From a61accf133982e7b3d690da9c4bc717d9d2b43aa Mon Sep 17 00:00:00 2001 From: filatov Date: Tue, 7 Feb 2017 16:20:41 +0000 Subject: [PATCH 002/320] TITANIZATION: remove 'mtc' and 'system' from function declaration --- ttcn/BTP/LibItsBtp_Functions.ttcn | 4 +- ttcn/CAM/LibItsCam_Functions.ttcn | 4 +- ttcn/DENM/LibItsDenm_Functions.ttcn | 4 +- .../LibItsGeoNetworking_Functions.ttcn | 42 +++++++++---------- ttcn/IVIM/LibItsIvim_Functions.ttcn | 4 +- ...LibItsIpv6OverGeoNetworking_Functions.ttcn | 4 +- .../LibItsMapemSpatem_Functions.ttcn | 4 +- ttcn/SremSsem/LibItsSremSsem_Functions.ttcn | 4 +- 8 files changed, 35 insertions(+), 35 deletions(-) diff --git a/ttcn/BTP/LibItsBtp_Functions.ttcn b/ttcn/BTP/LibItsBtp_Functions.ttcn index 581629d1..dac1f2cb 100644 --- a/ttcn/BTP/LibItsBtp_Functions.ttcn +++ b/ttcn/BTP/LibItsBtp_Functions.ttcn @@ -94,7 +94,7 @@ /** * @desc Setups default configuration */ - function f_cfUp() runs on ItsBtp system ItsBtpSystem { + function f_cfUp() runs on ItsBtp /* TITAN TODO: system ItsBtpSystem */ { map(self:utPort, system:utPort); map(self:btpPort, system:btpPort); @@ -105,7 +105,7 @@ /** * @desc Deletes default configuration */ - function f_cfDown() runs on ItsBtp system ItsBtpSystem { + function f_cfDown() runs on ItsBtp /* TITAN TODO: system ItsBtpSystem */ { unmap(self:utPort, system:utPort); unmap(self:btpPort, system:btpPort); diff --git a/ttcn/CAM/LibItsCam_Functions.ttcn b/ttcn/CAM/LibItsCam_Functions.ttcn index e5787f01..6e771b88 100644 --- a/ttcn/CAM/LibItsCam_Functions.ttcn +++ b/ttcn/CAM/LibItsCam_Functions.ttcn @@ -292,7 +292,7 @@ module LibItsCam_Functions { */ function f_cfUp( in charstring p_certificateId := PX_CERT_FOR_TS - ) runs on ItsCam system ItsCamSystem { + ) runs on ItsCam /* TITAN TODO: system ItsCamSystem */ { map(self:utPort, system:utPort); map(self:acPort, system:acPort); @@ -307,7 +307,7 @@ module LibItsCam_Functions { /** * @desc Deletes default configuration */ - function f_cfDown() runs on ItsCam system ItsCamSystem { + function f_cfDown() runs on ItsCam /* TITAN TODO: system ItsCamSystem */ { // Initialise secured mode f_uninitialiseSecuredMode(); diff --git a/ttcn/DENM/LibItsDenm_Functions.ttcn b/ttcn/DENM/LibItsDenm_Functions.ttcn index e94eddaf..0191c153 100644 --- a/ttcn/DENM/LibItsDenm_Functions.ttcn +++ b/ttcn/DENM/LibItsDenm_Functions.ttcn @@ -386,7 +386,7 @@ module LibItsDenm_Functions { */ function f_cfUp( in charstring p_certificateId := PX_CERT_FOR_TS - ) runs on ItsDenm system ItsDenmSystem { + ) runs on ItsDenm /* TITAN TODO: system ItsDenmSystem */ { map(self:acPort, system:acPort); map(self:utPort, system:utPort); @@ -401,7 +401,7 @@ module LibItsDenm_Functions { /** * @desc Deletes default configuration */ - function f_cfDown() runs on ItsDenm system ItsDenmSystem { + function f_cfDown() runs on ItsDenm /* TITAN TODO: system ItsDenmSystem */{ // Initialise secured mode f_uninitialiseSecuredMode(); diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn index 31bfb95d..2a2229df 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn @@ -154,7 +154,7 @@ module LibItsGeoNetworking_Functions { * - Area2 which only includes NodeB * NodeB being close to the area center */ - function f_cf01Up(Scenario p_scenario := e_staticPosition) runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + function f_cf01Up(Scenario p_scenario := e_staticPosition) runs on ItsGeoNetworking /* TITAN TODO: system ItsGeoNetworkingSystem */ { // Variables var PositionTable v_positionTable := {}; @@ -182,7 +182,7 @@ module LibItsGeoNetworking_Functions { } // end f_cf01Up - function f_cf01Down() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + function f_cf01Down() runs on ItsGeoNetworking /* TITAN TODO: system ItsGeoNetworkingSystem */ { f_uninitialiseSecuredMode(); @@ -207,7 +207,7 @@ module LibItsGeoNetworking_Functions { * * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages */ - function f_cf02Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + function f_cf02Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { // Variables var PositionTable v_positionTable := {}; @@ -270,7 +270,7 @@ module LibItsGeoNetworking_Functions { /** * @desc Deletes configuration cf02 */ - function f_cf02Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + function f_cf02Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { // Local variables var integer i; @@ -301,7 +301,7 @@ module LibItsGeoNetworking_Functions { * NodeB being close to the area center * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages */ - function f_cf03Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + function f_cf03Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { // Variables var PositionTable v_positionTable := {}; @@ -364,7 +364,7 @@ module LibItsGeoNetworking_Functions { /** * @desc Deletes configuration cf03 */ - function f_cf03Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + function f_cf03Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { // Local variables var integer i; @@ -397,7 +397,7 @@ module LibItsGeoNetworking_Functions { * NodeB being close to the area center * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages */ - function f_cf04Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + function f_cf04Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { // Variables var PositionTable v_positionTable := {}; @@ -460,7 +460,7 @@ module LibItsGeoNetworking_Functions { /** * @desc Deletes configuration cf04 */ - function f_cf04Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + function f_cf04Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */{ // Local variables var integer i; @@ -489,7 +489,7 @@ module LibItsGeoNetworking_Functions { * - Area1 which only includes NodeB, NodeD and IUT * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages */ - function f_cf05Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + function f_cf05Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { // Variables var PositionTable v_positionTable := {}; @@ -551,7 +551,7 @@ module LibItsGeoNetworking_Functions { /** * @desc Deletes configuration cf05 */ - function f_cf05Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + function f_cf05Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { // Local variables var integer i; @@ -581,7 +581,7 @@ module LibItsGeoNetworking_Functions { * - IUT not in sectorial area of NodeB-NodeF * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages */ - function f_cf06Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + function f_cf06Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { // Variables var PositionTable v_positionTable := {}; @@ -643,7 +643,7 @@ module LibItsGeoNetworking_Functions { /** * @desc Deletes configuration cf06 */ - function f_cf06Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + function f_cf06Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { // Local variables var integer i; @@ -672,7 +672,7 @@ module LibItsGeoNetworking_Functions { * - Area1 which only includes NodeB, NodeD and IUT * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages */ - function f_cf07Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + function f_cf07Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO mtc ItsMtc system ItsGeoNetworkingSystem */{ // Variables var PositionTable v_positionTable := {}; @@ -734,7 +734,7 @@ module LibItsGeoNetworking_Functions { /** * @desc Deletes configuration cf06 */ - function f_cf07Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + function f_cf07Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { // Local variables var integer i; @@ -1689,15 +1689,15 @@ module LibItsGeoNetworking_Functions { var GeoNetworkingInd v_msg; f_sendGeoNetMessage( - m_geoNwReq_linkLayerBroadcast( - m_geoNwPdu( - m_geoNwLsRequestPacket( - p_reqSrcPosVector, - p_reqSeqNumber, - p_gnAddress + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwLsRequestPacket( + p_reqSrcPosVector, + p_reqSeqNumber, + p_gnAddress + ) ) ) - ) ); tc_ac.start; diff --git a/ttcn/IVIM/LibItsIvim_Functions.ttcn b/ttcn/IVIM/LibItsIvim_Functions.ttcn index 306bb6f1..9b3e4519 100644 --- a/ttcn/IVIM/LibItsIvim_Functions.ttcn +++ b/ttcn/IVIM/LibItsIvim_Functions.ttcn @@ -243,7 +243,7 @@ module LibItsIvim_Functions { */ function f_cfUp( in charstring p_certificateId := PX_CERT_FOR_TS - ) runs on ItsIvim system ItsIvimSystem { + ) runs on ItsIvim /* TITAN TODO: system ItsIvimSystem */{ map(self:acPort, system:acPort); map(self:utPort, system:utPort); @@ -258,7 +258,7 @@ module LibItsIvim_Functions { /** * @desc Deletes default configuration */ - function f_cfDown() runs on ItsIvim system ItsIvimSystem { + function f_cfDown() runs on ItsIvim /* TITAN TODO: system ItsIvimSystem */{ // Initialise secured mode f_uninitialiseSecuredMode(); diff --git a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Functions.ttcn b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Functions.ttcn index 52717982..f2944b8c 100644 --- a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Functions.ttcn +++ b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Functions.ttcn @@ -38,7 +38,7 @@ module LibItsIpv6OverGeoNetworking_Functions { * - two ITS nodes (nodeA, nodeB) * - three GVLs */ - function f_cf01UpGn6() runs on ItsIpv6OverGeoNetworking system ItsIpv6OverGeoNetworkingSystem { + function f_cf01UpGn6() runs on ItsIpv6OverGeoNetworking /* TITAN TODO: system ItsIpv6OverGeoNetworkingSystem */ { // Variables var float v_distance; @@ -73,7 +73,7 @@ module LibItsIpv6OverGeoNetworking_Functions { /** * @desc Deletes configuration cf01Gn6 */ - function f_cf01DownGn6() runs on ItsIpv6OverGeoNetworking system ItsIpv6OverGeoNetworkingSystem { + function f_cf01DownGn6() runs on ItsIpv6OverGeoNetworking /* TITAN TODO: system ItsIpv6OverGeoNetworkingSystem */ { // Map unmap(self:ipv6OverGeoNetworkingPort, system:ipv6OverGeoNetworkingPort); diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn index c306793a..09372f06 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn @@ -225,7 +225,7 @@ module LibItsMapemSpatem_Functions { */ function f_cfUp( in charstring p_certificateId := PX_CERT_FOR_TS - ) runs on ItsMapemSpatem system ItsMapemSpatemSystem { + ) runs on ItsMapemSpatem /* TITAN TODO: system ItsMapemSpatemSystem */ { map(self:acPort, system:acPort); map(self:utPort, system:utPort); @@ -243,7 +243,7 @@ module LibItsMapemSpatem_Functions { /** * @desc Deletes default configuration */ - function f_cfDown() runs on ItsMapemSpatem system ItsMapemSpatemSystem { + function f_cfDown() runs on ItsMapemSpatem /* TITAN TODO: system ItsMapemSpatemSystem */ { // Initialise secured mode f_uninitialiseSecuredMode(); diff --git a/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn b/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn index fa27e33b..67f8b75a 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn @@ -258,7 +258,7 @@ module LibItsSremSsem_Functions { */ function f_cfUp( in charstring p_certificateId := PX_CERT_FOR_TS - ) runs on ItsSremSsem system ItsSremSsemSystem { + ) runs on ItsSremSsem /* TITAN TODO: system ItsSremSsemSystem */ { map(self:acPort, system:acPort); map(self:utPort, system:utPort); @@ -279,7 +279,7 @@ module LibItsSremSsem_Functions { /** * @desc Deletes default configuration */ - function f_cfDown() runs on ItsSremSsem system ItsSremSsemSystem { + function f_cfDown() runs on ItsSremSsem /* TITAN TODO: system ItsSremSsemSystem */ { // Initialise secured mode f_uninitialiseSecuredMode(); -- GitLab From 6dbc85d1c2298c199c63dfb858891322936cf540 Mon Sep 17 00:00:00 2001 From: filatov Date: Tue, 7 Feb 2017 17:20:16 +0000 Subject: [PATCH 003/320] TITANIZATION: Add EncdecDeclarations and other files. --- ttcn/BTP/LibItsBtp_EncdecDeclarations.ttcn | 13 + ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn | 21 ++ ttcn/CAM/LibItsCam_Functions.ttcn | 1 + ttcn/CAM/LibItsCam_Templates.ttcn | 1 + ttcn/CAM/LibItsCam_TestSystem.ttcn | 2 +- ...LibItsCommon_ASN1_ISDSRC_NamedNumbers.ttcn | 49 +++ .../LibItsCommon_ASN1_NamedNumbers1.ttcn | 298 ++++++++++++++++++ ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn | 16 + ...ibItsGeoNetworking_EncdecDeclarations.ttcn | 31 ++ .../LibItsGeoNetworking_Functions.ttcn | 1 + .../LibItsGeoNetworking_Templates.ttcn | 2 + .../IVIM/LibItsIvim_ASN1_IVInamedNumbers.ttcn | 17 + ttcn/IVIM/LibItsIvim_EncdecDeclarations.ttcn | 9 + ttcn/IVIM/LibItsIvim_Templates.ttcn | 2 + .../LibItsMapemSpatem_EncdecDeclarations.ttcn | 19 ++ .../LibItsMapemSpatem_Templates.ttcn | 2 + .../LibItsSecurity_EncdecDeclarations.ttcn | 31 ++ ttcn/Security/LibItsSecurity_Functions.ttcn3 | 1 + .../LibItsSremSsem_EncdecDeclarations.ttcn | 8 + ttcn/SremSsem/LibItsSremSsem_Templates.ttcn | 1 + 20 files changed, 524 insertions(+), 1 deletion(-) create mode 100644 ttcn/BTP/LibItsBtp_EncdecDeclarations.ttcn create mode 100644 ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn create mode 100644 ttcn/Common/LibItsCommon_ASN1_ISDSRC_NamedNumbers.ttcn create mode 100644 ttcn/Common/LibItsCommon_ASN1_NamedNumbers1.ttcn create mode 100644 ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn create mode 100644 ttcn/GeoNetworking/LibItsGeoNetworking_EncdecDeclarations.ttcn create mode 100644 ttcn/IVIM/LibItsIvim_ASN1_IVInamedNumbers.ttcn create mode 100644 ttcn/IVIM/LibItsIvim_EncdecDeclarations.ttcn create mode 100644 ttcn/MapemSpatem/LibItsMapemSpatem_EncdecDeclarations.ttcn create mode 100644 ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn create mode 100644 ttcn/SremSsem/LibItsSremSsem_EncdecDeclarations.ttcn diff --git a/ttcn/BTP/LibItsBtp_EncdecDeclarations.ttcn b/ttcn/BTP/LibItsBtp_EncdecDeclarations.ttcn new file mode 100644 index 00000000..a3366178 --- /dev/null +++ b/ttcn/BTP/LibItsBtp_EncdecDeclarations.ttcn @@ -0,0 +1,13 @@ +module LibItsBtp_EncdecDeclarations { + + // LibItsBtp + import from LibItsBtp_TypesAndValues all; + + external function fx_enc_BtpPayload (BtpPayload p) return bitstring + with {extension "prototype(convert) encode(LibItsBtp)"} + + /* TODO RGy function not implemented! (decvalue() not used by test suite @29-06-2016) + external function fx_dec_BtpPayload (inout bitstring b, out BtpPayload p) return integer + with {extension "prototype(sliding) decode(LibItsBtp)"} + */ +} // End of module LibItsBtp_EncdecDeclarations diff --git a/ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn b/ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn new file mode 100644 index 00000000..09265942 --- /dev/null +++ b/ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn @@ -0,0 +1,21 @@ +module LibItsCam_EncdecDeclarations { + + // LibIts + import from ITS_Container language "ASN.1:1997" all; + import from CAM_PDU_Descriptions language "ASN.1:1997" all; + import from DENM_PDU_Descriptions language "ASN.1:1997" all; + + // LibItsCam + import from LibItsCam_TestSystem all; + + external function fx_enc_CamReq (CamReq p) return bitstring + with {extension "prototype(convert) encode(LibIts_Interface)"} + + external function fx_enc_CAM (CAM p) return octetstring + with {extension "prototype(convert) encode(BER:BER_ENCODE_CER)"} + + /* TODO RGy function not implemented! (decvalue() not used by test suite @29-06-2016) + external function fx_dec_CamReq (inout bitstring b, out CamReq p) return integer + with {extension "prototype(sliding) decode(LibIts_Interface)"} + */ +} // End of module LibItsCam_EncdecDeclarations diff --git a/ttcn/CAM/LibItsCam_Functions.ttcn b/ttcn/CAM/LibItsCam_Functions.ttcn index 6e771b88..e44b8b30 100644 --- a/ttcn/CAM/LibItsCam_Functions.ttcn +++ b/ttcn/CAM/LibItsCam_Functions.ttcn @@ -33,6 +33,7 @@ module LibItsCam_Functions { import from LibItsCam_TypesAndValues all; import from LibItsCam_Pics all; import from LibItsCam_Pixits all; + import from LibItsCam_EncdecDeclarations all; group utFuntions { diff --git a/ttcn/CAM/LibItsCam_Templates.ttcn b/ttcn/CAM/LibItsCam_Templates.ttcn index 300bb0ca..018d52ed 100644 --- a/ttcn/CAM/LibItsCam_Templates.ttcn +++ b/ttcn/CAM/LibItsCam_Templates.ttcn @@ -23,6 +23,7 @@ module LibItsCam_Templates { // LibItsCommon import from LibItsCommon_Functions all; import from LibItsCommon_TypesAndValues all; + import from LibItsCommon_ASN1_NamedNumbers all; // LibItsCam import from LibItsCam_TestSystem all; diff --git a/ttcn/CAM/LibItsCam_TestSystem.ttcn b/ttcn/CAM/LibItsCam_TestSystem.ttcn index 71a351f0..01f8ca7b 100644 --- a/ttcn/CAM/LibItsCam_TestSystem.ttcn +++ b/ttcn/CAM/LibItsCam_TestSystem.ttcn @@ -157,4 +157,4 @@ module LibItsCam_TestSystem { encode "LibIts_Interface" } // end interfacePrimitives -} // End of module LibIts_TestSystem +} // End of module LibItsCam_TestSystem diff --git a/ttcn/Common/LibItsCommon_ASN1_ISDSRC_NamedNumbers.ttcn b/ttcn/Common/LibItsCommon_ASN1_ISDSRC_NamedNumbers.ttcn new file mode 100644 index 00000000..daf1a98c --- /dev/null +++ b/ttcn/Common/LibItsCommon_ASN1_ISDSRC_NamedNumbers.ttcn @@ -0,0 +1,49 @@ +//This module contains TTCN-3 values for ASN.1 named numbers, aligned with TTWorkbench name convention + +module LibItsCommon_ASN1_ISDSRC_NamedNumbers { + +import from IS_DSRC language "ASN.1:1997" all; + + group IS_DSCR_constants { + group LaneParameter_constants { + const LaneAttributes_Barrier LaneAttributes_Barrier_median_RevocableLane_ := '0000000000000000'B; + + const LaneAttributes_Bike LaneAttributes_Bike_bikeRevocableLane_ := '0000000000000000'B; + + const LaneAttributes_Crosswalk LaneAttributes_Crosswalk_crosswalkRevocableLane_ := '0000000000000000'B; + + const LaneAttributes_Parking LaneAttributes_Parking_parkingRevocableLane_ := '0000000000000000'B; + + const LaneAttributes_Sidewalk LaneAttributes_Sidewalk_sidewalk_RevocableLane_ := '0000000000000000'B; + + const LaneAttributes_Striping LaneAttributes_Striping_stripeToConnectingLanesRevocableLane_ := '0000000000000000'B; + + const LaneAttributes_TrackedVehicle LaneAttributes_TrackedVehicle_spec_RevocableLane_ := '0000000000000000'B; + + const LaneAttributes_Vehicle LaneAttributes_Vehicle_isVehicleRevocableLane_ := '00000000'B; + + const LaneDirection LaneDirection_ingressPath_ := '00'B; + const LaneDirection LaneDirection_egressPath_ := '01'B; + + } //end LaneParameter_constants + + group Intersection_constants { + const IntersectionStatusObject IntersectionStatusObject_manualControlIsEnabled_ := '0000000000000000'B; + const IntersectionStatusObject IntersectionStatusObject_stopTimeIsActivated_ := '0000000000000001'B; + const IntersectionStatusObject IntersectionStatusObject_failureFlash_ := '0000000000000010'B; + const IntersectionStatusObject IntersectionStatusObject_preemptIsActive_ := '0000000000000011'B; + const IntersectionStatusObject IntersectionStatusObject_signalPriorityIsActive_ := '0000000000000100'B; + const IntersectionStatusObject IntersectionStatusObject_fixedTimeOperation_ := '0000000000000101'B; + const IntersectionStatusObject IntersectionStatusObject_trafficDependentOperation_ := '0000000000000110'B; + const IntersectionStatusObject IntersectionStatusObject_standbyOperation_ := '0000000000000111'B; + const IntersectionStatusObject IntersectionStatusObject_failureMode_ := '0000000000001000'B; + const IntersectionStatusObject IntersectionStatusObject_off_ := '0000000000001001'B; + const IntersectionStatusObject IntersectionStatusObject_recentMAPmessageUpdate_ := '0000000000001010'B; + const IntersectionStatusObject IntersectionStatusObject_recentChangeInMAPassignedLanesIDsUsed_ := '0000000000001011'B; + const IntersectionStatusObject IntersectionStatusObject_noValidMAPisAvailableAtThisTime_ := '0000000000001100'B; + const IntersectionStatusObject IntersectionStatusObject_noValidSPATisAvailableAtThisTime_ := '0000000000001101'B; + + } //end Intersection_constants + } // end IS_DSCR_constants + +} // End of module LibItsCommon_ASN1_ISDSRC_NamedNumbers diff --git a/ttcn/Common/LibItsCommon_ASN1_NamedNumbers1.ttcn b/ttcn/Common/LibItsCommon_ASN1_NamedNumbers1.ttcn new file mode 100644 index 00000000..8ccbb257 --- /dev/null +++ b/ttcn/Common/LibItsCommon_ASN1_NamedNumbers1.ttcn @@ -0,0 +1,298 @@ +//This module contains TTCN-3 values for ASN.1 named numbers, aligned with TTWorkbench name convention + +module LibItsCommon_ASN1_NamedNumbers { + + import from ITS_Container language "ASN.1:2008" all; + + import from IVI language "ASN.1:1997" { + type IviStatus + } + + group commonConstants { + + const AccelerationConfidence AccelerationConfidence_pointOneMeterPerSecSquared_ := 1; + const AccelerationConfidence AccelerationConfidence_outOfRange_ := 101; + const AccelerationConfidence AccelerationConfidence_unavailable_ := 102; + + const AccelerationControl AccelerationControl_brakePedalEngaged_ := '0000000'B; + const AccelerationControl AccelerationControl_gasPedalEngaged_ := '0000001'B; + const AccelerationControl AccelerationControl_emergencyBrakeEngaged_ := '0000010'B; + const AccelerationControl AccelerationControl_collisionWarningEngaged_ := '0000011'B; + const AccelerationControl AccelerationControl_accEngaged_ := '0000100'B; + const AccelerationControl AccelerationControl_cruiseControlEngaged_ := '0000101'B; + const AccelerationControl AccelerationControl_speedLimiterEngaged_ := '0000110'B; + + const AltitudeValue AltitudeValue_referenceEllipsoidSurface_ := 0; + const AltitudeValue AltitudeValue_oneCentimeter_ := 1; + const AltitudeValue AltitudeValue_unavailable_ := 800001; + + const CurvatureValue CurvatureValue_straight_ := 0; + const CurvatureValue CurvatureValue_reciprocalOf1MeterRadiusToRight_ := -30000; + const CurvatureValue CurvatureValue_reciprocalOf1MeterRadiusToLeft_ := 30000; + const CurvatureValue CurvatureValue_unavailable_ := 30001; + + const ExteriorLights ExteriorLights_lowBeamHeadlightsOn_ := '00000000'B; + const ExteriorLights ExteriorLights_highBeamHeadlightsOn_ := '01000000'B; + const ExteriorLights ExteriorLights_leftTurnSignalOn_ := '00100000'B; + const ExteriorLights ExteriorLights_rightTurnSignalOn_ := '00010000'B; + const ExteriorLights ExteriorLights_daytimeRunningLightsOn_ := '00001000'B; + const ExteriorLights ExteriorLights_reverseLightOn_ := '00000100'B; + const ExteriorLights ExteriorLights_fogLightOn_ := '00000010'B; + const ExteriorLights ExteriorLights_parkingLightsOn_ := '00000001'B; + + const HeadingConfidence HeadingConfidence_withinZeroPointOneDegree_ := 1; + + const HeadingValue HeadingValue_wgs84North_ := 0; + + const ItsPduHeader.protocolVersion ItsPduHeader_protocolVersion_currentVersion_ := 1; + const ItsPduHeader.messageID ItsPduHeader_messageID_denm_ := 1; + const ItsPduHeader.messageID ItsPduHeader_messageID_cam_ := 2; + const ItsPduHeader.messageID ItsPduHeader_messageID_poi_ := 3; + const ItsPduHeader.messageID ItsPduHeader_messageID_spatem_ := 4; + const ItsPduHeader.messageID ItsPduHeader_messageID_mapem_ := 5; + const ItsPduHeader.messageID ItsPduHeader_messageID_ivim_ := 6; + const ItsPduHeader.messageID ItsPduHeader_messageID_ev_rsr_ := 7; + const ItsPduHeader.messageID ItsPduHeader_messageID_tistpgtransaction_ := 8; + const ItsPduHeader.messageID ItsPduHeader_messageID_srem_ := 9; + const ItsPduHeader.messageID ItsPduHeader_messageID_ssem_ := 10; + const ItsPduHeader.messageID ItsPduHeader_messageID_evcsn_ := 11; + + const LongitudinalAccelerationValue LongitudinalAccelerationValue_unavailable_ := 161; + + const SemiAxisLength SemiAxisLength_oneCentimeter_ := 1; + const SemiAxisLength SemiAxisLength_outOfRange_ := 4094; + const SemiAxisLength SemiAxisLength_unavailable_ := 4095; + + const StationType StationType_unknown_ := 0; + const StationType StationType_pedestrian_ := 1; + const StationType StationType_cyclist_ := 2; + const StationType StationType_moped_ := 3; + const StationType StationType_motorcycle_ := 4; + const StationType StationType_passengerCar_ := 5; + const StationType StationType_bus_ := 6; + const StationType StationType_lightTruck_ := 7; + const StationType StationType_heavyTruck_ := 8; + const StationType StationType_trailer_ := 9; + const StationType StationType_specialVehicles_ := 10; + const StationType StationType_tram_ := 11; + const StationType StationType_roadSideUnit_ := 15; + + const YawRateValue YawRateValue_straight_ := 0; + + group causeCodes { + const CauseCodeType CauseCodeType_reserved_ := 0; + const CauseCodeType CauseCodeType_trafficCondition_ := 1; + const CauseCodeType CauseCodeType_accident_ := 2; + const CauseCodeType CauseCodeType_roadworks_ := 3; + const CauseCodeType CauseCodeType_adverseWeatherCondition_Adhesion_ := 6; + const CauseCodeType CauseCodeType_hazardousLocation_SurfaceCondition_ := 9; + const CauseCodeType CauseCodeType_hazardousLocation_ObstacleOnTheRoad_ := 10; + const CauseCodeType CauseCodeType_hazardousLocation_AnimalOnTheRoad_ := 11; + const CauseCodeType CauseCodeType_humanPresenceOnTheRoad_ := 12; + const CauseCodeType CauseCodeType_wrongWayDriving_ := 14; + const CauseCodeType CauseCodeType_rescueAndRecoveryWorkInProgress_ := 15; + const CauseCodeType CauseCodeType_adverseWeatherCondition_ExtremeWeatherCondition_ := 17; + const CauseCodeType CauseCodeType_adverseWeatherCondition_Visibility_ := 18; + const CauseCodeType CauseCodeType_adverseWeatherCondition_Precipitation_ := 19; + const CauseCodeType CauseCodeType_slowVehicle_ := 26; + const CauseCodeType CauseCodeType_dangerousEndOfQueue_ := 27; + const CauseCodeType CauseCodeType_vehicleBreakdown_ := 91; + const CauseCodeType CauseCodeType_postCrash_ := 92; + const CauseCodeType CauseCodeType_humanProblem_ := 93; + const CauseCodeType CauseCodeType_stationaryVehicle_ := 94; + const CauseCodeType CauseCodeType_emergencyVehicleApproaching_ := 95; + const CauseCodeType CauseCodeType_hazardousLocation_DangerousCurve_ := 96; + const CauseCodeType CauseCodeType_collisionRisk_ := 97; + const CauseCodeType CauseCodeType_signalViolation_ := 98; + const CauseCodeType CauseCodeType_dangerousSituation_ := 99; + + } // end group causeCodes + + group subCauseCodes { + + const SubCauseCodeType SubCauseCodeType_unavailable_ := 0; + + const TrafficConditionSubCauseCode TrafficConditionSubCauseCode_unavailable_ := 0; + const TrafficConditionSubCauseCode TrafficConditionSubCauseCode_increasedVolumeOfTraffic_ := 1; + const TrafficConditionSubCauseCode TrafficConditionSubCauseCode_trafficJamSlowlyIncreasing_ := 2; + const TrafficConditionSubCauseCode TrafficConditionSubCauseCode_trafficJamIncreasing_ := 3; + const TrafficConditionSubCauseCode TrafficConditionSubCauseCode_trafficJamStronglyIncreasing_ := 4; + const TrafficConditionSubCauseCode TrafficConditionSubCauseCode_trafficStationary_ := 5; + const TrafficConditionSubCauseCode TrafficConditionSubCauseCode_trafficJamSlightlyDecreasing_ := 6; + const TrafficConditionSubCauseCode TrafficConditionSubCauseCode_trafficJamDecreasing_ := 7; + const TrafficConditionSubCauseCode TrafficConditionSubCauseCode_trafficJamStronglyDecreasing_ := 8; + + const AccidentSubCauseCode AccidentSubCauseCode_unavailable_ := 0; + const AccidentSubCauseCode AccidentSubCauseCode_multiVehicleAccident_ := 1; + const AccidentSubCauseCode AccidentSubCauseCode_heavyAccident_ := 2; + const AccidentSubCauseCode AccidentSubCauseCode_accidentInvolvingLorry_ := 3; + const AccidentSubCauseCode AccidentSubCauseCode_accidentInvolvingBus_ := 4; + const AccidentSubCauseCode AccidentSubCauseCode_accidentInvolvingHazardousMaterials_ := 5; + const AccidentSubCauseCode AccidentSubCauseCode_accidentOnOppositeLane_ := 6; + const AccidentSubCauseCode AccidentSubCauseCode_unsecuredAccident_ := 7; + const AccidentSubCauseCode AccidentSubCauseCode_assistanceRequested_ := 8; + + const RoadworksSubCauseCode RoadworksSubCauseCode_unavailable_ := 0; + const RoadworksSubCauseCode RoadworksSubCauseCode_majorRoadworks_ := 1; + const RoadworksSubCauseCode RoadworksSubCauseCode_roadMarkingWork_ := 2; + const RoadworksSubCauseCode RoadworksSubCauseCode_slowMovingRoadMaintenance_ := 3; + const RoadworksSubCauseCode RoadworksSubCauseCode_shortTermStationaryRoadworks_ := 4; + const RoadworksSubCauseCode RoadworksSubCauseCode_streetCleaning_ := 5; + const RoadworksSubCauseCode RoadworksSubCauseCode_winterService_ := 6; + + const HumanPresenceOnTheRoadSubCauseCode HumanPresenceOnTheRoadSubCauseCode_unavailable_ := 0; + const HumanPresenceOnTheRoadSubCauseCode HumanPresenceOnTheRoadSubCauseCode_childrenOnRoadway_ := 1; + const HumanPresenceOnTheRoadSubCauseCode HumanPresenceOnTheRoadSubCauseCode_cyclistOnRoadway_ := 2; + const HumanPresenceOnTheRoadSubCauseCode HumanPresenceOnTheRoadSubCauseCode_motorcyclistOnRoadway_ := 3; + + const WrongWayDrivingSubCauseCode WrongWayDrivingSubCauseCode_unavailable_ := 0; + const WrongWayDrivingSubCauseCode WrongWayDrivingSubCauseCode_wrongLane_ := 1; + const WrongWayDrivingSubCauseCode WrongWayDrivingSubCauseCode_wrongDirection_ := 2; + + const AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode_unavailable_ := 0; + const AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode_strongWinds_ := 1; + const AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode_damagingHail_ := 2; + const AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode_hurricane_ := 3; + const AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode_thunderstorm_ := 4; + const AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode_tornado_ := 5; + const AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode_blizzard_ := 6; + + const AdverseWeatherCondition_AdhesionSubCauseCode AdverseWeatherCondition_AdhesionSubCauseCode_unavailable_ := 0; + const AdverseWeatherCondition_AdhesionSubCauseCode AdverseWeatherCondition_AdhesionSubCauseCode_heavyFrostOnRoad_ := 1; + const AdverseWeatherCondition_AdhesionSubCauseCode AdverseWeatherCondition_AdhesionSubCauseCode_fuelOnRoad_ := 2; + const AdverseWeatherCondition_AdhesionSubCauseCode AdverseWeatherCondition_AdhesionSubCauseCode_mudOnRoad_ := 3; + const AdverseWeatherCondition_AdhesionSubCauseCode AdverseWeatherCondition_AdhesionSubCauseCode_snowOnRoad_ := 4; + const AdverseWeatherCondition_AdhesionSubCauseCode AdverseWeatherCondition_AdhesionSubCauseCode_iceOnRoad_ := 5; + const AdverseWeatherCondition_AdhesionSubCauseCode AdverseWeatherCondition_AdhesionSubCauseCode_blackIceOnRoad_ := 6; + const AdverseWeatherCondition_AdhesionSubCauseCode AdverseWeatherCondition_AdhesionSubCauseCode_oilOnRoad_ := 7; + const AdverseWeatherCondition_AdhesionSubCauseCode AdverseWeatherCondition_AdhesionSubCauseCode_looseChippings_ := 8; + const AdverseWeatherCondition_AdhesionSubCauseCode AdverseWeatherCondition_AdhesionSubCauseCode_instantBlackIce_ := 9; + const AdverseWeatherCondition_AdhesionSubCauseCode AdverseWeatherCondition_AdhesionSubCauseCode_roadsSalted_ := 10; + + const AdverseWeatherCondition_VisibilitySubCauseCode AdverseWeatherCondition_VisibilitySubCauseCode_unavailable_ := 0; + const AdverseWeatherCondition_VisibilitySubCauseCode AdverseWeatherCondition_VisibilitySubCauseCode_fog_ := 1; + const AdverseWeatherCondition_VisibilitySubCauseCode AdverseWeatherCondition_VisibilitySubCauseCode_smoke_ := 2; + const AdverseWeatherCondition_VisibilitySubCauseCode AdverseWeatherCondition_VisibilitySubCauseCode_heavySnowfall_ := 3; + const AdverseWeatherCondition_VisibilitySubCauseCode AdverseWeatherCondition_VisibilitySubCauseCode_heavyRain_ := 4; + const AdverseWeatherCondition_VisibilitySubCauseCode AdverseWeatherCondition_VisibilitySubCauseCode_heavyHail_ := 5; + const AdverseWeatherCondition_VisibilitySubCauseCode AdverseWeatherCondition_VisibilitySubCauseCode_lowSunGlare_ := 6; + const AdverseWeatherCondition_VisibilitySubCauseCode AdverseWeatherCondition_VisibilitySubCauseCode_sandstorms_ := 7; + const AdverseWeatherCondition_VisibilitySubCauseCode AdverseWeatherCondition_VisibilitySubCauseCode_swarmsOfInsects_ := 8; + + const AdverseWeatherCondition_PrecipitationSubCauseCode AdverseWeatherCondition_PrecipitationSubCauseCode_unavailable_ := 0; + const AdverseWeatherCondition_PrecipitationSubCauseCode AdverseWeatherCondition_PrecipitationSubCauseCode_heavyRain_ := 1; + const AdverseWeatherCondition_PrecipitationSubCauseCode AdverseWeatherCondition_PrecipitationSubCauseCode_heavySnowfall_ := 2; + const AdverseWeatherCondition_PrecipitationSubCauseCode AdverseWeatherCondition_PrecipitationSubCauseCode_softHail_ := 3; + + const SlowVehicleSubCauseCode SlowVehicleSubCauseCode_unavailable_ := 0; + const SlowVehicleSubCauseCode SlowVehicleSubCauseCode_maintenanceVehicle_ := 1; + const SlowVehicleSubCauseCode SlowVehicleSubCauseCode_vehiclesSlowingToLookAtAccident_ := 2; + const SlowVehicleSubCauseCode SlowVehicleSubCauseCode_abnormalLoad_ := 3; + const SlowVehicleSubCauseCode SlowVehicleSubCauseCode_abnormalWideLoad_ := 4; + const SlowVehicleSubCauseCode SlowVehicleSubCauseCode_convoy_ := 5; + const SlowVehicleSubCauseCode SlowVehicleSubCauseCode_snowplough_ := 6; + const SlowVehicleSubCauseCode SlowVehicleSubCauseCode_deicing_ := 7; + const SlowVehicleSubCauseCode SlowVehicleSubCauseCode_saltingVehicles_ := 8; + + const StationaryVehicleSubCauseCode StationaryVehicleSubCauseCode_unavailable_ := 0; + const StationaryVehicleSubCauseCode StationaryVehicleSubCauseCode_humanProblem_ := 1; + const StationaryVehicleSubCauseCode StationaryVehicleSubCauseCode_vehicleBreakdown_ := 2; + const StationaryVehicleSubCauseCode StationaryVehicleSubCauseCode_postCrash_ := 3; + const StationaryVehicleSubCauseCode StationaryVehicleSubCauseCode_publicTransportStop_ := 4; + const StationaryVehicleSubCauseCode StationaryVehicleSubCauseCode_carryingDangerousGoods_ := 5; + + const HumanProblemSubCauseCode HumanProblemSubCauseCode_unavailable_ := 0; + const HumanProblemSubCauseCode HumanProblemSubCauseCode_glycemiaProblem_ := 1; + const HumanProblemSubCauseCode HumanProblemSubCauseCode_heartProblem_ := 2; + + const EmergencyVehicleApproachingSubCauseCode EmergencyVehicleApproachingSubCauseCode_unavailable_ := 0; + const EmergencyVehicleApproachingSubCauseCode EmergencyVehicleApproachingSubCauseCode_emergencyVehicleApproaching_ := 1; + const EmergencyVehicleApproachingSubCauseCode EmergencyVehicleApproachingSubCauseCode_prioritizedVehicleApproaching_ := 2; + + const HazardousLocation_DangerousCurveSubCauseCode HazardousLocation_DangerousCurveSubCauseCode_unavailable_ := 0; + const HazardousLocation_DangerousCurveSubCauseCode HazardousLocation_DangerousCurveSubCauseCode_dangerousLeftTurnCurve_ := 1; + const HazardousLocation_DangerousCurveSubCauseCode HazardousLocation_DangerousCurveSubCauseCode_dangerousRightTurnCurve_ := 2; + const HazardousLocation_DangerousCurveSubCauseCode HazardousLocation_DangerousCurveSubCauseCode_multipleCurvesStartingWithUnknownTurningDirection_ := 3; + const HazardousLocation_DangerousCurveSubCauseCode HazardousLocation_DangerousCurveSubCauseCode_multipleCurvesStartingWithLeftTurn_ := 4; + const HazardousLocation_DangerousCurveSubCauseCode HazardousLocation_DangerousCurveSubCauseCode_multipleCurvesStartingWithRightTurn_ := 5; + + const HazardousLocation_SurfaceConditionSubCauseCode HazardousLocation_SurfaceConditionSubCauseCode_unavailable_ := 0; + const HazardousLocation_SurfaceConditionSubCauseCode HazardousLocation_SurfaceConditionSubCauseCode_rockfalls_ := 1; + const HazardousLocation_SurfaceConditionSubCauseCode HazardousLocation_SurfaceConditionSubCauseCode_earthquakeDamage_ := 2; + const HazardousLocation_SurfaceConditionSubCauseCode HazardousLocation_SurfaceConditionSubCauseCode_sewerCollapse_ := 3; + const HazardousLocation_SurfaceConditionSubCauseCode HazardousLocation_SurfaceConditionSubCauseCode_subsidence_ := 4; + const HazardousLocation_SurfaceConditionSubCauseCode HazardousLocation_SurfaceConditionSubCauseCode_snowDrifts_ := 5; + const HazardousLocation_SurfaceConditionSubCauseCode HazardousLocation_SurfaceConditionSubCauseCode_stormDamage_ := 6; + const HazardousLocation_SurfaceConditionSubCauseCode HazardousLocation_SurfaceConditionSubCauseCode_burstPipe_ := 7; + const HazardousLocation_SurfaceConditionSubCauseCode HazardousLocation_SurfaceConditionSubCauseCode_volcanoEruption_ := 8; + const HazardousLocation_SurfaceConditionSubCauseCode HazardousLocation_SurfaceConditionSubCauseCode_fallingIce_ := 9; + + const HazardousLocation_ObstacleOnTheRoadSubCauseCode HazardousLocation_ObstacleOnTheRoadSubCauseCode_unavailable_ := 0; + const HazardousLocation_ObstacleOnTheRoadSubCauseCode HazardousLocation_ObstacleOnTheRoadSubCauseCode_shedLoad_ := 1; + const HazardousLocation_ObstacleOnTheRoadSubCauseCode HazardousLocation_ObstacleOnTheRoadSubCauseCode_partsOfVehicles_ := 2; + const HazardousLocation_ObstacleOnTheRoadSubCauseCode HazardousLocation_ObstacleOnTheRoadSubCauseCode_partsOfTyres_ := 3; + const HazardousLocation_ObstacleOnTheRoadSubCauseCode HazardousLocation_ObstacleOnTheRoadSubCauseCode_bigObjects_ := 4; + const HazardousLocation_ObstacleOnTheRoadSubCauseCode HazardousLocation_ObstacleOnTheRoadSubCauseCode_fallenTrees_ := 5; + const HazardousLocation_ObstacleOnTheRoadSubCauseCode HazardousLocation_ObstacleOnTheRoadSubCauseCode_hubCaps_ := 6; + const HazardousLocation_ObstacleOnTheRoadSubCauseCode HazardousLocation_ObstacleOnTheRoadSubCauseCode_waitingVehicles_ := 7; + + const HazardousLocation_AnimalOnTheRoadSubCauseCode HazardousLocation_AnimalOnTheRoadSubCauseCode_unavailable_ := 0; + const HazardousLocation_AnimalOnTheRoadSubCauseCode HazardousLocation_AnimalOnTheRoadSubCauseCode_wildAnimals_ := 1; + const HazardousLocation_AnimalOnTheRoadSubCauseCode HazardousLocation_AnimalOnTheRoadSubCauseCode_herdOfAnimals_ := 2; + const HazardousLocation_AnimalOnTheRoadSubCauseCode HazardousLocation_AnimalOnTheRoadSubCauseCode_smallAnimals_ := 3; + const HazardousLocation_AnimalOnTheRoadSubCauseCode HazardousLocation_AnimalOnTheRoadSubCauseCode_largeAnimals_ := 4; + + const CollisionRiskSubCauseCode CollisionRiskSubCauseCode_unavailable_ := 0; + const CollisionRiskSubCauseCode CollisionRiskSubCauseCode_longitudinalCollisionRisk_ := 1; + const CollisionRiskSubCauseCode CollisionRiskSubCauseCode_crossingCollisionRisk_ := 2; + const CollisionRiskSubCauseCode CollisionRiskSubCauseCode_lateralCollisionRisk_ := 3; + const CollisionRiskSubCauseCode CollisionRiskSubCauseCode_vulnerableRoadUser_ := 4; + + const SignalViolationSubCauseCode SignalViolationSubCauseCode_unavailable_ := 0; + const SignalViolationSubCauseCode SignalViolationSubCauseCode_stopSignViolation_ := 1; + const SignalViolationSubCauseCode SignalViolationSubCauseCode_trafficLightViolation_ := 2; + const SignalViolationSubCauseCode SignalViolationSubCauseCode_turningRegulationViolation_ := 3; + + const RescueAndRecoveryWorkInProgressSubCauseCode RescueAndRecoveryWorkInProgressSubCauseCode_unavailable_ := 0; + const RescueAndRecoveryWorkInProgressSubCauseCode RescueAndRecoveryWorkInProgressSubCauseCode_emergencyVehicles_ := 1; + const RescueAndRecoveryWorkInProgressSubCauseCode RescueAndRecoveryWorkInProgressSubCauseCode_rescueHelicopterLanding_ := 2; + const RescueAndRecoveryWorkInProgressSubCauseCode RescueAndRecoveryWorkInProgressSubCauseCode_policeActivityOngoing_ := 3; + const RescueAndRecoveryWorkInProgressSubCauseCode RescueAndRecoveryWorkInProgressSubCauseCode_medicalEmergencyOngoing_ := 4; + const RescueAndRecoveryWorkInProgressSubCauseCode RescueAndRecoveryWorkInProgressSubCauseCode_childAbductionInProgress_ := 5; + + const DangerousEndOfQueueSubCauseCode DangerousEndOfQueueSubCauseCode_unavailable_ := 0; + const DangerousEndOfQueueSubCauseCode DangerousEndOfQueueSubCauseCode_suddenEndOfQueue_ := 1; + const DangerousEndOfQueueSubCauseCode DangerousEndOfQueueSubCauseCode_queueOverHill_ := 2; + const DangerousEndOfQueueSubCauseCode DangerousEndOfQueueSubCauseCode_queueAroundBend_ := 3; + const DangerousEndOfQueueSubCauseCode DangerousEndOfQueueSubCauseCode_queueInTunnel_ := 4; + + const DangerousSituationSubCauseCode DangerousSituationSubCauseCode_unavailable_ := 0; + const DangerousSituationSubCauseCode DangerousSituationSubCauseCode_emergencyElectronicBrakeEngaged_ := 1; + const DangerousSituationSubCauseCode DangerousSituationSubCauseCode_preCrashSystemEngaged_ := 2; + const DangerousSituationSubCauseCode DangerousSituationSubCauseCode_espEngaged_ := 3; + const DangerousSituationSubCauseCode DangerousSituationSubCauseCode_absEngaged_ := 4; + const DangerousSituationSubCauseCode DangerousSituationSubCauseCode_aebEngaged_ := 5; + const DangerousSituationSubCauseCode DangerousSituationSubCauseCode_brakeWarningEngaged_ := 6; + const DangerousSituationSubCauseCode DangerousSituationSubCauseCode_collisionRiskWarningEngaged_ := 7; + + const VehicleBreakdownSubCauseCode VehicleBreakdownSubCauseCode_unavailable_ := 0; + const VehicleBreakdownSubCauseCode VehicleBreakdownSubCauseCode_lackOfFuel_ := 1; + const VehicleBreakdownSubCauseCode VehicleBreakdownSubCauseCode_lackOfBatteryPower_ := 2; + const VehicleBreakdownSubCauseCode VehicleBreakdownSubCauseCode_engineProblem_ := 3; + const VehicleBreakdownSubCauseCode VehicleBreakdownSubCauseCode_transmissionProblem_ := 4; + const VehicleBreakdownSubCauseCode VehicleBreakdownSubCauseCode_engineCoolingProblem_ := 5; + const VehicleBreakdownSubCauseCode VehicleBreakdownSubCauseCode_brakingSystemProblem_ := 6; + const VehicleBreakdownSubCauseCode VehicleBreakdownSubCauseCode_steeringProblem_ := 7; + const VehicleBreakdownSubCauseCode VehicleBreakdownSubCauseCode_tyrePuncture_ := 8; + + const PostCrashSubCauseCode PostCrashSubCauseCode_unavailable_ := 0; + const PostCrashSubCauseCode PostCrashSubCauseCode_accidentWithoutECallTriggered_ := 1; + const PostCrashSubCauseCode PostCrashSubCauseCode_accidentWithECallManuallyTriggered_ := 2; + const PostCrashSubCauseCode PostCrashSubCauseCode_accidentWithECallAutomaticallyTriggered_ := 3; + const PostCrashSubCauseCode PostCrashSubCauseCode_accidentWithECallTriggeredWithoutAccessToCellularNetwork_ := 4; + + } // End of group subCauseCodes + + } // End of group commonConstants + +} // End of module LibIts_ASN1_NamedNumbers diff --git a/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn b/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn new file mode 100644 index 00000000..c1910b55 --- /dev/null +++ b/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn @@ -0,0 +1,16 @@ +module LibItsDenm_EncdecDeclarations { + + import from LibItsDenm_TestSystem all; + import from DENM_PDU_Descriptions language "ASN.1:1997" all; + + external function fx_enc_DenmReq (DenmReq p) return bitstring + with {extension "prototype(convert) encode(LibIts_Interface)"} + + external function fx_enc_DENM (DENM p) return octetstring + with {extension "prototype(convert) encode(BER:BER_ENCODE_CER)"} + + /* not needed yet, no decvalue is used in TTCN-3 code + external function fx_dec_DenmReq (inout bitstring b, out DenmReq p) return integer + with {extension "prototype(sliding) decode(LibIts_Interface)"} + */ +} // End of module LibItsDenm_EncdecDeclarations diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_EncdecDeclarations.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_EncdecDeclarations.ttcn new file mode 100644 index 00000000..ecfefbdf --- /dev/null +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_EncdecDeclarations.ttcn @@ -0,0 +1,31 @@ +module LibItsGeoNetworking_EncdecDeclarations { + + import from LibItsGeoNetworking_TypesAndValues all; + + external function fx_enc_GeoNetworkingPdu (GeoNetworkingPdu p) return bitstring + with {extension "prototype(convert) encode(LibItsGeoNetworking)"} + + external function fx_dec_GeoNetworkingPdu (inout bitstring b, out GeoNetworkingPdu p) return integer + with {extension "prototype(sliding) decode(LibItsGeoNetworking)"} + + external function fx_enc_Payload (Payload p) return bitstring + with {extension "prototype(convert) encode(LibItsGeoNetworking)"} + + external function fx_dec_Payload (inout bitstring b, out Payload p) return integer + with {extension "prototype(sliding) decode(LibItsGeoNetworking)"} + + external function fx_enc_GnNonSecuredPacket (GnNonSecuredPacket p) return bitstring + with {extension "prototype(convert) encode(LibItsGeoNetworking)"} + + external function fx_dec_GnNonSecuredPacket (inout bitstring b, out GnNonSecuredPacket p) return integer + with {extension "prototype(sliding) decode(LibItsGeoNetworking)"} + + /* + external function fx_enc_GeoSecuredMessage (GeoNetworkingPacket.securedMsg p) return bitstring + with {extension "prototype(convert) encode(LibItsSecurity)"} + + external function fx_dec_GeoSecuredMessage (inout bitstring b, out GeoNetworkingPacket.securedMsg p) return integer + with {extension "prototype(sliding) decode(LibItsSecurity)"} + */ + +} // End of module LibItsGeoNetworking_EncdecDeclarations diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn index 2a2229df..c28b6857 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn @@ -38,6 +38,7 @@ module LibItsGeoNetworking_Functions { import from LibItsGeoNetworking_Templates all; import from LibItsGeoNetworking_Pixits all; import from LibItsGeoNetworking_Pics all; + import from LibItsGeoNetworking_EncdecDeclarations all; group utFuntions { diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn index 82c039de..64c1dc32 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn @@ -21,6 +21,7 @@ module LibItsGeoNetworking_Templates { // LibItsBtp import from LibItsBtp_Templates all; + import from LibItsBtp_EncdecDeclarations all; // LibItsSecurity import from LibItsSecurity_TypesAndValues all; @@ -34,6 +35,7 @@ module LibItsGeoNetworking_Templates { import from LibItsGeoNetworking_TestSystem all; import from LibItsGeoNetworking_TypesAndValues all; import from LibItsGeoNetworking_Pixits all; + import from LibItsGeoNetworking_EncdecDeclarations all; group geoNwPrimitivesTemplates { diff --git a/ttcn/IVIM/LibItsIvim_ASN1_IVInamedNumbers.ttcn b/ttcn/IVIM/LibItsIvim_ASN1_IVInamedNumbers.ttcn new file mode 100644 index 00000000..86cea969 --- /dev/null +++ b/ttcn/IVIM/LibItsIvim_ASN1_IVInamedNumbers.ttcn @@ -0,0 +1,17 @@ +//This module contains TTCN-3 values for ASN.1 named numbers, aligned with TTWorkbench name convention + +module LibItsIvim_ASN1_IVInamedNumbers { + +import from IVI language "ASN.1:1997" all; + + group IVI_constants { + + const IviStatus IviStatus_new_ := 0; + const IviStatus IviStatus_update_ := 1; + const IviStatus IviStatus_cancellation_ := 2; + const IviStatus IviStatus_negation_ := 3; + + + } // end IVI_constants + +} // End of module LibItsIvim_ASN1_IVInamedNumbers diff --git a/ttcn/IVIM/LibItsIvim_EncdecDeclarations.ttcn b/ttcn/IVIM/LibItsIvim_EncdecDeclarations.ttcn new file mode 100644 index 00000000..427068a3 --- /dev/null +++ b/ttcn/IVIM/LibItsIvim_EncdecDeclarations.ttcn @@ -0,0 +1,9 @@ +module LibItsIvim_EncdecDeclarations { + + // LibIts + import from IVIM_PDU_Descriptions all; + + external function fx_enc_IVIM (IVIM p) return octetstring + with {extension "prototype(convert) encode(BER:BER_ENCODE_CER)"} + +} diff --git a/ttcn/IVIM/LibItsIvim_Templates.ttcn b/ttcn/IVIM/LibItsIvim_Templates.ttcn index 60dfb432..eb02a286 100644 --- a/ttcn/IVIM/LibItsIvim_Templates.ttcn +++ b/ttcn/IVIM/LibItsIvim_Templates.ttcn @@ -26,11 +26,13 @@ module LibItsIvim_Templates { import from LibItsCommon_TypesAndValues all; import from LibItsCommon_Functions all; import from LibItsCommon_Pixits all; + import from LibItsCommon_ASN1_NamedNumbers all; // LibItsIvim import from LibItsIvim_TestSystem all; import from LibItsIvim_TypesAndValues all; import from LibItsIvim_Functions all; + import from LibItsIvim_ASN1_IVInamedNumbers all; group asn1Constants { } // End of group asn1Constants diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_EncdecDeclarations.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_EncdecDeclarations.ttcn new file mode 100644 index 00000000..c2e0861c --- /dev/null +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_EncdecDeclarations.ttcn @@ -0,0 +1,19 @@ +module LibItsMapemSpatem_EncdecDeclarations { + + // LibIts + import from MAPEM_PDU_Descriptions all; + import from SPATEM_PDU_Descriptions all; + + external function fx_enc_MAPEM (MAPEM pdu) return octetstring + with {extension "prototype(convert) encode(BER:BER_ENCODE_CER)"} + + external function fx_dec_MAPEM (octetstring stream) return MAPEM + with {extension "prototype(convert) decode(BER:BER_ACCEPT_ALL)"} + + external function fx_enc_SPATEM (SPATEM pdu) return octetstring + with {extension "prototype(convert) encode(BER:BER_ENCODE_CER)"} + + external function fx_dec_SPATEM (octetstring stream) return SPATEM + with {extension "prototype(convert) decode(BER:BER_ACCEPT_ALL)"} + +} // End of module LibItsMapemSpatem_EncdecDeclarations diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn index eac85ed6..9471f393 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn @@ -24,6 +24,8 @@ module LibItsMapemSpatem_Templates { // LibItsCommon import from LibItsCommon_Functions all; import from LibItsCommon_TypesAndValues all; + import from LibItsCommon_ASN1_NamedNumbers all; + import from LibItsCommon_ASN1_ISDSRC_NamedNumbers all; // LibItsMapemSpatem import from LibItsMapemSpatem_TestSystem all; diff --git a/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn b/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn new file mode 100644 index 00000000..97081288 --- /dev/null +++ b/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn @@ -0,0 +1,31 @@ +module LibItsSecurity_EncdecDeclarations { + + import from LibItsSecurity_TypesAndValues all; + + //encoding functions + external function fx_enc_SecuredMessage (SecuredMessage p) return bitstring + with {extension "prototype(convert) encode(LibItsSecurity)"} + + external function fx_enc_ToBeSignedSecuredMessage (ToBeSignedSecuredMessage p) return bitstring + with {extension "prototype(convert) encode(LibItsSecurity)"} + + external function fx_enc_Certificate (Certificate p) return bitstring + with {extension "prototype(convert) encode(LibItsSecurity)"} + + external function fx_enc_ToBeSignedCertificate (ToBeSignedCertificate p) return bitstring + with {extension "prototype(convert) encode(LibItsSecurity)"} + /* + //decoding functions + external function fx_dec_SecuredMessage (inout bitstring b, out SecuredMessage p) return integer + with {extension "prototype(sliding) decode(LibItsSecurity)"} + + external function fx_dec_ToBeSignedSecuredMessage (inout bitstring b, out ToBeSignedSecuredMessage p) return integer + with {extension "prototype(sliding) decode(LibItsSecurity)"} + */ + external function fx_dec_Certificate (inout bitstring b, out Certificate p) return integer + with {extension "prototype(sliding) decode(LibItsSecurity)"} + /* + external function fx_dec_ToBeSignedCertificate (inout bitstring b, out ToBeSignedCertificate p) return integer + with {extension "prototype(sliding) decode(LibItsSecurity)"} + */ +} // End of module LibItsSecurity_EncdecDeclarations diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn3 b/ttcn/Security/LibItsSecurity_Functions.ttcn3 index 950bdad5..a941b7a7 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn3 +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn3 @@ -24,6 +24,7 @@ module LibItsSecurity_Functions { import from LibItsSecurity_Templates all; import from LibItsSecurity_Pixits all; import from LibItsSecurity_TestSystem all; + import from LibItsSecurity_EncdecDeclarations all; group helpersFunctions { diff --git a/ttcn/SremSsem/LibItsSremSsem_EncdecDeclarations.ttcn b/ttcn/SremSsem/LibItsSremSsem_EncdecDeclarations.ttcn new file mode 100644 index 00000000..d86dfd1b --- /dev/null +++ b/ttcn/SremSsem/LibItsSremSsem_EncdecDeclarations.ttcn @@ -0,0 +1,8 @@ +module LibItsSremSsem_EncdecDeclarations { + +import from IS_DSRC all; + +external function fx_enc_SSM (SignalStatusMessage p) return octetstring + with {extension "prototype(convert) encode(BER:BER_ENCODE_CER)"} + +} diff --git a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn index b280f2cb..317c7170 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn @@ -24,6 +24,7 @@ module LibItsSremSsem_Templates { // LibItsCommon import from LibItsCommon_TypesAndValues all; import from LibItsCommon_Functions all; + import from LibItsCommon_ASN1_NamedNumbers all; // LibItsSremSsem import from LibItsSremSsem_TestSystem all; -- GitLab From 192cacedc2e44053d512d7a8b1d6138fa4e412c3 Mon Sep 17 00:00:00 2001 From: filatov Date: Tue, 7 Feb 2017 18:22:39 +0000 Subject: [PATCH 004/320] TITANIZATION: common changes: valueof, dot notations, etc. --- ttcn/DENM/LibItsDenm_Functions.ttcn | 4 +- ttcn/DENM/LibItsDenm_Templates.ttcn | 14 +- .../LibItsGeoNetworking_Functions.ttcn | 17 +- .../LibItsGeoNetworking_Templates.ttcn | 94 +-- ttcn/IVIM/LibItsIvim_Functions.ttcn | 2 +- ttcn/IVIM/LibItsIvim_Templates.ttcn | 13 +- ...LibItsIpv6OverGeoNetworking_Functions.ttcn | 18 +- ...sIpv6OverGeoNetworking_TypesAndValues.ttcn | 2 +- .../LibItsMapemSpatem_Functions.ttcn | 2 +- .../LibItsMapemSpatem_Templates.ttcn | 16 +- ttcn/Security/LibItsSecurity_Functions.ttcn3 | 74 +- ttcn/Security/LibItsSecurity_Templates.ttcn3 | 14 +- ttcn/SremSsem/LibItsSremSsem_Templates.ttcn | 26 +- ttcn/V2G/LibItsV2G_Templates.ttcn | 33 +- ttcn/V2G/LibItsV2G_TestSystem.ttcn | 6 +- ttcn/V2G/LibItsV2G_TypesAndValues.ttcn | 159 ++-- ttcn/V2G/V2G_CI_AppProtocol.xsd | 55 ++ ttcn/V2G/V2G_CI_MsgBody.xsd | 484 ++++++++++++ ttcn/V2G/V2G_CI_MsgDataTypes.xsd | 698 ++++++++++++++++++ ttcn/V2G/V2G_CI_MsgDef.xsd | 31 + ttcn/V2G/V2G_CI_MsgHeader.xsd | 38 + ttcn/V2G/xmldsig-core-schema.xsd | 308 ++++++++ 22 files changed, 1900 insertions(+), 208 deletions(-) create mode 100644 ttcn/V2G/V2G_CI_AppProtocol.xsd create mode 100644 ttcn/V2G/V2G_CI_MsgBody.xsd create mode 100644 ttcn/V2G/V2G_CI_MsgDataTypes.xsd create mode 100644 ttcn/V2G/V2G_CI_MsgDef.xsd create mode 100644 ttcn/V2G/V2G_CI_MsgHeader.xsd create mode 100644 ttcn/V2G/xmldsig-core-schema.xsd diff --git a/ttcn/DENM/LibItsDenm_Functions.ttcn b/ttcn/DENM/LibItsDenm_Functions.ttcn index 0191c153..8ca735f1 100644 --- a/ttcn/DENM/LibItsDenm_Functions.ttcn +++ b/ttcn/DENM/LibItsDenm_Functions.ttcn @@ -550,7 +550,9 @@ module LibItsDenm_Functions { ) ); - return valueof(p_denm.management).actionID; +//FIXME RGY Titan doesn't support dot notation after valueof at the moment +// return valueof(p_denm.management).actionID; + return valueof(p_denm.management.actionID); } } // end sendFunctions diff --git a/ttcn/DENM/LibItsDenm_Templates.ttcn b/ttcn/DENM/LibItsDenm_Templates.ttcn index bd760fac..bba70087 100644 --- a/ttcn/DENM/LibItsDenm_Templates.ttcn +++ b/ttcn/DENM/LibItsDenm_Templates.ttcn @@ -23,6 +23,7 @@ module LibItsDenm_Templates { import from LibItsCommon_TypesAndValues all; import from LibItsCommon_Functions all; import from LibItsCommon_Pixits all; + import from LibItsCommon_ASN1_NamedNumbers all; // LibItsDenm import from LibItsDenm_TestSystem all; @@ -83,7 +84,9 @@ module LibItsDenm_Templates { * @param p_gnLifetime GN packet lifetime value (ms) * @param p_gnTrafficClass GN traffic class value */ - template DenmInd mw_denmIndWithGnParameters ( +//FIXME RGY template restriction can be the same as its base template: used in receiving operations only, where single "omit" is not allowed +// template DenmInd mw_denmIndWithGnParameters ( + template(present) DenmInd mw_denmIndWithGnParameters ( template (present) DENM p_denMsg, in template UInt8 p_gnNextHeader := *, in template UInt8 p_gnHeaderType := *, @@ -104,7 +107,8 @@ module LibItsDenm_Templates { * @param p_ssp SSP security parameter * @param p_its_aid ITS-AID value */ - template DenmInd mw_denmIndWithSecurityParameters( +//FIXME RGY Titan currently requires the modifyied template to have the same restriction as the base template + template (present) DenmInd mw_denmIndWithSecurityParameters( template (present) DENM p_denMsg, template Bit256 p_ssp := *, template UInt32 p_its_aid := c_its_aid_DENM @@ -119,7 +123,9 @@ module LibItsDenm_Templates { * @param p_btpDestinationPort BTP destination port value * @param p_btpInfo BTP destination port info value (if BTP-B) or BTP source port value (if BTP-A) */ - template DenmInd mw_denmIndWithBtpParameters ( +//FIXME RGY template restriction can be the same as its base template: template is not used currently +// template DenmInd mw_denmIndWithBtpParameters ( + template(present) DenmInd mw_denmIndWithBtpParameters ( template (present) DENM p_denMsg, in template UInt16 p_btpDestinationPort := *, in template UInt16 p_btpInfo := * @@ -350,8 +356,8 @@ module LibItsDenm_Templates { template (value) Longitude p_longitude := f_getTsLongitude(), template (value) Latitude p_latitude := f_getTsLatitude() ) := { - longitude := p_longitude, latitude := p_latitude, + longitude := p_longitude, positionConfidenceEllipse := m_posConfidenceEllipse, altitude := m_altitude } diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn index c28b6857..34f189fe 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn @@ -911,8 +911,9 @@ module LibItsGeoNetworking_Functions { position := p_positionValue }; } - - function @deterministic f_fillTimestamp(inout LongPosVector v_vector) +//FIXME RGY Titan doesn't support @deterministic yet +// function @deterministic f_fillTimestamp(inout LongPosVector v_vector) + function f_fillTimestamp(inout LongPosVector v_vector) return LongPosVector { if (v_vector.timestamp_ == 0) { v_vector.timestamp_ := f_computeGnTimestamp(); @@ -1588,12 +1589,12 @@ module LibItsGeoNetworking_Functions { var LongPosVector v_repDstPosVector; [vc_gnDefaultActive] a_receiveLsRequest(p_reqSeqNumber, p_mid, v_repDstPosVector) { - f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(m_geoNwPdu( + f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(m_geoNwPdu( m_geoNwLsReplyPacket( p_repSrcPosVector, f_longPosVector2ShortPosVector(v_repDstPosVector), vc_localSeqNumber - )))); + ))))); } } @@ -1690,6 +1691,7 @@ module LibItsGeoNetworking_Functions { var GeoNetworkingInd v_msg; f_sendGeoNetMessage( + valueof( m_geoNwReq_linkLayerBroadcast( m_geoNwPdu( m_geoNwLsRequestPacket( @@ -1699,6 +1701,7 @@ module LibItsGeoNetworking_Functions { ) ) ) + ) ); tc_ac.start; @@ -2521,7 +2524,9 @@ module LibItsGeoNetworking_Functions { mw_geoNwSecPdu( p_InSecMsg, mw_geoNwAnyPacket_withPayload(?) - ))) -> value (v_geoNw) { +//FIXME RGY Titan doesn't support storing list at the moment +// ))) -> value (v_geoNw) { + ))) -> value v_geoNw { p_received := f_getSecuredMessage(v_geoNw.msgIn); } } @@ -2779,7 +2784,7 @@ module LibItsGeoNetworking_Functions { f_HashedId3FromHashedId8( valueof(p_digest) )) - }, + } "" ); diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn index 64c1dc32..0f890cfd 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn @@ -109,7 +109,7 @@ module LibItsGeoNetworking_Templates { geoUnicast := { gnAddress := p_destinationGnAddr, lifetime := c_lifetime, - trafficClass := m_trafficClass, + trafficClass := valueof(m_trafficClass), payload := { decodedPayload := omit, rawPayload := ''O} // do not use f_adaptPayload_m here } } @@ -186,7 +186,7 @@ module LibItsGeoNetworking_Templates { geoBroadcast := { shape := p_geoArea.shape, lifetime := c_lifetime, - trafficClass := m_trafficClass, + trafficClass := valueof(m_trafficClass), reserved := c_uInt24Zero, area := p_geoArea.area, payload := { decodedPayload := omit, rawPayload := ''O} // do not use f_adaptPayload_m here @@ -246,7 +246,7 @@ module LibItsGeoNetworking_Templates { geoAnycast := { shape := p_geoArea.shape, lifetime := c_lifetime, - trafficClass := m_trafficClass, + trafficClass := valueof(m_trafficClass), reserved := c_uInt24Zero, area := p_geoArea.area, payload := { decodedPayload := omit, rawPayload := ''O} // do not use f_adaptPayload_m here @@ -288,7 +288,7 @@ module LibItsGeoNetworking_Templates { */ template (value) UtGnTrigger m_generateShbMessage := { shb := { - trafficClass := m_trafficClass, + trafficClass := valueof(m_trafficClass), payload := { decodedPayload := omit, rawPayload := ''O} // do not use f_adaptPayload_m here } } @@ -326,7 +326,7 @@ module LibItsGeoNetworking_Templates { tsb := { nbHops := 10, lifetime := c_lifetime, - trafficClass := m_trafficClass, + trafficClass := valueof(m_trafficClass), payload := { decodedPayload := omit, rawPayload := ''O} // do not use f_adaptPayload_m here } } @@ -376,7 +376,7 @@ module LibItsGeoNetworking_Templates { template (value) BeaconHeader p_beaconHeader ) := { startBeaconing := { - beaconPacket := m_geoNwPdu(m_geoNwBeaconPacket(p_beaconHeader.srcPosVector), -, c_hopLimit1) + beaconPacket := m_geoNwPdu(valueof(m_geoNwBeaconPacket(valueof(p_beaconHeader.srcPosVector))), -, c_hopLimit1) } } @@ -419,7 +419,7 @@ module LibItsGeoNetworking_Templates { integer p_numberOfNeighbour ) := { startBeaconingMultipleNeighbour := { - beaconPacket := m_geoNwPdu(m_geoNwBeaconPacket(p_beaconHeader.srcPosVector), -, c_hopLimit1), + beaconPacket := m_geoNwPdu(valueof(m_geoNwBeaconPacket(valueof(p_beaconHeader.srcPosVector))), -, c_hopLimit1), numberOfNeighbour := p_numberOfNeighbour } } @@ -539,11 +539,11 @@ module LibItsGeoNetworking_Templates { in template (value) CommonHeader p_commonHeader, in template (value) ExtendedHeader p_extHeader ) := { - packet := { + packet := valueof({ commonHeader := p_commonHeader, extendedHeader := p_extHeader, payload := f_adaptPayload_m(char2oct("DEFAULT_PAYLOAD")) - }, + }), securedMsg := omit } @@ -577,7 +577,7 @@ module LibItsGeoNetworking_Templates { in template (value) octetstring p_payload ) modifies m_geoNwPacket := { packet := { - payload := f_adaptPayload_m(p_payload) + payload := valueof(f_adaptPayload_m(p_payload)) } } @@ -623,7 +623,9 @@ module LibItsGeoNetworking_Templates { * * @see mw_geoNwPacket */ - template GeoNetworkingPacket mw_geoNwPduAnyPayload( +//FIXME RGY template restriction can be the same as its base template: template is not used currently +// template GeoNetworkingPacket mw_geoNwPduAnyPayload( + template(present) GeoNetworkingPacket mw_geoNwPduAnyPayload( in template (present) CommonHeader p_commonHeader, in template (present) ExtendedHeader p_extHeader ) modifies mw_geoNwPacket := { @@ -640,7 +642,9 @@ module LibItsGeoNetworking_Templates { * * @see mw_geoNwPacket */ - template GeoNetworkingPacket mw_geoNwPduWithOctetstringPayload( +//FIXME RGY template restriction can be the same as its base template: template is not used currently +// template GeoNetworkingPacket mw_geoNwPduWithOctetstringPayload( + template(present) GeoNetworkingPacket mw_geoNwPduWithOctetstringPayload( in template (present) CommonHeader p_commonHeader, in template (present) ExtendedHeader p_extHeader, in template (present) octetstring p_payload @@ -658,7 +662,9 @@ module LibItsGeoNetworking_Templates { * * @see mw_geoNwPacket */ - template GeoNetworkingPacket mw_geoNwPduWithPayload( +//FIXME RGY template restriction can be the same as its base template: used in TC_SEC_ITSS_SND_CAM_02_01_BV only, where is called with parameters +// template GeoNetworkingPacket mw_geoNwPduWithPayload( + template(present) GeoNetworkingPacket mw_geoNwPduWithPayload( in template (present) CommonHeader p_commonHeader, in template (present) ExtendedHeader p_extHeader, in template (present) Payload p_payload @@ -716,18 +722,18 @@ module LibItsGeoNetworking_Templates { in template (value) UInt8 p_hopLimit := c_defaultHopLimit, in template (value) TrafficClass p_trafficClass := m_trafficClass ) := { - commonHeader := m_commonHeader( + commonHeader := valueof(m_commonHeader( PX_GN_UPPER_LAYER, m_geoUnicastHeaderType, p_trafficClass, p_hopLimit - ), - extendedHeader := m_geoUnicastHeader( + )), + extendedHeader := valueof(m_geoUnicastHeader( p_sourceLongPosVec, p_destinationShortPosVec, p_seqNumber - ), - payload := f_adaptPayload_m(char2oct("DEFAULT_PAYLOAD")) + )), + payload := valueof(f_adaptPayload_m(char2oct("DEFAULT_PAYLOAD"))) } /** @@ -827,18 +833,18 @@ module LibItsGeoNetworking_Templates { in template (value) UInt8 p_hopLimit := c_defaultHopLimit, in template (value) TrafficClass p_trafficClass := m_trafficClass ) := { - commonHeader := m_commonHeader( + commonHeader := valueof(m_commonHeader( PX_GN_UPPER_LAYER, - m_geoAnycastHeaderType(p_anycastArea.geoAnycastSubType), + m_geoAnycastHeaderType(valueof(p_anycastArea.geoAnycastSubType)), p_trafficClass, p_hopLimit - ), - extendedHeader := m_geoAnycastHeader( + )), + extendedHeader := valueof(m_geoAnycastHeader( p_sourceLongPosVec, p_seqNumber, p_anycastArea - ), - payload := f_adaptPayload_m(char2oct("DEFAULT_PAYLOAD")) + )), + payload := valueof(f_adaptPayload_m(char2oct("DEFAULT_PAYLOAD"))) } /** @@ -941,18 +947,18 @@ module LibItsGeoNetworking_Templates { in template (value) UInt8 p_hopLimit := c_defaultHopLimit, in template (value) TrafficClass p_trafficClass := m_trafficClass ) := { - commonHeader := m_commonHeader( + commonHeader := valueof(m_commonHeader( PX_GN_UPPER_LAYER, - m_geoBroadcastHeaderType(p_broadcastArea.geoBroadcastSubType), + m_geoBroadcastHeaderType(valueof(p_broadcastArea.geoBroadcastSubType)), p_trafficClass, p_hopLimit - ), - extendedHeader := m_geoBroadcastHeader( + )), + extendedHeader := valueof(m_geoBroadcastHeader( p_sourceLongPosVec, p_seqNumber, p_broadcastArea - ), - payload := f_adaptPayload_m(char2oct("DEFAULT_PAYLOAD")) + )), + payload := valueof(f_adaptPayload_m(char2oct("DEFAULT_PAYLOAD"))) } /** @@ -1244,16 +1250,16 @@ module LibItsGeoNetworking_Templates { template (value) GnNonSecuredPacket m_geoNwShbPacket( in template (value) LongPosVector p_sourceLongPosVec ) := { - commonHeader := m_commonHeader( + commonHeader := valueof(m_commonHeader( PX_GN_UPPER_LAYER, m_shbHeaderType, m_trafficClass, c_defaultHopLimit - ), - extendedHeader := m_shbHeader( + )), + extendedHeader := valueof(m_shbHeader( p_sourceLongPosVec - ), - payload := f_adaptPayload_m(char2oct("DEFAULT_PAYLOAD")) + )), + payload := valueof(f_adaptPayload_m(char2oct("DEFAULT_PAYLOAD"))) } /** @@ -1290,17 +1296,17 @@ module LibItsGeoNetworking_Templates { in template (value) UInt8 p_hopLimit := c_defaultHopLimit, in template (value) TrafficClass p_trafficClass := m_trafficClass ) := { - commonHeader := m_commonHeader( + commonHeader := valueof(m_commonHeader( PX_GN_UPPER_LAYER, m_tsbHeaderType, p_trafficClass, p_hopLimit - ), - extendedHeader := m_tsbHeader( + )), + extendedHeader := valueof(m_tsbHeader( p_seqNumber, p_sourceLongPosVec - ), - payload := f_adaptPayload_m(char2oct("DEFAULT_PAYLOAD")) + )), + payload := valueof(f_adaptPayload_m(char2oct("DEFAULT_PAYLOAD"))) } /** @@ -1776,7 +1782,7 @@ module LibItsGeoNetworking_Templates { in template (value) UInt16 p_seqNumber, in template (value) GeoBroadcastArea p_broadcastArea ) := { - geoBroadcastHeader := { + geoBroadcastHeader := valueof({ seqNumber := p_seqNumber, reserved := c_uInt8Zero, srcPosVector := p_sourceLongPosVec, @@ -1786,7 +1792,7 @@ module LibItsGeoNetworking_Templates { distanceB := p_broadcastArea.geoBroadcastArea.distanceB, angle := p_broadcastArea.geoBroadcastArea.angle, reserved2 := c_uInt24Zero - } + }) } /** @@ -1885,7 +1891,7 @@ module LibItsGeoNetworking_Templates { in template (value) UInt16 p_seqNumber, in template (value) GeoAnycastArea p_anycastArea ) := { - geoAnycastHeader := { + geoAnycastHeader := valueof({ seqNumber := p_seqNumber, reserved := c_uInt8Zero, srcPosVector := p_sourceLongPosVec, @@ -1895,7 +1901,7 @@ module LibItsGeoNetworking_Templates { distanceB := p_anycastArea.geoAnycastArea.distanceB, angle := p_anycastArea.geoAnycastArea.angle, reserved2 := c_uInt24Zero - } + }) } /** diff --git a/ttcn/IVIM/LibItsIvim_Functions.ttcn b/ttcn/IVIM/LibItsIvim_Functions.ttcn index 9b3e4519..01e82291 100644 --- a/ttcn/IVIM/LibItsIvim_Functions.ttcn +++ b/ttcn/IVIM/LibItsIvim_Functions.ttcn @@ -373,7 +373,7 @@ module LibItsIvim_Functions { var FncRetCode v_ret := e_success; if (valueof(p_trigger) == e_ets) { - f_sendIviMessage(m_ivimStructureCancellation(p_iviIdentificationNumber)); + f_sendIviMessage(valueof(m_ivimStructureCancellation(p_iviIdentificationNumber))); f_sleep(PX_TNOAC); } else { diff --git a/ttcn/IVIM/LibItsIvim_Templates.ttcn b/ttcn/IVIM/LibItsIvim_Templates.ttcn index eb02a286..51a59820 100644 --- a/ttcn/IVIM/LibItsIvim_Templates.ttcn +++ b/ttcn/IVIM/LibItsIvim_Templates.ttcn @@ -77,7 +77,9 @@ module LibItsIvim_Templates { * @param p_gnLifetime GN packet lifetime value (ms) * @param p_gnTrafficClass GN traffic class value */ - template IvimInd mw_ivimIndWithGnParameters ( +//FIXME RGY template should be (present), no omit is assigned to it as a whole; Titan currently requires that the modified templte has at least the same restirction as the base +// template IvimInd mw_ivimIndWithGnParameters ( + template(present) IvimInd mw_ivimIndWithGnParameters ( template (present) IVIM p_iviMsg, in template UInt8 p_gnNextHeader := *, in template UInt8 p_gnHeaderType := *, @@ -98,7 +100,9 @@ module LibItsIvim_Templates { * @param p_btpDestinationPort BTP destination port value * @param p_btpInfo BTP destination port info value (if BTP-B) or BTP source port value (if BTP-A) */ - template IvimInd mw_ivimIndWithBtpParameters ( +//FIXME RGY template should be (present), no omit is assigned to it as a whole; Titan currently requires that the modified templte has at least the same restirction as the base +// template IvimInd mw_ivimIndWithBtpParameters ( + template(present) IvimInd mw_ivimIndWithBtpParameters ( template (present) IVIM p_iviMsg, template UInt16 p_btpDestinationPort := *, template UInt16 p_btpInfo := * @@ -113,7 +117,8 @@ module LibItsIvim_Templates { * @param p_ssp SSP security parameter * @param p_its_aid ITS-AID value */ - template IvimInd mw_ivimIndWithSecurityParameters ( +//FIXME RGY template should be (present), no omit is assigned to it as a whole; Titan currently requires that the modified templte has at least the same restirction as the base + template(present) IvimInd mw_ivimIndWithSecurityParameters ( template (present) IVIM p_iviMsg, template Bit256 p_ssp := *, template UInt32 p_its_aid := * @@ -310,7 +315,7 @@ module LibItsIvim_Templates { template (value) IviStructure m_ivimStructureCancellation( in template (value) IviIdentificationNumber p_iviIdentificationNumber ) := { - mandatory := m_iviManagementContainer(f_getProvider(), p_iviIdentificationNumber, IviStatus_cancellation_), + mandatory := valueof(m_iviManagementContainer(f_getProvider(), valueof(p_iviIdentificationNumber), IviStatus_cancellation_)), optional_ := omit } // End of template m_ivimStructureCancellation diff --git a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Functions.ttcn b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Functions.ttcn index f2944b8c..3039b86d 100644 --- a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Functions.ttcn +++ b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Functions.ttcn @@ -296,12 +296,14 @@ module LibItsIpv6OverGeoNetworking_Functions { var LongPosVector v_nodeLongPosVector := f_getPosition(p_compName); f_sendGeoNetMessageWithPayload( - m_geoNwReq_linkLayerBroadcast( - m_geoNwPdu( - m_geoNwBroadcastPacket( - v_nodeLongPosVector, - vc_localSeqNumber, - f_getGeoBroadcastArea(valueof(p_gvl.area)) + valueof( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwBroadcastPacket( + v_nodeLongPosVector, + vc_localSeqNumber, + f_getGeoBroadcastArea(valueof(p_gvl.area)) + ) ) ) ), @@ -312,12 +314,12 @@ module LibItsIpv6OverGeoNetworking_Functions { c_icmpHdr, m_rtAdvWithOptions( m_rtAdvOpt_prefixOpt( - p_gvl.prefixLength, + valueof(p_gvl.prefixLength), c_lFlag1, c_aFlag1, p_validLifetime, c_preferredLifetime30s, - p_gvl.prefix + valueof(p_gvl.prefix) ) ) ) diff --git a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TypesAndValues.ttcn b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TypesAndValues.ttcn index 48691014..299f5230 100644 --- a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TypesAndValues.ttcn +++ b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TypesAndValues.ttcn @@ -189,7 +189,7 @@ module LibItsIpv6OverGeoNetworking_TypesAndValues { UInt32 reachableTime, UInt32 retransTimer, RtAdvOptions rtAdvOptions optional - } with { variant (checksum) "MarkForIPv6ChecksumCalculation" } + } // FIXME CHECK while TITAN refuse it: with { variant (checksum) "MarkForIPv6ChecksumCalculation" } /** * @desc RouterAdvertisement option list diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn index 09372f06..c3a7119d 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn @@ -332,6 +332,6 @@ module LibItsMapemSpatem_Functions { } } - } // End of receiveFunctions + } // End of group receiveFunctions } // End of module LibItsMapemSpatem_Functions \ No newline at end of file diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn index 9471f393..18be8285 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn @@ -93,7 +93,9 @@ module LibItsMapemSpatem_Templates { * @param p_btpDestinationPort BTP destination port value * @param p_btpInfo BTP destination port info value (if BTP-B) or BTP source port value (if BTP-A) */ - template MapemInd mw_mapemIndWithBtpParameters( +//FIXME RGY template should be (present), no omit is assigned to it as a whole; Titan currently requires that the modified templte has at least the same restirction as the base +// template MapemInd mw_mapemIndWithBtpParameters( + template(present) MapemInd mw_mapemIndWithBtpParameters( template (present) MAPEM p_mapemMsg, in template UInt16 p_btpDestinationPort := *, in template UInt16 p_btpInfo := * @@ -176,7 +178,9 @@ module LibItsMapemSpatem_Templates { * @param p_btpDestinationPort BTP destination port value * @param p_btpInfo BTP destination port info value (if BTP-B) or BTP source port value (if BTP-A) */ - template SpatemInd mw_spatemIndWithBtpParameters( +//FIXME RGY template should be (present), no omit is assigned to it as a whole; Titan currently requires that the modified templte has at least the same restirction as the base +// template SpatemInd mw_spatemIndWithBtpParameters( + template(present) SpatemInd mw_spatemIndWithBtpParameters( template (present) SPATEM p_spatemMsg, template UInt16 p_btpDestinationPort := *, template UInt16 p_btpInfo := * @@ -387,7 +391,9 @@ module LibItsMapemSpatem_Templates { /** * @desc Receive template for MAPEM Message */ - template (omit) MapData m_mapem( +//FIXME RGY template should be (present), no omit is assigned to it as a whole; Titan currently requires that the modified templte has at least the same restirction as the base +// template (omit) MapData m_mapem( + template (value) MapData m_mapem( in template (value) MsgCount p_msgIssueRevision, in template (omit) IntersectionGeometryList p_intersectionGeometryList := omit, in template (omit) RoadSegmentList p_roadSegments := omit @@ -563,7 +569,9 @@ module LibItsMapemSpatem_Templates { /** * @desc Send template for SPAT Message */ - template (omit) SPAT m_spatem( +//FIXME RGY template should be (present), no omit is assigned to it as a whole; Titan currently requires that the modified templte has at least the same restirction as the base +// template (omit) SPAT m_spatem( + template (value) SPAT m_spatem( in template (value) IntersectionStateList p_intersections, in template (omit) DescriptiveName p_name := omit ) modifies m_defaultSpatem:= { diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn3 b/ttcn/Security/LibItsSecurity_Functions.ttcn3 index a941b7a7..a6908dac 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn3 +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn3 @@ -273,7 +273,7 @@ module LibItsSecurity_Functions { ); p_securedMessage := m_securedMessage( - v_toBeSignedSecuredMessage.header_fields, + valueof(v_toBeSignedSecuredMessage.header_fields), p_payloadField, { m_trailer_field_signature( @@ -418,14 +418,14 @@ module LibItsSecurity_Functions { // log("p_trailerStatus=", p_trailerStatus); if (p_trailerStatus == 0) { // No signature p_securedMessage := m_securedMessage( - v_toBeSignedSecuredMessage.header_fields, + valueof(v_toBeSignedSecuredMessage.header_fields), p_payloadField, { } ); v_trailerSize := 0; } else if (p_trailerStatus == 2) { // Duplicate signature p_securedMessage := m_securedMessage( - v_toBeSignedSecuredMessage.header_fields, + valueof(v_toBeSignedSecuredMessage.header_fields), p_payloadField, { m_trailer_field_signature( @@ -453,7 +453,7 @@ module LibItsSecurity_Functions { } else if (p_trailerStatus == 3) { // Signature with reserved algorthm p_securedMessage := m_securedMessage_wrong_protocol( p_protocolVersion, - v_toBeSignedSecuredMessage.header_fields, + valueof(v_toBeSignedSecuredMessage.header_fields), p_payloadField, { m_trailer_field_signature( @@ -465,7 +465,7 @@ module LibItsSecurity_Functions { ); } else { // Invalid signature p_securedMessage := m_securedMessage( - v_toBeSignedSecuredMessage.header_fields, + valueof(v_toBeSignedSecuredMessage.header_fields), p_payloadField, { m_trailer_field_signature( @@ -1021,7 +1021,7 @@ module LibItsSecurity_Functions { if (valueof(p_issuingCertificate.subject_attributes[v_counter].type_) == e_verification_key) { return f_verifyCertificateSignatureWithPublicKey( p_certificateToBeVerified, - p_issuingCertificate.subject_attributes[v_counter].attribute.key); + valueof(p_issuingCertificate.subject_attributes[v_counter].attribute.key)); } } // End of 'for' statement @@ -1054,8 +1054,8 @@ module LibItsSecurity_Functions { // Create SecuredMessage payload to be signed v_toBeSignedSecuredMessage := m_toBeSignedSecuredMessage( - p_securedMessage.header_fields, - p_securedMessage.payload_field, + valueof(p_securedMessage.header_fields), + valueof(p_securedMessage.payload_field), e_signature ); log("f_verifyGnSecuredMessageSignatureWithPublicKey: v_toBeSignedSecuredMessage=", v_toBeSignedSecuredMessage); @@ -1108,7 +1108,7 @@ module LibItsSecurity_Functions { if (v_subjectAttribute.type_ == e_verification_key) { return f_verifyGnSecuredMessageSignatureWithPublicKey( p_securedMessage, - p_certificate.subject_attributes[v_counter].attribute.key); + valueof(p_certificate.subject_attributes[v_counter].attribute.key)); } } // End of 'for' statement @@ -1316,8 +1316,11 @@ module LibItsSecurity_Functions { ) return boolean { for (var integer i := 0; i < lengthof(p_cert.validity_restrictions); i := i + 1) { - if (valueof(p_cert).validity_restrictions[i].type_ == p_type) { - p_return := valueof(p_cert).validity_restrictions[i]; +//FIXME RGY Titan doesn't support dot notation after valueof at the moment +// if (valueof(p_cert).validity_restrictions[i].type_ == p_type) { +// p_return := valueof(p_cert).validity_restrictions[i]; + if (valueof(p_cert.validity_restrictions[i].type_) == p_type) { + p_return := valueof(p_cert.validity_restrictions[i]); return true; } } // End of 'for' statement @@ -1345,8 +1348,11 @@ module LibItsSecurity_Functions { out SubjectAttribute p_return ) return boolean { for (var integer i := 0; i < lengthof(p_cert.subject_attributes); i := i + 1) { - if (valueof(p_cert).subject_attributes[i].type_ == p_type) { - p_return := valueof(p_cert).subject_attributes[i]; +//FIXME RGY Titan doesn't support dot notation after valueof at the moment +// if (valueof(p_cert).subject_attributes[i].type_ == p_type) { +// p_return := valueof(p_cert).subject_attributes[i]; + if (valueof(p_cert.subject_attributes[i].type_) == p_type) { + p_return := valueof(p_cert.subject_attributes[i]); return true; } } @@ -1746,8 +1752,11 @@ module LibItsSecurity_Functions { in template (value) TwoDLocation p_location ) return boolean { return - (valueof(p_location).longitude != c_maxLongitude + 1) and - (valueof(p_location).latitude != c_maxLatitude + 1); +//FIXME RGY Titan doesn't support dot notation after valueof at the moment +// (valueof(p_location).longitude != c_maxLongitude + 1) and +// (valueof(p_location).latitude != c_maxLatitude + 1); + (valueof(p_location.longitude) != c_maxLongitude + 1) and + (valueof(p_location.latitude) != c_maxLatitude + 1); } // End of function f_isValidTwoDLocation /** @@ -1763,10 +1772,15 @@ module LibItsSecurity_Functions { in template (value) RectangularRegion p_r2 ) return boolean { return not ( - valueof(p_r2).northwest.longitude > valueof(p_r1).southeast.longitude or - valueof(p_r2).southeast.longitude < valueof(p_r1).northwest.longitude or - valueof(p_r2).southeast.latitude > valueof(p_r1).northwest.latitude or - valueof(p_r2).northwest.latitude < valueof(p_r1).southeast.latitude +//FIXME RGY Titan doesn't support dot notation after valueof at the moment +// valueof(p_r2).northwest.longitude > valueof(p_r1).southeast.longitude or +// valueof(p_r2).southeast.longitude < valueof(p_r1).northwest.longitude or +// valueof(p_r2).southeast.latitude > valueof(p_r1).northwest.latitude or +// valueof(p_r2).northwest.latitude < valueof(p_r1).southeast.latitude + valueof(p_r2.northwest.longitude) > valueof(p_r1.southeast.longitude) or + valueof(p_r2.southeast.longitude) < valueof(p_r1.northwest.longitude) or + valueof(p_r2.southeast.latitude) > valueof(p_r1.northwest.latitude) or + valueof(p_r2.northwest.latitude) < valueof(p_r1.southeast.latitude) ); } // End of function f_isRectangularRegionsIntersected @@ -1778,12 +1792,12 @@ module LibItsSecurity_Functions { for (v_i := 0; v_i < lengthof(p_region); v_i := v_i + 1) { var PolygonalRegion v_region_base; - f_convertRectangularRegionIntoPolygonalRegion(p_region[v_i], v_region_base); + f_convertRectangularRegionIntoPolygonalRegion(valueof(p_region[v_i]), v_region_base); v_found := false; for (v_j := 0; v_j < lengthof(p_region); v_j := v_j + 1) { if (v_j != v_i) { var PolygonalRegion v_region; - f_convertRectangularRegionIntoPolygonalRegion(p_region[v_j], v_region); + f_convertRectangularRegionIntoPolygonalRegion(valueof(p_region[v_j]), v_region); if (f_isPolygonalRegionInside(v_region, v_region_base) == true) { v_found := true; } @@ -1812,9 +1826,9 @@ module LibItsSecurity_Functions { for (v_i := 0; v_i < lengthof(p_parent); v_i := v_i + 1) { var PolygonalRegion v_region_parent, v_region; - f_convertRectangularRegionIntoPolygonalRegion(p_parent[v_i], v_region_parent); + f_convertRectangularRegionIntoPolygonalRegion(valueof(p_parent[v_i]), v_region_parent); for (v_j := 0; v_j < lengthof(p_parent); v_j := v_j + 1) { - f_convertRectangularRegionIntoPolygonalRegion(p_region[v_j], v_region); + f_convertRectangularRegionIntoPolygonalRegion(valueof(p_region[v_j]), v_region); if (f_isPolygonalRegionInside(v_region, v_region_parent) == true) { return true; } @@ -1911,24 +1925,26 @@ module LibItsSecurity_Functions { ) return boolean { var boolean v_ret := false; - select (p_region.region_type) { +//FIXME RGY valeuof is missing: argument of select case is Expression (see $19.3.1) +// select (p_region.region_type) { + select (valueof(p_region.region_type)) { case (e_none) { v_ret := true; } case (e_circle) { - v_ret := f_isLocationInsideCircularRegion(p_region.region.circular_region, p_location); + v_ret := f_isLocationInsideCircularRegion(valueof(p_region.region.circular_region), p_location); } case (e_rectangle) { - v_ret := f_isLocationInsideRectangularRegion(p_region.region.rectangular_region, p_location); + v_ret := f_isLocationInsideRectangularRegion(valueof(p_region.region.rectangular_region), p_location); } case (e_polygon) { - v_ret := f_isLocationInsidePolygonalRegion(p_region.region.polygonal_region, p_location); + v_ret := f_isLocationInsidePolygonalRegion(valueof(p_region.region.polygonal_region), p_location); } case (e_id) { - v_ret := f_isLocationInsideIdentifiedRegion(p_region.region.id_region, p_location); + v_ret := f_isLocationInsideIdentifiedRegion(valueof(p_region.region.id_region), p_location); } case else { - v_ret := f_isLocationInsideOtherRegion(p_region.region.other_region, p_location); + v_ret := f_isLocationInsideOtherRegion(valueof(p_region.region.other_region), p_location); } } diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn3 b/ttcn/Security/LibItsSecurity_Templates.ttcn3 index 473764f3..eda3f56e 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn3 +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn3 @@ -42,7 +42,9 @@ module LibItsSecurity_Templates { * @desc Its AID for Other * @see Draft ETSI TS 103 097 V1.1.14 Clause 7.3 Security profile for DENMs */ - const IntX c_its_aid_Other := PX_OTHER_ITS_AID; +//FIXME RGY definition type is changed to modulepar, as Titan doesn't support dynamic constants +// const IntX c_its_aid_Other := PX_OTHER_ITS_AID; + template IntX c_its_aid_Other := PX_OTHER_ITS_AID; /** * @desc Minimal value of Longitude @@ -2596,11 +2598,11 @@ module LibItsSecurity_Templates { template (value) ToBeSignedCertificate m_toBeSignedCertificate( in template (value) Certificate p_certificate ) := { - version := p_certificate.version, - signer_info := p_certificate.signer_info, - subject_info := p_certificate.subject_info, - subject_attributes := p_certificate.subject_attributes, - validity_restrictions := p_certificate.validity_restrictions + version := valueof(p_certificate.version), + signer_info := valueof(p_certificate.signer_info), + subject_info := valueof(p_certificate.subject_info), + subject_attributes := valueof(p_certificate.subject_attributes), + validity_restrictions := valueof(p_certificate.validity_restrictions) } // End of template m_toBeSignedCertificate } // End of group profileCertificates diff --git a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn index 317c7170..3da0801a 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn @@ -92,7 +92,9 @@ module LibItsSremSsem_Templates { * @param p_btpDestinationPort BTP destination port value * @param p_btpInfo BTP destination port info value (if BTP-B) or BTP source port value (if BTP-A) */ - template SremInd mw_sremIndWithBtpParameters( +//FIXME RGY template should be (present), no omit is assigned to it as a whole; Titan currently requires that the modified templte has at least the same restirction as the base +// template SremInd mw_sremIndWithBtpParameters( + template(present) SremInd mw_sremIndWithBtpParameters( template (present) SREM p_sremMsg, in template UInt16 p_btpDestinationPort := *, in template UInt16 p_btpInfo := * @@ -174,7 +176,9 @@ module LibItsSremSsem_Templates { * @param p_btpDestinationPort BTP destination port value * @param p_btpInfo BTP destination port info value (if BTP-B) or BTP source port value (if BTP-A) */ - template SsemInd mw_ssemIndWithBtpParameters( +//FIXME RGY template should be (present), no omit is assigned to it as a whole; Titan currently requires that the modified templte has at least the same restirction as the base +// template SsemInd mw_ssemIndWithBtpParameters( + template(present) SsemInd mw_ssemIndWithBtpParameters( template (present) SSEM p_ssemMsg, template UInt16 p_btpDestinationPort := *, template UInt16 p_btpInfo := * @@ -376,14 +380,16 @@ module LibItsSremSsem_Templates { second := PX_SECOND, sequenceNumber := omit, requests := { - m_signalRequestPackage( - m_signalRequest( - m_intersectionReferenceID, - 1, - priorityRequestTypeReserved, - { lane := 1 } - )) }, - requestor := m_requestorDescription(m_vehicleID(f_getIutStationId())), + valueof( + m_signalRequestPackage( + valueof( + m_signalRequest( + m_intersectionReferenceID, + 1, + priorityRequestTypeReserved, + { lane := 1 } + )))) }, + requestor := valueof(m_requestorDescription(m_vehicleID(f_getIutStationId()))), regional := omit } diff --git a/ttcn/V2G/LibItsV2G_Templates.ttcn b/ttcn/V2G/LibItsV2G_Templates.ttcn index 51242b47..8530413d 100644 --- a/ttcn/V2G/LibItsV2G_Templates.ttcn +++ b/ttcn/V2G/LibItsV2G_Templates.ttcn @@ -7,18 +7,22 @@ */ module LibItsV2G_Templates { - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; + // LibCommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; - // LibIts + // LibItsCommon + import from LibItsCommon_ASN1_NamedNumbers all; + + // LibItsV2G import from LibItsV2G_TestSystem all; import from LibItsV2G_TypesAndValues all; import from LibItsV2G_Pixits all; + import from LibItsV2G_TypeAliases all; //XSD - import from iso_15118_2_2010_MsgDef all; - import from iso_15118_2_2010_MsgDataTypes all; + import from urn_iso_15118_2_2010_MsgDef all; + import from urn_iso_15118_2_2010_MsgDataTypes all; group v2gPrimitivesTemplates { @@ -26,8 +30,8 @@ module LibItsV2G_Templates { group utPrimitives { - /** - * @desc Initializes the V2G IUT. + /** + * @desc Initializes the V2G IUT. */ template (value) UtInitialize m_v2gInitialize := { utV2Ginitialize := { @@ -38,7 +42,9 @@ module LibItsV2G_Templates { * @desc Upper Tester template for checking that V2G payload has been transmitted to upper layer * @param p_payload Payload to be checked */ - template (value) UtEvent m_checkPayload(in V2G_Message.Body p_body) := { +//FIXME RGY by standard conversion all field names are lowercase +// template (value) UtEvent m_checkPayload(in V2G_Message.Body p_body) := { + template (value) UtEvent m_checkPayload(in V2G_Message.body p_body) := { utV2Gevent := { v2gBody := p_body } @@ -92,6 +98,7 @@ module LibItsV2G_Templates { */ template V2G_Message mw_v2gMsg_sessionRequest (in template (present) sessionIDType_TYPE p_sId, in template (present) evccIDType_TYPE p_evccId ):= { +/*FIXME RGY by standard conversion all field names are lowercase Header := { SessionID := p_sId, Notification := omit, @@ -99,6 +106,14 @@ module LibItsV2G_Templates { }, Body := { BodyElement := omit//p_evccId +*/ + header := { + sessionID := p_sId, + notification := omit, + signature_ := omit + }, + body := { + bodyElement := omit//p_evccId } } diff --git a/ttcn/V2G/LibItsV2G_TestSystem.ttcn b/ttcn/V2G/LibItsV2G_TestSystem.ttcn index b6958e52..3f8fbdde 100644 --- a/ttcn/V2G/LibItsV2G_TestSystem.ttcn +++ b/ttcn/V2G/LibItsV2G_TestSystem.ttcn @@ -16,8 +16,10 @@ module LibItsV2G_TestSystem { import from LibItsV2G_TypesAndValues all; //XSD - import from iso_15118_2_2010_MsgDef all; - import from iso_15118_2_2010_MsgDataTypes all; + import from urn_iso_15118_2_2010_MsgDef all; + import from urn_iso_15118_2_2010_MsgDataTypes all; + + import from V2G_typeAliases all; group portDefinitions { diff --git a/ttcn/V2G/LibItsV2G_TypesAndValues.ttcn b/ttcn/V2G/LibItsV2G_TypesAndValues.ttcn index 9e5219ab..9f424d13 100644 --- a/ttcn/V2G/LibItsV2G_TypesAndValues.ttcn +++ b/ttcn/V2G/LibItsV2G_TypesAndValues.ttcn @@ -13,84 +13,84 @@ module LibItsV2G_TypesAndValues { // LibIts //import from iso_15118_2_2010_MsgBody all; //language "XSD" all with {extension "File:V2G_CI_MsgBody.xsd" }; - import from iso_15118_2_2010_AppProtocol all;//language "XSD" all with {extension "File:XSD/V2G_CI_AppProtocol.xsd" }; + import from urn_iso_15118_2_2010_AppProtocol all;//language "XSD" all with {extension "File:XSD/V2G_CI_AppProtocol.xsd" }; //import from iso_15118_2_2010_MsgDataTypes all;//language "XSD" all with {extension "File:XSD/V2G_CI_MsgDataTypes.xsd" }; - import from iso_15118_2_2010_MsgDef all;//language "XSD" all with {extension "File:XSD/V2G_CI_MsgDef.xsd" }; + import from urn_iso_15118_2_2010_MsgDef all;//language "XSD" all with {extension "File:XSD/V2G_CI_MsgDef.xsd" }; //import from iso_15118_2_2010_MsgHeader all;//language "XSD" all with {extension "File:XSD/V2G_CI_MsgHeader.xsd" }; //import from org_w3_www__2000_09_xmldsig all;//language "XSD" all with {extension "File:XSD/xmldsig-core-schema.xsd" }; group v2gPdus { - group SDPMessages { - + group SDPMessages { + /** * @desc SDP (Session Discovery Protocol) message description */ type record Sdp_Message { - Sdp_Header sdpHeader, + Sdp_Header sdpHeader, Sdp_Payload sdpPayload - } + } } } // end v2gPdus group v2gHeaders { - - group SDPMessages { - + + group SDPMessages { + /** * @desc SDP (Session Discovery Protocol) Header description */ - type record Sdp_Header { - Oct1 protocolVersion, - Oct1 inverseProtocolVersion, - Oct2 payloadType, + type record Sdp_Header { + Oct1 protocolVersion, + Oct1 inverseProtocolVersion, + Oct2 payloadType, UInt16 payloadLength - } + } } } // end v2gHeaders - group v2gPayload { - - group SDPMessages { - + group v2gPayload { + + group SDPMessages { + /** * @desc SDP (Session Discovery Protocol) Payload description */ - type union Sdp_Payload { - Sdp_Request sdpRequest, - Sdp_Response sdpResponse - } - + type union Sdp_Payload { + Sdp_Request sdpRequest, + Sdp_Response sdpResponse + } + /** * @desc SDP (Session Discovery Protocol) Request message description - */ - type record Sdp_Request - { - Oct1 security, - Oct1 transportProtocol - } - + */ + type record Sdp_Request + { + Oct1 security, + Oct1 transportProtocol + } + /** * @desc SDP (Session Discovery Protocol) Response message description - */ - type record Sdp_Response - { - Ipv6Address seccIPAddress, // IPv6 - UInt16 seccPort, - Oct1 security, + */ + type record Sdp_Response + { + Ipv6Address seccIPAddress, // IPv6 + UInt16 seccPort, + Oct1 security, Oct1 transportProtocol - } + } } - } //end v2gPayload - - group IPAddress - { - /** - * @desc IPv6 Address - */ - type Oct16 Ipv6Address; + } //end v2gPayload + + group IPAddress + { + /** + * @desc IPv6 Address + */ + type Oct16 Ipv6Address; } // end IPAddress group acPrimitives { @@ -180,42 +180,45 @@ module LibItsV2G_TypesAndValues { * @desc Upper Tester message generating V2G message */ type union UtV2Gevent { - V2G_Message.Header v2gHeader, - V2G_Message.Body v2gBody +//FIXME RGY by standard conversion all field names are lowercase +// V2G_Message.Header v2gHeader, +// V2G_Message.Body v2gBody + V2G_Message.header v2gHeader, + V2G_Message.body v2gBody } } // end utPrimitives - - group sdpValues { - - const Oct1 c_protocolVersion1 := '01'O; - const Oct1 c_inverseProtocolVersion1 := 'FE'O; - - const Oct2 c_sdpRequestMessagePayloadType := '9000'O; - const Oct2 c_sdpResponseMessagePayloadType := '9001'O; - - const UInt16 c_sdpRequestPayloadLength := 2; - const UInt16 c_sdpResponsePayloadLength := 18; - - const Oct1 c_securedwithTLS := '00'O; - const Oct1 c_noTransportLayerSecurity := '10'O; - - const Oct1 c_transportProtocolTCP := '00'O; - const Oct1 c_transportProtocolUDP := '10'O; - - const UInt16 c_V2G_UDP_SDP_SERVER := 15118; - - const integer c_maxNbrSdpRequestRetrans := 4; - const integer c_maxNbrConsecutiveSdpRequest := 5; - - } // end sdpValues - - group timerTimeouts - { - const float c_v2g_seccSequenceTimeout := 60.0; - const float c_v2g_evccSequenceTimeout := 40.0; - - const float c_v2g_sdpRetransmissionTimeout := 0.25; + + group sdpValues { + + const Oct1 c_protocolVersion1 := '01'O; + const Oct1 c_inverseProtocolVersion1 := 'FE'O; + + const Oct2 c_sdpRequestMessagePayloadType := '9000'O; + const Oct2 c_sdpResponseMessagePayloadType := '9001'O; + + const UInt16 c_sdpRequestPayloadLength := 2; + const UInt16 c_sdpResponsePayloadLength := 18; + + const Oct1 c_securedwithTLS := '00'O; + const Oct1 c_noTransportLayerSecurity := '10'O; + + const Oct1 c_transportProtocolTCP := '00'O; + const Oct1 c_transportProtocolUDP := '10'O; + + const UInt16 c_V2G_UDP_SDP_SERVER := 15118; + + const integer c_maxNbrSdpRequestRetrans := 4; + const integer c_maxNbrConsecutiveSdpRequest := 5; + + } // end sdpValues + + group timerTimeouts + { + const float c_v2g_seccSequenceTimeout := 60.0; + const float c_v2g_evccSequenceTimeout := 40.0; + + const float c_v2g_sdpRetransmissionTimeout := 0.25; } } with { diff --git a/ttcn/V2G/V2G_CI_AppProtocol.xsd b/ttcn/V2G/V2G_CI_AppProtocol.xsd new file mode 100644 index 00000000..ea3713dc --- /dev/null +++ b/ttcn/V2G/V2G_CI_AppProtocol.xsd @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ttcn/V2G/V2G_CI_MsgBody.xsd b/ttcn/V2G/V2G_CI_MsgBody.xsd new file mode 100644 index 00000000..5e9a3f48 --- /dev/null +++ b/ttcn/V2G/V2G_CI_MsgBody.xsd @@ -0,0 +1,484 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ttcn/V2G/V2G_CI_MsgDataTypes.xsd b/ttcn/V2G/V2G_CI_MsgDataTypes.xsd new file mode 100644 index 00000000..dc860bc0 --- /dev/null +++ b/ttcn/V2G/V2G_CI_MsgDataTypes.xsd @@ -0,0 +1,698 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Time in hours + + + + + Time in minutes + + + + + Time in seconds + + + + + Current in Ampere + + + + + Ampere hour + + + + + Voltage in Volt + + + + + Apparent power in Volt Ampere + + + + + Active power in Watt + + + + + Watt per second + + + + + Real energy in Watt hours + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ttcn/V2G/V2G_CI_MsgDef.xsd b/ttcn/V2G/V2G_CI_MsgDef.xsd new file mode 100644 index 00000000..5ae1e097 --- /dev/null +++ b/ttcn/V2G/V2G_CI_MsgDef.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ttcn/V2G/V2G_CI_MsgHeader.xsd b/ttcn/V2G/V2G_CI_MsgHeader.xsd new file mode 100644 index 00000000..35dff7ab --- /dev/null +++ b/ttcn/V2G/V2G_CI_MsgHeader.xsd @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + diff --git a/ttcn/V2G/xmldsig-core-schema.xsd b/ttcn/V2G/xmldsig-core-schema.xsd new file mode 100644 index 00000000..003d8e1c --- /dev/null +++ b/ttcn/V2G/xmldsig-core-schema.xsd @@ -0,0 +1,308 @@ + + + + + + ]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- GitLab From 0720d504f651879a91c883906133e749f6db184d Mon Sep 17 00:00:00 2001 From: filatov Date: Thu, 9 Feb 2017 17:27:42 +0000 Subject: [PATCH 005/320] IS_DSRC => DSRC various errors --- ...LibItsCommon_ASN1_ISDSRC_NamedNumbers.ttcn | 2 +- ttcn/DCC/LibItsDcc_TestSystem.ttcn | 4 ++- .../LibItsGeoNetworking_Functions.ttcn | 2 +- ttcn/Security/LibItsSecurity_Functions.ttcn3 | 25 ++++++++++++------- .../LibItsSremSsem_EncdecDeclarations.ttcn | 2 +- 5 files changed, 22 insertions(+), 13 deletions(-) diff --git a/ttcn/Common/LibItsCommon_ASN1_ISDSRC_NamedNumbers.ttcn b/ttcn/Common/LibItsCommon_ASN1_ISDSRC_NamedNumbers.ttcn index daf1a98c..697688e1 100644 --- a/ttcn/Common/LibItsCommon_ASN1_ISDSRC_NamedNumbers.ttcn +++ b/ttcn/Common/LibItsCommon_ASN1_ISDSRC_NamedNumbers.ttcn @@ -2,7 +2,7 @@ module LibItsCommon_ASN1_ISDSRC_NamedNumbers { -import from IS_DSRC language "ASN.1:1997" all; +import from DSRC language "ASN.1:1997" all; group IS_DSCR_constants { group LaneParameter_constants { diff --git a/ttcn/DCC/LibItsDcc_TestSystem.ttcn b/ttcn/DCC/LibItsDcc_TestSystem.ttcn index dcae78db..cc42d6fd 100644 --- a/ttcn/DCC/LibItsDcc_TestSystem.ttcn +++ b/ttcn/DCC/LibItsDcc_TestSystem.ttcn @@ -49,7 +49,9 @@ module LibItsDcc_TestSystem { * @desc Check Port used for intercomponent exchange of data to check */ type port CheckPort message { - inout all; +//FIXME RGY "all" is not supported by Titan in port message lists; only integers are sent and received via checkPort-s; +// inout all; + inout integer; } } // end portDefinitions diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn index 34f189fe..5cbaee1d 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn @@ -2784,7 +2784,7 @@ module LibItsGeoNetworking_Functions { f_HashedId3FromHashedId8( valueof(p_digest) )) - } + }, "" ); diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn3 b/ttcn/Security/LibItsSecurity_Functions.ttcn3 index a6908dac..c5dbc605 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn3 +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn3 @@ -24,7 +24,8 @@ module LibItsSecurity_Functions { import from LibItsSecurity_Templates all; import from LibItsSecurity_Pixits all; import from LibItsSecurity_TestSystem all; - import from LibItsSecurity_EncdecDeclarations all; +//FIXME(DF) UNUSED +// import from LibItsSecurity_EncdecDeclarations all; group helpersFunctions { @@ -191,7 +192,8 @@ module LibItsSecurity_Functions { // Local variables var octetstring v_secPayload, v_signature; - var Oct32 v_hash; +//FIXME(DF) UNUSED +// var Oct32 v_hash; var template (value) ToBeSignedSecuredMessage v_toBeSignedSecuredMessage; var integer i, j, k, n; var HeaderFields v_headerFields := {}; @@ -263,7 +265,7 @@ module LibItsSecurity_Functions { return false; } } else { - if(not f_readSigningKey(valueof(cc_taCert_A), v_privateKey)){ + if(not f_readSigningKey(cc_taCert_A, v_privateKey)){ return false; } } @@ -319,7 +321,8 @@ module LibItsSecurity_Functions { // Local variables var octetstring v_secPayload, v_signature; - var Oct32 v_hash; +// FIXME(DF)UNUSED +// var Oct32 v_hash; var template (value) ToBeSignedSecuredMessage v_toBeSignedSecuredMessage; var integer i, j, k, n; var HeaderFields v_headerFields := {}; @@ -405,7 +408,7 @@ module LibItsSecurity_Functions { return false; } } else { - if(not f_readSigningKey(valueof(cc_taCert_A), v_privateKey)){ + if(not f_readSigningKey(cc_taCert_A, v_privateKey)){ return false; } } @@ -948,7 +951,8 @@ module LibItsSecurity_Functions { in charstring p_certificateName ) runs on ItsSecurityBaseComponent return HashedId8 { // Local variables - var Certificate v_atCertificate; +// FIXME (DF) UNUSED +// var Certificate v_atCertificate; var HashedId8 v_hashedId8 := '0000000000000000'O; // Sanity check @@ -1044,7 +1048,8 @@ module LibItsSecurity_Functions { // Local variables var octetstring v_secPayload; var octetstring v_signedData; - var Oct32 v_hash; +// FIXME (DF) UNUSED +// var Oct32 v_hash; var integer v_counter; var boolean v_result := false; var template (value) ToBeSignedSecuredMessage v_toBeSignedSecuredMessage; @@ -1203,7 +1208,8 @@ module LibItsSecurity_Functions { function f_loadCertificates( in charstring p_configId ) runs on ItsSecurityBaseComponent return boolean { - var boolean v_result; +// FIXME (DF) UNUSED +// var boolean v_result; // Setup certificates memory cache if (fx_loadCertificates(PX_CERTIFICATE_POOL_PATH, p_configId) == true) { @@ -1848,7 +1854,8 @@ module LibItsSecurity_Functions { in template (value) RectangularRegion p_rectangular_region, out PolygonalRegion p_region ) return boolean { - var integer v_counter := 0; +// FIXME (DF) UNUSED +// var integer v_counter := 0; // Convert rectangular regions to polygons and check polygons p_region[0] := valueof(p_rectangular_region.northwest); diff --git a/ttcn/SremSsem/LibItsSremSsem_EncdecDeclarations.ttcn b/ttcn/SremSsem/LibItsSremSsem_EncdecDeclarations.ttcn index d86dfd1b..bc906abf 100644 --- a/ttcn/SremSsem/LibItsSremSsem_EncdecDeclarations.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_EncdecDeclarations.ttcn @@ -1,6 +1,6 @@ module LibItsSremSsem_EncdecDeclarations { -import from IS_DSRC all; +import from DSRC all; external function fx_enc_SSM (SignalStatusMessage p) return octetstring with {extension "prototype(convert) encode(BER:BER_ENCODE_CER)"} -- GitLab From 48eacf5356bc461cd01764b1cf1f33e920108d63 Mon Sep 17 00:00:00 2001 From: filatov Date: Thu, 9 Feb 2017 17:32:08 +0000 Subject: [PATCH 006/320] TITANISATION: UT and AC messages (Common, CAM, DENM, BTP) --- ttcn/BTP/LibItsBtp_Functions.ttcn | 4 +- ttcn/BTP/LibItsBtp_TestSystem.ttcn | 4 +- ttcn/BTP/LibItsBtp_TypesAndValues.ttcn | 7 ++- ttcn/CAM/LibItsCam_Functions.ttcn | 12 +++-- ttcn/CAM/LibItsCam_TestSystem.ttcn | 8 ++- ttcn/CAM/LibItsCam_TypesAndValues.ttcn | 8 ++- ttcn/Common/LibItsCommon_Templates.ttcn | 14 ++++-- ttcn/Common/LibItsCommon_TypesAndValues.ttcn | 49 ++++++++++++++++--- ttcn/DENM/LibItsDenm_Functions.ttcn | 20 ++++++-- ttcn/DENM/LibItsDenm_Templates.ttcn | 8 ++- ttcn/DENM/LibItsDenm_TestSystem.ttcn | 11 +++-- ttcn/DENM/LibItsDenm_TypesAndValues.ttcn | 13 ++++- .../LibItsGeoNetworking_TypesAndValues.ttcn | 4 +- 13 files changed, 128 insertions(+), 34 deletions(-) diff --git a/ttcn/BTP/LibItsBtp_Functions.ttcn b/ttcn/BTP/LibItsBtp_Functions.ttcn index dac1f2cb..8f31833c 100644 --- a/ttcn/BTP/LibItsBtp_Functions.ttcn +++ b/ttcn/BTP/LibItsBtp_Functions.ttcn @@ -41,7 +41,9 @@ utPort.send(p_init); tc_wait.start; alt { - [] utPort.receive(UtInitializeResult:true) { +//FIXME RGY As discussed, port in type is changed to a top-level union type +// [] utPort.receive(UtInitializeResult:true) { + [] utPort.receive(UtCommonResults:{utInitializeResult:=true}) { tc_wait.stop; log("*** f_utInitializeIut: INFO: IUT initialized ***"); } diff --git a/ttcn/BTP/LibItsBtp_TestSystem.ttcn b/ttcn/BTP/LibItsBtp_TestSystem.ttcn index 4c7929d9..e131d71a 100644 --- a/ttcn/BTP/LibItsBtp_TestSystem.ttcn +++ b/ttcn/BTP/LibItsBtp_TestSystem.ttcn @@ -29,7 +29,9 @@ module LibItsBtp_TestSystem { out UtInitialize, UtBtpTrigger; in - UtInitializeResult, UtBtpTriggerResult, UtBtpEventInd; +//FIXME RGY!!! As discussed, list of booleans is changed by a top-level union type +// UtInitializeResult, UtBtpTriggerResult, UtBtpEventInd; + UtCommonResults, UtBtpTriggerResult, UtBtpEventInd; } // end UpperTesterPort } // end portDefinitions diff --git a/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn b/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn index c2ca46ef..cad2ced6 100644 --- a/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn +++ b/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn @@ -145,7 +145,12 @@ module LibItsBtp_TypesAndValues { GenerateBtpB btpB } - type boolean UtBtpTriggerResult; +//FIXME RGY As discussed, boolean results are replaced by a union of the results +// type boolean UtBtpTriggerResult; + type union UtBtpResults { + boolean utBtpTriggerResult + } + type UtBtpResults.utBtpTriggerResult UtBtpTriggerResult; /** * @desc Upper Tester message to request triggering of an BTPA message at IUT diff --git a/ttcn/CAM/LibItsCam_Functions.ttcn b/ttcn/CAM/LibItsCam_Functions.ttcn index e44b8b30..b1c443da 100644 --- a/ttcn/CAM/LibItsCam_Functions.ttcn +++ b/ttcn/CAM/LibItsCam_Functions.ttcn @@ -49,7 +49,9 @@ module LibItsCam_Functions { utPort.send(p_init); tc_wait.start; alt { - [] utPort.receive(UtInitializeResult:true) { +//FIXME RGY As discussed, port in type is changed to a top-level union type +// [] utPort.receive(UtInitializeResult:true) { + [] utPort.receive(UtCommonResults:{utInitializeResult:=true}) { tc_wait.stop; log("*** f_utInitializeIut: INFO: IUT initialized ***"); } @@ -81,7 +83,9 @@ module LibItsCam_Functions { utPort.send(p_event); tc_wait.start; alt { - [] utPort.receive(UtCamTriggerResult:true) { +//FIXME RGY As discussed, port in type is changed to a top-level union type +// [] utPort.receive(UtCamTriggerResult:true) { + [] utPort.receive(UpperTesterCamResults:{utCamTriggerResult:=true}) { tc_wait.stop; } [] utPort.receive { @@ -107,7 +111,9 @@ module LibItsCam_Functions { utPort.send(p_position); alt { - [] utPort.receive(UtChangePositionResult:?) { +//FIXME RGY As discussed, port in type is changed to a top-level union type +// [] utPort.receive(UtChangePositionResult:?) { + [] utPort.receive(UtCommonResults:{utChangePositionResult:=?}) { tc_wait.stop; } [] utPort.receive { diff --git a/ttcn/CAM/LibItsCam_TestSystem.ttcn b/ttcn/CAM/LibItsCam_TestSystem.ttcn index 01f8ca7b..bbc4cab3 100644 --- a/ttcn/CAM/LibItsCam_TestSystem.ttcn +++ b/ttcn/CAM/LibItsCam_TestSystem.ttcn @@ -37,7 +37,9 @@ module LibItsCam_TestSystem { out AcGnssPrimitive, AcSecPrimitive; in - AcGnssResponse, AcGnssDistanceCovered, AcSecResponse; +//FIXME RGY As discussed, list of boolean result responses is collected into a top-level union +// AcGnssResponse, AcGnssDistanceCovered, AcSecResponse; + AdapterControlResults; } // end AdapterControlPort /** @@ -47,7 +49,9 @@ module LibItsCam_TestSystem { out UtInitialize, UtCamTrigger, UtChangePosition, UtActivatePositionTime, UtDeactivatePositionTime; in - UtInitializeResult, UtCamTriggerResult, UtChangePositionResult, UtActivatePositionTimeResult, UtDeactivatePositionTimeResult, UtCamEventInd; +//FIXME RGY As discussed, list of boolean result responses is collected into a top-level union +// UtInitializeResult, UtCamTriggerResult, UtChangePositionResult, UtActivatePositionTimeResult, UtDeactivatePositionTimeResult, UtCamEventInd; + UtCommonResults, UpperTesterCamResults, UtCamEventInd; } // end UpperTesterPort } // end portDefinitions diff --git a/ttcn/CAM/LibItsCam_TypesAndValues.ttcn b/ttcn/CAM/LibItsCam_TypesAndValues.ttcn index 5490fea5..f215e973 100644 --- a/ttcn/CAM/LibItsCam_TypesAndValues.ttcn +++ b/ttcn/CAM/LibItsCam_TypesAndValues.ttcn @@ -104,7 +104,13 @@ module LibItsCam_TypesAndValues { /** * @desc Upper Tester result message of request of triggering of an event at IUT */ - type boolean UtCamTriggerResult; +//FIXME RGY As discussed, simple boolean responses are collected to a union for forward compatibility +// type boolean UtCamTriggerResult; + type union UpperTesterCamResults { + boolean utCamTriggerResult + } + + type UpperTesterCamResults.utCamTriggerResult UtCamTriggerResult; /** * @desc Upper Tester message to check event/status on CAM IUT diff --git a/ttcn/Common/LibItsCommon_Templates.ttcn b/ttcn/Common/LibItsCommon_Templates.ttcn index 16f4f7c5..f172b4ed 100644 --- a/ttcn/Common/LibItsCommon_Templates.ttcn +++ b/ttcn/Common/LibItsCommon_Templates.ttcn @@ -18,7 +18,9 @@ module LibItsCommon_Templates { group taPrimitives { - template (value) AcSecResponse m_acSecResponseSuccess := true; +//FIXME RGY the simple boolean result has been changed to a union +// template (value) AcSecResponse m_acSecResponseSuccess := true; + template (value) AdapterControlResults m_acSecResponseSuccess := {acSecResponse:=true}; /** * @desc Enable security support @@ -42,9 +44,13 @@ module LibItsCommon_Templates { } } // End of template m_acDisableSecurity - template AcGnssResponse m_acGnssResponseSuccess := true; - - template AcGnssDistanceCovered m_acGnssDistanceCovered := true; +//FIXME RGY As discussed, port in type is changed to a top-level union type +// template AcGnssResponse m_acGnssResponseSuccess := true; + template AdapterControlResults m_acGnssResponseSuccess := {acGnssResponse:=true}; + +//FIXME RGY As discussed, port in type is changed to a top-level union type +// template AcGnssDistanceCovered m_acGnssDistanceCovered := true; + template AdapterControlResults m_acGnssDistanceCovered := {acGnssDistanceCovered:=true}; /** * @desc Testsystem will load GNSS scenario diff --git a/ttcn/Common/LibItsCommon_TypesAndValues.ttcn b/ttcn/Common/LibItsCommon_TypesAndValues.ttcn index 190b93ce..911ed5fa 100644 --- a/ttcn/Common/LibItsCommon_TypesAndValues.ttcn +++ b/ttcn/Common/LibItsCommon_TypesAndValues.ttcn @@ -30,7 +30,19 @@ module LibItsCommon_TypesAndValues { /** * @desc Upper Tester result message of the initialization request */ - type boolean UtInitializeResult; +//FIXME RGY As discussed, Commom top level type for UT results + type union UtCommonResults { + boolean utInitializeResult, + boolean utChangePositionResult, + boolean utChangePseudonymResult, + boolean utActivatePositionTimeResult, + boolean utDeactivatePositionTimeResult, + boolean utIvimTerminationResult + } + +//FIXME RGY As discussed, type is changed to a type derived from UpperTesterResultTypes +// type boolean UtInitializeResult; + type UtCommonResults.utInitializeResult UtInitializeResult; /** * @desc Upper Tester message to change the position of IUT. Values a relatives @@ -44,7 +56,9 @@ module LibItsCommon_TypesAndValues { /** * @desc Upper Tester result message of change position request of IUT */ - type boolean UtChangePositionResult; +//FIXME RGY As discussed, type is changed to a type derived from UpperTesterResultTypes +// type boolean UtChangePositionResult; + type UtCommonResults.utChangePositionResult UtChangePositionResult; /** * @desc Upper Tester message to change the pseudonym of the DENM IUT @@ -56,7 +70,9 @@ module LibItsCommon_TypesAndValues { /** * @desc Upper Tester result message of the change pseudonym request */ - type boolean UtChangePseudonymResult; +//FIXME RGY As discussed, type is changed to a type derived from UpperTesterResultTypes +// type boolean UtChangePseudonymResult; + type UtCommonResults.utChangePseudonymResult UtChangePseudonymResult; /** * @desc Upper Tester message to activate position and/or time @@ -68,7 +84,9 @@ module LibItsCommon_TypesAndValues { /** * @desc Upper Tester result message of the activate position and/or time request */ - type boolean UtActivatePositionTimeResult; +//FIXME RGY As discussed, type is changed to a type derived from UpperTesterResultTypes +// type boolean UtActivatePositionTimeResult; + type UtCommonResults.utActivatePositionTimeResult UtActivatePositionTimeResult; /** * @desc Upper Tester message to deactivate position and/or time @@ -80,7 +98,9 @@ module LibItsCommon_TypesAndValues { /** * @desc Upper Tester result message of the deactivate position and/or time request */ - type boolean UtDeactivatePositionTimeResult; +//FIXME RGY As discussed, type is changed to a type derived from UpperTesterResultTypes +// type boolean UtDeactivatePositionTimeResult; + type UtCommonResults.utDeactivatePositionTimeResult UtDeactivatePositionTimeResult; } with { @@ -118,7 +138,9 @@ module LibItsCommon_TypesAndValues { /** * @desc Primitive for receiving response from TA */ - type boolean AcSecResponse; +//FIXME RGY As discussed, type is changed to a type derived from AdapterControlResults +// type boolean AcSecResponse; + type AdapterControlResults.acSecResponse AcSecResponse; /** * @desc TA primitives for GNSS @@ -139,12 +161,23 @@ module LibItsCommon_TypesAndValues { /** * @desc Primitive for receiving response from TA */ - type boolean AcGnssResponse; +//FIXME RGY As discussed, Commom adapter control results are collected to a top-level union type + type union AdapterControlResults { + boolean acGnssResponse, + boolean acGnssDistanceCovered, + boolean acSecResponse + } + +//FIXME RGY As discussed, boolean results are replaced by related fields of the top-level reult union +// type boolean AcGnssResponse; + type AdapterControlResults.acGnssResponse AcGnssResponse; /** * @desc Primitive for receiving an indication if requested distance was covered from TA */ - type boolean AcGnssDistanceCovered; +//FIXME RGY As discussed, boolean results are replaced by related fields of the top-level reult union +// type boolean AcGnssDistanceCovered; + type AdapterControlResults.acGnssDistanceCovered AcGnssDistanceCovered; /** * @desc Primitive for loading a scenario diff --git a/ttcn/DENM/LibItsDenm_Functions.ttcn b/ttcn/DENM/LibItsDenm_Functions.ttcn index 8ca735f1..d028ce79 100644 --- a/ttcn/DENM/LibItsDenm_Functions.ttcn +++ b/ttcn/DENM/LibItsDenm_Functions.ttcn @@ -47,7 +47,9 @@ module LibItsDenm_Functions { utPort.send(p_init); tc_wait.start; alt { - [] utPort.receive(UtInitializeResult:true) { +//FIXME RGY As discussed, port in type is changed to a top-level union type +// [] utPort.receive(UtInitializeResult:true) { + [] utPort.receive(UtCommonResults:{utInitializeResult:=true}) { tc_wait.stop; log("*** " & testcasename() & ": INFO: IUT initialized ***"); } @@ -77,11 +79,15 @@ module LibItsDenm_Functions { utPort.send(p_change); tc_wait.start; alt { - [] utPort.receive(UtChangePseudonymResult:true) { +//FIXME RGY As discussed, port in type is changed to a top-level union type +// [] utPort.receive(UtChangePseudonymResult:true) { + [] utPort.receive(UtCommonResults:{utChangePseudonymResult:=true}) { tc_wait.stop; log("*** " & testcasename() & ": INFO: IUT pseudonym changed ***"); } - [] utPort.receive(UtChangePseudonymResult:false) { +//FIXME RGY As discussed, port in type is changed to a top-level union type +// [] utPort.receive(UtChangePseudonymResult:false) { + [] utPort.receive(UtCommonResults:{utChangePseudonymResult:=false}) { tc_wait.stop; log("*** " & testcasename() & ": INFO: IUT pseudonym changed ***"); f_selfOrClientSyncAndVerdict("error", e_error); @@ -181,7 +187,9 @@ module LibItsDenm_Functions { utPort.send(p_event); tc_wait.start; alt { - [] utPort.receive(UtDenmTerminationResult:?) { +//FIXME RGY As discussed, port in type is changed to a top-level union type +// [] utPort.receive(UtDenmTerminationResult:?) { + [] utPort.receive(UtDENMResults:{utDenmTerminationResult:=?}) { tc_wait.stop; } [] tc_wait.timeout { @@ -212,7 +220,9 @@ module LibItsDenm_Functions { utPort.send(p_position); tc_wait.start; alt { - [] utPort.receive(UtChangePositionResult:?) { +//FIXME RGY As discussed, port in type is changed to a top-level union type +// [] utPort.receive(UtChangePositionResult:?) { + [] utPort.receive(UtCommonResults:{utChangePositionResult:=?}) { tc_wait.stop; } [] tc_wait.timeout { diff --git a/ttcn/DENM/LibItsDenm_Templates.ttcn b/ttcn/DENM/LibItsDenm_Templates.ttcn index bba70087..70e1d7fb 100644 --- a/ttcn/DENM/LibItsDenm_Templates.ttcn +++ b/ttcn/DENM/LibItsDenm_Templates.ttcn @@ -583,7 +583,9 @@ module LibItsDenm_Templates { eventPosition := ?, relevanceDistance := *, relevanceTrafficDirection := *, - validityDuration := *, // It seems that a default value can be omitted (asn1studio) +//FIXME (DF) validityDuration is set as mandatory, '*' can not be assigned to it +// validityDuration := *, // It seems that a default value can be omitted (asn1studio) + validityDuration := ?, // It seems that a default value can be omitted (asn1studio) transmissionInterval := *, stationType := ? } @@ -710,7 +712,9 @@ module LibItsDenm_Templates { deltaLongitude := 0, deltaAltitude := 0 }, - pathDeltaTime := 0 +//FIXME (DF) pathDeltaTime == 0 is not compatible with PathDeltaTime range definition +// pathDeltaTime := 0 + pathDeltaTime := 1 } } }, diff --git a/ttcn/DENM/LibItsDenm_TestSystem.ttcn b/ttcn/DENM/LibItsDenm_TestSystem.ttcn index 0338ea3e..4c26f5f0 100644 --- a/ttcn/DENM/LibItsDenm_TestSystem.ttcn +++ b/ttcn/DENM/LibItsDenm_TestSystem.ttcn @@ -37,7 +37,9 @@ module LibItsDenm_TestSystem { out AcGnssPrimitive, AcSecPrimitive; in - AcGnssResponse, AcGnssDistanceCovered, AcSecResponse; +//FIXME RGY!!! As discussed, list of booleans is changed by a top-level union type +// AcGnssResponse, AcGnssDistanceCovered, AcSecResponse; + AdapterControlResults } // end AdapterControlPort /** @@ -47,8 +49,11 @@ module LibItsDenm_TestSystem { out UtInitialize, UtDenmTrigger, UtDenmUpdate, UtDenmTermination, UtChangePosition, UtChangePseudonym; in - UtInitializeResult, UtDenmTriggerResult, UtDenmUpdateResult, UtDenmTerminationResult, - UtChangePositionResult, UtChangePseudonymResult, UtDenmEventInd; +//FIXME RGY! As discussed, list of booleans is changed by a top-level union type +// UtInitializeResult, UtDenmTriggerResult, UtDenmUpdateResult, UtDenmTerminationResult, +// UtChangePositionResult, UtChangePseudonymResult, UtDenmEventInd; + UtCommonResults, UtDENMResults, UtDenmTriggerResult, + UtDenmUpdateResult, UtDenmEventInd; } // end UpperTesterPort } // end portDefinitions diff --git a/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn b/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn index e50be376..6ecc3c80 100644 --- a/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn +++ b/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn @@ -117,11 +117,20 @@ module LibItsDenm_TypesAndValues { ActionID actionId } +//FIXME RGY As discussed, boolean result types are replaced by a top-level union of the results /** - * @desc Upper Tester result message of termination of an event on DENM IUT + * @desc Upper Tester response message for all DENM results */ - type boolean UtDenmTerminationResult; + type union UtDENMResults { + boolean utDenmTerminationResult + } + /** + * @desc Upper Tester result message of termination of an event on DENM IUT + */ +//FIXME RGY As discussed, boolean result types are replaced by a top-level union type +// type boolean UtDenmTerminationResult; + type UtDENMResults.utDenmTerminationResult UtDenmTerminationResult; /** * @desc Upper Tester message to check event/status on DENM IUT */ diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn index eb565403..4dfef02d 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn @@ -1008,7 +1008,9 @@ module LibItsGeoNetworking_TypesAndValues { } // end utPrimitives with { - encode "UpperTester" +//FIXME RGY temporarily changed to RAW, until encoding functions are changed to UpperTester +// encode "UpperTester" + encode "RAW"; variant "" } group acPrimitives { -- GitLab From 6dd7b23e82b482b3d3b6f4d6b82d72e30c8eae34 Mon Sep 17 00:00:00 2001 From: filatov Date: Mon, 6 Mar 2017 09:53:55 +0000 Subject: [PATCH 007/320] Separation of asn.1 modules of IS --- .../{ => ETSI_TS_103301}/ETSI_TS_103301.asn | 0 .../ETSI_TS_103301/IVIM_PDU_Descriptions.asn | 26 + .../ETSI_TS_103301/MAPEM_PDU_Descriptions.asn | 25 + .../SPATEM_PDU_Descriptions.asn | 27 + .../ETSI_TS_103301/SREM_PDU_Descriptions.asn | 24 + .../ETSI_TS_103301/SSEM_PDU_Descriptions.asn | 25 + .../AVIAEINumberingAndDataStructures.asn} | 0 .../EfcDsrcApplication.asn} | 0 .../EfcDsrcGeneric.asn} | 0 .../CITSapplMgmtIDs.asn} | 0 asn1/IS/ISO_TS_19091/AddGrpC.asn | 124 ++ asn1/IS/ISO_TS_19091/AddGrpC_noCircular.asn | 30 + asn1/IS/ISO_TS_19091/DSRC.asn | 1913 +++++++++++++++++ .../ISO_TS_19091/DSRC_REGION_noCircular.asn | 419 ++++ asn1/IS/{ => ISO_TS_19091}/ISO_TS_19091.asn | 0 asn1/IS/ISO_TS_19091/REGION.asn | 117 + .../IVI.asn} | 0 ...rationIdentificationVehicleDataModule.asn} | 0 18 files changed, 2730 insertions(+) rename asn1/IS/{ => ETSI_TS_103301}/ETSI_TS_103301.asn (100%) create mode 100755 asn1/IS/ETSI_TS_103301/IVIM_PDU_Descriptions.asn create mode 100755 asn1/IS/ETSI_TS_103301/MAPEM_PDU_Descriptions.asn create mode 100755 asn1/IS/ETSI_TS_103301/SPATEM_PDU_Descriptions.asn create mode 100755 asn1/IS/ETSI_TS_103301/SREM_PDU_Descriptions.asn create mode 100755 asn1/IS/ETSI_TS_103301/SSEM_PDU_Descriptions.asn rename asn1/IS/{ISO_TS_14816.asn => ISO_TS_14816/AVIAEINumberingAndDataStructures.asn} (100%) rename asn1/IS/{ISO_TS_14906_Application.asn => ISO_TS_14906/EfcDsrcApplication.asn} (100%) rename asn1/IS/{ISO_TS_14906_Generic.asn => ISO_TS_14906/EfcDsrcGeneric.asn} (100%) rename asn1/IS/{ISO_TS_17419.asn => ISO_TS_17419/CITSapplMgmtIDs.asn} (100%) create mode 100755 asn1/IS/ISO_TS_19091/AddGrpC.asn create mode 100644 asn1/IS/ISO_TS_19091/AddGrpC_noCircular.asn create mode 100755 asn1/IS/ISO_TS_19091/DSRC.asn create mode 100644 asn1/IS/ISO_TS_19091/DSRC_REGION_noCircular.asn rename asn1/IS/{ => ISO_TS_19091}/ISO_TS_19091.asn (100%) create mode 100755 asn1/IS/ISO_TS_19091/REGION.asn rename asn1/IS/{ISO_TS_19321.asn => ISO_TS_19321/IVI.asn} (100%) rename asn1/IS/{ISO_TS_24534-3.asn => ISO_TS_24534-3/ElectronicRegistrationIdentificationVehicleDataModule.asn} (100%) diff --git a/asn1/IS/ETSI_TS_103301.asn b/asn1/IS/ETSI_TS_103301/ETSI_TS_103301.asn similarity index 100% rename from asn1/IS/ETSI_TS_103301.asn rename to asn1/IS/ETSI_TS_103301/ETSI_TS_103301.asn diff --git a/asn1/IS/ETSI_TS_103301/IVIM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/IVIM_PDU_Descriptions.asn new file mode 100755 index 00000000..a3263b72 --- /dev/null +++ b/asn1/IS/ETSI_TS_103301/IVIM_PDU_Descriptions.asn @@ -0,0 +1,26 @@ +-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +-- +-- module: IVI-MESSAGE-PDU-Descriptions +-- +-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- + +IVIM-PDU-Descriptions { + itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts-103301 (103301) ivim (2) version1 (1) +} + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +IMPORTS +IviStructure FROM IVI {iso (1) standard (0) ivi (19321) version1 (1)} +ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1)}; + + +IVIM ::= SEQUENCE { + header ItsPduHeader, + ivi IviStructure +} + +END + diff --git a/asn1/IS/ETSI_TS_103301/MAPEM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/MAPEM_PDU_Descriptions.asn new file mode 100755 index 00000000..efad7d23 --- /dev/null +++ b/asn1/IS/ETSI_TS_103301/MAPEM_PDU_Descriptions.asn @@ -0,0 +1,25 @@ +-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +-- +-- module: MAP-MESSAGE-PDU-Descriptions +-- +-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- + +MAPEM-PDU-Descriptions { + itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts-103301 (103301) mapem (1) version1 (1) +} + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +IMPORTS +MapData FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } +ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1)}; + + +MAPEM ::= SEQUENCE { + header ItsPduHeader, + map MapData +} + +END diff --git a/asn1/IS/ETSI_TS_103301/SPATEM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/SPATEM_PDU_Descriptions.asn new file mode 100755 index 00000000..6adc54fa --- /dev/null +++ b/asn1/IS/ETSI_TS_103301/SPATEM_PDU_Descriptions.asn @@ -0,0 +1,27 @@ +-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +-- +-- module: SPAT-MESSAGE-PDU-Descriptions +-- +-- This ASN.1 was created: 30.08.2016 +-- +-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- + +SPATEM-PDU-Descriptions { + itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts-103301 (103301) spatem (0) version1 (1) +} + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +IMPORTS +SPAT FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } +ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) }; + + +SPATEM ::= SEQUENCE { + header ItsPduHeader, + spat SPAT +} + +END diff --git a/asn1/IS/ETSI_TS_103301/SREM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/SREM_PDU_Descriptions.asn new file mode 100755 index 00000000..8d584dec --- /dev/null +++ b/asn1/IS/ETSI_TS_103301/SREM_PDU_Descriptions.asn @@ -0,0 +1,24 @@ +-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +-- +-- module: SRM-MESSAGE-PDU-Descriptions +-- +-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- + +SREM-PDU-Descriptions { + itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts-103301 (103301) srem (3) version1 (1) +} + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +IMPORTS +SignalRequestMessage FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } +ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) }; + +SREM ::= SEQUENCE { + header ItsPduHeader, + srm SignalRequestMessage +} + +END diff --git a/asn1/IS/ETSI_TS_103301/SSEM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/SSEM_PDU_Descriptions.asn new file mode 100755 index 00000000..50e8b835 --- /dev/null +++ b/asn1/IS/ETSI_TS_103301/SSEM_PDU_Descriptions.asn @@ -0,0 +1,25 @@ +-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +-- +-- module: SSM-MESSAGE-PDU-Descriptions +-- +-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- + +SSEM-PDU-Descriptions { + itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts-103301 (103301) ssem (4) version1 (1) +} + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +IMPORTS +SignalStatusMessage FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } +ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) }; + + +SSEM ::= SEQUENCE { + header ItsPduHeader, + ssm SignalStatusMessage +} + +END diff --git a/asn1/IS/ISO_TS_14816.asn b/asn1/IS/ISO_TS_14816/AVIAEINumberingAndDataStructures.asn similarity index 100% rename from asn1/IS/ISO_TS_14816.asn rename to asn1/IS/ISO_TS_14816/AVIAEINumberingAndDataStructures.asn diff --git a/asn1/IS/ISO_TS_14906_Application.asn b/asn1/IS/ISO_TS_14906/EfcDsrcApplication.asn similarity index 100% rename from asn1/IS/ISO_TS_14906_Application.asn rename to asn1/IS/ISO_TS_14906/EfcDsrcApplication.asn diff --git a/asn1/IS/ISO_TS_14906_Generic.asn b/asn1/IS/ISO_TS_14906/EfcDsrcGeneric.asn similarity index 100% rename from asn1/IS/ISO_TS_14906_Generic.asn rename to asn1/IS/ISO_TS_14906/EfcDsrcGeneric.asn diff --git a/asn1/IS/ISO_TS_17419.asn b/asn1/IS/ISO_TS_17419/CITSapplMgmtIDs.asn similarity index 100% rename from asn1/IS/ISO_TS_17419.asn rename to asn1/IS/ISO_TS_17419/CITSapplMgmtIDs.asn diff --git a/asn1/IS/ISO_TS_19091/AddGrpC.asn b/asn1/IS/ISO_TS_19091/AddGrpC.asn new file mode 100755 index 00000000..733d324a --- /dev/null +++ b/asn1/IS/ISO_TS_19091/AddGrpC.asn @@ -0,0 +1,124 @@ +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- ISO TS 19091 +-- +-- This ASN.1 was generated: 30.08.2016 +-- +-- This document contains the addendunm extensions for Addgrp-C (e.g. Europe) +-- +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +-- +-- module: AddGrpC +-- ISO TS 19091 30.08.2016 + +-- +-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- + +AddGrpC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) addgrpc (0) version (1) } + + +DEFINITIONS AUTOMATIC TAGS::= BEGIN + +IMPORTS +--FIXME RGY all definitions are moved to IS-DSRC-noCircular to cut circular import loop +--NodeOffsetPointXY, NodeSetXY, PrioritizationResponseStatus, SignalGroupID, DeltaTime, LaneID FROM DSRC +NodeOffsetPointXY, NodeSetXY, PrioritizationResponseStatus, SignalGroupID, DeltaTime, LaneID FROM DSRC-REGION-noCircular +Altitude, StationID, DeltaAltitude FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) }; + + +ConnectionManeuverAssist-addGrpC ::= SEQUENCE { + itsStationPositions ItsStationPositionList OPTIONAL, + rsuGNSSOffset NodeOffsetPointXY OPTIONAL, + ... +} + +ConnectionTrajectory-addGrpC ::= SEQUENCE { + nodes NodeSetXY, + ... +} + +/*FIXME RGY moved to AddGrpC-noCircular to cut circular import loop +Control-addGrpC ::= SEQUENCE { + ptvRequest PtvRequestType, + ... +} +*/ + +IntersectionState-addGrpC ::= SEQUENCE { + activePrioritizations PrioritizationResponseList OPTIONAL, + ... +} + +MapData-addGrpC ::= SEQUENCE { + signalHeadLocations SignalHeadLocationList OPTIONAL, + ... +} + +Position3D-addGrpC ::= SEQUENCE { + altitude Altitude, + ... +} + +PrioritizationResponseList ::= SEQUENCE SIZE(1..10) OF PrioritizationResponse + +PrioritizationResponse ::= SEQUENCE { + stationID StationID, + priorState PrioritizationResponseStatus, + signalGroup SignalGroupID, + ... +} + +RestrictionUserType-addGrpC ::= SEQUENCE { + emission EmissionType OPTIONAL, + ... +} + +SignalHeadLocationList ::= SEQUENCE (SIZE(1..64)) OF SignalHeadLocation + +SignalHeadLocation ::= SEQUENCE { + nodeXY NodeOffsetPointXY, + nodeZ DeltaAltitude, + signalGroupID SignalGroupID, + ... +} + +SignalStatusPackage-addGrpC ::= SEQUENCE { + synchToSchedule DeltaTime OPTIONAL, + ... +} + + +ItsStationPositionList::= SEQUENCE SIZE(1..5) OF ItsStationPosition + +ItsStationPosition ::= SEQUENCE { + stationID StationID, + laneID LaneID OPTIONAL, + nodeXY NodeOffsetPointXY OPTIONAL, + timeReference TimeReference OPTIONAL, + ... +} +EmissionType ::= ENUMERATED { + euro1, + euro2, + euro3, + euro4, + euro5, + euro6, + ... +} + +/*FIXME RGY moved to AddGrpC-noCircular to cut circular import loop +PtvRequestType ::= ENUMERATED { + preRequest, + mainRequest, + doorCloseRequest, + cancelRequest, + emergencyRequest, + ... +} +*/ + +TimeReference ::= INTEGER { oneMilliSec(1) } (0..65535) + +END diff --git a/asn1/IS/ISO_TS_19091/AddGrpC_noCircular.asn b/asn1/IS/ISO_TS_19091/AddGrpC_noCircular.asn new file mode 100644 index 00000000..f7dcf5be --- /dev/null +++ b/asn1/IS/ISO_TS_19091/AddGrpC_noCircular.asn @@ -0,0 +1,30 @@ +--FIXME RGY moved here from file SPAT_MAP_ISO_TS_19091.asn + +-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +-- +-- module: AddGrpC +-- ISO TS 19091 30.08.2016 +-- +-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +--FIXME RGY definitions are moved here from AddGrpC; created to cut circular import loops amongst ASN.1 files +AddGrpC-noCircular { iso (1) standard (0) signalizedIntersection (19091) profilec(2) addgrpc (0) version (1) } + + +DEFINITIONS AUTOMATIC TAGS::= BEGIN + + +Control-addGrpC ::= SEQUENCE { + ptvRequest PtvRequestType, + ... +} + +PtvRequestType ::= ENUMERATED { + preRequest, + mainRequest, + doorCloseRequest, + cancelRequest, + emergencyRequest, + ... +} + +END diff --git a/asn1/IS/ISO_TS_19091/DSRC.asn b/asn1/IS/ISO_TS_19091/DSRC.asn new file mode 100755 index 00000000..6d9b86d8 --- /dev/null +++ b/asn1/IS/ISO_TS_19091/DSRC.asn @@ -0,0 +1,1913 @@ +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- ISO TS 19091 +-- +-- This ASN.1 was generated: 30.08.2016 +-- +-- This document contains the data element needed for the encoding the SPAT, MapData, SignalRequestMessage, SignalStatusMessage message +-- as defined in ISO TS 19091 and SAEJ2735 +-- +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +-- +-- module: DSRC +-- +-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- + +DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } + +DEFINITIONS AUTOMATIC TAGS::= BEGIN + +IMPORTS +--FIXME RGY definitions moved to module DSRC-REGION-noCircular are commented our below +StationID, Longitude, Latitude, SpeedConfidence FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) } +Reg-SPAT,Reg-SignalRequestMessage, Reg-SignalStatusMessage, Reg-MapData, Reg-AdvisorySpeed, Reg-ComputedLane, Reg-ConnectionManeuverAssist, +Reg-GenericLane, Reg-IntersectionGeometry, Reg-IntersectionState, Reg-LaneAttributes, /*Reg-LaneDataAttribute,*/ Reg-MovementEvent, Reg-MovementState, +/*Reg-NodeAttributeSetXY, Reg-NodeOffsetPointXY,*/ Reg-Position3D, Reg-RequestorDescription, Reg-RequestorType, Reg-RestrictionUserType, Reg-RoadSegment, +Reg-SignalControlZone, Reg-SignalRequestPackage, Reg-SignalRequest, Reg-SignalStatusPackage, Reg-SignalStatus FROM REGION {iso (1) standard (0) signalizedIntersection (19091) profilec(2) region (1) version (1)} + +--FIXME RGY definitions moved to DSRC-REGION-noCircular but also refernced here are re-imported +DeltaAngle, DeltaTime, LaneID, NodeSetXY, PrioritizationResponseStatus, RegionalExtension, SignalGroupID, SpeedLimitList, Velocity, +Reg-LaneDataAttribute, Reg-NodeAttributeSetXY, Reg-NodeOffsetPointXY FROM DSRC-REGION-noCircular +Iso3833VehicleType FROM ElectronicRegistrationIdentificationVehicleDataModule {iso(1) standard(0) iso24534 (24534) vehicleData (1) version (1)} +; + + +-- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ +-- +-- Start of entries from table Messages... +-- This table typicaly contains message entries. +-- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ +-- + +MessageFrame ::= SEQUENCE { + messageId MESSAGE-ID-AND-TYPE.&id({MessageTypes}), + value MESSAGE-ID-AND-TYPE.&Type({MessageTypes}{@.messageId}), + ... + } + +MESSAGE-ID-AND-TYPE ::= CLASS { + &id DSRCmsgID UNIQUE, + &Type + } WITH SYNTAX {&Type IDENTIFIED BY &id} + +MessageTypes MESSAGE-ID-AND-TYPE ::= { + { MapData IDENTIFIED BY mapData } | + { SPAT IDENTIFIED BY signalPhaseAndTimingMessage } | + { SignalRequestMessage IDENTIFIED BY signalRequestMessage } | + { SignalStatusMessage IDENTIFIED BY signalStatusMessage }, + ... -- Expansion to be used only by the SAE J2735 DSRC TC + } + + +/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop +-- Regional extensions support +REG-EXT-ID-AND-TYPE ::= CLASS { + &id RegionId UNIQUE, + &Type + } WITH SYNTAX {&Type IDENTIFIED BY &id} + +RegionalExtension {REG-EXT-ID-AND-TYPE : Set} ::= SEQUENCE { + regionId REG-EXT-ID-AND-TYPE.&id( {Set} ), + regExtValue REG-EXT-ID-AND-TYPE.&Type( {Set}{@regionId} ) + } +*/ + +SPAT ::= SEQUENCE { + timeStamp MinuteOfTheYear OPTIONAL, + name DescriptiveName OPTIONAL, + -- human readable name for this collection + -- to be used only in debug mode + + intersections IntersectionStateList, + -- sets of SPAT data (one per intersection) + + -- If PrioritizationResponse data is required, it is found + -- in the RegionalSPAT entry below + + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-SPAT}} OPTIONAL, + ... + } + +SignalRequestMessage ::= SEQUENCE { + timeStamp MinuteOfTheYear OPTIONAL, + second DSecond, + sequenceNumber MsgCount OPTIONAL, + + requests SignalRequestList OPTIONAL, + -- Request Data for one or more signalized + -- intersections that support SRM dialogs + + requestor RequestorDescription, + -- Requesting Device and other User Data + -- contains vehicle ID (if from a vehicle) + -- as well as type data and current position + -- and may contain additional transit data + + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-SignalRequestMessage}} OPTIONAL, + ... +} + +SignalStatusMessage ::= SEQUENCE { + timeStamp MinuteOfTheYear OPTIONAL, + second DSecond, + sequenceNumber MsgCount OPTIONAL, + + -- Status Data for one of more signalized intersections + status SignalStatusList, + + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-SignalStatusMessage}} OPTIONAL, + ... +} + +MapData ::= SEQUENCE { + timeStamp MinuteOfTheYear OPTIONAL, + msgIssueRevision MsgCount, + layerType LayerType OPTIONAL, + layerID LayerID OPTIONAL, + intersections IntersectionGeometryList OPTIONAL, + -- All Intersection definitions + roadSegments RoadSegmentList OPTIONAL, + -- All roadway descriptions + + dataParameters DataParameters OPTIONAL, + -- Any meta data regarding the map contents + + restrictionList RestrictionClassList OPTIONAL, + -- Any restriction ID tables which have + -- established for these map entries + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-MapData}} OPTIONAL, + + -- NOTE: + -- Other map data will be added here as it is defined + -- Examples of the type of content to be added include + -- curve warnings, construction routes, etc. + ... +} + + +-- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ +-- +-- Start of entries from table Data_Frames... +-- This table typicaly contains data frame entries. +-- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ +-- + +AdvisorySpeed ::= SEQUENCE { + type AdvisorySpeedType, + -- the type of advisory which this is. + speed SpeedAdvice OPTIONAL, + -- See Section 11 for converting and translating speed + -- expressed in mph into units of m/s + -- This element is optional ONLY when superceded + -- by the presence of a regional speed element found in + -- Reg-AdvisorySpeed entry + confidence SpeedConfidence OPTIONAL, + -- A confidence value for the above speed + distance ZoneLength OPTIONAL, + -- Unit = 1 meter, + -- The distance indicates the region for which the advised speed + -- is recommended, it is specified upstream from the stop bar + -- along the connected egressing lane + class RestrictionClassID OPTIONAL, + -- the vehicle types to which it applies + -- when absent, the AdvisorySpeed applies to + -- all motor vehicle types + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-AdvisorySpeed}} OPTIONAL, + ... + } + +AdvisorySpeedList ::= SEQUENCE (SIZE(1..16)) OF AdvisorySpeed + +ComputedLane ::= SEQUENCE { + -- Data needed to created a computed lane + referenceLaneId LaneID, + -- the lane ID upon which this + -- computed lane will be based + -- Lane Offset in X and Y direction + offsetXaxis CHOICE { + small DrivenLineOffsetSm, + large DrivenLineOffsetLg + }, + offsetYaxis CHOICE { + small DrivenLineOffsetSm, + large DrivenLineOffsetLg + }, + -- A path X offset value for translations of the + -- path's points when creating translated lanes. + -- The values found in the reference lane are + -- all offset based on the X and Y values from + -- the coordinates of the reference lane's + -- initial path point. + -- Lane Rotation + rotateXY Angle OPTIONAL, + -- A path rotation value for the entire lane + -- Observe that this rotates the existing orientation + -- of the referenced lane, it does not replace it. + -- Rotation occurs about the initial path point. + -- Lane Path Scale (zooming) + scaleXaxis Scale-B12 OPTIONAL, + scaleYaxis Scale-B12 OPTIONAL, + -- value for translations or zooming of the path's + -- points. The values found in the reference lane + -- are all expanded or contracted based on the X + -- and Y and width values from the coordinates of + -- the reference lane's initial path point. + -- The Z axis remains untouched. + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-ComputedLane}} OPTIONAL, + ... + } +ConnectsToList ::= SEQUENCE (SIZE(1..16)) OF Connection + +ConnectingLane ::= SEQUENCE { + lane LaneID, -- Index of the connecting lane + maneuver AllowedManeuvers OPTIONAL + -- The Maneuver between + -- the enclosing lane and this lane + -- at the stop line to connect them + } + + +Connection ::= SEQUENCE { + -- The subject lane connecting to this lane is: + connectingLane ConnectingLane, + -- The index of the connecting lane and also + -- the maneuver from the current lane to it + remoteIntersection IntersectionReferenceID OPTIONAL, + -- This entry is only used when the + -- indicated connecting lane belongs + -- to another intersection layout. This + -- provides a means to create meshes of lanes + + -- SPAT mapping details at the stop line are: + signalGroup SignalGroupID OPTIONAL, + -- The matching signal group send by + -- the SPAT message for this lane/maneuver. + -- Shall be present unless the connectingLane + -- has no signal group (is un-signalized) + userClass RestrictionClassID OPTIONAL, + -- The Restriction Class of users this applies to + -- The use of some lane/maneuver and SignalGroupID + -- pairings are restricted to selected users. + -- When absent, the SignalGroupID applies to all + + -- Movement assist details are given by: + connectionID LaneConnectionID OPTIONAL + -- An optional connection index used to + -- relate this lane connection to any dynamic + -- clearance data in the SPAT. Note that + -- the index may be shared with other + -- connections if the clearance data is common + } + + +ConnectionManeuverAssist ::= SEQUENCE { + connectionID LaneConnectionID, + -- the common connectionID used by all lanes to which + -- this data applies + -- (this value traces to ConnectsTo entries in lanes) + -- Expected Clearance Information + queueLength ZoneLength OPTIONAL, + -- Unit = 1 meter, 0 = no queue + -- The distance from the stop line to the back + -- edge of the last vehicle in the queue, + -- as measured along the lane center line. + availableStorageLength ZoneLength OPTIONAL, + -- Unit = 1 meter, 0 = no space remains + -- Distance (e.g. beginning from the downstream + -- stop-line up to a given distance) with a high + -- probability for successfully executing the + -- connecting maneuver between the two lanes + -- during the current cycle. + -- Used for enhancing the awareness of vehicles + -- to anticipate if they can pass the stop line + -- of the lane. Used for optimizing the green wave, + -- due to knowledge of vehicles waiting in front + -- of a red light (downstream). + -- The element nextTime in TimeChangeDetails + -- in the containing data frame contains the next + -- timemark at which an active phase is expected, + -- a form of storage flush interval. + waitOnStop WaitOnStopline OPTIONAL, + -- If "true", the vehicles on this specific connecting + -- maneuver have to stop on the stop-line and not + -- to enter the collision area + pedBicycleDetect PedestrianBicycleDetect OPTIONAL, + -- true if ANY ped or bicycles are detected crossing + -- the above lanes. Set to false ONLY if there is a + -- high certainty that there are none present, + -- otherwise element is not sent. + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-ConnectionManeuverAssist}} OPTIONAL, + ... + } + +DataParameters ::= SEQUENCE { + processMethod IA5String(SIZE(1..255)) OPTIONAL, + processAgency IA5String(SIZE(1..255)) OPTIONAL, + lastCheckedDate IA5String(SIZE(1..255)) OPTIONAL, + geoidUsed IA5String(SIZE(1..255)) OPTIONAL, + ... + } + +EnabledLaneList ::= SEQUENCE (SIZE(1..16)) OF LaneID + -- The unique ID numbers for each + -- lane object which is 'active' + -- as part of the dynamic map contents. + +GenericLane ::= SEQUENCE { + laneID LaneID, + -- The unique ID number assigned + -- to this lane object + name DescriptiveName OPTIONAL, + -- often for debug use only + -- but at times used to name ped crossings + ingressApproach ApproachID OPTIONAL, -- inbound + egressApproach ApproachID OPTIONAL, -- outbound + -- Approach IDs to which this lane belongs + laneAttributes LaneAttributes, + -- All Attribute information about + -- the basic selected lane type + -- Directions of use, Geometric co-sharing + -- and Type Specific Attributes + -- These Attributes are 'lane - global' that is, + -- they are true for the entire length of the lane + maneuvers AllowedManeuvers OPTIONAL, + -- the permitted maneuvers for this lane + nodeList NodeListXY, + -- Lane spatial path information as well as + -- various Attribute information along the node path + -- Attributes found here are more general and may + -- come and go over the length of the lane. + connectsTo ConnectsToList OPTIONAL, + -- a list of other lanes and their signal group IDs + -- each connecting lane and its signal group ID + -- is given, therefore this element provides the + -- information formerly in "signalGroups" in prior + -- editions. + overlays OverlayLaneList OPTIONAL, + -- A list of any lanes which have spatial paths that + -- overlay (run on top of, and not simply cross) + -- the path of this lane when used + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-GenericLane}} OPTIONAL, + ... + } + +IntersectionAccessPoint ::= CHOICE { + lane LaneID, + approach ApproachID, + connection LaneConnectionID, + ... + } + +IntersectionGeometry ::= SEQUENCE { + name DescriptiveName OPTIONAL, + -- For debug use only + id IntersectionReferenceID, + -- A globally unique value set, + -- consisting of a regionID and + -- intersection ID assignment + revision MsgCount, + + -- Required default values about lane descriptions follow + refPoint Position3D, -- The reference from which subsequent + -- data points are offset until a new + -- point is used. + laneWidth LaneWidth OPTIONAL, + -- Reference width used by all subsequent + -- lanes unless a new width is given + speedLimits SpeedLimitList OPTIONAL, + -- Reference regulatory speed limits + -- used by all subsequent + -- lanes unless a new speed is given + -- See Section 11 for converting and + -- translating speed expressed in mph + -- into units of m/s + -- Complete details regarding each lane type in this intersection + laneSet LaneList, -- Data about one or more lanes + -- (all lane data is found here) + + -- Data describing how to use and request preemption and + -- priority services from this intersection (if supported) + -- NOTE Additonal data may be added in the next release of the + -- standard at this point to handle this concept + preemptPriorityData PreemptPriorityList OPTIONAL, + -- data about one or more regional + -- preempt or priority zones + + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-IntersectionGeometry}} OPTIONAL, + ... + } + +IntersectionGeometryList ::= SEQUENCE (SIZE(1..32)) OF IntersectionGeometry + +IntersectionReferenceID ::= SEQUENCE { + region RoadRegulatorID OPTIONAL, + -- a globally unique regional assignment value + -- typical assigned to a regional DOT authority + -- the value zero shall be used for testing needs + id IntersectionID + -- a unique mapping to the intersection + -- in question within the above region of use + } + +IntersectionState ::= SEQUENCE { + name DescriptiveName OPTIONAL, + -- human readable name for intersection + -- to be used only in debug mode + id IntersectionReferenceID, + -- A globally unique value set, consisting of a + -- regionID and intersection ID assignment + -- provides a unique mapping to the + -- intersection MAP in question + -- which provides complete location + -- and approach/move/lane data + revision MsgCount, + status IntersectionStatusObject, + -- general status of the controller(s) + moy MinuteOfTheYear OPTIONAL, + -- Minute of current UTC year + -- used only with messages to be archived + timeStamp DSecond OPTIONAL, + -- the mSec point in the current UTC minute that + -- this message was constructed + enabledLanes EnabledLaneList OPTIONAL, + -- a list of lanes where the RevocableLane bit + -- has been set which are now active and + -- therefore part of the current intersection + states MovementList, + -- Each Movement is given in turn + -- and contains its signal phase state, + -- mapping to the lanes it applies to, and + -- point in time it will end, and it + -- may contain both active and future states + maneuverAssistList ManeuverAssistList OPTIONAL, + -- Assist data + + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-IntersectionState}} OPTIONAL, + ... + } + +IntersectionStateList ::= SEQUENCE (SIZE(1..32)) OF IntersectionState + +LaneAttributes ::= SEQUENCE { + directionalUse LaneDirection, -- directions of lane use + sharedWith LaneSharing, -- co-users of the lane path + laneType LaneTypeAttributes, -- specific lane type data + regional RegionalExtension {{Reg-LaneAttributes}} OPTIONAL + } + +/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop +LaneDataAttribute ::= CHOICE { + -- Segment attribute types and the data needed for each + pathEndPointAngle DeltaAngle, + -- adjusts final point/width slant + -- of the lane to align with the stop line + laneCrownPointCenter RoadwayCrownAngle, + -- sets the canter of the road bed + -- from centerline point + laneCrownPointLeft RoadwayCrownAngle, + -- sets the canter of the road bed + -- from left edge + laneCrownPointRight RoadwayCrownAngle, + -- sets the canter of the road bed + -- from right edge + laneAngle MergeDivergeNodeAngle, + -- the angle or direction of another lane + -- this is required to support Japan style + -- when a merge point angle is required + speedLimits SpeedLimitList, + -- Reference regulatory speed limits + -- used by all segments + + -- Add others as needed, in regional space + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-LaneDataAttribute}}, + ... + } + +LaneDataAttributeList ::= SEQUENCE (SIZE(1..8)) OF LaneDataAttribute +*/ + +LaneList ::= SEQUENCE (SIZE(1..255)) OF GenericLane + +LaneSharing ::= BIT STRING { + -- With bits as defined: + overlappingLaneDescriptionProvided (0), + -- Assert when another lane object is present to describe the + -- path of the overlapping shared lane + -- this construct is not used for lane objects which simply cross + multipleLanesTreatedAsOneLane (1), + -- Assert if the lane object path and width details represents + -- multiple lanes within it that are not further described + + -- Various modes and type of traffic that may share this lane: + otherNonMotorizedTrafficTypes (2), -- horse drawn etc. + individualMotorizedVehicleTraffic (3), + busVehicleTraffic (4), + taxiVehicleTraffic (5), + pedestriansTraffic (6), + cyclistVehicleTraffic (7), + trackedVehicleTraffic (8), + pedestrianTraffic (9) + } (SIZE (10)) + -- All zeros would indicate 'not shared' and 'not overlapping' + +LaneTypeAttributes ::= CHOICE { + vehicle LaneAttributes-Vehicle, -- motor vehicle lanes + crosswalk LaneAttributes-Crosswalk, -- pedestrian crosswalks + bikeLane LaneAttributes-Bike, -- bike lanes + sidewalk LaneAttributes-Sidewalk, -- pedestrian sidewalk paths + median LaneAttributes-Barrier, -- medians & channelization + striping LaneAttributes-Striping, -- roadway markings + trackedVehicle LaneAttributes-TrackedVehicle, -- trains and trolleys + parking LaneAttributes-Parking, -- parking and stopping lanes + ... + } + +ManeuverAssistList ::= SEQUENCE (SIZE(1..16)) OF ConnectionManeuverAssist + +MovementEventList ::= SEQUENCE (SIZE(1..16)) OF MovementEvent + +MovementEvent ::= SEQUENCE { + eventState MovementPhaseState, + -- Consisting of: + -- Phase state (the basic 11 states) + -- Directional, protected, or permissive state + + timing TimeChangeDetails OPTIONAL, + -- Timing Data in UTC time stamps for event + -- includes start and min/max end times of phase + -- confidence and estimated next occurrence + + speeds AdvisorySpeedList OPTIONAL, + -- various speed advisories for use by + -- general and specific types of vehicles + -- supporting green-wave and other flow needs + -- See Section 11 for converting and translating + -- speed expressed in mph into units of m/s + + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-MovementEvent}} OPTIONAL, + ... + } + +MovementList ::= SEQUENCE (SIZE(1..255)) OF MovementState + +MovementState ::= SEQUENCE { + movementName DescriptiveName OPTIONAL, + -- uniquely defines movement by name + -- human readable name for intersection + -- to be used only in debug mode + signalGroup SignalGroupID, + -- the group id is used to map to lists + -- of lanes (and their descriptions) + -- which this MovementState data applies to + -- see comments in the Remarks for usage details + state-time-speed MovementEventList, + -- Consisting of sets of movement data with: + -- a) SignalPhaseState + -- b) TimeChangeDetails, and + -- c) AdvisorySpeeds (optional ) + -- Note one or more of the movement events may be for + -- a future time and that this allows conveying multiple + -- predictive phase and movement timing for various uses + -- for the current signal group + maneuverAssistList ManeuverAssistList OPTIONAL, + -- This information may also be placed in the + -- IntersectionState when common information applies to + -- different lanes in the same way + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-MovementState}} OPTIONAL, + ... + } + +/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop +NodeAttributeSetXY ::= SEQUENCE { + localNode NodeAttributeXYList OPTIONAL, + -- Attribute states which pertain to this node point + disabled SegmentAttributeXYList OPTIONAL, + -- Attribute states which are disabled at this node point + enabled SegmentAttributeXYList OPTIONAL, + -- Attribute states which are enabled at this node point + -- and which remain enabled until disabled or the lane ends + data LaneDataAttributeList OPTIONAL, + -- Attributes which require an additional data values + -- some of these are local to the node point, while others + -- persist with the provided values until changed + -- and this is indicated in each entry + dWidth Offset-B10 OPTIONAL, + -- A value added to the current lane width + -- at this node and from this node onwards, in 1cm steps + -- lane width between nodes are a linear taper between pts + -- the value of zero shall not be sent here + dElevation Offset-B10 OPTIONAL, + -- A value added to the current Elevation + -- at this node from this node onwards, in 10cm steps + -- elevations between nodes are a linear taper between pts + -- the value of zero shall not be sent here + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-NodeAttributeSetXY}} OPTIONAL, + ... + } + +NodeAttributeXYList ::= SEQUENCE (SIZE(1..8)) OF NodeAttributeXY + +NodeAttributeXY ::= ENUMERATED { + -- Various values which pertain only to the current node point + + -- General Items + reserved, + stopLine, -- point where a mid-path stop line exists + -- See also 'do not block' for segments + + -- Path finish details + roundedCapStyleA, -- Used to control final path rounded end shape + -- with edge of curve at final point in a circle + roundedCapStyleB, -- Used to control final path rounded end shape + -- with edge of curve extending 50% of width past + -- final point in a circle + + -- Topography Points (items with no concept of a distance along the path) + mergePoint, -- Japan merge with 1 or more lanes + divergePoint, -- Japan diverge with 1 or more lanes + downstreamStopLine, -- Japan style downstream intersection + -- (a 2nd intersection) stop line + downstreamStartNode, -- Japan style downstream intersection + -- (a 2nd intersection) start node + + -- Pedestrian Support Attributes + closedToTraffic, -- where a pedestrian may NOT go + -- to be used during construction events + safeIsland, -- a pedestrian safe stopping point + -- also called a traffic island + -- This usage described a point feature on a path, + -- other entries can describe a path + curbPresentAtStepOff, -- the sidewalk to street curb is NOT + -- angled where it meets the edge of the + -- roadway (user must step up/down) + + -- Lane geometry details (see standard for defined shapes) + hydrantPresent, -- Or other services access + ... + } +*/ + +Node-LLmD-64b ::= SEQUENCE { + lon Longitude, + lat Latitude + } + + +/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop + Node-XY-20b ::= SEQUENCE { + x Offset-B10, + y Offset-B10 + } + +Node-XY-22b ::= SEQUENCE { + x Offset-B11, + y Offset-B11 + } + + +Node-XY-24b ::= SEQUENCE { + x Offset-B12, + y Offset-B12 + } + + +Node-XY-26b ::= SEQUENCE { + x Offset-B13, + y Offset-B13 + } + + +Node-XY-28b ::= SEQUENCE { + x Offset-B14, + y Offset-B14 + } + + +Node-XY-32b ::= SEQUENCE { + x Offset-B16, + y Offset-B16 + } +*/ + +NodeListXY ::= CHOICE { + nodes NodeSetXY, + -- a lane made up of two or more + -- XY node points and any attributes + -- defined in those nodes + computed ComputedLane, + -- a lane path computed by translating + -- the data defined by another lane + ... + } + +/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop +NodeOffsetPointXY ::= CHOICE { + -- Nodes with X,Y content + node-XY1 Node-XY-20b, -- node is within 5.11m of last node + node-XY2 Node-XY-22b, -- node is within 10.23m of last node + node-XY3 Node-XY-24b, -- node is within 20.47m of last node + node-XY4 Node-XY-26b, -- node is within 40.96m of last node + node-XY5 Node-XY-28b, -- node is within 81.91m of last node + node-XY6 Node-XY-32b, -- node is within 327.67m of last node + node-LatLon Node-LLmD-64b, -- node is a full 32b Lat/Lon range + regional RegionalExtension {{Reg-NodeOffsetPointXY}} + -- node which follows is of a + -- regional definition type + } + +NodeSetXY ::= SEQUENCE (SIZE(2..63)) OF NodeXY + +NodeXY ::= SEQUENCE { + delta NodeOffsetPointXY, + -- A choice of which X,Y offset value to use + -- this includes various delta values as well a regional choices + attributes NodeAttributeSetXY OPTIONAL, + -- Any optional Attributes which are needed + -- This includes changes to the current lane width and elevation + ... +} +*/ + +OverlayLaneList ::= SEQUENCE (SIZE(1..5)) OF LaneID + -- The unique ID numbers for any lane object which have + -- spatial paths that overlay (run on top of, and not + -- simply cross with) the current lane. + -- Such as a train path that overlays a motor vehicle + -- lane object for a roadway segment. + +Position3D ::= SEQUENCE { + lat Latitude, -- in 1/10th micro degrees + long Longitude, -- in 1/10th micro degrees + elevation Elevation OPTIONAL, -- in 10 cm units + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-Position3D}} OPTIONAL, + ... + } + +PreemptPriorityList ::= SEQUENCE (SIZE(1..32)) OF SignalControlZone + +/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop +RegulatorySpeedLimit ::= SEQUENCE { + type SpeedLimitType, + -- The type of regulatory speed which follows + speed Velocity + -- The speed in units of 0.02 m/s + -- See Section 11 for converting and translating + -- speed expressed in mph into units of m/s + } +*/ + +RequestorDescription ::= SEQUENCE { + id VehicleID, + -- The ID used in the BSM or CAM of the requestor + -- This ID is presumed not to change + -- during the exchange + type RequestorType OPTIONAL, + -- Information regarding all type and class data + -- about the requesting vehicle + position RequestorPositionVector OPTIONAL, + -- The location of the requesting vehicle + name DescriptiveName OPTIONAL, + -- A human readable name for debugging use + -- Support for Transit requests + routeName DescriptiveName OPTIONAL, + -- A string for transit operations use + transitStatus TransitVehicleStatus OPTIONAL, + -- current vehicle state (loading, etc.) + transitOccupancy TransitVehicleOccupancy OPTIONAL, + -- current vehicle occupancy + transitSchedule DeltaTime OPTIONAL, + -- current vehicle schedule adherence + + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-RequestorDescription}} OPTIONAL, + ... + } + +RequestorPositionVector ::= SEQUENCE { + position Position3D, + heading Angle OPTIONAL, + speed TransmissionAndSpeed OPTIONAL, + ... + } + +RequestorType ::= SEQUENCE { + -- Defines who is requesting + role BasicVehicleRole, -- Basic role of this user at this time + subrole RequestSubRole OPTIONAL, -- A local list with role based items + + -- Defines what kind of request (a level of importance in the Priority Scheme) + request RequestImportanceLevel OPTIONAL, -- A local list with request items + + -- Additional classification details + iso3883 Iso3833VehicleType OPTIONAL, + hpmsType VehicleType OPTIONAL, -- HPMS classification types + + regional RegionalExtension {{Reg-RequestorType}} OPTIONAL, + ... + } + +RestrictionClassAssignment ::= SEQUENCE { + id RestrictionClassID, + -- the unique value (within an intersection or local region) + -- that is assigned to this group of users + users RestrictionUserTypeList + -- The list of user types/classes + -- to which this restriction ID applies + } + +RestrictionClassList ::= SEQUENCE (SIZE(1..254)) OF RestrictionClassAssignment + +RestrictionUserTypeList ::= SEQUENCE (SIZE(1..16)) OF RestrictionUserType + +RestrictionUserType ::= CHOICE { + basicType RestrictionAppliesTo, + -- a set of the most commonly used types + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-RestrictionUserType}}, + ... + } + +RoadLaneSetList ::= SEQUENCE (SIZE(1..255)) OF GenericLane + +RoadSegmentReferenceID ::= SEQUENCE { + region RoadRegulatorID OPTIONAL, + -- a globally unique regional assignment value + -- typically assigned to a regional DOT authority + -- the value zero shall be used for testing needs + id RoadSegmentID + -- a unique mapping to the road segment + -- in question within the above region of use + -- during its period of assignment and use + -- note that unlike intersectionID values, + -- this value can be reused by the region + } + +RoadSegment ::= SEQUENCE { + name DescriptiveName OPTIONAL, + id RoadSegmentReferenceID, + -- a globally unique value for the segment + revision MsgCount, + -- Required default values about the descriptions to follow + refPoint Position3D, -- the reference from which subsequent + -- data points are offset until a new + -- point is used. + laneWidth LaneWidth OPTIONAL, + -- Reference width used by all subsequent + -- lanes unless a new width is given + speedLimits SpeedLimitList OPTIONAL, + -- Reference regulatory speed limits + -- used by all subsequent + -- lanes unless a new speed is given + -- See Section 11 for converting and + -- translating speed expressed in mph + -- into units of m/s + + -- Data describing disruptions in the RoadSegment + -- such as work zones etc will be added here; + -- in the US the SAE ITIS codes would be used here + -- The details regarding each lane type in the RoadSegment + roadLaneSet RoadLaneSetList, + + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-RoadSegment}} OPTIONAL, + ... + } + +RoadSegmentList ::= SEQUENCE (SIZE(1..32)) OF RoadSegment + +/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop +SegmentAttributeXYList ::= SEQUENCE (SIZE(1..8)) OF SegmentAttributeXY +*/ + +SignalControlZone ::= SEQUENCE { + zone RegionalExtension {{Reg-SignalControlZone}}, + ... + } + +SignalRequesterInfo ::= SEQUENCE { + -- These three items serve to uniquely identify the requester + -- and the specific request to all parties + id VehicleID, + request RequestID, + sequenceNumber MsgCount, + role BasicVehicleRole OPTIONAL, + + typeData RequestorType OPTIONAL, + -- Used when addition data besides the role + -- is needed, at which point the role entry + -- above is not sent. + ... + } + +SignalRequestList ::= SEQUENCE (SIZE(1..32)) OF SignalRequestPackage + +SignalRequestPackage ::= SEQUENCE { + request SignalRequest, + -- The specific request to the intersection + -- contains IntersectionID, request type, + -- requested action (approach/lane request) + + -- The Estimated Time of Arrival (ETA) when the service is requested + minute MinuteOfTheYear OPTIONAL, + second DSecond OPTIONAL, + duration DSecond OPTIONAL, + -- The duration value is used to provide a short interval that + -- extends the ETA so that the requesting vehicle can arrive at + -- the point of service with uncertainty or with some desired + -- duration of service. This concept can be used to avoid needing + -- to frequently update the request. + -- The requester must update the ETA and duration values if the + -- period of services extends beyond the duration time. + -- It should be assumed that if the vehicle does not clear the + -- intersection when the duration is reached, the request will + -- be cancelled and the intersection will revert to + -- normal operation. + + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-SignalRequestPackage}} OPTIONAL, + ... + } + +SignalRequest ::= SEQUENCE { + -- the unique ID of the target intersection + id IntersectionReferenceID, + + -- The unique requestID used by the requestor + requestID RequestID, + + -- The type of request or cancel for priority or preempt use + -- when a prior request is canceled, only the requestID is needed + requestType PriorityRequestType, + + -- In typical use either an approach or a lane number would + -- be given, this indicates the requested + -- path through the intersection to the degree it is known. + inBoundLane IntersectionAccessPoint, + -- desired entry approach or lane + outBoundLane IntersectionAccessPoint OPTIONAL, + -- desired exit approach or lane + -- the values zero is used to indicate + -- intent to stop within the intersection + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-SignalRequest}} OPTIONAL, + ... + } + +SignalStatusList ::= SEQUENCE (SIZE(1..32)) OF SignalStatus + +SignalStatusPackageList ::= SEQUENCE (SIZE(1..32)) OF SignalStatusPackage + +SignalStatusPackage ::= SEQUENCE { + -- The party that made the initial SRM request + requester SignalRequesterInfo OPTIONAL, + -- The lanes or approaches used in the request + inboundOn IntersectionAccessPoint, -- estimated lane / approach of vehicle + outboundOn IntersectionAccessPoint OPTIONAL, + + -- The Estimated Time of Arrival (ETA) when the service is requested + -- This data echos the data of the request + minute MinuteOfTheYear OPTIONAL, + second DSecond OPTIONAL, + duration DSecond OPTIONAL, + + -- the SRM status for this request + status PrioritizationResponseStatus, + -- Status of request, this may include rejection + + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-SignalStatusPackage}} OPTIONAL, + ... + } + +SignalStatus ::= SEQUENCE { + sequenceNumber MsgCount, + -- changed whenever the below contents have change + id IntersectionReferenceID, + -- this provides a unique mapping to the + -- intersection map in question + -- which provides complete location + -- and approach/movement/lane data + -- as well as zones for priority/preemption + sigStatus SignalStatusPackageList, + -- a list of detailed status containing all + -- priority or preemption state data, both + -- active and pending, and who requested it + -- requests which are denied are also listed + -- here for a short period of time + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-SignalStatus}} OPTIONAL, + ... + } + +/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop +SpeedLimitList ::= SEQUENCE (SIZE(1..9)) OF RegulatorySpeedLimit + +SpeedLimitType ::= ENUMERATED { + unknown, -- Speed limit type not available + maxSpeedInSchoolZone, -- Only sent when the limit is active + maxSpeedInSchoolZoneWhenChildrenArePresent, -- Sent at any time + maxSpeedInConstructionZone, -- Used for work zones, incident zones, etc. + -- where a reduced speed is present + vehicleMinSpeed, + vehicleMaxSpeed, -- Regulatory speed limit for general traffic + vehicleNightMaxSpeed, + + truckMinSpeed, + truckMaxSpeed, + truckNightMaxSpeed, + + vehiclesWithTrailersMinSpeed, + vehiclesWithTrailersMaxSpeed, + vehiclesWithTrailersNightMaxSpeed, + ... + } +*/ + +TimeChangeDetails ::= SEQUENCE { + startTime TimeMark OPTIONAL, + -- When this phase 1st started + minEndTime TimeMark, + -- Expected shortest end time + maxEndTime TimeMark OPTIONAL, + -- Expected longest end time + + likelyTime TimeMark OPTIONAL, + -- Best predicted value based on other data + confidence TimeIntervalConfidence OPTIONAL, + -- Applies to above time element only + + nextTime TimeMark OPTIONAL + -- A rough estimate of time when + -- this phase may next occur again + -- used to support various ECO driving power + -- management needs. + } + +TimeMark ::= INTEGER (0..36001) + -- Tenths of a second in the current or next hour + -- In units of 1/10th second from UTC time + -- A range of 0~36000 covers one hour + -- The values 35991..36000 are used when a leap second occurs + -- The value 36001 is used to indicate time >3600 seconds + -- 36002 is to be used when value undefined or unknown + -- Note that this is NOT expressed in GPS time + -- or in local time + +TransmissionAndSpeed ::= SEQUENCE { + transmisson TransmissionState, + speed Velocity + } + +VehicleID ::= CHOICE { + entityID TemporaryID, + stationID StationID + } + + +-- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ +-- +-- Start of entries from table Data_Elements... +-- This table typicaly contains data element entries. +-- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ +-- + +AdvisorySpeedType ::= ENUMERATED { + none (0), + greenwave (1), + ecoDrive (2), + transit (3), + ... + } -- Note: subject to further growth + +AllowedManeuvers ::= BIT STRING { + -- With bits as defined: + -- Allowed maneuvers at path end (stop line) + -- All maneuvers with bits not set are therefore prohibited ! + -- A value of zero shall be used for unknown, indicating no Maneuver + maneuverStraightAllowed (0), + -- a Straight movement is allowed in this lane + maneuverLeftAllowed (1), + -- a Left Turn movement is allowed in this lane + maneuverRightAllowed (2), + -- a Right Turn movement is allowed in this lane + maneuverUTurnAllowed (3), + -- a U turn movement is allowed in this lane + maneuverLeftTurnOnRedAllowed (4), + -- a Stop, and then proceed when safe movement + -- is allowed in this lane + maneuverRightTurnOnRedAllowed (5), + -- a Stop, and then proceed when safe movement + -- is allowed in this lane + maneuverLaneChangeAllowed (6), + -- a movement which changes to an outer lane + -- on the egress side is allowed in this lane + -- (example: left into either outbound lane) + maneuverNoStoppingAllowed (7), + -- the vehicle should not stop at the stop line + -- (example: a flashing green arrow) + yieldAllwaysRequired (8), + -- the allowed movements above are not protected + -- (example: an permanent yellow condition) + goWithHalt (9), + -- after making a full stop, may proceed + caution (10), + -- proceed past stop line with caution + reserved1 (11) + -- used to align to 12 Bit Field + + } (SIZE(12)) + +Angle ::= INTEGER (0..28800) + -- LSB of 0.0125 degrees + -- A range of 0 to 359.9875 degrees + +ApproachID ::= INTEGER (0..15) -- zero to be used when valid value is unknown + +BasicVehicleRole ::= ENUMERATED { + -- Values used in the EU and in the US + basicVehicle (0), -- Light duty passenger vehicle type + publicTransport (1), -- Used in EU for Transit us + specialTransport (2), -- Used in EU (e.g. heavy load) + dangerousGoods (3), -- Used in EU for any HAZMAT + roadWork (4), -- Used in EU for State and Local DOT uses + roadRescue (5), -- Used in EU and in the US to include tow trucks. + emergency (6), -- Used in EU for Police, Fire and Ambulance units + safetyCar (7), -- Used in EU for Escort vehicles + -- Begin US unique numbering + none-unknown (8), -- added to follow current SAE style guidelines + truck (9), -- Heavy trucks with additional BSM rights and obligations + motorcycle (10), -- + roadSideSource (11), -- For infrastructure generated calls such as + -- fire house, rail infrastructure, roadwork site, etc. + police (12), -- + fire (13), -- + ambulance (14), -- (does not include private para-transit etc.) + dot (15), -- all roadwork vehicles + transit (16), -- all transit vehicles + slowMoving (17), -- to also include oversize etc. + stopNgo (18), -- to include trash trucks, school buses and others + -- that routinely disturb the free flow of traffic + cyclist (19), -- + pedestrian (20), -- also includes those with mobility limitations + nonMotorized (21), -- other, horse drawn, etc. + military (22), -- + ... + } + +/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop +DeltaAngle ::= INTEGER (-150..150) + -- With an angle range from + -- negative 150 to positive 150 + -- in one degree steps where zero is directly + -- along the axis or the lane center line as defined by the + -- two closest points + +DeltaTime ::= INTEGER (-122 .. 121) + -- Supporting a range of +/- 20 minute in steps of 10 seconds + -- the value of -121 shall be used when more than -20 minutes + -- the value of +120 shall be used when more than +20 minutes + -- the value -122 shall be used when the value is unavailable +*/ + +DescriptiveName ::= IA5String (SIZE(1..63)) + +DrivenLineOffsetLg ::= INTEGER (-32767..32767) + -- LSB units are 1 cm. + +DrivenLineOffsetSm ::= INTEGER (-2047..2047) + -- LSB units are 1 cm. + +DSecond ::= INTEGER (0..65535) -- units of milliseconds + +DSRCmsgID ::= INTEGER (0..32767) + mapData DSRCmsgID ::= 18 -- MAP, intersections + signalPhaseAndTimingMessage DSRCmsgID ::= 19 -- SPAT + signalRequestMessage DSRCmsgID ::= 29 -- SRM + signalStatusMessage DSRCmsgID ::= 30 -- SSM + +Elevation ::= INTEGER (-4096..61439) + -- In units of 10 cm steps above or below the reference ellipsoid + -- Providing a range of -409.5 to + 6143.9 meters + -- The value -4096 shall be used when Unknown is to be sent + +IntersectionID ::= INTEGER (0..65535) + -- The values zero through 255 are allocated for testing purposes + -- Note that the value assigned to an intersection will be + -- unique within a given regional ID only + +IntersectionStatusObject ::= BIT STRING { + manualControlIsEnabled (0), + -- Timing reported is per programmed values, etc. but person + -- at cabinet can manually request that certain intervals are + -- terminated early (e.g. green). + stopTimeIsActivated (1), + -- And all counting/timing has stopped. + failureFlash (2), + -- Above to be used for any detected hardware failures, + -- e.g. conflict monitor as well as for police flash + preemptIsActive (3), + signalPriorityIsActive (4), + + -- Additional states + fixedTimeOperation (5), + -- Schedule of signals is based on time only + -- (i.e. the state can be calculated) + trafficDependentOperation (6), + -- Operation is based on different levels of traffic parameters + -- (requests, duration of gaps or more complex parameters) + standbyOperation (7), + -- Controller: partially switched off or partially amber flashing + failureMode (8), + -- Controller has a problem or failure in operation + off (9), + -- Controller is switched off + + -- Related to MAP and SPAT bindings + recentMAPmessageUpdate (10), + -- Map revision with content changes + recentChangeInMAPassignedLanesIDsUsed (11), + -- Change in MAP's assigned lanes used (lane changes) + -- Changes in the active lane list description + noValidMAPisAvailableAtThisTime (12), + -- MAP (and various lanes indexes) not available + noValidSPATisAvailableAtThisTime (13) + -- SPAT system is not working at this time + + -- Bits 14,15 reserved at this time and shall be zero + } (SIZE(16)) + + +LaneAttributes-Barrier ::= BIT STRING { + -- With bits as defined: + median-RevocableLane (0), + -- this lane may be activated or not based + -- on the current SPAT message contents + -- if not asserted, the lane is ALWAYS present + median (1), + whiteLineHashing (2), + stripedLines (3), + doubleStripedLines (4), + trafficCones (5), + constructionBarrier (6), + trafficChannels (7), + lowCurbs (8), + highCurbs (9) + -- Bits 10~15 reserved and set to zero + } (SIZE (16)) + +LaneAttributes-Bike ::= BIT STRING { + -- With bits as defined: + bikeRevocableLane (0), + -- this lane may be activated or not based + -- on the current SPAT message contents + -- if not asserted, the lane is ALWAYS present + pedestrianUseAllowed (1), + -- The path allows pedestrian traffic, + -- if not set, this mode is prohibited + isBikeFlyOverLane (2), + -- path of lane is not at grade + fixedCycleTime (3), + -- the phases use preset times + -- i.e. there is not a 'push to cross' button + biDirectionalCycleTimes (4), + -- ped walk phases use different SignalGroupID + -- for each direction. The first SignalGroupID + -- in the first Connection represents 'inbound' + -- flow (the direction of travel towards the first + -- node point) while second SignalGroupID in the + -- next Connection entry represents the 'outbound' + -- flow. And use of RestrictionClassID entries + -- in the Connect follow this same pattern in pairs. + isolatedByBarrier (5), + unsignalizedSegmentsPresent (6) + -- The lane path consists of one of more segments + -- which are not part of a signal group ID + + -- Bits 7~15 reserved and set to zero + } (SIZE (16)) + +LaneAttributes-Crosswalk ::= BIT STRING { + -- With bits as defined: + -- MUTCD provides no suitable "types" to use here + crosswalkRevocableLane (0), + -- this lane may be activated or not based + -- on the current SPAT message contents + -- if not asserted, the lane is ALWAYS present + bicyleUseAllowed (1), + -- The path allows bicycle traffic, + -- if not set, this mode is prohibited + isXwalkFlyOverLane (2), + -- path of lane is not at grade + fixedCycleTime (3), + -- ped walk phases use preset times + -- i.e. there is not a 'push to cross' button + biDirectionalCycleTimes (4), + -- ped walk phases use different SignalGroupID + -- for each direction. The first SignalGroupID + -- in the first Connection represents 'inbound' + -- flow (the direction of travel towards the first + -- node point) while second SignalGroupID in the + -- next Connection entry represents the 'outbound' + -- flow. And use of RestrictionClassID entries + -- in the Connect follow this same pattern in pairs. + hasPushToWalkButton (5), + -- Has a demand input + audioSupport (6), + -- audio crossing cues present + rfSignalRequestPresent (7), + -- Supports RF push to walk technologies + unsignalizedSegmentsPresent (8) + -- The lane path consists of one of more segments + -- which are not part of a signal group ID + -- Bits 9~15 reserved and set to zero + } (SIZE (16)) + +LaneAttributes-Parking ::= BIT STRING { + -- With bits as defined: + -- Parking use details, note that detailed restrictions such as + -- allowed hours are sent by way of ITIS codes in the TIM message + parkingRevocableLane (0), + -- this lane may be activated or not based + -- on the current SPAT message contents + -- if not asserted, the lane is ALWAYS present + parallelParkingInUse (1), + headInParkingInUse (2), + doNotParkZone (3), + -- used to denote fire hydrants as well as + -- short disruptions in a parking zone + parkingForBusUse (4), + parkingForTaxiUse (5), + noPublicParkingUse (6) + -- private parking, as in front of + -- private property + -- Bits 7~15 reserved and set to zero + } (SIZE (16)) + +LaneAttributes-Sidewalk ::= BIT STRING { + -- With bits as defined: + sidewalk-RevocableLane (0), + -- this lane may be activated or not based + -- on the current SPAT message contents + -- if not asserted, the lane is ALWAYS present + bicyleUseAllowed (1), + -- The path allows bicycle traffic, + -- if not set, this mode is prohibited + isSidewalkFlyOverLane (2), + -- path of lane is not at grade + walkBikes (3) + -- bike traffic must dismount and walk + -- Bits 4~15 reserved and set to zero + } (SIZE (16)) + + +LaneAttributes-Striping ::= BIT STRING { + -- With bits as defined: + stripeToConnectingLanesRevocableLane (0), + -- this lane may be activated or not activated based + -- on the current SPAT message contents + -- if not asserted, the lane is ALWAYS present + stripeDrawOnLeft (1), + stripeDrawOnRight (2), + -- which side of lane to mark + stripeToConnectingLanesLeft (3), + stripeToConnectingLanesRight (4), + stripeToConnectingLanesAhead (5) + -- the stripe type should be + -- presented to the user visually + -- to reflect stripes in the + -- intersection for the type of + -- movement indicated + -- Bits 6~15 reserved and set to zero + } (SIZE (16)) + + +LaneAttributes-TrackedVehicle ::= BIT STRING { + -- With bits as defined: + spec-RevocableLane (0), + -- this lane may be activated or not based + -- on the current SPAT message contents + -- if not asserted, the lane is ALWAYS present + spec-commuterRailRoadTrack (1), + spec-lightRailRoadTrack (2), + spec-heavyRailRoadTrack (3), + spec-otherRailType (4) + -- Bits 5~15 reserved and set to zero + } (SIZE (16)) + + +LaneAttributes-Vehicle ::= BIT STRING { + -- With bits as defined: + isVehicleRevocableLane (0), + -- this lane may be activated or not based + -- on the current SPAT message contents + -- if not asserted, the lane is ALWAYS present + isVehicleFlyOverLane (1), + -- path of lane is not at grade + hovLaneUseOnly (2), + restrictedToBusUse (3), + restrictedToTaxiUse (4), + restrictedFromPublicUse (5), + hasIRbeaconCoverage (6), + permissionOnRequest (7) -- e.g. to inform about a lane for e-cars + + } (SIZE (8,...)) + +LaneConnectionID ::= INTEGER (0..255) + +LaneDirection ::= BIT STRING { + -- With bits as defined: + -- Allowed directions of travel in the lane object + -- All lanes are described from the stop line outwards + ingressPath (0), + -- travel from rear of path to front + -- is allowed + egressPath (1) + -- travel from front of path to rear + -- is allowed + -- Notes: No Travel, i.e. the lane object type does not support + -- travel (medians, curbs, etc.) is indicated by not + -- asserting any bit value + -- Bi-Directional Travel (such as a ped crosswalk) is + -- indicated by asserting both of the bits + } (SIZE (2)) + +/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop +LaneID ::= INTEGER (0..255) + -- the value 0 shall be used when the lane ID is + -- not available or not known + -- the value 255 is reserved for future use +*/ + +LayerID ::= INTEGER (0..100) + +LayerType ::= ENUMERATED { + none, + mixedContent, -- two or more of the below types + generalMapData, + intersectionData, + curveData, + roadwaySectionData, + parkingAreaData, + sharedLaneData, + ... + } + +LaneWidth ::= INTEGER (0..32767) -- units of 1 cm + +/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop +MergeDivergeNodeAngle ::= INTEGER (-180..180) + -- In units of 1.5 degrees from north + -- the value -180 shall be used to represent + -- data is not available or unknown +*/ + +MinuteOfTheYear ::= INTEGER (0..527040) + -- the value 527040 shall be used for invalid + +MovementPhaseState ::= ENUMERATED { + -- Note that based on the regions and the operating mode not every + -- phase will be used in all transportation modes and that not + -- every phase will be used in all transportation modes + + unavailable (0), + -- This state is used for unknown or error + dark (1), + -- The signal head is dark (unlit) + + -- Reds + stop-Then-Proceed (2), + -- Often called 'flashing red' in US + -- Driver Action: + -- Stop vehicle at stop line. + -- Do not proceed unless it is safe. + -- Note that the right to proceed either right or left when + -- it is safe may be contained in the lane description to + -- handle what is called a 'right on red' + stop-And-Remain (3), + -- e.g. called 'red light' in US + -- Driver Action: + -- Stop vehicle at stop line. + -- Do not proceed. + -- Note that the right to proceed either right or left when + -- it is safe may be contained in the lane description to + -- handle what is called a 'right on red' + + -- Greens + pre-Movement (4), + -- Not used in the US, red+yellow partly in EU + -- Driver Action: + -- Stop vehicle. + -- Prepare to proceed (pending green) + -- (Prepare for transition to green/go) + permissive-Movement-Allowed (5), + -- Often called 'permissive green' in US + -- Driver Action: + -- Proceed with caution, + -- must yield to all conflicting traffic + -- Conflicting traffic may be present + -- in the intersection conflict area + protected-Movement-Allowed (6), + -- Often called 'protected green' in US + -- Driver Action: + -- Proceed, tossing caution to the wind, + -- in indicated (allowed) direction. + + -- Yellows / Ambers + -- The vehicle is not allowed to cross the stop bar if it is possible + -- to stop without danger. + permissive-clearance (7), + -- Often called 'permissive yellow' in US + -- Driver Action: + -- Prepare to stop. + -- Proceed if unable to stop, + -- Clear Intersection. + -- Conflicting traffic may be present + -- in the intersection conflict area + protected-clearance (8), + -- Often called 'protected yellow' in US + -- Driver Action: + -- Prepare to stop. + -- Proceed if unable to stop, + -- in indicated direction (to connected lane) + -- Clear Intersection. + + caution-Conflicting-Traffic (9) + -- Often called 'flashing yellow' in US + -- Often used for extended periods of time + -- Driver Action: + -- Proceed with caution, + -- Conflicting traffic may be present + -- in the intersection conflict area + } + -- The above number assignments are not used with UPER encoding + -- and are only to be used with DER or implicit encoding + +MsgCount ::= INTEGER (0..127) + +/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop +Offset-B10 ::= INTEGER (-512..511) + -- a range of +- 5.11 meters + +Offset-B11 ::= INTEGER (-1024..1023) + -- a range of +- 10.23 meters + +Offset-B12 ::= INTEGER (-2048..2047) + -- a range of +- 20.47 meters + +Offset-B13 ::= INTEGER (-4096..4095) + -- a range of +- 40.95 meters + +Offset-B14 ::= INTEGER (-8192..8191) + -- a range of +- 81.91 meters + +Offset-B16 ::= INTEGER (-32768..32767) + -- a range of +- 327.68 meters +*/ + +PedestrianBicycleDetect ::= BOOLEAN + -- true if ANY Pedestrians or Bicyclists are + -- detected crossing the target lane or lanes + +/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop +PrioritizationResponseStatus ::= ENUMERATED { + unknown (0), + -- Unknown state + requested (1), + -- This prioritization request was detected + -- by the traffic controller + processing (2), + -- Checking request + -- (request is in queue, other requests are prior) + watchOtherTraffic (3), + -- Cannot give full permission, + -- therefore watch for other traffic + -- Note that other requests may be present + granted (4), + -- Intervention was successful + -- and now prioritization is active + rejected (5), + -- The prioritization or preemption request was + -- rejected by the traffic controller + maxPresence (6), + -- The Request has exceeded maxPresence time + -- Used when the controller has determined that + -- the requester should then back off and + -- request an alternative. + reserviceLocked (7), + -- Prior conditions have resulted in a reservice + -- locked event: the controller requires the + -- passage of time before another similar request + -- will be accepted + ... +} +*/ + +PriorityRequestType ::= ENUMERATED { + priorityRequestTypeReserved (0), + priorityRequest (1), + priorityRequestUpdate (2), + priorityCancellation (3), + ... + } + +/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop +RegionId ::= INTEGER (0..255) + noRegion RegionId ::= 0 -- Use default supplied stubs + addGrpA RegionId ::= 1 -- USA + addGrpB RegionId ::= 2 -- Japan + addGrpC RegionId ::= 3 -- EU + -- NOTE: new registered regional IDs will be added here + -- The values 128 and above are for local region use +*/ + +RequestID ::= INTEGER (0..255) + +RequestImportanceLevel ::= ENUMERATED { + requestImportanceLevelUnKnown (0), + requestImportanceLevel1 (1), -- The least important request + requestImportanceLevel2 (2), -- The values here shall be assigned + requestImportanceLevel3 (3), -- Meanings based on regional needs + requestImportanceLevel4 (4), -- for each of the basic roles which + requestImportanceLevel5 (5), -- are defined elsewhere + requestImportanceLevel6 (6), + requestImportanceLevel7 (7), + requestImportanceLevel8 (8), + requestImportanceLevel9 (9), + requestImportanceLevel10 (10), + requestImportanceLevel11 (11), + requestImportanceLevel12 (12), + requestImportanceLevel13 (13), + requestImportanceLevel14 (14), -- The most important request + requestImportanceReserved (15) -- Reserved for future use + } + +RequestSubRole ::= ENUMERATED { + requestSubRoleUnKnown (0), + requestSubRole1 (1), -- The first type of sub role + requestSubRole2 (2), -- The values here shall be assigned + requestSubRole3 (3), -- Meanings based on regional needs + requestSubRole4 (4), -- to refine and expand the basic + requestSubRole5 (5), -- roles which are defined elsewhere + requestSubRole6 (6), + requestSubRole7 (7), + requestSubRole8 (8), + requestSubRole9 (9), + requestSubRole10 (10), + requestSubRole11 (11), + requestSubRole12 (12), + requestSubRole13 (13), + requestSubRole14 (14), -- The last type of sub role + requestSubRoleReserved (15) -- Reserved for future use + } + +RestrictionAppliesTo ::= ENUMERATED { + none, -- applies to nothing + equippedTransit, -- buses etc. + equippedTaxis, + equippedOther, -- other vehicle types with + -- necessary signal phase state + -- reception equipment + emissionCompliant, -- regional variants with more + -- definitive items also exist + equippedBicycle, + weightCompliant, + heightCompliant, + -- Items dealing with traveler needs serviced by the infrastructure + -- These end users (which are not vehicles) are presumed to be suitably equipped + pedestrians, + slowMovingPersons, + wheelchairUsers, + visualDisabilities, + audioDisabilities, -- hearing + otherUnknownDisabilities, + ... + } + +RestrictionClassID ::= INTEGER (0..255) + -- An index value to identify data about classes of users + -- the value used varies with each intersection's + -- needs and is defined in the map to the assigned + -- classes of supported users. + +RoadRegulatorID ::= INTEGER (0..65535) + -- The value zero shall be used for testing only + +RoadSegmentID ::= INTEGER (0..65535) + -- The values zero to 255 shall be used for testing only + -- Note that the value assigned to an RoadSegment will be + -- unique within a given regional ID only during its use + +/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop +RoadwayCrownAngle ::= INTEGER (-128..127) + -- In LSB units of 0.3 degrees of angle + -- over a range of -38.1 to + 38.1 degrees + -- The value -128 shall be used for unknown + -- The value zero shall be used for angles + -- which are between -0.15 and +0.15 +*/ + +Scale-B12 ::= INTEGER (-2048..2047) -- in steps of 0.05 percent + +/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop +SignalGroupID ::= INTEGER (0..255) + -- The value 0 shall be used when the ID is + -- not available or not known + -- the value 255 is reserved to indicate a + -- permanent green movement state + -- therefore a simple 8 phase signal controller + -- device might use 1..9 as its groupIDs +*/ + +/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop +SegmentAttributeXY ::= ENUMERATED { + -- Various values which can be Enabled and Disabled for a lane segment + + -- General Items + reserved , + doNotBlock , -- segment where a vehicle + -- may not come to a stop + whiteLine , -- segment where lane crossing not allowed + -- such as the final few meters of a lane + + -- Porous Lane states, merging, turn outs, parking etc. + + mergingLaneLeft , -- indicates porous lanes + mergingLaneRight , + + curbOnLeft , -- indicates presence of curbs + curbOnRight , + + loadingzoneOnLeft , -- loading or drop off zones + loadingzoneOnRight , + + turnOutPointOnLeft , -- opening to adjacent street/alley/road + turnOutPointOnRight , + + adjacentParkingOnLeft , -- side of road parking + adjacentParkingOnRight , + + -- Bike Lane Needs + adjacentBikeLaneOnLeft , -- presence of marked bike lanes + adjacentBikeLaneOnRight , + sharedBikeLane , -- right of way is shared with bikes + -- who may occupy entire lane width + bikeBoxInFront , + + -- Transit Needs + transitStopOnLeft , -- any form of bus/transit loading + -- with pull in-out access to lane on left + transitStopOnRight , -- any form of bus/transit loading + -- with pull in-out access to lane on right + transitStopInLane , -- any form of bus/transit loading + -- in mid path of the lane + sharedWithTrackedVehicle , -- lane is shared with train or trolley + -- not used for crossing tracks + + + -- Pedestrian Support Attributes + safeIsland , -- begin/end a safety island in path + lowCurbsPresent , -- for ADA support + rumbleStripPresent , -- for ADA support + audibleSignalingPresent , -- for ADA support + adaptiveTimingPresent , -- for ADA support + rfSignalRequestPresent , -- Supports RF push to walk technologies + partialCurbIntrusion , -- path is blocked by a median or curb + -- but at least 1 meter remains open for use + -- and at-grade passage + + -- Lane geometry details (see standard for defined shapes) + taperToLeft , -- Used to control final path shape + taperToRight , -- Used to control final path shape + taperToCenterLine , -- Used to control final path shape + + -- Parking Lane and Curb Attributes + parallelParking , -- + headInParking , -- Parking at an angle with the street + freeParking , -- no restriction on use of parking + timeRestrictionsOnParking , -- Parking is not permitted at all times + -- typically used when the 'parking' lane + -- becomes a driving lane at times + costToPark , -- Used where parking has a cost + midBlockCurbPresent , -- a protruding curb near lane edge + unEvenPavementPresent , -- a disjoint height at lane edge + ... + } +*/ + +SpeedAdvice ::= INTEGER (0..500) + -- LSB units are 0.1 m/s^2 + -- the value 499 shall be used for values at or greater than 49.9 m/s + -- the value 500 shall be used to indicate that speed is unavailable + + +TemporaryID ::= OCTET STRING (SIZE(4)) + +TimeIntervalConfidence ::= INTEGER (0..15) + -- Value Probability + -- 0 21% + -- 1 36% + -- 2 47% + -- 3 56% + -- 4 62% + -- 5 68% + -- 6 73% + -- 7 77% + -- 8 81% + -- 9 85% + -- 10 88% + -- 11 91% + -- 12 94% + -- 13 96% + -- 14 98% + -- 15 100% + +TransitVehicleOccupancy ::= ENUMERATED { + occupancyUnknown (0), + occupancyEmpty (1), + occupancyVeryLow (2), + occupancyLow (3), + occupancyMed (4), + occupancyHigh (5), + occupancyNearlyFull (6), + occupancyFull (7) + } + +TransitVehicleStatus ::= BIT STRING { + loading (0), -- parking and unable to move at this time + anADAuse (1), -- an ADA access is in progress (wheelchairs, kneeling, etc.) + aBikeLoad (2), -- loading of a bicycle is in progress + doorOpen (3), -- a vehicle door is open for passenger access + charging (4), -- a vehicle is connected to charging point + atStopLine (5) -- a vehicle is at the stop line for the lane it is in + } (SIZE(8)) + +TransmissionState ::= ENUMERATED { + neutral (0), -- Neutral + park (1), -- Park + forwardGears (2), -- Forward gears + reverseGears (3), -- Reverse gears + reserved1 (4), + reserved2 (5), + reserved3 (6), + unavailable (7) -- not-equipped or unavailable value, + -- Any related speed is relative to the vehicle reference frame used + } + +VehicleType ::= ENUMERATED { + none (0), -- Not Equipped, Not known or unavailable + unknown (1), -- Does not fit any other category + special (2), -- Special use + moto (3), -- Motorcycle + car (4), -- Passenger car + carOther (5), -- Four tire single units + bus (6), -- Buses + axleCnt2 (7), -- Two axle, six tire single units + axleCnt3 (8), -- Three axle, single units + axleCnt4 (9), -- Four or more axle, single unit + axleCnt4Trailer (10), -- Four or less axle, single trailer + axleCnt5Trailer (11), -- Five or less axle, single trailer + axleCnt6Trailer (12), -- Six or more axle, single trailer + axleCnt5MultiTrailer (13), -- Five or less axle, multi-trailer + axleCnt6MultiTrailer (14), -- Six axle, multi-trailer + axleCnt7MultiTrailer (15), -- Seven or more axle, multi-trailer + ... + } + +/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop +Velocity ::= INTEGER (0..8191) -- Units of 0.02 m/s + -- The value 8191 indicates that + -- velocity is unavailable +*/ + +WaitOnStopline ::= BOOLEAN -- + -- True or False + -- If "true", the vehicles on this specific connecting + -- maneuver have to stop on the stop-line + -- and not to enter the collision area + +ZoneLength ::= INTEGER (0..10000) + -- Unit = 1 meter, 0 = unknown, + -- The value 10000 to be used for Distances >=10000 m + -- (e.g. from known point to another point along a + -- known path, often against traffic flow direction + -- when used for measuring queues) + +END + + diff --git a/asn1/IS/ISO_TS_19091/DSRC_REGION_noCircular.asn b/asn1/IS/ISO_TS_19091/DSRC_REGION_noCircular.asn new file mode 100644 index 00000000..f352d2ae --- /dev/null +++ b/asn1/IS/ISO_TS_19091/DSRC_REGION_noCircular.asn @@ -0,0 +1,419 @@ +--FIXME RGY moved here from file SPAT_MAP_ISO_TS_19091.asn + +-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +-- +-- module: DSRC +-- ISO TS 19091 30.08.2016 +-- +-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +--FIXME RGY definitions are moved here from IS-DSRC and IS-REGION; created to cut circular import loops amongst ASN.1 files +DSRC-REGION-noCircular { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } + +DEFINITIONS AUTOMATIC TAGS::= BEGIN + +IMPORTS +Longitude, Latitude FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) } + +Control-addGrpC FROM AddGrpC-noCircular { iso (1) standard (0) signalizedIntersection (19091) profilec(2) addgrpc (0) version (1) }; + +------------------------------------------------------ +--FIXME RGY BELOW ARE DEFINITIONS MOVED FROM DSRC +------------------------------------------------------ + +DeltaAngle ::= INTEGER (-150..150) + -- With an angle range from + -- negative 150 to positive 150 + -- in one degree steps where zero is directly + -- along the axis or the lane center line as defined by the + -- two closest points + +DeltaTime ::= INTEGER (-122 .. 121) + -- Supporting a range of +/- 20 minute in steps of 10 seconds + -- the value of -121 shall be used when more than -20 minutes + -- the value of +120 shall be used when more than +20 minutes + -- the value -122 shall be used when the value is unavailable + +LaneDataAttribute ::= CHOICE { + -- Segment attribute types and the data needed for each + pathEndPointAngle DeltaAngle, + -- adjusts final point/width slant + -- of the lane to align with the stop line + laneCrownPointCenter RoadwayCrownAngle, + -- sets the canter of the road bed + -- from centerline point + laneCrownPointLeft RoadwayCrownAngle, + -- sets the canter of the road bed + -- from left edge + laneCrownPointRight RoadwayCrownAngle, + -- sets the canter of the road bed + -- from right edge + laneAngle MergeDivergeNodeAngle, + -- the angle or direction of another lane + -- this is required to support Japan style + -- when a merge point angle is required + speedLimits SpeedLimitList, + -- Reference regulatory speed limits + -- used by all segments + + -- Add others as needed, in regional space + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-LaneDataAttribute}}, + ... + } + +LaneDataAttributeList ::= SEQUENCE (SIZE(1..8)) OF LaneDataAttribute + +LaneID ::= INTEGER (0..255) + -- the value 0 shall be used when the lane ID is + -- not available or not known + -- the value 255 is reserved for future use + +MergeDivergeNodeAngle ::= INTEGER (-180..180) + -- In units of 1.5 degrees from north + -- the value -180 shall be used to represent + -- data is not available or unknown + +NodeOffsetPointXY ::= CHOICE { + -- Nodes with X,Y content + node-XY1 Node-XY-20b, -- node is within 5.11m of last node + node-XY2 Node-XY-22b, -- node is within 10.23m of last node + node-XY3 Node-XY-24b, -- node is within 20.47m of last node + node-XY4 Node-XY-26b, -- node is within 40.96m of last node + node-XY5 Node-XY-28b, -- node is within 81.91m of last node + node-XY6 Node-XY-32b, -- node is within 327.67m of last node + node-LatLon Node-LLmD-64b, -- node is a full 32b Lat/Lon range + regional RegionalExtension {{Reg-NodeOffsetPointXY}} + -- node which follows is of a + -- regional definition type + } + +Node-LLmD-64b ::= SEQUENCE { + lon Longitude, + lat Latitude + } + + +Node-XY-20b ::= SEQUENCE { + x Offset-B10, + y Offset-B10 + } + +Node-XY-22b ::= SEQUENCE { + x Offset-B11, + y Offset-B11 + } + + +Node-XY-24b ::= SEQUENCE { + x Offset-B12, + y Offset-B12 + } + + +Node-XY-26b ::= SEQUENCE { + x Offset-B13, + y Offset-B13 + } + + +Node-XY-28b ::= SEQUENCE { + x Offset-B14, + y Offset-B14 + } + + +Node-XY-32b ::= SEQUENCE { + x Offset-B16, + y Offset-B16 + } + +NodeSetXY ::= SEQUENCE (SIZE(2..63)) OF NodeXY + +NodeXY ::= SEQUENCE { + delta NodeOffsetPointXY, + -- A choice of which X,Y offset value to use + -- this includes various delta values as well a regional choices + attributes NodeAttributeSetXY OPTIONAL, + -- Any optional Attributes which are needed + -- This includes changes to the current lane width and elevation + ... +} + +NodeAttributeSetXY ::= SEQUENCE { + localNode NodeAttributeXYList OPTIONAL, + -- Attribute states which pertain to this node point + disabled SegmentAttributeXYList OPTIONAL, + -- Attribute states which are disabled at this node point + enabled SegmentAttributeXYList OPTIONAL, + -- Attribute states which are enabled at this node point + -- and which remain enabled until disabled or the lane ends + data LaneDataAttributeList OPTIONAL, + -- Attributes which require an additional data values + -- some of these are local to the node point, while others + -- persist with the provided values until changed + -- and this is indicated in each entry + dWidth Offset-B10 OPTIONAL, + -- A value added to the current lane width + -- at this node and from this node onwards, in 1cm steps + -- lane width between nodes are a linear taper between pts + -- the value of zero shall not be sent here + dElevation Offset-B10 OPTIONAL, + -- A value added to the current Elevation + -- at this node from this node onwards, in 10cm steps + -- elevations between nodes are a linear taper between pts + -- the value of zero shall not be sent here + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-NodeAttributeSetXY}} OPTIONAL, + ... + } + +NodeAttributeXYList ::= SEQUENCE (SIZE(1..8)) OF NodeAttributeXY + +NodeAttributeXY ::= ENUMERATED { + -- Various values which pertain only to the current node point + + -- General Items + reserved, + stopLine, -- point where a mid-path stop line exists + -- See also 'do not block' for segments + + -- Path finish details + roundedCapStyleA, -- Used to control final path rounded end shape + -- with edge of curve at final point in a circle + roundedCapStyleB, -- Used to control final path rounded end shape + -- with edge of curve extending 50% of width past + -- final point in a circle + + -- Topography Points (items with no concept of a distance along the path) + mergePoint, -- Japan merge with 1 or more lanes + divergePoint, -- Japan diverge with 1 or more lanes + downstreamStopLine, -- Japan style downstream intersection + -- (a 2nd intersection) stop line + downstreamStartNode, -- Japan style downstream intersection + -- (a 2nd intersection) start node + + -- Pedestrian Support Attributes + closedToTraffic, -- where a pedestrian may NOT go + -- to be used during construction events + safeIsland, -- a pedestrian safe stopping point + -- also called a traffic island + -- This usage described a point feature on a path, + -- other entries can describe a path + curbPresentAtStepOff, -- the sidewalk to street curb is NOT + -- angled where it meets the edge of the + -- roadway (user must step up/down) + + -- Lane geometry details (see standard for defined shapes) + hydrantPresent, -- Or other services access + ... + } + +Offset-B10 ::= INTEGER (-512..511) + -- a range of +- 5.11 meters + +Offset-B11 ::= INTEGER (-1024..1023) + -- a range of +- 10.23 meters + +Offset-B12 ::= INTEGER (-2048..2047) + -- a range of +- 20.47 meters + +Offset-B13 ::= INTEGER (-4096..4095) + -- a range of +- 40.95 meters + +Offset-B14 ::= INTEGER (-8192..8191) + -- a range of +- 81.91 meters + +Offset-B16 ::= INTEGER (-32768..32767) + -- a range of +- 327.68 meters + +PrioritizationResponseStatus ::= ENUMERATED { + unknown (0), + -- Unknown state + requested (1), + -- This prioritization request was detected + -- by the traffic controller + processing (2), + -- Checking request + -- (request is in queue, other requests are prior) + watchOtherTraffic (3), + -- Cannot give full permission, + -- therefore watch for other traffic + -- Note that other requests may be present + granted (4), + -- Intervention was successful + -- and now prioritization is active + rejected (5), + -- The prioritization or preemption request was + -- rejected by the traffic controller + maxPresence (6), + -- The Request has exceeded maxPresence time + -- Used when the controller has determined that + -- the requester should then back off and + -- request an alternative. + reserviceLocked (7), + -- Prior conditions have resulted in a reservice + -- locked event: the controller requires the + -- passage of time before another similar request + -- will be accepted + ... +} + +RegionId ::= INTEGER (0..255) + noRegion RegionId ::= 0 -- Use default supplied stubs + addGrpA RegionId ::= 1 -- USA + addGrpB RegionId ::= 2 -- Japan + addGrpC RegionId ::= 3 -- EU + -- NOTE: new registered regional IDs will be added here + -- The values 128 and above are for local region use + +-- Regional extensions support +REG-EXT-ID-AND-TYPE ::= CLASS { + &id RegionId UNIQUE, + &Type + } WITH SYNTAX {&Type IDENTIFIED BY &id} + +RegionalExtension {REG-EXT-ID-AND-TYPE : Set} ::= SEQUENCE { + regionId REG-EXT-ID-AND-TYPE.&id( {Set} ), + regExtValue REG-EXT-ID-AND-TYPE.&Type( {Set}{@regionId} ) + } + +RegulatorySpeedLimit ::= SEQUENCE { + type SpeedLimitType, + -- The type of regulatory speed which follows + speed Velocity + -- The speed in units of 0.02 m/s + -- See Section 11 for converting and translating + -- speed expressed in mph into units of m/s + } + +RoadwayCrownAngle ::= INTEGER (-128..127) + -- In LSB units of 0.3 degrees of angle + -- over a range of -38.1 to + 38.1 degrees + -- The value -128 shall be used for unknown + -- The value zero shall be used for angles + -- which are between -0.15 and +0.15 + + +SegmentAttributeXYList ::= SEQUENCE (SIZE(1..8)) OF SegmentAttributeXY + +SegmentAttributeXY ::= ENUMERATED { + -- Various values which can be Enabled and Disabled for a lane segment + + -- General Items + reserved , + doNotBlock , -- segment where a vehicle + -- may not come to a stop + whiteLine , -- segment where lane crossing not allowed + -- such as the final few meters of a lane + + -- Porous Lane states, merging, turn outs, parking etc. + + mergingLaneLeft , -- indicates porous lanes + mergingLaneRight , + + curbOnLeft , -- indicates presence of curbs + curbOnRight , + + loadingzoneOnLeft , -- loading or drop off zones + loadingzoneOnRight , + + turnOutPointOnLeft , -- opening to adjacent street/alley/road + turnOutPointOnRight , + + adjacentParkingOnLeft , -- side of road parking + adjacentParkingOnRight , + + -- Bike Lane Needs + adjacentBikeLaneOnLeft , -- presence of marked bike lanes + adjacentBikeLaneOnRight , + sharedBikeLane , -- right of way is shared with bikes + -- who may occupy entire lane width + bikeBoxInFront , + + -- Transit Needs + transitStopOnLeft , -- any form of bus/transit loading + -- with pull in-out access to lane on left + transitStopOnRight , -- any form of bus/transit loading + -- with pull in-out access to lane on right + transitStopInLane , -- any form of bus/transit loading + -- in mid path of the lane + sharedWithTrackedVehicle , -- lane is shared with train or trolley + -- not used for crossing tracks + + + -- Pedestrian Support Attributes + safeIsland , -- begin/end a safety island in path + lowCurbsPresent , -- for ADA support + rumbleStripPresent , -- for ADA support + audibleSignalingPresent , -- for ADA support + adaptiveTimingPresent , -- for ADA support + rfSignalRequestPresent , -- Supports RF push to walk technologies + partialCurbIntrusion , -- path is blocked by a median or curb + -- but at least 1 meter remains open for use + -- and at-grade passage + + -- Lane geometry details (see standard for defined shapes) + taperToLeft , -- Used to control final path shape + taperToRight , -- Used to control final path shape + taperToCenterLine , -- Used to control final path shape + + -- Parking Lane and Curb Attributes + parallelParking , -- + headInParking , -- Parking at an angle with the street + freeParking , -- no restriction on use of parking + timeRestrictionsOnParking , -- Parking is not permitted at all times + -- typically used when the 'parking' lane + -- becomes a driving lane at times + costToPark , -- Used where parking has a cost + midBlockCurbPresent , -- a protruding curb near lane edge + unEvenPavementPresent , -- a disjoint height at lane edge + ... + } + +SignalGroupID ::= INTEGER (0..255) + -- The value 0 shall be used when the ID is + -- not available or not known + -- the value 255 is reserved to indicate a + -- permanent green movement state + -- therefore a simple 8 phase signal controller + -- device might use 1..9 as its groupIDs + +SpeedLimitList ::= SEQUENCE (SIZE(1..9)) OF RegulatorySpeedLimit + +SpeedLimitType ::= ENUMERATED { + unknown, -- Speed limit type not available + maxSpeedInSchoolZone, -- Only sent when the limit is active + maxSpeedInSchoolZoneWhenChildrenArePresent, -- Sent at any time + maxSpeedInConstructionZone, -- Used for work zones, incident zones, etc. + -- where a reduced speed is present + vehicleMinSpeed, + vehicleMaxSpeed, -- Regulatory speed limit for general traffic + vehicleNightMaxSpeed, + + truckMinSpeed, + truckMaxSpeed, + truckNightMaxSpeed, + + vehiclesWithTrailersMinSpeed, + vehiclesWithTrailersMaxSpeed, + vehiclesWithTrailersNightMaxSpeed, + ... + } + +Velocity ::= INTEGER (0..8191) -- Units of 0.02 m/s + -- The value 8191 indicates that + -- velocity is unavailable + +------------------------------------------------------ +--FIXME RGY BELOW ARE DEFINITIONS MOVED FROM IS-REGION +------------------------------------------------------ + +Reg-LaneDataAttribute REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-NodeOffsetPointXY REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-NodeAttributeSetXY REG-EXT-ID-AND-TYPE ::= { + {Control-addGrpC IDENTIFIED BY addGrpC} , + ... +} +END diff --git a/asn1/IS/ISO_TS_19091.asn b/asn1/IS/ISO_TS_19091/ISO_TS_19091.asn similarity index 100% rename from asn1/IS/ISO_TS_19091.asn rename to asn1/IS/ISO_TS_19091/ISO_TS_19091.asn diff --git a/asn1/IS/ISO_TS_19091/REGION.asn b/asn1/IS/ISO_TS_19091/REGION.asn new file mode 100755 index 00000000..5e82f5dd --- /dev/null +++ b/asn1/IS/ISO_TS_19091/REGION.asn @@ -0,0 +1,117 @@ +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- ISO TS 19091 +-- +-- This ASN.1 was generated: 30.08.2016 +-- +-- This document contains the data element needed for the encoding the SPAT, MapData, SignalRequestMessage, SignalStatusMessage message +-- as defined in ISO TS 19091 and SAEJ2735 +-- +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +-- +-- module: REGION +-- +-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- + +REGION { iso (1) standard (0) signalizedIntersection (19091) profilec(2) region (1) version (1) } + +DEFINITIONS AUTOMATIC TAGS::= BEGIN + +IMPORTS +--FIXME RGY definitions moved to non-circularity module +--addGrpC, REG-EXT-ID-AND-TYPE FROM DSRC +addGrpC, REG-EXT-ID-AND-TYPE FROM DSRC-REGION-noCircular +--FIXME RGY Control-addGrpC has been moved to a non-circularity module +Control-addGrpC FROM AddGrpC-noCircular +ConnectionManeuverAssist-addGrpC, ConnectionTrajectory-addGrpC, IntersectionState-addGrpC, /*Control-addGrpC,*/ Position3D-addGrpC, RestrictionUserType-addGrpC, +SignalStatusPackage-addGrpC, MapData-addGrpC FROM AddGrpC {iso (1) standard (0) signalizedIntersection (19091) profilec(2) addgrpc (0) version (1)}; + + +Reg-AdvisorySpeed REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-ComputedLane REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-ConnectionManeuverAssist REG-EXT-ID-AND-TYPE ::= { + {ConnectionManeuverAssist-addGrpC IDENTIFIED BY addGrpC} , + ... +} + +Reg-GenericLane REG-EXT-ID-AND-TYPE ::= { + {ConnectionTrajectory-addGrpC IDENTIFIED BY addGrpC} , + ... +} + +Reg-IntersectionGeometry REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-IntersectionState REG-EXT-ID-AND-TYPE ::= { + {IntersectionState-addGrpC IDENTIFIED BY addGrpC} , + ... +} + +Reg-LaneAttributes REG-EXT-ID-AND-TYPE ::= { ... } + +/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop +Reg-LaneDataAttribute REG-EXT-ID-AND-TYPE ::= { ... } +*/ + +Reg-MapData REG-EXT-ID-AND-TYPE ::= { + {MapData-addGrpC IDENTIFIED BY addGrpC}, + ... +} + +Reg-MovementEvent REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-MovementState REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-NodeAttributeSetLL REG-EXT-ID-AND-TYPE ::= { ... } + +/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop +Reg-NodeAttributeSetXY REG-EXT-ID-AND-TYPE ::= { + {Control-addGrpC IDENTIFIED BY addGrpC} , + ... +} +*/ + +Reg-NodeOffsetPointLL REG-EXT-ID-AND-TYPE ::= { ... } + +/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop +Reg-NodeOffsetPointXY REG-EXT-ID-AND-TYPE ::= { ... } +*/ + +Reg-Position3D REG-EXT-ID-AND-TYPE ::= { + {Position3D-addGrpC IDENTIFIED BY addGrpC} , + ... +} + +Reg-RequestorDescription REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-RequestorType REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-RestrictionUserType REG-EXT-ID-AND-TYPE ::= { + {RestrictionUserType-addGrpC IDENTIFIED BY addGrpC} , + ... +} + +Reg-RoadSegment REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-SignalControlZone REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-SignalRequest REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-SignalRequestMessage REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-SignalRequestPackage REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-SignalStatus REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-SignalStatusMessage REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-SignalStatusPackage REG-EXT-ID-AND-TYPE ::= { + { SignalStatusPackage-addGrpC IDENTIFIED BY addGrpC} , + ... +} + +Reg-SPAT REG-EXT-ID-AND-TYPE ::= { ... } + +END diff --git a/asn1/IS/ISO_TS_19321.asn b/asn1/IS/ISO_TS_19321/IVI.asn similarity index 100% rename from asn1/IS/ISO_TS_19321.asn rename to asn1/IS/ISO_TS_19321/IVI.asn diff --git a/asn1/IS/ISO_TS_24534-3.asn b/asn1/IS/ISO_TS_24534-3/ElectronicRegistrationIdentificationVehicleDataModule.asn similarity index 100% rename from asn1/IS/ISO_TS_24534-3.asn rename to asn1/IS/ISO_TS_24534-3/ElectronicRegistrationIdentificationVehicleDataModule.asn -- GitLab From f5d2e09a374b712d900179e7a474ee49f8af1341 Mon Sep 17 00:00:00 2001 From: filatov Date: Mon, 6 Mar 2017 09:56:11 +0000 Subject: [PATCH 008/320] Separation of asn.1 modules of EV-RSR --- ...ions.asn => EV_RechargingSpotReservation_PDU_Descriptions.asn} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename asn1/EV-RSR/{EV-RSR-PDU-Descriptions.asn => EV_RechargingSpotReservation_PDU_Descriptions.asn} (100%) diff --git a/asn1/EV-RSR/EV-RSR-PDU-Descriptions.asn b/asn1/EV-RSR/EV_RechargingSpotReservation_PDU_Descriptions.asn similarity index 100% rename from asn1/EV-RSR/EV-RSR-PDU-Descriptions.asn rename to asn1/EV-RSR/EV_RechargingSpotReservation_PDU_Descriptions.asn -- GitLab From ce55310049c16d296945a74ec5b5992bb05b2a90 Mon Sep 17 00:00:00 2001 From: filatov Date: Mon, 6 Mar 2017 09:57:25 +0000 Subject: [PATCH 009/320] Separation of asn.1 modules of EVCSN --- .../{EVCSN-PDU-Descriptions.asn => EVCSN_PDU_Descriptions.asn} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename asn1/EVCSN/{EVCSN-PDU-Descriptions.asn => EVCSN_PDU_Descriptions.asn} (100%) diff --git a/asn1/EVCSN/EVCSN-PDU-Descriptions.asn b/asn1/EVCSN/EVCSN_PDU_Descriptions.asn similarity index 100% rename from asn1/EVCSN/EVCSN-PDU-Descriptions.asn rename to asn1/EVCSN/EVCSN_PDU_Descriptions.asn -- GitLab From 6f94fc94d2d4fe18442a24c2759562f10e6f6ac5 Mon Sep 17 00:00:00 2001 From: filatov Date: Mon, 6 Mar 2017 09:57:51 +0000 Subject: [PATCH 010/320] Separation of asn.1 modules of ITS-Container --- asn1/ITS-Container/{ITS-Container.asn => ITS_Container.asn} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename asn1/ITS-Container/{ITS-Container.asn => ITS_Container.asn} (100%) diff --git a/asn1/ITS-Container/ITS-Container.asn b/asn1/ITS-Container/ITS_Container.asn similarity index 100% rename from asn1/ITS-Container/ITS-Container.asn rename to asn1/ITS-Container/ITS_Container.asn -- GitLab From 77ffa63eea4eb2f7616fb8b96cfd294f069a332d Mon Sep 17 00:00:00 2001 From: filatov Date: Mon, 6 Mar 2017 10:20:37 +0000 Subject: [PATCH 011/320] Separation of asn.1 modules of IS --- asn1/IS/ETSI_TS_103301/ETSI_TS_103301.asn | 146 -- asn1/IS/ISO_TS_19091/ISO_TS_19091.asn | 2077 --------------------- 2 files changed, 2223 deletions(-) delete mode 100644 asn1/IS/ETSI_TS_103301/ETSI_TS_103301.asn delete mode 100644 asn1/IS/ISO_TS_19091/ISO_TS_19091.asn diff --git a/asn1/IS/ETSI_TS_103301/ETSI_TS_103301.asn b/asn1/IS/ETSI_TS_103301/ETSI_TS_103301.asn deleted file mode 100644 index a37d593b..00000000 --- a/asn1/IS/ETSI_TS_103301/ETSI_TS_103301.asn +++ /dev/null @@ -1,146 +0,0 @@ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- ETSI TS 103 301 --- --- This ASN.1 was generated: 30.08.2016 --- --- This document contains the data element needed for the encoding the SPATEM, MAPEM, IVIM, SSEM and SREM message --- as defined in ETSI TS 103 301 --- --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - - --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --- --- module: SPAT-MESSAGE-PDU-Descriptions --- --- This ASN.1 was created: 30.08.2016 --- --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- -SPATEM-PDU-Descriptions { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts-103301 (103301) spatem (0) version1 (1) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS -SPAT FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } -ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) }; - - -SPATEM ::= SEQUENCE { - header ItsPduHeader, - spat SPAT -} - -END - - - --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --- --- module: MAP-MESSAGE-PDU-Descriptions --- --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- -MAPEM-PDU-Descriptions { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts-103301 (103301) mapem (1) version1 (1) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS -MapData FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } -ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1)}; - - -MAPEM ::= SEQUENCE { - header ItsPduHeader, - map MapData -} - -END - - - --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --- --- module: IVI-MESSAGE-PDU-Descriptions --- --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- -IVIM-PDU-Descriptions { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts-103301 (103301) ivim (2) version1 (1) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS -IviStructure FROM IVI {iso (1) standard (0) ivi (19321) version1 (1)} -ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1)}; - - -IVIM ::= SEQUENCE { - header ItsPduHeader, - ivi IviStructure -} - -END - - - --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --- --- module: SRM-MESSAGE-PDU-Descriptions --- --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- -SREM-PDU-Descriptions { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts-103301 (103301) srem (3) version1 (1) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS -SignalRequestMessage FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } -ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) }; - -SREM ::= SEQUENCE { - header ItsPduHeader, - srm SignalRequestMessage -} - -END - - - --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --- --- module: SSM-MESSAGE-PDU-Descriptions --- --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- -SSEM-PDU-Descriptions { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts-103301 (103301) ssem (4) version1 (1) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS -SignalStatusMessage FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } -ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) }; - - -SSEM ::= SEQUENCE { - header ItsPduHeader, - ssm SignalStatusMessage -} - -END - diff --git a/asn1/IS/ISO_TS_19091/ISO_TS_19091.asn b/asn1/IS/ISO_TS_19091/ISO_TS_19091.asn deleted file mode 100644 index 6f8ca684..00000000 --- a/asn1/IS/ISO_TS_19091/ISO_TS_19091.asn +++ /dev/null @@ -1,2077 +0,0 @@ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- ISO TS 19091 --- --- This ASN.1 was generated: 30.08.2016 --- --- This document contains the data element needed for the encoding the SPAT, MapData, SignalRequestMessage, SignalStatusMessage message --- as defined in ISO TS 19091 and SAEJ2735 --- --- It includes the addendunm extensions for Addgrp-C (e.g. Europe) --- --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --- --- module: AddGrpC --- --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- -AddGrpC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) addgrpc (0) version (1) } - - -DEFINITIONS AUTOMATIC TAGS::= BEGIN - -IMPORTS -NodeOffsetPointXY, NodeSetXY, PrioritizationResponseStatus, SignalGroupID, DeltaTime, LaneID FROM DSRC -Altitude, StationID, DeltaAltitude FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) }; - - -ConnectionManeuverAssist-addGrpC ::= SEQUENCE { - itsStationPositions ItsStationPositionList OPTIONAL, - rsuGNSSOffset NodeOffsetPointXY OPTIONAL, - ... -} - -ConnectionTrajectory-addGrpC ::= SEQUENCE { - nodes NodeSetXY, - ... -} - -Control-addGrpC ::= SEQUENCE { - ptvRequest PtvRequestType, - ... -} - -IntersectionState-addGrpC ::= SEQUENCE { - activePrioritizations PrioritizationResponseList OPTIONAL, - ... -} - -MapData-addGrpC ::= SEQUENCE { - signalHeadLocations SignalHeadLocationList OPTIONAL, - ... -} - -Position3D-addGrpC ::= SEQUENCE { - altitude Altitude, - ... -} - -PrioritizationResponseList ::= SEQUENCE SIZE(1..10) OF PrioritizationResponse - -PrioritizationResponse ::= SEQUENCE { - stationID StationID, - priorState PrioritizationResponseStatus, - signalGroup SignalGroupID, - ... -} - -RestrictionUserType-addGrpC ::= SEQUENCE { - emission EmissionType OPTIONAL, - ... -} - -SignalHeadLocationList ::= SEQUENCE (SIZE(1..64)) OF SignalHeadLocation - -SignalHeadLocation ::= SEQUENCE { - nodeXY NodeOffsetPointXY, - nodeZ DeltaAltitude, - signalGroupID SignalGroupID, - ... -} - -SignalStatusPackage-addGrpC ::= SEQUENCE { - synchToSchedule DeltaTime OPTIONAL, - ... -} - - -ItsStationPositionList::= SEQUENCE SIZE(1..5) OF ItsStationPosition - -ItsStationPosition ::= SEQUENCE { - stationID StationID, - laneID LaneID OPTIONAL, - nodeXY NodeOffsetPointXY OPTIONAL, - timeReference TimeReference OPTIONAL, - ... -} -EmissionType ::= ENUMERATED { - euro1, - euro2, - euro3, - euro4, - euro5, - euro6, - ... -} - -PtvRequestType ::= ENUMERATED { - preRequest, - mainRequest, - doorCloseRequest, - cancelRequest, - emergencyRequest, - ... -} - -TimeReference ::= INTEGER { oneMilliSec(1) } (0..65535) - -END - - - --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --- --- module: REGION --- --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- -REGION { iso (1) standard (0) signalizedIntersection (19091) profilec(2) region (1) version (1) } - -DEFINITIONS AUTOMATIC TAGS::= BEGIN - -IMPORTS -addGrpC, REG-EXT-ID-AND-TYPE FROM DSRC -ConnectionManeuverAssist-addGrpC, ConnectionTrajectory-addGrpC, IntersectionState-addGrpC, Control-addGrpC, Position3D-addGrpC, RestrictionUserType-addGrpC, -SignalStatusPackage-addGrpC, MapData-addGrpC FROM AddGrpC {iso (1) standard (0) signalizedIntersection (19091) profilec(2) addgrpc (0) version (1)}; - -Reg-AdvisorySpeed REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-ComputedLane REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-ConnectionManeuverAssist REG-EXT-ID-AND-TYPE ::= { - {ConnectionManeuverAssist-addGrpC IDENTIFIED BY addGrpC} , - ... -} - -Reg-GenericLane REG-EXT-ID-AND-TYPE ::= { - {ConnectionTrajectory-addGrpC IDENTIFIED BY addGrpC} , - ... -} - -Reg-IntersectionGeometry REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-IntersectionState REG-EXT-ID-AND-TYPE ::= { - {IntersectionState-addGrpC IDENTIFIED BY addGrpC} , - ... -} - -Reg-LaneAttributes REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-LaneDataAttribute REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-MapData REG-EXT-ID-AND-TYPE ::= { - {MapData-addGrpC IDENTIFIED BY addGrpC}, - ... -} - -Reg-MovementEvent REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-MovementState REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-NodeAttributeSetLL REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-NodeAttributeSetXY REG-EXT-ID-AND-TYPE ::= { - {Control-addGrpC IDENTIFIED BY addGrpC} , - ... -} - -Reg-NodeOffsetPointLL REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-NodeOffsetPointXY REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-Position3D REG-EXT-ID-AND-TYPE ::= { - {Position3D-addGrpC IDENTIFIED BY addGrpC} , - ... -} - -Reg-RequestorDescription REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-RequestorType REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-RestrictionUserType REG-EXT-ID-AND-TYPE ::= { - {RestrictionUserType-addGrpC IDENTIFIED BY addGrpC} , - ... -} - -Reg-RoadSegment REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalControlZone REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalRequest REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalRequestMessage REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalRequestPackage REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalStatus REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalStatusMessage REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalStatusPackage REG-EXT-ID-AND-TYPE ::= { - { SignalStatusPackage-addGrpC IDENTIFIED BY addGrpC} , - ... -} - -Reg-SPAT REG-EXT-ID-AND-TYPE ::= { ... } - -END - - - --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --- --- module: DSRC --- --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- -DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } - -DEFINITIONS AUTOMATIC TAGS::= BEGIN - -IMPORTS -StationID, Longitude, Latitude, SpeedConfidence FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) } -Reg-SPAT,Reg-SignalRequestMessage, Reg-SignalStatusMessage, Reg-MapData, Reg-AdvisorySpeed, Reg-ComputedLane, Reg-ConnectionManeuverAssist, -Reg-GenericLane, Reg-IntersectionGeometry, Reg-IntersectionState, Reg-LaneAttributes, Reg-LaneDataAttribute, Reg-MovementEvent, Reg-MovementState, -Reg-NodeAttributeSetXY, Reg-NodeOffsetPointXY,Reg-Position3D, Reg-RequestorDescription, Reg-RequestorType, Reg-RestrictionUserType, Reg-RoadSegment, -Reg-SignalControlZone, Reg-SignalRequestPackage, Reg-SignalRequest, Reg-SignalStatusPackage, Reg-SignalStatus FROM REGION { iso (1) standard (0) signalizedIntersection (19091) profilec(2) region (1) version (1)} -Iso3833VehicleType FROM ElectronicRegistrationIdentificationVehicleDataModule { iso(1) standard(0) iso24534 (24534) vehicleData (1) version (1) }; - --- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ --- --- Start of entries from table Messages... --- This table typicaly contains message entries. --- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ --- - -MessageFrame ::= SEQUENCE { - messageId MESSAGE-ID-AND-TYPE.&id({MessageTypes}), - value MESSAGE-ID-AND-TYPE.&Type({MessageTypes}{@.messageId}), - ... - } - -MESSAGE-ID-AND-TYPE ::= CLASS { - &id DSRCmsgID UNIQUE, - &Type - } WITH SYNTAX {&Type IDENTIFIED BY &id} - -MessageTypes MESSAGE-ID-AND-TYPE ::= { - { MapData IDENTIFIED BY mapData } | - { SPAT IDENTIFIED BY signalPhaseAndTimingMessage } | - { SignalRequestMessage IDENTIFIED BY signalRequestMessage } | - { SignalStatusMessage IDENTIFIED BY signalStatusMessage }, - ... -- Expansion to be used only by the SAE J2735 DSRC TC - } - - --- Regional extensions support -REG-EXT-ID-AND-TYPE ::= CLASS { - &id RegionId UNIQUE, - &Type - } WITH SYNTAX {&Type IDENTIFIED BY &id} - -RegionalExtension {REG-EXT-ID-AND-TYPE : Set} ::= SEQUENCE { - regionId REG-EXT-ID-AND-TYPE.&id( {Set} ), - regExtValue REG-EXT-ID-AND-TYPE.&Type( {Set}{@regionId} ) - } - -SPAT ::= SEQUENCE { - timeStamp MinuteOfTheYear OPTIONAL, - name DescriptiveName OPTIONAL, - -- human readable name for this collection - -- to be used only in debug mode - - intersections IntersectionStateList, - -- sets of SPAT data (one per intersection) - - -- If PrioritizationResponse data is required, it is found - -- in the RegionalSPAT entry below - - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SPAT}} OPTIONAL, - ... - } - -SignalRequestMessage ::= SEQUENCE { - timeStamp MinuteOfTheYear OPTIONAL, - second DSecond, - sequenceNumber MsgCount OPTIONAL, - - requests SignalRequestList OPTIONAL, - -- Request Data for one or more signalized - -- intersections that support SRM dialogs - - requestor RequestorDescription, - -- Requesting Device and other User Data - -- contains vehicle ID (if from a vehicle) - -- as well as type data and current position - -- and may contain additional transit data - - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalRequestMessage}} OPTIONAL, - ... -} - -SignalStatusMessage ::= SEQUENCE { - timeStamp MinuteOfTheYear OPTIONAL, - second DSecond, - sequenceNumber MsgCount OPTIONAL, - - -- Status Data for one of more signalized intersections - status SignalStatusList, - - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalStatusMessage}} OPTIONAL, - ... -} - -MapData ::= SEQUENCE { - timeStamp MinuteOfTheYear OPTIONAL, - msgIssueRevision MsgCount, - layerType LayerType OPTIONAL, - layerID LayerID OPTIONAL, - intersections IntersectionGeometryList OPTIONAL, - -- All Intersection definitions - roadSegments RoadSegmentList OPTIONAL, - -- All roadway descriptions - - dataParameters DataParameters OPTIONAL, - -- Any meta data regarding the map contents - - restrictionList RestrictionClassList OPTIONAL, - -- Any restriction ID tables which have - -- established for these map entries - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-MapData}} OPTIONAL, - - -- NOTE: - -- Other map data will be added here as it is defined - -- Examples of the type of content to be added include - -- curve warnings, construction routes, etc. - ... -} - - --- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ --- --- Start of entries from table Data_Frames... --- This table typicaly contains data frame entries. --- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ --- - -AdvisorySpeed ::= SEQUENCE { - type AdvisorySpeedType, - -- the type of advisory which this is. - speed SpeedAdvice OPTIONAL, - -- See Section 11 for converting and translating speed - -- expressed in mph into units of m/s - -- This element is optional ONLY when superceded - -- by the presence of a regional speed element found in - -- Reg-AdvisorySpeed entry - confidence SpeedConfidence OPTIONAL, - -- A confidence value for the above speed - distance ZoneLength OPTIONAL, - -- Unit = 1 meter, - -- The distance indicates the region for which the advised speed - -- is recommended, it is specified upstream from the stop bar - -- along the connected egressing lane - class RestrictionClassID OPTIONAL, - -- the vehicle types to which it applies - -- when absent, the AdvisorySpeed applies to - -- all motor vehicle types - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-AdvisorySpeed}} OPTIONAL, - ... - } - -AdvisorySpeedList ::= SEQUENCE (SIZE(1..16)) OF AdvisorySpeed - -ComputedLane ::= SEQUENCE { - -- Data needed to created a computed lane - referenceLaneId LaneID, - -- the lane ID upon which this - -- computed lane will be based - -- Lane Offset in X and Y direction - offsetXaxis CHOICE { - small DrivenLineOffsetSm, - large DrivenLineOffsetLg - }, - offsetYaxis CHOICE { - small DrivenLineOffsetSm, - large DrivenLineOffsetLg - }, - -- A path X offset value for translations of the - -- path's points when creating translated lanes. - -- The values found in the reference lane are - -- all offset based on the X and Y values from - -- the coordinates of the reference lane's - -- initial path point. - -- Lane Rotation - rotateXY Angle OPTIONAL, - -- A path rotation value for the entire lane - -- Observe that this rotates the existing orientation - -- of the referenced lane, it does not replace it. - -- Rotation occurs about the initial path point. - -- Lane Path Scale (zooming) - scaleXaxis Scale-B12 OPTIONAL, - scaleYaxis Scale-B12 OPTIONAL, - -- value for translations or zooming of the path's - -- points. The values found in the reference lane - -- are all expanded or contracted based on the X - -- and Y and width values from the coordinates of - -- the reference lane's initial path point. - -- The Z axis remains untouched. - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-ComputedLane}} OPTIONAL, - ... - } -ConnectsToList ::= SEQUENCE (SIZE(1..16)) OF Connection - -ConnectingLane ::= SEQUENCE { - lane LaneID, -- Index of the connecting lane - maneuver AllowedManeuvers OPTIONAL - -- The Maneuver between - -- the enclosing lane and this lane - -- at the stop line to connect them - } - - -Connection ::= SEQUENCE { - -- The subject lane connecting to this lane is: - connectingLane ConnectingLane, - -- The index of the connecting lane and also - -- the maneuver from the current lane to it - remoteIntersection IntersectionReferenceID OPTIONAL, - -- This entry is only used when the - -- indicated connecting lane belongs - -- to another intersection layout. This - -- provides a means to create meshes of lanes - - -- SPAT mapping details at the stop line are: - signalGroup SignalGroupID OPTIONAL, - -- The matching signal group send by - -- the SPAT message for this lane/maneuver. - -- Shall be present unless the connectingLane - -- has no signal group (is un-signalized) - userClass RestrictionClassID OPTIONAL, - -- The Restriction Class of users this applies to - -- The use of some lane/maneuver and SignalGroupID - -- pairings are restricted to selected users. - -- When absent, the SignalGroupID applies to all - - -- Movement assist details are given by: - connectionID LaneConnectionID OPTIONAL - -- An optional connection index used to - -- relate this lane connection to any dynamic - -- clearance data in the SPAT. Note that - -- the index may be shared with other - -- connections if the clearance data is common - } - - -ConnectionManeuverAssist ::= SEQUENCE { - connectionID LaneConnectionID, - -- the common connectionID used by all lanes to which - -- this data applies - -- (this value traces to ConnectsTo entries in lanes) - -- Expected Clearance Information - queueLength ZoneLength OPTIONAL, - -- Unit = 1 meter, 0 = no queue - -- The distance from the stop line to the back - -- edge of the last vehicle in the queue, - -- as measured along the lane center line. - availableStorageLength ZoneLength OPTIONAL, - -- Unit = 1 meter, 0 = no space remains - -- Distance (e.g. beginning from the downstream - -- stop-line up to a given distance) with a high - -- probability for successfully executing the - -- connecting maneuver between the two lanes - -- during the current cycle. - -- Used for enhancing the awareness of vehicles - -- to anticipate if they can pass the stop line - -- of the lane. Used for optimizing the green wave, - -- due to knowledge of vehicles waiting in front - -- of a red light (downstream). - -- The element nextTime in TimeChangeDetails - -- in the containing data frame contains the next - -- timemark at which an active phase is expected, - -- a form of storage flush interval. - waitOnStop WaitOnStopline OPTIONAL, - -- If "true", the vehicles on this specific connecting - -- maneuver have to stop on the stop-line and not - -- to enter the collision area - pedBicycleDetect PedestrianBicycleDetect OPTIONAL, - -- true if ANY ped or bicycles are detected crossing - -- the above lanes. Set to false ONLY if there is a - -- high certainty that there are none present, - -- otherwise element is not sent. - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-ConnectionManeuverAssist}} OPTIONAL, - ... - } - -DataParameters ::= SEQUENCE { - processMethod IA5String(SIZE(1..255)) OPTIONAL, - processAgency IA5String(SIZE(1..255)) OPTIONAL, - lastCheckedDate IA5String(SIZE(1..255)) OPTIONAL, - geoidUsed IA5String(SIZE(1..255)) OPTIONAL, - ... - } - -EnabledLaneList ::= SEQUENCE (SIZE(1..16)) OF LaneID - -- The unique ID numbers for each - -- lane object which is 'active' - -- as part of the dynamic map contents. - -GenericLane ::= SEQUENCE { - laneID LaneID, - -- The unique ID number assigned - -- to this lane object - name DescriptiveName OPTIONAL, - -- often for debug use only - -- but at times used to name ped crossings - ingressApproach ApproachID OPTIONAL, -- inbound - egressApproach ApproachID OPTIONAL, -- outbound - -- Approach IDs to which this lane belongs - laneAttributes LaneAttributes, - -- All Attribute information about - -- the basic selected lane type - -- Directions of use, Geometric co-sharing - -- and Type Specific Attributes - -- These Attributes are 'lane - global' that is, - -- they are true for the entire length of the lane - maneuvers AllowedManeuvers OPTIONAL, - -- the permitted maneuvers for this lane - nodeList NodeListXY, - -- Lane spatial path information as well as - -- various Attribute information along the node path - -- Attributes found here are more general and may - -- come and go over the length of the lane. - connectsTo ConnectsToList OPTIONAL, - -- a list of other lanes and their signal group IDs - -- each connecting lane and its signal group ID - -- is given, therefore this element provides the - -- information formerly in "signalGroups" in prior - -- editions. - overlays OverlayLaneList OPTIONAL, - -- A list of any lanes which have spatial paths that - -- overlay (run on top of, and not simply cross) - -- the path of this lane when used - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-GenericLane}} OPTIONAL, - ... - } - -IntersectionAccessPoint ::= CHOICE { - lane LaneID, - approach ApproachID, - connection LaneConnectionID, - ... - } - -IntersectionGeometry ::= SEQUENCE { - name DescriptiveName OPTIONAL, - -- For debug use only - id IntersectionReferenceID, - -- A globally unique value set, - -- consisting of a regionID and - -- intersection ID assignment - revision MsgCount, - - -- Required default values about lane descriptions follow - refPoint Position3D, -- The reference from which subsequent - -- data points are offset until a new - -- point is used. - laneWidth LaneWidth OPTIONAL, - -- Reference width used by all subsequent - -- lanes unless a new width is given - speedLimits SpeedLimitList OPTIONAL, - -- Reference regulatory speed limits - -- used by all subsequent - -- lanes unless a new speed is given - -- See Section 11 for converting and - -- translating speed expressed in mph - -- into units of m/s - -- Complete details regarding each lane type in this intersection - laneSet LaneList, -- Data about one or more lanes - -- (all lane data is found here) - - -- Data describing how to use and request preemption and - -- priority services from this intersection (if supported) - -- NOTE Additonal data may be added in the next release of the - -- standard at this point to handle this concept - preemptPriorityData PreemptPriorityList OPTIONAL, - -- data about one or more regional - -- preempt or priority zones - - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-IntersectionGeometry}} OPTIONAL, - ... - } - -IntersectionGeometryList ::= SEQUENCE (SIZE(1..32)) OF IntersectionGeometry - -IntersectionReferenceID ::= SEQUENCE { - region RoadRegulatorID OPTIONAL, - -- a globally unique regional assignment value - -- typical assigned to a regional DOT authority - -- the value zero shall be used for testing needs - id IntersectionID - -- a unique mapping to the intersection - -- in question within the above region of use - } - -IntersectionState ::= SEQUENCE { - name DescriptiveName OPTIONAL, - -- human readable name for intersection - -- to be used only in debug mode - id IntersectionReferenceID, - -- A globally unique value set, consisting of a - -- regionID and intersection ID assignment - -- provides a unique mapping to the - -- intersection MAP in question - -- which provides complete location - -- and approach/move/lane data - revision MsgCount, - status IntersectionStatusObject, - -- general status of the controller(s) - moy MinuteOfTheYear OPTIONAL, - -- Minute of current UTC year - -- used only with messages to be archived - timeStamp DSecond OPTIONAL, - -- the mSec point in the current UTC minute that - -- this message was constructed - enabledLanes EnabledLaneList OPTIONAL, - -- a list of lanes where the RevocableLane bit - -- has been set which are now active and - -- therefore part of the current intersection - states MovementList, - -- Each Movement is given in turn - -- and contains its signal phase state, - -- mapping to the lanes it applies to, and - -- point in time it will end, and it - -- may contain both active and future states - maneuverAssistList ManeuverAssistList OPTIONAL, - -- Assist data - - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-IntersectionState}} OPTIONAL, - ... - } - -IntersectionStateList ::= SEQUENCE (SIZE(1..32)) OF IntersectionState - -LaneAttributes ::= SEQUENCE { - directionalUse LaneDirection, -- directions of lane use - sharedWith LaneSharing, -- co-users of the lane path - laneType LaneTypeAttributes, -- specific lane type data - regional RegionalExtension {{Reg-LaneAttributes}} OPTIONAL - } - -LaneDataAttribute ::= CHOICE { - -- Segment attribute types and the data needed for each - pathEndPointAngle DeltaAngle, - -- adjusts final point/width slant - -- of the lane to align with the stop line - laneCrownPointCenter RoadwayCrownAngle, - -- sets the canter of the road bed - -- from centerline point - laneCrownPointLeft RoadwayCrownAngle, - -- sets the canter of the road bed - -- from left edge - laneCrownPointRight RoadwayCrownAngle, - -- sets the canter of the road bed - -- from right edge - laneAngle MergeDivergeNodeAngle, - -- the angle or direction of another lane - -- this is required to support Japan style - -- when a merge point angle is required - speedLimits SpeedLimitList, - -- Reference regulatory speed limits - -- used by all segments - - -- Add others as needed, in regional space - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-LaneDataAttribute}}, - ... - } - -LaneDataAttributeList ::= SEQUENCE (SIZE(1..8)) OF LaneDataAttribute - -LaneList ::= SEQUENCE (SIZE(1..255)) OF GenericLane - -LaneSharing ::= BIT STRING { - -- With bits as defined: - overlappingLaneDescriptionProvided (0), - -- Assert when another lane object is present to describe the - -- path of the overlapping shared lane - -- this construct is not used for lane objects which simply cross - multipleLanesTreatedAsOneLane (1), - -- Assert if the lane object path and width details represents - -- multiple lanes within it that are not further described - - -- Various modes and type of traffic that may share this lane: - otherNonMotorizedTrafficTypes (2), -- horse drawn etc. - individualMotorizedVehicleTraffic (3), - busVehicleTraffic (4), - taxiVehicleTraffic (5), - pedestriansTraffic (6), - cyclistVehicleTraffic (7), - trackedVehicleTraffic (8), - pedestrianTraffic (9) - } (SIZE (10)) - -- All zeros would indicate 'not shared' and 'not overlapping' - -LaneTypeAttributes ::= CHOICE { - vehicle LaneAttributes-Vehicle, -- motor vehicle lanes - crosswalk LaneAttributes-Crosswalk, -- pedestrian crosswalks - bikeLane LaneAttributes-Bike, -- bike lanes - sidewalk LaneAttributes-Sidewalk, -- pedestrian sidewalk paths - median LaneAttributes-Barrier, -- medians & channelization - striping LaneAttributes-Striping, -- roadway markings - trackedVehicle LaneAttributes-TrackedVehicle, -- trains and trolleys - parking LaneAttributes-Parking, -- parking and stopping lanes - ... - } - -ManeuverAssistList ::= SEQUENCE (SIZE(1..16)) OF ConnectionManeuverAssist - -MovementEventList ::= SEQUENCE (SIZE(1..16)) OF MovementEvent - -MovementEvent ::= SEQUENCE { - eventState MovementPhaseState, - -- Consisting of: - -- Phase state (the basic 11 states) - -- Directional, protected, or permissive state - - timing TimeChangeDetails OPTIONAL, - -- Timing Data in UTC time stamps for event - -- includes start and min/max end times of phase - -- confidence and estimated next occurrence - - speeds AdvisorySpeedList OPTIONAL, - -- various speed advisories for use by - -- general and specific types of vehicles - -- supporting green-wave and other flow needs - -- See Section 11 for converting and translating - -- speed expressed in mph into units of m/s - - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-MovementEvent}} OPTIONAL, - ... - } - -MovementList ::= SEQUENCE (SIZE(1..255)) OF MovementState - -MovementState ::= SEQUENCE { - movementName DescriptiveName OPTIONAL, - -- uniquely defines movement by name - -- human readable name for intersection - -- to be used only in debug mode - signalGroup SignalGroupID, - -- the group id is used to map to lists - -- of lanes (and their descriptions) - -- which this MovementState data applies to - -- see comments in the Remarks for usage details - state-time-speed MovementEventList, - -- Consisting of sets of movement data with: - -- a) SignalPhaseState - -- b) TimeChangeDetails, and - -- c) AdvisorySpeeds (optional ) - -- Note one or more of the movement events may be for - -- a future time and that this allows conveying multiple - -- predictive phase and movement timing for various uses - -- for the current signal group - maneuverAssistList ManeuverAssistList OPTIONAL, - -- This information may also be placed in the - -- IntersectionState when common information applies to - -- different lanes in the same way - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-MovementState}} OPTIONAL, - ... - } - -NodeAttributeSetXY ::= SEQUENCE { - localNode NodeAttributeXYList OPTIONAL, - -- Attribute states which pertain to this node point - disabled SegmentAttributeXYList OPTIONAL, - -- Attribute states which are disabled at this node point - enabled SegmentAttributeXYList OPTIONAL, - -- Attribute states which are enabled at this node point - -- and which remain enabled until disabled or the lane ends - data LaneDataAttributeList OPTIONAL, - -- Attributes which require an additional data values - -- some of these are local to the node point, while others - -- persist with the provided values until changed - -- and this is indicated in each entry - dWidth Offset-B10 OPTIONAL, - -- A value added to the current lane width - -- at this node and from this node onwards, in 1cm steps - -- lane width between nodes are a linear taper between pts - -- the value of zero shall not be sent here - dElevation Offset-B10 OPTIONAL, - -- A value added to the current Elevation - -- at this node from this node onwards, in 10cm steps - -- elevations between nodes are a linear taper between pts - -- the value of zero shall not be sent here - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-NodeAttributeSetXY}} OPTIONAL, - ... - } - -NodeAttributeXYList ::= SEQUENCE (SIZE(1..8)) OF NodeAttributeXY - -NodeAttributeXY ::= ENUMERATED { - -- Various values which pertain only to the current node point - - -- General Items - reserved, - stopLine, -- point where a mid-path stop line exists - -- See also 'do not block' for segments - - -- Path finish details - roundedCapStyleA, -- Used to control final path rounded end shape - -- with edge of curve at final point in a circle - roundedCapStyleB, -- Used to control final path rounded end shape - -- with edge of curve extending 50% of width past - -- final point in a circle - - -- Topography Points (items with no concept of a distance along the path) - mergePoint, -- Japan merge with 1 or more lanes - divergePoint, -- Japan diverge with 1 or more lanes - downstreamStopLine, -- Japan style downstream intersection - -- (a 2nd intersection) stop line - downstreamStartNode, -- Japan style downstream intersection - -- (a 2nd intersection) start node - - -- Pedestrian Support Attributes - closedToTraffic, -- where a pedestrian may NOT go - -- to be used during construction events - safeIsland, -- a pedestrian safe stopping point - -- also called a traffic island - -- This usage described a point feature on a path, - -- other entries can describe a path - curbPresentAtStepOff, -- the sidewalk to street curb is NOT - -- angled where it meets the edge of the - -- roadway (user must step up/down) - - -- Lane geometry details (see standard for defined shapes) - hydrantPresent, -- Or other services access - ... - } - -Node-LLmD-64b ::= SEQUENCE { - lon Longitude, - lat Latitude - } - - Node-XY-20b ::= SEQUENCE { - x Offset-B10, - y Offset-B10 - } - -Node-XY-22b ::= SEQUENCE { - x Offset-B11, - y Offset-B11 - } - - -Node-XY-24b ::= SEQUENCE { - x Offset-B12, - y Offset-B12 - } - - -Node-XY-26b ::= SEQUENCE { - x Offset-B13, - y Offset-B13 - } - - -Node-XY-28b ::= SEQUENCE { - x Offset-B14, - y Offset-B14 - } - - -Node-XY-32b ::= SEQUENCE { - x Offset-B16, - y Offset-B16 - } - -NodeListXY ::= CHOICE { - nodes NodeSetXY, - -- a lane made up of two or more - -- XY node points and any attributes - -- defined in those nodes - computed ComputedLane, - -- a lane path computed by translating - -- the data defined by another lane - ... - } - -NodeOffsetPointXY ::= CHOICE { - -- Nodes with X,Y content - node-XY1 Node-XY-20b, -- node is within 5.11m of last node - node-XY2 Node-XY-22b, -- node is within 10.23m of last node - node-XY3 Node-XY-24b, -- node is within 20.47m of last node - node-XY4 Node-XY-26b, -- node is within 40.96m of last node - node-XY5 Node-XY-28b, -- node is within 81.91m of last node - node-XY6 Node-XY-32b, -- node is within 327.67m of last node - node-LatLon Node-LLmD-64b, -- node is a full 32b Lat/Lon range - regional RegionalExtension {{Reg-NodeOffsetPointXY}} - -- node which follows is of a - -- regional definition type - } - -NodeSetXY ::= SEQUENCE (SIZE(2..63)) OF NodeXY - -NodeXY ::= SEQUENCE { - delta NodeOffsetPointXY, - -- A choice of which X,Y offset value to use - -- this includes various delta values as well a regional choices - attributes NodeAttributeSetXY OPTIONAL, - -- Any optional Attributes which are needed - -- This includes changes to the current lane width and elevation - ... -} - -OverlayLaneList ::= SEQUENCE (SIZE(1..5)) OF LaneID - -- The unique ID numbers for any lane object which have - -- spatial paths that overlay (run on top of, and not - -- simply cross with) the current lane. - -- Such as a train path that overlays a motor vehicle - -- lane object for a roadway segment. - -Position3D ::= SEQUENCE { - lat Latitude, -- in 1/10th micro degrees - long Longitude, -- in 1/10th micro degrees - elevation Elevation OPTIONAL, -- in 10 cm units - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-Position3D}} OPTIONAL, - ... - } - -PreemptPriorityList ::= SEQUENCE (SIZE(1..32)) OF SignalControlZone - -RegulatorySpeedLimit ::= SEQUENCE { - type SpeedLimitType, - -- The type of regulatory speed which follows - speed Velocity - -- The speed in units of 0.02 m/s - -- See Section 11 for converting and translating - -- speed expressed in mph into units of m/s - } - -RequestorDescription ::= SEQUENCE { - id VehicleID, - -- The ID used in the BSM or CAM of the requestor - -- This ID is presumed not to change - -- during the exchange - type RequestorType OPTIONAL, - -- Information regarding all type and class data - -- about the requesting vehicle - position RequestorPositionVector OPTIONAL, - -- The location of the requesting vehicle - name DescriptiveName OPTIONAL, - -- A human readable name for debugging use - -- Support for Transit requests - routeName DescriptiveName OPTIONAL, - -- A string for transit operations use - transitStatus TransitVehicleStatus OPTIONAL, - -- current vehicle state (loading, etc.) - transitOccupancy TransitVehicleOccupancy OPTIONAL, - -- current vehicle occupancy - transitSchedule DeltaTime OPTIONAL, - -- current vehicle schedule adherence - - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-RequestorDescription}} OPTIONAL, - ... - } - -RequestorPositionVector ::= SEQUENCE { - position Position3D, - heading Angle OPTIONAL, - speed TransmissionAndSpeed OPTIONAL, - ... - } - -RequestorType ::= SEQUENCE { - -- Defines who is requesting - role BasicVehicleRole, -- Basic role of this user at this time - subrole RequestSubRole OPTIONAL, -- A local list with role based items - - -- Defines what kind of request (a level of importance in the Priority Scheme) - request RequestImportanceLevel OPTIONAL, -- A local list with request items - - -- Additional classification details - iso3883 Iso3833VehicleType OPTIONAL, - hpmsType VehicleType OPTIONAL, -- HPMS classification types - - regional RegionalExtension {{Reg-RequestorType}} OPTIONAL, - ... - } - -RestrictionClassAssignment ::= SEQUENCE { - id RestrictionClassID, - -- the unique value (within an intersection or local region) - -- that is assigned to this group of users - users RestrictionUserTypeList - -- The list of user types/classes - -- to which this restriction ID applies - } - -RestrictionClassList ::= SEQUENCE (SIZE(1..254)) OF RestrictionClassAssignment - -RestrictionUserTypeList ::= SEQUENCE (SIZE(1..16)) OF RestrictionUserType - -RestrictionUserType ::= CHOICE { - basicType RestrictionAppliesTo, - -- a set of the most commonly used types - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-RestrictionUserType}}, - ... - } - -RoadLaneSetList ::= SEQUENCE (SIZE(1..255)) OF GenericLane - -RoadSegmentReferenceID ::= SEQUENCE { - region RoadRegulatorID OPTIONAL, - -- a globally unique regional assignment value - -- typically assigned to a regional DOT authority - -- the value zero shall be used for testing needs - id RoadSegmentID - -- a unique mapping to the road segment - -- in question within the above region of use - -- during its period of assignment and use - -- note that unlike intersectionID values, - -- this value can be reused by the region - } - -RoadSegment ::= SEQUENCE { - name DescriptiveName OPTIONAL, - id RoadSegmentReferenceID, - -- a globally unique value for the segment - revision MsgCount, - -- Required default values about the descriptions to follow - refPoint Position3D, -- the reference from which subsequent - -- data points are offset until a new - -- point is used. - laneWidth LaneWidth OPTIONAL, - -- Reference width used by all subsequent - -- lanes unless a new width is given - speedLimits SpeedLimitList OPTIONAL, - -- Reference regulatory speed limits - -- used by all subsequent - -- lanes unless a new speed is given - -- See Section 11 for converting and - -- translating speed expressed in mph - -- into units of m/s - - -- Data describing disruptions in the RoadSegment - -- such as work zones etc will be added here; - -- in the US the SAE ITIS codes would be used here - -- The details regarding each lane type in the RoadSegment - roadLaneSet RoadLaneSetList, - - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-RoadSegment}} OPTIONAL, - ... - } - -RoadSegmentList ::= SEQUENCE (SIZE(1..32)) OF RoadSegment - -SegmentAttributeXYList ::= SEQUENCE (SIZE(1..8)) OF SegmentAttributeXY - -SignalControlZone ::= SEQUENCE { - zone RegionalExtension {{Reg-SignalControlZone}}, - ... - } - -SignalRequesterInfo ::= SEQUENCE { - -- These three items serve to uniquely identify the requester - -- and the specific request to all parties - id VehicleID, - request RequestID, - sequenceNumber MsgCount, - role BasicVehicleRole OPTIONAL, - - typeData RequestorType OPTIONAL, - -- Used when addition data besides the role - -- is needed, at which point the role entry - -- above is not sent. - ... - } - -SignalRequestList ::= SEQUENCE (SIZE(1..32)) OF SignalRequestPackage - -SignalRequestPackage ::= SEQUENCE { - request SignalRequest, - -- The specific request to the intersection - -- contains IntersectionID, request type, - -- requested action (approach/lane request) - - -- The Estimated Time of Arrival (ETA) when the service is requested - minute MinuteOfTheYear OPTIONAL, - second DSecond OPTIONAL, - duration DSecond OPTIONAL, - -- The duration value is used to provide a short interval that - -- extends the ETA so that the requesting vehicle can arrive at - -- the point of service with uncertainty or with some desired - -- duration of service. This concept can be used to avoid needing - -- to frequently update the request. - -- The requester must update the ETA and duration values if the - -- period of services extends beyond the duration time. - -- It should be assumed that if the vehicle does not clear the - -- intersection when the duration is reached, the request will - -- be cancelled and the intersection will revert to - -- normal operation. - - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalRequestPackage}} OPTIONAL, - ... - } - -SignalRequest ::= SEQUENCE { - -- the unique ID of the target intersection - id IntersectionReferenceID, - - -- The unique requestID used by the requestor - requestID RequestID, - - -- The type of request or cancel for priority or preempt use - -- when a prior request is canceled, only the requestID is needed - requestType PriorityRequestType, - - -- In typical use either an approach or a lane number would - -- be given, this indicates the requested - -- path through the intersection to the degree it is known. - inBoundLane IntersectionAccessPoint, - -- desired entry approach or lane - outBoundLane IntersectionAccessPoint OPTIONAL, - -- desired exit approach or lane - -- the values zero is used to indicate - -- intent to stop within the intersection - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalRequest}} OPTIONAL, - ... - } - -SignalStatusList ::= SEQUENCE (SIZE(1..32)) OF SignalStatus - -SignalStatusPackageList ::= SEQUENCE (SIZE(1..32)) OF SignalStatusPackage - -SignalStatusPackage ::= SEQUENCE { - -- The party that made the initial SRM request - requester SignalRequesterInfo OPTIONAL, - -- The lanes or approaches used in the request - inboundOn IntersectionAccessPoint, -- estimated lane / approach of vehicle - outboundOn IntersectionAccessPoint OPTIONAL, - - -- The Estimated Time of Arrival (ETA) when the service is requested - -- This data echos the data of the request - minute MinuteOfTheYear OPTIONAL, - second DSecond OPTIONAL, - duration DSecond OPTIONAL, - - -- the SRM status for this request - status PrioritizationResponseStatus, - -- Status of request, this may include rejection - - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalStatusPackage}} OPTIONAL, - ... - } - -SignalStatus ::= SEQUENCE { - sequenceNumber MsgCount, - -- changed whenever the below contents have change - id IntersectionReferenceID, - -- this provides a unique mapping to the - -- intersection map in question - -- which provides complete location - -- and approach/movement/lane data - -- as well as zones for priority/preemption - sigStatus SignalStatusPackageList, - -- a list of detailed status containing all - -- priority or preemption state data, both - -- active and pending, and who requested it - -- requests which are denied are also listed - -- here for a short period of time - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalStatus}} OPTIONAL, - ... - } - -SpeedLimitList ::= SEQUENCE (SIZE(1..9)) OF RegulatorySpeedLimit - -SpeedLimitType ::= ENUMERATED { - unknown, -- Speed limit type not available - maxSpeedInSchoolZone, -- Only sent when the limit is active - maxSpeedInSchoolZoneWhenChildrenArePresent, -- Sent at any time - maxSpeedInConstructionZone, -- Used for work zones, incident zones, etc. - -- where a reduced speed is present - vehicleMinSpeed, - vehicleMaxSpeed, -- Regulatory speed limit for general traffic - vehicleNightMaxSpeed, - - truckMinSpeed, - truckMaxSpeed, - truckNightMaxSpeed, - - vehiclesWithTrailersMinSpeed, - vehiclesWithTrailersMaxSpeed, - vehiclesWithTrailersNightMaxSpeed, - ... - } - -TimeChangeDetails ::= SEQUENCE { - startTime TimeMark OPTIONAL, - -- When this phase 1st started - minEndTime TimeMark, - -- Expected shortest end time - maxEndTime TimeMark OPTIONAL, - -- Expected longest end time - - likelyTime TimeMark OPTIONAL, - -- Best predicted value based on other data - confidence TimeIntervalConfidence OPTIONAL, - -- Applies to above time element only - - nextTime TimeMark OPTIONAL - -- A rough estimate of time when - -- this phase may next occur again - -- used to support various ECO driving power - -- management needs. - } - -TimeMark ::= INTEGER (0..36001) - -- Tenths of a second in the current or next hour - -- In units of 1/10th second from UTC time - -- A range of 0~36000 covers one hour - -- The values 35991..36000 are used when a leap second occurs - -- The value 36001 is used to indicate time >3600 seconds - -- 36002 is to be used when value undefined or unknown - -- Note that this is NOT expressed in GPS time - -- or in local time - -TransmissionAndSpeed ::= SEQUENCE { - transmisson TransmissionState, - speed Velocity - } - -VehicleID ::= CHOICE { - entityID TemporaryID, - stationID StationID - } - - --- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ --- --- Start of entries from table Data_Elements... --- This table typicaly contains data element entries. --- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ --- - -AdvisorySpeedType ::= ENUMERATED { - none (0), - greenwave (1), - ecoDrive (2), - transit (3), - ... - } -- Note: subject to further growth - -AllowedManeuvers ::= BIT STRING { - -- With bits as defined: - -- Allowed maneuvers at path end (stop line) - -- All maneuvers with bits not set are therefore prohibited ! - -- A value of zero shall be used for unknown, indicating no Maneuver - maneuverStraightAllowed (0), - -- a Straight movement is allowed in this lane - maneuverLeftAllowed (1), - -- a Left Turn movement is allowed in this lane - maneuverRightAllowed (2), - -- a Right Turn movement is allowed in this lane - maneuverUTurnAllowed (3), - -- a U turn movement is allowed in this lane - maneuverLeftTurnOnRedAllowed (4), - -- a Stop, and then proceed when safe movement - -- is allowed in this lane - maneuverRightTurnOnRedAllowed (5), - -- a Stop, and then proceed when safe movement - -- is allowed in this lane - maneuverLaneChangeAllowed (6), - -- a movement which changes to an outer lane - -- on the egress side is allowed in this lane - -- (example: left into either outbound lane) - maneuverNoStoppingAllowed (7), - -- the vehicle should not stop at the stop line - -- (example: a flashing green arrow) - yieldAllwaysRequired (8), - -- the allowed movements above are not protected - -- (example: an permanent yellow condition) - goWithHalt (9), - -- after making a full stop, may proceed - caution (10), - -- proceed past stop line with caution - reserved1 (11) - -- used to align to 12 Bit Field - - } (SIZE(12)) - -Angle ::= INTEGER (0..28800) - -- LSB of 0.0125 degrees - -- A range of 0 to 359.9875 degrees - -ApproachID ::= INTEGER (0..15) -- zero to be used when valid value is unknown - -BasicVehicleRole ::= ENUMERATED { - -- Values used in the EU and in the US - basicVehicle (0), -- Light duty passenger vehicle type - publicTransport (1), -- Used in EU for Transit us - specialTransport (2), -- Used in EU (e.g. heavy load) - dangerousGoods (3), -- Used in EU for any HAZMAT - roadWork (4), -- Used in EU for State and Local DOT uses - roadRescue (5), -- Used in EU and in the US to include tow trucks. - emergency (6), -- Used in EU for Police, Fire and Ambulance units - safetyCar (7), -- Used in EU for Escort vehicles - -- Begin US unique numbering - none-unknown (8), -- added to follow current SAE style guidelines - truck (9), -- Heavy trucks with additional BSM rights and obligations - motorcycle (10), -- - roadSideSource (11), -- For infrastructure generated calls such as - -- fire house, rail infrastructure, roadwork site, etc. - police (12), -- - fire (13), -- - ambulance (14), -- (does not include private para-transit etc.) - dot (15), -- all roadwork vehicles - transit (16), -- all transit vehicles - slowMoving (17), -- to also include oversize etc. - stopNgo (18), -- to include trash trucks, school buses and others - -- that routinely disturb the free flow of traffic - cyclist (19), -- - pedestrian (20), -- also includes those with mobility limitations - nonMotorized (21), -- other, horse drawn, etc. - military (22), -- - ... - } - -DeltaAngle ::= INTEGER (-150..150) - -- With an angle range from - -- negative 150 to positive 150 - -- in one degree steps where zero is directly - -- along the axis or the lane center line as defined by the - -- two closest points - -DeltaTime ::= INTEGER (-122 .. 121) - -- Supporting a range of +/- 20 minute in steps of 10 seconds - -- the value of -121 shall be used when more than -20 minutes - -- the value of +120 shall be used when more than +20 minutes - -- the value -122 shall be used when the value is unavailable - -DescriptiveName ::= IA5String (SIZE(1..63)) - -DrivenLineOffsetLg ::= INTEGER (-32767..32767) - -- LSB units are 1 cm. - -DrivenLineOffsetSm ::= INTEGER (-2047..2047) - -- LSB units are 1 cm. - -DSecond ::= INTEGER (0..65535) -- units of milliseconds - -DSRCmsgID ::= INTEGER (0..32767) - mapData DSRCmsgID ::= 18 -- MAP, intersections - signalPhaseAndTimingMessage DSRCmsgID ::= 19 -- SPAT - signalRequestMessage DSRCmsgID ::= 29 -- SRM - signalStatusMessage DSRCmsgID ::= 30 -- SSM - -Elevation ::= INTEGER (-4096..61439) - -- In units of 10 cm steps above or below the reference ellipsoid - -- Providing a range of -409.5 to + 6143.9 meters - -- The value -4096 shall be used when Unknown is to be sent - -IntersectionID ::= INTEGER (0..65535) - -- The values zero through 255 are allocated for testing purposes - -- Note that the value assigned to an intersection will be - -- unique within a given regional ID only - -IntersectionStatusObject ::= BIT STRING { - manualControlIsEnabled (0), - -- Timing reported is per programmed values, etc. but person - -- at cabinet can manually request that certain intervals are - -- terminated early (e.g. green). - stopTimeIsActivated (1), - -- And all counting/timing has stopped. - failureFlash (2), - -- Above to be used for any detected hardware failures, - -- e.g. conflict monitor as well as for police flash - preemptIsActive (3), - signalPriorityIsActive (4), - - -- Additional states - fixedTimeOperation (5), - -- Schedule of signals is based on time only - -- (i.e. the state can be calculated) - trafficDependentOperation (6), - -- Operation is based on different levels of traffic parameters - -- (requests, duration of gaps or more complex parameters) - standbyOperation (7), - -- Controller: partially switched off or partially amber flashing - failureMode (8), - -- Controller has a problem or failure in operation - off (9), - -- Controller is switched off - - -- Related to MAP and SPAT bindings - recentMAPmessageUpdate (10), - -- Map revision with content changes - recentChangeInMAPassignedLanesIDsUsed (11), - -- Change in MAP's assigned lanes used (lane changes) - -- Changes in the active lane list description - noValidMAPisAvailableAtThisTime (12), - -- MAP (and various lanes indexes) not available - noValidSPATisAvailableAtThisTime (13) - -- SPAT system is not working at this time - - -- Bits 14,15 reserved at this time and shall be zero - } (SIZE(16)) - - -LaneAttributes-Barrier ::= BIT STRING { - -- With bits as defined: - median-RevocableLane (0), - -- this lane may be activated or not based - -- on the current SPAT message contents - -- if not asserted, the lane is ALWAYS present - median (1), - whiteLineHashing (2), - stripedLines (3), - doubleStripedLines (4), - trafficCones (5), - constructionBarrier (6), - trafficChannels (7), - lowCurbs (8), - highCurbs (9) - -- Bits 10~15 reserved and set to zero - } (SIZE (16)) - -LaneAttributes-Bike ::= BIT STRING { - -- With bits as defined: - bikeRevocableLane (0), - -- this lane may be activated or not based - -- on the current SPAT message contents - -- if not asserted, the lane is ALWAYS present - pedestrianUseAllowed (1), - -- The path allows pedestrian traffic, - -- if not set, this mode is prohibited - isBikeFlyOverLane (2), - -- path of lane is not at grade - fixedCycleTime (3), - -- the phases use preset times - -- i.e. there is not a 'push to cross' button - biDirectionalCycleTimes (4), - -- ped walk phases use different SignalGroupID - -- for each direction. The first SignalGroupID - -- in the first Connection represents 'inbound' - -- flow (the direction of travel towards the first - -- node point) while second SignalGroupID in the - -- next Connection entry represents the 'outbound' - -- flow. And use of RestrictionClassID entries - -- in the Connect follow this same pattern in pairs. - isolatedByBarrier (5), - unsignalizedSegmentsPresent (6) - -- The lane path consists of one of more segments - -- which are not part of a signal group ID - - -- Bits 7~15 reserved and set to zero - } (SIZE (16)) - -LaneAttributes-Crosswalk ::= BIT STRING { - -- With bits as defined: - -- MUTCD provides no suitable "types" to use here - crosswalkRevocableLane (0), - -- this lane may be activated or not based - -- on the current SPAT message contents - -- if not asserted, the lane is ALWAYS present - bicyleUseAllowed (1), - -- The path allows bicycle traffic, - -- if not set, this mode is prohibited - isXwalkFlyOverLane (2), - -- path of lane is not at grade - fixedCycleTime (3), - -- ped walk phases use preset times - -- i.e. there is not a 'push to cross' button - biDirectionalCycleTimes (4), - -- ped walk phases use different SignalGroupID - -- for each direction. The first SignalGroupID - -- in the first Connection represents 'inbound' - -- flow (the direction of travel towards the first - -- node point) while second SignalGroupID in the - -- next Connection entry represents the 'outbound' - -- flow. And use of RestrictionClassID entries - -- in the Connect follow this same pattern in pairs. - hasPushToWalkButton (5), - -- Has a demand input - audioSupport (6), - -- audio crossing cues present - rfSignalRequestPresent (7), - -- Supports RF push to walk technologies - unsignalizedSegmentsPresent (8) - -- The lane path consists of one of more segments - -- which are not part of a signal group ID - -- Bits 9~15 reserved and set to zero - } (SIZE (16)) - -LaneAttributes-Parking ::= BIT STRING { - -- With bits as defined: - -- Parking use details, note that detailed restrictions such as - -- allowed hours are sent by way of ITIS codes in the TIM message - parkingRevocableLane (0), - -- this lane may be activated or not based - -- on the current SPAT message contents - -- if not asserted, the lane is ALWAYS present - parallelParkingInUse (1), - headInParkingInUse (2), - doNotParkZone (3), - -- used to denote fire hydrants as well as - -- short disruptions in a parking zone - parkingForBusUse (4), - parkingForTaxiUse (5), - noPublicParkingUse (6) - -- private parking, as in front of - -- private property - -- Bits 7~15 reserved and set to zero - } (SIZE (16)) - -LaneAttributes-Sidewalk ::= BIT STRING { - -- With bits as defined: - sidewalk-RevocableLane (0), - -- this lane may be activated or not based - -- on the current SPAT message contents - -- if not asserted, the lane is ALWAYS present - bicyleUseAllowed (1), - -- The path allows bicycle traffic, - -- if not set, this mode is prohibited - isSidewalkFlyOverLane (2), - -- path of lane is not at grade - walkBikes (3) - -- bike traffic must dismount and walk - -- Bits 4~15 reserved and set to zero - } (SIZE (16)) - - -LaneAttributes-Striping ::= BIT STRING { - -- With bits as defined: - stripeToConnectingLanesRevocableLane (0), - -- this lane may be activated or not activated based - -- on the current SPAT message contents - -- if not asserted, the lane is ALWAYS present - stripeDrawOnLeft (1), - stripeDrawOnRight (2), - -- which side of lane to mark - stripeToConnectingLanesLeft (3), - stripeToConnectingLanesRight (4), - stripeToConnectingLanesAhead (5) - -- the stripe type should be - -- presented to the user visually - -- to reflect stripes in the - -- intersection for the type of - -- movement indicated - -- Bits 6~15 reserved and set to zero - } (SIZE (16)) - - -LaneAttributes-TrackedVehicle ::= BIT STRING { - -- With bits as defined: - spec-RevocableLane (0), - -- this lane may be activated or not based - -- on the current SPAT message contents - -- if not asserted, the lane is ALWAYS present - spec-commuterRailRoadTrack (1), - spec-lightRailRoadTrack (2), - spec-heavyRailRoadTrack (3), - spec-otherRailType (4) - -- Bits 5~15 reserved and set to zero - } (SIZE (16)) - - -LaneAttributes-Vehicle ::= BIT STRING { - -- With bits as defined: - isVehicleRevocableLane (0), - -- this lane may be activated or not based - -- on the current SPAT message contents - -- if not asserted, the lane is ALWAYS present - isVehicleFlyOverLane (1), - -- path of lane is not at grade - hovLaneUseOnly (2), - restrictedToBusUse (3), - restrictedToTaxiUse (4), - restrictedFromPublicUse (5), - hasIRbeaconCoverage (6), - permissionOnRequest (7) -- e.g. to inform about a lane for e-cars - - } (SIZE (8,...)) - -LaneConnectionID ::= INTEGER (0..255) - -LaneDirection ::= BIT STRING { - -- With bits as defined: - -- Allowed directions of travel in the lane object - -- All lanes are described from the stop line outwards - ingressPath (0), - -- travel from rear of path to front - -- is allowed - egressPath (1) - -- travel from front of path to rear - -- is allowed - -- Notes: No Travel, i.e. the lane object type does not support - -- travel (medians, curbs, etc.) is indicated by not - -- asserting any bit value - -- Bi-Directional Travel (such as a ped crosswalk) is - -- indicated by asserting both of the bits - } (SIZE (2)) - -LaneID ::= INTEGER (0..255) - -- the value 0 shall be used when the lane ID is - -- not available or not known - -- the value 255 is reserved for future use - -LayerID ::= INTEGER (0..100) - -LayerType ::= ENUMERATED { - none, - mixedContent, -- two or more of the below types - generalMapData, - intersectionData, - curveData, - roadwaySectionData, - parkingAreaData, - sharedLaneData, - ... - } - -LaneWidth ::= INTEGER (0..32767) -- units of 1 cm - -MergeDivergeNodeAngle ::= INTEGER (-180..180) - -- In units of 1.5 degrees from north - -- the value -180 shall be used to represent - -- data is not available or unknown - -MinuteOfTheYear ::= INTEGER (0..527040) - -- the value 527040 shall be used for invalid - -MovementPhaseState ::= ENUMERATED { - -- Note that based on the regions and the operating mode not every - -- phase will be used in all transportation modes and that not - -- every phase will be used in all transportation modes - - unavailable (0), - -- This state is used for unknown or error - dark (1), - -- The signal head is dark (unlit) - - -- Reds - stop-Then-Proceed (2), - -- Often called 'flashing red' in US - -- Driver Action: - -- Stop vehicle at stop line. - -- Do not proceed unless it is safe. - -- Note that the right to proceed either right or left when - -- it is safe may be contained in the lane description to - -- handle what is called a 'right on red' - stop-And-Remain (3), - -- e.g. called 'red light' in US - -- Driver Action: - -- Stop vehicle at stop line. - -- Do not proceed. - -- Note that the right to proceed either right or left when - -- it is safe may be contained in the lane description to - -- handle what is called a 'right on red' - - -- Greens - pre-Movement (4), - -- Not used in the US, red+yellow partly in EU - -- Driver Action: - -- Stop vehicle. - -- Prepare to proceed (pending green) - -- (Prepare for transition to green/go) - permissive-Movement-Allowed (5), - -- Often called 'permissive green' in US - -- Driver Action: - -- Proceed with caution, - -- must yield to all conflicting traffic - -- Conflicting traffic may be present - -- in the intersection conflict area - protected-Movement-Allowed (6), - -- Often called 'protected green' in US - -- Driver Action: - -- Proceed, tossing caution to the wind, - -- in indicated (allowed) direction. - - -- Yellows / Ambers - -- The vehicle is not allowed to cross the stop bar if it is possible - -- to stop without danger. - permissive-clearance (7), - -- Often called 'permissive yellow' in US - -- Driver Action: - -- Prepare to stop. - -- Proceed if unable to stop, - -- Clear Intersection. - -- Conflicting traffic may be present - -- in the intersection conflict area - protected-clearance (8), - -- Often called 'protected yellow' in US - -- Driver Action: - -- Prepare to stop. - -- Proceed if unable to stop, - -- in indicated direction (to connected lane) - -- Clear Intersection. - - caution-Conflicting-Traffic (9) - -- Often called 'flashing yellow' in US - -- Often used for extended periods of time - -- Driver Action: - -- Proceed with caution, - -- Conflicting traffic may be present - -- in the intersection conflict area - } - -- The above number assignments are not used with UPER encoding - -- and are only to be used with DER or implicit encoding - -MsgCount ::= INTEGER (0..127) - -Offset-B10 ::= INTEGER (-512..511) - -- a range of +- 5.11 meters - -Offset-B11 ::= INTEGER (-1024..1023) - -- a range of +- 10.23 meters - -Offset-B12 ::= INTEGER (-2048..2047) - -- a range of +- 20.47 meters - -Offset-B13 ::= INTEGER (-4096..4095) - -- a range of +- 40.95 meters - -Offset-B14 ::= INTEGER (-8192..8191) - -- a range of +- 81.91 meters - -Offset-B16 ::= INTEGER (-32768..32767) - -- a range of +- 327.68 meters - -PedestrianBicycleDetect ::= BOOLEAN - -- true if ANY Pedestrians or Bicyclists are - -- detected crossing the target lane or lanes - -PrioritizationResponseStatus ::= ENUMERATED { - unknown (0), - -- Unknown state - requested (1), - -- This prioritization request was detected - -- by the traffic controller - processing (2), - -- Checking request - -- (request is in queue, other requests are prior) - watchOtherTraffic (3), - -- Cannot give full permission, - -- therefore watch for other traffic - -- Note that other requests may be present - granted (4), - -- Intervention was successful - -- and now prioritization is active - rejected (5), - -- The prioritization or preemption request was - -- rejected by the traffic controller - maxPresence (6), - -- The Request has exceeded maxPresence time - -- Used when the controller has determined that - -- the requester should then back off and - -- request an alternative. - reserviceLocked (7), - -- Prior conditions have resulted in a reservice - -- locked event: the controller requires the - -- passage of time before another similar request - -- will be accepted - ... -} - -PriorityRequestType ::= ENUMERATED { - priorityRequestTypeReserved (0), - priorityRequest (1), - priorityRequestUpdate (2), - priorityCancellation (3), - ... - } - -RegionId ::= INTEGER (0..255) - noRegion RegionId ::= 0 -- Use default supplied stubs - addGrpA RegionId ::= 1 -- USA - addGrpB RegionId ::= 2 -- Japan - addGrpC RegionId ::= 3 -- EU - -- NOTE: new registered regional IDs will be added here - -- The values 128 and above are for local region use - -RequestID ::= INTEGER (0..255) - -RequestImportanceLevel ::= ENUMERATED { - requestImportanceLevelUnKnown (0), - requestImportanceLevel1 (1), -- The least important request - requestImportanceLevel2 (2), -- The values here shall be assigned - requestImportanceLevel3 (3), -- Meanings based on regional needs - requestImportanceLevel4 (4), -- for each of the basic roles which - requestImportanceLevel5 (5), -- are defined elsewhere - requestImportanceLevel6 (6), - requestImportanceLevel7 (7), - requestImportanceLevel8 (8), - requestImportanceLevel9 (9), - requestImportanceLevel10 (10), - requestImportanceLevel11 (11), - requestImportanceLevel12 (12), - requestImportanceLevel13 (13), - requestImportanceLevel14 (14), -- The most important request - requestImportanceReserved (15) -- Reserved for future use - } - -RequestSubRole ::= ENUMERATED { - requestSubRoleUnKnown (0), - requestSubRole1 (1), -- The first type of sub role - requestSubRole2 (2), -- The values here shall be assigned - requestSubRole3 (3), -- Meanings based on regional needs - requestSubRole4 (4), -- to refine and expand the basic - requestSubRole5 (5), -- roles which are defined elsewhere - requestSubRole6 (6), - requestSubRole7 (7), - requestSubRole8 (8), - requestSubRole9 (9), - requestSubRole10 (10), - requestSubRole11 (11), - requestSubRole12 (12), - requestSubRole13 (13), - requestSubRole14 (14), -- The last type of sub role - requestSubRoleReserved (15) -- Reserved for future use - } - -RestrictionAppliesTo ::= ENUMERATED { - none, -- applies to nothing - equippedTransit, -- buses etc. - equippedTaxis, - equippedOther, -- other vehicle types with - -- necessary signal phase state - -- reception equipment - emissionCompliant, -- regional variants with more - -- definitive items also exist - equippedBicycle, - weightCompliant, - heightCompliant, - -- Items dealing with traveler needs serviced by the infrastructure - -- These end users (which are not vehicles) are presumed to be suitably equipped - pedestrians, - slowMovingPersons, - wheelchairUsers, - visualDisabilities, - audioDisabilities, -- hearing - otherUnknownDisabilities, - ... - } - -RestrictionClassID ::= INTEGER (0..255) - -- An index value to identify data about classes of users - -- the value used varies with each intersection's - -- needs and is defined in the map to the assigned - -- classes of supported users. - -RoadRegulatorID ::= INTEGER (0..65535) - -- The value zero shall be used for testing only - -RoadSegmentID ::= INTEGER (0..65535) - -- The values zero to 255 shall be used for testing only - -- Note that the value assigned to an RoadSegment will be - -- unique within a given regional ID only during its use - -RoadwayCrownAngle ::= INTEGER (-128..127) - -- In LSB units of 0.3 degrees of angle - -- over a range of -38.1 to + 38.1 degrees - -- The value -128 shall be used for unknown - -- The value zero shall be used for angles - -- which are between -0.15 and +0.15 - -Scale-B12 ::= INTEGER (-2048..2047) -- in steps of 0.05 percent - -SignalGroupID ::= INTEGER (0..255) - -- The value 0 shall be used when the ID is - -- not available or not known - -- the value 255 is reserved to indicate a - -- permanent green movement state - -- therefore a simple 8 phase signal controller - -- device might use 1..9 as its groupIDs - -SegmentAttributeXY ::= ENUMERATED { - -- Various values which can be Enabled and Disabled for a lane segment - - -- General Items - reserved , - doNotBlock , -- segment where a vehicle - -- may not come to a stop - whiteLine , -- segment where lane crossing not allowed - -- such as the final few meters of a lane - - -- Porous Lane states, merging, turn outs, parking etc. - - mergingLaneLeft , -- indicates porous lanes - mergingLaneRight , - - curbOnLeft , -- indicates presence of curbs - curbOnRight , - - loadingzoneOnLeft , -- loading or drop off zones - loadingzoneOnRight , - - turnOutPointOnLeft , -- opening to adjacent street/alley/road - turnOutPointOnRight , - - adjacentParkingOnLeft , -- side of road parking - adjacentParkingOnRight , - - -- Bike Lane Needs - adjacentBikeLaneOnLeft , -- presence of marked bike lanes - adjacentBikeLaneOnRight , - sharedBikeLane , -- right of way is shared with bikes - -- who may occupy entire lane width - bikeBoxInFront , - - -- Transit Needs - transitStopOnLeft , -- any form of bus/transit loading - -- with pull in-out access to lane on left - transitStopOnRight , -- any form of bus/transit loading - -- with pull in-out access to lane on right - transitStopInLane , -- any form of bus/transit loading - -- in mid path of the lane - sharedWithTrackedVehicle , -- lane is shared with train or trolley - -- not used for crossing tracks - - - -- Pedestrian Support Attributes - safeIsland , -- begin/end a safety island in path - lowCurbsPresent , -- for ADA support - rumbleStripPresent , -- for ADA support - audibleSignalingPresent , -- for ADA support - adaptiveTimingPresent , -- for ADA support - rfSignalRequestPresent , -- Supports RF push to walk technologies - partialCurbIntrusion , -- path is blocked by a median or curb - -- but at least 1 meter remains open for use - -- and at-grade passage - - -- Lane geometry details (see standard for defined shapes) - taperToLeft , -- Used to control final path shape - taperToRight , -- Used to control final path shape - taperToCenterLine , -- Used to control final path shape - - -- Parking Lane and Curb Attributes - parallelParking , -- - headInParking , -- Parking at an angle with the street - freeParking , -- no restriction on use of parking - timeRestrictionsOnParking , -- Parking is not permitted at all times - -- typically used when the 'parking' lane - -- becomes a driving lane at times - costToPark , -- Used where parking has a cost - midBlockCurbPresent , -- a protruding curb near lane edge - unEvenPavementPresent , -- a disjoint height at lane edge - ... - } - -SpeedAdvice ::= INTEGER (0..500) - -- LSB units are 0.1 m/s^2 - -- the value 499 shall be used for values at or greater than 49.9 m/s - -- the value 500 shall be used to indicate that speed is unavailable - - -TemporaryID ::= OCTET STRING (SIZE(4)) - -TimeIntervalConfidence ::= INTEGER (0..15) - -- Value Probability - -- 0 21% - -- 1 36% - -- 2 47% - -- 3 56% - -- 4 62% - -- 5 68% - -- 6 73% - -- 7 77% - -- 8 81% - -- 9 85% - -- 10 88% - -- 11 91% - -- 12 94% - -- 13 96% - -- 14 98% - -- 15 100% - -TransitVehicleOccupancy ::= ENUMERATED { - occupancyUnknown (0), - occupancyEmpty (1), - occupancyVeryLow (2), - occupancyLow (3), - occupancyMed (4), - occupancyHigh (5), - occupancyNearlyFull (6), - occupancyFull (7) - } - -TransitVehicleStatus ::= BIT STRING { - loading (0), -- parking and unable to move at this time - anADAuse (1), -- an ADA access is in progress (wheelchairs, kneeling, etc.) - aBikeLoad (2), -- loading of a bicycle is in progress - doorOpen (3), -- a vehicle door is open for passenger access - charging (4), -- a vehicle is connected to charging point - atStopLine (5) -- a vehicle is at the stop line for the lane it is in - } (SIZE(8)) - -TransmissionState ::= ENUMERATED { - neutral (0), -- Neutral - park (1), -- Park - forwardGears (2), -- Forward gears - reverseGears (3), -- Reverse gears - reserved1 (4), - reserved2 (5), - reserved3 (6), - unavailable (7) -- not-equipped or unavailable value, - -- Any related speed is relative to the vehicle reference frame used - } - -VehicleType ::= ENUMERATED { - none (0), -- Not Equipped, Not known or unavailable - unknown (1), -- Does not fit any other category - special (2), -- Special use - moto (3), -- Motorcycle - car (4), -- Passenger car - carOther (5), -- Four tire single units - bus (6), -- Buses - axleCnt2 (7), -- Two axle, six tire single units - axleCnt3 (8), -- Three axle, single units - axleCnt4 (9), -- Four or more axle, single unit - axleCnt4Trailer (10), -- Four or less axle, single trailer - axleCnt5Trailer (11), -- Five or less axle, single trailer - axleCnt6Trailer (12), -- Six or more axle, single trailer - axleCnt5MultiTrailer (13), -- Five or less axle, multi-trailer - axleCnt6MultiTrailer (14), -- Six axle, multi-trailer - axleCnt7MultiTrailer (15), -- Seven or more axle, multi-trailer - ... - } - -Velocity ::= INTEGER (0..8191) -- Units of 0.02 m/s - -- The value 8191 indicates that - -- velocity is unavailable - -WaitOnStopline ::= BOOLEAN -- - -- True or False - -- If "true", the vehicles on this specific connecting - -- maneuver have to stop on the stop-line - -- and not to enter the collision area - -ZoneLength ::= INTEGER (0..10000) - -- Unit = 1 meter, 0 = unknown, - -- The value 10000 to be used for Distances >=10000 m - -- (e.g. from known point to another point along a - -- known path, often against traffic flow direction - -- when used for measuring queues) - -END - -- GitLab From db0e9190478dbed7898cc42442178dee17cf136b Mon Sep 17 00:00:00 2001 From: filatov Date: Mon, 6 Mar 2017 13:41:05 +0000 Subject: [PATCH 012/320] TTITANIZATION: GeoNetworking --- .../LibItsGeoNetworking_Functions.ttcn | 25 ++++++++++++++++++- .../LibItsGeoNetworking_Templates.ttcn | 14 +++++------ .../LibItsGeoNetworking_TestSystem.ttcn | 25 +++++++++++++------ 3 files changed, 48 insertions(+), 16 deletions(-) diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn index 5cbaee1d..fbc2d270 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn @@ -1,5 +1,5 @@ /** - * @author ETSI / STF405 / STF449 / STF484 / STF517 + * @author ETSI / STF405 / STF449 / STF484 / STF517 / STF525 * @version $URL$ * $Id$ * @desc Module containing functions for GeoNetworking @@ -155,6 +155,7 @@ module LibItsGeoNetworking_Functions { * - Area2 which only includes NodeB * NodeB being close to the area center */ +//FIXME RGY Titan doesn't support mtc and system clauses yet function f_cf01Up(Scenario p_scenario := e_staticPosition) runs on ItsGeoNetworking /* TITAN TODO: system ItsGeoNetworkingSystem */ { // Variables @@ -183,6 +184,7 @@ module LibItsGeoNetworking_Functions { } // end f_cf01Up +//FIXME RGY Titan doesn't support mtc and system clauses yet function f_cf01Down() runs on ItsGeoNetworking /* TITAN TODO: system ItsGeoNetworkingSystem */ { f_uninitialiseSecuredMode(); @@ -208,6 +210,8 @@ module LibItsGeoNetworking_Functions { * * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages */ + +//FIXME RGY Titan doesn't support mtc and system clauses yet function f_cf02Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { // Variables @@ -271,6 +275,8 @@ module LibItsGeoNetworking_Functions { /** * @desc Deletes configuration cf02 */ + +//FIXME RGY Titan doesn't support mtc and system clauses yet function f_cf02Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { // Local variables @@ -302,6 +308,7 @@ module LibItsGeoNetworking_Functions { * NodeB being close to the area center * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages */ +//FIXME RGY Titan doesn't support mtc and system clauses yet function f_cf03Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { // Variables @@ -365,6 +372,8 @@ module LibItsGeoNetworking_Functions { /** * @desc Deletes configuration cf03 */ + + //FIXME RGY Titan doesn't support mtc and system clauses yet function f_cf03Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { // Local variables @@ -398,6 +407,8 @@ module LibItsGeoNetworking_Functions { * NodeB being close to the area center * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages */ + +//FIXME RGY Titan doesn't support mtc and system clauses yet function f_cf04Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { // Variables @@ -461,6 +472,8 @@ module LibItsGeoNetworking_Functions { /** * @desc Deletes configuration cf04 */ + +//FIXME RGY Titan doesn't support mtc and system clauses yet function f_cf04Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */{ // Local variables @@ -490,6 +503,8 @@ module LibItsGeoNetworking_Functions { * - Area1 which only includes NodeB, NodeD and IUT * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages */ + +//FIXME RGY Titan doesn't support mtc and system clauses yet function f_cf05Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { // Variables @@ -552,6 +567,8 @@ module LibItsGeoNetworking_Functions { /** * @desc Deletes configuration cf05 */ + +//FIXME RGY Titan doesn't support mtc and system clauses yet function f_cf05Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { // Local variables @@ -582,6 +599,7 @@ module LibItsGeoNetworking_Functions { * - IUT not in sectorial area of NodeB-NodeF * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages */ +//FIXME RGY Titan doesn't support mtc and system clauses yet function f_cf06Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { // Variables @@ -644,6 +662,8 @@ module LibItsGeoNetworking_Functions { /** * @desc Deletes configuration cf06 */ + +//FIXME RGY Titan doesn't support mtc and system clauses yet function f_cf06Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { // Local variables @@ -673,6 +693,8 @@ module LibItsGeoNetworking_Functions { * - Area1 which only includes NodeB, NodeD and IUT * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages */ + +//FIXME RGY Titan doesn't support mtc and system clauses yet function f_cf07Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO mtc ItsMtc system ItsGeoNetworkingSystem */{ // Variables @@ -735,6 +757,7 @@ module LibItsGeoNetworking_Functions { /** * @desc Deletes configuration cf06 */ +//FIXME RGY Titan doesn't support mtc and system clauses yet function f_cf07Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { // Local variables diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn index 0f890cfd..bb5a4d77 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn @@ -44,9 +44,9 @@ module LibItsGeoNetworking_Templates { * @param p_geoNwMsg GeoNetworking packet to be sent * @param p_its_aid ITS-AID used in secured mode. Default: 0, means unused */ - template (value) GeoNetworkingReq m_geoNwReq_linkLayerBroadcast( - in template (value) GeoNetworkingPdu p_geoNwMsg, - in template (value) UInt32 p_its_aid := 0 + template (omit) GeoNetworkingReq m_geoNwReq_linkLayerBroadcast( + in template (value) GeoNetworkingPdu p_geoNwMsg, + in template (value) UInt32 p_its_aid := 0 ) := { msgOut := p_geoNwMsg, macDestinationAddress := c_llBroadcast, @@ -59,10 +59,10 @@ module LibItsGeoNetworking_Templates { * @param p_its_aid ITS-AID used in secured mode. Default: 0, means unused * @param p_llDestinationAdress Link-layer destination address */ - template (value) GeoNetworkingReq m_geoNwReq_withLinkLayerDestination( - in template (value) GeoNetworkingPdu p_geoNwMsg, - in template (value) UInt32 p_its_aid := 0, - in template (value) MacAddress p_llDestinationAdress + template (omit) GeoNetworkingReq m_geoNwReq_withLinkLayerDestination( + in template (value) GeoNetworkingPdu p_geoNwMsg, + in template (value) UInt32 p_its_aid := 0, + in template (value) MacAddress p_llDestinationAdress ) modifies m_geoNwReq_linkLayerBroadcast := { macDestinationAddress := p_llDestinationAdress } diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn index 725702f7..3baf0d46 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn @@ -39,7 +39,10 @@ module LibItsGeoNetworking_TestSystem { out AcGnPrimitive, AcGn6Primitive, AcGnssPrimitive, AcSecPrimitive; in - AcGnResponse, AcGn6Response, AcGnssResponse, AcGnssDistanceCovered, AcSecResponse; + +//FIXME RGY As discussed, boolean results are replaced by a top-level union of results +// AcGnResponse, AcGn6Response, AcGnssResponse, AcGnssDistanceCovered, AcSecResponse; + AcGnResponse, AcGn6Response, AdapterControlResults; } // end AdapterControlPort /** @@ -49,7 +52,9 @@ module LibItsGeoNetworking_TestSystem { out UtInitialize, UtChangePosition, UtGnTrigger; in - UtInitializeResult, UtChangePositionResult, UtGnTriggerResult, UtGnEventInd; +//FIXME RGY As discussed, boolean results are replaced by a top-level union of results +// UtInitializeResult, UtChangePositionResult, UtGnTriggerResult, UtGnEventInd; + UtCommonResults, UtGnTriggerResult, UtGnEventInd; } // end UpperTesterPort } // end portDefinitions @@ -79,20 +84,24 @@ module LibItsGeoNetworking_TestSystem { /** * @desc ITS Main Test Component */ - type component ItsMtc extends ItsBaseMtc, ServerSyncComp, ItsSecurityBaseComponent { - +//FIXME RGY ItsMtc can extend ItsBaseGeoNetworking instead of ItsSecurityBaseComponent, as it contains +// everything defined here but vc_componentTable and already extends ItsSecurityBaseComponent +// also, ItsBaseMtc already extends ServerSyncComp +// type component ItsMtc extends ItsBaseMtc, ServerSyncComp, ItsSecurityBaseComponent { // TODO Extend ItsBaseMtc with ItsSecurityBaseComponent? { + type component ItsMtc extends ItsBaseMtc, ItsBaseGeoNetworking { +/*FIXME RGY all these objects are inherited from ItsBaseGeoNetworking, they shall not be defined again: see $6.2.10.2 port UpperTesterPort utPort; port AdapterControlPort acPort; - +*/ var ComponentTable vc_componentTable := {}; - +/* // UT indications var UtGnEventIndList vc_utInds := {}; var boolean vc_utDefaultActive := true; var boolean vc_acDefaultActive := true; var boolean vc_gnDefaultActive := true; - +*/ } // end ItsMtc /** @@ -110,7 +119,7 @@ module LibItsGeoNetworking_TestSystem { } // End of group componentDefinitions - type component ItsBaseGeoNetworking extends ItsBaseComponent, ItsSecurityBaseComponent { + type component ItsBaseGeoNetworking extends ItsBaseComponent, ItsSecurityBaseComponent { port UpperTesterPort utPort; port AdapterControlPort acPort; -- GitLab From be41dfbaaf4c6e4fea6532d0d7972446b52563ea Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 7 Mar 2017 14:43:27 +0000 Subject: [PATCH 013/320] Rename ttcn3 extension into ttcn --- ...bItsSecurity_Functions.ttcn3 => LibItsSecurity_Functions.ttcn} | 0 .../{LibItsSecurity_Pics.ttcn3 => LibItsSecurity_Pics.ttcn} | 0 .../{LibItsSecurity_Pixits.ttcn3 => LibItsSecurity_Pixits.ttcn} | 0 ...bItsSecurity_Templates.ttcn3 => LibItsSecurity_Templates.ttcn} | 0 ...tsSecurity_TestSystem.ttcn3 => LibItsSecurity_TestSystem.ttcn} | 0 ...ty_TypesAndValues.ttcn3 => LibItsSecurity_TypesAndValues.ttcn} | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename ttcn/Security/{LibItsSecurity_Functions.ttcn3 => LibItsSecurity_Functions.ttcn} (100%) rename ttcn/Security/{LibItsSecurity_Pics.ttcn3 => LibItsSecurity_Pics.ttcn} (100%) rename ttcn/Security/{LibItsSecurity_Pixits.ttcn3 => LibItsSecurity_Pixits.ttcn} (100%) rename ttcn/Security/{LibItsSecurity_Templates.ttcn3 => LibItsSecurity_Templates.ttcn} (100%) rename ttcn/Security/{LibItsSecurity_TestSystem.ttcn3 => LibItsSecurity_TestSystem.ttcn} (100%) rename ttcn/Security/{LibItsSecurity_TypesAndValues.ttcn3 => LibItsSecurity_TypesAndValues.ttcn} (100%) diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn3 b/ttcn/Security/LibItsSecurity_Functions.ttcn similarity index 100% rename from ttcn/Security/LibItsSecurity_Functions.ttcn3 rename to ttcn/Security/LibItsSecurity_Functions.ttcn diff --git a/ttcn/Security/LibItsSecurity_Pics.ttcn3 b/ttcn/Security/LibItsSecurity_Pics.ttcn similarity index 100% rename from ttcn/Security/LibItsSecurity_Pics.ttcn3 rename to ttcn/Security/LibItsSecurity_Pics.ttcn diff --git a/ttcn/Security/LibItsSecurity_Pixits.ttcn3 b/ttcn/Security/LibItsSecurity_Pixits.ttcn similarity index 100% rename from ttcn/Security/LibItsSecurity_Pixits.ttcn3 rename to ttcn/Security/LibItsSecurity_Pixits.ttcn diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn3 b/ttcn/Security/LibItsSecurity_Templates.ttcn similarity index 100% rename from ttcn/Security/LibItsSecurity_Templates.ttcn3 rename to ttcn/Security/LibItsSecurity_Templates.ttcn diff --git a/ttcn/Security/LibItsSecurity_TestSystem.ttcn3 b/ttcn/Security/LibItsSecurity_TestSystem.ttcn similarity index 100% rename from ttcn/Security/LibItsSecurity_TestSystem.ttcn3 rename to ttcn/Security/LibItsSecurity_TestSystem.ttcn diff --git a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn3 b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn similarity index 100% rename from ttcn/Security/LibItsSecurity_TypesAndValues.ttcn3 rename to ttcn/Security/LibItsSecurity_TypesAndValues.ttcn -- GitLab From 3b6ac5308d84ab6277250ae4b2af889f3e2f19e8 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 30 Mar 2017 13:42:40 +0000 Subject: [PATCH 014/320] STF525: Starting development of ItsAutoInterop ATS --- ttcn/Common/LibItsCommon_TestSystem.ttcn | 2 +- ttcn/IVIM/LibItsIvim_Templates.ttcn | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ttcn/Common/LibItsCommon_TestSystem.ttcn b/ttcn/Common/LibItsCommon_TestSystem.ttcn index 8c5011e8..d7c0e608 100644 --- a/ttcn/Common/LibItsCommon_TestSystem.ttcn +++ b/ttcn/Common/LibItsCommon_TestSystem.ttcn @@ -27,7 +27,7 @@ module LibItsCommon_TestSystem { // timers timer tc_guard := PX_TDONE; - } // end ItsMtc + } // end ItsBaseMtc /** * @desc Upper tester and Adapter control component diff --git a/ttcn/IVIM/LibItsIvim_Templates.ttcn b/ttcn/IVIM/LibItsIvim_Templates.ttcn index 51a59820..42bb2b9d 100644 --- a/ttcn/IVIM/LibItsIvim_Templates.ttcn +++ b/ttcn/IVIM/LibItsIvim_Templates.ttcn @@ -167,13 +167,13 @@ module LibItsIvim_Templates { * @param p_connectedIviStructures List of ConnectedIviStructure (Default: omit) * @param p_optional_ Optional field (Default: omit) */ - template (value) UtIvimUpdate m_utUpdateEvent( - template (value) IviIdentificationNumber p_iviIdentificationNumber, - template (omit) TimestampIts p_timeStamp := c_duration_2sec, - template (omit) TimestampIts p_validFrom := omit, - template (omit) TimestampIts p_validTo := omit, - template (omit) IVIManagementContainer.connectedIviStructures p_connectedIviStructures := omit, - template (omit) IviStructure.optional_ p_optional_ := omit + template (value) UtIvimUpdate m_utIvimUpdateEvent( + template (value) IviIdentificationNumber p_iviIdentificationNumber, + template (omit) TimestampIts p_timeStamp := c_duration_2sec, + template (omit) TimestampIts p_validFrom := omit, + template (omit) TimestampIts p_validTo := omit, + template (omit) IVIManagementContainer.connectedIviStructures p_connectedIviStructures := omit, + template (omit) IviStructure.optional_ p_optional_ := omit ) := { iviIdentificationNumber := p_iviIdentificationNumber, timeStamp := p_timeStamp, @@ -181,7 +181,7 @@ module LibItsIvim_Templates { validTo := p_validTo, connectedIviStructures := p_connectedIviStructures, optional_ := p_optional_ - } // End of template m_utUpdateEvent + } // End of template m_utIvimUpdateEvent /** * @desc Send template for Upper Tester event cancellation -- GitLab From 10fbceff734b7335b625eaf1223aafc012a1c309 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 7 Jun 2017 09:25:39 +0000 Subject: [PATCH 015/320] Add TTCN-3 tests for CAM codec --- ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn | 8 ++++---- ttcn/CAM/LibItsCam_TestSystem.ttcn | 15 +++++++++++++-- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn b/ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn index 09265942..b6d6323d 100644 --- a/ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn +++ b/ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn @@ -11,11 +11,11 @@ module LibItsCam_EncdecDeclarations { external function fx_enc_CamReq (CamReq p) return bitstring with {extension "prototype(convert) encode(LibIts_Interface)"} - external function fx_enc_CAM (CAM p) return octetstring - with {extension "prototype(convert) encode(BER:BER_ENCODE_CER)"} + external function fx_enc_CAM (CAM p) return bitstring + with {extension "prototype(convert) encode(PER)"}//LibItsCam_asn1 - /* TODO RGy function not implemented! (decvalue() not used by test suite @29-06-2016) + /* TODO RGy function not implemented! (decvalue() not used by test suite @29-06-2016) */ external function fx_dec_CamReq (inout bitstring b, out CamReq p) return integer with {extension "prototype(sliding) decode(LibIts_Interface)"} - */ + } // End of module LibItsCam_EncdecDeclarations diff --git a/ttcn/CAM/LibItsCam_TestSystem.ttcn b/ttcn/CAM/LibItsCam_TestSystem.ttcn index bbc4cab3..6752c4b5 100644 --- a/ttcn/CAM/LibItsCam_TestSystem.ttcn +++ b/ttcn/CAM/LibItsCam_TestSystem.ttcn @@ -141,7 +141,17 @@ module LibItsCam_TestSystem { UInt32 its_aid optional } with { - encode (msgIn) "LibItsCam_asn1" + variant "" + encode (msgIn) "PER"//LibItsCam_asn1 + encode (gnNextHeader) "RAW" + encode (gnHeaderType) "RAW" + encode (gnHeaderSubtype) "RAW" + encode (gnLifetime) "RAW" + encode (gnTrafficClass) "RAW" + encode (btpDestinationPort) "RAW" + encode (btpInfo) "RAW" + encode (ssp) "RAW" + encode (its_aid) "RAW" } /** @@ -151,7 +161,8 @@ module LibItsCam_TestSystem { CAM msgOut } with { - encode (msgOut) "LibItsCam_asn1" + variant "" + encode (msgOut) "PER"//LibItsCam_asn1 } } // end fa1Primitives -- GitLab From 927b844e801d9ebdc4dd0353de65d13339820949 Mon Sep 17 00:00:00 2001 From: filatov Date: Wed, 7 Jun 2017 16:23:42 +0000 Subject: [PATCH 016/320] PERization of CAM/DENM --- ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn | 20 +++++++++++++------- ttcn/CAM/LibItsCam_Functions.ttcn | 8 ++++---- ttcn/CAM/LibItsCam_Templates.ttcn | 2 +- ttcn/CAM/LibItsCam_TestSystem.ttcn | 12 +++++++----- ttcn/CAM/LibItsCam_TypesAndValues.ttcn | 4 ++-- ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn | 15 ++++++++++----- ttcn/DENM/LibItsDenm_TestSystem.ttcn | 8 ++++---- 7 files changed, 41 insertions(+), 28 deletions(-) diff --git a/ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn b/ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn index b6d6323d..c2986967 100644 --- a/ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn +++ b/ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn @@ -1,9 +1,7 @@ module LibItsCam_EncdecDeclarations { // LibIts - import from ITS_Container language "ASN.1:1997" all; import from CAM_PDU_Descriptions language "ASN.1:1997" all; - import from DENM_PDU_Descriptions language "ASN.1:1997" all; // LibItsCam import from LibItsCam_TestSystem all; @@ -11,11 +9,19 @@ module LibItsCam_EncdecDeclarations { external function fx_enc_CamReq (CamReq p) return bitstring with {extension "prototype(convert) encode(LibIts_Interface)"} - external function fx_enc_CAM (CAM p) return bitstring - with {extension "prototype(convert) encode(PER)"}//LibItsCam_asn1 - - /* TODO RGy function not implemented! (decvalue() not used by test suite @29-06-2016) */ external function fx_dec_CamReq (inout bitstring b, out CamReq p) return integer with {extension "prototype(sliding) decode(LibIts_Interface)"} - + + external function fx_dec_CamInd (inout bitstring b, out CamInd p) return integer + with {extension "prototype(sliding) decode(LibIts_Interface)"} + + external function fx_enc_CAM (CAM p) return bitstring + with {extension "prototype(convert) encode(PER)"} + + external function fx_dec_CAM (inout bitstring b, out CAM p) return integer + with {extension "prototype(sliding) decode(PER)"} +/* + external function fx_enc_CAM (CAM p) return octetstring + with {extension "prototype(convert) encode(BER:BER_ENCODE_CER)"} +*/ } // End of module LibItsCam_EncdecDeclarations diff --git a/ttcn/CAM/LibItsCam_Functions.ttcn b/ttcn/CAM/LibItsCam_Functions.ttcn index b1c443da..aadbf34f 100644 --- a/ttcn/CAM/LibItsCam_Functions.ttcn +++ b/ttcn/CAM/LibItsCam_Functions.ttcn @@ -18,8 +18,8 @@ module LibItsCam_Functions { // LibIts import from ITS_Container language "ASN.1:1997" all; - import from CAM_PDU_Descriptions language "ASN.1:1997" all; - import from DENM_PDU_Descriptions language "ASN.1:1997" all; +// import from CAM_PDU_Descriptions language "ASN.1:1997" all; +// import from DENM_PDU_Descriptions language "ASN.1:1997" all; // LibItsCommon import from LibItsCommon_Pixits all; @@ -32,8 +32,8 @@ module LibItsCam_Functions { import from LibItsCam_Templates all; import from LibItsCam_TypesAndValues all; import from LibItsCam_Pics all; - import from LibItsCam_Pixits all; - import from LibItsCam_EncdecDeclarations all; +// import from LibItsCam_Pixits all; +// import from LibItsCam_EncdecDeclarations all; group utFuntions { diff --git a/ttcn/CAM/LibItsCam_Templates.ttcn b/ttcn/CAM/LibItsCam_Templates.ttcn index 018d52ed..7f8793b3 100644 --- a/ttcn/CAM/LibItsCam_Templates.ttcn +++ b/ttcn/CAM/LibItsCam_Templates.ttcn @@ -18,7 +18,7 @@ module LibItsCam_Templates { // LibIts import from ITS_Container language "ASN.1:1997" all; import from CAM_PDU_Descriptions language "ASN.1:1997" all; - import from DENM_PDU_Descriptions language "ASN.1:1997" all; +// import from DENM_PDU_Descriptions language "ASN.1:1997" all; // LibItsCommon import from LibItsCommon_Functions all; diff --git a/ttcn/CAM/LibItsCam_TestSystem.ttcn b/ttcn/CAM/LibItsCam_TestSystem.ttcn index 6752c4b5..4d0bd3df 100644 --- a/ttcn/CAM/LibItsCam_TestSystem.ttcn +++ b/ttcn/CAM/LibItsCam_TestSystem.ttcn @@ -12,14 +12,14 @@ module LibItsCam_TestSystem { // LibCommon - import from LibCommon_Time {modulepar all}; - import from LibCommon_Sync all; +// import from LibCommon_Time {modulepar all}; +// import from LibCommon_Sync all; import from LibCommon_BasicTypesAndValues all; import from LibCommon_DataStrings all; // LibIts import from CAM_PDU_Descriptions language "ASN.1:1997" all; - import from DENM_PDU_Descriptions language "ASN.1:1997" all; +// import from DENM_PDU_Descriptions language "ASN.1:1997" all; // LibItsCommon import from LibItsCommon_TestSystem all; @@ -141,8 +141,9 @@ module LibItsCam_TestSystem { UInt32 its_aid optional } with { - variant "" +// variant "" encode (msgIn) "PER"//LibItsCam_asn1 +/* encode (gnNextHeader) "RAW" encode (gnHeaderType) "RAW" encode (gnHeaderSubtype) "RAW" @@ -152,6 +153,7 @@ module LibItsCam_TestSystem { encode (btpInfo) "RAW" encode (ssp) "RAW" encode (its_aid) "RAW" +*/ } /** @@ -161,7 +163,7 @@ module LibItsCam_TestSystem { CAM msgOut } with { - variant "" +// variant "" encode (msgOut) "PER"//LibItsCam_asn1 } diff --git a/ttcn/CAM/LibItsCam_TypesAndValues.ttcn b/ttcn/CAM/LibItsCam_TypesAndValues.ttcn index f215e973..35fe1f0b 100644 --- a/ttcn/CAM/LibItsCam_TypesAndValues.ttcn +++ b/ttcn/CAM/LibItsCam_TypesAndValues.ttcn @@ -13,12 +13,12 @@ module LibItsCam_TypesAndValues { // LibCommon import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings 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; - import from DENM_PDU_Descriptions language "ASN.1:1997" all; +// import from DENM_PDU_Descriptions language "ASN.1:1997" all; group camValues { diff --git a/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn b/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn index c1910b55..b6c42160 100644 --- a/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn +++ b/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn @@ -6,11 +6,16 @@ module LibItsDenm_EncdecDeclarations { external function fx_enc_DenmReq (DenmReq p) return bitstring with {extension "prototype(convert) encode(LibIts_Interface)"} - external function fx_enc_DENM (DENM p) return octetstring + external function fx_dec_DenmInd (inout bitstring b, out DenmInd p) return integer + with {extension "prototype(sliding) decode(LibIts_Interface)"} + + external function fx_enc_DENM (DENM p) return bitstring with {extension "prototype(convert) encode(BER:BER_ENCODE_CER)"} +// with {extension "prototype(convert) encode(PER)"} - /* not needed yet, no decvalue is used in TTCN-3 code - external function fx_dec_DenmReq (inout bitstring b, out DenmReq p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - */ + external function fx_dec_DENM (inout bitstring b, out DENM p) return integer + with {extension "prototype(sliding) decode(BER:BER_ENCODE_CER)"} +// with {extension "prototype(sliding) encode(PER)"} + + } // End of module LibItsDenm_EncdecDeclarations diff --git a/ttcn/DENM/LibItsDenm_TestSystem.ttcn b/ttcn/DENM/LibItsDenm_TestSystem.ttcn index 4c26f5f0..e6be9244 100644 --- a/ttcn/DENM/LibItsDenm_TestSystem.ttcn +++ b/ttcn/DENM/LibItsDenm_TestSystem.ttcn @@ -12,8 +12,8 @@ module LibItsDenm_TestSystem { // LibCommon - import from LibCommon_Time {modulepar all}; - import from LibCommon_Sync all; +// import from LibCommon_Time {modulepar all}; +// import from LibCommon_Sync all; import from LibCommon_BasicTypesAndValues all; import from LibCommon_DataStrings all; @@ -147,7 +147,7 @@ module LibItsDenm_TestSystem { UInt32 its_aid optional } with { - encode (msgIn) "LibItsDenm_asn1" + encode (msgIn) "PER" } /** @@ -159,7 +159,7 @@ module LibItsDenm_TestSystem { DENM msgOut } with { - encode (msgOut) "LibItsDenm_asn1" + encode (msgOut) "PER" } } // End of group fa1Primitives -- GitLab From 2286026ae1a1a38b3d4241dcf0ed9b73af490c08 Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 13 Jun 2017 13:18:27 +0000 Subject: [PATCH 017/320] GeoNetworking codecs & Layers ongoing Add PCAP layer --- ...ibItsGeoNetworking_EncdecDeclarations.ttcn | 13 +++ .../LibItsGeoNetworking_Functions.ttcn | 2 +- .../LibItsGeoNetworking_TestSystem.ttcn | 8 +- .../LibItsGeoNetworking_TypesAndValues.ttcn | 90 ++++++++++++++++--- 4 files changed, 98 insertions(+), 15 deletions(-) diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_EncdecDeclarations.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_EncdecDeclarations.ttcn index ecfefbdf..0af2d105 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_EncdecDeclarations.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_EncdecDeclarations.ttcn @@ -1,7 +1,20 @@ module LibItsGeoNetworking_EncdecDeclarations { import from LibItsGeoNetworking_TypesAndValues all; + import from LibItsGeoNetworking_TestSystem all; + external function fx_enc_GeoNetworkingReq (GeoNetworkingReq p) return bitstring + with {extension "prototype(convert) encode(LibIts_Interface)"} + + external function fx_dec_GeoNetworkingReq (inout bitstring b, out GeoNetworkingReq p) return integer + with {extension "prototype(sliding) decode(LibIts_Interface)"} + + external function fx_enc_GeoNetworkingInd (GeoNetworkingInd p) return bitstring + with {extension "prototype(convert) encode(LibIts_Interface)"} + + external function fx_dec_GeoNetworkingInd (inout bitstring b, out GeoNetworkingInd p) return integer + with {extension "prototype(sliding) decode(LibIts_Interface)"} + external function fx_enc_GeoNetworkingPdu (GeoNetworkingPdu p) return bitstring with {extension "prototype(convert) encode(LibItsGeoNetworking)"} diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn index fbc2d270..32b1a2f0 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn @@ -836,7 +836,7 @@ module LibItsGeoNetworking_Functions { if ((PICS_GN_SECURITY == true) or (PICS_IS_IUT_SECURED == true)) { f_acDisableSecurity(); } - } // End of function f_initialiseSecuredMode() + } // End of function f_uninitialiseSecuredMode() } // end geoConfigurationFunctions diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn index 3baf0d46..3bab45f4 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn @@ -50,7 +50,7 @@ module LibItsGeoNetworking_TestSystem { */ type port UpperTesterPort message { out - UtInitialize, UtChangePosition, UtGnTrigger; + UtInitialize, UtChangePosition, UtAutoInteropTrigger, UtGnTrigger; in //FIXME RGY As discussed, boolean results are replaced by a top-level union of results // UtInitializeResult, UtChangePositionResult, UtGnTriggerResult, UtGnEventInd; @@ -163,6 +163,9 @@ module LibItsGeoNetworking_TestSystem { MacAddress macDestinationAddress, Bit256 ssp optional, UInt32 its_aid optional + } with { +// encode "RAW"; + variant "" } /** @@ -172,6 +175,9 @@ module LibItsGeoNetworking_TestSystem { GeoNetworkingPdu msgOut, MacAddress macDestinationAddress, UInt32 its_aid + } with { +// encode "RAW"; + variant "" } } // end nt2Primitives diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn index 4dfef02d..b16b7ef6 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn @@ -231,6 +231,8 @@ module LibItsGeoNetworking_TypesAndValues { UInt8 reserved, Lifetime lifeTime, UInt8 routerHopLimit + } with { + variant "FIELDORDER(msb)" } type enumerated BasicNextHeader { @@ -239,7 +241,7 @@ module LibItsGeoNetworking_TypesAndValues { e_securedPacket(2), e_reserved } with { - variant "4 bit" + variant "FIELDLENGTH(4)" //variant "4 bit" } /** @@ -250,6 +252,8 @@ module LibItsGeoNetworking_TypesAndValues { type record Lifetime { UInt6 multiplier, LtBase ltBase + } with { + variant "FIELDORDER(msb)" } /** @@ -261,7 +265,7 @@ module LibItsGeoNetworking_TypesAndValues { e_10s(2), e_100s(3) } with { - variant "2 bit" + variant "FIELDLENGTH(2)" //variant "2 bit" } } // end group geoNetworkingBasicHeader @@ -301,6 +305,8 @@ module LibItsGeoNetworking_TypesAndValues { UInt16 plLength, // The Codec shall set the length of the paylaod if present UInt8 maxHopLimit, UInt8 reserved2 + } with { + variant "FIELDORDER(msb)" } /** @@ -313,7 +319,7 @@ module LibItsGeoNetworking_TypesAndValues { e_ipv6(3), e_reserved } with { - variant "4 bit" + variant "FIELDLENGTH(4)" //variant "4 bit" } /** @@ -337,18 +343,21 @@ module LibItsGeoNetworking_TypesAndValues { SCF scf, ChannelOffload channelOffload, TcId tcId + } with { + variant "FIELDORDER(msb)" } + type enumerated SCF { e_scfDisabled(0), e_scfEnable (1) } with { - variant "1 bit" + variant "FIELDLENGTH(1)" //variant "1 bit" } type enumerated ChannelOffload { e_choffDisabled(0), e_choffEnable (1) } with { - variant "1 bit" + variant "FIELDLENGTH(1)" //variant "1 bit" } type UInt6 TcId; @@ -374,6 +383,8 @@ module LibItsGeoNetworking_TypesAndValues { LSRequestHeader lsRequestHeader, LSReplyHeader lsReplyHeader, AnyHeader anyHeader + } with { + variant "" } /** @@ -385,6 +396,8 @@ module LibItsGeoNetworking_TypesAndValues { type record AnyHeader { UInt16 seqNumber, UInt16 reserved + } with { + variant "FIELDORDER(msb)" } /** @@ -396,6 +409,8 @@ module LibItsGeoNetworking_TypesAndValues { */ type record BeaconHeader { LongPosVector srcPosVector + } with { + variant "FIELDORDER(msb)" } /** @@ -423,6 +438,8 @@ module LibItsGeoNetworking_TypesAndValues { UInt16 distanceB, UInt16 angle, UInt16 reserved2 + } with { + variant "FIELDORDER(msb)" } /** @@ -457,6 +474,8 @@ module LibItsGeoNetworking_TypesAndValues { UInt16 reserved, LongPosVector srcPosVector, ShortPosVector dstPosVector + } with { + variant "FIELDORDER(msb)" } /** @@ -474,6 +493,8 @@ module LibItsGeoNetworking_TypesAndValues { UInt16 reserved, LongPosVector srcPosVector, ShortPosVector dstPosVector + } with { + variant "FIELDORDER(msb)" } /** @@ -491,6 +512,8 @@ module LibItsGeoNetworking_TypesAndValues { UInt16 reserved, LongPosVector srcPosVector, GN_Address gnAddress + } with { + variant "FIELDORDER(msb)" } /** @@ -504,6 +527,8 @@ module LibItsGeoNetworking_TypesAndValues { type record SHBHeader { LongPosVector srcPosVector, UInt32 reserved + } with { + variant "FIELDORDER(msb)" } /** @@ -519,6 +544,8 @@ module LibItsGeoNetworking_TypesAndValues { UInt16 seqNumber, UInt16 reserved, LongPosVector srcPosVector + } with { + variant "FIELDORDER(msb)" } group geoNetworkingHeadersSubtypes { @@ -531,6 +558,8 @@ module LibItsGeoNetworking_TypesAndValues { type record AnyHeaderType { HeaderType headerType(e_any), UInt4 headerSubType + } with { + variant "FIELDORDER(msb)" } /** @@ -541,6 +570,8 @@ module LibItsGeoNetworking_TypesAndValues { type record BeaconHeaderType { HeaderType headerType(e_beacon), UInt4 headerSubType + } with { + variant "FIELDORDER(msb)" } /** @@ -551,6 +582,8 @@ module LibItsGeoNetworking_TypesAndValues { type record GeoAnycastHeaderType { HeaderType headerType(e_geoAnycast), HeaderSubTypeGeoAnycast headerSubType + } with { + variant "FIELDORDER(msb)" } /** @@ -561,6 +594,8 @@ module LibItsGeoNetworking_TypesAndValues { type record GeoBroadcastHeaderType { HeaderType headerType(e_geoBroadcast), HeaderSubTypeGeoBroadcast headerSubType + } with { + variant "FIELDORDER(msb)" } /** @@ -571,6 +606,8 @@ module LibItsGeoNetworking_TypesAndValues { type record GeoUnicastHeaderType { HeaderType headerType(e_geoUnicast), UInt4 headerSubType + } with { + variant "FIELDORDER(msb)" } /** @@ -581,6 +618,8 @@ module LibItsGeoNetworking_TypesAndValues { type record LsHeaderType { HeaderType headerType(e_locationService), HeaderSubTypeLs headerSubType + } with { + variant "FIELDORDER(msb)" } /** @@ -591,6 +630,8 @@ module LibItsGeoNetworking_TypesAndValues { type record SaHeaderType { HeaderType headerType(e_serviceAnnouncement), HeaderSubTypeSa headerSubType + } with { + variant "FIELDORDER(msb)" } /** @@ -601,6 +642,8 @@ module LibItsGeoNetworking_TypesAndValues { type record TsbHeaderType { HeaderType headerType(e_topologicallyScopedBroadcast), HeaderSubTypeTSB headerSubType + } with { + variant "FIELDORDER(msb)" } /** @@ -612,7 +655,7 @@ module LibItsGeoNetworking_TypesAndValues { e_geoAnycastElip(2), e_reserved } with { - variant "4 bit" + variant "FIELDLENGTH(4)" //variant "4 bit" } /** @@ -624,7 +667,7 @@ module LibItsGeoNetworking_TypesAndValues { e_geoBroadcastElip(2), e_reserved } with { - variant "4 bit" + variant "FIELDLENGTH(4)" //variant "4 bit" } /** @@ -635,7 +678,7 @@ module LibItsGeoNetworking_TypesAndValues { e_multiHop(1), e_reserved } with { - variant "4 bit" + variant "FIELDLENGTH(4)" //variant "4 bit" } /** @@ -646,7 +689,7 @@ module LibItsGeoNetworking_TypesAndValues { e_lsReply(1), e_reserved } with { - variant "4 bit" + variant "FIELDLENGTH(4)" //variant "4 bit" } /** @@ -657,7 +700,7 @@ module LibItsGeoNetworking_TypesAndValues { e_saEos(1), e_reserved } with { - variant "4 bit" + variant "FIELDLENGTH(4)" //variant "4 bit" } /** @@ -682,6 +725,8 @@ module LibItsGeoNetworking_TypesAndValues { LsHeaderType lsHdr, SaHeaderType saHdr, UInt8 reserved + } with { + variant "FIELDORDER(msb)" } /** @@ -698,7 +743,7 @@ module LibItsGeoNetworking_TypesAndValues { e_serviceAnnouncement(7), e_reserved } with { - variant "4 bit" + variant "FIELDLENGTH(4)" //variant "4 bit" } /** @@ -738,6 +783,8 @@ module LibItsGeoNetworking_TypesAndValues { Bit1 pai, Int15 speed, UInt16 heading + } with { + variant "FIELDORDER(msb)" } /** @@ -769,6 +816,8 @@ module LibItsGeoNetworking_TypesAndValues { UInt32 timestamp_, Int32 latitude, Int32 longitude + } with { + variant "FIELDORDER(msb)" } group geoNetworkingAddress { @@ -796,6 +845,8 @@ module LibItsGeoNetworking_TypesAndValues { StationType stationType, UInt10 stationCountryCode, Oct6 mid + } with { + variant "FIELDORDER(msb)" } group geoNetworkingAddressSubtypes { @@ -818,7 +869,7 @@ module LibItsGeoNetworking_TypesAndValues { e_tram(11), e_roadSideUnit(15) } with { - variant "5 bit" + variant "FIELDLENGTH(5)" //variant "5 bit" } /** @@ -829,7 +880,7 @@ module LibItsGeoNetworking_TypesAndValues { e_manual(1), e_initial(0) } with { - variant "1 bit" + variant "FIELDLENGTH(1)" //variant "1 bit" } } // end group geoNetworkingAddressSubtypes @@ -854,6 +905,8 @@ module LibItsGeoNetworking_TypesAndValues { type record Payload { DecodedPayload decodedPayload optional, GnRawPayload rawPayload + } with { + variant "FIELDORDER(msb)" } /** @@ -905,6 +958,16 @@ module LibItsGeoNetworking_TypesAndValues { group utPrimitives { + /** + * @desc AutoInterop UpperTester trigger + * @member utRadioOnOff Set to true to power on the radio (on-link mode), false to power off the radio (off-link). + */ + type union UtAutoInteropTrigger { + boolean utRadioOnOff + } // End of type UtAutoInteropTrigger + + type boolean UtAutoInteropTriggerResult; + /** * @desc UT primitives for GeoNetworking * @member geoUnicast - @@ -1121,5 +1184,6 @@ module LibItsGeoNetworking_TypesAndValues { } } with { + variant "" encode "LibItsGeoNetworking" } -- GitLab From 3bdb33a35aca6fd27566c3af1cd1183d038ff584 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 21 Jun 2017 11:41:56 +0000 Subject: [PATCH 018/320] GeoNetworking codecs & Layers ongoing --- ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn index 3bab45f4..e3060261 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn @@ -164,8 +164,8 @@ module LibItsGeoNetworking_TestSystem { Bit256 ssp optional, UInt32 its_aid optional } with { -// encode "RAW"; - variant "" + //encode "RAW"; + variant "FIELDORDER(msb)" } /** @@ -176,14 +176,15 @@ module LibItsGeoNetworking_TestSystem { MacAddress macDestinationAddress, UInt32 its_aid } with { -// encode "RAW"; - variant "" + //encode "RAW"; + variant "FIELDORDER(msb)" } } // end nt2Primitives } // End of group networkAndTransportPrimitives with { + variant "" encode "LibIts_Interface" } // end interfacePrimitives -- GitLab From 07f1abb50dcfccf0d4509873e9694b32b5c837e5 Mon Sep 17 00:00:00 2001 From: filatov Date: Tue, 4 Jul 2017 14:51:02 +0000 Subject: [PATCH 019/320] Remove unneeded imports --- ttcn/BTP/LibItsBtp_EncdecDeclarations.ttcn | 22 +++++++++++++++++- ttcn/BTP/LibItsBtp_Functions.ttcn | 6 ++--- ttcn/BTP/LibItsBtp_TestSystem.ttcn | 8 +++---- ttcn/BTP/LibItsBtp_TypesAndValues.ttcn | 23 +++++++++++-------- ttcn/Common/LibItsCommon_Functions.ttcn | 4 ++-- ttcn/DENM/LibItsDenm_Functions.ttcn | 2 +- ttcn/DENM/LibItsDenm_TypesAndValues.ttcn | 2 +- .../LibItsGeoNetworking_Functions.ttcn | 4 ++-- .../LibItsGeoNetworking_Pixits.ttcn | 2 +- .../LibItsGeoNetworking_Templates.ttcn | 6 ++--- .../LibItsGeoNetworking_TestSystem.ttcn | 4 ++-- .../LibItsGeoNetworking_TypesAndValues.ttcn | 2 +- 12 files changed, 54 insertions(+), 31 deletions(-) diff --git a/ttcn/BTP/LibItsBtp_EncdecDeclarations.ttcn b/ttcn/BTP/LibItsBtp_EncdecDeclarations.ttcn index a3366178..92c9cd49 100644 --- a/ttcn/BTP/LibItsBtp_EncdecDeclarations.ttcn +++ b/ttcn/BTP/LibItsBtp_EncdecDeclarations.ttcn @@ -2,12 +2,32 @@ module LibItsBtp_EncdecDeclarations { // LibItsBtp import from LibItsBtp_TypesAndValues all; + import from LibItsBtp_TestSystem all; external function fx_enc_BtpPayload (BtpPayload p) return bitstring - with {extension "prototype(convert) encode(LibItsBtp)"} + with {extension "prototype(convert) encode(LibItsBtp_BtpPayload)"} /* TODO RGy function not implemented! (decvalue() not used by test suite @29-06-2016) external function fx_dec_BtpPayload (inout bitstring b, out BtpPayload p) return integer with {extension "prototype(sliding) decode(LibItsBtp)"} */ + + external function fx_enc_BtpReq (BtpReq p) return bitstring + with {extension "prototype(convert) encode(LibIts_Interface)"} + + external function fx_enc_BtpInd (BtpInd p) return bitstring + with {extension "prototype(convert) encode(LibIts_Interface)"} + + external function fx_dec_BtpInd (inout bitstring b, out BtpInd p) return integer + with {extension "prototype(sliding) decode(LibIts_Interface)"} + + external function fx_dec_BtpReq (inout bitstring b, out BtpReq p) return integer + with {extension "prototype(sliding) decode(LibIts_Interface)"} + + external function fx_enc_BtpPacket (BtpPacket p) return bitstring + with {extension "prototype(convert) encode(LibIts_Interface)"} + + external function fx_dec_BtpPacket (inout bitstring b, out BtpPacket p) return integer + with {extension "prototype(sliding) decode(LibIts_Interface)"} + } // End of module LibItsBtp_EncdecDeclarations diff --git a/ttcn/BTP/LibItsBtp_Functions.ttcn b/ttcn/BTP/LibItsBtp_Functions.ttcn index 8f31833c..0a91b678 100644 --- a/ttcn/BTP/LibItsBtp_Functions.ttcn +++ b/ttcn/BTP/LibItsBtp_Functions.ttcn @@ -14,11 +14,11 @@ // LibCommon import from LibCommon_Sync all; - import from LibCommon_Time all; - import from LibCommon_VerdictControl all; +// import from LibCommon_Time all; +// import from LibCommon_VerdictControl all; // LibItsCommon - import from LibItsCommon_Functions all; +// import from LibItsCommon_Functions all; import from LibItsCommon_TypesAndValues all; // LibItsBtp diff --git a/ttcn/BTP/LibItsBtp_TestSystem.ttcn b/ttcn/BTP/LibItsBtp_TestSystem.ttcn index e131d71a..cc4b320f 100644 --- a/ttcn/BTP/LibItsBtp_TestSystem.ttcn +++ b/ttcn/BTP/LibItsBtp_TestSystem.ttcn @@ -12,8 +12,8 @@ module LibItsBtp_TestSystem { // LibCommon - import from LibCommon_Time {modulepar all}; - import from LibCommon_Sync all; +// import from LibCommon_Time {modulepar all}; +// import from LibCommon_Sync all; // LibIts import from LibItsCommon_TestSystem all; @@ -112,8 +112,8 @@ module LibItsBtp_TestSystem { } // end nt1Primitives } // End of group networkAndTransportPrimitives - with { - encode "LibIts_Interface" + with { + encode "LibIts_Interface" } // end interfacePrimitives } // End of module LibItsBtp_TestSystem diff --git a/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn b/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn index cad2ced6..cf7d8d44 100644 --- a/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn +++ b/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn @@ -35,6 +35,9 @@ module LibItsBtp_TypesAndValues { BtpHeader header, BtpPayload payload optional } + with { + encode "LibIts_Interface" + } } // end btpPdus @@ -100,6 +103,9 @@ module LibItsBtp_TypesAndValues { DecodedBtpPayload decodedPayload optional, BtpRawPayload rawPayload } + with { + encode "LibItsBtp_BtpPayload" + } /** * @desc The decoded payload of the BTP packet @@ -120,13 +126,13 @@ module LibItsBtp_TypesAndValues { SREM sremPacket, SSEM ssemPacket } with { - encode (camPacket) "LibItsCam_asn1"; - encode (denmPacket) "LibItsDenm_asn1"; - encode (mapemPacket) "LibItsMapemSpatem_asn1"; - encode (spatemPacket) "LibItsMapemSpatem_asn1"; - encode (ivimPacket) "LibItsIvim_asn1"; - encode (sremPacket) "LibItsSremSsem_asn1"; - encode (ssemPacket) "LibItsSremSsem_asn1" + encode (camPacket) "PER"; + encode (denmPacket) "PER"; + encode (mapemPacket) "PER"; + encode (spatemPacket) "PER"; + encode (ivimPacket) "PER"; + encode (sremPacket) "PER"; + encode (ssemPacket) "PER" } } //end btpPayload @@ -189,6 +195,3 @@ module LibItsBtp_TypesAndValues { } } -with { - encode "LibItsBtp" -} diff --git a/ttcn/Common/LibItsCommon_Functions.ttcn b/ttcn/Common/LibItsCommon_Functions.ttcn index 3d7dd521..ec4082a1 100644 --- a/ttcn/Common/LibItsCommon_Functions.ttcn +++ b/ttcn/Common/LibItsCommon_Functions.ttcn @@ -13,8 +13,8 @@ module LibItsCommon_Functions { // LibCommon - import from LibCommon_Sync all; - import from LibCommon_VerdictControl all; +// import from LibCommon_Sync all; +// import from LibCommon_VerdictControl all; import from LibCommon_BasicTypesAndValues all; // LibIts diff --git a/ttcn/DENM/LibItsDenm_Functions.ttcn b/ttcn/DENM/LibItsDenm_Functions.ttcn index d028ce79..7f9859be 100644 --- a/ttcn/DENM/LibItsDenm_Functions.ttcn +++ b/ttcn/DENM/LibItsDenm_Functions.ttcn @@ -30,7 +30,7 @@ module LibItsDenm_Functions { import from LibItsDenm_TestSystem all; import from LibItsDenm_TypesAndValues all; import from LibItsDenm_Templates all; - import from LibItsDenm_Pixits all; +// import from LibItsDenm_Pixits all; import from LibItsDenm_Pics all; group utFuntions { diff --git a/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn b/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn index 6ecc3c80..9d3824fe 100644 --- a/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn +++ b/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn @@ -8,7 +8,7 @@ module LibItsDenm_TypesAndValues { //LibCommon - import from LibCommon_BasicTypesAndValues all; +// import from LibCommon_BasicTypesAndValues all; // LibIts import from DENM_PDU_Descriptions language "ASN.1:1997" all; diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn index 32b1a2f0..40291fc9 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn @@ -24,7 +24,7 @@ module LibItsGeoNetworking_Functions { import from LibItsCommon_Templates all; import from LibItsCommon_Functions all; import from LibItsCommon_Pixits all; - import from LibItsCommon_TestSystem all; +// import from LibItsCommon_TestSystem all; // LibItsSecurity import from LibItsSecurity_TypesAndValues all; @@ -38,7 +38,7 @@ module LibItsGeoNetworking_Functions { import from LibItsGeoNetworking_Templates all; import from LibItsGeoNetworking_Pixits all; import from LibItsGeoNetworking_Pics all; - import from LibItsGeoNetworking_EncdecDeclarations all; +// import from LibItsGeoNetworking_EncdecDeclarations all; group utFuntions { diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Pixits.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Pixits.ttcn index 81c43b9a..22311ece 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Pixits.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Pixits.ttcn @@ -12,7 +12,7 @@ module LibItsGeoNetworking_Pixits { // LibCommon - import from LibCommon_DataStrings all; +// import from LibCommon_DataStrings all; import from LibCommon_BasicTypesAndValues all; // LibIts diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn index bb5a4d77..0a8ede72 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn @@ -21,11 +21,11 @@ module LibItsGeoNetworking_Templates { // LibItsBtp import from LibItsBtp_Templates all; - import from LibItsBtp_EncdecDeclarations all; +// import from LibItsBtp_EncdecDeclarations all; // LibItsSecurity import from LibItsSecurity_TypesAndValues all; - import from LibItsSecurity_Pixits all; +// import from LibItsSecurity_Pixits all; // LibItsIpv6OverGeoNetworking import from LibItsIpv6OverGeoNetworking_TypesAndValues all; @@ -35,7 +35,7 @@ module LibItsGeoNetworking_Templates { import from LibItsGeoNetworking_TestSystem all; import from LibItsGeoNetworking_TypesAndValues all; import from LibItsGeoNetworking_Pixits all; - import from LibItsGeoNetworking_EncdecDeclarations all; +// import from LibItsGeoNetworking_EncdecDeclarations all; group geoNwPrimitivesTemplates { diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn index e3060261..919713c5 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn @@ -12,8 +12,8 @@ module LibItsGeoNetworking_TestSystem { // LibCommon - import from LibCommon_Time {modulepar all}; - import from LibCommon_Sync all; +// import from LibCommon_Time {modulepar all}; +// import from LibCommon_Sync all; import from LibCommon_BasicTypesAndValues all; import from LibCommon_DataStrings all; diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn index b16b7ef6..56b6f964 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn @@ -16,7 +16,7 @@ module LibItsGeoNetworking_TypesAndValues { import from LibCommon_DataStrings all; // LibIts - import from LibItsCommon_TypesAndValues all; +// import from LibItsCommon_TypesAndValues all; import from LibItsBtp_TypesAndValues {type BtpPacket;} import from LibItsIpv6OverGeoNetworking_TypesAndValues {type Ipv6Packet;} -- GitLab From 57568362b8d47330189f99e7cb817caa4d9ca51d Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 11 Jul 2017 11:35:49 +0000 Subject: [PATCH 020/320] CAM codecs & Layers ongoing --- ttcn/CAM/LibItsCam_TestSystem.ttcn | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ttcn/CAM/LibItsCam_TestSystem.ttcn b/ttcn/CAM/LibItsCam_TestSystem.ttcn index 4d0bd3df..0acc5fa7 100644 --- a/ttcn/CAM/LibItsCam_TestSystem.ttcn +++ b/ttcn/CAM/LibItsCam_TestSystem.ttcn @@ -141,7 +141,6 @@ module LibItsCam_TestSystem { UInt32 its_aid optional } with { -// variant "" encode (msgIn) "PER"//LibItsCam_asn1 /* encode (gnNextHeader) "RAW" @@ -163,7 +162,6 @@ module LibItsCam_TestSystem { CAM msgOut } with { -// variant "" encode (msgOut) "PER"//LibItsCam_asn1 } @@ -171,6 +169,7 @@ module LibItsCam_TestSystem { } // End of group facilityPrimitives with { + variant "" encode "LibIts_Interface" } // end interfacePrimitives -- GitLab From 3d752de84e99f9fce162e499894c671503c2dcdf Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 13 Jul 2017 06:28:38 +0000 Subject: [PATCH 021/320] Simplify Payload for GeoNetworking & BTP ==> Check TODO in Security ATS --- ttcn/BTP/LibItsBtp_EncdecDeclarations.ttcn | 3 - ttcn/BTP/LibItsBtp_Functions.ttcn | 2 +- ttcn/BTP/LibItsBtp_Pixits.ttcn | 5 +- ttcn/BTP/LibItsBtp_Templates.ttcn | 28 ++-- ttcn/BTP/LibItsBtp_TypesAndValues.ttcn | 78 +++------ ...ibItsGeoNetworking_EncdecDeclarations.ttcn | 6 - .../LibItsGeoNetworking_Functions.ttcn | 8 +- .../LibItsGeoNetworking_Templates.ttcn | 154 +++--------------- .../LibItsGeoNetworking_TypesAndValues.ttcn | 51 ++---- ...6OverGeoNetworking_EncdecDeclarations.ttcn | 11 ++ ...LibItsIpv6OverGeoNetworking_Functions.ttcn | 45 +++-- ...LibItsIpv6OverGeoNetworking_Templates.ttcn | 34 ++-- ...sIpv6OverGeoNetworking_TypesAndValues.ttcn | 5 +- 13 files changed, 125 insertions(+), 305 deletions(-) create mode 100644 ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_EncdecDeclarations.ttcn diff --git a/ttcn/BTP/LibItsBtp_EncdecDeclarations.ttcn b/ttcn/BTP/LibItsBtp_EncdecDeclarations.ttcn index 92c9cd49..2bb5ff8e 100644 --- a/ttcn/BTP/LibItsBtp_EncdecDeclarations.ttcn +++ b/ttcn/BTP/LibItsBtp_EncdecDeclarations.ttcn @@ -4,9 +4,6 @@ module LibItsBtp_EncdecDeclarations { import from LibItsBtp_TypesAndValues all; import from LibItsBtp_TestSystem all; - external function fx_enc_BtpPayload (BtpPayload p) return bitstring - with {extension "prototype(convert) encode(LibItsBtp_BtpPayload)"} - /* TODO RGy function not implemented! (decvalue() not used by test suite @29-06-2016) external function fx_dec_BtpPayload (inout bitstring b, out BtpPayload p) return integer with {extension "prototype(sliding) decode(LibItsBtp)"} diff --git a/ttcn/BTP/LibItsBtp_Functions.ttcn b/ttcn/BTP/LibItsBtp_Functions.ttcn index 0a91b678..86f2218e 100644 --- a/ttcn/BTP/LibItsBtp_Functions.ttcn +++ b/ttcn/BTP/LibItsBtp_Functions.ttcn @@ -234,7 +234,7 @@ * @desc Gets the BTP payload to use. * @return BTP payload */ - function f_getBtpPayload() return BtpPayload { + function f_getBtpPayload() return BtpRawPayload { return PX_PAYLOAD; } diff --git a/ttcn/BTP/LibItsBtp_Pixits.ttcn b/ttcn/BTP/LibItsBtp_Pixits.ttcn index 06e819a7..41701eee 100644 --- a/ttcn/BTP/LibItsBtp_Pixits.ttcn +++ b/ttcn/BTP/LibItsBtp_Pixits.ttcn @@ -43,10 +43,7 @@ module LibItsBtp_Pixits { * @desc Payload to be sent to the IUT for testing matter * */ - modulepar BtpPayload PX_PAYLOAD := { - decodedPayload := omit, - rawPayload := '0102030405'O - }; + modulepar BtpRawPayload PX_PAYLOAD := '0102030405'O ; } // end LibItsBtp_Pixits \ No newline at end of file diff --git a/ttcn/BTP/LibItsBtp_Templates.ttcn b/ttcn/BTP/LibItsBtp_Templates.ttcn index dbbb0aa4..a64fa437 100644 --- a/ttcn/BTP/LibItsBtp_Templates.ttcn +++ b/ttcn/BTP/LibItsBtp_Templates.ttcn @@ -89,7 +89,7 @@ module LibItsBtp_Templates { * @param p_payload Payload */ template (value) BtpPacket m_btpA ( - template (value) BtpPayload p_payload + template (value) BtpRawPayload p_payload ):= { header := { btpAHeader := { @@ -107,7 +107,7 @@ module LibItsBtp_Templates { * @param p_payload Payload */ template( value) BtpPacket m_btpB ( - template (value) BtpPayload p_payload + template (value) BtpRawPayload p_payload ) := { header := { btpBHeader := { @@ -125,9 +125,9 @@ module LibItsBtp_Templates { * @param p_payload Payload */ template (value) BtpPacket m_btpAWithPorts ( - template (value) BtpPortId p_destPort, - template (value) BtpPortId p_srcPort, - template (value) BtpPayload p_payload + template (value) BtpPortId p_destPort, + template (value) BtpPortId p_srcPort, + template (value) BtpRawPayload p_payload ):= { header := { btpAHeader := { @@ -145,9 +145,9 @@ module LibItsBtp_Templates { * @param p_payload Payload */ template( value) BtpPacket m_btpBWithPorts ( - template (value) BtpPortId p_destPort, - template (value) BtpPortInfo p_destPortInfo, - template (value) BtpPayload p_payload + template (value) BtpPortId p_destPort, + template (value) BtpPortInfo p_destPortInfo, + template (value) BtpRawPayload p_payload ) := { header := { btpBHeader := { @@ -165,9 +165,9 @@ module LibItsBtp_Templates { * @param p_payload Payload */ template BtpPacket mw_btpA ( - template (present) BtpPortId p_destPort, - template (present) BtpPortId p_srcPort, - template BtpPayload p_payload + template (present) BtpPortId p_destPort, + template (present) BtpPortId p_srcPort, + template BtpRawPayload p_payload ) := { header := { btpAHeader := { @@ -185,9 +185,9 @@ module LibItsBtp_Templates { * @param p_payload Payload */ template BtpPacket mw_btpB ( - template (present) BtpPortId p_destPort, - template (present) BtpPortInfo p_destPortInfo, - template BtpPayload p_payload + template (present) BtpPortId p_destPort, + template (present) BtpPortInfo p_destPortInfo, + template BtpRawPayload p_payload ) := { header := { btpBHeader := { diff --git a/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn b/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn index cf7d8d44..309236d1 100644 --- a/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn +++ b/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn @@ -14,14 +14,7 @@ module LibItsBtp_TypesAndValues { // LibCommon import from LibCommon_BasicTypesAndValues all; - // LibIts - import from CAM_PDU_Descriptions language "ASN.1:1997" all; - import from DENM_PDU_Descriptions language "ASN.1:1997" all; - import from MAPEM_PDU_Descriptions language "ASN.1:1997" all; - import from SPATEM_PDU_Descriptions language "ASN.1:1997" all; - import from IVIM_PDU_Descriptions language "ASN.1:1997" all; - import from SREM_PDU_Descriptions language "ASN.1:1997" all; - import from SSEM_PDU_Descriptions language "ASN.1:1997" all; + type octetstring BtpRawPayload; group btpPdus { @@ -33,9 +26,10 @@ module LibItsBtp_TypesAndValues { */ type record BtpPacket { BtpHeader header, - BtpPayload payload optional + BtpRawPayload payload optional } with { + variant "FIELDORDER(msb)" encode "LibIts_Interface" } @@ -52,7 +46,10 @@ module LibItsBtp_TypesAndValues { type union BtpHeader { BtpAHeader btpAHeader, BtpBHeader btpBHeader - } + } with { + variant "FIELDORDER(msb)" + } + /** * @desc BTP-A Header @@ -63,7 +60,10 @@ module LibItsBtp_TypesAndValues { type record BtpAHeader { BtpPortId destinationPort, BtpPortId sourcePort - } + } with { + variant "FIELDORDER(msb)" + } + /** * @desc BTP-B Header @@ -74,7 +74,10 @@ module LibItsBtp_TypesAndValues { type record BtpBHeader { BtpPortId destinationPort, BtpPortInfo destinationPortInfo - } + } with { + variant "FIELDORDER(msb)" + } + /** * @desc BTP Port ID @@ -90,53 +93,6 @@ module LibItsBtp_TypesAndValues { } // end btpHeaders - group btpPayload { - - type octetstring BtpRawPayload; - - /** - * @desc The payload of the BTP packet - * @member decodedPayload The decoded payload - * @member rawPayload Raw payload as it is received - */ - type record BtpPayload { - DecodedBtpPayload decodedPayload optional, - BtpRawPayload rawPayload - } - with { - encode "LibItsBtp_BtpPayload" - } - - /** - * @desc The decoded payload of the BTP packet - * @member camPacket The CAM packet - * @member denmPacket The DENM packet - * @member mapemPacket - * @member spatemPacket - * @member ivimPacket - * @member sremPacket - * @member seemPacket - */ - type union DecodedBtpPayload { - CAM camPacket, - DENM denmPacket, - MAPEM mapemPacket, - SPATEM spatemPacket, - IVIM ivimPacket, - SREM sremPacket, - SSEM ssemPacket - } with { - encode (camPacket) "PER"; - encode (denmPacket) "PER"; - encode (mapemPacket) "PER"; - encode (spatemPacket) "PER"; - encode (ivimPacket) "PER"; - encode (sremPacket) "PER"; - encode (ssemPacket) "PER" - } - - } //end btpPayload - group utPrimitives { group utCommonPrimitives { @@ -194,4 +150,8 @@ module LibItsBtp_TypesAndValues { encode "UpperTester" } +} with { + variant "" + encode "LibItsGeoNetworking" } + diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_EncdecDeclarations.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_EncdecDeclarations.ttcn index 0af2d105..f80507c3 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_EncdecDeclarations.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_EncdecDeclarations.ttcn @@ -21,12 +21,6 @@ module LibItsGeoNetworking_EncdecDeclarations { external function fx_dec_GeoNetworkingPdu (inout bitstring b, out GeoNetworkingPdu p) return integer with {extension "prototype(sliding) decode(LibItsGeoNetworking)"} - external function fx_enc_Payload (Payload p) return bitstring - with {extension "prototype(convert) encode(LibItsGeoNetworking)"} - - external function fx_dec_Payload (inout bitstring b, out Payload p) return integer - with {extension "prototype(sliding) decode(LibItsGeoNetworking)"} - external function fx_enc_GnNonSecuredPacket (GnNonSecuredPacket p) return bitstring with {extension "prototype(convert) encode(LibItsGeoNetworking)"} diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn index 40291fc9..24e2eaf1 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn @@ -2052,7 +2052,7 @@ module LibItsGeoNetworking_Functions { */ function f_sendGeoNetMessageWithPayload( in template (value) GeoNetworkingReq p_geoNetReq, - in template (value) Payload p_payload + in template (value) GnRawPayload p_payload ) runs on ItsGeoNetworking { p_geoNetReq.msgOut.gnPacket.packet.payload := p_payload; geoNetworkingPort.send(p_geoNetReq); @@ -2070,7 +2070,7 @@ module LibItsGeoNetworking_Functions { */ function f_receiveGeoNetMessageWithPayload( in template (present) GeoNetworkingInd p_geoNetInd, - in template (present) Payload p_payload + in template (present) GnRawPayload p_payload ) return template (present) GeoNetworkingInd { var template (present) GeoNetworkingInd v_geoNetInd := p_geoNetInd; @@ -2796,7 +2796,7 @@ module LibItsGeoNetworking_Functions { f_getPosition(c_compNodeC) // FIXME To be verified YANN )); // Add CAM payload - v_gnNonSecuredPacket.payload := valueof(f_adaptPayload_m(p_payload)); + v_gnNonSecuredPacket.payload := valueof(p_payload); f_buildGnSecuredCam( v_securedMessage, @@ -2846,7 +2846,7 @@ module LibItsGeoNetworking_Functions { f_getPosition(c_compNodeC) // FIXME To be verified YANN )); // Add CAM payload - v_gnNonSecuredPacket.payload := valueof(f_adaptPayload_m(p_payload)); + v_gnNonSecuredPacket.payload := valueof(p_payload); f_buildGnSecuredCam( v_securedMessage, diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn index 0a8ede72..2bf3b3d8 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn @@ -110,7 +110,7 @@ module LibItsGeoNetworking_Templates { gnAddress := p_destinationGnAddr, lifetime := c_lifetime, trafficClass := valueof(m_trafficClass), - payload := { decodedPayload := omit, rawPayload := ''O} // do not use f_adaptPayload_m here + payload := ''O } } @@ -155,7 +155,7 @@ module LibItsGeoNetworking_Templates { octetstring p_payload ) modifies m_generateGeoUnicastMessage := { geoUnicast := { - payload := { decodedPayload := omit, rawPayload := p_payload} // do not use f_adaptPayload_m here + payload := p_payload } } @@ -172,7 +172,7 @@ module LibItsGeoNetworking_Templates { octetstring p_payload ) modifies m_generateGeoUnicastMessageWithLifetime := { geoUnicast := { - payload := { decodedPayload := omit, rawPayload := p_payload} // do not use f_adaptPayload_m here + payload := p_payload } } @@ -189,7 +189,7 @@ module LibItsGeoNetworking_Templates { trafficClass := valueof(m_trafficClass), reserved := c_uInt24Zero, area := p_geoArea.area, - payload := { decodedPayload := omit, rawPayload := ''O} // do not use f_adaptPayload_m here + payload := ''O } } @@ -232,7 +232,7 @@ module LibItsGeoNetworking_Templates { octetstring p_payload ) modifies m_generateGeoBroadcastMessage := { geoBroadcast := { - payload := { decodedPayload := omit, rawPayload := p_payload} // do not use f_adaptPayload_m here + payload := p_payload } } @@ -249,7 +249,7 @@ module LibItsGeoNetworking_Templates { trafficClass := valueof(m_trafficClass), reserved := c_uInt24Zero, area := p_geoArea.area, - payload := { decodedPayload := omit, rawPayload := ''O} // do not use f_adaptPayload_m here + payload := ''O } } @@ -279,7 +279,7 @@ module LibItsGeoNetworking_Templates { octetstring p_payload ) modifies m_generateGeoAnycastMessage := { geoAnycast := { - payload := { decodedPayload := omit, rawPayload := p_payload} // do not use f_adaptPayload_m here + payload := p_payload } } @@ -289,7 +289,7 @@ module LibItsGeoNetworking_Templates { template (value) UtGnTrigger m_generateShbMessage := { shb := { trafficClass := valueof(m_trafficClass), - payload := { decodedPayload := omit, rawPayload := ''O} // do not use f_adaptPayload_m here + payload := ''O } } @@ -315,7 +315,7 @@ module LibItsGeoNetworking_Templates { octetstring p_payload ) modifies m_generateShbMessage := { shb := { - payload := { decodedPayload := omit, rawPayload := p_payload} // do not use f_adaptPayload_m here + payload := p_payload } } @@ -327,7 +327,7 @@ module LibItsGeoNetworking_Templates { nbHops := 10, lifetime := c_lifetime, trafficClass := valueof(m_trafficClass), - payload := { decodedPayload := omit, rawPayload := ''O} // do not use f_adaptPayload_m here + payload := ''O } } @@ -542,7 +542,7 @@ module LibItsGeoNetworking_Templates { packet := valueof({ commonHeader := p_commonHeader, extendedHeader := p_extHeader, - payload := f_adaptPayload_m(char2oct("DEFAULT_PAYLOAD")) + payload := char2oct("DEFAULT_PAYLOAD") }), securedMsg := omit } @@ -563,24 +563,6 @@ module LibItsGeoNetworking_Templates { } } - /** - * @desc Send template for GeoNetworking Packet with octetstring payload - * @param p_basicHeader Common header of GeoNetworking packet - * @param p_extHeader Extended header of GeoNetworking packet - * @param p_payload Octetstring payload - * - * @see m_geoNwPacket - */ - template (value) GeoNetworkingPacket m_geoNwPacketWithOctetstringPayload( - in template (value) CommonHeader p_commonHeader, - in template (value) ExtendedHeader p_extHeader, - in template (value) octetstring p_payload - ) modifies m_geoNwPacket := { - packet := { - payload := valueof(f_adaptPayload_m(p_payload)) - } - } - /** * @desc Send template for GeoNetworking Packet with payload * @param p_basicHeader Common header of GeoNetworking packet @@ -592,7 +574,7 @@ module LibItsGeoNetworking_Templates { template (value) GeoNetworkingPacket m_geoNwPacketWithPayload( in template (value) CommonHeader p_commonHeader, in template (value) ExtendedHeader p_extHeader, - in template (value) Payload p_payload + in template (value) GnRawPayload p_payload ) modifies m_geoNwPacket := { packet := { payload := p_payload @@ -650,7 +632,7 @@ module LibItsGeoNetworking_Templates { in template (present) octetstring p_payload ) modifies mw_geoNwPacket := { packet := { - payload := f_adaptPayload_mw(p_payload) + payload := p_payload } } @@ -667,7 +649,7 @@ module LibItsGeoNetworking_Templates { template(present) GeoNetworkingPacket mw_geoNwPduWithPayload( in template (present) CommonHeader p_commonHeader, in template (present) ExtendedHeader p_extHeader, - in template (present) Payload p_payload + in template (present) GnRawPayload p_payload ) modifies mw_geoNwPacket := { packet := { payload := p_payload @@ -693,7 +675,7 @@ module LibItsGeoNetworking_Templates { * @param payload Expected GN payload */ template (present) GnNonSecuredPacket mw_geoNwAnyPacket_withPayload( - template (present) Payload p_payload + template (present) GnRawPayload p_payload ) := { commonHeader := mw_commonHeader( ?, @@ -733,7 +715,7 @@ module LibItsGeoNetworking_Templates { p_destinationShortPosVec, p_seqNumber )), - payload := valueof(f_adaptPayload_m(char2oct("DEFAULT_PAYLOAD"))) + payload := valueof(char2oct("DEFAULT_PAYLOAD")) } /** @@ -844,7 +826,7 @@ module LibItsGeoNetworking_Templates { p_seqNumber, p_anycastArea )), - payload := valueof(f_adaptPayload_m(char2oct("DEFAULT_PAYLOAD"))) + payload := valueof(char2oct("DEFAULT_PAYLOAD")) } /** @@ -958,7 +940,7 @@ module LibItsGeoNetworking_Templates { p_seqNumber, p_broadcastArea )), - payload := valueof(f_adaptPayload_m(char2oct("DEFAULT_PAYLOAD"))) + payload := valueof(char2oct("DEFAULT_PAYLOAD")) } /** @@ -1009,7 +991,7 @@ module LibItsGeoNetworking_Templates { in template (present) LongPosVector p_sourceLongPosVec, in template (present) UInt16 p_seqNumber, in template (present) NextHeader p_nextHeader, - in template (present) Payload p_payload + in template (present) GnRawPayload p_payload ) modifies mw_geoNwBroadcastPacketWithNextHeader := { payload := p_payload } @@ -1138,10 +1120,7 @@ module LibItsGeoNetworking_Templates { p_seqNumber, p_mid ), - payload := { - decodedPayload := omit, - rawPayload := ''O - } + payload := omit } /** @@ -1183,10 +1162,7 @@ module LibItsGeoNetworking_Templates { extendedHeader := mw_lsReplyHeader( p_sourceLongPosVec, p_destinationLongPosVec ), - payload := { - decodedPayload := omit, - rawPayload := ''O - } + payload := omit } } // end group geoNwPacketLsTemplates @@ -1227,16 +1203,7 @@ module LibItsGeoNetworking_Templates { m_beaconHeaderType ), extendedHeader := mw_beaconHeader(p_sourceLongPosVec), - payload := ( - { - decodedPayload := omit, - rawPayload := ''O - }, - { // Ethernet testing requires minimum packet size of 60 bytes - decodedPayload := *, - rawPayload := '00000000000000000000'O - } - ) + payload := (*, '00000000000000000000'O) } } // end group geoNwPacketBeaconTemplates @@ -1259,7 +1226,7 @@ module LibItsGeoNetworking_Templates { extendedHeader := valueof(m_shbHeader( p_sourceLongPosVec )), - payload := valueof(f_adaptPayload_m(char2oct("DEFAULT_PAYLOAD"))) + payload := valueof(char2oct("DEFAULT_PAYLOAD")) } /** @@ -1306,7 +1273,7 @@ module LibItsGeoNetworking_Templates { p_seqNumber, p_sourceLongPosVec )), - payload := valueof(f_adaptPayload_m(char2oct("DEFAULT_PAYLOAD"))) + payload := valueof(char2oct("DEFAULT_PAYLOAD")) } /** @@ -2316,77 +2283,4 @@ module LibItsGeoNetworking_Templates { } // end geoMiscTemplates - group geoTemplateFunctions { - - function f_adaptPayloadForUtInd_m(in template (omit) Payload p_gnPayload) return octetstring { - if(not isvalue(p_gnPayload)) { - testcase.stop(__SCOPE__ & " can handle payload values only"); - } - if(PX_BTP_IN_UT_IND == false) { - if(PX_GN_UPPER_LAYER == e_btpA or PX_GN_UPPER_LAYER == e_btpB) { - if( ispresent(p_gnPayload.decodedPayload) ){ - return bit2oct(encvalue(p_gnPayload.decodedPayload.btpPacket.payload)); - } - - return valueof(p_gnPayload.rawPayload); - } - } - - return bit2oct(encvalue(valueof(p_gnPayload))); - } - - function f_adaptPayload_m(in template (value) octetstring p_finalPayload) return template (value) Payload { - var template (value) Payload v_payload; - - if(PX_GN_UPPER_LAYER == e_any) { - v_payload := { decodedPayload := omit, rawPayload := p_finalPayload}; - return v_payload; - } - - if(PX_GN_UPPER_LAYER == e_ipv6) { - v_payload := { decodedPayload := { ipv6Packet := m_ipv6Packet(c_unspecified, c_allNodesMca, c_noNextHdr, m_octetstringPayload(p_finalPayload))}, rawPayload := ''O}; - return v_payload; - } - - if(PX_GN_UPPER_LAYER == e_btpA) { - v_payload := { decodedPayload := { btpPacket := m_btpA({ decodedPayload := omit, rawPayload := p_finalPayload })}, rawPayload := ''O}; - return v_payload; - } - - if(PX_GN_UPPER_LAYER == e_btpB) { - v_payload := { decodedPayload := { btpPacket := m_btpB({ decodedPayload := omit, rawPayload := p_finalPayload })}, rawPayload := ''O}; - return v_payload; - } - - return v_payload; - } - - function f_adaptPayload_mw(in template (present) octetstring p_finalPayload) return template (present) Payload { - var template (present) Payload v_payload; - - if(PX_GN_UPPER_LAYER == e_any) { - v_payload := { decodedPayload := *, rawPayload := p_finalPayload}; - return v_payload; - } - - if(PX_GN_UPPER_LAYER == e_ipv6) { - v_payload := { decodedPayload := { ipv6Packet := mw_ipv6Packet(?, ?, ?, mw_octetstringPayload(p_finalPayload))}, rawPayload := ?}; - return v_payload; - } - - if(PX_GN_UPPER_LAYER == e_btpA) { - v_payload := { decodedPayload := { btpPacket := mw_btpA(?, ?, { decodedPayload := *, rawPayload := p_finalPayload } )}, rawPayload := ?}; - return v_payload; - } - - if(PX_GN_UPPER_LAYER == e_btpB) { - v_payload := { decodedPayload := { btpPacket := mw_btpB(?, ?, { decodedPayload := *, rawPayload := p_finalPayload })}, rawPayload := ?}; - return v_payload; - } - - return v_payload; - } - - } // end geoTemplateFunctions - } // end ItsGeoNetworking_Templates \ No newline at end of file diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn index 56b6f964..cdf63132 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn @@ -195,10 +195,12 @@ module LibItsGeoNetworking_TypesAndValues { encode (securedMsg) "LibItsSecurity" } + type octetstring GnRawPayload; + type record GnNonSecuredPacket { CommonHeader commonHeader, ExtendedHeader extendedHeader optional, - Payload payload optional + GnRawPayload payload optional } } // end group geoNetworkingPdus @@ -893,37 +895,6 @@ module LibItsGeoNetworking_TypesAndValues { } // end group geoNetworkingHeader - group geoNetworkingPayload { - - type octetstring GnRawPayload; - - /** - * @desc The payload of the GN packet - * @member decodedPayload The decoded payload - * @member rawPayload Raw payload as it is received - */ - type record Payload { - DecodedPayload decodedPayload optional, - GnRawPayload rawPayload - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc The decoded payload of the GN packet - * @member ipv6Packet The IPv6 packet - * @member btpPacket BTP packet - */ - type union DecodedPayload { - Ipv6Packet ipv6Packet, - BtpPacket btpPacket - } with { - encode (ipv6Packet) "LibItsIpv6OverGeoNetworking"; - encode (btpPacket) "LibItsBtp" - } - - } //end group geoNetworkingPayload - group geoNwPicsTypes { /** @@ -993,13 +964,13 @@ module LibItsGeoNetworking_TypesAndValues { * @member gnAddress Destination of the packet * @member lifetime Lifetime of the packet * @member trafficClass Traffic class of the packet - * @member payload Payload of the packet + * @member payload GnRawPayload of the packet */ type record GenerateGeoUnicastMessage { GN_Address gnAddress, UInt16 lifetime, TrafficClass trafficClass, - Payload payload + GnRawPayload payload } with { encode (payload) "UpperTester" } @@ -1010,7 +981,7 @@ module LibItsGeoNetworking_TypesAndValues { * @member lifetime Lifetime of the packet * @member trafficClass Traffic class of the packet * @member area Destination GeoArea - * @member payload Payload of the packet + * @member payload GnRawPayload of the packet */ type record GenerateGeoBroadcastMessage { GeoShape shape, @@ -1018,7 +989,7 @@ module LibItsGeoNetworking_TypesAndValues { TrafficClass trafficClass, UInt24 reserved, Area area, - Payload payload + GnRawPayload payload } with { encode (payload) "UpperTester" } @@ -1031,11 +1002,11 @@ module LibItsGeoNetworking_TypesAndValues { /** * @desc UT primitive for IUT to send a SHB packet * @member trafficClass Traffic class of the packet - * @member payload Payload of the packet + * @member payload GnRawPayload of the packet */ type record GenerateSHBMessage { TrafficClass trafficClass, - Payload payload + GnRawPayload payload } with { encode (payload) "UpperTester" } @@ -1045,13 +1016,13 @@ module LibItsGeoNetworking_TypesAndValues { * @member nbHops Number of Hops * @member lifetime Lifetime of the packet * @member trafficClass Traffic class of the packet - * @member payload Payload of the packet + * @member payload GnRawPayload of the packet */ type record GenerateTSBMessage { UInt8 nbHops, UInt16 lifetime, TrafficClass trafficClass, - Payload payload + GnRawPayload payload } with { encode (payload) "UpperTester" } diff --git a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_EncdecDeclarations.ttcn b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_EncdecDeclarations.ttcn new file mode 100644 index 00000000..0ccedc01 --- /dev/null +++ b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_EncdecDeclarations.ttcn @@ -0,0 +1,11 @@ +module LibItsIpv6OverGeoNetworking_EncdecDeclarations { + + import from LibItsIpv6OverGeoNetworking_TypesAndValues all; + + external function fx_enc_Ipv6Packet (Ipv6Packet p) return bitstring + with {extension "prototype(convert) encode(LibItsIpv6OverGeoNetworking)"} + + external function fx_dec_Ipv6Packet (inout bitstring b, out Ipv6Packet p) return integer + with {extension "prototype(sliding) decode(LibItsIpv6OverGeoNetworking)"} + +} // End of module LibItsIpv6OverGeoNetworking_EncdecDeclarations diff --git a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Functions.ttcn b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Functions.ttcn index 3039b86d..f8c1cc39 100644 --- a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Functions.ttcn +++ b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Functions.ttcn @@ -99,14 +99,7 @@ module LibItsIpv6OverGeoNetworking_Functions { ?, ?, e_ipv6, - mw_ipv6Payload( - mw_ipv6Packet( - ?, - ?, - ?, - mw_octetstringPayload(?) - ) - ) + ? ) ) ) @@ -121,9 +114,7 @@ module LibItsIpv6OverGeoNetworking_Functions { ?, ?, e_ipv6, - mw_ipv6Payload( - ? - ) + ? ) ) ) @@ -307,19 +298,21 @@ module LibItsIpv6OverGeoNetworking_Functions { ) ) ), - m_ipv6Payload( - m_ipv6Packet( - v_nodeAddresses.lla, - c_allNodesMca, - c_icmpHdr, - m_rtAdvWithOptions( - m_rtAdvOpt_prefixOpt( - valueof(p_gvl.prefixLength), - c_lFlag1, - c_aFlag1, - p_validLifetime, - c_preferredLifetime30s, - valueof(p_gvl.prefix) + bit2oct( + encvalue( + m_ipv6Packet( + v_nodeAddresses.lla, + c_allNodesMca, + c_icmpHdr, + m_rtAdvWithOptions( + m_rtAdvOpt_prefixOpt( + valueof(p_gvl.prefixLength), + c_lFlag1, + c_aFlag1, + p_validLifetime, + c_preferredLifetime30s, + valueof(p_gvl.prefix) + ) ) ) ) @@ -709,7 +702,7 @@ module LibItsIpv6OverGeoNetworking_Functions { in template (value) Ipv6Address p_sourceAddress, in template (value) Ipv6Address p_destinationAddress, in template (value) integer p_payloadLength, - in template (value) octetstring p_payload, + in template (value) GnRawPayload p_payload, in template (value) UInt8 p_nextHdr ) return Oct2 { var Oct2 v_checksum := 'FFFF'O; @@ -761,7 +754,7 @@ module LibItsIpv6OverGeoNetworking_Functions { in template (value) Ipv6Address p_sourceAddress, in template (value) Ipv6Address p_destinationAddress, in template (value) integer p_payloadLength, - in template (value) octetstring p_payload, + in template (value) GnRawPayload p_payload, in template (value) UInt8 p_nextHdr ) return Oct2; diff --git a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Templates.ttcn b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Templates.ttcn index f418957c..c70e6a2d 100644 --- a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Templates.ttcn +++ b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Templates.ttcn @@ -65,23 +65,23 @@ module LibItsIpv6OverGeoNetworking_Templates { group ipv6 { - /** - * @desc Send template for GN6 payload of type IPv6 - * @param p_ipv6Packet IPv6 packet to be used as GN6 payload - */ - template (value) Payload m_ipv6Payload(in template (value) Ipv6Packet p_ipv6Packet) := { - decodedPayload := {ipv6Packet := p_ipv6Packet}, - rawPayload := ''O - } - - /** - * @desc Receive template for GN6 payload of type IPv6 - * @param p_ipv6Packet Expected IPv6 packet to be received as GN6 payload - */ - template (present) Payload mw_ipv6Payload(in template (present) Ipv6Packet p_ipv6Packet) := { - decodedPayload := {ipv6Packet := p_ipv6Packet}, - rawPayload := ? - } +// /** +// * @desc Send template for GN6 payload of type IPv6 +// * @param p_ipv6Packet IPv6 packet to be used as GN6 payload +// */ +// template (value) Payload m_ipv6Payload(in template (value) Ipv6Packet p_ipv6Packet) := { +// decodedPayload := {ipv6Packet := p_ipv6Packet}, +// rawPayload := ''O +// } +// +// /** +// * @desc Receive template for GN6 payload of type IPv6 +// * @param p_ipv6Packet Expected IPv6 packet to be received as GN6 payload +// */ +// template (present) Payload mw_ipv6Payload(in template (present) Ipv6Packet p_ipv6Packet) := { +// decodedPayload := {ipv6Packet := p_ipv6Packet}, +// rawPayload := ? +// } /** * @desc Send template for IPv6 packet diff --git a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TypesAndValues.ttcn b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TypesAndValues.ttcn index 299f5230..81561cd1 100644 --- a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TypesAndValues.ttcn +++ b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TypesAndValues.ttcn @@ -99,7 +99,9 @@ module LibItsIpv6OverGeoNetworking_TypesAndValues { Ipv6Header ipv6Hdr, ExtensionHeaderList extHdrList optional, Ipv6Payload ipv6Payload optional - } + } with { + variant "FIELDORDER(msb)" + } /** * @desc Derived from RFC 2460 Section 3 @@ -308,5 +310,6 @@ module LibItsIpv6OverGeoNetworking_TypesAndValues { } with { + variant "" encode "LibItsIpv6OverGeoNetworking" } \ No newline at end of file -- GitLab From dcffd4b8f2308c5a4d073a6ca18fa7f0ecc5d54b Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 4 Sep 2017 08:20:28 +0000 Subject: [PATCH 022/320] Start testing DENM --- ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn b/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn index b6c42160..87ef8fc9 100644 --- a/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn +++ b/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn @@ -6,16 +6,16 @@ module LibItsDenm_EncdecDeclarations { external function fx_enc_DenmReq (DenmReq p) return bitstring with {extension "prototype(convert) encode(LibIts_Interface)"} + external function fx_dec_DenmReq (inout bitstring b, out DenmReq p) return integer + with {extension "prototype(sliding) decode(LibIts_Interface)"} + external function fx_dec_DenmInd (inout bitstring b, out DenmInd p) return integer with {extension "prototype(sliding) decode(LibIts_Interface)"} external function fx_enc_DENM (DENM p) return bitstring - with {extension "prototype(convert) encode(BER:BER_ENCODE_CER)"} -// with {extension "prototype(convert) encode(PER)"} + with {extension "prototype(convert) encode(PER)"} external function fx_dec_DENM (inout bitstring b, out DENM p) return integer - with {extension "prototype(sliding) decode(BER:BER_ENCODE_CER)"} -// with {extension "prototype(sliding) encode(PER)"} - + with {extension "prototype(sliding) decode(PER)"} } // End of module LibItsDenm_EncdecDeclarations -- GitLab From 3c7286f492ce202789f3d2fc483e0840f20fd9dc Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 12 Sep 2017 07:48:50 +0000 Subject: [PATCH 023/320] Start UpperTester changes --- ...ibItsGeoNetworking_EncdecDeclarations.ttcn | 3 + .../LibItsGeoNetworking_Functions.ttcn | 6 +- .../LibItsGeoNetworking_Templates.ttcn | 4 +- .../LibItsGeoNetworking_TestSystem.ttcn | 4 +- .../LibItsGeoNetworking_TypesAndValues.ttcn | 60 ++++++++++++++----- 5 files changed, 56 insertions(+), 21 deletions(-) diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_EncdecDeclarations.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_EncdecDeclarations.ttcn index f80507c3..febc184c 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_EncdecDeclarations.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_EncdecDeclarations.ttcn @@ -35,4 +35,7 @@ module LibItsGeoNetworking_EncdecDeclarations { with {extension "prototype(sliding) decode(LibItsSecurity)"} */ + external function fx_enc_UtGnInitialize (UtGnInitialize p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + } // End of module LibItsGeoNetworking_EncdecDeclarations diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn index 24e2eaf1..363fc3df 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn @@ -46,7 +46,7 @@ module LibItsGeoNetworking_Functions { * @desc Requests to bring the IUT in an initial state * @param p_init The initialisation to trigger. */ - function f_utInitializeIut(template (value) UtInitialize p_init) runs on ItsBaseGeoNetworking { + function f_utInitializeIut(template (value) UtGnInitialize p_init) runs on ItsBaseGeoNetworking { //deactivate gnPort default alts vc_gnDefaultActive := false; @@ -54,7 +54,7 @@ module LibItsGeoNetworking_Functions { utPort.send(p_init); tc_wait.start; alt { - [] utPort.receive(UtInitializeResult:true) { + [] utPort.receive(UtGnResults: { utGnInitializeResult := true }) { tc_wait.stop; log("*** f_utInitializeIut: INFO: IUT initialized ***"); } @@ -2885,4 +2885,4 @@ module LibItsGeoNetworking_Functions { } -} // end LibItsGeoNetworking_Functions \ No newline at end of file +} // end LibItsGeoNetworking_Functions diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn index 2bf3b3d8..07f48b6e 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn @@ -97,7 +97,7 @@ module LibItsGeoNetworking_Templates { /** * @desc Initializes the GN IUT. */ - template (value) UtInitialize m_gnInitialize := { + template (value) UtGnInitialize m_gnInitialize := { hashedId8 := '0000000000000000'O } @@ -2283,4 +2283,4 @@ module LibItsGeoNetworking_Templates { } // end geoMiscTemplates -} // end ItsGeoNetworking_Templates \ No newline at end of file +} // end ItsGeoNetworking_Templates diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn index 919713c5..ca8c476e 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn @@ -50,11 +50,11 @@ module LibItsGeoNetworking_TestSystem { */ type port UpperTesterPort message { out - UtInitialize, UtChangePosition, UtAutoInteropTrigger, UtGnTrigger; + UtGnInitialize, UtChangePosition, UtAutoInteropTrigger, UtGnTrigger; in //FIXME RGY As discussed, boolean results are replaced by a top-level union of results // UtInitializeResult, UtChangePositionResult, UtGnTriggerResult, UtGnEventInd; - UtCommonResults, UtGnTriggerResult, UtGnEventInd; + UtGnResults, /*UtCommonResults,*/ UtGnTriggerResult, UtGnEventInd; } // end UpperTesterPort } // end portDefinitions diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn index cdf63132..01cfd2c1 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn @@ -929,16 +929,41 @@ module LibItsGeoNetworking_TypesAndValues { group utPrimitives { + /** + * @desc Upper Tester message to initialize IUT + * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use + */ + type record UtGnInitialize { + Oct8 hashedId8 + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Upper Tester results message of the GeoNetworking + * @member utGnInitialize - + * @member utGnTriggerResult - + * @member utAutoInteropTriggerResult - + + */ + type union UtGnResults { + boolean utGnInitializeResult, + boolean utGnTriggerResult, + boolean utAutoInteropTriggerResult + } with { + variant "" + } // End of type UtGnResults + /** * @desc AutoInterop UpperTester trigger * @member utRadioOnOff Set to true to power on the radio (on-link mode), false to power off the radio (off-link). */ type union UtAutoInteropTrigger { boolean utRadioOnOff + } with { + variant "" } // End of type UtAutoInteropTrigger - type boolean UtAutoInteropTriggerResult; - /** * @desc UT primitives for GeoNetworking * @member geoUnicast - @@ -955,6 +980,8 @@ module LibItsGeoNetworking_TypesAndValues { GenerateGeoAnycastMessage geoAnycast, GenerateSHBMessage shb, GenerateTSBMessage tsb + } with { + variant "" } type boolean UtGnTriggerResult; @@ -971,8 +998,8 @@ module LibItsGeoNetworking_TypesAndValues { UInt16 lifetime, TrafficClass trafficClass, GnRawPayload payload - } with { - encode (payload) "UpperTester" + } with { + variant "FIELDORDER(msb)" } /** @@ -990,8 +1017,8 @@ module LibItsGeoNetworking_TypesAndValues { UInt24 reserved, Area area, GnRawPayload payload - } with { - encode (payload) "UpperTester" + } with { + variant "FIELDORDER(msb)" } /** @@ -1008,7 +1035,7 @@ module LibItsGeoNetworking_TypesAndValues { TrafficClass trafficClass, GnRawPayload payload } with { - encode (payload) "UpperTester" + variant "FIELDORDER(msb)" } /** @@ -1024,7 +1051,7 @@ module LibItsGeoNetworking_TypesAndValues { TrafficClass trafficClass, GnRawPayload payload } with { - encode (payload) "UpperTester" + variant "FIELDORDER(msb)" } /** @@ -1033,6 +1060,8 @@ module LibItsGeoNetworking_TypesAndValues { type record UtGnEventInd { // GeoNetworkingPdu gnPdu GnRawPayload rawPayload + } with { + variant "FIELDORDER(msb)" } /** @@ -1042,9 +1071,8 @@ module LibItsGeoNetworking_TypesAndValues { } // end utPrimitives with { -//FIXME RGY temporarily changed to RAW, until encoding functions are changed to UpperTester -// encode "UpperTester" - encode "RAW"; variant "" + encode "UpperTester"; + variant "" } group acPrimitives { @@ -1067,6 +1095,8 @@ module LibItsGeoNetworking_TypesAndValues { AcStartBeaconingMultipleNeighbour startBeaconingMultipleNeighbour, AcStopBeaconingMultipleNeighbour stopBeaconingMultipleNeighbour, AcGetLongPosVector getLongPosVector + } with { + variant "" } /** @@ -1078,8 +1108,9 @@ module LibItsGeoNetworking_TypesAndValues { AcGnResponseFailure failure } with { + variant "" encode(getLongPosVector) "LibItsGeoNetworking" - }; + } type record AcGnResponseFailure { boolean failure @@ -1094,7 +1125,7 @@ module LibItsGeoNetworking_TypesAndValues { } with { encode(beaconPacket) "LibItsGeoNetworking" - }; + } /** * @desc Primitive for TA to stop sending beacons for the test component @@ -1151,7 +1182,8 @@ module LibItsGeoNetworking_TypesAndValues { } // end acPrimitives with { - encode "AdapterControl" + variant "" + encode "AdapterControl" } } with { -- GitLab From 858d5f2d3ba56e486eae0d90a6cc211e983eaeaa Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 14 Sep 2017 15:13:49 +0000 Subject: [PATCH 024/320] Start UpperTester changes --- ttcn/BTP/LibItsBtp_Functions.ttcn | 10 +- ttcn/BTP/LibItsBtp_Templates.ttcn | 4 +- ttcn/BTP/LibItsBtp_TestSystem.ttcn | 6 +- ttcn/BTP/LibItsBtp_TypesAndValues.ttcn | 256 +- ttcn/CAM/LibItsCam_Functions.ttcn | 28 +- ttcn/CAM/LibItsCam_Templates.ttcn | 2 +- ttcn/CAM/LibItsCam_TestSystem.ttcn | 6 +- ttcn/CAM/LibItsCam_TypesAndValues.ttcn | 249 +- ttcn/Common/LibItsCommon_TypesAndValues.ttcn | 91 - ttcn/DENM/LibItsDenm_Functions.ttcn | 42 +- ttcn/DENM/LibItsDenm_Templates.ttcn | 6 +- ttcn/DENM/LibItsDenm_TestSystem.ttcn | 8 +- ttcn/DENM/LibItsDenm_TypesAndValues.ttcn | 305 +- ...ibItsGeoNetworking_EncdecDeclarations.ttcn | 8 +- .../LibItsGeoNetworking_Functions.ttcn | 5262 ++++++++--------- .../LibItsGeoNetworking_Templates.ttcn | 2 +- .../LibItsGeoNetworking_TestSystem.ttcn | 6 +- .../LibItsGeoNetworking_TypesAndValues.ttcn | 2110 +++---- ttcn/Security/LibItsSecurity_Templates.ttcn | 7 +- 19 files changed, 4215 insertions(+), 4193 deletions(-) diff --git a/ttcn/BTP/LibItsBtp_Functions.ttcn b/ttcn/BTP/LibItsBtp_Functions.ttcn index 86f2218e..47795723 100644 --- a/ttcn/BTP/LibItsBtp_Functions.ttcn +++ b/ttcn/BTP/LibItsBtp_Functions.ttcn @@ -33,7 +33,7 @@ * @desc Requests to bring the IUT in an initial state * @param p_init The initialisation to trigger. */ - function f_utInitializeIut(template (value) UtInitialize p_init) runs on ItsBtp { + function f_utInitializeIut(template (value) UtBtpInitialize p_init) runs on ItsBtp { //deactivate btpPort default alts vc_btpDefaultActive := false; @@ -41,9 +41,7 @@ utPort.send(p_init); tc_wait.start; alt { -//FIXME RGY As discussed, port in type is changed to a top-level union type -// [] utPort.receive(UtInitializeResult:true) { - [] utPort.receive(UtCommonResults:{utInitializeResult:=true}) { + [] utPort.receive(UtBtpResults: { utBtpInitializeResult := true}) { tc_wait.stop; log("*** f_utInitializeIut: INFO: IUT initialized ***"); } @@ -74,7 +72,7 @@ utPort.send(p_event); alt { - [] utPort.receive(UtBtpTriggerResult:true) { + [] utPort.receive(UtBtpResults: { utBtpTriggerResult := true }) { tc_wait.stop; } [] utPort.receive { @@ -239,4 +237,4 @@ } } // end getFunctions -} // end LibItsBtp_Functions \ No newline at end of file +} // end LibItsBtp_Functions diff --git a/ttcn/BTP/LibItsBtp_Templates.ttcn b/ttcn/BTP/LibItsBtp_Templates.ttcn index a64fa437..255d771b 100644 --- a/ttcn/BTP/LibItsBtp_Templates.ttcn +++ b/ttcn/BTP/LibItsBtp_Templates.ttcn @@ -44,7 +44,7 @@ module LibItsBtp_Templates { /** * @desc Initializes the BTP IUT. */ - template (value) UtInitialize m_btpInitialize := { + template (value) UtBtpInitialize m_btpInitialize := { hashedId8 := '0000000000000000'O } @@ -201,4 +201,4 @@ module LibItsBtp_Templates { } // end btpPduTemplates -} // end LibItsBtp_Templates \ No newline at end of file +} // end LibItsBtp_Templates diff --git a/ttcn/BTP/LibItsBtp_TestSystem.ttcn b/ttcn/BTP/LibItsBtp_TestSystem.ttcn index cc4b320f..d3830515 100644 --- a/ttcn/BTP/LibItsBtp_TestSystem.ttcn +++ b/ttcn/BTP/LibItsBtp_TestSystem.ttcn @@ -27,11 +27,9 @@ module LibItsBtp_TestSystem { */ type port UpperTesterPort message { out - UtInitialize, UtBtpTrigger; + UtBtpInitialize, UtBtpTrigger; in -//FIXME RGY!!! As discussed, list of booleans is changed by a top-level union type -// UtInitializeResult, UtBtpTriggerResult, UtBtpEventInd; - UtCommonResults, UtBtpTriggerResult, UtBtpEventInd; + UtBtpResults, UtBtpEventInd; } // end UpperTesterPort } // end portDefinitions diff --git a/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn b/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn index 309236d1..088eed79 100644 --- a/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn +++ b/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn @@ -11,147 +11,169 @@ */ module LibItsBtp_TypesAndValues { - // LibCommon - import from LibCommon_BasicTypesAndValues all; + // LibCommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; - type octetstring BtpRawPayload; + type octetstring BtpRawPayload; - group btpPdus { + group btpPdus { - /** - * @desc BTP Packet - * @see ETSI TS 102 636-5-1 chapter 6 - * @member header - * @member payload - */ - type record BtpPacket { - BtpHeader header, - BtpRawPayload payload optional - } - with { - variant "FIELDORDER(msb)" - encode "LibIts_Interface" - } + /** + * @desc BTP Packet + * @see ETSI TS 102 636-5-1 chapter 6 + * @member header + * @member payload + */ + type record BtpPacket { + BtpHeader header, + BtpRawPayload payload optional + } + with { + variant "FIELDORDER(msb)" + encode "LibIts_Interface" + } - } // end btpPdus + } // end btpPdus - group btpHeaders { + group btpHeaders { - /** - * @desc BTP Header - * @see ETSI TS 102 636-5-1 chapter 7.1 - * @member btpAHeader - * @member btpBHeader - */ - type union BtpHeader { - BtpAHeader btpAHeader, - BtpBHeader btpBHeader - } with { - variant "FIELDORDER(msb)" - } + /** + * @desc BTP Header + * @see ETSI TS 102 636-5-1 chapter 7.1 + * @member btpAHeader + * @member btpBHeader + */ + type union BtpHeader { + BtpAHeader btpAHeader, + BtpBHeader btpBHeader + } with { + variant "FIELDORDER(msb)" + } - /** - * @desc BTP-A Header - * @see ETSI TS 102 636-5-1 chapter 7.2 - * @member destinationPort - * @member sourcePort - */ - type record BtpAHeader { - BtpPortId destinationPort, - BtpPortId sourcePort - } with { - variant "FIELDORDER(msb)" - } + /** + * @desc BTP-A Header + * @see ETSI TS 102 636-5-1 chapter 7.2 + * @member destinationPort + * @member sourcePort + */ + type record BtpAHeader { + BtpPortId destinationPort, + BtpPortId sourcePort + } with { + variant "FIELDORDER(msb)" + } - /** - * @desc BTP-B Header - * @see ETSI TS 102 636-5-1 chapter 7.3 - * @member destinationPort - * @member destinationPortInfo - */ - type record BtpBHeader { - BtpPortId destinationPort, - BtpPortInfo destinationPortInfo - } with { - variant "FIELDORDER(msb)" - } + /** + * @desc BTP-B Header + * @see ETSI TS 102 636-5-1 chapter 7.3 + * @member destinationPort + * @member destinationPortInfo + */ + type record BtpBHeader { + BtpPortId destinationPort, + BtpPortInfo destinationPortInfo + } with { + variant "FIELDORDER(msb)" + } - /** - * @desc BTP Port ID - * @see ETSI TS 102 636-5-1 chapter 7.3.2 - */ - type UInt16 BtpPortId; + /** + * @desc BTP Port ID + * @see ETSI TS 102 636-5-1 chapter 7.3.2 + */ + type UInt16 BtpPortId; - /** - * @desc BTP-B Port info - * @see ETSI TS 102 636-5-1 chapter 7.3.2 - */ - type UInt16 BtpPortInfo; + /** + * @desc BTP-B Port info + * @see ETSI TS 102 636-5-1 chapter 7.3.2 + */ + type UInt16 BtpPortInfo; - } // end btpHeaders + } // end btpHeaders - group utPrimitives { + group utPrimitives { - group utCommonPrimitives { + group utCommonPrimitives { - /** - * @desc UT primitives for BTP - * @member btpA - - * @member btpB - - */ - type union UtBtpTrigger { - GenerateBtpA btpA, - GenerateBtpB btpB - } - -//FIXME RGY As discussed, boolean results are replaced by a union of the results -// type boolean UtBtpTriggerResult; - type union UtBtpResults { - boolean utBtpTriggerResult - } - type UtBtpResults.utBtpTriggerResult UtBtpTriggerResult; + /** + * @desc Upper Tester message to initialize IUT + * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use + */ + type record UtBtpInitialize { + Oct8 hashedId8 + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Upper Tester results message of the Btp IUT + * @member utBtpInitialize - + * @member utBtpTriggerResult - + */ + type union UtBtpResults { + boolean utBtpInitializeResult, + boolean utBtpTriggerResult + } with { + variant "" + } - /** - * @desc Upper Tester message to request triggering of an BTPA message at IUT - */ - type record GenerateBtpA { - BtpAHeader btpAHeader - } + /** + * @desc UT primitives for BTP + * @member btpA - + * @member btpB - + */ + type union UtBtpTrigger { + GenerateBtpA btpA, + GenerateBtpB btpB + } with { + variant "" + } + + /** + * @desc Upper Tester message to request triggering of an BTPA message at IUT + */ + type record GenerateBtpA { + BtpAHeader btpAHeader + } with { + variant "FIELDORDER(msb)" + } - /** - * @desc Upper Tester message to request triggering of an BTPB message at IUT - */ - type record GenerateBtpB { - BtpBHeader btpBHeader - } + /** + * @desc Upper Tester message to request triggering of an BTPB message at IUT + */ + type record GenerateBtpB { + BtpBHeader btpBHeader + } with { + variant "FIELDORDER(msb)" + } - /** - * @desc Upper Tester message to check event/status on BTP IUT - */ - type record UtBtpEventInd { - BtpRawPayload rawPayload - } + /** + * @desc Upper Tester message to check event/status on BTP IUT + */ + type record UtBtpEventInd { + BtpRawPayload rawPayload + } with { + variant "FIELDORDER(msb)" + } - /** - * @desc List of Upper Tester messages to check event/status on CAM IUT - */ - type record of UtBtpEventInd UtBtpEventIndList; - } -// with { -// encode "LibItsCommon" -// } + /** + * @desc List of Upper Tester messages to check event/status on CAM IUT + */ + type record of UtBtpEventInd UtBtpEventIndList; + } - } // end utPrimitives - with { - encode "UpperTester" - } + } // end utPrimitives + with { + variant "" + encode "UpperTester" + } } with { - variant "" - encode "LibItsGeoNetworking" + variant "" + encode "LibItsGeoNetworking" } diff --git a/ttcn/CAM/LibItsCam_Functions.ttcn b/ttcn/CAM/LibItsCam_Functions.ttcn index aadbf34f..2a6e5b8e 100644 --- a/ttcn/CAM/LibItsCam_Functions.ttcn +++ b/ttcn/CAM/LibItsCam_Functions.ttcn @@ -41,7 +41,7 @@ module LibItsCam_Functions { * @desc Requests to bring the IUT in an initial state * @param p_init The initialisation to trigger. */ - function f_utInitializeIut(template (value) UtInitialize p_init) runs on ItsCam { + function f_utInitializeIut(template (value) UtCamInitialize p_init) runs on ItsCam { //deactivate camPort default alts vc_camDefaultActive := false; @@ -49,9 +49,7 @@ module LibItsCam_Functions { utPort.send(p_init); tc_wait.start; alt { -//FIXME RGY As discussed, port in type is changed to a top-level union type -// [] utPort.receive(UtInitializeResult:true) { - [] utPort.receive(UtCommonResults:{utInitializeResult:=true}) { + [] utPort.receive(UtCamResults: { utCamInitializeResult := true }) { tc_wait.stop; log("*** f_utInitializeIut: INFO: IUT initialized ***"); } @@ -83,9 +81,7 @@ module LibItsCam_Functions { utPort.send(p_event); tc_wait.start; alt { -//FIXME RGY As discussed, port in type is changed to a top-level union type -// [] utPort.receive(UtCamTriggerResult:true) { - [] utPort.receive(UpperTesterCamResults:{utCamTriggerResult:=true}) { + [] utPort.receive(UtCamResults: { utCamTriggerResult := true }) { tc_wait.stop; } [] utPort.receive { @@ -104,20 +100,22 @@ module LibItsCam_Functions { * @desc Changes the position of the IUT * @param p_position */ - function f_utChangePosition(template (value) UtChangePosition p_position) runs on ItsCam { + function f_utChangePosition(template (value) UtCamChangePosition p_position) runs on ItsCam { //deactivate camPort default alts vc_camDefaultActive := false; utPort.send(p_position); alt { -//FIXME RGY As discussed, port in type is changed to a top-level union type -// [] utPort.receive(UtChangePositionResult:?) { - [] utPort.receive(UtCommonResults:{utChangePositionResult:=?}) { + [] utPort.receive(UtCamResults: { utCamChangePositionResult := true}) { tc_wait.stop; } - [] utPort.receive { - tc_wait.stop; + [] utPort.receive(UtCamResults: { utCamChangePositionResult := false }) { + tc_wait.stop; + log("*** f_utChangePosition: INFO: IUT position change was not successful ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] a_utDefault() { } [] tc_wait.timeout { log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); @@ -391,7 +389,7 @@ module LibItsCam_Functions { function f_prInitialState( in Scenario p_scenario := e_staticPosition, in boolean p_awaitInitialCAM := true, - in template (value) UtInitialize p_camInitialize := m_camInitialize + in template (value) UtCamInitialize p_camInitialize := m_camInitialize ) runs on ItsCam { f_utInitializeIut(p_camInitialize); @@ -503,4 +501,4 @@ module LibItsCam_Functions { } } // end of group camGenerators -} // end LibItsCam_Functions \ No newline at end of file +} // end LibItsCam_Functions diff --git a/ttcn/CAM/LibItsCam_Templates.ttcn b/ttcn/CAM/LibItsCam_Templates.ttcn index 7f8793b3..57b6b5a7 100644 --- a/ttcn/CAM/LibItsCam_Templates.ttcn +++ b/ttcn/CAM/LibItsCam_Templates.ttcn @@ -119,7 +119,7 @@ module LibItsCam_Templates { /** * @desc Initializes the CAM IUT. */ - template (value) UtInitialize m_camInitialize := { + template (value) UtCamInitialize m_camInitialize := { hashedId8 := '0000000000000000'O } diff --git a/ttcn/CAM/LibItsCam_TestSystem.ttcn b/ttcn/CAM/LibItsCam_TestSystem.ttcn index 0acc5fa7..404aeb8a 100644 --- a/ttcn/CAM/LibItsCam_TestSystem.ttcn +++ b/ttcn/CAM/LibItsCam_TestSystem.ttcn @@ -47,11 +47,9 @@ module LibItsCam_TestSystem { */ type port UpperTesterPort message { out - UtInitialize, UtCamTrigger, UtChangePosition, UtActivatePositionTime, UtDeactivatePositionTime; + UtCamInitialize, UtCamTrigger, UtCamChangePosition, UtActivatePositionTime, UtDeactivatePositionTime; in -//FIXME RGY As discussed, list of boolean result responses is collected into a top-level union -// UtInitializeResult, UtCamTriggerResult, UtChangePositionResult, UtActivatePositionTimeResult, UtDeactivatePositionTimeResult, UtCamEventInd; - UtCommonResults, UpperTesterCamResults, UtCamEventInd; + UtCamResults, UtCamEventInd; } // end UpperTesterPort } // end portDefinitions diff --git a/ttcn/CAM/LibItsCam_TypesAndValues.ttcn b/ttcn/CAM/LibItsCam_TypesAndValues.ttcn index 35fe1f0b..ff19154f 100644 --- a/ttcn/CAM/LibItsCam_TypesAndValues.ttcn +++ b/ttcn/CAM/LibItsCam_TypesAndValues.ttcn @@ -11,125 +11,174 @@ */ module LibItsCam_TypesAndValues { - // LibCommon - import from LibCommon_BasicTypesAndValues all; -// import from LibCommon_DataStrings all; + // LibCommon + 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; -// import from DENM_PDU_Descriptions language "ASN.1:1997" all; + // LibIts + import from ITS_Container language "ASN.1:1997" all; + import from CAM_PDU_Descriptions language "ASN.1:1997" all; + // import from DENM_PDU_Descriptions language "ASN.1:1997" all; - group camValues { + group camValues { - const float c_lowFrequencyGenerationTime := 0.5; //500 ms - const float c_specialVehicleGenerationTime := 0.5; //500 ms + const float c_lowFrequencyGenerationTime := 0.5; //500 ms + const float c_specialVehicleGenerationTime := 0.5; //500 ms - const AccelerationControl c_accCtrlIdle := '0000000'B; + const AccelerationControl c_accCtrlIdle := '0000000'B; - const ExteriorLights c_elAllLightsOff := '00000000'B; + const ExteriorLights c_elAllLightsOff := '00000000'B; - const VehicleRole c_vehicleRole_publicTransport := publicTransport; - const VehicleRole c_vehicleRole_specialTransport := specialTransport; - const VehicleRole c_vehicleRole_dangerousGoods := dangerousGoods; - const VehicleRole c_vehicleRole_roadWork := roadWork; - const VehicleRole c_vehicleRole_rescue := rescue; - const VehicleRole c_vehicleRole_emergency := emergency; - const VehicleRole c_vehicleRole_safetyCar := safetyCar; + const VehicleRole c_vehicleRole_publicTransport := publicTransport; + const VehicleRole c_vehicleRole_specialTransport := specialTransport; + const VehicleRole c_vehicleRole_dangerousGoods := dangerousGoods; + const VehicleRole c_vehicleRole_roadWork := roadWork; + const VehicleRole c_vehicleRole_rescue := rescue; + const VehicleRole c_vehicleRole_emergency := emergency; + const VehicleRole c_vehicleRole_safetyCar := safetyCar; - const DangerousGoodsBasic c_dangerousGoodsBasic_explosives1 := explosives1; - const DangerousGoodsBasic c_dangerousGoodsBasic_explosives2 := explosives2; - const DangerousGoodsBasic c_dangerousGoodsBasic_explosives3 := explosives3; - const DangerousGoodsBasic c_dangerousGoodsBasic_explosives4 := explosives4; - const DangerousGoodsBasic c_dangerousGoodsBasic_explosives5 := explosives5; - const DangerousGoodsBasic c_dangerousGoodsBasic_explosives6 := explosives6; - const DangerousGoodsBasic c_dangerousGoodsBasic_flammableGases := flammableGases; - const DangerousGoodsBasic c_dangerousGoodsBasic_nonFlammableGases := nonFlammableGases; - const DangerousGoodsBasic c_dangerousGoodsBasic_toxicGases := toxicGases; - const DangerousGoodsBasic c_dangerousGoodsBasic_flammableLiquids := flammableLiquids; - const DangerousGoodsBasic c_dangerousGoodsBasic_flammableSolids := flammableSolids; - const DangerousGoodsBasic c_dangerousGoodsBasic_substancesLiableToSpontaneousCombustion := substancesLiableToSpontaneousCombustion; - const DangerousGoodsBasic c_dangerousGoodsBasic_substancesEmittingFlammableGasesUponContactWithWater := substancesEmittingFlammableGasesUponContactWithWater; - const DangerousGoodsBasic c_dangerousGoodsBasic_oxidizingSubstances := oxidizingSubstances; - const DangerousGoodsBasic c_dangerousGoodsBasic_organicPeroxides := organicPeroxides; - const DangerousGoodsBasic c_dangerousGoodsBasic_toxicSubstances := toxicSubstances; - const DangerousGoodsBasic c_dangerousGoodsBasic_infectiousSubstances := infectiousSubstances; - const DangerousGoodsBasic c_dangerousGoodsBasic_radioactiveMaterial := radioactiveMaterial; - const DangerousGoodsBasic c_dangerousGoodsBasic_corrosiveSubstances := corrosiveSubstances; - const DangerousGoodsBasic c_dangerousGoodsBasic_miscellaneousDangerousSubstances := miscellaneousDangerousSubstances; + const DangerousGoodsBasic c_dangerousGoodsBasic_explosives1 := explosives1; + const DangerousGoodsBasic c_dangerousGoodsBasic_explosives2 := explosives2; + const DangerousGoodsBasic c_dangerousGoodsBasic_explosives3 := explosives3; + const DangerousGoodsBasic c_dangerousGoodsBasic_explosives4 := explosives4; + const DangerousGoodsBasic c_dangerousGoodsBasic_explosives5 := explosives5; + const DangerousGoodsBasic c_dangerousGoodsBasic_explosives6 := explosives6; + const DangerousGoodsBasic c_dangerousGoodsBasic_flammableGases := flammableGases; + const DangerousGoodsBasic c_dangerousGoodsBasic_nonFlammableGases := nonFlammableGases; + const DangerousGoodsBasic c_dangerousGoodsBasic_toxicGases := toxicGases; + const DangerousGoodsBasic c_dangerousGoodsBasic_flammableLiquids := flammableLiquids; + const DangerousGoodsBasic c_dangerousGoodsBasic_flammableSolids := flammableSolids; + const DangerousGoodsBasic c_dangerousGoodsBasic_substancesLiableToSpontaneousCombustion := substancesLiableToSpontaneousCombustion; + const DangerousGoodsBasic c_dangerousGoodsBasic_substancesEmittingFlammableGasesUponContactWithWater := substancesEmittingFlammableGasesUponContactWithWater; + const DangerousGoodsBasic c_dangerousGoodsBasic_oxidizingSubstances := oxidizingSubstances; + const DangerousGoodsBasic c_dangerousGoodsBasic_organicPeroxides := organicPeroxides; + const DangerousGoodsBasic c_dangerousGoodsBasic_toxicSubstances := toxicSubstances; + const DangerousGoodsBasic c_dangerousGoodsBasic_infectiousSubstances := infectiousSubstances; + const DangerousGoodsBasic c_dangerousGoodsBasic_radioactiveMaterial := radioactiveMaterial; + const DangerousGoodsBasic c_dangerousGoodsBasic_corrosiveSubstances := corrosiveSubstances; + const DangerousGoodsBasic c_dangerousGoodsBasic_miscellaneousDangerousSubstances := miscellaneousDangerousSubstances; - } // end group camValues + } // end group camValues - group certificates { + group certificates { - const charstring PX_CERT_IUT_CAM_02 := "CERT_IUT_CAM_BO_02_AT"; - const charstring PX_CERT_IUT_CAM_03 := "CERT_IUT_CAM_BO_03_AT"; + const charstring PX_CERT_IUT_CAM_02 := "CERT_IUT_CAM_BO_02_AT"; + const charstring PX_CERT_IUT_CAM_03 := "CERT_IUT_CAM_BO_03_AT"; - } + } - group utPrimitives { + group utPrimitives { + /** + * @desc Upper Tester message to initialize IUT + * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use + */ + type record UtCamInitialize { + Oct8 hashedId8 + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Upper Tester results message of the CAM IUT + * @member utCamInitialize - + * @member utCamTriggerResult - + * @member utCamChangePositionResult - + * @member utActivatePositionTimeResult - + * @member utDeactivatePositionTimeResult - + */ + type union UtCamResults { + boolean utCamInitializeResult, + boolean utCamTriggerResult, + boolean utCamChangePositionResult, + boolean utActivatePositionTimeResult, + boolean utDeactivatePositionTimeResult + } with { + variant "" + } // End of type UtCamResults + /** - * @desc - * @member changeCurvature Changes the curvature. - * @member changeSpeed Changes the speed in cm/s. - * @member setAccelerationControlStatus Sets the acceleration control status. - * @member setExteriorLightsStatus Sets the exterior lights status. - * @member changeHeading Changes the heading. - * @member setDriveDirection Sets the drive direction. - * @member setStationType - * @member setVehicleRole - * @member setEmbarkationStatus - * @member setPtActivation - * @member setDangerousGoods - * @member setLightBarSireneStatus - * @member changeYawRate Changes the yaw rate in offsets of 0.01 degrees per second. + * @desc Upper Tester message to change the position of IUT. Values a relatives */ - type union UtCamTrigger { - CurvatureValue changeCurvature, - Int16 changeSpeed, - AccelerationControl setAccelerationControlStatus, - ExteriorLights setExteriorLightsStatus, - HeadingValue changeHeading, - DriveDirection setDriveDirection, - YawRateValue changeYawRate, - StationType setStationType, - VehicleRole setVehicleRole, - EmbarkationStatus setEmbarkationStatus, - PtActivation setPtActivation, - DangerousGoodsBasic setDangerousGoods, - LightBarSirenInUse setLightBarSirene - } - - /** - * @desc Upper Tester result message of request of triggering of an event at IUT - */ -//FIXME RGY As discussed, simple boolean responses are collected to a union for forward compatibility -// type boolean UtCamTriggerResult; - type union UpperTesterCamResults { - boolean utCamTriggerResult - } - - type UpperTesterCamResults.utCamTriggerResult UtCamTriggerResult; + type record UtCamChangePosition { + Int32 latitude, + Int32 longitude, + Int32 elevation + } with { + variant "FIELDORDER(msb)" + } - /** - * @desc Upper Tester message to check event/status on CAM IUT - */ - type record UtCamEventInd { - CAM camMsg - } with { - encode (camMsg) "LibItsCam_asn1" - } + /** + * @desc + * @member changeCurvature Changes the curvature. + * @member changeSpeed Changes the speed in cm/s. + * @member setAccelerationControlStatus Sets the acceleration control status. + * @member setExteriorLightsStatus Sets the exterior lights status. + * @member changeHeading Changes the heading. + * @member setDriveDirection Sets the drive direction. + * @member setStationType + * @member setVehicleRole + * @member setEmbarkationStatus + * @member setPtActivation + * @member setDangerousGoods + * @member setLightBarSireneStatus + * @member changeYawRate Changes the yaw rate in offsets of 0.01 degrees per second. + */ + type union UtCamTrigger { + CurvatureValue changeCurvature, + Int16 changeSpeed, + AccelerationControl setAccelerationControlStatus, + ExteriorLights setExteriorLightsStatus, + HeadingValue changeHeading, + DriveDirection setDriveDirection, + YawRateValue changeYawRate, + StationType setStationType, + VehicleRole setVehicleRole, + EmbarkationStatus setEmbarkationStatus, + PtActivation setPtActivation, + DangerousGoodsBasic setDangerousGoods, + LightBarSirenInUse setLightBarSirene + } with { + variant "" + } - /** - * @desc List of Upper Tester messages to check event/status on CAM IUT - */ - type record of UtCamEventInd UtCamEventIndList; + /** + * @desc Upper Tester message to activate position and/or time + */ + type record UtActivatePositionTime { + // empty on purpose + } with { + variant "FIELDORDER(msb)" + } + /** + * @desc Upper Tester message to deactivate position and/or time + */ + type record UtDeactivatePositionTime { + // empty on purpose } with { - encode "UpperTester" + variant "FIELDORDER(msb)" + } + + /** + * @desc Upper Tester message to check event/status on CAM IUT + */ + type record UtCamEventInd { + CAM camMsg + } with { + encode (camMsg) "LibItsCam_asn1" + } + + /** + * @desc List of Upper Tester messages to check event/status on CAM IUT + */ + type record of UtCamEventInd UtCamEventIndList; + + } with { + encode "UpperTester" + variant "" } // end utPrimitives } with { - encode "LibItsCam" -} + encode "LibItsCam" + } diff --git a/ttcn/Common/LibItsCommon_TypesAndValues.ttcn b/ttcn/Common/LibItsCommon_TypesAndValues.ttcn index 911ed5fa..b50f5858 100644 --- a/ttcn/Common/LibItsCommon_TypesAndValues.ttcn +++ b/ttcn/Common/LibItsCommon_TypesAndValues.ttcn @@ -17,98 +17,7 @@ module LibItsCommon_TypesAndValues { // LibIts import from ITS_Container language "ASN.1:1997" all; - group utPrimitives { - - /** - * @desc Upper Tester message to initialize IUT - * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use - */ - type record UtInitialize { - Oct8 hashedId8 - } - - /** - * @desc Upper Tester result message of the initialization request - */ -//FIXME RGY As discussed, Commom top level type for UT results - type union UtCommonResults { - boolean utInitializeResult, - boolean utChangePositionResult, - boolean utChangePseudonymResult, - boolean utActivatePositionTimeResult, - boolean utDeactivatePositionTimeResult, - boolean utIvimTerminationResult - } - -//FIXME RGY As discussed, type is changed to a type derived from UpperTesterResultTypes -// type boolean UtInitializeResult; - type UtCommonResults.utInitializeResult UtInitializeResult; - - /** - * @desc Upper Tester message to change the position of IUT. Values a relatives - */ - type record UtChangePosition { - integer latitude, - integer longitude, - integer elevation - } - - /** - * @desc Upper Tester result message of change position request of IUT - */ -//FIXME RGY As discussed, type is changed to a type derived from UpperTesterResultTypes -// type boolean UtChangePositionResult; - type UtCommonResults.utChangePositionResult UtChangePositionResult; - - /** - * @desc Upper Tester message to change the pseudonym of the DENM IUT - */ - type record UtChangePseudonym { - // empty on purpose - } - - /** - * @desc Upper Tester result message of the change pseudonym request - */ -//FIXME RGY As discussed, type is changed to a type derived from UpperTesterResultTypes -// type boolean UtChangePseudonymResult; - type UtCommonResults.utChangePseudonymResult UtChangePseudonymResult; - - /** - * @desc Upper Tester message to activate position and/or time - */ - type record UtActivatePositionTime { - // empty on purpose - } - - /** - * @desc Upper Tester result message of the activate position and/or time request - */ -//FIXME RGY As discussed, type is changed to a type derived from UpperTesterResultTypes -// type boolean UtActivatePositionTimeResult; - type UtCommonResults.utActivatePositionTimeResult UtActivatePositionTimeResult; - - /** - * @desc Upper Tester message to deactivate position and/or time - */ - type record UtDeactivatePositionTime { - // empty on purpose - } - - /** - * @desc Upper Tester result message of the deactivate position and/or time request - */ -//FIXME RGY As discussed, type is changed to a type derived from UpperTesterResultTypes -// type boolean UtDeactivatePositionTimeResult; - type UtCommonResults.utDeactivatePositionTimeResult UtDeactivatePositionTimeResult; - - } - with { - encode "UpperTester" - } - group acPrimitives { - /** * @desc TA primitives for security support * @member acSetCertificate Primitive used to activate security support diff --git a/ttcn/DENM/LibItsDenm_Functions.ttcn b/ttcn/DENM/LibItsDenm_Functions.ttcn index 7f9859be..6278fbcf 100644 --- a/ttcn/DENM/LibItsDenm_Functions.ttcn +++ b/ttcn/DENM/LibItsDenm_Functions.ttcn @@ -39,7 +39,7 @@ module LibItsDenm_Functions { * @desc Requests to bring the IUT in an initial state * @param p_init The initialisation to trigger. */ - function f_utInitializeIut(template (value) UtInitialize p_init) runs on ItsDenm { + function f_utInitializeIut(template (value) UtDenmInitialize p_init) runs on ItsDenm { //deactivate denmPort default alts vc_denmDefaultActive := false; @@ -47,9 +47,7 @@ module LibItsDenm_Functions { utPort.send(p_init); tc_wait.start; alt { -//FIXME RGY As discussed, port in type is changed to a top-level union type -// [] utPort.receive(UtInitializeResult:true) { - [] utPort.receive(UtCommonResults:{utInitializeResult:=true}) { + [] utPort.receive(UtDenmResults: { utDenmInitializeResult := true }) { tc_wait.stop; log("*** " & testcasename() & ": INFO: IUT initialized ***"); } @@ -79,15 +77,11 @@ module LibItsDenm_Functions { utPort.send(p_change); tc_wait.start; alt { -//FIXME RGY As discussed, port in type is changed to a top-level union type -// [] utPort.receive(UtChangePseudonymResult:true) { - [] utPort.receive(UtCommonResults:{utChangePseudonymResult:=true}) { + [] utPort.receive(UtDenmResults: { utChangePseudonymResult := true}) { tc_wait.stop; log("*** " & testcasename() & ": INFO: IUT pseudonym changed ***"); } -//FIXME RGY As discussed, port in type is changed to a top-level union type -// [] utPort.receive(UtChangePseudonymResult:false) { - [] utPort.receive(UtCommonResults:{utChangePseudonymResult:=false}) { + [] utPort.receive(UtDenmResults: { utChangePseudonymResult := false}) { tc_wait.stop; log("*** " & testcasename() & ": INFO: IUT pseudonym changed ***"); f_selfOrClientSyncAndVerdict("error", e_error); @@ -112,7 +106,7 @@ module LibItsDenm_Functions { */ function f_utTriggerEvent(template (value) UtDenmTrigger p_event) runs on ItsDenm return ActionID { var ActionID v_actionId; - var UtDenmTriggerResult v_result; + var UtDenmResults v_result; //deactivate denmPort default alts vc_denmDefaultActive := false; @@ -120,10 +114,10 @@ module LibItsDenm_Functions { utPort.send(p_event); tc_wait.start; alt { - [] utPort.receive(UtDenmTriggerResult:?) -> value v_result { + [] utPort.receive(UtDenmResults: { utDenmTriggerResult := ? }) -> value v_result { tc_wait.stop; - v_actionId := v_result.actionId; - if ( not v_result.result ) { + v_actionId := v_result.utDenmTriggerResult.actionId; + if ( not v_result.utDenmTriggerResult.result ) { f_selfOrClientSyncAndVerdict("DENM Trigger failed", e_error); } } @@ -148,7 +142,7 @@ module LibItsDenm_Functions { */ function f_utUpdateEvent(template (value) UtDenmUpdate p_event) runs on ItsDenm return ActionID { var ActionID v_actionId; - var UtDenmUpdateResult v_result; + var UtDenmResults v_result; //deactivate denmPort default alts vc_denmDefaultActive := false; @@ -156,9 +150,9 @@ module LibItsDenm_Functions { utPort.send(p_event); tc_wait.start; alt { - [] utPort.receive(UtDenmUpdateResult:?) -> value v_result { + [] utPort.receive(UtDenmResults: { utDenmUpdateResult := ? }) -> value v_result { tc_wait.stop; - v_actionId := v_result.actionId; + v_actionId := v_result.utDenmUpdateResult.actionId; } [] a_utDefault() { //empty on purpose @@ -187,9 +181,7 @@ module LibItsDenm_Functions { utPort.send(p_event); tc_wait.start; alt { -//FIXME RGY As discussed, port in type is changed to a top-level union type -// [] utPort.receive(UtDenmTerminationResult:?) { - [] utPort.receive(UtDENMResults:{utDenmTerminationResult:=?}) { + [] utPort.receive(UtDenmResults: { utDenmTerminationResult := ?}) { tc_wait.stop; } [] tc_wait.timeout { @@ -212,7 +204,7 @@ module LibItsDenm_Functions { * @param p_longitude * @param p_elevation */ - function f_utChangePosition(template (value) UtChangePosition p_position) runs on ItsDenm { + function f_utChangePosition(template (value) UtDenmChangePosition p_position) runs on ItsDenm { //deactivate denmPort default alts vc_denmDefaultActive := false; @@ -220,9 +212,7 @@ module LibItsDenm_Functions { utPort.send(p_position); tc_wait.start; alt { -//FIXME RGY As discussed, port in type is changed to a top-level union type -// [] utPort.receive(UtChangePositionResult:?) { - [] utPort.receive(UtCommonResults:{utChangePositionResult:=?}) { + [] utPort.receive(UtDenmResults: { utDenmChangePositionResult := ? }) { tc_wait.stop; } [] tc_wait.timeout { @@ -490,7 +480,7 @@ module LibItsDenm_Functions { */ function f_prInitialState( in Scenario p_scenario := e_staticPosition, - in template (value) UtInitialize p_denmInitialize := m_denmInitialize + in template (value) UtDenmInitialize p_denmInitialize := m_denmInitialize ) runs on ItsDenm return FncRetCode { var FncRetCode v_ret := e_success; @@ -605,4 +595,4 @@ module LibItsDenm_Functions { } // end group miscellaneousFunctions -} // end LibItsDenm_Functions \ No newline at end of file +} // end LibItsDenm_Functions diff --git a/ttcn/DENM/LibItsDenm_Templates.ttcn b/ttcn/DENM/LibItsDenm_Templates.ttcn index 70e1d7fb..572f2533 100644 --- a/ttcn/DENM/LibItsDenm_Templates.ttcn +++ b/ttcn/DENM/LibItsDenm_Templates.ttcn @@ -139,7 +139,7 @@ module LibItsDenm_Templates { /** * @desc Send template for Upper Tester event initialization */ - template (value) UtInitialize m_denmInitialize := { + template (value) UtDenmInitialize m_denmInitialize := { hashedId8 := '0000000000000000'O } @@ -231,7 +231,7 @@ module LibItsDenm_Templates { * @param p_longitude The new longitude * @param p_elevation The new elevation (Default: 0) */ - template (value) UtChangePosition m_utChangePosition( + template (value) UtDenmChangePosition m_utChangePosition( template (value) integer p_latitude, template (value) integer p_longitude, template (value) integer p_elevation := 0 @@ -829,4 +829,4 @@ module LibItsDenm_Templates { template (present) bitstring mw_sspNoRoadworks := '*0??'B; } // end sspTemplates -} // end LibItsDenmTemplates \ No newline at end of file +} // end LibItsDenmTemplates diff --git a/ttcn/DENM/LibItsDenm_TestSystem.ttcn b/ttcn/DENM/LibItsDenm_TestSystem.ttcn index e6be9244..13bbf908 100644 --- a/ttcn/DENM/LibItsDenm_TestSystem.ttcn +++ b/ttcn/DENM/LibItsDenm_TestSystem.ttcn @@ -47,13 +47,9 @@ module LibItsDenm_TestSystem { */ type port UpperTesterPort message { out - UtInitialize, UtDenmTrigger, UtDenmUpdate, UtDenmTermination, UtChangePosition, UtChangePseudonym; + UtDenmInitialize, UtDenmTrigger, UtDenmUpdate, UtDenmTermination, UtDenmChangePosition, UtChangePseudonym; in -//FIXME RGY! As discussed, list of booleans is changed by a top-level union type -// UtInitializeResult, UtDenmTriggerResult, UtDenmUpdateResult, UtDenmTerminationResult, -// UtChangePositionResult, UtChangePseudonymResult, UtDenmEventInd; - UtCommonResults, UtDENMResults, UtDenmTriggerResult, - UtDenmUpdateResult, UtDenmEventInd; + UtDenmResults, UtDenmEventInd; } // end UpperTesterPort } // end portDefinitions diff --git a/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn b/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn index 9d3824fe..433c974f 100644 --- a/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn +++ b/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn @@ -7,154 +7,201 @@ */ module LibItsDenm_TypesAndValues { - //LibCommon -// import from LibCommon_BasicTypesAndValues all; + //LibCommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; - // LibIts - import from DENM_PDU_Descriptions language "ASN.1:1997" all; - import from ITS_Container language "ASN.1:1997" all; + // LibIts + import from DENM_PDU_Descriptions language "ASN.1:1997" all; + import from ITS_Container language "ASN.1:1997" all; - group actionTypes { + group actionTypes { - /** - * @desc Indication of whether event cancellation has to be raised by the test system or iut - */ - type enumerated Trigger { - e_ets(0), - e_iut(1) - } + /** + * @desc Indication of whether event cancellation has to be raised by the test system or iut + */ + type enumerated Trigger { + e_ets(0), + e_iut(1) + } - } // end group actionTypes + } // end group actionTypes - group otherTypes { + group otherTypes { - /** - * @desc List of SituationContainers used in behaviours - */ - type record of SituationContainer SituationContainerList; + /** + * @desc List of SituationContainers used in behaviours + */ + type record of SituationContainer SituationContainerList; - /** - * @desc List of ActionIDs used in behaviours - */ - type record of ActionID ActionIDList; + /** + * @desc List of ActionIDs used in behaviours + */ + type record of ActionID ActionIDList; - } + } - group denmConstants { + group denmConstants { - const ValidityDuration c_duration_2sec := 2; - const ValidityDuration c_duration_5sec := 5; - const ValidityDuration c_duration_10sec := 10; + const ValidityDuration c_duration_2sec := 2; + const ValidityDuration c_duration_5sec := 5; + const ValidityDuration c_duration_10sec := 10; - const TransmissionInterval c_interval_1sec := 1000; - const TransmissionInterval c_interval_2sec := 2000; - const TransmissionInterval c_interval_4sec := 4000; - const TransmissionInterval c_interval_5sec := 5000; - const TransmissionInterval c_interval_10sec := 10000; + const TransmissionInterval c_interval_1sec := 1000; + const TransmissionInterval c_interval_2sec := 2000; + const TransmissionInterval c_interval_4sec := 4000; + const TransmissionInterval c_interval_5sec := 5000; + const TransmissionInterval c_interval_10sec := 10000; - } // end group denmConstants + } // end group denmConstants - group certicicates { + group certicicates { - const charstring PX_CERT_IUT_DENM_01 := "CERT_IUT_DENM_BO_01_AT"; - const charstring PX_CERT_IUT_DENM_02 := "CERT_IUT_DENM_BO_02_AT"; + const charstring PX_CERT_IUT_DENM_01 := "CERT_IUT_DENM_BO_01_AT"; + const charstring PX_CERT_IUT_DENM_02 := "CERT_IUT_DENM_BO_02_AT"; - } + } - group utPrimitives { - + group utPrimitives { + + /** + * @desc Upper Tester message to initialize IUT + * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use + */ + type record UtDenmInitialize { + Oct8 hashedId8 + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Upper Tester results message of the DENM IUT + * @member utDenmInitialize - + * @member utDenmTriggerResult - + * @member utDenmUpdateResult, - + * @member utDenmChangePositionResult - + * @member utChangePseudonymResult - + */ + type union UtDenmResults { + boolean utDenmInitializeResult, + UtDenmTriggerResult utDenmTriggerResult, + UtDenmUpdateResult utDenmUpdateResult, + boolean utDenmTerminationResult, + boolean utDenmChangePositionResult, + boolean utChangePseudonymResult + } with { + variant "" + } // End of type UtDenmResults + /** * @desc Upper Tester message to request triggering of an event at IUT */ - type record UtDenmTrigger { - TimestampIts detectionTime, - ValidityDuration validityDuration optional, - ValidityDuration repetitionDuration optional, - SituationContainer situation, - RelevanceDistance relevanceDistance, - RelevanceTrafficDirection relevanceTrafficDirection, - TransmissionInterval transmissionInterval optional, - TransmissionInterval repetitionInterval optional, - AlacarteContainer alacarte optional - } - - /** - * @desc Upper Tester result message of request of triggering of an event at IUT - */ - type record UtDenmTriggerResult { - boolean result, - ActionID actionId - } - - /** - * @desc Upper Tester message to update an event at IUT - */ - type record UtDenmUpdate { - ActionID actionId, - TimestampIts detectionTime, - ValidityDuration validityDuration optional, - SituationContainer situation optional, - LocationContainer location optional, - RelevanceDistance relevanceDistance optional, - RelevanceTrafficDirection relevanceTrafficDirection optional, - TransmissionInterval transmissionInterval optional, - TransmissionInterval repetitionInterval optional, - AlacarteContainer alacarte optional - } - - /** - * @desc Upper Tester result message of an update request of an event on DENM IUT - */ - type record UtDenmUpdateResult { - boolean result, - ActionID actionId - } - - /** - * @desc Upper Tester message to request the termination of an event at IUT - */ - type record UtDenmTermination { - ActionID actionId - } - -//FIXME RGY As discussed, boolean result types are replaced by a top-level union of the results - /** - * @desc Upper Tester response message for all DENM results - */ - type union UtDENMResults { - boolean utDenmTerminationResult - } - - /** - * @desc Upper Tester result message of termination of an event on DENM IUT - */ -//FIXME RGY As discussed, boolean result types are replaced by a top-level union type -// type boolean UtDenmTerminationResult; - type UtDENMResults.utDenmTerminationResult UtDenmTerminationResult; - /** - * @desc Upper Tester message to check event/status on DENM IUT - */ - type record UtDenmEventInd { - DENM denMsg - } with { - encode (denMsg) "LibItsDenm_asn1" - } - - /** - * @desc List of Upper Tester messages to check event/status on DENM IUT - */ - type record of UtDenmEventInd UtDenmEventIndList; - - /** - * @desc List of ActionID received in response to the Upper Tester triggered messages - */ - type record of ActionID UtDenmActionIDList; - - } - with { - encode "UpperTester" + type record UtDenmTrigger { + TimestampIts detectionTime, + ValidityDuration validityDuration optional, + ValidityDuration repetitionDuration optional, + SituationContainer situation, + RelevanceDistance relevanceDistance, + RelevanceTrafficDirection relevanceTrafficDirection, + TransmissionInterval transmissionInterval optional, + TransmissionInterval repetitionInterval optional, + AlacarteContainer alacarte optional + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Upper Tester result message of request of triggering of an event at IUT + */ + type record UtDenmTriggerResult { + boolean result, + ActionID actionId + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Upper Tester message to update an event at IUT + */ + type record UtDenmUpdate { + ActionID actionId, + TimestampIts detectionTime, + ValidityDuration validityDuration optional, + SituationContainer situation optional, + LocationContainer location optional, + RelevanceDistance relevanceDistance optional, + RelevanceTrafficDirection relevanceTrafficDirection optional, + TransmissionInterval transmissionInterval optional, + TransmissionInterval repetitionInterval optional, + AlacarteContainer alacarte optional + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Upper Tester result message of an update request of an event on DENM IUT + */ + type record UtDenmUpdateResult { + boolean result, + ActionID actionId + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Upper Tester message to request the termination of an event at IUT + */ + type record UtDenmTermination { + ActionID actionId + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Upper Tester message to change the position of IUT. Values a relatives + */ + type record UtDenmChangePosition { + Int32 latitude, + Int32 longitude, + Int32 elevation + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Upper Tester message to change the pseudonym of the DENM IUT + */ + type record UtChangePseudonym { + // empty on purpose + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Upper Tester message to check event/status on DENM IUT + */ + type record UtDenmEventInd { + DENM denMsg + } with { + encode (denMsg) "LibItsDenm_asn1" + } + + /** + * @desc List of Upper Tester messages to check event/status on DENM IUT + */ + type record of UtDenmEventInd UtDenmEventIndList; + + /** + * @desc List of ActionID received in response to the Upper Tester triggered messages + */ + type record of ActionID UtDenmActionIDList; + + } + with { + encode "UpperTester" + variant "" } } with { - encode "LibItsDenm" -} + encode "LibItsDenm" + } diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_EncdecDeclarations.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_EncdecDeclarations.ttcn index febc184c..2cabce69 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_EncdecDeclarations.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_EncdecDeclarations.ttcn @@ -37,5 +37,11 @@ module LibItsGeoNetworking_EncdecDeclarations { external function fx_enc_UtGnInitialize (UtGnInitialize p) return bitstring with {extension "prototype(convert) encode(UpperTester)"} - + + external function fx_enc_UtGnChangePosition (UtGnChangePosition p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + + external function fx_enc_UtGnTrigger (UtGnTrigger p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + } // End of module LibItsGeoNetworking_EncdecDeclarations diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn index 363fc3df..8720ac5f 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn @@ -11,2878 +11,2878 @@ */ module LibItsGeoNetworking_Functions { - // Libcommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - import from LibCommon_VerdictControl {type FncRetCode;} - import from LibCommon_Sync all; - import from LibCommon_Time all; + // Libcommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; + import from LibCommon_VerdictControl {type FncRetCode;} + import from LibCommon_Sync all; + import from LibCommon_Time all; - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - import from LibItsExternal_TypesAndValues all; - import from LibItsCommon_Templates all; - import from LibItsCommon_Functions all; - import from LibItsCommon_Pixits all; -// import from LibItsCommon_TestSystem all; + // LibItsCommon + import from LibItsCommon_TypesAndValues all; + import from LibItsExternal_TypesAndValues all; + import from LibItsCommon_Templates all; + import from LibItsCommon_Functions all; + import from LibItsCommon_Pixits all; + // import from LibItsCommon_TestSystem all; - // LibItsSecurity - import from LibItsSecurity_TypesAndValues all; - import from LibItsSecurity_Templates all; - import from LibItsSecurity_Functions all; - import from LibItsSecurity_Pixits 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_TypesAndValues all; - import from LibItsGeoNetworking_Templates all; - import from LibItsGeoNetworking_Pixits all; - import from LibItsGeoNetworking_Pics all; -// import from LibItsGeoNetworking_EncdecDeclarations all; + // LibItsGeoNetworking + import from LibItsGeoNetworking_TestSystem all; + import from LibItsGeoNetworking_TypesAndValues all; + import from LibItsGeoNetworking_Templates all; + import from LibItsGeoNetworking_Pixits all; + import from LibItsGeoNetworking_Pics all; + // import from LibItsGeoNetworking_EncdecDeclarations all; - group utFuntions { + group utFuntions { - /** - * @desc Requests to bring the IUT in an initial state - * @param p_init The initialisation to trigger. - */ - function f_utInitializeIut(template (value) UtGnInitialize p_init) runs on ItsBaseGeoNetworking { + /** + * @desc Requests to bring the IUT in an initial state + * @param p_init The initialisation to trigger. + */ + function f_utInitializeIut(template (value) UtGnInitialize p_init) runs on ItsBaseGeoNetworking { - //deactivate gnPort default alts - vc_gnDefaultActive := false; + //deactivate gnPort default alts + vc_gnDefaultActive := false; - utPort.send(p_init); - tc_wait.start; - alt { + utPort.send(p_init); + tc_wait.start; + alt { [] utPort.receive(UtGnResults: { utGnInitializeResult := true }) { - tc_wait.stop; - log("*** f_utInitializeIut: INFO: IUT initialized ***"); - } - [] utPort.receive { - tc_wait.stop; - log("*** f_utInitializeIut: INFO: IUT could not be initialized ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_wait.timeout { - log("*** f_utInitializeIut: INFO: IUT could not be initialized in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } + tc_wait.stop; + log("*** f_utInitializeIut: INFO: IUT initialized ***"); + } + [] utPort.receive { + tc_wait.stop; + log("*** f_utInitializeIut: INFO: IUT could not be initialized ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] tc_wait.timeout { + log("*** f_utInitializeIut: INFO: IUT could not be initialized in time ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } - //activate gnPort default alts - vc_gnDefaultActive := true; + //activate gnPort default alts + vc_gnDefaultActive := true; - } + } - /** - * @desc Requests to change the position of the IUT - */ - function f_utChangePosition() runs on ItsBaseGeoNetworking { + /** + * @desc Requests to change the position of the IUT + */ + function f_utChangePosition() runs on ItsBaseGeoNetworking { - //deactivate gnPort default alts - vc_gnDefaultActive := false; + //deactivate gnPort default alts + vc_gnDefaultActive := false; - utPort.send(m_changePosition); - tc_wait.start; - alt { - [] utPort.receive(UtChangePositionResult:true) { - tc_wait.stop; - log("*** f_utChangePosition: INFO: IUT position changed ***"); - } - [] utPort.receive(UtChangePositionResult:false) { - tc_wait.stop; - log("*** f_utChangePosition: INFO: IUT position change was not successful ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] a_utDefault() { - } - [] tc_wait.timeout { - log("*** f_utChangePosition: INFO: IUT position not changed in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } + utPort.send(m_changePosition); + tc_wait.start; + alt { + [] utPort.receive(UtGnResults: { utGnChangePositionResult := true} ) { + tc_wait.stop; + log("*** f_utChangePosition: INFO: IUT position changed ***"); + } + [] utPort.receive(UtGnResults: { utGnChangePositionResult := false }) { + tc_wait.stop; + log("*** f_utChangePosition: INFO: IUT position change was not successful ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] a_utDefault() { + } + [] tc_wait.timeout { + log("*** f_utChangePosition: INFO: IUT position not changed in time ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } - //activate gnPort default alts - vc_gnDefaultActive := true; + //activate gnPort default alts + vc_gnDefaultActive := true; - } + } - /** - * @desc Triggers event from the application layer - * @param p_event The event to trigger. - */ - function f_utTriggerEvent(template (value) UtGnTrigger p_event) runs on ItsBaseGeoNetworking return boolean { + /** + * @desc Triggers event from the application layer + * @param p_event The event to trigger. + */ + function f_utTriggerEvent(template (value) UtGnTrigger p_event) runs on ItsBaseGeoNetworking return boolean { - // Variables - var boolean v_return := true; + // Variables + var boolean v_return := true; - //deactivate gnPort default alts - vc_gnDefaultActive := false; - - utPort.send(p_event); - tc_wait.start; - alt { - [] utPort.receive(UtGnTriggerResult:true) { - tc_wait.stop; - } - [] utPort.receive(UtGnTriggerResult:false) { - tc_wait.stop; - log("*** UtGnTriggerResult: INFO: UT trigger was not successful ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] a_utDefault() { - } - [] tc_wait.timeout { - v_return := false; - } - } - - //activate gnPort default alts - vc_gnDefaultActive := true; + //deactivate gnPort default alts + vc_gnDefaultActive := false; - return v_return; + utPort.send(p_event); + tc_wait.start; + alt { + [] utPort.receive(UtGnResults: { utGnTriggerResult := true }) { + tc_wait.stop; + } + [] utPort.receive(UtGnResults: { utGnTriggerResult := false }) { + tc_wait.stop; + log("*** UtGnTriggerResult: INFO: UT trigger was not successful ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] a_utDefault() { + } + [] tc_wait.timeout { + v_return := false; } + } + + //activate gnPort default alts + vc_gnDefaultActive := true; + + return v_return; + } - } // End of group utFunctions + } // End of group utFunctions - group geoConfigurationFunctions { - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - two ITS nodes (nodeA, nodeB) - * - Area1 which only includes NodeB and IUT - * - Area2 which only includes NodeB - * NodeB being close to the area center - */ -//FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf01Up(Scenario p_scenario := e_staticPosition) runs on ItsGeoNetworking /* TITAN TODO: system ItsGeoNetworkingSystem */ { - - // Variables - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - - // Map - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - map(self:geoNetworkingPort, system:geoNetworkingPort); - - // Connect - f_connect4SelfOrClientSync(); - activate(a_cf01Down()); - - // Initialise secured mode - f_initialiseSecuredMode(); - - //Initialze the IUT - f_initialState(p_scenario); - - // Positions & Areas - f_preparePositionsAndAreas(v_positionTable, v_areaTable); - - f_initialiseComponent(v_positionTable, v_areaTable, c_compNodeB); - - } // end f_cf01Up - -//FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf01Down() runs on ItsGeoNetworking /* TITAN TODO: system ItsGeoNetworkingSystem */ { - - f_uninitialiseSecuredMode(); - - // Unmap - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - unmap(self:geoNetworkingPort, system:geoNetworkingPort); - - // Disconnect - f_disconnect4SelfOrClientSync(); - - } // end f_cf01Down - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - one ITS node (NodeB) - * - one ITS node (NodeD) - * - Area1 which only includes NodeB, NodeD and IUT - * - Area2 which only includes NodeB and NodeD - * NodeB being close to the area center - * - * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages - */ + group geoConfigurationFunctions { + + /** + * @desc This configuration features: + * - one ITS node (IUT) + * - two ITS nodes (nodeA, nodeB) + * - Area1 which only includes NodeB and IUT + * - Area2 which only includes NodeB + * NodeB being close to the area center + */ + //FIXME RGY Titan doesn't support mtc and system clauses yet + function f_cf01Up(Scenario p_scenario := e_staticPosition) runs on ItsGeoNetworking /* TITAN TODO: system ItsGeoNetworkingSystem */ { + + // Variables + var PositionTable v_positionTable := {}; + var GeoAreaTable v_areaTable := {}; + + // Map + map(self:acPort, system:acPort); + map(self:utPort, system:utPort); + map(self:geoNetworkingPort, system:geoNetworkingPort); + + // Connect + f_connect4SelfOrClientSync(); + activate(a_cf01Down()); + + // Initialise secured mode + f_initialiseSecuredMode(); + + //Initialze the IUT + f_initialState(p_scenario); + + // Positions & Areas + f_preparePositionsAndAreas(v_positionTable, v_areaTable); + + f_initialiseComponent(v_positionTable, v_areaTable, c_compNodeB); + + } // end f_cf01Up + + //FIXME RGY Titan doesn't support mtc and system clauses yet + function f_cf01Down() runs on ItsGeoNetworking /* TITAN TODO: system ItsGeoNetworkingSystem */ { + + f_uninitialiseSecuredMode(); + + // Unmap + unmap(self:acPort, system:acPort); + unmap(self:utPort, system:utPort); + unmap(self:geoNetworkingPort, system:geoNetworkingPort); + + // Disconnect + f_disconnect4SelfOrClientSync(); + + } // end f_cf01Down + + /** + * @desc This configuration features: + * - one ITS node (IUT) + * - one ITS node (NodeB) + * - one ITS node (NodeD) + * - Area1 which only includes NodeB, NodeD and IUT + * - Area2 which only includes NodeB and NodeD + * NodeB being close to the area center + * + * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages + */ -//FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf02Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { - - // Variables - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - var ItsGeoNetworking v_component; - var integer i; - - // Select components - vc_componentTable := {{c_compNodeB, omit}, {c_compNodeD, omit}}; - - // Create components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; - } - - // Map & Connect - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - connect(self:syncPort, mtc:syncPort); - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - map(vc_componentTable[i].gnComponent:acPort, system:acPort); - map(vc_componentTable[i].gnComponent:utPort, system:utPort); - map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - - activate(a_cf02Down()); - - //Initialze the IUT - if(p_mainUtComponent == c_compMTC) { - // Initialise secured mode - f_initialiseSecuredMode(); + //FIXME RGY Titan doesn't support mtc and system clauses yet + function f_cf02Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { + + // Variables + var PositionTable v_positionTable := {}; + var GeoAreaTable v_areaTable := {}; + var ItsGeoNetworking v_component; + var integer i; + + // Select components + vc_componentTable := {{c_compNodeB, omit}, {c_compNodeD, omit}}; + + // Create components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; + } + + // Map & Connect + map(self:acPort, system:acPort); + map(self:utPort, system:utPort); + connect(self:syncPort, mtc:syncPort); + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + map(vc_componentTable[i].gnComponent:acPort, system:acPort); + map(vc_componentTable[i].gnComponent:utPort, system:utPort); + map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + + activate(a_cf02Down()); + + //Initialze the IUT + if(p_mainUtComponent == c_compMTC) { + // Initialise secured mode + f_initialiseSecuredMode(); - // MTC intializes IUT - f_initialState(p_scenario); - } - else { - v_component := f_getComponent(p_mainUtComponent); - v_component.start(f_initialState(p_scenario)); - v_component.done; - } - - // Positions & Areas - f_preparePositionsAndAreas(v_positionTable, v_areaTable); - - // Initialize components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); - } - } - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.done; - } - } - - } // end f_cf02Up - - /** - * @desc Deletes configuration cf02 - */ + // MTC intializes IUT + f_initialState(p_scenario); + } + else { + v_component := f_getComponent(p_mainUtComponent); + v_component.start(f_initialState(p_scenario)); + v_component.done; + } + + // Positions & Areas + f_preparePositionsAndAreas(v_positionTable, v_areaTable); + + // Initialize components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); + } + } + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.done; + } + } + + } // end f_cf02Up + + /** + * @desc Deletes configuration cf02 + */ -//FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf02Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { - - // Local variables - var integer i; - - f_uninitialiseSecuredMode(); - - // Unmap & Disconnect - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); - unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); - unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - disconnect(self:syncPort, mtc:syncPort); - - } // end f_cf02Down - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - one ITS node (NodeA) - * - one ITS node in direction of NodeA (NodeB) - * - one ITS node not in direction of NodeA (NodeC) - * - Area1 which only includes NodeB and IUT - * - Area2 which only includes NodeB - * NodeB being close to the area center - * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages - */ -//FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf03Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { - - // Variables - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - var ItsGeoNetworking v_component; - var integer i; - - // Select components - vc_componentTable := {{c_compNodeB, omit}, {c_compNodeC, omit}}; - - // Create components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; - } - - // Map & Connect - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - connect(self:syncPort, mtc:syncPort); - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - map(vc_componentTable[i].gnComponent:acPort, system:acPort); - map(vc_componentTable[i].gnComponent:utPort, system:utPort); - map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - - activate(a_cf03Down()); - - //Initialze the IUT - if(p_mainUtComponent == c_compMTC) { - // Initialise secured mode - f_initialiseSecuredMode(); + //FIXME RGY Titan doesn't support mtc and system clauses yet + function f_cf02Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { + + // Local variables + var integer i; + + f_uninitialiseSecuredMode(); + + // Unmap & Disconnect + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); + unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); + unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + unmap(self:acPort, system:acPort); + unmap(self:utPort, system:utPort); + disconnect(self:syncPort, mtc:syncPort); + + } // end f_cf02Down + + /** + * @desc This configuration features: + * - one ITS node (IUT) + * - one ITS node (NodeA) + * - one ITS node in direction of NodeA (NodeB) + * - one ITS node not in direction of NodeA (NodeC) + * - Area1 which only includes NodeB and IUT + * - Area2 which only includes NodeB + * NodeB being close to the area center + * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages + */ + //FIXME RGY Titan doesn't support mtc and system clauses yet + function f_cf03Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { + + // Variables + var PositionTable v_positionTable := {}; + var GeoAreaTable v_areaTable := {}; + var ItsGeoNetworking v_component; + var integer i; + + // Select components + vc_componentTable := {{c_compNodeB, omit}, {c_compNodeC, omit}}; + + // Create components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; + } + + // Map & Connect + map(self:acPort, system:acPort); + map(self:utPort, system:utPort); + connect(self:syncPort, mtc:syncPort); + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + map(vc_componentTable[i].gnComponent:acPort, system:acPort); + map(vc_componentTable[i].gnComponent:utPort, system:utPort); + map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + + activate(a_cf03Down()); + + //Initialze the IUT + if(p_mainUtComponent == c_compMTC) { + // Initialise secured mode + f_initialiseSecuredMode(); - // MTC intializes IUT - f_initialState(p_scenario); - } - else { - v_component := f_getComponent(p_mainUtComponent); - v_component.start(f_initialState(p_scenario)); - v_component.done; - } - - // Positions & Areas - f_preparePositionsAndAreas(v_positionTable, v_areaTable); - - // Initialize components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); - } - } - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.done; - } - } - - } // end f_cf03Up - - /** - * @desc Deletes configuration cf03 - */ + // MTC intializes IUT + f_initialState(p_scenario); + } + else { + v_component := f_getComponent(p_mainUtComponent); + v_component.start(f_initialState(p_scenario)); + v_component.done; + } + + // Positions & Areas + f_preparePositionsAndAreas(v_positionTable, v_areaTable); + + // Initialize components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); + } + } + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.done; + } + } + + } // end f_cf03Up + + /** + * @desc Deletes configuration cf03 + */ - //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf03Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { - - // Local variables - var integer i; - - f_uninitialiseSecuredMode(); - - // Unmap & Disconnect - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); - unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); - unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - disconnect(self:syncPort, mtc:syncPort); - - } // end f_cf03Down - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - one ITS node (NodeA) - * - one ITS node in direction of NodeA and having - * shortest distance to NodeA (NodeB) - * - one ITS node in direction of NodeA (NodeD) - * - one ITS node not in direction of NodeA (NodeC) - * - Area1 which only includes NodeB, NodeD and IUT - * - Area2 which only includes NodeA, NodeB and NodeD - * NodeB being close to the area center - * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages - */ + //FIXME RGY Titan doesn't support mtc and system clauses yet + function f_cf03Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { + + // Local variables + var integer i; + + f_uninitialiseSecuredMode(); + + // Unmap & Disconnect + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); + unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); + unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + unmap(self:acPort, system:acPort); + unmap(self:utPort, system:utPort); + disconnect(self:syncPort, mtc:syncPort); + + } // end f_cf03Down + + /** + * @desc This configuration features: + * - one ITS node (IUT) + * - one ITS node (NodeA) + * - one ITS node in direction of NodeA and having + * shortest distance to NodeA (NodeB) + * - one ITS node in direction of NodeA (NodeD) + * - one ITS node not in direction of NodeA (NodeC) + * - Area1 which only includes NodeB, NodeD and IUT + * - Area2 which only includes NodeA, NodeB and NodeD + * NodeB being close to the area center + * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages + */ -//FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf04Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { - - // Variables - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - var ItsGeoNetworking v_component; - var integer i; - - // Select components - vc_componentTable := {{c_compNodeB, omit}, {c_compNodeC, omit}, {c_compNodeD, omit}}; - - // Create components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; - } - - // Map & Connect - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - connect(self:syncPort, mtc:syncPort); - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - map(vc_componentTable[i].gnComponent:acPort, system:acPort); - map(vc_componentTable[i].gnComponent:utPort, system:utPort); - map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - - activate(a_cf04Down()); - - //Initialze the IUT - if(p_mainUtComponent == c_compMTC) { - // Initialise secured mode - f_initialiseSecuredMode(); + //FIXME RGY Titan doesn't support mtc and system clauses yet + function f_cf04Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { + + // Variables + var PositionTable v_positionTable := {}; + var GeoAreaTable v_areaTable := {}; + var ItsGeoNetworking v_component; + var integer i; + + // Select components + vc_componentTable := {{c_compNodeB, omit}, {c_compNodeC, omit}, {c_compNodeD, omit}}; + + // Create components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; + } + + // Map & Connect + map(self:acPort, system:acPort); + map(self:utPort, system:utPort); + connect(self:syncPort, mtc:syncPort); + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + map(vc_componentTable[i].gnComponent:acPort, system:acPort); + map(vc_componentTable[i].gnComponent:utPort, system:utPort); + map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + + activate(a_cf04Down()); + + //Initialze the IUT + if(p_mainUtComponent == c_compMTC) { + // Initialise secured mode + f_initialiseSecuredMode(); - // MTC intializes IUT - f_initialState(p_scenario); - } - else { - v_component := f_getComponent(p_mainUtComponent); - v_component.start(f_initialState(p_scenario)); - v_component.done; - } - - // Positions & Areas - f_preparePositionsAndAreas(v_positionTable, v_areaTable); - - // Initialize components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); - } - } - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.done; - } - } - - } // end f_cf04Up - - /** - * @desc Deletes configuration cf04 - */ + // MTC intializes IUT + f_initialState(p_scenario); + } + else { + v_component := f_getComponent(p_mainUtComponent); + v_component.start(f_initialState(p_scenario)); + v_component.done; + } + + // Positions & Areas + f_preparePositionsAndAreas(v_positionTable, v_areaTable); + + // Initialize components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); + } + } + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.done; + } + } + + } // end f_cf04Up + + /** + * @desc Deletes configuration cf04 + */ -//FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf04Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */{ - - // Local variables - var integer i; - - f_uninitialiseSecuredMode(); - - // Unmap & Disconnect - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); - unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); - unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - disconnect(self:syncPort, mtc:syncPort); - - } // end f_cf04Down + //FIXME RGY Titan doesn't support mtc and system clauses yet + function f_cf04Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */{ + + // Local variables + var integer i; + + f_uninitialiseSecuredMode(); + + // Unmap & Disconnect + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); + unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); + unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + unmap(self:acPort, system:acPort); + unmap(self:utPort, system:utPort); + disconnect(self:syncPort, mtc:syncPort); + + } // end f_cf04Down - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - one ITS node (NodeB) - * - one ITS node not in direction of NodeB and having - * longest distance to NodeB (NodeE) - * - Area1 which only includes NodeB, NodeD and IUT - * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages - */ + /** + * @desc This configuration features: + * - one ITS node (IUT) + * - one ITS node (NodeB) + * - one ITS node not in direction of NodeB and having + * longest distance to NodeB (NodeE) + * - Area1 which only includes NodeB, NodeD and IUT + * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages + */ -//FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf05Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { - - // Variables - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - var ItsGeoNetworking v_component; - var integer i; - - // Select components - vc_componentTable := {{c_compNodeB, omit}, {c_compNodeE, omit}}; - - // Create components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; - } - - // Map & Connect - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - connect(self:syncPort, mtc:syncPort); - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - map(vc_componentTable[i].gnComponent:acPort, system:acPort); - map(vc_componentTable[i].gnComponent:utPort, system:utPort); - map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - - activate(a_cf05Down()); - - //Initialze the IUT - if(p_mainUtComponent == c_compMTC) { - // Initialise secured mode - f_initialiseSecuredMode(); + //FIXME RGY Titan doesn't support mtc and system clauses yet + function f_cf05Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { + + // Variables + var PositionTable v_positionTable := {}; + var GeoAreaTable v_areaTable := {}; + var ItsGeoNetworking v_component; + var integer i; + + // Select components + vc_componentTable := {{c_compNodeB, omit}, {c_compNodeE, omit}}; + + // Create components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; + } + + // Map & Connect + map(self:acPort, system:acPort); + map(self:utPort, system:utPort); + connect(self:syncPort, mtc:syncPort); + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + map(vc_componentTable[i].gnComponent:acPort, system:acPort); + map(vc_componentTable[i].gnComponent:utPort, system:utPort); + map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + + activate(a_cf05Down()); + + //Initialze the IUT + if(p_mainUtComponent == c_compMTC) { + // Initialise secured mode + f_initialiseSecuredMode(); - // MTC intializes IUT - f_initialState(p_scenario); - } - else { - v_component := f_getComponent(p_mainUtComponent); - v_component.start(f_initialState(p_scenario)); - v_component.done; - } - - // Positions & Areas - f_preparePositionsAndAreas(v_positionTable, v_areaTable); - - // Initialize components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); - } - } - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.done; - } - } - } + // MTC intializes IUT + f_initialState(p_scenario); + } + else { + v_component := f_getComponent(p_mainUtComponent); + v_component.start(f_initialState(p_scenario)); + v_component.done; + } + + // Positions & Areas + f_preparePositionsAndAreas(v_positionTable, v_areaTable); + + // Initialize components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); + } + } + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.done; + } + } + } - /** - * @desc Deletes configuration cf05 - */ + /** + * @desc Deletes configuration cf05 + */ -//FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf05Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { - - // Local variables - var integer i; - - f_uninitialiseSecuredMode(); - - // Unmap & Disconnect - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); - unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); - unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - disconnect(self:syncPort, mtc:syncPort); - - } // end f_cf05Down - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - one ITS node (NodeB) - * - one ITS node not in direction of NodeB and having - * shortest distance to NodeB (NodeF) - * - Area1 which only includes NodeB, NodeD and IUT - * - IUT not in sectorial area of NodeB-NodeF - * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages - */ -//FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf06Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { + //FIXME RGY Titan doesn't support mtc and system clauses yet + function f_cf05Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { + + // Local variables + var integer i; + + f_uninitialiseSecuredMode(); + + // Unmap & Disconnect + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); + unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); + unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + unmap(self:acPort, system:acPort); + unmap(self:utPort, system:utPort); + disconnect(self:syncPort, mtc:syncPort); + + } // end f_cf05Down + + /** + * @desc This configuration features: + * - one ITS node (IUT) + * - one ITS node (NodeB) + * - one ITS node not in direction of NodeB and having + * shortest distance to NodeB (NodeF) + * - Area1 which only includes NodeB, NodeD and IUT + * - IUT not in sectorial area of NodeB-NodeF + * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages + */ + //FIXME RGY Titan doesn't support mtc and system clauses yet + function f_cf06Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { - // Variables - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - var ItsGeoNetworking v_component; - var integer i; - - // Select components - vc_componentTable := {{c_compNodeB, omit}, {c_compNodeF, omit}}; - - // Create components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; - } - - // Map & Connect - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - connect(self:syncPort, mtc:syncPort); - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - map(vc_componentTable[i].gnComponent:acPort, system:acPort); - map(vc_componentTable[i].gnComponent:utPort, system:utPort); - map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - - activate(a_cf06Down()); - - //Initialze the IUT - if(p_mainUtComponent == c_compMTC) { - // Initialise secured mode - f_initialiseSecuredMode(); + // Variables + var PositionTable v_positionTable := {}; + var GeoAreaTable v_areaTable := {}; + var ItsGeoNetworking v_component; + var integer i; + + // Select components + vc_componentTable := {{c_compNodeB, omit}, {c_compNodeF, omit}}; + + // Create components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; + } + + // Map & Connect + map(self:acPort, system:acPort); + map(self:utPort, system:utPort); + connect(self:syncPort, mtc:syncPort); + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + map(vc_componentTable[i].gnComponent:acPort, system:acPort); + map(vc_componentTable[i].gnComponent:utPort, system:utPort); + map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + + activate(a_cf06Down()); + + //Initialze the IUT + if(p_mainUtComponent == c_compMTC) { + // Initialise secured mode + f_initialiseSecuredMode(); - // MTC intializes IUT - f_initialState(p_scenario); - } - else { - v_component := f_getComponent(p_mainUtComponent); - v_component.start(f_initialState(p_scenario)); - v_component.done; - } - - // Positions & Areas - f_preparePositionsAndAreas(v_positionTable, v_areaTable); - - // Initialize components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); - } - } - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.done; - } - } - } + // MTC intializes IUT + f_initialState(p_scenario); + } + else { + v_component := f_getComponent(p_mainUtComponent); + v_component.start(f_initialState(p_scenario)); + v_component.done; + } + + // Positions & Areas + f_preparePositionsAndAreas(v_positionTable, v_areaTable); + + // Initialize components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); + } + } + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.done; + } + } + } - /** - * @desc Deletes configuration cf06 - */ + /** + * @desc Deletes configuration cf06 + */ -//FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf06Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { - - // Local variables - var integer i; - - f_uninitialiseSecuredMode(); - - // Unmap & Disconnect - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); - unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); - unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - disconnect(self:syncPort, mtc:syncPort); - - } // end f_cf06Down + //FIXME RGY Titan doesn't support mtc and system clauses yet + function f_cf06Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { + + // Local variables + var integer i; + + f_uninitialiseSecuredMode(); + + // Unmap & Disconnect + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); + unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); + unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + unmap(self:acPort, system:acPort); + unmap(self:utPort, system:utPort); + disconnect(self:syncPort, mtc:syncPort); + + } // end f_cf06Down - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - one ITS node (NodeB) - * - one ITS node in direction of NodeB and having - * shortest distance to NodeB (NodeD) - * - Area1 which only includes NodeB, NodeD and IUT - * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages - */ + /** + * @desc This configuration features: + * - one ITS node (IUT) + * - one ITS node (NodeB) + * - one ITS node in direction of NodeB and having + * shortest distance to NodeB (NodeD) + * - Area1 which only includes NodeB, NodeD and IUT + * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages + */ -//FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf07Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO mtc ItsMtc system ItsGeoNetworkingSystem */{ + //FIXME RGY Titan doesn't support mtc and system clauses yet + function f_cf07Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO mtc ItsMtc system ItsGeoNetworkingSystem */{ - // Variables - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - var ItsGeoNetworking v_component; - var integer i; - - // Select components - vc_componentTable := {{c_compNodeB, omit}, {c_compNodeD, omit}}; - - // Create components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; - } - - // Map & Connect - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - connect(self:syncPort, mtc:syncPort); - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - map(vc_componentTable[i].gnComponent:acPort, system:acPort); - map(vc_componentTable[i].gnComponent:utPort, system:utPort); - map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - - activate(a_cf07Down()); - - //Initialze the IUT - if(p_mainUtComponent == c_compMTC) { - // Initialise secured mode - f_initialiseSecuredMode(); + // Variables + var PositionTable v_positionTable := {}; + var GeoAreaTable v_areaTable := {}; + var ItsGeoNetworking v_component; + var integer i; + + // Select components + vc_componentTable := {{c_compNodeB, omit}, {c_compNodeD, omit}}; + + // Create components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; + } + + // Map & Connect + map(self:acPort, system:acPort); + map(self:utPort, system:utPort); + connect(self:syncPort, mtc:syncPort); + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + map(vc_componentTable[i].gnComponent:acPort, system:acPort); + map(vc_componentTable[i].gnComponent:utPort, system:utPort); + map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + + activate(a_cf07Down()); + + //Initialze the IUT + if(p_mainUtComponent == c_compMTC) { + // Initialise secured mode + f_initialiseSecuredMode(); - // MTC intializes IUT - f_initialState(p_scenario); - } - else { - v_component := f_getComponent(p_mainUtComponent); - v_component.start(f_initialState(p_scenario)); - v_component.done; - } - - // Positions & Areas - f_preparePositionsAndAreas(v_positionTable, v_areaTable); - - // Initialize components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); - } - } - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.done; - } - } - } - - /** - * @desc Deletes configuration cf06 - */ -//FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf07Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { - - // Local variables - var integer i; - - f_uninitialiseSecuredMode(); - - // Unmap & Disconnect - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); - unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); - unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - disconnect(self:syncPort, mtc:syncPort); - - } // end f_cf0yDown - - /** - * @desc Behavior function for initializing component's variables and tables - * @param p_positionTable Table containing position vectors of all nodes - * @param p_areaTable Table containing all defined geoAreas - * @param p_componentName Name of the component - */ - function f_initialiseComponent( - in PositionTable p_positionTable, - in GeoAreaTable p_areaTable, - in charstring p_componentName) - runs on ItsGeoNetworking { - - vc_positionTable := p_positionTable; - vc_areaTable := p_areaTable; - vc_componentName := p_componentName; - - vc_localSeqNumber := f_getInitialSequenceNumber(); - vc_multipleMessagesCount := f_getMessageCount(); - - } // end f_initialiseComponent - - /** - * @desc Makes the simulated ITS node behave as a neighbour of IUT - */ - function f_startBeingNeighbour() runs on ItsGeoNetworking { - - vc_neighbourDefault := activate(a_neighbourDefault()); - f_acTriggerEvent(m_startBeaconing(m_beaconHeader(f_getPosition(vc_componentName)).beaconHeader)); - f_sleepIgnoreDef(PX_NEIGHBOUR_DISCOVERY_DELAY); - } // end f_startBeingNeighbour - - /** - * @desc Makes the simulated ITS node behave as not being a neighbour of IUT - */ - function f_stopBeingNeighbour() runs on ItsGeoNetworking { - - f_acTriggerEvent(m_stopBeaconing); - if (PICS_GN_SECURITY == true) { - deactivate(vc_neighbourDefault); - } - } // end f_stopBeingNeighbour - - /** - * @desc Initialise secure mode if required - */ - function f_initialiseSecuredMode() runs on ItsBaseGeoNetworking { - if ((PICS_GN_SECURITY == true) or (PICS_IS_IUT_SECURED == true)) { - if(e_success != f_acEnableSecurity()){ - log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); - stop; - } - } - } // End of function f_initialiseSecuredMode() - - function f_uninitialiseSecuredMode() runs on ItsBaseGeoNetworking { - if ((PICS_GN_SECURITY == true) or (PICS_IS_IUT_SECURED == true)) { - f_acDisableSecurity(); - } - } // End of function f_uninitialiseSecuredMode() + // MTC intializes IUT + f_initialState(p_scenario); + } + else { + v_component := f_getComponent(p_mainUtComponent); + v_component.start(f_initialState(p_scenario)); + v_component.done; + } + + // Positions & Areas + f_preparePositionsAndAreas(v_positionTable, v_areaTable); + + // Initialize components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); + } + } + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.done; + } + } + } - } // end geoConfigurationFunctions + /** + * @desc Deletes configuration cf06 + */ + //FIXME RGY Titan doesn't support mtc and system clauses yet + function f_cf07Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { + + // Local variables + var integer i; + + f_uninitialiseSecuredMode(); + + // Unmap & Disconnect + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); + unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); + unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + unmap(self:acPort, system:acPort); + unmap(self:utPort, system:utPort); + disconnect(self:syncPort, mtc:syncPort); + + } // end f_cf0yDown + + /** + * @desc Behavior function for initializing component's variables and tables + * @param p_positionTable Table containing position vectors of all nodes + * @param p_areaTable Table containing all defined geoAreas + * @param p_componentName Name of the component + */ + function f_initialiseComponent( + in PositionTable p_positionTable, + in GeoAreaTable p_areaTable, + in charstring p_componentName) + runs on ItsGeoNetworking { + + vc_positionTable := p_positionTable; + vc_areaTable := p_areaTable; + vc_componentName := p_componentName; + + vc_localSeqNumber := f_getInitialSequenceNumber(); + vc_multipleMessagesCount := f_getMessageCount(); + + } // end f_initialiseComponent + + /** + * @desc Makes the simulated ITS node behave as a neighbour of IUT + */ + function f_startBeingNeighbour() runs on ItsGeoNetworking { + + vc_neighbourDefault := activate(a_neighbourDefault()); + f_acTriggerEvent(m_startBeaconing(m_beaconHeader(f_getPosition(vc_componentName)).beaconHeader)); + f_sleepIgnoreDef(PX_NEIGHBOUR_DISCOVERY_DELAY); + } // end f_startBeingNeighbour + + /** + * @desc Makes the simulated ITS node behave as not being a neighbour of IUT + */ + function f_stopBeingNeighbour() runs on ItsGeoNetworking { + + f_acTriggerEvent(m_stopBeaconing); + if (PICS_GN_SECURITY == true) { + deactivate(vc_neighbourDefault); + } + } // end f_stopBeingNeighbour + + /** + * @desc Initialise secure mode if required + */ + function f_initialiseSecuredMode() runs on ItsBaseGeoNetworking { + if ((PICS_GN_SECURITY == true) or (PICS_IS_IUT_SECURED == true)) { + if(e_success != f_acEnableSecurity()){ + log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); + stop; + } + } + } // End of function f_initialiseSecuredMode() + + function f_uninitialiseSecuredMode() runs on ItsBaseGeoNetworking { + if ((PICS_GN_SECURITY == true) or (PICS_IS_IUT_SECURED == true)) { + f_acDisableSecurity(); + } + } // End of function f_uninitialiseSecuredMode() + + } // end geoConfigurationFunctions - group componentFunctions { - /** - * @desc Get the component corresponding to a key - * @param p_componentName Name searched component - * @return ItsGeoNetworking - The searched position vector - */ - function f_getComponent( - in charstring p_componentName - ) runs on ItsMtc - return ItsGeoNetworking { - - var ItsGeoNetworking v_return := null; - var integer i := 0; - - for (i:=0; i value v_ind { - //store every upper tester indication received - vc_utInds[lengthof(vc_utInds)] := v_ind; - repeat; - } - [vc_utDefaultActive] utPort.receive { - log("*** " & testcasename() & ": INFO: Received unexpected UT message from IUT ***"); - repeat; - } - } + /** + * @desc The default for handling upper tester messages. + */ + altstep a_utDefault() runs on ItsBaseGeoNetworking { + var UtGnEventInd v_ind; + [vc_utDefaultActive] utPort.receive(UtGnEventInd:?) -> value v_ind { + //store every upper tester indication received + vc_utInds[lengthof(vc_utInds)] := v_ind; + repeat; + } + [vc_utDefaultActive] utPort.receive { + log("*** " & testcasename() & ": INFO: Received unexpected UT message from IUT ***"); + repeat; + } + } - /** - * @desc Default handling cf01 de-initialisation. - */ - altstep a_cf01Down() runs on ItsGeoNetworking { - [] a_shutdown() { - f_poDefault(); - f_cf01Down(); - log("*** a_cf01Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } + /** + * @desc Default handling cf01 de-initialisation. + */ + altstep a_cf01Down() runs on ItsGeoNetworking { + [] a_shutdown() { + f_poDefault(); + f_cf01Down(); + log("*** a_cf01Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } + } - /** - * @desc Default handling cf02 de-initialisation. - */ - altstep a_cf02Down() runs on ItsMtc { - [] a_shutdown() { - f_cf02Down(); - log("*** a_cf02Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } + /** + * @desc Default handling cf02 de-initialisation. + */ + altstep a_cf02Down() runs on ItsMtc { + [] a_shutdown() { + f_cf02Down(); + log("*** a_cf02Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } + } - /** - * @desc Default handling cf03 de-initialisation. - */ - altstep a_cf03Down() runs on ItsMtc { - [] a_shutdown() { - f_cf03Down(); - log("*** a_cf03Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } + /** + * @desc Default handling cf03 de-initialisation. + */ + altstep a_cf03Down() runs on ItsMtc { + [] a_shutdown() { + f_cf03Down(); + log("*** a_cf03Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } + } - /** - * @desc Default handling cf04 de-initialisation. - */ - altstep a_cf04Down() runs on ItsMtc { - [] a_shutdown() { - f_cf04Down(); - log("*** a_cf04Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } + /** + * @desc Default handling cf04 de-initialisation. + */ + altstep a_cf04Down() runs on ItsMtc { + [] a_shutdown() { + f_cf04Down(); + log("*** a_cf04Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } + } - /** - * @desc Default handling cf05 de-initialisation. - */ - altstep a_cf05Down() runs on ItsMtc { - [] a_shutdown() { - f_cf05Down(); - log("*** a_cf05Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } + /** + * @desc Default handling cf05 de-initialisation. + */ + altstep a_cf05Down() runs on ItsMtc { + [] a_shutdown() { + f_cf05Down(); + log("*** a_cf05Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } + } - /** - * @desc Default handling cf06 de-initialisation. - */ - altstep a_cf06Down() runs on ItsMtc { - [] a_shutdown() { - f_cf06Down(); - log("*** a_cf06Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } + /** + * @desc Default handling cf06 de-initialisation. + */ + altstep a_cf06Down() runs on ItsMtc { + [] a_shutdown() { + f_cf06Down(); + log("*** a_cf06Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } + } - /** - * @desc Default handling cf07 de-initialisation. - */ - altstep a_cf07Down() runs on ItsMtc { - [] a_shutdown() { - f_cf07Down(); - log("*** a_cf07Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - group geoGeoUnicastAltsteps { - - /** - * @desc Receive GeoUnicast packet - * @param p_sourceLongPosVec Expected source position vector - * @param p_destinationShortPosVec Expected destination position vector - * @param p_seqNumber Expected sequence number - */ - altstep a_receiveGeoUnicast( - in template (present) ShortPosVector p_destinationShortPosVec, - in template (present) UInt16 p_seqNumber - ) runs on ItsGeoNetworking { + /** + * @desc Default handling cf07 de-initialisation. + */ + altstep a_cf07Down() runs on ItsMtc { + [] a_shutdown() { + f_cf07Down(); + log("*** a_cf07Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } + } + group geoGeoUnicastAltsteps { + + /** + * @desc Receive GeoUnicast packet + * @param p_sourceLongPosVec Expected source position vector + * @param p_destinationShortPosVec Expected destination position vector + * @param p_seqNumber Expected sequence number + */ + altstep a_receiveGeoUnicast( + in template (present) ShortPosVector p_destinationShortPosVec, + in template (present) UInt16 p_seqNumber + ) runs on ItsGeoNetworking { - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwUnicastPacket( - p_destinationShortPosVec, - p_seqNumber)))) { - } - } + [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwUnicastPacket( + p_destinationShortPosVec, + p_seqNumber)))) { + } + } - /** - * @desc Receive GeoUnicast packet for specific destination - * @param p_destinationShortPosVec Expected destination position vector - */ - altstep a_receiveGeoUnicastWithDestination(in template (present) ShortPosVector p_destinationShortPosVec) runs on ItsGeoNetworking { + /** + * @desc Receive GeoUnicast packet for specific destination + * @param p_destinationShortPosVec Expected destination position vector + */ + altstep a_receiveGeoUnicastWithDestination(in template (present) ShortPosVector p_destinationShortPosVec) runs on ItsGeoNetworking { - [vc_gnDefaultActive] a_receiveGeoUnicast(p_destinationShortPosVec, ?) {} - } + [vc_gnDefaultActive] a_receiveGeoUnicast(p_destinationShortPosVec, ?) {} + } - /** - * @desc Receive any GeoUnicast packet - */ - altstep a_receiveAnyGeoUnicast() runs on ItsGeoNetworking { + /** + * @desc Receive any GeoUnicast packet + */ + altstep a_receiveAnyGeoUnicast() runs on ItsGeoNetworking { - [vc_gnDefaultActive] a_receiveGeoUnicast(?, ?) {} - } - - } // end geoGeoUnicastAltsteps - - group geoGeoBroadcastAltsteps { - - /** - * @desc Receive GeoBroadcast packet - * @param p_srcLongPosVec Expected source position vector - * @param p_seqNumber Expected sequence number - */ - altstep a_receiveGeoBroadcast( - in template (present) LongPosVector p_srcLongPosVec, - in template (present) UInt16 p_seqNumber - ) runs on ItsGeoNetworking { + [vc_gnDefaultActive] a_receiveGeoUnicast(?, ?) {} + } + + } // end geoGeoUnicastAltsteps + + group geoGeoBroadcastAltsteps { + + /** + * @desc Receive GeoBroadcast packet + * @param p_srcLongPosVec Expected source position vector + * @param p_seqNumber Expected sequence number + */ + altstep a_receiveGeoBroadcast( + in template (present) LongPosVector p_srcLongPosVec, + in template (present) UInt16 p_seqNumber + ) runs on ItsGeoNetworking { - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacket( - p_srcLongPosVec, - p_seqNumber - )))) { - } - } - - /** - * @desc Receive GeoBroadcast packet with specific Area and HopLimit - * @param p_srcLongPosVec Expected source position vector - * @param p_seqNumber Expected sequence number - * @param p_broadcastArea Expected geoBroadcastArea - * @param p_routerHopLimit Expected router hop limit - * @param p_maxHopLimit Expected max hop limit (Default: ?) - */ - altstep a_receiveGeoBroadcastWithAreaWithHopLimit( - in template (present) LongPosVector p_srcLongPosVec, - in template (present) UInt16 p_seqNumber, - in template (present) GeoBroadcastArea p_broadcastArea, - in template (present) UInt8 p_routerHopLimit, - in template (present) UInt8 p_maxHopLimit := ? - ) runs on ItsGeoNetworking { + [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacket( + p_srcLongPosVec, + p_seqNumber + )))) { + } + } + + /** + * @desc Receive GeoBroadcast packet with specific Area and HopLimit + * @param p_srcLongPosVec Expected source position vector + * @param p_seqNumber Expected sequence number + * @param p_broadcastArea Expected geoBroadcastArea + * @param p_routerHopLimit Expected router hop limit + * @param p_maxHopLimit Expected max hop limit (Default: ?) + */ + altstep a_receiveGeoBroadcastWithAreaWithHopLimit( + in template (present) LongPosVector p_srcLongPosVec, + in template (present) UInt16 p_seqNumber, + in template (present) GeoBroadcastArea p_broadcastArea, + in template (present) UInt8 p_routerHopLimit, + in template (present) UInt8 p_maxHopLimit := ? + ) runs on ItsGeoNetworking { - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithAreaAndHl( - p_srcLongPosVec, - p_seqNumber, - p_broadcastArea, - p_maxHopLimit - ), - -, - p_routerHopLimit - ))) { - } - } - - /** - * @desc Receive GeoBroadcast packet for specific Geobroadcast Area - * @param p_srcLongPosVec Expected source position vector - * @param p_seqNumber Expected sequence number - * @param p_broadcastArea Expected geoBroadcastArea - */ - altstep a_receiveGeoBroadcastWithArea( - in template (present) LongPosVector p_srcLongPosVec, - in template (present) UInt16 p_seqNumber, - in template (present) GeoBroadcastArea p_broadcastArea - ) runs on ItsGeoNetworking { + [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithAreaAndHl( + p_srcLongPosVec, + p_seqNumber, + p_broadcastArea, + p_maxHopLimit + ), + -, + p_routerHopLimit + ))) { + } + } + + /** + * @desc Receive GeoBroadcast packet for specific Geobroadcast Area + * @param p_srcLongPosVec Expected source position vector + * @param p_seqNumber Expected sequence number + * @param p_broadcastArea Expected geoBroadcastArea + */ + altstep a_receiveGeoBroadcastWithArea( + in template (present) LongPosVector p_srcLongPosVec, + in template (present) UInt16 p_seqNumber, + in template (present) GeoBroadcastArea p_broadcastArea + ) runs on ItsGeoNetworking { - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( - p_srcLongPosVec, - p_seqNumber, - p_broadcastArea - )))) { - } - } - - } // end geoGeoBroadcastAltsteps - - group geoGeoAnycastAltsteps { - - /** - * @desc Receive GeoAnycast packet - * @param p_srcLongPosVec Expected source position vector - * @param p_senderLongPosVec Expected sender position vector - * @param p_seqNumber Expected sequence number - */ - altstep a_receiveGeoAnycast( - in template (present) LongPosVector p_srcLongPosVec, - in template (present) LongPosVector p_senderLongPosVec, - in template (present) UInt16 p_seqNumber - ) runs on ItsGeoNetworking { + [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + p_srcLongPosVec, + p_seqNumber, + p_broadcastArea + )))) { + } + } + + } // end geoGeoBroadcastAltsteps + + group geoGeoAnycastAltsteps { + + /** + * @desc Receive GeoAnycast packet + * @param p_srcLongPosVec Expected source position vector + * @param p_senderLongPosVec Expected sender position vector + * @param p_seqNumber Expected sequence number + */ + altstep a_receiveGeoAnycast( + in template (present) LongPosVector p_srcLongPosVec, + in template (present) LongPosVector p_senderLongPosVec, + in template (present) UInt16 p_seqNumber + ) runs on ItsGeoNetworking { - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacket( - p_srcLongPosVec, - p_seqNumber - )))) { - } - } - - /** - * @desc Receive GeoAnycast packet with specific Area and HopLimit - * @param p_srcLongPosVec Expected source position vector - * @param p_senderLongPosVec Expected sender position vector - * @param p_seqNumber Expected sequence number - * @param p_anycastArea Expected geoAnycastArea - * @param p_hopLimit Expected hop limit - * @param p_maxHopLimit Expected max hop limit (Default: ?) - */ - altstep a_receiveGeoAnycastWithAreaWithHopLimit( - in template (present) LongPosVector p_srcLongPosVec, - in template (present) UInt16 p_seqNumber, - in template (present) GeoAnycastArea p_anycastArea, - in template (present) UInt8 p_hopLimit, - in template (present) UInt8 p_maxHopLimit := ? - ) runs on ItsGeoNetworking { + [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacket( + p_srcLongPosVec, + p_seqNumber + )))) { + } + } + + /** + * @desc Receive GeoAnycast packet with specific Area and HopLimit + * @param p_srcLongPosVec Expected source position vector + * @param p_senderLongPosVec Expected sender position vector + * @param p_seqNumber Expected sequence number + * @param p_anycastArea Expected geoAnycastArea + * @param p_hopLimit Expected hop limit + * @param p_maxHopLimit Expected max hop limit (Default: ?) + */ + altstep a_receiveGeoAnycastWithAreaWithHopLimit( + in template (present) LongPosVector p_srcLongPosVec, + in template (present) UInt16 p_seqNumber, + in template (present) GeoAnycastArea p_anycastArea, + in template (present) UInt8 p_hopLimit, + in template (present) UInt8 p_maxHopLimit := ? + ) runs on ItsGeoNetworking { - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( - p_srcLongPosVec, - p_seqNumber, - p_anycastArea - ), - -, - p_hopLimit - ))) { - } - } - - /** - * @desc Receive GeoAnycast packet for specific GeoAnycast Area - * @param p_srcLongPosVec Expected source position vector - * @param p_senderLongPosVec Expected sender position vector - * @param p_seqNumber Expected sequence number - * @param p_anycastArea Expected geoAnycastArea - */ - altstep a_receiveGeoAnycastWithArea( - in template (present) LongPosVector p_srcLongPosVec, - in template (present) UInt16 p_seqNumber, - in template (present) GeoAnycastArea p_anycastArea - ) runs on ItsGeoNetworking { + [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( + p_srcLongPosVec, + p_seqNumber, + p_anycastArea + ), + -, + p_hopLimit + ))) { + } + } + + /** + * @desc Receive GeoAnycast packet for specific GeoAnycast Area + * @param p_srcLongPosVec Expected source position vector + * @param p_senderLongPosVec Expected sender position vector + * @param p_seqNumber Expected sequence number + * @param p_anycastArea Expected geoAnycastArea + */ + altstep a_receiveGeoAnycastWithArea( + in template (present) LongPosVector p_srcLongPosVec, + in template (present) UInt16 p_seqNumber, + in template (present) GeoAnycastArea p_anycastArea + ) runs on ItsGeoNetworking { - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( - p_srcLongPosVec, - p_seqNumber, - p_anycastArea - )))) { - } - } - - } // end geoGeoAnycastAltsteps - - group geoLocationServiceAltsteps { - - /** - * @desc Receive Location Service Request - * @param p_seqNumber Expected sequence number of the received LS Request - * @param p_gnAddress GN address expected in received LS Request - * @param p_reqSrcPosVector Expected source position vector of the received LS Request - */ - altstep a_receiveLsRequest( - in template (present) UInt16 p_seqNumber, - in template (present) GN_Address.mid p_mid, - out LongPosVector p_reqSrcPosVector - ) runs on ItsGeoNetworking { - var GeoNetworkingInd v_msg; + [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( + p_srcLongPosVec, + p_seqNumber, + p_anycastArea + )))) { + } + } + + } // end geoGeoAnycastAltsteps + + group geoLocationServiceAltsteps { + + /** + * @desc Receive Location Service Request + * @param p_seqNumber Expected sequence number of the received LS Request + * @param p_gnAddress GN address expected in received LS Request + * @param p_reqSrcPosVector Expected source position vector of the received LS Request + */ + altstep a_receiveLsRequest( + in template (present) UInt16 p_seqNumber, + in template (present) GN_Address.mid p_mid, + out LongPosVector p_reqSrcPosVector + ) runs on ItsGeoNetworking { + var GeoNetworkingInd v_msg; - [vc_gnDefaultActive] geoNetworkingPort.receive( - mw_geoNwInd( - mw_geoNwPdu( - mw_geoNwLsRequestPacket( - p_seqNumber, - p_mid - ) - ) - ) - ) -> value v_msg { - p_reqSrcPosVector := valueof(v_msg.msgIn.gnPacket.packet.extendedHeader.lsRequestHeader.srcPosVector); - } - } - - /** - * @desc Receive any Location Service Request - */ - altstep a_receiveAnyLsRequest() runs on ItsGeoNetworking { - var LongPosVector v_reqSrcPosVector; + [vc_gnDefaultActive] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwLsRequestPacket( + p_seqNumber, + p_mid + ) + ) + ) + ) -> value v_msg { + p_reqSrcPosVector := valueof(v_msg.msgIn.gnPacket.packet.extendedHeader.lsRequestHeader.srcPosVector); + } + } + + /** + * @desc Receive any Location Service Request + */ + altstep a_receiveAnyLsRequest() runs on ItsGeoNetworking { + var LongPosVector v_reqSrcPosVector; - [vc_gnDefaultActive] a_receiveLsRequest(?, ?, v_reqSrcPosVector) {} - } - - /** - * @desc Receive any Location Service Reply - */ - altstep a_receiveAnyLsReply() runs on ItsGeoNetworking { - [vc_gnDefaultActive] geoNetworkingPort.receive( mw_geoNwInd( mw_geoNwPdu( mw_geoNwLsReplyPacket(?, ?) ))) { - //ignore and repeat - repeat; - } - } - - /** - * @desc Receive Location Service Request and send Location Service Reply - * @param p_reqSeqNumber Expected sequence number of the received LS Request - * @param p_gnAddress GN address expected in received LS Request - * @param p_repSrcPosVector Source position vector of the sent LS Response - * @param p_repSenderPosVector Sender position vector of the sent LS Response - */ - altstep a_receiveLsRequestAndReply( - in template (present) UInt16 p_reqSeqNumber, - in template (value) GN_Address.mid p_mid, - in template (value) LongPosVector p_repSrcPosVector, - in template (value) LongPosVector p_repSenderPosVector - ) runs on ItsGeoNetworking { - var LongPosVector v_repDstPosVector; + [vc_gnDefaultActive] a_receiveLsRequest(?, ?, v_reqSrcPosVector) {} + } + + /** + * @desc Receive any Location Service Reply + */ + altstep a_receiveAnyLsReply() runs on ItsGeoNetworking { + [vc_gnDefaultActive] geoNetworkingPort.receive( mw_geoNwInd( mw_geoNwPdu( mw_geoNwLsReplyPacket(?, ?) ))) { + //ignore and repeat + repeat; + } + } + + /** + * @desc Receive Location Service Request and send Location Service Reply + * @param p_reqSeqNumber Expected sequence number of the received LS Request + * @param p_gnAddress GN address expected in received LS Request + * @param p_repSrcPosVector Source position vector of the sent LS Response + * @param p_repSenderPosVector Sender position vector of the sent LS Response + */ + altstep a_receiveLsRequestAndReply( + in template (present) UInt16 p_reqSeqNumber, + in template (value) GN_Address.mid p_mid, + in template (value) LongPosVector p_repSrcPosVector, + in template (value) LongPosVector p_repSenderPosVector + ) runs on ItsGeoNetworking { + var LongPosVector v_repDstPosVector; - [vc_gnDefaultActive] a_receiveLsRequest(p_reqSeqNumber, p_mid, v_repDstPosVector) { - f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(m_geoNwPdu( - m_geoNwLsReplyPacket( - p_repSrcPosVector, - f_longPosVector2ShortPosVector(v_repDstPosVector), - vc_localSeqNumber - ))))); - } - } + [vc_gnDefaultActive] a_receiveLsRequest(p_reqSeqNumber, p_mid, v_repDstPosVector) { + f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(m_geoNwPdu( + m_geoNwLsReplyPacket( + p_repSrcPosVector, + f_longPosVector2ShortPosVector(v_repDstPosVector), + vc_localSeqNumber + ))))); + } + } - } // end geoLocationServiceAltsteps + } // end geoLocationServiceAltsteps - } // end geoAltsteps + } // end geoAltsteps - group preambles { - - /** - * @desc The default preamble. - */ - function f_prDefault() runs on ItsGeoNetworking { - activate(a_default()); - activate(a_utDefault()); - } + group preambles { + + /** + * @desc The default preamble. + */ + function f_prDefault() runs on ItsGeoNetworking { + activate(a_default()); + activate(a_utDefault()); + } - /** - * @desc Preamble for non-neighbour nodes - */ - function f_prNonNeighbour() runs on ItsGeoNetworking { - f_prDefault(); - } + /** + * @desc Preamble for non-neighbour nodes + */ + function f_prNonNeighbour() runs on ItsGeoNetworking { + f_prDefault(); + } - /** - * @desc Preamble for neighbour nodes - */ - function f_prNeighbour() runs on ItsGeoNetworking { - f_prDefault(); - f_startBeingNeighbour(); - f_sleep(0.5); - } + /** + * @desc Preamble for neighbour nodes + */ + function f_prNeighbour() runs on ItsGeoNetworking { + f_prDefault(); + f_startBeingNeighbour(); + f_sleep(0.5); + } - /** - * @desc Brings the IUT into an initial state. - * @remark Component variable vc_hashedId8ToBeUsed shall be set with the IUT certificate to be used - */ - function f_initialState(Scenario p_scenario := e_staticPosition) runs on ItsBaseGeoNetworking { - - if (PICS_GN_SECURITY) { - var Oct8 v_hashedId8ToBeUsed := f_setupIutCertificate(vc_hashedId8ToBeUsed); - if (oct2int(v_hashedId8ToBeUsed) == 0) { - v_hashedId8ToBeUsed := 'FFFFFFFFFFFFFFFF'O; // Reset to unknown value, the IUT will use its own certificates - } - f_utInitializeIut(m_secGnInitialize(v_hashedId8ToBeUsed)); - } // else, default behavior - else { - f_utInitializeIut(m_gnInitialize); - } - - f_acLoadScenario(p_scenario); - f_acStartScenario(); - } + /** + * @desc Brings the IUT into an initial state. + * @remark Component variable vc_hashedId8ToBeUsed shall be set with the IUT certificate to be used + */ + function f_initialState(Scenario p_scenario := e_staticPosition) runs on ItsBaseGeoNetworking { + + if (PICS_GN_SECURITY) { + var Oct8 v_hashedId8ToBeUsed := f_setupIutCertificate(vc_hashedId8ToBeUsed); + if (oct2int(v_hashedId8ToBeUsed) == 0) { + v_hashedId8ToBeUsed := 'FFFFFFFFFFFFFFFF'O; // Reset to unknown value, the IUT will use its own certificates + } + f_utInitializeIut(m_secGnInitialize(v_hashedId8ToBeUsed)); + } // else, default behavior + else { + f_utInitializeIut(m_gnInitialize); + } + + f_acLoadScenario(p_scenario); + f_acStartScenario(); + } - /** - * @desc Receive and reply to LS Requests - * @param p_reqSeqNumber Expected sequence number of the received LS Request - * @param p_gnAddress GN address expected in received LS Request - * @param p_repSrcPosVector Source position vector of the sent LS Response - * @param p_repSenderPosVector Sender position vector of the sent LS Response - */ - function f_handleLocationService( - in template (present) UInt16 p_reqSeqNumber, - in template (value) GN_Address.mid p_mid, - in template (value) LongPosVector p_repSrcPosVector, - in template (value) LongPosVector p_repSenderPosVector - ) runs on ItsGeoNetworking { - - tc_ac.start; - alt { - [] a_receiveLsRequestAndReply(p_reqSeqNumber, p_mid, p_repSrcPosVector, p_repSenderPosVector) { - tc_ac.stop; - } - } + /** + * @desc Receive and reply to LS Requests + * @param p_reqSeqNumber Expected sequence number of the received LS Request + * @param p_gnAddress GN address expected in received LS Request + * @param p_repSrcPosVector Source position vector of the sent LS Response + * @param p_repSenderPosVector Sender position vector of the sent LS Response + */ + function f_handleLocationService( + in template (present) UInt16 p_reqSeqNumber, + in template (value) GN_Address.mid p_mid, + in template (value) LongPosVector p_repSrcPosVector, + in template (value) LongPosVector p_repSenderPosVector + ) runs on ItsGeoNetworking { + + tc_ac.start; + alt { + [] a_receiveLsRequestAndReply(p_reqSeqNumber, p_mid, p_repSrcPosVector, p_repSenderPosVector) { + tc_ac.stop; + } + } - } + } - /** - * @desc Send LS request and receive LS Reply - * @param p_reqSrcPosVector Source position vector of the sent LS Request - * @param p_reqSeqNumber Sequence number of the sent LS Request - * @param p_gnAddress GN address for which the LS Request is sent - * @param p_repSrcPosVector Expected source position vector in received LS Response - * @return FncRetCode - */ - function f_processLocationService( - in template (value) LongPosVector p_reqSrcPosVector, - in template (value) UInt16 p_reqSeqNumber, - in template (value) GN_Address p_gnAddress, - out LongPosVector p_repSrcPosVector - ) runs on ItsGeoNetworking return FncRetCode { - var FncRetCode v_ret := e_error; - var GeoNetworkingInd v_msg; - - f_sendGeoNetMessage( - valueof( - m_geoNwReq_linkLayerBroadcast( - m_geoNwPdu( - m_geoNwLsRequestPacket( - p_reqSrcPosVector, - p_reqSeqNumber, - p_gnAddress - ) - ) - ) - ) - ); - - tc_ac.start; - alt { - [] geoNetworkingPort.receive( - mw_geoNwInd( - mw_geoNwPdu( - mw_geoNwLsReplyPacket( - ?, - mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(valueof(p_reqSrcPosVector))) - ) - ) - ) - ) -> value v_msg { - tc_ac.stop; - p_repSrcPosVector := valueof(v_msg.msgIn.gnPacket.packet.extendedHeader.lsReplyHeader.srcPosVector); - v_ret := e_success; - } - } - - return v_ret; - } + /** + * @desc Send LS request and receive LS Reply + * @param p_reqSrcPosVector Source position vector of the sent LS Request + * @param p_reqSeqNumber Sequence number of the sent LS Request + * @param p_gnAddress GN address for which the LS Request is sent + * @param p_repSrcPosVector Expected source position vector in received LS Response + * @return FncRetCode + */ + function f_processLocationService( + in template (value) LongPosVector p_reqSrcPosVector, + in template (value) UInt16 p_reqSeqNumber, + in template (value) GN_Address p_gnAddress, + out LongPosVector p_repSrcPosVector + ) runs on ItsGeoNetworking return FncRetCode { + var FncRetCode v_ret := e_error; + var GeoNetworkingInd v_msg; + + f_sendGeoNetMessage( + valueof( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwLsRequestPacket( + p_reqSrcPosVector, + p_reqSeqNumber, + p_gnAddress + ) + ) + ) + ) + ); + + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwLsReplyPacket( + ?, + mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(valueof(p_reqSrcPosVector))) + ) + ) + ) + ) -> value v_msg { + tc_ac.stop; + p_repSrcPosVector := valueof(v_msg.msgIn.gnPacket.packet.extendedHeader.lsReplyHeader.srcPosVector); + v_ret := e_success; + } + } + + return v_ret; + } - } // end preambles + } // end preambles - group postambles { + group postambles { - /** - * @desc The default postamble. - */ - function f_poDefault() runs on ItsGeoNetworking { - f_acStopScenario(); - } + /** + * @desc The default postamble. + */ + function f_poDefault() runs on ItsGeoNetworking { + f_acStopScenario(); + } - /** - * @desc Postamble for neighbour nodes - */ - function f_poNeighbour() runs on ItsGeoNetworking { - f_stopBeingNeighbour(); - f_poDefault(); - } + /** + * @desc Postamble for neighbour nodes + */ + function f_poNeighbour() runs on ItsGeoNetworking { + f_stopBeingNeighbour(); + f_poDefault(); + } - } // end postambles + } // end postambles - group adapterControl { + group adapterControl { - /** - * @desc Triggers event in the test system adaptation. - * @param p_event The event to trigger - * @return FncRetCode - */ - function f_acTriggerEvent(template (value) AcGnPrimitive p_event) runs on ItsBaseGeoNetworking return FncRetCode { - var FncRetCode v_ret := e_success; + /** + * @desc Triggers event in the test system adaptation. + * @param p_event The event to trigger + * @return FncRetCode + */ + function f_acTriggerEvent(template (value) AcGnPrimitive p_event) runs on ItsBaseGeoNetworking return FncRetCode { + var FncRetCode v_ret := e_success; - acPort.send(p_event); + acPort.send(p_event); - return v_ret; - } + return v_ret; + } - /** - * @desc Get the position vector corresponding to a specific GN address - * @param p_gnAddress GN address for which the search is performed - * @return LongPosVector - IUT's position - */ - function f_acGetLongPosVector(GN_Address p_gnAddress) runs on ItsBaseGeoNetworking return LongPosVector { - var AcGnResponse v_result; - - f_acTriggerEvent(m_getLongPosVector(p_gnAddress)); - tc_ac.start; - alt { - [] acPort.receive(mw_getLongPosVectorAny(p_gnAddress)) -> value v_result { - tc_ac.stop; - } - [] acPort.receive { - tc_ac.stop; - log("*** f_acGetLongPosVector: ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** f_acGetLongPosVector: ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } + /** + * @desc Get the position vector corresponding to a specific GN address + * @param p_gnAddress GN address for which the search is performed + * @return LongPosVector - IUT's position + */ + function f_acGetLongPosVector(GN_Address p_gnAddress) runs on ItsBaseGeoNetworking return LongPosVector { + var AcGnResponse v_result; - return v_result.getLongPosVector; + f_acTriggerEvent(m_getLongPosVector(p_gnAddress)); + tc_ac.start; + alt { + [] acPort.receive(mw_getLongPosVectorAny(p_gnAddress)) -> value v_result { + tc_ac.stop; } + [] acPort.receive { + tc_ac.stop; + log("*** f_acGetLongPosVector: ERROR: Received unexpected message ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] tc_ac.timeout { + log("*** f_acGetLongPosVector: ERROR: Timeout while waiting for adapter control event result ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } + + return v_result.getLongPosVector; + } - /** - * @desc Triggers test adapter to send beacons for multiple neighbours - * @param p_numberOfNeighbour Number of neighbours to simulate - * @return FncRetCode - */ - function f_acStartBeaconingMultipleNeighbour(in integer p_numberOfNeighbour) runs on ItsGeoNetworking return FncRetCode { + /** + * @desc Triggers test adapter to send beacons for multiple neighbours + * @param p_numberOfNeighbour Number of neighbours to simulate + * @return FncRetCode + */ + function f_acStartBeaconingMultipleNeighbour(in integer p_numberOfNeighbour) runs on ItsGeoNetworking return FncRetCode { - return f_acTriggerEvent(m_startBeaconingMultipleNeighbour(m_beaconHeader(f_getPosition(vc_componentName)).beaconHeader, p_numberOfNeighbour)); + return f_acTriggerEvent(m_startBeaconingMultipleNeighbour(m_beaconHeader(f_getPosition(vc_componentName)).beaconHeader, p_numberOfNeighbour)); - } + } - /** - * @desc Triggers test adapter to enable security support - * @return FncRetCode - */ - function f_acEnableSecurity() runs on ItsBaseGeoNetworking return FncRetCode { + /** + * @desc Triggers test adapter to enable security support + * @return FncRetCode + */ + function f_acEnableSecurity() runs on ItsBaseGeoNetworking return FncRetCode { - // Local variables + // Local variables - // Load certificates - if (PICS_GN_SECURITY) { - if( not f_loadCertificates(PX_IUT_SEC_CONFIG_NAME) ) { - return e_error; - } - - // Initialize vc_location - f_setGenerationLocation( - f_getTsLatitude(), - f_getTsLongitude() - ); - return f_acTriggerSecEvent(m_acEnableSecurity(cc_taCert_A)); - } - return f_acTriggerSecEvent(m_acEnableSecurity(PX_CERT_FOR_TS)); + // Load certificates + if (PICS_GN_SECURITY) { + if( not f_loadCertificates(PX_IUT_SEC_CONFIG_NAME) ) { + return e_error; } + + // Initialize vc_location + f_setGenerationLocation( + f_getTsLatitude(), + f_getTsLongitude() + ); + return f_acTriggerSecEvent(m_acEnableSecurity(cc_taCert_A)); + } + return f_acTriggerSecEvent(m_acEnableSecurity(PX_CERT_FOR_TS)); + } - /** - * @desc Triggers test adapter to disable security support - * @return FncRetCode - */ - function f_acDisableSecurity() runs on ItsBaseGeoNetworking return FncRetCode { + /** + * @desc Triggers test adapter to disable security support + * @return FncRetCode + */ + function f_acDisableSecurity() runs on ItsBaseGeoNetworking return FncRetCode { - f_unloadCertificates(); + f_unloadCertificates(); - return f_acTriggerSecEvent(m_acDisableSecurity); + return f_acTriggerSecEvent(m_acDisableSecurity); - } + } - /** - * @desc Triggers event in the test system adaptation. - * @param p_event The event to trigger - * @return FncRetCode - */ - function f_acTriggerSecEvent( - in template (value) AcSecPrimitive p_event - ) runs on ItsBaseGeoNetworking return FncRetCode { - var FncRetCode v_ret := e_success; - - acPort.send(p_event); - tc_ac.start; - alt { - [] acPort.receive(m_acSecResponseSuccess) { - tc_ac.stop; - } - [] acPort.receive { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - return v_ret; - } + /** + * @desc Triggers event in the test system adaptation. + * @param p_event The event to trigger + * @return FncRetCode + */ + function f_acTriggerSecEvent( + in template (value) AcSecPrimitive p_event + ) runs on ItsBaseGeoNetworking return FncRetCode { + var FncRetCode v_ret := e_success; + + acPort.send(p_event); + tc_ac.start; + alt { + [] acPort.receive(m_acSecResponseSuccess) { + tc_ac.stop; + } + [] acPort.receive { + tc_ac.stop; + log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] tc_ac.timeout { + log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for adapter control event result ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } + + return v_ret; + } - /** - * @desc Triggers event in the test system adaptation. - * @param p_event The event to trigger - * @return FncRetCode - */ - function f_acTriggerGnssEvent(template (value) AcGnssPrimitive p_event) runs on ItsBaseGeoNetworking return FncRetCode { - var FncRetCode v_ret := e_success; - - acPort.send(p_event); - tc_ac.start; - alt { - [] acPort.receive(m_acGnssResponseSuccess) { - tc_ac.stop; - } - [] acPort.receive { - tc_ac.stop; - log("*** f_acTriggerEvent: ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** f_acTriggerEvent: ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } + /** + * @desc Triggers event in the test system adaptation. + * @param p_event The event to trigger + * @return FncRetCode + */ + function f_acTriggerGnssEvent(template (value) AcGnssPrimitive p_event) runs on ItsBaseGeoNetworking return FncRetCode { + var FncRetCode v_ret := e_success; - return v_ret; + acPort.send(p_event); + tc_ac.start; + alt { + [] acPort.receive(m_acGnssResponseSuccess) { + tc_ac.stop; } - - /** - * @desc Loads the given scenario - * - * @param p_scenario The scenario to load. - */ - function f_acLoadScenario(Scenario p_scenario) runs on ItsBaseGeoNetworking { - - if (PX_GNSS_SCENARIO_SUPPORT==true) { - f_acTriggerGnssEvent(m_loadScenario(p_scenario)); - } - } // end f_acLoadScenario - - /** - * @desc Starts a loaded scenario - */ - function f_acStartScenario() runs on ItsBaseGeoNetworking { - - if (PX_GNSS_SCENARIO_SUPPORT==true) { - f_acTriggerGnssEvent(m_startScenario); - vc_scenarioStarted := true; - } - } // end f_acStartScenario - - /** - * @desc Stops a loaded scenario - */ - function f_acStopScenario() runs on ItsBaseGeoNetworking { + [] acPort.receive { + tc_ac.stop; + log("*** f_acTriggerEvent: ERROR: Received unexpected message ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] tc_ac.timeout { + log("*** f_acTriggerEvent: ERROR: Timeout while waiting for adapter control event result ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } - if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { - f_acTriggerGnssEvent(m_stopScenario); - vc_scenarioStarted := false; - } - } // end f_acStopScenario + return v_ret; + } - } // end adapterControl + /** + * @desc Loads the given scenario + * + * @param p_scenario The scenario to load. + */ + function f_acLoadScenario(Scenario p_scenario) runs on ItsBaseGeoNetworking { + + if (PX_GNSS_SCENARIO_SUPPORT==true) { + f_acTriggerGnssEvent(m_loadScenario(p_scenario)); + } + } // end f_acLoadScenario + + /** + * @desc Starts a loaded scenario + */ + function f_acStartScenario() runs on ItsBaseGeoNetworking { + + if (PX_GNSS_SCENARIO_SUPPORT==true) { + f_acTriggerGnssEvent(m_startScenario); + vc_scenarioStarted := true; + } + } // end f_acStartScenario + + /** + * @desc Stops a loaded scenario + */ + function f_acStopScenario() runs on ItsBaseGeoNetworking { + + if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { + f_acTriggerGnssEvent(m_stopScenario); + vc_scenarioStarted := false; + } + } // end f_acStopScenario + + } // end adapterControl - group commonFunctions { - - /** - * @desc Gets the value of the lifetime in seconds. - * @param p_lifetime Lifetime to be converted - * @return Lifetime in seconds - */ - function f_getLifetimeValue(in Lifetime p_lifetime) runs on ItsGeoNetworking return float { - var float v_lifetime := 0.0; + group commonFunctions { + + /** + * @desc Gets the value of the lifetime in seconds. + * @param p_lifetime Lifetime to be converted + * @return Lifetime in seconds + */ + function f_getLifetimeValue(in Lifetime p_lifetime) runs on ItsGeoNetworking return float { + var float v_lifetime := 0.0; - select (p_lifetime.ltBase) { - case (e_50ms) { - v_lifetime := int2float(p_lifetime.multiplier) * 0.5; - } - case (e_1s) { - v_lifetime := int2float(p_lifetime.multiplier) * 1.0; - } - case (e_10s) { - v_lifetime := int2float(p_lifetime.multiplier) * 10.0; - } - case (e_100s) { - v_lifetime := int2float(p_lifetime.multiplier) * 100.0; - } - } + select (p_lifetime.ltBase) { + case (e_50ms) { + v_lifetime := int2float(p_lifetime.multiplier) * 0.5; + } + case (e_1s) { + v_lifetime := int2float(p_lifetime.multiplier) * 1.0; + } + case (e_10s) { + v_lifetime := int2float(p_lifetime.multiplier) * 10.0; + } + case (e_100s) { + v_lifetime := int2float(p_lifetime.multiplier) * 100.0; + } + } - return v_lifetime; - } + return v_lifetime; + } - /** - * @desc Computes GN timestamp based on current time - * @return Unix-Epoch-Time mod 2^32 - */ - function f_computeGnTimestamp() return UInt32 { + /** + * @desc Computes GN timestamp based on current time + * @return Unix-Epoch-Time mod 2^32 + */ + function f_computeGnTimestamp() return UInt32 { - // Timestamp is 1s older than current time to avoid sending beacons coming from the future (time sync between nodes) - var UInt32 v_timestamp := fx_computeGnTimestamp() - 1000; - return v_timestamp; - } + // Timestamp is 1s older than current time to avoid sending beacons coming from the future (time sync between nodes) + var UInt32 v_timestamp := fx_computeGnTimestamp() - 1000; + return v_timestamp; + } - } // end commonFunctions + } // end commonFunctions - group testerFunctions { - - /** - * @desc Gets the tester GN local address for a specific node - * @param p_node Simulated node - * @return GN address of simulated node - */ - function f_getTsGnLocalAddress(in charstring p_node) return GN_Address { - var GN_Address v_gnAddr := valueof(m_dummyGnAddr); - - select (p_node) { - case (c_compNodeA) { - v_gnAddr := PX_TS_NODE_A_LOCAL_GN_ADDR; - } - case (c_compNodeB) { - v_gnAddr := PX_TS_NODE_B_LOCAL_GN_ADDR; - } - case (c_compNodeC) { - v_gnAddr := PX_TS_NODE_C_LOCAL_GN_ADDR; - } - case (c_compNodeD) { - v_gnAddr := PX_TS_NODE_D_LOCAL_GN_ADDR; - } - case (c_compNodeE) { - v_gnAddr := PX_TS_NODE_E_LOCAL_GN_ADDR; - } - case (c_compNodeF) { - v_gnAddr := PX_TS_NODE_F_LOCAL_GN_ADDR; - } - case else { - log("*** f_getTsGnLocalAddress: INFO: Unknown component " & p_node & " ***"); - } - } - - return v_gnAddr; - } + group testerFunctions { + + /** + * @desc Gets the tester GN local address for a specific node + * @param p_node Simulated node + * @return GN address of simulated node + */ + function f_getTsGnLocalAddress(in charstring p_node) return GN_Address { + var GN_Address v_gnAddr := valueof(m_dummyGnAddr); + + select (p_node) { + case (c_compNodeA) { + v_gnAddr := PX_TS_NODE_A_LOCAL_GN_ADDR; + } + case (c_compNodeB) { + v_gnAddr := PX_TS_NODE_B_LOCAL_GN_ADDR; + } + case (c_compNodeC) { + v_gnAddr := PX_TS_NODE_C_LOCAL_GN_ADDR; + } + case (c_compNodeD) { + v_gnAddr := PX_TS_NODE_D_LOCAL_GN_ADDR; + } + case (c_compNodeE) { + v_gnAddr := PX_TS_NODE_E_LOCAL_GN_ADDR; + } + case (c_compNodeF) { + v_gnAddr := PX_TS_NODE_F_LOCAL_GN_ADDR; + } + case else { + log("*** f_getTsGnLocalAddress: INFO: Unknown component " & p_node & " ***"); + } + } + + return v_gnAddr; + } - /** - * @desc Sends a GeoNetworking message and in case of an included sequence number in the message the - * local sequence number will be increased by one. - * @param p_geoNetReq The message to send. - */ - function f_sendGeoNetMessage(in template (value) GeoNetworkingReq p_geoNetReq) runs on ItsGeoNetworking { - geoNetworkingPort.send(p_geoNetReq); - if (not (ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.shbHeader) - or ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.beaconHeader))) { - f_setLocalSequenceNumber(); - } - } + /** + * @desc Sends a GeoNetworking message and in case of an included sequence number in the message the + * local sequence number will be increased by one. + * @param p_geoNetReq The message to send. + */ + function f_sendGeoNetMessage(in template (value) GeoNetworkingReq p_geoNetReq) runs on ItsGeoNetworking { + geoNetworkingPort.send(p_geoNetReq); + if (not (ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.shbHeader) + or ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.beaconHeader))) { + f_setLocalSequenceNumber(); + } + } - /** - * @desc Sends a GeoNetworking message with a payload and in case of an included sequence number in the message the - * local sequence number will be increased by one. - * @param p_geoNetReq The message to send. - * @param p_payload The payload to include. - */ - function f_sendGeoNetMessageWithPayload( - in template (value) GeoNetworkingReq p_geoNetReq, - in template (value) GnRawPayload p_payload - ) runs on ItsGeoNetworking { - p_geoNetReq.msgOut.gnPacket.packet.payload := p_payload; - geoNetworkingPort.send(p_geoNetReq); - if (not (ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.shbHeader) - or ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.beaconHeader))) { - f_setLocalSequenceNumber(); - } - } + /** + * @desc Sends a GeoNetworking message with a payload and in case of an included sequence number in the message the + * local sequence number will be increased by one. + * @param p_geoNetReq The message to send. + * @param p_payload The payload to include. + */ + function f_sendGeoNetMessageWithPayload( + in template (value) GeoNetworkingReq p_geoNetReq, + in template (value) GnRawPayload p_payload + ) runs on ItsGeoNetworking { + p_geoNetReq.msgOut.gnPacket.packet.payload := p_payload; + geoNetworkingPort.send(p_geoNetReq); + if (not (ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.shbHeader) + or ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.beaconHeader))) { + f_setLocalSequenceNumber(); + } + } - /** - * @desc Receive a GeoNetworking message with a payload and in case of an included sequence number in the message the - * local sequence number will be increased by one. - * @param p_geoNetInd The message to receive. - * @param p_payload The payload to include. - */ - function f_receiveGeoNetMessageWithPayload( - in template (present) GeoNetworkingInd p_geoNetInd, - in template (present) GnRawPayload p_payload - ) return template (present) GeoNetworkingInd { - var template (present) GeoNetworkingInd v_geoNetInd := p_geoNetInd; - - v_geoNetInd.msgIn.gnPacket.packet.payload := p_payload; - - return v_geoNetInd; - } + /** + * @desc Receive a GeoNetworking message with a payload and in case of an included sequence number in the message the + * local sequence number will be increased by one. + * @param p_geoNetInd The message to receive. + * @param p_payload The payload to include. + */ + function f_receiveGeoNetMessageWithPayload( + in template (present) GeoNetworkingInd p_geoNetInd, + in template (present) GnRawPayload p_payload + ) return template (present) GeoNetworkingInd { + var template (present) GeoNetworkingInd v_geoNetInd := p_geoNetInd; + + v_geoNetInd.msgIn.gnPacket.packet.payload := p_payload; + + return v_geoNetInd; + } - /** - * @desc Sets the value of the sequence number for the next event. - */ - function f_setLocalSequenceNumber() runs on ItsGeoNetworking { - vc_localSeqNumber := (vc_localSeqNumber + 1) mod c_uInt16Max; - } + /** + * @desc Sets the value of the sequence number for the next event. + */ + function f_setLocalSequenceNumber() runs on ItsGeoNetworking { + vc_localSeqNumber := (vc_localSeqNumber + 1) mod c_uInt16Max; + } - /** - * @desc Creates an initial seqence number - * @return Time based initial sequence number (increasing with time) - */ - function f_getInitialSequenceNumber() return UInt16 { + /** + * @desc Creates an initial seqence number + * @return Time based initial sequence number (increasing with time) + */ + function f_getInitialSequenceNumber() return UInt16 { - return (f_computeGnTimestamp() / 1000) mod c_uInt16Max; - } + return (f_computeGnTimestamp() / 1000) mod c_uInt16Max; + } - /** - * @desc Number of messages to be sent - * @return Number of messages to be sent - */ - function f_getMessageCount() return integer { - return PX_MESSAGE_COUNT; - } + /** + * @desc Number of messages to be sent + * @return Number of messages to be sent + */ + function f_getMessageCount() return integer { + return PX_MESSAGE_COUNT; + } - } // end testerFunctions + } // end testerFunctions - group iutFunctions { + group iutFunctions { - /** - * @desc Gets the IUT GN local address - * @return IUT's GN_Address - * @see PICS_GN_LOCAL_GN_ADDR - */ - function f_getIutGnLocalAddress() return GN_Address { + /** + * @desc Gets the IUT GN local address + * @return IUT's GN_Address + * @see PICS_GN_LOCAL_GN_ADDR + */ + function f_getIutGnLocalAddress() return GN_Address { - return PICS_GN_LOCAL_GN_ADDR; - } + return PICS_GN_LOCAL_GN_ADDR; + } - /** - * @desc Gets the IUT GN local address configuration method - * @return GnAddressConfigurationMethod - IUT's GN local address configuration method - * @see PICS_GN_LOCAL_ADDR_CONF_METHOD - */ - function f_getIutGnLocalAddressConfigurationMethod() return GnAddressConfigurationMethod { - return PICS_GN_LOCAL_ADDR_CONF_METHOD; - } + /** + * @desc Gets the IUT GN local address configuration method + * @return GnAddressConfigurationMethod - IUT's GN local address configuration method + * @see PICS_GN_LOCAL_ADDR_CONF_METHOD + */ + function f_getIutGnLocalAddressConfigurationMethod() return GnAddressConfigurationMethod { + return PICS_GN_LOCAL_ADDR_CONF_METHOD; + } - /** - * @desc Gets the IUT MAc address - * @return MacAddress - IUT's MAc Address - * @see PICS_IUT_MAC_ADDRESS - */ - function f_getIutMacAddress() return MacAddress { - return PICS_IUT_MAC_ADDRESS; - } + /** + * @desc Gets the IUT MAc address + * @return MacAddress - IUT's MAc Address + * @see PICS_IUT_MAC_ADDRESS + */ + function f_getIutMacAddress() return MacAddress { + return PICS_IUT_MAC_ADDRESS; + } - /** - * @desc Gets the GeoUnicast forwarding algorithm - * @return IUT's GeoUnicast forwarding algorithm - * @see PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM - */ - function f_getGeoUnicastForwardingAlgorithm() return GeoUnicastForwardingAlgorithm { - return PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM; - } + /** + * @desc Gets the GeoUnicast forwarding algorithm + * @return IUT's GeoUnicast forwarding algorithm + * @see PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM + */ + function f_getGeoUnicastForwardingAlgorithm() return GeoUnicastForwardingAlgorithm { + return PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM; + } - /** - * @desc Gets the GeoBroadcast forwarding algorithm - * @return IUT's GeoBroadcast forwarding algorithm - * @see PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM - */ - function f_getGeoBroadcastForwardingAlgorithm() return GeoBroadcastForwardingAlgorithm { - return PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM; - } + /** + * @desc Gets the GeoBroadcast forwarding algorithm + * @return IUT's GeoBroadcast forwarding algorithm + * @see PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM + */ + function f_getGeoBroadcastForwardingAlgorithm() return GeoBroadcastForwardingAlgorithm { + return PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM; + } - /** - * @desc Gets the IUT default hop limit - * @return IUT's default hop limit - * @see PICS_GN_DEFAULT_HOP_LIMIT - */ - function f_getDefaultHopLimit() return UInt8 { - return PICS_GN_DEFAULT_HOP_LIMIT; - } + /** + * @desc Gets the IUT default hop limit + * @return IUT's default hop limit + * @see PICS_GN_DEFAULT_HOP_LIMIT + */ + function f_getDefaultHopLimit() return UInt8 { + return PICS_GN_DEFAULT_HOP_LIMIT; + } - /** - * @desc Is the ITS-S mobile or stationary? - * @return Flags indicating whether the ITS-S is mobile or stationary. - * @see PICS_GN_IS_MOBILE - */ - function f_isMobile() return Bit8 { - if (PICS_GN_IS_MOBILE) { - return '10000000'B; - } - return '00000000'B; - } + /** + * @desc Is the ITS-S mobile or stationary? + * @return Flags indicating whether the ITS-S is mobile or stationary. + * @see PICS_GN_IS_MOBILE + */ + function f_isMobile() return Bit8 { + if (PICS_GN_IS_MOBILE) { + return '10000000'B; + } + return '00000000'B; + } - /** - * @desc Gets the LS retransmission timer.. Valid for NetRepInterval = default (cong. ctrl). - * @return LS retransmission timer in seconds - * @see PICS_GN_LOCATION_SERVICE_RETRANSMIT_TIMER - */ - function f_getLsRetransmitTimer() return float { - var float v_itsGnLocationServiceRetransmitTimer := int2float(PICS_GN_LOCATION_SERVICE_RETRANSMIT_TIMER/1000); + /** + * @desc Gets the LS retransmission timer.. Valid for NetRepInterval = default (cong. ctrl). + * @return LS retransmission timer in seconds + * @see PICS_GN_LOCATION_SERVICE_RETRANSMIT_TIMER + */ + function f_getLsRetransmitTimer() return float { + var float v_itsGnLocationServiceRetransmitTimer := int2float(PICS_GN_LOCATION_SERVICE_RETRANSMIT_TIMER/1000); - return v_itsGnLocationServiceRetransmitTimer; - } + return v_itsGnLocationServiceRetransmitTimer; + } - /** - * @desc Gets the LS retransmission timer for NetRepInterval = medium (cong. ctrl). - * @return LS retransmission timer (medium) in seconds - * @see PX_GN_LOCATION_SERVICE_TIMER_MEDIUM - */ - function f_getLsRetransmitTimerMedium() return float { - var float v_itsGnLocationServiceRetransmitTimerMedium := int2float(PX_GN_LOCATION_SERVICE_TIMER_MEDIUM/1000); + /** + * @desc Gets the LS retransmission timer for NetRepInterval = medium (cong. ctrl). + * @return LS retransmission timer (medium) in seconds + * @see PX_GN_LOCATION_SERVICE_TIMER_MEDIUM + */ + function f_getLsRetransmitTimerMedium() return float { + var float v_itsGnLocationServiceRetransmitTimerMedium := int2float(PX_GN_LOCATION_SERVICE_TIMER_MEDIUM/1000); - return v_itsGnLocationServiceRetransmitTimerMedium; - } + return v_itsGnLocationServiceRetransmitTimerMedium; + } - /** - * @desc Gets the LS retransmission timer for NetRepInterval = maximum (cong. ctrl). - * @return LS retransmission timer (maximum) in seconds - * @see PX_GN_LOCATION_SERVICE_TIMER_MAXIMUM - */ - function f_getLsRetransmitTimerMaximum() return float { - var float v_itsGnLocationServiceRetransmitTimerMaximum := int2float(PX_GN_LOCATION_SERVICE_TIMER_MAXIMUM/1000); + /** + * @desc Gets the LS retransmission timer for NetRepInterval = maximum (cong. ctrl). + * @return LS retransmission timer (maximum) in seconds + * @see PX_GN_LOCATION_SERVICE_TIMER_MAXIMUM + */ + function f_getLsRetransmitTimerMaximum() return float { + var float v_itsGnLocationServiceRetransmitTimerMaximum := int2float(PX_GN_LOCATION_SERVICE_TIMER_MAXIMUM/1000); - return v_itsGnLocationServiceRetransmitTimerMaximum; - } + return v_itsGnLocationServiceRetransmitTimerMaximum; + } - /** - * @desc Gets the App retransmission timer. Valid for AppRepInterval = default (cong. ctrl). - * @return App retransmission timer in seconds - * @see PX_GN_APPLICATION_RETRANSMIT_TIMER - */ - function f_getAppRetransmitTimer() return float { - var float v_itsGnLocationApplicationRetransmitTimer := int2float(PX_GN_APPLICATION_RETRANSMIT_TIMER/1000); + /** + * @desc Gets the App retransmission timer. Valid for AppRepInterval = default (cong. ctrl). + * @return App retransmission timer in seconds + * @see PX_GN_APPLICATION_RETRANSMIT_TIMER + */ + function f_getAppRetransmitTimer() return float { + var float v_itsGnLocationApplicationRetransmitTimer := int2float(PX_GN_APPLICATION_RETRANSMIT_TIMER/1000); - return v_itsGnLocationApplicationRetransmitTimer; - } + return v_itsGnLocationApplicationRetransmitTimer; + } - /** - * @desc Gets the App retransmission timer for AppRepInterval = medium (cong. ctrl). - * @return App retransmission timer (medium) in seconds - * @see PX_GN_APPLICATION_RETRANSMIT_TIMER_MEDIUM - */ - function f_getAppRetransmitTimerMedium() return float { - var float v_itsGnLocationApplicationRetransmitTimerMedium := int2float(PX_GN_APPLICATION_RETRANSMIT_TIMER_MEDIUM/1000); + /** + * @desc Gets the App retransmission timer for AppRepInterval = medium (cong. ctrl). + * @return App retransmission timer (medium) in seconds + * @see PX_GN_APPLICATION_RETRANSMIT_TIMER_MEDIUM + */ + function f_getAppRetransmitTimerMedium() return float { + var float v_itsGnLocationApplicationRetransmitTimerMedium := int2float(PX_GN_APPLICATION_RETRANSMIT_TIMER_MEDIUM/1000); - return v_itsGnLocationApplicationRetransmitTimerMedium; - } + return v_itsGnLocationApplicationRetransmitTimerMedium; + } - /** - * @desc Gets the App retransmission timer for AppRepInterval = maximum (cong. ctrl). - * @return App retransmission timer (maximum) in seconds - * @see PX_GN_APPLICATION_RETRANSMIT_TIMER_MAXIMUM - */ - function f_getAppRetransmitTimerMaximum() return float { - var float v_itsGnLocationApplicationRetransmitTimerMaximum := int2float(PX_GN_APPLICATION_RETRANSMIT_TIMER_MAXIMUM/1000); + /** + * @desc Gets the App retransmission timer for AppRepInterval = maximum (cong. ctrl). + * @return App retransmission timer (maximum) in seconds + * @see PX_GN_APPLICATION_RETRANSMIT_TIMER_MAXIMUM + */ + function f_getAppRetransmitTimerMaximum() return float { + var float v_itsGnLocationApplicationRetransmitTimerMaximum := int2float(PX_GN_APPLICATION_RETRANSMIT_TIMER_MAXIMUM/1000); - return v_itsGnLocationApplicationRetransmitTimerMaximum; - } + return v_itsGnLocationApplicationRetransmitTimerMaximum; + } - /** - * @desc Gets the LS maximum retransmission number. - * @return LS maximum retransmission number - * @see PICS_GN_LOCATION_SERVICE_MAX_RETRANS - */ - function f_getLsMaxRetrans() return integer { - var integer v_itsGnLocationServiceMaxRetrans := PICS_GN_LOCATION_SERVICE_MAX_RETRANS; + /** + * @desc Gets the LS maximum retransmission number. + * @return LS maximum retransmission number + * @see PICS_GN_LOCATION_SERVICE_MAX_RETRANS + */ + function f_getLsMaxRetrans() return integer { + var integer v_itsGnLocationServiceMaxRetrans := PICS_GN_LOCATION_SERVICE_MAX_RETRANS; - return v_itsGnLocationServiceMaxRetrans; - } + return v_itsGnLocationServiceMaxRetrans; + } - /** - * @desc Gets the Application maximum retransmission number. - * @return Application maximum retransmission number - * @see PX_GN_APPLICATION_MAX_RETRANS - */ - function f_getAppMaxRetrans() return integer { - var integer v_itsGnApplicationMaxRetrans := PX_GN_APPLICATION_MAX_RETRANS; + /** + * @desc Gets the Application maximum retransmission number. + * @return Application maximum retransmission number + * @see PX_GN_APPLICATION_MAX_RETRANS + */ + function f_getAppMaxRetrans() return integer { + var integer v_itsGnApplicationMaxRetrans := PX_GN_APPLICATION_MAX_RETRANS; - return v_itsGnApplicationMaxRetrans; - } + return v_itsGnApplicationMaxRetrans; + } - /** - * @desc Gets the Location Service packet buffer size. - * @return Location Service packet buffer size in Kbytes - * @see PICS_GN_LOCATION_SERVICE_PACKET_BUFFER_SIZE - */ - function f_getLsPacketBufferSize() return integer { - var integer v_itsGnLocationServicePacketBufferSize := PICS_GN_LOCATION_SERVICE_PACKET_BUFFER_SIZE; - - return v_itsGnLocationServicePacketBufferSize; - } // end f_getLsPacketBufferSize - - /** - * @desc Gets the UC forwarding packet buffer size. - * @return UC forwarding packet buffer size in bytes - * @see PICS_GN_UC_FORWARDING_PACKET_BUFFER_SIZE - */ - function f_getUcForwardingPacketBufferSize() return integer { - var integer v_itsGnUcForwardingPacketBufferSize := PICS_GN_UC_FORWARDING_PACKET_BUFFER_SIZE; - - return v_itsGnUcForwardingPacketBufferSize * 1024; - } // end f_getUcForwardingPacketBufferSize - - /** - * @desc Gets the BC forwarding packet buffer size. - * @return BC forwarding packet buffer size in bytes - * @see PICS_GN_BC_FORWARDING_PACKET_BUFFER_SIZE - */ - function f_getBcForwardingPacketBufferSize() return integer { - var integer v_itsGnBcForwardingPacketBufferSize := PICS_GN_BC_FORWARDING_PACKET_BUFFER_SIZE; - - return v_itsGnBcForwardingPacketBufferSize * 1024; - } // end f_getBcForwardingPacketBufferSize - - /** - * @desc Gets the maximum lifetime of a packet. - * @return Maximum lifetime of a packet in seconds - * @see PICS_GN_MAX_PACKET_LIFETIME - */ - function f_getMaxPacketLifeTime() return float { - var float v_itsGnMaxPacketLifetime := int2float(PICS_GN_MAX_PACKET_LIFETIME); - - return v_itsGnMaxPacketLifetime; - } + /** + * @desc Gets the Location Service packet buffer size. + * @return Location Service packet buffer size in Kbytes + * @see PICS_GN_LOCATION_SERVICE_PACKET_BUFFER_SIZE + */ + function f_getLsPacketBufferSize() return integer { + var integer v_itsGnLocationServicePacketBufferSize := PICS_GN_LOCATION_SERVICE_PACKET_BUFFER_SIZE; + + return v_itsGnLocationServicePacketBufferSize; + } // end f_getLsPacketBufferSize + + /** + * @desc Gets the UC forwarding packet buffer size. + * @return UC forwarding packet buffer size in bytes + * @see PICS_GN_UC_FORWARDING_PACKET_BUFFER_SIZE + */ + function f_getUcForwardingPacketBufferSize() return integer { + var integer v_itsGnUcForwardingPacketBufferSize := PICS_GN_UC_FORWARDING_PACKET_BUFFER_SIZE; + + return v_itsGnUcForwardingPacketBufferSize * 1024; + } // end f_getUcForwardingPacketBufferSize + + /** + * @desc Gets the BC forwarding packet buffer size. + * @return BC forwarding packet buffer size in bytes + * @see PICS_GN_BC_FORWARDING_PACKET_BUFFER_SIZE + */ + function f_getBcForwardingPacketBufferSize() return integer { + var integer v_itsGnBcForwardingPacketBufferSize := PICS_GN_BC_FORWARDING_PACKET_BUFFER_SIZE; + + return v_itsGnBcForwardingPacketBufferSize * 1024; + } // end f_getBcForwardingPacketBufferSize + + /** + * @desc Gets the maximum lifetime of a packet. + * @return Maximum lifetime of a packet in seconds + * @see PICS_GN_MAX_PACKET_LIFETIME + */ + function f_getMaxPacketLifeTime() return float { + var float v_itsGnMaxPacketLifetime := int2float(PICS_GN_MAX_PACKET_LIFETIME); + + return v_itsGnMaxPacketLifetime; + } - /** - * @desc Gets delta for timers. - * @return Delta for timers in seconds - * @see PX_T_DELTA - */ - function f_getDeltaTimer() return float { - var float v_deltaTimer := PX_T_DELTA; + /** + * @desc Gets delta for timers. + * @return Delta for timers in seconds + * @see PX_T_DELTA + */ + function f_getDeltaTimer() return float { + var float v_deltaTimer := PX_T_DELTA; - return v_deltaTimer; - } + return v_deltaTimer; + } - /** - * @desc Gets the beacon service retransmit timer. - * @return Beacon service retransmit timer - */ - function f_getBsRetransmitTimer() return float { - var float v_itsGnBeaconServiceRetransmitTimer; + /** + * @desc Gets the beacon service retransmit timer. + * @return Beacon service retransmit timer + */ + function f_getBsRetransmitTimer() return float { + var float v_itsGnBeaconServiceRetransmitTimer; - v_itsGnBeaconServiceRetransmitTimer := int2float( - (PICS_GN_BEACON_SERVICE_RETRANSMIT_TIMER/1000)); + v_itsGnBeaconServiceRetransmitTimer := int2float( + (PICS_GN_BEACON_SERVICE_RETRANSMIT_TIMER/1000)); - return v_itsGnBeaconServiceRetransmitTimer; - } + return v_itsGnBeaconServiceRetransmitTimer; + } - /** - * @desc Gets the beacon service retransmit timer for NetBeaconInterval = medium (cong. ctrl). - * @return Beacon service retransmit timer (medium) - */ - function f_getBsRetransmitTimerMedium() return float { - var float v_itsGnBeaconServiceRetransmitTimerMedium; // timer value increased (medium) + /** + * @desc Gets the beacon service retransmit timer for NetBeaconInterval = medium (cong. ctrl). + * @return Beacon service retransmit timer (medium) + */ + function f_getBsRetransmitTimerMedium() return float { + var float v_itsGnBeaconServiceRetransmitTimerMedium; // timer value increased (medium) - v_itsGnBeaconServiceRetransmitTimerMedium := int2float( - (PX_GN_BEACON_SERVICE_TIMER_MEDIUM+float2int((f_getBsMaxJitter() - 0.0 +1.0)*rnd()) + 0)/1000); + v_itsGnBeaconServiceRetransmitTimerMedium := int2float( + (PX_GN_BEACON_SERVICE_TIMER_MEDIUM+float2int((f_getBsMaxJitter() - 0.0 +1.0)*rnd()) + 0)/1000); - return v_itsGnBeaconServiceRetransmitTimerMedium; - } + return v_itsGnBeaconServiceRetransmitTimerMedium; + } - /** - * @desc Gets the beacon service retransmit timer for NetBeaconInterval = maximum (cong. ctrl). - * @return Beacon service retransmit timer (maximum) - */ - function f_getBsRetransmitTimerMaximum() return float { - var float v_itsGnBeaconServiceRetransmitTimerMaximum; // timer value increased (maximum) + /** + * @desc Gets the beacon service retransmit timer for NetBeaconInterval = maximum (cong. ctrl). + * @return Beacon service retransmit timer (maximum) + */ + function f_getBsRetransmitTimerMaximum() return float { + var float v_itsGnBeaconServiceRetransmitTimerMaximum; // timer value increased (maximum) - v_itsGnBeaconServiceRetransmitTimerMaximum := int2float( - (PX_GN_BEACON_SERVICE_TIMER_MAXIMUM+float2int((f_getBsMaxJitter() - 0.0 +1.0)*rnd()) + 0)/1000); + v_itsGnBeaconServiceRetransmitTimerMaximum := int2float( + (PX_GN_BEACON_SERVICE_TIMER_MAXIMUM+float2int((f_getBsMaxJitter() - 0.0 +1.0)*rnd()) + 0)/1000); - return v_itsGnBeaconServiceRetransmitTimerMaximum; - } + return v_itsGnBeaconServiceRetransmitTimerMaximum; + } - /** - * @desc Gets the maximum beacon service jitter. - * @return Maximum beacon service jitter - */ - function f_getBsMaxJitter() return float { - var float v_itsGnBeaconServiceMaxJitter := int2float(PICS_GN_BEACON_SERVICE_MAX_JITTER)/1000.0; + /** + * @desc Gets the maximum beacon service jitter. + * @return Maximum beacon service jitter + */ + function f_getBsMaxJitter() return float { + var float v_itsGnBeaconServiceMaxJitter := int2float(PICS_GN_BEACON_SERVICE_MAX_JITTER)/1000.0; - return v_itsGnBeaconServiceMaxJitter; - } + return v_itsGnBeaconServiceMaxJitter; + } - /** - * @desc Gets the Lifetime of a Location Table Entry. - * @return Lifetime of a Location Table Entry in seconds - * @see PICS_GN_LIFETIME_LOC_TE - */ - function f_getLifetimeLocTableEntry() return float { - var float v_itsGnLifetimeLocTableEntry := int2float(PICS_GN_LIFETIME_LOC_TE); + /** + * @desc Gets the Lifetime of a Location Table Entry. + * @return Lifetime of a Location Table Entry in seconds + * @see PICS_GN_LIFETIME_LOC_TE + */ + function f_getLifetimeLocTableEntry() return float { + var float v_itsGnLifetimeLocTableEntry := int2float(PICS_GN_LIFETIME_LOC_TE); - return v_itsGnLifetimeLocTableEntry; - } // end f_getLifetimeLocTableEntry + return v_itsGnLifetimeLocTableEntry; + } // end f_getLifetimeLocTableEntry - /** - * @desc Gets the maximum communication range for CBF algorithm - * @return Maximum communication range for CBF algorithm in meters - * @see PICS_GN_DEFAULT_MAX_COMMUNICATION_RANGE - */ - function f_getCbfMaxCommunicationRange() return integer { - var integer v_maxCommunicationRange := PICS_GN_DEFAULT_MAX_COMMUNICATION_RANGE; + /** + * @desc Gets the maximum communication range for CBF algorithm + * @return Maximum communication range for CBF algorithm in meters + * @see PICS_GN_DEFAULT_MAX_COMMUNICATION_RANGE + */ + function f_getCbfMaxCommunicationRange() return integer { + var integer v_maxCommunicationRange := PICS_GN_DEFAULT_MAX_COMMUNICATION_RANGE; - return v_maxCommunicationRange; - } // end f_getCbfMaxCommunicationRange + return v_maxCommunicationRange; + } // end f_getCbfMaxCommunicationRange - function f_getGeoUnicastCbfMaxTime() return integer { - var integer v_cbfMaxTime := PICS_GN_GEOUNICAST_CBF_MAX_TIME; + function f_getGeoUnicastCbfMaxTime() return integer { + var integer v_cbfMaxTime := PICS_GN_GEOUNICAST_CBF_MAX_TIME; - return v_cbfMaxTime; - } // end f_getGeoUnicastCbfMaxTime + return v_cbfMaxTime; + } // end f_getGeoUnicastCbfMaxTime - function f_getGeoUnicastCbfMinTime() return integer { - var integer v_cbfMinTime := PICS_GN_GEOUNICAST_CBF_MIN_TIME; + function f_getGeoUnicastCbfMinTime() return integer { + var integer v_cbfMinTime := PICS_GN_GEOUNICAST_CBF_MIN_TIME; - return v_cbfMinTime; - } // end f_getGeoUnicastCbfMinTime + return v_cbfMinTime; + } // end f_getGeoUnicastCbfMinTime - function f_getGeoBroadcastCbfMaxTime() return integer { - var integer v_cbfMaxTime := PICS_GN_GEOBROADCAST_CBF_MAX_TIME; + function f_getGeoBroadcastCbfMaxTime() return integer { + var integer v_cbfMaxTime := PICS_GN_GEOBROADCAST_CBF_MAX_TIME; - return v_cbfMaxTime; - } // end f_getGeoBroadcastCbfMaxTime + return v_cbfMaxTime; + } // end f_getGeoBroadcastCbfMaxTime - function f_getGeoBroadcastCbfMinTime() return integer { - var integer v_cbfMinTime := PICS_GN_GEOBROADCAST_CBF_MIN_TIME; + function f_getGeoBroadcastCbfMinTime() return integer { + var integer v_cbfMinTime := PICS_GN_GEOBROADCAST_CBF_MIN_TIME; - return v_cbfMinTime; - } // end f_getGeoBroadcastCbfMinTime + return v_cbfMinTime; + } // end f_getGeoBroadcastCbfMinTime - function f_getGnMaxAreaSize() return float { - var float v_maxAreaSize := PICS_GN_MAX_GEO_AREA_SIZE; + function f_getGnMaxAreaSize() return float { + var float v_maxAreaSize := PICS_GN_MAX_GEO_AREA_SIZE; - return v_maxAreaSize; - } // end f_getGnMaxAreaSize + return v_maxAreaSize; + } // end f_getGnMaxAreaSize - function f_getAdvancedGbcForwardingMaxCounter() return integer { - var integer v_maxCounter := PICS_GN_ADVANCED_BC_FORWARDING_MAX_COUNTER; + function f_getAdvancedGbcForwardingMaxCounter() return integer { + var integer v_maxCounter := PICS_GN_ADVANCED_BC_FORWARDING_MAX_COUNTER; - return v_maxCounter; - } + return v_maxCounter; + } - /** - * @desc Set the number of neighbour in the Location Table. - * @see PX_MIN_NR_NEIGHBOUR - */ - function f_setNrNeighbourLocTableDefault() runs on ItsGeoNetworking { - var integer v_nrNeighbour := f_random (0, PX_MIN_NR_NEIGHBOUR); + /** + * @desc Set the number of neighbour in the Location Table. + * @see PX_MIN_NR_NEIGHBOUR + */ + function f_setNrNeighbourLocTableDefault() runs on ItsGeoNetworking { + var integer v_nrNeighbour := f_random (0, PX_MIN_NR_NEIGHBOUR); - f_acStartBeaconingMultipleNeighbour(v_nrNeighbour); + f_acStartBeaconingMultipleNeighbour(v_nrNeighbour); - } // end f_setNrNeighbourLocTableDefault + } // end f_setNrNeighbourLocTableDefault - /** - * @desc Set the number of neighbour in the Location Table (medium). - * @see PX_MIN_NR_NEIGHBOUR - * @see PX_MAX_NR_NEIGHBOUR - */ - function f_setNrNeighbourLocTableMedium() runs on ItsGeoNetworking { - var integer v_nrNeighbour := f_random (PX_MIN_NR_NEIGHBOUR, PX_MAX_NR_NEIGHBOUR); + /** + * @desc Set the number of neighbour in the Location Table (medium). + * @see PX_MIN_NR_NEIGHBOUR + * @see PX_MAX_NR_NEIGHBOUR + */ + function f_setNrNeighbourLocTableMedium() runs on ItsGeoNetworking { + var integer v_nrNeighbour := f_random (PX_MIN_NR_NEIGHBOUR, PX_MAX_NR_NEIGHBOUR); - f_acStartBeaconingMultipleNeighbour(v_nrNeighbour); + f_acStartBeaconingMultipleNeighbour(v_nrNeighbour); - } // end f_setNrNeighbourLocTableMedium + } // end f_setNrNeighbourLocTableMedium - /** - * @desc Set the number of neighbour in the Location Table (maximum). - * @see PX_MAX_NR_NEIGHBOUR - * @see PX_MIN_NR_NEIGHBOUR - */ - function f_setNrNeighbourLocTableMaximum() runs on ItsGeoNetworking { - var integer v_nrNeighbour := f_random (PX_MAX_NR_NEIGHBOUR, (2*PX_MIN_NR_NEIGHBOUR)); + /** + * @desc Set the number of neighbour in the Location Table (maximum). + * @see PX_MAX_NR_NEIGHBOUR + * @see PX_MIN_NR_NEIGHBOUR + */ + function f_setNrNeighbourLocTableMaximum() runs on ItsGeoNetworking { + var integer v_nrNeighbour := f_random (PX_MAX_NR_NEIGHBOUR, (2*PX_MIN_NR_NEIGHBOUR)); - f_acStartBeaconingMultipleNeighbour(v_nrNeighbour); + f_acStartBeaconingMultipleNeighbour(v_nrNeighbour); - } // end f_setNrNeighbourLocTableMaximum + } // end f_setNrNeighbourLocTableMaximum - } // end iutFunctions + } // end iutFunctions - group posVectorFunctions { - - /** - * @desc Convert long position vector to short position vector - * @param p_longPosVector Long position vector to be converted - * @return Short position vector - */ - function f_longPosVector2ShortPosVector(in LongPosVector p_longPosVector) return ShortPosVector { - var ShortPosVector v_shortPosVector; - - v_shortPosVector := { - gnAddr := p_longPosVector.gnAddr, - timestamp_ := p_longPosVector.timestamp_, - latitude := p_longPosVector.latitude, - longitude := p_longPosVector.longitude - }; - - return v_shortPosVector; - } + group posVectorFunctions { + + /** + * @desc Convert long position vector to short position vector + * @param p_longPosVector Long position vector to be converted + * @return Short position vector + */ + function f_longPosVector2ShortPosVector(in LongPosVector p_longPosVector) return ShortPosVector { + var ShortPosVector v_shortPosVector; + + v_shortPosVector := { + gnAddr := p_longPosVector.gnAddr, + timestamp_ := p_longPosVector.timestamp_, + latitude := p_longPosVector.latitude, + longitude := p_longPosVector.longitude + }; + + return v_shortPosVector; + } - /** - * @desc Get IUT's long position vector - * @return IUT's long position vector - */ - function f_getIutLongPosVector() runs on ItsBaseGeoNetworking return LongPosVector { - return f_acGetLongPosVector(f_getIutGnLocalAddress()); - } + /** + * @desc Get IUT's long position vector + * @return IUT's long position vector + */ + function f_getIutLongPosVector() runs on ItsBaseGeoNetworking return LongPosVector { + return f_acGetLongPosVector(f_getIutGnLocalAddress()); + } - /** - * @desc Get IUT's short position vector - * @return IUT's short position vector - */ - function f_getIutShortPosVector() runs on ItsGeoNetworking return ShortPosVector { - var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); - - if (not isbound(v_longPosVectorIut)) { - v_longPosVectorIut := f_getIutLongPosVector(); - } - return f_longPosVector2ShortPosVector(v_longPosVectorIut); - } + /** + * @desc Get IUT's short position vector + * @return IUT's short position vector + */ + function f_getIutShortPosVector() runs on ItsGeoNetworking return ShortPosVector { + var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); + + if (not isbound(v_longPosVectorIut)) { + v_longPosVectorIut := f_getIutLongPosVector(); + } + return f_longPosVector2ShortPosVector(v_longPosVectorIut); + } - /** - * @desc Compute a position using a reference position, a distance and an orientation - * @param p_iutLongPosVector Reference position - * @param p_distance Distance to the reference position (in meter) - * @param p_orientation direction of the computed position (0 to 359; 0 means North) - * @return LongPosVector - */ - function f_computePositionUsingDistance(in LongPosVector p_iutLongPosVector, in float p_distance, in integer p_orientation) - return LongPosVector { - var LongPosVector v_result := p_iutLongPosVector; - - log("*** f_computePositionUsingDistance: INFO: calling fx_computePositionUsingDistance() ***"); - fx_computePositionUsingDistance(p_iutLongPosVector.latitude, p_iutLongPosVector.longitude, p_distance, p_orientation, v_result.latitude, v_result.longitude); - - return v_result; - } + /** + * @desc Compute a position using a reference position, a distance and an orientation + * @param p_iutLongPosVector Reference position + * @param p_distance Distance to the reference position (in meter) + * @param p_orientation direction of the computed position (0 to 359; 0 means North) + * @return LongPosVector + */ + function f_computePositionUsingDistance(in LongPosVector p_iutLongPosVector, in float p_distance, in integer p_orientation) + return LongPosVector { + var LongPosVector v_result := p_iutLongPosVector; + + log("*** f_computePositionUsingDistance: INFO: calling fx_computePositionUsingDistance() ***"); + fx_computePositionUsingDistance(p_iutLongPosVector.latitude, p_iutLongPosVector.longitude, p_distance, p_orientation, v_result.latitude, v_result.longitude); + + return v_result; + } - } // end posVectorFunctions + } // end posVectorFunctions - group externalFunctions { + group externalFunctions { - /** - * @desc External function to compute timestamp based on current time - * @return Unix-Epoch-Time mod 2^32 - */ - external function fx_computeGnTimestamp() return UInt32; + /** + * @desc External function to compute timestamp based on current time + * @return Unix-Epoch-Time mod 2^32 + */ + external function fx_computeGnTimestamp() return UInt32; - } // End of group externalFunctions + } // End of group externalFunctions - group security { - - /** - * @desc Waiting for the GN message with Security - * @param p_InSecMsg SecurityMessage template - * @param p_received returns received SecurityMessage - */ - altstep a_securedMessage ( - in template (present) SecuredMessage p_InSecMsg, - out SecuredMessage p_received - ) runs on ItsGeoNetworking { - var GeoNetworkingInd v_geoNw; - [] geoNetworkingPort.receive(mw_geoNwInd( - mw_geoNwSecPdu( - p_InSecMsg, - mw_geoNwAnyPacket_withPayload(?) -//FIXME RGY Titan doesn't support storing list at the moment -// ))) -> value (v_geoNw) { - ))) -> value v_geoNw { - p_received := f_getSecuredMessage(v_geoNw.msgIn); - } - } + group security { + + /** + * @desc Waiting for the GN message with Security + * @param p_InSecMsg SecurityMessage template + * @param p_received returns received SecurityMessage + */ + altstep a_securedMessage ( + in template (present) SecuredMessage p_InSecMsg, + out SecuredMessage p_received + ) runs on ItsGeoNetworking { + var GeoNetworkingInd v_geoNw; + [] geoNetworkingPort.receive(mw_geoNwInd( + mw_geoNwSecPdu( + p_InSecMsg, + mw_geoNwAnyPacket_withPayload(?) + //FIXME RGY Titan doesn't support storing list at the moment + // ))) -> value (v_geoNw) { + ))) -> value v_geoNw { + p_received := f_getSecuredMessage(v_geoNw.msgIn); + } + } - /** - * @desc Receive GN message with security containing certificate as a signer info - * @param p_cert returns the certificate used for sign received message - */ - altstep a_securedMessageWithCertificate( - out SecuredMessage p_received - ) runs on ItsGeoNetworking { - - [] a_securedMessage ( - mdw_securedMessage (superset(mw_header_field_signer_info_certificate)), - p_received - ) { - // Nothing to do - } - } // End of altstep a_securedMessageWithCertificate + /** + * @desc Receive GN message with security containing certificate as a signer info + * @param p_cert returns the certificate used for sign received message + */ + altstep a_securedMessageWithCertificate( + out SecuredMessage p_received + ) runs on ItsGeoNetworking { + + [] a_securedMessage ( + mdw_securedMessage (superset(mw_header_field_signer_info_certificate)), + p_received + ) { + // Nothing to do + } + } // End of altstep a_securedMessageWithCertificate - /** - * @desc Receive GN message with security containing certificate chain as a signer info - * @param p_cert returns the certificate used for sign received message - */ - altstep a_securedMessageWithCertificateChain( - out SecuredMessage p_received - ) runs on ItsGeoNetworking { - [] a_securedMessage ( - mdw_securedMessage( - superset( - mw_header_field_signer_info_certificate_chain - )), - p_received - ) { - // Nothing to do - } - } // End of altstep a_securedMessageWithCertificateChain - - /** - * @desc Receive GN message with security containing digest as a signer info - * @param p_cert returns the certificate used for sign received message - */ - altstep a_securedMessageWithDigest( - out SecuredMessage p_received - ) runs on ItsGeoNetworking { - [] a_securedMessage ( - mdw_securedMessage ( - superset( - mw_header_field_signer_info_digest - )), - p_received - ) { - // Nothing to do - } - } // End of altstep a_securedMessageWithDigest - - } // End of group altSteps + /** + * @desc Receive GN message with security containing certificate chain as a signer info + * @param p_cert returns the certificate used for sign received message + */ + altstep a_securedMessageWithCertificateChain( + out SecuredMessage p_received + ) runs on ItsGeoNetworking { + [] a_securedMessage ( + mdw_securedMessage( + superset( + mw_header_field_signer_info_certificate_chain + )), + p_received + ) { + // Nothing to do + } + } // End of altstep a_securedMessageWithCertificateChain + + /** + * @desc Receive GN message with security containing digest as a signer info + * @param p_cert returns the certificate used for sign received message + */ + altstep a_securedMessageWithDigest( + out SecuredMessage p_received + ) runs on ItsGeoNetworking { + [] a_securedMessage ( + mdw_securedMessage ( + superset( + mw_header_field_signer_info_digest + )), + p_received + ) { + // Nothing to do + } + } // End of altstep a_securedMessageWithDigest + + } // End of group altSteps - group waitingHelpers { - - /** - * @desc Wait for GN message with security containing certificate as a signer info - * @return the certificate used for sign received message - */ - function f_waitForCertificate( - out Certificate p_cert - ) runs on ItsGeoNetworking return boolean { - var SecuredMessage v_recv; - var boolean v_ret := false; - - alt { - [] a_securedMessageWithCertificate(v_recv) { - var SignerInfo v_si; + group waitingHelpers { + + /** + * @desc Wait for GN message with security containing certificate as a signer info + * @return the certificate used for sign received message + */ + function f_waitForCertificate( + out Certificate p_cert + ) runs on ItsGeoNetworking return boolean { + var SecuredMessage v_recv; + var boolean v_ret := false; + + alt { + [] a_securedMessageWithCertificate(v_recv) { + var SignerInfo v_si; - if (f_getMsgSignerInfo(v_recv, v_si) == true) { - if (ischosen(v_si.signerInfo.certificate)) { - p_cert := v_si.signerInfo.certificate; - v_ret := true; - } - } - } - } // End of 'alt' statement - - return v_ret; - } // End of function f_waitForCertificate - - /** - * @desc Wait for GN message with security containing certificate chain as a signer info - * @return the certificate used for sign received message - */ - function f_waitForCertificateChain (out CertificateChain p_chain) - runs on ItsGeoNetworking - return boolean { - var SecuredMessage v_recv; - var boolean v_ret := false; - - alt { - [] a_securedMessageWithCertificateChain(v_recv) { - var SignerInfo v_si; - if(f_getMsgSignerInfo(v_recv, v_si)) { - p_chain := v_si.signerInfo.certificates; - v_ret := true; - } - } - } - return v_ret; - } + if (f_getMsgSignerInfo(v_recv, v_si) == true) { + if (ischosen(v_si.signerInfo.certificate)) { + p_cert := v_si.signerInfo.certificate; + v_ret := true; + } + } + } + } // End of 'alt' statement + + return v_ret; + } // End of function f_waitForCertificate + + /** + * @desc Wait for GN message with security containing certificate chain as a signer info + * @return the certificate used for sign received message + */ + function f_waitForCertificateChain (out CertificateChain p_chain) + runs on ItsGeoNetworking + return boolean { + var SecuredMessage v_recv; + var boolean v_ret := false; + + alt { + [] a_securedMessageWithCertificateChain(v_recv) { + var SignerInfo v_si; + if(f_getMsgSignerInfo(v_recv, v_si)) { + p_chain := v_si.signerInfo.certificates; + v_ret := true; + } + } + } + return v_ret; + } - /** - * @desc Ask for the certificate chain and wait for GN message with security containing certificate chain as a signer info - * @return the certificate chain used for sign received message - */ - function f_askForCertificateChain (in template(value) octetstring p_CamPayload) - runs on ItsGeoNetworking - return boolean { - var SecuredMessage v_recv; - var SignerInfo v_si; - var boolean v_ret := false; - alt { - [] a_securedMessageWithCertificate(v_recv) { - if(f_getMsgSignerInfo(v_recv, v_si)) { - if(f_getCertificateSignerInfo(v_si.signerInfo.certificate, v_si)) { - if(v_si.type_ == e_certificate_digest_with_sha256) { - f_sendCertificateRequest(v_si.signerInfo.digest, p_CamPayload); - if(tc_ac.running) { - tc_ac.stop;tc_ac.start; - } - v_ret := true; - } - } - } - } - } - return v_ret; - } - /** - * @desc Ask for the certificate chain and wait for GN message with security containing certificate chain as a signer info - * @return the certificate chain used for sign received message - */ - function f_askAndWaitForCertificateChain( - out CertificateChain p_chain, - in template(value) octetstring p_CamPayload - ) runs on ItsGeoNetworking return boolean { - // Local variables - var SecuredMessage v_recv; - var SignerInfo v_si; - var boolean v_ret := false; - - alt { - [] a_securedMessageWithCertificate(v_recv) { - tc_ac.stop; - if(f_getMsgSignerInfo(v_recv, v_si)) { - if(f_getCertificateSignerInfo(v_si.signerInfo.certificate, v_si)) { - if(v_si.type_ == e_certificate_digest_with_sha256) { - f_sendCertificateRequest(v_si.signerInfo.digest, p_CamPayload); - tc_ac.start; - repeat; - } - } - } - } - [] a_securedMessageWithCertificateChain(v_recv) { - tc_ac.stop; - if(f_getMsgSignerInfo(v_recv, v_si) == true) { - p_chain := v_si.signerInfo.certificates; - v_ret := true; - } - } - } // End of 'alt' statement - - return v_ret; - } // End of function f_askAndWaitForCertificateChain - - /** - * @desc Wait for GN message with security containing digest as a signer info - * @return the digest of the certificate been used to sign received message - */ - function f_waitForDigest( - out HashedId8 p_digest - ) runs on ItsGeoNetworking return boolean { - // Local variables - var SecuredMessage v_recv; - var boolean v_ret := false; - - alt { - [] a_securedMessageWithDigest(v_recv) { - var SignerInfo v_si; - if(f_getMsgSignerInfo(v_recv, v_si)) { - p_digest := v_si.signerInfo.digest; - v_ret := true; - } - } - } // End of 'alt' statement - - return v_ret; - } // End of function f_waitForDigest - - /** - * @desc Send a CAM message with a certificate and wait the certificate chain request message - * @remark This function is used only for testing against another ATS - * @param p_certificate The certificate identifier - * @param p_CamPayload The CAM paylaod - * @return true on success, flase otherwise - */ - function f_sendCertificateAndWaitForCertificateChainRequest( - in charstring p_certificate, - in template(value) octetstring p_CamPayload - ) runs on ItsGeoNetworking return boolean { - // Local variables - var SecuredMessage v_recv; - - f_sendCertificate(p_certificate, p_CamPayload); - alt { - [] a_securedMessage ( - mdw_securedMessage( - superset( - mw_header_field_unrecognised_certificate - )), - v_recv - ) { - // Nothing to do - log("*** " & testcasename() & ": DEBUG: Receive certificate ***") - } - } // End of 'alt' statement - - return true; - } // End of function f_sendCertificateAndWaitForCertificateChainRequest - - } // End of group waitingHelpers - - group CertRequests{ - - function f_sendCertificateRequest( - in template (value) HashedId8 p_digest, - in template (value) octetstring p_payload - ) runs on ItsGeoNetworking { - var GeoNetworkingReq v_gnReq; - var GnNonSecuredPacket v_gnNonSecuredPacket; - var template (value) ToBeSignedSecuredMessage v_toBeSignedSecuredMessage; - var template (value) SecuredMessage v_securedMessage; + /** + * @desc Ask for the certificate chain and wait for GN message with security containing certificate chain as a signer info + * @return the certificate chain used for sign received message + */ + function f_askForCertificateChain (in template(value) octetstring p_CamPayload) + runs on ItsGeoNetworking + return boolean { + var SecuredMessage v_recv; + var SignerInfo v_si; + var boolean v_ret := false; + alt { + [] a_securedMessageWithCertificate(v_recv) { + if(f_getMsgSignerInfo(v_recv, v_si)) { + if(f_getCertificateSignerInfo(v_si.signerInfo.certificate, v_si)) { + if(v_si.type_ == e_certificate_digest_with_sha256) { + f_sendCertificateRequest(v_si.signerInfo.digest, p_CamPayload); + if(tc_ac.running) { + tc_ac.stop;tc_ac.start; + } + v_ret := true; + } + } + } + } + } + return v_ret; + } + /** + * @desc Ask for the certificate chain and wait for GN message with security containing certificate chain as a signer info + * @return the certificate chain used for sign received message + */ + function f_askAndWaitForCertificateChain( + out CertificateChain p_chain, + in template(value) octetstring p_CamPayload + ) runs on ItsGeoNetworking return boolean { + // Local variables + var SecuredMessage v_recv; + var SignerInfo v_si; + var boolean v_ret := false; + + alt { + [] a_securedMessageWithCertificate(v_recv) { + tc_ac.stop; + if(f_getMsgSignerInfo(v_recv, v_si)) { + if(f_getCertificateSignerInfo(v_si.signerInfo.certificate, v_si)) { + if(v_si.type_ == e_certificate_digest_with_sha256) { + f_sendCertificateRequest(v_si.signerInfo.digest, p_CamPayload); + tc_ac.start; + repeat; + } + } + } + } + [] a_securedMessageWithCertificateChain(v_recv) { + tc_ac.stop; + if(f_getMsgSignerInfo(v_recv, v_si) == true) { + p_chain := v_si.signerInfo.certificates; + v_ret := true; + } + } + } // End of 'alt' statement + + return v_ret; + } // End of function f_askAndWaitForCertificateChain + + /** + * @desc Wait for GN message with security containing digest as a signer info + * @return the digest of the certificate been used to sign received message + */ + function f_waitForDigest( + out HashedId8 p_digest + ) runs on ItsGeoNetworking return boolean { + // Local variables + var SecuredMessage v_recv; + var boolean v_ret := false; + + alt { + [] a_securedMessageWithDigest(v_recv) { + var SignerInfo v_si; + if(f_getMsgSignerInfo(v_recv, v_si)) { + p_digest := v_si.signerInfo.digest; + v_ret := true; + } + } + } // End of 'alt' statement + + return v_ret; + } // End of function f_waitForDigest + + /** + * @desc Send a CAM message with a certificate and wait the certificate chain request message + * @remark This function is used only for testing against another ATS + * @param p_certificate The certificate identifier + * @param p_CamPayload The CAM paylaod + * @return true on success, flase otherwise + */ + function f_sendCertificateAndWaitForCertificateChainRequest( + in charstring p_certificate, + in template(value) octetstring p_CamPayload + ) runs on ItsGeoNetworking return boolean { + // Local variables + var SecuredMessage v_recv; + + f_sendCertificate(p_certificate, p_CamPayload); + alt { + [] a_securedMessage ( + mdw_securedMessage( + superset( + mw_header_field_unrecognised_certificate + )), + v_recv + ) { + // Nothing to do + log("*** " & testcasename() & ": DEBUG: Receive certificate ***") + } + } // End of 'alt' statement + + return true; + } // End of function f_sendCertificateAndWaitForCertificateChainRequest + + } // End of group waitingHelpers + + group CertRequests{ + + function f_sendCertificateRequest( + in template (value) HashedId8 p_digest, + in template (value) octetstring p_payload + ) runs on ItsGeoNetworking { + var GeoNetworkingReq v_gnReq; + var GnNonSecuredPacket v_gnNonSecuredPacket; + var template (value) ToBeSignedSecuredMessage v_toBeSignedSecuredMessage; + var template (value) SecuredMessage v_securedMessage; - // Build signed SecuredMessage - v_gnNonSecuredPacket := valueof(m_geoNwShbPacket( - f_getPosition(c_compNodeC) // FIXME To be verified YANN - )); - // Add CAM payload - v_gnNonSecuredPacket.payload := valueof(p_payload); - - f_buildGnSecuredCam( - v_securedMessage, - m_payload_signed(bit2oct(encvalue(v_gnNonSecuredPacket))), - e_certificate, - { - m_header_field_unrecognised_certificate( - f_HashedId3FromHashedId8( - valueof(p_digest) - )) - }, - "" - ); + // Build signed SecuredMessage + v_gnNonSecuredPacket := valueof(m_geoNwShbPacket( + f_getPosition(c_compNodeC) // FIXME To be verified YANN + )); + // Add CAM payload + v_gnNonSecuredPacket.payload := valueof(p_payload); + + f_buildGnSecuredCam( + v_securedMessage, + m_payload_signed(bit2oct(encvalue(v_gnNonSecuredPacket))), + e_certificate, + { + m_header_field_unrecognised_certificate( + f_HashedId3FromHashedId8( + valueof(p_digest) + )) + }, + "" + ); - // Build secured Gn packet - v_gnReq := valueof(m_geoNwReq_linkLayerBroadcast( - m_geoNwSecPdu( - v_gnNonSecuredPacket, - v_securedMessage - ) // End of template m_geoNwSecPdu - )); // End of template m_geoNwReq_linkLayerBroadcast - - // Send Message - f_sendGeoNetMessage(v_gnReq); - - } // End of function f_sendCertificateRequest - - /** - * @desc Send a CAM message with a certificate - * @remark This function is used only for testing against another ATS - * @param p_certificate The certificate identifier - * @param p_CamPayload The CAM paylaod - * @return true on success, flase otherwise - * @see f_sendCertificateAndWaitForCertificateChainRequest - */ - function f_sendCertificate( - in charstring p_certificate, - in template (value) octetstring p_payload - ) runs on ItsGeoNetworking { - var GeoNetworkingReq v_gnReq; - var GnNonSecuredPacket v_gnNonSecuredPacket; - var template (value) ToBeSignedSecuredMessage v_toBeSignedSecuredMessage; - var template (value) SecuredMessage v_securedMessage; + // Build secured Gn packet + v_gnReq := valueof(m_geoNwReq_linkLayerBroadcast( + m_geoNwSecPdu( + v_gnNonSecuredPacket, + v_securedMessage + ) // End of template m_geoNwSecPdu + )); // End of template m_geoNwReq_linkLayerBroadcast + + // Send Message + f_sendGeoNetMessage(v_gnReq); + + } // End of function f_sendCertificateRequest + + /** + * @desc Send a CAM message with a certificate + * @remark This function is used only for testing against another ATS + * @param p_certificate The certificate identifier + * @param p_CamPayload The CAM paylaod + * @return true on success, flase otherwise + * @see f_sendCertificateAndWaitForCertificateChainRequest + */ + function f_sendCertificate( + in charstring p_certificate, + in template (value) octetstring p_payload + ) runs on ItsGeoNetworking { + var GeoNetworkingReq v_gnReq; + var GnNonSecuredPacket v_gnNonSecuredPacket; + var template (value) ToBeSignedSecuredMessage v_toBeSignedSecuredMessage; + var template (value) SecuredMessage v_securedMessage; - // Build signed SecuredMessage - v_gnNonSecuredPacket := valueof(m_geoNwShbPacket( - f_getPosition(c_compNodeC) // FIXME To be verified YANN - )); - // Add CAM payload - v_gnNonSecuredPacket.payload := valueof(p_payload); - - f_buildGnSecuredCam( - v_securedMessage, - m_payload_signed(bit2oct(encvalue(v_gnNonSecuredPacket))), - e_certificate, - -, - p_certificate - ); + // Build signed SecuredMessage + v_gnNonSecuredPacket := valueof(m_geoNwShbPacket( + f_getPosition(c_compNodeC) // FIXME To be verified YANN + )); + // Add CAM payload + v_gnNonSecuredPacket.payload := valueof(p_payload); + + f_buildGnSecuredCam( + v_securedMessage, + m_payload_signed(bit2oct(encvalue(v_gnNonSecuredPacket))), + e_certificate, + -, + p_certificate + ); - // Build secured Gn packet - v_gnReq := valueof(m_geoNwReq_linkLayerBroadcast( - m_geoNwSecPdu( - v_gnNonSecuredPacket, - v_securedMessage - ) // End of template m_geoNwSecPdu - )); // End of template m_geoNwReq_linkLayerBroadcast + // Build secured Gn packet + v_gnReq := valueof(m_geoNwReq_linkLayerBroadcast( + m_geoNwSecPdu( + v_gnNonSecuredPacket, + v_securedMessage + ) // End of template m_geoNwSecPdu + )); // End of template m_geoNwReq_linkLayerBroadcast - // Send Message - f_sendGeoNetMessage(v_gnReq); + // Send Message + f_sendGeoNetMessage(v_gnReq); - } // End of function f_sendCertificate + } // End of function f_sendCertificate - } // End of group CertRequests + } // End of group CertRequests - group messageGetters { - - /** - * @desc return SecuredMessage field of GeoNetworking packet - * @param p_msg GeoNetworking packet - * @return the SecuredMessage if any - */ - function f_getSecuredMessage(in GeoNetworkingPdu p_msg) - return SecuredMessage { - return p_msg.gnPacket.securedMsg; - } - + group messageGetters { + + /** + * @desc return SecuredMessage field of GeoNetworking packet + * @param p_msg GeoNetworking packet + * @return the SecuredMessage if any + */ + function f_getSecuredMessage(in GeoNetworkingPdu p_msg) + return SecuredMessage { + return p_msg.gnPacket.securedMsg; } + + } } // end LibItsGeoNetworking_Functions diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn index 07f48b6e..6acb474e 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn @@ -358,7 +358,7 @@ module LibItsGeoNetworking_Templates { /** * @desc Request IUT to change its position */ - template (value) UtChangePosition m_changePosition := { + template (value) UtGnChangePosition m_changePosition := { latitude := 1000, longitude := 0, elevation := 0 diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn index ca8c476e..86bd4e7a 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn @@ -50,11 +50,9 @@ module LibItsGeoNetworking_TestSystem { */ type port UpperTesterPort message { out - UtGnInitialize, UtChangePosition, UtAutoInteropTrigger, UtGnTrigger; + UtGnInitialize, UtGnChangePosition, UtAutoInteropTrigger, UtGnTrigger; in -//FIXME RGY As discussed, boolean results are replaced by a top-level union of results -// UtInitializeResult, UtChangePositionResult, UtGnTriggerResult, UtGnEventInd; - UtGnResults, /*UtCommonResults,*/ UtGnTriggerResult, UtGnEventInd; + UtGnResults, UtGnEventInd; } // end UpperTesterPort } // end portDefinitions diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn index 01cfd2c1..7a877793 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn @@ -11,1182 +11,1192 @@ */ module LibItsGeoNetworking_TypesAndValues { - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; + // LibCommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; - // LibIts -// import from LibItsCommon_TypesAndValues all; - import from LibItsBtp_TypesAndValues {type BtpPacket;} - import from LibItsIpv6OverGeoNetworking_TypesAndValues {type Ipv6Packet;} + // LibIts + // import from LibItsCommon_TypesAndValues all; + import from LibItsBtp_TypesAndValues {type BtpPacket;} + import from LibItsIpv6OverGeoNetworking_TypesAndValues {type Ipv6Packet;} - // LibItsSecurity - import from LibItsSecurity_TypesAndValues all; + // LibItsSecurity + import from LibItsSecurity_TypesAndValues all; - group geoConfigurationValues { + group geoConfigurationValues { - const charstring c_compIut := "IUT"; - const charstring c_compMTC := "MTC"; - const charstring c_compNodeA := "NodeA"; - const charstring c_compNodeB := "NodeB"; - const charstring c_compNodeC := "NodeC"; - const charstring c_compNodeD := "NodeD"; - const charstring c_compNodeE := "NodeE"; - const charstring c_compNodeF := "NodeF"; + const charstring c_compIut := "IUT"; + const charstring c_compMTC := "MTC"; + const charstring c_compNodeA := "NodeA"; + const charstring c_compNodeB := "NodeB"; + const charstring c_compNodeC := "NodeC"; + const charstring c_compNodeD := "NodeD"; + const charstring c_compNodeE := "NodeE"; + const charstring c_compNodeF := "NodeF"; - const charstring c_area1 := "AREA1"; - const charstring c_area2 := "AREA2"; + const charstring c_area1 := "AREA1"; + const charstring c_area2 := "AREA2"; - const integer c_latitudeFactorNodeA := 10; - const integer c_latitudeFactorNodeB := 2; - const integer c_latitudeFactorNodeC := -6; - const integer c_latitudeFactorNodeD := 1; - const integer c_latitudeFactorNodeE := -1; - const integer c_latitudeFactorNodeF := 2; - const integer c_longitudeFactorNodeA := 0; - const integer c_longitudeFactorNodeB := 0; - const integer c_longitudeFactorNodeC := 0; - const integer c_longitudeFactorNodeD := 0; - const integer c_longitudeFactorNodeE := 0; - const integer c_longitudeFactorNodeF := -3; - } // end geoConfigurationValues + const integer c_latitudeFactorNodeA := 10; + const integer c_latitudeFactorNodeB := 2; + const integer c_latitudeFactorNodeC := -6; + const integer c_latitudeFactorNodeD := 1; + const integer c_latitudeFactorNodeE := -1; + const integer c_latitudeFactorNodeF := 2; + const integer c_longitudeFactorNodeA := 0; + const integer c_longitudeFactorNodeB := 0; + const integer c_longitudeFactorNodeC := 0; + const integer c_longitudeFactorNodeD := 0; + const integer c_longitudeFactorNodeE := 0; + const integer c_longitudeFactorNodeF := -3; + } // end geoConfigurationValues - group geoSyncMessages { + group geoSyncMessages { - const charstring c_msgSent := "Message sent"; + const charstring c_msgSent := "Message sent"; - } // end geoSyncMessages + } // end geoSyncMessages - group geoTestingConstants { + group geoTestingConstants { - const UInt6 c_defaultLifetime := 10; // in seconds - const UInt16 c_lifetime := 1000 * c_defaultLifetime; // in seconds + const UInt6 c_defaultLifetime := 10; // in seconds + const UInt16 c_lifetime := 1000 * c_defaultLifetime; // in seconds - } // end geoTestingConstants + } // end geoTestingConstants - group units { + group units { - const float c_squareKm := 1000000.0; + const float c_squareKm := 1000000.0; - } // end units + } // end units - group geoConfigurationTypes { + group geoConfigurationTypes { - /** - * @desc Entry of position table - * @member key Reference key of the entry - * @member position Position vector stored in the entry - */ - type record PositionEntry { - charstring key, - LongPosVector position - } + /** + * @desc Entry of position table + * @member key Reference key of the entry + * @member position Position vector stored in the entry + */ + type record PositionEntry { + charstring key, + LongPosVector position + } - /** - * @desc Table containing node positions - */ - type record of PositionEntry PositionTable; + /** + * @desc Table containing node positions + */ + type record of PositionEntry PositionTable; - /** - * @desc Parameters of a geometric area - * @member geoAreaPosLatitude Latitude of area's center - * @member geoAreaPosLongitude Longitude of area's center - * @member distanceA Distance A - * @member distanceB Distance B - * @member angle Angle - */ - type record Area { - Int32 geoAreaPosLatitude, - Int32 geoAreaPosLongitude, - UInt16 distanceA, - UInt16 distanceB, - UInt16 angle - } + /** + * @desc Parameters of a geometric area + * @member geoAreaPosLatitude Latitude of area's center + * @member geoAreaPosLongitude Longitude of area's center + * @member distanceA Distance A + * @member distanceB Distance B + * @member angle Angle + */ + type record Area { + Int32 geoAreaPosLatitude, + Int32 geoAreaPosLongitude, + UInt16 distanceA, + UInt16 distanceB, + UInt16 angle + } - /** - * @desc Compact definition of GeoBroadcastArea - * @member geoBroadcastSubType Type of GeoBroadcastArea (=shape) - * @member geoBroadcastArea Parameters of the geometric area - */ - type record GeoBroadcastArea { - HeaderSubTypeGeoBroadcast geoBroadcastSubType, - Area geoBroadcastArea - } + /** + * @desc Compact definition of GeoBroadcastArea + * @member geoBroadcastSubType Type of GeoBroadcastArea (=shape) + * @member geoBroadcastArea Parameters of the geometric area + */ + type record GeoBroadcastArea { + HeaderSubTypeGeoBroadcast geoBroadcastSubType, + Area geoBroadcastArea + } - /** - * @desc Compact definition of GeoAnycastArea - * @member geoAnycastSubType Type of GeoAnycastArea (=shape) - * @member geoAnycastArea Parameters of the geometric area - */ - type record GeoAnycastArea { - HeaderSubTypeGeoAnycast geoAnycastSubType, - Area geoAnycastArea - } + /** + * @desc Compact definition of GeoAnycastArea + * @member geoAnycastSubType Type of GeoAnycastArea (=shape) + * @member geoAnycastArea Parameters of the geometric area + */ + type record GeoAnycastArea { + HeaderSubTypeGeoAnycast geoAnycastSubType, + Area geoAnycastArea + } - /** - * @desc Compact definition of a GeoArea (either GeoBroadcastArea or GeoAnycastArea) - * @member shape Shape of the GeoArea - * @member area Parameters of the geometric area - */ - type record GeoArea { - GeoShape shape, - Area area - } + /** + * @desc Compact definition of a GeoArea (either GeoBroadcastArea or GeoAnycastArea) + * @member shape Shape of the GeoArea + * @member area Parameters of the geometric area + */ + type record GeoArea { + GeoShape shape, + Area area + } - /** - * @desc Geometric shapes used to define GeoAreas - */ - type enumerated GeoShape { - e_geoCircle(0), - e_geoRect(1), - e_geoElip(2), - e_reserved - } + /** + * @desc Geometric shapes used to define GeoAreas + */ + type enumerated GeoShape { + e_geoCircle(0), + e_geoRect(1), + e_geoElip(2), + e_reserved + } - /** - * @desc Entry of GeoArea table - * @member key Reference key of the entry - * @member geoArea GeoArea stored in the entry - */ - type record GeoAreaEntry { - charstring key, - GeoArea geoArea - } + /** + * @desc Entry of GeoArea table + * @member key Reference key of the entry + * @member geoArea GeoArea stored in the entry + */ + type record GeoAreaEntry { + charstring key, + GeoArea geoArea + } - /** - * @desc Table containing geoArea definitions - */ - type record of GeoAreaEntry GeoAreaTable; + /** + * @desc Table containing geoArea definitions + */ + type record of GeoAreaEntry GeoAreaTable; - } // end geoConfigurationTypes + } // end geoConfigurationTypes - group geoNwValues { + group geoNwValues { - group geoNwHeaderConstants { + group geoNwHeaderConstants { - const UInt4 c_geoNwProtocolVersion := 0; + const UInt4 c_geoNwProtocolVersion := 0; - const UInt8 c_hopLimit1 := 1; - const UInt8 c_defaultHopLimit := 10; + const UInt8 c_hopLimit1 := 1; + const UInt8 c_defaultHopLimit := 10; - } // end geoNwHeaderConstants + } // end geoNwHeaderConstants - } // end geoNwValues + } // end geoNwValues - group geoNetworkingPdus { + group geoNetworkingPdus { - /** - * @desc GeoNetworking Packet - * - * @see ETSI EN 302 636-4-1 chapter 8.2, 8.3, 8.4 - * - * @member basicHeader - * @member gnPacket - */ - type record GeoNetworkingPdu { - BasicHeader basicHeader, - GeoNetworkingPacket gnPacket - } + /** + * @desc GeoNetworking Packet + * + * @see ETSI EN 302 636-4-1 chapter 8.2, 8.3, 8.4 + * + * @member basicHeader + * @member gnPacket + */ + type record GeoNetworkingPdu { + BasicHeader basicHeader, + GeoNetworkingPacket gnPacket + } - type record GeoNetworkingPacket { - GnNonSecuredPacket packet, - SecuredMessage securedMsg optional - } with { - encode (securedMsg) "LibItsSecurity" - } + type record GeoNetworkingPacket { + GnNonSecuredPacket packet, + SecuredMessage securedMsg optional + } with { + encode (securedMsg) "LibItsSecurity" + } - type octetstring GnRawPayload; + type octetstring GnRawPayload; - type record GnNonSecuredPacket { - CommonHeader commonHeader, - ExtendedHeader extendedHeader optional, - GnRawPayload payload optional - } - } // end group geoNetworkingPdus + type record GnNonSecuredPacket { + CommonHeader commonHeader, + ExtendedHeader extendedHeader optional, + GnRawPayload payload optional + } + } // end group geoNetworkingPdus - group geoNetworkingHeader { + group geoNetworkingHeader { - group geoNetworkingBasicHeader { + group geoNetworkingBasicHeader { - /** - * @desc Basic Header - * - *
-             *  0               1               2               3
-             *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
-             * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-             * |   V   |  NH   |    Reserved   |      LT       |      RHL      |
-             * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-             * 
- * - * @see ETSI EN 302 636-4-1 chapter 8.6.1 - * - * @member version - * @member nextHeader - * @member reserved - * @member lifeTime - * @member routerHopLimit - */ - type record BasicHeader { - UInt4 version, - BasicNextHeader nextHeader, - UInt8 reserved, - Lifetime lifeTime, - UInt8 routerHopLimit - } with { - variant "FIELDORDER(msb)" - } + /** + * @desc Basic Header + * + *
+       *  0               1               2               3
+       *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+       * |   V   |  NH   |    Reserved   |      LT       |      RHL      |
+       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+       * 
+ * + * @see ETSI EN 302 636-4-1 chapter 8.6.1 + * + * @member version + * @member nextHeader + * @member reserved + * @member lifeTime + * @member routerHopLimit + */ + type record BasicHeader { + UInt4 version, + BasicNextHeader nextHeader, + UInt8 reserved, + Lifetime lifeTime, + UInt8 routerHopLimit + } with { + variant "FIELDORDER(msb)" + } - type enumerated BasicNextHeader { - e_any(0), - e_commonHeader(1), - e_securedPacket(2), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } + type enumerated BasicNextHeader { + e_any(0), + e_commonHeader(1), + e_securedPacket(2), + e_reserved + } with { + variant "FIELDLENGTH(4)" //variant "4 bit" + } - /** - * @desc Indicates the maximum tolerable time a packet can be buffered until it reaches its destination. - * @member multiplier - * @member ltBase - */ - type record Lifetime { - UInt6 multiplier, - LtBase ltBase - } with { - variant "FIELDORDER(msb)" - } + /** + * @desc Indicates the maximum tolerable time a packet can be buffered until it reaches its destination. + * @member multiplier + * @member ltBase + */ + type record Lifetime { + UInt6 multiplier, + LtBase ltBase + } with { + variant "FIELDORDER(msb)" + } - /** - * @desc The base for the calculation of the lifetime. - */ - type enumerated LtBase { - e_50ms(0), - e_1s(1), - e_10s(2), - e_100s(3) - } with { - variant "FIELDLENGTH(2)" //variant "2 bit" - } + /** + * @desc The base for the calculation of the lifetime. + */ + type enumerated LtBase { + e_50ms(0), + e_1s(1), + e_10s(2), + e_100s(3) + } with { + variant "FIELDLENGTH(2)" //variant "2 bit" + } - } // end group geoNetworkingBasicHeader + } // end group geoNetworkingBasicHeader - group geoNetworkingCommonHeader { + group geoNetworkingCommonHeader { - /** - * @desc Common header for GeoNetworking - * - *
-             *  0               1               2               3
-             *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
-             * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-             * |  NH   |   R   |  HT   |  HST  |      TC       |     Flags     |
-             * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-             * |              PL               |     MHL       |    Reserved   |
-             * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-             * 
- * - * @see ETSI EN 302 636-4-1 chapter 8.7.2 - * - * @member nextHeader - * @member reserved - * @member headerTST Header type + Header Sub Type - * @member trafficClass - * @member flags - * @member plLength - * @member maxHopLimit - * @member reserved2 - */ - type record CommonHeader { - NextHeader nextHeader, - UInt4 reserved, - HeaderTST headerTST, - TrafficClass trafficClass, - Bit8 flags, - UInt16 plLength, // The Codec shall set the length of the paylaod if present - UInt8 maxHopLimit, - UInt8 reserved2 - } with { - variant "FIELDORDER(msb)" - } + /** + * @desc Common header for GeoNetworking + * + *
+       *  0               1               2               3
+       *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+       * |  NH   |   R   |  HT   |  HST  |      TC       |     Flags     |
+       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+       * |              PL               |     MHL       |    Reserved   |
+       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+       * 
+ * + * @see ETSI EN 302 636-4-1 chapter 8.7.2 + * + * @member nextHeader + * @member reserved + * @member headerTST Header type + Header Sub Type + * @member trafficClass + * @member flags + * @member plLength + * @member maxHopLimit + * @member reserved2 + */ + type record CommonHeader { + NextHeader nextHeader, + UInt4 reserved, + HeaderTST headerTST, + TrafficClass trafficClass, + Bit8 flags, + UInt16 plLength, // The Codec shall set the length of the paylaod if present + UInt8 maxHopLimit, + UInt8 reserved2 + } with { + variant "FIELDORDER(msb)" + } - /** - * @desc Identifies the type of header immediately following the Common Header (4Bits). - */ - type enumerated NextHeader { - e_any(0), - e_btpA(1), - e_btpB(2), - e_ipv6(3), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } + /** + * @desc Identifies the type of header immediately following the Common Header (4Bits). + */ + type enumerated NextHeader { + e_any(0), + e_btpA(1), + e_btpB(2), + e_ipv6(3), + e_reserved + } with { + variant "FIELDLENGTH(4)" //variant "4 bit" + } - /** - * @desc TrafficClass - * - *
-             *  0   1   2   3   4   5   6   7
-             * +---+---+---+---+---+---+---+---+
-             * |SCF|Ch.|         TC ID         |
-             * |   |Off|                       |
-             * +---+---+---+---+---+---+---+---+
-             * 
- * - * @see ETSI EN 302 636-4-1 chapter 8.7.5 - * - * @member scf - * @member channelOffload - * @member tcId - */ - type record TrafficClass { - SCF scf, - ChannelOffload channelOffload, - TcId tcId - } with { - variant "FIELDORDER(msb)" - } + /** + * @desc TrafficClass + * + *
+       *  0   1   2   3   4   5   6   7
+       * +---+---+---+---+---+---+---+---+
+       * |SCF|Ch.|         TC ID         |
+       * |   |Off|                       |
+       * +---+---+---+---+---+---+---+---+
+       * 
+ * + * @see ETSI EN 302 636-4-1 chapter 8.7.5 + * + * @member scf + * @member channelOffload + * @member tcId + */ + type record TrafficClass { + SCF scf, + ChannelOffload channelOffload, + TcId tcId + } with { + variant "FIELDORDER(msb)" + } - type enumerated SCF { - e_scfDisabled(0), - e_scfEnable (1) - } with { - variant "FIELDLENGTH(1)" //variant "1 bit" - } - type enumerated ChannelOffload { - e_choffDisabled(0), - e_choffEnable (1) - } with { - variant "FIELDLENGTH(1)" //variant "1 bit" - } - type UInt6 TcId; + type enumerated SCF { + e_scfDisabled(0), + e_scfEnable (1) + } with { + variant "FIELDLENGTH(1)" //variant "1 bit" + } + type enumerated ChannelOffload { + e_choffDisabled(0), + e_choffEnable (1) + } with { + variant "FIELDLENGTH(1)" //variant "1 bit" + } + type UInt6 TcId; - } // end group geoNetworkingCommonHeader + } // end group geoNetworkingCommonHeader - group geoNetworkingExtendedHeaders { + group geoNetworkingExtendedHeaders { - /** - * @desc GeoNetworking ExtendedHeader - * - * @see ETSI EN 302 636-4-1 chapter 8.3 - * - * @member commonHeader - * @member gnExtHeader - */ - type union ExtendedHeader { - GeoUnicastHeader geoUnicastHeader, - TSBHeader tsbHeader, - SHBHeader shbHeader, - GeoBroadcastHeader geoBroadcastHeader, - GeoAnycastHeader geoAnycastHeader, - BeaconHeader beaconHeader, - LSRequestHeader lsRequestHeader, - LSReplyHeader lsReplyHeader, - AnyHeader anyHeader - } with { - variant "" - } + /** + * @desc GeoNetworking ExtendedHeader + * + * @see ETSI EN 302 636-4-1 chapter 8.3 + * + * @member commonHeader + * @member gnExtHeader + */ + type union ExtendedHeader { + GeoUnicastHeader geoUnicastHeader, + TSBHeader tsbHeader, + SHBHeader shbHeader, + GeoBroadcastHeader geoBroadcastHeader, + GeoAnycastHeader geoAnycastHeader, + BeaconHeader beaconHeader, + LSRequestHeader lsRequestHeader, + LSReplyHeader lsReplyHeader, + AnyHeader anyHeader + } with { + variant "" + } - /** - * @desc The unspecified ANY header. - * - * @member seqNumber - * @member reserved - */ - type record AnyHeader { - UInt16 seqNumber, - UInt16 reserved - } with { - variant "FIELDORDER(msb)" - } + /** + * @desc The unspecified ANY header. + * + * @member seqNumber + * @member reserved + */ + type record AnyHeader { + UInt16 seqNumber, + UInt16 reserved + } with { + variant "FIELDORDER(msb)" + } - /** - * @desc The BEACON packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.6 - * - * @member commonHeader - */ - type record BeaconHeader { - LongPosVector srcPosVector - } with { - variant "FIELDORDER(msb)" - } + /** + * @desc The BEACON packet header. + * + * @see ETSI EN 302 636-4-1 chapter 8.8.6 + * + * @member commonHeader + */ + type record BeaconHeader { + LongPosVector srcPosVector + } with { + variant "FIELDORDER(msb)" + } - /** - * @desc The GEOANYCAST packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.5 - * - * @member seqNumber - * @member reserved - * @member srcPosVector - * @member geoAreaPosLatitude - * @member geoAreaPosLongitude - * @member distanceA - * @member distanceB - * @member angle - * @member reserved - */ - type record GeoAnycastHeader { - UInt16 seqNumber, - UInt16 reserved, - LongPosVector srcPosVector, - Int32 geoAreaPosLatitude, - Int32 geoAreaPosLongitude, - UInt16 distanceA, - UInt16 distanceB, - UInt16 angle, - UInt16 reserved2 - } with { - variant "FIELDORDER(msb)" - } + /** + * @desc The GEOANYCAST packet header. + * + * @see ETSI EN 302 636-4-1 chapter 8.8.5 + * + * @member seqNumber + * @member reserved + * @member srcPosVector + * @member geoAreaPosLatitude + * @member geoAreaPosLongitude + * @member distanceA + * @member distanceB + * @member angle + * @member reserved + */ + type record GeoAnycastHeader { + UInt16 seqNumber, + UInt16 reserved, + LongPosVector srcPosVector, + Int32 geoAreaPosLatitude, + Int32 geoAreaPosLongitude, + UInt16 distanceA, + UInt16 distanceB, + UInt16 angle, + UInt16 reserved2 + } with { + variant "FIELDORDER(msb)" + } - /** - * @desc The GEOBROADCAST packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.5 - * - * @member seqNumber - * @member reserved - * @member srcPosVector - * @member geoAreaPosLatitude - * @member geoAreaPosLongitude - * @member distanceA - * @member distanceB - * @member angle - * @member reserved - */ - type GeoAnycastHeader GeoBroadcastHeader; + /** + * @desc The GEOBROADCAST packet header. + * + * @see ETSI EN 302 636-4-1 chapter 8.8.5 + * + * @member seqNumber + * @member reserved + * @member srcPosVector + * @member geoAreaPosLatitude + * @member geoAreaPosLongitude + * @member distanceA + * @member distanceB + * @member angle + * @member reserved + */ + type GeoAnycastHeader GeoBroadcastHeader; - /** - * @desc The GEOUNICAST packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.2 - * - * @member seqNumber - * @member reserved - * @member srcPosVector - * @member dstPosVector - */ - type record GeoUnicastHeader { - UInt16 seqNumber, - UInt16 reserved, - LongPosVector srcPosVector, - ShortPosVector dstPosVector - } with { - variant "FIELDORDER(msb)" - } + /** + * @desc The GEOUNICAST packet header. + * + * @see ETSI EN 302 636-4-1 chapter 8.8.2 + * + * @member seqNumber + * @member reserved + * @member srcPosVector + * @member dstPosVector + */ + type record GeoUnicastHeader { + UInt16 seqNumber, + UInt16 reserved, + LongPosVector srcPosVector, + ShortPosVector dstPosVector + } with { + variant "FIELDORDER(msb)" + } - /** - * @desc The Location Service (LS) Reply packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.8 - * - * @member seqNumber - * @member reserved - * @member srcPosVector - * @member dstPosVector - */ - type record LSReplyHeader { - UInt16 seqNumber, - UInt16 reserved, - LongPosVector srcPosVector, - ShortPosVector dstPosVector - } with { - variant "FIELDORDER(msb)" - } + /** + * @desc The Location Service (LS) Reply packet header. + * + * @see ETSI EN 302 636-4-1 chapter 8.8.8 + * + * @member seqNumber + * @member reserved + * @member srcPosVector + * @member dstPosVector + */ + type record LSReplyHeader { + UInt16 seqNumber, + UInt16 reserved, + LongPosVector srcPosVector, + ShortPosVector dstPosVector + } with { + variant "FIELDORDER(msb)" + } - /** - * @desc The Location Service (LS) Request packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.7 - * - * @member seqNumber - * @member reserved - * @member srcPosVector - * @member gnAddress - */ - type record LSRequestHeader { - UInt16 seqNumber, - UInt16 reserved, - LongPosVector srcPosVector, - GN_Address gnAddress - } with { - variant "FIELDORDER(msb)" - } + /** + * @desc The Location Service (LS) Request packet header. + * + * @see ETSI EN 302 636-4-1 chapter 8.8.7 + * + * @member seqNumber + * @member reserved + * @member srcPosVector + * @member gnAddress + */ + type record LSRequestHeader { + UInt16 seqNumber, + UInt16 reserved, + LongPosVector srcPosVector, + GN_Address gnAddress + } with { + variant "FIELDORDER(msb)" + } - /** - * The Single Hop Broadcast (SHB) packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.4 - * - * @member srcPosVector - * @member reserved - */ - type record SHBHeader { - LongPosVector srcPosVector, - UInt32 reserved - } with { - variant "FIELDORDER(msb)" - } + /** + * The Single Hop Broadcast (SHB) packet header. + * + * @see ETSI EN 302 636-4-1 chapter 8.8.4 + * + * @member srcPosVector + * @member reserved + */ + type record SHBHeader { + LongPosVector srcPosVector, + UInt32 reserved + } with { + variant "FIELDORDER(msb)" + } - /** - * @desc The Topologically-Scoped Broadcast (TSB) packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.3 - * - * @member seqNumber - * @member reserved - * @member srcPosVector - */ - type record TSBHeader { - UInt16 seqNumber, - UInt16 reserved, - LongPosVector srcPosVector - } with { - variant "FIELDORDER(msb)" - } + /** + * @desc The Topologically-Scoped Broadcast (TSB) packet header. + * + * @see ETSI EN 302 636-4-1 chapter 8.8.3 + * + * @member seqNumber + * @member reserved + * @member srcPosVector + */ + type record TSBHeader { + UInt16 seqNumber, + UInt16 reserved, + LongPosVector srcPosVector + } with { + variant "FIELDORDER(msb)" + } - group geoNetworkingHeadersSubtypes { + group geoNetworkingHeadersSubtypes { - /** - * @desc Identifies the header type and the header subtype for ANY. - * @member headerType - * @member reserved - */ - type record AnyHeaderType { - HeaderType headerType(e_any), - UInt4 headerSubType - } with { - variant "FIELDORDER(msb)" - } + /** + * @desc Identifies the header type and the header subtype for ANY. + * @member headerType + * @member reserved + */ + type record AnyHeaderType { + HeaderType headerType(e_any), + UInt4 headerSubType + } with { + variant "FIELDORDER(msb)" + } - /** - * @desc Identifies the header type and the header subtype for BEACON. - * @member headerType - * @member reserved - */ - type record BeaconHeaderType { - HeaderType headerType(e_beacon), - UInt4 headerSubType - } with { - variant "FIELDORDER(msb)" - } + /** + * @desc Identifies the header type and the header subtype for BEACON. + * @member headerType + * @member reserved + */ + type record BeaconHeaderType { + HeaderType headerType(e_beacon), + UInt4 headerSubType + } with { + variant "FIELDORDER(msb)" + } - /** - * @desc Identifies the header type and the header subtype for GEOANYCAST. - * @member headerType - * @member reserved - */ - type record GeoAnycastHeaderType { - HeaderType headerType(e_geoAnycast), - HeaderSubTypeGeoAnycast headerSubType - } with { - variant "FIELDORDER(msb)" - } + /** + * @desc Identifies the header type and the header subtype for GEOANYCAST. + * @member headerType + * @member reserved + */ + type record GeoAnycastHeaderType { + HeaderType headerType(e_geoAnycast), + HeaderSubTypeGeoAnycast headerSubType + } with { + variant "FIELDORDER(msb)" + } - /** - * @desc Identifies the header type and the header subtype for GEOBROADCAST. - * @member headerType - * @member reserved - */ - type record GeoBroadcastHeaderType { - HeaderType headerType(e_geoBroadcast), - HeaderSubTypeGeoBroadcast headerSubType - } with { - variant "FIELDORDER(msb)" - } + /** + * @desc Identifies the header type and the header subtype for GEOBROADCAST. + * @member headerType + * @member reserved + */ + type record GeoBroadcastHeaderType { + HeaderType headerType(e_geoBroadcast), + HeaderSubTypeGeoBroadcast headerSubType + } with { + variant "FIELDORDER(msb)" + } - /** - * @desc Identifies the header type and the header subtype for GEOUNICAST. - * @member headerType - * @member reserved - */ - type record GeoUnicastHeaderType { - HeaderType headerType(e_geoUnicast), - UInt4 headerSubType - } with { - variant "FIELDORDER(msb)" - } + /** + * @desc Identifies the header type and the header subtype for GEOUNICAST. + * @member headerType + * @member reserved + */ + type record GeoUnicastHeaderType { + HeaderType headerType(e_geoUnicast), + UInt4 headerSubType + } with { + variant "FIELDORDER(msb)" + } - /** - * @desc Identifies the header type and the header subtype for Location Service LS. - * @member headerType - * @member reserved - */ - type record LsHeaderType { - HeaderType headerType(e_locationService), - HeaderSubTypeLs headerSubType - } with { - variant "FIELDORDER(msb)" - } + /** + * @desc Identifies the header type and the header subtype for Location Service LS. + * @member headerType + * @member reserved + */ + type record LsHeaderType { + HeaderType headerType(e_locationService), + HeaderSubTypeLs headerSubType + } with { + variant "FIELDORDER(msb)" + } - /** - * @desc Identifies the header type and the header subtype for Service Announcement SA. - * @member headerType - * @member reserved - */ - type record SaHeaderType { - HeaderType headerType(e_serviceAnnouncement), - HeaderSubTypeSa headerSubType - } with { - variant "FIELDORDER(msb)" - } + /** + * @desc Identifies the header type and the header subtype for Service Announcement SA. + * @member headerType + * @member reserved + */ + type record SaHeaderType { + HeaderType headerType(e_serviceAnnouncement), + HeaderSubTypeSa headerSubType + } with { + variant "FIELDORDER(msb)" + } - /** - * @desc Identifies the header type and the header subtype for Topologically-Scoped Broadcast TSB. - * @member headerType - * @member headerSubType - */ - type record TsbHeaderType { - HeaderType headerType(e_topologicallyScopedBroadcast), - HeaderSubTypeTSB headerSubType - } with { - variant "FIELDORDER(msb)" - } + /** + * @desc Identifies the header type and the header subtype for Topologically-Scoped Broadcast TSB. + * @member headerType + * @member headerSubType + */ + type record TsbHeaderType { + HeaderType headerType(e_topologicallyScopedBroadcast), + HeaderSubTypeTSB headerSubType + } with { + variant "FIELDORDER(msb)" + } - /** - * @desc Identifies the header subtype for GEOANYCAST. - */ - type enumerated HeaderSubTypeGeoAnycast { - e_geoAnycastCircle(0), - e_geoAnycastRect(1), - e_geoAnycastElip(2), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } + /** + * @desc Identifies the header subtype for GEOANYCAST. + */ + type enumerated HeaderSubTypeGeoAnycast { + e_geoAnycastCircle(0), + e_geoAnycastRect(1), + e_geoAnycastElip(2), + e_reserved + } with { + variant "FIELDLENGTH(4)" //variant "4 bit" + } - /** - * @desc Identifies the header subtype for GEOBROADCAST. - */ - type enumerated HeaderSubTypeGeoBroadcast { - e_geoBroadcastCircle(0), - e_geoBroadcastRect(1), - e_geoBroadcastElip(2), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } + /** + * @desc Identifies the header subtype for GEOBROADCAST. + */ + type enumerated HeaderSubTypeGeoBroadcast { + e_geoBroadcastCircle(0), + e_geoBroadcastRect(1), + e_geoBroadcastElip(2), + e_reserved + } with { + variant "FIELDLENGTH(4)" //variant "4 bit" + } - /** - * @desc Identifies the header subtype for Topologically-scoped broadcast TSB. - */ - type enumerated HeaderSubTypeTSB { - e_singleHop(0), - e_multiHop(1), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } + /** + * @desc Identifies the header subtype for Topologically-scoped broadcast TSB. + */ + type enumerated HeaderSubTypeTSB { + e_singleHop(0), + e_multiHop(1), + e_reserved + } with { + variant "FIELDLENGTH(4)" //variant "4 bit" + } - /** - * @desc Identifies the header subtype for Location Service LS. - */ - type enumerated HeaderSubTypeLs { - e_lsRequest(0), - e_lsReply(1), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } + /** + * @desc Identifies the header subtype for Location Service LS. + */ + type enumerated HeaderSubTypeLs { + e_lsRequest(0), + e_lsReply(1), + e_reserved + } with { + variant "FIELDLENGTH(4)" //variant "4 bit" + } - /** - * @desc Identifies the header subtype for Service Announcement SA. - */ - type enumerated HeaderSubTypeSa { - e_sa(0), - e_saEos(1), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } + /** + * @desc Identifies the header subtype for Service Announcement SA. + */ + type enumerated HeaderSubTypeSa { + e_sa(0), + e_saEos(1), + e_reserved + } with { + variant "FIELDLENGTH(4)" //variant "4 bit" + } - /** - * @desc Identifies the header type and the header subtype. - * @member anyHdr - * @member beaconHdr - * @member geoUnicastHdr - * @member geoAnycastHdr - * @member geoBroadcastHdr - * @member tsbHdr - * @member lsHdr - * @member saHdr - * @member reserved - */ - type union HeaderTST { - AnyHeaderType anyHdr, - BeaconHeaderType beaconHdr, - GeoUnicastHeaderType geoUnicastHdr, - GeoAnycastHeaderType geoAnycastHdr, - GeoBroadcastHeaderType geoBroadcastHdr, - TsbHeaderType tsbHdr, - LsHeaderType lsHdr, - SaHeaderType saHdr, - UInt8 reserved - } with { - variant "FIELDORDER(msb)" - } + /** + * @desc Identifies the header type and the header subtype. + * @member anyHdr + * @member beaconHdr + * @member geoUnicastHdr + * @member geoAnycastHdr + * @member geoBroadcastHdr + * @member tsbHdr + * @member lsHdr + * @member saHdr + * @member reserved + */ + type union HeaderTST { + AnyHeaderType anyHdr, + BeaconHeaderType beaconHdr, + GeoUnicastHeaderType geoUnicastHdr, + GeoAnycastHeaderType geoAnycastHdr, + GeoBroadcastHeaderType geoBroadcastHdr, + TsbHeaderType tsbHdr, + LsHeaderType lsHdr, + SaHeaderType saHdr, + UInt8 reserved + } with { + variant "FIELDORDER(msb)" + } - /** - * @desc Identifies the type of the GeoAdhoc header type (4Bits). - */ - type enumerated HeaderType { - e_any(0), - e_beacon(1), - e_geoUnicast(2), - e_geoAnycast(3), - e_geoBroadcast(4), - e_topologicallyScopedBroadcast(5), - e_locationService(6), - e_serviceAnnouncement(7), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } + /** + * @desc Identifies the type of the GeoAdhoc header type (4Bits). + */ + type enumerated HeaderType { + e_any(0), + e_beacon(1), + e_geoUnicast(2), + e_geoAnycast(3), + e_geoBroadcast(4), + e_topologicallyScopedBroadcast(5), + e_locationService(6), + e_serviceAnnouncement(7), + e_reserved + } with { + variant "FIELDLENGTH(4)" //variant "4 bit" + } - /** - * @desc Long Position Vector - * - *
-                 *  0               1               2               3
-                 *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
-                 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-                 * |                           GN_ADDR                             |
-                 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-                 * |                             TST                               |
-                 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-                 * |                             Lat                               |
-                 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-                 * |                             Long                              |
-                 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-                 * |P|              S              |               H               |
-                 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-                 * 
- * - * @see ETSI EN 302 636-4-1 chapter 8.5.2 - * - * @member gnAddr - * @member timestamp_ - * @member latitude - * @member longitude - * @member pai Position Accuracy Indicator - * @member speed - * @member heading - */ - type record LongPosVector { - GN_Address gnAddr, - UInt32 timestamp_, - Int32 latitude, - Int32 longitude, - Bit1 pai, - Int15 speed, - UInt16 heading - } with { - variant "FIELDORDER(msb)" - } + /** + * @desc Long Position Vector + * + *
+         *  0               1               2               3
+         *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+         * |                           GN_ADDR                             |
+         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+         * |                             TST                               |
+         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+         * |                             Lat                               |
+         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+         * |                             Long                              |
+         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+         * |P|              S              |               H               |
+         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+         * 
+ * + * @see ETSI EN 302 636-4-1 chapter 8.5.2 + * + * @member gnAddr + * @member timestamp_ + * @member latitude + * @member longitude + * @member pai Position Accuracy Indicator + * @member speed + * @member heading + */ + type record LongPosVector { + GN_Address gnAddr, + UInt32 timestamp_, + Int32 latitude, + Int32 longitude, + Bit1 pai, + Int15 speed, + UInt16 heading + } with { + variant "FIELDORDER(msb)" + } - /** - * @desc Short Position Vector - * - *
-                 *  0               1               2               3
-                 *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
-                 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-                 * |                           GN_ADDR                             |
-                 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-                 * |                             TST                               |
-                 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-                 * |                             Lat                               |
-                 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-                 * |                             Long                              |
-                 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-                 * 
- * - * @see ETSI EN 302 636-4-1 chapter 8.5.3 - * - * @member gnAddr - * @member timestamp - * @member latitude - * @member longitude - */ - type record ShortPosVector { - GN_Address gnAddr, - UInt32 timestamp_, - Int32 latitude, - Int32 longitude - } with { - variant "FIELDORDER(msb)" - } + /** + * @desc Short Position Vector + * + *
+         *  0               1               2               3
+         *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+         * |                           GN_ADDR                             |
+         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+         * |                             TST                               |
+         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+         * |                             Lat                               |
+         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+         * |                             Long                              |
+         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+         * 
+ * + * @see ETSI EN 302 636-4-1 chapter 8.5.3 + * + * @member gnAddr + * @member timestamp + * @member latitude + * @member longitude + */ + type record ShortPosVector { + GN_Address gnAddr, + UInt32 timestamp_, + Int32 latitude, + Int32 longitude + } with { + variant "FIELDORDER(msb)" + } - group geoNetworkingAddress { - /** - * @desc GeoNetworking address - * - *
-                     *  0               1               2               3
-                     *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
-                     * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-                     * |M|  S_T    |       S_CC        |             M_ID              |
-                     * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-                     * |                              M_ID                             |
-                     * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-                     * 
- * - * @see ETSI EN 302 636-4-1 chapter 6.2 - * - * @member typeOfAddress - * @member stationType - * @member mid - */ - type record GN_Address { - TypeOfAddress typeOfAddress, - StationType stationType, - UInt10 stationCountryCode, - Oct6 mid - } with { - variant "FIELDORDER(msb)" - } + group geoNetworkingAddress { + /** + * @desc GeoNetworking address + * + *
+           *  0               1               2               3
+           *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+           * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+           * |M|  S_T    |       S_CC        |             M_ID              |
+           * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+           * |                              M_ID                             |
+           * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+           * 
+ * + * @see ETSI EN 302 636-4-1 chapter 6.2 + * + * @member typeOfAddress + * @member stationType + * @member mid + */ + type record GN_Address { + TypeOfAddress typeOfAddress, + StationType stationType, + UInt10 stationCountryCode, + Oct6 mid + } with { + variant "FIELDORDER(msb)" + } - group geoNetworkingAddressSubtypes { + group geoNetworkingAddressSubtypes { - /** - * @desc Identifies the ITS station (5Bits). - */ - type enumerated StationType { - e_unknown(0), - e_pedestrian(1), - e_cyclist(2), - e_moped(3), - e_motorcycle(4), - e_passengerCar(5), - e_bus(6), - e_lightTruck(7), - e_heavyTruck(8), - e_trailer(9), - e_specialVehicle(10), - e_tram(11), - e_roadSideUnit(15) - } with { - variant "FIELDLENGTH(5)" //variant "5 bit" - } + /** + * @desc Identifies the ITS station (5Bits). + */ + type enumerated StationType { + e_unknown(0), + e_pedestrian(1), + e_cyclist(2), + e_moped(3), + e_motorcycle(4), + e_passengerCar(5), + e_bus(6), + e_lightTruck(7), + e_heavyTruck(8), + e_trailer(9), + e_specialVehicle(10), + e_tram(11), + e_roadSideUnit(15) + } with { + variant "FIELDLENGTH(5)" //variant "5 bit" + } - /** - * @desc Distinguish between manually configured - * network address and the initial GeoNetwork address (1Bit). - */ - type enumerated TypeOfAddress { - e_manual(1), - e_initial(0) - } with { - variant "FIELDLENGTH(1)" //variant "1 bit" - } + /** + * @desc Distinguish between manually configured + * network address and the initial GeoNetwork address (1Bit). + */ + type enumerated TypeOfAddress { + e_manual(1), + e_initial(0) + } with { + variant "FIELDLENGTH(1)" //variant "1 bit" + } - } // end group geoNetworkingAddressSubtypes + } // end group geoNetworkingAddressSubtypes - } // end group geoNetworkingAddress + } // end group geoNetworkingAddress - } // end group geoNetworkingHeadersSubtypes + } // end group geoNetworkingHeadersSubtypes - } // end group geoNetworkingExtendedHeaders + } // end group geoNetworkingExtendedHeaders - } // end group geoNetworkingHeader + } // end group geoNetworkingHeader - group geoNwPicsTypes { + group geoNwPicsTypes { - /** - * @desc The GeoUnicast forwarding algorithm. - */ - type enumerated GeoUnicastForwardingAlgorithm { - e_unspecified(0), - e_greedy(1), - e_cbf(2) - } + /** + * @desc The GeoUnicast forwarding algorithm. + */ + type enumerated GeoUnicastForwardingAlgorithm { + e_unspecified(0), + e_greedy(1), + e_cbf(2) + } - /** - * @desc The GeoBroadcast forwarding algorithm. - */ - type enumerated GeoBroadcastForwardingAlgorithm { - e_unspecified(0), - e_simple(1), - e_cbf(2), - e_advanced(3) - } + /** + * @desc The GeoBroadcast forwarding algorithm. + */ + type enumerated GeoBroadcastForwardingAlgorithm { + e_unspecified(0), + e_simple(1), + e_cbf(2), + e_advanced(3) + } - /** - * @desc GN address configuration method. - */ - type enumerated GnAddressConfigurationMethod { - e_auto(0), - e_managed(1), - e_anonymous(2) - } + /** + * @desc GN address configuration method. + */ + type enumerated GnAddressConfigurationMethod { + e_auto(0), + e_managed(1), + e_anonymous(2) + } - } // end geoNwPicsTypes + } // end geoNwPicsTypes - group utPrimitives { + group utPrimitives { - /** - * @desc Upper Tester message to initialize IUT - * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use - */ - type record UtGnInitialize { - Oct8 hashedId8 - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester results message of the GeoNetworking - * @member utGnInitialize - - * @member utGnTriggerResult - - * @member utAutoInteropTriggerResult - + /** + * @desc Upper Tester message to initialize IUT + * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use + */ + type record UtGnInitialize { + Oct8 hashedId8 + } with { + variant "FIELDORDER(msb)" + } - */ - type union UtGnResults { - boolean utGnInitializeResult, - boolean utGnTriggerResult, - boolean utAutoInteropTriggerResult - } with { - variant "" - } // End of type UtGnResults + /** + * @desc Upper Tester results message of the GeoNetworking IUT + * @member utGnInitialize - + * @member utGnTriggerResult - + * @member utAutoInteropTriggerResult - + * @member utGnChangePositionResult - + */ + type union UtGnResults { + boolean utGnInitializeResult, + boolean utGnTriggerResult, + boolean utGnAutoInteropTriggerResult, + boolean utGnChangePositionResult + } with { + variant "" + } // End of type UtGnResults /** * @desc AutoInterop UpperTester trigger * @member utRadioOnOff Set to true to power on the radio (on-link mode), false to power off the radio (off-link). */ - type union UtAutoInteropTrigger { - boolean utRadioOnOff - } with { - variant "" - } // End of type UtAutoInteropTrigger + type union UtAutoInteropTrigger { + boolean utRadioOnOff + } with { + variant "" + } // End of type UtAutoInteropTrigger /** - * @desc UT primitives for GeoNetworking - * @member geoUnicast - - * @member geoBroadcast - - * @member geoAnycast - - * @member shb - - * @member tsb - - * @member changePosition - - * @member checkPacket - + * @desc Upper Tester message to change the position of IUT. Values a relatives */ - type union UtGnTrigger { - GenerateGeoUnicastMessage geoUnicast, - GenerateGeoBroadcastMessage geoBroadcast, - GenerateGeoAnycastMessage geoAnycast, - GenerateSHBMessage shb, - GenerateTSBMessage tsb - } with { - variant "" - } + type record UtGnChangePosition { + Int32 latitude, + Int32 longitude, + Int32 elevation + } with { + variant "FIELDORDER(msb)" + } - type boolean UtGnTriggerResult; + /** + * @desc UT primitives for GeoNetworking + * @member geoUnicast - + * @member geoBroadcast - + * @member geoAnycast - + * @member shb - + * @member tsb - + * @member changePosition - + * @member checkPacket - + */ + type union UtGnTrigger { + GenerateGeoUnicastMessage geoUnicast, + GenerateGeoBroadcastMessage geoBroadcast, + GenerateGeoAnycastMessage geoAnycast, + GenerateSHBMessage shb, + GenerateTSBMessage tsb + } with { + variant "" + } - /** - * @desc UT primitive for IUT to send a GeoUnicast packet - * @member gnAddress Destination of the packet - * @member lifetime Lifetime of the packet - * @member trafficClass Traffic class of the packet - * @member payload GnRawPayload of the packet - */ - type record GenerateGeoUnicastMessage { - GN_Address gnAddress, - UInt16 lifetime, - TrafficClass trafficClass, - GnRawPayload payload - } with { - variant "FIELDORDER(msb)" - } + /** + * @desc UT primitive for IUT to send a GeoUnicast packet + * @member gnAddress Destination of the packet + * @member lifetime Lifetime of the packet + * @member trafficClass Traffic class of the packet + * @member payload GnRawPayload of the packet + */ + type record GenerateGeoUnicastMessage { + GN_Address gnAddress, + UInt16 lifetime, + TrafficClass trafficClass, + GnRawPayload payload + } with { + variant "FIELDORDER(msb)" + } - /** - * @desc UT primitive for IUT to send a GeoBroadcast packet - * @member shape Shape of the area - * @member lifetime Lifetime of the packet - * @member trafficClass Traffic class of the packet - * @member area Destination GeoArea - * @member payload GnRawPayload of the packet - */ - type record GenerateGeoBroadcastMessage { - GeoShape shape, - UInt16 lifetime, - TrafficClass trafficClass, - UInt24 reserved, - Area area, - GnRawPayload payload - } with { - variant "FIELDORDER(msb)" - } + /** + * @desc UT primitive for IUT to send a GeoBroadcast packet + * @member shape Shape of the area + * @member lifetime Lifetime of the packet + * @member trafficClass Traffic class of the packet + * @member area Destination GeoArea + * @member payload GnRawPayload of the packet + */ + type record GenerateGeoBroadcastMessage { + GeoShape shape, + UInt16 lifetime, + TrafficClass trafficClass, + UInt24 reserved, + Area area, + GnRawPayload payload + } with { + variant "FIELDORDER(msb)" + } - /** - * @desc UT primitive for IUT to send a Geoanycast packet - */ - type GenerateGeoBroadcastMessage GenerateGeoAnycastMessage; + /** + * @desc UT primitive for IUT to send a Geoanycast packet + */ + type GenerateGeoBroadcastMessage GenerateGeoAnycastMessage; - /** - * @desc UT primitive for IUT to send a SHB packet - * @member trafficClass Traffic class of the packet - * @member payload GnRawPayload of the packet - */ - type record GenerateSHBMessage { - TrafficClass trafficClass, - GnRawPayload payload - } with { - variant "FIELDORDER(msb)" - } + /** + * @desc UT primitive for IUT to send a SHB packet + * @member trafficClass Traffic class of the packet + * @member payload GnRawPayload of the packet + */ + type record GenerateSHBMessage { + TrafficClass trafficClass, + GnRawPayload payload + } with { + variant "FIELDORDER(msb)" + } - /** - * @desc UT primitive for IUT to send a SHB packet - * @member nbHops Number of Hops - * @member lifetime Lifetime of the packet - * @member trafficClass Traffic class of the packet - * @member payload GnRawPayload of the packet - */ - type record GenerateTSBMessage { - UInt8 nbHops, - UInt16 lifetime, - TrafficClass trafficClass, - GnRawPayload payload - } with { - variant "FIELDORDER(msb)" - } + /** + * @desc UT primitive for IUT to send a SHB packet + * @member nbHops Number of Hops + * @member lifetime Lifetime of the packet + * @member trafficClass Traffic class of the packet + * @member payload GnRawPayload of the packet + */ + type record GenerateTSBMessage { + UInt8 nbHops, + UInt16 lifetime, + TrafficClass trafficClass, + GnRawPayload payload + } with { + variant "FIELDORDER(msb)" + } - /** - * @desc Upper Tester message to check Upper Layer message transmission on GN IUT - */ - type record UtGnEventInd { -// GeoNetworkingPdu gnPdu - GnRawPayload rawPayload - } with { - variant "FIELDORDER(msb)" - } + /** + * @desc Upper Tester message to check Upper Layer message transmission on GN IUT + */ + type record UtGnEventInd { + // GeoNetworkingPdu gnPdu + GnRawPayload rawPayload + } with { + variant "FIELDORDER(msb)" + } - /** - * @desc List of Upper Tester messages to check Upper Layer message transmission on GN IUT - */ - type record of UtGnEventInd UtGnEventIndList; + /** + * @desc List of Upper Tester messages to check Upper Layer message transmission on GN IUT + */ + type record of UtGnEventInd UtGnEventIndList; - } // end utPrimitives - with { - encode "UpperTester"; - variant "" + } // end utPrimitives + with { + encode "UpperTester"; + variant "" } - group acPrimitives { + group acPrimitives { - /** - * @desc TA primitives for GeoNetworking - * @member startBeaconing - - * @member stopBeaconing - - * @member startPassBeaconing - - * @member stopPassBeaconing - - * @member startBeaconingMultipleNeighbour - - * @member stopBeaconingMultipleNeighbour - - * @member getLongPosVector - - */ - type union AcGnPrimitive { - AcStartBeaconing startBeaconing, - AcStopBeaconing stopBeaconing, - AcStartPassBeaconing startPassBeaconing, - AcStopPassBeaconing stopPassBeaconing, - AcStartBeaconingMultipleNeighbour startBeaconingMultipleNeighbour, - AcStopBeaconingMultipleNeighbour stopBeaconingMultipleNeighbour, - AcGetLongPosVector getLongPosVector - } with { - variant "" - } + /** + * @desc TA primitives for GeoNetworking + * @member startBeaconing - + * @member stopBeaconing - + * @member startPassBeaconing - + * @member stopPassBeaconing - + * @member startBeaconingMultipleNeighbour - + * @member stopBeaconingMultipleNeighbour - + * @member getLongPosVector - + */ + type union AcGnPrimitive { + AcStartBeaconing startBeaconing, + AcStopBeaconing stopBeaconing, + AcStartPassBeaconing startPassBeaconing, + AcStopPassBeaconing stopPassBeaconing, + AcStartBeaconingMultipleNeighbour startBeaconingMultipleNeighbour, + AcStopBeaconingMultipleNeighbour stopBeaconingMultipleNeighbour, + AcGetLongPosVector getLongPosVector + } with { + variant "" + } - /** - * @desc Primitive for receiveing response from TA - * @member getLongPosVector - */ - type union AcGnResponse { - LongPosVector getLongPosVector, - AcGnResponseFailure failure - } - with { - variant "" - encode(getLongPosVector) "LibItsGeoNetworking" - } + /** + * @desc Primitive for receiveing response from TA + * @member getLongPosVector + */ + type union AcGnResponse { + LongPosVector getLongPosVector, + AcGnResponseFailure failure + } + with { + variant "" + encode(getLongPosVector) "LibItsGeoNetworking" + } - type record AcGnResponseFailure { - boolean failure - } + type record AcGnResponseFailure { + boolean failure + } - /** - * @desc Primitive for TA to start sending beacons for the test component - * @member beaconHeader Beacon template - */ - type record AcStartBeaconing { - GeoNetworkingPdu beaconPacket - } - with { - encode(beaconPacket) "LibItsGeoNetworking" - } - - /** - * @desc Primitive for TA to stop sending beacons for the test component - */ - type record AcStopBeaconing { - } + /** + * @desc Primitive for TA to start sending beacons for the test component + * @member beaconHeader Beacon template + */ + type record AcStartBeaconing { + GeoNetworkingPdu beaconPacket + } + with { + encode(beaconPacket) "LibItsGeoNetworking" + } - /** - * @desc Primitive for TA to start enqueueing received beacons - * @member beaconHeader Filter - */ - type record AcStartPassBeaconing { - BeaconHeader beaconHeader - } - with { - encode(beaconHeader) "LibItsGeoNetworking" - }; + /** + * @desc Primitive for TA to stop sending beacons for the test component + */ + type record AcStopBeaconing { + } - /** - * @desc Primitive for TA to stop enqueueing received beacons - */ - type record AcStopPassBeaconing { - } + /** + * @desc Primitive for TA to start enqueueing received beacons + * @member beaconHeader Filter + */ + type record AcStartPassBeaconing { + BeaconHeader beaconHeader + } + with { + encode(beaconHeader) "LibItsGeoNetworking" + }; - /** - * @desc Primitive for TA to start sending beacons for multiple neighbours - * @member beaconHeader Beacon template - * @member numberOfNeighbour Number of neighbours to simulate - */ - type record AcStartBeaconingMultipleNeighbour { - GeoNetworkingPdu beaconPacket, - integer numberOfNeighbour - } - with { - encode(beaconPacket) "LibItsGeoNetworking" - }; + /** + * @desc Primitive for TA to stop enqueueing received beacons + */ + type record AcStopPassBeaconing { + } - /** - * @desc Primitive for TA to stop sending beacons for multiple neighbours - */ - type record AcStopBeaconingMultipleNeighbour { - } + /** + * @desc Primitive for TA to start sending beacons for multiple neighbours + * @member beaconHeader Beacon template + * @member numberOfNeighbour Number of neighbours to simulate + */ + type record AcStartBeaconingMultipleNeighbour { + GeoNetworkingPdu beaconPacket, + integer numberOfNeighbour + } + with { + encode(beaconPacket) "LibItsGeoNetworking" + }; - /** - * @desc Primitive for retrieving the position vector corresponding to a specific GN address - * @member gnAddress GN address to be searched - */ - type record AcGetLongPosVector { - GN_Address gnAddress - } - with { - encode(gnAddress) "LibItsGeoNetworking" - }; + /** + * @desc Primitive for TA to stop sending beacons for multiple neighbours + */ + type record AcStopBeaconingMultipleNeighbour { + } - } // end acPrimitives + /** + * @desc Primitive for retrieving the position vector corresponding to a specific GN address + * @member gnAddress GN address to be searched + */ + type record AcGetLongPosVector { + GN_Address gnAddress + } with { - variant "" - encode "AdapterControl" + encode(gnAddress) "LibItsGeoNetworking" + }; + + } // end acPrimitives + with { + variant "" + encode "AdapterControl" } } with { - variant "" - encode "LibItsGeoNetworking" -} + variant "" + encode "LibItsGeoNetworking" + } diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index eda3f56e..fad5870d 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -17,6 +17,9 @@ module LibItsSecurity_Templates { // LibItsCommon import from LibItsCommon_TypesAndValues all; + // LibItsGeoNetworking + import from LibItsGeoNetworking_TypesAndValues all; + // LibItsSecurity import from LibItsSecurity_TypesAndValues all; import from LibItsSecurity_Pixits all; @@ -2609,8 +2612,8 @@ module LibItsSecurity_Templates { group utPrimitives { - template UtInitialize m_secGnInitialize( - in Oct8 p_hashedId8 + template UtGnInitialize m_secGnInitialize( + in Oct8 p_hashedId8 ) := { hashedId8 := p_hashedId8 } // End of template m_secGnInitialize -- GitLab From 99204451dccb8a5116fb82c4aaa90bdbdb400d16 Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 15 Sep 2017 09:28:37 +0000 Subject: [PATCH 025/320] Start UpperTester changes --- ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn b/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn index 87ef8fc9..5f073ada 100644 --- a/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn +++ b/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn @@ -1,5 +1,6 @@ module LibItsDenm_EncdecDeclarations { + import from LibItsDenm_TypesAndValues all; import from LibItsDenm_TestSystem all; import from DENM_PDU_Descriptions language "ASN.1:1997" all; @@ -18,4 +19,7 @@ module LibItsDenm_EncdecDeclarations { external function fx_dec_DENM (inout bitstring b, out DENM p) return integer with {extension "prototype(sliding) decode(PER)"} + external function fx_enc_UtDenmInitialize (UtDenmInitialize p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + } // End of module LibItsDenm_EncdecDeclarations -- GitLab From ec9eb8a41fd77b14ae4cafee64ed4449a524e5e8 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 20 Sep 2017 13:56:09 +0000 Subject: [PATCH 026/320] UpperTester changes --- ttcn/CAM/LibItsCam_Functions.ttcn | 8 ++++---- ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn | 6 ++++++ ttcn/DENM/LibItsDenm_Functions.ttcn | 8 ++++---- ttcn/DENM/LibItsDenm_Templates.ttcn | 4 ++-- ttcn/DENM/LibItsDenm_TestSystem.ttcn | 2 +- ttcn/DENM/LibItsDenm_TypesAndValues.ttcn | 6 +++--- ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn | 4 ++-- .../GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn | 2 +- 8 files changed, 23 insertions(+), 17 deletions(-) diff --git a/ttcn/CAM/LibItsCam_Functions.ttcn b/ttcn/CAM/LibItsCam_Functions.ttcn index 2a6e5b8e..5a25f9d5 100644 --- a/ttcn/CAM/LibItsCam_Functions.ttcn +++ b/ttcn/CAM/LibItsCam_Functions.ttcn @@ -110,10 +110,10 @@ module LibItsCam_Functions { [] utPort.receive(UtCamResults: { utCamChangePositionResult := true}) { tc_wait.stop; } - [] utPort.receive(UtCamResults: { utCamChangePositionResult := false }) { - tc_wait.stop; - log("*** f_utChangePosition: INFO: IUT position change was not successful ***"); - f_selfOrClientSyncAndVerdict("error", e_error); + [] utPort.receive(UtCamResults: { utCamChangePositionResult := false }) { + tc_wait.stop; + log("*** f_utChangePosition: INFO: IUT position change was not successful ***"); + f_selfOrClientSyncAndVerdict("error", e_error); } [] a_utDefault() { } diff --git a/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn b/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn index 5f073ada..a9a34eff 100644 --- a/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn +++ b/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn @@ -22,4 +22,10 @@ module LibItsDenm_EncdecDeclarations { external function fx_enc_UtDenmInitialize (UtDenmInitialize p) return bitstring with {extension "prototype(convert) encode(UpperTester)"} + external function fx_enc_UtDenmChangePosition (UtDenmChangePosition p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + + external function fx_enc_UtDenmChangePseudonym (UtDenmChangePseudonym p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + } // End of module LibItsDenm_EncdecDeclarations diff --git a/ttcn/DENM/LibItsDenm_Functions.ttcn b/ttcn/DENM/LibItsDenm_Functions.ttcn index 6278fbcf..9d0a5ac2 100644 --- a/ttcn/DENM/LibItsDenm_Functions.ttcn +++ b/ttcn/DENM/LibItsDenm_Functions.ttcn @@ -58,7 +58,7 @@ module LibItsDenm_Functions { log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); f_selfOrClientSyncAndVerdict("error", e_timeout); } - } + } //activate denmPort default alts vc_denmDefaultActive := true; @@ -69,7 +69,7 @@ module LibItsDenm_Functions { * @desc Requests to change the IUT with a new pseudonym * @param p_change The change to trigger. */ - function f_utChangePseudonym ( template (value) UtChangePseudonym p_change ) runs on ItsDenm { + function f_utChangePseudonym ( template (value) UtDenmChangePseudonym p_change ) runs on ItsDenm { //deactivate denmPort default alts vc_denmDefaultActive := false; @@ -77,11 +77,11 @@ module LibItsDenm_Functions { utPort.send(p_change); tc_wait.start; alt { - [] utPort.receive(UtDenmResults: { utChangePseudonymResult := true}) { + [] utPort.receive(UtDenmResults: { utDenmChangePseudonymResult := true}) { tc_wait.stop; log("*** " & testcasename() & ": INFO: IUT pseudonym changed ***"); } - [] utPort.receive(UtDenmResults: { utChangePseudonymResult := false}) { + [] utPort.receive(UtDenmResults: { utDenmChangePseudonymResult := false}) { tc_wait.stop; log("*** " & testcasename() & ": INFO: IUT pseudonym changed ***"); f_selfOrClientSyncAndVerdict("error", e_error); diff --git a/ttcn/DENM/LibItsDenm_Templates.ttcn b/ttcn/DENM/LibItsDenm_Templates.ttcn index 572f2533..d88ba6b1 100644 --- a/ttcn/DENM/LibItsDenm_Templates.ttcn +++ b/ttcn/DENM/LibItsDenm_Templates.ttcn @@ -146,7 +146,7 @@ module LibItsDenm_Templates { /** * @desc Send template for Upper Tester event changePseudonym */ - template (value) UtChangePseudonym m_utChangePseudonym := { + template (value) UtDenmChangePseudonym m_utDenmChangePseudonym := { } /** @@ -231,7 +231,7 @@ module LibItsDenm_Templates { * @param p_longitude The new longitude * @param p_elevation The new elevation (Default: 0) */ - template (value) UtDenmChangePosition m_utChangePosition( + template (value) UtDenmChangePosition m_utDenmChangePosition( template (value) integer p_latitude, template (value) integer p_longitude, template (value) integer p_elevation := 0 diff --git a/ttcn/DENM/LibItsDenm_TestSystem.ttcn b/ttcn/DENM/LibItsDenm_TestSystem.ttcn index 13bbf908..8bd2b6ff 100644 --- a/ttcn/DENM/LibItsDenm_TestSystem.ttcn +++ b/ttcn/DENM/LibItsDenm_TestSystem.ttcn @@ -47,7 +47,7 @@ module LibItsDenm_TestSystem { */ type port UpperTesterPort message { out - UtDenmInitialize, UtDenmTrigger, UtDenmUpdate, UtDenmTermination, UtDenmChangePosition, UtChangePseudonym; + UtDenmInitialize, UtDenmTrigger, UtDenmUpdate, UtDenmTermination, UtDenmChangePosition, UtDenmChangePseudonym; in UtDenmResults, UtDenmEventInd; } // end UpperTesterPort diff --git a/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn b/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn index 433c974f..2dccd4e0 100644 --- a/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn +++ b/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn @@ -80,7 +80,7 @@ module LibItsDenm_TypesAndValues { * @member utDenmTriggerResult - * @member utDenmUpdateResult, - * @member utDenmChangePositionResult - - * @member utChangePseudonymResult - + * @member utDenmChangePseudonymResult - */ type union UtDenmResults { boolean utDenmInitializeResult, @@ -88,7 +88,7 @@ module LibItsDenm_TypesAndValues { UtDenmUpdateResult utDenmUpdateResult, boolean utDenmTerminationResult, boolean utDenmChangePositionResult, - boolean utChangePseudonymResult + boolean utDenmChangePseudonymResult } with { variant "" } // End of type UtDenmResults @@ -171,7 +171,7 @@ module LibItsDenm_TypesAndValues { /** * @desc Upper Tester message to change the pseudonym of the DENM IUT */ - type record UtChangePseudonym { + type record UtDenmChangePseudonym { // empty on purpose } with { variant "FIELDORDER(msb)" diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn index 86bd4e7a..4790ada7 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn @@ -50,9 +50,9 @@ module LibItsGeoNetworking_TestSystem { */ type port UpperTesterPort message { out - UtGnInitialize, UtGnChangePosition, UtAutoInteropTrigger, UtGnTrigger; + UtGnInitialize, UtGnChangePosition, UtAutoInteropTrigger, UtGnTrigger; // FIXME Remove UtAutoInteropTrigger from GN component, create an AutoInterop component in - UtGnResults, UtGnEventInd; + UtGnResults, UtGnEventInd; } // end UpperTesterPort } // end portDefinitions diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn index 7a877793..e9083080 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn @@ -949,7 +949,7 @@ module LibItsGeoNetworking_TypesAndValues { type union UtGnResults { boolean utGnInitializeResult, boolean utGnTriggerResult, - boolean utGnAutoInteropTriggerResult, + boolean utAutoInteropTriggerResult, // FIXME Remove UtAutoInteropTrigger from GN component, create an AutoInterop component boolean utGnChangePositionResult } with { variant "" -- GitLab From cc915fee1ee5581385f45d58db7bab2f9afb29c6 Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 25 Sep 2017 12:10:18 +0000 Subject: [PATCH 027/320] UpperTester changes validation --- ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn b/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn index a9a34eff..778c29c9 100644 --- a/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn +++ b/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn @@ -28,4 +28,16 @@ module LibItsDenm_EncdecDeclarations { external function fx_enc_UtDenmChangePseudonym (UtDenmChangePseudonym p) return bitstring with {extension "prototype(convert) encode(UpperTester)"} + external function fx_enc_UtDenmTrigger (UtDenmTrigger p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + + external function fx_enc_UtDenmUpdate (UtDenmUpdate p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + + external function fx_enc_UtDenmTermination (UtDenmTermination p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + + external function fx_dec_UtDenmResults (inout bitstring b, out UtDenmResults p) return integer + with {extension "prototype(sliding) decode(UpperTester)"} + } // End of module LibItsDenm_EncdecDeclarations -- GitLab From c6f9f3d343f568ce6e47f15be0f3339bf2187f0a Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 27 Sep 2017 07:18:02 +0000 Subject: [PATCH 028/320] UpperTester/DENM validation --- ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn b/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn index 778c29c9..5b8e61d7 100644 --- a/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn +++ b/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn @@ -40,4 +40,7 @@ module LibItsDenm_EncdecDeclarations { external function fx_dec_UtDenmResults (inout bitstring b, out UtDenmResults p) return integer with {extension "prototype(sliding) decode(UpperTester)"} + external function fx_dec_UtDenmEventInd (inout bitstring b, out UtDenmEventInd p) return integer + with {extension "prototype(sliding) decode(UpperTester)"} + } // End of module LibItsDenm_EncdecDeclarations -- GitLab From 7f63cabbd62e8fb5f15fa6f332b67c37208100c7 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 27 Sep 2017 13:26:50 +0000 Subject: [PATCH 029/320] UpperTester/CAM validation --- ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn | 19 ++++++++++++++++++- ttcn/CAM/LibItsCam_TypesAndValues.ttcn | 2 +- ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn | 3 +++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn b/ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn index c2986967..296a07d0 100644 --- a/ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn +++ b/ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn @@ -4,6 +4,7 @@ module LibItsCam_EncdecDeclarations { import from CAM_PDU_Descriptions language "ASN.1:1997" all; // LibItsCam + import from LibItsCam_TypesAndValues all; import from LibItsCam_TestSystem all; external function fx_enc_CamReq (CamReq p) return bitstring @@ -23,5 +24,21 @@ module LibItsCam_EncdecDeclarations { /* external function fx_enc_CAM (CAM p) return octetstring with {extension "prototype(convert) encode(BER:BER_ENCODE_CER)"} -*/ +*/ + + external function fx_enc_UtCamInitialize (UtCamInitialize p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + + external function fx_enc_UtCamChangePosition (UtCamChangePosition p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + + external function fx_enc_UtCamTrigger (UtCamTrigger p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + + external function fx_dec_UtCamResults (inout bitstring b, out UtCamResults p) return integer + with {extension "prototype(sliding) decode(UpperTester)"} + + external function fx_dec_UtCamEventInd (inout bitstring b, out UtCamEventInd p) return integer + with {extension "prototype(sliding) decode(UpperTester)"} + } // End of module LibItsCam_EncdecDeclarations diff --git a/ttcn/CAM/LibItsCam_TypesAndValues.ttcn b/ttcn/CAM/LibItsCam_TypesAndValues.ttcn index ff19154f..e6e077b5 100644 --- a/ttcn/CAM/LibItsCam_TypesAndValues.ttcn +++ b/ttcn/CAM/LibItsCam_TypesAndValues.ttcn @@ -164,7 +164,7 @@ module LibItsCam_TypesAndValues { * @desc Upper Tester message to check event/status on CAM IUT */ type record UtCamEventInd { - CAM camMsg + CAM camMsg // TODO Rename into caMsg to be compliant with UtDenmEventInd } with { encode (camMsg) "LibItsCam_asn1" } diff --git a/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn b/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn index 5b8e61d7..1b737e81 100644 --- a/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn +++ b/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn @@ -1,6 +1,9 @@ module LibItsDenm_EncdecDeclarations { + // LibIts import from LibItsDenm_TypesAndValues all; + + // LibItsDenm import from LibItsDenm_TestSystem all; import from DENM_PDU_Descriptions language "ASN.1:1997" all; -- GitLab From c2dab5af2393df2f6ddd340b45cc16324caad35d Mon Sep 17 00:00:00 2001 From: filatov Date: Thu, 28 Sep 2017 15:12:43 +0000 Subject: [PATCH 030/320] Security ASN1 files --- asn1/Security/1609Dot2/IEEE1609dot2.asn | 310 ++++++++++++++++ .../1609Dot2/IEEE1609dot2BaseTypes.asn | 334 ++++++++++++++++++ asn1/Security/EtsiTs103097Module.asn | 105 ++++++ 3 files changed, 749 insertions(+) create mode 100755 asn1/Security/1609Dot2/IEEE1609dot2.asn create mode 100755 asn1/Security/1609Dot2/IEEE1609dot2BaseTypes.asn create mode 100755 asn1/Security/EtsiTs103097Module.asn diff --git a/asn1/Security/1609Dot2/IEEE1609dot2.asn b/asn1/Security/1609Dot2/IEEE1609dot2.asn new file mode 100755 index 00000000..67d7682c --- /dev/null +++ b/asn1/Security/1609Dot2/IEEE1609dot2.asn @@ -0,0 +1,310 @@ +IEEE1609dot2 {iso(1) identified-organization(3) ieee(111) +standards-association-numbered-series-standards(2) wave-stds(1609) +dot2(2) base (1) schema (1) major-version-2(2)} + +--****************************************************************************** +-- +-- IEEE P1609.2 Data Types +-- +--****************************************************************************** + +DEFINITIONS AUTOMATIC TAGS ::= BEGIN + +EXPORTS ALL; + +IMPORTS + CrlSeries, + EccP256CurvePoint, + EciesP256EncryptedKey, + EncryptionKey, + GeographicRegion, + GroupLinkageValue, + HashAlgorithm, + HashedId3, + HashedId8, + Hostname, + IValue, + LinkageValue, + Opaque, + Psid, + PsidSsp, + PsidSspRange, + PublicEncryptionKey, + PublicVerificationKey, + SequenceOfHashedId3, + SequenceOfPsidSsp, + SequenceOfPsidSspRange, + ServiceSpecificPermissions, + Signature, + SubjectAssurance, + SymmetricEncryptionKey, + ThreeDLocation, + Time64, + Uint3, + Uint8, + Uint16, + Uint32, + ValidityPeriod +FROM IEEE1609dot2BaseTypes {iso(1) identified-organization(3) ieee(111) + standards-association-numbered-series-standards(2) wave-stds(1609) + dot2(2) base(1) base-types(2) major-version-2 (2)} + +; + +-- +--********************************************************************* +-- +-- Structures for describing secured data +-- +--********************************************************************* + +-- Necessary to get certain tools to generate sample PDUs +-- TestIeee1609Dot2Data ::= Ieee1609Dot2Data +-- TestCertificate ::= Certificate + +-- this structure belongs later in the file but putting it here avoids +-- compiler errors with certain tools +SignedDataPayload ::= SEQUENCE { + data Ieee1609Dot2Data OPTIONAL, + extDataHash HashedData OPTIONAL, + ... +} + (WITH COMPONENTS {..., data PRESENT} | + WITH COMPONENTS {..., extDataHash PRESENT}) + +Ieee1609Dot2Data ::= SEQUENCE { + protocolVersion Uint8(3), + content Ieee1609Dot2Content +} + +Ieee1609Dot2Content ::= CHOICE { + unsecuredData Opaque, + signedData SignedData, + encryptedData EncryptedData, + signedCertificateRequest Opaque, + ... +} + +SignedData ::= SEQUENCE { + hashId HashAlgorithm, + tbsData ToBeSignedData, + signer SignerIdentifier, + signature Signature +} + +SignerIdentifier ::= CHOICE { + digest HashedId8, + certificate SequenceOfCertificate, + self NULL, + ... +} + +ToBeSignedData ::= SEQUENCE { + payload SignedDataPayload, + headerInfo HeaderInfo +} + +HashedData::= CHOICE { + sha256HashedData OCTET STRING (SIZE(32)), + ... +} + +HeaderInfo ::= SEQUENCE { + psid Psid, + generationTime Time64 OPTIONAL, + expiryTime Time64 OPTIONAL, + generationLocation ThreeDLocation OPTIONAL, + p2pcdLearningRequest HashedId3 OPTIONAL, + missingCrlIdentifier MissingCrlIdentifier OPTIONAL, + encryptionKey EncryptionKey OPTIONAL, + ..., + inlineP2pcdRequest SequenceOfHashedId3 OPTIONAL, + requestedCertificate Certificate OPTIONAL +} + +MissingCrlIdentifier ::= SEQUENCE { + cracaId HashedId3, + crlSeries CrlSeries, + ... +} + +Countersignature ::= Ieee1609Dot2Data (WITH COMPONENTS {..., + content (WITH COMPONENTS {..., + signedData (WITH COMPONENTS {..., + tbsData (WITH COMPONENTS {..., + payload (WITH COMPONENTS {..., + data ABSENT, + extDataHash PRESENT + }), + headerInfo(WITH COMPONENTS {..., + generationTime PRESENT, + expiryTime ABSENT, + generationLocation ABSENT, + p2pcdLearningRequest ABSENT, + missingCrlIdentifier ABSENT, + encryptionKey ABSENT + }) + }) + }) + }) +}) + +--********************************************************************** +-- +-- Structures for describing encrypted data +-- +--********************************************************************** + + +EncryptedData ::= SEQUENCE { + recipients SequenceOfRecipientInfo, + ciphertext SymmetricCiphertext +} +RecipientInfo ::= CHOICE { + pskRecipInfo PreSharedKeyRecipientInfo, + symmRecipInfo SymmRecipientInfo, + certRecipInfo PKRecipientInfo, + signedDataRecipInfo PKRecipientInfo, + rekRecipInfo PKRecipientInfo +} + +SequenceOfRecipientInfo ::= SEQUENCE OF RecipientInfo + +PreSharedKeyRecipientInfo ::= HashedId8 +SymmRecipientInfo ::= SEQUENCE { + recipientId HashedId8, + encKey SymmetricCiphertext +} + +PKRecipientInfo ::= SEQUENCE { + recipientId HashedId8, + encKey EncryptedDataEncryptionKey +} + +EncryptedDataEncryptionKey ::= CHOICE { + eciesNistP256 EciesP256EncryptedKey, + eciesBrainpoolP256r1 EciesP256EncryptedKey, + ... +} + +SymmetricCiphertext ::= CHOICE { + aes128ccm AesCcmCiphertext, + ... +} + +AesCcmCiphertext ::= SEQUENCE { + nonce OCTET STRING (SIZE (12)), + ccmCiphertext Opaque -- 16 bytes longer than plaintext +} + + +--********************************************************************** +-- +-- Certificates and other security management data structures +-- +--********************************************************************** + +-- Certificates are implicit (type = implicit, toBeSigned includes +-- reconstruction value, signature absent) or explicit (type = explicit, +-- toBeSigned includes verification key, signature present). + +Certificate ::= CertificateBase (ImplicitCertificate | ExplicitCertificate) + +SequenceOfCertificate ::= SEQUENCE OF Certificate + +CertificateBase ::= SEQUENCE { + version Uint8(3), + type CertificateType, + issuer IssuerIdentifier, + toBeSigned ToBeSignedCertificate, + signature Signature OPTIONAL +} + +CertificateType ::= ENUMERATED { + explicit, + implicit, + ... +} + +ImplicitCertificate ::= CertificateBase (WITH COMPONENTS {..., + type(implicit), + toBeSigned(WITH COMPONENTS {..., + verifyKeyIndicator(WITH COMPONENTS {reconstructionValue}) + }), + signature ABSENT + }) + +ExplicitCertificate ::= CertificateBase (WITH COMPONENTS {..., + type(explicit), + toBeSigned(WITH COMPONENTS {..., + verifyKeyIndicator(WITH COMPONENTS {verificationKey}) + }), + signature PRESENT + }) + +IssuerIdentifier ::= CHOICE { + sha256AndDigest HashedId8, + self HashAlgorithm, + ..., + sha384AndDigest HashedId8 +} + +ToBeSignedCertificate ::= SEQUENCE { + id CertificateId, + cracaId HashedId3, + crlSeries CrlSeries, + validityPeriod ValidityPeriod, + region GeographicRegion OPTIONAL, + assuranceLevel SubjectAssurance OPTIONAL, + appPermissions SequenceOfPsidSsp OPTIONAL, + certIssuePermissions SequenceOfPsidGroupPermissions OPTIONAL, + certRequestPermissions SequenceOfPsidGroupPermissions OPTIONAL, + canRequestRollover NULL OPTIONAL, + encryptionKey PublicEncryptionKey OPTIONAL, + verifyKeyIndicator VerificationKeyIndicator, + ... +} +(WITH COMPONENTS { ..., appPermissions PRESENT} | + WITH COMPONENTS { ..., certIssuePermissions PRESENT} | + WITH COMPONENTS { ..., certRequestPermissions PRESENT}) + +CertificateId ::= CHOICE { + linkageData LinkageData, + name Hostname, + binaryId OCTET STRING(SIZE(1..64)), + none NULL, + ... +} + +LinkageData ::= SEQUENCE { + iCert IValue, + linkage-value LinkageValue, + group-linkage-value GroupLinkageValue OPTIONAL +} + +--EndEntityType ::= BIT STRING {app (0), enrol (1) } (SIZE (8)) (ALL EXCEPT {}) +EndEntityType ::= BIT STRING {app (0), enrol (1) } (SIZE (8)) + +PsidGroupPermissions ::= SEQUENCE { + subjectPermissions SubjectPermissions, + minChainLength INTEGER DEFAULT 1, + chainLengthRange INTEGER DEFAULT 0, + eeType EndEntityType DEFAULT '00'H +} + +SequenceOfPsidGroupPermissions ::= SEQUENCE OF PsidGroupPermissions + +SubjectPermissions ::= CHOICE { + explicit SequenceOfPsidSspRange, + all NULL, + ... +} + +VerificationKeyIndicator ::= CHOICE { + verificationKey PublicVerificationKey, + reconstructionValue EccP256CurvePoint, + ... +} + +END + diff --git a/asn1/Security/1609Dot2/IEEE1609dot2BaseTypes.asn b/asn1/Security/1609Dot2/IEEE1609dot2BaseTypes.asn new file mode 100755 index 00000000..04a38acb --- /dev/null +++ b/asn1/Security/1609Dot2/IEEE1609dot2BaseTypes.asn @@ -0,0 +1,334 @@ +IEEE1609dot2BaseTypes {iso(1) identified-organization(3) ieee(111) +standards-association-numbered-series-standards(2) wave-stds(1609) +dot2(2) base(1) base-types(2) major-version-2(2)} + +-- +--******************************************************************** +-- IEEE P1609.2 Base Data Types +-- +--******************************************************************** + +DEFINITIONS AUTOMATIC TAGS ::= BEGIN + +EXPORTS ALL; + + +-- ------------------------------------------------------------------ +-- +-- Integers +-- +-- ------------------------------------------------------------------ + + +Uint3 ::= INTEGER (0..7) -- (hex) 07 +Uint8 ::= INTEGER (0..255) -- (hex) ff +Uint16 ::= INTEGER (0..65535) -- (hex) ff ff +Uint32 ::= INTEGER (0..4294967295)---- -- (hex) ff ff ff ff +Uint64 ::= INTEGER (0..18446744073709551615) -- (hex) ff ff ff ff ff ff ff ff +-- Uint64 ::= INTEGER -- -- (hex) ff ff ff ff ff ff ff ff + +SequenceOfUint8 ::= SEQUENCE OF Uint8 +SequenceOfUint16 ::= SEQUENCE OF Uint16 + +-- ------------------------------------------------------------------ +-- +-- OCTET STRING types +-- +-- ------------------------------------------------------------------ + + +Opaque ::= OCTET STRING + + +HashedId10 ::= OCTET STRING (SIZE(10)) +HashedId8 ::= OCTET STRING (SIZE(8)) +HashedId3 ::= OCTET STRING (SIZE(3)) +SequenceOfHashedId3 ::= SEQUENCE OF HashedId3 + + +-- ------------------------------------------------------------------ +-- +-- Time +-- +-- ------------------------------------------------------------------ + +Time32 ::= Uint32 +Time64 ::= Uint64 + +ValidityPeriod ::= SEQUENCE { + start Time32, + duration Duration +} + +Duration ::= CHOICE { + microseconds Uint16, + milliseconds Uint16, + seconds Uint16, + minutes Uint16, + hours Uint16, + sixtyHours Uint16, + years Uint16 +} + +-- ------------------------------------------------------------------ +-- +-- Location +-- +-- ------------------------------------------------------------------ + + +GeographicRegion ::= CHOICE { + circularRegion CircularRegion, + rectangularRegion SequenceOfRectangularRegion, + polygonalRegion PolygonalRegion, + identifiedRegion SequenceOfIdentifiedRegion, + ... +} + +CircularRegion ::= SEQUENCE { + center TwoDLocation, + radius Uint16 +} + +RectangularRegion ::= SEQUENCE { + northWest TwoDLocation, + southEast TwoDLocation +} + +SequenceOfRectangularRegion ::= SEQUENCE OF RectangularRegion + +PolygonalRegion ::= SEQUENCE SIZE(3..MAX) OF TwoDLocation + +TwoDLocation ::= SEQUENCE { + latitude Latitude, + longitude Longitude +} + +IdentifiedRegion ::= CHOICE { + countryOnly CountryOnly, + countryAndRegions CountryAndRegions, + countryAndSubregions CountryAndSubregions, + ... +} + +SequenceOfIdentifiedRegion ::= SEQUENCE OF IdentifiedRegion + +CountryOnly ::= Uint16 + +CountryAndRegions ::= SEQUENCE { + countryOnly CountryOnly, + regions SequenceOfUint8 +} + +CountryAndSubregions ::= SEQUENCE { + country CountryOnly, + regionAndSubregions SequenceOfRegionAndSubregions +} + +RegionAndSubregions ::= SEQUENCE { + region Uint8, + subregions SequenceOfUint16 +} + +SequenceOfRegionAndSubregions ::= SEQUENCE OF RegionAndSubregions + +ThreeDLocation ::= SEQUENCE { + latitude Latitude, + longitude Longitude, + elevation Elevation +} + +Latitude ::= NinetyDegreeInt +Longitude ::= OneEightyDegreeInt +Elevation ::= ElevInt + +NinetyDegreeInt ::= INTEGER { + min (-900000000), + max (900000000), + unknown (900000001) +} (-900000000..900000001) + +KnownLatitude ::= NinetyDegreeInt (min..max) -- Minus 90deg to +90deg in microdegree intervals +UnknownLatitude ::= NinetyDegreeInt (unknown) + +OneEightyDegreeInt ::= INTEGER { + min (-1799999999), + max (1800000000), + unknown (1800000001) +} (-1799999999..1800000001) + +KnownLongitude ::= OneEightyDegreeInt (min..max) +UnknownLongitude ::= OneEightyDegreeInt (unknown) + +ElevInt ::= Uint16 -- Range is from -4096 to 61439 in units of one-tenth of a meter + +-- ------------------------------------------------------------------ +-- +-- Crypto +-- +-- ------------------------------------------------------------------ + +Signature ::= CHOICE { + ecdsaNistP256Signature EcdsaP256Signature, + ecdsaBrainpoolP256r1Signature EcdsaP256Signature, + ..., + ecdsaBrainpoolP384r1Signature EcdsaP384Signature +} + +EcdsaP256Signature ::= SEQUENCE { + rSig EccP256CurvePoint, + sSig OCTET STRING (SIZE (32)) +} + +EcdsaP384Signature ::= SEQUENCE { + rSig EccP384CurvePoint, + sSig OCTET STRING (SIZE (48)) +} + +EccP256CurvePoint ::= CHOICE { + x-only OCTET STRING (SIZE (32)), + fill NULL, -- consistency with 1363 / X9.62 + compressed-y-0 OCTET STRING (SIZE (32)), + compressed-y-1 OCTET STRING (SIZE (32)), + uncompressedP256 SEQUENCE { + x OCTET STRING (SIZE (32)), + y OCTET STRING (SIZE (32)) + } +} + +EccP384CurvePoint::= CHOICE { + x-only OCTET STRING (SIZE (48)), + fill NULL, -- consistency w 1363 / X9.62 + compressed-y-0 OCTET STRING (SIZE (48)), + compressed-y-1 OCTET STRING (SIZE (48)), + uncompressedP384 SEQUENCE { + x OCTET STRING (SIZE (48)), + y OCTET STRING (SIZE (48)) + } +} + + +SymmAlgorithm ::= ENUMERATED { + aes128Ccm, + ... +} + +HashAlgorithm ::= ENUMERATED { + sha256, + ..., + sha384 +} + +EciesP256EncryptedKey ::= SEQUENCE { + v EccP256CurvePoint, + c OCTET STRING (SIZE (16)), + t OCTET STRING (SIZE (16)) +} + +EncryptionKey ::= CHOICE { + public PublicEncryptionKey, + symmetric SymmetricEncryptionKey +} + +PublicEncryptionKey ::= SEQUENCE { + supportedSymmAlg SymmAlgorithm, + publicKey BasePublicEncryptionKey +} + +BasePublicEncryptionKey ::= CHOICE { + eciesNistP256 EccP256CurvePoint, + eciesBrainpoolP256r1 EccP256CurvePoint, + ... +} + +PublicVerificationKey ::= CHOICE { + ecdsaNistP256 EccP256CurvePoint, + ecdsaBrainpoolP256r1 EccP256CurvePoint, + ..., + ecdsaBrainpoolP384r1 EccP384CurvePoint +} + +SymmetricEncryptionKey ::= CHOICE { + aes128Ccm OCTET STRING(SIZE(16)), + ... +} + +-- ------------------------------------------------------------------ +-- +-- PSID / ITS-AID +-- +-- ------------------------------------------------------------------ + + +PsidSsp ::= SEQUENCE { + psid Psid, + ssp ServiceSpecificPermissions OPTIONAL +} + +SequenceOfPsidSsp ::= SEQUENCE OF PsidSsp + +Psid ::= INTEGER (0..MAX) + +SequenceOfPsid ::= SEQUENCE OF Psid + +ServiceSpecificPermissions ::= CHOICE { + opaque OCTET STRING (SIZE(0..MAX)), + ..., + bitmapSsp BitmapSsp +} + +BitmapSsp ::= OCTET STRING (SIZE(0..31)) + +PsidSspRange ::= SEQUENCE { + psid Psid, + sspRange SspRange OPTIONAL +} + +SequenceOfPsidSspRange ::= SEQUENCE OF PsidSspRange + +SspRange ::= CHOICE { + opaque SequenceOfOctetString, + all NULL, + ... , + bitmapSspRange BitmapSspRange +} + +BitmapSspRange ::= SEQUENCE { + sspValue OCTET STRING (SIZE(1..32)), + sspBitmask OCTET STRING (SIZE(1..32)) +} + +SequenceOfOctetString ::= SEQUENCE (SIZE (0..MAX)) OF + OCTET STRING (SIZE(0..MAX)) + + +-- ------------------------------------------------------------------ +-- +-- Goes in certs +-- +-- ------------------------------------------------------------------ + +SubjectAssurance ::= OCTET STRING (SIZE(1)) + +CrlSeries ::= Uint16 + + +-- ------------------------------------------------------------------ +-- +-- Pseudonym Linkage +-- +-- ------------------------------------------------------------------ + +IValue ::= Uint16 +Hostname ::= UTF8String (SIZE(0..255)) +LinkageValue ::= OCTET STRING (SIZE(9)) +GroupLinkageValue ::= SEQUENCE { + jValue OCTET STRING (SIZE(4)), + value OCTET STRING (SIZE(9)) +} + +LaId ::= OCTET STRING (SIZE(2)) +LinkageSeed ::= OCTET STRING (SIZE(16)) + +END + diff --git a/asn1/Security/EtsiTs103097Module.asn b/asn1/Security/EtsiTs103097Module.asn new file mode 100755 index 00000000..9477ab6f --- /dev/null +++ b/asn1/Security/EtsiTs103097Module.asn @@ -0,0 +1,105 @@ +EtsiTs103097Module +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) v1(0) } + +DEFINITIONS AUTOMATIC TAGS ::= BEGIN + +IMPORTS + +Ieee1609Dot2Data, ExplicitCertificate + +FROM + +IEEE1609dot2 {iso(1) identified-organization(3) ieee(111) +standards-association-numbered-series-standards(2) wave-stds(1609) +dot2(2) base (1) schema (1) major-version-2(2)}; + +EtsiTs103097Certificate::= ExplicitCertificate + (WITH COMPONENTS{..., + toBeSigned (WITH COMPONENTS{..., + id (WITH COMPONENTS{..., + linkageData ABSENT, + binaryId ABSENT + }), + certRequestPermissions ABSENT, + canRequestRollover ABSENT + }) + }) + +SingleEtsiTs103097Certificate ::= SEQUENCE { + only EtsiTs103097Certificate +} + + +EtsiTs103097Data::=Ieee1609Dot2Data (WITH COMPONENTS {..., + content (WITH COMPONENTS {..., + signedData (WITH COMPONENTS {..., -- constraints on signed data headers + tbsData (WITH COMPONENTS { + headerInfo (WITH COMPONENTS {..., + generationTime PRESENT, + p2pcdLearningRequest ABSENT, + missingCrlIdentifier ABSENT + }) + }), + signer (WITH COMPONENTS {..., --constraints on the certificate + certificate (SIZE(1)) + }) + }), + encryptedData (WITH COMPONENTS {..., -- constraints on encrypted data headers + recipients (WITH COMPONENT ( + (WITH COMPONENTS {..., + pskRecipInfo ABSENT, + symmRecipInfo ABSENT, + rekRecipInfo ABSENT + }) + )) + }), + signedCertificateRequest ABSENT + }) +}) + +EtsiTs103097Data-Signed {ToBeSignedDataContent} ::= EtsiTs103097Data (WITH COMPONENTS {..., + content (WITH COMPONENTS { + signedData (WITH COMPONENTS {..., + tbsData (WITH COMPONENTS { + payload (WITH COMPONENTS { + data (WITH COMPONENTS {..., + content (WITH COMPONENTS { + unsecuredData (CONTAINING ToBeSignedDataContent) + }) + }) PRESENT + }) + }) + }) + }) +}) + +EtsiTs103097Data-SignedExternalPayload ::= EtsiTs103097Data (WITH COMPONENTS {..., + content (WITH COMPONENTS { + signedData (WITH COMPONENTS {..., + tbsData (WITH COMPONENTS { + payload (WITH COMPONENTS { + extDataHash (WITH COMPONENTS { + sha256HashedData PRESENT + }) PRESENT + }) + }) + }) + }) +}) + +EtsiTs103097Data-Encrypted {ToBeEncryptedDataContent} ::= EtsiTs103097Data (WITH COMPONENTS {..., + content (WITH COMPONENTS { + encryptedData (WITH COMPONENTS {..., + ciphertext (WITH COMPONENTS {..., + aes128ccm (WITH COMPONENTS {..., + ccmCiphertext (CONSTRAINED BY {-- ccm encryption of -- ToBeEncryptedDataContent}) + }) + }) + }) + }) +}) + + +EtsiTs103097Data-SignedAndEncrypted {ToBesignedAndEncryptedDataContent} ::= EtsiTs103097Data-Encrypted {EtsiTs103097Data-Signed {ToBesignedAndEncryptedDataContent}} + +END -- GitLab From 55adc50e43044bd51799b713ffeb941c38c00696 Mon Sep 17 00:00:00 2001 From: filatov Date: Thu, 28 Sep 2017 15:17:20 +0000 Subject: [PATCH 031/320] original ISO19091 asn1 files are necessary for asn1c --- asn1/IS/ISO_TS_19091/original/AddGrpC.asn | 122 ++ asn1/IS/ISO_TS_19091/original/DSRC.asn | 1870 +++++++++++++++++++++ asn1/IS/ISO_TS_19091/original/REGION.asn | 111 ++ 3 files changed, 2103 insertions(+) create mode 100755 asn1/IS/ISO_TS_19091/original/AddGrpC.asn create mode 100755 asn1/IS/ISO_TS_19091/original/DSRC.asn create mode 100755 asn1/IS/ISO_TS_19091/original/REGION.asn diff --git a/asn1/IS/ISO_TS_19091/original/AddGrpC.asn b/asn1/IS/ISO_TS_19091/original/AddGrpC.asn new file mode 100755 index 00000000..ce1f9d68 --- /dev/null +++ b/asn1/IS/ISO_TS_19091/original/AddGrpC.asn @@ -0,0 +1,122 @@ +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- ISO TS 19091 +-- +-- This ASN.1 was generated: 30.08.2016 +-- +-- This document contains the data element needed for the encoding the SPAT, MapData, SignalRequestMessage, SignalStatusMessage message +-- as defined in ISO TS 19091 and SAEJ2735 +-- +-- It includes the addendunm extensions for Addgrp-C (e.g. Europe) +-- +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +-- +-- module: AddGrpC +-- +-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +AddGrpC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) addgrpc (0) version (1) } + + +DEFINITIONS AUTOMATIC TAGS::= BEGIN + +IMPORTS +NodeOffsetPointXY, NodeSetXY, PrioritizationResponseStatus, SignalGroupID, DeltaTime, LaneID FROM DSRC +Altitude, StationID, DeltaAltitude FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) }; + + +ConnectionManeuverAssist-addGrpC ::= SEQUENCE { + itsStationPositions ItsStationPositionList OPTIONAL, + rsuGNSSOffset NodeOffsetPointXY OPTIONAL, + ... +} + +ConnectionTrajectory-addGrpC ::= SEQUENCE { + nodes NodeSetXY, + ... +} + +Control-addGrpC ::= SEQUENCE { + ptvRequest PtvRequestType, + ... +} + +IntersectionState-addGrpC ::= SEQUENCE { + activePrioritizations PrioritizationResponseList OPTIONAL, + ... +} + +MapData-addGrpC ::= SEQUENCE { + signalHeadLocations SignalHeadLocationList OPTIONAL, + ... +} + +Position3D-addGrpC ::= SEQUENCE { + altitude Altitude, + ... +} + +PrioritizationResponseList ::= SEQUENCE SIZE(1..10) OF PrioritizationResponse + +PrioritizationResponse ::= SEQUENCE { + stationID StationID, + priorState PrioritizationResponseStatus, + signalGroup SignalGroupID, + ... +} + +RestrictionUserType-addGrpC ::= SEQUENCE { + emission EmissionType OPTIONAL, + ... +} + +SignalHeadLocationList ::= SEQUENCE (SIZE(1..64)) OF SignalHeadLocation + +SignalHeadLocation ::= SEQUENCE { + nodeXY NodeOffsetPointXY, + nodeZ DeltaAltitude, + signalGroupID SignalGroupID, + ... +} + +SignalStatusPackage-addGrpC ::= SEQUENCE { + synchToSchedule DeltaTime OPTIONAL, + ... +} + + +ItsStationPositionList::= SEQUENCE SIZE(1..5) OF ItsStationPosition + +ItsStationPosition ::= SEQUENCE { + stationID StationID, + laneID LaneID OPTIONAL, + nodeXY NodeOffsetPointXY OPTIONAL, + timeReference TimeReference OPTIONAL, + ... +} +EmissionType ::= ENUMERATED { + euro1, + euro2, + euro3, + euro4, + euro5, + euro6, + ... +} + +PtvRequestType ::= ENUMERATED { + preRequest, + mainRequest, + doorCloseRequest, + cancelRequest, + emergencyRequest, + ... +} + +TimeReference ::= INTEGER { oneMilliSec(1) } (0..65535) + +END + + + diff --git a/asn1/IS/ISO_TS_19091/original/DSRC.asn b/asn1/IS/ISO_TS_19091/original/DSRC.asn new file mode 100755 index 00000000..6dd38f02 --- /dev/null +++ b/asn1/IS/ISO_TS_19091/original/DSRC.asn @@ -0,0 +1,1870 @@ +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- ISO TS 19091 +-- +-- This ASN.1 was generated: 30.08.2016 +-- +-- This document contains the data element needed for the encoding the SPAT, MapData, SignalRequestMessage, SignalStatusMessage message +-- as defined in ISO TS 19091 and SAEJ2735 +-- +-- It includes the addendunm extensions for Addgrp-C (e.g. Europe) +-- +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +-- +-- module: DSRC +-- +-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } + +DEFINITIONS AUTOMATIC TAGS::= BEGIN + +IMPORTS +StationID, Longitude, Latitude, SpeedConfidence FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) } +Reg-SPAT,Reg-SignalRequestMessage, Reg-SignalStatusMessage, Reg-MapData, Reg-AdvisorySpeed, Reg-ComputedLane, Reg-ConnectionManeuverAssist, +Reg-GenericLane, Reg-IntersectionGeometry, Reg-IntersectionState, Reg-LaneAttributes, Reg-LaneDataAttribute, Reg-MovementEvent, Reg-MovementState, +Reg-NodeAttributeSetXY, Reg-NodeOffsetPointXY,Reg-Position3D, Reg-RequestorDescription, Reg-RequestorType, Reg-RestrictionUserType, Reg-RoadSegment, +Reg-SignalControlZone, Reg-SignalRequestPackage, Reg-SignalRequest, Reg-SignalStatusPackage, Reg-SignalStatus FROM REGION { iso (1) standard (0) signalizedIntersection (19091) profilec(2) region (1) version (1)} +Iso3833VehicleType FROM ElectronicRegistrationIdentificationVehicleDataModule { iso(1) standard(0) iso24534 (24534) vehicleData (1) version (1) }; + +-- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ +-- +-- Start of entries from table Messages... +-- This table typicaly contains message entries. +-- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ +-- + +MessageFrame ::= SEQUENCE { + messageId MESSAGE-ID-AND-TYPE.&id({MessageTypes}), + value MESSAGE-ID-AND-TYPE.&Type({MessageTypes}{@.messageId}), + ... + } + +MESSAGE-ID-AND-TYPE ::= CLASS { + &id DSRCmsgID UNIQUE, + &Type + } WITH SYNTAX {&Type IDENTIFIED BY &id} + +MessageTypes MESSAGE-ID-AND-TYPE ::= { + { MapData IDENTIFIED BY mapData } | + { SPAT IDENTIFIED BY signalPhaseAndTimingMessage } | + { SignalRequestMessage IDENTIFIED BY signalRequestMessage } | + { SignalStatusMessage IDENTIFIED BY signalStatusMessage }, + ... -- Expansion to be used only by the SAE J2735 DSRC TC + } + + +-- Regional extensions support +REG-EXT-ID-AND-TYPE ::= CLASS { + &id RegionId UNIQUE, + &Type + } WITH SYNTAX {&Type IDENTIFIED BY &id} + +RegionalExtension {REG-EXT-ID-AND-TYPE : Set} ::= SEQUENCE { + regionId REG-EXT-ID-AND-TYPE.&id( {Set} ), + regExtValue REG-EXT-ID-AND-TYPE.&Type( {Set}{@regionId} ) + } + +SPAT ::= SEQUENCE { + timeStamp MinuteOfTheYear OPTIONAL, + name DescriptiveName OPTIONAL, + -- human readable name for this collection + -- to be used only in debug mode + + intersections IntersectionStateList, + -- sets of SPAT data (one per intersection) + + -- If PrioritizationResponse data is required, it is found + -- in the RegionalSPAT entry below + + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-SPAT}} OPTIONAL, + ... + } + +SignalRequestMessage ::= SEQUENCE { + timeStamp MinuteOfTheYear OPTIONAL, + second DSecond, + sequenceNumber MsgCount OPTIONAL, + + requests SignalRequestList OPTIONAL, + -- Request Data for one or more signalized + -- intersections that support SRM dialogs + + requestor RequestorDescription, + -- Requesting Device and other User Data + -- contains vehicle ID (if from a vehicle) + -- as well as type data and current position + -- and may contain additional transit data + + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-SignalRequestMessage}} OPTIONAL, + ... +} + +SignalStatusMessage ::= SEQUENCE { + timeStamp MinuteOfTheYear OPTIONAL, + second DSecond, + sequenceNumber MsgCount OPTIONAL, + + -- Status Data for one of more signalized intersections + status SignalStatusList, + + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-SignalStatusMessage}} OPTIONAL, + ... +} + +MapData ::= SEQUENCE { + timeStamp MinuteOfTheYear OPTIONAL, + msgIssueRevision MsgCount, + layerType LayerType OPTIONAL, + layerID LayerID OPTIONAL, + intersections IntersectionGeometryList OPTIONAL, + -- All Intersection definitions + roadSegments RoadSegmentList OPTIONAL, + -- All roadway descriptions + + dataParameters DataParameters OPTIONAL, + -- Any meta data regarding the map contents + + restrictionList RestrictionClassList OPTIONAL, + -- Any restriction ID tables which have + -- established for these map entries + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-MapData}} OPTIONAL, + + -- NOTE: + -- Other map data will be added here as it is defined + -- Examples of the type of content to be added include + -- curve warnings, construction routes, etc. + ... +} + + +-- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ +-- +-- Start of entries from table Data_Frames... +-- This table typicaly contains data frame entries. +-- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ +-- + +AdvisorySpeed ::= SEQUENCE { + type AdvisorySpeedType, + -- the type of advisory which this is. + speed SpeedAdvice OPTIONAL, + -- See Section 11 for converting and translating speed + -- expressed in mph into units of m/s + -- This element is optional ONLY when superceded + -- by the presence of a regional speed element found in + -- Reg-AdvisorySpeed entry + confidence SpeedConfidence OPTIONAL, + -- A confidence value for the above speed + distance ZoneLength OPTIONAL, + -- Unit = 1 meter, + -- The distance indicates the region for which the advised speed + -- is recommended, it is specified upstream from the stop bar + -- along the connected egressing lane + class RestrictionClassID OPTIONAL, + -- the vehicle types to which it applies + -- when absent, the AdvisorySpeed applies to + -- all motor vehicle types + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-AdvisorySpeed}} OPTIONAL, + ... + } + +AdvisorySpeedList ::= SEQUENCE (SIZE(1..16)) OF AdvisorySpeed + +ComputedLane ::= SEQUENCE { + -- Data needed to created a computed lane + referenceLaneId LaneID, + -- the lane ID upon which this + -- computed lane will be based + -- Lane Offset in X and Y direction + offsetXaxis CHOICE { + small DrivenLineOffsetSm, + large DrivenLineOffsetLg + }, + offsetYaxis CHOICE { + small DrivenLineOffsetSm, + large DrivenLineOffsetLg + }, + -- A path X offset value for translations of the + -- path's points when creating translated lanes. + -- The values found in the reference lane are + -- all offset based on the X and Y values from + -- the coordinates of the reference lane's + -- initial path point. + -- Lane Rotation + rotateXY Angle OPTIONAL, + -- A path rotation value for the entire lane + -- Observe that this rotates the existing orientation + -- of the referenced lane, it does not replace it. + -- Rotation occurs about the initial path point. + -- Lane Path Scale (zooming) + scaleXaxis Scale-B12 OPTIONAL, + scaleYaxis Scale-B12 OPTIONAL, + -- value for translations or zooming of the path's + -- points. The values found in the reference lane + -- are all expanded or contracted based on the X + -- and Y and width values from the coordinates of + -- the reference lane's initial path point. + -- The Z axis remains untouched. + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-ComputedLane}} OPTIONAL, + ... + } +ConnectsToList ::= SEQUENCE (SIZE(1..16)) OF Connection + +ConnectingLane ::= SEQUENCE { + lane LaneID, -- Index of the connecting lane + maneuver AllowedManeuvers OPTIONAL + -- The Maneuver between + -- the enclosing lane and this lane + -- at the stop line to connect them + } + + +Connection ::= SEQUENCE { + -- The subject lane connecting to this lane is: + connectingLane ConnectingLane, + -- The index of the connecting lane and also + -- the maneuver from the current lane to it + remoteIntersection IntersectionReferenceID OPTIONAL, + -- This entry is only used when the + -- indicated connecting lane belongs + -- to another intersection layout. This + -- provides a means to create meshes of lanes + + -- SPAT mapping details at the stop line are: + signalGroup SignalGroupID OPTIONAL, + -- The matching signal group send by + -- the SPAT message for this lane/maneuver. + -- Shall be present unless the connectingLane + -- has no signal group (is un-signalized) + userClass RestrictionClassID OPTIONAL, + -- The Restriction Class of users this applies to + -- The use of some lane/maneuver and SignalGroupID + -- pairings are restricted to selected users. + -- When absent, the SignalGroupID applies to all + + -- Movement assist details are given by: + connectionID LaneConnectionID OPTIONAL + -- An optional connection index used to + -- relate this lane connection to any dynamic + -- clearance data in the SPAT. Note that + -- the index may be shared with other + -- connections if the clearance data is common + } + + +ConnectionManeuverAssist ::= SEQUENCE { + connectionID LaneConnectionID, + -- the common connectionID used by all lanes to which + -- this data applies + -- (this value traces to ConnectsTo entries in lanes) + -- Expected Clearance Information + queueLength ZoneLength OPTIONAL, + -- Unit = 1 meter, 0 = no queue + -- The distance from the stop line to the back + -- edge of the last vehicle in the queue, + -- as measured along the lane center line. + availableStorageLength ZoneLength OPTIONAL, + -- Unit = 1 meter, 0 = no space remains + -- Distance (e.g. beginning from the downstream + -- stop-line up to a given distance) with a high + -- probability for successfully executing the + -- connecting maneuver between the two lanes + -- during the current cycle. + -- Used for enhancing the awareness of vehicles + -- to anticipate if they can pass the stop line + -- of the lane. Used for optimizing the green wave, + -- due to knowledge of vehicles waiting in front + -- of a red light (downstream). + -- The element nextTime in TimeChangeDetails + -- in the containing data frame contains the next + -- timemark at which an active phase is expected, + -- a form of storage flush interval. + waitOnStop WaitOnStopline OPTIONAL, + -- If "true", the vehicles on this specific connecting + -- maneuver have to stop on the stop-line and not + -- to enter the collision area + pedBicycleDetect PedestrianBicycleDetect OPTIONAL, + -- true if ANY ped or bicycles are detected crossing + -- the above lanes. Set to false ONLY if there is a + -- high certainty that there are none present, + -- otherwise element is not sent. + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-ConnectionManeuverAssist}} OPTIONAL, + ... + } + +DataParameters ::= SEQUENCE { + processMethod IA5String(SIZE(1..255)) OPTIONAL, + processAgency IA5String(SIZE(1..255)) OPTIONAL, + lastCheckedDate IA5String(SIZE(1..255)) OPTIONAL, + geoidUsed IA5String(SIZE(1..255)) OPTIONAL, + ... + } + +EnabledLaneList ::= SEQUENCE (SIZE(1..16)) OF LaneID + -- The unique ID numbers for each + -- lane object which is 'active' + -- as part of the dynamic map contents. + +GenericLane ::= SEQUENCE { + laneID LaneID, + -- The unique ID number assigned + -- to this lane object + name DescriptiveName OPTIONAL, + -- often for debug use only + -- but at times used to name ped crossings + ingressApproach ApproachID OPTIONAL, -- inbound + egressApproach ApproachID OPTIONAL, -- outbound + -- Approach IDs to which this lane belongs + laneAttributes LaneAttributes, + -- All Attribute information about + -- the basic selected lane type + -- Directions of use, Geometric co-sharing + -- and Type Specific Attributes + -- These Attributes are 'lane - global' that is, + -- they are true for the entire length of the lane + maneuvers AllowedManeuvers OPTIONAL, + -- the permitted maneuvers for this lane + nodeList NodeListXY, + -- Lane spatial path information as well as + -- various Attribute information along the node path + -- Attributes found here are more general and may + -- come and go over the length of the lane. + connectsTo ConnectsToList OPTIONAL, + -- a list of other lanes and their signal group IDs + -- each connecting lane and its signal group ID + -- is given, therefore this element provides the + -- information formerly in "signalGroups" in prior + -- editions. + overlays OverlayLaneList OPTIONAL, + -- A list of any lanes which have spatial paths that + -- overlay (run on top of, and not simply cross) + -- the path of this lane when used + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-GenericLane}} OPTIONAL, + ... + } + +IntersectionAccessPoint ::= CHOICE { + lane LaneID, + approach ApproachID, + connection LaneConnectionID, + ... + } + +IntersectionGeometry ::= SEQUENCE { + name DescriptiveName OPTIONAL, + -- For debug use only + id IntersectionReferenceID, + -- A globally unique value set, + -- consisting of a regionID and + -- intersection ID assignment + revision MsgCount, + + -- Required default values about lane descriptions follow + refPoint Position3D, -- The reference from which subsequent + -- data points are offset until a new + -- point is used. + laneWidth LaneWidth OPTIONAL, + -- Reference width used by all subsequent + -- lanes unless a new width is given + speedLimits SpeedLimitList OPTIONAL, + -- Reference regulatory speed limits + -- used by all subsequent + -- lanes unless a new speed is given + -- See Section 11 for converting and + -- translating speed expressed in mph + -- into units of m/s + -- Complete details regarding each lane type in this intersection + laneSet LaneList, -- Data about one or more lanes + -- (all lane data is found here) + + -- Data describing how to use and request preemption and + -- priority services from this intersection (if supported) + -- NOTE Additonal data may be added in the next release of the + -- standard at this point to handle this concept + preemptPriorityData PreemptPriorityList OPTIONAL, + -- data about one or more regional + -- preempt or priority zones + + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-IntersectionGeometry}} OPTIONAL, + ... + } + +IntersectionGeometryList ::= SEQUENCE (SIZE(1..32)) OF IntersectionGeometry + +IntersectionReferenceID ::= SEQUENCE { + region RoadRegulatorID OPTIONAL, + -- a globally unique regional assignment value + -- typical assigned to a regional DOT authority + -- the value zero shall be used for testing needs + id IntersectionID + -- a unique mapping to the intersection + -- in question within the above region of use + } + +IntersectionState ::= SEQUENCE { + name DescriptiveName OPTIONAL, + -- human readable name for intersection + -- to be used only in debug mode + id IntersectionReferenceID, + -- A globally unique value set, consisting of a + -- regionID and intersection ID assignment + -- provides a unique mapping to the + -- intersection MAP in question + -- which provides complete location + -- and approach/move/lane data + revision MsgCount, + status IntersectionStatusObject, + -- general status of the controller(s) + moy MinuteOfTheYear OPTIONAL, + -- Minute of current UTC year + -- used only with messages to be archived + timeStamp DSecond OPTIONAL, + -- the mSec point in the current UTC minute that + -- this message was constructed + enabledLanes EnabledLaneList OPTIONAL, + -- a list of lanes where the RevocableLane bit + -- has been set which are now active and + -- therefore part of the current intersection + states MovementList, + -- Each Movement is given in turn + -- and contains its signal phase state, + -- mapping to the lanes it applies to, and + -- point in time it will end, and it + -- may contain both active and future states + maneuverAssistList ManeuverAssistList OPTIONAL, + -- Assist data + + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-IntersectionState}} OPTIONAL, + ... + } + +IntersectionStateList ::= SEQUENCE (SIZE(1..32)) OF IntersectionState + +LaneAttributes ::= SEQUENCE { + directionalUse LaneDirection, -- directions of lane use + sharedWith LaneSharing, -- co-users of the lane path + laneType LaneTypeAttributes, -- specific lane type data + regional RegionalExtension {{Reg-LaneAttributes}} OPTIONAL + } + +LaneDataAttribute ::= CHOICE { + -- Segment attribute types and the data needed for each + pathEndPointAngle DeltaAngle, + -- adjusts final point/width slant + -- of the lane to align with the stop line + laneCrownPointCenter RoadwayCrownAngle, + -- sets the canter of the road bed + -- from centerline point + laneCrownPointLeft RoadwayCrownAngle, + -- sets the canter of the road bed + -- from left edge + laneCrownPointRight RoadwayCrownAngle, + -- sets the canter of the road bed + -- from right edge + laneAngle MergeDivergeNodeAngle, + -- the angle or direction of another lane + -- this is required to support Japan style + -- when a merge point angle is required + speedLimits SpeedLimitList, + -- Reference regulatory speed limits + -- used by all segments + + -- Add others as needed, in regional space + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-LaneDataAttribute}}, + ... + } + +LaneDataAttributeList ::= SEQUENCE (SIZE(1..8)) OF LaneDataAttribute + +LaneList ::= SEQUENCE (SIZE(1..255)) OF GenericLane + +LaneSharing ::= BIT STRING { + -- With bits as defined: + overlappingLaneDescriptionProvided (0), + -- Assert when another lane object is present to describe the + -- path of the overlapping shared lane + -- this construct is not used for lane objects which simply cross + multipleLanesTreatedAsOneLane (1), + -- Assert if the lane object path and width details represents + -- multiple lanes within it that are not further described + + -- Various modes and type of traffic that may share this lane: + otherNonMotorizedTrafficTypes (2), -- horse drawn etc. + individualMotorizedVehicleTraffic (3), + busVehicleTraffic (4), + taxiVehicleTraffic (5), + pedestriansTraffic (6), + cyclistVehicleTraffic (7), + trackedVehicleTraffic (8), + pedestrianTraffic (9) + } (SIZE (10)) + -- All zeros would indicate 'not shared' and 'not overlapping' + +LaneTypeAttributes ::= CHOICE { + vehicle LaneAttributes-Vehicle, -- motor vehicle lanes + crosswalk LaneAttributes-Crosswalk, -- pedestrian crosswalks + bikeLane LaneAttributes-Bike, -- bike lanes + sidewalk LaneAttributes-Sidewalk, -- pedestrian sidewalk paths + median LaneAttributes-Barrier, -- medians & channelization + striping LaneAttributes-Striping, -- roadway markings + trackedVehicle LaneAttributes-TrackedVehicle, -- trains and trolleys + parking LaneAttributes-Parking, -- parking and stopping lanes + ... + } + +ManeuverAssistList ::= SEQUENCE (SIZE(1..16)) OF ConnectionManeuverAssist + +MovementEventList ::= SEQUENCE (SIZE(1..16)) OF MovementEvent + +MovementEvent ::= SEQUENCE { + eventState MovementPhaseState, + -- Consisting of: + -- Phase state (the basic 11 states) + -- Directional, protected, or permissive state + + timing TimeChangeDetails OPTIONAL, + -- Timing Data in UTC time stamps for event + -- includes start and min/max end times of phase + -- confidence and estimated next occurrence + + speeds AdvisorySpeedList OPTIONAL, + -- various speed advisories for use by + -- general and specific types of vehicles + -- supporting green-wave and other flow needs + -- See Section 11 for converting and translating + -- speed expressed in mph into units of m/s + + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-MovementEvent}} OPTIONAL, + ... + } + +MovementList ::= SEQUENCE (SIZE(1..255)) OF MovementState + +MovementState ::= SEQUENCE { + movementName DescriptiveName OPTIONAL, + -- uniquely defines movement by name + -- human readable name for intersection + -- to be used only in debug mode + signalGroup SignalGroupID, + -- the group id is used to map to lists + -- of lanes (and their descriptions) + -- which this MovementState data applies to + -- see comments in the Remarks for usage details + state-time-speed MovementEventList, + -- Consisting of sets of movement data with: + -- a) SignalPhaseState + -- b) TimeChangeDetails, and + -- c) AdvisorySpeeds (optional ) + -- Note one or more of the movement events may be for + -- a future time and that this allows conveying multiple + -- predictive phase and movement timing for various uses + -- for the current signal group + maneuverAssistList ManeuverAssistList OPTIONAL, + -- This information may also be placed in the + -- IntersectionState when common information applies to + -- different lanes in the same way + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-MovementState}} OPTIONAL, + ... + } + +NodeAttributeSetXY ::= SEQUENCE { + localNode NodeAttributeXYList OPTIONAL, + -- Attribute states which pertain to this node point + disabled SegmentAttributeXYList OPTIONAL, + -- Attribute states which are disabled at this node point + enabled SegmentAttributeXYList OPTIONAL, + -- Attribute states which are enabled at this node point + -- and which remain enabled until disabled or the lane ends + data LaneDataAttributeList OPTIONAL, + -- Attributes which require an additional data values + -- some of these are local to the node point, while others + -- persist with the provided values until changed + -- and this is indicated in each entry + dWidth Offset-B10 OPTIONAL, + -- A value added to the current lane width + -- at this node and from this node onwards, in 1cm steps + -- lane width between nodes are a linear taper between pts + -- the value of zero shall not be sent here + dElevation Offset-B10 OPTIONAL, + -- A value added to the current Elevation + -- at this node from this node onwards, in 10cm steps + -- elevations between nodes are a linear taper between pts + -- the value of zero shall not be sent here + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-NodeAttributeSetXY}} OPTIONAL, + ... + } + +NodeAttributeXYList ::= SEQUENCE (SIZE(1..8)) OF NodeAttributeXY + +NodeAttributeXY ::= ENUMERATED { + -- Various values which pertain only to the current node point + + -- General Items + reserved, + stopLine, -- point where a mid-path stop line exists + -- See also 'do not block' for segments + + -- Path finish details + roundedCapStyleA, -- Used to control final path rounded end shape + -- with edge of curve at final point in a circle + roundedCapStyleB, -- Used to control final path rounded end shape + -- with edge of curve extending 50% of width past + -- final point in a circle + + -- Topography Points (items with no concept of a distance along the path) + mergePoint, -- Japan merge with 1 or more lanes + divergePoint, -- Japan diverge with 1 or more lanes + downstreamStopLine, -- Japan style downstream intersection + -- (a 2nd intersection) stop line + downstreamStartNode, -- Japan style downstream intersection + -- (a 2nd intersection) start node + + -- Pedestrian Support Attributes + closedToTraffic, -- where a pedestrian may NOT go + -- to be used during construction events + safeIsland, -- a pedestrian safe stopping point + -- also called a traffic island + -- This usage described a point feature on a path, + -- other entries can describe a path + curbPresentAtStepOff, -- the sidewalk to street curb is NOT + -- angled where it meets the edge of the + -- roadway (user must step up/down) + + -- Lane geometry details (see standard for defined shapes) + hydrantPresent, -- Or other services access + ... + } + +Node-LLmD-64b ::= SEQUENCE { + lon Longitude, + lat Latitude + } + + Node-XY-20b ::= SEQUENCE { + x Offset-B10, + y Offset-B10 + } + +Node-XY-22b ::= SEQUENCE { + x Offset-B11, + y Offset-B11 + } + + +Node-XY-24b ::= SEQUENCE { + x Offset-B12, + y Offset-B12 + } + + +Node-XY-26b ::= SEQUENCE { + x Offset-B13, + y Offset-B13 + } + + +Node-XY-28b ::= SEQUENCE { + x Offset-B14, + y Offset-B14 + } + + +Node-XY-32b ::= SEQUENCE { + x Offset-B16, + y Offset-B16 + } + +NodeListXY ::= CHOICE { + nodes NodeSetXY, + -- a lane made up of two or more + -- XY node points and any attributes + -- defined in those nodes + computed ComputedLane, + -- a lane path computed by translating + -- the data defined by another lane + ... + } + +NodeOffsetPointXY ::= CHOICE { + -- Nodes with X,Y content + node-XY1 Node-XY-20b, -- node is within 5.11m of last node + node-XY2 Node-XY-22b, -- node is within 10.23m of last node + node-XY3 Node-XY-24b, -- node is within 20.47m of last node + node-XY4 Node-XY-26b, -- node is within 40.96m of last node + node-XY5 Node-XY-28b, -- node is within 81.91m of last node + node-XY6 Node-XY-32b, -- node is within 327.67m of last node + node-LatLon Node-LLmD-64b, -- node is a full 32b Lat/Lon range + regional RegionalExtension {{Reg-NodeOffsetPointXY}} + -- node which follows is of a + -- regional definition type + } + +NodeSetXY ::= SEQUENCE (SIZE(2..63)) OF NodeXY + +NodeXY ::= SEQUENCE { + delta NodeOffsetPointXY, + -- A choice of which X,Y offset value to use + -- this includes various delta values as well a regional choices + attributes NodeAttributeSetXY OPTIONAL, + -- Any optional Attributes which are needed + -- This includes changes to the current lane width and elevation + ... +} + +OverlayLaneList ::= SEQUENCE (SIZE(1..5)) OF LaneID + -- The unique ID numbers for any lane object which have + -- spatial paths that overlay (run on top of, and not + -- simply cross with) the current lane. + -- Such as a train path that overlays a motor vehicle + -- lane object for a roadway segment. + +Position3D ::= SEQUENCE { + lat Latitude, -- in 1/10th micro degrees + long Longitude, -- in 1/10th micro degrees + elevation Elevation OPTIONAL, -- in 10 cm units + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-Position3D}} OPTIONAL, + ... + } + +PreemptPriorityList ::= SEQUENCE (SIZE(1..32)) OF SignalControlZone + +RegulatorySpeedLimit ::= SEQUENCE { + type SpeedLimitType, + -- The type of regulatory speed which follows + speed Velocity + -- The speed in units of 0.02 m/s + -- See Section 11 for converting and translating + -- speed expressed in mph into units of m/s + } + +RequestorDescription ::= SEQUENCE { + id VehicleID, + -- The ID used in the BSM or CAM of the requestor + -- This ID is presumed not to change + -- during the exchange + type RequestorType OPTIONAL, + -- Information regarding all type and class data + -- about the requesting vehicle + position RequestorPositionVector OPTIONAL, + -- The location of the requesting vehicle + name DescriptiveName OPTIONAL, + -- A human readable name for debugging use + -- Support for Transit requests + routeName DescriptiveName OPTIONAL, + -- A string for transit operations use + transitStatus TransitVehicleStatus OPTIONAL, + -- current vehicle state (loading, etc.) + transitOccupancy TransitVehicleOccupancy OPTIONAL, + -- current vehicle occupancy + transitSchedule DeltaTime OPTIONAL, + -- current vehicle schedule adherence + + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-RequestorDescription}} OPTIONAL, + ... + } + +RequestorPositionVector ::= SEQUENCE { + position Position3D, + heading Angle OPTIONAL, + speed TransmissionAndSpeed OPTIONAL, + ... + } + +RequestorType ::= SEQUENCE { + -- Defines who is requesting + role BasicVehicleRole, -- Basic role of this user at this time + subrole RequestSubRole OPTIONAL, -- A local list with role based items + + -- Defines what kind of request (a level of importance in the Priority Scheme) + request RequestImportanceLevel OPTIONAL, -- A local list with request items + + -- Additional classification details + iso3883 Iso3833VehicleType OPTIONAL, + hpmsType VehicleType OPTIONAL, -- HPMS classification types + + regional RegionalExtension {{Reg-RequestorType}} OPTIONAL, + ... + } + +RestrictionClassAssignment ::= SEQUENCE { + id RestrictionClassID, + -- the unique value (within an intersection or local region) + -- that is assigned to this group of users + users RestrictionUserTypeList + -- The list of user types/classes + -- to which this restriction ID applies + } + +RestrictionClassList ::= SEQUENCE (SIZE(1..254)) OF RestrictionClassAssignment + +RestrictionUserTypeList ::= SEQUENCE (SIZE(1..16)) OF RestrictionUserType + +RestrictionUserType ::= CHOICE { + basicType RestrictionAppliesTo, + -- a set of the most commonly used types + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-RestrictionUserType}}, + ... + } + +RoadLaneSetList ::= SEQUENCE (SIZE(1..255)) OF GenericLane + +RoadSegmentReferenceID ::= SEQUENCE { + region RoadRegulatorID OPTIONAL, + -- a globally unique regional assignment value + -- typically assigned to a regional DOT authority + -- the value zero shall be used for testing needs + id RoadSegmentID + -- a unique mapping to the road segment + -- in question within the above region of use + -- during its period of assignment and use + -- note that unlike intersectionID values, + -- this value can be reused by the region + } + +RoadSegment ::= SEQUENCE { + name DescriptiveName OPTIONAL, + id RoadSegmentReferenceID, + -- a globally unique value for the segment + revision MsgCount, + -- Required default values about the descriptions to follow + refPoint Position3D, -- the reference from which subsequent + -- data points are offset until a new + -- point is used. + laneWidth LaneWidth OPTIONAL, + -- Reference width used by all subsequent + -- lanes unless a new width is given + speedLimits SpeedLimitList OPTIONAL, + -- Reference regulatory speed limits + -- used by all subsequent + -- lanes unless a new speed is given + -- See Section 11 for converting and + -- translating speed expressed in mph + -- into units of m/s + + -- Data describing disruptions in the RoadSegment + -- such as work zones etc will be added here; + -- in the US the SAE ITIS codes would be used here + -- The details regarding each lane type in the RoadSegment + roadLaneSet RoadLaneSetList, + + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-RoadSegment}} OPTIONAL, + ... + } + +RoadSegmentList ::= SEQUENCE (SIZE(1..32)) OF RoadSegment + +SegmentAttributeXYList ::= SEQUENCE (SIZE(1..8)) OF SegmentAttributeXY + +SignalControlZone ::= SEQUENCE { + zone RegionalExtension {{Reg-SignalControlZone}}, + ... + } + +SignalRequesterInfo ::= SEQUENCE { + -- These three items serve to uniquely identify the requester + -- and the specific request to all parties + id VehicleID, + request RequestID, + sequenceNumber MsgCount, + role BasicVehicleRole OPTIONAL, + + typeData RequestorType OPTIONAL, + -- Used when addition data besides the role + -- is needed, at which point the role entry + -- above is not sent. + ... + } + +SignalRequestList ::= SEQUENCE (SIZE(1..32)) OF SignalRequestPackage + +SignalRequestPackage ::= SEQUENCE { + request SignalRequest, + -- The specific request to the intersection + -- contains IntersectionID, request type, + -- requested action (approach/lane request) + + -- The Estimated Time of Arrival (ETA) when the service is requested + minute MinuteOfTheYear OPTIONAL, + second DSecond OPTIONAL, + duration DSecond OPTIONAL, + -- The duration value is used to provide a short interval that + -- extends the ETA so that the requesting vehicle can arrive at + -- the point of service with uncertainty or with some desired + -- duration of service. This concept can be used to avoid needing + -- to frequently update the request. + -- The requester must update the ETA and duration values if the + -- period of services extends beyond the duration time. + -- It should be assumed that if the vehicle does not clear the + -- intersection when the duration is reached, the request will + -- be cancelled and the intersection will revert to + -- normal operation. + + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-SignalRequestPackage}} OPTIONAL, + ... + } + +SignalRequest ::= SEQUENCE { + -- the unique ID of the target intersection + id IntersectionReferenceID, + + -- The unique requestID used by the requestor + requestID RequestID, + + -- The type of request or cancel for priority or preempt use + -- when a prior request is canceled, only the requestID is needed + requestType PriorityRequestType, + + -- In typical use either an approach or a lane number would + -- be given, this indicates the requested + -- path through the intersection to the degree it is known. + inBoundLane IntersectionAccessPoint, + -- desired entry approach or lane + outBoundLane IntersectionAccessPoint OPTIONAL, + -- desired exit approach or lane + -- the values zero is used to indicate + -- intent to stop within the intersection + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-SignalRequest}} OPTIONAL, + ... + } + +SignalStatusList ::= SEQUENCE (SIZE(1..32)) OF SignalStatus + +SignalStatusPackageList ::= SEQUENCE (SIZE(1..32)) OF SignalStatusPackage + +SignalStatusPackage ::= SEQUENCE { + -- The party that made the initial SRM request + requester SignalRequesterInfo OPTIONAL, + -- The lanes or approaches used in the request + inboundOn IntersectionAccessPoint, -- estimated lane / approach of vehicle + outboundOn IntersectionAccessPoint OPTIONAL, + + -- The Estimated Time of Arrival (ETA) when the service is requested + -- This data echos the data of the request + minute MinuteOfTheYear OPTIONAL, + second DSecond OPTIONAL, + duration DSecond OPTIONAL, + + -- the SRM status for this request + status PrioritizationResponseStatus, + -- Status of request, this may include rejection + + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-SignalStatusPackage}} OPTIONAL, + ... + } + +SignalStatus ::= SEQUENCE { + sequenceNumber MsgCount, + -- changed whenever the below contents have change + id IntersectionReferenceID, + -- this provides a unique mapping to the + -- intersection map in question + -- which provides complete location + -- and approach/movement/lane data + -- as well as zones for priority/preemption + sigStatus SignalStatusPackageList, + -- a list of detailed status containing all + -- priority or preemption state data, both + -- active and pending, and who requested it + -- requests which are denied are also listed + -- here for a short period of time + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-SignalStatus}} OPTIONAL, + ... + } + +SpeedLimitList ::= SEQUENCE (SIZE(1..9)) OF RegulatorySpeedLimit + +SpeedLimitType ::= ENUMERATED { + unknown, -- Speed limit type not available + maxSpeedInSchoolZone, -- Only sent when the limit is active + maxSpeedInSchoolZoneWhenChildrenArePresent, -- Sent at any time + maxSpeedInConstructionZone, -- Used for work zones, incident zones, etc. + -- where a reduced speed is present + vehicleMinSpeed, + vehicleMaxSpeed, -- Regulatory speed limit for general traffic + vehicleNightMaxSpeed, + + truckMinSpeed, + truckMaxSpeed, + truckNightMaxSpeed, + + vehiclesWithTrailersMinSpeed, + vehiclesWithTrailersMaxSpeed, + vehiclesWithTrailersNightMaxSpeed, + ... + } + +TimeChangeDetails ::= SEQUENCE { + startTime TimeMark OPTIONAL, + -- When this phase 1st started + minEndTime TimeMark, + -- Expected shortest end time + maxEndTime TimeMark OPTIONAL, + -- Expected longest end time + + likelyTime TimeMark OPTIONAL, + -- Best predicted value based on other data + confidence TimeIntervalConfidence OPTIONAL, + -- Applies to above time element only + + nextTime TimeMark OPTIONAL + -- A rough estimate of time when + -- this phase may next occur again + -- used to support various ECO driving power + -- management needs. + } + +TimeMark ::= INTEGER (0..36001) + -- Tenths of a second in the current or next hour + -- In units of 1/10th second from UTC time + -- A range of 0~36000 covers one hour + -- The values 35991..36000 are used when a leap second occurs + -- The value 36001 is used to indicate time >3600 seconds + -- 36002 is to be used when value undefined or unknown + -- Note that this is NOT expressed in GPS time + -- or in local time + +TransmissionAndSpeed ::= SEQUENCE { + transmisson TransmissionState, + speed Velocity + } + +VehicleID ::= CHOICE { + entityID TemporaryID, + stationID StationID + } + + +-- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ +-- +-- Start of entries from table Data_Elements... +-- This table typicaly contains data element entries. +-- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ +-- + +AdvisorySpeedType ::= ENUMERATED { + none (0), + greenwave (1), + ecoDrive (2), + transit (3), + ... + } -- Note: subject to further growth + +AllowedManeuvers ::= BIT STRING { + -- With bits as defined: + -- Allowed maneuvers at path end (stop line) + -- All maneuvers with bits not set are therefore prohibited ! + -- A value of zero shall be used for unknown, indicating no Maneuver + maneuverStraightAllowed (0), + -- a Straight movement is allowed in this lane + maneuverLeftAllowed (1), + -- a Left Turn movement is allowed in this lane + maneuverRightAllowed (2), + -- a Right Turn movement is allowed in this lane + maneuverUTurnAllowed (3), + -- a U turn movement is allowed in this lane + maneuverLeftTurnOnRedAllowed (4), + -- a Stop, and then proceed when safe movement + -- is allowed in this lane + maneuverRightTurnOnRedAllowed (5), + -- a Stop, and then proceed when safe movement + -- is allowed in this lane + maneuverLaneChangeAllowed (6), + -- a movement which changes to an outer lane + -- on the egress side is allowed in this lane + -- (example: left into either outbound lane) + maneuverNoStoppingAllowed (7), + -- the vehicle should not stop at the stop line + -- (example: a flashing green arrow) + yieldAllwaysRequired (8), + -- the allowed movements above are not protected + -- (example: an permanent yellow condition) + goWithHalt (9), + -- after making a full stop, may proceed + caution (10), + -- proceed past stop line with caution + reserved1 (11) + -- used to align to 12 Bit Field + + } (SIZE(12)) + +Angle ::= INTEGER (0..28800) + -- LSB of 0.0125 degrees + -- A range of 0 to 359.9875 degrees + +ApproachID ::= INTEGER (0..15) -- zero to be used when valid value is unknown + +BasicVehicleRole ::= ENUMERATED { + -- Values used in the EU and in the US + basicVehicle (0), -- Light duty passenger vehicle type + publicTransport (1), -- Used in EU for Transit us + specialTransport (2), -- Used in EU (e.g. heavy load) + dangerousGoods (3), -- Used in EU for any HAZMAT + roadWork (4), -- Used in EU for State and Local DOT uses + roadRescue (5), -- Used in EU and in the US to include tow trucks. + emergency (6), -- Used in EU for Police, Fire and Ambulance units + safetyCar (7), -- Used in EU for Escort vehicles + -- Begin US unique numbering + none-unknown (8), -- added to follow current SAE style guidelines + truck (9), -- Heavy trucks with additional BSM rights and obligations + motorcycle (10), -- + roadSideSource (11), -- For infrastructure generated calls such as + -- fire house, rail infrastructure, roadwork site, etc. + police (12), -- + fire (13), -- + ambulance (14), -- (does not include private para-transit etc.) + dot (15), -- all roadwork vehicles + transit (16), -- all transit vehicles + slowMoving (17), -- to also include oversize etc. + stopNgo (18), -- to include trash trucks, school buses and others + -- that routinely disturb the free flow of traffic + cyclist (19), -- + pedestrian (20), -- also includes those with mobility limitations + nonMotorized (21), -- other, horse drawn, etc. + military (22), -- + ... + } + +DeltaAngle ::= INTEGER (-150..150) + -- With an angle range from + -- negative 150 to positive 150 + -- in one degree steps where zero is directly + -- along the axis or the lane center line as defined by the + -- two closest points + +DeltaTime ::= INTEGER (-122 .. 121) + -- Supporting a range of +/- 20 minute in steps of 10 seconds + -- the value of -121 shall be used when more than -20 minutes + -- the value of +120 shall be used when more than +20 minutes + -- the value -122 shall be used when the value is unavailable + +DescriptiveName ::= IA5String (SIZE(1..63)) + +DrivenLineOffsetLg ::= INTEGER (-32767..32767) + -- LSB units are 1 cm. + +DrivenLineOffsetSm ::= INTEGER (-2047..2047) + -- LSB units are 1 cm. + +DSecond ::= INTEGER (0..65535) -- units of milliseconds + +DSRCmsgID ::= INTEGER (0..32767) + mapData DSRCmsgID ::= 18 -- MAP, intersections + signalPhaseAndTimingMessage DSRCmsgID ::= 19 -- SPAT + signalRequestMessage DSRCmsgID ::= 29 -- SRM + signalStatusMessage DSRCmsgID ::= 30 -- SSM + +Elevation ::= INTEGER (-4096..61439) + -- In units of 10 cm steps above or below the reference ellipsoid + -- Providing a range of -409.5 to + 6143.9 meters + -- The value -4096 shall be used when Unknown is to be sent + +IntersectionID ::= INTEGER (0..65535) + -- The values zero through 255 are allocated for testing purposes + -- Note that the value assigned to an intersection will be + -- unique within a given regional ID only + +IntersectionStatusObject ::= BIT STRING { + manualControlIsEnabled (0), + -- Timing reported is per programmed values, etc. but person + -- at cabinet can manually request that certain intervals are + -- terminated early (e.g. green). + stopTimeIsActivated (1), + -- And all counting/timing has stopped. + failureFlash (2), + -- Above to be used for any detected hardware failures, + -- e.g. conflict monitor as well as for police flash + preemptIsActive (3), + signalPriorityIsActive (4), + + -- Additional states + fixedTimeOperation (5), + -- Schedule of signals is based on time only + -- (i.e. the state can be calculated) + trafficDependentOperation (6), + -- Operation is based on different levels of traffic parameters + -- (requests, duration of gaps or more complex parameters) + standbyOperation (7), + -- Controller: partially switched off or partially amber flashing + failureMode (8), + -- Controller has a problem or failure in operation + off (9), + -- Controller is switched off + + -- Related to MAP and SPAT bindings + recentMAPmessageUpdate (10), + -- Map revision with content changes + recentChangeInMAPassignedLanesIDsUsed (11), + -- Change in MAP's assigned lanes used (lane changes) + -- Changes in the active lane list description + noValidMAPisAvailableAtThisTime (12), + -- MAP (and various lanes indexes) not available + noValidSPATisAvailableAtThisTime (13) + -- SPAT system is not working at this time + + -- Bits 14,15 reserved at this time and shall be zero + } (SIZE(16)) + + +LaneAttributes-Barrier ::= BIT STRING { + -- With bits as defined: + median-RevocableLane (0), + -- this lane may be activated or not based + -- on the current SPAT message contents + -- if not asserted, the lane is ALWAYS present + median (1), + whiteLineHashing (2), + stripedLines (3), + doubleStripedLines (4), + trafficCones (5), + constructionBarrier (6), + trafficChannels (7), + lowCurbs (8), + highCurbs (9) + -- Bits 10~15 reserved and set to zero + } (SIZE (16)) + +LaneAttributes-Bike ::= BIT STRING { + -- With bits as defined: + bikeRevocableLane (0), + -- this lane may be activated or not based + -- on the current SPAT message contents + -- if not asserted, the lane is ALWAYS present + pedestrianUseAllowed (1), + -- The path allows pedestrian traffic, + -- if not set, this mode is prohibited + isBikeFlyOverLane (2), + -- path of lane is not at grade + fixedCycleTime (3), + -- the phases use preset times + -- i.e. there is not a 'push to cross' button + biDirectionalCycleTimes (4), + -- ped walk phases use different SignalGroupID + -- for each direction. The first SignalGroupID + -- in the first Connection represents 'inbound' + -- flow (the direction of travel towards the first + -- node point) while second SignalGroupID in the + -- next Connection entry represents the 'outbound' + -- flow. And use of RestrictionClassID entries + -- in the Connect follow this same pattern in pairs. + isolatedByBarrier (5), + unsignalizedSegmentsPresent (6) + -- The lane path consists of one of more segments + -- which are not part of a signal group ID + + -- Bits 7~15 reserved and set to zero + } (SIZE (16)) + +LaneAttributes-Crosswalk ::= BIT STRING { + -- With bits as defined: + -- MUTCD provides no suitable "types" to use here + crosswalkRevocableLane (0), + -- this lane may be activated or not based + -- on the current SPAT message contents + -- if not asserted, the lane is ALWAYS present + bicyleUseAllowed (1), + -- The path allows bicycle traffic, + -- if not set, this mode is prohibited + isXwalkFlyOverLane (2), + -- path of lane is not at grade + fixedCycleTime (3), + -- ped walk phases use preset times + -- i.e. there is not a 'push to cross' button + biDirectionalCycleTimes (4), + -- ped walk phases use different SignalGroupID + -- for each direction. The first SignalGroupID + -- in the first Connection represents 'inbound' + -- flow (the direction of travel towards the first + -- node point) while second SignalGroupID in the + -- next Connection entry represents the 'outbound' + -- flow. And use of RestrictionClassID entries + -- in the Connect follow this same pattern in pairs. + hasPushToWalkButton (5), + -- Has a demand input + audioSupport (6), + -- audio crossing cues present + rfSignalRequestPresent (7), + -- Supports RF push to walk technologies + unsignalizedSegmentsPresent (8) + -- The lane path consists of one of more segments + -- which are not part of a signal group ID + -- Bits 9~15 reserved and set to zero + } (SIZE (16)) + +LaneAttributes-Parking ::= BIT STRING { + -- With bits as defined: + -- Parking use details, note that detailed restrictions such as + -- allowed hours are sent by way of ITIS codes in the TIM message + parkingRevocableLane (0), + -- this lane may be activated or not based + -- on the current SPAT message contents + -- if not asserted, the lane is ALWAYS present + parallelParkingInUse (1), + headInParkingInUse (2), + doNotParkZone (3), + -- used to denote fire hydrants as well as + -- short disruptions in a parking zone + parkingForBusUse (4), + parkingForTaxiUse (5), + noPublicParkingUse (6) + -- private parking, as in front of + -- private property + -- Bits 7~15 reserved and set to zero + } (SIZE (16)) + +LaneAttributes-Sidewalk ::= BIT STRING { + -- With bits as defined: + sidewalk-RevocableLane (0), + -- this lane may be activated or not based + -- on the current SPAT message contents + -- if not asserted, the lane is ALWAYS present + bicyleUseAllowed (1), + -- The path allows bicycle traffic, + -- if not set, this mode is prohibited + isSidewalkFlyOverLane (2), + -- path of lane is not at grade + walkBikes (3) + -- bike traffic must dismount and walk + -- Bits 4~15 reserved and set to zero + } (SIZE (16)) + + +LaneAttributes-Striping ::= BIT STRING { + -- With bits as defined: + stripeToConnectingLanesRevocableLane (0), + -- this lane may be activated or not activated based + -- on the current SPAT message contents + -- if not asserted, the lane is ALWAYS present + stripeDrawOnLeft (1), + stripeDrawOnRight (2), + -- which side of lane to mark + stripeToConnectingLanesLeft (3), + stripeToConnectingLanesRight (4), + stripeToConnectingLanesAhead (5) + -- the stripe type should be + -- presented to the user visually + -- to reflect stripes in the + -- intersection for the type of + -- movement indicated + -- Bits 6~15 reserved and set to zero + } (SIZE (16)) + + +LaneAttributes-TrackedVehicle ::= BIT STRING { + -- With bits as defined: + spec-RevocableLane (0), + -- this lane may be activated or not based + -- on the current SPAT message contents + -- if not asserted, the lane is ALWAYS present + spec-commuterRailRoadTrack (1), + spec-lightRailRoadTrack (2), + spec-heavyRailRoadTrack (3), + spec-otherRailType (4) + -- Bits 5~15 reserved and set to zero + } (SIZE (16)) + + +LaneAttributes-Vehicle ::= BIT STRING { + -- With bits as defined: + isVehicleRevocableLane (0), + -- this lane may be activated or not based + -- on the current SPAT message contents + -- if not asserted, the lane is ALWAYS present + isVehicleFlyOverLane (1), + -- path of lane is not at grade + hovLaneUseOnly (2), + restrictedToBusUse (3), + restrictedToTaxiUse (4), + restrictedFromPublicUse (5), + hasIRbeaconCoverage (6), + permissionOnRequest (7) -- e.g. to inform about a lane for e-cars + + } (SIZE (8,...)) + +LaneConnectionID ::= INTEGER (0..255) + +LaneDirection ::= BIT STRING { + -- With bits as defined: + -- Allowed directions of travel in the lane object + -- All lanes are described from the stop line outwards + ingressPath (0), + -- travel from rear of path to front + -- is allowed + egressPath (1) + -- travel from front of path to rear + -- is allowed + -- Notes: No Travel, i.e. the lane object type does not support + -- travel (medians, curbs, etc.) is indicated by not + -- asserting any bit value + -- Bi-Directional Travel (such as a ped crosswalk) is + -- indicated by asserting both of the bits + } (SIZE (2)) + +LaneID ::= INTEGER (0..255) + -- the value 0 shall be used when the lane ID is + -- not available or not known + -- the value 255 is reserved for future use + +LayerID ::= INTEGER (0..100) + +LayerType ::= ENUMERATED { + none, + mixedContent, -- two or more of the below types + generalMapData, + intersectionData, + curveData, + roadwaySectionData, + parkingAreaData, + sharedLaneData, + ... + } + +LaneWidth ::= INTEGER (0..32767) -- units of 1 cm + +MergeDivergeNodeAngle ::= INTEGER (-180..180) + -- In units of 1.5 degrees from north + -- the value -180 shall be used to represent + -- data is not available or unknown + +MinuteOfTheYear ::= INTEGER (0..527040) + -- the value 527040 shall be used for invalid + +MovementPhaseState ::= ENUMERATED { + -- Note that based on the regions and the operating mode not every + -- phase will be used in all transportation modes and that not + -- every phase will be used in all transportation modes + + unavailable (0), + -- This state is used for unknown or error + dark (1), + -- The signal head is dark (unlit) + + -- Reds + stop-Then-Proceed (2), + -- Often called 'flashing red' in US + -- Driver Action: + -- Stop vehicle at stop line. + -- Do not proceed unless it is safe. + -- Note that the right to proceed either right or left when + -- it is safe may be contained in the lane description to + -- handle what is called a 'right on red' + stop-And-Remain (3), + -- e.g. called 'red light' in US + -- Driver Action: + -- Stop vehicle at stop line. + -- Do not proceed. + -- Note that the right to proceed either right or left when + -- it is safe may be contained in the lane description to + -- handle what is called a 'right on red' + + -- Greens + pre-Movement (4), + -- Not used in the US, red+yellow partly in EU + -- Driver Action: + -- Stop vehicle. + -- Prepare to proceed (pending green) + -- (Prepare for transition to green/go) + permissive-Movement-Allowed (5), + -- Often called 'permissive green' in US + -- Driver Action: + -- Proceed with caution, + -- must yield to all conflicting traffic + -- Conflicting traffic may be present + -- in the intersection conflict area + protected-Movement-Allowed (6), + -- Often called 'protected green' in US + -- Driver Action: + -- Proceed, tossing caution to the wind, + -- in indicated (allowed) direction. + + -- Yellows / Ambers + -- The vehicle is not allowed to cross the stop bar if it is possible + -- to stop without danger. + permissive-clearance (7), + -- Often called 'permissive yellow' in US + -- Driver Action: + -- Prepare to stop. + -- Proceed if unable to stop, + -- Clear Intersection. + -- Conflicting traffic may be present + -- in the intersection conflict area + protected-clearance (8), + -- Often called 'protected yellow' in US + -- Driver Action: + -- Prepare to stop. + -- Proceed if unable to stop, + -- in indicated direction (to connected lane) + -- Clear Intersection. + + caution-Conflicting-Traffic (9) + -- Often called 'flashing yellow' in US + -- Often used for extended periods of time + -- Driver Action: + -- Proceed with caution, + -- Conflicting traffic may be present + -- in the intersection conflict area + } + -- The above number assignments are not used with UPER encoding + -- and are only to be used with DER or implicit encoding + +MsgCount ::= INTEGER (0..127) + +Offset-B10 ::= INTEGER (-512..511) + -- a range of +- 5.11 meters + +Offset-B11 ::= INTEGER (-1024..1023) + -- a range of +- 10.23 meters + +Offset-B12 ::= INTEGER (-2048..2047) + -- a range of +- 20.47 meters + +Offset-B13 ::= INTEGER (-4096..4095) + -- a range of +- 40.95 meters + +Offset-B14 ::= INTEGER (-8192..8191) + -- a range of +- 81.91 meters + +Offset-B16 ::= INTEGER (-32768..32767) + -- a range of +- 327.68 meters + +PedestrianBicycleDetect ::= BOOLEAN + -- true if ANY Pedestrians or Bicyclists are + -- detected crossing the target lane or lanes + +PrioritizationResponseStatus ::= ENUMERATED { + unknown (0), + -- Unknown state + requested (1), + -- This prioritization request was detected + -- by the traffic controller + processing (2), + -- Checking request + -- (request is in queue, other requests are prior) + watchOtherTraffic (3), + -- Cannot give full permission, + -- therefore watch for other traffic + -- Note that other requests may be present + granted (4), + -- Intervention was successful + -- and now prioritization is active + rejected (5), + -- The prioritization or preemption request was + -- rejected by the traffic controller + maxPresence (6), + -- The Request has exceeded maxPresence time + -- Used when the controller has determined that + -- the requester should then back off and + -- request an alternative. + reserviceLocked (7), + -- Prior conditions have resulted in a reservice + -- locked event: the controller requires the + -- passage of time before another similar request + -- will be accepted + ... +} + +PriorityRequestType ::= ENUMERATED { + priorityRequestTypeReserved (0), + priorityRequest (1), + priorityRequestUpdate (2), + priorityCancellation (3), + ... + } + +RegionId ::= INTEGER (0..255) + noRegion RegionId ::= 0 -- Use default supplied stubs + addGrpA RegionId ::= 1 -- USA + addGrpB RegionId ::= 2 -- Japan + addGrpC RegionId ::= 3 -- EU + -- NOTE: new registered regional IDs will be added here + -- The values 128 and above are for local region use + +RequestID ::= INTEGER (0..255) + +RequestImportanceLevel ::= ENUMERATED { + requestImportanceLevelUnKnown (0), + requestImportanceLevel1 (1), -- The least important request + requestImportanceLevel2 (2), -- The values here shall be assigned + requestImportanceLevel3 (3), -- Meanings based on regional needs + requestImportanceLevel4 (4), -- for each of the basic roles which + requestImportanceLevel5 (5), -- are defined elsewhere + requestImportanceLevel6 (6), + requestImportanceLevel7 (7), + requestImportanceLevel8 (8), + requestImportanceLevel9 (9), + requestImportanceLevel10 (10), + requestImportanceLevel11 (11), + requestImportanceLevel12 (12), + requestImportanceLevel13 (13), + requestImportanceLevel14 (14), -- The most important request + requestImportanceReserved (15) -- Reserved for future use + } + +RequestSubRole ::= ENUMERATED { + requestSubRoleUnKnown (0), + requestSubRole1 (1), -- The first type of sub role + requestSubRole2 (2), -- The values here shall be assigned + requestSubRole3 (3), -- Meanings based on regional needs + requestSubRole4 (4), -- to refine and expand the basic + requestSubRole5 (5), -- roles which are defined elsewhere + requestSubRole6 (6), + requestSubRole7 (7), + requestSubRole8 (8), + requestSubRole9 (9), + requestSubRole10 (10), + requestSubRole11 (11), + requestSubRole12 (12), + requestSubRole13 (13), + requestSubRole14 (14), -- The last type of sub role + requestSubRoleReserved (15) -- Reserved for future use + } + +RestrictionAppliesTo ::= ENUMERATED { + none, -- applies to nothing + equippedTransit, -- buses etc. + equippedTaxis, + equippedOther, -- other vehicle types with + -- necessary signal phase state + -- reception equipment + emissionCompliant, -- regional variants with more + -- definitive items also exist + equippedBicycle, + weightCompliant, + heightCompliant, + -- Items dealing with traveler needs serviced by the infrastructure + -- These end users (which are not vehicles) are presumed to be suitably equipped + pedestrians, + slowMovingPersons, + wheelchairUsers, + visualDisabilities, + audioDisabilities, -- hearing + otherUnknownDisabilities, + ... + } + +RestrictionClassID ::= INTEGER (0..255) + -- An index value to identify data about classes of users + -- the value used varies with each intersection's + -- needs and is defined in the map to the assigned + -- classes of supported users. + +RoadRegulatorID ::= INTEGER (0..65535) + -- The value zero shall be used for testing only + +RoadSegmentID ::= INTEGER (0..65535) + -- The values zero to 255 shall be used for testing only + -- Note that the value assigned to an RoadSegment will be + -- unique within a given regional ID only during its use + +RoadwayCrownAngle ::= INTEGER (-128..127) + -- In LSB units of 0.3 degrees of angle + -- over a range of -38.1 to + 38.1 degrees + -- The value -128 shall be used for unknown + -- The value zero shall be used for angles + -- which are between -0.15 and +0.15 + +Scale-B12 ::= INTEGER (-2048..2047) -- in steps of 0.05 percent + +SignalGroupID ::= INTEGER (0..255) + -- The value 0 shall be used when the ID is + -- not available or not known + -- the value 255 is reserved to indicate a + -- permanent green movement state + -- therefore a simple 8 phase signal controller + -- device might use 1..9 as its groupIDs + +SegmentAttributeXY ::= ENUMERATED { + -- Various values which can be Enabled and Disabled for a lane segment + + -- General Items + reserved , + doNotBlock , -- segment where a vehicle + -- may not come to a stop + whiteLine , -- segment where lane crossing not allowed + -- such as the final few meters of a lane + + -- Porous Lane states, merging, turn outs, parking etc. + + mergingLaneLeft , -- indicates porous lanes + mergingLaneRight , + + curbOnLeft , -- indicates presence of curbs + curbOnRight , + + loadingzoneOnLeft , -- loading or drop off zones + loadingzoneOnRight , + + turnOutPointOnLeft , -- opening to adjacent street/alley/road + turnOutPointOnRight , + + adjacentParkingOnLeft , -- side of road parking + adjacentParkingOnRight , + + -- Bike Lane Needs + adjacentBikeLaneOnLeft , -- presence of marked bike lanes + adjacentBikeLaneOnRight , + sharedBikeLane , -- right of way is shared with bikes + -- who may occupy entire lane width + bikeBoxInFront , + + -- Transit Needs + transitStopOnLeft , -- any form of bus/transit loading + -- with pull in-out access to lane on left + transitStopOnRight , -- any form of bus/transit loading + -- with pull in-out access to lane on right + transitStopInLane , -- any form of bus/transit loading + -- in mid path of the lane + sharedWithTrackedVehicle , -- lane is shared with train or trolley + -- not used for crossing tracks + + + -- Pedestrian Support Attributes + safeIsland , -- begin/end a safety island in path + lowCurbsPresent , -- for ADA support + rumbleStripPresent , -- for ADA support + audibleSignalingPresent , -- for ADA support + adaptiveTimingPresent , -- for ADA support + rfSignalRequestPresent , -- Supports RF push to walk technologies + partialCurbIntrusion , -- path is blocked by a median or curb + -- but at least 1 meter remains open for use + -- and at-grade passage + + -- Lane geometry details (see standard for defined shapes) + taperToLeft , -- Used to control final path shape + taperToRight , -- Used to control final path shape + taperToCenterLine , -- Used to control final path shape + + -- Parking Lane and Curb Attributes + parallelParking , -- + headInParking , -- Parking at an angle with the street + freeParking , -- no restriction on use of parking + timeRestrictionsOnParking , -- Parking is not permitted at all times + -- typically used when the 'parking' lane + -- becomes a driving lane at times + costToPark , -- Used where parking has a cost + midBlockCurbPresent , -- a protruding curb near lane edge + unEvenPavementPresent , -- a disjoint height at lane edge + ... + } + +SpeedAdvice ::= INTEGER (0..500) + -- LSB units are 0.1 m/s^2 + -- the value 499 shall be used for values at or greater than 49.9 m/s + -- the value 500 shall be used to indicate that speed is unavailable + + +TemporaryID ::= OCTET STRING (SIZE(4)) + +TimeIntervalConfidence ::= INTEGER (0..15) + -- Value Probability + -- 0 21% + -- 1 36% + -- 2 47% + -- 3 56% + -- 4 62% + -- 5 68% + -- 6 73% + -- 7 77% + -- 8 81% + -- 9 85% + -- 10 88% + -- 11 91% + -- 12 94% + -- 13 96% + -- 14 98% + -- 15 100% + +TransitVehicleOccupancy ::= ENUMERATED { + occupancyUnknown (0), + occupancyEmpty (1), + occupancyVeryLow (2), + occupancyLow (3), + occupancyMed (4), + occupancyHigh (5), + occupancyNearlyFull (6), + occupancyFull (7) + } + +TransitVehicleStatus ::= BIT STRING { + loading (0), -- parking and unable to move at this time + anADAuse (1), -- an ADA access is in progress (wheelchairs, kneeling, etc.) + aBikeLoad (2), -- loading of a bicycle is in progress + doorOpen (3), -- a vehicle door is open for passenger access + charging (4), -- a vehicle is connected to charging point + atStopLine (5) -- a vehicle is at the stop line for the lane it is in + } (SIZE(8)) + +TransmissionState ::= ENUMERATED { + neutral (0), -- Neutral + park (1), -- Park + forwardGears (2), -- Forward gears + reverseGears (3), -- Reverse gears + reserved1 (4), + reserved2 (5), + reserved3 (6), + unavailable (7) -- not-equipped or unavailable value, + -- Any related speed is relative to the vehicle reference frame used + } + +VehicleType ::= ENUMERATED { + none (0), -- Not Equipped, Not known or unavailable + unknown (1), -- Does not fit any other category + special (2), -- Special use + moto (3), -- Motorcycle + car (4), -- Passenger car + carOther (5), -- Four tire single units + bus (6), -- Buses + axleCnt2 (7), -- Two axle, six tire single units + axleCnt3 (8), -- Three axle, single units + axleCnt4 (9), -- Four or more axle, single unit + axleCnt4Trailer (10), -- Four or less axle, single trailer + axleCnt5Trailer (11), -- Five or less axle, single trailer + axleCnt6Trailer (12), -- Six or more axle, single trailer + axleCnt5MultiTrailer (13), -- Five or less axle, multi-trailer + axleCnt6MultiTrailer (14), -- Six axle, multi-trailer + axleCnt7MultiTrailer (15), -- Seven or more axle, multi-trailer + ... + } + +Velocity ::= INTEGER (0..8191) -- Units of 0.02 m/s + -- The value 8191 indicates that + -- velocity is unavailable + +WaitOnStopline ::= BOOLEAN -- + -- True or False + -- If "true", the vehicles on this specific connecting + -- maneuver have to stop on the stop-line + -- and not to enter the collision area + +ZoneLength ::= INTEGER (0..10000) + -- Unit = 1 meter, 0 = unknown, + -- The value 10000 to be used for Distances >=10000 m + -- (e.g. from known point to another point along a + -- known path, often against traffic flow direction + -- when used for measuring queues) + +END + diff --git a/asn1/IS/ISO_TS_19091/original/REGION.asn b/asn1/IS/ISO_TS_19091/original/REGION.asn new file mode 100755 index 00000000..9a5385d6 --- /dev/null +++ b/asn1/IS/ISO_TS_19091/original/REGION.asn @@ -0,0 +1,111 @@ +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- ISO TS 19091 +-- +-- This ASN.1 was generated: 30.08.2016 +-- +-- This document contains the data element needed for the encoding the SPAT, MapData, SignalRequestMessage, SignalStatusMessage message +-- as defined in ISO TS 19091 and SAEJ2735 +-- +-- It includes the addendunm extensions for Addgrp-C (e.g. Europe) +-- +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +-- +-- module: REGION +-- +-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +REGION { iso (1) standard (0) signalizedIntersection (19091) profilec(2) region (1) version (1) } + +DEFINITIONS AUTOMATIC TAGS::= BEGIN + +IMPORTS +addGrpC, REG-EXT-ID-AND-TYPE FROM DSRC +ConnectionManeuverAssist-addGrpC, ConnectionTrajectory-addGrpC, IntersectionState-addGrpC, Control-addGrpC, Position3D-addGrpC, RestrictionUserType-addGrpC, +SignalStatusPackage-addGrpC, MapData-addGrpC FROM AddGrpC {iso (1) standard (0) signalizedIntersection (19091) profilec(2) addgrpc (0) version (1)}; + +Reg-AdvisorySpeed REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-ComputedLane REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-ConnectionManeuverAssist REG-EXT-ID-AND-TYPE ::= { + {ConnectionManeuverAssist-addGrpC IDENTIFIED BY addGrpC} , + ... +} + +Reg-GenericLane REG-EXT-ID-AND-TYPE ::= { + {ConnectionTrajectory-addGrpC IDENTIFIED BY addGrpC} , + ... +} + +Reg-IntersectionGeometry REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-IntersectionState REG-EXT-ID-AND-TYPE ::= { + {IntersectionState-addGrpC IDENTIFIED BY addGrpC} , + ... +} + +Reg-LaneAttributes REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-LaneDataAttribute REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-MapData REG-EXT-ID-AND-TYPE ::= { + {MapData-addGrpC IDENTIFIED BY addGrpC}, + ... +} + +Reg-MovementEvent REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-MovementState REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-NodeAttributeSetLL REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-NodeAttributeSetXY REG-EXT-ID-AND-TYPE ::= { + {Control-addGrpC IDENTIFIED BY addGrpC} , + ... +} + +Reg-NodeOffsetPointLL REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-NodeOffsetPointXY REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-Position3D REG-EXT-ID-AND-TYPE ::= { + {Position3D-addGrpC IDENTIFIED BY addGrpC} , + ... +} + +Reg-RequestorDescription REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-RequestorType REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-RestrictionUserType REG-EXT-ID-AND-TYPE ::= { + {RestrictionUserType-addGrpC IDENTIFIED BY addGrpC} , + ... +} + +Reg-RoadSegment REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-SignalControlZone REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-SignalRequest REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-SignalRequestMessage REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-SignalRequestPackage REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-SignalStatus REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-SignalStatusMessage REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-SignalStatusPackage REG-EXT-ID-AND-TYPE ::= { + { SignalStatusPackage-addGrpC IDENTIFIED BY addGrpC} , + ... +} + +Reg-SPAT REG-EXT-ID-AND-TYPE ::= { ... } + +END + + + -- GitLab From ddb00f596dda7ea86fec955ab90c01eb1e9fd81d Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 4 Oct 2017 05:49:15 +0000 Subject: [PATCH 032/320] AcControlPort changes validation --- ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn index 8720ac5f..ed1ee439 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF405 / STF449 / STF484 / STF517 / STF525 * @version $URL$ - * $Id$ +* $Id$ * @desc Module containing functions for GeoNetworking * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. -- GitLab From 6e775b97b9f6e5495676f2efaea1ae8496613a10 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 18 Oct 2017 12:57:58 +0000 Subject: [PATCH 033/320] Validate DENM/CAM decoding from pcap files --- ttcn/CAM/LibItsCam_TestSystem.ttcn | 13 +------------ ttcn/DENM/LibItsDenm_TestSystem.ttcn | 1 + 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/ttcn/CAM/LibItsCam_TestSystem.ttcn b/ttcn/CAM/LibItsCam_TestSystem.ttcn index 404aeb8a..fd62a304 100644 --- a/ttcn/CAM/LibItsCam_TestSystem.ttcn +++ b/ttcn/CAM/LibItsCam_TestSystem.ttcn @@ -139,18 +139,7 @@ module LibItsCam_TestSystem { UInt32 its_aid optional } with { - encode (msgIn) "PER"//LibItsCam_asn1 -/* - encode (gnNextHeader) "RAW" - encode (gnHeaderType) "RAW" - encode (gnHeaderSubtype) "RAW" - encode (gnLifetime) "RAW" - encode (gnTrafficClass) "RAW" - encode (btpDestinationPort) "RAW" - encode (btpInfo) "RAW" - encode (ssp) "RAW" - encode (its_aid) "RAW" -*/ + encode (msgIn) "PER" } /** diff --git a/ttcn/DENM/LibItsDenm_TestSystem.ttcn b/ttcn/DENM/LibItsDenm_TestSystem.ttcn index 8bd2b6ff..d8ff7c38 100644 --- a/ttcn/DENM/LibItsDenm_TestSystem.ttcn +++ b/ttcn/DENM/LibItsDenm_TestSystem.ttcn @@ -162,6 +162,7 @@ module LibItsDenm_TestSystem { } // End of group facilityPrimitives with { + variant "" encode "LibIts_Interface" } // end interfacePrimitives -- GitLab From a3446482c0f0ee1a3665e8f29fc70fe42b337091 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 19 Oct 2017 07:59:43 +0000 Subject: [PATCH 034/320] Validate DENM/CAM decoding from pcap files --- ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn | 6 +++--- ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn index 6acb474e..23321d9b 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn @@ -20,7 +20,7 @@ module LibItsGeoNetworking_Templates { import from LibItsExternal_TypesAndValues all; // LibItsBtp - import from LibItsBtp_Templates all; + // import from LibItsBtp_Templates all; // import from LibItsBtp_EncdecDeclarations all; // LibItsSecurity @@ -28,8 +28,8 @@ module LibItsGeoNetworking_Templates { // import from LibItsSecurity_Pixits all; // LibItsIpv6OverGeoNetworking - import from LibItsIpv6OverGeoNetworking_TypesAndValues all; - import from LibItsIpv6OverGeoNetworking_Templates all; + //import from LibItsIpv6OverGeoNetworking_TypesAndValues all; + //import from LibItsIpv6OverGeoNetworking_Templates all; // AtsGeoNetworking import from LibItsGeoNetworking_TestSystem all; diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn index e9083080..c3032664 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn @@ -17,8 +17,8 @@ module LibItsGeoNetworking_TypesAndValues { // LibIts // import from LibItsCommon_TypesAndValues all; - import from LibItsBtp_TypesAndValues {type BtpPacket;} - import from LibItsIpv6OverGeoNetworking_TypesAndValues {type Ipv6Packet;} + //import from LibItsBtp_TypesAndValues {type BtpPacket;} + //import from LibItsIpv6OverGeoNetworking_TypesAndValues {type Ipv6Packet;} // LibItsSecurity import from LibItsSecurity_TypesAndValues all; -- GitLab From 197e4d5b2a278d2246cf9a73f7751ce523d5242e Mon Sep 17 00:00:00 2001 From: filatov Date: Fri, 27 Oct 2017 19:17:08 +0000 Subject: [PATCH 035/320] Security ASN.1 files: ready for asn1c --- .../1609Dot2/IEEE1609dot2BaseTypes.asn | 16 +- asn1/Security/EtsiTs102941BaseTypes.asn | 124 +++++++++++++++ asn1/Security/EtsiTs102941Its-sMessages.asn | 135 ++++++++++++++++ .../EtsiTs102941OfflineDataStructures.asn | 66 ++++++++ asn1/Security/EtsiTs102941TrustLists.asn | 144 ++++++++++++++++++ 5 files changed, 477 insertions(+), 8 deletions(-) create mode 100755 asn1/Security/EtsiTs102941BaseTypes.asn create mode 100755 asn1/Security/EtsiTs102941Its-sMessages.asn create mode 100755 asn1/Security/EtsiTs102941OfflineDataStructures.asn create mode 100755 asn1/Security/EtsiTs102941TrustLists.asn diff --git a/asn1/Security/1609Dot2/IEEE1609dot2BaseTypes.asn b/asn1/Security/1609Dot2/IEEE1609dot2BaseTypes.asn index 04a38acb..387bf00b 100755 --- a/asn1/Security/1609Dot2/IEEE1609dot2BaseTypes.asn +++ b/asn1/Security/1609Dot2/IEEE1609dot2BaseTypes.asn @@ -100,8 +100,8 @@ SequenceOfRectangularRegion ::= SEQUENCE OF RectangularRegion PolygonalRegion ::= SEQUENCE SIZE(3..MAX) OF TwoDLocation TwoDLocation ::= SEQUENCE { - latitude Latitude, - longitude Longitude + latitude SecLatitude, + longitude SecLongitude } IdentifiedRegion ::= CHOICE { @@ -133,14 +133,14 @@ RegionAndSubregions ::= SEQUENCE { SequenceOfRegionAndSubregions ::= SEQUENCE OF RegionAndSubregions ThreeDLocation ::= SEQUENCE { - latitude Latitude, - longitude Longitude, - elevation Elevation + latitude SecLatitude, + longitude SecLongitude, + elevation SecElevation } -Latitude ::= NinetyDegreeInt -Longitude ::= OneEightyDegreeInt -Elevation ::= ElevInt +SecLatitude ::= NinetyDegreeInt +SecLongitude ::= OneEightyDegreeInt +SecElevation ::= ElevInt NinetyDegreeInt ::= INTEGER { min (-900000000), diff --git a/asn1/Security/EtsiTs102941BaseTypes.asn b/asn1/Security/EtsiTs102941BaseTypes.asn new file mode 100755 index 00000000..13105c22 --- /dev/null +++ b/asn1/Security/EtsiTs102941BaseTypes.asn @@ -0,0 +1,124 @@ +EtsiTs102941BaseTypes +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(0) version1(1) } + +-- draft version r6 of 28.09.2017 + +DEFINITIONS AUTOMATIC TAGS ::= BEGIN + +IMPORTS +HashedId8, Time32, PublicEncryptionKey, PublicVerificationKey +FROM +IEEE1609dot2BaseTypes {iso(1) identified-organization(3) ieee(111) +standards-association-numbered-series-standards(2) wave-stds(1609) +dot2(2) base(1) base-types(2) major-version-2(2)} + +CertificateId, SubjectAssurance, SequenceOfPsidSsp, SequenceOfPsidGroupPermissions, ValidityPeriod, GeographicRegion +FROM +IEEE1609dot2 {iso(1) identified-organization(3) ieee(111) +standards-association-numbered-series-standards(2) wave-stds(1609) +dot2(2) base (1) schema (1) major-version-2(2)} + +EtsiTs103097Data-Encrypted, EtsiTs103097Data-SignedExternalPayload +FROM EtsiTs103097Module +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} +; + +AuthorizationResponseCode ::= ENUMERATED { + ok(0), + -- ITS->AA + its-aa-cantparse, -- valid for any structure + its-aa-badcontenttype, -- not encrypted, not signed, not authorizationrequest + its-aa-imnottherecipient, -- the “recipients” of the outermost encrypted data doesn’t include me + its-aa-unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm + its-aa-decryptionfailed, -- works for ECIES-HMAC and AES-CCM + its-aa-keysdontmatch, -- HMAC keyTag verification fails + its-aa-incompleterequest, -- some elements are missing + its-aa-invalidencryptionkey, -- the responseEncryptionKey is bad + its-aa-outofsyncrequest, -- signingTime is outside acceptable limits + its-aa-unknownea, -- the EA identified by eaId is unknown to me + its-aa-invalidea, -- the EA certificate is revoked + its-aa-deniedpermissions, -- I, the AA, deny the requested permissions + -- AA->EA + aa-ea-cantreachea, -- the EA is unreachable (network error?) + -- EA->AA + ea-aa-cantparse, -- valid for any structure + ea-aa-badcontenttype, -- not encrypted, not signed, not authorizationrequest + ea-aa-imnottherecipient, -- the “recipients” of the outermost encrypted data doesn’t include me + ea-aa-unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm + ea-aa-decryptionfailed, -- works for ECIES-HMAC and AES-CCM + -- TODO: to be continued... + invalidaa, -- the AA certificate presented is invalid/revoked/whatever + invalidaasignature, -- the AA certificate presented can’t validate the request signature + wrongea, -- the encrypted signature doesn’t designate me as the EA + unknownits, -- can’t retrieve the EC/ITS in my DB + invalidsignature, -- signature verification of the request by the EC fails + invalidencryptionkey, -- signature is good, but the key is bad + deniedpermissions, -- permissions not granted + deniedtoomanycerts, -- parallel limit + ... } + +AuthorizationValidationResponseCode ::= ENUMERATED { + ok(0), + cantparse, -- valid for any structure + badcontenttype, -- not encrypted, not signed, not permissionsverificationrequest + imnottherecipient, -- the “recipients” of the outermost encrypted data doesn’t include me + unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm + decryptionfailed, -- works for ECIES-HMAC and AES-CCM + invalidaa, -- the AA certificate presented is invalid/revoked/whatever + invalidaasignature, -- the AA certificate presented can’t validate the request signature + wrongea, -- the encrypted signature doesn’t designate me as the EA + unknownits, -- can’t retrieve the EC/ITS in my DB + invalidsignature, -- signature verification of the request by the EC fails + invalidencryptionkey, -- signature is good, but the responseEncryptionKey is bad + deniedpermissions, -- requested permissions not granted + deniedtoomanycerts, -- parallel limit + deniedrequest, -- any other reason? + ... } + +CertificateFormat::= INTEGER{ + ts103097v211 (1) + }(1..255) + +CertificateSubjectAttributes::= SEQUENCE { + id CertificateId OPTIONAL, + validityPeriod ValidityPeriod OPTIONAL, + region GeographicRegion OPTIONAL, + assuranceLevel SubjectAssurance OPTIONAL, + appPermissions SequenceOfPsidSsp OPTIONAL, + certIssuePermissions SequenceOfPsidGroupPermissions OPTIONAL, + ... +}(WITH COMPONENTS { ..., appPermissions PRESENT} | + WITH COMPONENTS { ..., certIssuePermissions PRESENT}) + + +EnrolmentResponseCode ::= ENUMERATED { + ok(0), + cantparse, -- valid for any structure + badcontenttype, -- not encrypted, not signed, not enrolmentrequest + imnottherecipient, -- the “recipients” doesn’t include me + unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm + decryptionfailed, -- works for ECIES-HMAC and AES-CCM + unknownits, -- can’t retrieve the ITS from the itsId + invalidsignature, -- signature verification of the request fails + invalidencryptionkey, -- signature is good, but the responseEncryptionKey is bad + baditsstatus, -- revoked, not yet active + incompleterequest, -- some elements are missing + deniedpermissions, -- requested permissions are not granted + invalidkeys, -- either the verification_key of the encryption_key is bad + deniedrequest, -- any other reason? + ... } + +EcSignature::= CHOICE{ + encryptedEcSignature EtsiTs103097Data-Encrypted{EtsiTs103097Data-SignedExternalPayload}, + ecSignature EtsiTs103097Data-SignedExternalPayload + } + +PublicKeys ::= SEQUENCE { + verificationKey PublicVerificationKey, + encryptionKey PublicEncryptionKey OPTIONAL + } + +Version ::= INTEGER {v1(1)} + + +END diff --git a/asn1/Security/EtsiTs102941Its-sMessages.asn b/asn1/Security/EtsiTs102941Its-sMessages.asn new file mode 100755 index 00000000..cb8c5d1b --- /dev/null +++ b/asn1/Security/EtsiTs102941Its-sMessages.asn @@ -0,0 +1,135 @@ +EtsiTs102941Its-sMessages + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) its-sMessages(1) version1(1)} + +-- draft version r6 of 28.09.2017 + +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +IMPORTS + +EtsiTs103097Certificate, EtsiTs103097Data-Signed, EtsiTs103097Data-Encrypted, EtsiTs103097Data-SignedExternalPayload, EtsiTs103097Data-SignedAndEncrypted +FROM EtsiTs103097Module +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} + +AuthorizationResponseCode, AuthorizationValidationResponseCode, CertificateFormat, CertificateSubjectAttributes,EnrolmentResponseCode, EcSignature, HashedId8, PublicKeys, Version +FROM EtsiTs102941BaseTypes +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(0) version1(1) } + +; + +/************ +-- Messages +************/ + +EnrolmentRequestMessage::= EtsiTs103097Data-SignedAndEncrypted {EtsiTS102941DataIts-s (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentRequest PRESENT})})} +EnrolmentResponseMessage::= EtsiTs103097Data-SignedAndEncrypted {EtsiTS102941DataIts-s (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentResponse PRESENT})})} +AuthorizationRequestMessage::= EtsiTs103097Data-Encrypted {EtsiTS102941DataIts-s (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} +AuthorizationRequestMessageWithPop::= EtsiTs103097Data-Encrypted {EtsiTS102941DataIts-s (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequestWithPop PRESENT})})} +AuthorizationResponseMessage::= EtsiTs103097Data-SignedAndEncrypted {EtsiTS102941DataIts-s (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationResponse PRESENT})})} +AuthorizationValidationRequestMessage::= EtsiTs103097Data-SignedAndEncrypted {EtsiTS102941DataIts-s (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationValidationRequest PRESENT})})} +AuthorizationValidationResponseMessage::= EtsiTs103097Data-SignedAndEncrypted {EtsiTS102941DataIts-s (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationValidationResponse PRESENT})})} + + +/************ +-- EtsiTS102941Data +************/ + +EtsiTS102941DataIts-s::= SEQUENCE{ + version Version (v1), + content Content} + +Content ::= CHOICE{ + enrolmentRequest InnerEcRequestSignedForPop, + enrolmentResponse InnerEcResponse, + authorizationRequest InnerAtRequest, + authorizationRequestWithPop InnerAtRequestSignedForPop, + authorizationResponse InnerAtResponse, + authorizationValidationRequest AuthorizationValidationRequest, + authorizationValidationResponse AuthorizationValidationResponse, + caCertificateRequest NULL, + caCertificateResponse NULL, + ... + } + + +/************ +-- EnrolmentRequest/Response +************/ + +InnerEcRequestSignedForPop::= EtsiTs103097Data-Signed{InnerEcRequest} + +InnerEcRequest::= SEQUENCE { + itsId IA5String, + certificateFormat CertificateFormat, + publicKeys PublicKeys, + requestedSubjectAttributes CertificateSubjectAttributes (WITH COMPONENTS{certIssuePermissions ABSENT}), + ... + } + +InnerEcResponse ::= SEQUENCE { + requestHash OCTET STRING (SIZE(16)), + responseCode EnrolmentResponseCode, + certificate EtsiTs103097Certificate OPTIONAL, + ... + } + (WITH COMPONENTS { responseCode (ok), certificate PRESENT } + | WITH COMPONENTS { responseCode (ALL EXCEPT ok), certificate ABSENT } + ) + +/************ +-- AuthorizationRequest/Response +************/ + +InnerAtRequestSignedForPop::= EtsiTs103097Data-Signed{InnerAtRequest} + +InnerAtRequest ::= SEQUENCE { + publicKeys PublicKeys, + hmacKey OCTET STRING (SIZE(32)), + sharedAtRequest SharedAtRequest, + ecSignature EcSignature, + ... + } + +SharedAtRequest ::= SEQUENCE { + eaId HashedId8, + keyTag OCTET STRING (SIZE(16)), + ertificateFormat CertificateFormat, + requestedSubjectAttributes CertificateSubjectAttributes (WITH COMPONENTS{certIssuePermissions ABSENT}), + ... + } + +InnerAtResponse ::= SEQUENCE { + requestHash OCTET STRING (SIZE(16)), + responseCode AuthorizationResponseCode, + certificate EtsiTs103097Certificate OPTIONAL, + ... + } + (WITH COMPONENTS { responseCode (ok), certificate PRESENT } + | WITH COMPONENTS { responseCode (ALL EXCEPT ok), certificate ABSENT } + ) + +/************ +-- AuthorizationValidationRequest/Response +************/ + +AuthorizationValidationRequest ::= SEQUENCE { + sharedAtRequest SharedAtRequest, + ecSignature EcSignature, + ... + } + +AuthorizationValidationResponse ::= SEQUENCE { + requestHash OCTET STRING (SIZE(16)), + responseCode AuthorizationValidationResponseCode, + confirmedSubjectAttributes CertificateSubjectAttributes (WITH COMPONENTS{certIssuePermissions ABSENT}) OPTIONAL, + ... + } + +END + + + + + + diff --git a/asn1/Security/EtsiTs102941OfflineDataStructures.asn b/asn1/Security/EtsiTs102941OfflineDataStructures.asn new file mode 100755 index 00000000..b94bbac3 --- /dev/null +++ b/asn1/Security/EtsiTs102941OfflineDataStructures.asn @@ -0,0 +1,66 @@ +EtsiTs102941OfflineDataStructures + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) offlineDataStructures(3) version1(1)} + +-- draft version r6 of 28.09.2017 + +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +IMPORTS + +EtsiTs103097Certificate, EtsiTs103097Data-SignedAndEncrypted, EtsiTs103097Data-Signed +FROM +EtsiTs103097Module +{itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} + +HashedId8, PublicKeys, CertificateSubjectAttributes, EnrolmentResponseCode, Time32, Version +FROM EtsiTs102941BaseTypes +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941)baseTypes(0) version1(1)} + +; + +/************ +-- Messages +************/ + +CaCertificateRequestMessage ::= EtsiTs103097Data-Signed {EtsiTS102941DataCa(WITH COMPONENTS{..., content (WITH COMPONENTS{caCertificateRequest PRESENT})})} +CaCertificateResponseMessage ::= EtsiTs103097Data-Signed {EtsiTS102941DataCa(WITH COMPONENTS{..., content (WITH COMPONENTS{caCertificateResponse PRESENT})})} + +/************ +-- EtsiTS102941Data +************/ + +EtsiTS102941DataCa::= SEQUENCE{ + version Version (v1), + content CaContent} + +CaContent ::= CHOICE{ + caCertificateRequest CaCertificateRequest, + caCertificateResponse CaCertificateResponse, + ... + } + + +/************ +-- CA certificate request +************/ + +CaCertificateRequest ::= SEQUENCE { + publicKeys PublicKeys, + reqquestedSubjectAttributes CertificateSubjectAttributes, + ... +} + +CaCertificateResponse::=SEQUENCE { + requestHash OCTET STRING (SIZE(16)), + responseCode EnrolmentResponseCode, + certificate EtsiTs103097Certificate OPTIONAL, + ... + } + (WITH COMPONENTS { responseCode (ok), certificate PRESENT } + | WITH COMPONENTS { responseCode (ALL EXCEPT ok), certificate ABSENT } + ) + + +END + diff --git a/asn1/Security/EtsiTs102941TrustLists.asn b/asn1/Security/EtsiTs102941TrustLists.asn new file mode 100755 index 00000000..62d63a18 --- /dev/null +++ b/asn1/Security/EtsiTs102941TrustLists.asn @@ -0,0 +1,144 @@ +EtsiTs102941TrustLists + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) trustLists(2) version(1)} + +-- draft version r6 of 28.09.2017 + +DEFINITIONS AUTOMATIC TAGS ::= BEGIN + +IMPORTS + +ItsPduHeader +FROM +ITS-Container +{itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1)} + +EtsiTs103097Certificate, EtsiTs103097Data-SignedAndEncrypted, EtsiTs103097Data-Signed +FROM +EtsiTs103097Module +{itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} + +HashedId8, Time32, Version +FROM EtsiTs102941BaseTypes +{itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(0) version1(1)} + +; + +/************ +-- Messages +************/ + +CTLM::= SEQUENCE { + header ItsPduHeader, + ctl Ctl, + ... + } + +CRLM::= SEQUENCE { + header ItsPduHeader, + crl Crl, + ... + } + + +/************ +-- CRL +************/ +Crl ::= EtsiTs103097Data-Signed{ToBeSignedCrl} + +ToBeSignedCrl ::= SEQUENCE { + version Version, + thisUpdate Time32, + nextUpdate Time32, + entries SEQUENCE OF CRLEntry, + ... +} + +CRLEntry ::= HashedId8 + + +/************ +-- CTL +************/ + +Ctl ::= EtsiTs103097Data-Signed{ToBeSignedCtl} + +ToBeSignedCtl::= CtlFormat (FullCtl | DeltaCtl) + +FullCtl::= CtlFormat(WITH COMPONENTS {..., + isFullCtl(TRUE), + ctlCommands(WITH COMPONENT( + (WITH COMPONENTS {..., + delete ABSENT + }) + )) + }) + + +DeltaCtl::= CtlFormat (WITH COMPONENTS {..., + isFullCtl(FALSE) + }) + + +CtlFormat ::= SEQUENCE { + version Version, + nextUpdate Time32, + isFullCtl BOOLEAN, + ctlSequence INTEGER (0..255), + ctlCommands SEQUENCE OF CtlCommand, + ... + } + + +CtlCommand::= CHOICE{ + add CtlEntry, + delete CtlDelete, + ... + } + +CtlEntry ::= CHOICE { + rca RootCaEntry, + ea EaEntry, + aa AaEntry, + dc DcEntry, + tlm TlmEntry, + ... + } + +CtlDelete ::= CHOICE { + cert HashedId8, + dc DcDelete, + ... + } + +RootCaEntry ::= SEQUENCE { + selfsignedRootCa EtsiTs103097Certificate, + linkRootCaCertificate EtsiTs103097Certificate OPTIONAL, + constraints OCTET STRING OPTIONAL +} + +EaEntry ::= SEQUENCE { + eaCertificate EtsiTs103097Certificate, + linkEaCertificate EtsiTs103097Certificate OPTIONAL, + aaAccessPoint Url, + itsAccessPoint Url OPTIONAL } +-- First URL is to be used by AA (AuthorizationValidationRequest) +-- second URL is to be used by ITS-S (AuthorizationRequest) + +AaEntry ::= SEQUENCE { + aaCertificate EtsiTs103097Certificate, + accessPoint Url + } + +DcEntry::= Url + +DcDelete::= Url + +TlmEntry::= SEQUENCE { + selfSignedTLMCertificate EtsiTs103097Certificate, + linkTLMCertificate EtsiTs103097Certificate OPTIONAL +} + +Url::= IA5String + + +END -- GitLab From 9ef207a1099739a4f0d8a12b6d3bf0884977e3d9 Mon Sep 17 00:00:00 2001 From: filatov Date: Fri, 27 Oct 2017 19:19:28 +0000 Subject: [PATCH 036/320] fix IVI asn1 files to be avoid intersection with Security --- asn1/IS/ISO_TS_14816/AVIAEINumberingAndDataStructures.asn | 3 ++- asn1/IS/ISO_TS_14906/EfcDsrcApplication.asn | 4 ++-- asn1/IS/ISO_TS_14906/EfcDsrcGeneric.asn | 1 + asn1/IS/ISO_TS_19091/AddGrpC_noCircular.asn | 2 +- .../ElectronicRegistrationIdentificationVehicleDataModule.asn | 1 + 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/asn1/IS/ISO_TS_14816/AVIAEINumberingAndDataStructures.asn b/asn1/IS/ISO_TS_14816/AVIAEINumberingAndDataStructures.asn index adcff5c8..9f7298f9 100644 --- a/asn1/IS/ISO_TS_14816/AVIAEINumberingAndDataStructures.asn +++ b/asn1/IS/ISO_TS_14816/AVIAEINumberingAndDataStructures.asn @@ -13,6 +13,7 @@ AVIAEINumberingAndDataStructures {iso(1) standard(0) iso14816(14816) asnm1(1) version1(1)} DEFINITIONS AUTOMATIC TAGS::= BEGIN +IMPORTS; CS5::= SEQUENCE { vin VisibleString, -- 17 characters VIN @@ -23,6 +24,6 @@ CS5::= SEQUENCE { CountryCode::= BIT STRING(SIZE(10)) -IssuerIdentifier::= INTEGER(0 .. 16383) +AVIAEIIssuerIdentifier::= INTEGER(0 .. 16383) END diff --git a/asn1/IS/ISO_TS_14906/EfcDsrcApplication.asn b/asn1/IS/ISO_TS_14906/EfcDsrcApplication.asn index b7d595e5..211f3794 100644 --- a/asn1/IS/ISO_TS_14906/EfcDsrcApplication.asn +++ b/asn1/IS/ISO_TS_14906/EfcDsrcApplication.asn @@ -15,7 +15,7 @@ EfcDsrcApplication { iso(1) standard(0) 14906 application(0) version5(5) } DEFINITIONS AUTOMATIC TAGS ::= BEGIN EXPORTS ALL; IMPORTS -CountryCode, CS5, IssuerIdentifier +CountryCode, CS5, AVIAEIIssuerIdentifier FROM AVIAEINumberingAndDataStructures {iso(1) standard(0) iso14816(14816) asnm1(1) version1(1)} -- defined in ISO 14816 -- AttributeIdList @@ -112,7 +112,7 @@ PassengerCapacity ::= SEQUENCE{ Provider ::= SEQUENCE { countryCode CountryCode, - providerIdentifier IssuerIdentifier + providerIdentifier AVIAEIIssuerIdentifier } SoundLevel ::= SEQUENCE{ diff --git a/asn1/IS/ISO_TS_14906/EfcDsrcGeneric.asn b/asn1/IS/ISO_TS_14906/EfcDsrcGeneric.asn index 2f64fd7b..d2d1e619 100644 --- a/asn1/IS/ISO_TS_14906/EfcDsrcGeneric.asn +++ b/asn1/IS/ISO_TS_14906/EfcDsrcGeneric.asn @@ -14,6 +14,7 @@ EfcDsrcGeneric { iso(1) standard(0) 14906 generic(1) version5(5) } DEFINITIONS AUTOMATIC TAGS ::= BEGIN EXPORTS ALL; +IMPORTS; AttributeIdList ::= SEQUENCE (SIZE(0.. 127,...)) OF INTEGER(0..127,...) diff --git a/asn1/IS/ISO_TS_19091/AddGrpC_noCircular.asn b/asn1/IS/ISO_TS_19091/AddGrpC_noCircular.asn index f7dcf5be..905659ee 100644 --- a/asn1/IS/ISO_TS_19091/AddGrpC_noCircular.asn +++ b/asn1/IS/ISO_TS_19091/AddGrpC_noCircular.asn @@ -11,7 +11,7 @@ AddGrpC-noCircular { iso (1) standard (0) signalizedIntersection (19091) profile DEFINITIONS AUTOMATIC TAGS::= BEGIN - +IMPORTS; Control-addGrpC ::= SEQUENCE { ptvRequest PtvRequestType, diff --git a/asn1/IS/ISO_TS_24534-3/ElectronicRegistrationIdentificationVehicleDataModule.asn b/asn1/IS/ISO_TS_24534-3/ElectronicRegistrationIdentificationVehicleDataModule.asn index 941b1806..f106babc 100644 --- a/asn1/IS/ISO_TS_24534-3/ElectronicRegistrationIdentificationVehicleDataModule.asn +++ b/asn1/IS/ISO_TS_24534-3/ElectronicRegistrationIdentificationVehicleDataModule.asn @@ -18,6 +18,7 @@ ElectronicRegistrationIdentificationVehicleDataModule {iso(1) standard(0) iso245 DEFINITIONS AUTOMATIC TAGS ::= BEGIN +IMPORTS; -- Electronic Registration Identification (ERI)- Vehicle Data -- GitLab From 9b9ea37fc2da27301c572695dc7c056e4bea9e7a Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 3 Nov 2017 13:16:54 +0000 Subject: [PATCH 037/320] Need to use _ instead of - for the ASN.1 file naming wth TCT3 & asn1c --- ...tsiTs102941Its-sMessages.asn => EtsiTs102941Its_sMessages.asn} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename asn1/Security/{EtsiTs102941Its-sMessages.asn => EtsiTs102941Its_sMessages.asn} (100%) diff --git a/asn1/Security/EtsiTs102941Its-sMessages.asn b/asn1/Security/EtsiTs102941Its_sMessages.asn similarity index 100% rename from asn1/Security/EtsiTs102941Its-sMessages.asn rename to asn1/Security/EtsiTs102941Its_sMessages.asn -- GitLab From 2281dff39849fc950733f92237c66a7e3820f798 Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 13 Nov 2017 14:40:33 +0000 Subject: [PATCH 038/320] Rebuild TTCN-3 with TCT3 --- ttcn/CAM/LibItsCam_Templates.ttcn | 30 ++++++++++++++--------------- ttcn/DENM/LibItsDenm_Templates.ttcn | 20 +++++++++---------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/ttcn/CAM/LibItsCam_Templates.ttcn b/ttcn/CAM/LibItsCam_Templates.ttcn index 57b6b5a7..1cdbc251 100644 --- a/ttcn/CAM/LibItsCam_Templates.ttcn +++ b/ttcn/CAM/LibItsCam_Templates.ttcn @@ -208,12 +208,12 @@ module LibItsCam_Templates { latitude := f_integer2Latitude(f_getTsLatitude()), longitude := f_integer2Longitude(f_getTsLongitude()), positionConfidenceEllipse := { - semiMajorConfidence := SemiAxisLength_oneCentimeter_, - semiMinorConfidence := SemiAxisLength_oneCentimeter_, - semiMajorOrientation := HeadingValue_wgs84North_ + semiMajorConfidence := LibItsCommon_ASN1_NamedNumbers.SemiAxisLength_oneCentimeter_, + semiMinorConfidence := LibItsCommon_ASN1_NamedNumbers.SemiAxisLength_oneCentimeter_, + semiMajorOrientation := LibItsCommon_ASN1_NamedNumbers.HeadingValue_wgs84North_ }, altitude := { - altitudeValue := AltitudeValue_referenceEllipsoidSurface_, + altitudeValue := LibItsCommon_ASN1_NamedNumbers.AltitudeValue_referenceEllipsoidSurface_, altitudeConfidence := unavailable } } @@ -225,8 +225,8 @@ module LibItsCam_Templates { */ template (present) CAM mw_camMsg_any := { header := { - protocolVersion := ItsPduHeader_protocolVersion_currentVersion_, - messageID := ItsPduHeader_messageID_cam_, + protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, + messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_cam_, stationID := ? }, cam := { @@ -549,21 +549,21 @@ module LibItsCam_Templates { template (value) ReferencePosition p_referencePosition ) := { header := { - protocolVersion := ItsPduHeader_protocolVersion_currentVersion_, - messageID := ItsPduHeader_messageID_cam_, + protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, + messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_cam_, stationID := p_stationId }, cam := { generationDeltaTime := p_generationTime, camParameters := { basicContainer := { - stationType := StationType_passengerCar_, + stationType := LibItsCommon_ASN1_NamedNumbers.StationType_passengerCar_, referencePosition := p_referencePosition }, highFrequencyContainer := { basicVehicleContainerHighFrequency := { heading := { - headingValue := HeadingValue_wgs84North_, //0 + headingValue := LibItsCommon_ASN1_NamedNumbers.HeadingValue_wgs84North_, //0 headingConfidence := 10 }, speed := { @@ -577,16 +577,16 @@ module LibItsCam_Templates { }, vehicleWidth := 21, longitudinalAcceleration := { - longitudinalAccelerationValue := LongitudinalAccelerationValue_unavailable_, - longitudinalAccelerationConfidence := AccelerationConfidence_unavailable_ + longitudinalAccelerationValue := LibItsCommon_ASN1_NamedNumbers.LongitudinalAccelerationValue_unavailable_, + longitudinalAccelerationConfidence := LibItsCommon_ASN1_NamedNumbers.AccelerationConfidence_unavailable_ }, curvature := { - curvatureValue := CurvatureValue_straight_, + curvatureValue := LibItsCommon_ASN1_NamedNumbers.CurvatureValue_straight_, curvatureConfidence := unavailable }, curvatureCalculationMode := yawRateUsed, yawRate := { - yawRateValue := YawRateValue_straight_, + yawRateValue := LibItsCommon_ASN1_NamedNumbers.YawRateValue_straight_, yawRateConfidence := unavailable }, accelerationControl := omit, @@ -620,7 +620,7 @@ module LibItsCam_Templates { lowFrequencyContainer := { basicVehicleContainerLowFrequency := { vehicleRole := default_, - exteriorLights := ExteriorLights_daytimeRunningLightsOn_, + exteriorLights := LibItsCommon_ASN1_NamedNumbers.ExteriorLights_daytimeRunningLightsOn_, pathHistory := {} } } diff --git a/ttcn/DENM/LibItsDenm_Templates.ttcn b/ttcn/DENM/LibItsDenm_Templates.ttcn index d88ba6b1..ebd39ee2 100644 --- a/ttcn/DENM/LibItsDenm_Templates.ttcn +++ b/ttcn/DENM/LibItsDenm_Templates.ttcn @@ -281,8 +281,8 @@ module LibItsDenm_Templates { template (present) DENM mw_denmPdu( template (present) DecentralizedEnvironmentalNotificationMessage p_denm, template (present) StationID p_stationID := ?, - template (present) ItsPduHeader.protocolVersion p_protocolVersion := ItsPduHeader_protocolVersion_currentVersion_, - template (present) ItsPduHeader.messageID p_messageID := ItsPduHeader_messageID_denm_ + template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, + template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_denm_ ) := { header := mw_itsPduHeader(p_stationID, p_protocolVersion, p_messageID), denm := p_denm @@ -300,8 +300,8 @@ module LibItsDenm_Templates { */ template (value) ItsPduHeader m_itsPduHeader( template (value) StationID p_stationID := f_getTsStationId(), - template (value) ItsPduHeader.protocolVersion p_protocolVersion := ItsPduHeader_protocolVersion_currentVersion_, - template (value) ItsPduHeader.messageID p_messageID := ItsPduHeader_messageID_denm_ + template (value) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, + template (value) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_denm_ ) := { protocolVersion := p_protocolVersion, messageID := p_messageID, @@ -316,8 +316,8 @@ module LibItsDenm_Templates { */ template ItsPduHeader mw_itsPduHeader( template (present) StationID p_stationID := ?, - template (present) ItsPduHeader.protocolVersion p_protocolVersion := ItsPduHeader_protocolVersion_currentVersion_, - template (present) ItsPduHeader.messageID p_messageID := ItsPduHeader_messageID_denm_ + template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, + template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_denm_ ) := { protocolVersion := p_protocolVersion, messageID := p_messageID, @@ -369,9 +369,9 @@ module LibItsDenm_Templates { * @param p_semiMajorOrientation The major orientation (Default: HeadingValue_wgs84North) */ template (value) PosConfidenceEllipse m_posConfidenceEllipse( - template (value) SemiAxisLength p_semiMajorConfidence := SemiAxisLength_oneCentimeter_, - template (value) SemiAxisLength p_semiMinorConfidence := SemiAxisLength_oneCentimeter_, - template (value) HeadingValue p_semiMajorOrientation := HeadingValue_wgs84North + template (value) SemiAxisLength p_semiMajorConfidence := LibItsCommon_ASN1_NamedNumbers.SemiAxisLength_oneCentimeter_, + template (value) SemiAxisLength p_semiMinorConfidence := LibItsCommon_ASN1_NamedNumbers.SemiAxisLength_oneCentimeter_, + template (value) HeadingValue p_semiMajorOrientation := LibItsCommon_ASN1_NamedNumbers.HeadingValue_wgs84North_ ) := { semiMajorConfidence := p_semiMajorConfidence, semiMinorConfidence := p_semiMinorConfidence, @@ -384,7 +384,7 @@ module LibItsDenm_Templates { * @param p_altitudeConfidence The confidence of the elevation (Default: within one meter) */ template (value) Altitude m_altitude( - template (value) AltitudeValue p_altitudeValue := AltitudeValue_referenceEllipsoidSurface_, + template (value) AltitudeValue p_altitudeValue := LibItsCommon_ASN1_NamedNumbers.AltitudeValue_referenceEllipsoidSurface_, template (value) AltitudeConfidence p_altitudeConfidence := alt_000_01 ) := { altitudeValue := p_altitudeValue, -- GitLab From 1d0ac5bcf7f79c9e454b67b85ebd6ca86bdd1c24 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 16 Nov 2017 13:46:43 +0000 Subject: [PATCH 039/320] Review IVIM, MAPEM/SPATEM and SREM/SSEM --- ttcn/IVIM/LibItsIvim_Functions.ttcn | 25 ++++--- ttcn/IVIM/LibItsIvim_Templates.ttcn | 6 +- ttcn/IVIM/LibItsIvim_TestSystem.ttcn | 9 ++- ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn | 72 +++++++++++++++++-- .../LibItsMapemSpatem_Functions.ttcn | 8 +-- .../MapemSpatem/LibItsMapemSpatem_Pixits.ttcn | 1 + .../LibItsMapemSpatem_Templates.ttcn | 3 +- .../LibItsMapemSpatem_TestSystem.ttcn | 4 +- .../LibItsMapemSpatem_TypesAndValues.ttcn | 44 +++++++++--- ttcn/SremSsem/LibItsSremSsem_Functions.ttcn | 28 ++++---- ttcn/SremSsem/LibItsSremSsem_Templates.ttcn | 2 +- ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn | 6 +- .../LibItsSremSsem_TypesAndValues.ttcn | 46 +++++++++--- 13 files changed, 184 insertions(+), 70 deletions(-) diff --git a/ttcn/IVIM/LibItsIvim_Functions.ttcn b/ttcn/IVIM/LibItsIvim_Functions.ttcn index 01e82291..46e8af2c 100644 --- a/ttcn/IVIM/LibItsIvim_Functions.ttcn +++ b/ttcn/IVIM/LibItsIvim_Functions.ttcn @@ -58,12 +58,12 @@ module LibItsIvim_Functions { * @desc Requests to bring the IUT in an initial state * @param p_init The initialisation to trigger. */ - function f_utInitializeIut(template (value) UtInitialize p_init) runs on ItsIvim { + function f_utInitializeIut(template (value) UtIvimInitialize p_init) runs on ItsIvim { utPort.send(p_init); tc_wait.start; alt { - [] utPort.receive(UtInitializeResult:true) { + [] utPort.receive(UtIvimResults: { utIvimInitializeResult := true }) { tc_wait.stop; log("*** " & testcasename() & ": INFO: IUT initialized ***"); } @@ -89,15 +89,15 @@ module LibItsIvim_Functions { in template (value) UtIvimTrigger p_event ) runs on ItsIvim return IviIdentificationNumber { var IviIdentificationNumber v_iviIdentificationNumber; - var UtIvimTriggerResult v_result; + var UtIvimResults v_result; utPort.send(p_event); tc_wait.start; alt { - [] utPort.receive(UtIvimTriggerResult:?) -> value v_result { + [] utPort.receive(UtIvimResults: { utIvimTriggerResult := ? }) -> value v_result { tc_wait.stop; - v_iviIdentificationNumber := v_result.iviIdentificationNumber; - if ( not v_result.result ) { + v_iviIdentificationNumber := v_result.utIvimTriggerResult.iviIdentificationNumber; + if ( not v_result.utIvimTriggerResult.result ) { f_selfOrClientSyncAndVerdict("IVIM Trigger failed", e_error); } } @@ -125,14 +125,17 @@ module LibItsIvim_Functions { in template (value) UtIvimUpdate p_event ) runs on ItsIvim return IviIdentificationNumber { var IviIdentificationNumber v_iviIdentificationNumber; - var UtIvimUpdateResult v_result; + var UtIvimResults v_result; utPort.send(p_event); tc_wait.start; alt { - [] utPort.receive(UtIvimUpdateResult:?) -> value v_result { + [] utPort.receive(UtIvimResults: { utIvimUpdateResult := ? }) -> value v_result { tc_wait.stop; - v_iviIdentificationNumber := v_result.iviIdentificationNumber; + v_iviIdentificationNumber := v_result.utIvimUpdateResult.iviIdentificationNumber; + if ( not v_result.utIvimUpdateResult.result ) { + f_selfOrClientSyncAndVerdict("IVIM Update failed", e_error); + } } [] a_utDefault() { //empty on purpose @@ -159,7 +162,7 @@ module LibItsIvim_Functions { utPort.send(p_event); tc_wait.start; alt { - [] utPort.receive(UtIvimTerminationResult:?) { + [] utPort.receive(UtIvimResults: { utIvimTerminationResult := ? }) { tc_wait.stop; } [] tc_wait.timeout { @@ -449,4 +452,4 @@ module LibItsIvim_Functions { } // End of group miscellaneousFunctions -} // End of module LibItsIvim_Functions \ No newline at end of file +} // End of module LibItsIvim_Functions diff --git a/ttcn/IVIM/LibItsIvim_Templates.ttcn b/ttcn/IVIM/LibItsIvim_Templates.ttcn index 42bb2b9d..e7c61627 100644 --- a/ttcn/IVIM/LibItsIvim_Templates.ttcn +++ b/ttcn/IVIM/LibItsIvim_Templates.ttcn @@ -132,7 +132,7 @@ module LibItsIvim_Templates { /** * @desc Send template for Upper Tester event initialization */ - template (value) UtInitialize m_ivimStructureInitialize := { + template (value) UtIvimInitialize m_ivimStructureInitialize := { hashedId8 := '0000000000000000'O } // End of template m_ivimStructureInitialize @@ -419,7 +419,7 @@ module LibItsIvim_Templates { */ template (present) Provider mw_provider( template (present) CountryCode p_countryCode := ?, - template (present) IssuerIdentifier p_providerIdentifier := ? + template (present) AVIAEIIssuerIdentifier p_providerIdentifier := ? ) := { countryCode := p_countryCode, providerIdentifier := p_providerIdentifier @@ -597,4 +597,4 @@ module LibItsIvim_Templates { } // End of group roadConfigurationContainerGroup -} // End of module LibItsIvimTemplates \ No newline at end of file +} // End of module LibItsIvimTemplates diff --git a/ttcn/IVIM/LibItsIvim_TestSystem.ttcn b/ttcn/IVIM/LibItsIvim_TestSystem.ttcn index e7f94804..2b9d6864 100644 --- a/ttcn/IVIM/LibItsIvim_TestSystem.ttcn +++ b/ttcn/IVIM/LibItsIvim_TestSystem.ttcn @@ -35,9 +35,9 @@ module LibItsIvim_TestSystem { */ type port AdapterControlPort message { out - AcGnssPrimitive, AcSecPrimitive; + AcSecPrimitive; in - AcGnssResponse, AcGnssDistanceCovered, AcSecResponse; + AdapterControlResults; } // end AdapterControlPort /** @@ -45,10 +45,9 @@ module LibItsIvim_TestSystem { */ type port UpperTesterPort message { out - UtInitialize, UtIvimTrigger, UtIvimUpdate, UtIvimTermination, UtChangePosition, UtChangePseudonym; + UtIvimInitialize, UtIvimTrigger, UtIvimUpdate, UtIvimTermination; in - UtInitializeResult, UtIvimTriggerResult, UtIvimUpdateResult, UtIvimTerminationResult, - UtChangePositionResult, UtChangePseudonymResult, UtIvimEventInd; + UtIvimResults, UtIvimEventInd; } // end UpperTesterPort } // end portDefinitions diff --git a/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn b/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn index 399e7eb9..c0ae7832 100644 --- a/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn +++ b/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn @@ -11,6 +11,10 @@ */ module LibItsIvim_TypesAndValues { + // LibCommon + import from LibCommon_DataStrings all; + import from LibCommon_BasicTypesAndValues all; + // LibIts import from IVIM_PDU_Descriptions language "ASN.1:1997" all; import from IVI language "ASN.1:1997" all; @@ -53,6 +57,33 @@ module LibItsIvim_TypesAndValues { group utPrimitives { + /** + * @desc Upper Tester message to initialize IUT + * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use + */ + type record UtIvimInitialize { + Oct8 hashedId8 + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Upper Tester results message of the IVIM IUT + * @member utIvimInitialize - + * @member utIvimTriggerResult - + * @member utIvimUpdateResult, - + * @member utIvimChangePositionResult - + * @member utIvimChangePseudonymResult - + */ + type union UtIvimResults { + boolean utIvimInitializeResult, + UtIvimTriggerResult utIvimTriggerResult, + UtIvimUpdateResult utIvimUpdateResult, + UtIvimTermination utIvimTerminationResult + } with { + variant "" + } // End of type UtIvimResults + /** * @desc Upper Tester message to request triggering of an event at IUT */ @@ -62,7 +93,9 @@ module LibItsIvim_TypesAndValues { TimestampIts repetitionInterval optional/*, IVIManagementContainer.connectedIviStructures connectedIviStructures optional, IviStructure.optional_ optional_ optional*/ - } + } with { + variant "FIELDORDER(msb)" + } /** * @desc Upper Tester result message of request of triggering of an event at IUT @@ -70,7 +103,9 @@ module LibItsIvim_TypesAndValues { type record UtIvimTriggerResult { boolean result, IviIdentificationNumber iviIdentificationNumber - } + } with { + variant "FIELDORDER(msb)" + } /** * @desc Upper Tester message to update an event at IUT @@ -82,7 +117,9 @@ module LibItsIvim_TypesAndValues { TimestampIts validTo optional, IVIManagementContainer.connectedIviStructures connectedIviStructures optional, IviStructure.optional_ optional_ optional - } + } with { + variant "FIELDORDER(msb)" + } /** * @desc Upper Tester result message of an update request of an event on Ivim IUT @@ -90,19 +127,43 @@ module LibItsIvim_TypesAndValues { type record UtIvimUpdateResult { boolean result, IviIdentificationNumber iviIdentificationNumber - } + } with { + variant "FIELDORDER(msb)" + } /** * @desc Upper Tester message to request the termination of an event at IUT */ type record UtIvimTermination { IviIdentificationNumber iviIdentificationNumber - } + } with { + variant "FIELDORDER(msb)" + } /** * @desc Upper Tester result message of termination of an event on Ivim IUT */ type boolean UtIvimTerminationResult; + + /** + * @desc Upper Tester message to change the position of IUT. Values a relatives + */ + type record UtIvimChangePosition { + Int32 latitude, + Int32 longitude, + Int32 elevation + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Upper Tester message to change the pseudonym of the DENM IUT + */ + type record UtIvimChangePseudonym { + // empty on purpose + } with { + variant "FIELDORDER(msb)" + } /** * @desc Upper Tester message to check event/status on Ivim IUT @@ -126,6 +187,7 @@ module LibItsIvim_TypesAndValues { } with { encode "UpperTester" + variant "" } } with { diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn index c3a7119d..f020d302 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn @@ -39,12 +39,12 @@ module LibItsMapemSpatem_Functions { * @desc Requests to bring the IUT in an initial state * @param p_init The initialisation to trigger. */ - function f_utInitializeIut(template (value) UtInitialize p_init) runs on ItsMapemSpatem { + function f_utInitializeIut(template (value) UtMapemSpatemInitialize p_init) runs on ItsMapemSpatem { utPort.send(p_init); tc_wait.start; alt { - [] utPort.receive(UtInitializeResult:true) { + [] utPort.receive(UtMapemSpatemResults: { utMapemSpatemInitializeResult := true }) { tc_wait.stop; log("*** " & testcasename() & ": INFO: IUT initialized ***"); } @@ -71,7 +71,7 @@ module LibItsMapemSpatem_Functions { utPort.send ( p_event ); tc_wait.start; alt { - [] utPort.receive ( UtMapemSpatemTriggerResult:? ) -> value v_result { + [] utPort.receive ( UtMapemSpatemResults: { utMapemSpatemTriggerResult := ? }) -> value v_result { tc_wait.stop; if ( not v_result ) { f_selfOrClientSyncAndVerdict("MapSpat Trigger failed", e_error); @@ -334,4 +334,4 @@ module LibItsMapemSpatem_Functions { } // End of group receiveFunctions -} // End of module LibItsMapemSpatem_Functions \ No newline at end of file +} // End of module LibItsMapemSpatem_Functions diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Pixits.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Pixits.ttcn index 7fa071dd..efd40711 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Pixits.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Pixits.ttcn @@ -17,6 +17,7 @@ module LibItsMapemSpatem_Pixits { // LibIts import from DSRC language "ASN.1:1997" all; + import from DSRC_REGION_noCircular language "ASN.1:1997" all; // LibItsMapemSpatem import from LibItsMapemSpatem_TypesAndValues all; diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn index 18be8285..aa204ea2 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn @@ -20,6 +20,7 @@ module LibItsMapemSpatem_Templates { import from MAPEM_PDU_Descriptions language "ASN.1:1997" all; import from SPATEM_PDU_Descriptions language "ASN.1:1997" all; import from DSRC language "ASN.1:1997" all; + import from DSRC_REGION_noCircular language "ASN.1:1997" all; // LibItsCommon import from LibItsCommon_Functions all; @@ -212,7 +213,7 @@ module LibItsMapemSpatem_Templates { * @desc Send template for Upper Tester event initialization * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use */ - template (value) UtInitialize m_mapemSpatemInitialize := { + template (value) UtMapemSpatemInitialize m_mapemSpatemInitialize := { hashedId8 := '0000000000000000'O } diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_TestSystem.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_TestSystem.ttcn index 0baa5026..11e20faf 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_TestSystem.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_TestSystem.ttcn @@ -47,9 +47,9 @@ module LibItsMapemSpatem_TestSystem { */ type port UpperTesterPort message { out - UtInitialize, UtMapemSpatemTrigger; + UtMapemSpatemInitialize, UtMapemSpatemTrigger; in - UtInitializeResult, UtMapemSpatemTriggerResult, UtMapemEventInd , UtSpatemEventInd; + UtMapemSpatemResults, UtMapemEventInd , UtSpatemEventInd; } // end UpperTesterPort } // end portDefinitions diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn index cf2618d9..152ac08e 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn @@ -30,12 +30,40 @@ module LibItsMapemSpatem_TypesAndValues { group utPrimitives { + /** + * @desc Upper Tester message to initialize IUT + * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use + */ + type record UtMapemSpatemInitialize { + Oct8 hashedId8 + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Upper Tester results message of the MAPEM/SPATEM IUT + * @member utMapemSpatemInitialize - + * @member utMapemSpatemTriggerResult - + * @member utMapemSpatemUpdateResult, - + * @member utMapemSpatemChangePositionResult - + * @member utMapemSpatemChangePseudonymResult - + */ + type union UtMapemSpatemResults { + boolean utMapemSpatemInitializeResult, + boolean utMapemSpatemTriggerResult + } with { + variant "" + } // End of type UtMapemSpatemResults + /** * @desc Upper Tester message to request triggering of an event at IUT */ type record UtMapemSpatemTrigger { Event event + } with { + variant "FIELDORDER(msb)" } + type enumerated Event { startTLMService (0), stopTLMService (1), @@ -45,18 +73,14 @@ module LibItsMapemSpatem_TypesAndValues { mapemRepL10s (5), mapemRepG10s (6) } - /** - * @desc Upper Tester result message of request of triggering of an event at IUT - */ - type boolean UtMapemSpatemTriggerResult; /** * @desc Upper Tester message to check event/status at IUT */ type record UtMapemEventInd { - MAPEM mapeMsg - } with { - encode (mapeMsg) "LibItsMapemSpatem_asn1" + MAPEM mapeMsg + } with { + encode (mapeMsg) "LibItsMapemSpatem_asn1" } /** @@ -79,6 +103,8 @@ module LibItsMapemSpatem_TypesAndValues { type record of UtSpatemEventInd UtSpatemEventIndList; } with { encode "UpperTester" + variant "" } - -} // End of module LibItsMapemSpatem_TypesAndValues \ No newline at end of file +} with { + encode "LibItsMapemSpatem" +} // End of module LibItsMapemSpatem_TypesAndValues diff --git a/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn b/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn index 67f8b75a..81ef45a2 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn @@ -39,12 +39,12 @@ module LibItsSremSsem_Functions { * @desc Requests to bring the IUT in an initial state * @param p_init The initialisation to trigger. */ - function f_utInitializeIut(template (value) UtInitialize p_init) runs on ItsSremSsem { + function f_utInitializeIut(template (value) UtSremInitialize p_init) runs on ItsSremSsem { utPort.send(p_init); tc_wait.start; alt { - [] utPort.receive(UtInitializeResult:true) { + [] utPort.receive(UtSremResults: { utSremInitializeResult := true }) { tc_wait.stop; log("*** " & testcasename() & ": INFO: IUT initialized ***"); } @@ -66,17 +66,16 @@ module LibItsSremSsem_Functions { function f_utTriggerEvent( in template (value) UtSremTrigger p_event ) runs on ItsSremSsem { - var UtSremTriggerResult v_result; utPort.send ( p_event ); tc_wait.start; alt { - [] utPort.receive ( UtSremTriggerResult:? ) -> value v_result { + [] utPort.receive ( UtSremResults: { utSremTriggerResult := true }) { + tc_wait.stop; + } + [] utPort.receive ( UtSremResults: { utSremTriggerResult := false }) { tc_wait.stop; - if ( not v_result ) { - f_selfOrClientSyncAndVerdict("SREM Trigger failed", e_error); - } - + f_selfOrClientSyncAndVerdict("SREM Trigger failed", e_error); } [] tc_wait.timeout { log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); @@ -98,17 +97,16 @@ module LibItsSremSsem_Functions { function f_utUpdateEvent( in template (value) UtSremUpdate p_event ) runs on ItsSremSsem { - var UtSremUpdateResult v_result; utPort.send ( p_event ); tc_wait.start; alt { - [] utPort.receive ( UtSremUpdateResult:? ) -> value v_result { + [] utPort.receive ( UtSremResults: { utSremUpdateResult := true }) { tc_wait.stop; - if ( not v_result ) { - f_selfOrClientSyncAndVerdict("SREM Update failed", e_error); - } - + } + [] utPort.receive ( UtSremResults: { utSremUpdateResult := false }) { + tc_wait.stop; + f_selfOrClientSyncAndVerdict("SREM Update failed", e_error); } [] tc_wait.timeout { log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); @@ -391,4 +389,4 @@ module LibItsSremSsem_Functions { } // End of group miscellaneousFunctions -} // End of module LibItsSremSsem_Functions \ No newline at end of file +} // End of module LibItsSremSsem_Functions diff --git a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn index 3da0801a..c6892bd4 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn @@ -210,7 +210,7 @@ module LibItsSremSsem_Templates { * @desc Send template for Upper Tester event initialization * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use */ - template (value) UtInitialize m_sremSsemInitialize := { + template (value) UtSremInitialize m_sremSsemInitialize := { hashedId8 := '0000000000000000'O } diff --git a/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn b/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn index ed4bddfe..990615c5 100644 --- a/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn @@ -39,7 +39,7 @@ module LibItsSremSsem_TestSystem { out AcSecPrimitive; in - AcSecResponse; + AdapterControlResults; } // end AdapterControlPort /** @@ -47,9 +47,9 @@ module LibItsSremSsem_TestSystem { */ type port UpperTesterPort message { out - UtInitialize, UtSremTrigger, UtSremUpdate; + UtSremInitialize, UtSremTrigger, UtSremUpdate; in - UtInitializeResult, UtSremTriggerResult, UtSremUpdateResult, UtSremEventInd , UtSsemEventInd; + UtSremResults, UtSremEventInd , UtSsemEventInd; } // end UpperTesterPort } // end portDefinitions diff --git a/ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn b/ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn index 63b01dc1..362d12c4 100644 --- a/ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn @@ -30,19 +30,42 @@ module LibItsSremSsem_TypesAndValues { group utPrimitives { + /** + * @desc Upper Tester mes`sage to initialize IUT + * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use + */ + type record UtSremInitialize { + Oct8 hashedId8 + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Upper Tester results message of the Srem/Ssem IUT + * @member utSremInitialize - + * @member utSremTriggerResult - + * @member utAutoInteropTriggerResult - + * @member utSremChangePositionResult - + */ + type union UtSremResults { + boolean utSremInitializeResult, + boolean utSremTriggerResult, + boolean utSremUpdateResult + } with { + variant "" + } // End of type UtSremResults + /** * @desc Upper Tester message to request triggering of an event at IUT */ type record UtSremTrigger { BasicVehicleRole basicVehicleRole, RequestImportanceLevel requestImportanceLevel - } + } with { + variant "FIELDORDER(msb)" + } type record of UtSremTrigger UtSremTriggerList; - /** - * @desc Upper Tester result message of request of triggering of an event at IUT - */ - type boolean UtSremTriggerResult; /** * @desc Upper Tester message to request updating of an event at IUT @@ -51,11 +74,9 @@ module LibItsSremSsem_TypesAndValues { RequestID requestID, BasicVehicleRole basicVehicleRole, RequestImportanceLevel requestImportanceLevel - } - /** - * @desc Upper Tester result message of request of triggering of an event at IUT - */ - type boolean UtSremUpdateResult; + } with { + variant "FIELDORDER(msb)" + } /** * @desc Upper Tester message to check event/status at IUT @@ -89,6 +110,9 @@ module LibItsSremSsem_TypesAndValues { } with { encode "UpperTester" + variant "" } -} // End of module LibItsSremSsem_TypesAndValues \ No newline at end of file +} with { + encode "LibItsSremSsem" +} // End of module LibItsSremSsem_TypesAndValues -- GitLab From a10c257b686e23a484910c52c2b040c68c8ad021 Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 17 Nov 2017 09:46:59 +0000 Subject: [PATCH 040/320] Review IVIM, MAPEM/SPATEM and SREM/SSEM --- ttcn/IVIM/LibItsIvim_EncdecDeclarations.ttcn | 37 ++++++++++++++++++- ttcn/IVIM/LibItsIvim_Templates.ttcn | 14 +++---- ttcn/IVIM/LibItsIvim_TestSystem.ttcn | 2 +- .../LibItsMapemSpatem_Functions.ttcn | 11 +++--- .../LibItsMapemSpatem_TestSystem.ttcn | 2 +- .../LibItsMapemSpatem_TypesAndValues.ttcn | 3 -- 6 files changed, 50 insertions(+), 19 deletions(-) diff --git a/ttcn/IVIM/LibItsIvim_EncdecDeclarations.ttcn b/ttcn/IVIM/LibItsIvim_EncdecDeclarations.ttcn index 427068a3..d154e91f 100644 --- a/ttcn/IVIM/LibItsIvim_EncdecDeclarations.ttcn +++ b/ttcn/IVIM/LibItsIvim_EncdecDeclarations.ttcn @@ -3,7 +3,42 @@ module LibItsIvim_EncdecDeclarations { // LibIts import from IVIM_PDU_Descriptions all; + // LibItsIvim + import from LibItsIvim_TypesAndValues all; + import from LibItsIvim_TestSystem all; + + external function fx_enc_IvimReq (IvimReq p) return bitstring + with {extension "prototype(convert) encode(LibIts_Interface)"} + + external function fx_dec_IvimReq (inout bitstring b, out IvimReq p) return integer + with {extension "prototype(sliding) decode(LibIts_Interface)"} + + external function fx_dec_IvimInd (inout bitstring b, out IvimInd p) return integer + with {extension "prototype(sliding) decode(LibIts_Interface)"} + + external function fx_enc_IVIM (IVIM p) return bitstring + with {extension "prototype(convert) encode(PER)"} + + external function fx_dec_IVIM (inout bitstring b, out IVIM p) return integer + with {extension "prototype(sliding) decode(PER)"} +/* external function fx_enc_IVIM (IVIM p) return octetstring with {extension "prototype(convert) encode(BER:BER_ENCODE_CER)"} +*/ + + external function fx_enc_UtIvimInitialize (UtIvimInitialize p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + + external function fx_enc_UtIvimChangePosition (UtIvimChangePosition p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + + external function fx_enc_UtIvimTrigger (UtIvimTrigger p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + + external function fx_dec_UtIvimResults (inout bitstring b, out UtIvimResults p) return integer + with {extension "prototype(sliding) decode(UpperTester)"} + + external function fx_dec_UtIvimEventInd (inout bitstring b, out UtIvimEventInd p) return integer + with {extension "prototype(sliding) decode(UpperTester)"} -} +} // End of module LibItsIvim_EncdecDeclarations diff --git a/ttcn/IVIM/LibItsIvim_Templates.ttcn b/ttcn/IVIM/LibItsIvim_Templates.ttcn index e7c61627..1f5bdfce 100644 --- a/ttcn/IVIM/LibItsIvim_Templates.ttcn +++ b/ttcn/IVIM/LibItsIvim_Templates.ttcn @@ -207,8 +207,8 @@ module LibItsIvim_Templates { */ template (value) ItsPduHeader m_itsPduHeader( template (value) StationID p_stationID := f_getTsStationId(), - template (value) ItsPduHeader.protocolVersion p_protocolVersion := ItsPduHeader_protocolVersion_currentVersion_, - template (value) ItsPduHeader.messageID p_messageID := ItsPduHeader_messageID_ivim_ + template (value) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, + template (value) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_ivim_ ) := { protocolVersion := p_protocolVersion, messageID := p_messageID, @@ -223,8 +223,8 @@ module LibItsIvim_Templates { */ template ItsPduHeader mw_itsPduHeader( template (present) StationID p_stationID := ?, - template (present) ItsPduHeader.protocolVersion p_protocolVersion := ItsPduHeader_protocolVersion_currentVersion_, - template (present) ItsPduHeader.messageID p_messageID := ItsPduHeader_messageID_ivim_ + template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, + template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_ivim_ ) := { protocolVersion := p_protocolVersion, messageID := p_messageID, @@ -271,8 +271,8 @@ module LibItsIvim_Templates { template (present) IVIM mw_ivimPdu( template (present) IviStructure p_ivim, template (present) StationID p_stationID := ?, - template (present) ItsPduHeader.protocolVersion p_protocolVersion := ItsPduHeader_protocolVersion_currentVersion_, - template (present) ItsPduHeader.messageID p_messageID := ItsPduHeader_messageID_ivim_ + template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, + template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_ivim_ ) := { header := mw_itsPduHeader(p_stationID, p_protocolVersion, p_messageID), ivi := p_ivim @@ -315,7 +315,7 @@ module LibItsIvim_Templates { template (value) IviStructure m_ivimStructureCancellation( in template (value) IviIdentificationNumber p_iviIdentificationNumber ) := { - mandatory := valueof(m_iviManagementContainer(f_getProvider(), valueof(p_iviIdentificationNumber), IviStatus_cancellation_)), + mandatory := valueof(m_iviManagementContainer(f_getProvider(), valueof(p_iviIdentificationNumber), LibItsIvim_ASN1_IVInamedNumbers.IviStatus_cancellation_)), optional_ := omit } // End of template m_ivimStructureCancellation diff --git a/ttcn/IVIM/LibItsIvim_TestSystem.ttcn b/ttcn/IVIM/LibItsIvim_TestSystem.ttcn index 2b9d6864..6940b132 100644 --- a/ttcn/IVIM/LibItsIvim_TestSystem.ttcn +++ b/ttcn/IVIM/LibItsIvim_TestSystem.ttcn @@ -35,7 +35,7 @@ module LibItsIvim_TestSystem { */ type port AdapterControlPort message { out - AcSecPrimitive; + AcGnssPrimitive, AcSecPrimitive; in AdapterControlResults; } // end AdapterControlPort diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn index f020d302..ef637f7e 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn @@ -66,17 +66,16 @@ module LibItsMapemSpatem_Functions { function f_utTriggerEvent( in template (value) UtMapemSpatemTrigger p_event ) runs on ItsMapemSpatem { - var UtMapemSpatemTriggerResult v_result; utPort.send ( p_event ); tc_wait.start; alt { - [] utPort.receive ( UtMapemSpatemResults: { utMapemSpatemTriggerResult := ? }) -> value v_result { + [] utPort.receive ( UtMapemSpatemResults: { utMapemSpatemTriggerResult := true }) { tc_wait.stop; - if ( not v_result ) { - f_selfOrClientSyncAndVerdict("MapSpat Trigger failed", e_error); - } - + } + [] utPort.receive ( UtMapemSpatemResults: { utMapemSpatemTriggerResult := false }) { + tc_wait.stop; + f_selfOrClientSyncAndVerdict("MapSpat Trigger failed", e_error); } [] tc_wait.timeout { log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_TestSystem.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_TestSystem.ttcn index 11e20faf..81908d0c 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_TestSystem.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_TestSystem.ttcn @@ -39,7 +39,7 @@ module LibItsMapemSpatem_TestSystem { out AcSecPrimitive; in - AcSecResponse; + AdapterControlResults; } // end AdapterControlPort /** diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn index 152ac08e..b4a79631 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn @@ -44,9 +44,6 @@ module LibItsMapemSpatem_TypesAndValues { * @desc Upper Tester results message of the MAPEM/SPATEM IUT * @member utMapemSpatemInitialize - * @member utMapemSpatemTriggerResult - - * @member utMapemSpatemUpdateResult, - - * @member utMapemSpatemChangePositionResult - - * @member utMapemSpatemChangePseudonymResult - */ type union UtMapemSpatemResults { boolean utMapemSpatemInitializeResult, -- GitLab From a6429f2984beafff5f79b748acbdb9706fffb34b Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 17 Nov 2017 15:25:10 +0000 Subject: [PATCH 041/320] Review IVIM, MAPEM/SPATEM and SREM/SSEM --- ttcn/CAM/LibItsCam_TestSystem.ttcn | 2 +- ttcn/IVIM/LibItsIvim_TestSystem.ttcn | 5 +++-- ttcn/MapemSpatem/LibItsMapemSpatem_TestSystem.ttcn | 11 ++++++----- ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn | 11 ++++++----- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/ttcn/CAM/LibItsCam_TestSystem.ttcn b/ttcn/CAM/LibItsCam_TestSystem.ttcn index fd62a304..45560a23 100644 --- a/ttcn/CAM/LibItsCam_TestSystem.ttcn +++ b/ttcn/CAM/LibItsCam_TestSystem.ttcn @@ -149,7 +149,7 @@ module LibItsCam_TestSystem { CAM msgOut } with { - encode (msgOut) "PER"//LibItsCam_asn1 + encode (msgOut) "PER" } } // end fa1Primitives diff --git a/ttcn/IVIM/LibItsIvim_TestSystem.ttcn b/ttcn/IVIM/LibItsIvim_TestSystem.ttcn index 6940b132..c07a815f 100644 --- a/ttcn/IVIM/LibItsIvim_TestSystem.ttcn +++ b/ttcn/IVIM/LibItsIvim_TestSystem.ttcn @@ -136,7 +136,7 @@ module LibItsIvim_TestSystem { UInt32 its_aid optional } with { - encode (msgIn) "LibItsIvim_asn1" + encode (msgIn) "PER" } /** @@ -148,13 +148,14 @@ module LibItsIvim_TestSystem { IVIM msgOut } with { - encode (msgOut) "LibItsIvim_asn1" + encode (msgOut) "PER" } } // End of group fa1Primitives } // End of group facilityPrimitives with { + variant "" encode "LibIts_Interface" } // end interfacePrimitives diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_TestSystem.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_TestSystem.ttcn index 81908d0c..266985c8 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_TestSystem.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_TestSystem.ttcn @@ -113,7 +113,7 @@ module LibItsMapemSpatem_TestSystem { UInt32 its_aid optional } with { - encode (msgIn) "LibItsMapemSpatem_asn1" + encode (msgIn) "PER" } type record SpatemInd { @@ -129,7 +129,7 @@ module LibItsMapemSpatem_TestSystem { UInt32 its_aid optional } with { - encode (msgIn) "LibItsMapemSpatem_asn1" + encode (msgIn) "PER" } /** @@ -139,16 +139,17 @@ module LibItsMapemSpatem_TestSystem { MAPEM msgOut } with { - encode (msgOut) "LibItsMapemSpatem_asn1" + encode (msgOut) "PER" } type record SpatemReq { SPATEM msgOut } with { - encode (msgOut) "LibItsMapemSpatem_asn1" + encode (msgOut) "PER" } - } with { + } with { + variant "" encode "LibIts_Interface" } // End of group ApplPrimitives diff --git a/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn b/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn index 990615c5..c9a512f9 100644 --- a/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn @@ -113,7 +113,7 @@ module LibItsSremSsem_TestSystem { UInt32 its_aid optional } with { - encode (msgIn) "LibItsSremSsem_asn1" + encode (msgIn) "PER" } type record of SremInd SremInds; @@ -131,7 +131,7 @@ module LibItsSremSsem_TestSystem { UInt32 its_aid optional } with { - encode (msgIn) "LibItsSremSsem_asn1" + encode (msgIn) "PER" } /** @@ -141,16 +141,17 @@ module LibItsSremSsem_TestSystem { SREM msgOut } with { - encode (msgOut) "LibItsSremSsem_asn1" + encode (msgOut) "PER" } type record SsemReq { SSEM msgOut } with { - encode (msgOut) "LibItsSremSsem_asn1" + encode (msgOut) "PER" } - } with { + } with { + variant "" encode "LibIts_Interface" } // End of group ApplPrimitives -- GitLab From 1ec7c7d7f7c964d6c2fcd35cd4a647c626968083 Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 24 Nov 2017 15:01:49 +0000 Subject: [PATCH 042/320] Review IVIM, MAPEM/SPATEM and SREM/SSEM --- ...cn => LibItsCommon_ASN1_NamedNumbers.ttcn} | 0 .../LibItsGeoNetworking_Pixits.ttcn | 2 +- .../LibItsGeoNetworking_Templates.ttcn | 44 +- ttcn/IVIM/LibItsIvim_EncdecDeclarations.ttcn | 12 +- ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn | 24 +- ...LibItsIpv6OverGeoNetworking_Templates.ttcn | 616 +++++++++--------- .../LibItsMapemSpatem_EncdecDeclarations.ttcn | 4 +- .../LibItsMapemSpatem_Templates.ttcn | 19 +- .../LibItsSecurity_EncdecDeclarations.ttcn | 53 +- .../LibItsSremSsem_EncdecDeclarations.ttcn | 2 +- ttcn/SremSsem/LibItsSremSsem_Templates.ttcn | 16 +- 11 files changed, 404 insertions(+), 388 deletions(-) rename ttcn/Common/{LibItsCommon_ASN1_NamedNumbers1.ttcn => LibItsCommon_ASN1_NamedNumbers.ttcn} (100%) diff --git a/ttcn/Common/LibItsCommon_ASN1_NamedNumbers1.ttcn b/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn similarity index 100% rename from ttcn/Common/LibItsCommon_ASN1_NamedNumbers1.ttcn rename to ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Pixits.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Pixits.ttcn index 22311ece..67ce401d 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Pixits.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Pixits.ttcn @@ -175,7 +175,7 @@ module LibItsGeoNetworking_Pixits { * @desc The IUT's upper layer * @see ETSI TS 102 871-3 Table B.7 */ - modulepar NextHeader PX_GN_UPPER_LAYER := e_btpB; + modulepar NextHeader PX_GN_UPPER_LAYER := e_any; /** * @desc Is BTP header present in IUT's UT indication. Only applicable if PX_GN_UPPER_LAYER == e_btpA or e_btpB. diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn index 23321d9b..497b8ddc 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn @@ -539,11 +539,11 @@ module LibItsGeoNetworking_Templates { in template (value) CommonHeader p_commonHeader, in template (value) ExtendedHeader p_extHeader ) := { - packet := valueof({ - commonHeader := p_commonHeader, - extendedHeader := p_extHeader, + packet := { + commonHeader := valueof(p_commonHeader), + extendedHeader := valueof(p_extHeader), payload := char2oct("DEFAULT_PAYLOAD") - }), + }, securedMsg := omit } @@ -1749,17 +1749,17 @@ module LibItsGeoNetworking_Templates { in template (value) UInt16 p_seqNumber, in template (value) GeoBroadcastArea p_broadcastArea ) := { - geoBroadcastHeader := valueof({ - seqNumber := p_seqNumber, + geoBroadcastHeader := { + seqNumber := valueof(p_seqNumber), reserved := c_uInt8Zero, - srcPosVector := p_sourceLongPosVec, - geoAreaPosLatitude := p_broadcastArea.geoBroadcastArea.geoAreaPosLatitude, - geoAreaPosLongitude := p_broadcastArea.geoBroadcastArea.geoAreaPosLongitude, - distanceA := p_broadcastArea.geoBroadcastArea.distanceA, - distanceB := p_broadcastArea.geoBroadcastArea.distanceB, - angle := p_broadcastArea.geoBroadcastArea.angle, + srcPosVector := valueof(p_sourceLongPosVec), + geoAreaPosLatitude := valueof(p_broadcastArea.geoBroadcastArea.geoAreaPosLatitude), + geoAreaPosLongitude := valueof(p_broadcastArea.geoBroadcastArea.geoAreaPosLongitude), + distanceA := valueof(p_broadcastArea.geoBroadcastArea.distanceA), + distanceB := valueof(p_broadcastArea.geoBroadcastArea.distanceB), + angle := valueof(p_broadcastArea.geoBroadcastArea.angle), reserved2 := c_uInt24Zero - }) + } } /** @@ -1858,17 +1858,17 @@ module LibItsGeoNetworking_Templates { in template (value) UInt16 p_seqNumber, in template (value) GeoAnycastArea p_anycastArea ) := { - geoAnycastHeader := valueof({ - seqNumber := p_seqNumber, + geoAnycastHeader := { + seqNumber := valueof(p_seqNumber), reserved := c_uInt8Zero, - srcPosVector := p_sourceLongPosVec, - geoAreaPosLatitude := p_anycastArea.geoAnycastArea.geoAreaPosLatitude, - geoAreaPosLongitude := p_anycastArea.geoAnycastArea.geoAreaPosLongitude, - distanceA := p_anycastArea.geoAnycastArea.distanceA, - distanceB := p_anycastArea.geoAnycastArea.distanceB, - angle := p_anycastArea.geoAnycastArea.angle, + srcPosVector := valueof(p_sourceLongPosVec), + geoAreaPosLatitude := valueof(p_anycastArea.geoAnycastArea.geoAreaPosLatitude), + geoAreaPosLongitude := valueof(p_anycastArea.geoAnycastArea.geoAreaPosLongitude), + distanceA := valueof(p_anycastArea.geoAnycastArea.distanceA), + distanceB := valueof(p_anycastArea.geoAnycastArea.distanceB), + angle := valueof(p_anycastArea.geoAnycastArea.angle), reserved2 := c_uInt24Zero - }) + } } /** diff --git a/ttcn/IVIM/LibItsIvim_EncdecDeclarations.ttcn b/ttcn/IVIM/LibItsIvim_EncdecDeclarations.ttcn index d154e91f..1f063f87 100644 --- a/ttcn/IVIM/LibItsIvim_EncdecDeclarations.ttcn +++ b/ttcn/IVIM/LibItsIvim_EncdecDeclarations.ttcn @@ -1,7 +1,7 @@ module LibItsIvim_EncdecDeclarations { // LibIts - import from IVIM_PDU_Descriptions all; + import from IVIM_PDU_Descriptions language "ASN.1:1997" all; // LibItsIvim import from LibItsIvim_TypesAndValues all; @@ -29,12 +29,18 @@ module LibItsIvim_EncdecDeclarations { external function fx_enc_UtIvimInitialize (UtIvimInitialize p) return bitstring with {extension "prototype(convert) encode(UpperTester)"} - external function fx_enc_UtIvimChangePosition (UtIvimChangePosition p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} + /* external function fx_enc_UtIvimChangePosition (UtIvimChangePosition p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"}*/ external function fx_enc_UtIvimTrigger (UtIvimTrigger p) return bitstring with {extension "prototype(convert) encode(UpperTester)"} + external function fx_enc_UtIvimUpdate (UtIvimUpdate p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + + external function fx_enc_UtIvimTermination (UtIvimTermination p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + external function fx_dec_UtIvimResults (inout bitstring b, out UtIvimResults p) return integer with {extension "prototype(sliding) decode(UpperTester)"} diff --git a/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn b/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn index c0ae7832..7f627f29 100644 --- a/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn +++ b/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn @@ -79,7 +79,7 @@ module LibItsIvim_TypesAndValues { boolean utIvimInitializeResult, UtIvimTriggerResult utIvimTriggerResult, UtIvimUpdateResult utIvimUpdateResult, - UtIvimTermination utIvimTerminationResult + boolean utIvimTerminationResult } with { variant "" } // End of type UtIvimResults @@ -143,28 +143,8 @@ module LibItsIvim_TypesAndValues { /** * @desc Upper Tester result message of termination of an event on Ivim IUT */ - type boolean UtIvimTerminationResult; + //type boolean UtIvimTerminationResult; - /** - * @desc Upper Tester message to change the position of IUT. Values a relatives - */ - type record UtIvimChangePosition { - Int32 latitude, - Int32 longitude, - Int32 elevation - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to change the pseudonym of the DENM IUT - */ - type record UtIvimChangePseudonym { - // empty on purpose - } with { - variant "FIELDORDER(msb)" - } - /** * @desc Upper Tester message to check event/status on Ivim IUT */ diff --git a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Templates.ttcn b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Templates.ttcn index c70e6a2d..da581a7a 100644 --- a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Templates.ttcn +++ b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Templates.ttcn @@ -1,310 +1,310 @@ -/** - * @author ETSI / STF405 / STF449 - * @version $URL$ - * $Id$ - * @desc IPv6 over GeoNetworking Protocol Templates - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsIpv6OverGeoNetworking_Templates { - +/** + * @author ETSI / STF405 / STF449 + * @version $URL$ + * $Id$ + * @desc IPv6 over GeoNetworking Protocol Templates + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * + */ +module LibItsIpv6OverGeoNetworking_Templates { + //LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - //LibIts - import from LibItsIpv6OverGeoNetworking_TestSystem all; - import from LibItsIpv6OverGeoNetworking_TypesAndValues all; - import from LibItsGeoNetworking_TypesAndValues {type Payload}; - import from LibItsExternal_TypesAndValues {type MacAddress}; - - group ipv6OverGeoNwPrimitivesTemplates { - - /** - * @desc Send template for IPv6OverGeoNetworking packet (IPv6OverGeoNetworking Primitive) - * @param p_interface Which virtual interface to use for sending the packet - * @param p_srcMacAddr Link-layer source address - * @param p_dstMacAddr Link-layer destination address - * @param p_ipv6Packet IPv6 packet to be sent - */ - template (value) IPv6OverGeoNetworkingReq m_ipv6OverGeoNwReq( - template (value) charstring p_interface, - template (value) MacAddress p_srcMacAddr, - template (value) MacAddress p_dstMacAddr, - template (value) Ipv6Packet p_ipv6Packet - ) := { - interface := p_interface, - macSourceAddress := p_srcMacAddr, - macDestinationAddress := p_dstMacAddr, - ipv6Packet := p_ipv6Packet - } - - /** - * @desc Receive template for IPv6OverGeoNetworking packet (IPv6OverGeoNetworking Primitive) - * @param p_interface On which virtual interface the packet is expected - * @param p_srcMacAddr Link-layer source address - * @param p_dstMacAddr Link-layer destination address - * @param p_ipv6Packet Expected IPv6 packet - */ - template IPv6OverGeoNetworkingInd mw_ipv6OverGeoNwInd( - template (present) charstring p_interface, - template (present) MacAddress p_srcMacAddr, - template (present) MacAddress p_dstMacAddr, - template (present) Ipv6Packet p_ipv6Packet - ) := { - interface := p_interface, - macSourceAddress := p_srcMacAddr, - macDestinationAddress := p_dstMacAddr, - ipv6Packet := p_ipv6Packet - } - - } // ipv6OverGeoNwPrimitivesTemplates - - group ipv6 { - -// /** -// * @desc Send template for GN6 payload of type IPv6 -// * @param p_ipv6Packet IPv6 packet to be used as GN6 payload -// */ -// template (value) Payload m_ipv6Payload(in template (value) Ipv6Packet p_ipv6Packet) := { -// decodedPayload := {ipv6Packet := p_ipv6Packet}, -// rawPayload := ''O -// } -// -// /** -// * @desc Receive template for GN6 payload of type IPv6 -// * @param p_ipv6Packet Expected IPv6 packet to be received as GN6 payload -// */ -// template (present) Payload mw_ipv6Payload(in template (present) Ipv6Packet p_ipv6Packet) := { -// decodedPayload := {ipv6Packet := p_ipv6Packet}, -// rawPayload := ? -// } - - /** - * @desc Send template for IPv6 packet - * @param p_srcAddr IPv6 source address - * @param p_dstAddr IPv6 destination address - * @param p_nextHdr IPv6's next header - * @param p_payload IPv6 payload - */ - template (value) Ipv6Packet m_ipv6Packet( - in template (value) Ipv6Address p_srcAddr, - in template (value) Ipv6Address p_dstAddr, - in template (value) UInt8 p_nextHdr, - in template (omit) Ipv6Payload p_payload - ) := { - ipv6Hdr := m_ipv6Header(p_srcAddr, p_dstAddr, p_nextHdr), - extHdrList := omit, - ipv6Payload := p_payload - } - - /** - * @desc Reception template for IPv6 packet - * @param p_srcAddr IPv6 source address - * @param p_dstAddr IPv6 destination address - * @param p_nextHdr IPv6's next header - * @param p_payload IPv6 payload - */ - template Ipv6Packet mw_ipv6Packet( - in template (present) Ipv6Address p_srcAddr, - in template (present) Ipv6Address p_dstAddr, - in template (present) UInt8 p_nextHdr, - in template Ipv6Payload p_payload - ) := { - ipv6Hdr := mw_ipv6Header(p_srcAddr, p_dstAddr, p_nextHdr), - extHdrList := omit, - ipv6Payload := p_payload - } - - /** - * @desc Send template for IPv6 header - * @param p_srcAddr IPv6 source address - * @param p_dstAddr IPv6 destination address - * @param p_nextHdr IPv6's next header - */ - template (value) Ipv6Header m_ipv6Header( - in template (value) Ipv6Address p_srcAddr, - in template (value) Ipv6Address p_dstAddr, - in template (value) UInt8 p_nextHdr - ) := { - version := 6, - trafficClass := 0, - flowLabel := 0, - payloadLength := 0, //indicates that the adaptation will fill the correct value - nextHeader := p_nextHdr, - hopLimit := 255, - sourceAddress := p_srcAddr, - destinationAddress := p_dstAddr - } - - /** - * @desc Receive template for IPv6 header - * @param p_srcAddr IPv6 source address - * @param p_dstAddr IPv6 destination address - * @param p_nextHdr IPv6's next header - */ - template Ipv6Header mw_ipv6Header( - in template (present) Ipv6Address p_srcAddr, - in template (present) Ipv6Address p_dstAddr, - in template (present) UInt8 p_nextHdr - ) := { - version := 6, - trafficClass := ?, - flowLabel := ?, - payloadLength := ?, - nextHeader := p_nextHdr, - hopLimit := ?, - sourceAddress := p_srcAddr, - destinationAddress := p_dstAddr - } - - /** - * @desc Send template for IPv6 payload containing Router Advertisement - * @param p_rtAdvOptions Router Advertisement options - */ - template (value) Ipv6Payload m_rtAdvWithOptions( - in template (omit) RtAdvOptions p_rtAdvOptions - ) := { - routerAdvMsg := { - icmpType := c_rtAdvMsg, - icmpCode := 0, - checksum := c_2ZeroBytes, //indicates that the adaptation will fill the correct value - curHopLimit := 255, - managedConfigFlag := 0, - otherConfigFlag := 0, - homeAgentFlag := 0, - reserved := 0, - routerLifetime := c_uInt16Max, - reachableTime := c_uInt32Max, - retransTimer := 0, - rtAdvOptions := p_rtAdvOptions - } - } - - /** - * @desc Receive template for IPv6 payload containing Router Advertisement - * @param p_rtAdvOptions Router Advertisement options - */ - template Ipv6Payload mw_rtAdvWithOptions( - in template RtAdvOptions p_rtAdvOptions - ) := { - routerAdvMsg := { - icmpType := c_rtAdvMsg, - icmpCode := 0, - checksum := ?, - curHopLimit := ?, - managedConfigFlag := ?, - otherConfigFlag := ?, - homeAgentFlag := ?, - reserved := ?, - routerLifetime := ?, - reachableTime := ?, - retransTimer := ?, - rtAdvOptions := p_rtAdvOptions - } - } - - /** - * @desc Send template for IPv6 payload containing Router Advertisement - * @param p_rtAdvOptions Router Advertisement options - */ - template (value) Ipv6Payload m_octetstringPayload( - in template (value) octetstring p_payload - ) := { - octetstringMsg := p_payload - } - - /** - * @desc Receive template for IPv6 payload containing Router Advertisement - * @param p_rtAdvOptions Router Advertisement options - */ - template Ipv6Payload mw_octetstringPayload( - in template (present) octetstring p_payload - ) := { - octetstringMsg := p_payload - } - - /** - * @desc Send template for IPv6 Prefix option - * @param p_prefixLength Length of the prefix. - * @param p_lFlag Value for link flag. - * @param p_aFlag Value for autoconfiguration flag. - * @param p_validLifetime Value for valid life time duration. - * @param p_preferredLifetime Value for preffered life time duration. - * @param p_prefix Address prefix to be used - */ - template RtAdvOptions m_rtAdvOpt_prefixOpt ( - in template (value) UInt8 p_prefixLength, - in template (value) UInt1 p_lFlag, - in template (value) UInt1 p_aFlag, - in template (value) UInt32 p_validLifetime, - in template (value) UInt32 p_preferredLifetime, - in template (value) Ipv6Address p_prefix - ):={ - srcLinkLayerAddr := omit, - prefixInfoList := { - m_prefixInfo( - p_prefixLength, - p_lFlag, - p_aFlag, - p_validLifetime, - p_preferredLifetime, - p_prefix - ) - }, - otherOption := omit - } - - /** - * @desc Send template for IPv6 Prefix info - * @param p_prefixLength The length of the prefix - * @param p_lFlag Value for link flag. - * @param p_aFlag Value for autoconfiguration flag. - * @param p_validLifetime Value for valid life time duration. - * @param p_preferredLifetime Value for preferred life time duration. - * @param p_prefix Address prefix to be used - */ - template PrefixInfo m_prefixInfo ( - in template (value) UInt8 p_prefixLength, - in template (value) UInt1 p_lFlag, - in template (value) UInt1 p_aFlag, - in template (value) UInt32 p_validLifetime, - in template (value) UInt32 p_preferredLifetime, - in template (value) Ipv6Address p_prefix - ):= { - icmpType:= c_prefixInfo, - optionLength:= c_prefixInfoLen, - prefixLength:= p_prefixLength, - linkFlag:=p_lFlag, - autoConfigFlag:=p_aFlag, - rtAddrFlag := c_rtAddrFlag0, - reserved1:=0, - validLifetime:=p_validLifetime, - preferredLifetime:=p_preferredLifetime, - reserved2:=0, - prefix:= p_prefix - } - - } // end group ipv6 - - group gn6AcPrimitives { - - /** - * @desc TA primitive for querying link-layer interfaces information - */ - template (value) AcGn6Primitive m_acGetInterfaceInfos := { - getInterfaceInfos := 3 - } - - /** - * @desc TA primitive for retrieving link-layer interfaces information - */ - template AcGn6Response mw_acInterfaceInfos := { - interfaceInfoList := ? - } - } // end gn6AcPrimitives - + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; + + //LibIts + import from LibItsIpv6OverGeoNetworking_TestSystem all; + import from LibItsIpv6OverGeoNetworking_TypesAndValues all; + import from LibItsGeoNetworking_TypesAndValues all; + import from LibItsExternal_TypesAndValues {type MacAddress}; + + group ipv6OverGeoNwPrimitivesTemplates { + + /** + * @desc Send template for IPv6OverGeoNetworking packet (IPv6OverGeoNetworking Primitive) + * @param p_interface Which virtual interface to use for sending the packet + * @param p_srcMacAddr Link-layer source address + * @param p_dstMacAddr Link-layer destination address + * @param p_ipv6Packet IPv6 packet to be sent + */ + template (value) IPv6OverGeoNetworkingReq m_ipv6OverGeoNwReq( + template (value) charstring p_interface, + template (value) MacAddress p_srcMacAddr, + template (value) MacAddress p_dstMacAddr, + template (value) Ipv6Packet p_ipv6Packet + ) := { + interface := p_interface, + macSourceAddress := p_srcMacAddr, + macDestinationAddress := p_dstMacAddr, + ipv6Packet := p_ipv6Packet + } + + /** + * @desc Receive template for IPv6OverGeoNetworking packet (IPv6OverGeoNetworking Primitive) + * @param p_interface On which virtual interface the packet is expected + * @param p_srcMacAddr Link-layer source address + * @param p_dstMacAddr Link-layer destination address + * @param p_ipv6Packet Expected IPv6 packet + */ + template IPv6OverGeoNetworkingInd mw_ipv6OverGeoNwInd( + template (present) charstring p_interface, + template (present) MacAddress p_srcMacAddr, + template (present) MacAddress p_dstMacAddr, + template (present) Ipv6Packet p_ipv6Packet + ) := { + interface := p_interface, + macSourceAddress := p_srcMacAddr, + macDestinationAddress := p_dstMacAddr, + ipv6Packet := p_ipv6Packet + } + + } // ipv6OverGeoNwPrimitivesTemplates + + group ipv6 { + +// /** +// * @desc Send template for GN6 payload of type IPv6 +// * @param p_ipv6Packet IPv6 packet to be used as GN6 payload +// */ +// template (value) Payload m_ipv6Payload(in template (value) Ipv6Packet p_ipv6Packet) := { +// decodedPayload := {ipv6Packet := p_ipv6Packet}, +// rawPayload := ''O +// } +// +// /** +// * @desc Receive template for GN6 payload of type IPv6 +// * @param p_ipv6Packet Expected IPv6 packet to be received as GN6 payload +// */ +// template (present) Payload mw_ipv6Payload(in template (present) Ipv6Packet p_ipv6Packet) := { +// decodedPayload := {ipv6Packet := p_ipv6Packet}, +// rawPayload := ? +// } + + /** + * @desc Send template for IPv6 packet + * @param p_srcAddr IPv6 source address + * @param p_dstAddr IPv6 destination address + * @param p_nextHdr IPv6's next header + * @param p_payload IPv6 payload + */ + template (value) Ipv6Packet m_ipv6Packet( + in template (value) Ipv6Address p_srcAddr, + in template (value) Ipv6Address p_dstAddr, + in template (value) UInt8 p_nextHdr, + in template (omit) Ipv6Payload p_payload + ) := { + ipv6Hdr := m_ipv6Header(p_srcAddr, p_dstAddr, p_nextHdr), + extHdrList := omit, + ipv6Payload := p_payload + } + + /** + * @desc Reception template for IPv6 packet + * @param p_srcAddr IPv6 source address + * @param p_dstAddr IPv6 destination address + * @param p_nextHdr IPv6's next header + * @param p_payload IPv6 payload + */ + template Ipv6Packet mw_ipv6Packet( + in template (present) Ipv6Address p_srcAddr, + in template (present) Ipv6Address p_dstAddr, + in template (present) UInt8 p_nextHdr, + in template Ipv6Payload p_payload + ) := { + ipv6Hdr := mw_ipv6Header(p_srcAddr, p_dstAddr, p_nextHdr), + extHdrList := omit, + ipv6Payload := p_payload + } + + /** + * @desc Send template for IPv6 header + * @param p_srcAddr IPv6 source address + * @param p_dstAddr IPv6 destination address + * @param p_nextHdr IPv6's next header + */ + template (value) Ipv6Header m_ipv6Header( + in template (value) Ipv6Address p_srcAddr, + in template (value) Ipv6Address p_dstAddr, + in template (value) UInt8 p_nextHdr + ) := { + version := 6, + trafficClass := 0, + flowLabel := 0, + payloadLength := 0, //indicates that the adaptation will fill the correct value + nextHeader := p_nextHdr, + hopLimit := 255, + sourceAddress := p_srcAddr, + destinationAddress := p_dstAddr + } + + /** + * @desc Receive template for IPv6 header + * @param p_srcAddr IPv6 source address + * @param p_dstAddr IPv6 destination address + * @param p_nextHdr IPv6's next header + */ + template Ipv6Header mw_ipv6Header( + in template (present) Ipv6Address p_srcAddr, + in template (present) Ipv6Address p_dstAddr, + in template (present) UInt8 p_nextHdr + ) := { + version := 6, + trafficClass := ?, + flowLabel := ?, + payloadLength := ?, + nextHeader := p_nextHdr, + hopLimit := ?, + sourceAddress := p_srcAddr, + destinationAddress := p_dstAddr + } + + /** + * @desc Send template for IPv6 payload containing Router Advertisement + * @param p_rtAdvOptions Router Advertisement options + */ + template (value) Ipv6Payload m_rtAdvWithOptions( + in template (omit) RtAdvOptions p_rtAdvOptions + ) := { + routerAdvMsg := { + icmpType := c_rtAdvMsg, + icmpCode := 0, + checksum := c_2ZeroBytes, //indicates that the adaptation will fill the correct value + curHopLimit := 255, + managedConfigFlag := 0, + otherConfigFlag := 0, + homeAgentFlag := 0, + reserved := 0, + routerLifetime := c_uInt16Max, + reachableTime := c_uInt32Max, + retransTimer := 0, + rtAdvOptions := p_rtAdvOptions + } + } + + /** + * @desc Receive template for IPv6 payload containing Router Advertisement + * @param p_rtAdvOptions Router Advertisement options + */ + template Ipv6Payload mw_rtAdvWithOptions( + in template RtAdvOptions p_rtAdvOptions + ) := { + routerAdvMsg := { + icmpType := c_rtAdvMsg, + icmpCode := 0, + checksum := ?, + curHopLimit := ?, + managedConfigFlag := ?, + otherConfigFlag := ?, + homeAgentFlag := ?, + reserved := ?, + routerLifetime := ?, + reachableTime := ?, + retransTimer := ?, + rtAdvOptions := p_rtAdvOptions + } + } + + /** + * @desc Send template for IPv6 payload containing Router Advertisement + * @param p_rtAdvOptions Router Advertisement options + */ + template (value) Ipv6Payload m_octetstringPayload( + in template (value) octetstring p_payload + ) := { + octetstringMsg := p_payload + } + + /** + * @desc Receive template for IPv6 payload containing Router Advertisement + * @param p_rtAdvOptions Router Advertisement options + */ + template Ipv6Payload mw_octetstringPayload( + in template (present) octetstring p_payload + ) := { + octetstringMsg := p_payload + } + + /** + * @desc Send template for IPv6 Prefix option + * @param p_prefixLength Length of the prefix. + * @param p_lFlag Value for link flag. + * @param p_aFlag Value for autoconfiguration flag. + * @param p_validLifetime Value for valid life time duration. + * @param p_preferredLifetime Value for preffered life time duration. + * @param p_prefix Address prefix to be used + */ + template RtAdvOptions m_rtAdvOpt_prefixOpt ( + in template (value) UInt8 p_prefixLength, + in template (value) UInt1 p_lFlag, + in template (value) UInt1 p_aFlag, + in template (value) UInt32 p_validLifetime, + in template (value) UInt32 p_preferredLifetime, + in template (value) Ipv6Address p_prefix + ):={ + srcLinkLayerAddr := omit, + prefixInfoList := { + m_prefixInfo( + p_prefixLength, + p_lFlag, + p_aFlag, + p_validLifetime, + p_preferredLifetime, + p_prefix + ) + }, + otherOption := omit + } + + /** + * @desc Send template for IPv6 Prefix info + * @param p_prefixLength The length of the prefix + * @param p_lFlag Value for link flag. + * @param p_aFlag Value for autoconfiguration flag. + * @param p_validLifetime Value for valid life time duration. + * @param p_preferredLifetime Value for preferred life time duration. + * @param p_prefix Address prefix to be used + */ + template PrefixInfo m_prefixInfo ( + in template (value) UInt8 p_prefixLength, + in template (value) UInt1 p_lFlag, + in template (value) UInt1 p_aFlag, + in template (value) UInt32 p_validLifetime, + in template (value) UInt32 p_preferredLifetime, + in template (value) Ipv6Address p_prefix + ):= { + icmpType:= c_prefixInfo, + optionLength:= c_prefixInfoLen, + prefixLength:= p_prefixLength, + linkFlag:=p_lFlag, + autoConfigFlag:=p_aFlag, + rtAddrFlag := c_rtAddrFlag0, + reserved1:=0, + validLifetime:=p_validLifetime, + preferredLifetime:=p_preferredLifetime, + reserved2:=0, + prefix:= p_prefix + } + + } // end group ipv6 + + group gn6AcPrimitives { + + /** + * @desc TA primitive for querying link-layer interfaces information + */ + template (value) AcGn6Primitive m_acGetInterfaceInfos := { + getInterfaceInfos := 3 + } + + /** + * @desc TA primitive for retrieving link-layer interfaces information + */ + template AcGn6Response mw_acInterfaceInfos := { + interfaceInfoList := ? + } + } // end gn6AcPrimitives + } // end LibItsIpv6OverGeoNetworking_TypesAndValues \ No newline at end of file diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_EncdecDeclarations.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_EncdecDeclarations.ttcn index c2e0861c..7f8620ab 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_EncdecDeclarations.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_EncdecDeclarations.ttcn @@ -1,8 +1,8 @@ module LibItsMapemSpatem_EncdecDeclarations { // LibIts - import from MAPEM_PDU_Descriptions all; - import from SPATEM_PDU_Descriptions all; + import from MAPEM_PDU_Descriptions language "ASN.1:1997" all; + import from SPATEM_PDU_Descriptions language "ASN.1:1997" all; external function fx_enc_MAPEM (MAPEM pdu) return octetstring with {extension "prototype(convert) encode(BER:BER_ENCODE_CER)"} diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn index aa204ea2..bc975dda 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn @@ -234,7 +234,7 @@ module LibItsMapemSpatem_Templates { template (value) MAPEM m_mapemPdu( in template (value) MapData p_map ) := { - header := m_itsPduHeader( - , - ,ItsPduHeader_messageID_mapem_ ), + header := m_itsPduHeader( - , - ,LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_mapem_ ), map_ := p_map } @@ -256,7 +256,7 @@ module LibItsMapemSpatem_Templates { template (value) SPATEM m_spatemPdu( in template (value) SPAT p_spat ) := { - header := m_itsPduHeader( - , - , ItsPduHeader_messageID_spatem_ ), + header := m_itsPduHeader( - , - , LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_spatem_ ), spat := p_spat } @@ -283,7 +283,7 @@ module LibItsMapemSpatem_Templates { */ template (value) ItsPduHeader m_itsPduHeader( in template (value) StationID p_stationID := f_getTsStationId(), - in template (value) ItsPduHeader.protocolVersion p_protocolVersion := ItsPduHeader_protocolVersion_currentVersion_, + in template (value) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, in template (value) ItsPduHeader.messageID p_messageID ) := { protocolVersion := p_protocolVersion, @@ -299,7 +299,7 @@ module LibItsMapemSpatem_Templates { */ template ItsPduHeader mw_itsPduHeader( template (present) StationID p_stationID := ?, - template (present) ItsPduHeader.protocolVersion p_protocolVersion := ItsPduHeader_protocolVersion_currentVersion_, + template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, template (present) ItsPduHeader.messageID p_messageID := ? ) := { protocolVersion := p_protocolVersion, @@ -315,8 +315,8 @@ module LibItsMapemSpatem_Templates { */ template ItsPduHeader mw_itsPduHeaderMapem( template (present) StationID p_stationID := ?, - template (present) ItsPduHeader.protocolVersion p_protocolVersion := ItsPduHeader_protocolVersion_currentVersion_, - template (present) ItsPduHeader.messageID p_messageID := ItsPduHeader_messageID_mapem_ + template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, + template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_mapem_ ) := { protocolVersion := p_protocolVersion, messageID := p_messageID, @@ -331,8 +331,8 @@ module LibItsMapemSpatem_Templates { */ template ItsPduHeader mw_itsPduHeaderSpatem( template (present) StationID p_stationID := ?, - template (present) ItsPduHeader.protocolVersion p_protocolVersion := ItsPduHeader_protocolVersion_currentVersion_, - template (present) ItsPduHeader.messageID p_messageID := ItsPduHeader_messageID_spatem_ + template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, + template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_spatem_ ) := { protocolVersion := p_protocolVersion, messageID := p_messageID, @@ -589,7 +589,8 @@ module LibItsMapemSpatem_Templates { id := m_intersectionReferenceID, // A globally unique value set, consisting of a regionID and // intersection ID assignment provides a unique mapping to the intersection MAP in question which provides complete location and approach/move/lane data revision := PX_INTERSECTIONSTATE_REVISION, - status := IntersectionStatusObject_manualControlIsEnabled_, // General status of the controller(s) + status := LibItsCommon_ASN1_ISDSRC_NamedNumbers.IntersectionStatusObject_manualControlIsEnabled_, + // General status of the controller(s) moy := omit, // Minute of current UTC year used only with messages to be archived timeStamp := omit, // The mSec point in the current UTC minute that this message was constructed enabledLanes := { 1, 2 }, // A list of lanes where the RevocableLane bit has been set which are now active andtherefore part of the current intersection diff --git a/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn b/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn index 97081288..ca76d9aa 100644 --- a/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn +++ b/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn @@ -1,31 +1,60 @@ module LibItsSecurity_EncdecDeclarations { + // LibIts + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + import from IEEE1609dot2 language "ASN.1:1997" all; + import from EtsiTs103097Module language "ASN.1:1997" all; + import from LibItsSecurity_TypesAndValues all; + /** + * @desc Encoding function for EtsiTs103097Certificate certificate + * @return The encode message in OER format + */ + external function fx_enc_CertificateBase(in IEEE1609dot2.CertificateBase p) return bitstring + with {extension "prototype(convert) encode(PER)"} + + + + + + + + + + + + + + + + + + //encoding functions - external function fx_enc_SecuredMessage (SecuredMessage p) return bitstring + external function fx_enc_SecuredMessage (LibItsSecurity_TypesAndValues.SecuredMessage p) return bitstring with {extension "prototype(convert) encode(LibItsSecurity)"} - external function fx_enc_ToBeSignedSecuredMessage (ToBeSignedSecuredMessage p) return bitstring + external function fx_enc_ToBeSignedSecuredMessage (LibItsSecurity_TypesAndValues.ToBeSignedSecuredMessage p) return bitstring with {extension "prototype(convert) encode(LibItsSecurity)"} - external function fx_enc_Certificate (Certificate p) return bitstring + external function fx_enc_Certificate (LibItsSecurity_TypesAndValues.Certificate p) return bitstring with {extension "prototype(convert) encode(LibItsSecurity)"} - external function fx_enc_ToBeSignedCertificate (ToBeSignedCertificate p) return bitstring + external function fx_enc_ToBeSignedCertificate (LibItsSecurity_TypesAndValues.ToBeSignedCertificate p) return bitstring with {extension "prototype(convert) encode(LibItsSecurity)"} - /* + //decoding functions - external function fx_dec_SecuredMessage (inout bitstring b, out SecuredMessage p) return integer + external function fx_dec_SecuredMessage (inout bitstring b, out LibItsSecurity_TypesAndValues.SecuredMessage p) return integer with {extension "prototype(sliding) decode(LibItsSecurity)"} - external function fx_dec_ToBeSignedSecuredMessage (inout bitstring b, out ToBeSignedSecuredMessage p) return integer + external function fx_dec_ToBeSignedSecuredMessage (inout bitstring b, out LibItsSecurity_TypesAndValues.ToBeSignedSecuredMessage p) return integer with {extension "prototype(sliding) decode(LibItsSecurity)"} - */ - external function fx_dec_Certificate (inout bitstring b, out Certificate p) return integer + + external function fx_dec_Certificate (inout bitstring b, out LibItsSecurity_TypesAndValues.Certificate p) return integer with {extension "prototype(sliding) decode(LibItsSecurity)"} - /* - external function fx_dec_ToBeSignedCertificate (inout bitstring b, out ToBeSignedCertificate p) return integer + + external function fx_dec_ToBeSignedCertificate (inout bitstring b, out LibItsSecurity_TypesAndValues.ToBeSignedCertificate p) return integer with {extension "prototype(sliding) decode(LibItsSecurity)"} - */ + } // End of module LibItsSecurity_EncdecDeclarations diff --git a/ttcn/SremSsem/LibItsSremSsem_EncdecDeclarations.ttcn b/ttcn/SremSsem/LibItsSremSsem_EncdecDeclarations.ttcn index bc906abf..010bf24f 100644 --- a/ttcn/SremSsem/LibItsSremSsem_EncdecDeclarations.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_EncdecDeclarations.ttcn @@ -1,6 +1,6 @@ module LibItsSremSsem_EncdecDeclarations { -import from DSRC all; +import from DSRC language "ASN.1:1997" all; external function fx_enc_SSM (SignalStatusMessage p) return octetstring with {extension "prototype(convert) encode(BER:BER_ENCODE_CER)"} diff --git a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn index c6892bd4..fad8e875 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn @@ -246,7 +246,7 @@ module LibItsSremSsem_Templates { template (value) SREM m_sremPdu( in template (value) SignalRequestMessage p_srm ) := { - header := m_itsPduHeader( - , - ,ItsPduHeader_messageID_srem_ ), + header := m_itsPduHeader( - , - ,LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_srem_ ), srm := p_srm } @@ -268,7 +268,7 @@ module LibItsSremSsem_Templates { template (value) SSEM m_ssemPdu( in template (value) SignalStatusMessage p_ssm ) := { - header := m_itsPduHeader( - , - , ItsPduHeader_messageID_ssem_), + header := m_itsPduHeader( - , - , LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_ssem_), ssm := p_ssm } @@ -295,7 +295,7 @@ module LibItsSremSsem_Templates { */ template (value) ItsPduHeader m_itsPduHeader( in template (value) StationID p_stationID := f_getTsStationId(), - in template (value) ItsPduHeader.protocolVersion p_protocolVersion := ItsPduHeader_protocolVersion_currentVersion_, + in template (value) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, in template (value) ItsPduHeader.messageID p_messageID ) := { protocolVersion := p_protocolVersion, @@ -311,7 +311,7 @@ module LibItsSremSsem_Templates { */ template ItsPduHeader mw_itsPduHeader( template (present) StationID p_stationID := ?, - template (present) ItsPduHeader.protocolVersion p_protocolVersion := ItsPduHeader_protocolVersion_currentVersion_, + template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, template (present) ItsPduHeader.messageID p_messageID := ? ) := { protocolVersion := p_protocolVersion, @@ -327,8 +327,8 @@ module LibItsSremSsem_Templates { */ template ItsPduHeader mw_itsPduHeaderSrem( template (present) StationID p_stationID := ?, - template (present) ItsPduHeader.protocolVersion p_protocolVersion := ItsPduHeader_protocolVersion_currentVersion_, - template (present) ItsPduHeader.messageID p_messageID := ItsPduHeader_messageID_srem_ + template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, + template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_srem_ ) := { protocolVersion := p_protocolVersion, messageID := p_messageID, @@ -343,8 +343,8 @@ module LibItsSremSsem_Templates { */ template ItsPduHeader mw_itsPduHeaderSsem( template (present) StationID p_stationID := ?, - template (present) ItsPduHeader.protocolVersion p_protocolVersion := ItsPduHeader_protocolVersion_currentVersion_, - template (present) ItsPduHeader.messageID p_messageID := ItsPduHeader_messageID_ssem_ + template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, + template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_ssem_ ) := { protocolVersion := p_protocolVersion, messageID := p_messageID, -- GitLab From 09bd3c2e056e88e143221462f14ec8719d344617 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 30 Nov 2017 14:53:06 +0000 Subject: [PATCH 043/320] Add Service Advertisement support --- .../LibItsGeoNetworking_Templates.ttcn | 156 ++++++++++++++++++ 1 file changed, 156 insertions(+) diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn index 497b8ddc..4a396d20 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn @@ -1329,6 +1329,86 @@ module LibItsGeoNetworking_Templates { } // end group geoNwPacketTsbTemplates + group geoNwPacketSaTemplates { + + /** + * @desc Send template for GeoNetworking SA Packet + * @param p_seqNumber Sequence number of SA packet + * @param p_sourceLongPosVec Long position vector of source + * @param p_hopLimit The maximum number of hops (Default: c_defaultHopLimit) + */ + template (value) GnNonSecuredPacket m_geoNwSaPacket( + in template (value) UInt16 p_seqNumber, + in template (value) LongPosVector p_sourceLongPosVec, + in template (value) UInt8 p_hopLimit := c_defaultHopLimit, + in template (value) TrafficClass p_trafficClass := m_trafficClass + ) := { + commonHeader := valueof(m_commonHeader( + PX_GN_UPPER_LAYER, + m_saHeaderType_sa, + p_trafficClass, + p_hopLimit + )), + extendedHeader := valueof(m_tsbHeader( + p_seqNumber, + p_sourceLongPosVec + )), + payload := '00100011010203CAFEDECA'O + } + + /** + * @desc Receive template for GeoNetworking SA Packet + * @param p_seqNumber Sequence number of SA packet (Default: ?) + * @param p_sourceLongPosVec Long position vector of source (Default: ?) + */ + template (present) GnNonSecuredPacket mw_geoNwSaPacket( + in template (present) UInt16 p_seqNumber := ?, + in template (present) LongPosVector p_sourceLongPosVec := ? + ) := { + commonHeader := mw_commonHeader( + PX_GN_UPPER_LAYER, + m_saHeaderType_sa + ), + extendedHeader := mw_saHeader(p_seqNumber, p_sourceLongPosVec), + payload := ? + } + + /** + * @desc Receive template for GeoNetworking SA Packet + * @param p_seqNumber Sequence number of SA packet (Default: ?) + * @param p_sourceLongPosVec Long position vector of source (Default: ?) + * @param p_hopLimit The maximum number of hops (Default: ?) + */ + template (present) GnNonSecuredPacket mw_geoNwSaPacketWithHl( + in template (present) UInt16 p_seqNumber := ?, + in template (present) LongPosVector p_sourceLongPosVec := ?, + in template (present) UInt8 p_hopLimit := ? + ) modifies mw_geoNwSaPacket := { + commonHeader := mw_commonHeaderWithHopLimit( + PX_GN_UPPER_LAYER, + m_saHeaderType_sa, + p_hopLimit + ) + } + + /** + * @desc Receive template for GeoNetworking SA Packet + * @param p_seqNumber Sequence number of SA packet (Default: ?) + * @param p_sourceLongPosVec Long position vector of source (Default: ?) + * @param p_nextHeader Id of next header + */ + template (present) GnNonSecuredPacket mw_geoNwSaPacketWithNextHeader( + in template (present) UInt16 p_seqNumber := ?, + in template (present) LongPosVector p_sourceLongPosVec := ?, + in template (value) NextHeader p_nextHeader + ) modifies mw_geoNwSaPacket := { + commonHeader := { + nextHeader := p_nextHeader + } + } + + } // end group geoNwPacketSaTemplates + } // end group geoNwPacketTemplates group geoNwHeadersTemplates { @@ -2220,6 +2300,82 @@ module LibItsGeoNetworking_Templates { } // end tsbHeaderTemplates + group saHeaderTemplates { + + /** + * @desc Send template for SA header + * @param p_seqNumber Sequence number of TSB packet + * @param p_srcPosVector Long position vector of source + */ + template ExtendedHeader m_saHeader( + in template (value) UInt16 p_seqNumber, + in template (value) LongPosVector p_srcPosVector + ) := { + tsbHeader := { + seqNumber := p_seqNumber, + reserved := c_uInt8Zero, + srcPosVector := p_srcPosVector + } + } + + /** + * @desc Receive template for TSB header + * @param p_seqNumber Sequence number of TSB packet + * @param p_sourceLongPosVec Long position vector of source + */ + template (present) ExtendedHeader mw_saHeader( + in template (present) UInt16 p_seqNumber, + in template (present) LongPosVector p_sourceLongPosVec + ) := { + tsbHeader := { + seqNumber := p_seqNumber, + reserved := ?, + srcPosVector := p_sourceLongPosVec + } + } + + /** + * @desc Send template for SA header type + */ + template (value) HeaderTST m_saHeaderType_sa := { + saHdr := { + headerType := e_serviceAnnouncement, + headerSubType := e_sa + } + } + + /** + * @desc Receive template for SA header type + */ + template (present) HeaderTST mw_saHeaderType_sa := { + saHdr := { + headerType := e_serviceAnnouncement, + headerSubType := e_sa + } + } + + /** + * @desc Send template for SA header type + */ + template (value) HeaderTST m_saHeaderType_eos := { + saHdr := { + headerType := e_serviceAnnouncement, + headerSubType := e_saEos + } + } + + /** + * @desc Receive template for SA header type + */ + template (present) HeaderTST mw_saHeaderType_eos := { + saHdr := { + headerType := e_serviceAnnouncement, + headerSubType := e_saEos + } + } + + } // end saHeaderTemplates + } // end geoNwHeadersTemplates group geoMiscTemplates { -- GitLab From 6424f714ce3167a350ee66ad014ef4189b290b86 Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 1 Dec 2017 08:26:33 +0000 Subject: [PATCH 044/320] Start Security support --- ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn | 10 +++++++++- ttcn/Security/LibItsSecurity_Pixits.ttcn | 5 +++++ ttcn/Security/LibItsSecurity_Templates.ttcn | 5 +++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn b/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn index ca76d9aa..efe10718 100644 --- a/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn +++ b/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn @@ -9,11 +9,19 @@ module LibItsSecurity_EncdecDeclarations { /** * @desc Encoding function for EtsiTs103097Certificate certificate + * @param p The certificate to encode * @return The encode message in OER format */ external function fx_enc_CertificateBase(in IEEE1609dot2.CertificateBase p) return bitstring with {extension "prototype(convert) encode(PER)"} + /** + * @desc Encoding function for IEEE1609dot2.ToBeSignedCertificate + * @param p The ToBeSign part of the certificate + * @return The encode message in OER format + */ + external function fx_enc_ToBeSignedCertificate(in IEEE1609dot2.ToBeSignedCertificate p) return bitstring + with {extension "prototype(convert) encode(PER)"} @@ -41,7 +49,7 @@ module LibItsSecurity_EncdecDeclarations { external function fx_enc_Certificate (LibItsSecurity_TypesAndValues.Certificate p) return bitstring with {extension "prototype(convert) encode(LibItsSecurity)"} - external function fx_enc_ToBeSignedCertificate (LibItsSecurity_TypesAndValues.ToBeSignedCertificate p) return bitstring + external function fx_enc_ToBeSignedCertificate_ (LibItsSecurity_TypesAndValues.ToBeSignedCertificate p) return bitstring with {extension "prototype(convert) encode(LibItsSecurity)"} //decoding functions diff --git a/ttcn/Security/LibItsSecurity_Pixits.ttcn b/ttcn/Security/LibItsSecurity_Pixits.ttcn index e630e30d..9eada6da 100644 --- a/ttcn/Security/LibItsSecurity_Pixits.ttcn +++ b/ttcn/Security/LibItsSecurity_Pixits.ttcn @@ -15,6 +15,11 @@ module LibItsSecurity_Pixits { import from LibCommon_BasicTypesAndValues all; import from LibCommon_DataStrings all; + // LibIts + //import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + //import from IEEE1609dot2 language "ASN.1:1997" all; + //import from EtsiTs103097Module language "ASN.1:1997" all; + // LibItsSecurity import from LibItsSecurity_TypesAndValues all; diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index fad5870d..81aa6b03 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -20,6 +20,11 @@ module LibItsSecurity_Templates { // LibItsGeoNetworking import from LibItsGeoNetworking_TypesAndValues all; + // LibIts + //import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + //import from IEEE1609dot2 language "ASN.1:1997" all; + //import from EtsiTs103097Module language "ASN.1:1997" all; + // LibItsSecurity import from LibItsSecurity_TypesAndValues all; import from LibItsSecurity_Pixits all; -- GitLab From 53ee51782f53b43906ad7088c27c05dee5eba8f5 Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 4 Dec 2017 09:51:58 +0000 Subject: [PATCH 045/320] Cleanup Security templates & Types --- .../LibItsGeoNetworking_Functions.ttcn | 125 +- .../LibItsGeoNetworking_Templates.ttcn | 7 +- .../LibItsGeoNetworking_TypesAndValues.ttcn | 9 +- .../LibItsSecurity_EncdecDeclarations.ttcn | 14 +- ttcn/Security/LibItsSecurity_Functions.ttcn | 747 ++-- ttcn/Security/LibItsSecurity_Pixits.ttcn | 14 +- ttcn/Security/LibItsSecurity_Templates.ttcn | 3272 ++++++----------- ttcn/Security/LibItsSecurity_TestSystem.ttcn | 5 + .../LibItsSecurity_TypesAndValues.ttcn | 855 +---- 9 files changed, 1583 insertions(+), 3465 deletions(-) diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn index ed1ee439..36b03b86 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn @@ -14,10 +14,15 @@ module LibItsGeoNetworking_Functions { // Libcommon import from LibCommon_BasicTypesAndValues all; import from LibCommon_DataStrings all; - import from LibCommon_VerdictControl {type FncRetCode;} + import from LibCommon_VerdictControl all; import from LibCommon_Sync all; import from LibCommon_Time all; + // LibIts + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + import from IEEE1609dot2 language "ASN.1:1997" all; + import from EtsiTs103097Module language "ASN.1:1997" all; + // LibItsCommon import from LibItsCommon_TypesAndValues all; import from LibItsExternal_TypesAndValues all; @@ -1225,16 +1230,16 @@ module LibItsGeoNetworking_Functions { ) { repeat; } - [vc_gnDefaultActive] geoNetworkingPort.receive( + /* FIXME To be reviewed [vc_gnDefaultActive] geoNetworkingPort.receive( mw_geoNwInd( mw_geoNwSecPdu( - mdw_securedMessage_CAMs, + mw_securedMessage_CAMs, ? ))) { // Skip CAM messages log("*** a_default: WARNING: Skip secured CAM messages ***"); repeat; - } + }*/ [vc_gnDefaultActive] geoNetworkingPort.receive { log("*** a_default: WARNING: Received an unexpected message ***"); repeat; @@ -2538,9 +2543,9 @@ module LibItsGeoNetworking_Functions { * @param p_InSecMsg SecurityMessage template * @param p_received returns received SecurityMessage */ - altstep a_securedMessage ( - in template (present) SecuredMessage p_InSecMsg, - out SecuredMessage p_received + /* FIXME To be reviewed altstep a_securedMessage ( + in template (present) EtsiTs103097Data p_InSecMsg, + out EtsiTs103097Data p_received ) runs on ItsGeoNetworking { var GeoNetworkingInd v_geoNw; [] geoNetworkingPort.receive(mw_geoNwInd( @@ -2552,33 +2557,33 @@ module LibItsGeoNetworking_Functions { ))) -> value v_geoNw { p_received := f_getSecuredMessage(v_geoNw.msgIn); } - } + }*/ /** * @desc Receive GN message with security containing certificate as a signer info * @param p_cert returns the certificate used for sign received message */ - altstep a_securedMessageWithCertificate( - out SecuredMessage p_received + /* FIXME To be reviewed altstep a_securedMessageWithCertificate( + out EtsiTs103097Data p_received ) runs on ItsGeoNetworking { [] a_securedMessage ( - mdw_securedMessage (superset(mw_header_field_signer_info_certificate)), + mw_securedMessage (superset(mw_header_field_signer_info_certificate)), p_received ) { // Nothing to do } - } // End of altstep a_securedMessageWithCertificate + }*/ // End of altstep a_securedMessageWithCertificate /** * @desc Receive GN message with security containing certificate chain as a signer info * @param p_cert returns the certificate used for sign received message */ - altstep a_securedMessageWithCertificateChain( - out SecuredMessage p_received + /* FIXME To be reviewed altstep a_securedMessageWithCertificateChain( + out EtsiTs103097Data p_received ) runs on ItsGeoNetworking { [] a_securedMessage ( - mdw_securedMessage( + mw_securedMessage( superset( mw_header_field_signer_info_certificate_chain )), @@ -2586,17 +2591,17 @@ module LibItsGeoNetworking_Functions { ) { // Nothing to do } - } // End of altstep a_securedMessageWithCertificateChain + }*/ // End of altstep a_securedMessageWithCertificateChain /** * @desc Receive GN message with security containing digest as a signer info * @param p_cert returns the certificate used for sign received message */ - altstep a_securedMessageWithDigest( - out SecuredMessage p_received + /* FIXME To be reviewed altstep a_securedMessageWithDigest( + out EtsiTs103097Data p_received ) runs on ItsGeoNetworking { [] a_securedMessage ( - mdw_securedMessage ( + mw_securedMessage ( superset( mw_header_field_signer_info_digest )), @@ -2604,7 +2609,7 @@ module LibItsGeoNetworking_Functions { ) { // Nothing to do } - } // End of altstep a_securedMessageWithDigest + }*/ // End of altstep a_securedMessageWithDigest } // End of group altSteps @@ -2615,14 +2620,14 @@ module LibItsGeoNetworking_Functions { * @return the certificate used for sign received message */ function f_waitForCertificate( - out Certificate p_cert + out EtsiTs103097Certificate p_cert ) runs on ItsGeoNetworking return boolean { - var SecuredMessage v_recv; + var EtsiTs103097Data v_recv; var boolean v_ret := false; - alt { + /* FIXME To be reviewed alt { [] a_securedMessageWithCertificate(v_recv) { - var SignerInfo v_si; + var SignerIdentifier v_si; if (f_getMsgSignerInfo(v_recv, v_si) == true) { if (ischosen(v_si.signerInfo.certificate)) { @@ -2631,7 +2636,7 @@ module LibItsGeoNetworking_Functions { } } } - } // End of 'alt' statement + }*/ // End of 'alt' statement return v_ret; } // End of function f_waitForCertificate @@ -2640,21 +2645,21 @@ module LibItsGeoNetworking_Functions { * @desc Wait for GN message with security containing certificate chain as a signer info * @return the certificate used for sign received message */ - function f_waitForCertificateChain (out CertificateChain p_chain) + function f_waitForCertificateChain (out SequenceOfCertificate p_chain) runs on ItsGeoNetworking return boolean { - var SecuredMessage v_recv; + var EtsiTs103097Data v_recv; var boolean v_ret := false; - alt { + /* FIXME To be reviewed alt { [] a_securedMessageWithCertificateChain(v_recv) { - var SignerInfo v_si; + var SignerIdentifier v_si; if(f_getMsgSignerInfo(v_recv, v_si)) { p_chain := v_si.signerInfo.certificates; v_ret := true; } } - } + }*/ return v_ret; } @@ -2665,10 +2670,10 @@ module LibItsGeoNetworking_Functions { function f_askForCertificateChain (in template(value) octetstring p_CamPayload) runs on ItsGeoNetworking return boolean { - var SecuredMessage v_recv; - var SignerInfo v_si; + var EtsiTs103097Data v_recv; + var SignerIdentifier v_si; var boolean v_ret := false; - alt { + /* FIXME To be reviewed alt { [] a_securedMessageWithCertificate(v_recv) { if(f_getMsgSignerInfo(v_recv, v_si)) { if(f_getCertificateSignerInfo(v_si.signerInfo.certificate, v_si)) { @@ -2682,7 +2687,7 @@ module LibItsGeoNetworking_Functions { } } } - } + }*/ return v_ret; } /** @@ -2690,15 +2695,15 @@ module LibItsGeoNetworking_Functions { * @return the certificate chain used for sign received message */ function f_askAndWaitForCertificateChain( - out CertificateChain p_chain, + out SequenceOfCertificate p_chain, in template(value) octetstring p_CamPayload ) runs on ItsGeoNetworking return boolean { // Local variables - var SecuredMessage v_recv; - var SignerInfo v_si; + var EtsiTs103097Data v_recv; + var SignerIdentifier v_si; var boolean v_ret := false; - alt { + /* FIXME To be reviewed alt { [] a_securedMessageWithCertificate(v_recv) { tc_ac.stop; if(f_getMsgSignerInfo(v_recv, v_si)) { @@ -2718,7 +2723,7 @@ module LibItsGeoNetworking_Functions { v_ret := true; } } - } // End of 'alt' statement + }*/ // End of 'alt' statement return v_ret; } // End of function f_askAndWaitForCertificateChain @@ -2731,18 +2736,18 @@ module LibItsGeoNetworking_Functions { out HashedId8 p_digest ) runs on ItsGeoNetworking return boolean { // Local variables - var SecuredMessage v_recv; + var EtsiTs103097Data v_recv; var boolean v_ret := false; - alt { + /* FIXME To be reviewed alt { [] a_securedMessageWithDigest(v_recv) { - var SignerInfo v_si; + var SignerIdentifier v_si; if(f_getMsgSignerInfo(v_recv, v_si)) { p_digest := v_si.signerInfo.digest; v_ret := true; } } - } // End of 'alt' statement + }*/ // End of 'alt' statement return v_ret; } // End of function f_waitForDigest @@ -2759,12 +2764,12 @@ module LibItsGeoNetworking_Functions { in template(value) octetstring p_CamPayload ) runs on ItsGeoNetworking return boolean { // Local variables - var SecuredMessage v_recv; + var EtsiTs103097Data v_recv; f_sendCertificate(p_certificate, p_CamPayload); - alt { + /* FIXME To be reviewed alt { [] a_securedMessage ( - mdw_securedMessage( + mw_securedMessage( superset( mw_header_field_unrecognised_certificate )), @@ -2773,7 +2778,7 @@ module LibItsGeoNetworking_Functions { // Nothing to do log("*** " & testcasename() & ": DEBUG: Receive certificate ***") } - } // End of 'alt' statement + }*/ // End of 'alt' statement return true; } // End of function f_sendCertificateAndWaitForCertificateChainRequest @@ -2788,17 +2793,17 @@ module LibItsGeoNetworking_Functions { ) runs on ItsGeoNetworking { var GeoNetworkingReq v_gnReq; var GnNonSecuredPacket v_gnNonSecuredPacket; - var template (value) ToBeSignedSecuredMessage v_toBeSignedSecuredMessage; - var template (value) SecuredMessage v_securedMessage; + var template (value) ToBeSignedData v_toBeSignedData; + var template (value) EtsiTs103097Data v_securedMessage; - // Build signed SecuredMessage + // Build signed EtsiTs103097Data v_gnNonSecuredPacket := valueof(m_geoNwShbPacket( f_getPosition(c_compNodeC) // FIXME To be verified YANN )); // Add CAM payload v_gnNonSecuredPacket.payload := valueof(p_payload); - f_buildGnSecuredCam( + /* FIXME To be reviewed f_buildGnSecuredCam( v_securedMessage, m_payload_signed(bit2oct(encvalue(v_gnNonSecuredPacket))), e_certificate, @@ -2820,7 +2825,7 @@ module LibItsGeoNetworking_Functions { )); // End of template m_geoNwReq_linkLayerBroadcast // Send Message - f_sendGeoNetMessage(v_gnReq); + f_sendGeoNetMessage(v_gnReq);*/ } // End of function f_sendCertificateRequest @@ -2838,11 +2843,11 @@ module LibItsGeoNetworking_Functions { ) runs on ItsGeoNetworking { var GeoNetworkingReq v_gnReq; var GnNonSecuredPacket v_gnNonSecuredPacket; - var template (value) ToBeSignedSecuredMessage v_toBeSignedSecuredMessage; - var template (value) SecuredMessage v_securedMessage; + var template (value) ToBeSignedData v_toBeSignedData; + var template (value) EtsiTs103097Data v_securedMessage; - // Build signed SecuredMessage - v_gnNonSecuredPacket := valueof(m_geoNwShbPacket( + // Build signed EtsiTs103097Data + /* FIXME To be reviewed v_gnNonSecuredPacket := valueof(m_geoNwShbPacket( f_getPosition(c_compNodeC) // FIXME To be verified YANN )); // Add CAM payload @@ -2865,7 +2870,7 @@ module LibItsGeoNetworking_Functions { )); // End of template m_geoNwReq_linkLayerBroadcast // Send Message - f_sendGeoNetMessage(v_gnReq); + f_sendGeoNetMessage(v_gnReq);*/ } // End of function f_sendCertificate @@ -2874,12 +2879,12 @@ module LibItsGeoNetworking_Functions { group messageGetters { /** - * @desc return SecuredMessage field of GeoNetworking packet + * @desc return EtsiTs103097Data field of GeoNetworking packet * @param p_msg GeoNetworking packet - * @return the SecuredMessage if any + * @return the EtsiTs103097Data if any */ function f_getSecuredMessage(in GeoNetworkingPdu p_msg) - return SecuredMessage { + return EtsiTs103097Data { return p_msg.gnPacket.securedMsg; } diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn index 4a396d20..fc0233fe 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn @@ -15,6 +15,9 @@ module LibItsGeoNetworking_Templates { import from LibCommon_BasicTypesAndValues all; import from LibCommon_DataStrings all; + // LibIts + import from EtsiTs103097Module language "ASN.1:1997" all; + // LibItsCommon import from LibItsCommon_TypesAndValues all; import from LibItsExternal_TypesAndValues all; @@ -500,7 +503,7 @@ module LibItsGeoNetworking_Templates { * @param p_packet Clear-text version of the packet */ template (present) GeoNetworkingPdu mw_geoNwSecPdu( - in template (present) SecuredMessage p_secMsg, + in template (present) EtsiTs103097Data p_secMsg, in template (present) GnNonSecuredPacket p_packet := ? ) := { basicHeader := mw_securedBasicHeader(), @@ -517,7 +520,7 @@ module LibItsGeoNetworking_Templates { */ template (value) GeoNetworkingPdu m_geoNwSecPdu( in template (value) GnNonSecuredPacket p_packet, - in template (value) SecuredMessage p_secMsg + in template (value) EtsiTs103097Data p_secMsg ) := { basicHeader := m_securedBasicHeader(), gnPacket := { diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn index c3032664..46e5de14 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn @@ -16,12 +16,7 @@ module LibItsGeoNetworking_TypesAndValues { import from LibCommon_DataStrings all; // LibIts - // import from LibItsCommon_TypesAndValues all; - //import from LibItsBtp_TypesAndValues {type BtpPacket;} - //import from LibItsIpv6OverGeoNetworking_TypesAndValues {type Ipv6Packet;} - - // LibItsSecurity - import from LibItsSecurity_TypesAndValues all; + import from EtsiTs103097Module language "ASN.1:1997" all; group geoConfigurationValues { @@ -190,7 +185,7 @@ module LibItsGeoNetworking_TypesAndValues { type record GeoNetworkingPacket { GnNonSecuredPacket packet, - SecuredMessage securedMsg optional + EtsiTs103097Data securedMsg optional } with { encode (securedMsg) "LibItsSecurity" } diff --git a/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn b/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn index efe10718..9107023f 100644 --- a/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn +++ b/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn @@ -15,6 +15,8 @@ module LibItsSecurity_EncdecDeclarations { external function fx_enc_CertificateBase(in IEEE1609dot2.CertificateBase p) return bitstring with {extension "prototype(convert) encode(PER)"} + external function fx_dec_CertificateBase(inout bitstring b, out IEEE1609dot2.CertificateBase p) return integer + with {extension "prototype(sliding) decode(PER)"} /** * @desc Encoding function for IEEE1609dot2.ToBeSignedCertificate * @param p The ToBeSign part of the certificate @@ -23,6 +25,14 @@ module LibItsSecurity_EncdecDeclarations { external function fx_enc_ToBeSignedCertificate(in IEEE1609dot2.ToBeSignedCertificate p) return bitstring with {extension "prototype(convert) encode(PER)"} + /** + * @desc Encoding function for IEEE1609dot2.Ieee1609Dot2Data + * @param p The Ieee1609Dot2Data part of the certificate + * @return The encode message in OER format + */ + external function fx_enc_Ieee1609Dot2Data(in IEEE1609dot2.Ieee1609Dot2Data p) return bitstring + with {extension "prototype(convert) encode(PER)"} + @@ -40,7 +50,7 @@ module LibItsSecurity_EncdecDeclarations { //encoding functions - external function fx_enc_SecuredMessage (LibItsSecurity_TypesAndValues.SecuredMessage p) return bitstring +/* external function fx_enc_SecuredMessage (LibItsSecurity_TypesAndValues.SecuredMessage p) return bitstring with {extension "prototype(convert) encode(LibItsSecurity)"} external function fx_enc_ToBeSignedSecuredMessage (LibItsSecurity_TypesAndValues.ToBeSignedSecuredMessage p) return bitstring @@ -63,6 +73,6 @@ module LibItsSecurity_EncdecDeclarations { with {extension "prototype(sliding) decode(LibItsSecurity)"} external function fx_dec_ToBeSignedCertificate (inout bitstring b, out LibItsSecurity_TypesAndValues.ToBeSignedCertificate p) return integer - with {extension "prototype(sliding) decode(LibItsSecurity)"} + with {extension "prototype(sliding) decode(LibItsSecurity)"}*/ } // End of module LibItsSecurity_EncdecDeclarations diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index c5dbc605..fda7fcb4 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -15,6 +15,11 @@ module LibItsSecurity_Functions { import from LibCommon_BasicTypesAndValues all; import from LibCommon_DataStrings all; + // LibIts + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + import from IEEE1609dot2 language "ASN.1:1997" all; + import from EtsiTs103097Module language "ASN.1:1997" all; + // LibItsCommon import from LibItsCommon_Functions all; import from LibItsCommon_TypesAndValues all; @@ -24,8 +29,6 @@ module LibItsSecurity_Functions { import from LibItsSecurity_Templates all; import from LibItsSecurity_Pixits all; import from LibItsSecurity_TestSystem all; -//FIXME(DF) UNUSED -// import from LibItsSecurity_EncdecDeclarations all; group helpersFunctions { @@ -106,6 +109,22 @@ module LibItsSecurity_Functions { p_ecdsaNistp256PublicKeyY); } // End of function f_verifyWithEcdsaNistp256WithSha256 + /** + * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. + * This function should not be used by the ATS + * @param p_privateKey The new private key value + * @param p_publicKeyX The new public key value (x coordinate) + * @param p_publicKeyX The new public key value (y coordinate) + * @return true on success, false otherwise + */ + function f_generate_key_pair( + out octetstring p_privateKey, + out octetstring p_publicKeyX, + out octetstring p_publicKeyY + ) return boolean { + return fx_generateKeyPair(p_privateKey, p_publicKeyX, p_publicKeyY); + } + /** * @desc Calculate digest over the certificate * @param p_cert The certificate @@ -113,7 +132,7 @@ module LibItsSecurity_Functions { * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.13 HashedId8 */ function f_calculateDigestFromCertificate( - in Certificate p_cert + in EtsiTs103097Certificate p_cert ) return HashedId8 { var octetstring v_toBeHashedData; var octetstring v_hash; @@ -125,18 +144,20 @@ module LibItsSecurity_Functions { function f_duration2time( in Duration p_duration - ) return Time32 { - if (p_duration.unit == e_seconds) { - return p_duration.duration_; - } else if (p_duration.unit == e_minutes) { - return p_duration.duration_ * 60; - } else if (p_duration.unit == e_hours) { - return p_duration.duration_ * 3600; - } else if (p_duration.unit == e_hoursBlock) { - return p_duration.duration_ * 216000; + ) return UInt16 { + if (ischosen(p_duration.seconds)) { + return p_duration.seconds; + } else if (ischosen(p_duration.minutes)) { + return p_duration.minutes; + } else if (ischosen(p_duration.hours)) { + return p_duration.hours; + } else if (ischosen(p_duration.sixtyHours)) { + return p_duration.sixtyHours; + } else if (ischosen(p_duration.years)) { + return p_duration.years; } - return p_duration.duration_ * 31556925; + return 0; // Unrechable code } // End of function f_duration2time group hostSignatureHelpers { @@ -151,8 +172,8 @@ module LibItsSecurity_Functions { */ function f_prepareCertificates( in template (omit) charstring p_certificateName, - out Certificate p_aaCertificate, - out Certificate p_atCertificate + out EtsiTs103097Certificate p_aaCertificate, + out EtsiTs103097Certificate p_atCertificate ) runs on ItsSecurityBaseComponent return boolean { // Load certificates if required @@ -160,7 +181,7 @@ module LibItsSecurity_Functions { if (f_readCertificate(valueof(p_certificateName), p_atCertificate) == false){ return false; } - if (f_readCertificate(oct2str(p_atCertificate.signer_info.signerInfo.digest), p_aaCertificate) == false) { + if (f_readCertificate(oct2str(p_atCertificate.toBeSigned.cracaId), p_aaCertificate) == false) { return false; } } else { @@ -178,58 +199,58 @@ module LibItsSecurity_Functions { * @param p_securedMessage The signed SecureMessage part * @param p_payloadField Payloads to be included in the message * @param p_mandatoryHeaders Mandatory headers for the selected profile - * @param p_headerFields HeaderFields to be inserted in the message + * @param p_headerInfo HeaderInfo to be inserted in the message * @param p_securityProfile Selected security profile * @return true on success, false otherwise */ function f_buildGnSecuredMessage( - out template (value) SecuredMessage p_securedMessage, + out template (value) Ieee1609Dot2Data p_securedMessage, in template (value) charstring p_certificateName, - in template (value) SecPayload p_payloadField, - in template (value) HeaderFields p_mandatoryHeaders, - in template (omit) HeaderFields p_headerFields := omit + in template (value) Ieee1609Dot2Content p_payloadField, + in template (value) HeaderInfo p_mandatoryHeaders, + in template (omit) HeaderInfo p_headerInfo := omit ) runs on ItsSecurityBaseComponent return boolean { // Local variables var octetstring v_secPayload, v_signature; //FIXME(DF) UNUSED // var Oct32 v_hash; - var template (value) ToBeSignedSecuredMessage v_toBeSignedSecuredMessage; + var template (value) ToBeSignedData v_toBeSignedData; var integer i, j, k, n; - var HeaderFields v_headerFields := {}; - var SecPayload v_toBeSignedPayload; + var HeaderInfo v_headerFields := {}; + var Ieee1609Dot2Content v_toBeSignedPayload; var Oct32 v_privateKey; // Prepare headers - if (not(ispresent(p_headerFields))) { + if (not(ispresent(p_headerInfo))) { v_headerFields := valueof(p_mandatoryHeaders); - } else { - // Merge p_headerFields and v_mandatoryHeaders into v_headerFields + } else {/* FIXME To be reviewed + // Merge p_headerInfo and v_mandatoryHeaders into v_headerFields - i := 0; // index for p_headerFields + i := 0; // index for p_headerInfo j := 0; // index for v_mandatoryHeaders k := 0; // index for v_headerFields // Special processing for signer_info - if (lengthof(valueof(p_headerFields)) > 0 and valueof(p_headerFields[i].type_) == e_signer_info) { - v_headerFields[k] := valueof(p_headerFields[i]); + if (lengthof(valueof(p_headerInfo)) > 0 and valueof(p_headerInfo[i].type_) == e_signer_info) { + v_headerFields[k] := valueof(p_headerInfo[i]); k := k + 1; i := i + 1; } for (j := j; j < lengthof(p_mandatoryHeaders); j := j + 1) { // Search for mandatory header in p_HeaderFields - for (n := 0; n < lengthof(p_headerFields); n := n + 1) { - if (valueof(p_headerFields[n].type_) == valueof(p_mandatoryHeaders[j].type_)) { + for (n := 0; n < lengthof(p_headerInfo); n := n + 1) { + if (valueof(p_headerInfo[n].type_) == valueof(p_mandatoryHeaders[j].type_)) { // mandatory header already in p_HeaderFields break; } } // End of 'for' statement - if (n >= lengthof(p_headerFields)) { + if (n >= lengthof(p_headerInfo)) { if (valueof(p_mandatoryHeaders[j].type_) != e_signer_info) { - // Add headers from p_headerFields having lower number than mandatory header - for (n := i; n < lengthof(p_headerFields) and valueof(p_headerFields[n].type_) < valueof(p_mandatoryHeaders[j].type_); n := n + 1) { - v_headerFields[k] := valueof(p_headerFields[n]); + // Add headers from p_headerInfo having lower number than mandatory header + for (n := i; n < lengthof(p_headerInfo) and valueof(p_headerInfo[n].type_) < valueof(p_mandatoryHeaders[j].type_); n := n + 1) { + v_headerFields[k] := valueof(p_headerInfo[n]); k := k + 1; i := i + 1; } @@ -241,23 +262,23 @@ module LibItsSecurity_Functions { } // End of 'for' statement // Add remaining headers from p_HeaderFields - for ( i := i; i < lengthof(p_headerFields); i := i + 1) { - // Add headers from p_headerFields having lower number than mandatory header - v_headerFields[k] := valueof(p_headerFields[i]); + for ( i := i; i < lengthof(p_headerInfo); i := i + 1) { + // Add headers from p_headerInfo having lower number than mandatory header + v_headerFields[k] := valueof(p_headerInfo[i]); k := k + 1; } // End of 'for' statement - } + */} // Prepare payload to be signed v_toBeSignedPayload := valueof(p_payloadField); - v_toBeSignedSecuredMessage := m_toBeSignedSecuredMessage( + /* FIXME To be reviewedv_toBeSignedData := m_toBeSignedSecuredMessage( v_headerFields, v_toBeSignedPayload, e_signature ); - v_secPayload := bit2oct(encvalue(v_toBeSignedSecuredMessage)); + v_secPayload := bit2oct(encvalue(v_toBeSignedData)); // Signed payload if (ispresent(p_certificateName) and (valueof(p_certificateName) != cc_taCert_A)) { @@ -272,10 +293,10 @@ module LibItsSecurity_Functions { v_signature := f_signWithEcdsaNistp256WithSha256( v_secPayload, v_privateKey - ); + );*/ - p_securedMessage := m_securedMessage( - valueof(v_toBeSignedSecuredMessage.header_fields), + /* FIXME To be reviewed p_securedMessage := m_securedMessage( + valueof(v_toBeSignedData.header_fields), p_payloadField, { m_trailer_field_signature( @@ -289,9 +310,9 @@ module LibItsSecurity_Functions { ) ) } - ); + );*/ - return true; + return false;/* FIXME To be reviewed true;*/ } // End of function f_buildGnSecuredMessage /** @@ -305,61 +326,61 @@ module LibItsSecurity_Functions { *
  • 2 for duplicated trailer
  • * @param p_payloadField Payloads to be included in the message * @param p_mandatoryHeaders Mandatory headers for the selected profile - * @param p_headerFields HeaderFields to be inserted in the message + * @param p_headerInfo HeaderInfo to be inserted in the message * @param p_securityProfile Selected security profile * @return true on success, false otherwise */ function f_buildGnSecuredMessage_Bo( - out template (value) SecuredMessage p_securedMessage, + out template (value) Ieee1609Dot2Data p_securedMessage, in template (value) charstring p_certificateName, in UInt8 p_protocolVersion := c_protocol_version, in integer p_trailerStatus := 0, - in template (value) SecPayload p_payloadField, - in template (value) HeaderFields p_mandatoryHeaders, - in template (omit) HeaderFields p_headerFields := omit + in template (value) Ieee1609Dot2Content p_payloadField, + in template (value) HeaderInfo p_mandatoryHeaders, + in template (omit) HeaderInfo p_headerInfo := omit ) runs on ItsSecurityBaseComponent return boolean { // Local variables var octetstring v_secPayload, v_signature; // FIXME(DF)UNUSED // var Oct32 v_hash; - var template (value) ToBeSignedSecuredMessage v_toBeSignedSecuredMessage; + var template (value) ToBeSignedData v_toBeSignedData; var integer i, j, k, n; - var HeaderFields v_headerFields := {}; - var SecPayload v_toBeSignedPayload; + var HeaderInfo v_headerFields := {}; + var Ieee1609Dot2Content v_toBeSignedPayload; var Oct32 v_privateKey; var UInt8 v_trailerSize; // Prepare headers - if (not(ispresent(p_headerFields))) { + if (not(ispresent(p_headerInfo))) { v_headerFields := valueof(p_mandatoryHeaders); - } else { - // Merge p_headerFields and v_mandatoryHeaders into v_headerFields + } else {/* FIXME To be reviewed + // Merge p_headerInfo and v_mandatoryHeaders into v_headerFields - i := 0; // index for p_headerFields + i := 0; // index for p_headerInfo j := 0; // index for v_mandatoryHeaders k := 0; // index for v_headerFields // Special processing for signer_info - if (lengthof(valueof(p_headerFields)) > 0 and valueof(p_headerFields[i].type_) == e_signer_info) { - v_headerFields[k] := valueof(p_headerFields[i]); + if (lengthof(valueof(p_headerInfo)) > 0 and valueof(p_headerInfo[i].type_) == e_signer_info) { + v_headerFields[k] := valueof(p_headerInfo[i]); k := k + 1; i := i + 1; } for (j := j; j < lengthof(p_mandatoryHeaders); j := j + 1) { // Search for mandatory header in p_HeaderFields - for (n := 0; n < lengthof(p_headerFields); n := n + 1) { - if (valueof(p_headerFields[n].type_) == valueof(p_mandatoryHeaders[j].type_)) { + for (n := 0; n < lengthof(p_headerInfo); n := n + 1) { + if (valueof(p_headerInfo[n].type_) == valueof(p_mandatoryHeaders[j].type_)) { // mandatory header already in p_HeaderFields break; } } // End of 'for' statement - if (n >= lengthof(p_headerFields)) { + if (n >= lengthof(p_headerInfo)) { if (valueof(p_mandatoryHeaders[j].type_) != e_signer_info) { - // Add headers from p_headerFields having lower number than mandatory header - for (n := i; n < lengthof(p_headerFields) and valueof(p_headerFields[n].type_) < valueof(p_mandatoryHeaders[j].type_); n := n + 1) { - v_headerFields[k] := valueof(p_headerFields[n]); + // Add headers from p_headerInfo having lower number than mandatory header + for (n := i; n < lengthof(p_headerInfo) and valueof(p_headerInfo[n].type_) < valueof(p_mandatoryHeaders[j].type_); n := n + 1) { + v_headerFields[k] := valueof(p_headerInfo[n]); k := k + 1; i := i + 1; } @@ -371,15 +392,15 @@ module LibItsSecurity_Functions { } // End of 'for' statement // Add remaining headers from p_HeaderFields - for ( i := i; i < lengthof(p_headerFields); i := i + 1) { - // Add headers from p_headerFields having lower number than mandatory header - v_headerFields[k] := valueof(p_headerFields[i]); + for ( i := i; i < lengthof(p_headerInfo); i := i + 1) { + // Add headers from p_headerInfo having lower number than mandatory header + v_headerFields[k] := valueof(p_headerInfo[i]); k := k + 1; } // End of 'for' statement - } + */} // Prepare payload to be signed - v_toBeSignedPayload := valueof(p_payloadField); + /* FIXME To be reviewed v_toBeSignedPayload := valueof(p_payloadField); // log("p_trailerStatus=", p_trailerStatus); if (p_trailerStatus == 0) { v_trailerSize := 0; @@ -390,16 +411,16 @@ module LibItsSecurity_Functions { } else { v_trailerSize := 67; } - v_toBeSignedSecuredMessage := m_toBeSignedSecuredMessage_wrong_protocol( + v_toBeSignedData := m_toBeSignedSecuredMessage_wrong_protocol( v_headerFields, v_toBeSignedPayload, e_signature, p_protocolVersion, v_trailerSize - ); -// log("m_toBeSignedSecuredMessage_wrong_protocol=", v_toBeSignedSecuredMessage); + );*/ +// log("m_toBeSignedSecuredMessage_wrong_protocol=", v_toBeSignedData); - v_secPayload := bit2oct(encvalue(v_toBeSignedSecuredMessage)); + /* FIXME To be reviewedv_secPayload := bit2oct(encvalue(v_toBeSignedData)); // log("v_secPayload=", v_secPayload); // Signed payload @@ -415,20 +436,20 @@ module LibItsSecurity_Functions { v_signature := f_signWithEcdsaNistp256WithSha256( v_secPayload, v_privateKey - ); + );*/ // log("v_signature=", v_signature); // log("p_trailerStatus=", p_trailerStatus); - if (p_trailerStatus == 0) { // No signature + /* FIXME To be reviewed if (p_trailerStatus == 0) { // No signature p_securedMessage := m_securedMessage( - valueof(v_toBeSignedSecuredMessage.header_fields), + valueof(v_toBeSignedData.header_fields), p_payloadField, { } ); v_trailerSize := 0; } else if (p_trailerStatus == 2) { // Duplicate signature p_securedMessage := m_securedMessage( - valueof(v_toBeSignedSecuredMessage.header_fields), + valueof(v_toBeSignedData.header_fields), p_payloadField, { m_trailer_field_signature( @@ -454,9 +475,9 @@ module LibItsSecurity_Functions { } ); } else if (p_trailerStatus == 3) { // Signature with reserved algorthm - p_securedMessage := m_securedMessage_wrong_protocol( + p_securedMessage := m_ieee1609Dot2Data_wrong_protocol( p_protocolVersion, - valueof(v_toBeSignedSecuredMessage.header_fields), + valueof(v_toBeSignedData.header_fields), p_payloadField, { m_trailer_field_signature( @@ -468,7 +489,7 @@ module LibItsSecurity_Functions { ); } else { // Invalid signature p_securedMessage := m_securedMessage( - valueof(v_toBeSignedSecuredMessage.header_fields), + valueof(v_toBeSignedData.header_fields), p_payloadField, { m_trailer_field_signature( @@ -483,77 +504,77 @@ module LibItsSecurity_Functions { ) } ); - p_securedMessage.trailer_fields[0].trailerField.signature_.signature_.ecdsa_signature.s := not4b(valueof(p_securedMessage.trailer_fields[0].trailerField.signature_.signature_.ecdsa_signature.s)); - } + p_securedMessage.trailer_fields[0].trailerField.signature_.ecdsaNistP256Signature.sSig := not4b(valueof(p_securedMessage.trailer_fields[0].trailerField.signature_.ecdsaNistP256Signature.sSig)); + }*/ - return true; + return false;/* FIXME To be reviewed true;*/ } // End of function f_buildGnSecuredMessage_Bo /** * @desc This function build and sign the SecureMessage part covered by the signature process * @param p_securedMessage The signed SecureMessage part * @param p_payloadField Payloads to be included in the message - * @param p_signerInfoType Add digest or AT certificate or certificate chain + * @param p_signerIdentifierType Add digest or AT certificate or certificate chain * @param p_threeDLocation The 3D location - * @param p_headerFields HeaderFields to be inserted in the message + * @param p_headerInfo HeaderInfo to be inserted in the message * @param p_certificateName The certificate identifier to be used. Default: TA_CERT_A - * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerFields + * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerInfo * @return true on success, false otherwise * * @see Draft ETSI TS 103 097 V1.1.14 Clause 7.1 Security profile for CAMs */ function f_buildGnSecuredCam( - out template (value) SecuredMessage p_securedMessage, - in template (value) SecPayload p_payloadField, - in template (omit) SignerInfoType p_signerInfoType := e_certificate_digest_with_sha256, - in template (omit) HeaderFields p_headerFields := omit, + out template (value) Ieee1609Dot2Data p_securedMessage, + in template (value) Ieee1609Dot2Content p_payloadField, + in template (omit) SignerIdentifier p_signerIdentifierType := omit, // FIXME To be reviewed + in template (omit) HeaderInfo p_headerInfo := omit, in template (value) charstring p_certificateName := "", in boolean p_addMissingHeaders := true ) runs on ItsSecurityBaseComponent return boolean { // Local variables - var Certificate v_aaCertificate, v_atCertificate; - var HeaderFields v_mandatoryHeaders := {}; - var HeaderField v_signerInfo; + var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; + var HeaderInfo v_mandatoryHeaders := {}; + var HeaderInfo v_signerInfo; // Load certificates if required if (f_prepareCertificates(p_certificateName, v_aaCertificate, v_atCertificate) == false) { return false; } - if (p_addMissingHeaders == true) { + /* FIXME To be reviewed if (p_addMissingHeaders == true) { // Prepare mandatory headers - if (valueof(p_signerInfoType) == e_certificate) { // Add the AT certificate + if (valueof(p_signerIdentifierType) == e_certificate) { // Add the AT certificate v_signerInfo := valueof( - m_header_field_signer_info( - m_signerInfo_certificate( + m_header_info_signer_info( + m_signerIdentifier_certificate( v_atCertificate ))); - } else if (valueof(p_signerInfoType) == e_certificate_chain) { // Add the AT certificate + AA Certificate + } else if (valueof(p_signerIdentifierType) == e_certificate_chain) { // Add the AT certificate + AA EtsiTs103097Certificate v_signerInfo := valueof( - m_header_field_signer_info( - m_signerInfo_certificates( + m_header_info_signer_info( + m_signerIdentifier_certificates( { v_aaCertificate, v_atCertificate } ) )); - } else if (valueof(p_signerInfoType) == e_certificate_digest_with_sha256) { // Add the AT certificate digest + } else if (valueof(p_signerIdentifierType) == e_certificate_digest_with_sha256) { // Add the AT certificate digest v_signerInfo := valueof( - m_header_field_signer_info( - m_signerInfo_digest( + m_header_info_signer_info( + m_issuerIdentifier_sha256AndDigest( f_calculateDigestFromCertificate(v_atCertificate) ))); } v_mandatoryHeaders := { v_signerInfo, - valueof(m_header_field_generation_time(1000 * f_getCurrentTime())), // In us - valueof(m_header_field_its_aid(c_its_aid_CAM)) + valueof(m_header_info_generation_time(1000 * f_getCurrentTime())), // In us + valueof(m_header_info_its_aid(c_its_aid_CAM)) } - } + }*/ - return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField, v_mandatoryHeaders, p_headerFields); + return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField, v_mandatoryHeaders, p_headerInfo); } // End of function f_buildGnSecuredCam @@ -566,11 +587,11 @@ module LibItsSecurity_Functions { *
  • 1 for invalid trailer
  • *
  • 2 for duplicated trailer
  • * @param p_payloadField Payloads to be included in the message - * @param p_signerInfoType Add digest or AT certificate or certificate chain + * @param p_signerIdentifierType Add digest or AT certificate or certificate chain * @param p_threeDLocation The 3D location - * @param p_headerFields HeaderFields to be inserted in the message + * @param p_headerInfo HeaderInfo to be inserted in the message * @param p_certificateName The certificate identifier to be used. Default: TA_CERT_A - * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerFields + * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerInfo * @param p_alterATCertificateSignature Set to true to alter the AT certificate signature * @param p_alterAACertificateSignature Set to true to alter the AA certificate signature * @return true on success, false otherwise @@ -578,12 +599,12 @@ module LibItsSecurity_Functions { * @see Draft ETSI TS 103 097 V1.1.14 Clause 7.1 Security profile for CAMs */ function f_buildGnSecuredCam_Bo( - out template (value) SecuredMessage p_securedMessage, + out template (value) Ieee1609Dot2Data p_securedMessage, in UInt8 p_protocolVersion := c_protocol_version, in integer p_trailerStatus := 0, - in template (value) SecPayload p_payloadField, - in template (omit) SignerInfoType p_signerInfoType := e_certificate_digest_with_sha256, - in template (omit) HeaderFields p_headerFields := omit, + in template (value) Ieee1609Dot2Content p_payloadField, + in template (omit) SignerIdentifier p_signerIdentifierType := omit, // FIXME To be reviewed + in template (omit) HeaderInfo p_headerInfo := omit, in template (value) charstring p_certificateName := "", in boolean p_addMissingHeaders := true, in boolean p_alterATCertificateSignature := false, @@ -591,9 +612,9 @@ module LibItsSecurity_Functions { ) runs on ItsSecurityBaseComponent return boolean { // Local variables - var Certificate v_aaCertificate, v_atCertificate; - var HeaderFields v_mandatoryHeaders := {}; - var HeaderField v_signerInfo; + var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; + var HeaderInfo v_mandatoryHeaders := {}; + var HeaderInfo v_signerInfo; // Load certificates if required if (f_prepareCertificates(p_certificateName, v_aaCertificate, v_atCertificate) == false) { @@ -601,46 +622,46 @@ module LibItsSecurity_Functions { } if (p_alterATCertificateSignature == true) { - v_atCertificate.signature_.signature_.ecdsa_signature.s := not4b(v_atCertificate.signature_.signature_.ecdsa_signature.s); + v_atCertificate.signature_.ecdsaNistP256Signature.sSig := not4b(v_atCertificate.signature_.ecdsaNistP256Signature.sSig); } if (p_alterAACertificateSignature == true) { - v_aaCertificate.signature_.signature_.ecdsa_signature.s := not4b(v_aaCertificate.signature_.signature_.ecdsa_signature.s); + v_aaCertificate.signature_.ecdsaNistP256Signature.sSig := not4b(v_aaCertificate.signature_.ecdsaNistP256Signature.sSig); } - if (p_addMissingHeaders == true) { + /* FIXME To be reviewed if (p_addMissingHeaders == true) { // Prepare mandatory headers - if (valueof(p_signerInfoType) == e_certificate) { // Add the AT certificate + if (valueof(p_signerIdentifierType) == e_certificate) { // Add the AT certificate v_signerInfo := valueof( - m_header_field_signer_info( - m_signerInfo_certificate( + m_header_info_signer_info( + m_signerIdentifier_certificate( v_atCertificate ))); - } else if (valueof(p_signerInfoType) == e_certificate_chain) { // Add the AT certificate + AA Certificate + } else if (valueof(p_signerIdentifierType) == e_certificate_chain) { // Add the AT certificate + AA EtsiTs103097Certificate v_signerInfo := valueof( - m_header_field_signer_info( - m_signerInfo_certificates( + m_header_info_signer_info( + m_signerIdentifier_certificates( { v_aaCertificate, v_atCertificate } ) )); - } else if (valueof(p_signerInfoType) == e_certificate_digest_with_sha256) { // Add the AT certificate digest + } else if (valueof(p_signerIdentifierType) == e_certificate_digest_with_sha256) { // Add the AT certificate digest v_signerInfo := valueof( - m_header_field_signer_info( - m_signerInfo_digest( + m_header_info_signer_info( + m_issuerIdentifier_sha256AndDigest( f_calculateDigestFromCertificate(v_atCertificate) ))); } v_mandatoryHeaders := { v_signerInfo, - valueof(m_header_field_generation_time(1000 * f_getCurrentTime())), // In us - valueof(m_header_field_its_aid(c_its_aid_CAM)) + valueof(m_header_info_generation_time(1000 * f_getCurrentTime())), // In us + valueof(m_header_info_its_aid(c_its_aid_CAM)) } - } + }*/ - return f_buildGnSecuredMessage_Bo(p_securedMessage, p_certificateName, p_protocolVersion, p_trailerStatus, p_payloadField, v_mandatoryHeaders, p_headerFields); + return f_buildGnSecuredMessage_Bo(p_securedMessage, p_certificateName, p_protocolVersion, p_trailerStatus, p_payloadField, v_mandatoryHeaders, p_headerInfo); } // End of function f_buildGnSecuredCam_Bo @@ -648,27 +669,27 @@ module LibItsSecurity_Functions { * @desc This function build and sign the SecureMessage part covered by the signature process * @param p_securedMessage The signed SecureMessage part * @param p_payloadField Payloads to be included in the message - * @param p_signerInfoType Add digest or AT certificate or certificate chain + * @param p_signerIdentifierType Add digest or AT certificate or certificate chain * @param p_threeDLocation The 3D location - * @param p_headerFields HeaderFields to be inserted in the message + * @param p_headerInfo HeaderInfo to be inserted in the message * @param p_certificateName The certificate identifier to be used. Default: TA_CERT_A - * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerFields + * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerInfo * @return true on success, false otherwise */ function f_buildGnSecuredDenm( - out template (value) SecuredMessage p_securedMessage, - in template (value) SecPayload p_payloadField, - in template (omit) SignerInfoType p_signerInfoType := e_certificate_digest_with_sha256, + out template (value) Ieee1609Dot2Data p_securedMessage, + in template (value) Ieee1609Dot2Content p_payloadField, + in template (omit) SignerIdentifier p_signerIdentifierType := omit, // FIXME To be reviewed in ThreeDLocation p_threeDLocation, - in template (omit) HeaderFields p_headerFields := omit, + in template (omit) HeaderInfo p_headerInfo := omit, in template (value) charstring p_certificateName := "", in boolean p_addMissingHeaders := true ) runs on ItsSecurityBaseComponent return boolean { // Local variables - var Certificate v_aaCertificate, v_atCertificate; - var HeaderFields v_mandatoryHeaders := {}; - var HeaderField v_signerInfo; + var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; + var HeaderInfo v_mandatoryHeaders := {}; + var HeaderInfo v_signerInfo; // Load certificates if required if (f_prepareCertificates(p_certificateName, v_aaCertificate, v_atCertificate) == false) { @@ -676,41 +697,41 @@ module LibItsSecurity_Functions { } // Add additional headers if required - if (p_addMissingHeaders == true) { + /* FIXME To be reviewed if (p_addMissingHeaders == true) { // Prepare mandatory headers - if (valueof(p_signerInfoType) == e_certificate) { // Add the AT certificate + if (valueof(p_signerIdentifierType) == e_certificate) { // Add the AT certificate v_signerInfo := valueof( - m_header_field_signer_info( - m_signerInfo_certificate( + m_header_info_signer_info( + m_signerIdentifier_certificate( v_atCertificate ))); - } else if (valueof(p_signerInfoType) == e_certificate_chain) { // Add the AT certificate + AA Certificate + } else if (valueof(p_signerIdentifierType) == e_certificate_chain) { // Add the AT certificate + AA EtsiTs103097Certificate v_signerInfo := valueof( - m_header_field_signer_info( - m_signerInfo_certificates( + m_header_info_signer_info( + m_signerIdentifier_certificates( { v_aaCertificate, v_atCertificate } ) )); - } else if (valueof(p_signerInfoType) == e_certificate_digest_with_sha256) { // Add the AT certificate digest + } else if (valueof(p_signerIdentifierType) == e_certificate_digest_with_sha256) { // Add the AT certificate digest v_signerInfo := valueof( - m_header_field_signer_info( - m_signerInfo_digest( - v_atCertificate.signer_info.signerInfo.digest + m_header_info_signer_info( + m_issuerIdentifier_sha256AndDigest( + v_atCertificate.cracaId ))); } v_mandatoryHeaders := { v_signerInfo, - valueof(m_header_field_generation_time(1000 * f_getCurrentTime())), // In us - valueof(m_header_field_generation_location(p_threeDLocation)), - valueof(m_header_field_its_aid(c_its_aid_DENM)) + valueof(m_header_info_generation_time(1000 * f_getCurrentTime())), // In us + valueof(m_header_info_generation_location(p_threeDLocation)), + valueof(m_header_info_its_aid(c_its_aid_DENM)) } - } + }*/ // Build the secured message and return it - return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField, v_mandatoryHeaders, p_headerFields); + return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField, v_mandatoryHeaders, p_headerInfo); } // End of function f_buildGnSecuredDenm @@ -723,29 +744,29 @@ module LibItsSecurity_Functions { *
  • 1 for invalid trailer
  • *
  • 2 for duplicated trailer
  • * @param p_payloadField Payloads to be included in the message - * @param p_signerInfoType Add digest or AT certificate or certificate chain + * @param p_signerIdentifierType Add digest or AT certificate or certificate chain * @param p_threeDLocation The 3D location - * @param p_headerFields HeaderFields to be inserted in the message + * @param p_headerInfo HeaderInfo to be inserted in the message * @param p_certificateName The certificate identifier to be used. Default: TA_CERT_A - * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerFields + * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerInfo * @return true on success, false otherwise */ function f_buildGnSecuredDenm_Bo( - out template (value) SecuredMessage p_securedMessage, + out template (value) Ieee1609Dot2Data p_securedMessage, in UInt8 p_protocolVersion := c_protocol_version, in integer p_trailerStatus := 0, - in template (value) SecPayload p_payloadField, - in template (omit) SignerInfoType p_signerInfoType := e_certificate_digest_with_sha256, + in template (value) Ieee1609Dot2Content p_payloadField, + in template (omit) SignerIdentifier p_signerIdentifierType := omit, // FIXME To be reviewed in ThreeDLocation p_threeDLocation, - in template (omit) HeaderFields p_headerFields := omit, + in template (omit) HeaderInfo p_headerInfo := omit, in template (value) charstring p_certificateName := "", in boolean p_addMissingHeaders := true ) runs on ItsSecurityBaseComponent return boolean { // Local variables - var Certificate v_aaCertificate, v_atCertificate; - var HeaderFields v_mandatoryHeaders := {}; - var HeaderField v_signerInfo; + var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; + var HeaderInfo v_mandatoryHeaders := {}; + var HeaderInfo v_signerInfo; // Load certificates if required if (f_prepareCertificates(p_certificateName, v_aaCertificate, v_atCertificate) == false) { @@ -753,41 +774,41 @@ module LibItsSecurity_Functions { } // Add additional headers if required - if (p_addMissingHeaders == true) { + /* FIXME To be reviewed if (p_addMissingHeaders == true) { // Prepare mandatory headers - if (valueof(p_signerInfoType) == e_certificate) { // Add the AT certificate + if (valueof(p_signerIdentifierType) == e_certificate) { // Add the AT certificate v_signerInfo := valueof( - m_header_field_signer_info( - m_signerInfo_certificate( + m_header_info_signer_info( + m_signerIdentifier_certificate( v_atCertificate ))); - } else if (valueof(p_signerInfoType) == e_certificate_chain) { // Add the AT certificate + AA Certificate + } else if (valueof(p_signerIdentifierType) == e_certificate_chain) { // Add the AT certificate + AA EtsiTs103097Certificate v_signerInfo := valueof( - m_header_field_signer_info( - m_signerInfo_certificates( + m_header_info_signer_info( + m_signerIdentifier_certificates( { v_aaCertificate, v_atCertificate } ) )); - } else if (valueof(p_signerInfoType) == e_certificate_digest_with_sha256) { // Add the AT certificate digest + } else if (valueof(p_signerIdentifierType) == e_certificate_digest_with_sha256) { // Add the AT certificate digest v_signerInfo := valueof( - m_header_field_signer_info( - m_signerInfo_digest( - v_atCertificate.signer_info.signerInfo.digest + m_header_info_signer_info( + m_issuerIdentifier_sha256AndDigest( + v_atCertificate.cracaId ))); } v_mandatoryHeaders := { v_signerInfo, - valueof(m_header_field_generation_time(1000 * f_getCurrentTime())), // In us - valueof(m_header_field_generation_location(p_threeDLocation)), - valueof(m_header_field_its_aid(c_its_aid_DENM)) + valueof(m_header_info_generation_time(1000 * f_getCurrentTime())), // In us + valueof(m_header_info_generation_location(p_threeDLocation)), + valueof(m_header_info_its_aid(c_its_aid_DENM)) } - } + }*/ // Build the secured message and return it - return f_buildGnSecuredMessage_Bo(p_securedMessage, p_certificateName, p_protocolVersion, p_trailerStatus, p_payloadField, v_mandatoryHeaders, p_headerFields); + return f_buildGnSecuredMessage_Bo(p_securedMessage, p_certificateName, p_protocolVersion, p_trailerStatus, p_payloadField, v_mandatoryHeaders, p_headerInfo); } // End of function f_buildGnSecuredDenm_Bo @@ -795,27 +816,27 @@ module LibItsSecurity_Functions { * @desc This function build and sign the SecureMessage part covered by the signature process * @param p_securedMessage The signed SecureMessage part * @param p_payloadField Payloads to be included in the message - * @param p_signerInfoType Add digest or AT certificate or certificate chain + * @param p_signerIdentifierType Add digest or AT certificate or certificate chain * @param p_threeDLocation The 3D location - * @param p_headerFields HeaderFields to be inserted in the message + * @param p_headerInfo HeaderInfo to be inserted in the message * @param p_certificateName The certificate identifier to be used. Default: TA_CERT_A - * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerFields + * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerInfo * @return true on success, false otherwise */ function f_buildGnSecuredOtherMessage( - out template (value) SecuredMessage p_securedMessage, - in template (value) SecPayload p_payloadField, - in template (omit) SignerInfoType p_signerInfoType := e_certificate_digest_with_sha256, + out template (value) Ieee1609Dot2Data p_securedMessage, + in template (value) Ieee1609Dot2Content p_payloadField, + in template (omit) SignerIdentifier p_signerIdentifierType := omit, // FIXME To be reviewed in ThreeDLocation p_threeDLocation, - in template (omit) HeaderFields p_headerFields := omit, + in template (omit) HeaderInfo p_headerInfo := omit, in template (value) charstring p_certificateName := "", in boolean p_addMissingHeaders := true ) runs on ItsSecurityBaseComponent return boolean { // Local variables - var Certificate v_aaCertificate, v_atCertificate; - var HeaderFields v_mandatoryHeaders := {}; - var HeaderField v_signerInfo; + var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; + var HeaderInfo v_mandatoryHeaders := {}; + var HeaderInfo v_signerInfo; // Load certificates if required if (f_prepareCertificates(p_certificateName, v_aaCertificate, v_atCertificate) == false) { @@ -823,40 +844,40 @@ module LibItsSecurity_Functions { } // Add additional headers if required - if (p_addMissingHeaders == true) { + /* FIXME To be reviewed if (p_addMissingHeaders == true) { // Prepare mandatory headers - if (valueof(p_signerInfoType) == e_certificate) { // Add the AT certificate + if (valueof(p_signerIdentifierType) == e_certificate) { // Add the AT certificate v_signerInfo := valueof( - m_header_field_signer_info( - m_signerInfo_certificate( + m_header_info_signer_info( + m_signerIdentifier_certificate( v_atCertificate ))); - } else if (valueof(p_signerInfoType) == e_certificate_chain) { // Add the AT certificate + AA Certificate + } else if (valueof(p_signerIdentifierType) == e_certificate_chain) { // Add the AT certificate + AA EtsiTs103097Certificate v_signerInfo := valueof( - m_header_field_signer_info( - m_signerInfo_certificates( + m_header_info_signer_info( + m_signerIdentifier_certificates( { v_aaCertificate, v_atCertificate } ) )); - } else if (valueof(p_signerInfoType) == e_certificate_digest_with_sha256) { // Add the AT certificate digest + } else if (valueof(p_signerIdentifierType) == e_certificate_digest_with_sha256) { // Add the AT certificate digest v_signerInfo := valueof( - m_header_field_signer_info( - m_signerInfo_digest( - v_atCertificate.signer_info.signerInfo.digest + m_header_info_signer_info( + m_issuerIdentifier_sha256AndDigest( + v_atCertificate.cracaId ))); } v_mandatoryHeaders := { v_signerInfo, - valueof(m_header_field_generation_time(1000 * f_getCurrentTime())), // In us - valueof(m_header_field_generation_location(p_threeDLocation)) + valueof(m_header_info_generation_time(1000 * f_getCurrentTime())), // In us + valueof(m_header_info_generation_location(p_threeDLocation)) } - } + }*/ // Build the secured message and return it - return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField, v_mandatoryHeaders, p_headerFields); + return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField, v_mandatoryHeaders, p_headerInfo); } // End of function f_buildGnSecuredOtherMessage /** @@ -868,29 +889,29 @@ module LibItsSecurity_Functions { *
  • 1 for invalid trailer
  • *
  • 2 for duplicated trailer
  • * @param p_payloadField Payloads to be included in the message - * @param p_signerInfoType Add digest or AT certificate or certificate chain + * @param p_signerIdentifierType Add digest or AT certificate or certificate chain * @param p_threeDLocation The 3D location - * @param p_headerFields HeaderFields to be inserted in the message + * @param p_headerInfo HeaderInfo to be inserted in the message * @param p_certificateName The certificate identifier to be used. Default: TA_CERT_A - * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerFields + * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerInfo * @return true on success, false otherwise */ function f_buildGnSecuredOtherMessage_Bo( - out template (value) SecuredMessage p_securedMessage, + out template (value) Ieee1609Dot2Data p_securedMessage, in UInt8 p_protocolVersion := c_protocol_version, in integer p_trailerStatus := 0, - in template (value) SecPayload p_payloadField, - in template (omit) SignerInfoType p_signerInfoType := e_certificate_digest_with_sha256, + in template (value) Ieee1609Dot2Content p_payloadField, + in template (omit) SignerIdentifier p_signerIdentifierType := omit, // FIXME To be reviewed in ThreeDLocation p_threeDLocation, - in template (omit) HeaderFields p_headerFields := omit, + in template (omit) HeaderInfo p_headerInfo := omit, in template (value) charstring p_certificateName := "", in boolean p_addMissingHeaders := true ) runs on ItsSecurityBaseComponent return boolean { // Local variables - var Certificate v_aaCertificate, v_atCertificate; - var HeaderFields v_mandatoryHeaders := {}; - var HeaderField v_signerInfo; + var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; + var HeaderInfo v_mandatoryHeaders := {}; + var HeaderInfo v_signerInfo; // Load certificates if required if (f_prepareCertificates(p_certificateName, v_aaCertificate, v_atCertificate) == false) { @@ -898,42 +919,42 @@ module LibItsSecurity_Functions { } // Add additional headers if required - if (p_addMissingHeaders == true) { + /* FIXME To be reviewed if (p_addMissingHeaders == true) { // Prepare mandatory headers - if (valueof(p_signerInfoType) == e_certificate) { // Add the AT certificate + if (valueof(p_signerIdentifierType) == e_certificate) { // Add the AT certificate v_signerInfo := valueof( - m_header_field_signer_info( - m_signerInfo_certificate( + m_header_info_signer_info( + m_signerIdentifier_certificate( v_atCertificate ))); - } else if (valueof(p_signerInfoType) == e_certificate_chain) { // Add the AT certificate + AA Certificate + } else if (valueof(p_signerIdentifierType) == e_certificate_chain) { // Add the AT certificate + AA EtsiTs103097Certificate v_signerInfo := valueof( - m_header_field_signer_info( - m_signerInfo_certificates( + m_header_info_signer_info( + m_signerIdentifier_certificates( { v_aaCertificate, v_atCertificate } ) )); - } else if (valueof(p_signerInfoType) == e_certificate_digest_with_sha256) { // Add the AT certificate digest + } else if (valueof(p_signerIdentifierType) == e_certificate_digest_with_sha256) { // Add the AT certificate digest v_signerInfo := valueof( - m_header_field_signer_info( - m_signerInfo_digest( - v_atCertificate.signer_info.signerInfo.digest + m_header_info_signer_info( + m_issuerIdentifier_sha256AndDigest( + v_atCertificate.cracaId ))); } v_mandatoryHeaders := { v_signerInfo, - valueof(m_header_field_generation_time(1000 * f_getCurrentTime())), // In us - valueof(m_header_field_generation_location(p_threeDLocation)) + valueof(m_header_info_generation_time(1000 * f_getCurrentTime())), // In us + valueof(m_header_info_generation_location(p_threeDLocation)) } - } + }*/ // FIXME To be done // Build the secured message and return it - return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField, v_mandatoryHeaders, p_headerFields); + return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField, v_mandatoryHeaders, p_headerInfo); } // End of function f_buildGnSecuredOtherMessage_Bo } // End of group hostSignatureHelpers @@ -952,7 +973,7 @@ module LibItsSecurity_Functions { ) runs on ItsSecurityBaseComponent return HashedId8 { // Local variables // FIXME (DF) UNUSED -// var Certificate v_atCertificate; +// var EtsiTs103097Certificate v_atCertificate; var HashedId8 v_hashedId8 := '0000000000000000'O; // Sanity check @@ -970,14 +991,14 @@ module LibItsSecurity_Functions { /** * @desc Verify the signature of the provided certificate - * @param p_certificateToBeVerified Certificate to be verified + * @param p_certificateToBeVerified EtsiTs103097Certificate to be verified * @param p_publicKey Public key to verify the certificate signature * @return true on success, false otherwise * @verdict */ function f_verifyCertificateSignatureWithPublicKey( - in template (value) Certificate p_certificateToBeVerified, - in template (value) PublicKey p_publicKey + in template (value) EtsiTs103097Certificate p_certificateToBeVerified, + in template (value) EccP256CurvePoint p_publicKey ) return boolean { // Local variables var octetstring toBeVerifiedData; @@ -985,49 +1006,49 @@ module LibItsSecurity_Functions { var boolean v_result := false; var template (value) ToBeSignedCertificate v_toBeSignedCertificate; - // Create Certificate payload to be verified - v_toBeSignedCertificate := m_toBeSignedCertificate(p_certificateToBeVerified); + // Create EtsiTs103097Certificate payload to be verified + /* FIXME To be reviewed v_toBeSignedCertificate := m_toBeSignedCertificate(p_certificateToBeVerified); toBeVerifiedData := bit2oct(encvalue(v_toBeSignedCertificate)); // Build the signature v_signature := '0000'O & - valueof(p_certificateToBeVerified.signature_.signature_.ecdsa_signature.r.x) & - valueof(p_certificateToBeVerified.signature_.signature_.ecdsa_signature.s); + valueof(p_certificateToBeVerified.signature_.ecdsaNistP256Signature.rSig) & + valueof(p_certificateToBeVerified.signature_.ecdsaNistP256Signature.sSig); log("toBeVerifiedData: ", toBeVerifiedData); log("v_signature : ", v_signature); - log("PublicKey :", p_publicKey); + log("EcdsaP256Signature :", p_publicKey); // Verify the certificate v_result := f_verifyWithEcdsaNistp256WithSha256( toBeVerifiedData, v_signature, - valueof(p_publicKey.public_key.eccPoint.x), - valueof(p_publicKey.public_key.eccPoint.y.y) - ); + valueof(p_publicKey.uncompressedP256.x), + valueof(p_publicKey.uncompressedP256.y) + );*/ return v_result; } // End of finction f_verifyCertificateSignatureWithPublicKey /** * @desc Verify the signature of the provided secured message - * @param p_certificateToBeVerified Certificate to be verified + * @param p_certificateToBeVerified EtsiTs103097Certificate to be verified * @param p_issuingCertificate Issuing certificate * @return true on success, false otherwise * @verdict */ function f_verifyCertificateSignatureWithIssuingCertificate( - in template (value) Certificate p_certificateToBeVerified, - in template (value) Certificate p_issuingCertificate + in template (value) EtsiTs103097Certificate p_certificateToBeVerified, + in template (value) EtsiTs103097Certificate p_issuingCertificate ) return boolean { - for (var integer v_counter := 0; v_counter < lengthof(p_issuingCertificate.subject_attributes); v_counter := v_counter + 1) { + /* FIXME To be reviewed for (var integer v_counter := 0; v_counter < lengthof(p_issuingCertificate.subject_attributes); v_counter := v_counter + 1) { if (valueof(p_issuingCertificate.subject_attributes[v_counter].type_) == e_verification_key) { return f_verifyCertificateSignatureWithPublicKey( p_certificateToBeVerified, valueof(p_issuingCertificate.subject_attributes[v_counter].attribute.key)); } - } // End of 'for' statement + }*/ // End of 'for' statement return false; } // End of function f_verifyCertificateSignatureWithIssuingCertificate @@ -1036,13 +1057,13 @@ module LibItsSecurity_Functions { * @desc Verify the signature of the provided secured message * @param p_securedMessage The message to be verified * @param p_publicKey The ECDSA public key to verify a signature - * @param p_certificate Certificate to be used to verify the message + * @param p_certificate EtsiTs103097Certificate to be used to verify the message * @return true on success, false otherwise * @verdict */ function f_verifyGnSecuredMessageSignatureWithPublicKey( - in template (value) SecuredMessage p_securedMessage, - in template (value) PublicKey p_publicKey + in template (value) Ieee1609Dot2Data p_securedMessage, + in template (value) EccP256CurvePoint p_publicKey ) return boolean { // Local variables @@ -1052,43 +1073,43 @@ module LibItsSecurity_Functions { // var Oct32 v_hash; var integer v_counter; var boolean v_result := false; - var template (value) ToBeSignedSecuredMessage v_toBeSignedSecuredMessage; + var template (value) ToBeSignedData v_toBeSignedData; // log(">>> f_verifyGnSecuredMessageSignatureWithPublicKey: p_securedMessage= ", p_securedMessage); // log(">>> f_verifyGnSecuredMessageSignatureWithPublicKey: p_publicKey= ", p_publicKey); - // Create SecuredMessage payload to be signed - v_toBeSignedSecuredMessage := m_toBeSignedSecuredMessage( + // Create Ieee1609Dot2Data payload to be signed + /* FIXME To be reviewed v_toBeSignedData := m_toBeSignedSecuredMessage( valueof(p_securedMessage.header_fields), valueof(p_securedMessage.payload_field), e_signature ); - log("f_verifyGnSecuredMessageSignatureWithPublicKey: v_toBeSignedSecuredMessage=", v_toBeSignedSecuredMessage); + log("f_verifyGnSecuredMessageSignatureWithPublicKey: v_toBeSignedData=", v_toBeSignedData); - v_secPayload := bit2oct(encvalue(v_toBeSignedSecuredMessage)); + v_secPayload := bit2oct(encvalue(v_toBeSignedData)); log("f_verifyGnSecuredMessageSignatureWithPublicKey: v_secPayload=", v_secPayload); // Verify payload for (v_counter := 0; v_counter < lengthof(p_securedMessage.trailer_fields); v_counter := v_counter + 1) { - var SecuredMessage v_securedMessage := valueof(p_securedMessage); + var Ieee1609Dot2Data v_securedMessage := valueof(p_securedMessage); if ( (v_securedMessage.trailer_fields[v_counter].type_ == e_signature) and (v_securedMessage.trailer_fields[v_counter].trailerField.signature_.algorithm == e_ecdsa_nistp256_with_sha256) ) { v_signedData := '0000'O & - v_securedMessage.trailer_fields[v_counter].trailerField.signature_.signature_.ecdsa_signature.r.x & - v_securedMessage.trailer_fields[v_counter].trailerField.signature_.signature_.ecdsa_signature.s; + v_securedMessage.trailer_fields[v_counter].trailerField.signature_.ecdsaNistP256Signature.rSig & + v_securedMessage.trailer_fields[v_counter].trailerField.signature_.ecdsaNistP256Signature.sSig; log("f_verifyGnSecuredMessageSignatureWithPublicKey: v_signedData=", v_signedData); v_result := f_verifyWithEcdsaNistp256WithSha256( v_secPayload, v_signedData, - valueof(p_publicKey.public_key.eccPoint.x), - valueof(p_publicKey.public_key.eccPoint.y.y) + valueof(p_publicKey.uncompressedP256.x), + valueof(p_publicKey.uncompressedP256.y) ); break; } - } // End of 'for' statement + }*/ // End of 'for' statement log("f_verifyGnSecuredMessageSignatureWithPublicKey: v_result=", v_result); return v_result; @@ -1097,16 +1118,16 @@ module LibItsSecurity_Functions { /** * @desc Verify the signature of the provided secured message * @param p_securedMessage - * @param p_certificate Certificate to be used to verify the message + * @param p_certificate EtsiTs103097Certificate to be used to verify the message * @return true on success, false otherwise * @verdict */ function f_verifyGnSecuredMessageSignatureWithCertificate( - in template (value) SecuredMessage p_securedMessage, - in template (value) Certificate p_certificate + in template (value) Ieee1609Dot2Data p_securedMessage, + in template (value) EtsiTs103097Certificate p_certificate ) return boolean { - for (var integer v_counter := 0; v_counter < lengthof(p_certificate.subject_attributes); v_counter := v_counter + 1) { + /* FIXME To be reviewed for (var integer v_counter := 0; v_counter < lengthof(p_certificate.subject_attributes); v_counter := v_counter + 1) { var SubjectAttribute v_subjectAttribute := valueof(p_certificate.subject_attributes[v_counter]); log("f_verifyGnSecuredMessageSignatureWithCertificate: processing ", v_subjectAttribute); @@ -1115,7 +1136,7 @@ module LibItsSecurity_Functions { p_securedMessage, valueof(p_certificate.subject_attributes[v_counter].attribute.key)); } - } // End of 'for' statement + }*/ // End of 'for' statement return false; } // End of function f_verifyGnSecuredOtherMessageWithDeviceCertificate @@ -1125,54 +1146,54 @@ module LibItsSecurity_Functions { group messageGetters { /** - * @desc return SecuredMessage header field of given type or null if none - * @param p_msg the SecuredMessage + * @desc return Ieee1609Dot2Data header field of given type or null if none + * @param p_msg the Ieee1609Dot2Data * @param p_type header field type - * @return HeaderField of given type if any or null + * @return HeaderInfo of given type if any or null */ function f_getMsgHeaderField( - in template(omit) SecuredMessage p_securedMessage, - in HeaderFieldType p_headerFieldType, - out HeaderField p_return + in template(omit) Ieee1609Dot2Data p_securedMessage, + in HeaderInfo p_headerInfo, + out HeaderInfo p_return ) return boolean { /*Spirent splitted*/ var integer v_length; - var SecuredMessage v_securedMessage; + var Ieee1609Dot2Data v_securedMessage; if (not isvalue(p_securedMessage)) { testcase.stop(__SCOPE__ & " can not handle omitted secured message values"); } v_securedMessage := valueof(p_securedMessage); /*Spirent replaced p_securedMessage with v_securedMessage*/ - v_length := lengthof(v_securedMessage.header_fields); + /* FIXME To be reviewed tv_length := lengthof(v_securedMessage.header_fields); for (var integer i := 0; i < v_length; i := i + 1) { if (v_securedMessage.header_fields[i].type_ == p_headerFieldType) { p_return := v_securedMessage.header_fields[i]; return true; } - } + }*/ log("f_getMsgHeaderField: return false"); return false; } /** - * @desc return SignerInfo SecuredMessage field + * @desc return SignerIdentifier Ieee1609Dot2Data field */ - function f_getMsgSignerInfo ( - in template(omit) SecuredMessage p_securedMessage, - out SignerInfo p_signerInfo + function f_getMsgSignerIdentifier ( + in template(omit) Ieee1609Dot2Data p_securedMessage, + out SignerIdentifier p_signerIdentifier ) return boolean { - var HeaderField v_hf; + var HeaderInfo v_hf; - if (f_getMsgHeaderField(p_securedMessage, e_signer_info, v_hf) == true) { + /* FIXME To be reviewed tif (f_getMsgHeaderField(p_securedMessage, e_signer_info, v_hf) == true) { if (isbound(v_hf.headerField.signer)) { - p_signerInfo := v_hf.headerField.signer; + p_signerIdentifier := v_hf.headerField.signer; return true; } - } + }*/ - log("f_getMsgSignerInfo: return false"); + log("f_getMsgSignerIdentifier: return false"); return false; } @@ -1188,9 +1209,9 @@ module LibItsSecurity_Functions { * @verdict Unchanged */ function f_setGenerationLocation( - in WGSLatitude p_latitude, - in WGSLongitude p_longitude, - in Oct2 p_elevation := '0000'O + in SecLatitude p_latitude, + in SecLongitude p_longitude, + in SecElevation p_elevation := 0 ) runs on ItsSecurityBaseComponent { vc_location := { p_latitude, @@ -1212,10 +1233,10 @@ module LibItsSecurity_Functions { // var boolean v_result; // Setup certificates memory cache - if (fx_loadCertificates(PX_CERTIFICATE_POOL_PATH, p_configId) == true) { + /* FIXME To be reviewed if (fx_loadCertificates(PX_CERTIFICATE_POOL_PATH, p_configId) == true) { // Setup security component variables if(f_readCertificate(cc_taCert_A, vc_atCertificate)) { - if(f_readCertificate(oct2str(vc_atCertificate.signer_info.signerInfo.digest), vc_aaCertificate)) { + if(f_readCertificate(oct2str(vc_atCertificate.cracaId), vc_aaCertificate)) { if(f_readSigningKey(cc_taCert_A, vc_signingPrivateKey)) { f_readEncryptingKey(cc_taCert_A, vc_encryptPrivateKey); return true; @@ -1229,7 +1250,7 @@ module LibItsSecurity_Functions { } }else{ log("f_loadCertificates: Failed to load certificates from ", PX_CERTIFICATE_POOL_PATH); - } + }*/ return false; } // End of function f_loadCertificates @@ -1253,7 +1274,7 @@ module LibItsSecurity_Functions { */ function f_readCertificate( in charstring p_certificateId, - out Certificate p_certificate + out EtsiTs103097Certificate p_certificate ) runs on ItsSecurityBaseComponent return boolean { var octetstring v_certificate; @@ -1316,12 +1337,11 @@ module LibItsSecurity_Functions { } // End of function f_readEncryptingKey function f_getCertificateValidityRestriction( - in template (value) Certificate p_cert, - in ValidityRestrictionType p_type, - out ValidityRestriction p_return + in template (value) EtsiTs103097Certificate p_cert, + out ValidityPeriod p_return ) return boolean { - for (var integer i := 0; i < lengthof(p_cert.validity_restrictions); i := i + 1) { + /* FIXME To be reviewed tfor (var integer i := 0; i < lengthof(p_cert.validity_restrictions); i := i + 1) { //FIXME RGY Titan doesn't support dot notation after valueof at the moment // if (valueof(p_cert).validity_restrictions[i].type_ == p_type) { // p_return := valueof(p_cert).validity_restrictions[i]; @@ -1331,29 +1351,28 @@ module LibItsSecurity_Functions { } } // End of 'for' statement - log("f_getCertificateValidityRestriction: Failed to retrieve ", p_type); + log("f_getCertificateValidityRestriction: Failed to retrieve ", p_type);*/ return false; } // End of function f_getCertificateValidityRestriction - function f_getCertificateSignerInfo( - in template (value) Certificate p_cert, - out SignerInfo p_si + function f_getCertificateSignerIdentifier( + in template (value) EtsiTs103097Certificate p_cert, + out SignerIdentifier p_si ) return boolean { - if (isbound(valueof(p_cert.signer_info))) { + /* FIXME To be reviewed tif (isbound(valueof(p_cert.signer_info))) { p_si := valueof(p_cert.signer_info); return true; - } + }*/ - log("f_getCertificateSignerInfo: Failed to retrieve "); + log("f_getCertificateSignerIdentifier: Failed to retrieve "); return false; } function f_getCertificateSubjectAttribute( - in template (value) Certificate p_cert, - in SubjectAttributeType p_type, - out SubjectAttribute p_return + in template (value) EtsiTs103097Certificate p_cert/* FIXME To be reviewed, + out SubjectAttribute p_return*/ ) return boolean { - for (var integer i := 0; i < lengthof(p_cert.subject_attributes); i := i + 1) { + /* FIXME To be reviewed tfor (var integer i := 0; i < lengthof(p_cert.subject_attributes); i := i + 1) { //FIXME RGY Titan doesn't support dot notation after valueof at the moment // if (valueof(p_cert).subject_attributes[i].type_ == p_type) { // p_return := valueof(p_cert).subject_attributes[i]; @@ -1363,7 +1382,7 @@ module LibItsSecurity_Functions { } } - log("f_getCertificateSubjectAttribute: Failed to retrieve ", p_type); + log("f_getCertificateSubjectAttribute: Failed to retrieve ", p_type);*/ return false; } @@ -1372,7 +1391,7 @@ module LibItsSecurity_Functions { group certificatesCaching { function f_createCertificatesCaching( - in CertificateChain p_certificates, + in SequenceOfCertificate p_certificates, out CertificatesCaching p_certificatesCaching ) return boolean { p_certificatesCaching := { }; @@ -1389,7 +1408,7 @@ module LibItsSecurity_Functions { function f_getCertificateFromCaching( in CertificatesCaching p_certificatesCaching, in HashedId8 p_hashedId8, - out Certificate p_certificate + out EtsiTs103097Certificate p_certificate ) return boolean { for (var integer v_counter := 0; v_counter < lengthof(p_certificatesCaching); v_counter := v_counter + 1) { if (match(p_certificatesCaching[v_counter].hashedId8, p_hashedId8) == true) { @@ -1404,7 +1423,7 @@ module LibItsSecurity_Functions { function f_getCertificatesCachingItem( in CertificatesCaching p_certificatesCaching, in UInt8 p_index, - out Certificate p_certificate + out EtsiTs103097Certificate p_certificate ) return boolean { if (lengthof(p_certificatesCaching) < p_index) { p_certificate := p_certificatesCaching[p_index].certificate; @@ -1558,7 +1577,7 @@ module LibItsSecurity_Functions { * @return true on success, false otherwise * @verdict Unchanged */ - external function fx_isLocationInsideRectangularRegion(in RectangularRegions p_region, in ThreeDLocation p_location) return boolean; + external function fx_isLocationInsideRectangularRegion(in SequenceOfRectangularRegion p_region, in ThreeDLocation p_location) return boolean; /** * @desc Check that the location is inside a polygonal region @@ -1603,7 +1622,7 @@ module LibItsSecurity_Functions { * * @return true on success, false otherwise */ - external function fx_areRectanglesInside(in RectangularRegions p_rectanglar_region_1, in RectangularRegions p_rectanglar_region_2) return boolean; + external function fx_areRectanglesInside(in SequenceOfRectangularRegion p_rectanglar_region_1, in SequenceOfRectangularRegion p_rectanglar_region_2) return boolean; /** * @desc Check that p_polygonal_region_1 polygonal region is included into p_polygonal_region_2 polygonal region @@ -1632,13 +1651,13 @@ module LibItsSecurity_Functions { group geometryFunctions { function f_checkRegionValidityRestiction( - in Certificate p_cert, - in Certificate p_cert_issuer + in EtsiTs103097Certificate p_cert, + in EtsiTs103097Certificate p_cert_issuer ) return boolean { - var ValidityRestriction v_cert_region, v_cert_issuer_region; + var ValidityPeriod v_cert_region, v_cert_issuer_region; var boolean v_cert_issuer_region_result; - v_cert_issuer_region_result := f_getCertificateValidityRestriction(p_cert_issuer, e_region, v_cert_issuer_region); + /* FIXME To be reviewed v_cert_issuer_region_result := f_getCertificateValidityRestriction(p_cert_issuer, e_region, v_cert_issuer_region); if (f_getCertificateValidityRestriction(p_cert, e_region, v_cert_region) == false) { if (v_cert_issuer_region_result == true) { if (v_cert_issuer_region.validity.region.region_type != e_none) { @@ -1702,7 +1721,7 @@ module LibItsSecurity_Functions { return false; } } - } + }*/ return true; } // End of function f_checkRegionValidityRestiction @@ -1729,8 +1748,8 @@ module LibItsSecurity_Functions { * @return true on success, false otherwise */ function f_areRectanglesInside( - in RectangularRegions p_rectanglar_region_1, - in RectangularRegions p_rectanglar_region_2 + in SequenceOfRectangularRegion p_rectanglar_region_1, + in SequenceOfRectangularRegion p_rectanglar_region_2 ) return boolean { return fx_areRectanglesInside(p_rectanglar_region_1, p_rectanglar_region_2); } @@ -1767,7 +1786,7 @@ module LibItsSecurity_Functions { /** * @desc Check that two given rectanlular regions are intersected - * Note: Regions must be normalized(northwest.latitude >= southeast.latitude) + * Note: Regions must be normalized(northWest.latitude >= southEast.latitude) * @param p_r1 Region 1 * @param p_r2 Region 2 * @@ -1779,19 +1798,19 @@ module LibItsSecurity_Functions { ) return boolean { return not ( //FIXME RGY Titan doesn't support dot notation after valueof at the moment -// valueof(p_r2).northwest.longitude > valueof(p_r1).southeast.longitude or -// valueof(p_r2).southeast.longitude < valueof(p_r1).northwest.longitude or -// valueof(p_r2).southeast.latitude > valueof(p_r1).northwest.latitude or -// valueof(p_r2).northwest.latitude < valueof(p_r1).southeast.latitude - valueof(p_r2.northwest.longitude) > valueof(p_r1.southeast.longitude) or - valueof(p_r2.southeast.longitude) < valueof(p_r1.northwest.longitude) or - valueof(p_r2.southeast.latitude) > valueof(p_r1.northwest.latitude) or - valueof(p_r2.northwest.latitude) < valueof(p_r1.southeast.latitude) +// valueof(p_r2).northWest.longitude > valueof(p_r1).southEast.longitude or +// valueof(p_r2).southEast.longitude < valueof(p_r1).northWest.longitude or +// valueof(p_r2).southEast.latitude > valueof(p_r1).northWest.latitude or +// valueof(p_r2).northWest.latitude < valueof(p_r1).southEast.latitude + valueof(p_r2.northWest.longitude) > valueof(p_r1.southEast.longitude) or + valueof(p_r2.southEast.longitude) < valueof(p_r1.northWest.longitude) or + valueof(p_r2.southEast.latitude) > valueof(p_r1.northWest.latitude) or + valueof(p_r2.northWest.latitude) < valueof(p_r1.southEast.latitude) ); } // End of function f_isRectangularRegionsIntersected function f_isContinuousRectangularRegions( - in template (value) RectangularRegions p_region + in template (value) SequenceOfRectangularRegion p_region ) return boolean { var integer v_i, v_j; var boolean v_found; @@ -1825,8 +1844,8 @@ module LibItsSecurity_Functions { * @verdict Unchanged */ function f_isRectangularRegionsInside( - in template (value) RectangularRegions p_parent, - in template (value) RectangularRegions p_region + in template (value) SequenceOfRectangularRegion p_parent, + in template (value) SequenceOfRectangularRegion p_region ) return boolean { var integer v_i, v_j; @@ -1858,15 +1877,15 @@ module LibItsSecurity_Functions { // var integer v_counter := 0; // Convert rectangular regions to polygons and check polygons - p_region[0] := valueof(p_rectangular_region.northwest); + p_region[0] := valueof(p_rectangular_region.northWest); p_region[1] := { - valueof(p_rectangular_region.northwest.latitude) + valueof(p_rectangular_region.southeast.latitude), - valueof(p_rectangular_region.northwest.longitude) + valueof(p_rectangular_region.northWest.latitude) + valueof(p_rectangular_region.southEast.latitude), + valueof(p_rectangular_region.northWest.longitude) }; - p_region[2] := valueof(p_rectangular_region.southeast); + p_region[2] := valueof(p_rectangular_region.southEast); p_region[3] := { - valueof(p_rectangular_region.northwest.latitude), - valueof(p_rectangular_region.northwest.longitude) + valueof(p_rectangular_region.southeast.longitude) + valueof(p_rectangular_region.northWest.latitude), + valueof(p_rectangular_region.northWest.longitude) + valueof(p_rectangular_region.southEast.longitude) }; log("f_convertRectangularRegionIntoPolygonalRegion: DEBUG: Northwest location is invalid in rect ", p_region); @@ -1934,25 +1953,19 @@ module LibItsSecurity_Functions { //FIXME RGY valeuof is missing: argument of select case is Expression (see $19.3.1) // select (p_region.region_type) { - select (valueof(p_region.region_type)) { - case (e_none) { - v_ret := true; - } - case (e_circle) { - v_ret := f_isLocationInsideCircularRegion(valueof(p_region.region.circular_region), p_location); - } - case (e_rectangle) { - v_ret := f_isLocationInsideRectangularRegion(valueof(p_region.region.rectangular_region), p_location); - } - case (e_polygon) { - v_ret := f_isLocationInsidePolygonalRegion(valueof(p_region.region.polygonal_region), p_location); - } - case (e_id) { - v_ret := f_isLocationInsideIdentifiedRegion(valueof(p_region.region.id_region), p_location); - } - case else { - v_ret := f_isLocationInsideOtherRegion(valueof(p_region.region.other_region), p_location); - } + if (ischosen(p_region.circularRegion)) { + v_ret := f_isLocationInsideCircularRegion(valueof(p_region.circularRegion), p_location); + } else if (ischosen(p_region.rectangularRegion)) { + v_ret := f_isLocationInsideRectangularRegion(valueof(p_region.rectangularRegion), p_location); + } else if (ischosen(p_region.polygonalRegion)) { + v_ret := f_isLocationInsidePolygonalRegion(valueof(p_region.polygonalRegion), p_location); + } else if (ischosen(p_region.identifiedRegion)) { + for (var integer v_i := 0; v_i < lengthof(p_region.identifiedRegion); v_i := v_i + 1) { + if (f_isLocationInsideIdentifiedRegion(valueof(p_region.identifiedRegion[v_i]), p_location) == true) { + v_ret := true; + break; + } + } // End of 'for' statement } return v_ret; @@ -1985,7 +1998,7 @@ module LibItsSecurity_Functions { * @verdict Unchanged */ function f_isLocationInsideRectangularRegion( - in template (value) RectangularRegions p_region, + in template (value) SequenceOfRectangularRegion p_region, in template (value) ThreeDLocation p_location ) return boolean { // Sanity check @@ -2093,7 +2106,7 @@ module LibItsSecurity_Functions { */ function f_ddlat2int( in float p_latitude - ) return WGSLatitude { + ) return SecLatitude { return float2int(p_latitude * 10000000.0); // Significand length shall be 7 digits length } @@ -2105,7 +2118,7 @@ module LibItsSecurity_Functions { */ function f_ddlon2int( in float p_longitude - ) return WGSLongitude { + ) return SecLongitude { return float2int(p_longitude * 1000000.0); // Significand length shall be 6 digits length } diff --git a/ttcn/Security/LibItsSecurity_Pixits.ttcn b/ttcn/Security/LibItsSecurity_Pixits.ttcn index 9eada6da..d8f43a9b 100644 --- a/ttcn/Security/LibItsSecurity_Pixits.ttcn +++ b/ttcn/Security/LibItsSecurity_Pixits.ttcn @@ -16,12 +16,12 @@ module LibItsSecurity_Pixits { import from LibCommon_DataStrings all; // LibIts - //import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - //import from IEEE1609dot2 language "ASN.1:1997" all; - //import from EtsiTs103097Module language "ASN.1:1997" all; + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + import from IEEE1609dot2 language "ASN.1:1997" all; + import from EtsiTs103097Module language "ASN.1:1997" all; // LibItsSecurity - import from LibItsSecurity_TypesAndValues all; + //import from LibItsSecurity_TypesAndValues all; /** * @desc Root path to access certificate stored in files, identified by certficate ID @@ -42,7 +42,7 @@ module LibItsSecurity_Pixits { /** * @desc ITS-AID value for other profile. Default: 38 */ - modulepar IntX PX_OTHER_ITS_AID := 141; // Assign to GN-MGMT, Other than CA, DEN, MAP, SPAT, IVI, SRE, SSE & GN-MGMT: 38 + modulepar Psid PX_OTHER_ITS_AID := 141; // Assign to GN-MGMT, Other than CA, DEN, MAP, SPAT, IVI, SRE, SSE & GN-MGMT: 38 /** * @desc Invalid protocol version. Default: 1 @@ -52,12 +52,12 @@ module LibItsSecurity_Pixits { /** * @desc Invalid WGS longitude */ - modulepar WGSLongitude PX_WGSLONGITUDE := 0; + modulepar SecLongitude PX_WGSLONGITUDE := 0; /** * @desc Invalid WGS latitude. Default: 1 */ - modulepar WGSLatitude PX_WGSLATITUDE := 0; + modulepar SecLatitude PX_WGSLATITUDE := 0; /** * @desc Invalid digest. Default: 1 diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index 81aa6b03..a15ea2b7 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -21,9 +21,9 @@ module LibItsSecurity_Templates { import from LibItsGeoNetworking_TypesAndValues all; // LibIts - //import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - //import from IEEE1609dot2 language "ASN.1:1997" all; - //import from EtsiTs103097Module language "ASN.1:1997" all; + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + import from IEEE1609dot2 language "ASN.1:1997" all; + import from EtsiTs103097Module language "ASN.1:1997" all; // LibItsSecurity import from LibItsSecurity_TypesAndValues all; @@ -36,48 +36,48 @@ module LibItsSecurity_Templates { /** * @desc Protocol version - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.1 SecuredMessage + * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.1 Ieee1609Dot2Data */ - const UInt8 c_protocol_version := 2; + const UInt8 c_protocol_version := 3; /** * @desc Certificate version - * @see Draft ETSI TS 103 097 V1.1.14 Clause 6.1 Certificate + * @see Draft ETSI TS 103 097 V1.3.1 Clause 6.1 Certificate */ - const UInt8 c_certificate_version := 2; + const UInt8 c_certificate_version := 3; /** * @desc Its AID for Other - * @see Draft ETSI TS 103 097 V1.1.14 Clause 7.3 Security profile for DENMs + * @see Draft ETSI TS 103 097 V1.3.1 Clause 7.3 Security profile for DENMs */ //FIXME RGY definition type is changed to modulepar, as Titan doesn't support dynamic constants // const IntX c_its_aid_Other := PX_OTHER_ITS_AID; - template IntX c_its_aid_Other := PX_OTHER_ITS_AID; + template Psid c_its_aid_Other := PX_OTHER_ITS_AID; /** * @desc Minimal value of Longitude */ - const Int32 c_minLongitude := -1800000000; + const SecLongitude c_minLongitude := -1799999999; // TODO Use constant from IEEE1609dot2BaseTypes /** * @desc Maximal value of Longitude */ - const Int32 c_maxLongitude := 1800000000; + const SecLongitude c_maxLongitude := 1800000000; // TODO Use constant from IEEE1609dot2BaseTypes /** * @desc Minimal value of Latitude */ - const Int32 c_minLatitude := -900000000; + const SecLatitude c_minLatitude := -900000000; // TODO Use constant from IEEE1609dot2BaseTypes /** * @desc Maximal value of Latitude */ - const Int32 c_maxLatitude := 900000000; + const SecLatitude c_maxLatitude := 900000000; // TODO Use constant from IEEE1609dot2BaseTypes /** * @desc List of ISO-3166 country codes */ - const RegionIdentifiers c_iso3166Codes := { + const SequenceOfUint16 c_iso3166Codes := { 4, 8, 10, 12, 16, 20, 24, 28, 31, 32, 36, 40, 44, 48, 50, 51, 52, 56, 60, 64, 68, 70, 72, 74, 76, 84, 86, 90, 92, 96, 100, 104, 108, 112, 116, 120, 124, 132, 136, 140, 144, 148, 152, 156, 158, 162, 166, 170, 174, 175, 178, 180, 184, 188, @@ -97,7 +97,7 @@ module LibItsSecurity_Templates { /** * @desc List of United Nations Statistics Division country codes */ - const RegionIdentifiers c_unStatsAdditionalCodes := { + const SequenceOfUint16 c_unStatsAdditionalCodes := { 1, 2, 5, 9, 11, 13, 14, 15, 17, 18, 19, 21, 29, 30, 34, 35, 39, 53, 54, 57, 61, 142, 143, 145, 150, 151, 154, 155, 199, 419, 432, 680, 722, 830 }; @@ -106,67 +106,21 @@ module LibItsSecurity_Templates { /** * @desc Dummy send/receive templates for security headers - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4 Basic format elements + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4 Basic format elements */ group dummyBasicFormatElements { - /** - * @desc Dummy send templates for security headers - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2 Specification of basic format elements - */ - group dummyBasicFormatElementsSend { - - /** - * @desc Generic Send/Receive templates for security algorithm descriptions - */ - group dummyAlgorithms { - - } // End of group dummyAlgorithms - - } // End of group dummyBasicFormatElementsSend - /** * @desc Dummy receive templates for security headers - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2 Specification of basic format elements + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2 Specification of basic format elements */ group dummyBasicFormatElementsRecv { - - /** - * @desc Dummy receive template for PublicKey/EccPoint - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.4 PublicKey - */ - template (present) PublicKey mw_publicKey_eccPoint_dummy := { - algorithm := e_ecdsa_nistp256_with_sha256, - public_key := { - eccPoint := ? - } // End of field public_key - } // End of template mw_publicKey_eccPoint_dummy - - /** - * @desc Dummy send template for PublicKey/AES CCM - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.4 PublicKey - */ - template (present) PublicKey mw_publicKey_aesccm_dummy := { - algorithm := e_ecies_nistp256, - public_key := { - aesCcm := ? - } // End of field public_key - } // End of template mw_publicKey_aesccm_dummy - - /** - * @desc Dummy receive template for Time64WithStandardDeviation - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.17 Time64WithStandardDeviation - */ - template (present) Time64WithStandardDeviation mw_time64WithStandardDeviation_dummy := { - time := ?, - log_std_dev := ? - } // End of template mw_time64WithStandardDeviation_dummy - + /** * @desc Dummy receive template for TwoDLocation * @param p_latitude Latitude range from 900 000 000 to +900 000 000 * @param p_longitude Longitude range from 1 800 000 000 to +1 800 000 000 - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.19 TwoDLocation + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.19 TwoDLocation */ template (present) TwoDLocation mw_twoDLocation_dummy := { latitude := ?, @@ -178,13 +132,13 @@ module LibItsSecurity_Templates { * @param p_latitude Latitude range from 900 000 000 to +900 000 000 * @param p_longitude Longitude range from 1 800 000 000 to +1 800 000 000 * @param p_elevation Elevation relative to the WGS-84 ellipsoid in decimetres - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.20 ThreeDLocation + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.20 ThreeDLocation */ - template (present) ThreeDLocation mdw_threeDLocation_dummy := { + template (present) ThreeDLocation mw_threeDLocation_dummy := { latitude := ?, longitude := ?, elevation := ? - } // End of template mdw_threeDLocation_dummy + } // End of template mw_threeDLocation_dummy } // End of group dummyBasicFormatElementsRecv @@ -192,13 +146,13 @@ module LibItsSecurity_Templates { /** * @desc Send/receive templates for security headers - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4 Basic format elements + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4 Basic format elements */ group basicFormatElements { /** * @desc Send templates for security headers - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2 Specification of basic format elements + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2 Specification of basic format elements */ group basicFormatElementsSend { @@ -208,148 +162,76 @@ module LibItsSecurity_Templates { group algorithms { /** - * @desc Send template for EccPoint description based on x_coordinate_only type - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.5 EccPoint - * @see Draft ETSI TS 103 097 V1.1.14 Table 2: Derivation of field sizes depending on the used algorithm + * @desc Send template for EccP256CurvePoint description based on x_coordinate_only type + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.5 EccP256CurvePoint + * @see Draft ETSI TS 103 097 V1.3.1 Table 2: Derivation of field sizes depending on the used algorithm */ - template (value) EccPoint m_eccPointecdsa_nistp256_with_sha256_x_coordinate_only( - in template (value) octetstring p_x + template (value) EccP256CurvePoint m_eccPointecdsa_nistp256_with_sha256_x_coordinate_only( + in template (value) octetstring p_x ) := { - type_ := e_x_coordinate_only, - x := p_x, - y := omit + x_only := p_x } // End of template m_eccPointecdsa_nistp256_with_sha256_x_coordinate_only /** - * @desc Send template for EccPoint description based on y_coordinate_only type - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.5 EccPoint - * @see Draft ETSI TS 103 097 V1.1.14 Table 2: Derivation of field sizes depending on the used algorithm + * @desc Send template for EccP256CurvePoint description based on y_coordinate_only type + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.5 EccP256CurvePoint + * @see Draft ETSI TS 103 097 V1.3.1 Table 2: Derivation of field sizes depending on the used algorithm */ - template (value) EccPoint m_eccPointecdsa_nistp256_with_sha256_y_coordinate_only( - in template (value) octetstring p_x + template (value) EccP256CurvePoint m_eccPointecdsa_nistp256_with_sha256_y_coordinate_only( + in template (value) octetstring p_y ) := { - type_ := e_compressed_lsb_y_0, - x := p_x, - y := omit + compressed_y_0 := p_y } // End of template m_eccPointecdsa_nistp256_with_sha256_y_coordinate_only /** - * @desc Send template for EccPoint description based on uncompressed type - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.5 EccPoint - * @see Draft ETSI TS 103 097 V1.1.14 Table 2: Derivation of field sizes depending on the used algorithm + * @desc Send template for EccP256CurvePoint description based on uncompressed type + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.5 EccP256CurvePoint + * @see Draft ETSI TS 103 097 V1.3.1 Table 2: Derivation of field sizes depending on the used algorithm */ - template (value) EccPoint m_eccPointecdsa_nistp256_with_sha256_uncompressed( - in template (value) octetstring p_x, - in template (value) octetstring p_y + template (value) EccP256CurvePoint m_eccPointecdsa_nistp256_with_sha256_uncompressed( + in template (value) octetstring p_x, + in template (value) octetstring p_y ) := { - type_ := e_uncompressed, - x := p_x, - y := { - y := p_y + uncompressedP256 := { + x := p_x, + y := p_y } } // End of template m_eccPointecdsa_nistp256_with_sha256_uncompressed - /** - * @desc Information regarding AES CCM encryption - * @param p_eccPoint The EccPoint used in the PublicKey - */ - template (value) AesCcm m_aesccm( - in template (value) EccPoint p_eccPoint - ) := { - supported_symm_alg := e_aes_128_ccm, - eccPoint := p_eccPoint - } // End of template m_aesccm - - /** - * @desc Send template for AES CCM encryption parameters - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.7 EncryptionParameters - */ - template (value) EncryptionParameters m_encryptionParameters_aes_128_ccm( - in template (value) Oct12 p_nonce - ) := { - symm_algorithm := e_aes_128_ccm, - public_key := { - nonce := p_nonce - } - } // End of template m_encryptionParameters_aes_128_ccm - } // End of group algorithms - /** - * @desc Send template for PublicKey/EccPoint - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.4 PublicKey - */ - template (value) PublicKey m_publicKey_eccPoint( - in template (value) EccPoint p_eccPoint - ) := { - algorithm := e_ecdsa_nistp256_with_sha256, - public_key := { - eccPoint := p_eccPoint - } // End of field public_key - } // End of template m_publicKey_eccPoint - - /** - * @desc Send template for PublicKey/AES CCM - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.4 PublicKey - */ - template (value) PublicKey m_publicKey_aesccm( - in template (value) AesCcm p_aesCcm - ) := { - algorithm := e_ecies_nistp256, - public_key := { - aesCcm := p_aesCcm - } // End of field public_key - } // End of template m_publicKey_aesccm - /** * @desc Send templates for Signature description - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.9 Signature - * @see Draft ETSI TS 103 097 V1.1.14 Table 2: Derivation of field sizes depending on the used algorithm + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.9 Signature + * @see Draft ETSI TS 103 097 V1.3.1 Table 2: Derivation of field sizes depending on the used algorithm */ group signatures { /** * @desc Send template for signatures based on ECDSA algorithm * @member p_ecdsaSignature The ECDSA based signature - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.9 Signature + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.9 Signature */ template (value) Signature m_signature( - in template (value) EcdsaSignature p_ecdsaSignature + in template (value) EcdsaP256Signature p_ecdsaSignature ):= { - algorithm := e_ecdsa_nistp256_with_sha256, - signature_ := { - ecdsa_signature := p_ecdsaSignature - } // End of field signature_ + ecdsaNistP256Signature := p_ecdsaSignature } // End of template m_signature_ecdsa /** * @desc Send template for ECDSA based signature * @member p_r The coordinate of the elliptic curve point resulting from multiplying the generator element by the ephemeral private key * @member p_s The signature - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.10 EcdsaSignature + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.10 EcdsaP256Signature */ - template (value) EcdsaSignature m_ecdsaSignature( - in template (value) EccPoint p_r, - in template (value) octetstring p_s + template (value) EcdsaP256Signature m_ecdsaSignature( + in template (value) EccP256CurvePoint p_rSig, + in template (value) octetstring p_sSig ) := { - r := p_r, - s := p_s + rSig := p_rSig, + sSig := p_sSig } // End of template m_ecdsaSignature - /** - * @desc Send template for signatures based on unknown algorithm - * @member p_signature The unknown signature - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.9 Signature - */ - template (value) Signature m_unknownSignature( - in template (value) octetstring p_signature - ):= { - algorithm := e_unknown, - signature_ := { - signature_ := p_signature - } // End of field signature_ - } // End of template m_unknownSignature - } // End of group signatures group signerInfos { @@ -357,115 +239,39 @@ module LibItsSecurity_Templates { /** * @desc Send template for self signed message */ - template (value) SignerInfo m_signerInfo_self := { - type_ := e_self, - signerInfo := omit - } // End of template m_signerInfo_self - - /** - * @desc Send template for self signed message - */ - template (value) SignerInfo m_signerInfo_digest( - in template (value) HashedId8 p_digest - ) := { - type_ := e_certificate_digest_with_sha256, - signerInfo := { - digest := p_digest - } // End of field signerInfo - } // End of template m_signerInfo_digest + template (value) SignerIdentifier m_signerIdentifier_self := { + self_ := NULL + } // End of template m_signerIdentifier_self /** * @desc Send template for certificate signed message */ - template (value) SignerInfo m_signerInfo_certificate( - in template (value) Certificate p_certificate - ) := { - type_ := e_certificate, - signerInfo := { - certificate := p_certificate - } // End of field signerInfo - } // End of template m_signerInfo_certificate - - /** - * @desc Send template for certificate chain signed message - */ - template (value) SignerInfo m_signerInfo_certificates( - in template (value) CertificateChain p_certificates + template (value) SignerIdentifier m_signerIdentifier_certificate( + in template (value) Certificate p_certificate ) := { - type_ := e_certificate_chain, - signerInfo := { - certificates := p_certificates - } // End of field signerInfo - } // End of template m_signerInfo_certificates + certificate := { p_certificate } // Only one + } // End of template m_signerIdentifier_certificate /** - * @desc Send template for other certificate signed message - */ - template (value) SignerInfo m_signerInfo_other_certificates( - in template (value) CertificateWithAlgo p_certificateWithAlgo - ) := { - type_ := e_certificate_digest_with_other_algorithm, - signerInfo := { - certificateWithAlgo := p_certificateWithAlgo - } // End of field signerInfo - } // End of template m_signerInfo_other_certificates - - template (value) CertificateWithAlgo m_certificateWithAlgo_ecdsa( - in template (value) HashedId8 p_digest - ) := { - algorithm := e_ecdsa_nistp256_with_sha256, - digest := p_digest - } // End of m_certificateWithAlgo - - /** - * @desc Send template for unknown signed message + * @desc Send template for certificate signed message */ - template (value) SignerInfo m_signerInfo_unknown( - in template (value) octetstring p_info + template (value) SignerIdentifier m_signerIdentifier_certificates( + in template (value) SequenceOfCertificate p_certificates ) := { - type_ := e_unknown, - signerInfo := { - info := p_info - } // End of field signerInfo - } // End of template m_signerInfo_unknown + certificate := p_certificates + } // End of template m_signerIdentifier_certificates } // End of group signerInfos - /** - * @desc Send template for Time64WithStandardDeviation - * @param p_time Time in microseconds - * @param p_log_std_dev Estimate standard deviation (unit: nanoseconds) - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.17 Time64WithStandardDeviation - */ - template (value) Time64WithStandardDeviation m_time64WithStandardDeviation( - in template (value) Time64 p_time, - in template (value) UInt8 p_log_std_dev - ) := { - time := p_time, - log_std_dev := p_log_std_dev - } // End of template m_time64WithStandardDeviation - - /** - * @desc Send template for Duration (in seconds) - * @param p_duration The duration value - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.18 Duration - */ - template (value) Duration m_duration_in_seconds( - in template (value) Int13 p_duration - ) := { - unit := e_seconds, - duration_ := p_duration - } // End of template m_duration_in_seconds - /** * @desc Send template for TwoDLocation * @param p_latitude Latitude range from 900 000 000 to +900 000 000 * @param p_longitude Longitude range from 1 800 000 000 to +1 800 000 000 - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.19 TwoDLocation + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.19 TwoDLocation */ template (value) TwoDLocation m_twoDLocation( - in template (value) WGSLatitude p_latitude, - in template (value) WGSLongitude p_longitude + in template (value) SecLatitude p_latitude, + in template (value) SecLongitude p_longitude ) := { latitude := p_latitude, longitude := p_longitude @@ -476,12 +282,12 @@ module LibItsSecurity_Templates { * @param p_latitude Latitude range from 900 000 000 to +900 000 000 * @param p_longitude Longitude range from 1 800 000 000 to +1 800 000 000 * @param p_elevation Elevation relative to the WGS-84 ellipsoid in decimetres - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.20 ThreeDLocation + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.20 ThreeDLocation */ template (value) ThreeDLocation m_threeDLocation( - in template (value) WGSLatitude p_latitude, - in template (value) WGSLongitude p_longitude, - in template (value) Oct2 p_elevation + in template (value) SecLatitude p_latitude, + in template (value) SecLongitude p_longitude, + in template (value) SecElevation p_elevation ) := { latitude := p_latitude, longitude := p_longitude, @@ -492,255 +298,150 @@ module LibItsSecurity_Templates { * @desc Send template circular geographic region * @param p_center Circle center * @param p_radius Circle radius - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.21 GeographicRegion + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion */ template (value) GeographicRegion m_geographicRegion_circle( in template (value) TwoDLocation p_center, in template (value) UInt16 p_radius ) := { - region_type := e_circle, - region := { - circular_region := { - center := p_center, - radius := p_radius - } // End of field circular_region - } // End of field region + circularRegion := { + center := p_center, + radius := p_radius + } } // End of template m_geographicRegion_circle /** * @desc Send template rectangular geographic region * @param p_northwest Upper left corner * @param p_southeast Lower rigth corner - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.21 GeographicRegion + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion */ template (value) GeographicRegion m_geographicRegion_rectangle( in template (value) TwoDLocation p_northwest, in template (value) TwoDLocation p_southeast ) := { - region_type := e_rectangle, - region := { - rectangular_region := { - { - northwest := p_northwest, - southeast := p_southeast - } - } // End of field rectangular_region - } // End of field region + rectangularRegion := { + { + northWest := p_northwest, + southEast := p_southeast + } + } } // End of template m_geographicRegion_rectangle /** * @desc Send template polygonial geographic region * @param p_polygonal_region Polygonial region description - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.21 GeographicRegion + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion */ template (value) GeographicRegion m_geographicRegion_polygonial( in template (value) PolygonalRegion p_polygonal_region ) := { - region_type := e_polygon, - region := { - polygonal_region := p_polygonal_region - } // End of field region + polygonalRegion := p_polygonal_region } // End of template m_geographicRegion_polygonial /** * @desc Send template for geographic identified region - * @param p_id_region Indentified region - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.21 GeographicRegion + * @param p_identifiedRegion Indentified region + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion */ template (value) GeographicRegion m_geographicRegion_identifiedRegion( - in template (value) IdentifiedRegion p_id_region + in template (value) SequenceOfIdentifiedRegion p_identifiedRegions ) := { - region_type := e_id, - region := { - id_region := p_id_region - } // End of field region + identifiedRegion := p_identifiedRegions } // End of template m_geographicRegion_identifiedRegion - /** - * @desc Send template for not specified geographic region - * @param p_id_region Indentified region - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.21 GeographicRegion - */ - template (value) GeographicRegion m_geographicRegion_nonce := { - region_type := e_none, - region := omit - } // End of template m_geographicRegion_nonce + template (value) IdentifiedRegion m_identifiedRegion_country_only( + in template (value) CountryOnly p_countryOnly + ) := { + countryOnly := p_countryOnly + } // End of template m_identifiedRegion_country_only + + template (value) IdentifiedRegion m_identifiedRegion_country_and_region( + in template (value) CountryOnly p_countryOnly, + in template (value) SequenceOfUint8 p_regions + ) := { + countryAndRegions := { + countryOnly := p_countryOnly, + regions := p_regions + } + } // End of template m_identifiedRegion_country_and_region } // End of group basicFormatElementsSend /** * @desc Receive templates for security headers - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2 Specification of basic format elements + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2 Specification of basic format elements */ group basicFormatElementsRecv { - /** - * @desc Receive templates for security algorithm descriptions - */ - group algorithms { - - /** - * @desc Receive template for EccPoint description based on x_coordinate_only type - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.5 EccPoint - * @see Draft ETSI TS 103 097 V1.1.14 Table 2: Derivation of field sizes depending on the used algorithm - */ - template (present) EccPoint mw_eccPointecdsa_nistp256_with_sha256_x_coordinate_only( - in template (present) octetstring p_x := ? - ) := { - type_ := e_x_coordinate_only, - x := p_x, - y := omit - } // End of template mw_eccPointecdsa_nistp256_with_sha256_x_coordinate_only - - /** - * @desc Receive template for EccPoint description based on y_coordinate_only type - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.5 EccPoint - * @see Draft ETSI TS 103 097 V1.1.14 Table 2: Derivation of field sizes depending on the used algorithm - */ - template (present) EccPoint mw_eccPointecdsa_nistp256_with_sha256_y0_coordinate_only( - in template (present) octetstring p_x := ? - ) := { - type_ := e_compressed_lsb_y_0, - x := p_x, - y := omit - } // End of template mw_eccPointecdsa_nistp256_with_sha256_y0_coordinate_only - - /** - * @desc Receive template for EccPoint description based on y_coordinate_only type - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.5 EccPoint - * @see Draft ETSI TS 103 097 V1.1.14 Table 2: Derivation of field sizes depending on the used algorithm - */ - template (present) EccPoint mw_eccPointecdsa_nistp256_with_sha256_y1_coordinate_only( - in template (present) octetstring p_x := ? - ) := { - type_ := e_compressed_lsb_y_1, - x := p_x, - y := omit - } // End of template mw_eccPointecdsa_nistp256_with_sha256_y1_coordinate_only - - /** - * @desc Receive template for EccPoint description based on uncompressed type - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.5 EccPoint - * @see Draft ETSI TS 103 097 V1.1.14 Table 2: Derivation of field sizes depending on the used algorithm - */ - template (present) EccPoint mw_eccPointecdsa_nistp256_with_sha256_uncompressed( - in template (present) octetstring p_x := ?, - in template (present) octetstring p_y := ? - ) := { - type_ := e_uncompressed, - x := p_x, - y := { - y := p_y - } - } // End of template mw_eccPointecdsa_nistp256_with_sha256_uncompressed - - } // End of group algorithms - - group signerInfos { + group signerIdentifiers { /** * @desc Recv template for message signed with digest */ - template (present) SignerInfo mw_signerInfo_digest( - in template (present) HashedId8 p_digest := ? + template (present) SignerIdentifier mw_signerIdentifier_digest( + in template (present) HashedId8 p_digest := ? ) := { - type_ := e_certificate_digest_with_sha256, - signerInfo := { - digest := p_digest - } // End of field signerInfo - } // End of template mw_signerInfo_digest + digest := p_digest + } // End of template mw_signerIdentifier_digest - template (present) SignerInfo mw_signerInfo_certificate( - in template (present) Certificate p_certificate := ? + template (present) SignerIdentifier mw_signerIdentifier_certificate( + in template (present) Certificate p_certificate := ? ) := { - type_ := e_certificate, - signerInfo := { - certificate := p_certificate - } // End of field signerInfo - } // End of template m_signerInfo_certificate + certificate := { p_certificate } + } // End of template m_signerIdentifier_certificate - template (present) SignerInfo mw_signerInfo_certificates( - in template (present) CertificateChain p_certificates := ? + template (present) SignerIdentifier mw_signerIdentifier_certificates( + in template (present) SequenceOfCertificate p_certificates := ? ) := { - type_ := e_certificate_chain, - signerInfo := { - certificates := p_certificates - } // End of field signerInfo - } // End of template mw_signerInfo_certificates + certificate := p_certificates + } // End of template mw_signerIdentifier_certificates - } // End of group signerInfos - + } // End of group signerIdentifiers /** * @desc Receive templates for Signature description - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.9 Signature - * @see Draft ETSI TS 103 097 V1.1.14 Table 2: Derivation of field sizes depending on the used algorithm + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.9 Signature + * @see Draft ETSI TS 103 097 V1.3.1 Table 2: Derivation of field sizes depending on the used algorithm */ group signatures { /** * @desc Receive template for signatures based on ECDSA algorithm * @member p_ecdsaSignature The ECDSA based signature - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.9 Signature + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.9 Signature */ template (present) Signature mw_signature( - in template (present) EcdsaSignature p_ecdsaSignature := ? + in template (present) EcdsaP256Signature p_ecdsaSignature := ? ):= { - algorithm := e_ecdsa_nistp256_with_sha256, - signature_ := { - ecdsa_signature := p_ecdsaSignature - } // End of field signature_ + ecdsaNistP256Signature := p_ecdsaSignature } // End of template mw_signature /** * @desc Receive template for ECDSA based signature * @member p_r The coordinate of the elliptic curve point resulting from multiplying the generator element by the ephemeral private key * @member p_s The signature - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.10 EcdsaSignature + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.10 EcdsaP256Signature */ - template (present) EcdsaSignature mw_ecdsaSignature( - in template (present) EccPoint p_r := ?, - in template (present) octetstring p_s := ? + template (present) EcdsaP256Signature mw_ecdsaSignature( + in template (present) EccP256CurvePoint p_rSig := ?, + in template (present) octetstring p_sSig := ? ) := { - r := p_r, - s := p_s + rSig := p_rSig, + sSig := p_sSig } // End of template mw_ecdsaSignature } // End of group signatures - /** - * @desc Receive template for Time64WithStandardDeviation - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.17 Time64WithStandardDeviation - */ - template (present) Time64WithStandardDeviation mw_time64WithStandardDeviation( - in template (present) Time64 p_time, - in template (present) UInt8 p_log_std_dev - ) := { - time := p_time, - log_std_dev := p_log_std_dev - } // End of template mw_time64WithStandardDeviation - - /** - * @desc Receive template for Duration (in seconds) - * @param p_duration The duration value - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.18 Duration - */ - template (present) Duration mw_duration_in_seconds( - in template (present) Int13 p_duration - ) := { - unit := e_seconds, - duration_ := p_duration - } // End of template mw_duration_in_seconds - /** * @desc Receive template for TwoDLocation * @param p_latitude Latitude range from 900 000 000 to +900 000 000 * @param p_longitude Longitude range from 1 800 000 000 to +1 800 000 000 - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.19 TwoDLocation + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.19 TwoDLocation */ template (present) TwoDLocation mw_twoDLocation( - in template (present) WGSLatitude p_latitude, - in template (present) WGSLongitude p_longitude + in template (present) SecLatitude p_latitude, + in template (present) SecLongitude p_longitude ) := { latitude := p_latitude, longitude := p_longitude @@ -751,12 +452,12 @@ module LibItsSecurity_Templates { * @param p_latitude Latitude range from 900 000 000 to +900 000 000 * @param p_longitude Longitude range from 1 800 000 000 to +1 800 000 000 * @param p_elevation Elevation relative to the WGS-84 ellipsoid in decimetres - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.20 ThreeDLocation + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.20 ThreeDLocation */ template (present) ThreeDLocation mw_threeDLocation( - in template (present) WGSLatitude p_latitude, - in template (present) WGSLongitude p_longitude, - in template (present) Oct2 p_elevation + in template (present) SecLatitude p_latitude, + in template (present) SecLongitude p_longitude, + in template (present) SecElevation p_elevation ) := { latitude := p_latitude, longitude := p_longitude, @@ -767,1854 +468,1069 @@ module LibItsSecurity_Templates { * @desc Receive template circular geographic region * @param p_center Circle center * @param p_radius Circle radius - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.21 GeographicRegion + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion */ template (present) GeographicRegion mw_geographicRegion_circle( in template (present) TwoDLocation p_center := ?, in template (present) UInt16 p_radius := ? ) := { - region_type := e_circle, - region := { - circular_region := { - center := p_center, - radius := p_radius - } // End of field circular_region - } // End of field region + circularRegion := { + center := p_center, + radius := p_radius + } } // End of template mw_geographicRegion_circle /** * @desc Basic receive template rectangular geographic region * @param p_northwest Upper left corner * @param p_southeast Lower rigth corner - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.21 GeographicRegion + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion */ template (present) GeographicRegion mw_geographicRegion_rectangular( in template (present) TwoDLocation p_northwest := ?, in template (present) TwoDLocation p_southeast := ? ) := { - region_type := e_rectangle, - region := { - rectangular_region := { - { - northwest := p_northwest, - southeast := p_southeast - } - } // End of field rectangular_region - } // End of field region + rectangularRegion := { + { + northWest := p_northwest, + southEast := p_southeast + } + } } // End of template mw_geographicRegion_rectangular /** * @desc Receive template polygonial geographic region * @param p_polygonal_region Polygonial region description - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.21 GeographicRegion + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion */ template (present) GeographicRegion mw_geographicRegion_polygonal( in template (present) PolygonalRegion p_polygonal_region := ? ) := { - region_type := e_polygon, - region := { - polygonal_region := p_polygonal_region - } // End of field region + polygonalRegion := p_polygonal_region } // End of template mw_geographicRegion_polygonial /** * @desc Receive template for geographic identified region - * @param p_id_region Indentified region - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.21 GeographicRegion + * @param p_identifiedRegion Indentified region + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion */ template (present) GeographicRegion mw_geographicRegion_identified( - in template (present) IdentifiedRegion p_id_region := ? + in template (present) SequenceOfIdentifiedRegion p_identifiedRegion := ? ) := { - region_type := e_id, - region := { - id_region := p_id_region - } // End of field region + identifiedRegion := p_identifiedRegion } // End of template mw_geographicRegion_identifiedRegion - /** - * @desc Receive template for not specified geographic region - * @param p_id_region Indentified region - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.21 GeographicRegion - */ - template (present) GeographicRegion mw_geographicRegion_none := { - region_type := e_none, - region := omit - } // End of template mw_geographicRegion_nonce - - template (present) IdentifiedRegion mw_identifiedRegion_iso3166_any + template (present) IdentifiedRegion mw_identifiedRegion_country_only := { - region_dictionary := e_iso_3166_1, - region_identifier := (all from c_iso3166Codes), - local_region := ? + countryOnly := ?// FIXME ((all from c_iso3166Codes), (all from c_unStatsAdditionalCodes)) } - template (present) IdentifiedRegion mw_identifiedRegion_un_stats_any - := { - region_dictionary := e_un_stats, - region_identifier := ((all from c_iso3166Codes), (all from c_unStatsAdditionalCodes)), - local_region := ? + template (present) IdentifiedRegion mw_identifiedRegion_country_and_region := { + countryAndRegions := { + countryOnly := ?, // FIXME ((all from c_iso3166Codes), (all from c_unStatsAdditionalCodes)), + regions := ? + } } } // End of group basicFormatElementsRecv } // End of group dummyBasicFormatElements - /** - * @desc Dummy send/receive templates for security headers - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5 Specification of security header + * @desc Send templates for security headers + * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.1 EtsiTs103097Data */ - group dummyMessages { + group etsiTs103097Data { /** - * @desc Dummy send templates for security headers - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5 Specification of security header + * @desc Generic send template for EtsiTs103097Data message */ - group dummyMessagesSend { - - /** - * @desc Generic send template for Security profile for other messages - * @see Draft ETSI TS 103 097 V1.1.14 Clause 7.3 Generic security profile for other signed messages - */ - template (value) SecuredMessage m_secureMessage_dummy := { - protocol_version := c_protocol_version, - header_fields := { - m_header_field_signer_info( - m_signerInfo_self - ) - }, - payload_field := m_payload_signed_external, - trailer_fields := { } - } // End of template m_secureMessage_dummy - - } // End of group dummyMessagesSend + template (value) EtsiTs103097Data m_etsiTs103097Data( + in template (value) Ieee1609Dot2Content p_content + ) := { + content := p_content + } // End of template m_etsiTs103097Data + + template (value) EtsiTs103097Data m_etsiTs103097Data_unsecured( + in template (value) Opaque p_unsecuredData + ) := { + content := { unsecuredData := p_unsecuredData } + } // End of template m_secured_data_unsecured + + template (value) EtsiTs103097Data m_etsiTs103097Data_signed( + in template (value) SignedData p_signedData + ) := { + content := { signedData := p_signedData } + } // End of template m_secured_data_signed /** - * @desc Dummy receive templates for security headers - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5 Specification of security header + * @desc Generic send template for EtsiTs103097Data message */ - group dummyMessagesRecv { - - /** - * @desc Generic received template for SecuredMessage - */ - template (present) SecuredMessage mdw_securedMessage_dummy := { - protocol_version := c_protocol_version, - header_fields := ?, - payload_field := ?, - trailer_fields := ? - } // End of template mdw_securedMessage_dummy - - } // End of group dummyMessagesRecv - - group dummyPayloads { - - /** - * @desc Generic received template for unsecured payload - */ - template (present) SecPayload mw_unsecuredPayload_dummy := { - type_ := e_unsecured, - data := ? - } // End of template mw_unsecuredPayload_dummy - - /** - * @desc Generic received template for SecuredMessage - */ - template (present) SecPayload mw_signedPayload_dummy := { - type_ := e_signed, - data := ? - } // End of template mw_signedPayload_dummy - - } // End of group payloads + template (present) EtsiTs103097Data mw_etsiTs103097Data( + template (present) Ieee1609Dot2Content p_content := ? + ) := { + content := p_content + } // End of template mw_etsiTs103097Data - group dummyEciesEncryptedKey { - - group dummyEciesEncryptedKeyRecv { - - /** - * @desc Basic receive template for an ECIES-encrypted symmetric key as defined in IEEE Std 1363a 2004 - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.9 EciesEncryptedKey - */ - template (present) EciesEncryptedKey mw_eciesEncryptedKey_dummy := { - v := ?, - c := ?, - t := ? - } // End of template mw_eciesEncryptedKey_dummy - - } // End of group dummyEciesEncryptedKeyRecv - - } // End of group dummyEciesEncryptedKey + /** + * @desc Generic send template for EtsiTs103097Data message + */ + template (value) EtsiTs103097Data m_etsiTs103097Data_wrong_protocol( + in template (value) UInt8 p_protocol_version, + in template (value) Ieee1609Dot2Content p_content + ) := { + content := p_content + } // End of template m_etsiTs103097Data_wrong_protocol - } // End of group dummyMessages + } // End of group etsiTs103097Data /** - * @desc Send/receive templates for security headers - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5 Specification of security header + * @desc Send templates for ToBeSignedData header + * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 SignedData */ - group messages { + group signedData { + + template (value) SignedData m_signedData( + in template (value) HashAlgorithm p_hashId, + in template (value) ToBeSignedData p_tbsData, + in template (value) SignerIdentifier p_signer, + in template (value) Signature p_signature_ + ) := { + hashId := p_hashId, + tbsData := p_tbsData, + signer := p_signer, + signature_ := p_signature_ + } // End of template m_signedData + + template (present) SignedData mw_signedData( + template (present) HashAlgorithm p_hashId := ?, + template (present) ToBeSignedData p_tbsData := ?, + template (present) SignerIdentifier p_signer := ?, + template (present) Signature p_signature_ := ? + ) := { + hashId := p_hashId, + tbsData := p_tbsData, + signer := p_signer, + signature_ := p_signature_ + } // End of template mw_signedData + + template (value) ToBeSignedData m_toBeSignedData( + in template (value) SignedDataPayload p_payload, + in template (value) HeaderInfo p_headerInfo + ) := { + payload := p_payload, + headerInfo := p_headerInfo + } // End of template m_toBeSignedData + + template (present) ToBeSignedData mw_toBeSignedData( + template (present) SignedDataPayload p_payload := ?, + template (present) HeaderInfo p_headerInfo := ? + ) := { + payload := p_payload, + headerInfo := p_headerInfo + } // End of template mw_toBeSignedData + + template (value) SignedDataPayload m_signedDataPayload( + in template (value) Ieee1609Dot2Data p_data + ) := { + data := p_data, + extDataHash := omit + } // End of template m_signedDataPayload + + template (value) SignedDataPayload m_signedDataPayload_ext( + in template (value) Ieee1609Dot2Data p_data, + in template (value) Oct32 p_extDataHash + ) := { + data := p_data, + extDataHash := { sha256HashedData := p_extDataHash } + } // End of template m_signedDataPayload_ext + } // End of group signedData + + /** + * @desc Send/Receive templates for Payload + * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload + */ + group ieee1609Dot2Data { + /** - * @desc Send templates for security headers - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5 Specification of security header + * @desc Send template for Ieee1609Dot2Data + * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload */ - group messagesSend { - - /** - * @desc Generic send template for secured message - */ - template (value) SecuredMessage m_securedMessage( - in template (value) HeaderFields p_header_fields, - in template (value) SecPayload p_payload_field, - in template (value) TrailerFields p_trailer_fields - ) := { - protocol_version := c_protocol_version, - header_fields := p_header_fields, - payload_field := p_payload_field, - trailer_fields := p_trailer_fields - } // End of template m_securedMessage - - /** - * @desc Generic send template for secured message - */ - template (value) SecuredMessage m_securedMessage_wrong_protocol( - in template (value) UInt8 p_protocol_version := c_protocol_version, - in template (value) HeaderFields p_header_fields, - in template (value) SecPayload p_payload_field, - in template (value) TrailerFields p_trailer_fields - ) := { - protocol_version := p_protocol_version, - header_fields := p_header_fields, - payload_field := p_payload_field, - trailer_fields := p_trailer_fields - } // End of template m_securedMessage + template (value) Ieee1609Dot2Data m_ieee1609Dot2Data( + in template (value) Ieee1609Dot2Content p_content + ) := { + content := p_content + } // End of template m_ieee1609Dot2Data - } // End of group messagesSend + /** + * @desc Receive template for Ieee1609Dot2Data + * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload + */ + template (present) Ieee1609Dot2Data mw_ieee1609Dot2Data( + template (present) Ieee1609Dot2Content p_content := ? + ) := { + content := p_content + } // End of template mw_ieee1609Dot2Data /** - * @desc Receive templates for security headers - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5 Specification of security header + * @desc Send template for 'unsecured' Payload + * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload */ - group messagesRecv { - - /** - * @desc Generic received template for SecuredMessage - */ - template (present) SecuredMessage mdw_securedMessage( - in template (present) HeaderFields p_header := ?, - in template (present) SecPayload p_payload := ?, - in template (present) TrailerFields p_trailer := ? - ) modifies mdw_securedMessage_dummy := { - header_fields := p_header, - payload_field := p_payload, - trailer_fields := p_trailer - } // End of template mdw_securedMessage - - template (present) SecuredMessage mdw_securedMessage_CAMs_headers( - in template (present) HeaderField p_header := ?, - in template (present) SecPayload p_payload := ?, - in template (present) TrailerFields p_trailer := ? - ) modifies mdw_securedMessage_dummy := { - header_fields := superset(mw_header_field_its_aid_CAM, p_header), - payload_field := p_payload, - trailer_fields := p_trailer - } // End of template mdw_securedMessage_CAMs - - template (present) SecuredMessage mdw_securedMessage_CAMs( - in template (present) HeaderField p_header := ?, - in template (present) SecPayload p_payload := ?, - in template (present) TrailerFields p_trailer := ? - ) modifies mdw_securedMessage_dummy := { - header_fields := superset(mw_header_field_its_aid_CAM, p_header), - payload_field := p_payload, - trailer_fields := p_trailer - } // End of template mdw_securedMessage_CAMs - - template (present) SecuredMessage mdw_securedMessage_DENMs( - in template (present) HeaderField p_header := ?, - in template (present) SecPayload p_payload := ?, - in template (present) TrailerFields p_trailer := ? - ) modifies mdw_securedMessage_dummy := { - header_fields := superset(mw_header_field_its_aid_DENM, p_header), - payload_field := p_payload, - trailer_fields := p_trailer - } // End of template mdw_securedMessage_DENMs - - template SecuredMessage mdw_securedMessage_Others( - in template (present) HeaderField p_header := ?, - in template (present) SecPayload p_payload := ?, - in template (present) TrailerFields p_trailer := ? - ) := { - protocol_version := c_protocol_version, - header_fields := superset( - mw_header_field_its_aid_Other, - p_header - ), - payload_field := p_payload, - trailer_fields := p_trailer - } // End of template mdw_securedMessage_Others - - } // End of group messagesRecv + template (value) Ieee1609Dot2Content m_ieee1609Dot2Data_unsecured( + in template (value) Opaque p_unsecuredData + ) := { + unsecuredData := p_unsecuredData + } // End of template m_ieee1609Dot2Data_unsecured /** - * @desc Send/Receive templates for Payload - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.2 Payload + * @desc Send template for 'signed' Payload + * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload */ - group payloads { - - /** - * @desc Send templates for Payload - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.2 Payload - */ - group payloadsSend { - - /** - * @desc Send template for 'unsecured' Payload - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.2 Payload - */ - template (value) SecPayload m_payload_unsecured( - in template (value) octetstring p_data - ) := { - type_ := e_unsecured, - data := p_data - } // End of template m_payload_unsecured - - /** - * @desc Send template for 'signed' Payload - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.2 Payload - */ - template (value) SecPayload m_payload_signed( - in template (value) octetstring p_data - ) := { - type_ := e_signed, - data := p_data - } // End of template m_payload_signed - - /** - * @desc Send template for 'signed_external' Payload - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.2 Payload - */ - template (value) SecPayload m_payload_signed_external( - in template (omit) octetstring p_data := omit - ) := { - type_ := e_signed_external, - data := p_data - } // End of template m_payload_signed_external - - /** - * @desc Send template for 'encrypted' Payload - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.2 Payload - */ - template (value) SecPayload m_payload_encrypted( - in template (value) octetstring p_data - ) := { - type_ := e_encrypted, - data := p_data - } // End of template m_payload_encrypted - - /** - * @desc Send template for 'signed_external' Payload - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.2 Payload - */ - template (value) SecPayload m_payload_signed_and_encrypted( - in template (value) octetstring p_data - ) := { - type_ := e_signed_and_encrypted, - data := p_data - } // End of template m_payload_signed_and_encrypted - - /** - * @desc Send template for 'unsecured' Payload - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.2 Payload - */ - template (value) SecPayload m_payload_unknown( - in template (value) octetstring p_data - ) := { - type_ := e_unknown, - data := p_data - } // End of template m_payload_unknown - - } // End of group payloadsSend - - /** - * @desc Receive templates for Payload - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.2 Payload - */ - group payloadsRecv { - /** - * @desc Receive template for SecPayload - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.2 Payload - */ - template (present) SecPayload mw_payload ( - in template (present) SecPayloadType p_type := ?, - in template (present) octetstring p_data := ? - ):= { - type_ := p_type, - data := p_data - } // End of template mw_payload - - - } // End of group payloadsRecv - - } // End of group payloads + template (value) Ieee1609Dot2Content m_ieee1609Dot2Data_signed( + in template (value) SignedData p_signedData + ) := { + signedData := p_signedData + } // End of template m_ieee1609Dot2Data_signed + + } // End of group ieee1609Dot2Data + + /** + * @desc Send/Receive templates for HeaderInfo + * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.4 HeaderInfo + */ + group headerFields { + + template (omit) HeaderInfo m_ieee1609Dot2_headerInfo( + in template (value) Psid p_psid + ) := { + psid := p_psid, + generationTime := omit, + expiryTime := omit, + generationLocation := omit, + p2pcdLearningRequest := omit, + missingCrlIdentifier := omit, + encryptionKey := omit, + inlineP2pcdRequest := omit, + requestedCertificate := omit + } // End of template m_ieee1609Dot2_headerInfo /** - * @desc Send/Receive templates for HeaderField - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField + * + * Clause 7.1.1 Security profile for CAMs */ - group headerFields { - - /** - * @desc Send templates for HeaderField - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField - */ - group headerFieldsSend { - - /** - * @desc Send template for HeaderField with generation time information - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField - */ - template (value) HeaderField m_header_field_generation_time( - in template (value) Time64 p_generation_time - ) := { - type_ := e_generation_time, - headerField := { - generation_time := p_generation_time - } - } // End of template m_header_field_generation_time - - /** - * @desc Send template for HeaderField with generation time and standard deviation information - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField - */ - template (value) HeaderField m_header_field_generation_time_with_standard_deviation( - in template (value) Time64WithStandardDeviation p_generation_time_with_standard_deviation - ) := { - type_ := e_generation_time_standard_deviation, - headerField := { - generation_time_with_standard_deviation := p_generation_time_with_standard_deviation - } - } // End of template m_header_field_generation_time_with_standard_deviation - - /** - * @desc Send template for HeaderField with expiration time information - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField - */ - template (value) HeaderField m_header_field_expiry_time( - in template (value) Time32 p_expiry_time - ) := { - type_ := e_expiration, - headerField := { - expiry_time := p_expiry_time - } - } // End of template m_header_field_expiry_time - - /** - * @desc Send template for HeaderField with generation location information - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField - */ - template (value) HeaderField m_header_field_generation_location( - in template (value) ThreeDLocation p_generation_location - ) := { - type_ := e_generation_location, - headerField := { - generation_location := p_generation_location - } - } // End of template m_header_field_generation_location - - /** - * @desc Send template for HeaderField with generation location information - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField - */ - template (value) HeaderField m_header_field_unrecognised_certificate( - in template (value) HashedId3 p_digest - ) := { - type_ := e_request_unrecognized_certificate, - headerField := { - digests := { p_digest } - } - } // End of template m_header_field_digest - - /** - * @desc Send template for HeaderField with generation location information - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField - */ - template (value) HeaderField m_header_field_unrecognised_certificates( - in template (value) HashedId3s p_digests - ) := { - type_ := e_request_unrecognized_certificate, - headerField := { - digests := p_digests - } - } // End of template m_header_field_multiple_digests - - /** - * @desc Send template for HeaderField with ItsAid information - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField - */ - template (value) HeaderField m_header_field_its_aid( - in template (value) IntX p_its_aid - ) := { - type_ := e_its_aid, - headerField := { - its_aid := p_its_aid - } - } // End of template m_header_field_its_aid - - /** - * @desc Send template for HeaderField with CAM ItsAid identifier - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField - */ - template (value) HeaderField m_header_field_its_aid_CAM := { - type_ := e_its_aid, - headerField := { - its_aid := c_its_aid_CAM - } - } // End of template m_header_field_its_aid_CAM - - /** - * @desc Send template for HeaderField with CAM ItsAid identifier - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField - */ - template (value) HeaderField m_header_field_its_aid_DENM := { - type_ := e_its_aid, - headerField := { - its_aid := c_its_aid_DENM - } - } // End of template m_header_field_its_aid_DENM - - /** - * @desc Send template for HeaderField with CAM ItsAid identifier - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField - */ - template (value) HeaderField m_header_field_its_aid_Other := { - type_ := e_its_aid, - headerField := { - its_aid := c_its_aid_Other - } - } // End of template m_header_field_its_aid_Other - - /** - * @desc Send template for HeaderField with signer information - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField - */ - template (value) HeaderField m_header_field_signer_info( - in template (value) SignerInfo p_signer - ) := { - type_ := e_signer_info, - headerField := { - signer := p_signer - } - } // End of template m_header_field_signerInfo_signer_info - - /** - * @desc Send template for HeaderField with signer information - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField - */ - template (value) HeaderField m_header_field_recipient( - in template (value) RecipientInfo p_recipient - ) := { - type_ := e_recipient_info, - headerField := { - recipients := { p_recipient } - } - } // End of template m_header_field_recipient - - /** - * @desc Send template for HeaderField with signer information - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField - */ - template (value) HeaderField m_header_field_multiple_recipients( - in template (value) RecipientInfos p_recipients - ) := { - type_ := e_recipient_info, - headerField := { - recipients := p_recipients - } - } // End of template m_header_field_multiple_recipients - - /** - * @desc Send template for HeaderField with signer information - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField - */ - template (value) HeaderField m_header_field_enc_params( - in template (value) EncryptionParameters p_enc_params - ) := { - type_ := e_encryption_parameters, - headerField := { - enc_params := p_enc_params - } - } // End of template m_header_field_enc_params - - /** - * @desc Send template for HeaderField with unspecify header field value - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField - */ - template (value) HeaderField m_header_field_unspecify := { - type_ := e_other_header_240, - headerField := { - other_header := 'C0FFEEDECA'O - } - } // End of template m_header_field_unspecify - - } // End of group headerFieldsSend - - /** - * @desc Receive templates for HeaderField - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField - */ - group headerFieldsRecv { - - /** - * @desc Receive template for HeaderField with generation time information - * @param p_headerType Type id of the Header field - */ - template (present) HeaderField mw_header_field( - in HeaderFieldType p_headerType - ) := { - type_ := p_headerType, - headerField := ? - } // End of template mw_header_field_generation_time - - /** - * @desc Receive template for HeaderField with generation time information - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField - */ - template (present) HeaderField mw_header_field_generation_time( - in template (present) Time64 p_generation_time := ? - ) := { - type_ := e_generation_time, - headerField := { - generation_time := p_generation_time - } - } // End of template mw_header_field_generation_time - - /** - * @desc Receive template for HeaderField with generation time and standard deviation information - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField - */ - template (present) HeaderField mw_header_field_generation_time_with_standard_deviation( - in template (present) Time64WithStandardDeviation p_generation_time_with_standard_deviation := ? - ) := { - type_ := e_generation_time_standard_deviation, - headerField := { - generation_time_with_standard_deviation := p_generation_time_with_standard_deviation - } - } // End of template mw_header_field_generation_time_with_standard_deviation - - /** - * @desc Receive template for HeaderField with expiration time information - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField - */ - template (present) HeaderField mw_header_field_expiry_time( - in template (present) Time32 p_expiry_time := ? - ) := { - type_ := e_expiration, - headerField := { - expiry_time := p_expiry_time - } - } // End of template mw_header_field_expiry_time - - /** - * @desc Receive template for HeaderField with generation location information - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField - */ - template (present) HeaderField mw_header_field_generation_location( - in template (present) ThreeDLocation p_generation_location := ? - ) := { - type_ := e_generation_location, - headerField := { - generation_location := p_generation_location - } - } // End of template mw_header_field_generation_location - - /** - * @desc Receive template for HeaderField with generation location information - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField - */ - template (present) HeaderField mw_header_field_unrecognised_certificate( - in template (present) HashedId3s p_digests := ? - ) := { - type_ := e_request_unrecognized_certificate, - headerField := { - digests := p_digests - } - } // End of template mw_header_field_unrecognised_certificate - - /** - * @desc Receive template for HeaderField with signer information - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField - */ - template (present) HeaderField mw_header_field_signer_info( - in template (present) SignerInfo p_signer := ? - ) := { - type_ := e_signer_info, - headerField := { - signer := p_signer - } - } // End of template mw_header_field_signerInfo_signer_info - - /** - * @desc Receive template for HeaderField with signer information - * containing certificate - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField - */ - template (present) HeaderField mw_header_field_signer_info_certificate ( - in template (present) Certificate p_cert := ? - ) := { - type_ := e_signer_info, - headerField := { - signer := mw_signerInfo_certificate(p_cert) - } - } // End of template mw_header_field_signer_info_certificate - - /** - * @desc Receive template for HeaderField with signer information - * containing certificate digest - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField - */ - template (present) HeaderField mw_header_field_signer_info_digest ( - in template (present) HashedId8 p_digest := ? - ) := { - type_ := e_signer_info, - headerField := { - signer := mw_signerInfo_digest(p_digest) - } - } // End of template mw_header_field_signer_info_digest - - /** - * @desc Receive template for HeaderField with signer information - * containing certificate chain - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField - */ - template (present) HeaderField mw_header_field_signer_info_certificate_chain ( - in template (present) CertificateChain p_certs := ? - ) := { - type_ := e_signer_info, - headerField := { - signer := mw_signerInfo_certificates(p_certs) - } - } // End of template mw_header_field_signer_info_certificate_chain - - /** - * @desc Receive template for HeaderField with signer information - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField - */ - template (value) HeaderField mw_header_field_multiple_recipients( - in template (value) RecipientInfos p_recipients - ) := { - type_ := e_recipient_info, - headerField := { - recipients := p_recipients - } - } // End of template mw_header_field_multiple_recipients - - /** - * @desc Receive template for HeaderField with signer information - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField - */ - template (present) HeaderField mw_header_field_enc_params( - in template (present) EncryptionParameters p_enc_params - ) := { - type_ := e_encryption_parameters, - headerField := { - enc_params := p_enc_params - } - } // End of template mw_header_field_enc_params - - /** - * @desc Receive template for HeaderField with request for unrecognized certificate - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField - */ - template (present) HeaderField mw_header_field_request_unrecognized_certificate( - in template (present) HashedId3s p_digests := ? - - ) := { - type_ := e_request_unrecognized_certificate, - headerField := { - digests := p_digests - } - } // End of template mw_header_field_signer_info_digest - - /** - * @desc Receive template for HeaderField with ItsAid identifier - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField - */ - template (present) HeaderField mw_header_field_its_aid( - in template (present) IntX p_its_aid := ? - ) := { - type_ := e_its_aid, - headerField := { - its_aid := p_its_aid - } - } // End of template mw_header_field_its_aid - - /** - * @desc Receive template for HeaderField with CAM ItsAid identifier - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField - */ - template (value) HeaderField mw_header_field_its_aid_CAM := { - type_ := e_its_aid, - headerField := { - its_aid := c_its_aid_CAM - } - } // End of template mw_header_field_its_aid_CAM - - /** - * @desc Receive template for HeaderField with DENM ItsAid identifier - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField - */ - template (value) HeaderField mw_header_field_its_aid_DENM := { - type_ := e_its_aid, - headerField := { - its_aid := c_its_aid_DENM - } - } // End of template mw_header_field_its_aid_DENM - - /** - * @desc Receive template for HeaderField with Other ItsAid identifier - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField - */ - template (value) HeaderField mw_header_field_its_aid_Other := { - type_ := e_its_aid, - headerField := { - its_aid := c_its_aid_Other - } - } // End of template mw_header_field_its_aid_Other - - } // End of group headerFieldsRecv - - } // End of group headerFields + template (omit) HeaderInfo m_headerInfo_cam( + in template (value) Psid p_psid := 34, // TODO ITS-AID for CAM + in template (value) Time64 p_generationTime, + in template (value) Time64 p_expiryTime, + in template (omit) ThreeDLocation p_generationLocation := omit + ) modifies m_ieee1609Dot2_headerInfo := { + generationTime := p_generationTime, + expiryTime := p_expiryTime, + generationLocation := p_generationLocation + } // End of template m_headerInfo_cam /** - * @desc Send/Receive templates for TrailerField - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.6 TrailerField + * + * Clause 7.1.2 Security profile for DENMs */ - group trailerFields { - - /** - * @desc Send template containing signature information used by the security layer after processing the payload - * @param p_signature The signature information - */ - template (value) TrailerField m_trailer_field_signature( - in template (value) Signature p_signature - ) := { - type_ := e_signature, - trailerField := { - signature_ := p_signature - } - } // End of template m_trailer_field_dummy - - /** - * @desc Receive template containing signature information used by the security layer after processing the payload - * @param p_signature The signature information - */ - template (present) TrailerField mw_trailer_field_signature( - in template (present) Signature p_signature := ? - ) := { - type_ := e_signature, - trailerField := { - signature_ := p_signature - } - } // End of template mw_trailer_field_dummy - - /** - * @desc Receive template containing signature information used by the security layer after processing the payload - * @param p_type The trailer field type - * @param p_body The trailer field container - */ - template (present) TrailerField mw_trailer_field ( - in template (present) TrailerFieldType p_type := ?, - in template (present) TrailerFieldContainer p_body := ? - ) := { - type_ := p_type, - trailerField := p_body - } // End of template mw_trailer_field - } // End of group trailerFields + template (omit) HeaderInfo m_headerInfo_denm( + in template (value) Psid p_psid := 35, // TODO ITS-AID for DENM + in template (value) Time64 p_generationTime, + in template (value) Time64 p_expiryTime, + in template (omit) ThreeDLocation p_generationLocation := omit + ) modifies m_ieee1609Dot2_headerInfo := { + generationTime := p_generationTime, + expiryTime := p_expiryTime, + generationLocation := p_generationLocation + } // End of template m_headerInfo_denm /** - * @desc Send/Receive templates for RecipientInfo - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.8 RecipientInfo + * + * Clause 7.1.3 Generic security profile for other signed messages */ - group recipientInfo { - - /** - * @desc Send template containing information for a message's recipient - * @param p_cert_id The recipient's certificate identifier - * @param p_pk_encryption The encryption type - * @param p_enc_key The encrypted key contained in an EciesEncryptedKey structure - */ - template (value) RecipientInfo m_recipientInfo_ecies_enc_key( - in template (value) HashedId8 p_cert_id, - in template (value) PublicKeyAlgorithm p_pk_encryption, - in template (value) EciesEncryptedKey p_enc_key - ) := { - cert_id := p_cert_id, - pk_encryption := p_pk_encryption, - enc_key := { - enc_key := p_enc_key - } // End of field enc_key - } // End of template m_recipientInfo_ecies_enc_key - - template (value) RecipientInfo m_recipientInfo_other_enc_key( - in template (value) HashedId8 p_cert_id, - in template (value) PublicKeyAlgorithm p_pk_encryption, - in template (value) octetstring p_enc_key_other - ) := { - cert_id := p_cert_id, - pk_encryption := p_pk_encryption, - enc_key := { - enc_key_other := p_enc_key_other - } // End of field enc_key - } // End of template m_recipientInfo_other_enc_key - - /** - * @desc Receive template containing information for a message's recipient - * @param p_cert_id The recipient's certificate identifier - * @param p_pk_encryption The encryption type - * @param p_enc_key The encrypted key contained in an EciesEncryptedKey structure - */ - template (present) RecipientInfo mw_recipientInfo_ecies_enc_key( - in template (present) HashedId8 p_cert_id, - in template (present) PublicKeyAlgorithm p_pk_encryption, - in template (present) EciesEncryptedKey p_enc_key - ) := { - cert_id := p_cert_id, - pk_encryption := p_pk_encryption, - enc_key := { - enc_key := p_enc_key - } // End of field enc_key - } // End of template mw_recipientInfo_ecies_enc_key - - } // End of group recipientInfo + template (omit) HeaderInfo m_headerInfo_gn( + in template (value) Psid p_psid := 141, // TODO ITS-AID for GN + in template (value) Time64 p_generationTime, + in template (value) Time64 p_expiryTime, + in template (omit) ThreeDLocation p_generationLocation := omit + ) modifies m_ieee1609Dot2_headerInfo := { + generationTime := p_generationTime, + expiryTime := p_expiryTime, + generationLocation := p_generationLocation + } // End of template m_headerInfo_gn - /** - * @desc Send/Receive templates for EciesEncryptedKey - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.9 EciesEncryptedKey - */ - group eciesEncryptedKey { - - /** - * @desc Send template for an ECIES-encrypted symmetric key as defined in IEEE Std 1363a 2004 - * @param p_ecc_key The sender's EEC ephemeral key - * @param p_encrypted_key The encrypted (AES) key - * @param p_authentication_tag The authentication tag vector - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.9 EciesEncryptedKey - */ - template (value) EciesEncryptedKey m_eciesEncryptedKey_aesccm( - in template (value) EccPoint p_ecc_key, - in template (value) octetstring p_encrypted_key, - in template (value) Oct16 p_authentication_tag - ) := { - v := p_ecc_key, - c := p_encrypted_key, - t := p_authentication_tag - } // End of template m_eciesEncryptedKey_aesccm - - /** - * @desc Receive template for an ECIES-encrypted symmetric key as defined in IEEE Std 1363a 2004 - * @param p_ecc_key The sender's EEC ephemeral key - * @param p_encrypted_key The encrypted (AES) key - * @param p_authentication_tag The authentication tag vector - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.9 EciesEncryptedKey - */ - template (present) EciesEncryptedKey mw_eciesEncryptedKey_aesccm( - in template (present) EccPoint p_ecc_key, - in template (present) octetstring p_encrypted_key, - in template (present) Oct16 p_authentication_tag - ) := { - v := p_ecc_key, - c := p_encrypted_key, - t := p_authentication_tag - } // End of template mw_eciesEncryptedKey_aesccm - - } // End of group eciesEncryptedKey + } // End of group headerFields + + group signatures { - } // End of group messages + template (value) Signature m_signature_ecdsaNistP256( + in template (value) EcdsaP256Signature p_ecdsaNistP256Signature + ) := { + ecdsaNistP256Signature := p_ecdsaNistP256Signature + } // End of template m_signature_ecdsaNistP256 + + template (present) Signature mw_signature_ecdsaNistP256( + template (present) EcdsaP256Signature p_ecdsaNistP256Signature := ? + ) := { + ecdsaNistP256Signature := p_ecdsaNistP256Signature + } // End of template mw_signature_ecdsaNistP256 + + template (value) Signature m_signature_ecdsaBrainpoolP256r1( + in template (value) EcdsaP256Signature p_ecdsaBrainpoolP256r1Signature + ) := { + ecdsaBrainpoolP256r1Signature := p_ecdsaBrainpoolP256r1Signature + } // End of template m_signature_ecdsaBrainpoolP256r1 + + template (present) Signature mw_signature_ecdsaBrainpoolP256r1( + template (present) EcdsaP256Signature p_ecdsaBrainpoolP256r1Signature := ? + ) := { + ecdsaBrainpoolP256r1Signature := p_ecdsaBrainpoolP256r1Signature + } // End of template m_signature_ecdsaBrainpoolP256r1 + + template (value) Signature m_signature_ecdsaBrainpoolP384r1( + in template (value) EcdsaP384Signature p_ecdsaBrainpoolP384r1Signature + ) := { + ecdsaBrainpoolP384r1Signature := p_ecdsaBrainpoolP384r1Signature + } // End of template m_signature_ecdsaBrainpoolP384r1 + + template (present) Signature mw_signature_ecdsaBrainpoolP384r1( + template (present) EcdsaP384Signature p_ecdsaBrainpoolP384r1Signature := ? + ) := { + ecdsaBrainpoolP384r1Signature := p_ecdsaBrainpoolP384r1Signature + } // End of template mw_signature_ecdsaBrainpoolP384r1 + + template (value) EcdsaP256Signature m_ecdsaNistP256Signature( + in template (value) EccP256CurvePoint p_rSig, + in template (value) Oct32 p_sSig + ) := { + rSig := p_rSig, + sSig := p_sSig + } // End of template m_ecdsaNistP256Signature + + template (present) EcdsaP256Signature mw_ecdsaNistP256Signature( + template (present) EccP256CurvePoint p_rSig, + template (present) Oct32 p_sSig + ) := { + rSig := p_rSig, + sSig := p_sSig + } // End of template mw_ecdsaNistP256Signature + + template (value) EcdsaP384Signature m_ecdsaP384Signature( + in template (value) EccP384CurvePoint p_rSig, + in template (value) Oct48 p_sSig + ) := { + rSig := p_rSig, + sSig := p_sSig + } // End of template m_ecdsaP384Signature + + template (present) EcdsaP384Signature mw_ecdsaP384Signature( + template (present) EccP384CurvePoint p_rSig := ?, + template (present) Oct48 p_sSig := ? + ) := { + rSig := p_rSig, + sSig := p_sSig + } // End of template mw_ecdsaP384Signature + + template (value) EccP256CurvePoint m_eccP256CurvePoint_x_only( + in template (value) Oct32 p_x_only + ) := { + x_only := p_x_only + } // End of template m_eccP256CurvePoint_x_only + + template (present) EccP256CurvePoint mw_eccP256CurvePoint_x_only( + template (present) Oct32 p_x_only := ? + ) := { + x_only := p_x_only + } // End of template mw_eccP256CurvePoint_x_only + + template (value) EccP256CurvePoint m_eccP256CurvePoint_compressed_y_0( + in template (value) Oct32 p_compressed_y_0 + ) := { + compressed_y_0 := p_compressed_y_0 + } // End of template m_eccP256CurvePoint_compressed_y_0 + + template (present) EccP256CurvePoint mw_eccP256CurvePoint_compressed_y_0( + template (present) Oct32 p_compressed_y_0 := ? + ) := { + compressed_y_0 := p_compressed_y_0 + } // End of template mw_eccP256CurvePoint_compressed_y_0 + + template (value) EccP256CurvePoint m_eccP256CurvePoint_compressed_y_1( + in template (value) Oct32 p_compressed_y_1 + ) := { + compressed_y_1 := p_compressed_y_1 + } // End of template m_eccP256CurvePoint_compressed_y_1 + + template (present) EccP256CurvePoint mw_eccP256CurvePoint_compressed_y_1( + template (present) Oct32 p_compressed_y_1 := ? + ) := { + compressed_y_1 := p_compressed_y_1 + } // End of template mw_eccP256CurvePoint_compressed_y_1 + + template (value) EccP256CurvePoint m_eccP256CurvePoint_uncompressed( + in template (value) Oct32 p_x, + in template (value) Oct32 p_y + ) := { + uncompressedP256 := { + x := p_x, + y := p_y + } + } // End of template m_eccP256CurvePoint_uncompressed + + template (present) EccP256CurvePoint mw_eccP256CurvePoint_uncompressed( + template (present) Oct32 p_x := ?, + template (present) Oct32 p_y := ? + ) := { + uncompressedP256 := { + x := p_x, + y := p_y + } + } // End of template mw_eccP256CurvePoint_uncompressed + + template (value) EccP384CurvePoint m_eccP384CurvePoint_x_only( + in template (value) Oct48 p_x_only + ) := { + x_only := p_x_only + } // End of template m_eccP384CurvePoint_x_only + + template (present) EccP384CurvePoint mw_eccP384CurvePoint_x_only( + template (present) Oct48 p_x_only := ? + ) := { + x_only := p_x_only + } // End of template mw_eccP384CurvePoint_x_only + + template (value) EccP384CurvePoint m_eccP384CurvePoint_compressed_y_0( + in template (value) Oct48 p_compressed_y_0 + ) := { + compressed_y_0 := p_compressed_y_0 + } // End of template m_eccP384CurvePoint_compressed_y_0 + + template (present) EccP384CurvePoint mw_eccP384CurvePoint_compressed_y_0( + template (present) Oct48 p_compressed_y_0 := ? + ) := { + compressed_y_0 := p_compressed_y_0 + } // End of template mw_eccP384CurvePoint_compressed_y_0 + + template (value) EccP384CurvePoint m_eccP384CurvePoint_compressed_y_1( + in template (value) Oct48 p_compressed_y_1 + ) := { + compressed_y_1 := p_compressed_y_1 + } // End of template m_eccP384CurvePoint_compressed_y_1 + + template (present) EccP384CurvePoint mw_eccP384CurvePoint_compressed_y_1( + template (present) Oct48 p_compressed_y_1 := ? + ) := { + compressed_y_1 := p_compressed_y_1 + } // End of template mw_eccP384CurvePoint_compressed_y_1 + + template (value) EccP384CurvePoint m_eccP384CurvePoint_uncompressed( + in template (value) Oct48 p_x, + in template (value) Oct48 p_y + ) := { + uncompressedP384 := { + x := p_x, + y := p_y + } + } // End of template m_eccP384CurvePoint_uncompressed + + template (present) EccP384CurvePoint mw_eccP384CurvePoint_uncompressed( + template (present) Oct48 p_x := ?, + template (present) Oct48 p_y := ? + ) := { + uncompressedP384 := { + x := p_x, + y := p_y + } + } // End of template mw_eccP384CurvePoint_uncompressed + + } // End of group signatures /** * @desc Dummy send/receive templates for certificates - * @see Draft ETSI TS 103 097 V1.1.14 Clause 6 Specification of certificate format + * @see Draft ETSI TS 103 097 V1.3.1 Clause 6 Specification of certificate format */ - group dummyCertifices { + group certificates { /** - * @desc Dummy send templates for certificates - * @see Draft ETSI TS 103 097 V1.1.14 Clause 6 Specification of certificate format + * @desc Send certificate template + * @member p_signer_info Signer information + * @member p_subject_info The subject information + * @member p_subject_attributes List of subject attribute + * @member p_validity_restrictions List of validity restriction + * @member p_signature The signature + * @see Draft ETSI TS 103 097 V1.3.1 Clause 6.1 Certificate */ - group dummyCertificesSend { - - } // End of group dummyCertificesSend + template (omit) EtsiTs103097Certificate m_etsiTs103097Certificate( + in template (value) IssuerIdentifier p_issuer, + in template (value) ToBeSignedCertificate p_toBeSigned, + in template (omit) Signature p_signature_ := omit + ) := { + version := c_certificate_version, + type_ := explicit, + issuer := p_issuer, + toBeSigned := p_toBeSigned, + signature_ := p_signature_ + } // End of template m_etsiTs103097Certificate /** - * @desc Dummy receive templates for certificates - * @see Draft ETSI TS 103 097 V1.1.14 Clause 6 Specification of certificate format + * @desc Send certificate template + * @member p_signer_info Signer information + * @member p_subject_info The subject information + * @member p_subject_attributes List of subject attribute + * @member p_validity_restrictions List of validity restriction + * @member p_signature The signature + * @see Draft ETSI TS 103 097 V1.3.1 Clause 6.1 Certificate */ - group dummyCertificesRecv { - - /** - * @desc Dummy receive certificate template - * @see Draft ETSI TS 103 097 V1.1.14 Clause 6.1 Certificate - */ - template (present) Certificate mw_certificate_dummy := { - version := c_certificate_version, - signer_info := ?, - subject_info := ?, - subject_attributes := ?, - validity_restrictions := ?, - signature_ := ? - } // End of template mw_certificate_dummy - - } // End of group dummyCertificesRecv + template (present) EtsiTs103097Certificate mw_etsiTs103097Certificate( + template (present) IssuerIdentifier p_issuer := ?, + template (present) ToBeSignedCertificate p_toBeSigned := ?, + template (present) Signature p_signature_ := ? + ) := { + version := c_certificate_version, + type_ := explicit, + issuer := p_issuer, + toBeSigned := p_toBeSigned, + signature_ := p_signature_ + } // End of template mw_etsiTs103097Certificate - } // End of group dummyCertifices + } // End of group certificates - /** - * @desc Send/receive templates for certificates - * @see Draft ETSI TS 103 097 V1.1.14 Clause 6 Specification of certificate format - */ - group certificates { + group issuerIdentifier { + + template (value) IssuerIdentifier m_issuerIdentifier_self( + in template (value) HashAlgorithm p_self + ) := { + self_ := p_self + } // End of template m_issuerIdentifier_self + + template (present) IssuerIdentifier mw_issuerIdentifier_self( + template (present) HashAlgorithm p_self := ? + ) := { + self_ := p_self + } // End of template mw_issuerIdentifier_self + + template (value) IssuerIdentifier m_issuerIdentifier_sha256AndDigest( // FIXME Add opque field for unknown issuer? + in template (value) HashedId8 p_sha256AndDigest + ) := { + sha256AndDigest := p_sha256AndDigest + } // End of template m_issuerIdentifier_sha256AndDigest + + template (present) IssuerIdentifier mw_issuerIdentifier_sha256AndDigest( // FIXME Add opque field for unknown issuer? + template (present) HashedId8 p_sha256AndDigest := ? + ) := { + sha256AndDigest := p_sha256AndDigest + } // End of template mw_issuerIdentifier_sha256AndDigest + + template (value) IssuerIdentifier m_issuerIdentifier_sha384AndDigest( + in template (value) HashedId8 p_sha384AndDigest + ) := { + sha384AndDigest := p_sha384AndDigest + } // End of template m_issuerIdentifier_sha384AndDigest + + template (present) IssuerIdentifier mw_issuerIdentifier_sha384AndDigest( + template (present) HashedId8 p_sha384AndDigest := ? + ) := { + sha384AndDigest := p_sha384AndDigest + } // End of template mw_issuerIdentifier_sha384AndDigest + + } // End of group issuerIdentifier + + group toBeSignedCertificate { + + template (omit) ToBeSignedCertificate m_toBeSignedCertificate( + in template (value) CertificateId p_id, + in template (value) HashedId3 p_cracaId, + in template (value) CrlSeries p_crlSeries, + in template (value) SequenceOfPsidSsp p_appPermissions, + in template (value) SequenceOfPsidGroupPermissions p_certIssuePermissions, + in template (value) VerificationKeyIndicator p_verifyKeyIndicator, + in template (omit) SequenceOfPsidGroupPermissions p_certRequestPermissions := omit, + in template (omit) ValidityPeriod p_validityPeriod := omit, + in template (omit) GeographicRegion p_region := omit, + in template (omit) SubjectAssurance p_assuranceLevel := omit, + in template (omit) PublicEncryptionKey p_encryptionKey := omit + ) := { + id := p_id, + cracaId := p_cracaId, + crlSeries := p_crlSeries, + validityPeriod := p_validityPeriod, + region := p_region, + assuranceLevel := p_assuranceLevel, + appPermissions := p_appPermissions, + certIssuePermissions := p_certIssuePermissions, + certRequestPermissions := p_certRequestPermissions, + canRequestRollover := omit, + encryptionKey := p_encryptionKey, + verifyKeyIndicator := p_verifyKeyIndicator + } // End of template m_toBeSignedCertificate + + template ToBeSignedCertificate mw_toBeSignedCertificate( + template (present) CertificateId p_id := ?, + template (present) HashedId3 p_cracaId := ?, + template (present) CrlSeries p_crlSeries := ?, + template (present) SequenceOfPsidSsp p_appPermissions := ?, + template (present) SequenceOfPsidGroupPermissions p_certIssuePermissions := ?, + template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, + template SequenceOfPsidGroupPermissions p_certRequestPermissions := *, + template ValidityPeriod p_validityPeriod := *, + template GeographicRegion p_region := *, + template SubjectAssurance p_assuranceLevel := *, + template PublicEncryptionKey p_encryptionKey := * + ) := { + id := p_id, + cracaId := p_cracaId, + crlSeries := p_crlSeries, + validityPeriod := p_validityPeriod, + region := p_region, + assuranceLevel := p_assuranceLevel, + appPermissions := p_appPermissions, + certIssuePermissions := p_certIssuePermissions, + certRequestPermissions := p_certRequestPermissions, + canRequestRollover := *, + encryptionKey := p_encryptionKey, + verifyKeyIndicator := p_verifyKeyIndicator + } // End of template mw_toBeSignedCertificate + + } // End of toBeSignedCertificate + + group keys { + + template (value) VerificationKeyIndicator m_verificationKeyIndicator_verificationKey( + in template (value) PublicVerificationKey p_verificationKey + ) := { + verificationKey := p_verificationKey + } // End of template m_verificationKeyIndicator_verificationKey + + template (present) VerificationKeyIndicator mw_verificationKeyIndicator_verificationKey( + template (present) PublicVerificationKey p_verificationKey := ? + ) := { + verificationKey := p_verificationKey + } // End of template mw_verificationKeyIndicator_verificationKey + + template (value) VerificationKeyIndicator m_verificationKeyIndicator_reconstructionValue( + in template (value) EccP256CurvePoint p_reconstructionValue + ) := { + reconstructionValue := p_reconstructionValue + } // End of template m_verificationKeyIndicator_reconstructionValue + + template (present) VerificationKeyIndicator mw_verificationKeyIndicator_reconstructionValue( + template (present) EccP256CurvePoint p_reconstructionValue := ? + ) := { + reconstructionValue := p_reconstructionValue + } // End of template mw_verificationKeyIndicator_reconstructionValue + + template (value) PublicVerificationKey m_publicVerificationKey_ecdsaNistP256( + in template (value) EccP256CurvePoint p_ecdsaNistP256 + ) := { + ecdsaNistP256 := p_ecdsaNistP256 + } // End of template m_publicVerificationKey_ecdsaNistP256 + + template (present) PublicVerificationKey mw_publicVerificationKey_ecdsaNistP256( + template (present) EccP256CurvePoint p_ecdsaNistP256 := ? + ) := { + ecdsaNistP256 := p_ecdsaNistP256 + } // End of template mw_publicVerificationKey_ecdsaNistP256 + + } // End of group keys + + group appPermissions { + + template (omit) PsidSsp m_appPermissions( + in template (value) Psid p_psid, + in template (omit) ServiceSpecificPermissions p_ssp := omit + ) := { + psid := p_psid, + ssp := p_ssp + } // End of template m_appPermissions + + template (value) PsidSspRange m_psidSspRange( + in Psid p_psid, + in template (value) SspRange p_sspRange := m_SspRange_all + ) := { + psid := p_psid, + sspRange := p_sspRange + } // End of template m_psidSspRange + + template (value) SspRange m_SspRange_all := { + all_ := NULL + } // End of template m_SspRange_all + + template (value) SspRange m_SspRange_opaque( + in template (value) SequenceOfOctetString p_opaque + ) := { + opaque := p_opaque + } // End of template m_SspRange_opaque + + template (value) SspRange m_SspRange_bitmapSspRange( + in template (value) BitmapSspRange p_bitmapSspRange + ) := { + bitmapSspRange := p_bitmapSspRange + } // End of template m_SspRange_bitmapSspRange + + template (value) PsidGroupPermissions m_psidGroupPermissions( + in template (value) SubjectPermissions p_subjectPermissions, + in integer p_minChainLength := 1, + in integer p_chainLengthRange := 0, + in EndEntityType p_eeType := oct2bit('00'O) + ) := { + subjectPermissions := p_subjectPermissions, + minChainLength := p_minChainLength, + chainLengthRange := p_chainLengthRange, + eeType := p_eeType + } // End of template m_psidGroupPermissions + + template (value) SubjectPermissions m_subjectPermissions_explicit( + in template (value) SequenceOfPsidSspRange p_certIssuePermissions + ) := { + explicit := p_certIssuePermissions + } // End of template m_subjectPermissions_explicit + + template (value) SubjectPermissions m_subjectPermissions_all := { + all_ := NULL + } // End of template m_subjectPermissions_all + + } // End of group appPermissions + + + group validityRestriction { + + template (value) ValidityPeriod m_validityPeriod( + in template (value) Time32 p_start_, + in template (value) Duration p_duration + ) := { + start_ := p_start_, + duration := p_duration + } // End of template m_validityPeriod + + template (present) ValidityPeriod mw_validityPeriod( + template (present) Time32 p_start_ := ?, + template (present) Duration p_duration := ? + ) := { + start_ := p_start_, + duration := p_duration + } // End of template mw_validityPeriod /** - * @desc Send templates for certificates - * @see Draft ETSI TS 103 097 V1.1.14 Clause 6 Specification of certificate format + * @desc Send template for Duration (in seconds) + * @param p_duration The duration value + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.18 Duration */ - group certificatesSend { - - /** - * @desc Send certificate template - * @member p_signer_info Signer information - * @member p_subject_info The subject information - * @member p_subject_attributes List of subject attribute - * @member p_validity_restrictions List of validity restriction - * @member p_signature The signature - * @see Draft ETSI TS 103 097 V1.1.14 Clause 6.1 Certificate - */ - template (value) Certificate m_certificate( - in template (value) SignerInfo p_signer_info, - in template (value) SubjectInfo p_subject_info, - in template (value) SubjectAttributes p_subject_attributes, - in template (value) ValidityRestrictions p_validity_restrictions, - in template (value) Signature p_signature - ) := { - version := c_certificate_version, - signer_info := p_signer_info, - subject_info := p_subject_info, - subject_attributes := p_subject_attributes, - validity_restrictions := p_validity_restrictions, - signature_ := p_signature - } // End of template m_certificate - - /** - * @desc Send templates for certificates - * @see Draft ETSI TS 103 097 V1.1.14 Clause 6.2 SubjectInfo - */ - group subjectInfo { - - template (value) SubjectInfo m_subject_info_root_ca( - in template (value) Oct0to31 p_subject_name - ) := { - subject_type := e_root_ca, - subject_name := p_subject_name - } // End of template m_subject_info_root_ca - - template (value) SubjectInfo m_subject_info_authorization_authority( - in template (value) Oct0to31 p_subject_name - ) := { - subject_type := e_authorization_authority, - subject_name := p_subject_name - } // End of template m_subject_info_authorization_authority - - template (value) SubjectInfo m_subject_info_authorization_ticket := { - subject_type := e_authorization_ticket, - subject_name := ''O - } // End of template m_subject_info_authorization_ticket - - template (value) SubjectInfo m_subject_info_revocation( - in template (value) Oct0to31 p_subject_name - ) := { - subject_type := e_crl_signer, - subject_name := p_subject_name - } // End of template m_subject_info_revocation - - } // End of group subjectInfo - - group subjectAttribute { - - template (value) SubjectAttribute m_subject_attribute_verification_key( - in template (value) PublicKey p_key - ) := { - type_ := e_verification_key, - attribute := { - key := p_key - } - } // End of template m_subject_attribute_verification_key - - template (value) SubjectAttribute m_subject_attribute_encryption_key( - in template (value) PublicKey p_key - ) := { - type_ := e_encryption_key, - attribute := { - key := p_key - } - } // End of template m_subject_attribute_encryption_key - - template (value) SubjectAttribute m_subject_attribute_reconstruction_value( - in template (value) EccPoint p_rv - ) := { - type_ := e_reconstruction_value, - attribute := { - rv := p_rv - } - } // End of template m_subject_attribute_reconstruction_value - - template (value) SubjectAttribute m_subject_attribute_assurance_level( - in template (value) SubjectAssurance p_assurance_level - ) := { - type_ := e_assurance_level, - attribute := { - assurance_level := p_assurance_level - } - } // End of template m_subject_attribute_assurance_level - - template (value) SubjectAttribute m_subject_attribute_its_aid_list( - in template (value) IntXs p_its_aid_list - ) := { - type_ := e_its_aid_list, - attribute := { - its_aid_list := p_its_aid_list - } - } // End of template m_subject_attribute_its_aid_list - - template (value) SubjectAttribute m_subject_attribute_its_aid_ssp_list( - in template (value) ItsAidSsps p_its_aid_ssp_list - ) := { - type_ := e_its_aid_ssp_list, - attribute := { - its_aid_ssp_list := p_its_aid_ssp_list - } - } // End of template m_subject_attribute_its_aid_ssp_list - - } // End of group subjectAttribute - - group subjectAssurance { - - template (value) SubjectAssurance m_subjectAssurance( - in template (value) Bit3 p_levels, - in template (value) Bit2 p_confidence - ) := { - levels := p_levels, - reserved := '000'B, - confidence := p_confidence - } // End of template m_subjectAssurance - - } // End of group subjectAssurance - - group validityRestriction { - - template (value) ValidityRestriction m_validity_restriction_time_end( - in template (value) Time32 p_end_validity - ) := { - type_ := e_time_end, - validity := { - end_validity := p_end_validity - } // End of field validity - } // End of template m_validity_restriction_time_end - - template (value) ValidityRestriction m_validity_restriction_time_start_and_end( - in template (value) Time32 p_start_validity, - in template (value) Time32 p_end_validity - ) := { - type_ := e_time_start_and_end, - validity := { - time_start_and_end := { - start_validity := p_start_validity, - end_validity := p_end_validity - } // End of field time_start_and_end - } // End of field validity - } // End of template m_validity_restriction_time_start_and_end - - template (value) ValidityRestriction m_validity_restriction_time_start_and_duration( - in template (value) Time32 p_start_validity, - in template (value) Duration p_duration - ) := { - type_ := e_time_start_and_duration, - validity := { - time_start_and_duration := { - start_validity := p_start_validity, - duration_ := p_duration - } // End of field time_start_and_duration - } // End of field validity - } // End of template m_validity_restriction_time_start_and_duration - - template (value) ValidityRestriction m_validity_restriction_region( - in template (value) GeographicRegion p_region - ) := { - type_ := e_region, - validity := { - region := p_region - } // End of field validity - } // End of template m_validity_restriction_region - - template (value) ValidityRestriction m_validity_restriction_unknown := { - type_ := e_unknown, - validity := { - data := ''O - } // End of field validity - } // End of template m_validity_restriction_unknown - - } // End of group validityRestriction - - } // End of group certificatesSend + template (value) Duration m_duration_in_seconds( + in template (value) Int16 p_duration + ) := { + seconds := p_duration + } // End of template m_duration_in_seconds /** - * @desc Receive templates for certificates - * @see Draft ETSI TS 103 097 V1.1.14 Clause 6 Specification of certificate format + * @desc Receive template for Duration (in seconds) + * @param p_duration The duration value + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.18 Duration */ - group certificatesRecv { - - template (present) Certificate mw_certificate( - in template (present) SignerInfo p_signer_info := ?, - in template (present) SubjectInfo p_subject_info := ?, - in template (present) SubjectAttributes p_subject_attributes := ?, - in template (present) ValidityRestrictions p_validity_restrictions := ?, - in template (present) Signature p_signature := ? - ) := { - version := c_certificate_version, - signer_info := p_signer_info, - subject_info := p_subject_info, - subject_attributes := p_subject_attributes, - validity_restrictions := p_validity_restrictions, - signature_ := p_signature - } // End of template m_certificate - - template (present) Certificate mw_aa_certificate( - in template (present) SignerInfo p_signer_info := ?, - in template (present) SubjectAttributes p_subject_attributes := ?, - in template (present) ValidityRestrictions p_validity_restrictions := ?, - in template (present) Signature p_signature := ? - ) := { - version := c_certificate_version, - signer_info := p_signer_info, - subject_info := { - subject_type := e_authorization_authority, - subject_name := ? - }, - subject_attributes := p_subject_attributes, - validity_restrictions := p_validity_restrictions, - signature_ := p_signature - } // End of template m_aa_certificate + template (present) Duration mw_duration_in_seconds( + template (present) Int16 p_duration := ? + ) := { + seconds := p_duration + } // End of template mw_duration_in_seconds + + template (value) Duration m_duration_years( + in template (value) Uint16 p_years + ) := { + years := p_years + } // End of template m_duration_years + + template (present) Duration mw_duration_years( + template (present) Uint16 p_years := ? + ) := { + years := p_years + } // End of template mw_duration_years + + } // End of group validityRestriction + + group ssp {/* + + group sspTest { - template (present) Certificate mw_at_certificate( - in template (present) SignerInfo p_signer_info := ?, - in template (present) SubjectAttributes p_subject_attributes := ?, - in template (present) ValidityRestrictions p_validity_restrictions := ?, - in template (present) Signature p_signature :=? - ) := { - version := c_certificate_version, - signer_info := p_signer_info, - subject_info := { - subject_type := e_authorization_ticket, - subject_name := ? - }, - subject_attributes := p_subject_attributes, - validity_restrictions := p_validity_restrictions, - signature_ := p_signature - } // End of template m_at_certificate + template (present) ServiceSpecificPermissions m_sspTest := { + version := '00'O, + sspContainer := omit + } // End of template mw_sspTest - group subjectInfo { - - template (present) SubjectInfo mw_subject_info_root_ca( - in template (present) Oct0to31 p_subject_name - ) := { - subject_type := e_root_ca, - subject_name := p_subject_name - } // End of template mw_subject_info_root_ca - - template (present) SubjectInfo mw_subject_info_revocation( - in template (present) Oct0to31 p_subject_name - ) := { - subject_type := e_crl_signer, - subject_name := p_subject_name - } // End of template mw_subject_info_revocation - - } // End of group subjectInfo + template (present) ServiceSpecificPermissions mw_sspTest := { + version := '00'O, + sspContainer := * + } // End of template mw_sspTest - group subjectAttribute { - - template (present) SubjectAttribute mw_subject_attribute_verification_key( - in template (present) PublicKey p_key := ? - ) := { - type_ := e_verification_key, - attribute := { - key := p_key - } - } // End of template mw_subject_attribute_verification_key - - group publicKeyRecv { - - /** - * @desc Receive template for PublicKey/EccPoint/Compressed_lsb_y_0 - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.4 PublicKey - */ - template (present) PublicKey mw_publicKey_eccPoint_compressed_lsb_y_0 - modifies mw_publicKey_eccPoint_dummy := { - public_key := { - eccPoint := mw_eccPointecdsa_nistp256_with_sha256_y0_coordinate_only - } // End of field public_key - } // End of template mw_publicKey_eccPoint_compressed_lsb_y_0 - - /** - * @desc Receive template for PublicKey/EccPoint/Compressed_lsb_y_1 - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.4 PublicKey - */ - template (present) PublicKey mw_publicKey_eccPoint_compressed_lsb_y_1 - modifies mw_publicKey_eccPoint_dummy := { - public_key := { - eccPoint := mw_eccPointecdsa_nistp256_with_sha256_y1_coordinate_only - } // End of field public_key - } // End of template mw_publicKey_eccPoint_compressed_lsb_y_1 - - /** - * @desc Receive template for PublicKey/EccPoint/Uncompressed - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.4 PublicKey - */ - template (present) PublicKey mw_publicKey_eccPoint_uncompressed - modifies mw_publicKey_eccPoint_dummy := { - public_key := { - eccPoint := mw_eccPointecdsa_nistp256_with_sha256_uncompressed - } // End of field public_key - } // End of template mw_publicKey_eccPoint_compressed_lsb_y_0 - - } // End of group publicKeyRecv + } // End of group sspTest + + group sspCam { + + group sspCamSend { + + template (value) SspCAM m_sspCAMContainer_sign_all := { + cenDsrcTollingZone := '1'B, + publicTransport := '1'B, + specialTransport := '1'B, + dangerousGoods := '1'B, + roadwork := '1'B, + rescue := '1'B, + emergency := '1'B, + safetyCar := '1'B, + closedLanes := '1'B, + requestForRightOfWay := '1'B, + requestForFreeCrossingAtATrafficLight := '1'B, + noPassing := '1'B, + noPassingForTrucks := '1'B, + speedLimit := '1'B, + reserved1 := '0'B, + reserved2 := '0'B + } // End of template m_sspCAMContainer_sign_all + + template (value) SspCAM m_sspCAMContainer_vehicle + modifies m_sspCAMContainer_sign_all := { + cenDsrcTollingZone := '0'B, + closedLanes := '0'B, + noPassing := '0'B, + noPassingForTrucks := '0'B, + speedLimit := '0'B + } // End of template m_sspCAMContainer_vehicle + + template (value) ServiceSpecificPermissions m_sspCAM_sign_all := { + version := '01'O, + sspContainer := { + sspCAM := m_sspCAMContainer_sign_all + } // End of field sspContainer + } // End of template m_sspCAM_sign_all + + template (value) ServiceSpecificPermissions m_sspCAM_vehicle + modifies m_sspCAM_sign_all := { + sspContainer := { + sspCAM := m_sspCAMContainer_vehicle + } // End of field sspContainer + } // End of template m_sspCAM_vehicle + + } // End of group sspCamSend + + group sspCamRecv { + + template (present) SspCAM mw_sspCAMContainer_dummy := { + cenDsrcTollingZone := ?, + publicTransport := ?, + specialTransport := ?, + dangerousGoods := ?, + roadwork := ?, + rescue := ?, + emergency := ?, + safetyCar := ?, + closedLanes := ?, + requestForRightOfWay := ?, + requestForFreeCrossingAtATrafficLight := ?, + noPassing := ?, + noPassingForTrucks := ?, + speedLimit := ?, + reserved1 := ?, + reserved2 := ? + } // End of template mw_sspCAMContainer_dummy - template (present) SubjectAttribute mw_subject_attribute_encryption_key( - in template (present) EccPoint p_rv := ? - ) := { - type_ := e_encryption_key, - attribute := { - rv := p_rv + + template (present) ServiceSpecificPermissions mw_sspCAM_dummy := { + version := '01'O, + sspContainer := { + sspCAM := mw_sspCAMContainer_dummy } - } // End of template mw_subject_attribute_encryption_key + } // End of template mw_sspCAM_dummy - template (present) SubjectAttribute mw_subject_attribute_assurance_level( - in template (present) SubjectAssurance p_assurance_level := ? - ) := { - type_ := e_assurance_level, - attribute := { - assurance_level := p_assurance_level - } - } // End of template mw_subject_attribute_assurance_level + } // End of group sspCamRecv + + } // End of group sspCam + + group sspDenm { + + group sspDenmSend { + + template (value) SspDENM m_sspDENMContainer_sign_all := { + trafficCondition := '1'B, + accident := '1'B, + roadworks := '1'B, + adverseWeatherCondition_Adhesion := '1'B, + hazardousLocation_SurfaceCondition := '1'B, + hazardousLocation_ObstacleOnTheRoad := '1'B, + hazardousLocation_AnimalOnTheRoad := '1'B, + humanPresenceOnTheRoad := '1'B, + wrongWayDriving := '1'B, + rescueAndRecoveryWorkInProgress := '1'B, + adverseWeatherCondition_ExtremeWeatherCondition := '1'B, + adverseWeatherCondition_Visibility := '1'B, + adverseWeatherCondition_Precipitation := '1'B, + slowVehicle := '1'B, + dangerousEndOfQueue := '1'B, + vehicleBreakdown := '1'B, + postCrash := '1'B, + humanProblem := '1'B, + stationaryVehicle := '1'B, + emergencyVehicleApproaching := '1'B, + hazardousLocation_DangerousCurve := '1'B, + collisionRisk := '1'B, + signalViolation := '1'B, + dangerousSituation := '1'B + } // End of template m_sspDENMContainer_sign_all + + template (value) SspDENM m_sspDENMContainer_vehicle + modifies m_sspDENMContainer_sign_all:= { + trafficCondition := '0'B, + accident := '0'B, + roadworks := '0'B, + adverseWeatherCondition_Adhesion := '0'B, + hazardousLocation_SurfaceCondition := '0'B, + hazardousLocation_ObstacleOnTheRoad := '0'B, + hazardousLocation_AnimalOnTheRoad := '0'B, + slowVehicle := '0'B, + dangerousEndOfQueue := '0'B, + vehicleBreakdown := '0'B, + stationaryVehicle := '0'B + } // End of template m_sspDENMContainer_sign_all + + template (value) SspDENM m_sspDENMContainer_roadSideUnit + modifies m_sspDENMContainer_sign_all:= { + trafficCondition := '0'B, + accident := '0'B, + roadworks := '0'B, + adverseWeatherCondition_Adhesion := '0'B, + hazardousLocation_SurfaceCondition := '0'B, + hazardousLocation_ObstacleOnTheRoad := '0'B, + hazardousLocation_AnimalOnTheRoad := '0'B, + humanPresenceOnTheRoad := '0'B, + wrongWayDriving := '0'B, + rescueAndRecoveryWorkInProgress := '0'B, + adverseWeatherCondition_ExtremeWeatherCondition := '0'B, + adverseWeatherCondition_Visibility := '0'B, + adverseWeatherCondition_Precipitation := '0'B, + postCrash := '0'B, + humanProblem := '0'B, + stationaryVehicle := '0'B, + hazardousLocation_DangerousCurve := '0'B, + collisionRisk := '0'B, + dangerousSituation := '0'B + } // End of template m_sspDENMContainer_roadSideUnit + + template (value) ServiceSpecificPermissions m_sspDENM_sign_all := { + version := '01'O, + sspContainer := { + sspDENM := m_sspDENMContainer_sign_all + } // End of field sspContainer + } // End of template m_sspDENM_sign_all - template (present) SubjectAttribute mw_subject_attribute_reconstruction_value( - in template (present) IntXs p_its_aid_list := ? - ) := { - type_ := e_reconstruction_value, - attribute := { - its_aid_list := p_its_aid_list + + template (value) ServiceSpecificPermissions m_sspDENM_vehicle + modifies m_sspDENM_sign_all := { + sspContainer := { + sspDENM := m_sspDENMContainer_vehicle + } // End of field sspContainer + } // End of template m_sspDENM_vehicle + + template (value) ServiceSpecificPermissions m_sspDENM_roadSideUnit + modifies m_sspDENM_sign_all := { + sspContainer := { + sspDENM := m_sspDENMContainer_vehicle + } // End of field sspContainer + } // End of template m_sspDENM_roadSideUnit + + } // End of group sspDenmSend + + group sspDenmRecv { + + template (present) SspDENM mw_sspDENMContainer_dummy := { + trafficCondition := ?, + accident := ?, + roadworks := ?, + adverseWeatherCondition_Adhesion := ?, + hazardousLocation_SurfaceCondition := ?, + hazardousLocation_ObstacleOnTheRoad := ?, + hazardousLocation_AnimalOnTheRoad := ?, + humanPresenceOnTheRoad := ?, + wrongWayDriving := ?, + rescueAndRecoveryWorkInProgress := ?, + adverseWeatherCondition_ExtremeWeatherCondition := ?, + adverseWeatherCondition_Visibility := ?, + adverseWeatherCondition_Precipitation := ?, + slowVehicle := ?, + dangerousEndOfQueue := ?, + vehicleBreakdown := ?, + postCrash := ?, + humanProblem := ?, + stationaryVehicle := ?, + emergencyVehicleApproaching := ?, + hazardousLocation_DangerousCurve := ?, + collisionRisk := ?, + signalViolation := ?, + dangerousSituation := ? + } // End of template mw_sspDENMContainer_dummy + + template (present) SspDENM mw_sspDENMContainer_vehicle + modifies mw_sspDENMContainer_dummy := { + trafficCondition := '0'B, + accident := '0'B, + roadworks := '0'B, + adverseWeatherCondition_Adhesion := '0'B, + hazardousLocation_SurfaceCondition := '0'B, + hazardousLocation_ObstacleOnTheRoad := '0'B, + hazardousLocation_AnimalOnTheRoad := '0'B, + slowVehicle := '0'B, + dangerousEndOfQueue := '0'B, + vehicleBreakdown := '0'B, + stationaryVehicle := '0'B + } // End of template mw_sspDENMContainer_vehicle + + template (present) SspDENM mw_sspDENMContainer_roadSideUnit + modifies mw_sspDENMContainer_dummy := { + trafficCondition := '0'B, + accident := '0'B, + roadworks := '0'B, + adverseWeatherCondition_Adhesion := '0'B, + hazardousLocation_SurfaceCondition := '0'B, + hazardousLocation_ObstacleOnTheRoad := '0'B, + hazardousLocation_AnimalOnTheRoad := '0'B, + humanPresenceOnTheRoad := '0'B, + wrongWayDriving := '0'B, + rescueAndRecoveryWorkInProgress := '0'B, + adverseWeatherCondition_ExtremeWeatherCondition := '0'B, + adverseWeatherCondition_Visibility := '0'B, + adverseWeatherCondition_Precipitation := '0'B, + postCrash := '0'B, + humanProblem := '0'B, + stationaryVehicle := '0'B, + hazardousLocation_DangerousCurve := '0'B, + collisionRisk := '0'B, + dangerousSituation := '0'B + } // End of template m_sspDENMContainer_roadSideUnit + + template (present) ServiceSpecificPermissions mw_sspDENM_dummy := { + version := '01'O, + sspContainer := { + sspDENM := mw_sspDENMContainer_dummy } - } // End of template mw_subject_attribute_reconstruction_value + } // End of template mw_sspDENM_dummy - template (present) SubjectAttribute mw_subject_attribute_its_aid_list( - in template (present) IntXs p_its_aid_list := ? - ) := { - type_ := e_its_aid_list, - attribute := { - its_aid_list := p_its_aid_list + template (present) ServiceSpecificPermissions mw_sspDENM_vehicle + modifies mw_sspDENM_dummy := { + sspContainer := { + sspDENM := mw_sspDENMContainer_vehicle } - } // End of template mw_subject_attribute_its_aid_list + } // End of template mw_sspDENM_vehicle - template (present) SubjectAttribute mw_subject_attribute_its_aid_ssp_list( - in template (present) ItsAidSsps p_its_aid_ssp_list := ? - ) := { - type_ := e_its_aid_ssp_list, - attribute := { - its_aid_ssp_list := p_its_aid_ssp_list + template (present) ServiceSpecificPermissions mw_sspDENM_roadSideUnit + modifies mw_sspDENM_dummy := { + sspContainer := { + sspDENM := mw_sspDENMContainer_roadSideUnit } - } // End of template mw_subject_attribute_its_aid_ssp_list - - } // End of group subjectAttribute - - group subjectAssurance { - - template (present) SubjectAssurance mw_subjectAssurance( - in template (present) Bit3 p_levels, - in template (present) Bit2 p_confidence - ) := { - levels := p_levels, - reserved := '000'B, - confidence := p_confidence - } // End of template mw_subjectAssurance + } // End of template mw_sspDENM_roadSideUnit - } // End of group subjectAssurance + } // End of group sspDenmRecv - group validityRestriction { - - template (present) ValidityRestriction mw_validity_restriction_time_end( - in template (present) Time32 p_end_validity := ? - ) := { - type_ := e_time_end, - validity := { - end_validity := p_end_validity - } // End of field validity - } // End of template mw_validity_restriction_time_end - - template (present) ValidityRestriction mw_validity_restriction_time_start_and_end( - in template (present) Time32 p_start_validity := ?, - in template (present) Time32 p_end_validity := ? - ) := { - type_ := e_time_start_and_end, - validity := { - time_start_and_end := { - start_validity := p_start_validity, - end_validity := p_end_validity - } // End of field time_start_and_end - } // End of field validity - } // End of template mw_validity_restriction_time_start_and_end - - template (present) ValidityRestriction mw_validity_restriction_time_start_and_duration( - in template (present) Time32 p_start_validity := ?, - in template (present) Duration p_duration := ? - ) := { - type_ := e_time_start_and_duration, - validity := { - time_start_and_duration := { - start_validity := p_start_validity, - duration_ := p_duration - } // End of field time_start_and_duration - } // End of field validity - } // End of template mw_validity_restriction_time_start_and_duration - - /** - * @desc Receive template for any region excepted 'none' - */ - template (present) ValidityRestriction mw_validity_restriction_any_valid_region := { - type_ := e_region, - validity := { - region := { - region_type := complement(e_none), - region := * - } - } // End of field validity - } // End of template mw_validity_restriction_any_valid_region - - /** - * @desc Receive template for specified region - * @param p_region The expected region - */ - template (present) ValidityRestriction mw_validity_restriction_region( - in template (present) GeographicRegion p_region := ? - ) := { - type_ := e_region, - validity := { - region := p_region - } // End of field validity - } // End of template mw_validity_restriction_region - - } // End of group validityRestriction - - } // End of group certificatesRecv + } // End of group sspDenm - group ssp { - - group sspTest { - - template (present) ServiceSpecificPermissions m_sspTest := { - version := '00'O, - sspContainer := omit - } // End of template mw_sspTest - - template (present) ServiceSpecificPermissions mw_sspTest := { - version := '00'O, - sspContainer := * - } // End of template mw_sspTest - - } // End of group sspTest - - group sspCam { - - group sspCamSend { - - /** - * @desc - */ - template (value) SspCAM m_sspCAMContainer_sign_all := { - cenDsrcTollingZone := '1'B, - publicTransport := '1'B, - specialTransport := '1'B, - dangerousGoods := '1'B, - roadwork := '1'B, - rescue := '1'B, - emergency := '1'B, - safetyCar := '1'B, - closedLanes := '1'B, - requestForRightOfWay := '1'B, - requestForFreeCrossingAtATrafficLight := '1'B, - noPassing := '1'B, - noPassingForTrucks := '1'B, - speedLimit := '1'B, - reserved1 := '0'B, - reserved2 := '0'B - } // End of template m_sspCAMContainer_sign_all - - /** - * @desc - */ - template (value) SspCAM m_sspCAMContainer_vehicle - modifies m_sspCAMContainer_sign_all := { - cenDsrcTollingZone := '0'B, - closedLanes := '0'B, - noPassing := '0'B, - noPassingForTrucks := '0'B, - speedLimit := '0'B - } // End of template m_sspCAMContainer_vehicle - - - /** - * @desc - */ - template (value) ServiceSpecificPermissions m_sspCAM_sign_all := { - version := '01'O, - sspContainer := { - sspCAM := m_sspCAMContainer_sign_all - } // End of field sspContainer - } // End of template m_sspCAM_sign_all - - /** - * @desc - */ - template (value) ServiceSpecificPermissions m_sspCAM_vehicle - modifies m_sspCAM_sign_all := { - sspContainer := { - sspCAM := m_sspCAMContainer_vehicle - } // End of field sspContainer - } // End of template m_sspCAM_vehicle - - } // End of group sspCamSend - - group sspCamRecv { - - /** - * @desc - */ - template (present) SspCAM mw_sspCAMContainer_dummy := { - cenDsrcTollingZone := ?, - publicTransport := ?, - specialTransport := ?, - dangerousGoods := ?, - roadwork := ?, - rescue := ?, - emergency := ?, - safetyCar := ?, - closedLanes := ?, - requestForRightOfWay := ?, - requestForFreeCrossingAtATrafficLight := ?, - noPassing := ?, - noPassingForTrucks := ?, - speedLimit := ?, - reserved1 := ?, - reserved2 := ? - } // End of template mw_sspCAMContainer_dummy - - /** - * @desc - */ - template (present) ServiceSpecificPermissions mw_sspCAM_dummy := { - version := '01'O, - sspContainer := { - sspCAM := mw_sspCAMContainer_dummy - } - } // End of template mw_sspCAM_dummy - - } // End of group sspCamRecv - - } // End of group sspCam - - group sspDenm { - - group sspDenmSend { - - /** - * @desc - */ - template (value) SspDENM m_sspDENMContainer_sign_all := { - trafficCondition := '1'B, - accident := '1'B, - roadworks := '1'B, - adverseWeatherCondition_Adhesion := '1'B, - hazardousLocation_SurfaceCondition := '1'B, - hazardousLocation_ObstacleOnTheRoad := '1'B, - hazardousLocation_AnimalOnTheRoad := '1'B, - humanPresenceOnTheRoad := '1'B, - wrongWayDriving := '1'B, - rescueAndRecoveryWorkInProgress := '1'B, - adverseWeatherCondition_ExtremeWeatherCondition := '1'B, - adverseWeatherCondition_Visibility := '1'B, - adverseWeatherCondition_Precipitation := '1'B, - slowVehicle := '1'B, - dangerousEndOfQueue := '1'B, - vehicleBreakdown := '1'B, - postCrash := '1'B, - humanProblem := '1'B, - stationaryVehicle := '1'B, - emergencyVehicleApproaching := '1'B, - hazardousLocation_DangerousCurve := '1'B, - collisionRisk := '1'B, - signalViolation := '1'B, - dangerousSituation := '1'B - } // End of template m_sspDENMContainer_sign_all - - /** - * @desc - */ - template (value) SspDENM m_sspDENMContainer_vehicle - modifies m_sspDENMContainer_sign_all:= { - trafficCondition := '0'B, - accident := '0'B, - roadworks := '0'B, - adverseWeatherCondition_Adhesion := '0'B, - hazardousLocation_SurfaceCondition := '0'B, - hazardousLocation_ObstacleOnTheRoad := '0'B, - hazardousLocation_AnimalOnTheRoad := '0'B, - slowVehicle := '0'B, - dangerousEndOfQueue := '0'B, - vehicleBreakdown := '0'B, - stationaryVehicle := '0'B - } // End of template m_sspDENMContainer_sign_all - - /** - * @desc - */ - template (value) SspDENM m_sspDENMContainer_roadSideUnit - modifies m_sspDENMContainer_sign_all:= { - trafficCondition := '0'B, - accident := '0'B, - roadworks := '0'B, - adverseWeatherCondition_Adhesion := '0'B, - hazardousLocation_SurfaceCondition := '0'B, - hazardousLocation_ObstacleOnTheRoad := '0'B, - hazardousLocation_AnimalOnTheRoad := '0'B, - humanPresenceOnTheRoad := '0'B, - wrongWayDriving := '0'B, - rescueAndRecoveryWorkInProgress := '0'B, - adverseWeatherCondition_ExtremeWeatherCondition := '0'B, - adverseWeatherCondition_Visibility := '0'B, - adverseWeatherCondition_Precipitation := '0'B, - postCrash := '0'B, - humanProblem := '0'B, - stationaryVehicle := '0'B, - hazardousLocation_DangerousCurve := '0'B, - collisionRisk := '0'B, - dangerousSituation := '0'B - } // End of template m_sspDENMContainer_roadSideUnit - - /** - * @desc - */ - template (value) ServiceSpecificPermissions m_sspDENM_sign_all := { - version := '01'O, - sspContainer := { - sspDENM := m_sspDENMContainer_sign_all - } // End of field sspContainer - } // End of template m_sspDENM_sign_all - - /** - * @desc - */ - template (value) ServiceSpecificPermissions m_sspDENM_vehicle - modifies m_sspDENM_sign_all := { - sspContainer := { - sspDENM := m_sspDENMContainer_vehicle - } // End of field sspContainer - } // End of template m_sspDENM_vehicle - - /** - * @desc - */ - template (value) ServiceSpecificPermissions m_sspDENM_roadSideUnit - modifies m_sspDENM_sign_all := { - sspContainer := { - sspDENM := m_sspDENMContainer_vehicle - } // End of field sspContainer - } // End of template m_sspDENM_roadSideUnit - - } // End of group sspDenmSend - - group sspDenmRecv { - - /** - * @desc - */ - template (present) SspDENM mw_sspDENMContainer_dummy := { - trafficCondition := ?, - accident := ?, - roadworks := ?, - adverseWeatherCondition_Adhesion := ?, - hazardousLocation_SurfaceCondition := ?, - hazardousLocation_ObstacleOnTheRoad := ?, - hazardousLocation_AnimalOnTheRoad := ?, - humanPresenceOnTheRoad := ?, - wrongWayDriving := ?, - rescueAndRecoveryWorkInProgress := ?, - adverseWeatherCondition_ExtremeWeatherCondition := ?, - adverseWeatherCondition_Visibility := ?, - adverseWeatherCondition_Precipitation := ?, - slowVehicle := ?, - dangerousEndOfQueue := ?, - vehicleBreakdown := ?, - postCrash := ?, - humanProblem := ?, - stationaryVehicle := ?, - emergencyVehicleApproaching := ?, - hazardousLocation_DangerousCurve := ?, - collisionRisk := ?, - signalViolation := ?, - dangerousSituation := ? - } // End of template mw_sspDENMContainer_dummy - - /** - * @desc - */ - template (present) SspDENM mw_sspDENMContainer_vehicle - modifies mw_sspDENMContainer_dummy := { - trafficCondition := '0'B, - accident := '0'B, - roadworks := '0'B, - adverseWeatherCondition_Adhesion := '0'B, - hazardousLocation_SurfaceCondition := '0'B, - hazardousLocation_ObstacleOnTheRoad := '0'B, - hazardousLocation_AnimalOnTheRoad := '0'B, - slowVehicle := '0'B, - dangerousEndOfQueue := '0'B, - vehicleBreakdown := '0'B, - stationaryVehicle := '0'B - } // End of template mw_sspDENMContainer_vehicle - - /** - * @desc - */ - template (present) SspDENM mw_sspDENMContainer_roadSideUnit - modifies mw_sspDENMContainer_dummy := { - trafficCondition := '0'B, - accident := '0'B, - roadworks := '0'B, - adverseWeatherCondition_Adhesion := '0'B, - hazardousLocation_SurfaceCondition := '0'B, - hazardousLocation_ObstacleOnTheRoad := '0'B, - hazardousLocation_AnimalOnTheRoad := '0'B, - humanPresenceOnTheRoad := '0'B, - wrongWayDriving := '0'B, - rescueAndRecoveryWorkInProgress := '0'B, - adverseWeatherCondition_ExtremeWeatherCondition := '0'B, - adverseWeatherCondition_Visibility := '0'B, - adverseWeatherCondition_Precipitation := '0'B, - postCrash := '0'B, - humanProblem := '0'B, - stationaryVehicle := '0'B, - hazardousLocation_DangerousCurve := '0'B, - collisionRisk := '0'B, - dangerousSituation := '0'B - } // End of template m_sspDENMContainer_roadSideUnit - - /** - * @desc - */ - template (present) ServiceSpecificPermissions mw_sspDENM_dummy := { - version := '01'O, - sspContainer := { - sspDENM := mw_sspDENMContainer_dummy - } - } // End of template mw_sspDENM_dummy - - /** - * @desc - */ - template (present) ServiceSpecificPermissions mw_sspDENM_vehicle - modifies mw_sspDENM_dummy := { - sspContainer := { - sspDENM := mw_sspDENMContainer_vehicle - } - } // End of template mw_sspDENM_vehicle - - /** - * @desc - */ - template (present) ServiceSpecificPermissions mw_sspDENM_roadSideUnit - modifies mw_sspDENM_dummy := { - sspContainer := { - sspDENM := mw_sspDENMContainer_roadSideUnit - } - } // End of template mw_sspDENM_roadSideUnit - - } // End of group sspDenmRecv - - } // End of group sspDenm - - } // End of group ssp - - } // End of group certificates - - /** - * @desc Send/receive templates for profiles for certificates - * @see Draft ETSI TS 103 097 V1.1.14 Clause 7.4 Profiles for certificate - */ - group profileCertificates { - - /** - * @desc SecuredMesage payload to be signed - * @member p_security_profile The secury profile - * @member p_header_fields The headers list - * @member p_payload_field The payloads list - * @member p_trailer_field_type The trailer type - * @see Draft ETSI TS 103 097 V1.1.14 Clause 7 Security profiles - */ - template (value) ToBeSignedSecuredMessage m_toBeSignedSecuredMessage( - in template (value) HeaderFields p_header_fields, - in template (value) SecPayload p_payload_field, - in template (value) TrailerFieldType p_trailer_field_type - ) := { - protocol_version := c_protocol_version, - header_fields := p_header_fields, - payload_field := p_payload_field, - trailer_fieldsLength := 67, // 43h = lengthof(trailer_fields) // FIXME To be enhanced due to multiple signature - trailerFieldType := p_trailer_field_type - } // End of template m_toBeSignedSecuredMessage - - /** - * @desc SecuredMesage template used to calculate the signature - * @member p_header_fields The headers list - * @member p_payload_field The payloads list - * @member p_trailer_field_type The trailer type - * @member p_protocol_version The protocol version - * @member p_trailer_fieldsLength The trailer fields length, set to 67 - * @see Draft ETSI TS 103 097 V1.1.14 Clause 7 Security profiles - */ - template (value) ToBeSignedSecuredMessage m_toBeSignedSecuredMessage_wrong_protocol( - in template (value) HeaderFields p_header_fields, - in template (value) SecPayload p_payload_field, - in template (value) TrailerFieldType p_trailer_field_type, - in template (value) UInt8 p_protocol_version := c_protocol_version, - in template (value) UInt8 p_trailer_fieldsLength := 67 - ) modifies m_toBeSignedSecuredMessage := { - protocol_version := p_protocol_version - } // End of template m_toBeSignedSecuredMessage - - /** - * @desc The certificate paylaod to be signed - * @member p_certificate The signed certificate to be verified - * @see Draft ETSI TS 103 097 V1.1.14 Clause 7.4 Profiles for certificate - */ - template (value) ToBeSignedCertificate m_toBeSignedCertificate( - in template (value) Certificate p_certificate - ) := { - version := valueof(p_certificate.version), - signer_info := valueof(p_certificate.signer_info), - subject_info := valueof(p_certificate.subject_info), - subject_attributes := valueof(p_certificate.subject_attributes), - validity_restrictions := valueof(p_certificate.validity_restrictions) - } // End of template m_toBeSignedCertificate - - } // End of group profileCertificates - + */} // End of group ssp + group utPrimitives { template UtGnInitialize m_secGnInitialize( diff --git a/ttcn/Security/LibItsSecurity_TestSystem.ttcn b/ttcn/Security/LibItsSecurity_TestSystem.ttcn index 660be475..6dd8a9d9 100644 --- a/ttcn/Security/LibItsSecurity_TestSystem.ttcn +++ b/ttcn/Security/LibItsSecurity_TestSystem.ttcn @@ -14,6 +14,11 @@ module LibItsSecurity_TestSystem { // LibCommon import from LibCommon_DataStrings all; + // LibIts + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + import from IEEE1609dot2 language "ASN.1:1997" all; + import from EtsiTs103097Module language "ASN.1:1997" all; + // LibItsSecurity import from LibItsSecurity_TypesAndValues all; import from LibItsSecurity_Pixits all; diff --git a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn index 943bf223..9fddeecf 100644 --- a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn +++ b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn @@ -15,829 +15,17 @@ module LibItsSecurity_TypesAndValues { import from LibCommon_BasicTypesAndValues all; import from LibCommon_DataStrings all; + // LibIts + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + import from IEEE1609dot2 language "ASN.1:1997" all; + import from EtsiTs103097Module language "ASN.1:1997" all; + /** * @desc Specification of basic format elements * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2 */ group basicFormatElements { - /** - * @desc An integer of variable length - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.1 IntX - */ - type integer IntX with { variant "IntX" }; - - /** - * @desc List of supported algorithms based on public key cryptography - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.2 PublicKeyAlgorithm - */ - type enumerated PublicKeyAlgorithm { - e_ecdsa_nistp256_with_sha256 (0), - e_ecies_nistp256 (1), - e_unknown (240) - } with { variant "8 bit" } - - /** - * @desc List of supported algorithms based on symmetric key cryptography - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.3 SymmetricAlgorithm - */ - type enumerated SymmetricAlgorithm { - e_aes_128_ccm (0) - } with { variant "8 bit" } - - /** - * @desc Wrapper for public keys by specifying the used algorithm - * @member algorithm Specifying the used algorithm - * @member public_key The public key structure - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.4 PublicKey - */ - type record PublicKey { - PublicKeyAlgorithm algorithm, - PublicKeyContainer public_key - } // End of type PublicKey - - /** - * @desc Information regarding ECC contained in an EccPoint structure - * @member eccPoint Specific details regarding ECC contained in an EccPoint structure - * @member ecies_nistp256 Specific details regarding ECC contained in an EccPoint structure - * @member other_key Out of scope - */ - type union PublicKeyContainer { - EccPoint eccPoint, - AesCcm aesCcm, - octetstring other_key - } // End of type PublicKeyContainer - - /** - * @desc Information regarding AES CCM encryption - * @member supported_symm_alg The symmetric key algorithm - * @member eccPoint The EccPoint used in the PublicKey - */ - type record AesCcm { - SymmetricAlgorithm supported_symm_alg, - EccPoint eccPoint - } // End of type AesCcmsc - - /** - * @desc Defines public key based on elliptic curve cryptography - * @member type_ The ECC key types - * @member x The x coordinate - * @member y The y coordinate - * @remark In case of e_x_coordinate_only, e_compressed_lsb_y_0 and e_compressed_lsb_y_1, the field y shall not be present - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.5 EccPoint - * @see Draft ETSI TS 103 097 V1.1.14 Table 2: Derivation of field sizes depending on the used algorithm - */ - type record EccPoint { - EccPointType type_, - octetstring x, - EccPointContainer y optional - } // End of type EccPoint - - /** - * @desc Defines a public key based on elliptic curve cryptography - * @member y The y coordinate - * @member data Out of scope - */ - type union EccPointContainer { - octetstring y, - octetstring data - } // End of type EccPointContainer - - /** - * @desc List of supported ECC key types - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.6 EccPointType - */ - type enumerated EccPointType { - e_x_coordinate_only (0), - e_compressed_lsb_y_0 (2), - e_compressed_lsb_y_1 (3), - e_uncompressed (4) - } with { variant "8 bit" } - - /** - * @desc Parameters and additional data required for encryption and decryption of data using different symmetric encryption algorithms - * @member symm_algorithm The symmetric algorithm that shall be used with a public key for encryption - * @member public_key The public key for encryption - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.7 EncryptionParameters - */ - type record EncryptionParameters { - SymmetricAlgorithm symm_algorithm, - EncryptionParametersContainer public_key - } // End of type EncryptionParameters - - /** - * @desc - * @member nonce Data encryption with the Advanced Encryption Standard (AES) using a 128-bit key in Counter with cipher block chaining message authentication code (CCM) mode - * @member params Out of scope - */ - type union EncryptionParametersContainer { - Oct12 nonce, - octetstring params - } // End of type EncryptionParametersContainer - - /** - * @desc Signatures based on public key cryptography - * @member algorithm Algorithm type - * @member signature_ The signature - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.8 Signature - */ - type record Signature { - PublicKeyAlgorithm algorithm, - SignatureContainer signature_ - } // End of type Signature - - /** - * @desc - * @member algorithm The ECDSA based signature - * @member signature_ Out of scope - */ - type union SignatureContainer { - EcdsaSignature ecdsa_signature, - octetstring signature_ - } // End of type SignatureContainer - - /** - * @desc Description an ECDSA based signature - * @member r Coordinate of the elliptic curve point resulting from multiplying the generator element by the ephemeral private key - * @member s Signature - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.9 EcdsaSignature - */ - type record EcdsaSignature { - EccPoint r, - octetstring s - } // End of type EcdsaSignature - - - /** - * @desc Information about the signer of a message - * @member type_ Signature algorithm type - * @member signerInfo Signature algorithm information. In case of self-signed, this field is not required because of no additional data shall be given - * @remark In case of e_self, the field signerInfo shall not be present - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.10 SignerInfo - */ - type record SignerInfo { - SignerInfoType type_, - SignerInfoContainer signerInfo optional - } // End of type SignerInfo - - /** - * @desc - * @member digest The digest value - * @member certificate A certificate - * @member certificates A complete certificate chain - * @member certificateWithAlgo A certificate with a specific algorithm - * @member info To be used in all other cases - */ - type union SignerInfoContainer { - HashedId8 digest, - Certificate certificate, - CertificateChain certificates, - CertificateWithAlgo certificateWithAlgo, - octetstring info - } // End of type SignerInfoContainer - - /** - * @desc - * @member algorithm The public key algorithm - * @member digest The digest value - */ - type record CertificateWithAlgo { - PublicKeyAlgorithm algorithm, - HashedId8 digest - } // End of type CertificateWithAlgo - - /** - * @desc The list of the methods to describe a message's signer - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.11 SignerInfoType - */ - type enumerated SignerInfoType { - e_self (0), - e_certificate_digest_with_sha256 (1), - e_certificate (2), - e_certificate_chain (3), - e_certificate_digest_with_other_algorithm (4), - e_unknown (240) - } // End of type SignerInfoContainer - - /** - * @desc Identifies data such as a certificate - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.12 HashedId8 - * @see RFC2246 Clause 4.2. Miscellaneous - */ - type Oct8 HashedId8; - - /** - * @desc Indication on an identifier, where real identification is not required - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.13 HashedId3 - * @see RFC2246 Clause 4.2. Miscellaneous - */ - type Oct3 HashedId3; - - /** - * @desc The unsigned 32 bits number of International Atomic Time (TAI) microseconds since 00:00:00 UTC, 01 January 2004 - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.14 Time64 - */ - type UInt32 Time32; - - /** - * @desc The unsigned 64 bits number of International Atomic Time (TAI) microseconds since 00:00:00 UTC, 01 January 2004 - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.15 Time64 - */ - type UInt64 Time64; - - /** - * @desc The time along with the standard deviation of time values - * @member time The time being encoded - * @member log_std_dev The rounded up value of the log to the base 1,134666 of the implementation's estimate of the standard deviation in units of nanoseconds - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.16 Time64WithStandardDeviation - */ - type record Time64WithStandardDeviation { - Time64 time, - UInt8 log_std_dev - } // End of type Time64WithStandardDeviation - - /** - * @desc Defines the duration of a time span (e.g. a certificate's validity) - * @member unit Units of the duration - * @member duration_ The duration of a time span - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.17 Duration - */ - type record Duration { - DurationUnitType unit, - Int13 duration_ - } // End of type Duration - - /** - * @desc List of supported duration unit - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.17 Duration - * @see Draft ETSI TS 103 097 V1.1.14 Table 3: Interpretation of duration unit bits - */ - type enumerated DurationUnitType { - e_seconds (0), // seconds - e_minutes (1), // minutes (60 seconds) - e_hours (2), // hours (3 600 seconds) - e_hoursBlock (3), // 60 hour blocks (216 000 seconds) - e_year (4) // years (31 556 925 seconds) - } with { variant "3 bit" } - - /** - * @desc Define latitude range - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.18/19 Two/ThreeDLocation/permitted values - */ - type integer WGSLatitude (-900000000 .. 900000001) with { variant "32 bit"}; - - /** - * @desc Define longitude range - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.18/19 Two/hreeDLocation/permitted values - */ - type integer WGSLongitude (-1800000000 .. 1800000001) with { variant "32 bit"}; - - /** - * @desc Specify a two dimensional location - * @member latitude Latitude in tenths of micro degrees relative to the World Geodetic System (WGS)-84 datum - * @member longitude Longitude in tenths of micro degrees relative to the World Geodetic System (WGS)-84 datum - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.18 TwoDLocation - */ - type record TwoDLocation { - WGSLatitude latitude, - WGSLongitude longitude - } // End of type TwoDLocation - - /** - * @desc Specify a three dimensional location - * @member latitude Latitude in tenths of micro degrees relative to the World Geodetic System (WGS)-84 datum - * @member longitude Longitude in tenths of micro degrees relative to the World Geodetic System (WGS)-84 datum - * @member elevation Elevation relative to the WGS-84 ellipsoid in decimetres - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.19 ThreeDLocation - */ - type record ThreeDLocation { - WGSLatitude latitude, - WGSLongitude longitude, - Oct2 elevation - } // End of type ThreeDLocation - - /** - * @desc Defines an ordered list of ThreeDLocation - * @remark TTCN-3 language does not provide feature suach as superset for the. In consequence, the is replaced here by a set of - */ - type set of ThreeDLocation ThreeDLocations; - - /** - * @desc Defines geographic regions used to limit the validity of certificates - * @member region_type Region type - * @member region Region description - * @remark In case of e_none, the field region shall not be present - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.20 GeographicRegion - */ - type record GeographicRegion { - RegionType region_type, - GeographicRegionContainer region optional - } // End of type GeographicRegion - - type union GeographicRegionContainer { - CircularRegion circular_region, - RectangularRegions rectangular_region, - PolygonalRegion polygonal_region, - IdentifiedRegion id_region, - octetstring other_region - } // End of type GeographicRegionContainer - - /** - * @desc The list of the possible region types - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.21 RegionType - */ - type enumerated RegionType { - e_none (0), - e_circle (1), - e_rectangle (2), - e_polygon (3), - e_id (4) - } with { variant "8 bit" } - - /** - * @desc Defines a circular region - * @member center Circular center - * @member radius Radius given in metres - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.22 CircularRegion - */ - type record CircularRegion { - TwoDLocation center, - UInt16 radius - } // End of type CircularRegion - - /** - * @desc Defines a rectangular region by connecting the four points in the order (northwest.latitude, northwest.longitude), (northwest.longitude, southeast.longitude), (southeast.longitude, southeast.longitude), and (southeast.longitude, northwest.longitude) - * @member northwest Upper left corner - * @member southeast Lower rigth corner - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.23 RectangularRegion - */ - type record RectangularRegion { - TwoDLocation northwest, - TwoDLocation southeast - } // End of type RectangularRegion - - /** - * @desc Defines an ordered list of RectangularRegion - * @remark TTCN-3 language does not provide feature suach as superset for the. In consequence, the is replaced here by a set of - */ - type set of RectangularRegion RectangularRegions; - - /** - * @desc Defines an ordered list of PolygonalRegion - * @remark TTCN-3 language does not provide feature suach as superset for the. In consequence, the is replaced here by a set of - */ - type set of TwoDLocation PolygonalRegion; - - /** - * @desc Defines a predefined geographic region determined by the region dictionary and the region identifier - * @member region_dictionary The region dictionary - * @member region_identifier The region identifier - * @member local_region The whole region. 0 if the whole region is meant - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.25 IdentifiedRegion - */ - type record IdentifiedRegion { - RegionDictionary region_dictionary, - UInt16 region_identifier, - IntX local_region - } // End of type IdentifiedRegion - - /** - * @desc The list of dictionaries containing two-octet records of globally defined regions - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.26 RegionDictionary - */ - type enumerated RegionDictionary { - e_iso_3166_1 (0), - e_un_stats (1) - } with { - variant "8 bit" - } // End of type RegionDictionary - - /** - * @desc Defines an ordered list of RegionIdentifiers - * @remark TTCN-3 language does not provide feature suach as superset for the. In consequence, the is replaced here by a set of - */ - type set of UInt16 RegionIdentifiers; - - } // End of group basicFormatElements - - /** - * @desc Specification of security header - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5 - */ - group SecurityMessages { - - /** - * @desc Secured message description, part to be signed - * @member protocol_version The applied protocol version - * @member header_fields Multiple information fields of interest to the security layer - * @member payload_field The message's payload - * @member trailer_fields Security information after the payload - * - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.1 SecuredMessage - * @see Draft ETSI TS 103 097 V1.1.14 Clause 7 Security profiles - */ - type record ToBeSignedSecuredMessage { - UInt8 protocol_version, - HeaderFields header_fields, - SecPayload payload_field, // Used by the codec to fill it with the secured packet in case of 'omit' value - UInt8 trailer_fieldsLength, // Draft ETSI TS 103 097 V1.1.14 Clauses 7.1/2/3 - TrailerFieldType trailerFieldType - } // End of type ToBeSignedSecuredMessage - - /** - * @desc Secured message description - * @member protocol_version The applied protocol version - * @member header_fields Multiple information fields of interest to the security layer - * @member payload_fields The message's payload - * @member trailer_fields Security information after the payload - * - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.1 SecuredMessage - */ - type record SecuredMessage { - UInt8 protocol_version, - HeaderFields header_fields, - SecPayload payload_field, // Used by the codec to fill it with the secured packet in case of 'omit' value - TrailerFields trailer_fields - } // End of type SecuredMessage - - /** - * @desc Defines an ordered list of HeaderField - * @remark TTCN-3 language does not provide feature suach as superset for the. In consequence, the is replaced here by a set of - */ - type set of HeaderField HeaderFields; - - /** - * @desc Payload structure - * @member type_ Payload type - * @member payload Payload data - * - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.2 Payload - */ - type record SecPayload { - SecPayloadType type_, - octetstring data optional - } // End of type Payload - - /** - * @desc Supported types of payloads - * - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.3 PayloadType - */ - type enumerated SecPayloadType { - e_unsecured (0), - e_signed (1), - e_encrypted (2), - e_signed_external (3), - e_signed_and_encrypted (4), - e_unknown (240) - } with { variant "8 bit" } - - /** - * @desc Defines an ordered list of TrailerField - * @remark TTCN-3 language does not provide feature suach as superset for the. In consequence, the is replaced here by a set of - */ - type set of TrailerField TrailerFields; - - /** - * @desc Information of interest to the security layer - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.4 HeaderField - */ - type record HeaderField { - HeaderFieldType type_, - HeaderFieldContainer headerField - } // End of type HeaderField - - /** - * @desc Supported types of header fields - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.5 HeaderFieldType - */ - type enumerated HeaderFieldType { - e_generation_time (0), - e_generation_time_standard_deviation (1), - e_expiration (2), - e_generation_location (3), - e_request_unrecognized_certificate (4), - e_its_aid (5), - e_signer_info (128), - e_encryption_parameters (129), - e_recipient_info (130), - e_other_header_240 (240) - } with { variant "8 bit" } - - type union HeaderFieldContainer { - Time64 generation_time, - Time64WithStandardDeviation generation_time_with_standard_deviation, - Time32 expiry_time, - ThreeDLocation generation_location, - HashedId3s digests, - IntX its_aid, - SignerInfo signer, - EncryptionParameters enc_params, - RecipientInfos recipients, - octetstring other_header - } // End of type HeaderFieldContainer - - /** - * @desc Defines an ordered list of HashedId3 - * @remark TTCN-3 language does not provide feature suach as superset for the. In consequence, the is replaced here by a set of - */ - type set of HashedId3 HashedId3s; - - /** - * @desc Defines an ordered list of RecipientInfo - * @remark TTCN-3 language does not provide feature suach as superset for the. In consequence, the is replaced here by a set of - */ - type set of RecipientInfo RecipientInfos; - - /** - * @desc Information used by the security layer after processing the payload - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.6 TrailerField - */ - type record TrailerField { - TrailerFieldType type_, - TrailerFieldContainer trailerField - } // End of type TrailerField - - /** - * @desc - * @member signature_ The signature of the payload - * @member security_field Out of scope - */ - type union TrailerFieldContainer { - Signature signature_, - octetstring security_field - } // End of type TrailerFieldContainer - - /** - * @desc Supported types of trailer fields - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.7 TrailerFieldType - */ - type enumerated TrailerFieldType { - e_signature (1) - } with { variant "8 bit" } - - /** - * @desc Information for a message's recipient - * @member cert_id Identifier for the recipient's certificate - * @member pk_encryption Type of the recipient's certificate - * @member enc_key The recipient's certificate - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.8 RecipientInfo - */ - type record RecipientInfo { - HashedId8 cert_id, - PublicKeyAlgorithm pk_encryption, - RecipientInfoContainer enc_key - } // End of type RecipientInfo - - /** - * @desc The recipient's certificate - * @member enc_key Identifier for the recipient's certificate - * @member enc_key_other Type of the recipient's certificate - */ - type union RecipientInfoContainer { - EciesEncryptedKey enc_key, - octetstring enc_key_other - } // End of type RecipientInfoContainer - - /** - * @desc Defines an ECIES-encrypted symmetric key as defined in IEEE Std 1363a 2004 - * @member v The sender's ECC ephemeral key used for the Elliptic Curve Encryption Scheme - * @member c The encrypted (AES) key - * @member t The authentication tag vector - * @see Draft ETSI TS 103 097 V1.1.14 Clause 5.9 EciesEncryptedKey - */ - type record EciesEncryptedKey { - EccPoint v, - octetstring c, - Oct16 t - } // End of type EciesEncryptedKey - - } // End of group SecurityMessages - - group certificateSpecification { - - /** - * @desc Certificate description - * @member version The certificate's version. Shall be set to 2 - * @member signer_info The certificate's signer information - * @member subject_info Information on the certificate's subject - * @member subject_attributes The certificate's subject - * @member validity_restrictions Restrictions regarding the certificate's validity - * @member signature_ The signature of this certificate signed by the responsible CA - * @see Draft ETSI TS 103 097 V1.1.14 Clause 6.1 Certificate - */ - type record Certificate { - UInt8 version, - SignerInfo signer_info, - SubjectInfo subject_info, - SubjectAttributes subject_attributes, - ValidityRestrictions validity_restrictions, - Signature signature_ - } // End of type Certificate - - /** - * @desc Defines an ordered list of Certificate - * @remark TTCN-3 language does not provide feature suach as superset for the. In consequence, the is replaced here by a set of - */ - type set of Certificate CertificateChain; - - /** - * @desc Certificate description - * @member subject_type The type subjet - * @member subject_name The subject itself - * @see Draft ETSI TS 103 097 V1.1.14 Clause 6.2 SubjectInfo - * @remark The subject_name variable-length vector shall have a maximum length of 32 bytes - */ - type record SubjectInfo { - SubjectType subject_type, - Oct0to31 subject_name // The subject_name variable-length vector shall have a maximum length of 32 bytes - } // End of type SubjectInfo - - /** - * @desc The list of the possible types of subjects - * @see Draft ETSI TS 103 097 V1.1.14 Clause 6.3 SubjectInfoType - */ - type enumerated SubjectType { - e_enrollment_credential (0), - e_authorization_ticket (1), - e_authorization_authority (2), - e_enrollment_authority (3), - e_root_ca (4), - e_crl_signer (5) - } with { variant "8 bit" } - - /** - * @desc Subject attribute description - * @member type_ The type of attribute - * @member attribute The attribute itself - * @see Draft ETSI TS 103 097 V1.1.14 Clause 6.4 SubjectAttribute - */ - type record SubjectAttribute { - SubjectAttributeType type_, - SubjectAttributeContainer attribute - } // End of type SubjectAttribute - - /** - * @desc The attributes description - * @member key - * @member rv - * @member assurance_level - * @member its_aid_list - * @member its_aid_ssp_list - * @member other_attribute - */ - type union SubjectAttributeContainer { - PublicKey key, - EccPoint rv, - SubjectAssurance assurance_level, - IntXs its_aid_list, - ItsAidSsps its_aid_ssp_list, - octetstring other_attribute - } // End of type SubjectAttributeContainer - - /** - * @desc Defines an ordered list of SubjectAttribute - * @remark TTCN-3 language does not provide feature suach as superset for the. In consequence, the is replaced here by a set of - */ - type set of SubjectAttribute SubjectAttributes; - - /** - * @desc Defines an ordered list of IntX - * @remark TTCN-3 language does not provide feature suach as superset for the. In consequence, the is replaced here by a set of - */ - type set of IntX IntXs; - - /** - * @desc Defines an ordered list of ItsAidSsp - * @remark TTCN-3 language does not provide feature suach as superset for the. In consequence, the is replaced here by a set of - */ - type set of ItsAidSsp ItsAidSsps; - - /** - * @desc The list of the possible types of attributes - * @see Draft ETSI TS 103 097 V1.1.14 Clause 6.5 SubjectAttributeType - */ - type enumerated SubjectAttributeType { - e_verification_key (0), - e_encryption_key (1), - e_assurance_level (2), - e_reconstruction_value (3), - e_its_aid_list (32), - e_its_aid_ssp_list (33) - } with { variant "8 bit" } - - /** - * @desc The ITS S's assurance - * @member levels The assurance levels - * @member reserved Out of scope - * @member confidence The confidence - * @see Draft ETSI TS 103 097 V1.1.14 Clause 6.6 SubjectAssurance - * @see Draft ETSI TS 103 097 V1.1.14 Table 5: Bitwise encoding of subject assurance - */ - type record SubjectAssurance { - Bit3 levels, - Bit3 reserved, - Bit2 confidence - } with { variant "8 bit" } // End of type SubjectAssurance - - /** - * @desc Defines ways to restrict the validity restriction of the certificate - * @member type_ The type of validity restriction of the certificate - * @member validity The validity restriction of the certificate - * @see Draft ETSI TS 103 097 V1.1.14 Clause 6.6 SubjectAssurance - */ - type record ValidityRestriction { - ValidityRestrictionType type_, - ValidityRestrictionContainer validity - } // End of type ValidityRestriction - - /** - * @desc Defines the validity restriction of the certificate - * @member end_validity Validity restriction till the end date - * @member time_start_and_end Validity restriction between into a range - * @member time_start_and_duration Validity restriction between into a range from a start date and inside a geographical aera - * @member region Validity restriction into a geographical area - * @member region Validity restriction into a geographical area - * @member data Undefined - */ - type union ValidityRestrictionContainer { - Time32 end_validity, - TimeStartEnd time_start_and_end, - TimeDuration time_start_and_duration, - GeographicRegion region, - octetstring data - } // End of type ValidityRestrictionContainer - - /** - * @desc Defines the validity restriction between into a range - * @member start_validity Start date - * @member end_validity End date - */ - type record TimeStartEnd { - Time32 start_validity, - Time32 end_validity - } // End of type TimeStartEnd - - /** - * @desc Defines the validity restriction between into a range from a start date and inside a geographical aera - * @member start_validity Start date - * @member duration_ Duration of the validity restriction from the start date - */ - type record TimeDuration { - Time32 start_validity, - Duration duration_ - } // End of type TimeDuration - - /** - * @desc Type of validity restriction of a certificate - * @see Draft ETSI TS 103 097 V1.1.14 6.8 ValidityRestrictionType - */ - type enumerated ValidityRestrictionType { - e_time_end (0), - e_time_start_and_end (1), - e_time_start_and_duration (2), - e_region (3), - e_unknown - } with { variant "8 bit" } - - type set of ValidityRestriction ValidityRestrictions; - - /** - * @desc ITS-AID description - * @member its_aid The ITS_AID identifier - * @member service_specific_permissions The associated Service Specific Permissions - * @see Draft ETSI TS 103 097 V1.1.14 Clause 6.9 ItsAidSsp - */ - type record ItsAidSsp { - IntX its_aid, - ServiceSpecificPermissions service_specific_permissions - } // End of type ItsAidSsp - - /** - * @desc Service specific permissions definition - * @member version SSP version control - * @member sspConatiner Service specific permissions definition - */ - type record ServiceSpecificPermissions { - Oct1 version, - ServiceSpecificPermissionsContainer sspContainer optional - } // End of type ServiceSpecificPermissions - - /** - * @desc Service specific permissions definition - * @member sspCAM Service specific permissions definition for DENM - * @member sspDENM Service specific permissions definition for DENM - * @member opaque Service specific permissions definition for others - * - * @see ETSI EN 302 637-2 V1.3.2 (2014-11) Clause 6.2.2.2 Service Specific Permissions (SSP) - * @see ETSI EN 302 637-3 V1.2.2 (2014-11) Clause 6.2.2.2 Service Specific Permissions (SSP) - */ - type union ServiceSpecificPermissionsContainer { - SspCAM sspCAM, - SspDENM sspDENM, - Oct0to30 opaque - } // End of type ServiceSpecificPermissions - /** * @desc Service specific permissions definition for CAM * @see ETSI EN 302 637-2 V1.3.2 (2014-11) Clause 6.2.2.2 Service Specific Permissions (SSP) @@ -925,26 +113,9 @@ module LibItsSecurity_TypesAndValues { */ group profileCertificates { - /** - * @desc Certificate description, part to be signed - * @member version The certificate's version. Shall be set to 2 - * @member signer_info The certificate's signer - * @member subject_info Information on the certificate's subject - * @member subject_attributes The certificate's subject - * @member validity_restrictions Restrictions regarding the certificate's validity - * @see Draft ETSI TS 103 097 V1.1.14 Clause 7.4 Profiles for certificate - */ - type record ToBeSignedCertificate { - UInt8 version, - SignerInfo signer_info, - SubjectInfo subject_info, - SubjectAttributes subject_attributes, - ValidityRestrictions validity_restrictions - } // End of type ToBeSignedCertificate - type record CertificatesCachingItem { - HashedId8 hashedId8, - Certificate certificate + HashedId8 hashedId8, + EtsiTs103097Certificate certificate } type record of CertificatesCachingItem CertificatesCaching; @@ -963,12 +134,12 @@ module LibItsSecurity_TypesAndValues { * @member location 3D location associated to each configuration */ type record TaConfig { - Oct32 signingPrivateKey, - Oct32 encryptPrivateKey, - Certificate caCertificate, - Certificate aaCertificate, - Certificate atCertificate, - ThreeDLocation location + Oct32 signingPrivateKey, + Oct32 encryptPrivateKey, + EtsiTs103097Certificate caCertificate, + EtsiTs103097Certificate aaCertificate, + EtsiTs103097Certificate atCertificate, + ThreeDLocation location } // End of type TaConfig /** -- GitLab From d18229fc35087c75760c18aa99f8270012f6c812 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 6 Dec 2017 12:47:57 +0000 Subject: [PATCH 046/320] Add signatures support --- ttcn/Security/LibItsSecurity_Functions.ttcn | 195 +++++++++---------- ttcn/Security/LibItsSecurity_Templates.ttcn | 91 ++++++--- ttcn/Security/LibItsSecurity_TestSystem.ttcn | 2 +- 3 files changed, 150 insertions(+), 138 deletions(-) diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index fda7fcb4..74335786 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -33,10 +33,10 @@ module LibItsSecurity_Functions { group helpersFunctions { /** - * @desc Produces a 256-bit (32-byte) hash value - * @param p_toBeHashedData Data to be used to calculate the hash value - * @return The hash value - */ + * @desc Produces a 256-bit (32-byte) hash value + * @param p_toBeHashedData Data to be used to calculate the hash value + * @return The hash value + */ function f_hashWithSha256( in octetstring p_toBeHashedData ) return Oct32 { @@ -44,10 +44,21 @@ module LibItsSecurity_Functions { } // End of function f_hashWithSha256 /** - * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signaturee - * @param p_toBeSignedSecuredMessage The data to be signed - * @return The signature value - */ + * @desc Produces a 384-bit (48-byte) hash value + * @param p_toBeHashedData Data to be used to calculate the hash value + * @return The hash value + */ + function f_hashWithSha384( + in octetstring p_toBeHashedData + ) return Oct48 { + return fx_hashWithSha384(p_toBeHashedData); + } // End of function f_hashWithSha256 + + /** + * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signaturee + * @param p_toBeSignedSecuredMessage The data to be signed + * @return The signature value + */ function f_signWithEcdsaNistp256WithSha256( in octetstring p_toBeSignedSecuredMessage, in Oct32 p_privateKey @@ -60,11 +71,11 @@ module LibItsSecurity_Functions { } // End of function f_signWithEcdsaNistp256WithSha256 /** - * @desc Compute the HashedId8 value from the hash value - * @param p_hash The hash value - * @return The HashedId8 value - * @verdict - */ + * @desc Compute the HashedId8 value from the hash value + * @param p_hash The hash value + * @return The HashedId8 value + * @verdict + */ function f_HashedId8FromSha256( in Oct32 p_hash ) return HashedId8 { @@ -72,11 +83,11 @@ module LibItsSecurity_Functions { } // End of function f_HashedId8FromSha256 /** - * @desc Compute the HashedId3 value from the HashedId8 value - * @param p_hashp_hashedId8 The HashedId8 value - * @return The HashedId3 value - * @verdict Unchanged - */ + * @desc Compute the HashedId3 value from the HashedId8 value + * @param p_hashp_hashedId8 The HashedId8 value + * @return The HashedId3 value + * @verdict Unchanged + */ function f_HashedId3FromHashedId8( in HashedId8 p_hashedId8 ) return HashedId3 { @@ -84,13 +95,13 @@ module LibItsSecurity_Functions { } // End of function f_HashedId3FromHashedId8 /** - * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_signature The signature - * @param p_ecdsaNistp256PublicKeyX The public key (x coordinate) - * @param p_ecdsaNistp256PublicKeyY The public key (y coordinate) - * @return true on success, false otherwise - */ + * @desc Verify the signature of the specified data + * @param p_toBeVerifiedData The data to be verified + * @param p_signature The signature + * @param p_ecdsaNistp256PublicKeyX The public key (x coordinate) + * @param p_ecdsaNistp256PublicKeyY The public key (y coordinate) + * @return true on success, false otherwise + */ function f_verifyWithEcdsaNistp256WithSha256( in octetstring p_toBeVerifiedData, in octetstring p_signature, @@ -120,7 +131,7 @@ module LibItsSecurity_Functions { function f_generate_key_pair( out octetstring p_privateKey, out octetstring p_publicKeyX, - out octetstring p_publicKeyY + out octetstring p_publicKeyY ) return boolean { return fx_generateKeyPair(p_privateKey, p_publicKeyX, p_publicKeyY); } @@ -1151,28 +1162,23 @@ module LibItsSecurity_Functions { * @param p_type header field type * @return HeaderInfo of given type if any or null */ - function f_getMsgHeaderField( + function f_getMsgHeaderInfo( in template(omit) Ieee1609Dot2Data p_securedMessage, in HeaderInfo p_headerInfo, out HeaderInfo p_return ) return boolean { - /*Spirent splitted*/ var integer v_length; var Ieee1609Dot2Data v_securedMessage; + if (not isvalue(p_securedMessage)) { testcase.stop(__SCOPE__ & " can not handle omitted secured message values"); } v_securedMessage := valueof(p_securedMessage); - - /*Spirent replaced p_securedMessage with v_securedMessage*/ - /* FIXME To be reviewed tv_length := lengthof(v_securedMessage.header_fields); - for (var integer i := 0; i < v_length; i := i + 1) { - if (v_securedMessage.header_fields[i].type_ == p_headerFieldType) { - p_return := v_securedMessage.header_fields[i]; - return true; - } - }*/ - + if (ispresent(v_securedMessage.content.signedData)) { + p_return := v_securedMessage.content.signedData.tbsData.headerInfo; + return true; + } + log("f_getMsgHeaderField: return false"); return false; } @@ -1184,14 +1190,10 @@ module LibItsSecurity_Functions { in template(omit) Ieee1609Dot2Data p_securedMessage, out SignerIdentifier p_signerIdentifier ) return boolean { - var HeaderInfo v_hf; - - /* FIXME To be reviewed tif (f_getMsgHeaderField(p_securedMessage, e_signer_info, v_hf) == true) { - if (isbound(v_hf.headerField.signer)) { - p_signerIdentifier := v_hf.headerField.signer; - return true; - } - }*/ + if (ispresent(p_securedMessage.content.signedData)) { + p_signerIdentifier := valueof(p_securedMessage.content.signedData.signer); + return true; + } log("f_getMsgSignerIdentifier: return false"); return false; @@ -1340,34 +1342,10 @@ module LibItsSecurity_Functions { in template (value) EtsiTs103097Certificate p_cert, out ValidityPeriod p_return ) return boolean { - - /* FIXME To be reviewed tfor (var integer i := 0; i < lengthof(p_cert.validity_restrictions); i := i + 1) { -//FIXME RGY Titan doesn't support dot notation after valueof at the moment -// if (valueof(p_cert).validity_restrictions[i].type_ == p_type) { -// p_return := valueof(p_cert).validity_restrictions[i]; - if (valueof(p_cert.validity_restrictions[i].type_) == p_type) { - p_return := valueof(p_cert.validity_restrictions[i]); - return true; - } - } // End of 'for' statement - - log("f_getCertificateValidityRestriction: Failed to retrieve ", p_type);*/ - return false; + p_return := valueof(p_cert.toBeSigned.validityPeriod); + return true; } // End of function f_getCertificateValidityRestriction - function f_getCertificateSignerIdentifier( - in template (value) EtsiTs103097Certificate p_cert, - out SignerIdentifier p_si - ) return boolean { - /* FIXME To be reviewed tif (isbound(valueof(p_cert.signer_info))) { - p_si := valueof(p_cert.signer_info); - return true; - }*/ - - log("f_getCertificateSignerIdentifier: Failed to retrieve "); - return false; - } - function f_getCertificateSubjectAttribute( in template (value) EtsiTs103097Certificate p_cert/* FIXME To be reviewed, out SubjectAttribute p_return*/ @@ -1449,38 +1427,45 @@ module LibItsSecurity_Functions { group signing { /** - * @desc Produces a 256-bit (32-byte) hash value - * @param p_toBeHashedData Data to be used to calculate the hash value - * @return The hash value - */ + * @desc Produces a 256-bit (32-byte) hash value + * @param p_toBeHashedData Data to be used to calculate the hash value + * @return The hash value + */ external function fx_hashWithSha256(in octetstring p_toBeHashedData) return Oct32; /** - * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signaturee - * @param p_toBeSignedSecuredMessage The data to be signed - * @param p_privateKey The private key - * @return The signature value - */ + * @desc Produces a 384-bit (48-byte) hash value + * @param p_toBeHashedData Data to be used to calculate the hash value + * @return The hash value + */ + external function fx_hashWithSha384(in octetstring p_toBeHashedData) return Oct48; + + /** + * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signaturee + * @param p_toBeSignedSecuredMessage The data to be signed + * @param p_privateKey The private key + * @return The signature value + */ external function fx_signWithEcdsaNistp256WithSha256(in octetstring p_toBeSignedSecuredMessage, in octetstring/*UInt64*/ p_privateKey) return octetstring; /** - * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_signature The signature - * @param p_ecdsaNistp256PublicKeyX The public key (x coordinate) - * @param p_ecdsaNistp256PublicKeyY The public key (y coordinate) - * @return true on success, false otherwise - */ + * @desc Verify the signature of the specified data + * @param p_toBeVerifiedData The data to be verified + * @param p_signature The signature + * @param p_ecdsaNistp256PublicKeyX The public key (x coordinate) + * @param p_ecdsaNistp256PublicKeyY The public key (y coordinate) + * @return true on success, false otherwise + */ external function fx_verifyWithEcdsaNistp256WithSha256(in octetstring p_toBeVerifiedData, in octetstring p_signature, in octetstring p_ecdsaNistp256PublicKeyX, in octetstring p_ecdsaNistp256PublicKeyY) return boolean; /** - * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. - * This function should not be used by the ATS - * @param p_privateKey The new private key value - * @param p_publicKeyX The new public key value (x coordinate) - * @param p_publicKeyX The new public key value (y coordinate) - * @return true on success, false otherwise - */ + * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. + * This function should not be used by the ATS + * @param p_privateKey The new private key value + * @param p_publicKeyX The new public key value (x coordinate) + * @param p_publicKeyX The new public key value (y coordinate) + * @return true on success, false otherwise + */ external function fx_generateKeyPair(out octetstring/*UInt64*/ p_privateKey, out octetstring p_publicKeyX, out octetstring p_publicKeyY) return boolean; } // End of group signing @@ -1873,8 +1858,6 @@ module LibItsSecurity_Functions { in template (value) RectangularRegion p_rectangular_region, out PolygonalRegion p_region ) return boolean { -// FIXME (DF) UNUSED -// var integer v_counter := 0; // Convert rectangular regions to polygons and check polygons p_region[0] := valueof(p_rectangular_region.northWest); @@ -1929,8 +1912,8 @@ module LibItsSecurity_Functions { } // End of function f_isPolygonalRegionInside /** - * @desc - */ + * @desc + */ function f_isIdentifiedRegionInside( in template (value) UInt16 p_parent, in template (value) UInt16 p_region @@ -1939,20 +1922,18 @@ module LibItsSecurity_Functions { } // End of function f_isIdentifiedRegionInside /** - * @desc Check that the location is inside a region - * @param p_region The region to consider - * @param p_location The device location - * @return true on success, false otherwise - * @verdict Unchanged - */ + * @desc Check that the location is inside a region + * @param p_region The region to consider + * @param p_location The device location + * @return true on success, false otherwise + * @verdict Unchanged + */ function f_isLocationInsideRegion( in template (value) GeographicRegion p_region, in template (value) ThreeDLocation p_location ) return boolean { var boolean v_ret := false; -//FIXME RGY valeuof is missing: argument of select case is Expression (see $19.3.1) -// select (p_region.region_type) { if (ischosen(p_region.circularRegion)) { v_ret := f_isLocationInsideCircularRegion(valueof(p_region.circularRegion), p_location); } else if (ischosen(p_region.rectangularRegion)) { diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index a15ea2b7..0226a015 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -1038,22 +1038,24 @@ module LibItsSecurity_Templates { group toBeSignedCertificate { - template (omit) ToBeSignedCertificate m_toBeSignedCertificate( - in template (value) CertificateId p_id, - in template (value) HashedId3 p_cracaId, - in template (value) CrlSeries p_crlSeries, - in template (value) SequenceOfPsidSsp p_appPermissions, - in template (value) SequenceOfPsidGroupPermissions p_certIssuePermissions, - in template (value) VerificationKeyIndicator p_verifyKeyIndicator, - in template (omit) SequenceOfPsidGroupPermissions p_certRequestPermissions := omit, - in template (omit) ValidityPeriod p_validityPeriod := omit, - in template (omit) GeographicRegion p_region := omit, - in template (omit) SubjectAssurance p_assuranceLevel := omit, - in template (omit) PublicEncryptionKey p_encryptionKey := omit + /** + * @desc Send template for ToBeSignedCertificate with CA restrictions + * @see ETSI TS 103 097 V1.3.1 Clause 7.2.3 Root CA certificate + */ + template (omit) ToBeSignedCertificate m_toBeSignedCertificate_ca( + in template (value) CertificateId p_id, + in template (value) SequenceOfPsidSsp p_appPermissions, + in template (value) SequenceOfPsidGroupPermissions p_certIssuePermissions, + in template (value) VerificationKeyIndicator p_verifyKeyIndicator, + in template (omit) SequenceOfPsidGroupPermissions p_certRequestPermissions := omit, + in template (omit) ValidityPeriod p_validityPeriod := omit, + in template (omit) GeographicRegion p_region := omit, + in template (omit) SubjectAssurance p_assuranceLevel := omit, + in template (omit) PublicEncryptionKey p_encryptionKey := omit ) := { id := p_id, - cracaId := p_cracaId, - crlSeries := p_crlSeries, + cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 + crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 validityPeriod := p_validityPeriod, region := p_region, assuranceLevel := p_assuranceLevel, @@ -1063,24 +1065,26 @@ module LibItsSecurity_Templates { canRequestRollover := omit, encryptionKey := p_encryptionKey, verifyKeyIndicator := p_verifyKeyIndicator - } // End of template m_toBeSignedCertificate - - template ToBeSignedCertificate mw_toBeSignedCertificate( - template (present) CertificateId p_id := ?, - template (present) HashedId3 p_cracaId := ?, - template (present) CrlSeries p_crlSeries := ?, - template (present) SequenceOfPsidSsp p_appPermissions := ?, - template (present) SequenceOfPsidGroupPermissions p_certIssuePermissions := ?, - template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, - template SequenceOfPsidGroupPermissions p_certRequestPermissions := *, - template ValidityPeriod p_validityPeriod := *, - template GeographicRegion p_region := *, - template SubjectAssurance p_assuranceLevel := *, - template PublicEncryptionKey p_encryptionKey := * + } // End of template m_toBeSignedCertificate_ca + + /** + * @desc Receive template for ToBeSignedCertificate with CA restrictions + * @see ETSI TS 103 097 V1.3.1 Clause 7.2.3 Root CA certificate + */ + template ToBeSignedCertificate mw_toBeSignedCertificate_ca( + template (present) CertificateId p_id := ?, + template (present) SequenceOfPsidSsp p_appPermissions := ?, + template (present) SequenceOfPsidGroupPermissions p_certIssuePermissions := ?, + template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, + template SequenceOfPsidGroupPermissions p_certRequestPermissions := *, + template ValidityPeriod p_validityPeriod := *, + template GeographicRegion p_region := *, + template SubjectAssurance p_assuranceLevel := *, + template PublicEncryptionKey p_encryptionKey := * ) := { id := p_id, - cracaId := p_cracaId, - crlSeries := p_crlSeries, + cracaId := '000000'O, + crlSeries := 0, validityPeriod := p_validityPeriod, region := p_region, assuranceLevel := p_assuranceLevel, @@ -1092,6 +1096,33 @@ module LibItsSecurity_Templates { verifyKeyIndicator := p_verifyKeyIndicator } // End of template mw_toBeSignedCertificate + /** + * @desc Send template for ToBeSignedCertificate with AT restrictions + * @see ETSI TS 103 097 V1.3.1 Clause 7.2.1 Authorization tickets + */ + template (omit) ToBeSignedCertificate m_toBeSignedCertificate_at( + in template (value) SequenceOfPsidSsp p_appPermissions, + in template (value) VerificationKeyIndicator p_verifyKeyIndicator, + in template (omit) SequenceOfPsidGroupPermissions p_certRequestPermissions := omit, + in template (omit) ValidityPeriod p_validityPeriod := omit, + in template (omit) GeographicRegion p_region := omit, + in template (omit) SubjectAssurance p_assuranceLevel := omit, + in template (omit) PublicEncryptionKey p_encryptionKey := omit + ) := { + id := { none_ := NULL }, + cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 + crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 + validityPeriod := p_validityPeriod, + region := p_region, + assuranceLevel := p_assuranceLevel, + appPermissions := p_appPermissions, + certIssuePermissions := omit, + certRequestPermissions := p_certRequestPermissions, + canRequestRollover := omit, + encryptionKey := p_encryptionKey, + verifyKeyIndicator := p_verifyKeyIndicator + } // End of template m_toBeSignedCertificate_at + } // End of toBeSignedCertificate group keys { diff --git a/ttcn/Security/LibItsSecurity_TestSystem.ttcn b/ttcn/Security/LibItsSecurity_TestSystem.ttcn index 6dd8a9d9..23a2955f 100644 --- a/ttcn/Security/LibItsSecurity_TestSystem.ttcn +++ b/ttcn/Security/LibItsSecurity_TestSystem.ttcn @@ -31,7 +31,7 @@ module LibItsSecurity_TestSystem { type component ItsSecurityBaseComponent { // Certificates - var Certificate vc_aaCertificate; /** Test Adapter AT certificate */ + var Certificate vc_aaCertificate; /** Test Adapter AA certificate */ var Certificate vc_atCertificate; /** Test Adapter AT certificate */ var Certificate vc_lastAtCertificateUsed; /** Last Test Adapter certificate used in 'f_buildGnSecuredXXX' functions */ var charstring vc_hashedId8ToBeUsed := PX_IUT_DEFAULT_CERTIFICATE; /** Digest value of the AT certificate to be used by the IUT. Default: CERT_IUT_A_AT */ -- GitLab From ef0c952b5943e336a3b3e21164c6650c73de6f95 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 7 Dec 2017 13:28:00 +0000 Subject: [PATCH 047/320] Add Brainpool Security support --- .../LibItsSecurity_EncdecDeclarations.ttcn | 42 ++------ ttcn/Security/LibItsSecurity_Functions.ttcn | 102 ++++++++++++++++-- ttcn/Security/LibItsSecurity_Templates.ttcn | 101 ++++------------- .../LibItsSecurity_TypesAndValues.ttcn | 11 +- 4 files changed, 128 insertions(+), 128 deletions(-) diff --git a/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn b/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn index 9107023f..7973e2ee 100644 --- a/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn +++ b/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn @@ -17,6 +17,7 @@ module LibItsSecurity_EncdecDeclarations { external function fx_dec_CertificateBase(inout bitstring b, out IEEE1609dot2.CertificateBase p) return integer with {extension "prototype(sliding) decode(PER)"} + /** * @desc Encoding function for IEEE1609dot2.ToBeSignedCertificate * @param p The ToBeSign part of the certificate @@ -33,46 +34,19 @@ module LibItsSecurity_EncdecDeclarations { external function fx_enc_Ieee1609Dot2Data(in IEEE1609dot2.Ieee1609Dot2Data p) return bitstring with {extension "prototype(convert) encode(PER)"} + external function fx_dec_Ieee1609Dot2Data(inout bitstring p_data, out IEEE1609dot2.Ieee1609Dot2Data p_ieee1609Dot2Data) return integer + with {extension "prototype(sliding) decode(PER)"} - - - - - - - - - - - - - - - - //encoding functions -/* external function fx_enc_SecuredMessage (LibItsSecurity_TypesAndValues.SecuredMessage p) return bitstring - with {extension "prototype(convert) encode(LibItsSecurity)"} - - external function fx_enc_ToBeSignedSecuredMessage (LibItsSecurity_TypesAndValues.ToBeSignedSecuredMessage p) return bitstring + external function fx_enc_SspCAM (LibItsSecurity_TypesAndValues.SspCAM p_ssp) return bitstring with {extension "prototype(convert) encode(LibItsSecurity)"} - external function fx_enc_Certificate (LibItsSecurity_TypesAndValues.Certificate p) return bitstring - with {extension "prototype(convert) encode(LibItsSecurity)"} + external function fx_dec_SspCAM (inout bitstring p_data, out LibItsSecurity_TypesAndValues.SspCAM p_ssp) return integer + with {extension "prototype(sliding) decode(LibItsSecurity)"} - external function fx_enc_ToBeSignedCertificate_ (LibItsSecurity_TypesAndValues.ToBeSignedCertificate p) return bitstring + external function fx_enc_SspDENM (LibItsSecurity_TypesAndValues.SspDENM p_ssp) return bitstring with {extension "prototype(convert) encode(LibItsSecurity)"} - - //decoding functions - external function fx_dec_SecuredMessage (inout bitstring b, out LibItsSecurity_TypesAndValues.SecuredMessage p) return integer - with {extension "prototype(sliding) decode(LibItsSecurity)"} - external function fx_dec_ToBeSignedSecuredMessage (inout bitstring b, out LibItsSecurity_TypesAndValues.ToBeSignedSecuredMessage p) return integer - with {extension "prototype(sliding) decode(LibItsSecurity)"} - - external function fx_dec_Certificate (inout bitstring b, out LibItsSecurity_TypesAndValues.Certificate p) return integer + external function fx_dec_SspDENM (inout bitstring p_data, out LibItsSecurity_TypesAndValues.SspDENM p_ssp) return integer with {extension "prototype(sliding) decode(LibItsSecurity)"} - external function fx_dec_ToBeSignedCertificate (inout bitstring b, out LibItsSecurity_TypesAndValues.ToBeSignedCertificate p) return integer - with {extension "prototype(sliding) decode(LibItsSecurity)"}*/ - } // End of module LibItsSecurity_EncdecDeclarations diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 74335786..b2182b2f 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -55,7 +55,7 @@ module LibItsSecurity_Functions { } // End of function f_hashWithSha256 /** - * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signaturee + * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature * @param p_toBeSignedSecuredMessage The data to be signed * @return The signature value */ @@ -70,6 +70,22 @@ module LibItsSecurity_Functions { } // End of function f_signWithEcdsaNistp256WithSha256 + /** + * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature + * @param p_toBeSignedSecuredMessage The data to be signed + * @return The signature value + */ + function f_signWithEcdsaBrainpoolp256WithSha256( + in octetstring p_toBeSignedSecuredMessage, + in Oct32 p_privateKey + ) runs on ItsSecurityBaseComponent return octetstring { + return fx_signWithEcdsaBrainpoolp256WithSha256( + p_toBeSignedSecuredMessage, + p_privateKey + ); + + } // End of function f_signWithEcdsaBrainpoolp256WithSha256 + /** * @desc Compute the HashedId8 value from the hash value * @param p_hash The hash value @@ -128,12 +144,44 @@ module LibItsSecurity_Functions { * @param p_publicKeyX The new public key value (y coordinate) * @return true on success, false otherwise */ - function f_generate_key_pair( - out octetstring p_privateKey, - out octetstring p_publicKeyX, - out octetstring p_publicKeyY - ) return boolean { - return fx_generateKeyPair(p_privateKey, p_publicKeyX, p_publicKeyY); + function f_generate_key_pair_nistp256( + out octetstring p_privateKey, + out octetstring p_publicKeyX, + out octetstring p_publicKeyY + ) return boolean { + return fx_generateKeyPair_nistp256(p_privateKey, p_publicKeyX, p_publicKeyY); + } + + /** + * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. + * This function should not be used by the ATS + * @param p_privateKey The new private key value + * @param p_publicKeyX The new public key value (x coordinate) + * @param p_publicKeyX The new public key value (y coordinate) + * @return true on success, false otherwise + */ + function f_generate_key_pair_brainpoolp256( + out octetstring p_privateKey, + out octetstring p_publicKeyX, + out octetstring p_publicKeyY + ) return boolean { + return fx_generateKeyPair_brainpoolp256(p_privateKey, p_publicKeyX, p_publicKeyY); + } + + /** + * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. + * This function should not be used by the ATS + * @param p_privateKey The new private key value + * @param p_publicKeyX The new public key value (x coordinate) + * @param p_publicKeyX The new public key value (y coordinate) + * @return true on success, false otherwise + */ + function f_generate_key_pair_brainpoolp384( + out octetstring p_privateKey, + out octetstring p_publicKeyX, + out octetstring p_publicKeyY + ) return boolean { + return fx_generateKeyPair_brainpoolp384(p_privateKey, p_publicKeyX, p_publicKeyY); } /** @@ -1441,12 +1489,28 @@ module LibItsSecurity_Functions { external function fx_hashWithSha384(in octetstring p_toBeHashedData) return Oct48; /** - * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signaturee + * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature * @param p_toBeSignedSecuredMessage The data to be signed * @param p_privateKey The private key * @return The signature value */ external function fx_signWithEcdsaNistp256WithSha256(in octetstring p_toBeSignedSecuredMessage, in octetstring/*UInt64*/ p_privateKey) return octetstring; + + /** + * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature + * @param p_toBeSignedSecuredMessage The data to be signed + * @param p_privateKey The private key + * @return The signature value + */ + external function fx_signWithEcdsaBrainpoolp256WithSha256(in octetstring p_toBeSignedSecuredMessage, in octetstring/*UInt64*/ p_privateKey) return octetstring; + + /** + * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature + * @param p_toBeSignedSecuredMessage The data to be signed + * @param p_privateKey The private key + * @return The signature value + */ + external function fx_signWithEcdsaBrainpoolp384WithSha384(in octetstring p_toBeSignedSecuredMessage, in octetstring/*UInt64*/ p_privateKey) return octetstring; /** * @desc Verify the signature of the specified data @@ -1466,7 +1530,27 @@ module LibItsSecurity_Functions { * @param p_publicKeyX The new public key value (y coordinate) * @return true on success, false otherwise */ - external function fx_generateKeyPair(out octetstring/*UInt64*/ p_privateKey, out octetstring p_publicKeyX, out octetstring p_publicKeyY) return boolean; + external function fx_generateKeyPair_nistp256(out octetstring/*UInt64*/ p_privateKey, out octetstring p_publicKeyX, out octetstring p_publicKeyY) return boolean; + + /** + * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. + * This function should not be used by the ATS + * @param p_privateKey The new private key value + * @param p_publicKeyX The new public key value (x coordinate) + * @param p_publicKeyX The new public key value (y coordinate) + * @return true on success, false otherwise + */ + external function fx_generateKeyPair_brainpoolp256(out octetstring/*UInt64*/ p_privateKey, out octetstring p_publicKeyX, out octetstring p_publicKeyY) return boolean; + + /** + * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. + * This function should not be used by the ATS + * @param p_privateKey The new private key value + * @param p_publicKeyX The new public key value (x coordinate) + * @param p_publicKeyX The new public key value (y coordinate) + * @return true on success, false otherwise + */ + external function fx_generateKeyPair_brainpoolp384(out octetstring/*UInt64*/ p_privateKey, out octetstring p_publicKeyX, out octetstring p_publicKeyY) return boolean; } // End of group signing diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index 0226a015..c12d533d 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -1278,21 +1278,7 @@ module LibItsSecurity_Templates { } // End of group validityRestriction - group ssp {/* - - group sspTest { - - template (present) ServiceSpecificPermissions m_sspTest := { - version := '00'O, - sspContainer := omit - } // End of template mw_sspTest - - template (present) ServiceSpecificPermissions mw_sspTest := { - version := '00'O, - sspContainer := * - } // End of template mw_sspTest - - } // End of group sspTest + group ssp { group sspCam { @@ -1313,8 +1299,7 @@ module LibItsSecurity_Templates { noPassing := '1'B, noPassingForTrucks := '1'B, speedLimit := '1'B, - reserved1 := '0'B, - reserved2 := '0'B + reserved := '000000000000000000'B } // End of template m_sspCAMContainer_sign_all template (value) SspCAM m_sspCAMContainer_vehicle @@ -1326,19 +1311,11 @@ module LibItsSecurity_Templates { speedLimit := '0'B } // End of template m_sspCAMContainer_vehicle - template (value) ServiceSpecificPermissions m_sspCAM_sign_all := { - version := '01'O, - sspContainer := { - sspCAM := m_sspCAMContainer_sign_all - } // End of field sspContainer - } // End of template m_sspCAM_sign_all - - template (value) ServiceSpecificPermissions m_sspCAM_vehicle - modifies m_sspCAM_sign_all := { - sspContainer := { - sspCAM := m_sspCAMContainer_vehicle - } // End of field sspContainer - } // End of template m_sspCAM_vehicle + template (value) ServiceSpecificPermissions m_sspCAM( + in template (value) BitmapSsp p_bitmapSsp + ) := { + bitmapSsp := p_bitmapSsp + } // End of template m_sspCAM } // End of group sspCamSend @@ -1359,16 +1336,11 @@ module LibItsSecurity_Templates { noPassing := ?, noPassingForTrucks := ?, speedLimit := ?, - reserved1 := ?, - reserved2 := ? + reserved := '000000000000000000'B } // End of template mw_sspCAMContainer_dummy - template (present) ServiceSpecificPermissions mw_sspCAM_dummy := { - version := '01'O, - sspContainer := { - sspCAM := mw_sspCAMContainer_dummy - } + bitmapSsp := ? } // End of template mw_sspCAM_dummy } // End of group sspCamRecv @@ -1403,7 +1375,8 @@ module LibItsSecurity_Templates { hazardousLocation_DangerousCurve := '1'B, collisionRisk := '1'B, signalViolation := '1'B, - dangerousSituation := '1'B + dangerousSituation := '1'B, + reserved := '00000000'B } // End of template m_sspDENMContainer_sign_all template (value) SspDENM m_sspDENMContainer_vehicle @@ -1444,27 +1417,11 @@ module LibItsSecurity_Templates { dangerousSituation := '0'B } // End of template m_sspDENMContainer_roadSideUnit - template (value) ServiceSpecificPermissions m_sspDENM_sign_all := { - version := '01'O, - sspContainer := { - sspDENM := m_sspDENMContainer_sign_all - } // End of field sspContainer - } // End of template m_sspDENM_sign_all - - - template (value) ServiceSpecificPermissions m_sspDENM_vehicle - modifies m_sspDENM_sign_all := { - sspContainer := { - sspDENM := m_sspDENMContainer_vehicle - } // End of field sspContainer - } // End of template m_sspDENM_vehicle - - template (value) ServiceSpecificPermissions m_sspDENM_roadSideUnit - modifies m_sspDENM_sign_all := { - sspContainer := { - sspDENM := m_sspDENMContainer_vehicle - } // End of field sspContainer - } // End of template m_sspDENM_roadSideUnit + template (value) ServiceSpecificPermissions m_sspDENM( + in template (value) BitmapSsp p_bitmapSsp + ) := { + bitmapSsp := p_bitmapSsp + } // End of template m_sspDENM } // End of group sspDenmSend @@ -1494,7 +1451,8 @@ module LibItsSecurity_Templates { hazardousLocation_DangerousCurve := ?, collisionRisk := ?, signalViolation := ?, - dangerousSituation := ? + dangerousSituation := ?, + reserved := '00000000'B } // End of template mw_sspDENMContainer_dummy template (present) SspDENM mw_sspDENMContainer_vehicle @@ -1535,32 +1493,11 @@ module LibItsSecurity_Templates { dangerousSituation := '0'B } // End of template m_sspDENMContainer_roadSideUnit - template (present) ServiceSpecificPermissions mw_sspDENM_dummy := { - version := '01'O, - sspContainer := { - sspDENM := mw_sspDENMContainer_dummy - } - } // End of template mw_sspDENM_dummy - - template (present) ServiceSpecificPermissions mw_sspDENM_vehicle - modifies mw_sspDENM_dummy := { - sspContainer := { - sspDENM := mw_sspDENMContainer_vehicle - } - } // End of template mw_sspDENM_vehicle - - template (present) ServiceSpecificPermissions mw_sspDENM_roadSideUnit - modifies mw_sspDENM_dummy := { - sspContainer := { - sspDENM := mw_sspDENMContainer_roadSideUnit - } - } // End of template mw_sspDENM_roadSideUnit - } // End of group sspDenmRecv } // End of group sspDenm - */} // End of group ssp + } // End of group ssp group utPrimitives { diff --git a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn index 9fddeecf..4cae1bc6 100644 --- a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn +++ b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn @@ -45,8 +45,9 @@ module LibItsSecurity_TypesAndValues { Bit1 noPassing, Bit1 noPassingForTrucks, Bit1 speedLimit, - Bit1 reserved1, - Bit1 reserved2 + Bit18 reserved + } with { + variant "FIELDORDER(msb)" } // End of type SspCAM /** @@ -102,7 +103,10 @@ module LibItsSecurity_TypesAndValues { Bit1 hazardousLocation_DangerousCurve, Bit1 collisionRisk, Bit1 signalViolation, - Bit1 dangerousSituation + Bit1 dangerousSituation, + Bit8 reserved + } with { + variant "FIELDORDER(msb)" } // End of type SspDENM } // End of group certificateSpecification @@ -157,5 +161,6 @@ module LibItsSecurity_TypesAndValues { } // End of group utPrimitives } with { + variant "" encode "LibItsSecurity" } // End of module LibItsSecurity_TypesAndValues -- GitLab From 0972821f859a16aae837e86087dab0f329cc7c35 Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 8 Dec 2017 07:40:31 +0000 Subject: [PATCH 048/320] Add Brainpool Security support --- ttcn/Security/LibItsSecurity_Functions.ttcn | 124 +++++++++++++++++--- 1 file changed, 106 insertions(+), 18 deletions(-) diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index b2182b2f..3558a5b8 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -86,6 +86,22 @@ module LibItsSecurity_Functions { } // End of function f_signWithEcdsaBrainpoolp256WithSha256 + /** + * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature + * @param p_toBeSignedSecuredMessage The data to be signed + * @return The signature value + */ + function f_signWithEcdsaBrainpoolp384WithSha384( + in octetstring p_toBeSignedSecuredMessage, + in Oct48 p_privateKey + ) runs on ItsSecurityBaseComponent return octetstring { + return fx_signWithEcdsaBrainpoolp384WithSha384( + p_toBeSignedSecuredMessage, + p_privateKey + ); + + } // End of function f_signWithEcdsaBrainpoolp384WithSha384 + /** * @desc Compute the HashedId8 value from the hash value * @param p_hash The hash value @@ -136,6 +152,58 @@ module LibItsSecurity_Functions { p_ecdsaNistp256PublicKeyY); } // End of function f_verifyWithEcdsaNistp256WithSha256 + /** + * @Desc Verify the signature of the specified data + * @param p_toBeVerifiedData The data to be verified + * @param p_signature The signature + * @param p_ecdsaBrainpoolp256PublicKeyX The public key (x coordinate) + * @param p_ecdsaBrainpoolp256PublicKeyY The public key (y coordinate) + * @return true on success, false otherwise + */ + function f_verifyWithEcdsaBrainpoolp256WithSha256( + in octetstring p_toBeVerifiedData, + in octetstring p_signature, + in octetstring p_ecdsaBrainpoolp256PublicKeyX, + in octetstring p_ecdsaBrainpoolp256PublicKeyY + ) return boolean { +// log("f_verifyWithEcdsaBrainpoolp256WithSha256: toBeVerifiedData", p_toBeVerifiedData); +// log("f_verifyWithEcdsaBrainpoolp256WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); +// log("f_verifyWithEcdsaBrainpoolp256WithSha256: signature", p_signature); +// log("f_verifyWithEcdsaBrainpoolp256WithSha256: ecdsaBrainpoolp256PublicKeyX", p_ecdsaBrainpoolp256PublicKeyX); +// log("f_verifyWithEcdsaBrainpoolp256WithSha256: ecdsaBrainpoolp256PublicKeyY", p_ecdsaBrainpoolp256PublicKeyY); + return fx_verifyWithEcdsaBrainpoolp256WithSha256( + p_toBeVerifiedData, + p_signature, + p_ecdsaBrainpoolp256PublicKeyX, + p_ecdsaBrainpoolp256PublicKeyY); + } // End of function f_verifyWithEcdsaBrainpoolp256WithSha256 + + /** + * @Desc Verify the signature of the specified data + * @param p_toBeVerifiedData The data to be verified + * @param p_signature The signature + * @param p_ecdsaBrainpoolp384PublicKeyX The public key (x coordinate) + * @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate) + * @return true on success, false otherwise + */ + function f_verifyWithEcdsaBrainpoolp384WithSha384( + in octetstring p_toBeVerifiedData, + in octetstring p_signature, + in octetstring p_ecdsaBrainpoolp384PublicKeyX, + in octetstring p_ecdsaBrainpoolp384PublicKeyY + ) return boolean { +// log("f_verifyWithEcdsaBrainpoolp384WithSha384: toBeVerifiedData", p_toBeVerifiedData); +// log("f_verifyWithEcdsaBrainpoolp384WithSha384: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); +// log("f_verifyWithEcdsaBrainpoolp384WithSha384: signature", p_signature); +// log("f_verifyWithEcdsaBrainpoolp384WithSha384: ecdsaBrainpoolp384PublicKeyX", p_ecdsaBrainpoolp384PublicKeyX); +// log("f_verifyWithEcdsaBrainpoolp384WithSha384: ecdsaBrainpoolp384PublicKeyY", p_ecdsaBrainpoolp384PublicKeyY); + return fx_verifyWithEcdsaBrainpoolp384WithSha384( + p_toBeVerifiedData, + p_signature, + p_ecdsaBrainpoolp384PublicKeyX, + p_ecdsaBrainpoolp384PublicKeyY); + } // End of function f_verifyWithEcdsaBrainpoolp384WithSha384 + /** * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. * This function should not be used by the ATS @@ -145,9 +213,9 @@ module LibItsSecurity_Functions { * @return true on success, false otherwise */ function f_generate_key_pair_nistp256( - out octetstring p_privateKey, - out octetstring p_publicKeyX, - out octetstring p_publicKeyY + out Oct32 p_privateKey, + out Oct32 p_publicKeyX, + out Oct32 p_publicKeyY ) return boolean { return fx_generateKeyPair_nistp256(p_privateKey, p_publicKeyX, p_publicKeyY); } @@ -161,9 +229,9 @@ module LibItsSecurity_Functions { * @return true on success, false otherwise */ function f_generate_key_pair_brainpoolp256( - out octetstring p_privateKey, - out octetstring p_publicKeyX, - out octetstring p_publicKeyY + out Oct32 p_privateKey, + out Oct32 p_publicKeyX, + out Oct32 p_publicKeyY ) return boolean { return fx_generateKeyPair_brainpoolp256(p_privateKey, p_publicKeyX, p_publicKeyY); } @@ -177,9 +245,9 @@ module LibItsSecurity_Functions { * @return true on success, false otherwise */ function f_generate_key_pair_brainpoolp384( - out octetstring p_privateKey, - out octetstring p_publicKeyX, - out octetstring p_publicKeyY + out Oct48 p_privateKey, + out Oct48 p_publicKeyX, + out Oct48 p_publicKeyY ) return boolean { return fx_generateKeyPair_brainpoolp384(p_privateKey, p_publicKeyX, p_publicKeyY); } @@ -1479,14 +1547,14 @@ module LibItsSecurity_Functions { * @param p_toBeHashedData Data to be used to calculate the hash value * @return The hash value */ - external function fx_hashWithSha256(in octetstring p_toBeHashedData) return Oct32; + external function fx_hashWithSha256(in Oct32 p_toBeHashedData) return Oct32; /** * @desc Produces a 384-bit (48-byte) hash value * @param p_toBeHashedData Data to be used to calculate the hash value * @return The hash value */ - external function fx_hashWithSha384(in octetstring p_toBeHashedData) return Oct48; + external function fx_hashWithSha384(in Oct32 p_toBeHashedData) return Oct48; /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature @@ -1494,7 +1562,7 @@ module LibItsSecurity_Functions { * @param p_privateKey The private key * @return The signature value */ - external function fx_signWithEcdsaNistp256WithSha256(in octetstring p_toBeSignedSecuredMessage, in octetstring/*UInt64*/ p_privateKey) return octetstring; + external function fx_signWithEcdsaNistp256WithSha256(in Oct32 p_toBeSignedSecuredMessage, in Oct32 p_privateKey) return octetstring; /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature @@ -1502,7 +1570,7 @@ module LibItsSecurity_Functions { * @param p_privateKey The private key * @return The signature value */ - external function fx_signWithEcdsaBrainpoolp256WithSha256(in octetstring p_toBeSignedSecuredMessage, in octetstring/*UInt64*/ p_privateKey) return octetstring; + external function fx_signWithEcdsaBrainpoolp256WithSha256(in Oct32 p_toBeSignedSecuredMessage, in Oct32 p_privateKey) return octetstring; /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature @@ -1510,7 +1578,7 @@ module LibItsSecurity_Functions { * @param p_privateKey The private key * @return The signature value */ - external function fx_signWithEcdsaBrainpoolp384WithSha384(in octetstring p_toBeSignedSecuredMessage, in octetstring/*UInt64*/ p_privateKey) return octetstring; + external function fx_signWithEcdsaBrainpoolp384WithSha384(in Oct48 p_toBeSignedSecuredMessage, in Oct48 p_privateKey) return octetstring; /** * @desc Verify the signature of the specified data @@ -1520,7 +1588,27 @@ module LibItsSecurity_Functions { * @param p_ecdsaNistp256PublicKeyY The public key (y coordinate) * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaNistp256WithSha256(in octetstring p_toBeVerifiedData, in octetstring p_signature, in octetstring p_ecdsaNistp256PublicKeyX, in octetstring p_ecdsaNistp256PublicKeyY) return boolean; + external function fx_verifyWithEcdsaNistp256WithSha256(in Oct32 p_toBeVerifiedData, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyX, in Oct32 p_ecdsaNistp256PublicKeyY) return boolean; + + /** + * @desc Verify the signature of the specified data + * @param p_toBeVerifiedData The data to be verified + * @param p_signature The signature + * @param p_ecdsaBrainpoolp256PublicKeyX The public key (x coordinate) + * @param p_ecdsaBrainpoolp256PublicKeyY The public key (y coordinate) + * @return true on success, false otherwise + */ + external function fx_verifyWithEcdsaBrainpoolp256WithSha256(in Oct32 p_toBeVerifiedData, in octetstring p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyX, in Oct32 p_ecdsaBrainpoolp256PublicKeyY) return boolean; + + /** + * @desc Verify the signature of the specified data + * @param p_toBeVerifiedData The data to be verified + * @param p_signature The signature + * @param p_ecdsaBrainpoolp384PublicKeyX The public key (x coordinate) + * @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate) + * @return true on success, false otherwise + */ + external function fx_verifyWithEcdsaBrainpoolp384WithSha384(in Oct48 p_toBeVerifiedData, in octetstring p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyX, in Oct48 p_ecdsaBrainpoolp384PublicKeyY) return boolean; /** * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. @@ -1530,7 +1618,7 @@ module LibItsSecurity_Functions { * @param p_publicKeyX The new public key value (y coordinate) * @return true on success, false otherwise */ - external function fx_generateKeyPair_nistp256(out octetstring/*UInt64*/ p_privateKey, out octetstring p_publicKeyX, out octetstring p_publicKeyY) return boolean; + external function fx_generateKeyPair_nistp256(out Oct32 p_privateKey, out Oct32 p_publicKeyX, out Oct32 p_publicKeyY) return boolean; /** * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. @@ -1540,7 +1628,7 @@ module LibItsSecurity_Functions { * @param p_publicKeyX The new public key value (y coordinate) * @return true on success, false otherwise */ - external function fx_generateKeyPair_brainpoolp256(out octetstring/*UInt64*/ p_privateKey, out octetstring p_publicKeyX, out octetstring p_publicKeyY) return boolean; + external function fx_generateKeyPair_brainpoolp256(out Oct32 p_privateKey, out Oct32 p_publicKeyX, out Oct32 p_publicKeyY) return boolean; /** * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. @@ -1550,7 +1638,7 @@ module LibItsSecurity_Functions { * @param p_publicKeyX The new public key value (y coordinate) * @return true on success, false otherwise */ - external function fx_generateKeyPair_brainpoolp384(out octetstring/*UInt64*/ p_privateKey, out octetstring p_publicKeyX, out octetstring p_publicKeyY) return boolean; + external function fx_generateKeyPair_brainpoolp384(out Oct48 p_privateKey, out Oct48 p_publicKeyX, out Oct48 p_publicKeyY) return boolean; } // End of group signing -- GitLab From b741b3d360ebf3ab2a77fb8e8b87f70b257660ef Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 11 Dec 2017 13:48:42 +0000 Subject: [PATCH 049/320] Add Brainpool Security support --- ttcn/Security/LibItsSecurity_Templates.ttcn | 135 +++++++++++++++++--- 1 file changed, 118 insertions(+), 17 deletions(-) diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index c12d533d..b62311b4 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -816,21 +816,21 @@ module LibItsSecurity_Templates { sSig := p_sSig } // End of template mw_ecdsaNistP256Signature - template (value) EcdsaP384Signature m_ecdsaP384Signature( - in template (value) EccP384CurvePoint p_rSig, - in template (value) Oct48 p_sSig + template (value) EcdsaP384Signature m_ecdsaBrainpoolP384Signature( + in template (value) EccP384CurvePoint p_rSig, + in template (value) Oct48 p_sSig ) := { rSig := p_rSig, sSig := p_sSig - } // End of template m_ecdsaP384Signature + } // End of template m_ecdsaBrainpoolP384Signature - template (present) EcdsaP384Signature mw_ecdsaP384Signature( - template (present) EccP384CurvePoint p_rSig := ?, - template (present) Oct48 p_sSig := ? + template (present) EcdsaP384Signature mw_ecdsaBrainpoolP384Signature( + template (present) EccP384CurvePoint p_rSig := ?, + template (present) Oct48 p_sSig := ? ) := { rSig := p_rSig, sSig := p_sSig - } // End of template mw_ecdsaP384Signature + } // End of template mw_ecdsaBrainpoolP384Signature template (value) EccP256CurvePoint m_eccP256CurvePoint_x_only( in template (value) Oct32 p_x_only @@ -1047,7 +1047,6 @@ module LibItsSecurity_Templates { in template (value) SequenceOfPsidSsp p_appPermissions, in template (value) SequenceOfPsidGroupPermissions p_certIssuePermissions, in template (value) VerificationKeyIndicator p_verifyKeyIndicator, - in template (omit) SequenceOfPsidGroupPermissions p_certRequestPermissions := omit, in template (omit) ValidityPeriod p_validityPeriod := omit, in template (omit) GeographicRegion p_region := omit, in template (omit) SubjectAssurance p_assuranceLevel := omit, @@ -1060,8 +1059,8 @@ module LibItsSecurity_Templates { region := p_region, assuranceLevel := p_assuranceLevel, appPermissions := p_appPermissions, - certIssuePermissions := p_certIssuePermissions, - certRequestPermissions := p_certRequestPermissions, + certIssuePermissions := p_certIssuePermissions, // ETSI TS 103 097 V1.3.1 Clause 7.2.3 Root CA certificates Bullet 4 + certRequestPermissions := omit, canRequestRollover := omit, encryptionKey := p_encryptionKey, verifyKeyIndicator := p_verifyKeyIndicator @@ -1074,9 +1073,8 @@ module LibItsSecurity_Templates { template ToBeSignedCertificate mw_toBeSignedCertificate_ca( template (present) CertificateId p_id := ?, template (present) SequenceOfPsidSsp p_appPermissions := ?, - template (present) SequenceOfPsidGroupPermissions p_certIssuePermissions := ?, + template (present) SequenceOfPsidGroupPermissions p_certIssuePermissions, template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, - template SequenceOfPsidGroupPermissions p_certRequestPermissions := *, template ValidityPeriod p_validityPeriod := *, template GeographicRegion p_region := *, template SubjectAssurance p_assuranceLevel := *, @@ -1088,14 +1086,68 @@ module LibItsSecurity_Templates { validityPeriod := p_validityPeriod, region := p_region, assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, + appPermissions := *, certIssuePermissions := p_certIssuePermissions, - certRequestPermissions := p_certRequestPermissions, + certRequestPermissions := *, canRequestRollover := *, encryptionKey := p_encryptionKey, verifyKeyIndicator := p_verifyKeyIndicator } // End of template mw_toBeSignedCertificate + /** + * @desc Send template for ToBeSignedCertificate with Enrolment credential restrictions + * @see ETSI TS 103 097 V1.3.1 Clause 7.2.2 Enrolment credential + */ + template (omit) ToBeSignedCertificate m_toBeSignedCertificate_ea( + in template (value) CertificateId p_id, + in template (value) SequenceOfPsidSsp p_appPermissions, + in template (value) VerificationKeyIndicator p_verifyKeyIndicator, + in template (omit) ValidityPeriod p_validityPeriod := omit, + in template (omit) GeographicRegion p_region := omit, + in template (omit) SubjectAssurance p_assuranceLevel := omit, + in template (omit) PublicEncryptionKey p_encryptionKey := omit + ) := { + id := p_id, + cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 + crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 + validityPeriod := p_validityPeriod, + region := p_region, + assuranceLevel := p_assuranceLevel, + appPermissions := p_appPermissions, + certIssuePermissions := omit, + certRequestPermissions := omit, + canRequestRollover := omit, + encryptionKey := p_encryptionKey, + verifyKeyIndicator := p_verifyKeyIndicator + } // End of template m_toBeSignedCertificate_ea + + /** + * @desc Send template for ToBeSignedCertificate with Enrolment credential restrictions + * @see ETSI TS 103 097 V1.3.1 Clause 7.2.2 Enrolment credential + */ + template ToBeSignedCertificate mw_toBeSignedCertificate_ea( + template (present) CertificateId p_id := ?, + template (present) SequenceOfPsidSsp p_appPermissions := ?, + template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, + template ValidityPeriod p_validityPeriod := *, + template GeographicRegion p_region := *, + template SubjectAssurance p_assuranceLevel := *, + template PublicEncryptionKey p_encryptionKey := * + ) := { + id := p_id, + cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 + crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 + validityPeriod := p_validityPeriod, + region := p_region, + assuranceLevel := p_assuranceLevel, + appPermissions := p_appPermissions, + certIssuePermissions := *, + certRequestPermissions := *, + canRequestRollover := *, + encryptionKey := p_encryptionKey, + verifyKeyIndicator := p_verifyKeyIndicator + } // End of template mw_toBeSignedCertificate_ea + /** * @desc Send template for ToBeSignedCertificate with AT restrictions * @see ETSI TS 103 097 V1.3.1 Clause 7.2.1 Authorization tickets @@ -1103,7 +1155,6 @@ module LibItsSecurity_Templates { template (omit) ToBeSignedCertificate m_toBeSignedCertificate_at( in template (value) SequenceOfPsidSsp p_appPermissions, in template (value) VerificationKeyIndicator p_verifyKeyIndicator, - in template (omit) SequenceOfPsidGroupPermissions p_certRequestPermissions := omit, in template (omit) ValidityPeriod p_validityPeriod := omit, in template (omit) GeographicRegion p_region := omit, in template (omit) SubjectAssurance p_assuranceLevel := omit, @@ -1117,12 +1168,38 @@ module LibItsSecurity_Templates { assuranceLevel := p_assuranceLevel, appPermissions := p_appPermissions, certIssuePermissions := omit, - certRequestPermissions := p_certRequestPermissions, + certRequestPermissions := omit, canRequestRollover := omit, encryptionKey := p_encryptionKey, verifyKeyIndicator := p_verifyKeyIndicator } // End of template m_toBeSignedCertificate_at + /** + * @desc Send template for ToBeSignedCertificate with AT restrictions + * @see ETSI TS 103 097 V1.3.1 Clause 7.2.1 Authorization tickets + */ + template ToBeSignedCertificate mw_toBeSignedCertificate_at( + template (present) SequenceOfPsidSsp p_appPermissions := ?, + template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, + template ValidityPeriod p_validityPeriod := *, + template GeographicRegion p_region := *, + template SubjectAssurance p_assuranceLevel := *, + template PublicEncryptionKey p_encryptionKey := * + ) := { + id := { none_ := NULL }, + cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 + crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 + validityPeriod := p_validityPeriod, + region := p_region, + assuranceLevel := p_assuranceLevel, + appPermissions := p_appPermissions, + certIssuePermissions := *, + certRequestPermissions := *, + canRequestRollover := *, + encryptionKey := p_encryptionKey, + verifyKeyIndicator := p_verifyKeyIndicator + } // End of template mw_toBeSignedCertificate_at + } // End of toBeSignedCertificate group keys { @@ -1163,6 +1240,30 @@ module LibItsSecurity_Templates { ecdsaNistP256 := p_ecdsaNistP256 } // End of template mw_publicVerificationKey_ecdsaNistP256 + template (value) PublicVerificationKey m_publicVerificationKey_ecdsaBrainpoolP256( + in template (value) EccP256CurvePoint p_ecdsaBrainpoolP256r1 + ) := { + ecdsaBrainpoolP256r1 := p_ecdsaBrainpoolP256r1 + } // End of template m_publicVerificationKey_ecdsaBrainpoolP256 + + template (present) PublicVerificationKey mw_publicVerificationKey_ecdsaBrainpoolP256( + template (present) EccP256CurvePoint p_ecdsaBrainpoolP256r1 := ? + ) := { + ecdsaBrainpoolP256r1 := p_ecdsaBrainpoolP256r1 + } // End of template mw_publicVerificationKey_ecdsaBrainpoolP256 + + template (value) PublicVerificationKey m_publicVerificationKey_ecdsaBrainpoolP384( + in template (value) EccP384CurvePoint p_ecdsaBrainpoolP384r1 + ) := { + ecdsaBrainpoolP384r1 := p_ecdsaBrainpoolP384r1 + } // End of template m_publicVerificationKey_ecdsaBrainpoolP384 + + template (present) PublicVerificationKey mw_publicVerificationKey_ecdsaBrainpoolP384( + template (present) EccP384CurvePoint p_ecdsaBrainpoolP384r1 := ? + ) := { + ecdsaBrainpoolP384r1 := p_ecdsaBrainpoolP384r1 + } // End of template mw_publicVerificationKey_ecdsaBrainpoolP384 + } // End of group keys group appPermissions { -- GitLab From 14fce52eb6c581beec5a72493a9150e34d87b851 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 14 Dec 2017 10:22:32 +0000 Subject: [PATCH 050/320] Validate AtsRSUSimulator for CAM & DENM --- ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn b/ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn index 296a07d0..bba87da5 100644 --- a/ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn +++ b/ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn @@ -21,10 +21,6 @@ module LibItsCam_EncdecDeclarations { external function fx_dec_CAM (inout bitstring b, out CAM p) return integer with {extension "prototype(sliding) decode(PER)"} -/* - external function fx_enc_CAM (CAM p) return octetstring - with {extension "prototype(convert) encode(BER:BER_ENCODE_CER)"} -*/ external function fx_enc_UtCamInitialize (UtCamInitialize p) return bitstring with {extension "prototype(convert) encode(UpperTester)"} -- GitLab From 9c8a103c931e29f9dcdbc3ff781b1d60ebfab8ae Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 15 Dec 2017 16:05:17 +0000 Subject: [PATCH 051/320] Validate AtsRSUSimulator for CAM & DENM --- ttcn/Security/LibItsSecurity_Templates.ttcn | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index b62311b4..43ce6111 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -548,18 +548,21 @@ module LibItsSecurity_Templates { template (value) EtsiTs103097Data m_etsiTs103097Data( in template (value) Ieee1609Dot2Content p_content ) := { - content := p_content + protocolVersion := c_protocol_version, + content := p_content } // End of template m_etsiTs103097Data template (value) EtsiTs103097Data m_etsiTs103097Data_unsecured( in template (value) Opaque p_unsecuredData ) := { + protocolVersion := c_protocol_version, content := { unsecuredData := p_unsecuredData } } // End of template m_secured_data_unsecured template (value) EtsiTs103097Data m_etsiTs103097Data_signed( in template (value) SignedData p_signedData ) := { + protocolVersion := c_protocol_version, content := { signedData := p_signedData } } // End of template m_secured_data_signed @@ -569,7 +572,8 @@ module LibItsSecurity_Templates { template (present) EtsiTs103097Data mw_etsiTs103097Data( template (present) Ieee1609Dot2Content p_content := ? ) := { - content := p_content + protocolVersion := c_protocol_version, + content := p_content } // End of template mw_etsiTs103097Data /** @@ -579,7 +583,8 @@ module LibItsSecurity_Templates { in template (value) UInt8 p_protocol_version, in template (value) Ieee1609Dot2Content p_content ) := { - content := p_content + protocolVersion := c_protocol_version, + content := p_content } // End of template m_etsiTs103097Data_wrong_protocol } // End of group etsiTs103097Data -- GitLab From 14e21bbc3d837ed51fd47542d93fc4e98064d5e5 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 20 Dec 2017 15:58:21 +0000 Subject: [PATCH 052/320] Validate AtsRSUSimulator for CAM & DENM --- ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn | 2 +- ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn index fc0233fe..a7aa57e4 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn @@ -1206,7 +1206,7 @@ module LibItsGeoNetworking_Templates { m_beaconHeaderType ), extendedHeader := mw_beaconHeader(p_sourceLongPosVec), - payload := (*, '00000000000000000000'O) + payload := '00000000000000000000'O ifpresent //(*, '00000000000000000000'O) } } // end group geoNwPacketBeaconTemplates diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn index 46e5de14..5aac89ce 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn @@ -379,6 +379,8 @@ module LibItsGeoNetworking_TypesAndValues { BeaconHeader beaconHeader, LSRequestHeader lsRequestHeader, LSReplyHeader lsReplyHeader, + AnyHeader saHeader, // FIXME Cannot find description, AnyHeader was used as default + AnyHeader saEosHeader, // FIXME Cannot find description, AnyHeader was used as default AnyHeader anyHeader } with { variant "" -- GitLab From b26e71111a0ecc91148cd6985426b23002247406 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 10 Jan 2018 14:35:06 +0000 Subject: [PATCH 053/320] Start validation of TD_AUTO_IOT_DENM_RWW_BV_01 --- ttcn/Security/LibItsSecurity_Functions.ttcn | 4 +- ttcn/Security/LibItsSecurity_Templates.ttcn | 86 +++++++++++++++++---- 2 files changed, 72 insertions(+), 18 deletions(-) diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 3558a5b8..c07d8c96 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -1547,14 +1547,14 @@ module LibItsSecurity_Functions { * @param p_toBeHashedData Data to be used to calculate the hash value * @return The hash value */ - external function fx_hashWithSha256(in Oct32 p_toBeHashedData) return Oct32; + external function fx_hashWithSha256(in octetstring p_toBeHashedData) return Oct32; /** * @desc Produces a 384-bit (48-byte) hash value * @param p_toBeHashedData Data to be used to calculate the hash value * @return The hash value */ - external function fx_hashWithSha384(in Oct32 p_toBeHashedData) return Oct48; + external function fx_hashWithSha384(in octetstring p_toBeHashedData) return Oct48; /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index 43ce6111..33fe1a12 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -805,37 +805,37 @@ module LibItsSecurity_Templates { ecdsaBrainpoolP384r1Signature := p_ecdsaBrainpoolP384r1Signature } // End of template mw_signature_ecdsaBrainpoolP384r1 - template (value) EcdsaP256Signature m_ecdsaNistP256Signature( - in template (value) EccP256CurvePoint p_rSig, - in template (value) Oct32 p_sSig + template (value) EcdsaP256Signature m_ecdsaP256Signature( + in template (value) EccP256CurvePoint p_rSig, + in template (value) Oct32 p_sSig ) := { rSig := p_rSig, sSig := p_sSig - } // End of template m_ecdsaNistP256Signature + } // End of template m_ecdsaP256Signature - template (present) EcdsaP256Signature mw_ecdsaNistP256Signature( - template (present) EccP256CurvePoint p_rSig, - template (present) Oct32 p_sSig + template (present) EcdsaP256Signature mw_ecdsaP256Signature( + template (present) EccP256CurvePoint p_rSig, + template (present) Oct32 p_sSig ) := { rSig := p_rSig, sSig := p_sSig - } // End of template mw_ecdsaNistP256Signature + } // End of template mw_ecdsaP256Signature - template (value) EcdsaP384Signature m_ecdsaBrainpoolP384Signature( - in template (value) EccP384CurvePoint p_rSig, - in template (value) Oct48 p_sSig + template (value) EcdsaP384Signature m_ecdsaP384Signature( + in template (value) EccP384CurvePoint p_rSig, + in template (value) Oct48 p_sSig ) := { rSig := p_rSig, sSig := p_sSig - } // End of template m_ecdsaBrainpoolP384Signature + } // End of template m_ecdsaP384Signature - template (present) EcdsaP384Signature mw_ecdsaBrainpoolP384Signature( - template (present) EccP384CurvePoint p_rSig := ?, - template (present) Oct48 p_sSig := ? + template (present) EcdsaP384Signature mw_ecdsaP384Signature( + template (present) EccP384CurvePoint p_rSig := ?, + template (present) Oct48 p_sSig := ? ) := { rSig := p_rSig, sSig := p_sSig - } // End of template mw_ecdsaBrainpoolP384Signature + } // End of template mw_ecdsaP384Signature template (value) EccP256CurvePoint m_eccP256CurvePoint_x_only( in template (value) Oct32 p_x_only @@ -1153,6 +1153,60 @@ module LibItsSecurity_Templates { verifyKeyIndicator := p_verifyKeyIndicator } // End of template mw_toBeSignedCertificate_ea + /** + * @desc Send template for ToBeSignedCertificate with Authorization authority restrictions + * @see ETSI TS 103 097 V1.3.1 Clause 7.2.4 Subordinate certification authority certificates + */ + template (omit) ToBeSignedCertificate m_toBeSignedCertificate_aa( + in template (value) CertificateId p_id, + in template (value) SequenceOfPsidSsp p_appPermissions, + in template (value) VerificationKeyIndicator p_verifyKeyIndicator, + in template (omit) ValidityPeriod p_validityPeriod := omit, + in template (omit) GeographicRegion p_region := omit, + in template (omit) SubjectAssurance p_assuranceLevel := omit, + in template (omit) PublicEncryptionKey p_encryptionKey := omit + ) := { + id := p_id, + cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 + crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 + validityPeriod := p_validityPeriod, + region := p_region, + assuranceLevel := p_assuranceLevel, + appPermissions := p_appPermissions, + certIssuePermissions := omit, + certRequestPermissions := omit, + canRequestRollover := omit, + encryptionKey := p_encryptionKey, + verifyKeyIndicator := p_verifyKeyIndicator + } // End of template m_toBeSignedCertificate_aa + + /** + * @desc Send template for ToBeSignedCertificate with Authorization authority restrictions + * @see ETSI TS 103 097 V1.3.1 Clause 7.2.4 Subordinate certification authority certificates + */ + template ToBeSignedCertificate mw_toBeSignedCertificate_aa( + template (present) CertificateId p_id := ?, + template (present) SequenceOfPsidSsp p_appPermissions := ?, + template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, + template ValidityPeriod p_validityPeriod := *, + template GeographicRegion p_region := *, + template SubjectAssurance p_assuranceLevel := *, + template PublicEncryptionKey p_encryptionKey := * + ) := { + id := p_id, + cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 + crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 + validityPeriod := p_validityPeriod, + region := p_region, + assuranceLevel := p_assuranceLevel, + appPermissions := p_appPermissions, + certIssuePermissions := *, + certRequestPermissions := *, + canRequestRollover := *, + encryptionKey := p_encryptionKey, + verifyKeyIndicator := p_verifyKeyIndicator + } // End of template mw_toBeSignedCertificate_aa + /** * @desc Send template for ToBeSignedCertificate with AT restrictions * @see ETSI TS 103 097 V1.3.1 Clause 7.2.1 Authorization tickets -- GitLab From ee38bff72f57c71d2ec93a213c76a7b35e24a77a Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 12 Jan 2018 09:59:35 +0000 Subject: [PATCH 054/320] Start validation of TD_AUTO_IOT_DENM_RWW_BV_01 --- ttcn/Security/LibItsSecurity_Functions.ttcn | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index c07d8c96..f22e4abf 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -137,8 +137,8 @@ module LibItsSecurity_Functions { function f_verifyWithEcdsaNistp256WithSha256( in octetstring p_toBeVerifiedData, in octetstring p_signature, - in octetstring p_ecdsaNistp256PublicKeyX, - in octetstring p_ecdsaNistp256PublicKeyY + in Oct32 p_ecdsaNistp256PublicKeyX, + in Oct32 p_ecdsaNistp256PublicKeyY ) return boolean { // log("f_verifyWithEcdsaNistp256WithSha256: toBeVerifiedData", p_toBeVerifiedData); // log("f_verifyWithEcdsaNistp256WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); @@ -163,8 +163,8 @@ module LibItsSecurity_Functions { function f_verifyWithEcdsaBrainpoolp256WithSha256( in octetstring p_toBeVerifiedData, in octetstring p_signature, - in octetstring p_ecdsaBrainpoolp256PublicKeyX, - in octetstring p_ecdsaBrainpoolp256PublicKeyY + in Oct32 p_ecdsaBrainpoolp256PublicKeyX, + in Oct32 p_ecdsaBrainpoolp256PublicKeyY ) return boolean { // log("f_verifyWithEcdsaBrainpoolp256WithSha256: toBeVerifiedData", p_toBeVerifiedData); // log("f_verifyWithEcdsaBrainpoolp256WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); @@ -189,8 +189,8 @@ module LibItsSecurity_Functions { function f_verifyWithEcdsaBrainpoolp384WithSha384( in octetstring p_toBeVerifiedData, in octetstring p_signature, - in octetstring p_ecdsaBrainpoolp384PublicKeyX, - in octetstring p_ecdsaBrainpoolp384PublicKeyY + in Oct48 p_ecdsaBrainpoolp384PublicKeyX, + in Oct48 p_ecdsaBrainpoolp384PublicKeyY ) return boolean { // log("f_verifyWithEcdsaBrainpoolp384WithSha384: toBeVerifiedData", p_toBeVerifiedData); // log("f_verifyWithEcdsaBrainpoolp384WithSha384: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); -- GitLab From 0f09e5117b529bf850e04a8643afdfaa9a8b9f4b Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 24 Jan 2018 14:18:17 +0000 Subject: [PATCH 055/320] Start Security support in the TA Start ATS security review Validation of TD_AUTO_IOT_DENM_RWW_BV_01 in progress --- .../LibItsGeoNetworking_Templates.ttcn | 6 +- .../LibItsSecurity_EncdecDeclarations.ttcn | 6 + ttcn/Security/LibItsSecurity_Functions.ttcn | 2 +- ttcn/Security/LibItsSecurity_Pics.ttcn | 12 +- ttcn/Security/LibItsSecurity_Pixits.ttcn | 5 +- ttcn/Security/LibItsSecurity_Templates.ttcn | 74 ++++++++++- ttcn/Security/LibItsSecurity_TestSystem.ttcn | 115 +---------------- .../LibItsSecurity_TypesAndValues.ttcn | 121 +++++++++++++++++- 8 files changed, 208 insertions(+), 133 deletions(-) diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn index a7aa57e4..ff477c43 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn @@ -650,9 +650,9 @@ module LibItsGeoNetworking_Templates { //FIXME RGY template restriction can be the same as its base template: used in TC_SEC_ITSS_SND_CAM_02_01_BV only, where is called with parameters // template GeoNetworkingPacket mw_geoNwPduWithPayload( template(present) GeoNetworkingPacket mw_geoNwPduWithPayload( - in template (present) CommonHeader p_commonHeader, - in template (present) ExtendedHeader p_extHeader, - in template (present) GnRawPayload p_payload + in template (present) CommonHeader p_commonHeader := ?, + in template (present) ExtendedHeader p_extHeader := ?, + in template (present) GnRawPayload p_payload := ? ) modifies mw_geoNwPacket := { packet := { payload := p_payload diff --git a/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn b/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn index 7973e2ee..ba3ba3e5 100644 --- a/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn +++ b/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn @@ -37,6 +37,12 @@ module LibItsSecurity_EncdecDeclarations { external function fx_dec_Ieee1609Dot2Data(inout bitstring p_data, out IEEE1609dot2.Ieee1609Dot2Data p_ieee1609Dot2Data) return integer with {extension "prototype(sliding) decode(PER)"} + external function fx_enc_Ieee1609Dot2ToBeSignedData(in IEEE1609dot2.ToBeSignedData p) return bitstring + with {extension "prototype(convert) encode(PER)"} + + external function fx_dec_Ieee1609Dot2ToBeSignedData(inout bitstring p_data, out IEEE1609dot2.ToBeSignedData p_toBeSignedData) return integer + with {extension "prototype(sliding) decode(PER)"} + external function fx_enc_SspCAM (LibItsSecurity_TypesAndValues.SspCAM p_ssp) return bitstring with {extension "prototype(convert) encode(LibItsSecurity)"} diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index f22e4abf..69e9b281 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -1,5 +1,5 @@ /** - * @author ETSI / STF481 / STF507/ STF517 + * @author ETSI / STF481 / STF507 / STF517 / STF538 * @version $URL$ * $Id$ * @desc Module containing functions for Security Protocol diff --git a/ttcn/Security/LibItsSecurity_Pics.ttcn b/ttcn/Security/LibItsSecurity_Pics.ttcn index 421b3785..b824a4b1 100644 --- a/ttcn/Security/LibItsSecurity_Pics.ttcn +++ b/ttcn/Security/LibItsSecurity_Pics.ttcn @@ -1,5 +1,5 @@ /** - * @author ETSI / STF481 / STF507 / STF517 + * @author ETSI / STF481 / STF507 / STF517 / STF538 * @version $URL$ * $Id$ * @desc Module containing Pics for Security Protocol @@ -11,6 +11,16 @@ */ module LibItsSecurity_Pics { + // LibIts + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + import from IEEE1609dot2 language "ASN.1:1997" all; + import from EtsiTs103097Module language "ASN.1:1997" all; + + /** + * Is the IUT support Brainpool algorithm + */ + modulepar boolean PICS_BRAINPOOL_SUPPORT := false; + /** * Is the IUT support certificates pushing */ diff --git a/ttcn/Security/LibItsSecurity_Pixits.ttcn b/ttcn/Security/LibItsSecurity_Pixits.ttcn index d8f43a9b..8d59a57e 100644 --- a/ttcn/Security/LibItsSecurity_Pixits.ttcn +++ b/ttcn/Security/LibItsSecurity_Pixits.ttcn @@ -1,5 +1,5 @@ /** - * @author ETSI / STF481 / STF507 / STF517 + * @author ETSI / STF481 / STF507 / STF517 / STF538 * @version $URL$ * $Id$ * @desc Module containing Pixits for Security Protocol @@ -20,9 +20,6 @@ module LibItsSecurity_Pixits { import from IEEE1609dot2 language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; - // LibItsSecurity - //import from LibItsSecurity_TypesAndValues all; - /** * @desc Root path to access certificate stored in files, identified by certficate ID */ diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index 33fe1a12..e3e1e9c3 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -1,4 +1,5 @@ /** + * @author ETSI / STF481 / STF507 / STF517 / STF538 * @version $URL$ * $Id$ * @desc Module containing templates for Security Protocol @@ -247,11 +248,20 @@ module LibItsSecurity_Templates { * @desc Send template for certificate signed message */ template (value) SignerIdentifier m_signerIdentifier_certificate( - in template (value) Certificate p_certificate + in template (value) Certificate p_certificate // TODO Use SingleEtsiTs103097Certificate ) := { certificate := { p_certificate } // Only one } // End of template m_signerIdentifier_certificate + /** + * @desc Send template for digest signed message + */ + template (value) SignerIdentifier m_signerIdentifier_digest( + in template (value) HashedId8 p_digest + ) := { + digest := p_digest + } // End of template m_signerIdentifier_digest + /** * @desc Send template for certificate signed message */ @@ -566,6 +576,13 @@ module LibItsSecurity_Templates { content := { signedData := p_signedData } } // End of template m_secured_data_signed + template (present) EtsiTs103097Data mw_etsiTs103097Data_signed( + template (present) SignedData p_signedData := ? + ) := { + protocolVersion := c_protocol_version, + content := { signedData := p_signedData } + } // End of template mw_secured_data_signed + /** * @desc Generic send template for EtsiTs103097Data message */ @@ -642,6 +659,13 @@ module LibItsSecurity_Templates { extDataHash := omit } // End of template m_signedDataPayload + template (present) SignedDataPayload mw_signedDataPayload( + template (present) Ieee1609Dot2Data p_data := ? + ) := { + data := p_data, + extDataHash := * + } // End of template mw_signedDataPayload + template (value) SignedDataPayload m_signedDataPayload_ext( in template (value) Ieee1609Dot2Data p_data, in template (value) Oct32 p_extDataHash @@ -673,7 +697,7 @@ module LibItsSecurity_Templates { * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload */ template (present) Ieee1609Dot2Data mw_ieee1609Dot2Data( - template (present) Ieee1609Dot2Content p_content := ? + template (present) Ieee1609Dot2Content p_content := ? ) := { content := p_content } // End of template mw_ieee1609Dot2Data @@ -706,6 +730,9 @@ module LibItsSecurity_Templates { */ group headerFields { + /** + * @desc Basic send HeaderInfo template with ETSI ITS restrction + */ template (omit) HeaderInfo m_ieee1609Dot2_headerInfo( in template (value) Psid p_psid ) := { @@ -721,11 +748,29 @@ module LibItsSecurity_Templates { } // End of template m_ieee1609Dot2_headerInfo /** + * @desc Basic receive HeaderInfo template with ETSI ITS restrction + */ + template (present) HeaderInfo mw_ieee1609Dot2_headerInfo( + template (present) Psid p_psid := ? + ) := { + psid := p_psid, + generationTime := *, + expiryTime := *, + generationLocation := *, + p2pcdLearningRequest := omit, + missingCrlIdentifier := omit, + encryptionKey := omit, + inlineP2pcdRequest := *, + requestedCertificate := * + } // End of template mw_ieee1609Dot2_headerInfo + + /** + * @desc CAM specific send HeaderInfo template with ETSI ITS restrction * - * Clause 7.1.1 Security profile for CAMs + * @see Clause 7.1.1 Security profile for CAMs */ template (omit) HeaderInfo m_headerInfo_cam( - in template (value) Psid p_psid := 34, // TODO ITS-AID for CAM + in template (value) Psid p_psid := c_its_aid_CAM, in template (value) Time64 p_generationTime, in template (value) Time64 p_expiryTime, in template (omit) ThreeDLocation p_generationLocation := omit @@ -735,12 +780,29 @@ module LibItsSecurity_Templates { generationLocation := p_generationLocation } // End of template m_headerInfo_cam + /** + * @desc CAM specific receive HeaderInfo template with ETSI ITS restrction + * + * Clause 7.1.1 Security profile for CAMs + */ + template (present) HeaderInfo mw_headerInfo_cam( + template (present) Psid p_psid := c_its_aid_CAM, + template Time64 p_generationTime := omit, + template Time64 p_expiryTime := omit, + template ThreeDLocation p_generationLocation := omit + ) modifies mw_ieee1609Dot2_headerInfo := { + psid := c_its_aid_CAM, + generationTime := p_generationTime, + expiryTime := p_expiryTime, + generationLocation := p_generationLocation + } // End of template mw_headerInfo_cam + /** * * Clause 7.1.2 Security profile for DENMs */ template (omit) HeaderInfo m_headerInfo_denm( - in template (value) Psid p_psid := 35, // TODO ITS-AID for DENM + in template (value) Psid p_psid := c_its_aid_DENM, in template (value) Time64 p_generationTime, in template (value) Time64 p_expiryTime, in template (omit) ThreeDLocation p_generationLocation := omit @@ -1259,7 +1321,7 @@ module LibItsSecurity_Templates { verifyKeyIndicator := p_verifyKeyIndicator } // End of template mw_toBeSignedCertificate_at - } // End of toBeSignedCertificate + } // End of group toBeSignedCertificate group keys { diff --git a/ttcn/Security/LibItsSecurity_TestSystem.ttcn b/ttcn/Security/LibItsSecurity_TestSystem.ttcn index 23a2955f..20a4776b 100644 --- a/ttcn/Security/LibItsSecurity_TestSystem.ttcn +++ b/ttcn/Security/LibItsSecurity_TestSystem.ttcn @@ -1,5 +1,5 @@ /** - * @author ETSI / STF481 / STF507 / STF517 + * @author ETSI / STF481 / STF507 / STF517 / STF538 * @version $URL$ * $Id$ * @desc Test System module for Security Protocol @@ -43,119 +43,6 @@ module LibItsSecurity_TestSystem { // Generation position. See Draft ETSI TS 103 097 V1.1.14 Clause 7.2 Security profiles for DENMs var ThreeDLocation vc_location; - // Test Adapter certificates & private keys - Valid behavior - const charstring cc_taCert_A := "CERT_TS_A_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_A1 := "CERT_TS_A_1_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_B := "CERT_TS_B_AT"; /** Default certificate, with circular region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_B1 := "CERT_TS_B_1_AT"; - const charstring cc_taCert_C := "CERT_TS_C_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_D := "CERT_TS_D_AT"; /** Certificate with a polygonal region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_E := "CERT_TS_E_AT"; /** Certificate with a region identifier, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_F := "CERT_TS_F_AT"; /** Certificate that can be used as an unknown certificate for IUT. */ - const charstring cc_taCert_G := "CERT_TS_G_AT"; /** to be defined */ - const charstring cc_taCert_EC := "CERT_TS_A_EC"; /** Certificate with a subject type indicating 'enrolment_credentials', to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_AA := "CERT_TS_A_AA"; /** Certificate with a subject type indicating 'authorisation_authority', to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_EA := "CERT_TS_A_EA"; /** Certificate with a subject type indicating 'enrolment_authority', to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_CA := "CERT_TS_A_CA"; /** Certificate with a subject type indicating 'root_ca', to be used when secured messages are sent from TA to IUT */ - // Test Adapter certificates & private keys - Inoportune behavior - const charstring cc_taCert_B_BO := "CERT_TS_B_BO_AT"; /** Certificate with a circular region, the IUT position is outside of the region */ - const charstring cc_taCert_C_BO := "CERT_TS_C_BO_AT"; /** Certificate with a rectangular region, the IUT position is outside of the region */ - const charstring cc_taCert_D_BO := "CERT_TS_D_BO_AT"; /** Certificate with a polygonal region, the IUT position is outside of the region */ - const charstring cc_taCert_E_BO := "CERT_TS_E_BO_AT"; /** Certificate with a region identifier, the IUT position is outside of the region */ - const charstring cc_taCert0101_BO := "CERT_TS_01_01_BO_AT"; /** Check that IUT discards the AT certificate with version 3 */ - const charstring cc_taCert0102_BO := "CERT_TS_01_02_BO_AT"; /** Check that IUT discards the AT certificate with version 1 */ - const charstring cc_taCert0103_BO := "CERT_TS_01_03_BO_AT"; /** Check that IUT discards the AA certificate with version 3 */ - const charstring cc_taCert0104_BO := "CERT_TS_01_04_BO_AT"; /** Check that IUT discards the AA certificate with version 1 */ - const charstring cc_taCert0201_BO := "CERT_TS_02_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization ticket certificate contains the subject type 'enrolment_credential' */ - const charstring cc_taCert0202_BO := "CERT_TS_02_02_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization authority certificate contains the subject type 'enrolment_credential' */ - const charstring cc_taCert0203_BO := "CERT_TS_02_03_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization ticket certificate contains the subject type 'enrolment_authority' */ - const charstring cc_taCert0204_BO := "CERT_TS_02_04_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization authority certificate contains the subject type 'enrolment_authority' */ - const charstring cc_taCert0301_BO := "CERT_TS_03_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization ticket certificate contains the subject type 'authorization_ticket' */ - const charstring cc_taCert0302_BO := "CERT_TS_03_02_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization authority certificate contains the subject type 'authorization_ticket' */ - const charstring cc_taCert0601_BO := "CERT_TS_06_01_BO_AT"; /** Check that IUT discards a SecuredMessage containing generation_time before the message signing certificate validity period */ - const charstring cc_taCert0602_BO := "CERT_TS_06_02_BO_AT"; /** Check that IUT discards a SecuredMessage containing generation_time after the message signing certificate validity period */ - const charstring cc_taCert0401_BO := "CERT_TS_04_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the AA certificate contains the subject type 'authorization_authority' */ - const charstring cc_taCertMsg1301_BO := "CERT_TS_MSG_13_01_BO_AT"; /** Check that IUT discards secured CAM signed with the not yet valid certificate */ - const charstring cc_taCertMsg1302_BO := "CERT_TS_MSG_13_02_BO_AT"; /** Check that IUT discards secured CAM signed with the expired certificate */ - const charstring cc_taCertMsg1303_BO := "CERT_TS_MSG_13_03_BO_AT"; /** Check that IUT discards secured CAM when IUT location is outside the circular validity restriction of the signing certificatee */ - const charstring cc_taCertMsg1304_BO := "CERT_TS_MSG_13_04_BO_AT"; /** Check that IUT discards secured CAM when IUT location is outside the rectangular validity restriction of the signing certificate */ - const charstring cc_taCertMsg1305_BO := "CERT_TS_MSG_13_05_BO_AT"; /** Check that IUT discards secured CAM when IUT location is outside the polygonal validity restriction of the signing certificate */ - const charstring cc_taCertMsg1306_BO := "CERT_TS_MSG_13_06_BO_AT"; /** Check that IUT discards secured CAM when IUT location is outside the identified validity restriction of the signing certificate */ - const charstring cc_taCert0601_BV := "CERT_TS_06_01_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the same circular region validity restriction as its issuing certificate */ - const charstring cc_taCert0602_BV := "CERT_TS_06_02_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the circular region validity restriction of its issuing certificate */ - const charstring cc_taCert0603_BV := "CERT_TS_06_03_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the rectangular region validity restriction of its issuing certificate */ - const charstring cc_taCert0604_BV := "CERT_TS_06_04_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0605_BV := "CERT_TS_06_05_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the identified region validity restriction of its issuing certificate */ - const charstring cc_taCert0606_BO := "CERT_TS_06_06_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message does not contain the region validity restriction but its issuing certificate contains the circular region validity restriction */ - const charstring cc_taCert0607_BO := "CERT_TS_06_07_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains circular region validity restriction which is outside of the circular region validity restriction of its issuing certificate */ - const charstring cc_taCert0608_BO := "CERT_TS_06_08_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains circular region validity restriction which is not fully covered by the the circular region validity restriction of its issuing certificate */ - const charstring cc_taCert0701_BV := "CERT_TS_07_01_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the same rectangular region validity restriction as its issuing certificate */ - const charstring cc_taCert0702_BV := "CERT_TS_07_02_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the rectangular region validity restriction which is fully inside in the circular region validity restriction of its issuing certificate */ - const charstring cc_taCert0703_BV := "CERT_TS_07_03_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the validity restriction with rectangular region which is fully inside in the rectangular region validity restriction of its issuing certificate */ - const charstring cc_taCert0704_BV := "CERT_TS_07_04_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the rectangular region validity restriction which is fully inside in the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0705_BV := "CERT_TS_07_05_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the rectangular region validity restriction which is fully inside in the identified region validity restriction of its issuing certificate */ - const charstring cc_taCert0706_BO := "CERT_TS_07_06_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message does not contain the region validity restriction but its issuing certificate contains the rectangular region validity restriction */ - const charstring cc_taCert0707_BO := "CERT_TS_07_07_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains rectangular region validity restriction which is outside of the rectangular region validity restriction of its issuing certificate */ - const charstring cc_taCert0708_BO := "CERT_TS_07_08_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains rectangular region validity restriction which is not fully covered by the the rectangular region validity restriction of its issuing certificate */ - const charstring cc_taCert0801_BV := "CERT_TS_08_01_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the same polygonal region validity restriction as its issuing certificate */ - const charstring cc_taCert0802_BV := "CERT_TS_08_02_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the circular region validity restriction of its issuing certificate */ - const charstring cc_taCert0803_BV := "CERT_TS_08_03_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the rectangular region validity restriction of its issuing certificate */ - const charstring cc_taCert0804_BV := "CERT_TS_08_04_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0805_BV := "CERT_TS_08_05_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the identified region validity restriction of its issuing certificate */ - const charstring cc_taCert0806_BO := "CERT_TS_08_06_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message does not contain the region validity restriction but its issuing certificate contains the polygonal region validity restriction */ - const charstring cc_taCert0807_BO := "CERT_TS_08_07_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains polygonal region validity restriction which is outside of the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0808_BO := "CERT_TS_08_08_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains polygonal region validity restriction which is outside of the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0809_BO := "CERT_TS_08_09_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains polygonal region validity restriction which is not fully covered by the the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0901_BV := "CERT_TS_09_01_BV_AT"; /** Check that the IUT accepts a message when its signing certificate contains the identified region validity restriction with the same identified region as the issuing certificate and without local area definition */ - const charstring cc_taCert0902_BV := "CERT_TS_09_02_BV_AT"; /** Check that the IUT accepts a message when its signing certificate contains the identified region validity restriction with the same identified region as the issuing certificate and with local area definition */ - const charstring cc_taCert0903_BV := "CERT_TS_09_03_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the circular region validity restriction of its issuing certificate */ - const charstring cc_taCert0904_BV := "CERT_TS_09_04_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the rectangular region validity restriction of its issuing certificate */ - const charstring cc_taCert0905_BV := "CERT_TS_09_05_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0906_BV := "CERT_TS_09_06_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of the message contains the identified region validity restriction with the identified region which is fully covered by the identified region of the validity restriction of its issuing certificate */ - const charstring cc_taCert0907_BO := "CERT_TS_09_07_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message does not contain the region validity restriction but its issuing certificate contains the identified region validity restriction */ - const charstring cc_taCert0908_BO := "CERT_TS_09_08_BO_AT"; /** Check that the IUT discards a message when the signing certificate and its issuing certificate are both containing the identified region validity restrictions with the same region id but different local regions */ - const charstring cc_taCert0909_BO := "CERT_TS_09_09_BO_AT"; /** Check that the IUT discards a message when the identified region of the validity restriction of its signing certificate is different and not fully covered by the one in the issuing certificate */ - const charstring cc_taCert0910_BO := "CERT_TS_09_10_BO_AT"; /** Check that the IUT discards a message when the identified region validity restriction of its signing certificate contains unknown area code */ - const charstring cc_taCert0911_BO := "CERT_TS_09_11_BO_AT"; /** Check that the IUT discards a message when the identified region validity restriction of its signing certificate contains invalid area code */ - const charstring cc_taCert1001_BO := "CERT_TS_10_01_BO_AT"; /** Check that the IUT discards a message when its signing certificate does not contain the time validity restriction */ - const charstring cc_taCert1002_BO := "CERT_TS_10_02_BO_AT"; /** Check that the IUT discards a message when the issuing certificate of the message signing certificate does not contain the time validity restriction */ - const charstring cc_taCert1003_BO := "CERT_TS_10_03_BO_AT"; /** Check that the IUT discards a message when its signing certificate contains 'time_end' validity restriction */ - const charstring cc_taCert1004_BO := "CERT_TS_10_03_BO_AT"; /** Check that the IUT discards a message when its signing certificate contains 'time_start_and_duration' validity restriction */ - const charstring cc_taCert1005_BO := "CERT_TS_10_03_BO_AT"; /** Check that the IUT discards a message when the issuing certificate of the message signing certificate contains 'time_end' validity restriction */ - const charstring cc_taCert1006_BO := "CERT_TS_10_03_BO_AT"; /** Check that the IUT discards a message when its signing certificate contains 'time_start_and_duration' validity restriction */ - const charstring cc_taCert1101_BO := "CERT_TS_11_01_BO_AT"; /** Check that the IUT discards a message when the validity period of the signing certificate ends after the validity period of its issuing certificate */ - const charstring cc_taCert1102_BO := "CERT_TS_11_02_BO_AT"; /** Check that the IUT discards a message when the validity period of its signing certificate starts before the validity period of the issuing certificate */ - const charstring cc_taCert1103_BO := "CERT_TS_11_03_BO_AT"; /** Check that the IUT discards a message when the issuing certificate of signing certificate is expired but the signing certificate is not expired yet */ - const charstring cc_taCert1104_BO := "CERT_TS_11_04_BO_AT"; /** Check that the IUT discards a message when the validity period of the signing certificate is after the validity period of its issuing certificate */ - const charstring cc_taCert1201_BO := "CERT_TS_12_01_BO_AT"; /** Check that the IUT discards a message when its signing certificate does not contain the SSP-AID subject attribute */ - const charstring cc_taCert1202_BO := "CERT_TS_12_02_BO_AT"; /** Check that the IUT discards a Secured CAM when its signing certificate does not contain a record with AID_CAM in the its_aid_ssp_list subject attribute */ - const charstring cc_taCert1203_BO := "CERT_TS_12_03_BO_AT"; /** Check that the IUT discards a Secured DENM when its signing certificate does not contain a record with AID_DENM in the its_aid_ssp_list subject attribute */ - const charstring cc_taCert1204_BO := "CERT_TS_12_04_BO_AT"; /** Check that the IUT discards a Secured CAM when its signing certificate contains two records with AID_CAM in the its_aid_ssp_list subject attribute */ - const charstring cc_taCert1301_BO := "CERT_TS_13_01_BO_AT"; /** Check that the IUT discards a message when the signing AT certificate contains a CAM AID-SSP record whereas the issuing AA certificate does not contain the record with AID_CAM */ - const charstring cc_taCert1302_BO := "CERT_TS_13_02_BO_AT"; /** Check that the IUT discards a message when the signing AT certificate contains a DENM AID-SSP record whereas the issuing AA certificate does not contain the AID record with AID_DENM */ - const charstring cc_taCert1303_BO := "CERT_TS_13_03_BO_AT"; /** Check that IUT discards a SecuredMessage if the AA certificate does not contain a subject_attribute of type its_aid_list */ - const charstring cc_taCert1401_BO := "CERT_TS_14_01_BO_AT"; /** Check that IUT discards the AT certificate with signer info of type 'certificate' */ - const charstring cc_taCert1402_BO := "CERT_TS_14_02_BO_AT"; /** Check that IUT discards the AT certificate with signer info of type 'certificate_chain' */ - const charstring cc_taCert1403_BO := "CERT_TS_14_03_BO_AT"; /** Check that IUT discards the AT certificate with signer info of type 'certificate_digest_with_other_algorithm' */ - const charstring cc_taCert1501_BO := "CERT_TS_15_01_BO_AT"; /** Check that IUT discards the AA certificate with signer info of type 'certificate' */ - const charstring cc_taCert1502_BO := "CERT_TS_15_02_BO_AT"; /** Check that IUT discards the AA certificate with signer info of type 'certificate_chain' */ - const charstring cc_taCert1503_BO := "CERT_TS_15_03_BO_AT"; /** Check that IUT discards the AA certificate with signer info of type 'certificate_digest_with_other_algorithm' */ - const charstring cc_taCert1601_BO := "CERT_TS_16_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject_name of the AT certificate is not an empty name field */ - const charstring cc_taCert1701_BO := "CERT_TS_17_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject attribute of type assurance_level is missing in the AT certificate */ - const charstring cc_taCert1702_BO := "CERT_TS_17_02_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject attribute of type assurance_level is missing in the AA certificate */ - const charstring cc_taCert1703_BO := "CERT_TS_17_03_BO_AT"; /** Check that IUT discards a SecuredMessage if the assurance level of issuing certificate is less then assurance level of subordinate certificate */ - const charstring cc_taCert1704_BO := "CERT_TS_17_04_BO_AT"; /** Check that IUT discards a SecuredMessage if the assurance level of issuing certificate is equal to the assurance level of the subordinate certificate but the confidence of subject assurance of issuing certificate is less then the confidence of the subordinate certificate */ - const charstring cc_taCert1801_BO := "CERT_TS_18_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject attribute of type verification_key is missing in the AT certificate */ - const charstring cc_taCert1802_BO := "CERT_TS_18_02_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject attribute of type verification_key is missing in the AA certificate */ - const charstring cc_taCert1901_BO := "CERT_TS_19_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the reserved region type has been used in region validity restriction of the AT certificate */ - - // IUT certificates & private keys - const charstring cc_iutCert_A := "CERT_IUT_A_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_B := "CERT_IUT_B_AT"; /** Default certificate, with circular region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_C := "CERT_IUT_C_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_D := "CERT_IUT_D_AT"; /** Certificate with a polygonal region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_E := "CERT_IUT_E_AT"; /** Certificate with a region identifier, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_F := "CERT_IUT_F_AT"; /** Certificate with a subject type indicating 'enrolment_credentials', to be used when secured messages are sent from TA to IUT */ } // End of ItsSecurityBaseComponent } // End of group componentDefinitions diff --git a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn index 4cae1bc6..8ba1e039 100644 --- a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn +++ b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn @@ -20,6 +20,120 @@ module LibItsSecurity_TypesAndValues { import from IEEE1609dot2 language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; + // Test Adapter certificates & private keys - Valid behavior + const charstring cc_taCert_A := "CERT_TS_A_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_A1 := "CERT_TS_A_1_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_B := "CERT_TS_B_AT"; /** Default certificate, with circular region, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_B1 := "CERT_TS_B_1_AT"; + const charstring cc_taCert_C := "CERT_TS_C_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_D := "CERT_TS_D_AT"; /** Certificate with a polygonal region, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_E := "CERT_TS_E_AT"; /** Certificate with a region identifier, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_F := "CERT_TS_F_AT"; /** Certificate that can be used as an unknown certificate for IUT. */ + const charstring cc_taCert_G := "CERT_TS_G_AT"; /** to be defined */ + const charstring cc_taCert_EC := "CERT_TS_A_EC"; /** Certificate with a subject type indicating 'enrolment_credentials', to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_AA := "CERT_TS_A_AA"; /** Certificate with a subject type indicating 'authorisation_authority', to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_EA := "CERT_TS_A_EA"; /** Certificate with a subject type indicating 'enrolment_authority', to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_CA := "CERT_TS_A_CA"; /** Certificate with a subject type indicating 'root_ca', to be used when secured messages are sent from TA to IUT */ + // Test Adapter certificates & private keys - Inoportune behavior + const charstring cc_taCert_B_BO := "CERT_TS_B_BO_AT"; /** Certificate with a circular region, the IUT position is outside of the region */ + const charstring cc_taCert_C_BO := "CERT_TS_C_BO_AT"; /** Certificate with a rectangular region, the IUT position is outside of the region */ + const charstring cc_taCert_D_BO := "CERT_TS_D_BO_AT"; /** Certificate with a polygonal region, the IUT position is outside of the region */ + const charstring cc_taCert_E_BO := "CERT_TS_E_BO_AT"; /** Certificate with a region identifier, the IUT position is outside of the region */ + const charstring cc_taCert0101_BO := "CERT_TS_01_01_BO_AT"; /** Check that IUT discards the AT certificate with version 3 */ + const charstring cc_taCert0102_BO := "CERT_TS_01_02_BO_AT"; /** Check that IUT discards the AT certificate with version 1 */ + const charstring cc_taCert0103_BO := "CERT_TS_01_03_BO_AT"; /** Check that IUT discards the AA certificate with version 3 */ + const charstring cc_taCert0104_BO := "CERT_TS_01_04_BO_AT"; /** Check that IUT discards the AA certificate with version 1 */ + const charstring cc_taCert0201_BO := "CERT_TS_02_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization ticket certificate contains the subject type 'enrolment_credential' */ + const charstring cc_taCert0202_BO := "CERT_TS_02_02_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization authority certificate contains the subject type 'enrolment_credential' */ + const charstring cc_taCert0203_BO := "CERT_TS_02_03_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization ticket certificate contains the subject type 'enrolment_authority' */ + const charstring cc_taCert0204_BO := "CERT_TS_02_04_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization authority certificate contains the subject type 'enrolment_authority' */ + const charstring cc_taCert0301_BO := "CERT_TS_03_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization ticket certificate contains the subject type 'authorization_ticket' */ + const charstring cc_taCert0302_BO := "CERT_TS_03_02_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization authority certificate contains the subject type 'authorization_ticket' */ + const charstring cc_taCert0601_BO := "CERT_TS_06_01_BO_AT"; /** Check that IUT discards a SecuredMessage containing generation_time before the message signing certificate validity period */ + const charstring cc_taCert0602_BO := "CERT_TS_06_02_BO_AT"; /** Check that IUT discards a SecuredMessage containing generation_time after the message signing certificate validity period */ + const charstring cc_taCert0401_BO := "CERT_TS_04_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the AA certificate contains the subject type 'authorization_authority' */ + const charstring cc_taCertMsg1301_BO := "CERT_TS_MSG_13_01_BO_AT"; /** Check that IUT discards secured CAM signed with the not yet valid certificate */ + const charstring cc_taCertMsg1302_BO := "CERT_TS_MSG_13_02_BO_AT"; /** Check that IUT discards secured CAM signed with the expired certificate */ + const charstring cc_taCertMsg1303_BO := "CERT_TS_MSG_13_03_BO_AT"; /** Check that IUT discards secured CAM when IUT location is outside the circular validity restriction of the signing certificatee */ + const charstring cc_taCertMsg1304_BO := "CERT_TS_MSG_13_04_BO_AT"; /** Check that IUT discards secured CAM when IUT location is outside the rectangular validity restriction of the signing certificate */ + const charstring cc_taCertMsg1305_BO := "CERT_TS_MSG_13_05_BO_AT"; /** Check that IUT discards secured CAM when IUT location is outside the polygonal validity restriction of the signing certificate */ + const charstring cc_taCertMsg1306_BO := "CERT_TS_MSG_13_06_BO_AT"; /** Check that IUT discards secured CAM when IUT location is outside the identified validity restriction of the signing certificate */ + const charstring cc_taCert0601_BV := "CERT_TS_06_01_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the same circular region validity restriction as its issuing certificate */ + const charstring cc_taCert0602_BV := "CERT_TS_06_02_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the circular region validity restriction of its issuing certificate */ + const charstring cc_taCert0603_BV := "CERT_TS_06_03_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the rectangular region validity restriction of its issuing certificate */ + const charstring cc_taCert0604_BV := "CERT_TS_06_04_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the polygonal region validity restriction of its issuing certificate */ + const charstring cc_taCert0605_BV := "CERT_TS_06_05_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the identified region validity restriction of its issuing certificate */ + const charstring cc_taCert0606_BO := "CERT_TS_06_06_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message does not contain the region validity restriction but its issuing certificate contains the circular region validity restriction */ + const charstring cc_taCert0607_BO := "CERT_TS_06_07_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains circular region validity restriction which is outside of the circular region validity restriction of its issuing certificate */ + const charstring cc_taCert0608_BO := "CERT_TS_06_08_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains circular region validity restriction which is not fully covered by the the circular region validity restriction of its issuing certificate */ + const charstring cc_taCert0701_BV := "CERT_TS_07_01_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the same rectangular region validity restriction as its issuing certificate */ + const charstring cc_taCert0702_BV := "CERT_TS_07_02_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the rectangular region validity restriction which is fully inside in the circular region validity restriction of its issuing certificate */ + const charstring cc_taCert0703_BV := "CERT_TS_07_03_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the validity restriction with rectangular region which is fully inside in the rectangular region validity restriction of its issuing certificate */ + const charstring cc_taCert0704_BV := "CERT_TS_07_04_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the rectangular region validity restriction which is fully inside in the polygonal region validity restriction of its issuing certificate */ + const charstring cc_taCert0705_BV := "CERT_TS_07_05_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the rectangular region validity restriction which is fully inside in the identified region validity restriction of its issuing certificate */ + const charstring cc_taCert0706_BO := "CERT_TS_07_06_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message does not contain the region validity restriction but its issuing certificate contains the rectangular region validity restriction */ + const charstring cc_taCert0707_BO := "CERT_TS_07_07_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains rectangular region validity restriction which is outside of the rectangular region validity restriction of its issuing certificate */ + const charstring cc_taCert0708_BO := "CERT_TS_07_08_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains rectangular region validity restriction which is not fully covered by the the rectangular region validity restriction of its issuing certificate */ + const charstring cc_taCert0801_BV := "CERT_TS_08_01_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the same polygonal region validity restriction as its issuing certificate */ + const charstring cc_taCert0802_BV := "CERT_TS_08_02_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the circular region validity restriction of its issuing certificate */ + const charstring cc_taCert0803_BV := "CERT_TS_08_03_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the rectangular region validity restriction of its issuing certificate */ + const charstring cc_taCert0804_BV := "CERT_TS_08_04_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the polygonal region validity restriction of its issuing certificate */ + const charstring cc_taCert0805_BV := "CERT_TS_08_05_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the identified region validity restriction of its issuing certificate */ + const charstring cc_taCert0806_BO := "CERT_TS_08_06_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message does not contain the region validity restriction but its issuing certificate contains the polygonal region validity restriction */ + const charstring cc_taCert0807_BO := "CERT_TS_08_07_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains polygonal region validity restriction which is outside of the polygonal region validity restriction of its issuing certificate */ + const charstring cc_taCert0808_BO := "CERT_TS_08_08_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains polygonal region validity restriction which is outside of the polygonal region validity restriction of its issuing certificate */ + const charstring cc_taCert0809_BO := "CERT_TS_08_09_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains polygonal region validity restriction which is not fully covered by the the polygonal region validity restriction of its issuing certificate */ + const charstring cc_taCert0901_BV := "CERT_TS_09_01_BV_AT"; /** Check that the IUT accepts a message when its signing certificate contains the identified region validity restriction with the same identified region as the issuing certificate and without local area definition */ + const charstring cc_taCert0902_BV := "CERT_TS_09_02_BV_AT"; /** Check that the IUT accepts a message when its signing certificate contains the identified region validity restriction with the same identified region as the issuing certificate and with local area definition */ + const charstring cc_taCert0903_BV := "CERT_TS_09_03_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the circular region validity restriction of its issuing certificate */ + const charstring cc_taCert0904_BV := "CERT_TS_09_04_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the rectangular region validity restriction of its issuing certificate */ + const charstring cc_taCert0905_BV := "CERT_TS_09_05_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the polygonal region validity restriction of its issuing certificate */ + const charstring cc_taCert0906_BV := "CERT_TS_09_06_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of the message contains the identified region validity restriction with the identified region which is fully covered by the identified region of the validity restriction of its issuing certificate */ + const charstring cc_taCert0907_BO := "CERT_TS_09_07_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message does not contain the region validity restriction but its issuing certificate contains the identified region validity restriction */ + const charstring cc_taCert0908_BO := "CERT_TS_09_08_BO_AT"; /** Check that the IUT discards a message when the signing certificate and its issuing certificate are both containing the identified region validity restrictions with the same region id but different local regions */ + const charstring cc_taCert0909_BO := "CERT_TS_09_09_BO_AT"; /** Check that the IUT discards a message when the identified region of the validity restriction of its signing certificate is different and not fully covered by the one in the issuing certificate */ + const charstring cc_taCert0910_BO := "CERT_TS_09_10_BO_AT"; /** Check that the IUT discards a message when the identified region validity restriction of its signing certificate contains unknown area code */ + const charstring cc_taCert0911_BO := "CERT_TS_09_11_BO_AT"; /** Check that the IUT discards a message when the identified region validity restriction of its signing certificate contains invalid area code */ + const charstring cc_taCert1001_BO := "CERT_TS_10_01_BO_AT"; /** Check that the IUT discards a message when its signing certificate does not contain the time validity restriction */ + const charstring cc_taCert1002_BO := "CERT_TS_10_02_BO_AT"; /** Check that the IUT discards a message when the issuing certificate of the message signing certificate does not contain the time validity restriction */ + const charstring cc_taCert1003_BO := "CERT_TS_10_03_BO_AT"; /** Check that the IUT discards a message when its signing certificate contains 'time_end' validity restriction */ + const charstring cc_taCert1004_BO := "CERT_TS_10_03_BO_AT"; /** Check that the IUT discards a message when its signing certificate contains 'time_start_and_duration' validity restriction */ + const charstring cc_taCert1005_BO := "CERT_TS_10_03_BO_AT"; /** Check that the IUT discards a message when the issuing certificate of the message signing certificate contains 'time_end' validity restriction */ + const charstring cc_taCert1006_BO := "CERT_TS_10_03_BO_AT"; /** Check that the IUT discards a message when its signing certificate contains 'time_start_and_duration' validity restriction */ + const charstring cc_taCert1101_BO := "CERT_TS_11_01_BO_AT"; /** Check that the IUT discards a message when the validity period of the signing certificate ends after the validity period of its issuing certificate */ + const charstring cc_taCert1102_BO := "CERT_TS_11_02_BO_AT"; /** Check that the IUT discards a message when the validity period of its signing certificate starts before the validity period of the issuing certificate */ + const charstring cc_taCert1103_BO := "CERT_TS_11_03_BO_AT"; /** Check that the IUT discards a message when the issuing certificate of signing certificate is expired but the signing certificate is not expired yet */ + const charstring cc_taCert1104_BO := "CERT_TS_11_04_BO_AT"; /** Check that the IUT discards a message when the validity period of the signing certificate is after the validity period of its issuing certificate */ + const charstring cc_taCert1201_BO := "CERT_TS_12_01_BO_AT"; /** Check that the IUT discards a message when its signing certificate does not contain the SSP-AID subject attribute */ + const charstring cc_taCert1202_BO := "CERT_TS_12_02_BO_AT"; /** Check that the IUT discards a Secured CAM when its signing certificate does not contain a record with AID_CAM in the its_aid_ssp_list subject attribute */ + const charstring cc_taCert1203_BO := "CERT_TS_12_03_BO_AT"; /** Check that the IUT discards a Secured DENM when its signing certificate does not contain a record with AID_DENM in the its_aid_ssp_list subject attribute */ + const charstring cc_taCert1204_BO := "CERT_TS_12_04_BO_AT"; /** Check that the IUT discards a Secured CAM when its signing certificate contains two records with AID_CAM in the its_aid_ssp_list subject attribute */ + const charstring cc_taCert1301_BO := "CERT_TS_13_01_BO_AT"; /** Check that the IUT discards a message when the signing AT certificate contains a CAM AID-SSP record whereas the issuing AA certificate does not contain the record with AID_CAM */ + const charstring cc_taCert1302_BO := "CERT_TS_13_02_BO_AT"; /** Check that the IUT discards a message when the signing AT certificate contains a DENM AID-SSP record whereas the issuing AA certificate does not contain the AID record with AID_DENM */ + const charstring cc_taCert1303_BO := "CERT_TS_13_03_BO_AT"; /** Check that IUT discards a SecuredMessage if the AA certificate does not contain a subject_attribute of type its_aid_list */ + const charstring cc_taCert1401_BO := "CERT_TS_14_01_BO_AT"; /** Check that IUT discards the AT certificate with signer info of type 'certificate' */ + const charstring cc_taCert1402_BO := "CERT_TS_14_02_BO_AT"; /** Check that IUT discards the AT certificate with signer info of type 'certificate_chain' */ + const charstring cc_taCert1403_BO := "CERT_TS_14_03_BO_AT"; /** Check that IUT discards the AT certificate with signer info of type 'certificate_digest_with_other_algorithm' */ + const charstring cc_taCert1501_BO := "CERT_TS_15_01_BO_AT"; /** Check that IUT discards the AA certificate with signer info of type 'certificate' */ + const charstring cc_taCert1502_BO := "CERT_TS_15_02_BO_AT"; /** Check that IUT discards the AA certificate with signer info of type 'certificate_chain' */ + const charstring cc_taCert1503_BO := "CERT_TS_15_03_BO_AT"; /** Check that IUT discards the AA certificate with signer info of type 'certificate_digest_with_other_algorithm' */ + const charstring cc_taCert1601_BO := "CERT_TS_16_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject_name of the AT certificate is not an empty name field */ + const charstring cc_taCert1701_BO := "CERT_TS_17_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject attribute of type assurance_level is missing in the AT certificate */ + const charstring cc_taCert1702_BO := "CERT_TS_17_02_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject attribute of type assurance_level is missing in the AA certificate */ + const charstring cc_taCert1703_BO := "CERT_TS_17_03_BO_AT"; /** Check that IUT discards a SecuredMessage if the assurance level of issuing certificate is less then assurance level of subordinate certificate */ + const charstring cc_taCert1704_BO := "CERT_TS_17_04_BO_AT"; /** Check that IUT discards a SecuredMessage if the assurance level of issuing certificate is equal to the assurance level of the subordinate certificate but the confidence of subject assurance of issuing certificate is less then the confidence of the subordinate certificate */ + const charstring cc_taCert1801_BO := "CERT_TS_18_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject attribute of type verification_key is missing in the AT certificate */ + const charstring cc_taCert1802_BO := "CERT_TS_18_02_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject attribute of type verification_key is missing in the AA certificate */ + const charstring cc_taCert1901_BO := "CERT_TS_19_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the reserved region type has been used in region validity restriction of the AT certificate */ + + // IUT certificates & private keys + const charstring cc_iutCert_A := "CERT_IUT_A_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ + const charstring cc_iutCert_B := "CERT_IUT_B_AT"; /** Default certificate, with circular region, to be used when secured messages are sent from TA to IUT */ + const charstring cc_iutCert_C := "CERT_IUT_C_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ + const charstring cc_iutCert_D := "CERT_IUT_D_AT"; /** Certificate with a polygonal region, to be used when secured messages are sent from TA to IUT */ + const charstring cc_iutCert_E := "CERT_IUT_E_AT"; /** Certificate with a region identifier, to be used when secured messages are sent from TA to IUT */ + const charstring cc_iutCert_F := "CERT_IUT_F_AT"; /** Certificate with a subject type indicating 'enrolment_credentials', to be used when secured messages are sent from TA to IUT */ + /** * @desc Specification of basic format elements * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2 @@ -123,7 +237,6 @@ module LibItsSecurity_TypesAndValues { } type record of CertificatesCachingItem CertificatesCaching; - } // End of group profileCertificates group taConfiguration { @@ -137,19 +250,19 @@ module LibItsSecurity_TypesAndValues { * @member atCertificate Authorization Tickate certificate generated by the PKI Infrastructire tool * @member location 3D location associated to each configuration */ - type record TaConfig { + /*type record TaConfig { Oct32 signingPrivateKey, Oct32 encryptPrivateKey, EtsiTs103097Certificate caCertificate, EtsiTs103097Certificate aaCertificate, EtsiTs103097Certificate atCertificate, ThreeDLocation location - } // End of type TaConfig + }*/ // End of type TaConfig /** * @desc Describes the Test Adapter security configurations */ - type set of TaConfig TaConfigs; + //type set of TaConfig TaConfigs; } // End of group taConfiguration -- GitLab From 3965070c2194b61ea4f9b820f82462057f68e3d5 Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 26 Jan 2018 09:34:36 +0000 Subject: [PATCH 056/320] ATS security review --- ttcn/Security/LibItsSecurity_Functions.ttcn | 297 +++++++++----------- ttcn/Security/LibItsSecurity_Templates.ttcn | 13 +- 2 files changed, 145 insertions(+), 165 deletions(-) diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 69e9b281..0ed3a3bc 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -258,8 +258,8 @@ module LibItsSecurity_Functions { * @return the HashedId8 value * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.13 HashedId8 */ - function f_calculateDigestFromCertificate( - in EtsiTs103097Certificate p_cert + function f_calculateDigestSha256FromCertificate( + in EtsiTs103097Certificate p_cert ) return HashedId8 { var octetstring v_toBeHashedData; var octetstring v_hash; @@ -267,7 +267,18 @@ module LibItsSecurity_Functions { v_toBeHashedData := bit2oct(encvalue(p_cert)); v_hash := f_hashWithSha256(v_toBeHashedData); return substr(v_hash, lengthof(v_hash) - 8, 8); - } // End of function f_calculateDigestFromCertificate + } // End of function f_calculateDigestSha256FromCertificate + + function f_calculateDigestSha384FromCertificate( + in EtsiTs103097Certificate p_cert + ) return HashedId8 { + var octetstring v_toBeHashedData; + var octetstring v_hash; + + v_toBeHashedData := bit2oct(encvalue(p_cert)); + v_hash := f_hashWithSha384(v_toBeHashedData); + return substr(v_hash, lengthof(v_hash) - 8, 8); + } // End of function f_calculateDigestSha384FromCertificate function f_duration2time( in Duration p_duration @@ -331,80 +342,19 @@ module LibItsSecurity_Functions { * @return true on success, false otherwise */ function f_buildGnSecuredMessage( - out template (value) Ieee1609Dot2Data p_securedMessage, - in template (value) charstring p_certificateName, - in template (value) Ieee1609Dot2Content p_payloadField, - in template (value) HeaderInfo p_mandatoryHeaders, - in template (omit) HeaderInfo p_headerInfo := omit + out template (value) EtsiTs103097Data p_securedMessage, + in charstring p_certificateName, + in ToBeSignedData p_payloadField ) runs on ItsSecurityBaseComponent return boolean { // Local variables var octetstring v_secPayload, v_signature; -//FIXME(DF) UNUSED -// var Oct32 v_hash; - var template (value) ToBeSignedData v_toBeSignedData; - var integer i, j, k, n; - var HeaderInfo v_headerFields := {}; + var ToBeSignedData v_toBeSignedData; var Ieee1609Dot2Content v_toBeSignedPayload; var Oct32 v_privateKey; - - // Prepare headers - if (not(ispresent(p_headerInfo))) { - v_headerFields := valueof(p_mandatoryHeaders); - } else {/* FIXME To be reviewed - // Merge p_headerInfo and v_mandatoryHeaders into v_headerFields - - i := 0; // index for p_headerInfo - j := 0; // index for v_mandatoryHeaders - k := 0; // index for v_headerFields - - // Special processing for signer_info - if (lengthof(valueof(p_headerInfo)) > 0 and valueof(p_headerInfo[i].type_) == e_signer_info) { - v_headerFields[k] := valueof(p_headerInfo[i]); - k := k + 1; - i := i + 1; - } - - for (j := j; j < lengthof(p_mandatoryHeaders); j := j + 1) { - // Search for mandatory header in p_HeaderFields - for (n := 0; n < lengthof(p_headerInfo); n := n + 1) { - if (valueof(p_headerInfo[n].type_) == valueof(p_mandatoryHeaders[j].type_)) { - // mandatory header already in p_HeaderFields - break; - } - } // End of 'for' statement - if (n >= lengthof(p_headerInfo)) { - if (valueof(p_mandatoryHeaders[j].type_) != e_signer_info) { - // Add headers from p_headerInfo having lower number than mandatory header - for (n := i; n < lengthof(p_headerInfo) and valueof(p_headerInfo[n].type_) < valueof(p_mandatoryHeaders[j].type_); n := n + 1) { - v_headerFields[k] := valueof(p_headerInfo[n]); - k := k + 1; - i := i + 1; - } - } - // Add mandatory header - v_headerFields[k] := valueof(p_mandatoryHeaders[j]); - k := k + 1; - } - } // End of 'for' statement - - // Add remaining headers from p_HeaderFields - for ( i := i; i < lengthof(p_headerInfo); i := i + 1) { - // Add headers from p_headerInfo having lower number than mandatory header - v_headerFields[k] := valueof(p_headerInfo[i]); - k := k + 1; - } // End of 'for' statement - */} - + // Prepare payload to be signed - v_toBeSignedPayload := valueof(p_payloadField); - - /* FIXME To be reviewedv_toBeSignedData := m_toBeSignedSecuredMessage( - v_headerFields, - v_toBeSignedPayload, - e_signature - ); - + v_toBeSignedData := valueof(p_payloadField); v_secPayload := bit2oct(encvalue(v_toBeSignedData)); // Signed payload @@ -417,29 +367,32 @@ module LibItsSecurity_Functions { return false; } } - v_signature := f_signWithEcdsaNistp256WithSha256( - v_secPayload, - v_privateKey - );*/ - /* FIXME To be reviewed p_securedMessage := m_securedMessage( - valueof(v_toBeSignedData.header_fields), - p_payloadField, - { - m_trailer_field_signature( - m_signature( - m_ecdsaSignature( - m_eccPointecdsa_nistp256_with_sha256_y_coordinate_only( - substr(v_signature, 2, 32) - ), - substr(v_signature, 34, 32) - ) - ) - ) - } - );*/ + if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature)) { + v_signature := f_signWithEcdsaNistp256WithSha256( + v_secPayload, + v_privateKey + ); + p_securedMessage.content.signedData.signature_ := m_signature_ecdsaNistP256( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only(substr(v_signature, 0, 32)), + substr(v_signature, 32, 32) + ) + ); + } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { + v_signature := f_signWithEcdsaBrainpoolp256WithSha256( + v_secPayload, + v_privateKey + ); + p_securedMessage.content.signedData.signature_ := m_signature_ecdsaBrainpoolP256r1( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only(substr(v_signature, 0, 32)), + substr(v_signature, 32, 32) + ) + ); + } // TODO To be continued - return false;/* FIXME To be reviewed true;*/ + return true; } // End of function f_buildGnSecuredMessage /** @@ -458,11 +411,11 @@ module LibItsSecurity_Functions { * @return true on success, false otherwise */ function f_buildGnSecuredMessage_Bo( - out template (value) Ieee1609Dot2Data p_securedMessage, + out template (value) EtsiTs103097Data p_securedMessage, in template (value) charstring p_certificateName, in UInt8 p_protocolVersion := c_protocol_version, in integer p_trailerStatus := 0, - in template (value) Ieee1609Dot2Content p_payloadField, + in template (value) ToBeSignedData p_payloadField, in template (value) HeaderInfo p_mandatoryHeaders, in template (omit) HeaderInfo p_headerInfo := omit ) runs on ItsSecurityBaseComponent return boolean { @@ -642,8 +595,6 @@ module LibItsSecurity_Functions { * @param p_securedMessage The signed SecureMessage part * @param p_payloadField Payloads to be included in the message * @param p_signerIdentifierType Add digest or AT certificate or certificate chain - * @param p_threeDLocation The 3D location - * @param p_headerInfo HeaderInfo to be inserted in the message * @param p_certificateName The certificate identifier to be used. Default: TA_CERT_A * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerInfo * @return true on success, false otherwise @@ -651,57 +602,87 @@ module LibItsSecurity_Functions { * @see Draft ETSI TS 103 097 V1.1.14 Clause 7.1 Security profile for CAMs */ function f_buildGnSecuredCam( - out template (value) Ieee1609Dot2Data p_securedMessage, - in template (value) Ieee1609Dot2Content p_payloadField, - in template (omit) SignerIdentifier p_signerIdentifierType := omit, // FIXME To be reviewed - in template (omit) HeaderInfo p_headerInfo := omit, - in template (value) charstring p_certificateName := "", - in boolean p_addMissingHeaders := true + out template (value) EtsiTs103097Data p_securedMessage, + in ToBeSignedData p_payloadField, + in SignerIdentifier p_signerIdentifierType, + in charstring p_certificateName := ""/*, + in boolean p_addMissingHeaders := true*/ ) runs on ItsSecurityBaseComponent return boolean { // Local variables var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; - var HeaderInfo v_mandatoryHeaders := {}; - var HeaderInfo v_signerInfo; // Load certificates if required if (f_prepareCertificates(p_certificateName, v_aaCertificate, v_atCertificate) == false) { return false; } - - /* FIXME To be reviewed if (p_addMissingHeaders == true) { - // Prepare mandatory headers - if (valueof(p_signerIdentifierType) == e_certificate) { // Add the AT certificate - v_signerInfo := valueof( - m_header_info_signer_info( - m_signerIdentifier_certificate( + log("v_atCertificate = ", v_atCertificate); + + // Fill sta structure with default values, these values will be updated later + p_securedMessage := m_etsiTs103097Data_signed( + m_signedData( + sha256, + p_payloadField, + m_signerIdentifier_self, + m_signature_ecdsaNistP256( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only(int2oct(0, 32)), + int2oct(0, 32) + ) + ) + ) + ); + // Prepare mandatory headers + if (ischosen(p_signerIdentifierType.certificate)) { // Add the AT certificate + /* TODO + * v_signerInfo := valueof( + m_header_info_signer_info( + m_signerIdentifier_certificate( + v_atCertificate + ))); + } else if (valueof(p_signerIdentifierType) == e_certificate_chain) { // Add the AT certificate + AA EtsiTs103097Certificate + v_signerInfo := valueof( + m_header_info_signer_info( + m_signerIdentifier_certificates( + { + v_aaCertificate, v_atCertificate - ))); - } else if (valueof(p_signerIdentifierType) == e_certificate_chain) { // Add the AT certificate + AA EtsiTs103097Certificate - v_signerInfo := valueof( - m_header_info_signer_info( - m_signerIdentifier_certificates( - { - v_aaCertificate, - v_atCertificate - } - ) - )); - } else if (valueof(p_signerIdentifierType) == e_certificate_digest_with_sha256) { // Add the AT certificate digest - v_signerInfo := valueof( - m_header_info_signer_info( - m_issuerIdentifier_sha256AndDigest( - f_calculateDigestFromCertificate(v_atCertificate) - ))); - } - v_mandatoryHeaders := { - v_signerInfo, - valueof(m_header_info_generation_time(1000 * f_getCurrentTime())), // In us - valueof(m_header_info_its_aid(c_its_aid_CAM)) + } + ) + ));*/ + } else if (ischosen(p_signerIdentifierType.digest)) { // Add the AT certificate digest + if (ischosen(v_atCertificate.issuer.sha256AndDigest)) { + p_securedMessage.content.signedData.hashId := sha256; + p_securedMessage.content.signedData.signer := m_signerIdentifier_digest( + f_calculateDigestSha256FromCertificate(v_atCertificate) + ); + } else if (ischosen(v_atCertificate.issuer.sha384AndDigest)) { + p_securedMessage.content.signedData.hashId := sha384; + p_securedMessage.content.signedData.signer := m_signerIdentifier_digest( + f_calculateDigestSha384FromCertificate(v_atCertificate) + ); } - }*/ + } + if (ispresent(v_atCertificate.signature_)) { + if (ischosen(v_atCertificate.signature_.ecdsaBrainpoolP256r1Signature)) { + p_securedMessage.content.signedData.signature_ := m_signature_ecdsaBrainpoolP256r1( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only(int2oct(0, 32)), + int2oct(0, 32) + ) + ); + } else if (ischosen(v_atCertificate.signature_.ecdsaBrainpoolP384r1Signature)) { + p_securedMessage.content.signedData.signature_ := m_signature_ecdsaBrainpoolP384r1( + m_ecdsaP384Signature( + m_eccP384CurvePoint_x_only(int2oct(0, 48)), + int2oct(0, 48) + ) + ); + } // else, m_signature_ecdsaNistP256 already chosen by default + } + log("p_securedMessage = ", p_securedMessage); - return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField, v_mandatoryHeaders, p_headerInfo); + return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField/*, v_mandatoryHeaders*/); } // End of function f_buildGnSecuredCam @@ -726,13 +707,13 @@ module LibItsSecurity_Functions { * @see Draft ETSI TS 103 097 V1.1.14 Clause 7.1 Security profile for CAMs */ function f_buildGnSecuredCam_Bo( - out template (value) Ieee1609Dot2Data p_securedMessage, + out template (value) EtsiTs103097Data p_securedMessage, in UInt8 p_protocolVersion := c_protocol_version, in integer p_trailerStatus := 0, - in template (value) Ieee1609Dot2Content p_payloadField, - in template (omit) SignerIdentifier p_signerIdentifierType := omit, // FIXME To be reviewed + in ToBeSignedData p_payloadField, + in SignerIdentifier p_signerIdentifierType, // FIXME To be reviewed in template (omit) HeaderInfo p_headerInfo := omit, - in template (value) charstring p_certificateName := "", + in charstring p_certificateName := "", in boolean p_addMissingHeaders := true, in boolean p_alterATCertificateSignature := false, in boolean p_alterAACertificateSignature := false @@ -804,12 +785,12 @@ module LibItsSecurity_Functions { * @return true on success, false otherwise */ function f_buildGnSecuredDenm( - out template (value) Ieee1609Dot2Data p_securedMessage, - in template (value) Ieee1609Dot2Content p_payloadField, - in template (omit) SignerIdentifier p_signerIdentifierType := omit, // FIXME To be reviewed + out template (value) EtsiTs103097Data p_securedMessage, + in ToBeSignedData p_payloadField, + in SignerIdentifier p_signerIdentifierType, in ThreeDLocation p_threeDLocation, in template (omit) HeaderInfo p_headerInfo := omit, - in template (value) charstring p_certificateName := "", + in charstring p_certificateName := "", in boolean p_addMissingHeaders := true ) runs on ItsSecurityBaseComponent return boolean { @@ -858,7 +839,7 @@ module LibItsSecurity_Functions { }*/ // Build the secured message and return it - return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField, v_mandatoryHeaders, p_headerInfo); + return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField/*, v_mandatoryHeaders*/); } // End of function f_buildGnSecuredDenm @@ -879,14 +860,14 @@ module LibItsSecurity_Functions { * @return true on success, false otherwise */ function f_buildGnSecuredDenm_Bo( - out template (value) Ieee1609Dot2Data p_securedMessage, + out template (value) EtsiTs103097Data p_securedMessage, in UInt8 p_protocolVersion := c_protocol_version, in integer p_trailerStatus := 0, - in template (value) Ieee1609Dot2Content p_payloadField, - in template (omit) SignerIdentifier p_signerIdentifierType := omit, // FIXME To be reviewed + in ToBeSignedData p_payloadField, + in SignerIdentifier p_signerIdentifierType, // FIXME To be reviewed in ThreeDLocation p_threeDLocation, in template (omit) HeaderInfo p_headerInfo := omit, - in template (value) charstring p_certificateName := "", + in charstring p_certificateName := "", in boolean p_addMissingHeaders := true ) runs on ItsSecurityBaseComponent return boolean { @@ -951,12 +932,12 @@ module LibItsSecurity_Functions { * @return true on success, false otherwise */ function f_buildGnSecuredOtherMessage( - out template (value) Ieee1609Dot2Data p_securedMessage, - in template (value) Ieee1609Dot2Content p_payloadField, - in template (omit) SignerIdentifier p_signerIdentifierType := omit, // FIXME To be reviewed + out template (value) EtsiTs103097Data p_securedMessage, + in ToBeSignedData p_payloadField, + in SignerIdentifier p_signerIdentifierType, // FIXME To be reviewed in ThreeDLocation p_threeDLocation, in template (omit) HeaderInfo p_headerInfo := omit, - in template (value) charstring p_certificateName := "", + in charstring p_certificateName := "", in boolean p_addMissingHeaders := true ) runs on ItsSecurityBaseComponent return boolean { @@ -1004,7 +985,7 @@ module LibItsSecurity_Functions { }*/ // Build the secured message and return it - return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField, v_mandatoryHeaders, p_headerInfo); + return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField/*, v_mandatoryHeaders*/); } // End of function f_buildGnSecuredOtherMessage /** @@ -1024,14 +1005,14 @@ module LibItsSecurity_Functions { * @return true on success, false otherwise */ function f_buildGnSecuredOtherMessage_Bo( - out template (value) Ieee1609Dot2Data p_securedMessage, + out template (value) EtsiTs103097Data p_securedMessage, in UInt8 p_protocolVersion := c_protocol_version, in integer p_trailerStatus := 0, - in template (value) Ieee1609Dot2Content p_payloadField, - in template (omit) SignerIdentifier p_signerIdentifierType := omit, // FIXME To be reviewed + in ToBeSignedData p_payloadField, + in SignerIdentifier p_signerIdentifierType, // FIXME To be reviewed in ThreeDLocation p_threeDLocation, in template (omit) HeaderInfo p_headerInfo := omit, - in template (value) charstring p_certificateName := "", + in charstring p_certificateName := "", in boolean p_addMissingHeaders := true ) runs on ItsSecurityBaseComponent return boolean { @@ -1081,7 +1062,7 @@ module LibItsSecurity_Functions { // FIXME To be done // Build the secured message and return it - return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField, v_mandatoryHeaders, p_headerInfo); + return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField/*, v_mandatoryHeaders*/); } // End of function f_buildGnSecuredOtherMessage_Bo } // End of group hostSignatureHelpers @@ -1492,7 +1473,7 @@ module LibItsSecurity_Functions { for (var integer v_counter := 0; v_counter < lengthof(p_certificates); v_counter := v_counter + 1) { var CertificatesCachingItem v_item; v_item.certificate := p_certificates[v_counter]; - v_item.hashedId8 := f_calculateDigestFromCertificate(v_item.certificate); + v_item.hashedId8 := f_calculateDigestSha256FromCertificate(v_item.certificate); p_certificatesCaching[v_counter] := v_item; } // End of 'for' statement diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index e3e1e9c3..6dcfe949 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -226,8 +226,8 @@ module LibItsSecurity_Templates { * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.10 EcdsaP256Signature */ template (value) EcdsaP256Signature m_ecdsaSignature( - in template (value) EccP256CurvePoint p_rSig, - in template (value) octetstring p_sSig + in template (value) EccP256CurvePoint p_rSig, + in template (value) octetstring p_sSig ) := { rSig := p_rSig, sSig := p_sSig @@ -257,7 +257,7 @@ module LibItsSecurity_Templates { * @desc Send template for digest signed message */ template (value) SignerIdentifier m_signerIdentifier_digest( - in template (value) HashedId8 p_digest + in template (value) HashedId8 p_digest := '0000000000000000'O ) := { digest := p_digest } // End of template m_signerIdentifier_digest @@ -266,7 +266,7 @@ module LibItsSecurity_Templates { * @desc Send template for certificate signed message */ template (value) SignerIdentifier m_signerIdentifier_certificates( - in template (value) SequenceOfCertificate p_certificates + in template (value) SequenceOfCertificate p_certificates := {} ) := { certificate := p_certificates } // End of template m_signerIdentifier_certificates @@ -772,12 +772,11 @@ module LibItsSecurity_Templates { template (omit) HeaderInfo m_headerInfo_cam( in template (value) Psid p_psid := c_its_aid_CAM, in template (value) Time64 p_generationTime, - in template (value) Time64 p_expiryTime, - in template (omit) ThreeDLocation p_generationLocation := omit + in template (omit) Time64 p_expiryTime := omit ) modifies m_ieee1609Dot2_headerInfo := { generationTime := p_generationTime, expiryTime := p_expiryTime, - generationLocation := p_generationLocation + generationLocation := omit } // End of template m_headerInfo_cam /** -- GitLab From 2047f9134e20a2cb22d77a45fec0da40ce9b2930 Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 30 Jan 2018 15:20:33 +0000 Subject: [PATCH 057/320] ATS security review --- ttcn/Security/LibItsSecurity_Functions.ttcn | 48 +++- ttcn/Security/LibItsSecurity_Pics.ttcn | 9 + ttcn/Security/LibItsSecurity_Templates.ttcn | 15 +- .../LibItsSecurity_TypesAndValues.ttcn | 234 +++++++++--------- 4 files changed, 178 insertions(+), 128 deletions(-) diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 0ed3a3bc..dba978c7 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -28,6 +28,7 @@ module LibItsSecurity_Functions { import from LibItsSecurity_TypesAndValues all; import from LibItsSecurity_Templates all; import from LibItsSecurity_Pixits all; + import from LibItsSecurity_Pics all; import from LibItsSecurity_TestSystem all; group helpersFunctions { @@ -252,6 +253,26 @@ module LibItsSecurity_Functions { return fx_generateKeyPair_brainpoolp384(p_privateKey, p_publicKeyX, p_publicKeyY); } + /** + * @desc Calculate digest over the certificate + * @param p_cert The certificate + * @return the HashedId8 value + * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.13 HashedId8 + */ + function f_calculateDigestFromCertificate( + in Certificate p_cert + ) return HashedId8 { + var octetstring v_hash; + + if (PICS_HASH_ALGORITHM == sha256) { + v_hash := f_calculateDigestSha256FromCertificate(p_cert); + } if (PICS_HASH_ALGORITHM == sha384) { + v_hash := f_calculateDigestSha384FromCertificate(p_cert); + } + + return substr(v_hash, lengthof(v_hash) - 8, 8); + } // End of function f_calculateDigestFromCertificate + /** * @desc Calculate digest over the certificate * @param p_cert The certificate @@ -634,6 +655,8 @@ module LibItsSecurity_Functions { ); // Prepare mandatory headers if (ischosen(p_signerIdentifierType.certificate)) { // Add the AT certificate + log("*** " & testcasename() & ": TODO ***"); + stop; /* TODO * v_signerInfo := valueof( m_header_info_signer_info( @@ -662,6 +685,9 @@ module LibItsSecurity_Functions { f_calculateDigestSha384FromCertificate(v_atCertificate) ); } + } else { + log("*** " & testcasename() & ": TODO ***"); + stop; } if (ispresent(v_atCertificate.signature_)) { if (ischosen(v_atCertificate.signature_.ecdsaBrainpoolP256r1Signature)) { @@ -1260,9 +1286,9 @@ module LibItsSecurity_Functions { * @return HeaderInfo of given type if any or null */ function f_getMsgHeaderInfo( - in template(omit) Ieee1609Dot2Data p_securedMessage, - in HeaderInfo p_headerInfo, - out HeaderInfo p_return + in template(omit) Ieee1609Dot2Data p_securedMessage, + in HeaderInfo p_headerInfo, + out HeaderInfo p_return ) return boolean { var integer v_length; var Ieee1609Dot2Data v_securedMessage; @@ -1284,10 +1310,14 @@ module LibItsSecurity_Functions { * @desc return SignerIdentifier Ieee1609Dot2Data field */ function f_getMsgSignerIdentifier ( - in template(omit) Ieee1609Dot2Data p_securedMessage, - out SignerIdentifier p_signerIdentifier + in template(omit) Ieee1609Dot2Data p_securedMessage, + out SignerIdentifier p_signerIdentifier ) return boolean { - if (ispresent(p_securedMessage.content.signedData)) { + if (not isvalue(p_securedMessage)) { + testcase.stop(__SCOPE__ & " can not handle omitted secured message values"); + } + + if (ischosen(p_securedMessage.content.signedData)) { p_signerIdentifier := valueof(p_securedMessage.content.signedData.signer); return true; } @@ -1296,7 +1326,7 @@ module LibItsSecurity_Functions { return false; } - }// End of group messageGetters + } // End of group messageGetters group certificateGetters { @@ -1399,8 +1429,8 @@ module LibItsSecurity_Functions { * @return true on success, false otherwise */ function f_getCertificateDigest( - in charstring p_certificateId, - out HashedId8 p_digest + in charstring p_certificateId, + out HashedId8 p_digest ) runs on ItsSecurityBaseComponent return boolean { if( not fx_readCertificateDigest(p_certificateId, p_digest)){ log("f_getCertificateDigest: Failed to retrieve digest for ", p_certificateId); diff --git a/ttcn/Security/LibItsSecurity_Pics.ttcn b/ttcn/Security/LibItsSecurity_Pics.ttcn index b824a4b1..cde0fd9f 100644 --- a/ttcn/Security/LibItsSecurity_Pics.ttcn +++ b/ttcn/Security/LibItsSecurity_Pics.ttcn @@ -16,11 +16,20 @@ module LibItsSecurity_Pics { import from IEEE1609dot2 language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; + // LibItsSecurity + import from LibItsSecurity_TypesAndValues all; + + modulepar HashAlgorithm PICS_HASH_ALGORITHM := sha256; + + modulepar SignAlgorithm PICS_SIGN_ALGORITHM := e_nistp_256; + /** * Is the IUT support Brainpool algorithm */ modulepar boolean PICS_BRAINPOOL_SUPPORT := false; + modulepar boolean PICS_SEC_P2P_AT_DISTRIBUTION := false; + /** * Is the IUT support certificates pushing */ diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index 6dcfe949..512ec6a9 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -760,7 +760,7 @@ module LibItsSecurity_Templates { p2pcdLearningRequest := omit, missingCrlIdentifier := omit, encryptionKey := omit, - inlineP2pcdRequest := *, + inlineP2pcdRequest := omit, requestedCertificate := * } // End of template mw_ieee1609Dot2_headerInfo @@ -772,11 +772,13 @@ module LibItsSecurity_Templates { template (omit) HeaderInfo m_headerInfo_cam( in template (value) Psid p_psid := c_its_aid_CAM, in template (value) Time64 p_generationTime, - in template (omit) Time64 p_expiryTime := omit + in template (omit) Time64 p_expiryTime := omit, + in template (omit) SequenceOfHashedId3 p_inlineP2pcdRequest := omit ) modifies m_ieee1609Dot2_headerInfo := { generationTime := p_generationTime, expiryTime := p_expiryTime, - generationLocation := omit + generationLocation := omit, + inlineP2pcdRequest := p_inlineP2pcdRequest } // End of template m_headerInfo_cam /** @@ -786,14 +788,15 @@ module LibItsSecurity_Templates { */ template (present) HeaderInfo mw_headerInfo_cam( template (present) Psid p_psid := c_its_aid_CAM, - template Time64 p_generationTime := omit, + template (present) Time64 p_generationTime := ?, template Time64 p_expiryTime := omit, - template ThreeDLocation p_generationLocation := omit + template SequenceOfHashedId3 p_inlineP2pcdRequest := omit ) modifies mw_ieee1609Dot2_headerInfo := { psid := c_its_aid_CAM, generationTime := p_generationTime, expiryTime := p_expiryTime, - generationLocation := p_generationLocation + generationLocation := omit, + inlineP2pcdRequest := p_inlineP2pcdRequest } // End of template mw_headerInfo_cam /** diff --git a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn index 8ba1e039..fbc1f159 100644 --- a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn +++ b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn @@ -20,119 +20,119 @@ module LibItsSecurity_TypesAndValues { import from IEEE1609dot2 language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; - // Test Adapter certificates & private keys - Valid behavior - const charstring cc_taCert_A := "CERT_TS_A_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_A1 := "CERT_TS_A_1_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_B := "CERT_TS_B_AT"; /** Default certificate, with circular region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_B1 := "CERT_TS_B_1_AT"; - const charstring cc_taCert_C := "CERT_TS_C_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_D := "CERT_TS_D_AT"; /** Certificate with a polygonal region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_E := "CERT_TS_E_AT"; /** Certificate with a region identifier, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_F := "CERT_TS_F_AT"; /** Certificate that can be used as an unknown certificate for IUT. */ - const charstring cc_taCert_G := "CERT_TS_G_AT"; /** to be defined */ - const charstring cc_taCert_EC := "CERT_TS_A_EC"; /** Certificate with a subject type indicating 'enrolment_credentials', to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_AA := "CERT_TS_A_AA"; /** Certificate with a subject type indicating 'authorisation_authority', to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_EA := "CERT_TS_A_EA"; /** Certificate with a subject type indicating 'enrolment_authority', to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_CA := "CERT_TS_A_CA"; /** Certificate with a subject type indicating 'root_ca', to be used when secured messages are sent from TA to IUT */ - // Test Adapter certificates & private keys - Inoportune behavior - const charstring cc_taCert_B_BO := "CERT_TS_B_BO_AT"; /** Certificate with a circular region, the IUT position is outside of the region */ - const charstring cc_taCert_C_BO := "CERT_TS_C_BO_AT"; /** Certificate with a rectangular region, the IUT position is outside of the region */ - const charstring cc_taCert_D_BO := "CERT_TS_D_BO_AT"; /** Certificate with a polygonal region, the IUT position is outside of the region */ - const charstring cc_taCert_E_BO := "CERT_TS_E_BO_AT"; /** Certificate with a region identifier, the IUT position is outside of the region */ - const charstring cc_taCert0101_BO := "CERT_TS_01_01_BO_AT"; /** Check that IUT discards the AT certificate with version 3 */ - const charstring cc_taCert0102_BO := "CERT_TS_01_02_BO_AT"; /** Check that IUT discards the AT certificate with version 1 */ - const charstring cc_taCert0103_BO := "CERT_TS_01_03_BO_AT"; /** Check that IUT discards the AA certificate with version 3 */ - const charstring cc_taCert0104_BO := "CERT_TS_01_04_BO_AT"; /** Check that IUT discards the AA certificate with version 1 */ - const charstring cc_taCert0201_BO := "CERT_TS_02_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization ticket certificate contains the subject type 'enrolment_credential' */ - const charstring cc_taCert0202_BO := "CERT_TS_02_02_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization authority certificate contains the subject type 'enrolment_credential' */ - const charstring cc_taCert0203_BO := "CERT_TS_02_03_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization ticket certificate contains the subject type 'enrolment_authority' */ - const charstring cc_taCert0204_BO := "CERT_TS_02_04_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization authority certificate contains the subject type 'enrolment_authority' */ - const charstring cc_taCert0301_BO := "CERT_TS_03_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization ticket certificate contains the subject type 'authorization_ticket' */ - const charstring cc_taCert0302_BO := "CERT_TS_03_02_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization authority certificate contains the subject type 'authorization_ticket' */ - const charstring cc_taCert0601_BO := "CERT_TS_06_01_BO_AT"; /** Check that IUT discards a SecuredMessage containing generation_time before the message signing certificate validity period */ - const charstring cc_taCert0602_BO := "CERT_TS_06_02_BO_AT"; /** Check that IUT discards a SecuredMessage containing generation_time after the message signing certificate validity period */ - const charstring cc_taCert0401_BO := "CERT_TS_04_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the AA certificate contains the subject type 'authorization_authority' */ - const charstring cc_taCertMsg1301_BO := "CERT_TS_MSG_13_01_BO_AT"; /** Check that IUT discards secured CAM signed with the not yet valid certificate */ - const charstring cc_taCertMsg1302_BO := "CERT_TS_MSG_13_02_BO_AT"; /** Check that IUT discards secured CAM signed with the expired certificate */ - const charstring cc_taCertMsg1303_BO := "CERT_TS_MSG_13_03_BO_AT"; /** Check that IUT discards secured CAM when IUT location is outside the circular validity restriction of the signing certificatee */ - const charstring cc_taCertMsg1304_BO := "CERT_TS_MSG_13_04_BO_AT"; /** Check that IUT discards secured CAM when IUT location is outside the rectangular validity restriction of the signing certificate */ - const charstring cc_taCertMsg1305_BO := "CERT_TS_MSG_13_05_BO_AT"; /** Check that IUT discards secured CAM when IUT location is outside the polygonal validity restriction of the signing certificate */ - const charstring cc_taCertMsg1306_BO := "CERT_TS_MSG_13_06_BO_AT"; /** Check that IUT discards secured CAM when IUT location is outside the identified validity restriction of the signing certificate */ - const charstring cc_taCert0601_BV := "CERT_TS_06_01_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the same circular region validity restriction as its issuing certificate */ - const charstring cc_taCert0602_BV := "CERT_TS_06_02_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the circular region validity restriction of its issuing certificate */ - const charstring cc_taCert0603_BV := "CERT_TS_06_03_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the rectangular region validity restriction of its issuing certificate */ - const charstring cc_taCert0604_BV := "CERT_TS_06_04_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0605_BV := "CERT_TS_06_05_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the identified region validity restriction of its issuing certificate */ - const charstring cc_taCert0606_BO := "CERT_TS_06_06_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message does not contain the region validity restriction but its issuing certificate contains the circular region validity restriction */ - const charstring cc_taCert0607_BO := "CERT_TS_06_07_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains circular region validity restriction which is outside of the circular region validity restriction of its issuing certificate */ - const charstring cc_taCert0608_BO := "CERT_TS_06_08_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains circular region validity restriction which is not fully covered by the the circular region validity restriction of its issuing certificate */ - const charstring cc_taCert0701_BV := "CERT_TS_07_01_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the same rectangular region validity restriction as its issuing certificate */ - const charstring cc_taCert0702_BV := "CERT_TS_07_02_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the rectangular region validity restriction which is fully inside in the circular region validity restriction of its issuing certificate */ - const charstring cc_taCert0703_BV := "CERT_TS_07_03_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the validity restriction with rectangular region which is fully inside in the rectangular region validity restriction of its issuing certificate */ - const charstring cc_taCert0704_BV := "CERT_TS_07_04_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the rectangular region validity restriction which is fully inside in the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0705_BV := "CERT_TS_07_05_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the rectangular region validity restriction which is fully inside in the identified region validity restriction of its issuing certificate */ - const charstring cc_taCert0706_BO := "CERT_TS_07_06_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message does not contain the region validity restriction but its issuing certificate contains the rectangular region validity restriction */ - const charstring cc_taCert0707_BO := "CERT_TS_07_07_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains rectangular region validity restriction which is outside of the rectangular region validity restriction of its issuing certificate */ - const charstring cc_taCert0708_BO := "CERT_TS_07_08_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains rectangular region validity restriction which is not fully covered by the the rectangular region validity restriction of its issuing certificate */ - const charstring cc_taCert0801_BV := "CERT_TS_08_01_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the same polygonal region validity restriction as its issuing certificate */ - const charstring cc_taCert0802_BV := "CERT_TS_08_02_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the circular region validity restriction of its issuing certificate */ - const charstring cc_taCert0803_BV := "CERT_TS_08_03_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the rectangular region validity restriction of its issuing certificate */ - const charstring cc_taCert0804_BV := "CERT_TS_08_04_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0805_BV := "CERT_TS_08_05_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the identified region validity restriction of its issuing certificate */ - const charstring cc_taCert0806_BO := "CERT_TS_08_06_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message does not contain the region validity restriction but its issuing certificate contains the polygonal region validity restriction */ - const charstring cc_taCert0807_BO := "CERT_TS_08_07_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains polygonal region validity restriction which is outside of the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0808_BO := "CERT_TS_08_08_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains polygonal region validity restriction which is outside of the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0809_BO := "CERT_TS_08_09_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains polygonal region validity restriction which is not fully covered by the the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0901_BV := "CERT_TS_09_01_BV_AT"; /** Check that the IUT accepts a message when its signing certificate contains the identified region validity restriction with the same identified region as the issuing certificate and without local area definition */ - const charstring cc_taCert0902_BV := "CERT_TS_09_02_BV_AT"; /** Check that the IUT accepts a message when its signing certificate contains the identified region validity restriction with the same identified region as the issuing certificate and with local area definition */ - const charstring cc_taCert0903_BV := "CERT_TS_09_03_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the circular region validity restriction of its issuing certificate */ - const charstring cc_taCert0904_BV := "CERT_TS_09_04_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the rectangular region validity restriction of its issuing certificate */ - const charstring cc_taCert0905_BV := "CERT_TS_09_05_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0906_BV := "CERT_TS_09_06_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of the message contains the identified region validity restriction with the identified region which is fully covered by the identified region of the validity restriction of its issuing certificate */ - const charstring cc_taCert0907_BO := "CERT_TS_09_07_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message does not contain the region validity restriction but its issuing certificate contains the identified region validity restriction */ - const charstring cc_taCert0908_BO := "CERT_TS_09_08_BO_AT"; /** Check that the IUT discards a message when the signing certificate and its issuing certificate are both containing the identified region validity restrictions with the same region id but different local regions */ - const charstring cc_taCert0909_BO := "CERT_TS_09_09_BO_AT"; /** Check that the IUT discards a message when the identified region of the validity restriction of its signing certificate is different and not fully covered by the one in the issuing certificate */ - const charstring cc_taCert0910_BO := "CERT_TS_09_10_BO_AT"; /** Check that the IUT discards a message when the identified region validity restriction of its signing certificate contains unknown area code */ - const charstring cc_taCert0911_BO := "CERT_TS_09_11_BO_AT"; /** Check that the IUT discards a message when the identified region validity restriction of its signing certificate contains invalid area code */ - const charstring cc_taCert1001_BO := "CERT_TS_10_01_BO_AT"; /** Check that the IUT discards a message when its signing certificate does not contain the time validity restriction */ - const charstring cc_taCert1002_BO := "CERT_TS_10_02_BO_AT"; /** Check that the IUT discards a message when the issuing certificate of the message signing certificate does not contain the time validity restriction */ - const charstring cc_taCert1003_BO := "CERT_TS_10_03_BO_AT"; /** Check that the IUT discards a message when its signing certificate contains 'time_end' validity restriction */ - const charstring cc_taCert1004_BO := "CERT_TS_10_03_BO_AT"; /** Check that the IUT discards a message when its signing certificate contains 'time_start_and_duration' validity restriction */ - const charstring cc_taCert1005_BO := "CERT_TS_10_03_BO_AT"; /** Check that the IUT discards a message when the issuing certificate of the message signing certificate contains 'time_end' validity restriction */ - const charstring cc_taCert1006_BO := "CERT_TS_10_03_BO_AT"; /** Check that the IUT discards a message when its signing certificate contains 'time_start_and_duration' validity restriction */ - const charstring cc_taCert1101_BO := "CERT_TS_11_01_BO_AT"; /** Check that the IUT discards a message when the validity period of the signing certificate ends after the validity period of its issuing certificate */ - const charstring cc_taCert1102_BO := "CERT_TS_11_02_BO_AT"; /** Check that the IUT discards a message when the validity period of its signing certificate starts before the validity period of the issuing certificate */ - const charstring cc_taCert1103_BO := "CERT_TS_11_03_BO_AT"; /** Check that the IUT discards a message when the issuing certificate of signing certificate is expired but the signing certificate is not expired yet */ - const charstring cc_taCert1104_BO := "CERT_TS_11_04_BO_AT"; /** Check that the IUT discards a message when the validity period of the signing certificate is after the validity period of its issuing certificate */ - const charstring cc_taCert1201_BO := "CERT_TS_12_01_BO_AT"; /** Check that the IUT discards a message when its signing certificate does not contain the SSP-AID subject attribute */ - const charstring cc_taCert1202_BO := "CERT_TS_12_02_BO_AT"; /** Check that the IUT discards a Secured CAM when its signing certificate does not contain a record with AID_CAM in the its_aid_ssp_list subject attribute */ - const charstring cc_taCert1203_BO := "CERT_TS_12_03_BO_AT"; /** Check that the IUT discards a Secured DENM when its signing certificate does not contain a record with AID_DENM in the its_aid_ssp_list subject attribute */ - const charstring cc_taCert1204_BO := "CERT_TS_12_04_BO_AT"; /** Check that the IUT discards a Secured CAM when its signing certificate contains two records with AID_CAM in the its_aid_ssp_list subject attribute */ - const charstring cc_taCert1301_BO := "CERT_TS_13_01_BO_AT"; /** Check that the IUT discards a message when the signing AT certificate contains a CAM AID-SSP record whereas the issuing AA certificate does not contain the record with AID_CAM */ - const charstring cc_taCert1302_BO := "CERT_TS_13_02_BO_AT"; /** Check that the IUT discards a message when the signing AT certificate contains a DENM AID-SSP record whereas the issuing AA certificate does not contain the AID record with AID_DENM */ - const charstring cc_taCert1303_BO := "CERT_TS_13_03_BO_AT"; /** Check that IUT discards a SecuredMessage if the AA certificate does not contain a subject_attribute of type its_aid_list */ - const charstring cc_taCert1401_BO := "CERT_TS_14_01_BO_AT"; /** Check that IUT discards the AT certificate with signer info of type 'certificate' */ - const charstring cc_taCert1402_BO := "CERT_TS_14_02_BO_AT"; /** Check that IUT discards the AT certificate with signer info of type 'certificate_chain' */ - const charstring cc_taCert1403_BO := "CERT_TS_14_03_BO_AT"; /** Check that IUT discards the AT certificate with signer info of type 'certificate_digest_with_other_algorithm' */ - const charstring cc_taCert1501_BO := "CERT_TS_15_01_BO_AT"; /** Check that IUT discards the AA certificate with signer info of type 'certificate' */ - const charstring cc_taCert1502_BO := "CERT_TS_15_02_BO_AT"; /** Check that IUT discards the AA certificate with signer info of type 'certificate_chain' */ - const charstring cc_taCert1503_BO := "CERT_TS_15_03_BO_AT"; /** Check that IUT discards the AA certificate with signer info of type 'certificate_digest_with_other_algorithm' */ - const charstring cc_taCert1601_BO := "CERT_TS_16_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject_name of the AT certificate is not an empty name field */ - const charstring cc_taCert1701_BO := "CERT_TS_17_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject attribute of type assurance_level is missing in the AT certificate */ - const charstring cc_taCert1702_BO := "CERT_TS_17_02_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject attribute of type assurance_level is missing in the AA certificate */ - const charstring cc_taCert1703_BO := "CERT_TS_17_03_BO_AT"; /** Check that IUT discards a SecuredMessage if the assurance level of issuing certificate is less then assurance level of subordinate certificate */ - const charstring cc_taCert1704_BO := "CERT_TS_17_04_BO_AT"; /** Check that IUT discards a SecuredMessage if the assurance level of issuing certificate is equal to the assurance level of the subordinate certificate but the confidence of subject assurance of issuing certificate is less then the confidence of the subordinate certificate */ - const charstring cc_taCert1801_BO := "CERT_TS_18_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject attribute of type verification_key is missing in the AT certificate */ - const charstring cc_taCert1802_BO := "CERT_TS_18_02_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject attribute of type verification_key is missing in the AA certificate */ - const charstring cc_taCert1901_BO := "CERT_TS_19_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the reserved region type has been used in region validity restriction of the AT certificate */ - - // IUT certificates & private keys - const charstring cc_iutCert_A := "CERT_IUT_A_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_B := "CERT_IUT_B_AT"; /** Default certificate, with circular region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_C := "CERT_IUT_C_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_D := "CERT_IUT_D_AT"; /** Certificate with a polygonal region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_E := "CERT_IUT_E_AT"; /** Certificate with a region identifier, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_F := "CERT_IUT_F_AT"; /** Certificate with a subject type indicating 'enrolment_credentials', to be used when secured messages are sent from TA to IUT */ + // Test Adapter certificates & private keys - Valid behavior + const charstring cc_taCert_A := "CERT_TS_A_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_A1 := "CERT_TS_A_1_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_B := "CERT_TS_B_AT"; /** Default certificate, with circular region, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_B1 := "CERT_TS_B_1_AT"; + const charstring cc_taCert_C := "CERT_TS_C_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_D := "CERT_TS_D_AT"; /** Certificate with a polygonal region, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_E := "CERT_TS_E_AT"; /** Certificate with a region identifier, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_F := "CERT_TS_F_AT"; /** Certificate that can be used as an unknown certificate for IUT. */ + const charstring cc_taCert_G := "CERT_TS_G_AT"; /** to be defined */ + const charstring cc_taCert_EC := "CERT_TS_A_EC"; /** Certificate with a subject type indicating 'enrolment_credentials', to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_AA := "CERT_TS_A_AA"; /** Certificate with a subject type indicating 'authorisation_authority', to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_EA := "CERT_TS_A_EA"; /** Certificate with a subject type indicating 'enrolment_authority', to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_CA := "CERT_TS_A_CA"; /** Certificate with a subject type indicating 'root_ca', to be used when secured messages are sent from TA to IUT */ + // Test Adapter certificates & private keys - Inoportune behavior + const charstring cc_taCert_B_BO := "CERT_TS_B_BO_AT"; /** Certificate with a circular region, the IUT position is outside of the region */ + const charstring cc_taCert_C_BO := "CERT_TS_C_BO_AT"; /** Certificate with a rectangular region, the IUT position is outside of the region */ + const charstring cc_taCert_D_BO := "CERT_TS_D_BO_AT"; /** Certificate with a polygonal region, the IUT position is outside of the region */ + const charstring cc_taCert_E_BO := "CERT_TS_E_BO_AT"; /** Certificate with a region identifier, the IUT position is outside of the region */ + const charstring cc_taCert0101_BO := "CERT_TS_01_01_BO_AT"; /** Check that IUT discards the AT certificate with version 3 */ + const charstring cc_taCert0102_BO := "CERT_TS_01_02_BO_AT"; /** Check that IUT discards the AT certificate with version 1 */ + const charstring cc_taCert0103_BO := "CERT_TS_01_03_BO_AT"; /** Check that IUT discards the AA certificate with version 3 */ + const charstring cc_taCert0104_BO := "CERT_TS_01_04_BO_AT"; /** Check that IUT discards the AA certificate with version 1 */ + const charstring cc_taCert0201_BO := "CERT_TS_02_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization ticket certificate contains the subject type 'enrolment_credential' */ + const charstring cc_taCert0202_BO := "CERT_TS_02_02_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization authority certificate contains the subject type 'enrolment_credential' */ + const charstring cc_taCert0203_BO := "CERT_TS_02_03_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization ticket certificate contains the subject type 'enrolment_authority' */ + const charstring cc_taCert0204_BO := "CERT_TS_02_04_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization authority certificate contains the subject type 'enrolment_authority' */ + const charstring cc_taCert0301_BO := "CERT_TS_03_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization ticket certificate contains the subject type 'authorization_ticket' */ + const charstring cc_taCert0302_BO := "CERT_TS_03_02_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization authority certificate contains the subject type 'authorization_ticket' */ + const charstring cc_taCert0601_BO := "CERT_TS_06_01_BO_AT"; /** Check that IUT discards a SecuredMessage containing generation_time before the message signing certificate validity period */ + const charstring cc_taCert0602_BO := "CERT_TS_06_02_BO_AT"; /** Check that IUT discards a SecuredMessage containing generation_time after the message signing certificate validity period */ + const charstring cc_taCert0401_BO := "CERT_TS_04_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the AA certificate contains the subject type 'authorization_authority' */ + const charstring cc_taCertMsg1301_BO := "CERT_TS_MSG_13_01_BO_AT"; /** Check that IUT discards secured CAM signed with the not yet valid certificate */ + const charstring cc_taCertMsg1302_BO := "CERT_TS_MSG_13_02_BO_AT"; /** Check that IUT discards secured CAM signed with the expired certificate */ + const charstring cc_taCertMsg1303_BO := "CERT_TS_MSG_13_03_BO_AT"; /** Check that IUT discards secured CAM when IUT location is outside the circular validity restriction of the signing certificatee */ + const charstring cc_taCertMsg1304_BO := "CERT_TS_MSG_13_04_BO_AT"; /** Check that IUT discards secured CAM when IUT location is outside the rectangular validity restriction of the signing certificate */ + const charstring cc_taCertMsg1305_BO := "CERT_TS_MSG_13_05_BO_AT"; /** Check that IUT discards secured CAM when IUT location is outside the polygonal validity restriction of the signing certificate */ + const charstring cc_taCertMsg1306_BO := "CERT_TS_MSG_13_06_BO_AT"; /** Check that IUT discards secured CAM when IUT location is outside the identified validity restriction of the signing certificate */ + const charstring cc_taCert0601_BV := "CERT_TS_06_01_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the same circular region validity restriction as its issuing certificate */ + const charstring cc_taCert0602_BV := "CERT_TS_06_02_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the circular region validity restriction of its issuing certificate */ + const charstring cc_taCert0603_BV := "CERT_TS_06_03_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the rectangular region validity restriction of its issuing certificate */ + const charstring cc_taCert0604_BV := "CERT_TS_06_04_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the polygonal region validity restriction of its issuing certificate */ + const charstring cc_taCert0605_BV := "CERT_TS_06_05_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the identified region validity restriction of its issuing certificate */ + const charstring cc_taCert0606_BO := "CERT_TS_06_06_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message does not contain the region validity restriction but its issuing certificate contains the circular region validity restriction */ + const charstring cc_taCert0607_BO := "CERT_TS_06_07_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains circular region validity restriction which is outside of the circular region validity restriction of its issuing certificate */ + const charstring cc_taCert0608_BO := "CERT_TS_06_08_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains circular region validity restriction which is not fully covered by the the circular region validity restriction of its issuing certificate */ + const charstring cc_taCert0701_BV := "CERT_TS_07_01_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the same rectangular region validity restriction as its issuing certificate */ + const charstring cc_taCert0702_BV := "CERT_TS_07_02_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the rectangular region validity restriction which is fully inside in the circular region validity restriction of its issuing certificate */ + const charstring cc_taCert0703_BV := "CERT_TS_07_03_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the validity restriction with rectangular region which is fully inside in the rectangular region validity restriction of its issuing certificate */ + const charstring cc_taCert0704_BV := "CERT_TS_07_04_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the rectangular region validity restriction which is fully inside in the polygonal region validity restriction of its issuing certificate */ + const charstring cc_taCert0705_BV := "CERT_TS_07_05_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the rectangular region validity restriction which is fully inside in the identified region validity restriction of its issuing certificate */ + const charstring cc_taCert0706_BO := "CERT_TS_07_06_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message does not contain the region validity restriction but its issuing certificate contains the rectangular region validity restriction */ + const charstring cc_taCert0707_BO := "CERT_TS_07_07_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains rectangular region validity restriction which is outside of the rectangular region validity restriction of its issuing certificate */ + const charstring cc_taCert0708_BO := "CERT_TS_07_08_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains rectangular region validity restriction which is not fully covered by the the rectangular region validity restriction of its issuing certificate */ + const charstring cc_taCert0801_BV := "CERT_TS_08_01_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the same polygonal region validity restriction as its issuing certificate */ + const charstring cc_taCert0802_BV := "CERT_TS_08_02_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the circular region validity restriction of its issuing certificate */ + const charstring cc_taCert0803_BV := "CERT_TS_08_03_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the rectangular region validity restriction of its issuing certificate */ + const charstring cc_taCert0804_BV := "CERT_TS_08_04_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the polygonal region validity restriction of its issuing certificate */ + const charstring cc_taCert0805_BV := "CERT_TS_08_05_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the identified region validity restriction of its issuing certificate */ + const charstring cc_taCert0806_BO := "CERT_TS_08_06_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message does not contain the region validity restriction but its issuing certificate contains the polygonal region validity restriction */ + const charstring cc_taCert0807_BO := "CERT_TS_08_07_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains polygonal region validity restriction which is outside of the polygonal region validity restriction of its issuing certificate */ + const charstring cc_taCert0808_BO := "CERT_TS_08_08_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains polygonal region validity restriction which is outside of the polygonal region validity restriction of its issuing certificate */ + const charstring cc_taCert0809_BO := "CERT_TS_08_09_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains polygonal region validity restriction which is not fully covered by the the polygonal region validity restriction of its issuing certificate */ + const charstring cc_taCert0901_BV := "CERT_TS_09_01_BV_AT"; /** Check that the IUT accepts a message when its signing certificate contains the identified region validity restriction with the same identified region as the issuing certificate and without local area definition */ + const charstring cc_taCert0902_BV := "CERT_TS_09_02_BV_AT"; /** Check that the IUT accepts a message when its signing certificate contains the identified region validity restriction with the same identified region as the issuing certificate and with local area definition */ + const charstring cc_taCert0903_BV := "CERT_TS_09_03_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the circular region validity restriction of its issuing certificate */ + const charstring cc_taCert0904_BV := "CERT_TS_09_04_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the rectangular region validity restriction of its issuing certificate */ + const charstring cc_taCert0905_BV := "CERT_TS_09_05_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the polygonal region validity restriction of its issuing certificate */ + const charstring cc_taCert0906_BV := "CERT_TS_09_06_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of the message contains the identified region validity restriction with the identified region which is fully covered by the identified region of the validity restriction of its issuing certificate */ + const charstring cc_taCert0907_BO := "CERT_TS_09_07_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message does not contain the region validity restriction but its issuing certificate contains the identified region validity restriction */ + const charstring cc_taCert0908_BO := "CERT_TS_09_08_BO_AT"; /** Check that the IUT discards a message when the signing certificate and its issuing certificate are both containing the identified region validity restrictions with the same region id but different local regions */ + const charstring cc_taCert0909_BO := "CERT_TS_09_09_BO_AT"; /** Check that the IUT discards a message when the identified region of the validity restriction of its signing certificate is different and not fully covered by the one in the issuing certificate */ + const charstring cc_taCert0910_BO := "CERT_TS_09_10_BO_AT"; /** Check that the IUT discards a message when the identified region validity restriction of its signing certificate contains unknown area code */ + const charstring cc_taCert0911_BO := "CERT_TS_09_11_BO_AT"; /** Check that the IUT discards a message when the identified region validity restriction of its signing certificate contains invalid area code */ + const charstring cc_taCert1001_BO := "CERT_TS_10_01_BO_AT"; /** Check that the IUT discards a message when its signing certificate does not contain the time validity restriction */ + const charstring cc_taCert1002_BO := "CERT_TS_10_02_BO_AT"; /** Check that the IUT discards a message when the issuing certificate of the message signing certificate does not contain the time validity restriction */ + const charstring cc_taCert1003_BO := "CERT_TS_10_03_BO_AT"; /** Check that the IUT discards a message when its signing certificate contains 'time_end' validity restriction */ + const charstring cc_taCert1004_BO := "CERT_TS_10_03_BO_AT"; /** Check that the IUT discards a message when its signing certificate contains 'time_start_and_duration' validity restriction */ + const charstring cc_taCert1005_BO := "CERT_TS_10_03_BO_AT"; /** Check that the IUT discards a message when the issuing certificate of the message signing certificate contains 'time_end' validity restriction */ + const charstring cc_taCert1006_BO := "CERT_TS_10_03_BO_AT"; /** Check that the IUT discards a message when its signing certificate contains 'time_start_and_duration' validity restriction */ + const charstring cc_taCert1101_BO := "CERT_TS_11_01_BO_AT"; /** Check that the IUT discards a message when the validity period of the signing certificate ends after the validity period of its issuing certificate */ + const charstring cc_taCert1102_BO := "CERT_TS_11_02_BO_AT"; /** Check that the IUT discards a message when the validity period of its signing certificate starts before the validity period of the issuing certificate */ + const charstring cc_taCert1103_BO := "CERT_TS_11_03_BO_AT"; /** Check that the IUT discards a message when the issuing certificate of signing certificate is expired but the signing certificate is not expired yet */ + const charstring cc_taCert1104_BO := "CERT_TS_11_04_BO_AT"; /** Check that the IUT discards a message when the validity period of the signing certificate is after the validity period of its issuing certificate */ + const charstring cc_taCert1201_BO := "CERT_TS_12_01_BO_AT"; /** Check that the IUT discards a message when its signing certificate does not contain the SSP-AID subject attribute */ + const charstring cc_taCert1202_BO := "CERT_TS_12_02_BO_AT"; /** Check that the IUT discards a Secured CAM when its signing certificate does not contain a record with AID_CAM in the its_aid_ssp_list subject attribute */ + const charstring cc_taCert1203_BO := "CERT_TS_12_03_BO_AT"; /** Check that the IUT discards a Secured DENM when its signing certificate does not contain a record with AID_DENM in the its_aid_ssp_list subject attribute */ + const charstring cc_taCert1204_BO := "CERT_TS_12_04_BO_AT"; /** Check that the IUT discards a Secured CAM when its signing certificate contains two records with AID_CAM in the its_aid_ssp_list subject attribute */ + const charstring cc_taCert1301_BO := "CERT_TS_13_01_BO_AT"; /** Check that the IUT discards a message when the signing AT certificate contains a CAM AID-SSP record whereas the issuing AA certificate does not contain the record with AID_CAM */ + const charstring cc_taCert1302_BO := "CERT_TS_13_02_BO_AT"; /** Check that the IUT discards a message when the signing AT certificate contains a DENM AID-SSP record whereas the issuing AA certificate does not contain the AID record with AID_DENM */ + const charstring cc_taCert1303_BO := "CERT_TS_13_03_BO_AT"; /** Check that IUT discards a SecuredMessage if the AA certificate does not contain a subject_attribute of type its_aid_list */ + const charstring cc_taCert1401_BO := "CERT_TS_14_01_BO_AT"; /** Check that IUT discards the AT certificate with signer info of type 'certificate' */ + const charstring cc_taCert1402_BO := "CERT_TS_14_02_BO_AT"; /** Check that IUT discards the AT certificate with signer info of type 'certificate_chain' */ + const charstring cc_taCert1403_BO := "CERT_TS_14_03_BO_AT"; /** Check that IUT discards the AT certificate with signer info of type 'certificate_digest_with_other_algorithm' */ + const charstring cc_taCert1501_BO := "CERT_TS_15_01_BO_AT"; /** Check that IUT discards the AA certificate with signer info of type 'certificate' */ + const charstring cc_taCert1502_BO := "CERT_TS_15_02_BO_AT"; /** Check that IUT discards the AA certificate with signer info of type 'certificate_chain' */ + const charstring cc_taCert1503_BO := "CERT_TS_15_03_BO_AT"; /** Check that IUT discards the AA certificate with signer info of type 'certificate_digest_with_other_algorithm' */ + const charstring cc_taCert1601_BO := "CERT_TS_16_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject_name of the AT certificate is not an empty name field */ + const charstring cc_taCert1701_BO := "CERT_TS_17_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject attribute of type assurance_level is missing in the AT certificate */ + const charstring cc_taCert1702_BO := "CERT_TS_17_02_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject attribute of type assurance_level is missing in the AA certificate */ + const charstring cc_taCert1703_BO := "CERT_TS_17_03_BO_AT"; /** Check that IUT discards a SecuredMessage if the assurance level of issuing certificate is less then assurance level of subordinate certificate */ + const charstring cc_taCert1704_BO := "CERT_TS_17_04_BO_AT"; /** Check that IUT discards a SecuredMessage if the assurance level of issuing certificate is equal to the assurance level of the subordinate certificate but the confidence of subject assurance of issuing certificate is less then the confidence of the subordinate certificate */ + const charstring cc_taCert1801_BO := "CERT_TS_18_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject attribute of type verification_key is missing in the AT certificate */ + const charstring cc_taCert1802_BO := "CERT_TS_18_02_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject attribute of type verification_key is missing in the AA certificate */ + const charstring cc_taCert1901_BO := "CERT_TS_19_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the reserved region type has been used in region validity restriction of the AT certificate */ + + // IUT certificates & private keys + const charstring cc_iutCert_A := "CERT_IUT_A_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ + const charstring cc_iutCert_B := "CERT_IUT_B_AT"; /** Default certificate, with circular region, to be used when secured messages are sent from TA to IUT */ + const charstring cc_iutCert_C := "CERT_IUT_C_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ + const charstring cc_iutCert_D := "CERT_IUT_D_AT"; /** Certificate with a polygonal region, to be used when secured messages are sent from TA to IUT */ + const charstring cc_iutCert_E := "CERT_IUT_E_AT"; /** Certificate with a region identifier, to be used when secured messages are sent from TA to IUT */ + const charstring cc_iutCert_F := "CERT_IUT_F_AT"; /** Certificate with a subject type indicating 'enrolment_credentials', to be used when secured messages are sent from TA to IUT */ /** * @desc Specification of basic format elements @@ -239,6 +239,14 @@ module LibItsSecurity_TypesAndValues { } // End of group profileCertificates + type enumerated SignAlgorithm { + e_nistp_256, + e_nistp_384, + e_brainpool_256, + e_brainpool_384 + } + + group taConfiguration { /** -- GitLab From e9328a3b5409eb12c91fc63339950dd7f723007e Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 31 Jan 2018 14:30:46 +0000 Subject: [PATCH 058/320] ATS security review --- ttcn/Security/LibItsSecurity_Pics.ttcn | 10 +++++++++- ttcn/Security/LibItsSecurity_Templates.ttcn | 16 +++++++++------- ttcn/Security/LibItsSecurity_TypesAndValues.ttcn | 1 + 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/ttcn/Security/LibItsSecurity_Pics.ttcn b/ttcn/Security/LibItsSecurity_Pics.ttcn index cde0fd9f..bad7d10d 100644 --- a/ttcn/Security/LibItsSecurity_Pics.ttcn +++ b/ttcn/Security/LibItsSecurity_Pics.ttcn @@ -28,7 +28,15 @@ module LibItsSecurity_Pics { */ modulepar boolean PICS_BRAINPOOL_SUPPORT := false; - modulepar boolean PICS_SEC_P2P_AT_DISTRIBUTION := false; + /** + * Is the IUT able to distribute AT certificates + */ + modulepar boolean PICS_SEC_P2P_AT_DISTRIBUTION := true; + + /** + * Is the IUT able to distribute AA certificates + */ + modulepar boolean PICS_SEC_P2P_AA_DISTRIBUTION := true; /** * Is the IUT support certificates pushing diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index 512ec6a9..c6c5666f 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -761,7 +761,7 @@ module LibItsSecurity_Templates { missingCrlIdentifier := omit, encryptionKey := omit, inlineP2pcdRequest := omit, - requestedCertificate := * + requestedCertificate := omit } // End of template mw_ieee1609Dot2_headerInfo /** @@ -790,13 +790,15 @@ module LibItsSecurity_Templates { template (present) Psid p_psid := c_its_aid_CAM, template (present) Time64 p_generationTime := ?, template Time64 p_expiryTime := omit, - template SequenceOfHashedId3 p_inlineP2pcdRequest := omit + template SequenceOfHashedId3 p_inlineP2pcdRequest := omit, + template Certificate p_requestedCertificate := omit ) modifies mw_ieee1609Dot2_headerInfo := { - psid := c_its_aid_CAM, - generationTime := p_generationTime, - expiryTime := p_expiryTime, - generationLocation := omit, - inlineP2pcdRequest := p_inlineP2pcdRequest + psid := c_its_aid_CAM, + generationTime := p_generationTime, + expiryTime := p_expiryTime, + generationLocation := omit, + inlineP2pcdRequest := p_inlineP2pcdRequest, + requestedCertificate := p_requestedCertificate } // End of template mw_headerInfo_cam /** diff --git a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn index fbc1f159..f6b6d004 100644 --- a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn +++ b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn @@ -25,6 +25,7 @@ module LibItsSecurity_TypesAndValues { const charstring cc_taCert_A1 := "CERT_TS_A_1_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_B := "CERT_TS_B_AT"; /** Default certificate, with circular region, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_B1 := "CERT_TS_B_1_AT"; + const charstring cc_taCert_B_AA := "CERT_TS_B_1_AA"; const charstring cc_taCert_C := "CERT_TS_C_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_D := "CERT_TS_D_AT"; /** Certificate with a polygonal region, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_E := "CERT_TS_E_AT"; /** Certificate with a region identifier, to be used when secured messages are sent from TA to IUT */ -- GitLab From 3e0f43573f256581262004973e51c954d7a613f1 Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 2 Feb 2018 14:10:31 +0000 Subject: [PATCH 059/320] Add certificates loader --- ttcn/Security/LibItsSecurity_Functions.ttcn | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index dba978c7..cde22a43 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -1362,10 +1362,10 @@ module LibItsSecurity_Functions { // var boolean v_result; // Setup certificates memory cache - /* FIXME To be reviewed if (fx_loadCertificates(PX_CERTIFICATE_POOL_PATH, p_configId) == true) { + if (fx_loadCertificates(PX_CERTIFICATE_POOL_PATH, p_configId) == true) { // Setup security component variables - if(f_readCertificate(cc_taCert_A, vc_atCertificate)) { - if(f_readCertificate(oct2str(vc_atCertificate.cracaId), vc_aaCertificate)) { + /*FIXME if(f_readCertificate(cc_taCert_A, vc_atCertificate)) { + if(f_readCertificate(oct2str(vc_atCertificate.issuer), vc_aaCertificate)) { if(f_readSigningKey(cc_taCert_A, vc_signingPrivateKey)) { f_readEncryptingKey(cc_taCert_A, vc_encryptPrivateKey); return true; @@ -1373,13 +1373,13 @@ module LibItsSecurity_Functions { log("f_loadCertificates: Failed to load signing key for ", cc_taCert_A); }else{ log("f_loadCertificates: Failed to load AA certificate for ", cc_taCert_A); - } + } }else{ log("f_loadCertificates: Failed to load AT certificate for ", cc_taCert_A); - } - }else{ + }*/ + } else { log("f_loadCertificates: Failed to load certificates from ", PX_CERTIFICATE_POOL_PATH); - }*/ + } return false; } // End of function f_loadCertificates @@ -1667,6 +1667,7 @@ module LibItsSecurity_Functions { * @return true on success, false otherwise */ external function fx_loadCertificates(in charstring p_rootDirectory, in charstring p_configId) return boolean; + external function fx_store_certificate(in charstring p_cert_id, in octetstring p_cert, in octetstring p_private_key, in octetstring p_public_key_x, in octetstring p_public_key_y, in octetstring p_hashid8, in octetstring p_issuer) return boolean; /** * @desc Unload from memory cache the certificates -- GitLab From f6f03a623eb3c3634b0cd82ddc6a62c8b9317a8b Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 8 Feb 2018 08:09:37 +0000 Subject: [PATCH 060/320] STF538: Finalize CAM TP implementation --- ttcn/Security/LibItsSecurity_Functions.ttcn | 173 ++++++++++++------ ttcn/Security/LibItsSecurity_Templates.ttcn | 24 ++- .../LibItsSecurity_TypesAndValues.ttcn | 1 - 3 files changed, 140 insertions(+), 58 deletions(-) diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index cde22a43..eefaadd6 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -1188,66 +1188,133 @@ module LibItsSecurity_Functions { } // End of function f_verifyCertificateSignatureWithIssuingCertificate /** - * @desc Verify the signature of the provided secured message - * @param p_securedMessage The message to be verified - * @param p_publicKey The ECDSA public key to verify a signature - * @param p_certificate EtsiTs103097Certificate to be used to verify the message - * @return true on success, false otherwise - * @verdict - */ - function f_verifyGnSecuredMessageSignatureWithPublicKey( - in template (value) Ieee1609Dot2Data p_securedMessage, - in template (value) EccP256CurvePoint p_publicKey + * @desc Verify the signature of the provided secured message for ECDSA Nist-P256 algorithm + * @param p_securedMessage The message to be verified + * @param p_publicKey The ECDSA public key to verify a signature + * @param p_certificate EtsiTs103097Certificate to be used to verify the message + * @return true on success, false otherwise + * @verdict Unchanged + */ + function f_verifyGnSecuredMessageSignature_ecdsaNistP256( + in template (value) Ieee1609Dot2Data p_securedMessage, + in template (value) EccP256CurvePoint p_publicKey ) return boolean { // Local variables var octetstring v_secPayload; var octetstring v_signedData; -// FIXME (DF) UNUSED -// var Oct32 v_hash; - var integer v_counter; var boolean v_result := false; var template (value) ToBeSignedData v_toBeSignedData; -// log(">>> f_verifyGnSecuredMessageSignatureWithPublicKey: p_securedMessage= ", p_securedMessage); -// log(">>> f_verifyGnSecuredMessageSignatureWithPublicKey: p_publicKey= ", p_publicKey); + log(">>> f_verifyGnSecuredMessageSignature_ecdsaNistP256: p_securedMessage= ", p_securedMessage); + log(">>> f_verifyGnSecuredMessageSignature_ecdsaNistP256: p_publicKey= ", p_publicKey); // Create Ieee1609Dot2Data payload to be signed - /* FIXME To be reviewed v_toBeSignedData := m_toBeSignedSecuredMessage( - valueof(p_securedMessage.header_fields), - valueof(p_securedMessage.payload_field), - e_signature + v_toBeSignedData := valueof(p_securedMessage.content.signedData.tbsData); + log("f_verifyGnSecuredMessageSignature_ecdsaNistP256: v_toBeSignedData=", p_securedMessage.content.signedData.tbsData); + + v_secPayload := bit2oct(encvalue(v_toBeSignedData)); + log("f_verifyGnSecuredMessageSignature_ecdsaNistP256: v_secPayload=", v_secPayload); + + // Verify payload + v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig.x_only) & valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig); + log("f_verifyGnSecuredMessageSignature_ecdsaNistP256: v_signedData=", v_signedData); + v_result := f_verifyWithEcdsaNistp256WithSha256( + v_secPayload, + v_signedData, + valueof(p_publicKey.uncompressedP256.x), + valueof(p_publicKey.uncompressedP256.y) ); - log("f_verifyGnSecuredMessageSignatureWithPublicKey: v_toBeSignedData=", v_toBeSignedData); + + log("f_verifyGnSecuredMessageSignature_ecdsaNistP256: v_result=", v_result); + return v_result; + } // End of function f_verifyGnSecuredMessageSignature_ecdsaNistP256 + + /** + * @desc Verify the signature of the provided secured message for ECDSA Brainpool-P256 algorithm + * @param p_securedMessage The message to be verified + * @param p_publicKey The ECDSA public key to verify a signature + * @param p_certificate EtsiTs103097Certificate to be used to verify the message + * @return true on success, false otherwise + * @verdict Unchanged + */ + function f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1( + in template (value) Ieee1609Dot2Data p_securedMessage, + in template (value) EccP256CurvePoint p_publicKey + ) return boolean { + + // Local variables + var octetstring v_secPayload; + var octetstring v_signedData; + var boolean v_result := false; + var template (value) ToBeSignedData v_toBeSignedData; + + log(">>> f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: p_securedMessage= ", p_securedMessage); + log(">>> f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: p_publicKey= ", p_publicKey); + + // Create Ieee1609Dot2Data payload to be signed + v_toBeSignedData := valueof(p_securedMessage.content.signedData.tbsData); + log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: v_toBeSignedData=", p_securedMessage.content.signedData.tbsData); v_secPayload := bit2oct(encvalue(v_toBeSignedData)); - log("f_verifyGnSecuredMessageSignatureWithPublicKey: v_secPayload=", v_secPayload); + log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: v_secPayload=", v_secPayload); // Verify payload - for (v_counter := 0; v_counter < lengthof(p_securedMessage.trailer_fields); v_counter := v_counter + 1) { - var Ieee1609Dot2Data v_securedMessage := valueof(p_securedMessage); - if ( - (v_securedMessage.trailer_fields[v_counter].type_ == e_signature) and - (v_securedMessage.trailer_fields[v_counter].trailerField.signature_.algorithm == e_ecdsa_nistp256_with_sha256) - ) { - v_signedData := - '0000'O & - v_securedMessage.trailer_fields[v_counter].trailerField.signature_.ecdsaNistP256Signature.rSig & - v_securedMessage.trailer_fields[v_counter].trailerField.signature_.ecdsaNistP256Signature.sSig; - log("f_verifyGnSecuredMessageSignatureWithPublicKey: v_signedData=", v_signedData); - v_result := f_verifyWithEcdsaNistp256WithSha256( - v_secPayload, - v_signedData, - valueof(p_publicKey.uncompressedP256.x), - valueof(p_publicKey.uncompressedP256.y) - ); - break; - } - }*/ // End of 'for' statement + v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only) & valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig); + log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: v_signedData=", v_signedData); + v_result := f_verifyWithEcdsaBrainpoolp256WithSha256( + v_secPayload, + v_signedData, + valueof(p_publicKey.uncompressedP256.x), + valueof(p_publicKey.uncompressedP256.y) + ); + + log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: v_result=", v_result); + return v_result; + } // End of function f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1 + + /** + * @desc Verify the signature of the provided secured message for ECDSA Brainpool-P384 algorithm + * @param p_securedMessage The message to be verified + * @param p_publicKey The ECDSA public key to verify a signature + * @param p_certificate EtsiTs103097Certificate to be used to verify the message + * @return true on success, false otherwise + * @verdict Unchanged + */ + function f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1( + in template (value) Ieee1609Dot2Data p_securedMessage, + in template (value) EccP384CurvePoint p_publicKey + ) return boolean { + + // Local variables + var octetstring v_secPayload; + var octetstring v_signedData; + var boolean v_result := false; + var template (value) ToBeSignedData v_toBeSignedData; + + log(">>> f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: p_securedMessage= ", p_securedMessage); + log(">>> f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: p_publicKey= ", p_publicKey); + + // Create Ieee1609Dot2Data payload to be signed + v_toBeSignedData := valueof(p_securedMessage.content.signedData.tbsData); + log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: v_toBeSignedData=", p_securedMessage.content.signedData.tbsData); + + v_secPayload := bit2oct(encvalue(v_toBeSignedData)); + log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: v_secPayload=", v_secPayload); + + // Verify payload + v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only) & valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig); + log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: v_signedData=", v_signedData); + v_result := f_verifyWithEcdsaBrainpoolp256WithSha256( + v_secPayload, + v_signedData, + valueof(p_publicKey.uncompressedP384.x), + valueof(p_publicKey.uncompressedP384.y) + ); - log("f_verifyGnSecuredMessageSignatureWithPublicKey: v_result=", v_result); + log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: v_result=", v_result); return v_result; - } // End of function f_verifyCertificateSignatureWithPublicKey + } // End of function f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1 /** * @desc Verify the signature of the provided secured message @@ -1261,18 +1328,15 @@ module LibItsSecurity_Functions { in template (value) EtsiTs103097Certificate p_certificate ) return boolean { - /* FIXME To be reviewed for (var integer v_counter := 0; v_counter < lengthof(p_certificate.subject_attributes); v_counter := v_counter + 1) { - var SubjectAttribute v_subjectAttribute := valueof(p_certificate.subject_attributes[v_counter]); - - log("f_verifyGnSecuredMessageSignatureWithCertificate: processing ", v_subjectAttribute); - if (v_subjectAttribute.type_ == e_verification_key) { - return f_verifyGnSecuredMessageSignatureWithPublicKey( - p_securedMessage, - valueof(p_certificate.subject_attributes[v_counter].attribute.key)); - } - }*/ // End of 'for' statement + if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { + return f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1(p_securedMessage, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1); + } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature)) { + return f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1(p_securedMessage, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1); + } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature)) { + return f_verifyGnSecuredMessageSignature_ecdsaNistP256(p_securedMessage, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256); + } - return false; + return true; } // End of function f_verifyGnSecuredOtherMessageWithDeviceCertificate } // End of group deviceSignatureHelpers @@ -1287,7 +1351,6 @@ module LibItsSecurity_Functions { */ function f_getMsgHeaderInfo( in template(omit) Ieee1609Dot2Data p_securedMessage, - in HeaderInfo p_headerInfo, out HeaderInfo p_return ) return boolean { var integer v_length; diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index c6c5666f..ae0863c6 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -712,6 +712,16 @@ module LibItsSecurity_Templates { unsecuredData := p_unsecuredData } // End of template m_ieee1609Dot2Data_unsecured + /** + * @desc Receive template for 'unsecured' Payload + * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload + */ + template (present) Ieee1609Dot2Content mw_ieee1609Dot2Data_unsecured( + template (present) Opaque p_unsecuredData := ? + ) := { + unsecuredData := p_unsecuredData + } // End of template mw_ieee1609Dot2Data_unsecured + /** * @desc Send template for 'signed' Payload * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload @@ -722,6 +732,16 @@ module LibItsSecurity_Templates { signedData := p_signedData } // End of template m_ieee1609Dot2Data_signed + /** + * @desc Send template for 'signed' Payload + * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload + */ + template (present) Ieee1609Dot2Content mw_ieee1609Dot2Data_signed( + template (present) SignedData p_signedData := ? + ) := { + signedData := p_signedData + } // End of template mw_ieee1609Dot2Data_signed + } // End of group ieee1609Dot2Data /** @@ -880,8 +900,8 @@ module LibItsSecurity_Templates { } // End of template m_ecdsaP256Signature template (present) EcdsaP256Signature mw_ecdsaP256Signature( - template (present) EccP256CurvePoint p_rSig, - template (present) Oct32 p_sSig + template (present) EccP256CurvePoint p_rSig := ?, + template (present) Oct32 p_sSig := ? ) := { rSig := p_rSig, sSig := p_sSig diff --git a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn index f6b6d004..fff8db8b 100644 --- a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn +++ b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn @@ -242,7 +242,6 @@ module LibItsSecurity_TypesAndValues { type enumerated SignAlgorithm { e_nistp_256, - e_nistp_384, e_brainpool_256, e_brainpool_384 } -- GitLab From be4cf8b94dc45689d77d89532fa54b1effcd9ff1 Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 9 Feb 2018 14:25:09 +0000 Subject: [PATCH 061/320] Security support in the TA --- ttcn/Security/LibItsSecurity_Functions.ttcn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index eefaadd6..b3bce1ff 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -1305,7 +1305,7 @@ module LibItsSecurity_Functions { // Verify payload v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only) & valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig); log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: v_signedData=", v_signedData); - v_result := f_verifyWithEcdsaBrainpoolp256WithSha256( + v_result := f_verifyWithEcdsaBrainpoolp384WithSha384( v_secPayload, v_signedData, valueof(p_publicKey.uncompressedP384.x), -- GitLab From e99ed734844d8badb105872c1837436f247e27c8 Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 19 Feb 2018 15:32:03 +0000 Subject: [PATCH 062/320] Security support in the TA --- ttcn/Common/LibItsCommon_TypesAndValues.ttcn | 1 + ttcn/Security/LibItsSecurity_Functions.ttcn | 28 ++++++-------------- ttcn/Security/LibItsSecurity_Pics.ttcn | 2 +- ttcn/Security/LibItsSecurity_Templates.ttcn | 25 +++++++++++++---- 4 files changed, 30 insertions(+), 26 deletions(-) diff --git a/ttcn/Common/LibItsCommon_TypesAndValues.ttcn b/ttcn/Common/LibItsCommon_TypesAndValues.ttcn index b50f5858..b14fbc29 100644 --- a/ttcn/Common/LibItsCommon_TypesAndValues.ttcn +++ b/ttcn/Common/LibItsCommon_TypesAndValues.ttcn @@ -148,6 +148,7 @@ module LibItsCommon_TypesAndValues { const integer c_its_aid_MAP := 138; const integer c_its_aid_IVI := 139; const integer c_its_aid_TLC := 140; + const integer c_its_aid_GN := 141; } } with { diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index b3bce1ff..480ab78f 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -1530,30 +1530,18 @@ module LibItsSecurity_Functions { function f_getCertificateValidityRestriction( in template (value) EtsiTs103097Certificate p_cert, - out ValidityPeriod p_return + out template (value) ValidityPeriod p_validityPeriod, + out template (omit) GeographicRegion p_geographicRegion ) return boolean { - p_return := valueof(p_cert.toBeSigned.validityPeriod); + p_validityPeriod := valueof(p_cert.toBeSigned.validityPeriod); + if (ispresent(p_cert.toBeSigned.region)) { + p_geographicRegion := valueof(p_cert.toBeSigned.region); + } else { + p_geographicRegion := omit; + } return true; } // End of function f_getCertificateValidityRestriction - function f_getCertificateSubjectAttribute( - in template (value) EtsiTs103097Certificate p_cert/* FIXME To be reviewed, - out SubjectAttribute p_return*/ - ) return boolean { - /* FIXME To be reviewed tfor (var integer i := 0; i < lengthof(p_cert.subject_attributes); i := i + 1) { -//FIXME RGY Titan doesn't support dot notation after valueof at the moment -// if (valueof(p_cert).subject_attributes[i].type_ == p_type) { -// p_return := valueof(p_cert).subject_attributes[i]; - if (valueof(p_cert.subject_attributes[i].type_) == p_type) { - p_return := valueof(p_cert.subject_attributes[i]); - return true; - } - } - - log("f_getCertificateSubjectAttribute: Failed to retrieve ", p_type);*/ - return false; - } - }// End of group certificateGetters group certificatesCaching { diff --git a/ttcn/Security/LibItsSecurity_Pics.ttcn b/ttcn/Security/LibItsSecurity_Pics.ttcn index bad7d10d..3fc6ddad 100644 --- a/ttcn/Security/LibItsSecurity_Pics.ttcn +++ b/ttcn/Security/LibItsSecurity_Pics.ttcn @@ -41,7 +41,7 @@ module LibItsSecurity_Pics { /** * Is the IUT support certificates pushing */ - modulepar boolean PICS_CERTIFICATE_SELECTION := true; + modulepar boolean PICS_SEC_CERTIFICATE_SELECTION := true; /** * Is the IUT support circular region geographical restriction diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index ae0863c6..221e7a14 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -828,20 +828,35 @@ module LibItsSecurity_Templates { template (omit) HeaderInfo m_headerInfo_denm( in template (value) Psid p_psid := c_its_aid_DENM, in template (value) Time64 p_generationTime, - in template (value) Time64 p_expiryTime, - in template (omit) ThreeDLocation p_generationLocation := omit - ) modifies m_ieee1609Dot2_headerInfo := { + in template (value) ThreeDLocation p_generationLocation, + in template (omit) Time64 p_expiryTime := omit + ) modifies mw_ieee1609Dot2_headerInfo := { generationTime := p_generationTime, expiryTime := p_expiryTime, generationLocation := p_generationLocation } // End of template m_headerInfo_denm + /** + * + * Clause 7.1.2 Security profile for DENMs + */ + template (present) HeaderInfo mw_headerInfo_denm( + template (present) Psid p_psid := c_its_aid_DENM, + template (present) Time64 p_generationTime := ?, + template (present) ThreeDLocation p_generationLocation := ?, + template Time64 p_expiryTime := omit + ) modifies m_ieee1609Dot2_headerInfo := { + generationTime := p_generationTime, + expiryTime := p_expiryTime, + generationLocation := p_generationLocation + } // End of template mw_headerInfo_denm + /** * * Clause 7.1.3 Generic security profile for other signed messages */ template (omit) HeaderInfo m_headerInfo_gn( - in template (value) Psid p_psid := 141, // TODO ITS-AID for GN + in template (value) Psid p_psid := c_its_aid_GN, in template (value) Time64 p_generationTime, in template (value) Time64 p_expiryTime, in template (omit) ThreeDLocation p_generationLocation := omit @@ -1326,7 +1341,7 @@ module LibItsSecurity_Templates { template ToBeSignedCertificate mw_toBeSignedCertificate_at( template (present) SequenceOfPsidSsp p_appPermissions := ?, template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, - template ValidityPeriod p_validityPeriod := *, + template ValidityPeriod p_validityPeriod := ?, template GeographicRegion p_region := *, template SubjectAssurance p_assuranceLevel := *, template PublicEncryptionKey p_encryptionKey := * -- GitLab From 845b312e6654b505850f05fb264104285a882dd0 Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 20 Feb 2018 07:43:07 +0000 Subject: [PATCH 063/320] STF538: Finalize DENM & CAM TP implementation --- ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn | 4 ++-- ttcn/Security/LibItsSecurity_TypesAndValues.ttcn | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn index ff477c43..71eacb02 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn @@ -952,8 +952,8 @@ module LibItsGeoNetworking_Templates { * @param p_seqNumber Sequence number of GeoBroadcast packet */ template (present) GnNonSecuredPacket mw_geoNwBroadcastPacket( - in template (present) LongPosVector p_sourceLongPosVec, - in template (present) UInt16 p_seqNumber + in template (present) LongPosVector p_sourceLongPosVec := ?, + in template (present) UInt16 p_seqNumber := ? ) := { commonHeader := mw_commonHeader( PX_GN_UPPER_LAYER, diff --git a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn index fff8db8b..3072a013 100644 --- a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn +++ b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn @@ -23,9 +23,9 @@ module LibItsSecurity_TypesAndValues { // Test Adapter certificates & private keys - Valid behavior const charstring cc_taCert_A := "CERT_TS_A_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_A1 := "CERT_TS_A_1_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_B := "CERT_TS_B_AT"; /** Default certificate, with circular region, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_B := "CERT_TS_B_AT"; /** Default certificate, with circular region, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_B1 := "CERT_TS_B_1_AT"; - const charstring cc_taCert_B_AA := "CERT_TS_B_1_AA"; + const charstring cc_taCert_B_AA := "CERT_TS_B_1_AA"; const charstring cc_taCert_C := "CERT_TS_C_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_D := "CERT_TS_D_AT"; /** Certificate with a polygonal region, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_E := "CERT_TS_E_AT"; /** Certificate with a region identifier, to be used when secured messages are sent from TA to IUT */ @@ -128,6 +128,9 @@ module LibItsSecurity_TypesAndValues { const charstring cc_taCert1901_BO := "CERT_TS_19_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the reserved region type has been used in region validity restriction of the AT certificate */ // IUT certificates & private keys + const charstring cc_taCert_CA1 := "CERT_IUT_CA1_AT"; + const charstring cc_taCert_CA2 := "CERT_IUT_CA2_AT"; + const charstring cc_taCert_CC_AA := "CERT_IUT_CC_AA"; const charstring cc_iutCert_A := "CERT_IUT_A_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ const charstring cc_iutCert_B := "CERT_IUT_B_AT"; /** Default certificate, with circular region, to be used when secured messages are sent from TA to IUT */ const charstring cc_iutCert_C := "CERT_IUT_C_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ -- GitLab From 8c2a975e1efa033767367443278f1734f2c9fe32 Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 20 Feb 2018 10:42:16 +0000 Subject: [PATCH 064/320] STF538: Finalize GN, DENM & CAM TP implementation --- ttcn/Security/LibItsSecurity_Pics.ttcn | 2 +- ttcn/Security/LibItsSecurity_Templates.ttcn | 30 ++++++++++++++++++--- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/ttcn/Security/LibItsSecurity_Pics.ttcn b/ttcn/Security/LibItsSecurity_Pics.ttcn index 3fc6ddad..4e4f93eb 100644 --- a/ttcn/Security/LibItsSecurity_Pics.ttcn +++ b/ttcn/Security/LibItsSecurity_Pics.ttcn @@ -76,6 +76,6 @@ module LibItsSecurity_Pics { /** * Does the IUT support ITS-AID for Generic profile? */ - modulepar boolean PICS_ITS_AID_OTHER_PROFILE := true; + modulepar boolean PICS_SEC_ITS_AID_OTHER := true; } // End of module LibItsSecurity_Pics \ No newline at end of file diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index 221e7a14..81368c4c 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -396,7 +396,7 @@ module LibItsSecurity_Templates { } // End of template mw_signerIdentifier_digest template (present) SignerIdentifier mw_signerIdentifier_certificate( - in template (present) Certificate p_certificate := ? + in template (present) EtsiTs103097Certificate p_certificate := ? ) := { certificate := { p_certificate } } // End of template m_signerIdentifier_certificate @@ -866,6 +866,21 @@ module LibItsSecurity_Templates { generationLocation := p_generationLocation } // End of template m_headerInfo_gn + /** + * + * Clause 7.1.3 Generic security profile for other signed messages + */ + template (present) HeaderInfo mw_headerInfo_gn( + template (present) Psid p_psid := c_its_aid_GN, + template (present) Time64 p_generationTime := ?, + template (present) Time64 p_expiryTime := ?, + template ThreeDLocation p_generationLocation := omit + ) modifies m_ieee1609Dot2_headerInfo := { + generationTime := p_generationTime, + expiryTime := p_expiryTime, + generationLocation := p_generationLocation + } // End of template mw_headerInfo_gn + } // End of group headerFields group signatures { @@ -1179,7 +1194,8 @@ module LibItsSecurity_Templates { template ToBeSignedCertificate mw_toBeSignedCertificate_ca( template (present) CertificateId p_id := ?, template (present) SequenceOfPsidSsp p_appPermissions := ?, - template (present) SequenceOfPsidGroupPermissions p_certIssuePermissions, + template (present) SequenceOfPsidGroupPermissions p_certIssuePermissions := ?, + template (present) SequenceOfPsidGroupPermissions p_certRequestPermissions := ?, template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, template ValidityPeriod p_validityPeriod := *, template GeographicRegion p_region := *, @@ -1194,7 +1210,7 @@ module LibItsSecurity_Templates { assuranceLevel := p_assuranceLevel, appPermissions := *, certIssuePermissions := p_certIssuePermissions, - certRequestPermissions := *, + certRequestPermissions := p_certRequestPermissions, canRequestRollover := *, encryptionKey := p_encryptionKey, verifyKeyIndicator := p_verifyKeyIndicator @@ -1436,6 +1452,14 @@ module LibItsSecurity_Templates { ssp := p_ssp } // End of template m_appPermissions + template (present) PsidSsp mw_appPermissions( + template (present) Psid p_psid := ?, + template ServiceSpecificPermissions p_ssp := * + ) := { + psid := p_psid, + ssp := p_ssp + } // End of template mw_appPermissions + template (value) PsidSspRange m_psidSspRange( in Psid p_psid, in template (value) SspRange p_sspRange := m_SspRange_all -- GitLab From 2209fa4692b664c31516bc4a77d4216978167d1f Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 20 Feb 2018 11:05:44 +0000 Subject: [PATCH 065/320] STF538: Finalize GN, DENM & CAM TP implementation --- ttcn/Security/LibItsSecurity_Templates.ttcn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index 81368c4c..111169de 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -845,7 +845,7 @@ module LibItsSecurity_Templates { template (present) Time64 p_generationTime := ?, template (present) ThreeDLocation p_generationLocation := ?, template Time64 p_expiryTime := omit - ) modifies m_ieee1609Dot2_headerInfo := { + ) modifies mw_ieee1609Dot2_headerInfo := { generationTime := p_generationTime, expiryTime := p_expiryTime, generationLocation := p_generationLocation -- GitLab From 764fb649e34efe92c4fc33a4e59fdea19c8ce847 Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 20 Feb 2018 11:14:01 +0000 Subject: [PATCH 066/320] STF538: Finalize GN, DENM & CAM TP implementation --- ttcn/Security/LibItsSecurity_Templates.ttcn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index 111169de..a9680538 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -875,7 +875,7 @@ module LibItsSecurity_Templates { template (present) Time64 p_generationTime := ?, template (present) Time64 p_expiryTime := ?, template ThreeDLocation p_generationLocation := omit - ) modifies m_ieee1609Dot2_headerInfo := { + ) modifies mw_ieee1609Dot2_headerInfo := { generationTime := p_generationTime, expiryTime := p_expiryTime, generationLocation := p_generationLocation -- GitLab From 1d3e9918ff747912ae6eeb743e1a26f21099f926 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 21 Feb 2018 15:15:41 +0000 Subject: [PATCH 067/320] STF538: Finalize GN, DENM & CAM TP implementation --- ttcn/CAM/LibItsCam_Functions.ttcn | 16 +-- .../LibItsGeoNetworking_Functions.ttcn | 104 ++++++++++-------- ttcn/Security/LibItsSecurity_Templates.ttcn | 49 ++++++--- 3 files changed, 97 insertions(+), 72 deletions(-) diff --git a/ttcn/CAM/LibItsCam_Functions.ttcn b/ttcn/CAM/LibItsCam_Functions.ttcn index 5a25f9d5..d7f53a5d 100644 --- a/ttcn/CAM/LibItsCam_Functions.ttcn +++ b/ttcn/CAM/LibItsCam_Functions.ttcn @@ -324,7 +324,7 @@ module LibItsCam_Functions { } // End of function f_cfDown - } // end of camConfigurationFunctions + } // End of camConfigurationFunctions group defaults { @@ -370,7 +370,7 @@ module LibItsCam_Functions { } } - } // end of defaults + } // End of defaults group preambles { @@ -421,7 +421,7 @@ module LibItsCam_Functions { } // End of function f_prInitialState - } // end of preambles + } // End of preambles group postambles { @@ -432,7 +432,7 @@ module LibItsCam_Functions { f_acStopScenario(); } - } // end group postambles + } // End group postambles group camPositionFunctions { @@ -460,7 +460,7 @@ module LibItsCam_Functions { return v_referencePosition; } - } // end group camPositionFunctions + } // End group camPositionFunctions group camAuxilaryFunctions { @@ -482,7 +482,7 @@ module LibItsCam_Functions { } } - } // end group camAuxilaryFunctions + } // End group camAuxilaryFunctions group camGenerators { function f_generateDefaultCam() @@ -499,6 +499,6 @@ module LibItsCam_Functions { ) ); } - } // end of group camGenerators + } // End of group camGenerators -} // end LibItsCam_Functions +} // End of LibItsCam_Functions diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn index 36b03b86..a90c20f4 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn @@ -2543,7 +2543,7 @@ module LibItsGeoNetworking_Functions { * @param p_InSecMsg SecurityMessage template * @param p_received returns received SecurityMessage */ - /* FIXME To be reviewed altstep a_securedMessage ( + altstep a_securedMessage ( in template (present) EtsiTs103097Data p_InSecMsg, out EtsiTs103097Data p_received ) runs on ItsGeoNetworking { @@ -2552,28 +2552,34 @@ module LibItsGeoNetworking_Functions { mw_geoNwSecPdu( p_InSecMsg, mw_geoNwAnyPacket_withPayload(?) - //FIXME RGY Titan doesn't support storing list at the moment - // ))) -> value (v_geoNw) { ))) -> value v_geoNw { p_received := f_getSecuredMessage(v_geoNw.msgIn); } - }*/ + } // End of 'altstep' statement /** * @desc Receive GN message with security containing certificate as a signer info * @param p_cert returns the certificate used for sign received message */ - /* FIXME To be reviewed altstep a_securedMessageWithCertificate( + altstep a_securedMessageWithCertificate( out EtsiTs103097Data p_received ) runs on ItsGeoNetworking { [] a_securedMessage ( - mw_securedMessage (superset(mw_header_field_signer_info_certificate)), - p_received + mw_etsiTs103097Data_signed( + mw_signedData( + -, + mw_toBeSignedData( + mw_signedDataPayload + ), + mw_signerIdentifier_certificate // containing certificate + ) + ), + p_received ) { // Nothing to do } - }*/ // End of altstep a_securedMessageWithCertificate + } // End of altstep a_securedMessageWithCertificate /** * @desc Receive GN message with security containing certificate chain as a signer info @@ -2597,19 +2603,24 @@ module LibItsGeoNetworking_Functions { * @desc Receive GN message with security containing digest as a signer info * @param p_cert returns the certificate used for sign received message */ - /* FIXME To be reviewed altstep a_securedMessageWithDigest( + altstep a_securedMessageWithDigest( out EtsiTs103097Data p_received ) runs on ItsGeoNetworking { [] a_securedMessage ( - mw_securedMessage ( - superset( - mw_header_field_signer_info_digest - )), - p_received + mw_etsiTs103097Data_signed( + mw_signedData( + -, + mw_toBeSignedData( + mw_signedDataPayload + ), + mw_signerIdentifier_digest // containing digest + ) + ), + p_received ) { // Nothing to do } - }*/ // End of altstep a_securedMessageWithDigest + } // End of altstep a_securedMessageWithDigest } // End of group altSteps @@ -2625,18 +2636,17 @@ module LibItsGeoNetworking_Functions { var EtsiTs103097Data v_recv; var boolean v_ret := false; - /* FIXME To be reviewed alt { + alt { [] a_securedMessageWithCertificate(v_recv) { - var SignerIdentifier v_si; - - if (f_getMsgSignerInfo(v_recv, v_si) == true) { - if (ischosen(v_si.signerInfo.certificate)) { - p_cert := v_si.signerInfo.certificate; + var SignerIdentifier v_signerIdentifier; + if (f_getMsgSignerIdentifier(v_recv, v_signerIdentifier) == true) { + if (ischosen(v_signerIdentifier.certificate)) { + p_cert := v_signerIdentifier.certificate[0]; v_ret := true; } } } - }*/ // End of 'alt' statement + } // End of 'alt' statement return v_ret; } // End of function f_waitForCertificate @@ -2671,25 +2681,25 @@ module LibItsGeoNetworking_Functions { runs on ItsGeoNetworking return boolean { var EtsiTs103097Data v_recv; - var SignerIdentifier v_si; var boolean v_ret := false; - /* FIXME To be reviewed alt { + + alt { [] a_securedMessageWithCertificate(v_recv) { - if(f_getMsgSignerInfo(v_recv, v_si)) { - if(f_getCertificateSignerInfo(v_si.signerInfo.certificate, v_si)) { - if(v_si.type_ == e_certificate_digest_with_sha256) { - f_sendCertificateRequest(v_si.signerInfo.digest, p_CamPayload); - if(tc_ac.running) { - tc_ac.stop;tc_ac.start; - } - v_ret := true; + var SignerIdentifier v_signerIdentifier; + if (f_getMsgSignerIdentifier(v_recv, v_signerIdentifier) == true) { + if(ischosen(v_signerIdentifier.digest)) { + f_sendCertificateRequest(v_signerIdentifier.digest, p_CamPayload); + if(tc_ac.running) { + tc_ac.stop;tc_ac.start; } + v_ret := true; } } } - }*/ + } return v_ret; - } + } // End of function f_askForCertificateChain + /** * @desc Ask for the certificate chain and wait for GN message with security containing certificate chain as a signer info * @return the certificate chain used for sign received message @@ -2700,30 +2710,30 @@ module LibItsGeoNetworking_Functions { ) runs on ItsGeoNetworking return boolean { // Local variables var EtsiTs103097Data v_recv; - var SignerIdentifier v_si; + var SignerIdentifier v_signerIdentifier; var boolean v_ret := false; - /* FIXME To be reviewed alt { + alt { [] a_securedMessageWithCertificate(v_recv) { tc_ac.stop; - if(f_getMsgSignerInfo(v_recv, v_si)) { - if(f_getCertificateSignerInfo(v_si.signerInfo.certificate, v_si)) { - if(v_si.type_ == e_certificate_digest_with_sha256) { - f_sendCertificateRequest(v_si.signerInfo.digest, p_CamPayload); + + if (f_getMsgSignerIdentifier(v_recv, v_signerIdentifier) == true) { + if(ischosen(v_signerIdentifier.digest)) { + f_sendCertificateRequest(v_signerIdentifier.digest, p_CamPayload); + f_sendCertificateRequest(v_signerIdentifier.digest, p_CamPayload); tc_ac.start; repeat; } - } } } - [] a_securedMessageWithCertificateChain(v_recv) { + /* FIXME To be done [] a_securedMessageWithCertificateChain(v_recv) { tc_ac.stop; - if(f_getMsgSignerInfo(v_recv, v_si) == true) { - p_chain := v_si.signerInfo.certificates; - v_ret := true; + if (f_getMsgSignerIdentifier(v_recv, v_signerIdentifier) == true) { // FIXME How to receive chain of certificate + p_chain := v_signerIdentifier.certificate; + v_ret := true; } - } - }*/ // End of 'alt' statement + }*/ + } // End of 'alt' statement return v_ret; } // End of function f_askAndWaitForCertificateChain diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index a9680538..9f25b986 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -784,6 +784,24 @@ module LibItsSecurity_Templates { requestedCertificate := omit } // End of template mw_ieee1609Dot2_headerInfo + /** + * @desc Basic receive HeaderInfo template with ETSI ITS restrction + */ + template (present) HeaderInfo mw_ieee1609Dot2_headerInfo_request_certificate( + template (present) Psid p_psid := ?, + template (present) Certificate p_requestedCertificate := ? + ) modifies mw_ieee1609Dot2_headerInfo := { + psid := p_psid, + generationTime := *, + expiryTime := *, + generationLocation := *, + p2pcdLearningRequest := omit, + missingCrlIdentifier := omit, + encryptionKey := omit, + inlineP2pcdRequest := omit, + requestedCertificate := p_requestedCertificate + } // End of template mw_ieee1609Dot2_headerInfo + /** * @desc CAM specific send HeaderInfo template with ETSI ITS restrction * @@ -857,13 +875,9 @@ module LibItsSecurity_Templates { */ template (omit) HeaderInfo m_headerInfo_gn( in template (value) Psid p_psid := c_its_aid_GN, - in template (value) Time64 p_generationTime, - in template (value) Time64 p_expiryTime, - in template (omit) ThreeDLocation p_generationLocation := omit + in template (value) Time64 p_generationTime ) modifies m_ieee1609Dot2_headerInfo := { - generationTime := p_generationTime, - expiryTime := p_expiryTime, - generationLocation := p_generationLocation + generationTime := p_generationTime } // End of template m_headerInfo_gn /** @@ -872,13 +886,14 @@ module LibItsSecurity_Templates { */ template (present) HeaderInfo mw_headerInfo_gn( template (present) Psid p_psid := c_its_aid_GN, - template (present) Time64 p_generationTime := ?, - template (present) Time64 p_expiryTime := ?, - template ThreeDLocation p_generationLocation := omit + template (present) Time64 p_generationTime := ? ) modifies mw_ieee1609Dot2_headerInfo := { - generationTime := p_generationTime, - expiryTime := p_expiryTime, - generationLocation := p_generationLocation + generationTime := p_generationTime, + expiryTime := *, + generationLocation := *, + encryptionKey := *, + inlineP2pcdRequest := *, + requestedCertificate := * } // End of template mw_headerInfo_gn } // End of group headerFields @@ -1224,7 +1239,7 @@ module LibItsSecurity_Templates { in template (value) CertificateId p_id, in template (value) SequenceOfPsidSsp p_appPermissions, in template (value) VerificationKeyIndicator p_verifyKeyIndicator, - in template (omit) ValidityPeriod p_validityPeriod := omit, + in template (value) ValidityPeriod p_validityPeriod, in template (omit) GeographicRegion p_region := omit, in template (omit) SubjectAssurance p_assuranceLevel := omit, in template (omit) PublicEncryptionKey p_encryptionKey := omit @@ -1251,7 +1266,7 @@ module LibItsSecurity_Templates { template (present) CertificateId p_id := ?, template (present) SequenceOfPsidSsp p_appPermissions := ?, template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, - template ValidityPeriod p_validityPeriod := *, + template (present) ValidityPeriod p_validityPeriod := ?, template GeographicRegion p_region := *, template SubjectAssurance p_assuranceLevel := *, template PublicEncryptionKey p_encryptionKey := * @@ -1278,7 +1293,7 @@ module LibItsSecurity_Templates { in template (value) CertificateId p_id, in template (value) SequenceOfPsidSsp p_appPermissions, in template (value) VerificationKeyIndicator p_verifyKeyIndicator, - in template (omit) ValidityPeriod p_validityPeriod := omit, + in template (value) ValidityPeriod p_validityPeriod, in template (omit) GeographicRegion p_region := omit, in template (omit) SubjectAssurance p_assuranceLevel := omit, in template (omit) PublicEncryptionKey p_encryptionKey := omit @@ -1305,7 +1320,7 @@ module LibItsSecurity_Templates { template (present) CertificateId p_id := ?, template (present) SequenceOfPsidSsp p_appPermissions := ?, template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, - template ValidityPeriod p_validityPeriod := *, + template (present) ValidityPeriod p_validityPeriod := ?, template GeographicRegion p_region := *, template SubjectAssurance p_assuranceLevel := *, template PublicEncryptionKey p_encryptionKey := * @@ -1357,7 +1372,7 @@ module LibItsSecurity_Templates { template ToBeSignedCertificate mw_toBeSignedCertificate_at( template (present) SequenceOfPsidSsp p_appPermissions := ?, template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, - template ValidityPeriod p_validityPeriod := ?, + template (present) ValidityPeriod p_validityPeriod := ?, template GeographicRegion p_region := *, template SubjectAssurance p_assuranceLevel := *, template PublicEncryptionKey p_encryptionKey := * -- GitLab From 755c231a1f94157e9c34f5119b956642c62228d3 Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 23 Feb 2018 10:08:00 +0000 Subject: [PATCH 068/320] STF538: Start Certificate TPs implementation --- ttcn/Security/LibItsSecurity_Functions.ttcn | 4 +- ttcn/Security/LibItsSecurity_Pics.ttcn | 44 ++++++++++++++------- ttcn/Security/LibItsSecurity_Templates.ttcn | 36 +++++++++-------- 3 files changed, 51 insertions(+), 33 deletions(-) diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 480ab78f..24eed304 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -264,9 +264,9 @@ module LibItsSecurity_Functions { ) return HashedId8 { var octetstring v_hash; - if (PICS_HASH_ALGORITHM == sha256) { + if (PICS_SEC_SHA256) { v_hash := f_calculateDigestSha256FromCertificate(p_cert); - } if (PICS_HASH_ALGORITHM == sha384) { + } if (PICS_SEC_SHA384) { v_hash := f_calculateDigestSha384FromCertificate(p_cert); } diff --git a/ttcn/Security/LibItsSecurity_Pics.ttcn b/ttcn/Security/LibItsSecurity_Pics.ttcn index 4e4f93eb..a9f9851e 100644 --- a/ttcn/Security/LibItsSecurity_Pics.ttcn +++ b/ttcn/Security/LibItsSecurity_Pics.ttcn @@ -19,14 +19,30 @@ module LibItsSecurity_Pics { // LibItsSecurity import from LibItsSecurity_TypesAndValues all; - modulepar HashAlgorithm PICS_HASH_ALGORITHM := sha256; + /** + * Does the IUT support SHA-256 digest + */ + modulepar boolean PICS_SEC_SHA256 := true; + + /** + * Does the IUT support SHA-384 digest + */ + modulepar boolean PICS_SEC_SHA384 := true; - modulepar SignAlgorithm PICS_SIGN_ALGORITHM := e_nistp_256; + /** + * Does the IUT support NIST P256 algorithm + */ + modulepar boolean PICS_SEC_NIST_P256 := true; + + /** + * Does the IUT support Brainpool P256r1 algorithm + */ + modulepar boolean PICS_SEC_BRAINPOOL_P256R1 := false; /** - * Is the IUT support Brainpool algorithm + * Does the IUT support Brainpool P384r1 algorithm */ - modulepar boolean PICS_BRAINPOOL_SUPPORT := false; + modulepar boolean PICS_SEC_BRAINPOOL_P384R1 := false; /** * Is the IUT able to distribute AT certificates @@ -46,32 +62,32 @@ module LibItsSecurity_Pics { /** * Is the IUT support circular region geographical restriction */ - modulepar boolean PICS_USE_CIRCULAR_REGION := true; + modulepar boolean PICS_SEC_CIRCULAR_REGION := true; /** - * Is the IUT support rectangular region geographical restriction + * Does the IUT support rectangular region geographical restriction */ - modulepar boolean PICS_USE_RECTANGULAR_REGION := true; + modulepar boolean PICS_SEC_RECTANGULAR_REGION := true; /** - * Is the IUT support polygonal region geographical restriction + * Does the IUT support polygonal region geographical restriction */ - modulepar boolean PICS_USE_POLYGONAL_REGION := true; + modulepar boolean PICS_SEC_POLYGONAL_REGION := true; /** * Is the IUT support identified region geographical restriction */ - modulepar boolean PICS_USE_IDENTIFIED_REGION := true; + modulepar boolean PICS_SEC_IDENTIFIED_REGION := true; /** - * Is the IUT support identified region/UN geographical restriction + * Does the IUT support identified region/UN geographical restriction */ - modulepar boolean PICS_USE_UN_STATS_REGION_DICTIONARY := true; + modulepar boolean PICS_SEC_UN_STATS_REGION_DICTIONARY := true; /** - * Is the IUT support identified region/ISO31661 geographical restriction + * Does the IUT support identified region/ISO31661 geographical restriction */ - modulepar boolean PICS_USE_ISO31661_REGION_DICTIONARY := true; + modulepar boolean PICS_ISO31661_REGION_DICTIONARY := true; /** * Does the IUT support ITS-AID for Generic profile? diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index 9f25b986..cf27d3d5 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -326,9 +326,9 @@ module LibItsSecurity_Templates { * @param p_southeast Lower rigth corner * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion */ - template (value) GeographicRegion m_geographicRegion_rectangle( - in template (value) TwoDLocation p_northwest, - in template (value) TwoDLocation p_southeast + template (value) GeographicRegion m_geographicRegion_rectangular( + in template (value) TwoDLocation p_northwest, + in template (value) TwoDLocation p_southeast ) := { rectangularRegion := { { @@ -336,7 +336,7 @@ module LibItsSecurity_Templates { southEast := p_southeast } } - } // End of template m_geographicRegion_rectangle + } // End of template m_geographicRegion_rectangular /** * @desc Send template polygonial geographic region @@ -496,16 +496,8 @@ module LibItsSecurity_Templates { * @param p_southeast Lower rigth corner * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion */ - template (present) GeographicRegion mw_geographicRegion_rectangular( - in template (present) TwoDLocation p_northwest := ?, - in template (present) TwoDLocation p_southeast := ? - ) := { - rectangularRegion := { - { - northWest := p_northwest, - southEast := p_southeast - } - } + template (present) GeographicRegion mw_geographicRegion_rectangular := { + rectangularRegion := ? } // End of template mw_geographicRegion_rectangular /** @@ -1332,13 +1324,23 @@ module LibItsSecurity_Templates { region := p_region, assuranceLevel := p_assuranceLevel, appPermissions := p_appPermissions, - certIssuePermissions := *, - certRequestPermissions := *, - canRequestRollover := *, + certIssuePermissions := omit, + certRequestPermissions := omit, + canRequestRollover := omit, encryptionKey := p_encryptionKey, verifyKeyIndicator := p_verifyKeyIndicator } // End of template mw_toBeSignedCertificate_aa + template (present) CertificateId mw_certificateId_name( + template (present) charstring p_name := ? + ) := { + name := p_name + } // End of template mw_certificateId_name + + template (present) CertificateId mw_certificateId_none := { + none_ := NULL + } // End of template mw_certificateId_none + /** * @desc Send template for ToBeSignedCertificate with AT restrictions * @see ETSI TS 103 097 V1.3.1 Clause 7.2.1 Authorization tickets -- GitLab From ca69dcbb0cc346cadbcdb2ec1b8e068356cc3b8d Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 26 Feb 2018 14:19:07 +0000 Subject: [PATCH 069/320] STF538: Certificate TPs implementation --- .../LibItsGeoNetworking_Functions.ttcn | 94 ++----------------- ttcn/Security/LibItsSecurity_Functions.ttcn | 4 +- ttcn/Security/LibItsSecurity_Templates.ttcn | 36 +++++-- ttcn/Security/LibItsSecurity_TestSystem.ttcn | 4 +- ttcn/SremSsem/LibItsSremSsem_Templates.ttcn | 8 +- 5 files changed, 45 insertions(+), 101 deletions(-) diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn index a90c20f4..4488609f 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn @@ -2581,24 +2581,6 @@ module LibItsGeoNetworking_Functions { } } // End of altstep a_securedMessageWithCertificate - /** - * @desc Receive GN message with security containing certificate chain as a signer info - * @param p_cert returns the certificate used for sign received message - */ - /* FIXME To be reviewed altstep a_securedMessageWithCertificateChain( - out EtsiTs103097Data p_received - ) runs on ItsGeoNetworking { - [] a_securedMessage ( - mw_securedMessage( - superset( - mw_header_field_signer_info_certificate_chain - )), - p_received - ) { - // Nothing to do - } - }*/ // End of altstep a_securedMessageWithCertificateChain - /** * @desc Receive GN message with security containing digest as a signer info * @param p_cert returns the certificate used for sign received message @@ -2641,8 +2623,8 @@ module LibItsGeoNetworking_Functions { var SignerIdentifier v_signerIdentifier; if (f_getMsgSignerIdentifier(v_recv, v_signerIdentifier) == true) { if (ischosen(v_signerIdentifier.certificate)) { - p_cert := v_signerIdentifier.certificate[0]; - v_ret := true; + p_cert := v_signerIdentifier.certificate[0]; + v_ret := true; } } } @@ -2651,28 +2633,6 @@ module LibItsGeoNetworking_Functions { return v_ret; } // End of function f_waitForCertificate - /** - * @desc Wait for GN message with security containing certificate chain as a signer info - * @return the certificate used for sign received message - */ - function f_waitForCertificateChain (out SequenceOfCertificate p_chain) - runs on ItsGeoNetworking - return boolean { - var EtsiTs103097Data v_recv; - var boolean v_ret := false; - - /* FIXME To be reviewed alt { - [] a_securedMessageWithCertificateChain(v_recv) { - var SignerIdentifier v_si; - if(f_getMsgSignerInfo(v_recv, v_si)) { - p_chain := v_si.signerInfo.certificates; - v_ret := true; - } - } - }*/ - return v_ret; - } - /** * @desc Ask for the certificate chain and wait for GN message with security containing certificate chain as a signer info * @return the certificate chain used for sign received message @@ -2686,11 +2646,12 @@ module LibItsGeoNetworking_Functions { alt { [] a_securedMessageWithCertificate(v_recv) { var SignerIdentifier v_signerIdentifier; - if (f_getMsgSignerIdentifier(v_recv, v_signerIdentifier) == true) { + if (f_getMsgSignerIdentifier(v_recv, v_signerIdentifier) == true) { // Get AT certificate if(ischosen(v_signerIdentifier.digest)) { - f_sendCertificateRequest(v_signerIdentifier.digest, p_CamPayload); + f_sendCertificateRequest(v_signerIdentifier.digest, p_CamPayload); // Request issuer if(tc_ac.running) { - tc_ac.stop;tc_ac.start; + tc_ac.stop; + tc_ac.start; } v_ret := true; } @@ -2712,56 +2673,21 @@ module LibItsGeoNetworking_Functions { var EtsiTs103097Data v_recv; var SignerIdentifier v_signerIdentifier; var boolean v_ret := false; - + + f_askForCertificateChain(p_CamPayload); // Get AT certificate and request for the issuer alt { - [] a_securedMessageWithCertificate(v_recv) { + [] a_securedMessageWithCertificate(v_recv) { // Get AA certificate tc_ac.stop; if (f_getMsgSignerIdentifier(v_recv, v_signerIdentifier) == true) { - if(ischosen(v_signerIdentifier.digest)) { - f_sendCertificateRequest(v_signerIdentifier.digest, p_CamPayload); - f_sendCertificateRequest(v_signerIdentifier.digest, p_CamPayload); - tc_ac.start; - repeat; - } + p_chain := v_signerIdentifier.certificate; } } - /* FIXME To be done [] a_securedMessageWithCertificateChain(v_recv) { - tc_ac.stop; - if (f_getMsgSignerIdentifier(v_recv, v_signerIdentifier) == true) { // FIXME How to receive chain of certificate - p_chain := v_signerIdentifier.certificate; - v_ret := true; - } - }*/ } // End of 'alt' statement return v_ret; } // End of function f_askAndWaitForCertificateChain - /** - * @desc Wait for GN message with security containing digest as a signer info - * @return the digest of the certificate been used to sign received message - */ - function f_waitForDigest( - out HashedId8 p_digest - ) runs on ItsGeoNetworking return boolean { - // Local variables - var EtsiTs103097Data v_recv; - var boolean v_ret := false; - - /* FIXME To be reviewed alt { - [] a_securedMessageWithDigest(v_recv) { - var SignerIdentifier v_si; - if(f_getMsgSignerInfo(v_recv, v_si)) { - p_digest := v_si.signerInfo.digest; - v_ret := true; - } - } - }*/ // End of 'alt' statement - - return v_ret; - } // End of function f_waitForDigest - /** * @desc Send a CAM message with a certificate and wait the certificate chain request message * @remark This function is used only for testing against another ATS diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 24eed304..15196be5 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -1452,8 +1452,8 @@ module LibItsSecurity_Functions { */ function f_unloadCertificates() runs on ItsSecurityBaseComponent return boolean { // Reset security component variables - vc_signingPrivateKey := '0000000000000000000000000000000000000000000000000000000000000000'O; - vc_encryptPrivateKey := '0000000000000000000000000000000000000000000000000000000000000000'O; + vc_signingPrivateKey := ''O; + vc_encryptPrivateKey := ''O; // Clear certificates memory cache return fx_unloadCertificates(); } // End of function f_unloadCertificates diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index cf27d3d5..a7e3b2f2 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -1204,7 +1204,7 @@ module LibItsSecurity_Templates { template (present) SequenceOfPsidGroupPermissions p_certIssuePermissions := ?, template (present) SequenceOfPsidGroupPermissions p_certRequestPermissions := ?, template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, - template ValidityPeriod p_validityPeriod := *, + template (present) ValidityPeriod p_validityPeriod := ?, template GeographicRegion p_region := *, template SubjectAssurance p_assuranceLevel := *, template PublicEncryptionKey p_encryptionKey := * @@ -1215,10 +1215,10 @@ module LibItsSecurity_Templates { validityPeriod := p_validityPeriod, region := p_region, assuranceLevel := p_assuranceLevel, - appPermissions := *, + appPermissions := omit, certIssuePermissions := p_certIssuePermissions, certRequestPermissions := p_certRequestPermissions, - canRequestRollover := *, + canRequestRollover := omit, encryptionKey := p_encryptionKey, verifyKeyIndicator := p_verifyKeyIndicator } // End of template mw_toBeSignedCertificate @@ -1270,9 +1270,9 @@ module LibItsSecurity_Templates { region := p_region, assuranceLevel := p_assuranceLevel, appPermissions := p_appPermissions, - certIssuePermissions := *, - certRequestPermissions := *, - canRequestRollover := *, + certIssuePermissions := omit, + certRequestPermissions := omit, + canRequestRollover := omit, encryptionKey := p_encryptionKey, verifyKeyIndicator := p_verifyKeyIndicator } // End of template mw_toBeSignedCertificate_ea @@ -1386,9 +1386,9 @@ module LibItsSecurity_Templates { region := p_region, assuranceLevel := p_assuranceLevel, appPermissions := p_appPermissions, - certIssuePermissions := *, - certRequestPermissions := *, - canRequestRollover := *, + certIssuePermissions := omit, + certRequestPermissions := omit, + canRequestRollover := omit, encryptionKey := p_encryptionKey, verifyKeyIndicator := p_verifyKeyIndicator } // End of template mw_toBeSignedCertificate_at @@ -1513,12 +1513,30 @@ module LibItsSecurity_Templates { eeType := p_eeType } // End of template m_psidGroupPermissions + template (present) PsidGroupPermissions mw_psidGroupPermissions( + template (present) SubjectPermissions p_subjectPermissions := ?, + integer p_minChainLength := 1, + integer p_chainLengthRange := 0, + template (present) EndEntityType p_eeType := ? + ) := { + subjectPermissions := p_subjectPermissions, + minChainLength := p_minChainLength, + chainLengthRange := p_chainLengthRange, + eeType := p_eeType + } // End of template mw_psidGroupPermissions + template (value) SubjectPermissions m_subjectPermissions_explicit( in template (value) SequenceOfPsidSspRange p_certIssuePermissions ) := { explicit := p_certIssuePermissions } // End of template m_subjectPermissions_explicit + template (present) SubjectPermissions mw_subjectPermissions_explicit( + template (present) SequenceOfPsidSspRange p_certIssuePermissions := ? + ) := { + explicit := p_certIssuePermissions + } // End of template mw_subjectPermissions_explicit + template (value) SubjectPermissions m_subjectPermissions_all := { all_ := NULL } // End of template m_subjectPermissions_all diff --git a/ttcn/Security/LibItsSecurity_TestSystem.ttcn b/ttcn/Security/LibItsSecurity_TestSystem.ttcn index 20a4776b..db5ac95c 100644 --- a/ttcn/Security/LibItsSecurity_TestSystem.ttcn +++ b/ttcn/Security/LibItsSecurity_TestSystem.ttcn @@ -37,8 +37,8 @@ module LibItsSecurity_TestSystem { var charstring vc_hashedId8ToBeUsed := PX_IUT_DEFAULT_CERTIFICATE; /** Digest value of the AT certificate to be used by the IUT. Default: CERT_IUT_A_AT */ // Private keys - var Oct32 vc_signingPrivateKey; - var Oct32 vc_encryptPrivateKey; + var octetstring vc_signingPrivateKey; + var octetstring vc_encryptPrivateKey; // Generation position. See Draft ETSI TS 103 097 V1.1.14 Clause 7.2 Security profiles for DENMs var ThreeDLocation vc_location; diff --git a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn index fad8e875..7914f206 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn @@ -133,7 +133,7 @@ module LibItsSremSsem_Templates { * @param p_ssemMsg The expected SSEM Message */ template (present) SsemInd mw_ssemInd( - template (present) SSEM p_ssemMsg + template (present) SSEM p_ssemMsg := ? ) := { msgIn := p_ssemMsg, gnNextHeader := *, @@ -540,7 +540,7 @@ module LibItsSremSsem_Templates { * @desc Receive template for SSEM Message */ template (present) SignalStatusMessage mw_defaultSsem( - template MsgCount p_sequenceNumber := * + template (present) MsgCount p_sequenceNumber := ? ) := { timeStamp := *, second := ?, @@ -550,12 +550,12 @@ module LibItsSremSsem_Templates { } template (present) SignalStatusMessage mw_ssemWellFormatted( - template MsgCount p_sequenceNumber := * + template (present) MsgCount p_sequenceNumber := ? ) modifies mw_defaultSsem := { } template (present) SignalStatusMessage mw_ssem_with_region_id( - template MsgCount p_sequenceNumber := *, + template (present) MsgCount p_sequenceNumber := ?, template (present) SignalStatusMessage.regional p_regional := ? ) modifies mw_defaultSsem := { regional := p_regional -- GitLab From 19acefd5011f7a39ffcc417a97a1602f9e911dc5 Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 26 Feb 2018 16:14:49 +0000 Subject: [PATCH 070/320] STF538: Certificate TPs implementation --- ttcn/Security/LibItsSecurity_Templates.ttcn | 34 +++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index a7e3b2f2..2cf6c04d 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -575,6 +575,20 @@ module LibItsSecurity_Templates { content := { signedData := p_signedData } } // End of template mw_secured_data_signed + template (value) EtsiTs103097Data m_etsiTs103097Data_encrypted( + in template (value) EncryptedData p_encryptedData + ) := { + protocolVersion := c_protocol_version, + content := { encryptedData := p_encryptedData } + } // End of template m_etsiTs103097Data_encrypted + + template (present) EtsiTs103097Data mw_etsiTs103097Data_encrypted( + template (present) EncryptedData p_encryptedData := ? + ) := { + protocolVersion := c_protocol_version, + content := { encryptedData := p_encryptedDat } + } // End of template mw_etsiTs103097Data_encrypted + /** * @desc Generic send template for EtsiTs103097Data message */ @@ -668,6 +682,26 @@ module LibItsSecurity_Templates { } // End of group signedData + group encryptedData { + + template (value) EncryptedData m_encryptedData( + in template (value) SequenceOfRecipientInfo p_recipients, + in template (value) SymmetricCiphertext p_ciphertex + ) := { + recipients := p_recipients, + ciphertext := p_ciphertex + } // End of template m_encryptedData + + template (present) EncryptedData mw_encryptedData( + template (present) SequenceOfRecipientInfo p_recipients := ?, + template (present) SymmetricCiphertext p_ciphertex := ? + ) := { + recipients := p_recipients, + ciphertext := p_ciphertex + } // End of template mw_encryptedData + + } // End of group encryptedData + /** * @desc Send/Receive templates for Payload * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload -- GitLab From c30f78a21afe952501eb7ca84e01c7591f9a40ce Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 27 Feb 2018 17:15:37 +0000 Subject: [PATCH 071/320] STF538: Start Encryption TPs implementation --- ttcn/Security/LibItsSecurity_Pics.ttcn | 5 + ttcn/Security/LibItsSecurity_Templates.ttcn | 178 +++++++++++++++++++- 2 files changed, 180 insertions(+), 3 deletions(-) diff --git a/ttcn/Security/LibItsSecurity_Pics.ttcn b/ttcn/Security/LibItsSecurity_Pics.ttcn index a9f9851e..6804e2cb 100644 --- a/ttcn/Security/LibItsSecurity_Pics.ttcn +++ b/ttcn/Security/LibItsSecurity_Pics.ttcn @@ -94,4 +94,9 @@ module LibItsSecurity_Pics { */ modulepar boolean PICS_SEC_ITS_AID_OTHER := true; + /** + * Does the IUT support encryption data? + */ + modulepar boolean PICS_SEC_ENCRYPTION_SUPPORT := true; + } // End of module LibItsSecurity_Pics \ No newline at end of file diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index 2cf6c04d..308af5ae 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -586,7 +586,7 @@ module LibItsSecurity_Templates { template (present) EncryptedData p_encryptedData := ? ) := { protocolVersion := c_protocol_version, - content := { encryptedData := p_encryptedDat } + content := { encryptedData := p_encryptedData } } // End of template mw_etsiTs103097Data_encrypted /** @@ -682,6 +682,10 @@ module LibItsSecurity_Templates { } // End of group signedData + /** + * @desc Send templates for ToBeSignedData header + * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.3 EncryptedData + */ group encryptedData { template (value) EncryptedData m_encryptedData( @@ -700,6 +704,130 @@ module LibItsSecurity_Templates { ciphertext := p_ciphertex } // End of template mw_encryptedData + template (value) RecipientInfo m_recipientInfo_pskRecipInfo( + in template (value) PreSharedKeyRecipientInfo p_pskRecipInfo + ) := { + pskRecipInfo := p_pskRecipInfo + } // End of template m_recipientInfo_pskRecipInfo + + template (value) RecipientInfo m_recipientInfo_symmRecipInfo( + in template (value) SymmRecipientInfo p_symmRecipInfo + ) := { + symmRecipInfo := p_symmRecipInfo + } // End of template m_recipientInfo_symmRecipInfo + + template (value) RecipientInfo m_recipientInfo_certRecipInfo( + in template (value) PKRecipientInfo p_certRecipInfo + ) := { + certRecipInfo := p_certRecipInfo + } // End of template m_recipientInfo_certRecipInfo + + template (present) RecipientInfo mw_recipientInfo_certRecipInfo( + template (present) PKRecipientInfo p_certRecipInfo := ? + ) := { + certRecipInfo := p_certRecipInfo + } // End of template mw_recipientInfo_certRecipInfo + + template (value) RecipientInfo m_recipientInfo_signedDataRecipInfo( + in template (value) PKRecipientInfo p_signedDataRecipInfo + ) := { + signedDataRecipInfo := p_signedDataRecipInfo + } // End of template m_recipientInfo_signedDataRecipInfo + + template (value) RecipientInfo m_recipientInfo_rekRecipInfo( + in template (value) PKRecipientInfo p_rekRecipInfo + ) := { + rekRecipInfo := p_rekRecipInfo + } // End of template m_recipientInfo_rekRecipInfo + + template (value) PKRecipientInfo m_pKRecipientInfo( + in template (value) HashedId8 p_recipientId, + in template (value) EncryptedDataEncryptionKey p_encKey + ) := { + recipientId := p_recipientId, + encKey := p_encKey + } // End of template m_pKRecipientInfo + + template (present) PKRecipientInfo mw_pKRecipientInfo( + template (present) HashedId8 p_recipientId := ?, + template (present) EncryptedDataEncryptionKey p_encKey := ? + ) := { + recipientId := p_recipientId, + encKey := p_encKey + } // End of template mw_pKRecipientInfo + + template (value) EciesP256EncryptedKey m_evciesP256EncryptedKey( + in template (value) EccP256CurvePoint p_v, + in template (value) Oct16 p_c, + in template (value) Oct16 p_t + ) :={ + v := p_v, + c := p_c, + t := p_t + } // End of template m_evciesP256EncryptedKey + + template (present) EciesP256EncryptedKey mw_evciesP256EncryptedKey( + template (present) EccP256CurvePoint p_v := ?, + template (present) Oct16 p_c := ?, + template (present) Oct16 p_t := ? + ) :={ + v := p_v, + c := p_c, + t := p_t + } // End of template mw_evciesP256EncryptedKey + + template (value) EncryptedDataEncryptionKey m_encryptedDataEncryptionKey_eciesNistP256( + in template (value) EciesP256EncryptedKey p_eciesNistP256 + ) := { + eciesNistP256 := p_eciesNistP256 + } // End of template m_encryptedDataEncryptionKey_eciesNistP256 + + template (present) EncryptedDataEncryptionKey mw_encryptedDataEncryptionKey_eciesNistP256( + template (present) EciesP256EncryptedKey p_eciesNistP256 := ? + ) := { + eciesNistP256 := p_eciesNistP256 + } // End of template mw_encryptedDataEncryptionKey_eciesNistP256 + + template (value) EncryptedDataEncryptionKey m_encryptedDataEncryptionKey_eciesBrainpoolP256r1( + in template (value) EciesP256EncryptedKey p_eciesBrainpoolP256r1 + ) := { + eciesBrainpoolP256r1 := p_eciesBrainpoolP256r1 + } // End of template m_encryptedDataEncryptionKey_eciesBrainpoolP256r1 + + template (present) EncryptedDataEncryptionKey mw_encryptedDataEncryptionKey_eciesBrainpoolP256r1( + template (present) EciesP256EncryptedKey p_eciesBrainpoolP256r1 := ? + ) := { + eciesBrainpoolP256r1 := p_eciesBrainpoolP256r1 + } // End of template mw_encryptedDataEncryptionKey_eciesBrainpoolP256r1 + + template (value) SymmetricCiphertext m_SymmetricCiphertext_aes128ccm( + in template (value) AesCcmCiphertext p_aes128ccm + ) := { + aes128ccm := p_aes128ccm + } // End of template m_SymmetricCiphertext_aes128ccm + + template (present) SymmetricCiphertext mw_SymmetricCiphertext_aes128ccm( + template (present) AesCcmCiphertext p_aes128ccm := ? + ) := { + aes128ccm := p_aes128ccm + } // End of template mw_SymmetricCiphertext_aes128ccm + + template (value) AesCcmCiphertext m_aesCcmCiphertext( + in template (value) Oct12 p_nonce, + in template (value) Opaque p_ccmCiphertext + ) := { + nonce := p_nonce, + ccmCiphertext := p_ccmCiphertext + } // End of template m_aesCcmCiphertext + + template (present) AesCcmCiphertext mw_aesCcmCiphertext( + template (present) Oct12 p_nonce := ?, + template (present) Opaque p_ccmCiphertext := ? + ) := { + nonce := p_nonce, + ccmCiphertext := p_ccmCiphertext + } // End of template mw_aesCcmCiphertext + } // End of group encryptedData /** @@ -1429,7 +1557,7 @@ module LibItsSecurity_Templates { } // End of group toBeSignedCertificate - group keys { + group verificationKeys { template (value) VerificationKeyIndicator m_verificationKeyIndicator_verificationKey( in template (value) PublicVerificationKey p_verificationKey @@ -1491,7 +1619,51 @@ module LibItsSecurity_Templates { ecdsaBrainpoolP384r1 := p_ecdsaBrainpoolP384r1 } // End of template mw_publicVerificationKey_ecdsaBrainpoolP384 - } // End of group keys + } // End of group verificationKeys + + group encryptionKey { + + template (value) PublicEncryptionKey m_encryptionKey( + in template (value) SymmAlgorithm p_supportedSymmAlg, + in template (value) BasePublicEncryptionKey p_publicKey + ) := { + supportedSymmAlg := p_supportedSymmAlg, + publicKey := p_publicKey + } // End of template m_encryptionKey + + template (present) PublicEncryptionKey mw_encryptionKey( + template (present) SymmAlgorithm p_supportedSymmAlg := aes128Ccm, + template (present) BasePublicEncryptionKey p_publicKey := ? + ) := { + supportedSymmAlg := p_supportedSymmAlg, + publicKey := p_publicKey + } // End of template mw_encryptionKey + + template (value) BasePublicEncryptionKey m_publicEncryptionKey_ecdsaNistP256( + in template (value) EccP256CurvePoint p_eciesNistP256 + ) := { + eciesNistP256 := p_eciesNistP256 + } // End of template m_publicEncryptionKey_ecdsaNistP256 + + template (present) BasePublicEncryptionKey mw_publicEncryptionKey_ecdsaNistP256( + template (present) EccP256CurvePoint p_eciesNistP256 := ? + ) := { + eciesNistP256 := p_eciesNistP256 + } // End of template mw_publicEncryptionKey_ecdsaNistP256 + + template (value) BasePublicEncryptionKey m_publicEncryptionKey_eciesBrainpoolP256r1( + in template (value) EccP256CurvePoint p_eciesBrainpoolP256r1 + ) := { + eciesBrainpoolP256r1 := p_eciesBrainpoolP256r1 + } // End of template m_publicEncryptionKey_eciesBrainpoolP256r1 + + template (present) BasePublicEncryptionKey mw_publicEncryptionKey_eciesBrainpoolP256r1( + template (present) EccP256CurvePoint p_eciesBrainpoolP256r1 := ? + ) := { + eciesBrainpoolP256r1 := p_eciesBrainpoolP256r1 + } // End of template mw_publicEncryptionKey_eciesBrainpoolP256r1 + + } // End of group encryptionKey group appPermissions { -- GitLab From ac051b744b2d49d70e631b807e8b79f26c172958 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 28 Feb 2018 14:52:46 +0000 Subject: [PATCH 072/320] STF538: Start Encryption TPs implementation --- ttcn/Security/LibItsSecurity_Functions.ttcn | 31 +++++++++++++-------- ttcn/Security/LibItsSecurity_Pics.ttcn | 8 +++--- ttcn/Security/LibItsSecurity_Templates.ttcn | 27 +++++++++--------- 3 files changed, 37 insertions(+), 29 deletions(-) diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 15196be5..d9aebf1f 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -63,7 +63,7 @@ module LibItsSecurity_Functions { function f_signWithEcdsaNistp256WithSha256( in octetstring p_toBeSignedSecuredMessage, in Oct32 p_privateKey - ) runs on ItsSecurityBaseComponent return octetstring { + ) return octetstring { return fx_signWithEcdsaNistp256WithSha256( p_toBeSignedSecuredMessage, p_privateKey @@ -79,7 +79,7 @@ module LibItsSecurity_Functions { function f_signWithEcdsaBrainpoolp256WithSha256( in octetstring p_toBeSignedSecuredMessage, in Oct32 p_privateKey - ) runs on ItsSecurityBaseComponent return octetstring { + ) return octetstring { return fx_signWithEcdsaBrainpoolp256WithSha256( p_toBeSignedSecuredMessage, p_privateKey @@ -95,7 +95,7 @@ module LibItsSecurity_Functions { function f_signWithEcdsaBrainpoolp384WithSha384( in octetstring p_toBeSignedSecuredMessage, in Oct48 p_privateKey - ) runs on ItsSecurityBaseComponent return octetstring { + ) return octetstring { return fx_signWithEcdsaBrainpoolp384WithSha384( p_toBeSignedSecuredMessage, p_privateKey @@ -109,12 +109,24 @@ module LibItsSecurity_Functions { * @return The HashedId8 value * @verdict */ - function f_HashedId8FromSha256( + function f_HashedId8FromSha256( in Oct32 p_hash ) return HashedId8 { return substr(p_hash, lengthof(p_hash) - 8, 8); } // End of function f_HashedId8FromSha256 + /** + * @desc Compute the HashedId8 value from the hash value + * @param p_hash The hash value + * @return The HashedId8 value + * @verdict + */ + function f_HashedId8FromSha384( + in Oct48 p_hash + ) return HashedId8 { + return substr(p_hash, lengthof(p_hash) - 8, 8); + } // End of function f_HashedId8FromSha384 + /** * @desc Compute the HashedId3 value from the HashedId8 value * @param p_hashp_hashedId8 The HashedId8 value @@ -439,7 +451,7 @@ module LibItsSecurity_Functions { in template (value) ToBeSignedData p_payloadField, in template (value) HeaderInfo p_mandatoryHeaders, in template (omit) HeaderInfo p_headerInfo := omit - ) runs on ItsSecurityBaseComponent return boolean { + ) return boolean { // Local variables var octetstring v_secPayload, v_signature; @@ -1421,14 +1433,11 @@ module LibItsSecurity_Functions { function f_loadCertificates( in charstring p_configId ) runs on ItsSecurityBaseComponent return boolean { -// FIXME (DF) UNUSED -// var boolean v_result; - // Setup certificates memory cache if (fx_loadCertificates(PX_CERTIFICATE_POOL_PATH, p_configId) == true) { // Setup security component variables - /*FIXME if(f_readCertificate(cc_taCert_A, vc_atCertificate)) { - if(f_readCertificate(oct2str(vc_atCertificate.issuer), vc_aaCertificate)) { + if(f_readCertificate(cc_taCert_A, vc_atCertificate)) { + if(f_readCertificate(vc_atCertificate.toBeSigned.id.name, vc_aaCertificate)) { if(f_readSigningKey(cc_taCert_A, vc_signingPrivateKey)) { f_readEncryptingKey(cc_taCert_A, vc_encryptPrivateKey); return true; @@ -1439,7 +1448,7 @@ module LibItsSecurity_Functions { } }else{ log("f_loadCertificates: Failed to load AT certificate for ", cc_taCert_A); - }*/ + } } else { log("f_loadCertificates: Failed to load certificates from ", PX_CERTIFICATE_POOL_PATH); } diff --git a/ttcn/Security/LibItsSecurity_Pics.ttcn b/ttcn/Security/LibItsSecurity_Pics.ttcn index 6804e2cb..007ec3f4 100644 --- a/ttcn/Security/LibItsSecurity_Pics.ttcn +++ b/ttcn/Security/LibItsSecurity_Pics.ttcn @@ -27,7 +27,7 @@ module LibItsSecurity_Pics { /** * Does the IUT support SHA-384 digest */ - modulepar boolean PICS_SEC_SHA384 := true; + modulepar boolean PICS_SEC_SHA384 := false; /** * Does the IUT support NIST P256 algorithm @@ -37,7 +37,7 @@ module LibItsSecurity_Pics { /** * Does the IUT support Brainpool P256r1 algorithm */ - modulepar boolean PICS_SEC_BRAINPOOL_P256R1 := false; + modulepar boolean PICS_SEC_BRAINPOOL_P256R1 := true; /** * Does the IUT support Brainpool P384r1 algorithm @@ -82,12 +82,12 @@ module LibItsSecurity_Pics { /** * Does the IUT support identified region/UN geographical restriction */ - modulepar boolean PICS_SEC_UN_STATS_REGION_DICTIONARY := true; + //TODO Remove modulepar boolean PICS_SEC_UN_STATS_REGION_DICTIONARY := true; /** * Does the IUT support identified region/ISO31661 geographical restriction */ - modulepar boolean PICS_ISO31661_REGION_DICTIONARY := true; + //TODO Remove modulepar boolean PICS_ISO31661_REGION_DICTIONARY := true; /** * Does the IUT support ITS-AID for Generic profile? diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index 308af5ae..99f06b13 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -554,6 +554,16 @@ module LibItsSecurity_Templates { content := p_content } // End of template m_etsiTs103097Data + /** + * @desc Generic receive template for EtsiTs103097Data message + */ + template (present) EtsiTs103097Data mw_etsiTs103097Data( + template (present) Ieee1609Dot2Content p_content := ? + ) := { + protocolVersion := c_protocol_version, + content := p_content + } // End of template mw_etsiTs103097Data + template (value) EtsiTs103097Data m_etsiTs103097Data_unsecured( in template (value) Opaque p_unsecuredData ) := { @@ -589,16 +599,6 @@ module LibItsSecurity_Templates { content := { encryptedData := p_encryptedData } } // End of template mw_etsiTs103097Data_encrypted - /** - * @desc Generic send template for EtsiTs103097Data message - */ - template (present) EtsiTs103097Data mw_etsiTs103097Data( - template (present) Ieee1609Dot2Content p_content := ? - ) := { - protocolVersion := c_protocol_version, - content := p_content - } // End of template mw_etsiTs103097Data - /** * @desc Generic send template for EtsiTs103097Data message */ @@ -981,13 +981,12 @@ module LibItsSecurity_Templates { template (present) HeaderInfo mw_headerInfo_cam( template (present) Psid p_psid := c_its_aid_CAM, template (present) Time64 p_generationTime := ?, - template Time64 p_expiryTime := omit, template SequenceOfHashedId3 p_inlineP2pcdRequest := omit, template Certificate p_requestedCertificate := omit ) modifies mw_ieee1609Dot2_headerInfo := { psid := c_its_aid_CAM, generationTime := p_generationTime, - expiryTime := p_expiryTime, + expiryTime := omit, generationLocation := omit, inlineP2pcdRequest := p_inlineP2pcdRequest, requestedCertificate := p_requestedCertificate @@ -1002,7 +1001,7 @@ module LibItsSecurity_Templates { in template (value) Time64 p_generationTime, in template (value) ThreeDLocation p_generationLocation, in template (omit) Time64 p_expiryTime := omit - ) modifies mw_ieee1609Dot2_headerInfo := { + ) modifies m_ieee1609Dot2_headerInfo := { generationTime := p_generationTime, expiryTime := p_expiryTime, generationLocation := p_generationLocation @@ -1499,7 +1498,7 @@ module LibItsSecurity_Templates { name := p_name } // End of template mw_certificateId_name - template (present) CertificateId mw_certificateId_none := { + template CertificateId mw_certificateId_none := { none_ := NULL } // End of template mw_certificateId_none -- GitLab From 4fe8f9adfc7e02514892e4109a9912577d7baafa Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 28 Feb 2018 14:55:31 +0000 Subject: [PATCH 073/320] STF538: Start Encryption TPs implementation --- ttcn/Security/LibItsSecurity_Functions.ttcn | 30 ++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index d9aebf1f..b488689c 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -1435,22 +1435,22 @@ module LibItsSecurity_Functions { ) runs on ItsSecurityBaseComponent return boolean { // Setup certificates memory cache if (fx_loadCertificates(PX_CERTIFICATE_POOL_PATH, p_configId) == true) { - // Setup security component variables - if(f_readCertificate(cc_taCert_A, vc_atCertificate)) { - if(f_readCertificate(vc_atCertificate.toBeSigned.id.name, vc_aaCertificate)) { - if(f_readSigningKey(cc_taCert_A, vc_signingPrivateKey)) { - f_readEncryptingKey(cc_taCert_A, vc_encryptPrivateKey); - return true; - } - log("f_loadCertificates: Failed to load signing key for ", cc_taCert_A); - }else{ - log("f_loadCertificates: Failed to load AA certificate for ", cc_taCert_A); - } - }else{ - log("f_loadCertificates: Failed to load AT certificate for ", cc_taCert_A); - } + // Setup security component variables + if (f_readCertificate(cc_taCert_A, vc_atCertificate) == true) { + if (f_readCertificate(vc_atCertificate.toBeSigned.id.name, vc_aaCertificate)) { + if (f_readSigningKey(cc_taCert_A, vc_signingPrivateKey)== true) { + f_readEncryptingKey(cc_taCert_A, vc_encryptPrivateKey); + return true; + } + log("f_loadCertificates: Failed to load signing key for ", cc_taCert_A); + } else { + log("f_loadCertificates: Failed to load AA certificate for ", cc_taCert_A); + } + } else { + log("f_loadCertificates: Failed to load AT certificate for ", cc_taCert_A); + } } else { - log("f_loadCertificates: Failed to load certificates from ", PX_CERTIFICATE_POOL_PATH); + log("f_loadCertificates: Failed to load certificates from ", PX_CERTIFICATE_POOL_PATH); } return false; } // End of function f_loadCertificates -- GitLab From 536e63bf85cb1bdf77abe53fc69a549a674d5ea5 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 1 Mar 2018 09:51:47 +0000 Subject: [PATCH 074/320] STF538: Finalyse certificates generation ATS --- ttcn/Security/LibItsSecurity_Functions.ttcn | 113 +++++++++++++------- 1 file changed, 73 insertions(+), 40 deletions(-) diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index b488689c..f29df8f2 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -1144,37 +1144,50 @@ module LibItsSecurity_Functions { */ function f_verifyCertificateSignatureWithPublicKey( in template (value) EtsiTs103097Certificate p_certificateToBeVerified, - in template (value) EccP256CurvePoint p_publicKey + in template (value) PublicVerificationKey p_publicVerificationKey ) return boolean { - // Local variables - var octetstring toBeVerifiedData; + var ToBeSignedCertificate v_toBeSignedCertificate; + var octetstring v_enc_msg; var octetstring v_signature; - var boolean v_result := false; - var template (value) ToBeSignedCertificate v_toBeSignedCertificate; - - // Create EtsiTs103097Certificate payload to be verified - /* FIXME To be reviewed v_toBeSignedCertificate := m_toBeSignedCertificate(p_certificateToBeVerified); - toBeVerifiedData := bit2oct(encvalue(v_toBeSignedCertificate)); - - // Build the signature - v_signature := - '0000'O & - valueof(p_certificateToBeVerified.signature_.ecdsaNistP256Signature.rSig) & - valueof(p_certificateToBeVerified.signature_.ecdsaNistP256Signature.sSig); - - log("toBeVerifiedData: ", toBeVerifiedData); - log("v_signature : ", v_signature); - log("EcdsaP256Signature :", p_publicKey); - - // Verify the certificate - v_result := f_verifyWithEcdsaNistp256WithSha256( - toBeVerifiedData, - v_signature, - valueof(p_publicKey.uncompressedP256.x), - valueof(p_publicKey.uncompressedP256.y) - );*/ - return v_result; + // Create ToBeSignedCertificate payload to be signed + v_toBeSignedCertificate := valueof(p_certificateToBeVerified.toBeSigned); + log("f_verifyCertificateSignatureWithPublicKey: v_toBeSignedCertificate=", v_toBeSignedCertificate); + + v_enc_msg := bit2oct(encvalue(v_toBeSignedCertificate)); + log("f_verifyCertificateSignatureWithPublicKey: v_enc_msg=", v_enc_msg); + + // Verify payload + if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1)) { + v_signature := valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only) & valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP256r1Signature.sSig); + log("f_verifyCertificateSignatureWithPublicKey: v_signedData=", v_signature); + return f_verifyWithEcdsaBrainpoolp256WithSha256( + v_enc_msg, + v_signature, + valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.uncompressedP256.x), + valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.uncompressedP256.y) + ); + } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1)) { + v_signature := valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only) & valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP384r1Signature.sSig); + log("f_verifyCertificateSignatureWithPublicKey: v_signedData=", v_signature); + return f_verifyWithEcdsaBrainpoolp384WithSha384( + v_enc_msg, + v_signature, + valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.uncompressedP384.x), + valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.uncompressedP384.y) + ); + } else if (ischosen(p_publicVerificationKey.ecdsaNistP256)) { + v_signature := valueof(p_certificateToBeVerified.signature_.ecdsaNistP256Signature.rSig.x_only) & valueof(p_certificateToBeVerified.signature_.ecdsaNistP256Signature.sSig); + log("f_verifyCertificateSignatureWithPublicKey: v_signedData=", v_signature); + return f_verifyWithEcdsaNistp256WithSha256( + v_enc_msg, + v_signature, + valueof(p_publicVerificationKey.ecdsaNistP256.uncompressedP256.x), + valueof(p_publicVerificationKey.ecdsaNistP256.uncompressedP256.y) + ); + } + + return false; } // End of finction f_verifyCertificateSignatureWithPublicKey /** @@ -1188,15 +1201,15 @@ module LibItsSecurity_Functions { in template (value) EtsiTs103097Certificate p_certificateToBeVerified, in template (value) EtsiTs103097Certificate p_issuingCertificate ) return boolean { - /* FIXME To be reviewed for (var integer v_counter := 0; v_counter < lengthof(p_issuingCertificate.subject_attributes); v_counter := v_counter + 1) { - if (valueof(p_issuingCertificate.subject_attributes[v_counter].type_) == e_verification_key) { - return f_verifyCertificateSignatureWithPublicKey( - p_certificateToBeVerified, - valueof(p_issuingCertificate.subject_attributes[v_counter].attribute.key)); - } - }*/ // End of 'for' statement - return false; + // Sanity checks + if (not(ischosen(p_issuingCertificate.toBeSigned.verifyKeyIndicator.verificationKey))) { + return false; + } + return f_verifyCertificateSignatureWithPublicKey( + p_certificateToBeVerified, + p_issuingCertificate.toBeSigned.verifyKeyIndicator.verificationKey + ); } // End of function f_verifyCertificateSignatureWithIssuingCertificate /** @@ -1348,7 +1361,7 @@ module LibItsSecurity_Functions { return f_verifyGnSecuredMessageSignature_ecdsaNistP256(p_securedMessage, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256); } - return true; + return false; } // End of function f_verifyGnSecuredOtherMessageWithDeviceCertificate } // End of group deviceSignatureHelpers @@ -1423,7 +1436,7 @@ module LibItsSecurity_Functions { p_elevation } } // End of function f_setGenerationLocation - + /** * @desc Load in memory cache the certificates available * @param p_configId A configuration identifier @@ -1437,7 +1450,9 @@ module LibItsSecurity_Functions { if (fx_loadCertificates(PX_CERTIFICATE_POOL_PATH, p_configId) == true) { // Setup security component variables if (f_readCertificate(cc_taCert_A, vc_atCertificate) == true) { - if (f_readCertificate(vc_atCertificate.toBeSigned.id.name, vc_aaCertificate)) { + var charstring str := oct2str(unichar2oct(vc_atCertificate.toBeSigned.id.name)); + log("UTF8 to charstring conversion: ", str); + if (f_readCertificate(str, vc_aaCertificate)) { if (f_readSigningKey(cc_taCert_A, vc_signingPrivateKey)== true) { f_readEncryptingKey(cc_taCert_A, vc_encryptPrivateKey); return true; @@ -1504,13 +1519,29 @@ module LibItsSecurity_Functions { in charstring p_certificateId, out HashedId8 p_digest ) runs on ItsSecurityBaseComponent return boolean { - if( not fx_readCertificateDigest(p_certificateId, p_digest)){ + if (not fx_readCertificateDigest(p_certificateId, p_digest)){ log("f_getCertificateDigest: Failed to retrieve digest for ", p_certificateId); return false; } return true; } // End of function f_getCertificateDigest + function f_getCertificateFromDigest( + in HashedId8 p_digest, + out EtsiTs103097Certificate p_certificate + ) runs on ItsSecurityBaseComponent return boolean { + var charstring v_certificate_id; + if (not(fx_readCertificateFromDigest(p_digest, v_certificate_id))) { + log("f_getCertificateFromDigest: Failed to retrieve digest for ", p_digest); + return false; + } + if (not(f_readCertificate(v_certificate_id, p_certificate))) { + log("f_getCertificateFromDigest: Failed to retrieve digest for ", v_certificate_id); + return false; + } + return true; + } // End of function f_getCertificateFromDigest + /** * @desc Read the signing private key for the specified certificate * @param p_keysId the keys identifier @@ -1751,6 +1782,8 @@ module LibItsSecurity_Functions { */ external function fx_readCertificateDigest(in charstring p_certificateId, out HashedId8 p_digest) return boolean; + external function fx_readCertificateFromDigest(in HashedId8 p_digest, out charstring p_certificateId) return boolean; + /** * @desc Read the private keys for the specified certificate * @param p_keysId the keys identifier -- GitLab From 37abbaa594abb4a8d747c9f724a58622b3fc3a9d Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 2 Mar 2018 10:40:35 +0000 Subject: [PATCH 075/320] STF538: Finalise certificates generation ATS --- ttcn/Security/LibItsSecurity_Functions.ttcn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index f29df8f2..ad5483f6 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -1150,6 +1150,8 @@ module LibItsSecurity_Functions { var octetstring v_enc_msg; var octetstring v_signature; + log("f_verifyCertificateSignatureWithPublicKey: p_publicVerificationKey=", p_publicVerificationKey); + // Create ToBeSignedCertificate payload to be signed v_toBeSignedCertificate := valueof(p_certificateToBeVerified.toBeSigned); log("f_verifyCertificateSignatureWithPublicKey: v_toBeSignedCertificate=", v_toBeSignedCertificate); -- GitLab From a6ac0912c744949e869976ef27e8526c3a001669 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 14 Mar 2018 06:25:34 +0000 Subject: [PATCH 076/320] STF538: Finalise certificates generation ATS --- ttcn/Security/LibItsSecurity_Functions.ttcn | 108 +++++++++++++++++++- ttcn/Security/LibItsSecurity_Templates.ttcn | 2 +- 2 files changed, 107 insertions(+), 3 deletions(-) diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index ad5483f6..708a8118 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -74,6 +74,7 @@ module LibItsSecurity_Functions { /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature * @param p_toBeSignedSecuredMessage The data to be signed + * @param p_privateKey The private key * @return The signature value */ function f_signWithEcdsaBrainpoolp256WithSha256( @@ -90,6 +91,7 @@ module LibItsSecurity_Functions { /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature * @param p_toBeSignedSecuredMessage The data to be signed + * @param p_privateKey The private key * @return The signature value */ function f_signWithEcdsaBrainpoolp384WithSha384( @@ -103,6 +105,90 @@ module LibItsSecurity_Functions { } // End of function f_signWithEcdsaBrainpoolp384WithSha384 + function f_decrypt( + in EtsiTs103097Data p_encrypedSecuredMessage, + out EtsiTs103097Data p_decrypedSecuredMessage + ) return boolean { + if (not(ischosen(p_encrypedSecuredMessage.content.encryptedData))) { + var PKRecipientInfo v_pKRecipientInfo; + var RecipientInfo v_recipientInfo := p_encrypedSecuredMessage.content.encryptedData.recipients[0]; + + if (ischosen(v_recipientInfo.certRecipInfo)) { + v_pKRecipientInfo := p_encrypedSecuredMessage.content.encryptedData.recipients[0].certRecipInfo; + // Read the certificate based on the recipientId + } else if (ischosen(v_recipientInfo.signedDataRecipInfo)) { + v_pKRecipientInfo := p_encrypedSecuredMessage.content.encryptedData.recipients[0].signedDataRecipInfo; + // Read the certificate based on the recipientId + } else { + return false; + } + + /*if (ischosen(v_pKRecipientInfo.encKey.eciesNistP256)) { + var octetstring v_encryptedSecuredMessage; + var SymmetricCiphertext v_ciphertext := p_encrypedSecuredMessage.content.encryptedData.ciphertext; + f_decryptWithEciesNistp256WithSha256( + v_ciphertext.aes128ccm.ccmCiphertext, + , + , + v_pKRecipientInfo.encKey.eciesNistP256.c, + v_ciphertext.aes128ccm.nonce, + v_pKRecipientInfo.encKey.eciesNistP256.t); + } else if (ischosen(v_pKRecipientInfo.encKey.eciesBrainpoolP256r1)) { + }*/ + } + + return false; + } // End of function f_signWithEcdsaBrainpoolp384WithSha384 + + /** + * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption + * @param p_toBeEncryptedSecuredMessage The data to be encrypted + * @return The encrypted value + */ + function f_encryptWithEciesNistp256WithSha256( + in octetstring p_toBeEncryptedSecuredMessage, + in Oct32 p_peerPublicKeyX, + in Oct32 p_peerPublicKeyY, + out Oct32 p_publicEncKeyX, + out Oct32 p_publicEncKeyY, + out Oct16 p_ephKey, + out Oct16 p_tag, + out Oct12 p_nonce + ) return octetstring { + return fx_encryptWithEciesNistp256WithSha256( + p_toBeEncryptedSecuredMessage, + p_peerPublicKeyX, + p_peerPublicKeyY, + p_publicEncKeyX, + p_publicEncKeyY, + p_ephKey, + p_tag, + p_nonce + ); + } // End of function f_encryptWithEciesNistp256WithSha256 + + /** + * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption + * @param p_encryptedSecuredMessage The data to be decrypted + * @return The decrypted value + */ + function f_decryptWithEciesNistp256WithSha256( + in octetstring p_encryptedSecuredMessage, + in Oct32 p_publicKeyX, + in Oct32 p_publicKeyY, + in Oct12 p_nonce, + in Oct12 p_tag + ) return octetstring { + return fx_decryptWithEciesNistp256WithSha256( + p_encryptedSecuredMessage, + p_publicKeyX, + p_publicKeyY, + p_nonce, + p_tag + ); + + } // End of function f_decryptWithEcdsaNistp256WithSha256 + /** * @desc Compute the HashedId8 value from the hash value * @param p_hash The hash value @@ -1667,7 +1753,25 @@ module LibItsSecurity_Functions { * @return The signature value */ external function fx_signWithEcdsaNistp256WithSha256(in Oct32 p_toBeSignedSecuredMessage, in Oct32 p_privateKey) return octetstring; - + + /** + * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption + * @param p_toBeEncryptedSecuredMessage The data to be encrypted + * @param p_publicKeyX The public key (X coordonate) + * @param p_publicKeyY The public key (Y coordonate) + * @return The encrypted value + */ + external function fx_encryptWithEciesNistp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_peerPublicKeyX, in Oct32 p_peerPublicKeyY, out Oct32 p_publicEncKeyX, out Oct32 p_publicEncKeyY, out Oct16 p_ephKey, out Oct16 p_tag, out Oct12 p_nonce) return octetstring; + + /** + * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption + * @param p_encryptedSecuredMessage The data to be decrypted + * @param p_publicKeyX The public key (X coordonate) + * @param p_publicKeyY The public key (Y coordonate) + * @return The decrypted value + */ + external function fx_decryptWithEciesNistp256WithSha256(in octetstring p_encryptedSecuredMessage, in Oct32 p_publicKeyX, in Oct32 p_publicKeyY, in Oct12 p_nonce, in Oct12 p_tag) return octetstring; + /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature * @param p_toBeSignedSecuredMessage The data to be signed @@ -1760,7 +1864,7 @@ module LibItsSecurity_Functions { * @return true on success, false otherwise */ external function fx_loadCertificates(in charstring p_rootDirectory, in charstring p_configId) return boolean; - external function fx_store_certificate(in charstring p_cert_id, in octetstring p_cert, in octetstring p_private_key, in octetstring p_public_key_x, in octetstring p_public_key_y, in octetstring p_hashid8, in octetstring p_issuer) return boolean; + external function fx_store_certificate(in charstring p_cert_id, in octetstring p_cert, in octetstring p_private_key, in octetstring p_public_key_x, in octetstring p_public_key_y, in octetstring p_hashid8, in octetstring p_issuer, in template (omit) octetstring p_private_enc_key, in template (omit) octetstring p_public_enc_key_x, in template (omit) octetstring p_public_enc_key_y) return boolean; /** * @desc Unload from memory cache the certificates diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index 99f06b13..bf2d3138 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -1623,7 +1623,7 @@ module LibItsSecurity_Templates { group encryptionKey { template (value) PublicEncryptionKey m_encryptionKey( - in template (value) SymmAlgorithm p_supportedSymmAlg, + in template (value) SymmAlgorithm p_supportedSymmAlg := aes128Ccm, in template (value) BasePublicEncryptionKey p_publicKey ) := { supportedSymmAlg := p_supportedSymmAlg, -- GitLab From d03aa2806f7d310539e2b9f21bb68171235c7d1b Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 21 Mar 2018 10:22:36 +0000 Subject: [PATCH 077/320] STF538: Start validation --- ttcn/Security/LibItsSecurity_Functions.ttcn | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 708a8118..18c9be84 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -1538,10 +1538,19 @@ module LibItsSecurity_Functions { if (fx_loadCertificates(PX_CERTIFICATE_POOL_PATH, p_configId) == true) { // Setup security component variables if (f_readCertificate(cc_taCert_A, vc_atCertificate) == true) { - var charstring str := oct2str(unichar2oct(vc_atCertificate.toBeSigned.id.name)); - log("UTF8 to charstring conversion: ", str); - if (f_readCertificate(str, vc_aaCertificate)) { - if (f_readSigningKey(cc_taCert_A, vc_signingPrivateKey)== true) { + var HashedId8 v_issuer; + log("Issuer: ", vc_atCertificate.issuer); + if (ischosen(vc_atCertificate.issuer.sha256AndDigest)) { + v_issuer := vc_atCertificate.issuer.sha256AndDigest; + } else if (ischosen(vc_atCertificate.issuer.sha384AndDigest)) { + v_issuer := vc_atCertificate.issuer.sha384AndDigest; + } else { + log("AT certificate cannot be issued by CA"); + return false; + } + log("Selected issuer: ", v_issuer); + if (f_getCertificateFromDigest(v_issuer, vc_aaCertificate)) { + if (f_readSigningKey(cc_taCert_A, vc_signingPrivateKey) == true) { f_readEncryptingKey(cc_taCert_A, vc_encryptPrivateKey); return true; } -- GitLab From 249fd702f3f3603762a3a5d6136d670da606fdea Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 22 Mar 2018 12:30:01 +0000 Subject: [PATCH 078/320] STF538: Start validation --- ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn index 4488609f..656e81a6 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn @@ -1673,7 +1673,8 @@ module LibItsGeoNetworking_Functions { else { f_utInitializeIut(m_gnInitialize); } - + f_sleep(PX_NEIGHBOUR_DISCOVERY_DELAY); + f_acLoadScenario(p_scenario); f_acStartScenario(); } @@ -1796,7 +1797,7 @@ module LibItsGeoNetworking_Functions { */ function f_acGetLongPosVector(GN_Address p_gnAddress) runs on ItsBaseGeoNetworking return LongPosVector { var AcGnResponse v_result; - + f_acTriggerEvent(m_getLongPosVector(p_gnAddress)); tc_ac.start; alt { -- GitLab From 5f055d9130ae1512682db003aa32c2cf1e40a058 Mon Sep 17 00:00:00 2001 From: garciay Date: Sun, 25 Mar 2018 14:47:13 +0000 Subject: [PATCH 079/320] Add ITS HTTP support --- ttcn/LibHttp/LibItsHttp_Templates.ttcn | 62 +++++++++++++++++++++ ttcn/LibHttp/LibItsHttp_TypesAndValues.ttcn | 59 ++++++++++++++++++++ 2 files changed, 121 insertions(+) create mode 100644 ttcn/LibHttp/LibItsHttp_Templates.ttcn create mode 100644 ttcn/LibHttp/LibItsHttp_TypesAndValues.ttcn diff --git a/ttcn/LibHttp/LibItsHttp_Templates.ttcn b/ttcn/LibHttp/LibItsHttp_Templates.ttcn new file mode 100644 index 00000000..ba4d1c15 --- /dev/null +++ b/ttcn/LibHttp/LibItsHttp_Templates.ttcn @@ -0,0 +1,62 @@ +/** + * @author ETSI / STF549 + * @version $URL$ + * $ID:$ + * @desc This module provides the templates for ITS HTTP based protocols. + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * @see ETSI TS 103 478 + */ +module LibHttp_Templates { + + // LibHttp + import from LibHttp_TypesAndValues all; + + template (value) HeaderLine m_header_line( + in template (value) charstring p_header_name, + in template (value) charstring_list p_header_value + ) := { + header_name := p_header_name, + header_value := p_header_value + } // End of template m_header_line + + template (value) HttpMessage m_http_request( + in template (value) Request p_request + ) := { + request := p_request + } // End of template m_http_request + + template (present) HttpMessage mw_http_request( + template (present) Request p_request := ? + ) := { + request := p_request + } // End of template mw_http_request + + template (value) HttpMessage m_http_response( + in template (value) Response p_response + ) := { + response := p_response + } // End of template m_http_response + + template (present) HttpMessage mw_http_response( + template (present) Response p_response := ? + ) := { + response := p_response + } // End of template mw_http_response + + template (omit) Request m_http_request_get( + in charstring p_uri, + in template (value) HeaderLines p_headers, + in template (omit) charstring p_body := omit + ) := { + method := "GET", + uri := p_uri, + version_major := c_http_version_major, + version_minor := c_http_version_minor, + header := p_headers, + body := p_body + } // End of template m_http_request_get + +} // End of module LibHttp_Templates diff --git a/ttcn/LibHttp/LibItsHttp_TypesAndValues.ttcn b/ttcn/LibHttp/LibItsHttp_TypesAndValues.ttcn new file mode 100644 index 00000000..809b0dae --- /dev/null +++ b/ttcn/LibHttp/LibItsHttp_TypesAndValues.ttcn @@ -0,0 +1,59 @@ +/** + * @author ETSI / STF545 + * @version $URL$ + * $ID:$ + * @desc This module provides the types and values used by ITS HTTP based protocols. + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * @see ETSI TS 103 478 + */ +module LibHttp_TypesAndValues { + + const integer c_http_version_major := 1; + const integer c_http_version_minor := 1; + + type record of charstring charstring_list; + type record HeaderLine { + charstring header_name, + charstring_list header_value + } with { + variant "FIELDORDER(msb)" + } + + type record of HeaderLine HeaderLines; + + type record Request { + charstring method, + charstring uri, + integer version_major, + integer version_minor, + HeaderLines header, + charstring body optional + } with { + variant "FIELDORDER(msb)" + } + + type record Response { + integer version_major, + integer version_minor, + integer statuscode, + charstring statustext, + HeaderLines header, + charstring body optional + } with { + variant "FIELDORDER(msb)" + } + + type union HttpMessage { + Response response, + Request request + } with { + variant "FIELDORDER(msb)" + } + +} with { + variant "" + encode "HttcpCodec" +} // End of module LibHttp_TypesAndValues -- GitLab From 37a421b96192dc6b59a44cceb9ce2b630d3892f0 Mon Sep 17 00:00:00 2001 From: garciay Date: Sun, 25 Mar 2018 14:50:58 +0000 Subject: [PATCH 080/320] Add ITS HTTP support --- ttcn/{LibHttp => Http}/LibItsHttp_Templates.ttcn | 0 ttcn/{LibHttp => Http}/LibItsHttp_TypesAndValues.ttcn | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename ttcn/{LibHttp => Http}/LibItsHttp_Templates.ttcn (100%) rename ttcn/{LibHttp => Http}/LibItsHttp_TypesAndValues.ttcn (100%) diff --git a/ttcn/LibHttp/LibItsHttp_Templates.ttcn b/ttcn/Http/LibItsHttp_Templates.ttcn similarity index 100% rename from ttcn/LibHttp/LibItsHttp_Templates.ttcn rename to ttcn/Http/LibItsHttp_Templates.ttcn diff --git a/ttcn/LibHttp/LibItsHttp_TypesAndValues.ttcn b/ttcn/Http/LibItsHttp_TypesAndValues.ttcn similarity index 100% rename from ttcn/LibHttp/LibItsHttp_TypesAndValues.ttcn rename to ttcn/Http/LibItsHttp_TypesAndValues.ttcn -- GitLab From 0b6eebf3da334d06718fe6a10dbbc2c251134a52 Mon Sep 17 00:00:00 2001 From: garciay Date: Sun, 25 Mar 2018 15:52:06 +0000 Subject: [PATCH 081/320] Add ITS HTTP support --- ttcn/Http/LibItsHttp_Templates.ttcn | 6 +++--- ttcn/Http/LibItsHttp_TypesAndValues.ttcn | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ttcn/Http/LibItsHttp_Templates.ttcn b/ttcn/Http/LibItsHttp_Templates.ttcn index ba4d1c15..329727a0 100644 --- a/ttcn/Http/LibItsHttp_Templates.ttcn +++ b/ttcn/Http/LibItsHttp_Templates.ttcn @@ -9,10 +9,10 @@ * All rights reserved. * @see ETSI TS 103 478 */ -module LibHttp_Templates { +module LibItsHttp_Templates { // LibHttp - import from LibHttp_TypesAndValues all; + import from LibItsHttp_TypesAndValues all; template (value) HeaderLine m_header_line( in template (value) charstring p_header_name, @@ -59,4 +59,4 @@ module LibHttp_Templates { body := p_body } // End of template m_http_request_get -} // End of module LibHttp_Templates +} // End of module LibItsHttp_Templates diff --git a/ttcn/Http/LibItsHttp_TypesAndValues.ttcn b/ttcn/Http/LibItsHttp_TypesAndValues.ttcn index 809b0dae..12c1dad7 100644 --- a/ttcn/Http/LibItsHttp_TypesAndValues.ttcn +++ b/ttcn/Http/LibItsHttp_TypesAndValues.ttcn @@ -9,7 +9,7 @@ * All rights reserved. * @see ETSI TS 103 478 */ -module LibHttp_TypesAndValues { +module LibItsHttp_TypesAndValues { const integer c_http_version_major := 1; const integer c_http_version_minor := 1; @@ -56,4 +56,4 @@ module LibHttp_TypesAndValues { } with { variant "" encode "HttcpCodec" -} // End of module LibHttp_TypesAndValues +} // End of module LibItsHttp_TypesAndValues -- GitLab From 07f1a5c8ce379976f56d887ef1d8ca2ade1736dd Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 3 Apr 2018 12:46:08 +0000 Subject: [PATCH 082/320] STF545: Start ECIES implementation Validate HMAC-SH256 & AES 128 CCM encryption --- ttcn/Security/LibItsSecurity_Functions.ttcn | 25 ++++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 18c9be84..f63dfc38 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -139,7 +139,7 @@ module LibItsSecurity_Functions { return false; } // End of function f_signWithEcdsaBrainpoolp384WithSha384 - + /** * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption * @param p_toBeEncryptedSecuredMessage The data to be encrypted @@ -151,8 +151,8 @@ module LibItsSecurity_Functions { in Oct32 p_peerPublicKeyY, out Oct32 p_publicEncKeyX, out Oct32 p_publicEncKeyY, - out Oct16 p_ephKey, - out Oct16 p_tag, + out Oct16 p_hmac, + out Oct16 p_authentication_vector, out Oct12 p_nonce ) return octetstring { return fx_encryptWithEciesNistp256WithSha256( @@ -161,8 +161,8 @@ module LibItsSecurity_Functions { p_peerPublicKeyY, p_publicEncKeyX, p_publicEncKeyY, - p_ephKey, - p_tag, + p_hmac, + p_authentication_vector, p_nonce ); } // End of function f_encryptWithEciesNistp256WithSha256 @@ -1762,6 +1762,19 @@ module LibItsSecurity_Functions { * @return The signature value */ external function fx_signWithEcdsaNistp256WithSha256(in Oct32 p_toBeSignedSecuredMessage, in Oct32 p_privateKey) return octetstring; + + external function fx_test_hmac_sha256(in octetstring p_k, in octetstring p_m) return octetstring; + /** + * @desc Test function the validate AES128 CCM encryption based on IEEE Std 1609.2-20XX Annex D.6.1 AES-CCM-128 + * @return The encrypted test + */ + external function fx_test_encrypt_aes_128_ccm_test(in octetstring p_k, in octetstring p_n, in octetstring p_pt) return octetstring; + + /** + * @desc Test function the validate AES128 CCM decryption based on IEEE Std 1609.2-20XX Annex D.6.1 AES-CCM-128 + * @return The decrypted test + */ + external function fx_test_decrypt_aes_128_ccm_test(in octetstring p_k, in octetstring p_n, in octetstring p_pt) return octetstring; /** * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption @@ -1770,7 +1783,7 @@ module LibItsSecurity_Functions { * @param p_publicKeyY The public key (Y coordonate) * @return The encrypted value */ - external function fx_encryptWithEciesNistp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_peerPublicKeyX, in Oct32 p_peerPublicKeyY, out Oct32 p_publicEncKeyX, out Oct32 p_publicEncKeyY, out Oct16 p_ephKey, out Oct16 p_tag, out Oct12 p_nonce) return octetstring; + external function fx_encryptWithEciesNistp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_peerPublicKeyX, in Oct32 p_peerPublicKeyY, out Oct32 p_publicEncKeyX, out Oct32 p_publicEncKeyY, out Oct16 p_hmac, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; /** * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption -- GitLab From 38e71615cd614610f905c5347ee1cd972fde2577 Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 3 Apr 2018 14:12:25 +0000 Subject: [PATCH 083/320] STF545: Start ECIES implementation --- ttcn/Security/LibItsSecurity_Functions.ttcn | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index f63dfc38..31b893fc 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -151,7 +151,7 @@ module LibItsSecurity_Functions { in Oct32 p_peerPublicKeyY, out Oct32 p_publicEncKeyX, out Oct32 p_publicEncKeyY, - out Oct16 p_hmac, + out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce ) return octetstring { @@ -161,7 +161,7 @@ module LibItsSecurity_Functions { p_peerPublicKeyY, p_publicEncKeyX, p_publicEncKeyY, - p_hmac, + p_encrypted_sym_key, p_authentication_vector, p_nonce ); @@ -1783,7 +1783,7 @@ module LibItsSecurity_Functions { * @param p_publicKeyY The public key (Y coordonate) * @return The encrypted value */ - external function fx_encryptWithEciesNistp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_peerPublicKeyX, in Oct32 p_peerPublicKeyY, out Oct32 p_publicEncKeyX, out Oct32 p_publicEncKeyY, out Oct16 p_hmac, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; + external function fx_encryptWithEciesNistp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_peerPublicKeyX, in Oct32 p_peerPublicKeyY, out Oct32 p_publicEncKeyX, out Oct32 p_publicEncKeyY, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; /** * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption -- GitLab From 284ecb2d8bebab2eb4adf7ee76b4985256ebcf25 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 4 Apr 2018 08:33:36 +0000 Subject: [PATCH 084/320] STF545: Validate ECIES implementation --- ttcn/Security/LibItsSecurity_Functions.ttcn | 59 +++++++++++---------- 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 31b893fc..0d0b4399 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -147,24 +147,24 @@ module LibItsSecurity_Functions { */ function f_encryptWithEciesNistp256WithSha256( in octetstring p_toBeEncryptedSecuredMessage, - in Oct32 p_peerPublicKeyX, - in Oct32 p_peerPublicKeyY, - out Oct32 p_publicEncKeyX, - out Oct32 p_publicEncKeyY, + in Oct32 p_recipientsPublicKeyX, + in Oct32 p_recipientsPublicKeyY, + out Oct32 p_publicEphemeralKeyX, + out Oct32 p_publicEphemeralKeyY, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce ) return octetstring { - return fx_encryptWithEciesNistp256WithSha256( - p_toBeEncryptedSecuredMessage, - p_peerPublicKeyX, - p_peerPublicKeyY, - p_publicEncKeyX, - p_publicEncKeyY, - p_encrypted_sym_key, - p_authentication_vector, - p_nonce - ); + return fx_encryptWithEciesNistp256WithSha256( + p_toBeEncryptedSecuredMessage, + p_recipientsPublicKeyX, + p_recipientsPublicKeyY, + p_publicEphemeralKeyX, + p_publicEphemeralKeyY, + p_encrypted_sym_key, + p_authentication_vector, + p_nonce + ); } // End of function f_encryptWithEciesNistp256WithSha256 /** @@ -174,19 +174,22 @@ module LibItsSecurity_Functions { */ function f_decryptWithEciesNistp256WithSha256( in octetstring p_encryptedSecuredMessage, - in Oct32 p_publicKeyX, - in Oct32 p_publicKeyY, - in Oct12 p_nonce, - in Oct12 p_tag + in Oct32 p_privateEncKey, + in Oct32 p_publicEphemeralKeyX, + in Oct32 p_publicEphemeralKeyY, + in Oct16 p_encrypted_sym_key, + in Oct16 p_authentication_vector, + in Oct12 p_nonce ) return octetstring { - return fx_decryptWithEciesNistp256WithSha256( - p_encryptedSecuredMessage, - p_publicKeyX, - p_publicKeyY, - p_nonce, - p_tag - ); - + return fx_decryptWithEciesNistp256WithSha256( + p_encryptedSecuredMessage, + p_privateEncKey, + p_publicEphemeralKeyX, + p_publicEphemeralKeyY, + p_encrypted_sym_key, + p_authentication_vector, + p_nonce + ); } // End of function f_decryptWithEcdsaNistp256WithSha256 /** @@ -1783,7 +1786,7 @@ module LibItsSecurity_Functions { * @param p_publicKeyY The public key (Y coordonate) * @return The encrypted value */ - external function fx_encryptWithEciesNistp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_peerPublicKeyX, in Oct32 p_peerPublicKeyY, out Oct32 p_publicEncKeyX, out Oct32 p_publicEncKeyY, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; + external function fx_encryptWithEciesNistp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyX, in Oct32 p_recipientsPublicKeyY, out Oct32 p_publicEphemeralKeyX, out Oct32 p_publicEphemeralKeyY, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; /** * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption @@ -1792,7 +1795,7 @@ module LibItsSecurity_Functions { * @param p_publicKeyY The public key (Y coordonate) * @return The decrypted value */ - external function fx_decryptWithEciesNistp256WithSha256(in octetstring p_encryptedSecuredMessage, in Oct32 p_publicKeyX, in Oct32 p_publicKeyY, in Oct12 p_nonce, in Oct12 p_tag) return octetstring; + external function fx_decryptWithEciesNistp256WithSha256(in octetstring p_encryptedSecuredMessage, in Oct32 p_privateEncKey, in Oct32 p_publicEphemeralKeyX, in Oct32 p_publicEphemeralKeyY, in Oct16 p_encrypted_sym_key, in Oct16 p_authentication_vector, in Oct12 p_nonce) return octetstring; /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature -- GitLab From 722f77d83b82c2f927ce29974de17c36fd72247b Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 4 Apr 2018 09:25:44 +0000 Subject: [PATCH 085/320] STF545: Validate ECIES implementation --- ttcn/Security/LibItsSecurity_Functions.ttcn | 73 ++++++++++++++------- 1 file changed, 51 insertions(+), 22 deletions(-) diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 0d0b4399..bdc69c97 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -123,18 +123,27 @@ module LibItsSecurity_Functions { return false; } - /*if (ischosen(v_pKRecipientInfo.encKey.eciesNistP256)) { - var octetstring v_encryptedSecuredMessage; - var SymmetricCiphertext v_ciphertext := p_encrypedSecuredMessage.content.encryptedData.ciphertext; - f_decryptWithEciesNistp256WithSha256( - v_ciphertext.aes128ccm.ccmCiphertext, - , - , - v_pKRecipientInfo.encKey.eciesNistP256.c, - v_ciphertext.aes128ccm.nonce, - v_pKRecipientInfo.encKey.eciesNistP256.t); + if (ischosen(v_pKRecipientInfo.encKey.eciesNistP256)) { + var octetstring v_decryptedSecuredMessage; + var SymmetricCiphertext v_ciphertext := p_encrypedSecuredMessage.content.encryptedData.ciphertext; + // FIXME Add the private encryption key + /*v_decryptedSecuredMessage := f_decryptWithEciesNistp256WithSha256( + v_ciphertext.aes128ccm.ccmCiphertext, + v_pKRecipientInfo.encKey.eciesNistP256.v.uncompressedP256.x, + v_pKRecipientInfo.encKey.eciesNistP256.v.uncompressedP256.y, + v_pKRecipientInfo.encKey.eciesNistP256.c, + v_pKRecipientInfo.encKey.eciesNistP256.t, + v_ciphertext.aes128ccm.nonce + ); + if (isbound(v_decryptedSecuredMessage)) { + var bitstring v_decode := oct2bit(v_decryptedSecuredMessage); + if (decvalue(v_decode, p_decrypedSecuredMessage) == 0) { + return true; + } + }*/ } else if (ischosen(v_pKRecipientInfo.encKey.eciesBrainpoolP256r1)) { - }*/ + // TODO + } } return false; @@ -143,20 +152,27 @@ module LibItsSecurity_Functions { /** * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption * @param p_toBeEncryptedSecuredMessage The data to be encrypted - * @return The encrypted value + * @param p_recipientsPublicKeyX The Recipient's public encryption key X-coordinate + * @param p_recipientsPublicKeyY The Recipient's public encryption key Y-coordinate + * @param p_publicEphemeralKeyX The generated ephemeral key X-coordinate + * @param p_publicEphemeralKeyY The generated ephemeral key Y-coordinate + * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key + * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption + * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption + * @return The encrypted message */ function f_encryptWithEciesNistp256WithSha256( in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyX, in Oct32 p_recipientsPublicKeyY, - out Oct32 p_publicEphemeralKeyX, + out Oct32 p_publicEphemeralKeyX, out Oct32 p_publicEphemeralKeyY, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce ) return octetstring { return fx_encryptWithEciesNistp256WithSha256( - p_toBeEncryptedSecuredMessage, + p_toBeEncryptedSecuredMessage, p_recipientsPublicKeyX, p_recipientsPublicKeyY, p_publicEphemeralKeyX, @@ -170,7 +186,12 @@ module LibItsSecurity_Functions { /** * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption * @param p_encryptedSecuredMessage The data to be decrypted - * @return The decrypted value + * @param p_publicEphemeralKeyX The generated ephemeral key X-coordinate + * @param p_publicEphemeralKeyY The generated ephemeral key Y-coordinate + * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key + * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption + * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption + * @return The decrypted message */ function f_decryptWithEciesNistp256WithSha256( in octetstring p_encryptedSecuredMessage, @@ -1782,18 +1803,26 @@ module LibItsSecurity_Functions { /** * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption * @param p_toBeEncryptedSecuredMessage The data to be encrypted - * @param p_publicKeyX The public key (X coordonate) - * @param p_publicKeyY The public key (Y coordonate) - * @return The encrypted value + * @param p_recipientsPublicKeyX The Recipient's public encryption key X-coordinate + * @param p_recipientsPublicKeyY The Recipient's public encryption key Y-coordinate + * @param p_publicEphemeralKeyX The generated ephemeral key X-coordinate + * @param p_publicEphemeralKeyY The generated ephemeral key Y-coordinate + * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key + * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption + * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption + * @return The encrypted message */ external function fx_encryptWithEciesNistp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyX, in Oct32 p_recipientsPublicKeyY, out Oct32 p_publicEphemeralKeyX, out Oct32 p_publicEphemeralKeyY, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; /** * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption - * @param p_encryptedSecuredMessage The data to be decrypted - * @param p_publicKeyX The public key (X coordonate) - * @param p_publicKeyY The public key (Y coordonate) - * @return The decrypted value + * @param p_encryptedSecuredMessage The data to be decrypted + * @param p_publicEphemeralKeyX The generated ephemeral key X-coordinate + * @param p_publicEphemeralKeyY The generated ephemeral key Y-coordinate + * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key + * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption + * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption + * @return The decrypted message */ external function fx_decryptWithEciesNistp256WithSha256(in octetstring p_encryptedSecuredMessage, in Oct32 p_privateEncKey, in Oct32 p_publicEphemeralKeyX, in Oct32 p_publicEphemeralKeyY, in Oct16 p_encrypted_sym_key, in Oct16 p_authentication_vector, in Oct12 p_nonce) return octetstring; -- GitLab From a28a57ca0a472825e13d4a23cecc6fc909b079fd Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 4 Apr 2018 12:15:28 +0000 Subject: [PATCH 086/320] STF545: Validate full support of ECIES encryption --- ttcn/Security/LibItsSecurity_Functions.ttcn | 143 ++++++++++++++++++-- 1 file changed, 134 insertions(+), 9 deletions(-) diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index bdc69c97..28400970 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -106,6 +106,7 @@ module LibItsSecurity_Functions { } // End of function f_signWithEcdsaBrainpoolp384WithSha384 function f_decrypt( + in octetstring p_encryptPrivateKey, in EtsiTs103097Data p_encrypedSecuredMessage, out EtsiTs103097Data p_decrypedSecuredMessage ) return boolean { @@ -113,6 +114,12 @@ module LibItsSecurity_Functions { var PKRecipientInfo v_pKRecipientInfo; var RecipientInfo v_recipientInfo := p_encrypedSecuredMessage.content.encryptedData.recipients[0]; + // Check the private encryption key + if (not(isbound(p_encryptPrivateKey))) { + log("*** " & testcasename() & ":ERROR: Failed to load encryption private key ***"); + return false; + } + if (ischosen(v_recipientInfo.certRecipInfo)) { v_pKRecipientInfo := p_encrypedSecuredMessage.content.encryptedData.recipients[0].certRecipInfo; // Read the certificate based on the recipientId @@ -126,9 +133,9 @@ module LibItsSecurity_Functions { if (ischosen(v_pKRecipientInfo.encKey.eciesNistP256)) { var octetstring v_decryptedSecuredMessage; var SymmetricCiphertext v_ciphertext := p_encrypedSecuredMessage.content.encryptedData.ciphertext; - // FIXME Add the private encryption key - /*v_decryptedSecuredMessage := f_decryptWithEciesNistp256WithSha256( + v_decryptedSecuredMessage := f_decryptWithEciesNistp256WithSha256( v_ciphertext.aes128ccm.ccmCiphertext, + p_encryptPrivateKey, v_pKRecipientInfo.encKey.eciesNistP256.v.uncompressedP256.x, v_pKRecipientInfo.encKey.eciesNistP256.v.uncompressedP256.y, v_pKRecipientInfo.encKey.eciesNistP256.c, @@ -140,17 +147,33 @@ module LibItsSecurity_Functions { if (decvalue(v_decode, p_decrypedSecuredMessage) == 0) { return true; } - }*/ + } } else if (ischosen(v_pKRecipientInfo.encKey.eciesBrainpoolP256r1)) { - // TODO + var octetstring v_decryptedSecuredMessage; + var SymmetricCiphertext v_ciphertext := p_encrypedSecuredMessage.content.encryptedData.ciphertext; + v_decryptedSecuredMessage := f_decryptWithEciesBrainpoolp256WithSha256( + v_ciphertext.aes128ccm.ccmCiphertext, + p_encryptPrivateKey, + v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.uncompressedP256.x, + v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.uncompressedP256.y, + v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.c, + v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.t, + v_ciphertext.aes128ccm.nonce + ); + if (isbound(v_decryptedSecuredMessage)) { + var bitstring v_decode := oct2bit(v_decryptedSecuredMessage); + if (decvalue(v_decode, p_decrypedSecuredMessage) == 0) { + return true; + } + } } } return false; - } // End of function f_signWithEcdsaBrainpoolp384WithSha384 + } // End of function f_decrypt /** - * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption + * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption using Nist-P256 algorithm * @param p_toBeEncryptedSecuredMessage The data to be encrypted * @param p_recipientsPublicKeyX The Recipient's public encryption key X-coordinate * @param p_recipientsPublicKeyY The Recipient's public encryption key Y-coordinate @@ -159,6 +182,9 @@ module LibItsSecurity_Functions { * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption + * @see IEEE Std 1609.2-2017 Clause 5.3.5 Public key encryption algorithms: ECIES + * @see https://www.nominet.uk/researchblog/how-elliptic-curve-cryptography-encryption-works/ + * @see http://digital.csic.es/bitstream/10261/32671/1/V2-I2-P7-13.pdf * @return The encrypted message */ function f_encryptWithEciesNistp256WithSha256( @@ -184,7 +210,7 @@ module LibItsSecurity_Functions { } // End of function f_encryptWithEciesNistp256WithSha256 /** - * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption + * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Nist-P256 algorithm * @param p_encryptedSecuredMessage The data to be decrypted * @param p_publicEphemeralKeyX The generated ephemeral key X-coordinate * @param p_publicEphemeralKeyY The generated ephemeral key Y-coordinate @@ -192,6 +218,9 @@ module LibItsSecurity_Functions { * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption * @return The decrypted message + * @see IEEE Std 1609.2-2017 Clause 5.3.5 Public key encryption algorithms: ECIES + * @see https://www.nominet.uk/researchblog/how-elliptic-curve-cryptography-encryption-works/ + * @see http://digital.csic.es/bitstream/10261/32671/1/V2-I2-P7-13.pdf */ function f_decryptWithEciesNistp256WithSha256( in octetstring p_encryptedSecuredMessage, @@ -213,6 +242,76 @@ module LibItsSecurity_Functions { ); } // End of function f_decryptWithEcdsaNistp256WithSha256 + /** + * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption using Brainpool-P256 algorithm + * @param p_toBeEncryptedSecuredMessage The data to be encrypted + * @param p_recipientsPublicKeyX The Recipient's public encryption key X-coordinate + * @param p_recipientsPublicKeyY The Recipient's public encryption key Y-coordinate + * @param p_publicEphemeralKeyX The generated ephemeral key X-coordinate + * @param p_publicEphemeralKeyY The generated ephemeral key Y-coordinate + * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key + * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption + * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption + * @return The encrypted message + * @see IEEE Std 1609.2-2017 Clause 5.3.5 Public key encryption algorithms: ECIES + * @see https://www.nominet.uk/researchblog/how-elliptic-curve-cryptography-encryption-works/ + * @see http://digital.csic.es/bitstream/10261/32671/1/V2-I2-P7-13.pdf + */ + function f_encryptWithEciesBrainpoolp256WithSha256( + in octetstring p_toBeEncryptedSecuredMessage, + in Oct32 p_recipientsPublicKeyX, + in Oct32 p_recipientsPublicKeyY, + out Oct32 p_publicEphemeralKeyX, + out Oct32 p_publicEphemeralKeyY, + out Oct16 p_encrypted_sym_key, + out Oct16 p_authentication_vector, + out Oct12 p_nonce + ) return octetstring { + return fx_encryptWithEciesBrainpoolp256WithSha256( + p_toBeEncryptedSecuredMessage, + p_recipientsPublicKeyX, + p_recipientsPublicKeyY, + p_publicEphemeralKeyX, + p_publicEphemeralKeyY, + p_encrypted_sym_key, + p_authentication_vector, + p_nonce + ); + } // End of function f_encryptWithEciesBrainpoolp256WithSha256 + + /** + * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Brainpool-P256 algorithm + * @param p_encryptedSecuredMessage The data to be decrypted + * @param p_publicEphemeralKeyX The generated ephemeral key X-coordinate + * @param p_publicEphemeralKeyY The generated ephemeral key Y-coordinate + * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key + * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption + * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption + * @return The decrypted message + * @see IEEE Std 1609.2-2017 Clause 5.3.5 Public key encryption algorithms: ECIES + * @see https://www.nominet.uk/researchblog/how-elliptic-curve-cryptography-encryption-works/ + * @see http://digital.csic.es/bitstream/10261/32671/1/V2-I2-P7-13.pdf + */ + function f_decryptWithEciesBrainpoolp256WithSha256( + in octetstring p_encryptedSecuredMessage, + in Oct32 p_privateEncKey, + in Oct32 p_publicEphemeralKeyX, + in Oct32 p_publicEphemeralKeyY, + in Oct16 p_encrypted_sym_key, + in Oct16 p_authentication_vector, + in Oct12 p_nonce + ) return octetstring { + return fx_decryptWithEciesBrainpoolp256WithSha256( + p_encryptedSecuredMessage, + p_privateEncKey, + p_publicEphemeralKeyX, + p_publicEphemeralKeyY, + p_encrypted_sym_key, + p_authentication_vector, + p_nonce + ); + } // End of function f_decryptWithEcdsaBrainpoolp256WithSha256 + /** * @desc Compute the HashedId8 value from the hash value * @param p_hash The hash value @@ -1801,7 +1900,7 @@ module LibItsSecurity_Functions { external function fx_test_decrypt_aes_128_ccm_test(in octetstring p_k, in octetstring p_n, in octetstring p_pt) return octetstring; /** - * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption + * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption using Nist-P256 algorithm * @param p_toBeEncryptedSecuredMessage The data to be encrypted * @param p_recipientsPublicKeyX The Recipient's public encryption key X-coordinate * @param p_recipientsPublicKeyY The Recipient's public encryption key Y-coordinate @@ -1815,7 +1914,7 @@ module LibItsSecurity_Functions { external function fx_encryptWithEciesNistp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyX, in Oct32 p_recipientsPublicKeyY, out Oct32 p_publicEphemeralKeyX, out Oct32 p_publicEphemeralKeyY, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; /** - * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption + * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Nist-P256 algorithm * @param p_encryptedSecuredMessage The data to be decrypted * @param p_publicEphemeralKeyX The generated ephemeral key X-coordinate * @param p_publicEphemeralKeyY The generated ephemeral key Y-coordinate @@ -1826,6 +1925,32 @@ module LibItsSecurity_Functions { */ external function fx_decryptWithEciesNistp256WithSha256(in octetstring p_encryptedSecuredMessage, in Oct32 p_privateEncKey, in Oct32 p_publicEphemeralKeyX, in Oct32 p_publicEphemeralKeyY, in Oct16 p_encrypted_sym_key, in Oct16 p_authentication_vector, in Oct12 p_nonce) return octetstring; + /** + * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption using Brainpool-P256 algorithm + * @param p_toBeEncryptedSecuredMessage The data to be encrypted + * @param p_recipientsPublicKeyX The Recipient's public encryption key X-coordinate + * @param p_recipientsPublicKeyY The Recipient's public encryption key Y-coordinate + * @param p_publicEphemeralKeyX The generated ephemeral key X-coordinate + * @param p_publicEphemeralKeyY The generated ephemeral key Y-coordinate + * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key + * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption + * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption + * @return The encrypted message + */ + external function fx_encryptWithEciesBrainpoolp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyX, in Oct32 p_recipientsPublicKeyY, out Oct32 p_publicEphemeralKeyX, out Oct32 p_publicEphemeralKeyY, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; + + /** + * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Brainpool-P256 algorithm + * @param p_encryptedSecuredMessage The data to be decrypted + * @param p_publicEphemeralKeyX The generated ephemeral key X-coordinate + * @param p_publicEphemeralKeyY The generated ephemeral key Y-coordinate + * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key + * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption + * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption + * @return The decrypted message + */ + external function fx_decryptWithEciesBrainpoolp256WithSha256(in octetstring p_encryptedSecuredMessage, in Oct32 p_privateEncKey, in Oct32 p_publicEphemeralKeyX, in Oct32 p_publicEphemeralKeyY, in Oct16 p_encrypted_sym_key, in Oct16 p_authentication_vector, in Oct12 p_nonce) return octetstring; + /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature * @param p_toBeSignedSecuredMessage The data to be signed -- GitLab From 1ee2d939e7ef593cf19ce85b4b7d3d8b4564b4de Mon Sep 17 00:00:00 2001 From: filatov Date: Wed, 4 Apr 2018 20:07:08 +0000 Subject: [PATCH 087/320] add TS102941 modules --- .../1609Dot2/IEEE1609dot2BaseTypes.asn | 2 +- asn1/Security/EtsiTs102941BaseTypes.asn | 124 --------------- asn1/Security/EtsiTs102941Its_sMessages.asn | 135 ---------------- .../EtsiTs102941OfflineDataStructures.asn | 66 -------- asn1/Security/EtsiTs102941TrustLists.asn | 144 ------------------ .../TS102921/EtsiTs102941BaseTypes.asn | 63 ++++++++ .../TS102921/EtsiTs102941MessagesCA.asn | 87 +++++++++++ .../TS102921/EtsiTs102941MessagesItss.asn | 82 ++++++++++ ...siTs102941MessagesItss_OptionalPrivacy.asn | 76 +++++++++ .../TS102921/EtsiTs102941TrustLists.asn | 142 +++++++++++++++++ .../EtsiTs102941TypesAuthorization.asn | 91 +++++++++++ ...siTs102941TypesAuthorizationValidation.asn | 64 ++++++++ .../EtsiTs102941TypesCaManagement.asn | 31 ++++ .../TS102921/EtsiTs102941TypesEnrolment.asn | 67 ++++++++ 14 files changed, 704 insertions(+), 470 deletions(-) delete mode 100755 asn1/Security/EtsiTs102941BaseTypes.asn delete mode 100755 asn1/Security/EtsiTs102941Its_sMessages.asn delete mode 100755 asn1/Security/EtsiTs102941OfflineDataStructures.asn delete mode 100755 asn1/Security/EtsiTs102941TrustLists.asn create mode 100644 asn1/Security/TS102921/EtsiTs102941BaseTypes.asn create mode 100644 asn1/Security/TS102921/EtsiTs102941MessagesCA.asn create mode 100644 asn1/Security/TS102921/EtsiTs102941MessagesItss.asn create mode 100644 asn1/Security/TS102921/EtsiTs102941MessagesItss_OptionalPrivacy.asn create mode 100644 asn1/Security/TS102921/EtsiTs102941TrustLists.asn create mode 100644 asn1/Security/TS102921/EtsiTs102941TypesAuthorization.asn create mode 100644 asn1/Security/TS102921/EtsiTs102941TypesAuthorizationValidation.asn create mode 100644 asn1/Security/TS102921/EtsiTs102941TypesCaManagement.asn create mode 100644 asn1/Security/TS102921/EtsiTs102941TypesEnrolment.asn diff --git a/asn1/Security/1609Dot2/IEEE1609dot2BaseTypes.asn b/asn1/Security/1609Dot2/IEEE1609dot2BaseTypes.asn index 387bf00b..d4965a03 100755 --- a/asn1/Security/1609Dot2/IEEE1609dot2BaseTypes.asn +++ b/asn1/Security/1609Dot2/IEEE1609dot2BaseTypes.asn @@ -11,7 +11,7 @@ dot2(2) base(1) base-types(2) major-version-2(2)} DEFINITIONS AUTOMATIC TAGS ::= BEGIN EXPORTS ALL; - +IMPORTS; -- ------------------------------------------------------------------ -- diff --git a/asn1/Security/EtsiTs102941BaseTypes.asn b/asn1/Security/EtsiTs102941BaseTypes.asn deleted file mode 100755 index 13105c22..00000000 --- a/asn1/Security/EtsiTs102941BaseTypes.asn +++ /dev/null @@ -1,124 +0,0 @@ -EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(0) version1(1) } - --- draft version r6 of 28.09.2017 - -DEFINITIONS AUTOMATIC TAGS ::= BEGIN - -IMPORTS -HashedId8, Time32, PublicEncryptionKey, PublicVerificationKey -FROM -IEEE1609dot2BaseTypes {iso(1) identified-organization(3) ieee(111) -standards-association-numbered-series-standards(2) wave-stds(1609) -dot2(2) base(1) base-types(2) major-version-2(2)} - -CertificateId, SubjectAssurance, SequenceOfPsidSsp, SequenceOfPsidGroupPermissions, ValidityPeriod, GeographicRegion -FROM -IEEE1609dot2 {iso(1) identified-organization(3) ieee(111) -standards-association-numbered-series-standards(2) wave-stds(1609) -dot2(2) base (1) schema (1) major-version-2(2)} - -EtsiTs103097Data-Encrypted, EtsiTs103097Data-SignedExternalPayload -FROM EtsiTs103097Module -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} -; - -AuthorizationResponseCode ::= ENUMERATED { - ok(0), - -- ITS->AA - its-aa-cantparse, -- valid for any structure - its-aa-badcontenttype, -- not encrypted, not signed, not authorizationrequest - its-aa-imnottherecipient, -- the “recipients” of the outermost encrypted data doesn’t include me - its-aa-unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm - its-aa-decryptionfailed, -- works for ECIES-HMAC and AES-CCM - its-aa-keysdontmatch, -- HMAC keyTag verification fails - its-aa-incompleterequest, -- some elements are missing - its-aa-invalidencryptionkey, -- the responseEncryptionKey is bad - its-aa-outofsyncrequest, -- signingTime is outside acceptable limits - its-aa-unknownea, -- the EA identified by eaId is unknown to me - its-aa-invalidea, -- the EA certificate is revoked - its-aa-deniedpermissions, -- I, the AA, deny the requested permissions - -- AA->EA - aa-ea-cantreachea, -- the EA is unreachable (network error?) - -- EA->AA - ea-aa-cantparse, -- valid for any structure - ea-aa-badcontenttype, -- not encrypted, not signed, not authorizationrequest - ea-aa-imnottherecipient, -- the “recipients” of the outermost encrypted data doesn’t include me - ea-aa-unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm - ea-aa-decryptionfailed, -- works for ECIES-HMAC and AES-CCM - -- TODO: to be continued... - invalidaa, -- the AA certificate presented is invalid/revoked/whatever - invalidaasignature, -- the AA certificate presented can’t validate the request signature - wrongea, -- the encrypted signature doesn’t designate me as the EA - unknownits, -- can’t retrieve the EC/ITS in my DB - invalidsignature, -- signature verification of the request by the EC fails - invalidencryptionkey, -- signature is good, but the key is bad - deniedpermissions, -- permissions not granted - deniedtoomanycerts, -- parallel limit - ... } - -AuthorizationValidationResponseCode ::= ENUMERATED { - ok(0), - cantparse, -- valid for any structure - badcontenttype, -- not encrypted, not signed, not permissionsverificationrequest - imnottherecipient, -- the “recipients” of the outermost encrypted data doesn’t include me - unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm - decryptionfailed, -- works for ECIES-HMAC and AES-CCM - invalidaa, -- the AA certificate presented is invalid/revoked/whatever - invalidaasignature, -- the AA certificate presented can’t validate the request signature - wrongea, -- the encrypted signature doesn’t designate me as the EA - unknownits, -- can’t retrieve the EC/ITS in my DB - invalidsignature, -- signature verification of the request by the EC fails - invalidencryptionkey, -- signature is good, but the responseEncryptionKey is bad - deniedpermissions, -- requested permissions not granted - deniedtoomanycerts, -- parallel limit - deniedrequest, -- any other reason? - ... } - -CertificateFormat::= INTEGER{ - ts103097v211 (1) - }(1..255) - -CertificateSubjectAttributes::= SEQUENCE { - id CertificateId OPTIONAL, - validityPeriod ValidityPeriod OPTIONAL, - region GeographicRegion OPTIONAL, - assuranceLevel SubjectAssurance OPTIONAL, - appPermissions SequenceOfPsidSsp OPTIONAL, - certIssuePermissions SequenceOfPsidGroupPermissions OPTIONAL, - ... -}(WITH COMPONENTS { ..., appPermissions PRESENT} | - WITH COMPONENTS { ..., certIssuePermissions PRESENT}) - - -EnrolmentResponseCode ::= ENUMERATED { - ok(0), - cantparse, -- valid for any structure - badcontenttype, -- not encrypted, not signed, not enrolmentrequest - imnottherecipient, -- the “recipients” doesn’t include me - unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm - decryptionfailed, -- works for ECIES-HMAC and AES-CCM - unknownits, -- can’t retrieve the ITS from the itsId - invalidsignature, -- signature verification of the request fails - invalidencryptionkey, -- signature is good, but the responseEncryptionKey is bad - baditsstatus, -- revoked, not yet active - incompleterequest, -- some elements are missing - deniedpermissions, -- requested permissions are not granted - invalidkeys, -- either the verification_key of the encryption_key is bad - deniedrequest, -- any other reason? - ... } - -EcSignature::= CHOICE{ - encryptedEcSignature EtsiTs103097Data-Encrypted{EtsiTs103097Data-SignedExternalPayload}, - ecSignature EtsiTs103097Data-SignedExternalPayload - } - -PublicKeys ::= SEQUENCE { - verificationKey PublicVerificationKey, - encryptionKey PublicEncryptionKey OPTIONAL - } - -Version ::= INTEGER {v1(1)} - - -END diff --git a/asn1/Security/EtsiTs102941Its_sMessages.asn b/asn1/Security/EtsiTs102941Its_sMessages.asn deleted file mode 100755 index cb8c5d1b..00000000 --- a/asn1/Security/EtsiTs102941Its_sMessages.asn +++ /dev/null @@ -1,135 +0,0 @@ -EtsiTs102941Its-sMessages - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) its-sMessages(1) version1(1)} - --- draft version r6 of 28.09.2017 - -DEFINITIONS AUTOMATIC TAGS ::= -BEGIN - -IMPORTS - -EtsiTs103097Certificate, EtsiTs103097Data-Signed, EtsiTs103097Data-Encrypted, EtsiTs103097Data-SignedExternalPayload, EtsiTs103097Data-SignedAndEncrypted -FROM EtsiTs103097Module -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} - -AuthorizationResponseCode, AuthorizationValidationResponseCode, CertificateFormat, CertificateSubjectAttributes,EnrolmentResponseCode, EcSignature, HashedId8, PublicKeys, Version -FROM EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(0) version1(1) } - -; - -/************ --- Messages -************/ - -EnrolmentRequestMessage::= EtsiTs103097Data-SignedAndEncrypted {EtsiTS102941DataIts-s (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentRequest PRESENT})})} -EnrolmentResponseMessage::= EtsiTs103097Data-SignedAndEncrypted {EtsiTS102941DataIts-s (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentResponse PRESENT})})} -AuthorizationRequestMessage::= EtsiTs103097Data-Encrypted {EtsiTS102941DataIts-s (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} -AuthorizationRequestMessageWithPop::= EtsiTs103097Data-Encrypted {EtsiTS102941DataIts-s (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequestWithPop PRESENT})})} -AuthorizationResponseMessage::= EtsiTs103097Data-SignedAndEncrypted {EtsiTS102941DataIts-s (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationResponse PRESENT})})} -AuthorizationValidationRequestMessage::= EtsiTs103097Data-SignedAndEncrypted {EtsiTS102941DataIts-s (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationValidationRequest PRESENT})})} -AuthorizationValidationResponseMessage::= EtsiTs103097Data-SignedAndEncrypted {EtsiTS102941DataIts-s (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationValidationResponse PRESENT})})} - - -/************ --- EtsiTS102941Data -************/ - -EtsiTS102941DataIts-s::= SEQUENCE{ - version Version (v1), - content Content} - -Content ::= CHOICE{ - enrolmentRequest InnerEcRequestSignedForPop, - enrolmentResponse InnerEcResponse, - authorizationRequest InnerAtRequest, - authorizationRequestWithPop InnerAtRequestSignedForPop, - authorizationResponse InnerAtResponse, - authorizationValidationRequest AuthorizationValidationRequest, - authorizationValidationResponse AuthorizationValidationResponse, - caCertificateRequest NULL, - caCertificateResponse NULL, - ... - } - - -/************ --- EnrolmentRequest/Response -************/ - -InnerEcRequestSignedForPop::= EtsiTs103097Data-Signed{InnerEcRequest} - -InnerEcRequest::= SEQUENCE { - itsId IA5String, - certificateFormat CertificateFormat, - publicKeys PublicKeys, - requestedSubjectAttributes CertificateSubjectAttributes (WITH COMPONENTS{certIssuePermissions ABSENT}), - ... - } - -InnerEcResponse ::= SEQUENCE { - requestHash OCTET STRING (SIZE(16)), - responseCode EnrolmentResponseCode, - certificate EtsiTs103097Certificate OPTIONAL, - ... - } - (WITH COMPONENTS { responseCode (ok), certificate PRESENT } - | WITH COMPONENTS { responseCode (ALL EXCEPT ok), certificate ABSENT } - ) - -/************ --- AuthorizationRequest/Response -************/ - -InnerAtRequestSignedForPop::= EtsiTs103097Data-Signed{InnerAtRequest} - -InnerAtRequest ::= SEQUENCE { - publicKeys PublicKeys, - hmacKey OCTET STRING (SIZE(32)), - sharedAtRequest SharedAtRequest, - ecSignature EcSignature, - ... - } - -SharedAtRequest ::= SEQUENCE { - eaId HashedId8, - keyTag OCTET STRING (SIZE(16)), - ertificateFormat CertificateFormat, - requestedSubjectAttributes CertificateSubjectAttributes (WITH COMPONENTS{certIssuePermissions ABSENT}), - ... - } - -InnerAtResponse ::= SEQUENCE { - requestHash OCTET STRING (SIZE(16)), - responseCode AuthorizationResponseCode, - certificate EtsiTs103097Certificate OPTIONAL, - ... - } - (WITH COMPONENTS { responseCode (ok), certificate PRESENT } - | WITH COMPONENTS { responseCode (ALL EXCEPT ok), certificate ABSENT } - ) - -/************ --- AuthorizationValidationRequest/Response -************/ - -AuthorizationValidationRequest ::= SEQUENCE { - sharedAtRequest SharedAtRequest, - ecSignature EcSignature, - ... - } - -AuthorizationValidationResponse ::= SEQUENCE { - requestHash OCTET STRING (SIZE(16)), - responseCode AuthorizationValidationResponseCode, - confirmedSubjectAttributes CertificateSubjectAttributes (WITH COMPONENTS{certIssuePermissions ABSENT}) OPTIONAL, - ... - } - -END - - - - - - diff --git a/asn1/Security/EtsiTs102941OfflineDataStructures.asn b/asn1/Security/EtsiTs102941OfflineDataStructures.asn deleted file mode 100755 index b94bbac3..00000000 --- a/asn1/Security/EtsiTs102941OfflineDataStructures.asn +++ /dev/null @@ -1,66 +0,0 @@ -EtsiTs102941OfflineDataStructures - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) offlineDataStructures(3) version1(1)} - --- draft version r6 of 28.09.2017 - -DEFINITIONS AUTOMATIC TAGS ::= -BEGIN - -IMPORTS - -EtsiTs103097Certificate, EtsiTs103097Data-SignedAndEncrypted, EtsiTs103097Data-Signed -FROM -EtsiTs103097Module -{itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} - -HashedId8, PublicKeys, CertificateSubjectAttributes, EnrolmentResponseCode, Time32, Version -FROM EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941)baseTypes(0) version1(1)} - -; - -/************ --- Messages -************/ - -CaCertificateRequestMessage ::= EtsiTs103097Data-Signed {EtsiTS102941DataCa(WITH COMPONENTS{..., content (WITH COMPONENTS{caCertificateRequest PRESENT})})} -CaCertificateResponseMessage ::= EtsiTs103097Data-Signed {EtsiTS102941DataCa(WITH COMPONENTS{..., content (WITH COMPONENTS{caCertificateResponse PRESENT})})} - -/************ --- EtsiTS102941Data -************/ - -EtsiTS102941DataCa::= SEQUENCE{ - version Version (v1), - content CaContent} - -CaContent ::= CHOICE{ - caCertificateRequest CaCertificateRequest, - caCertificateResponse CaCertificateResponse, - ... - } - - -/************ --- CA certificate request -************/ - -CaCertificateRequest ::= SEQUENCE { - publicKeys PublicKeys, - reqquestedSubjectAttributes CertificateSubjectAttributes, - ... -} - -CaCertificateResponse::=SEQUENCE { - requestHash OCTET STRING (SIZE(16)), - responseCode EnrolmentResponseCode, - certificate EtsiTs103097Certificate OPTIONAL, - ... - } - (WITH COMPONENTS { responseCode (ok), certificate PRESENT } - | WITH COMPONENTS { responseCode (ALL EXCEPT ok), certificate ABSENT } - ) - - -END - diff --git a/asn1/Security/EtsiTs102941TrustLists.asn b/asn1/Security/EtsiTs102941TrustLists.asn deleted file mode 100755 index 62d63a18..00000000 --- a/asn1/Security/EtsiTs102941TrustLists.asn +++ /dev/null @@ -1,144 +0,0 @@ -EtsiTs102941TrustLists - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) trustLists(2) version(1)} - --- draft version r6 of 28.09.2017 - -DEFINITIONS AUTOMATIC TAGS ::= BEGIN - -IMPORTS - -ItsPduHeader -FROM -ITS-Container -{itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1)} - -EtsiTs103097Certificate, EtsiTs103097Data-SignedAndEncrypted, EtsiTs103097Data-Signed -FROM -EtsiTs103097Module -{itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} - -HashedId8, Time32, Version -FROM EtsiTs102941BaseTypes -{itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(0) version1(1)} - -; - -/************ --- Messages -************/ - -CTLM::= SEQUENCE { - header ItsPduHeader, - ctl Ctl, - ... - } - -CRLM::= SEQUENCE { - header ItsPduHeader, - crl Crl, - ... - } - - -/************ --- CRL -************/ -Crl ::= EtsiTs103097Data-Signed{ToBeSignedCrl} - -ToBeSignedCrl ::= SEQUENCE { - version Version, - thisUpdate Time32, - nextUpdate Time32, - entries SEQUENCE OF CRLEntry, - ... -} - -CRLEntry ::= HashedId8 - - -/************ --- CTL -************/ - -Ctl ::= EtsiTs103097Data-Signed{ToBeSignedCtl} - -ToBeSignedCtl::= CtlFormat (FullCtl | DeltaCtl) - -FullCtl::= CtlFormat(WITH COMPONENTS {..., - isFullCtl(TRUE), - ctlCommands(WITH COMPONENT( - (WITH COMPONENTS {..., - delete ABSENT - }) - )) - }) - - -DeltaCtl::= CtlFormat (WITH COMPONENTS {..., - isFullCtl(FALSE) - }) - - -CtlFormat ::= SEQUENCE { - version Version, - nextUpdate Time32, - isFullCtl BOOLEAN, - ctlSequence INTEGER (0..255), - ctlCommands SEQUENCE OF CtlCommand, - ... - } - - -CtlCommand::= CHOICE{ - add CtlEntry, - delete CtlDelete, - ... - } - -CtlEntry ::= CHOICE { - rca RootCaEntry, - ea EaEntry, - aa AaEntry, - dc DcEntry, - tlm TlmEntry, - ... - } - -CtlDelete ::= CHOICE { - cert HashedId8, - dc DcDelete, - ... - } - -RootCaEntry ::= SEQUENCE { - selfsignedRootCa EtsiTs103097Certificate, - linkRootCaCertificate EtsiTs103097Certificate OPTIONAL, - constraints OCTET STRING OPTIONAL -} - -EaEntry ::= SEQUENCE { - eaCertificate EtsiTs103097Certificate, - linkEaCertificate EtsiTs103097Certificate OPTIONAL, - aaAccessPoint Url, - itsAccessPoint Url OPTIONAL } --- First URL is to be used by AA (AuthorizationValidationRequest) --- second URL is to be used by ITS-S (AuthorizationRequest) - -AaEntry ::= SEQUENCE { - aaCertificate EtsiTs103097Certificate, - accessPoint Url - } - -DcEntry::= Url - -DcDelete::= Url - -TlmEntry::= SEQUENCE { - selfSignedTLMCertificate EtsiTs103097Certificate, - linkTLMCertificate EtsiTs103097Certificate OPTIONAL -} - -Url::= IA5String - - -END diff --git a/asn1/Security/TS102921/EtsiTs102941BaseTypes.asn b/asn1/Security/TS102921/EtsiTs102941BaseTypes.asn new file mode 100644 index 00000000..0a489830 --- /dev/null +++ b/asn1/Security/TS102921/EtsiTs102941BaseTypes.asn @@ -0,0 +1,63 @@ +EtsiTs102941BaseTypes +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1) } + +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +IMPORTS +HashedId8, Time32, PublicEncryptionKey, PublicVerificationKey, Signature +FROM +IEEE1609dot2BaseTypes {iso(1) identified-organization(3) ieee(111) +standards-association-numbered-series-standards(2) wave-stds(1609) +dot2(2) base(1) base-types(2) major-version-2(2)} + +CertificateId, SubjectAssurance, SequenceOfPsidSsp, SequenceOfPsidGroupPermissions, ValidityPeriod, GeographicRegion +FROM +IEEE1609dot2 {iso(1) identified-organization(3) ieee(111) +standards-association-numbered-series-standards(2) wave-stds(1609) +dot2(2) base (1) schema (1) major-version-2(2)} + +EtsiTs103097Data-Encrypted, EtsiTs103097Data-Signed, EtsiTs103097Data-SignedExternalPayload +FROM EtsiTs103097Module +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} +; + +CertificateFormat::= INTEGER { + ts103097v131 (1) + }(1..255) + +CertificateSubjectAttributes ::= SEQUENCE { + id CertificateId OPTIONAL, + validityPeriod ValidityPeriod OPTIONAL, + region GeographicRegion OPTIONAL, + assuranceLevel SubjectAssurance OPTIONAL, + appPermissions SequenceOfPsidSsp OPTIONAL, + certIssuePermissions SequenceOfPsidGroupPermissions OPTIONAL, + ... + }(WITH COMPONENTS { ..., appPermissions PRESENT} | + WITH COMPONENTS { ..., certIssuePermissions PRESENT}) + +EcSignature::= CHOICE { + encryptedEcSignature EtsiTs103097Data-Encrypted{EtsiTs103097Data-SignedExternalPayload}, + ecSignature EtsiTs103097Data-SignedExternalPayload + } + +PublicKeys ::= SEQUENCE { + verificationKey PublicVerificationKey, + encryptionKey PublicEncryptionKey OPTIONAL + } + +Version ::= INTEGER {v1(1)} + +EtsiTs103097Data-Encrypted-Unicast {ToBeEncryptedDataContent} ::= EtsiTs103097Data-Encrypted {ToBeEncryptedDataContent} +(WITH COMPONENTS {..., + content (WITH COMPONENTS { + encryptedData (WITH COMPONENTS {..., + recipients (SIZE(1)) + }) + }) +}) + +EtsiTs103097Data-SignedAndEncrypted-Unicast {ToBesignedAndEncryptedDataContent} ::= EtsiTs103097Data-Encrypted-Unicast {EtsiTs103097Data-Signed {ToBesignedAndEncryptedDataContent}} + +END diff --git a/asn1/Security/TS102921/EtsiTs102941MessagesCA.asn b/asn1/Security/TS102921/EtsiTs102941MessagesCA.asn new file mode 100644 index 00000000..13b9c766 --- /dev/null +++ b/asn1/Security/TS102921/EtsiTs102941MessagesCA.asn @@ -0,0 +1,87 @@ +/************************************************************************************* + This file contains the EtsiTs102941Messages module containing all possible PKI messages. + It should be used when all PKI messages needs to be implemented (for example, for CA development) +**************************************************************************************/ +EtsiTs102941MessagesCa + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) messagesCa(0) version1(1)} + +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +IMPORTS + +EtsiTs103097Data-Signed, +--EtsiTs103097Data-Encrypted, +EtsiTs103097Data-SignedExternalPayload +--EtsiTs103097Data-SignedAndEncrypted +FROM EtsiTs103097Module +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} + +Version, +EtsiTs103097Data-Encrypted-Unicast, +EtsiTs103097Data-SignedAndEncrypted-Unicast +FROM EtsiTs102941BaseTypes +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1) } + +InnerEcRequestSignedForPop, InnerEcResponse +FROM EtsiTs102941TypesEnrolment +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) enrolment(4) version1(1) } + +InnerAtRequest, InnerAtResponse +FROM EtsiTs102941TypesAuthorization +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version1(1) } + +ToBeSignedCrl, ToBeSignedTlmCtl, ToBeSignedRcaCtl +FROM EtsiTs102941TrustLists +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) trustLists(6) version1(1) } + +AuthorizationValidationRequest, AuthorizationValidationResponse +FROM EtsiTs102941TypesAuthorizationValidation +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authValidation(7) version1(1) } + +CaCertificateRequest +FROM EtsiTs102941TypesCaManagement +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) caManagement(8) version1(1) } + +; + +/************ +-- Messages +************/ +EnrolmentRequestMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentRequest PRESENT})})} +EnrolmentResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentResponse PRESENT})})} +AuthorizationRequestMessage ::= EtsiTs103097Data-Encrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} +AuthorizationRequestMessageWithPop ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} +AuthorizationResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationResponse PRESENT})})} +CertificateRevocationListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateRevocationList PRESENT})})} +TlmCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListTlm PRESENT})})} +RcaCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListRca PRESENT})})} +AuthorizationValidationRequestMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationValidationRequest PRESENT})})} +AuthorizationValidationResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationValidationResponse PRESENT})})} +CaCertificateRequestMessage ::= EtsiTs103097Data-Signed {EtsiTs102941Data(WITH COMPONENTS{..., content (WITH COMPONENTS{caCertificateRequest PRESENT})})} +CaCertificateRekeyingMessage ::= EtsiTs103097Data-Signed {EtsiTs103097Data-Signed {EtsiTs102941Data(WITH COMPONENTS{..., content (WITH COMPONENTS{caCertificateRequest PRESENT})})}} + +/************ +-- EtsiTs102941Data +************/ + +EtsiTs102941Data::= SEQUENCE { + version Version (v1), + content EtsiTs102941DataContent + } + +EtsiTs102941DataContent ::= CHOICE { + enrolmentRequest InnerEcRequestSignedForPop, + enrolmentResponse InnerEcResponse, + authorizationRequest InnerAtRequest, + authorizationResponse InnerAtResponse, + certificateRevocationList ToBeSignedCrl, + certificateTrustListTlm ToBeSignedTlmCtl, + certificateTrustListRca ToBeSignedRcaCtl, + authorizationValidationRequest AuthorizationValidationRequest, + authorizationValidationResponse AuthorizationValidationResponse, + caCertificateRequest CaCertificateRequest, + ... + } + +END diff --git a/asn1/Security/TS102921/EtsiTs102941MessagesItss.asn b/asn1/Security/TS102921/EtsiTs102941MessagesItss.asn new file mode 100644 index 00000000..b1fc08db --- /dev/null +++ b/asn1/Security/TS102921/EtsiTs102941MessagesItss.asn @@ -0,0 +1,82 @@ +/************************************************************************************* + This file contains the EtsiTs102941MessagesItss module providing the ITS-S subset + of messages defined in the module EtsiTs102941MessagesCA + It should never be imported together with the module EtsiTs102941MessagesCA. + Use the EtsiTs102941MessagesCA if all possible PKI message types are needed. + + This module blocks the usage of unencrypted EC signature for AA requests. +**************************************************************************************/ +EtsiTs102941MessagesItss + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) messagesItss(1) version1(1)} + +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +IMPORTS + +EtsiTs103097Data-Signed +--EtsiTs103097Data-Encrypted, +--EtsiTs103097Data-SignedAndEncrypted +FROM EtsiTs103097Module +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0) } + +EtsiTs103097Data-Encrypted-Unicast, +EtsiTs103097Data-SignedAndEncrypted-Unicast, +Version +FROM EtsiTs102941BaseTypes +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1) } + +InnerEcRequestSignedForPop, InnerEcResponse +FROM EtsiTs102941TypesEnrolment +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) enrolment(4) version1(1) } + +InnerAtRequest, InnerAtResponse +FROM EtsiTs102941TypesAuthorization +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version1(1) } + +ToBeSignedCrl, ToBeSignedTlmCtl, ToBeSignedRcaCtl +FROM EtsiTs102941TrustLists +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) trustLists(6) version1(1) } + +; + +/************ +-- Messages +************/ + +EnrolmentRequestMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentRequest PRESENT})})} +EnrolmentResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentResponse PRESENT})})} +AuthorizationRequestMessage ::= EtsiTs103097Data-Encrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} +AuthorizationRequestMessageWithPop ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} +AuthorizationResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationResponse PRESENT})})} +CertificateRevocationListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateRevocationList PRESENT})})} +TlmCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListTlm PRESENT})})} +RcaCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListRca PRESENT})})} + +/************ +-- EtsiTs102941Data +************/ + +EtsiTs102941Data::= SEQUENCE { + version Version (v1), + content EtsiTs102941DataContent + } + +EtsiTs102941DataContent ::= CHOICE { + enrolmentRequest InnerEcRequestSignedForPop, + enrolmentResponse InnerEcResponse, + authorizationRequest InnerAtRequest, + authorizationResponse InnerAtResponse, + certificateRevocationList ToBeSignedCrl, + certificateTrustListTlm ToBeSignedTlmCtl, + certificateTrustListRca ToBeSignedRcaCtl, + ... + } (WITH COMPONENTS{..., + authorizationRequest (WITH COMPONENTS{..., + ecSignature (WITH COMPONENTS{..., + encryptedEcSignature PRESENT + }) + }) + }) + +END diff --git a/asn1/Security/TS102921/EtsiTs102941MessagesItss_OptionalPrivacy.asn b/asn1/Security/TS102921/EtsiTs102941MessagesItss_OptionalPrivacy.asn new file mode 100644 index 00000000..8447660b --- /dev/null +++ b/asn1/Security/TS102921/EtsiTs102941MessagesItss_OptionalPrivacy.asn @@ -0,0 +1,76 @@ +/************************************************************************************* + This file contains the EtsiTs102941MessagesItss-OptionalPrivacy module providing the + same subset of messages as the EtsiTs102941MessagesItss module. + It should never be used together with the EtsiTs102941MessagesCA and EtsiTs102941MessagesItss + + This module allows the usage of unencrypted EC signature for AA requests. +**************************************************************************************/ +EtsiTs102941MessagesItss-OptionalPrivacy + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) messagesItssOp(2) version1(1)} + +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +IMPORTS + +EtsiTs103097Data-Signed +--EtsiTs103097Data-Encrypted, +--EtsiTs103097Data-SignedAndEncrypted +FROM EtsiTs103097Module +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0) } + +EtsiTs103097Data-Encrypted-Unicast, +EtsiTs103097Data-SignedAndEncrypted-Unicast, +Version +FROM EtsiTs102941BaseTypes +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1) } + +InnerEcRequestSignedForPop, InnerEcResponse +FROM EtsiTs102941TypesEnrolment +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) enrolment(4) version1(1) } + +InnerAtRequest, +InnerAtRequestSignedForPop, InnerAtResponse +FROM EtsiTs102941TypesAuthorization +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version1(1) } + +ToBeSignedCrl, ToBeSignedTlmCtl, ToBeSignedRcaCtl +FROM EtsiTs102941TrustLists +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) trustLists(6) version1(1) } + +; + +/************ +-- Messages +************/ + +EnrolmentRequestMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentRequest PRESENT})})} +EnrolmentResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentResponse PRESENT})})} +AuthorizationRequestMessage ::= EtsiTs103097Data-Encrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} +AuthorizationRequestMessageWithPop ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} +AuthorizationResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationResponse PRESENT})})} +CertificateRevocationListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateRevocationList PRESENT})})} +TlmCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListTlm PRESENT})})} +RcaCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListRca PRESENT})})} + +/************ +-- EtsiTs102941Data +************/ + +EtsiTs102941Data::= SEQUENCE { + version Version (v1), + content EtsiTs102941DataContent + } + +EtsiTs102941DataContent ::= CHOICE { + enrolmentRequest InnerEcRequestSignedForPop, + enrolmentResponse InnerEcResponse, + authorizationRequest InnerAtRequest, + authorizationResponse InnerAtResponse, + certificateRevocationList ToBeSignedCrl, + certificateTrustListTlm ToBeSignedTlmCtl, + certificateTrustListRca ToBeSignedRcaCtl, + ... + } + +END diff --git a/asn1/Security/TS102921/EtsiTs102941TrustLists.asn b/asn1/Security/TS102921/EtsiTs102941TrustLists.asn new file mode 100644 index 00000000..5b0434ed --- /dev/null +++ b/asn1/Security/TS102921/EtsiTs102941TrustLists.asn @@ -0,0 +1,142 @@ +EtsiTs102941TrustLists + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) trustLists(6) version1(1)} + +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +IMPORTS + +EtsiTs103097Certificate, EtsiTs103097Data-SignedAndEncrypted, EtsiTs103097Data-Signed +FROM +EtsiTs103097Module +{itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} + +HashedId8, Time32, Version --, CertificateAuthorityConstraints +FROM EtsiTs102941BaseTypes +{itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1)} + +; + +/************ +-- CRL +************/ +ToBeSignedCrl ::= SEQUENCE { + version Version, + thisUpdate Time32, + nextUpdate Time32, + entries SEQUENCE OF CrlEntry, + ... +} + +CrlEntry ::= HashedId8 + +/************ +-- TLM CTL +************/ + +ToBeSignedTlmCtl ::= CtlFormat (FullCtl | DeltaCtl) (WITH COMPONENTS {..., + ctlCommands ( WITH COMPONENT( + ( WITH COMPONENTS {..., + add ( WITH COMPONENTS {..., + ea ABSENT, + aa ABSENT + }) + }) + )) +}) + +/************ +-- RCA CTL +************/ + +ToBeSignedRcaCtl ::= CtlFormat (FullCtl | DeltaCtl) ( WITH COMPONENTS {..., + ctlCommands ( WITH COMPONENT( + ( WITH COMPONENTS {..., + add ( WITH COMPONENTS {..., + rca ABSENT, + tlm ABSENT + }) + }) + )) +}) + +/************ +-- CTL +************/ + +FullCtl::= CtlFormat ( WITH COMPONENTS {..., + isFullCtl ( TRUE ), + ctlCommands ( WITH COMPONENT( + ( WITH COMPONENTS {..., + delete ABSENT + }) + )) +}) + +DeltaCtl::= CtlFormat (WITH COMPONENTS {..., + isFullCtl(FALSE) +}) + + +CtlFormat ::= SEQUENCE { + version Version, + nextUpdate Time32, + isFullCtl BOOLEAN, + ctlSequence INTEGER (0..255), + ctlCommands SEQUENCE OF CtlCommand, + ... +} + +CtlCommand ::= CHOICE { + add CtlEntry, + delete CtlDelete, + ... +} + +CtlEntry ::= CHOICE { + rca RootCaEntry, + ea EaEntry, + aa AaEntry, + dc DcEntry, + tlm TlmEntry, + ... +} + +CtlDelete ::= CHOICE { + cert HashedId8, + dc DcDelete, + ... +} + +TlmEntry::= SEQUENCE { + selfSignedTLMCertificate EtsiTs103097Certificate, + linkTLMCertificate EtsiTs103097Certificate OPTIONAL, + accessPoint Url +} + +RootCaEntry ::= SEQUENCE { + selfsignedRootCa EtsiTs103097Certificate, + linkRootCaCertificate EtsiTs103097Certificate OPTIONAL +} + +EaEntry ::= SEQUENCE { + eaCertificate EtsiTs103097Certificate, + aaAccessPoint Url, + itsAccessPoint Url OPTIONAL +} + +AaEntry ::= SEQUENCE { + aaCertificate EtsiTs103097Certificate, + accessPoint Url +} + +DcEntry ::= SEQUENCE { + url Url, + cert SEQUENCE OF HashedId8 +} + +DcDelete ::= Url + +Url::= IA5String + +END diff --git a/asn1/Security/TS102921/EtsiTs102941TypesAuthorization.asn b/asn1/Security/TS102921/EtsiTs102941TypesAuthorization.asn new file mode 100644 index 00000000..c30ab1e2 --- /dev/null +++ b/asn1/Security/TS102921/EtsiTs102941TypesAuthorization.asn @@ -0,0 +1,91 @@ +EtsiTs102941TypesAuthorization + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version1(1)} + +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +IMPORTS + +EtsiTs103097Certificate, +EtsiTs103097Data-Signed +FROM EtsiTs103097Module +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} + +CertificateFormat, CertificateSubjectAttributes, EcSignature, HashedId8, PublicKeys, Version +FROM EtsiTs102941BaseTypes +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1) } + +; + +/************ +-- AuthorizationRequest/Response +************/ + +AuthorizationResponseCode ::= ENUMERATED { + ok(0), + -- ITS->AA + its-aa-cantparse, -- valid for any structure + its-aa-badcontenttype, -- not encrypted, not signed, not authorizationrequest + its-aa-imnottherecipient, -- the “recipients” of the outermost encrypted data doesn’t include me + its-aa-unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm + its-aa-decryptionfailed, -- works for ECIES-HMAC and AES-CCM + its-aa-keysdontmatch, -- HMAC keyTag verification fails + its-aa-incompleterequest, -- some elements are missing + its-aa-invalidencryptionkey, -- the responseEncryptionKey is bad + its-aa-outofsyncrequest, -- signingTime is outside acceptable limits + its-aa-unknownea, -- the EA identified by eaId is unknown to me + its-aa-invalidea, -- the EA certificate is revoked + its-aa-deniedpermissions, -- I, the AA, deny the requested permissions + -- AA->EA + aa-ea-cantreachea, -- the EA is unreachable (network error?) + -- EA->AA + ea-aa-cantparse, -- valid for any structure + ea-aa-badcontenttype, -- not encrypted, not signed, not authorizationrequest + ea-aa-imnottherecipient, -- the “recipients” of the outermost encrypted data doesn’t include me + ea-aa-unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm + ea-aa-decryptionfailed, -- works for ECIES-HMAC and AES-CCM + -- TODO: to be continued... + invalidaa, -- the AA certificate presented is invalid/revoked/whatever + invalidaasignature, -- the AA certificate presented can’t validate the request signature + wrongea, -- the encrypted signature doesn’t designate me as the EA + unknownits, -- can’t retrieve the EC/ITS in my DB + invalidsignature, -- signature verification of the request by the EC fails + invalidencryptionkey, -- signature is good, but the key is bad + deniedpermissions, -- permissions not granted + deniedtoomanycerts, -- parallel limit + ... } + + +InnerAtRequest ::= SEQUENCE { + publicKeys PublicKeys, + hmacKey OCTET STRING (SIZE(32)), + sharedAtRequest SharedAtRequest, + ecSignature EcSignature, + ... + } + +SharedAtRequest ::= SEQUENCE { + eaId HashedId8, + keyTag OCTET STRING (SIZE(16)), + certificateFormat CertificateFormat, + requestedSubjectAttributes CertificateSubjectAttributes (WITH COMPONENTS{certIssuePermissions ABSENT}), + ... + } + +InnerAtResponse ::= SEQUENCE { + requestHash OCTET STRING (SIZE(16)), + responseCode AuthorizationResponseCode, + certificate EtsiTs103097Certificate OPTIONAL, + ... + } + (WITH COMPONENTS { responseCode (ok), certificate PRESENT } + | WITH COMPONENTS { responseCode (ALL EXCEPT ok), certificate ABSENT } + ) + +END + + + + + + diff --git a/asn1/Security/TS102921/EtsiTs102941TypesAuthorizationValidation.asn b/asn1/Security/TS102921/EtsiTs102941TypesAuthorizationValidation.asn new file mode 100644 index 00000000..9ee99110 --- /dev/null +++ b/asn1/Security/TS102921/EtsiTs102941TypesAuthorizationValidation.asn @@ -0,0 +1,64 @@ +EtsiTs102941TypesAuthorizationValidation + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authValidation(7) version1(1)} + +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +IMPORTS + +EtsiTs103097Certificate +FROM EtsiTs103097Module +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} + +CertificateFormat, CertificateSubjectAttributes,EcSignature, HashedId8, PublicKeys, Version +FROM EtsiTs102941BaseTypes +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1) } + +SharedAtRequest +FROM EtsiTs102941TypesAuthorization +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version1(1)} + +; + +/************ +-- AuthorizationValidationRequest/Response +************/ + +AuthorizationValidationResponseCode ::= ENUMERATED { + ok(0), + cantparse, -- valid for any structure + badcontenttype, -- not encrypted, not signed, not permissionsverificationrequest + imnottherecipient, -- the “recipients” of the outermost encrypted data doesn’t include me + unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm + decryptionfailed, -- works for ECIES-HMAC and AES-CCM + invalidaa, -- the AA certificate presented is invalid/revoked/whatever + invalidaasignature, -- the AA certificate presented can’t validate the request signature + wrongea, -- the encrypted signature doesn’t designate me as the EA + unknownits, -- can’t retrieve the EC/ITS in my DB + invalidsignature, -- signature verification of the request by the EC fails + invalidencryptionkey, -- signature is good, but the responseEncryptionKey is bad + deniedpermissions, -- requested permissions not granted + deniedtoomanycerts, -- parallel limit + deniedrequest, -- any other reason? + ... } + +AuthorizationValidationRequest ::= SEQUENCE { + sharedAtRequest SharedAtRequest, + ecSignature EcSignature, + ... + } + +AuthorizationValidationResponse ::= SEQUENCE { + requestHash OCTET STRING (SIZE(16)), + responseCode AuthorizationValidationResponseCode, + confirmedSubjectAttributes CertificateSubjectAttributes (WITH COMPONENTS{certIssuePermissions ABSENT}) OPTIONAL, + ... + } + +END + + + + + + diff --git a/asn1/Security/TS102921/EtsiTs102941TypesCaManagement.asn b/asn1/Security/TS102921/EtsiTs102941TypesCaManagement.asn new file mode 100644 index 00000000..59465c98 --- /dev/null +++ b/asn1/Security/TS102921/EtsiTs102941TypesCaManagement.asn @@ -0,0 +1,31 @@ +EtsiTs102941TypesCaManagement + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) caManagement(8) version1(1)} + +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +IMPORTS + +EtsiTs103097Certificate, EtsiTs103097Data-Signed +FROM +EtsiTs103097Module +{itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} + +PublicKeys, CertificateSubjectAttributes +FROM EtsiTs102941BaseTypes +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1)} + +; + +/************ +-- CA certificate request +************/ + +CaCertificateRequest ::= SEQUENCE { + publicKeys PublicKeys, + requestedSubjectAttributes CertificateSubjectAttributes, + ... +} + +END + diff --git a/asn1/Security/TS102921/EtsiTs102941TypesEnrolment.asn b/asn1/Security/TS102921/EtsiTs102941TypesEnrolment.asn new file mode 100644 index 00000000..04a4a1be --- /dev/null +++ b/asn1/Security/TS102921/EtsiTs102941TypesEnrolment.asn @@ -0,0 +1,67 @@ +EtsiTs102941TypesEnrolment + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) enrolment(4) version1(1)} + +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +IMPORTS + +EtsiTs103097Certificate, +EtsiTs103097Data-Signed +FROM EtsiTs103097Module +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} + +CertificateFormat, CertificateSubjectAttributes, EcSignature, HashedId8, PublicKeys, Version +FROM EtsiTs102941BaseTypes +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1) } + +; + +/************ +-- EnrolmentRequest/Response +************/ + +EnrolmentResponseCode ::= ENUMERATED { + ok(0), + cantparse, -- valid for any structure + badcontenttype, -- not encrypted, not signed, not enrolmentrequest + imnottherecipient, -- the “recipients†doesn’t include me + unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm + decryptionfailed, -- works for ECIES-HMAC and AES-CCM + unknownits, -- can’t retrieve the ITS from the itsId + invalidsignature, -- signature verification of the request fails + invalidencryptionkey, -- signature is good, but the responseEncryptionKey is bad + baditsstatus, -- revoked, not yet active + incompleterequest, -- some elements are missing + deniedpermissions, -- requested permissions are not granted + invalidkeys, -- either the verification_key of the encryption_key is bad + deniedrequest, -- any other reason? + ... } + +InnerEcRequestSignedForPop::= EtsiTs103097Data-Signed{InnerEcRequest} + +InnerEcRequest ::= SEQUENCE { + itsId IA5String, + certificateFormat CertificateFormat, + publicKeys PublicKeys, + requestedSubjectAttributes CertificateSubjectAttributes (WITH COMPONENTS{certIssuePermissions ABSENT}), + ... + } + +InnerEcResponse ::= SEQUENCE { + requestHash OCTET STRING (SIZE(16)), + responseCode EnrolmentResponseCode, + certificate EtsiTs103097Certificate OPTIONAL, + ... + } + (WITH COMPONENTS { responseCode (ok), certificate PRESENT } + | WITH COMPONENTS { responseCode (ALL EXCEPT ok), certificate ABSENT } + ) + +END + + + + + + -- GitLab From eba7a6babc5d8c6da4d8de9aae543d9a772dcca1 Mon Sep 17 00:00:00 2001 From: filatov Date: Wed, 4 Apr 2018 20:08:16 +0000 Subject: [PATCH 088/320] fix ASN.1 warnings --- asn1/IS/ISO_TS_14906/EfcDsrcApplication.asn | 5 +++-- asn1/ITS-Container/ITS_Container.asn | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/asn1/IS/ISO_TS_14906/EfcDsrcApplication.asn b/asn1/IS/ISO_TS_14906/EfcDsrcApplication.asn index 211f3794..f5f1db97 100644 --- a/asn1/IS/ISO_TS_14906/EfcDsrcApplication.asn +++ b/asn1/IS/ISO_TS_14906/EfcDsrcApplication.asn @@ -18,8 +18,9 @@ IMPORTS CountryCode, CS5, AVIAEIIssuerIdentifier FROM AVIAEINumberingAndDataStructures {iso(1) standard(0) iso14816(14816) asnm1(1) version1(1)} -- defined in ISO 14816 -- -AttributeIdList -FROM EfcDsrcGeneric {iso(1) standard(0) 14906 generic(1) version5(5)}; +-- AttributeIdList +-- FROM EfcDsrcGeneric {iso(1) standard(0) 14906 generic(1) version5(5)}; +; -- NOTE: The following are the definitions of the action and response -- parameters diff --git a/asn1/ITS-Container/ITS_Container.asn b/asn1/ITS-Container/ITS_Container.asn index e57ad63f..a67ab8c8 100644 --- a/asn1/ITS-Container/ITS_Container.asn +++ b/asn1/ITS-Container/ITS_Container.asn @@ -6,6 +6,8 @@ DEFINITIONS AUTOMATIC TAGS ::= BEGIN +IMPORTS; + ItsPduHeader ::= SEQUENCE { protocolVersion INTEGER{currentVersion(1)} (0..255), messageID INTEGER{ denm(1), cam(2), poi(3), spatem(4), mapem(5), ivim(6), ev-rsr(7), tistpgtransaction(8), srem(9), ssem(10), evcsn(11) } (0..255), -- Mantis #7209, #7005 -- GitLab From 8fa5e0d936c046cbcf15be40a08c6b148375138d Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 5 Apr 2018 09:03:07 +0000 Subject: [PATCH 089/320] STF525: Add encryption support in Test System STF545: Start TestSystem support --- ttcn/Pki/LibItsPki_TestSystem.ttcn | 47 +++++++++++++++++++++ ttcn/Security/LibItsSecurity_Functions.ttcn | 19 ++++++--- 2 files changed, 60 insertions(+), 6 deletions(-) create mode 100644 ttcn/Pki/LibItsPki_TestSystem.ttcn diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn new file mode 100644 index 00000000..2bd6f88d --- /dev/null +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -0,0 +1,47 @@ +/** + * @author ETSI / STF545 + * @version $URL$ + * $Id$ + * @desc Test System module for ITS PKI + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * + */ +module LibItsPki_TestSystem { + + // LibItsCommon + import from LibItsCommon_TestSystem all; + + // LibIts + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + import from IEEE1609dot2 language "ASN.1:1997" all; + import from EtsiTs103097Module language "ASN.1:1997" all; + import from EtsiTs102941Its_sMessages language "ASN.1:1997" all; + import from EtsiTs102941OfflineDataStructures language "ASN.1:1997" all; + + // LibItsPki + + type port PkiPort message { + in PkiInd; + out PkiReq; + } // End of port PkiPort + + type component ItsPkiSystem { + port PkiPort pkiPort; + } // End of component ItsPkiSystem + + type component ItsPki extends ItsBaseComponent { + port PkiPort pkiPort; + } // End of component ItsPki + + type record PkiReq { + + } // End of type PkiReq + + type record PkiInd { + + } // End of type PkiInd + +} // End of module LibItsPki_TestSystem diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 28400970..cb4caeea 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -110,7 +110,7 @@ module LibItsSecurity_Functions { in EtsiTs103097Data p_encrypedSecuredMessage, out EtsiTs103097Data p_decrypedSecuredMessage ) return boolean { - if (not(ischosen(p_encrypedSecuredMessage.content.encryptedData))) { + if (ischosen(p_encrypedSecuredMessage.content.encryptedData)) { var PKRecipientInfo v_pKRecipientInfo; var RecipientInfo v_recipientInfo := p_encrypedSecuredMessage.content.encryptedData.recipients[0]; @@ -121,13 +121,14 @@ module LibItsSecurity_Functions { } if (ischosen(v_recipientInfo.certRecipInfo)) { - v_pKRecipientInfo := p_encrypedSecuredMessage.content.encryptedData.recipients[0].certRecipInfo; - // Read the certificate based on the recipientId + v_pKRecipientInfo := p_encrypedSecuredMessage.content.encryptedData.recipients[0].certRecipInfo; + // Read the certificate based on the recipientId } else if (ischosen(v_recipientInfo.signedDataRecipInfo)) { - v_pKRecipientInfo := p_encrypedSecuredMessage.content.encryptedData.recipients[0].signedDataRecipInfo; - // Read the certificate based on the recipientId + v_pKRecipientInfo := p_encrypedSecuredMessage.content.encryptedData.recipients[0].signedDataRecipInfo; + // Read the certificate based on the recipientId } else { - return false; + log("*** " & testcasename() & ":ERROR: Unsupported RecipientInfo variant ***"); + return false; } if (ischosen(v_pKRecipientInfo.encKey.eciesNistP256)) { @@ -146,6 +147,8 @@ module LibItsSecurity_Functions { var bitstring v_decode := oct2bit(v_decryptedSecuredMessage); if (decvalue(v_decode, p_decrypedSecuredMessage) == 0) { return true; + } else { + log("*** " & testcasename() & ":ERROR: Faild to decode secured message ***"); } } } else if (ischosen(v_pKRecipientInfo.encKey.eciesBrainpoolP256r1)) { @@ -164,9 +167,13 @@ module LibItsSecurity_Functions { var bitstring v_decode := oct2bit(v_decryptedSecuredMessage); if (decvalue(v_decode, p_decrypedSecuredMessage) == 0) { return true; + } else { + log("*** " & testcasename() & ":ERROR: Faild to decode secured message ***"); } } } + } else { + log("*** " & testcasename() & ":ERROR: Message not encrypted ***"); } return false; -- GitLab From 18406aa2d1239a7dabf5633f7c617d1fa64b744b Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 5 Apr 2018 12:23:19 +0000 Subject: [PATCH 090/320] STF525: Remove undefined data structure InnerAtRequestSignedForPop --- .../TS102921/EtsiTs102941MessagesItss_OptionalPrivacy.asn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asn1/Security/TS102921/EtsiTs102941MessagesItss_OptionalPrivacy.asn b/asn1/Security/TS102921/EtsiTs102941MessagesItss_OptionalPrivacy.asn index 8447660b..fcce41a0 100644 --- a/asn1/Security/TS102921/EtsiTs102941MessagesItss_OptionalPrivacy.asn +++ b/asn1/Security/TS102921/EtsiTs102941MessagesItss_OptionalPrivacy.asn @@ -30,7 +30,7 @@ FROM EtsiTs102941TypesEnrolment { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) enrolment(4) version1(1) } InnerAtRequest, -InnerAtRequestSignedForPop, InnerAtResponse +InnerAtResponse FROM EtsiTs102941TypesAuthorization { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version1(1) } -- GitLab From 9cae940ef8a3cfb5db74ed4cac693fd4ec5422c7 Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 6 Apr 2018 12:54:33 +0000 Subject: [PATCH 091/320] STF538: Start ATS validation --- ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn | 5 ++--- ttcn/Pki/LibItsPki_TestSystem.ttcn | 9 +++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn index 656e81a6..ce4d58e4 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn @@ -1654,7 +1654,6 @@ module LibItsGeoNetworking_Functions { function f_prNeighbour() runs on ItsGeoNetworking { f_prDefault(); f_startBeingNeighbour(); - f_sleep(0.5); } /** @@ -1911,11 +1910,11 @@ module LibItsGeoNetworking_Functions { } [] acPort.receive { tc_ac.stop; - log("*** f_acTriggerEvent: ERROR: Received unexpected message ***"); + log("*** f_acTriggerGnssEvent: ERROR: Received unexpected message ***"); f_selfOrClientSyncAndVerdict("error", e_error); } [] tc_ac.timeout { - log("*** f_acTriggerEvent: ERROR: Timeout while waiting for adapter control event result ***"); + log("*** f_acTriggerGnssEvent: ERROR: Timeout while waiting for adapter control event result ***"); f_selfOrClientSyncAndVerdict("error", e_timeout); } } diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index 2bd6f88d..d7ad9b51 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -18,8 +18,13 @@ module LibItsPki_TestSystem { import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; import from IEEE1609dot2 language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; - import from EtsiTs102941Its_sMessages language "ASN.1:1997" all; - import from EtsiTs102941OfflineDataStructures language "ASN.1:1997" all; + import from EtsiTs102941BaseTypes language "ASN.1:1997" all; + import from EtsiTs103097Module language "ASN.1:1997" all; + import from EtsiTs102941BaseTypes language "ASN.1:1997" all; + import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; + import from EtsiTs102941TypesAuthorization language "ASN.1:1997" all; + import from EtsiTs102941TrustLists language "ASN.1:1997" all; + import from EtsiTs102941MessagesItss language "ASN.1:1997" all; // LibItsPki -- GitLab From 2a1b44d28b2c2bc8c9e21333ba9a336d875399b9 Mon Sep 17 00:00:00 2001 From: filatov Date: Tue, 17 Apr 2018 20:45:41 +0000 Subject: [PATCH 092/320] fix compilation errors --- ttcn/Pki/LibItsPki_TestSystem.ttcn | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index d7ad9b51..eb1d0734 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -18,13 +18,12 @@ module LibItsPki_TestSystem { import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; import from IEEE1609dot2 language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; - import from EtsiTs102941BaseTypes language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; + import from EtsiTs102941MessagesCa language "ASN.1:1997" all; import from EtsiTs102941BaseTypes language "ASN.1:1997" all; import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; import from EtsiTs102941TypesAuthorization language "ASN.1:1997" all; import from EtsiTs102941TrustLists language "ASN.1:1997" all; - import from EtsiTs102941MessagesItss language "ASN.1:1997" all; + import from EtsiTs103097Module language "ASN.1:1997" all; // LibItsPki -- GitLab From b616c4f243add0a58d6f90ef00ea00a8f1f4a7b4 Mon Sep 17 00:00:00 2001 From: filatov Date: Wed, 25 Apr 2018 09:07:38 +0000 Subject: [PATCH 093/320] fix executable flag on files --- asn1/IS/ETSI_TS_103301/IVIM_PDU_Descriptions.asn | 0 asn1/IS/ETSI_TS_103301/MAPEM_PDU_Descriptions.asn | 0 asn1/IS/ETSI_TS_103301/SPATEM_PDU_Descriptions.asn | 0 asn1/IS/ETSI_TS_103301/SREM_PDU_Descriptions.asn | 0 asn1/IS/ETSI_TS_103301/SSEM_PDU_Descriptions.asn | 0 asn1/IS/ISO_TS_19091/AddGrpC.asn | 0 asn1/IS/ISO_TS_19091/DSRC.asn | 0 asn1/IS/ISO_TS_19091/REGION.asn | 0 asn1/IS/ISO_TS_19091/original/AddGrpC.asn | 0 asn1/IS/ISO_TS_19091/original/DSRC.asn | 0 asn1/IS/ISO_TS_19091/original/REGION.asn | 0 asn1/Security/1609Dot2/IEEE1609dot2.asn | 0 asn1/Security/1609Dot2/IEEE1609dot2BaseTypes.asn | 0 asn1/Security/EtsiTs103097Module.asn | 0 14 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 asn1/IS/ETSI_TS_103301/IVIM_PDU_Descriptions.asn mode change 100755 => 100644 asn1/IS/ETSI_TS_103301/MAPEM_PDU_Descriptions.asn mode change 100755 => 100644 asn1/IS/ETSI_TS_103301/SPATEM_PDU_Descriptions.asn mode change 100755 => 100644 asn1/IS/ETSI_TS_103301/SREM_PDU_Descriptions.asn mode change 100755 => 100644 asn1/IS/ETSI_TS_103301/SSEM_PDU_Descriptions.asn mode change 100755 => 100644 asn1/IS/ISO_TS_19091/AddGrpC.asn mode change 100755 => 100644 asn1/IS/ISO_TS_19091/DSRC.asn mode change 100755 => 100644 asn1/IS/ISO_TS_19091/REGION.asn mode change 100755 => 100644 asn1/IS/ISO_TS_19091/original/AddGrpC.asn mode change 100755 => 100644 asn1/IS/ISO_TS_19091/original/DSRC.asn mode change 100755 => 100644 asn1/IS/ISO_TS_19091/original/REGION.asn mode change 100755 => 100644 asn1/Security/1609Dot2/IEEE1609dot2.asn mode change 100755 => 100644 asn1/Security/1609Dot2/IEEE1609dot2BaseTypes.asn mode change 100755 => 100644 asn1/Security/EtsiTs103097Module.asn diff --git a/asn1/IS/ETSI_TS_103301/IVIM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/IVIM_PDU_Descriptions.asn old mode 100755 new mode 100644 diff --git a/asn1/IS/ETSI_TS_103301/MAPEM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/MAPEM_PDU_Descriptions.asn old mode 100755 new mode 100644 diff --git a/asn1/IS/ETSI_TS_103301/SPATEM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/SPATEM_PDU_Descriptions.asn old mode 100755 new mode 100644 diff --git a/asn1/IS/ETSI_TS_103301/SREM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/SREM_PDU_Descriptions.asn old mode 100755 new mode 100644 diff --git a/asn1/IS/ETSI_TS_103301/SSEM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/SSEM_PDU_Descriptions.asn old mode 100755 new mode 100644 diff --git a/asn1/IS/ISO_TS_19091/AddGrpC.asn b/asn1/IS/ISO_TS_19091/AddGrpC.asn old mode 100755 new mode 100644 diff --git a/asn1/IS/ISO_TS_19091/DSRC.asn b/asn1/IS/ISO_TS_19091/DSRC.asn old mode 100755 new mode 100644 diff --git a/asn1/IS/ISO_TS_19091/REGION.asn b/asn1/IS/ISO_TS_19091/REGION.asn old mode 100755 new mode 100644 diff --git a/asn1/IS/ISO_TS_19091/original/AddGrpC.asn b/asn1/IS/ISO_TS_19091/original/AddGrpC.asn old mode 100755 new mode 100644 diff --git a/asn1/IS/ISO_TS_19091/original/DSRC.asn b/asn1/IS/ISO_TS_19091/original/DSRC.asn old mode 100755 new mode 100644 diff --git a/asn1/IS/ISO_TS_19091/original/REGION.asn b/asn1/IS/ISO_TS_19091/original/REGION.asn old mode 100755 new mode 100644 diff --git a/asn1/Security/1609Dot2/IEEE1609dot2.asn b/asn1/Security/1609Dot2/IEEE1609dot2.asn old mode 100755 new mode 100644 diff --git a/asn1/Security/1609Dot2/IEEE1609dot2BaseTypes.asn b/asn1/Security/1609Dot2/IEEE1609dot2BaseTypes.asn old mode 100755 new mode 100644 diff --git a/asn1/Security/EtsiTs103097Module.asn b/asn1/Security/EtsiTs103097Module.asn old mode 100755 new mode 100644 -- GitLab From 0f7e7d9409760b1fc42a7555b0a7f4d696c70ee8 Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 27 Apr 2018 06:42:10 +0000 Subject: [PATCH 094/320] Major security bugs fixed for signature. Encryption to do. --- ttcn/Pki/LibItsPki_Templates.ttcn | 53 +++++ ttcn/Pki/LibItsPki_TestSystem.ttcn | 5 +- ttcn/Security/LibItsSecurity_Functions.ttcn | 233 +++++++++++++++----- ttcn/Security/LibItsSecurity_Templates.ttcn | 72 ++---- 4 files changed, 249 insertions(+), 114 deletions(-) create mode 100644 ttcn/Pki/LibItsPki_Templates.ttcn diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn new file mode 100644 index 00000000..87f084f3 --- /dev/null +++ b/ttcn/Pki/LibItsPki_Templates.ttcn @@ -0,0 +1,53 @@ +/** + * @author ETSI / STF545 + * @version $URL$ + * $Id$ + * @desc Module containing templates for IT PKI Protocol + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * + */ +module LibItsPki_Templates { + + // LibIts + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + import from IEEE1609dot2 language "ASN.1:1997" all; + import from EtsiTs102941BaseTypes language "ASN.1:1997" all; + import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; + import from EtsiTs102941MessagesItss language "ASN.1:1997" all; + import from EtsiTs103097Module language "ASN.1:1997" all; + + // LibItsCommon + import from LibItsCommon_TypesAndValues all; + import from LibItsCommon_Functions all; + import from LibItsCommon_TypesAndValues all; + import from LibItsCommon_ASN1_NamedNumbers all; + + // LibItsSecurity + import from LibItsSecurity_Templates all; + + template (value) EnrolmentRequestMessage m_enrolmentRequestMessage( + in template (value) EncryptedData p_encryptedData + ) modifies m_etsiTs103097Data_encrypted := { + } // End of template m_enrolmentRequestMessage + + template (value) EtsiTs102941DataContent m_enrolmentRequest( + in template (value) InnerEcRequestSignedForPop p_enrolmentRequest + ) := { + enrolmentRequest := p_enrolmentRequest + } // End of template m_enrolmentRequest + + template (value) InnerEcRequest m_innerEcRequest( + in template (value) charstring p_itsId, + in template (value) PublicKeys p_publicKeys, + in template (value) CertificateSubjectAttributes p_requestedSubjectAttributes //(WITH COMPONENTS{certIssuePermissions ABSENT}), + ) := { + itsId := p_itsId, + certificateFormat := 1, + publicKeys := p_publicKeys, + requestedSubjectAttributes := p_requestedSubjectAttributes + } // End of template m_innerEcRequest + +} // End of module LibItsPki_Templates \ No newline at end of file diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index eb1d0734..826018c5 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -17,12 +17,9 @@ module LibItsPki_TestSystem { // LibIts import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; import from IEEE1609dot2 language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; - import from EtsiTs102941MessagesCa language "ASN.1:1997" all; import from EtsiTs102941BaseTypes language "ASN.1:1997" all; import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; - import from EtsiTs102941TypesAuthorization language "ASN.1:1997" all; - import from EtsiTs102941TrustLists language "ASN.1:1997" all; + import from EtsiTs102941MessagesItss language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; // LibItsPki diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index cb4caeea..d2e1463a 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -359,53 +359,105 @@ module LibItsSecurity_Functions { * @desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified * @param p_signature The signature - * @param p_ecdsaNistp256PublicKeyX The public key (x coordinate) - * @param p_ecdsaNistp256PublicKeyY The public key (y coordinate) + * @param p_ecdsaNistp256PublicKeyCompressed The compressed public key + * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @return true on success, false otherwise */ function f_verifyWithEcdsaNistp256WithSha256( in octetstring p_toBeVerifiedData, in octetstring p_signature, - in Oct32 p_ecdsaNistp256PublicKeyX, - in Oct32 p_ecdsaNistp256PublicKeyY + in Oct32 p_ecdsaNistp256PublicKeyCompressed, + in integer p_compressedMode + ) return boolean { +// log("f_verifyWithEcdsaNistp256WithSha256: toBeVerifiedData", p_toBeVerifiedData); +// log("f_verifyWithEcdsaNistp256WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); +// log("f_verifyWithEcdsaNistp256WithSha256: signature", p_signature); +// log("f_verifyWithEcdsaNistp256WithSha256: ecdsaNistp256PublicKeyCompressed", p_ecdsaNistp256PublicKeyCompressed); + return fx_verifyWithEcdsaNistp256WithSha256( + p_toBeVerifiedData, + p_signature, + p_ecdsaNistp256PublicKeyCompressed, + p_compressedMode + ); + } // End of function f_verifyWithEcdsaNistp256WithSha256 + + /** + * @desc Verify the signature of the specified data + * @param p_toBeVerifiedData The data to be verified + * @param p_signature The signature + * @param p_ecdsaNistp256PublicKeyX The public key (x coordinate) + * @param p_ecdsaNistp256PublicKeyY The public key (y coordinate) + * @return true on success, false otherwise + */ + function f_verifyWithEcdsaNistp256WithSha256_1( // TODO To be removed + in octetstring p_toBeVerifiedData, + in octetstring p_signature, + in Oct32 p_ecdsaNistp256PublicKeyX, + in Oct32 p_ecdsaNistp256PublicKeyY ) return boolean { // log("f_verifyWithEcdsaNistp256WithSha256: toBeVerifiedData", p_toBeVerifiedData); // log("f_verifyWithEcdsaNistp256WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); // log("f_verifyWithEcdsaNistp256WithSha256: signature", p_signature); // log("f_verifyWithEcdsaNistp256WithSha256: ecdsaNistp256PublicKeyX", p_ecdsaNistp256PublicKeyX); // log("f_verifyWithEcdsaNistp256WithSha256: ecdsaNistp256PublicKeyY", p_ecdsaNistp256PublicKeyY); - return fx_verifyWithEcdsaNistp256WithSha256( + return fx_verifyWithEcdsaNistp256WithSha256_1( p_toBeVerifiedData, p_signature, p_ecdsaNistp256PublicKeyX, p_ecdsaNistp256PublicKeyY); - } // End of function f_verifyWithEcdsaNistp256WithSha256 + } // End of function f_verifyWithEcdsaNistp256WithSha256_1 /** * @Desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified * @param p_signature The signature - * @param p_ecdsaBrainpoolp256PublicKeyX The public key (x coordinate) - * @param p_ecdsaBrainpoolp256PublicKeyY The public key (y coordinate) + * @param p_ecdsaBrainpoolp256PublicKeyCompressed The compressed public key + * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @return true on success, false otherwise */ function f_verifyWithEcdsaBrainpoolp256WithSha256( in octetstring p_toBeVerifiedData, in octetstring p_signature, - in Oct32 p_ecdsaBrainpoolp256PublicKeyX, - in Oct32 p_ecdsaBrainpoolp256PublicKeyY + in Oct32 p_ecdsaBrainpoolp256PublicKeyCompressed, + in integer p_compressedMode + ) return boolean { +// log("f_verifyWithEcdsaBrainpoolp256WithSha256: toBeVerifiedData", p_toBeVerifiedData); +// log("f_verifyWithEcdsaBrainpoolp256WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); +// log("f_verifyWithEcdsaBrainpoolp256WithSha256: signature", p_signature); +// log("f_verifyWithEcdsaBrainpoolp256WithSha256: ecdsaBrainpoolp256PublicKeyCompressed", p_ecdsaBrainpoolp256PublicKeyCompressed); + return fx_verifyWithEcdsaBrainpoolp256WithSha256( + p_toBeVerifiedData, + p_signature, + p_ecdsaBrainpoolp256PublicKeyCompressed, + p_compressedMode + ); + } // End of function f_verifyWithEcdsaBrainpoolp256WithSha256 + + /** + * @Desc Verify the signature of the specified data + * @param p_toBeVerifiedData The data to be verified + * @param p_signature The signature + * @param p_ecdsaBrainpoolp256PublicKeyX The public key (x coordinate) + * @param p_ecdsaBrainpoolp256PublicKeyY The public key (y coordinate) + * @return true on success, false otherwise + */ + function f_verifyWithEcdsaBrainpoolp256WithSha256_1( // TODO To be removed + in octetstring p_toBeVerifiedData, + in octetstring p_signature, + in Oct32 p_ecdsaBrainpoolp256PublicKeyX, + in Oct32 p_ecdsaBrainpoolp256PublicKeyY ) return boolean { // log("f_verifyWithEcdsaBrainpoolp256WithSha256: toBeVerifiedData", p_toBeVerifiedData); // log("f_verifyWithEcdsaBrainpoolp256WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); // log("f_verifyWithEcdsaBrainpoolp256WithSha256: signature", p_signature); // log("f_verifyWithEcdsaBrainpoolp256WithSha256: ecdsaBrainpoolp256PublicKeyX", p_ecdsaBrainpoolp256PublicKeyX); // log("f_verifyWithEcdsaBrainpoolp256WithSha256: ecdsaBrainpoolp256PublicKeyY", p_ecdsaBrainpoolp256PublicKeyY); - return fx_verifyWithEcdsaBrainpoolp256WithSha256( + return fx_verifyWithEcdsaBrainpoolp256WithSha256_1( p_toBeVerifiedData, p_signature, p_ecdsaBrainpoolp256PublicKeyX, p_ecdsaBrainpoolp256PublicKeyY); - } // End of function f_verifyWithEcdsaBrainpoolp256WithSha256 + } // End of function f_verifyWithEcdsaBrainpoolp256WithSha256_1 /** * @Desc Verify the signature of the specified data @@ -413,25 +465,52 @@ module LibItsSecurity_Functions { * @param p_signature The signature * @param p_ecdsaBrainpoolp384PublicKeyX The public key (x coordinate) * @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate) + * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @return true on success, false otherwise */ function f_verifyWithEcdsaBrainpoolp384WithSha384( in octetstring p_toBeVerifiedData, in octetstring p_signature, - in Oct48 p_ecdsaBrainpoolp384PublicKeyX, - in Oct48 p_ecdsaBrainpoolp384PublicKeyY + in Oct48 p_ecdsaBrainpoolp384PublicKeyCompressed, + in integer p_compressedMode + ) return boolean { +// log("f_verifyWithEcdsaBrainpoolp384WithSha384: toBeVerifiedData", p_toBeVerifiedData); +// log("f_verifyWithEcdsaBrainpoolp384WithSha384: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); +// log("f_verifyWithEcdsaBrainpoolp384WithSha384: signature", p_signature); +// log("f_verifyWithEcdsaBrainpoolp384WithSha384: ecdsaBrainpoolp384PublicKeyCompressed", p_ecdsaBrainpoolp384PublicKeyCompressed); + return fx_verifyWithEcdsaBrainpoolp384WithSha384( + p_toBeVerifiedData, + p_signature, + p_ecdsaBrainpoolp384PublicKeyCompressed, + p_compressedMode + ); + } // End of function f_verifyWithEcdsaBrainpoolp384WithSha384 + + /** + * @Desc Verify the signature of the specified data + * @param p_toBeVerifiedData The data to be verified + * @param p_signature The signature + * @param p_ecdsaBrainpoolp384PublicKeyX The public key (x coordinate) + * @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate) + * @return true on success, false otherwise + */ + function f_verifyWithEcdsaBrainpoolp384WithSha384_1( // TODO To be removed + in octetstring p_toBeVerifiedData, + in octetstring p_signature, + in Oct48 p_ecdsaBrainpoolp384PublicKeyX, + in Oct48 p_ecdsaBrainpoolp384PublicKeyY ) return boolean { // log("f_verifyWithEcdsaBrainpoolp384WithSha384: toBeVerifiedData", p_toBeVerifiedData); // log("f_verifyWithEcdsaBrainpoolp384WithSha384: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); // log("f_verifyWithEcdsaBrainpoolp384WithSha384: signature", p_signature); // log("f_verifyWithEcdsaBrainpoolp384WithSha384: ecdsaBrainpoolp384PublicKeyX", p_ecdsaBrainpoolp384PublicKeyX); // log("f_verifyWithEcdsaBrainpoolp384WithSha384: ecdsaBrainpoolp384PublicKeyY", p_ecdsaBrainpoolp384PublicKeyY); - return fx_verifyWithEcdsaBrainpoolp384WithSha384( + return fx_verifyWithEcdsaBrainpoolp384WithSha384_1( p_toBeVerifiedData, p_signature, p_ecdsaBrainpoolp384PublicKeyX, p_ecdsaBrainpoolp384PublicKeyY); - } // End of function f_verifyWithEcdsaBrainpoolp384WithSha384 + } // End of function f_verifyWithEcdsaBrainpoolp384WithSha384_1 /** * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. @@ -439,14 +518,18 @@ module LibItsSecurity_Functions { * @param p_privateKey The new private key value * @param p_publicKeyX The new public key value (x coordinate) * @param p_publicKeyX The new public key value (y coordinate) + * @param p_publicKeyCompressed The compressed public keys + * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @return true on success, false otherwise */ function f_generate_key_pair_nistp256( out Oct32 p_privateKey, out Oct32 p_publicKeyX, - out Oct32 p_publicKeyY + out Oct32 p_publicKeyY, + out Oct32 p_publicKeyCompressed, + out integer p_compressedMode ) return boolean { - return fx_generateKeyPair_nistp256(p_privateKey, p_publicKeyX, p_publicKeyY); + return fx_generateKeyPair_nistp256(p_privateKey, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressedMode); } /** @@ -455,14 +538,18 @@ module LibItsSecurity_Functions { * @param p_privateKey The new private key value * @param p_publicKeyX The new public key value (x coordinate) * @param p_publicKeyX The new public key value (y coordinate) + * @param p_publicKeyCompressed The compressed public keys + * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @return true on success, false otherwise */ function f_generate_key_pair_brainpoolp256( out Oct32 p_privateKey, out Oct32 p_publicKeyX, - out Oct32 p_publicKeyY + out Oct32 p_publicKeyY, + out Oct32 p_publicKeyCompressed, + out integer p_compressedMode ) return boolean { - return fx_generateKeyPair_brainpoolp256(p_privateKey, p_publicKeyX, p_publicKeyY); + return fx_generateKeyPair_brainpoolp256(p_privateKey, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressedMode); } /** @@ -471,14 +558,18 @@ module LibItsSecurity_Functions { * @param p_privateKey The new private key value * @param p_publicKeyX The new public key value (x coordinate) * @param p_publicKeyX The new public key value (y coordinate) + * @param p_publicKeyCompressed The compressed public keys + * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @return true on success, false otherwise */ function f_generate_key_pair_brainpoolp384( out Oct48 p_privateKey, out Oct48 p_publicKeyX, - out Oct48 p_publicKeyY + out Oct48 p_publicKeyY, + out Oct48 p_publicKeyCompressed, + out integer p_compressedMode ) return boolean { - return fx_generateKeyPair_brainpoolp384(p_privateKey, p_publicKeyX, p_publicKeyY); + return fx_generateKeyPair_brainpoolp384(p_privateKey, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressedMode); } /** @@ -1379,30 +1470,36 @@ module LibItsSecurity_Functions { if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1)) { v_signature := valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only) & valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP256r1Signature.sSig); log("f_verifyCertificateSignatureWithPublicKey: v_signedData=", v_signature); - return f_verifyWithEcdsaBrainpoolp256WithSha256( - v_enc_msg, - v_signature, - valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.uncompressedP256.x), - valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.uncompressedP256.y) - ); + if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1.uncompressedP256)) { + return f_verifyWithEcdsaBrainpoolp256WithSha256_1( + v_enc_msg, + v_signature, + valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.uncompressedP256.x), + valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.uncompressedP256.y) + ); + } } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1)) { v_signature := valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only) & valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP384r1Signature.sSig); log("f_verifyCertificateSignatureWithPublicKey: v_signedData=", v_signature); - return f_verifyWithEcdsaBrainpoolp384WithSha384( - v_enc_msg, - v_signature, - valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.uncompressedP384.x), - valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.uncompressedP384.y) - ); + if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1.uncompressedP384)) { + return f_verifyWithEcdsaBrainpoolp384WithSha384_1( + v_enc_msg, + v_signature, + valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.uncompressedP384.x), + valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.uncompressedP384.y) + ); + } } else if (ischosen(p_publicVerificationKey.ecdsaNistP256)) { v_signature := valueof(p_certificateToBeVerified.signature_.ecdsaNistP256Signature.rSig.x_only) & valueof(p_certificateToBeVerified.signature_.ecdsaNistP256Signature.sSig); log("f_verifyCertificateSignatureWithPublicKey: v_signedData=", v_signature); - return f_verifyWithEcdsaNistp256WithSha256( - v_enc_msg, - v_signature, - valueof(p_publicVerificationKey.ecdsaNistP256.uncompressedP256.x), - valueof(p_publicVerificationKey.ecdsaNistP256.uncompressedP256.y) - ); + if (ischosen(p_publicVerificationKey.ecdsaNistP256.uncompressedP256)) { + return f_verifyWithEcdsaNistp256WithSha256_1( + v_enc_msg, + v_signature, + valueof(p_publicVerificationKey.ecdsaNistP256.uncompressedP256.x), + valueof(p_publicVerificationKey.ecdsaNistP256.uncompressedP256.y) + ); + } } return false; @@ -1462,7 +1559,7 @@ module LibItsSecurity_Functions { // Verify payload v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig.x_only) & valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig); log("f_verifyGnSecuredMessageSignature_ecdsaNistP256: v_signedData=", v_signedData); - v_result := f_verifyWithEcdsaNistp256WithSha256( + v_result := f_verifyWithEcdsaNistp256WithSha256_1( // TODO Use x_only v_secPayload, v_signedData, valueof(p_publicKey.uncompressedP256.x), @@ -1505,7 +1602,7 @@ module LibItsSecurity_Functions { // Verify payload v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only) & valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig); log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: v_signedData=", v_signedData); - v_result := f_verifyWithEcdsaBrainpoolp256WithSha256( + v_result := f_verifyWithEcdsaBrainpoolp256WithSha256_1( // TODO Use x_only v_secPayload, v_signedData, valueof(p_publicKey.uncompressedP256.x), @@ -1548,7 +1645,7 @@ module LibItsSecurity_Functions { // Verify payload v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only) & valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig); log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: v_signedData=", v_signedData); - v_result := f_verifyWithEcdsaBrainpoolp384WithSha384( + v_result := f_verifyWithEcdsaBrainpoolp384WithSha384_1( // TODO Use x_only v_secPayload, v_signedData, valueof(p_publicKey.uncompressedP384.x), @@ -1974,6 +2071,15 @@ module LibItsSecurity_Functions { */ external function fx_signWithEcdsaBrainpoolp384WithSha384(in Oct48 p_toBeSignedSecuredMessage, in Oct48 p_privateKey) return octetstring; + /** + * @desc Verify the signature of the specified data + * @param p_toBeVerifiedData The data to be verified + * @param p_signature The signature + * @param p_ecdsaNistp256PublicKeyCompressed The compressed public key (x coordinate only) + * @return true on success, false otherwise + */ + external function fx_verifyWithEcdsaNistp256WithSha256(in Oct32 p_toBeVerifiedData, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyCompressed, in integer p_compressedMode) return boolean; + /** * @desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified @@ -1982,7 +2088,16 @@ module LibItsSecurity_Functions { * @param p_ecdsaNistp256PublicKeyY The public key (y coordinate) * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaNistp256WithSha256(in Oct32 p_toBeVerifiedData, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyX, in Oct32 p_ecdsaNistp256PublicKeyY) return boolean; + external function fx_verifyWithEcdsaNistp256WithSha256_1(in Oct32 p_toBeVerifiedData, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyX, in Oct32 p_ecdsaNistp256PublicKeyY) return boolean; + + /** + * @desc Verify the signature of the specified data + * @param p_toBeVerifiedData The data to be verified + * @param p_signature The signature + * @param p_ecdsaBrainpoolp256PublicKeyCompressed The compressed public key (x coordinate only) + * @return true on success, false otherwise + */ + external function fx_verifyWithEcdsaBrainpoolp256WithSha256(in Oct32 p_toBeVerifiedData, in octetstring p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyCompressed, in integer p_compressedMode) return boolean; /** * @desc Verify the signature of the specified data @@ -1992,17 +2107,25 @@ module LibItsSecurity_Functions { * @param p_ecdsaBrainpoolp256PublicKeyY The public key (y coordinate) * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaBrainpoolp256WithSha256(in Oct32 p_toBeVerifiedData, in octetstring p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyX, in Oct32 p_ecdsaBrainpoolp256PublicKeyY) return boolean; + external function fx_verifyWithEcdsaBrainpoolp256WithSha256_1(in Oct32 p_toBeVerifiedData, in octetstring p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyX, in Oct32 p_ecdsaBrainpoolp256PublicKeyY) return boolean; + + /** + * @desc Verify the signature of the specified data + * @param p_toBeVerifiedData The data to be verified + * @param p_signature The signature + * @param p_ecdsaBrainpoolp384PublicKeyCompressed The compressed public key (x coordinate) + * @return true on success, false otherwise + */ + external function fx_verifyWithEcdsaBrainpoolp384WithSha384(in Oct48 p_toBeVerifiedData, in octetstring p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyCompressed, in integer p_compressedMode) return boolean; /** * @desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified * @param p_signature The signature - * @param p_ecdsaBrainpoolp384PublicKeyX The public key (x coordinate) - * @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate) + * @param p_ecdsaBrainpoolp384PublicKeyCompressed The compressed public key (x coordinate only) * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaBrainpoolp384WithSha384(in Oct48 p_toBeVerifiedData, in octetstring p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyX, in Oct48 p_ecdsaBrainpoolp384PublicKeyY) return boolean; + external function fx_verifyWithEcdsaBrainpoolp384WithSha384_1(in Oct48 p_toBeVerifiedData, in octetstring p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyX, in Oct48 p_ecdsaBrainpoolp384PublicKeyY) return boolean; /** * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. @@ -2010,9 +2133,11 @@ module LibItsSecurity_Functions { * @param p_privateKey The new private key value * @param p_publicKeyX The new public key value (x coordinate) * @param p_publicKeyX The new public key value (y coordinate) + * @param p_publicKeyCompressed The compressed public keys + * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @return true on success, false otherwise */ - external function fx_generateKeyPair_nistp256(out Oct32 p_privateKey, out Oct32 p_publicKeyX, out Oct32 p_publicKeyY) return boolean; + external function fx_generateKeyPair_nistp256(out Oct32 p_privateKey, out Oct32 p_publicKeyX, out Oct32 p_publicKeyY, out Oct32 p_publicKeyCompressed, out integer p_compressedMode) return boolean; /** * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. @@ -2020,9 +2145,11 @@ module LibItsSecurity_Functions { * @param p_privateKey The new private key value * @param p_publicKeyX The new public key value (x coordinate) * @param p_publicKeyX The new public key value (y coordinate) + * @param p_publicKeyCompressed The compressed public keys + * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @return true on success, false otherwise */ - external function fx_generateKeyPair_brainpoolp256(out Oct32 p_privateKey, out Oct32 p_publicKeyX, out Oct32 p_publicKeyY) return boolean; + external function fx_generateKeyPair_brainpoolp256(out Oct32 p_privateKey, out Oct32 p_publicKeyX, out Oct32 p_publicKeyY, out Oct32 p_publicKeyCompressed, out integer p_compressedMode) return boolean; /** * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. @@ -2030,9 +2157,11 @@ module LibItsSecurity_Functions { * @param p_privateKey The new private key value * @param p_publicKeyX The new public key value (x coordinate) * @param p_publicKeyX The new public key value (y coordinate) + * @param p_publicKeyCompressed The compressed public keys + * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @return true on success, false otherwise */ - external function fx_generateKeyPair_brainpoolp384(out Oct48 p_privateKey, out Oct48 p_publicKeyX, out Oct48 p_publicKeyY) return boolean; + external function fx_generateKeyPair_brainpoolp384(out Oct48 p_privateKey, out Oct48 p_publicKeyX, out Oct48 p_publicKeyY, out Oct48 p_publicKeyCompressed, out integer p_compressedMode) return boolean; } // End of group signing @@ -2050,7 +2179,7 @@ module LibItsSecurity_Functions { * @return true on success, false otherwise */ external function fx_loadCertificates(in charstring p_rootDirectory, in charstring p_configId) return boolean; - external function fx_store_certificate(in charstring p_cert_id, in octetstring p_cert, in octetstring p_private_key, in octetstring p_public_key_x, in octetstring p_public_key_y, in octetstring p_hashid8, in octetstring p_issuer, in template (omit) octetstring p_private_enc_key, in template (omit) octetstring p_public_enc_key_x, in template (omit) octetstring p_public_enc_key_y) return boolean; + external function fx_store_certificate(in charstring p_cert_id, in octetstring p_cert, in octetstring p_private_key, in octetstring p_public_key_x, in octetstring p_public_key_y, in template octetstring p_public_key_compressed, in template integer p_public_key_compressed_mode, in octetstring p_hashid8, in octetstring p_issuer, in template (omit) octetstring p_private_enc_key, in template (omit) octetstring p_public_enc_key_x, in template (omit) octetstring p_public_enc_key_y) return boolean; /** * @desc Unload from memory cache the certificates diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index bf2d3138..977ac5a0 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -157,50 +157,6 @@ module LibItsSecurity_Templates { */ group basicFormatElementsSend { - /** - * @desc Send templates for security algorithm descriptions - */ - group algorithms { - - /** - * @desc Send template for EccP256CurvePoint description based on x_coordinate_only type - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.5 EccP256CurvePoint - * @see Draft ETSI TS 103 097 V1.3.1 Table 2: Derivation of field sizes depending on the used algorithm - */ - template (value) EccP256CurvePoint m_eccPointecdsa_nistp256_with_sha256_x_coordinate_only( - in template (value) octetstring p_x - ) := { - x_only := p_x - } // End of template m_eccPointecdsa_nistp256_with_sha256_x_coordinate_only - - /** - * @desc Send template for EccP256CurvePoint description based on y_coordinate_only type - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.5 EccP256CurvePoint - * @see Draft ETSI TS 103 097 V1.3.1 Table 2: Derivation of field sizes depending on the used algorithm - */ - template (value) EccP256CurvePoint m_eccPointecdsa_nistp256_with_sha256_y_coordinate_only( - in template (value) octetstring p_y - ) := { - compressed_y_0 := p_y - } // End of template m_eccPointecdsa_nistp256_with_sha256_y_coordinate_only - - /** - * @desc Send template for EccP256CurvePoint description based on uncompressed type - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.5 EccP256CurvePoint - * @see Draft ETSI TS 103 097 V1.3.1 Table 2: Derivation of field sizes depending on the used algorithm - */ - template (value) EccP256CurvePoint m_eccPointecdsa_nistp256_with_sha256_uncompressed( - in template (value) octetstring p_x, - in template (value) octetstring p_y - ) := { - uncompressedP256 := { - x := p_x, - y := p_y - } - } // End of template m_eccPointecdsa_nistp256_with_sha256_uncompressed - - } // End of group algorithms - /** * @desc Send templates for Signature description * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.9 Signature @@ -1242,7 +1198,7 @@ module LibItsSecurity_Templates { group certificates { /** - * @desc Send certificate template + * @desc Send certificate template of type explicit (signature is included) * @member p_signer_info Signer information * @member p_subject_info The subject information * @member p_subject_attributes List of subject attribute @@ -1263,7 +1219,7 @@ module LibItsSecurity_Templates { } // End of template m_etsiTs103097Certificate /** - * @desc Send certificate template + * @desc Send certificate template of type explicit (signature is included) * @member p_signer_info Signer information * @member p_subject_info The subject information * @member p_subject_attributes List of subject attribute @@ -1594,29 +1550,29 @@ module LibItsSecurity_Templates { ecdsaNistP256 := p_ecdsaNistP256 } // End of template mw_publicVerificationKey_ecdsaNistP256 - template (value) PublicVerificationKey m_publicVerificationKey_ecdsaBrainpoolP256( - in template (value) EccP256CurvePoint p_ecdsaBrainpoolP256r1 + template (value) PublicVerificationKey m_publicVerificationKey_ecdsaBrainpoolP256r1( + in template (value) EccP256CurvePoint p_ecdsaBrainpoolP256r1 ) := { ecdsaBrainpoolP256r1 := p_ecdsaBrainpoolP256r1 - } // End of template m_publicVerificationKey_ecdsaBrainpoolP256 + } // End of template m_publicVerificationKey_ecdsaBrainpoolP256r1 - template (present) PublicVerificationKey mw_publicVerificationKey_ecdsaBrainpoolP256( - template (present) EccP256CurvePoint p_ecdsaBrainpoolP256r1 := ? + template (present) PublicVerificationKey mw_publicVerificationKey_ecdsaBrainpoolP256r1( + template (present) EccP256CurvePoint p_ecdsaBrainpoolP256r1 := ? ) := { ecdsaBrainpoolP256r1 := p_ecdsaBrainpoolP256r1 - } // End of template mw_publicVerificationKey_ecdsaBrainpoolP256 + } // End of template mw_publicVerificationKey_ecdsaBrainpoolP256r1 - template (value) PublicVerificationKey m_publicVerificationKey_ecdsaBrainpoolP384( - in template (value) EccP384CurvePoint p_ecdsaBrainpoolP384r1 + template (value) PublicVerificationKey m_publicVerificationKey_ecdsaBrainpoolP384r1( + in template (value) EccP384CurvePoint p_ecdsaBrainpoolP384r1 ) := { ecdsaBrainpoolP384r1 := p_ecdsaBrainpoolP384r1 - } // End of template m_publicVerificationKey_ecdsaBrainpoolP384 + } // End of template m_publicVerificationKey_ecdsaBrainpoolP384r1 - template (present) PublicVerificationKey mw_publicVerificationKey_ecdsaBrainpoolP384( - template (present) EccP384CurvePoint p_ecdsaBrainpoolP384r1 := ? + template (present) PublicVerificationKey mw_publicVerificationKey_ecdsaBrainpoolP384r1( + template (present) EccP384CurvePoint p_ecdsaBrainpoolP384r1 := ? ) := { ecdsaBrainpoolP384r1 := p_ecdsaBrainpoolP384r1 - } // End of template mw_publicVerificationKey_ecdsaBrainpoolP384 + } // End of template mw_publicVerificationKey_ecdsaBrainpoolP384r1 } // End of group verificationKeys -- GitLab From 5f362327fc0442908a20b5c40fe43129595b9eee Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 27 Apr 2018 12:06:49 +0000 Subject: [PATCH 095/320] Major security bugs fixed for signature. Encryption to do. --- ttcn/Security/LibItsSecurity_Functions.ttcn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index d2e1463a..6de4fad2 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -2179,7 +2179,7 @@ module LibItsSecurity_Functions { * @return true on success, false otherwise */ external function fx_loadCertificates(in charstring p_rootDirectory, in charstring p_configId) return boolean; - external function fx_store_certificate(in charstring p_cert_id, in octetstring p_cert, in octetstring p_private_key, in octetstring p_public_key_x, in octetstring p_public_key_y, in template octetstring p_public_key_compressed, in template integer p_public_key_compressed_mode, in octetstring p_hashid8, in octetstring p_issuer, in template (omit) octetstring p_private_enc_key, in template (omit) octetstring p_public_enc_key_x, in template (omit) octetstring p_public_enc_key_y) return boolean; + external function fx_store_certificate(in charstring p_cert_id, in octetstring p_cert, in octetstring p_private_key, in octetstring p_public_key_x, in octetstring p_public_key_y, in octetstring p_public_key_compressed, in integer p_public_key_compressed_mode, in octetstring p_hashid8, in octetstring p_issuer, in template (omit) octetstring p_private_enc_key, in template (omit) octetstring p_public_enc_key_x, in template (omit) octetstring p_public_enc_key_y) return boolean; /** * @desc Unload from memory cache the certificates -- GitLab From 9a7b9845434e4e79b528cf02fd28aecde4cfcf55 Mon Sep 17 00:00:00 2001 From: garciay Date: Sun, 29 Apr 2018 13:51:53 +0000 Subject: [PATCH 096/320] Major security bugs fixed for signature. Encryption to do. --- ttcn/Security/LibItsSecurity_Functions.ttcn | 240 ++++++++++++++++---- 1 file changed, 200 insertions(+), 40 deletions(-) diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 6de4fad2..32328b48 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -62,10 +62,12 @@ module LibItsSecurity_Functions { */ function f_signWithEcdsaNistp256WithSha256( in octetstring p_toBeSignedSecuredMessage, + in HashedId8 p_certificateIssuer, in Oct32 p_privateKey ) return octetstring { return fx_signWithEcdsaNistp256WithSha256( p_toBeSignedSecuredMessage, + p_certificateIssuer, p_privateKey ); @@ -79,10 +81,12 @@ module LibItsSecurity_Functions { */ function f_signWithEcdsaBrainpoolp256WithSha256( in octetstring p_toBeSignedSecuredMessage, + in HashedId8 p_certificateIssuer, in Oct32 p_privateKey ) return octetstring { return fx_signWithEcdsaBrainpoolp256WithSha256( p_toBeSignedSecuredMessage, + p_certificateIssuer, p_privateKey ); @@ -96,10 +100,12 @@ module LibItsSecurity_Functions { */ function f_signWithEcdsaBrainpoolp384WithSha384( in octetstring p_toBeSignedSecuredMessage, + in HashedId8 p_certificateIssuer, in Oct48 p_privateKey ) return octetstring { return fx_signWithEcdsaBrainpoolp384WithSha384( p_toBeSignedSecuredMessage, + p_certificateIssuer, p_privateKey ); @@ -358,6 +364,7 @@ module LibItsSecurity_Functions { /** * @desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified + * @param p_certificateIssuer The digest of the certificate issuer * @param p_signature The signature * @param p_ecdsaNistp256PublicKeyCompressed The compressed public key * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise @@ -365,6 +372,7 @@ module LibItsSecurity_Functions { */ function f_verifyWithEcdsaNistp256WithSha256( in octetstring p_toBeVerifiedData, + in HashedId8 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyCompressed, in integer p_compressedMode @@ -375,6 +383,7 @@ module LibItsSecurity_Functions { // log("f_verifyWithEcdsaNistp256WithSha256: ecdsaNistp256PublicKeyCompressed", p_ecdsaNistp256PublicKeyCompressed); return fx_verifyWithEcdsaNistp256WithSha256( p_toBeVerifiedData, + p_certificateIssuer, p_signature, p_ecdsaNistp256PublicKeyCompressed, p_compressedMode @@ -384,6 +393,7 @@ module LibItsSecurity_Functions { /** * @desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified + * @param p_certificateIssuer The digest of the certificate issuer * @param p_signature The signature * @param p_ecdsaNistp256PublicKeyX The public key (x coordinate) * @param p_ecdsaNistp256PublicKeyY The public key (y coordinate) @@ -391,6 +401,7 @@ module LibItsSecurity_Functions { */ function f_verifyWithEcdsaNistp256WithSha256_1( // TODO To be removed in octetstring p_toBeVerifiedData, + in HashedId8 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyX, in Oct32 p_ecdsaNistp256PublicKeyY @@ -402,6 +413,7 @@ module LibItsSecurity_Functions { // log("f_verifyWithEcdsaNistp256WithSha256: ecdsaNistp256PublicKeyY", p_ecdsaNistp256PublicKeyY); return fx_verifyWithEcdsaNistp256WithSha256_1( p_toBeVerifiedData, + p_certificateIssuer, p_signature, p_ecdsaNistp256PublicKeyX, p_ecdsaNistp256PublicKeyY); @@ -410,6 +422,7 @@ module LibItsSecurity_Functions { /** * @Desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified + * @param p_certificateIssuer The digest of the certificate issuer * @param p_signature The signature * @param p_ecdsaBrainpoolp256PublicKeyCompressed The compressed public key * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise @@ -417,6 +430,7 @@ module LibItsSecurity_Functions { */ function f_verifyWithEcdsaBrainpoolp256WithSha256( in octetstring p_toBeVerifiedData, + in HashedId8 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyCompressed, in integer p_compressedMode @@ -427,6 +441,7 @@ module LibItsSecurity_Functions { // log("f_verifyWithEcdsaBrainpoolp256WithSha256: ecdsaBrainpoolp256PublicKeyCompressed", p_ecdsaBrainpoolp256PublicKeyCompressed); return fx_verifyWithEcdsaBrainpoolp256WithSha256( p_toBeVerifiedData, + p_certificateIssuer, p_signature, p_ecdsaBrainpoolp256PublicKeyCompressed, p_compressedMode @@ -436,6 +451,7 @@ module LibItsSecurity_Functions { /** * @Desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified + * @param p_certificateIssuer The digest of the certificate issuer * @param p_signature The signature * @param p_ecdsaBrainpoolp256PublicKeyX The public key (x coordinate) * @param p_ecdsaBrainpoolp256PublicKeyY The public key (y coordinate) @@ -443,6 +459,7 @@ module LibItsSecurity_Functions { */ function f_verifyWithEcdsaBrainpoolp256WithSha256_1( // TODO To be removed in octetstring p_toBeVerifiedData, + in HashedId8 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyX, in Oct32 p_ecdsaBrainpoolp256PublicKeyY @@ -454,6 +471,7 @@ module LibItsSecurity_Functions { // log("f_verifyWithEcdsaBrainpoolp256WithSha256: ecdsaBrainpoolp256PublicKeyY", p_ecdsaBrainpoolp256PublicKeyY); return fx_verifyWithEcdsaBrainpoolp256WithSha256_1( p_toBeVerifiedData, + p_certificateIssuer, p_signature, p_ecdsaBrainpoolp256PublicKeyX, p_ecdsaBrainpoolp256PublicKeyY); @@ -462,6 +480,7 @@ module LibItsSecurity_Functions { /** * @Desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified + * @param p_certificateIssuer The digest of the certificate issuer * @param p_signature The signature * @param p_ecdsaBrainpoolp384PublicKeyX The public key (x coordinate) * @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate) @@ -470,6 +489,7 @@ module LibItsSecurity_Functions { */ function f_verifyWithEcdsaBrainpoolp384WithSha384( in octetstring p_toBeVerifiedData, + in HashedId8 p_certificateIssuer, in octetstring p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyCompressed, in integer p_compressedMode @@ -480,6 +500,7 @@ module LibItsSecurity_Functions { // log("f_verifyWithEcdsaBrainpoolp384WithSha384: ecdsaBrainpoolp384PublicKeyCompressed", p_ecdsaBrainpoolp384PublicKeyCompressed); return fx_verifyWithEcdsaBrainpoolp384WithSha384( p_toBeVerifiedData, + p_certificateIssuer, p_signature, p_ecdsaBrainpoolp384PublicKeyCompressed, p_compressedMode @@ -489,6 +510,7 @@ module LibItsSecurity_Functions { /** * @Desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified + * @param p_certificateIssuer The digest of the certificate issuer * @param p_signature The signature * @param p_ecdsaBrainpoolp384PublicKeyX The public key (x coordinate) * @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate) @@ -496,6 +518,7 @@ module LibItsSecurity_Functions { */ function f_verifyWithEcdsaBrainpoolp384WithSha384_1( // TODO To be removed in octetstring p_toBeVerifiedData, + in HashedId8 p_certificateIssuer, in octetstring p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyX, in Oct48 p_ecdsaBrainpoolp384PublicKeyY @@ -507,6 +530,7 @@ module LibItsSecurity_Functions { // log("f_verifyWithEcdsaBrainpoolp384WithSha384: ecdsaBrainpoolp384PublicKeyY", p_ecdsaBrainpoolp384PublicKeyY); return fx_verifyWithEcdsaBrainpoolp384WithSha384_1( p_toBeVerifiedData, + p_certificateIssuer, p_signature, p_ecdsaBrainpoolp384PublicKeyX, p_ecdsaBrainpoolp384PublicKeyY); @@ -691,6 +715,7 @@ module LibItsSecurity_Functions { var octetstring v_secPayload, v_signature; var ToBeSignedData v_toBeSignedData; var Ieee1609Dot2Content v_toBeSignedPayload; + var HashedId8 v_certificateDigest; var Oct32 v_privateKey; // Prepare payload to be signed @@ -707,10 +732,12 @@ module LibItsSecurity_Functions { return false; } } - + f_getCertificateDigest(p_certificateName, v_certificateDigest); + if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature)) { v_signature := f_signWithEcdsaNistp256WithSha256( - v_secPayload, + v_secPayload, + v_certificateDigest, v_privateKey ); p_securedMessage.content.signedData.signature_ := m_signature_ecdsaNistP256( @@ -721,7 +748,8 @@ module LibItsSecurity_Functions { ); } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { v_signature := f_signWithEcdsaBrainpoolp256WithSha256( - v_secPayload, + v_secPayload, + v_certificateDigest, v_privateKey ); p_securedMessage.content.signedData.signature_ := m_signature_ecdsaBrainpoolP256r1( @@ -1473,10 +1501,30 @@ module LibItsSecurity_Functions { if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1.uncompressedP256)) { return f_verifyWithEcdsaBrainpoolp256WithSha256_1( v_enc_msg, + valueof(p_certificateToBeVerified.issuer.sha256AndDigest), v_signature, valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.uncompressedP256.x), valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.uncompressedP256.y) ); + } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1.compressed_y_0)) { + return f_verifyWithEcdsaBrainpoolp256WithSha256( + v_enc_msg, + valueof(p_certificateToBeVerified.issuer.sha256AndDigest), + v_signature, + valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.compressed_y_0), + 0 // Latest bit of the Y-coordinate is 0 + ); + } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1.compressed_y_1)) { + return f_verifyWithEcdsaBrainpoolp256WithSha256( + v_enc_msg, + valueof(p_certificateToBeVerified.issuer.sha256AndDigest), + v_signature, + valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.compressed_y_1), + 1 // Latest bit of the Y-coordinate is 1 + ); + } else { + log("f_verifyCertificateSignatureWithPublicKey: Unknown PublicVerificationKey value"); + return false; } } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1)) { v_signature := valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only) & valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP384r1Signature.sSig); @@ -1484,10 +1532,30 @@ module LibItsSecurity_Functions { if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1.uncompressedP384)) { return f_verifyWithEcdsaBrainpoolp384WithSha384_1( v_enc_msg, + valueof(p_certificateToBeVerified.issuer.sha384AndDigest), v_signature, valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.uncompressedP384.x), valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.uncompressedP384.y) ); + } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1.compressed_y_0)) { + return f_verifyWithEcdsaBrainpoolp384WithSha384( + v_enc_msg, + valueof(p_certificateToBeVerified.issuer.sha384AndDigest), + v_signature, + valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.compressed_y_0), + 0 // Latest bit of the Y-coordinate is 0 + ); + } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1.compressed_y_1)) { + return f_verifyWithEcdsaBrainpoolp384WithSha384( + v_enc_msg, + valueof(p_certificateToBeVerified.issuer.sha384AndDigest), + v_signature, + valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.compressed_y_1), + 1 // Latest bit of the Y-coordinate is 1 + ); + } else { + log("f_verifyCertificateSignatureWithPublicKey: Unknown PublicVerificationKey value"); + return false; } } else if (ischosen(p_publicVerificationKey.ecdsaNistP256)) { v_signature := valueof(p_certificateToBeVerified.signature_.ecdsaNistP256Signature.rSig.x_only) & valueof(p_certificateToBeVerified.signature_.ecdsaNistP256Signature.sSig); @@ -1495,10 +1563,30 @@ module LibItsSecurity_Functions { if (ischosen(p_publicVerificationKey.ecdsaNistP256.uncompressedP256)) { return f_verifyWithEcdsaNistp256WithSha256_1( v_enc_msg, + valueof(p_certificateToBeVerified.issuer.sha256AndDigest), v_signature, valueof(p_publicVerificationKey.ecdsaNistP256.uncompressedP256.x), valueof(p_publicVerificationKey.ecdsaNistP256.uncompressedP256.y) ); + } else if (ischosen(p_publicVerificationKey.ecdsaNistP256.compressed_y_0)) { + return f_verifyWithEcdsaNistp256WithSha256( + v_enc_msg, + valueof(p_certificateToBeVerified.issuer.sha256AndDigest), + v_signature, + valueof(p_publicVerificationKey.ecdsaNistP256.compressed_y_0), + 0 // Latest bit of the Y-coordinate is 0 + ); + } else if (ischosen(p_publicVerificationKey.ecdsaNistP256.compressed_y_1)) { + return f_verifyWithEcdsaNistp256WithSha256( + v_enc_msg, + valueof(p_certificateToBeVerified.issuer.sha256AndDigest), + v_signature, + valueof(p_publicVerificationKey.ecdsaNistP256.compressed_y_1), + 1 // Latest bit of the Y-coordinate is 1 + ); + } else { + log("f_verifyCertificateSignatureWithPublicKey: Unknown PublicVerificationKey value"); + return false; } } @@ -1537,6 +1625,7 @@ module LibItsSecurity_Functions { */ function f_verifyGnSecuredMessageSignature_ecdsaNistP256( in template (value) Ieee1609Dot2Data p_securedMessage, + in template (value) HashedId8 p_certificateIssuer, in template (value) EccP256CurvePoint p_publicKey ) return boolean { @@ -1547,6 +1636,7 @@ module LibItsSecurity_Functions { var template (value) ToBeSignedData v_toBeSignedData; log(">>> f_verifyGnSecuredMessageSignature_ecdsaNistP256: p_securedMessage= ", p_securedMessage); + log(">>> f_verifyGnSecuredMessageSignature_ecdsaNistP256: p_certificateIssuer= ", p_certificateIssuer); log(">>> f_verifyGnSecuredMessageSignature_ecdsaNistP256: p_publicKey= ", p_publicKey); // Create Ieee1609Dot2Data payload to be signed @@ -1559,12 +1649,31 @@ module LibItsSecurity_Functions { // Verify payload v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig.x_only) & valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig); log("f_verifyGnSecuredMessageSignature_ecdsaNistP256: v_signedData=", v_signedData); - v_result := f_verifyWithEcdsaNistp256WithSha256_1( // TODO Use x_only - v_secPayload, - v_signedData, - valueof(p_publicKey.uncompressedP256.x), - valueof(p_publicKey.uncompressedP256.y) - ); + if (ischosen(p_publicKey.uncompressedP256)) { + v_result := f_verifyWithEcdsaNistp256WithSha256_1( + v_secPayload, + valueof(p_certificateIssuer), + v_signedData, + valueof(p_publicKey.uncompressedP256.x), + valueof(p_publicKey.uncompressedP256.y) + ); + } else if (ischosen(p_publicKey.compressed_y_0)) { + v_result := f_verifyWithEcdsaNistp256WithSha256( + v_secPayload, + valueof(p_certificateIssuer), + v_signedData, + valueof(p_publicKey.compressed_y_0), + 0 + ); + } else if (ischosen(p_publicKey.compressed_y_1)) { + v_result := f_verifyWithEcdsaNistp256WithSha256( + v_secPayload, + valueof(p_certificateIssuer), + v_signedData, + valueof(p_publicKey.compressed_y_1), + 1 + ); + } log("f_verifyGnSecuredMessageSignature_ecdsaNistP256: v_result=", v_result); return v_result; @@ -1580,6 +1689,7 @@ module LibItsSecurity_Functions { */ function f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1( in template (value) Ieee1609Dot2Data p_securedMessage, + in template (value) HashedId8 p_certificateIssuer, in template (value) EccP256CurvePoint p_publicKey ) return boolean { @@ -1590,6 +1700,7 @@ module LibItsSecurity_Functions { var template (value) ToBeSignedData v_toBeSignedData; log(">>> f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: p_securedMessage= ", p_securedMessage); + log(">>> f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: p_certificateIssuer= ", p_certificateIssuer); log(">>> f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: p_publicKey= ", p_publicKey); // Create Ieee1609Dot2Data payload to be signed @@ -1602,12 +1713,31 @@ module LibItsSecurity_Functions { // Verify payload v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only) & valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig); log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: v_signedData=", v_signedData); - v_result := f_verifyWithEcdsaBrainpoolp256WithSha256_1( // TODO Use x_only - v_secPayload, - v_signedData, - valueof(p_publicKey.uncompressedP256.x), - valueof(p_publicKey.uncompressedP256.y) - ); + if (ischosen(p_publicKey.uncompressedP256)) { + v_result := f_verifyWithEcdsaBrainpoolp256WithSha256_1( + v_secPayload, + valueof(p_certificateIssuer), + v_signedData, + valueof(p_publicKey.uncompressedP256.x), + valueof(p_publicKey.uncompressedP256.y) + ); + } else if (ischosen(p_publicKey.compressed_y_0)) { + v_result := f_verifyWithEcdsaBrainpoolp256WithSha256( + v_secPayload, + valueof(p_certificateIssuer), + v_signedData, + valueof(p_publicKey.compressed_y_0), + 0 + ); + } else if (ischosen(p_publicKey.compressed_y_1)) { + v_result := f_verifyWithEcdsaBrainpoolp256WithSha256( + v_secPayload, + valueof(p_certificateIssuer), + v_signedData, + valueof(p_publicKey.compressed_y_1), + 1 + ); + } log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: v_result=", v_result); return v_result; @@ -1623,6 +1753,7 @@ module LibItsSecurity_Functions { */ function f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1( in template (value) Ieee1609Dot2Data p_securedMessage, + in template (value) HashedId8 p_certificateIssuer, in template (value) EccP384CurvePoint p_publicKey ) return boolean { @@ -1633,6 +1764,7 @@ module LibItsSecurity_Functions { var template (value) ToBeSignedData v_toBeSignedData; log(">>> f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: p_securedMessage= ", p_securedMessage); + log(">>> f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: p_certificateIssuer= ", p_certificateIssuer); log(">>> f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: p_publicKey= ", p_publicKey); // Create Ieee1609Dot2Data payload to be signed @@ -1645,12 +1777,31 @@ module LibItsSecurity_Functions { // Verify payload v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only) & valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig); log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: v_signedData=", v_signedData); - v_result := f_verifyWithEcdsaBrainpoolp384WithSha384_1( // TODO Use x_only - v_secPayload, - v_signedData, - valueof(p_publicKey.uncompressedP384.x), - valueof(p_publicKey.uncompressedP384.y) - ); + if (ischosen(p_publicKey.uncompressedP384)) { + v_result := f_verifyWithEcdsaBrainpoolp384WithSha384_1( + v_secPayload, + valueof(p_certificateIssuer), + v_signedData, + valueof(p_publicKey.uncompressedP384.x), + valueof(p_publicKey.uncompressedP384.y) + ); + } else if (ischosen(p_publicKey.compressed_y_0)) { + v_result := f_verifyWithEcdsaBrainpoolp384WithSha384( + v_secPayload, + valueof(p_certificateIssuer), + v_signedData, + valueof(p_publicKey.compressed_y_0), + 0 + ); + } else if (ischosen(p_publicKey.compressed_y_1)) { + v_result := f_verifyWithEcdsaBrainpoolp384WithSha384( + v_secPayload, + valueof(p_certificateIssuer), + v_signedData, + valueof(p_publicKey.compressed_y_1), + 1 + ); + } log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: v_result=", v_result); return v_result; @@ -1669,11 +1820,11 @@ module LibItsSecurity_Functions { ) return boolean { if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { - return f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1(p_securedMessage, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1); + return f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1(p_securedMessage, p_certificate.issuer.sha256AndDigest, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1); } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature)) { - return f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1(p_securedMessage, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1); + return f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1(p_securedMessage, p_certificate.issuer.sha384AndDigest, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1); } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature)) { - return f_verifyGnSecuredMessageSignature_ecdsaNistP256(p_securedMessage, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256); + return f_verifyGnSecuredMessageSignature_ecdsaNistP256(p_securedMessage, p_certificate.issuer.sha256AndDigest, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256); } return false; @@ -1982,14 +2133,6 @@ module LibItsSecurity_Functions { */ external function fx_hashWithSha384(in octetstring p_toBeHashedData) return Oct48; - /** - * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature - * @param p_toBeSignedSecuredMessage The data to be signed - * @param p_privateKey The private key - * @return The signature value - */ - external function fx_signWithEcdsaNistp256WithSha256(in Oct32 p_toBeSignedSecuredMessage, in Oct32 p_privateKey) return octetstring; - external function fx_test_hmac_sha256(in octetstring p_k, in octetstring p_m) return octetstring; /** * @desc Test function the validate AES128 CCM encryption based on IEEE Std 1609.2-20XX Annex D.6.1 AES-CCM-128 @@ -2058,74 +2201,91 @@ module LibItsSecurity_Functions { /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature * @param p_toBeSignedSecuredMessage The data to be signed + * @param p_certificateIssuer The digest of the certificate issuer + * @param p_privateKey The private key + * @return The signature value + */ + external function fx_signWithEcdsaNistp256WithSha256(in Oct32 p_toBeSignedSecuredMessage, in HashedId8 p_certificateIssuer, in Oct32 p_privateKey) return octetstring; + + /** + * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature + * @param p_toBeSignedSecuredMessage The data to be signed + * @param p_certificateIssuer The digest of the certificate issuer * @param p_privateKey The private key * @return The signature value */ - external function fx_signWithEcdsaBrainpoolp256WithSha256(in Oct32 p_toBeSignedSecuredMessage, in Oct32 p_privateKey) return octetstring; + external function fx_signWithEcdsaBrainpoolp256WithSha256(in Oct32 p_toBeSignedSecuredMessage, in HashedId8 p_certificateIssuer, in Oct32 p_privateKey) return octetstring; /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature * @param p_toBeSignedSecuredMessage The data to be signed + * @param p_certificateIssuer The digest of the certificate issuer * @param p_privateKey The private key * @return The signature value */ - external function fx_signWithEcdsaBrainpoolp384WithSha384(in Oct48 p_toBeSignedSecuredMessage, in Oct48 p_privateKey) return octetstring; + external function fx_signWithEcdsaBrainpoolp384WithSha384(in Oct48 p_toBeSignedSecuredMessage, in HashedId8 p_certificateIssuer, in Oct48 p_privateKey) return octetstring; /** * @desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified + * @param p_certificateIssuer The digest of the certificate issuer * @param p_signature The signature * @param p_ecdsaNistp256PublicKeyCompressed The compressed public key (x coordinate only) * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaNistp256WithSha256(in Oct32 p_toBeVerifiedData, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyCompressed, in integer p_compressedMode) return boolean; + external function fx_verifyWithEcdsaNistp256WithSha256(in Oct32 p_toBeVerifiedData, in HashedId8 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyCompressed, in integer p_compressedMode) return boolean; /** * @desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified + * @param p_certificateIssuer The digest of the certificate issuer * @param p_signature The signature * @param p_ecdsaNistp256PublicKeyX The public key (x coordinate) * @param p_ecdsaNistp256PublicKeyY The public key (y coordinate) * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaNistp256WithSha256_1(in Oct32 p_toBeVerifiedData, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyX, in Oct32 p_ecdsaNistp256PublicKeyY) return boolean; + external function fx_verifyWithEcdsaNistp256WithSha256_1(in Oct32 p_toBeVerifiedData, in HashedId8 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyX, in Oct32 p_ecdsaNistp256PublicKeyY) return boolean; /** * @desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified + * @param p_certificateIssuer The digest of the certificate issuer * @param p_signature The signature * @param p_ecdsaBrainpoolp256PublicKeyCompressed The compressed public key (x coordinate only) * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaBrainpoolp256WithSha256(in Oct32 p_toBeVerifiedData, in octetstring p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyCompressed, in integer p_compressedMode) return boolean; + external function fx_verifyWithEcdsaBrainpoolp256WithSha256(in Oct32 p_toBeVerifiedData, in HashedId8 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyCompressed, in integer p_compressedMode) return boolean; /** * @desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified + * @param p_certificateIssuer The digest of the certificate issuer * @param p_signature The signature * @param p_ecdsaBrainpoolp256PublicKeyX The public key (x coordinate) * @param p_ecdsaBrainpoolp256PublicKeyY The public key (y coordinate) * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaBrainpoolp256WithSha256_1(in Oct32 p_toBeVerifiedData, in octetstring p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyX, in Oct32 p_ecdsaBrainpoolp256PublicKeyY) return boolean; + external function fx_verifyWithEcdsaBrainpoolp256WithSha256_1(in Oct32 p_toBeVerifiedData, in HashedId8 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyX, in Oct32 p_ecdsaBrainpoolp256PublicKeyY) return boolean; /** * @desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified + * @param p_certificateIssuer The digest of the certificate issuer * @param p_signature The signature * @param p_ecdsaBrainpoolp384PublicKeyCompressed The compressed public key (x coordinate) * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaBrainpoolp384WithSha384(in Oct48 p_toBeVerifiedData, in octetstring p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyCompressed, in integer p_compressedMode) return boolean; + external function fx_verifyWithEcdsaBrainpoolp384WithSha384(in Oct48 p_toBeVerifiedData, in HashedId8 p_certificateIssuer, in octetstring p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyCompressed, in integer p_compressedMode) return boolean; /** * @desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified + * @param p_certificateIssuer The digest of the certificate issuer * @param p_signature The signature * @param p_ecdsaBrainpoolp384PublicKeyCompressed The compressed public key (x coordinate only) * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaBrainpoolp384WithSha384_1(in Oct48 p_toBeVerifiedData, in octetstring p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyX, in Oct48 p_ecdsaBrainpoolp384PublicKeyY) return boolean; + external function fx_verifyWithEcdsaBrainpoolp384WithSha384_1(in Oct48 p_toBeVerifiedData, in HashedId8 p_certificateIssuer, in octetstring p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyX, in Oct48 p_ecdsaBrainpoolp384PublicKeyY) return boolean; /** * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. -- GitLab From f78937ed10113cba0a45663fcb3e9c6d03e671b0 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 2 May 2018 12:58:44 +0000 Subject: [PATCH 097/320] Major security bugs fixed for signature. Encryption to do. --- ttcn/Security/LibItsSecurity_Functions.ttcn | 571 +++++++++++++------- 1 file changed, 364 insertions(+), 207 deletions(-) diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 32328b48..d8cbb62d 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -57,12 +57,14 @@ module LibItsSecurity_Functions { /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature - * @param p_toBeSignedSecuredMessage The data to be signed + * @param p_toBeSignedSecuredMessage The data to be signed (Hash ( Hash (Data input) || Hash (Signer identifier input) )) + * @param p_certificateIssuer The hash of the canonical certificate issuer + * @param p_privateKey The private key for signature * @return The signature value */ function f_signWithEcdsaNistp256WithSha256( in octetstring p_toBeSignedSecuredMessage, - in HashedId8 p_certificateIssuer, + in Oct32 p_certificateIssuer, in Oct32 p_privateKey ) return octetstring { return fx_signWithEcdsaNistp256WithSha256( @@ -75,13 +77,14 @@ module LibItsSecurity_Functions { /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature - * @param p_toBeSignedSecuredMessage The data to be signed - * @param p_privateKey The private key + * @param p_toBeSignedSecuredMessage The data to be signed (Hash ( Hash (Data input) || Hash (Signer identifier input) )) + * @param p_certificateIssuer The hash of the canonical certificate issuer + * @param p_privateKey The private key for signature * @return The signature value */ function f_signWithEcdsaBrainpoolp256WithSha256( in octetstring p_toBeSignedSecuredMessage, - in HashedId8 p_certificateIssuer, + in Oct32 p_certificateIssuer, in Oct32 p_privateKey ) return octetstring { return fx_signWithEcdsaBrainpoolp256WithSha256( @@ -94,13 +97,14 @@ module LibItsSecurity_Functions { /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature - * @param p_toBeSignedSecuredMessage The data to be signed - * @param p_privateKey The private key + * @param p_toBeSignedSecuredMessage The data to be signed (Hash ( Hash (Data input) || Hash (Signer identifier input) )) + * @param p_certificateIssuer The hash of the canonical certificate issuer + * @param p_privateKey The private key for signature * @return The signature value */ function f_signWithEcdsaBrainpoolp384WithSha384( in octetstring p_toBeSignedSecuredMessage, - in HashedId8 p_certificateIssuer, + in Oct48 p_certificateIssuer, in Oct48 p_privateKey ) return octetstring { return fx_signWithEcdsaBrainpoolp384WithSha384( @@ -140,15 +144,30 @@ module LibItsSecurity_Functions { if (ischosen(v_pKRecipientInfo.encKey.eciesNistP256)) { var octetstring v_decryptedSecuredMessage; var SymmetricCiphertext v_ciphertext := p_encrypedSecuredMessage.content.encryptedData.ciphertext; - v_decryptedSecuredMessage := f_decryptWithEciesNistp256WithSha256( - v_ciphertext.aes128ccm.ccmCiphertext, - p_encryptPrivateKey, - v_pKRecipientInfo.encKey.eciesNistP256.v.uncompressedP256.x, - v_pKRecipientInfo.encKey.eciesNistP256.v.uncompressedP256.y, - v_pKRecipientInfo.encKey.eciesNistP256.c, - v_pKRecipientInfo.encKey.eciesNistP256.t, - v_ciphertext.aes128ccm.nonce - ); + if (ischosen(v_pKRecipientInfo.encKey.eciesNistP256.v.compressed_y_0)) { + v_decryptedSecuredMessage := f_decryptWithEciesNistp256WithSha256( + v_ciphertext.aes128ccm.ccmCiphertext, + p_encryptPrivateKey, + v_pKRecipientInfo.encKey.eciesNistP256.v.compressed_y_0, + 0, + v_pKRecipientInfo.encKey.eciesNistP256.c, + v_pKRecipientInfo.encKey.eciesNistP256.t, + v_ciphertext.aes128ccm.nonce + ); + } else if (ischosen(v_pKRecipientInfo.encKey.eciesNistP256.v.compressed_y_1)) { + v_decryptedSecuredMessage := f_decryptWithEciesNistp256WithSha256( + v_ciphertext.aes128ccm.ccmCiphertext, + p_encryptPrivateKey, + v_pKRecipientInfo.encKey.eciesNistP256.v.compressed_y_1, + 1, + v_pKRecipientInfo.encKey.eciesNistP256.c, + v_pKRecipientInfo.encKey.eciesNistP256.t, + v_ciphertext.aes128ccm.nonce + ); + } else { + log("*** " & testcasename() & ":ERROR: Non canonical ephemeral encryption keys ***"); + return false; + } if (isbound(v_decryptedSecuredMessage)) { var bitstring v_decode := oct2bit(v_decryptedSecuredMessage); if (decvalue(v_decode, p_decrypedSecuredMessage) == 0) { @@ -160,15 +179,30 @@ module LibItsSecurity_Functions { } else if (ischosen(v_pKRecipientInfo.encKey.eciesBrainpoolP256r1)) { var octetstring v_decryptedSecuredMessage; var SymmetricCiphertext v_ciphertext := p_encrypedSecuredMessage.content.encryptedData.ciphertext; - v_decryptedSecuredMessage := f_decryptWithEciesBrainpoolp256WithSha256( - v_ciphertext.aes128ccm.ccmCiphertext, - p_encryptPrivateKey, - v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.uncompressedP256.x, - v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.uncompressedP256.y, - v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.c, - v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.t, - v_ciphertext.aes128ccm.nonce - ); + if (ischosen(v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.compressed_y_0)) { + v_decryptedSecuredMessage := f_decryptWithEciesBrainpoolp256WithSha256( + v_ciphertext.aes128ccm.ccmCiphertext, + p_encryptPrivateKey, + v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.compressed_y_0, + 0, + v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.c, + v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.t, + v_ciphertext.aes128ccm.nonce + ); + } else if (ischosen(v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.compressed_y_1)) { + v_decryptedSecuredMessage := f_decryptWithEciesBrainpoolp256WithSha256( + v_ciphertext.aes128ccm.ccmCiphertext, + p_encryptPrivateKey, + v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.compressed_y_1, + 1, + v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.c, + v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.t, + v_ciphertext.aes128ccm.nonce + ); + } else { + log("*** " & testcasename() & ":ERROR: Non canonical ephemeral encryption keys ***"); + return false; + } if (isbound(v_decryptedSecuredMessage)) { var bitstring v_decode := oct2bit(v_decryptedSecuredMessage); if (decvalue(v_decode, p_decrypedSecuredMessage) == 0) { @@ -188,10 +222,10 @@ module LibItsSecurity_Functions { /** * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption using Nist-P256 algorithm * @param p_toBeEncryptedSecuredMessage The data to be encrypted - * @param p_recipientsPublicKeyX The Recipient's public encryption key X-coordinate - * @param p_recipientsPublicKeyY The Recipient's public encryption key Y-coordinate - * @param p_publicEphemeralKeyX The generated ephemeral key X-coordinate - * @param p_publicEphemeralKeyY The generated ephemeral key Y-coordinate + * @param p_recipientsPublicKeyCompressed The Recipient's compressed public key + * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key + * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption @@ -202,20 +236,20 @@ module LibItsSecurity_Functions { */ function f_encryptWithEciesNistp256WithSha256( in octetstring p_toBeEncryptedSecuredMessage, - in Oct32 p_recipientsPublicKeyX, - in Oct32 p_recipientsPublicKeyY, - out Oct32 p_publicEphemeralKeyX, - out Oct32 p_publicEphemeralKeyY, + in Oct32 p_recipientsPublicKeyCompressed, + in integer p_compressedMode, + out Oct32 p_publicEphemeralKeyCompressed, + out integer p_ephemeralKeyModeCompressed, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce ) return octetstring { return fx_encryptWithEciesNistp256WithSha256( p_toBeEncryptedSecuredMessage, - p_recipientsPublicKeyX, - p_recipientsPublicKeyY, - p_publicEphemeralKeyX, - p_publicEphemeralKeyY, + p_recipientsPublicKeyCompressed, + p_compressedMode, + p_publicEphemeralKeyCompressed, + p_ephemeralKeyModeCompressed, p_encrypted_sym_key, p_authentication_vector, p_nonce @@ -225,8 +259,8 @@ module LibItsSecurity_Functions { /** * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Nist-P256 algorithm * @param p_encryptedSecuredMessage The data to be decrypted - * @param p_publicEphemeralKeyX The generated ephemeral key X-coordinate - * @param p_publicEphemeralKeyY The generated ephemeral key Y-coordinate + * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key + * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption @@ -238,8 +272,8 @@ module LibItsSecurity_Functions { function f_decryptWithEciesNistp256WithSha256( in octetstring p_encryptedSecuredMessage, in Oct32 p_privateEncKey, - in Oct32 p_publicEphemeralKeyX, - in Oct32 p_publicEphemeralKeyY, + in Oct32 p_publicEphemeralKeyCompressed, + in integer p_ephemeralKeyModeCompressed, in Oct16 p_encrypted_sym_key, in Oct16 p_authentication_vector, in Oct12 p_nonce @@ -247,8 +281,8 @@ module LibItsSecurity_Functions { return fx_decryptWithEciesNistp256WithSha256( p_encryptedSecuredMessage, p_privateEncKey, - p_publicEphemeralKeyX, - p_publicEphemeralKeyY, + p_publicEphemeralKeyCompressed, + p_ephemeralKeyModeCompressed, p_encrypted_sym_key, p_authentication_vector, p_nonce @@ -258,10 +292,10 @@ module LibItsSecurity_Functions { /** * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption using Brainpool-P256 algorithm * @param p_toBeEncryptedSecuredMessage The data to be encrypted - * @param p_recipientsPublicKeyX The Recipient's public encryption key X-coordinate - * @param p_recipientsPublicKeyY The Recipient's public encryption key Y-coordinate - * @param p_publicEphemeralKeyX The generated ephemeral key X-coordinate - * @param p_publicEphemeralKeyY The generated ephemeral key Y-coordinate + * @param p_recipientsPublicKeyCompressed The Recipient's compressed public key + * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key + * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption @@ -271,32 +305,32 @@ module LibItsSecurity_Functions { * @see http://digital.csic.es/bitstream/10261/32671/1/V2-I2-P7-13.pdf */ function f_encryptWithEciesBrainpoolp256WithSha256( - in octetstring p_toBeEncryptedSecuredMessage, - in Oct32 p_recipientsPublicKeyX, - in Oct32 p_recipientsPublicKeyY, - out Oct32 p_publicEphemeralKeyX, - out Oct32 p_publicEphemeralKeyY, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce + in octetstring p_toBeEncryptedSecuredMessage, + in Oct32 p_recipientsPublicKeyX, + in integer p_compressedMode, + out Oct32 p_publicEphemeralKeyCompressed, + out integer p_ephemeralKeyModeCompressed, + out Oct16 p_encrypted_sym_key, + out Oct16 p_authentication_vector, + out Oct12 p_nonce ) return octetstring { return fx_encryptWithEciesBrainpoolp256WithSha256( - p_toBeEncryptedSecuredMessage, - p_recipientsPublicKeyX, - p_recipientsPublicKeyY, - p_publicEphemeralKeyX, - p_publicEphemeralKeyY, - p_encrypted_sym_key, - p_authentication_vector, - p_nonce - ); + p_toBeEncryptedSecuredMessage, + p_recipientsPublicKeyX, + p_compressedMode, + p_publicEphemeralKeyCompressed, + p_ephemeralKeyModeCompressed, + p_encrypted_sym_key, + p_authentication_vector, + p_nonce + ); } // End of function f_encryptWithEciesBrainpoolp256WithSha256 /** * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Brainpool-P256 algorithm * @param p_encryptedSecuredMessage The data to be decrypted - * @param p_publicEphemeralKeyX The generated ephemeral key X-coordinate - * @param p_publicEphemeralKeyY The generated ephemeral key Y-coordinate + * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key + * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption @@ -306,23 +340,23 @@ module LibItsSecurity_Functions { * @see http://digital.csic.es/bitstream/10261/32671/1/V2-I2-P7-13.pdf */ function f_decryptWithEciesBrainpoolp256WithSha256( - in octetstring p_encryptedSecuredMessage, - in Oct32 p_privateEncKey, - in Oct32 p_publicEphemeralKeyX, - in Oct32 p_publicEphemeralKeyY, - in Oct16 p_encrypted_sym_key, - in Oct16 p_authentication_vector, - in Oct12 p_nonce + in octetstring p_encryptedSecuredMessage, + in Oct32 p_privateEncKey, + in Oct32 p_publicEphemeralKeyCompressed, + in integer p_ephemeralKeyModeCompressed, + in Oct16 p_encrypted_sym_key, + in Oct16 p_authentication_vector, + in Oct12 p_nonce ) return octetstring { return fx_decryptWithEciesBrainpoolp256WithSha256( - p_encryptedSecuredMessage, - p_privateEncKey, - p_publicEphemeralKeyX, - p_publicEphemeralKeyY, - p_encrypted_sym_key, - p_authentication_vector, - p_nonce - ); + p_encryptedSecuredMessage, + p_privateEncKey, + p_publicEphemeralKeyCompressed, + p_ephemeralKeyModeCompressed, + p_encrypted_sym_key, + p_authentication_vector, + p_nonce + ); } // End of function f_decryptWithEcdsaBrainpoolp256WithSha256 /** @@ -364,7 +398,7 @@ module LibItsSecurity_Functions { /** * @desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The digest of the certificate issuer + * @param p_certificateIssuer The hash of the canonical certificate issuer * @param p_signature The signature * @param p_ecdsaNistp256PublicKeyCompressed The compressed public key * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise @@ -372,7 +406,7 @@ module LibItsSecurity_Functions { */ function f_verifyWithEcdsaNistp256WithSha256( in octetstring p_toBeVerifiedData, - in HashedId8 p_certificateIssuer, + in Oct32 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyCompressed, in integer p_compressedMode @@ -393,7 +427,7 @@ module LibItsSecurity_Functions { /** * @desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The digest of the certificate issuer + * @param p_certificateIssuer The hash of the canonical certificate issuer * @param p_signature The signature * @param p_ecdsaNistp256PublicKeyX The public key (x coordinate) * @param p_ecdsaNistp256PublicKeyY The public key (y coordinate) @@ -401,7 +435,7 @@ module LibItsSecurity_Functions { */ function f_verifyWithEcdsaNistp256WithSha256_1( // TODO To be removed in octetstring p_toBeVerifiedData, - in HashedId8 p_certificateIssuer, + in Oct32 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyX, in Oct32 p_ecdsaNistp256PublicKeyY @@ -422,7 +456,7 @@ module LibItsSecurity_Functions { /** * @Desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The digest of the certificate issuer + * @param p_certificateIssuer The hash of the canonical certificate issuer * @param p_signature The signature * @param p_ecdsaBrainpoolp256PublicKeyCompressed The compressed public key * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise @@ -430,7 +464,7 @@ module LibItsSecurity_Functions { */ function f_verifyWithEcdsaBrainpoolp256WithSha256( in octetstring p_toBeVerifiedData, - in HashedId8 p_certificateIssuer, + in Oct32 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyCompressed, in integer p_compressedMode @@ -451,7 +485,7 @@ module LibItsSecurity_Functions { /** * @Desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The digest of the certificate issuer + * @param p_certificateIssuer The hash of the canonical certificate issuer * @param p_signature The signature * @param p_ecdsaBrainpoolp256PublicKeyX The public key (x coordinate) * @param p_ecdsaBrainpoolp256PublicKeyY The public key (y coordinate) @@ -459,7 +493,7 @@ module LibItsSecurity_Functions { */ function f_verifyWithEcdsaBrainpoolp256WithSha256_1( // TODO To be removed in octetstring p_toBeVerifiedData, - in HashedId8 p_certificateIssuer, + in Oct32 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyX, in Oct32 p_ecdsaBrainpoolp256PublicKeyY @@ -480,7 +514,7 @@ module LibItsSecurity_Functions { /** * @Desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The digest of the certificate issuer + * @param p_certificateIssuer The hash of the canonical certificate issuer * @param p_signature The signature * @param p_ecdsaBrainpoolp384PublicKeyX The public key (x coordinate) * @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate) @@ -489,7 +523,7 @@ module LibItsSecurity_Functions { */ function f_verifyWithEcdsaBrainpoolp384WithSha384( in octetstring p_toBeVerifiedData, - in HashedId8 p_certificateIssuer, + in Oct48 p_certificateIssuer, in octetstring p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyCompressed, in integer p_compressedMode @@ -510,7 +544,7 @@ module LibItsSecurity_Functions { /** * @Desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The digest of the certificate issuer + * @param p_certificateIssuer The hash of the canonical certificate issuer * @param p_signature The signature * @param p_ecdsaBrainpoolp384PublicKeyX The public key (x coordinate) * @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate) @@ -518,7 +552,7 @@ module LibItsSecurity_Functions { */ function f_verifyWithEcdsaBrainpoolp384WithSha384_1( // TODO To be removed in octetstring p_toBeVerifiedData, - in HashedId8 p_certificateIssuer, + in Oct48 p_certificateIssuer, in octetstring p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyX, in Oct48 p_ecdsaBrainpoolp384PublicKeyY @@ -715,8 +749,8 @@ module LibItsSecurity_Functions { var octetstring v_secPayload, v_signature; var ToBeSignedData v_toBeSignedData; var Ieee1609Dot2Content v_toBeSignedPayload; - var HashedId8 v_certificateDigest; - var Oct32 v_privateKey; + var octetstring v_certificateHash; + var octetstring v_privateKey; // Prepare payload to be signed v_toBeSignedData := valueof(p_payloadField); @@ -732,12 +766,12 @@ module LibItsSecurity_Functions { return false; } } - f_getCertificateDigest(p_certificateName, v_certificateDigest); + f_getCertificateHash(p_certificateName, v_certificateHash); if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature)) { v_signature := f_signWithEcdsaNistp256WithSha256( v_secPayload, - v_certificateDigest, + v_certificateHash, v_privateKey ); p_securedMessage.content.signedData.signature_ := m_signature_ecdsaNistP256( @@ -749,7 +783,7 @@ module LibItsSecurity_Functions { } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { v_signature := f_signWithEcdsaBrainpoolp256WithSha256( v_secPayload, - v_certificateDigest, + v_certificateHash, v_privateKey ); p_securedMessage.content.signedData.signature_ := m_signature_ecdsaBrainpoolP256r1( @@ -758,6 +792,18 @@ module LibItsSecurity_Functions { substr(v_signature, 32, 32) ) ); + } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature)) { + v_signature := f_signWithEcdsaBrainpoolp384WithSha384( + v_secPayload, + v_certificateHash, + v_privateKey + ); + p_securedMessage.content.signedData.signature_ := m_signature_ecdsaBrainpoolP384r1( + m_ecdsaP384Signature( + m_eccP384CurvePoint_x_only(substr(v_signature, 0, 32)), + substr(v_signature, 32, 32) + ) + ); } // TODO To be continued return true; @@ -1485,7 +1531,8 @@ module LibItsSecurity_Functions { var octetstring v_enc_msg; var octetstring v_signature; - log("f_verifyCertificateSignatureWithPublicKey: p_publicVerificationKey=", p_publicVerificationKey); + log(">>> f_verifyCertificateSignatureWithPublicKey: p_certificateToBeVerified=", p_certificateToBeVerified); + log(">>> f_verifyCertificateSignatureWithPublicKey: p_publicVerificationKey=", p_publicVerificationKey); // Create ToBeSignedCertificate payload to be signed v_toBeSignedCertificate := valueof(p_certificateToBeVerified.toBeSigned); @@ -1496,12 +1543,28 @@ module LibItsSecurity_Functions { // Verify payload if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1)) { + var Oct32 v_hash; + + if (ischosen(p_certificateToBeVerified.issuer.self_)) { + v_hash := int2oct(0, 32); + } else { + var charstring v_certificate; + + if (fx_readCertificateFromDigest(valueof(p_certificateToBeVerified.issuer.sha256AndDigest), v_certificate) == false) { + log("f_verifyCertificateSignatureWithPublicKey: Invalid issuer: ", p_certificateToBeVerified.issuer.sha256AndDigest); + return false; + } + if (f_getCertificateHash(v_certificate, v_hash) == false) { + log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate: " & v_certificate); + return false; + } + } v_signature := valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only) & valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP256r1Signature.sSig); log("f_verifyCertificateSignatureWithPublicKey: v_signedData=", v_signature); if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1.uncompressedP256)) { return f_verifyWithEcdsaBrainpoolp256WithSha256_1( v_enc_msg, - valueof(p_certificateToBeVerified.issuer.sha256AndDigest), + v_hash, v_signature, valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.uncompressedP256.x), valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.uncompressedP256.y) @@ -1509,7 +1572,7 @@ module LibItsSecurity_Functions { } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1.compressed_y_0)) { return f_verifyWithEcdsaBrainpoolp256WithSha256( v_enc_msg, - valueof(p_certificateToBeVerified.issuer.sha256AndDigest), + v_hash, v_signature, valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.compressed_y_0), 0 // Latest bit of the Y-coordinate is 0 @@ -1517,7 +1580,7 @@ module LibItsSecurity_Functions { } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1.compressed_y_1)) { return f_verifyWithEcdsaBrainpoolp256WithSha256( v_enc_msg, - valueof(p_certificateToBeVerified.issuer.sha256AndDigest), + v_hash, v_signature, valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.compressed_y_1), 1 // Latest bit of the Y-coordinate is 1 @@ -1527,12 +1590,28 @@ module LibItsSecurity_Functions { return false; } } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1)) { + var Oct48 v_hash; + + if (ischosen(p_certificateToBeVerified.issuer.self_)) { + v_hash := int2oct(0, 48); + } else { + var charstring v_certificate; + + if (fx_readCertificateFromDigest(valueof(p_certificateToBeVerified.issuer.sha384AndDigest), v_certificate) == false) { + log("f_verifyCertificateSignatureWithPublicKey: Invalid issuer: ", p_certificateToBeVerified.issuer.sha384AndDigest); + return false; + } + if (f_getCertificateHash(v_certificate, v_hash) == false) { + log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate: " & v_certificate); + return false; + } + } v_signature := valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only) & valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP384r1Signature.sSig); log("f_verifyCertificateSignatureWithPublicKey: v_signedData=", v_signature); if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1.uncompressedP384)) { return f_verifyWithEcdsaBrainpoolp384WithSha384_1( v_enc_msg, - valueof(p_certificateToBeVerified.issuer.sha384AndDigest), + v_hash, v_signature, valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.uncompressedP384.x), valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.uncompressedP384.y) @@ -1540,7 +1619,7 @@ module LibItsSecurity_Functions { } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1.compressed_y_0)) { return f_verifyWithEcdsaBrainpoolp384WithSha384( v_enc_msg, - valueof(p_certificateToBeVerified.issuer.sha384AndDigest), + v_hash, v_signature, valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.compressed_y_0), 0 // Latest bit of the Y-coordinate is 0 @@ -1548,7 +1627,7 @@ module LibItsSecurity_Functions { } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1.compressed_y_1)) { return f_verifyWithEcdsaBrainpoolp384WithSha384( v_enc_msg, - valueof(p_certificateToBeVerified.issuer.sha384AndDigest), + v_hash, v_signature, valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.compressed_y_1), 1 // Latest bit of the Y-coordinate is 1 @@ -1558,32 +1637,48 @@ module LibItsSecurity_Functions { return false; } } else if (ischosen(p_publicVerificationKey.ecdsaNistP256)) { + var Oct32 v_hash; + + if (ischosen(p_certificateToBeVerified.issuer.self_)) { + v_hash := int2oct(0, 32); + } else { + var charstring v_certificate; + + if (fx_readCertificateFromDigest(valueof(p_certificateToBeVerified.issuer.sha256AndDigest), v_certificate) == false) { + log("f_verifyCertificateSignatureWithPublicKey: Invalid issuer: ", p_certificateToBeVerified.issuer.sha256AndDigest); + return false; + } + if (f_getCertificateHash(v_certificate, v_hash) == false) { + log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate: " & v_certificate); + return false; + } + } v_signature := valueof(p_certificateToBeVerified.signature_.ecdsaNistP256Signature.rSig.x_only) & valueof(p_certificateToBeVerified.signature_.ecdsaNistP256Signature.sSig); log("f_verifyCertificateSignatureWithPublicKey: v_signedData=", v_signature); if (ischosen(p_publicVerificationKey.ecdsaNistP256.uncompressedP256)) { return f_verifyWithEcdsaNistp256WithSha256_1( v_enc_msg, - valueof(p_certificateToBeVerified.issuer.sha256AndDigest), + v_hash, v_signature, valueof(p_publicVerificationKey.ecdsaNistP256.uncompressedP256.x), valueof(p_publicVerificationKey.ecdsaNistP256.uncompressedP256.y) ); } else if (ischosen(p_publicVerificationKey.ecdsaNistP256.compressed_y_0)) { return f_verifyWithEcdsaNistp256WithSha256( - v_enc_msg, - valueof(p_certificateToBeVerified.issuer.sha256AndDigest), - v_signature, - valueof(p_publicVerificationKey.ecdsaNistP256.compressed_y_0), - 0 // Latest bit of the Y-coordinate is 0 - ); + v_enc_msg, + v_hash, + v_signature, + valueof(p_publicVerificationKey.ecdsaNistP256.compressed_y_0), + 0 // Latest bit of the Y-coordinate is 0 + ); } else if (ischosen(p_publicVerificationKey.ecdsaNistP256.compressed_y_1)) { return f_verifyWithEcdsaNistp256WithSha256( - v_enc_msg, - valueof(p_certificateToBeVerified.issuer.sha256AndDigest), - v_signature, - valueof(p_publicVerificationKey.ecdsaNistP256.compressed_y_1), - 1 // Latest bit of the Y-coordinate is 1 - ); + v_enc_msg, + v_hash, + v_signature, + valueof(p_publicVerificationKey.ecdsaNistP256.compressed_y_1), + 1 // Latest bit of the Y-coordinate is 1 + ); } else { log("f_verifyCertificateSignatureWithPublicKey: Unknown PublicVerificationKey value"); return false; @@ -1625,7 +1720,7 @@ module LibItsSecurity_Functions { */ function f_verifyGnSecuredMessageSignature_ecdsaNistP256( in template (value) Ieee1609Dot2Data p_securedMessage, - in template (value) HashedId8 p_certificateIssuer, + in template (value) Oct32 p_certificateIssuer, in template (value) EccP256CurvePoint p_publicKey ) return boolean { @@ -1689,7 +1784,7 @@ module LibItsSecurity_Functions { */ function f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1( in template (value) Ieee1609Dot2Data p_securedMessage, - in template (value) HashedId8 p_certificateIssuer, + in template (value) Oct32 p_certificateIssuer, in template (value) EccP256CurvePoint p_publicKey ) return boolean { @@ -1753,7 +1848,7 @@ module LibItsSecurity_Functions { */ function f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1( in template (value) Ieee1609Dot2Data p_securedMessage, - in template (value) HashedId8 p_certificateIssuer, + in template (value) Oct48 p_certificateIssuer, in template (value) EccP384CurvePoint p_publicKey ) return boolean { @@ -1818,13 +1913,46 @@ module LibItsSecurity_Functions { in template (value) Ieee1609Dot2Data p_securedMessage, in template (value) EtsiTs103097Certificate p_certificate ) return boolean { - + if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { - return f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1(p_securedMessage, p_certificate.issuer.sha256AndDigest, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1); + var charstring v_certificate; + var Oct32 v_hash; + + if (fx_readCertificateFromDigest(valueof(p_certificate.issuer.sha256AndDigest), v_certificate) == false) { + log("f_verifyCertificateSignatureWithPublicKey: Invalid issuer: ", p_certificate.issuer.sha256AndDigest); + return false; + } + if (f_getCertificateHash(v_certificate, v_hash) == false) { + log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate: " & v_certificate); + return false; + } + return f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1(p_securedMessage, v_hash, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1); } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature)) { - return f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1(p_securedMessage, p_certificate.issuer.sha384AndDigest, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1); + var charstring v_certificate; + var Oct48 v_hash; + + if (fx_readCertificateFromDigest(valueof(p_certificate.issuer.sha384AndDigest), v_certificate) == false) { + log("f_verifyCertificateSignatureWithPublicKey: Invalid issuer: ", p_certificate.issuer.sha384AndDigest); + return false; + } + if (f_getCertificateHash(v_certificate, v_hash) == false) { + log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate: " & v_certificate); + return false; + } + return f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1(p_securedMessage, v_hash, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1); } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature)) { - return f_verifyGnSecuredMessageSignature_ecdsaNistP256(p_securedMessage, p_certificate.issuer.sha256AndDigest, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256); + var charstring v_certificate; + var Oct32 v_hash; + + if (fx_readCertificateFromDigest(valueof(p_certificate.issuer.sha256AndDigest), v_certificate) == false) { + log("f_verifyCertificateSignatureWithPublicKey: Invalid issuer: ", p_certificate.issuer.sha256AndDigest); + return false; + } + if (f_getCertificateHash(v_certificate, v_hash) == false) { + log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate: " & v_certificate); + return false; + } + return f_verifyGnSecuredMessageSignature_ecdsaNistP256(p_securedMessage, v_hash, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256); } return false; @@ -1958,15 +2086,15 @@ module LibItsSecurity_Functions { } // End of function f_unloadCertificates /** - * @desc Read the specified certificate - * @param p_certificateId the certificate identifier - * @param p_certificate the expected certificate - * @return true on success, false otherwise - */ + * @desc Read the specified certificate + * @param p_certificateId the certificate identifier + * @param p_certificate the expected certificate + * @return true on success, false otherwise + */ function f_readCertificate( in charstring p_certificateId, out EtsiTs103097Certificate p_certificate - ) runs on ItsSecurityBaseComponent return boolean { + ) return boolean { var octetstring v_certificate; if (fx_readCertificate(p_certificateId, v_certificate) == true) { @@ -1985,15 +2113,15 @@ module LibItsSecurity_Functions { } // End of function f_readCertificate /** - * @desc Read the specified certificate - * @param p_certificateId the certificate identifier - * @param p_certificate the expected certificate - * @return true on success, false otherwise - */ + * @desc Read the specified certificate + * @param p_certificateId the certificate identifier + * @param p_digest the digest of the certificate + * @return true on success, false otherwise + */ function f_getCertificateDigest( in charstring p_certificateId, out HashedId8 p_digest - ) runs on ItsSecurityBaseComponent return boolean { + ) return boolean { if (not fx_readCertificateDigest(p_certificateId, p_digest)){ log("f_getCertificateDigest: Failed to retrieve digest for ", p_certificateId); return false; @@ -2001,10 +2129,27 @@ module LibItsSecurity_Functions { return true; } // End of function f_getCertificateDigest + /** + * @desc Read the whole-hash of the certificate + * @param p_certificateId the certificate identifier + * @param p_hash the whole-hash of the certificate + * @return true on success, false otherwise + */ + function f_getCertificateHash( + in charstring p_certificateId, + out octetstring p_hash + ) return boolean { + if (not fx_readCertificateHash(p_certificateId, p_hash)){ + log("f_getCertificateHash: Failed to retrieve digest for ", p_certificateId); + return false; + } + return true; + } // End of function f_getCertificateHash + function f_getCertificateFromDigest( in HashedId8 p_digest, out EtsiTs103097Certificate p_certificate - ) runs on ItsSecurityBaseComponent return boolean { + ) return boolean { var charstring v_certificate_id; if (not(fx_readCertificateFromDigest(p_digest, v_certificate_id))) { log("f_getCertificateFromDigest: Failed to retrieve digest for ", p_digest); @@ -2026,7 +2171,7 @@ module LibItsSecurity_Functions { function f_readSigningKey( in charstring p_keysId, out Oct32 p_signingPrivateKey - ) runs on ItsSecurityBaseComponent return boolean { + ) return boolean { return fx_readSigningKey(p_keysId, p_signingPrivateKey); } // End of function f_readSigningKey @@ -2039,7 +2184,7 @@ module LibItsSecurity_Functions { function f_readEncryptingKey( in charstring p_keysId, out Oct32 p_encryptPrivateKey - ) runs on ItsSecurityBaseComponent return boolean { + ) return boolean { return fx_readEncryptingKey(p_keysId, p_encryptPrivateKey); } // End of function f_readEncryptingKey @@ -2149,143 +2294,147 @@ module LibItsSecurity_Functions { /** * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption using Nist-P256 algorithm * @param p_toBeEncryptedSecuredMessage The data to be encrypted - * @param p_recipientsPublicKeyX The Recipient's public encryption key X-coordinate - * @param p_recipientsPublicKeyY The Recipient's public encryption key Y-coordinate - * @param p_publicEphemeralKeyX The generated ephemeral key X-coordinate - * @param p_publicEphemeralKeyY The generated ephemeral key Y-coordinate + * @param p_recipientsPublicKeyCompressed The Recipient's compressed public key + * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key + * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption * @return The encrypted message */ - external function fx_encryptWithEciesNistp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyX, in Oct32 p_recipientsPublicKeyY, out Oct32 p_publicEphemeralKeyX, out Oct32 p_publicEphemeralKeyY, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; + external function fx_encryptWithEciesNistp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyCompressed, in integer p_compressedMode, out Oct32 p_publicEphemeralKeyCompressed, out integer p_ephemeralKeyModeCompressed, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; /** * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Nist-P256 algorithm * @param p_encryptedSecuredMessage The data to be decrypted - * @param p_publicEphemeralKeyX The generated ephemeral key X-coordinate - * @param p_publicEphemeralKeyY The generated ephemeral key Y-coordinate + * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key + * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption * @return The decrypted message */ - external function fx_decryptWithEciesNistp256WithSha256(in octetstring p_encryptedSecuredMessage, in Oct32 p_privateEncKey, in Oct32 p_publicEphemeralKeyX, in Oct32 p_publicEphemeralKeyY, in Oct16 p_encrypted_sym_key, in Oct16 p_authentication_vector, in Oct12 p_nonce) return octetstring; + external function fx_decryptWithEciesNistp256WithSha256(in octetstring p_encryptedSecuredMessage, in Oct32 p_privateEncKey, in Oct32 p_publicEphemeralKeyCompressed, in integer p_ephemeralKeyModeCompressed, in Oct16 p_encrypted_sym_key, in Oct16 p_authentication_vector, in Oct12 p_nonce) return octetstring; /** * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption using Brainpool-P256 algorithm * @param p_toBeEncryptedSecuredMessage The data to be encrypted - * @param p_recipientsPublicKeyX The Recipient's public encryption key X-coordinate - * @param p_recipientsPublicKeyY The Recipient's public encryption key Y-coordinate - * @param p_publicEphemeralKeyX The generated ephemeral key X-coordinate - * @param p_publicEphemeralKeyY The generated ephemeral key Y-coordinate + * @param p_recipientsPublicKeyCompressed The Recipient's compressed public key + * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key + * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption * @return The encrypted message */ - external function fx_encryptWithEciesBrainpoolp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyX, in Oct32 p_recipientsPublicKeyY, out Oct32 p_publicEphemeralKeyX, out Oct32 p_publicEphemeralKeyY, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; + external function fx_encryptWithEciesBrainpoolp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyCompressed, in integer p_compressedMode, out Oct32 p_publicEphemeralKeyCompressed, out integer p_ephemeralKeyModeCompressed, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; /** * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Brainpool-P256 algorithm * @param p_encryptedSecuredMessage The data to be decrypted - * @param p_publicEphemeralKeyX The generated ephemeral key X-coordinate - * @param p_publicEphemeralKeyY The generated ephemeral key Y-coordinate + * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key + * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption * @return The decrypted message */ - external function fx_decryptWithEciesBrainpoolp256WithSha256(in octetstring p_encryptedSecuredMessage, in Oct32 p_privateEncKey, in Oct32 p_publicEphemeralKeyX, in Oct32 p_publicEphemeralKeyY, in Oct16 p_encrypted_sym_key, in Oct16 p_authentication_vector, in Oct12 p_nonce) return octetstring; + external function fx_decryptWithEciesBrainpoolp256WithSha256(in octetstring p_encryptedSecuredMessage, in Oct32 p_privateEncKey, in Oct32 p_publicEphemeralKeyCompressed, in integer p_ephemeralKeyModeCompressed, in Oct16 p_encrypted_sym_key, in Oct16 p_authentication_vector, in Oct12 p_nonce) return octetstring; /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature * @param p_toBeSignedSecuredMessage The data to be signed - * @param p_certificateIssuer The digest of the certificate issuer + * @param p_certificateIssuer The hash of the canonical certificate issuer * @param p_privateKey The private key * @return The signature value */ - external function fx_signWithEcdsaNistp256WithSha256(in Oct32 p_toBeSignedSecuredMessage, in HashedId8 p_certificateIssuer, in Oct32 p_privateKey) return octetstring; + external function fx_signWithEcdsaNistp256WithSha256(in Oct32 p_toBeSignedSecuredMessage, in Oct32 p_certificateIssuer, in Oct32 p_privateKey) return octetstring; /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature - * @param p_toBeSignedSecuredMessage The data to be signed - * @param p_certificateIssuer The digest of the certificate issuer - * @param p_privateKey The private key + * @param p_toBeSignedSecuredMessage The data to be signed (Hash ( Hash (Data input) || Hash (Signer identifier input) )) + * @param p_certificateIssuer The hash of the canonical certificate issuer + * @param p_privateKey The private key for signature * @return The signature value */ - external function fx_signWithEcdsaBrainpoolp256WithSha256(in Oct32 p_toBeSignedSecuredMessage, in HashedId8 p_certificateIssuer, in Oct32 p_privateKey) return octetstring; + external function fx_signWithEcdsaBrainpoolp256WithSha256(in Oct32 p_toBeSignedSecuredMessage, in Oct32 p_certificateIssuer, in Oct32 p_privateKey) return octetstring; /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature - * @param p_toBeSignedSecuredMessage The data to be signed - * @param p_certificateIssuer The digest of the certificate issuer - * @param p_privateKey The private key + * @param p_toBeSignedSecuredMessage The data to be signed (Hash ( Hash (Data input) || Hash (Signer identifier input) )) + * @param p_certificateIssuer The hash of the canonical certificate issuer + * @param p_privateKey The private key for signature * @return The signature value */ - external function fx_signWithEcdsaBrainpoolp384WithSha384(in Oct48 p_toBeSignedSecuredMessage, in HashedId8 p_certificateIssuer, in Oct48 p_privateKey) return octetstring; + external function fx_signWithEcdsaBrainpoolp384WithSha384(in Oct48 p_toBeSignedSecuredMessage, in Oct48 p_certificateIssuer, in Oct48 p_privateKey) return octetstring; /** * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The digest of the certificate issuer + * @param p_toBeVerifiedData The data to be verified (Hash ( Hash (Data input) || Hash (Signer identifier input) )) + * @param p_certificateIssuer The hash of the canonical certificate issuer * @param p_signature The signature - * @param p_ecdsaNistp256PublicKeyCompressed The compressed public key (x coordinate only) + * @param p_ecdsaNistp256PublicKeyCompressed The compressed public key + * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaNistp256WithSha256(in Oct32 p_toBeVerifiedData, in HashedId8 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyCompressed, in integer p_compressedMode) return boolean; + external function fx_verifyWithEcdsaNistp256WithSha256(in Oct32 p_toBeVerifiedData, in Oct32 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyCompressed, in integer p_compressedMode) return boolean; /** * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The digest of the certificate issuer + * @param p_toBeVerifiedData The data to be verified (Hash ( Hash (Data input) || Hash (Signer identifier input) )) + * @param p_certificateIssuer The hash of the canonical certificate issuer * @param p_signature The signature * @param p_ecdsaNistp256PublicKeyX The public key (x coordinate) * @param p_ecdsaNistp256PublicKeyY The public key (y coordinate) * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaNistp256WithSha256_1(in Oct32 p_toBeVerifiedData, in HashedId8 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyX, in Oct32 p_ecdsaNistp256PublicKeyY) return boolean; + external function fx_verifyWithEcdsaNistp256WithSha256_1(in Oct32 p_toBeVerifiedData, in Oct32 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyX, in Oct32 p_ecdsaNistp256PublicKeyY) return boolean; /** * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The digest of the certificate issuer + * @param p_toBeVerifiedData The data to be verified (Hash ( Hash (Data input) || Hash (Signer identifier input) )) + * @param p_certificateIssuer The hash of the canonical certificate issuer * @param p_signature The signature - * @param p_ecdsaBrainpoolp256PublicKeyCompressed The compressed public key (x coordinate only) + * @param p_ecdsaBrainpoolp256PublicKeyCompressed The compressed public key + * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaBrainpoolp256WithSha256(in Oct32 p_toBeVerifiedData, in HashedId8 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyCompressed, in integer p_compressedMode) return boolean; + external function fx_verifyWithEcdsaBrainpoolp256WithSha256(in Oct32 p_toBeVerifiedData, in Oct32 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyCompressed, in integer p_compressedMode) return boolean; /** * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The digest of the certificate issuer + * @param p_toBeVerifiedData The data to be verified (Hash ( Hash (Data input) || Hash (Signer identifier input) )) + * @param p_certificateIssuer The hash of the canonical certificate issuer * @param p_signature The signature * @param p_ecdsaBrainpoolp256PublicKeyX The public key (x coordinate) * @param p_ecdsaBrainpoolp256PublicKeyY The public key (y coordinate) * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaBrainpoolp256WithSha256_1(in Oct32 p_toBeVerifiedData, in HashedId8 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyX, in Oct32 p_ecdsaBrainpoolp256PublicKeyY) return boolean; + external function fx_verifyWithEcdsaBrainpoolp256WithSha256_1(in Oct32 p_toBeVerifiedData, in Oct32 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyX, in Oct32 p_ecdsaBrainpoolp256PublicKeyY) return boolean; /** * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The digest of the certificate issuer + * @param p_toBeVerifiedData The data to be verified (Hash ( Hash (Data input) || Hash (Signer identifier input) )) + * @param p_certificateIssuer The hash of the canonical certificate issuer * @param p_signature The signature - * @param p_ecdsaBrainpoolp384PublicKeyCompressed The compressed public key (x coordinate) + * @param p_ecdsaBrainpoolp384PublicKeyCompressed The compressed public key + * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaBrainpoolp384WithSha384(in Oct48 p_toBeVerifiedData, in HashedId8 p_certificateIssuer, in octetstring p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyCompressed, in integer p_compressedMode) return boolean; + external function fx_verifyWithEcdsaBrainpoolp384WithSha384(in Oct48 p_toBeVerifiedData, in Oct48 p_certificateIssuer, in octetstring p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyCompressed, in integer p_compressedMode) return boolean; /** * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The digest of the certificate issuer + * @param p_toBeVerifiedData The data to be verified (Hash ( Hash (Data input) || Hash (Signer identifier input) )) + * @param p_certificateIssuer The hash of the canonical certificate issuer * @param p_signature The signature - * @param p_ecdsaBrainpoolp384PublicKeyCompressed The compressed public key (x coordinate only) + * @param p_ecdsaBrainpoolp384PublicKeyX The public key (x coordinate) + * @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate) * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaBrainpoolp384WithSha384_1(in Oct48 p_toBeVerifiedData, in HashedId8 p_certificateIssuer, in octetstring p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyX, in Oct48 p_ecdsaBrainpoolp384PublicKeyY) return boolean; + external function fx_verifyWithEcdsaBrainpoolp384WithSha384_1(in Oct48 p_toBeVerifiedData, in Oct48 p_certificateIssuer, in octetstring p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyX, in Oct48 p_ecdsaBrainpoolp384PublicKeyY) return boolean; /** * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. @@ -2342,35 +2491,43 @@ module LibItsSecurity_Functions { external function fx_store_certificate(in charstring p_cert_id, in octetstring p_cert, in octetstring p_private_key, in octetstring p_public_key_x, in octetstring p_public_key_y, in octetstring p_public_key_compressed, in integer p_public_key_compressed_mode, in octetstring p_hashid8, in octetstring p_issuer, in template (omit) octetstring p_private_enc_key, in template (omit) octetstring p_public_enc_key_x, in template (omit) octetstring p_public_enc_key_y) return boolean; /** - * @desc Unload from memory cache the certificates - * @return true on success, false otherwise - */ + * @desc Unload from memory cache the certificates + * @return true on success, false otherwise + */ external function fx_unloadCertificates() return boolean; /** - * @desc Read the specified certificate - * @param p_certificateId the certificate identifier - * @param p_certificate the expected certificate - * @return true on success, false otherwise - */ + * @desc Read the specified certificate + * @param p_certificateId the certificate identifier + * @param p_certificate the expected certificate + * @return true on success, false otherwise + */ external function fx_readCertificate(in charstring p_certificateId, out octetstring p_certificate) return boolean; /** - * @desc Read the specified certificate digest - * @param p_certificateId the certificate identifier - * @param p_digest the expected certificate - * @return true on success, false otherwise - */ + * @desc Read the specified certificate digest + * @param p_certificateId the certificate identifier + * @param p_digest the expected certificate + * @return true on success, false otherwise + */ external function fx_readCertificateDigest(in charstring p_certificateId, out HashedId8 p_digest) return boolean; + /** + * @desc Read the whole-hash of the specified certificate + * @param p_certificateId the certificate identifier + * @param p_hash the whole-hash of the certificate + * @return true on success, false otherwise + */ + external function fx_readCertificateHash(in charstring p_certificateId, out octetstring p_hash) return boolean; + external function fx_readCertificateFromDigest(in HashedId8 p_digest, out charstring p_certificateId) return boolean; /** - * @desc Read the private keys for the specified certificate - * @param p_keysId the keys identifier - * @param p_signingPrivateKey the signing private key - * @return true on success, false otherwise - */ + * @desc Read the private keys for the specified certificate + * @param p_keysId the keys identifier + * @param p_signingPrivateKey the signing private key + * @return true on success, false otherwise + */ external function fx_readSigningKey(in charstring p_keysId, out Oct32 p_signingPrivateKey) return boolean; -- GitLab From faa0a07b88335b0235b282defc4aba2d7263d557 Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 4 May 2018 13:40:23 +0000 Subject: [PATCH 098/320] STF545: Start ATS development --- .../LibItsGeoNetworking_Templates.ttcn | 30 ++++++++++++++++ ttcn/Pki/LibItsPki_Templates.ttcn | 34 +++++++++++++++++++ 2 files changed, 64 insertions(+) diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn index 71eacb02..a48f6f19 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn @@ -721,6 +721,36 @@ module LibItsGeoNetworking_Templates { payload := valueof(char2oct("DEFAULT_PAYLOAD")) } + /** + * @desc Send template for GeoNetworking Unicast Packet + * @param p_sourceLongPosVec Long position vector of source + * @param p_destinationShortPosVec Short position vector of destination + * @param p_seqNumber Sequence number of GeoUnicast packet + * @param p_hopLimit Maximum number of hops (Default: c_defaultHopLimit) + * @param p_trafficClass Traffic Class + */ + template (value) GnNonSecuredPacket m_geoNwUnicastPacket_with_payload( + in template (value) LongPosVector p_sourceLongPosVec, + in template (value) ShortPosVector p_destinationShortPosVec, + in template (value) UInt16 p_seqNumber, + in template (value) UInt8 p_hopLimit := c_defaultHopLimit, + in template (value) TrafficClass p_trafficClass := m_trafficClass, + in template (value) GnRawPayload p_payload + ) := { + commonHeader := valueof(m_commonHeader( + PX_GN_UPPER_LAYER, + m_geoUnicastHeaderType, + p_trafficClass, + p_hopLimit + )), + extendedHeader := valueof(m_geoUnicastHeader( + p_sourceLongPosVec, + p_destinationShortPosVec, + p_seqNumber + )), + payload := valueof(p_payload) + } + /** * @desc Receive template for GeoNetworking Unicast Packet * @param p_destinationShortPosVec Short position vector of destination diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn index 87f084f3..c6e188d1 100644 --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ b/ttcn/Pki/LibItsPki_Templates.ttcn @@ -49,5 +49,39 @@ module LibItsPki_Templates { publicKeys := p_publicKeys, requestedSubjectAttributes := p_requestedSubjectAttributes } // End of template m_innerEcRequest + + template (omit) PublicKeys m_publicKeys( + in template (value) PublicVerificationKey p_verificationKey, + in template (omit) PublicEncryptionKey p_encryptionKey := omit + ) := { + verificationKey := p_verificationKey, + encryptionKey := p_encryptionKey + } // End of template m_publicKeys + + template PublicKeys mw_publicKeys( + template (present) PublicVerificationKey p_verificationKey := ?, + template PublicEncryptionKey p_encryptionKey := * + ) := { + verificationKey := p_verificationKey, + encryptionKey := p_encryptionKey + } // End of template mw_publicKeys + + template (omit) CertificateSubjectAttributes m_certificateSubjectAttributes( + in template (value) SequenceOfPsidSsp p_appPermissions, + in template (omit) ValidityPeriod p_validityPeriod := omit, + in template (omit) GeographicRegion p_region := omit, + in template (omit) SubjectAssurance p_assuranceLevel := omit + ) := { + id := { none_ := NULL }, + validityPeriod := p_validityPeriod, + region := p_region, + assuranceLevel := p_assuranceLevel, + appPermissions := p_appPermissions, + certIssuePermissions := omit + } // End of template m_certificateSubjectAttributes + + + + } // End of module LibItsPki_Templates \ No newline at end of file -- GitLab From 6d9238c80317eb2759660a1efc2f1e4efe9e3b4b Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 7 May 2018 13:47:39 +0000 Subject: [PATCH 099/320] STF545: Start ATS development --- .../LibItsGeoNetworking_Functions.ttcn | 33 ++++---- ttcn/Security/LibItsSecurity_Functions.ttcn | 83 +++++++++++-------- 2 files changed, 66 insertions(+), 50 deletions(-) diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn index ce4d58e4..0c1e9373 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn @@ -829,7 +829,22 @@ module LibItsGeoNetworking_Functions { * @desc Initialise secure mode if required */ function f_initialiseSecuredMode() runs on ItsBaseGeoNetworking { - if ((PICS_GN_SECURITY == true) or (PICS_IS_IUT_SECURED == true)) { + + // Local variables + + // Load certificates + if (PICS_GN_SECURITY == true) { + if( not f_loadCertificates(PX_IUT_SEC_CONFIG_NAME) ) { + log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); + stop; + } + + // Initialize vc_location + f_setGenerationLocation( + f_getTsLatitude(), + f_getTsLongitude() + ); + } else if (PICS_IS_IUT_SECURED == true) { if(e_success != f_acEnableSecurity()){ log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); stop; @@ -1833,22 +1848,6 @@ module LibItsGeoNetworking_Functions { * @return FncRetCode */ function f_acEnableSecurity() runs on ItsBaseGeoNetworking return FncRetCode { - - // Local variables - - // Load certificates - if (PICS_GN_SECURITY) { - if( not f_loadCertificates(PX_IUT_SEC_CONFIG_NAME) ) { - return e_error; - } - - // Initialize vc_location - f_setGenerationLocation( - f_getTsLatitude(), - f_getTsLongitude() - ); - return f_acTriggerSecEvent(m_acEnableSecurity(cc_taCert_A)); - } return f_acTriggerSecEvent(m_acEnableSecurity(PX_CERT_FOR_TS)); } diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index d8cbb62d..309ab041 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -711,13 +711,27 @@ module LibItsSecurity_Functions { out EtsiTs103097Certificate p_aaCertificate, out EtsiTs103097Certificate p_atCertificate ) runs on ItsSecurityBaseComponent return boolean { + //log(">>> f_prepareCertificates: ", p_certificateName); // Load certificates if required - if (/*Spirent change*/lengthof(p_certificateName)>0 and (valueof(p_certificateName) != cc_taCert_A)) { + if ((lengthof(p_certificateName) > 0) and (valueof(p_certificateName) != cc_taCert_A)) { + var HashedId8 v_digest; + var charstring v_cert; + if (f_readCertificate(valueof(p_certificateName), p_atCertificate) == false){ + log("f_prepareCertificates: Failed to read certificate ", p_certificateName); + return false; + } + if (ischosen(p_atCertificate.issuer.sha256AndDigest)) { + v_digest := p_atCertificate.issuer.sha256AndDigest; + } else if (ischosen(p_atCertificate.issuer.sha384AndDigest)) { + v_digest := p_atCertificate.issuer.sha384AndDigest; + } else { + log("f_prepareCertificates: Invalid certificate issuer ", p_atCertificate.issuer); return false; } - if (f_readCertificate(oct2str(p_atCertificate.toBeSigned.cracaId), p_aaCertificate) == false) { + if (f_getCertificateFromDigest(v_digest, p_aaCertificate) == false) { + log("f_prepareCertificates: Failed to read certificate issuer ", v_digest); return false; } } else { @@ -740,7 +754,7 @@ module LibItsSecurity_Functions { * @return true on success, false otherwise */ function f_buildGnSecuredMessage( - out template (value) EtsiTs103097Data p_securedMessage, + inout EtsiTs103097Data p_securedMessage, in charstring p_certificateName, in ToBeSignedData p_payloadField ) runs on ItsSecurityBaseComponent return boolean { @@ -751,7 +765,9 @@ module LibItsSecurity_Functions { var Ieee1609Dot2Content v_toBeSignedPayload; var octetstring v_certificateHash; var octetstring v_privateKey; - + + //log(">>> f_buildGnSecuredMessage: p_securedMessage=", p_securedMessage); + // Prepare payload to be signed v_toBeSignedData := valueof(p_payloadField); v_secPayload := bit2oct(encvalue(v_toBeSignedData)); @@ -774,38 +790,39 @@ module LibItsSecurity_Functions { v_certificateHash, v_privateKey ); - p_securedMessage.content.signedData.signature_ := m_signature_ecdsaNistP256( + p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaNistP256( m_ecdsaP256Signature( m_eccP256CurvePoint_x_only(substr(v_signature, 0, 32)), substr(v_signature, 32, 32) ) - ); + )); } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { v_signature := f_signWithEcdsaBrainpoolp256WithSha256( v_secPayload, v_certificateHash, v_privateKey ); - p_securedMessage.content.signedData.signature_ := m_signature_ecdsaBrainpoolP256r1( + p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP256r1( m_ecdsaP256Signature( m_eccP256CurvePoint_x_only(substr(v_signature, 0, 32)), substr(v_signature, 32, 32) ) - ); + )); } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature)) { v_signature := f_signWithEcdsaBrainpoolp384WithSha384( v_secPayload, v_certificateHash, v_privateKey ); - p_securedMessage.content.signedData.signature_ := m_signature_ecdsaBrainpoolP384r1( + p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP384r1( m_ecdsaP384Signature( m_eccP384CurvePoint_x_only(substr(v_signature, 0, 32)), substr(v_signature, 32, 32) ) - ); + )); } // TODO To be continued + //log("<<< f_buildGnSecuredMessage: p_securedMessage=", p_securedMessage); return true; } // End of function f_buildGnSecuredMessage @@ -825,7 +842,7 @@ module LibItsSecurity_Functions { * @return true on success, false otherwise */ function f_buildGnSecuredMessage_Bo( - out template (value) EtsiTs103097Data p_securedMessage, + inout EtsiTs103097Data p_securedMessage, in template (value) charstring p_certificateName, in UInt8 p_protocolVersion := c_protocol_version, in integer p_trailerStatus := 0, @@ -1016,13 +1033,12 @@ module LibItsSecurity_Functions { * @see Draft ETSI TS 103 097 V1.1.14 Clause 7.1 Security profile for CAMs */ function f_buildGnSecuredCam( - out template (value) EtsiTs103097Data p_securedMessage, + inout EtsiTs103097Data p_securedMessage, in ToBeSignedData p_payloadField, in SignerIdentifier p_signerIdentifierType, in charstring p_certificateName := ""/*, in boolean p_addMissingHeaders := true*/ ) runs on ItsSecurityBaseComponent return boolean { - // Local variables var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; @@ -1030,10 +1046,10 @@ module LibItsSecurity_Functions { if (f_prepareCertificates(p_certificateName, v_aaCertificate, v_atCertificate) == false) { return false; } - log("v_atCertificate = ", v_atCertificate); + //log("f_buildGnSecuredCam: v_atCertificate = ", v_atCertificate); - // Fill sta structure with default values, these values will be updated later - p_securedMessage := m_etsiTs103097Data_signed( + // Fill the structure with default values, these values will be updated later + p_securedMessage := valueof(m_etsiTs103097Data_signed( m_signedData( sha256, p_payloadField, @@ -1045,10 +1061,11 @@ module LibItsSecurity_Functions { ) ) ) - ); + )); // Prepare mandatory headers + //log("f_buildGnSecuredCam: p_signerIdentifierType=", p_signerIdentifierType); if (ischosen(p_signerIdentifierType.certificate)) { // Add the AT certificate - log("*** " & testcasename() & ": TODO ***"); + log("*** " & testcasename() & "f_buildGnSecuredCam: TODO ***"); stop; /* TODO * v_signerInfo := valueof( @@ -1069,37 +1086,37 @@ module LibItsSecurity_Functions { } else if (ischosen(p_signerIdentifierType.digest)) { // Add the AT certificate digest if (ischosen(v_atCertificate.issuer.sha256AndDigest)) { p_securedMessage.content.signedData.hashId := sha256; - p_securedMessage.content.signedData.signer := m_signerIdentifier_digest( + p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_digest( f_calculateDigestSha256FromCertificate(v_atCertificate) - ); + )); } else if (ischosen(v_atCertificate.issuer.sha384AndDigest)) { p_securedMessage.content.signedData.hashId := sha384; - p_securedMessage.content.signedData.signer := m_signerIdentifier_digest( + p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_digest( f_calculateDigestSha384FromCertificate(v_atCertificate) - ); + )); } } else { - log("*** " & testcasename() & ": TODO ***"); + log("*** " & testcasename() & "f_buildGnSecuredCam: TODO ***"); stop; } if (ispresent(v_atCertificate.signature_)) { if (ischosen(v_atCertificate.signature_.ecdsaBrainpoolP256r1Signature)) { - p_securedMessage.content.signedData.signature_ := m_signature_ecdsaBrainpoolP256r1( + p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP256r1( m_ecdsaP256Signature( m_eccP256CurvePoint_x_only(int2oct(0, 32)), int2oct(0, 32) ) - ); + )); } else if (ischosen(v_atCertificate.signature_.ecdsaBrainpoolP384r1Signature)) { - p_securedMessage.content.signedData.signature_ := m_signature_ecdsaBrainpoolP384r1( + p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP384r1( m_ecdsaP384Signature( m_eccP384CurvePoint_x_only(int2oct(0, 48)), int2oct(0, 48) ) - ); + )); } // else, m_signature_ecdsaNistP256 already chosen by default } - log("p_securedMessage = ", p_securedMessage); + //log("f_buildGnSecuredCam: p_securedMessage = ", p_securedMessage); return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField/*, v_mandatoryHeaders*/); @@ -1126,7 +1143,7 @@ module LibItsSecurity_Functions { * @see Draft ETSI TS 103 097 V1.1.14 Clause 7.1 Security profile for CAMs */ function f_buildGnSecuredCam_Bo( - out template (value) EtsiTs103097Data p_securedMessage, + inout EtsiTs103097Data p_securedMessage, in UInt8 p_protocolVersion := c_protocol_version, in integer p_trailerStatus := 0, in ToBeSignedData p_payloadField, @@ -1204,7 +1221,7 @@ module LibItsSecurity_Functions { * @return true on success, false otherwise */ function f_buildGnSecuredDenm( - out template (value) EtsiTs103097Data p_securedMessage, + inout EtsiTs103097Data p_securedMessage, in ToBeSignedData p_payloadField, in SignerIdentifier p_signerIdentifierType, in ThreeDLocation p_threeDLocation, @@ -1279,7 +1296,7 @@ module LibItsSecurity_Functions { * @return true on success, false otherwise */ function f_buildGnSecuredDenm_Bo( - out template (value) EtsiTs103097Data p_securedMessage, + inout EtsiTs103097Data p_securedMessage, in UInt8 p_protocolVersion := c_protocol_version, in integer p_trailerStatus := 0, in ToBeSignedData p_payloadField, @@ -1351,7 +1368,7 @@ module LibItsSecurity_Functions { * @return true on success, false otherwise */ function f_buildGnSecuredOtherMessage( - out template (value) EtsiTs103097Data p_securedMessage, + inout EtsiTs103097Data p_securedMessage, in ToBeSignedData p_payloadField, in SignerIdentifier p_signerIdentifierType, // FIXME To be reviewed in ThreeDLocation p_threeDLocation, @@ -1424,7 +1441,7 @@ module LibItsSecurity_Functions { * @return true on success, false otherwise */ function f_buildGnSecuredOtherMessage_Bo( - out template (value) EtsiTs103097Data p_securedMessage, + inout EtsiTs103097Data p_securedMessage, in UInt8 p_protocolVersion := c_protocol_version, in integer p_trailerStatus := 0, in ToBeSignedData p_payloadField, -- GitLab From d2486f174a7bf0749cf7a025ccd1dfb5283ce3c0 Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 7 May 2018 13:54:52 +0000 Subject: [PATCH 100/320] STF545: Start ATS development --- ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn index a48f6f19..fd05f8da 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn @@ -1489,7 +1489,10 @@ module LibItsGeoNetworking_Templates { * @param p_hopLimit Router Hop limit of GeoNetworking message */ template (value) BasicHeader m_securedBasicHeader( - in template (value) Lifetime p_lifeTime := m_defaultLifetime, + in template (value) Lifetime p_lifeTime := { + multiplier := c_defaultLifetime, + ltBase := e_100s + }/*FIXME Bug TITAN ? m_defaultLifetime*/, in template (value) UInt8 p_hopLimit := c_defaultHopLimit ) := { version := c_geoNwProtocolVersion, -- GitLab From a176b865586b51d1ae1863be8947efa2b2e22930 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 30 May 2018 16:07:09 +0000 Subject: [PATCH 101/320] Update HTTP Ng112 to ITS --- ttcn/Http/LibItsHttp_EncdecDeclarations.ttcn | 11 ++ ttcn/Http/LibItsHttp_Functions.ttcn | 39 ++++++ ttcn/Http/LibItsHttp_MessageBodyTypes.ttcn | 13 ++ ttcn/Http/LibItsHttp_Pics.ttcn | 13 ++ ttcn/Http/LibItsHttp_Templates.ttcn | 116 ++++++++++++------ ttcn/Http/LibItsHttp_TestSystem.ttcn | 30 +++++ ttcn/Http/LibItsHttp_TypesAndValues.ttcn | 21 +++- ttcn/Http/LibItsHttp_XMLTypes.ttcn | 11 ++ ttcn/Http/LibItsHttp_XmlMessageBodyTypes.ttcn | 20 +++ 9 files changed, 232 insertions(+), 42 deletions(-) create mode 100644 ttcn/Http/LibItsHttp_EncdecDeclarations.ttcn create mode 100644 ttcn/Http/LibItsHttp_Functions.ttcn create mode 100644 ttcn/Http/LibItsHttp_MessageBodyTypes.ttcn create mode 100644 ttcn/Http/LibItsHttp_Pics.ttcn create mode 100644 ttcn/Http/LibItsHttp_TestSystem.ttcn create mode 100644 ttcn/Http/LibItsHttp_XMLTypes.ttcn create mode 100644 ttcn/Http/LibItsHttp_XmlMessageBodyTypes.ttcn diff --git a/ttcn/Http/LibItsHttp_EncdecDeclarations.ttcn b/ttcn/Http/LibItsHttp_EncdecDeclarations.ttcn new file mode 100644 index 00000000..28a93dfe --- /dev/null +++ b/ttcn/Http/LibItsHttp_EncdecDeclarations.ttcn @@ -0,0 +1,11 @@ +module LibItsHttp_EncdecDeclarations { + // LibHttp + import from LibItsHttp_TypesAndValues all; + + external function fx_enc_http_message (HttpMessage p) return bitstring + with {extension "prototype(convert) encode(HttpCodec)"} + + external function fx_dec_http_message (inout bitstring b, out HttpMessage p) return integer + with {extension "prototype(sliding) decode(HttpCodec)"} + +} // End of module LibItsHttp_EncdecDeclarations diff --git a/ttcn/Http/LibItsHttp_Functions.ttcn b/ttcn/Http/LibItsHttp_Functions.ttcn new file mode 100644 index 00000000..3e98c3f2 --- /dev/null +++ b/ttcn/Http/LibItsHttp_Functions.ttcn @@ -0,0 +1,39 @@ +module LibItsHttp_Functions { + + // LibHttp + import from LibItsHttp_TypesAndValues all; + import from LibItsHttp_Pics all; + + function f_init_default_headers_list( + out HeaderLines p_headers + ) { + p_headers[0] := { c_header_host, { PICS_HEADER_HOST } }; + p_headers[1] := { c_header_content_type, { PICS_HEADER_CONTENT_TYPE } }; + p_headers[2] := { c_header_connection, { "keep-alive" } }; + p_headers[3] := { c_header_pragma, { "no-cache" } }; + p_headers[4] := { c_header_cache_control, { "no-cache" } }; + + } // End of function f_init_default_headers_list + + function f_remove_headears_list( + in charstring_list p_headers_to_remove, + inout HeaderLines p_headers + ) { + // Sanity checks + if (lengthof(p_headers_to_remove) == 0) { + return; + } else if (lengthof(p_headers) == 0) { + return; + } + + for (var integer v_idx := 0; v_idx < lengthof(p_headers_to_remove); v_idx := v_idx + 1) { + + for (var integer v_jdx := 0; v_jdx < lengthof(p_headers); v_jdx := v_jdx + 1) { + if (p_headers[v_jdx].header_name == p_headers_to_remove[v_idx]) { + p_headers[v_jdx].header_value := omit; // NOTE Codec won't encode it + } + } // End of 'for' statement + + } // End of 'for' statement + } // End of function f_init_default_headers_list +} // End of module LibItsHttp_Functions diff --git a/ttcn/Http/LibItsHttp_MessageBodyTypes.ttcn b/ttcn/Http/LibItsHttp_MessageBodyTypes.ttcn new file mode 100644 index 00000000..57373428 --- /dev/null +++ b/ttcn/Http/LibItsHttp_MessageBodyTypes.ttcn @@ -0,0 +1,13 @@ +module LibItsHttp_MessageBodyTypes { + + // LibHttp + import from LibItsHttp_XmlMessageBodyTypes all; + + type octetstring MsdBody; + + type union HttpMessageBody { + MsdBody ms_body, + XmlBody xml_body + } // End of type HttpMessageBody + +} // End of module LibItsHttp_MessageBodyTypes diff --git a/ttcn/Http/LibItsHttp_Pics.ttcn b/ttcn/Http/LibItsHttp_Pics.ttcn new file mode 100644 index 00000000..88307db3 --- /dev/null +++ b/ttcn/Http/LibItsHttp_Pics.ttcn @@ -0,0 +1,13 @@ +module LibItsHttp_Pics { + + /** + * @desc + */ + modulepar charstring PICS_HEADER_HOST := "http://www.lisp.com"; + + /** + * @desc + */ + modulepar charstring PICS_HEADER_CONTENT_TYPE := "application/held+xml;charset=utf-8"; + +} // End of module LibItsHttp_Pics diff --git a/ttcn/Http/LibItsHttp_Templates.ttcn b/ttcn/Http/LibItsHttp_Templates.ttcn index 329727a0..a7c233de 100644 --- a/ttcn/Http/LibItsHttp_Templates.ttcn +++ b/ttcn/Http/LibItsHttp_Templates.ttcn @@ -13,50 +13,92 @@ module LibItsHttp_Templates { // LibHttp import from LibItsHttp_TypesAndValues all; + import from LibItsHttp_MessageBodyTypes all; + import from LibItsHttp_XmlMessageBodyTypes all; - template (value) HeaderLine m_header_line( - in template (value) charstring p_header_name, - in template (value) charstring_list p_header_value - ) := { - header_name := p_header_name, - header_value := p_header_value - } // End of template m_header_line + group http_messages { + + template (value) HttpMessage m_http_request( + in template (value) Request p_request + ) := { + request := p_request + } // End of template m_http_request + + template (present) HttpMessage mw_http_request( + template (present) Request p_request := ? + ) := { + request := p_request + } // End of template mw_http_request + + template (value) HttpMessage m_http_response( + in template (value) Response p_response + ) := { + response := p_response + } // End of template m_http_response + + template (present) HttpMessage mw_http_response( + template (present) Response p_response := ? + ) := { + response := p_response + } // End of template mw_http_response + + } // End of group http_messages - template (value) HttpMessage m_http_request( - in template (value) Request p_request - ) := { - request := p_request - } // End of template m_http_request + group http_headers { + + template (value) HeaderLine m_header_line( + in template (value) charstring p_header_name, + in template (value) charstring_list p_header_value + ) := { + header_name := p_header_name, + header_value := p_header_value + } // End of template m_header_line - template (present) HttpMessage mw_http_request( - template (present) Request p_request := ? - ) := { - request := p_request - } // End of template mw_http_request + } // End of group http_headers - template (value) HttpMessage m_http_response( - in template (value) Response p_response - ) := { - response := p_response - } // End of template m_http_response + group http_requests { + + template (omit) Request m_http_request_get( + in charstring p_uri, + in template (value) HeaderLines p_headers, + in template (omit) HttpMessageBody p_body := omit + ) := { + method := "GET", + uri := p_uri, + version_major := c_http_version_major, + version_minor := c_http_version_minor, + header := p_headers, + body := p_body + } // End of template m_http_request_get + + } // End of group http_requests + + group http_responses { + + template (present) Response mw_http_response_ok( + template (present) HttpMessageBody p_body := ?, + template (present) HeaderLines p_header := ? + ) := { + version_major := 1, + version_minor := 1, + statuscode := 200, + statustext := "OK", + header := p_header, + body := p_body + } // End of template mw_http_response_ok + + } // End of group http_responses - template (present) HttpMessage mw_http_response( - template (present) Response p_response := ? + template (value) HttpMessageBody m_http_message_body_xml( + in template (value) XmlBody p_xml_body ) := { - response := p_response - } // End of template mw_http_response + xml_body := p_xml_body + } // End of template m_http_message_body_xml - template (omit) Request m_http_request_get( - in charstring p_uri, - in template (value) HeaderLines p_headers, - in template (omit) charstring p_body := omit + template (present) HttpMessageBody mw_http_message_body_xml( + template (present) XmlBody p_xml_body := ? ) := { - method := "GET", - uri := p_uri, - version_major := c_http_version_major, - version_minor := c_http_version_minor, - header := p_headers, - body := p_body - } // End of template m_http_request_get + xml_body := p_xml_body + } // End of template mw_http_message_body_xml } // End of module LibItsHttp_Templates diff --git a/ttcn/Http/LibItsHttp_TestSystem.ttcn b/ttcn/Http/LibItsHttp_TestSystem.ttcn new file mode 100644 index 00000000..2b84947f --- /dev/null +++ b/ttcn/Http/LibItsHttp_TestSystem.ttcn @@ -0,0 +1,30 @@ +/** + * @author ETSI / STF545 + * @version $URL$ + * $ID:$ + * @desc This module provides the test system used by ITS HTTP based protocols. + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * @see ETSI TS 103 478 + */ +module LibItsHttp_TestSystem { + + // LibCommon + import from LibCommon_Sync all; + import from LibCommon_Time all; + + // LibItsHttp + import from LibItsHttp_TypesAndValues all; + + type port HttpPort message { + inout HttpMessage; + } + + type component HttpComponent extends SelfSyncComp { + port HttpPort httpPort; + timer tc_ac := PX_TAC; + } // End of component HttpComponent + +} // End of module LibItsHttp_TestSystem diff --git a/ttcn/Http/LibItsHttp_TypesAndValues.ttcn b/ttcn/Http/LibItsHttp_TypesAndValues.ttcn index 12c1dad7..616b1375 100644 --- a/ttcn/Http/LibItsHttp_TypesAndValues.ttcn +++ b/ttcn/Http/LibItsHttp_TypesAndValues.ttcn @@ -11,13 +11,24 @@ */ module LibItsHttp_TypesAndValues { + // LibHttp + import from LibItsHttp_MessageBodyTypes all; + import from LibItsHttp_XmlMessageBodyTypes all; + + const charstring c_header_host := "Host"; + const charstring c_header_content_type := "Content-type"; + const charstring c_header_accept := "Accept"; + const charstring c_header_connection := "Connection"; + const charstring c_header_pragma := "Pragma"; + const charstring c_header_cache_control := "Cache-Control"; + const integer c_http_version_major := 1; const integer c_http_version_minor := 1; type record of charstring charstring_list; type record HeaderLine { charstring header_name, - charstring_list header_value + charstring_list header_value optional } with { variant "FIELDORDER(msb)" } @@ -30,7 +41,7 @@ module LibItsHttp_TypesAndValues { integer version_major, integer version_minor, HeaderLines header, - charstring body optional + HttpMessageBody body optional } with { variant "FIELDORDER(msb)" } @@ -41,7 +52,7 @@ module LibItsHttp_TypesAndValues { integer statuscode, charstring statustext, HeaderLines header, - charstring body optional + HttpMessageBody body optional } with { variant "FIELDORDER(msb)" } @@ -50,10 +61,10 @@ module LibItsHttp_TypesAndValues { Response response, Request request } with { - variant "FIELDORDER(msb)" + variant "" } } with { variant "" - encode "HttcpCodec" + encode "HttpCodec" } // End of module LibItsHttp_TypesAndValues diff --git a/ttcn/Http/LibItsHttp_XMLTypes.ttcn b/ttcn/Http/LibItsHttp_XMLTypes.ttcn new file mode 100644 index 00000000..0e135216 --- /dev/null +++ b/ttcn/Http/LibItsHttp_XMLTypes.ttcn @@ -0,0 +1,11 @@ +module LibItsHttp_XMLTypes { // FIXME To be removed + + /** + * This file is volontary empry. You have to declare all XSD files required by your project + * In addition, the TTCN-3 module LibItsHttp_XmlMessageBodyTypes have to be updated too. + */ + // RFC5985 Held + import from XSD all; + import from urn_ietf_params_xml_ns_geopriv_held language "XSD" all; + +} // End of module LibItsHttp_XMLTypes diff --git a/ttcn/Http/LibItsHttp_XmlMessageBodyTypes.ttcn b/ttcn/Http/LibItsHttp_XmlMessageBodyTypes.ttcn new file mode 100644 index 00000000..7cecf53b --- /dev/null +++ b/ttcn/Http/LibItsHttp_XmlMessageBodyTypes.ttcn @@ -0,0 +1,20 @@ +module LibItsHttp_XmlMessageBodyTypes { + + // LibItsHttp + import from LibItsHttp_XMLTypes all; + // RFC5985 Held + import from XSD all; + import from urn_ietf_params_xml_ns_geopriv_held language "XSD" all; + + /** + * This file volontary contains a trivial declaration of the type XmlBodu. + * In accordance with your TTCN-3 module LibItsHttp_XMLTypes, you have to change the XmlBody typing. + */ + + type union XmlBody { + LocationRequest locationRequest, + LocationResponse locationResponse, + charstring raw + }; + +} // End of LibItsHttp_XmlMessageBodyTypes -- GitLab From 8de0e26c816651289c16a98039daff1a2d528eb9 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 30 May 2018 16:08:01 +0000 Subject: [PATCH 102/320] Update HTTP Ng112 to ITS --- ttcn/Http/LibItsHttp_XMLTypes.ttcn | 5 +---- ttcn/Http/LibItsHttp_XmlMessageBodyTypes.ttcn | 2 -- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/ttcn/Http/LibItsHttp_XMLTypes.ttcn b/ttcn/Http/LibItsHttp_XMLTypes.ttcn index 0e135216..87fa3c28 100644 --- a/ttcn/Http/LibItsHttp_XMLTypes.ttcn +++ b/ttcn/Http/LibItsHttp_XMLTypes.ttcn @@ -4,8 +4,5 @@ module LibItsHttp_XMLTypes { // FIXME To be removed * This file is volontary empry. You have to declare all XSD files required by your project * In addition, the TTCN-3 module LibItsHttp_XmlMessageBodyTypes have to be updated too. */ - // RFC5985 Held - import from XSD all; - import from urn_ietf_params_xml_ns_geopriv_held language "XSD" all; - + } // End of module LibItsHttp_XMLTypes diff --git a/ttcn/Http/LibItsHttp_XmlMessageBodyTypes.ttcn b/ttcn/Http/LibItsHttp_XmlMessageBodyTypes.ttcn index 7cecf53b..d5e81f8e 100644 --- a/ttcn/Http/LibItsHttp_XmlMessageBodyTypes.ttcn +++ b/ttcn/Http/LibItsHttp_XmlMessageBodyTypes.ttcn @@ -12,8 +12,6 @@ module LibItsHttp_XmlMessageBodyTypes { */ type union XmlBody { - LocationRequest locationRequest, - LocationResponse locationResponse, charstring raw }; -- GitLab From 8fb3fe2709eb3eadd6940d5291dd2ac6f94ec8c5 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 31 May 2018 08:49:53 +0000 Subject: [PATCH 103/320] Update HTTP Ng112 to ITS --- ttcn/Http/LibItsHttp_XMLTypes.ttcn | 3 ++- ttcn/Http/LibItsHttp_XmlMessageBodyTypes.ttcn | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ttcn/Http/LibItsHttp_XMLTypes.ttcn b/ttcn/Http/LibItsHttp_XMLTypes.ttcn index 87fa3c28..abfb6cf7 100644 --- a/ttcn/Http/LibItsHttp_XMLTypes.ttcn +++ b/ttcn/Http/LibItsHttp_XMLTypes.ttcn @@ -4,5 +4,6 @@ module LibItsHttp_XMLTypes { // FIXME To be removed * This file is volontary empry. You have to declare all XSD files required by your project * In addition, the TTCN-3 module LibItsHttp_XmlMessageBodyTypes have to be updated too. */ - + // TODO Add here your custom RFCs import + } // End of module LibItsHttp_XMLTypes diff --git a/ttcn/Http/LibItsHttp_XmlMessageBodyTypes.ttcn b/ttcn/Http/LibItsHttp_XmlMessageBodyTypes.ttcn index d5e81f8e..3d5ee86f 100644 --- a/ttcn/Http/LibItsHttp_XmlMessageBodyTypes.ttcn +++ b/ttcn/Http/LibItsHttp_XmlMessageBodyTypes.ttcn @@ -2,17 +2,18 @@ module LibItsHttp_XmlMessageBodyTypes { // LibItsHttp import from LibItsHttp_XMLTypes all; - // RFC5985 Held - import from XSD all; - import from urn_ietf_params_xml_ns_geopriv_held language "XSD" all; /** * This file volontary contains a trivial declaration of the type XmlBodu. * In accordance with your TTCN-3 module LibItsHttp_XMLTypes, you have to change the XmlBody typing. */ + // TODO Add here your custom RFCs import type union XmlBody { + // TODO Add here your custom variants charstring raw - }; + } with { + variant "" + } } // End of LibItsHttp_XmlMessageBodyTypes -- GitLab From 1d420028782b2b6db3be0b9b707d20b7769ed131 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 31 May 2018 09:02:45 +0000 Subject: [PATCH 104/320] Update HTTP Ng112 to ITS --- ttcn/Http/LibItsHttp_Pics.ttcn | 2 +- ttcn/Http/LibItsHttp_TestSystem.ttcn | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ttcn/Http/LibItsHttp_Pics.ttcn b/ttcn/Http/LibItsHttp_Pics.ttcn index 88307db3..04bd2757 100644 --- a/ttcn/Http/LibItsHttp_Pics.ttcn +++ b/ttcn/Http/LibItsHttp_Pics.ttcn @@ -3,7 +3,7 @@ module LibItsHttp_Pics { /** * @desc */ - modulepar charstring PICS_HEADER_HOST := "http://www.lisp.com"; + modulepar charstring PICS_HEADER_HOST := "www.lisp.com"; /** * @desc diff --git a/ttcn/Http/LibItsHttp_TestSystem.ttcn b/ttcn/Http/LibItsHttp_TestSystem.ttcn index 2b84947f..69e02713 100644 --- a/ttcn/Http/LibItsHttp_TestSystem.ttcn +++ b/ttcn/Http/LibItsHttp_TestSystem.ttcn @@ -27,4 +27,8 @@ module LibItsHttp_TestSystem { timer tc_ac := PX_TAC; } // End of component HttpComponent + type component HttpTestAdapter { + port HttpPort httpPort; + } // End of component TestAdapter + } // End of module LibItsHttp_TestSystem -- GitLab From 13cdf371a826c2aefdba498328ba719de47f6021 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 6 Jun 2018 07:22:26 +0000 Subject: [PATCH 105/320] Update HTTP Ng112 to ITS --- ttcn/Http/LibItsHttp_Templates.ttcn | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/ttcn/Http/LibItsHttp_Templates.ttcn b/ttcn/Http/LibItsHttp_Templates.ttcn index a7c233de..9dfb21c5 100644 --- a/ttcn/Http/LibItsHttp_Templates.ttcn +++ b/ttcn/Http/LibItsHttp_Templates.ttcn @@ -89,16 +89,20 @@ module LibItsHttp_Templates { } // End of group http_responses - template (value) HttpMessageBody m_http_message_body_xml( - in template (value) XmlBody p_xml_body - ) := { - xml_body := p_xml_body - } // End of template m_http_message_body_xml - - template (present) HttpMessageBody mw_http_message_body_xml( - template (present) XmlBody p_xml_body := ? - ) := { - xml_body := p_xml_body - } // End of template mw_http_message_body_xml + group http_xml_body { + + template (value) HttpMessageBody m_http_message_body_xml( + in template (value) XmlBody p_xml_body + ) := { + xml_body := p_xml_body + } // End of template m_http_message_body_xml + + template (present) HttpMessageBody mw_http_message_body_xml( + template (present) XmlBody p_xml_body := ? + ) := { + xml_body := p_xml_body + } // End of template mw_http_message_body_xml + + } // End of group http_xml_body } // End of module LibItsHttp_Templates -- GitLab From 17a2613864dcf24e068938c4ca08a168ed653079 Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 8 Jun 2018 07:03:09 +0000 Subject: [PATCH 106/320] Update HTTP Ng112 to ITS --- ttcn/Http/LibItsHttp_MessageBodyTypes.ttcn | 34 ++++++++++++++-------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/ttcn/Http/LibItsHttp_MessageBodyTypes.ttcn b/ttcn/Http/LibItsHttp_MessageBodyTypes.ttcn index 57373428..e8af8000 100644 --- a/ttcn/Http/LibItsHttp_MessageBodyTypes.ttcn +++ b/ttcn/Http/LibItsHttp_MessageBodyTypes.ttcn @@ -1,13 +1,23 @@ module LibItsHttp_MessageBodyTypes { - - // LibHttp - import from LibItsHttp_XmlMessageBodyTypes all; - - type octetstring MsdBody; - - type union HttpMessageBody { - MsdBody ms_body, - XmlBody xml_body - } // End of type HttpMessageBody - -} // End of module LibItsHttp_MessageBodyTypes + + // LibHttp + import from LibItsHttp_XmlMessageBodyTypes all; + + type octetstring MsdBody; + + type charstring HtmlBody; + + type charstring TextBody; + + type union HttpMessageBody { + MsdBody ms_body, + HtmlBody html_body, + XmlBody xml_body, + TextBody text_body + } with { + variant "" + } // End of type HttpMessageBody + +} with { + encode "HttpCodec" +}// End of module LibItsHttp_MessageBodyTypes -- GitLab From dd73375a9590c1d129a8aa2dc00eef32eb0f5a18 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 28 Jun 2018 05:21:38 +0000 Subject: [PATCH 107/320] Bug fixed in certificate generation test suite Add support of v3 certificate loader --- ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn | 22 +++++++++++++++++++++ ttcn/Security/LibItsSecurity_Functions.ttcn | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn diff --git a/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn b/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn new file mode 100644 index 00000000..8c06a363 --- /dev/null +++ b/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn @@ -0,0 +1,22 @@ +module LibItsPki_EncdecDeclarations { + + // LibIts + import from EtsiTs102941BaseTypes language "ASN.1:1997" all; + import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; + import from EtsiTs103097Module language "ASN.1:1997" all; + + import from LibItsSecurity_TypesAndValues all; + + /** + * @desc Encoding function for EtsiTs103097Certificate certificate + * @param p The certificate to encode + * @return The encode message in OER format + */ + external function fx_enc_CertificateBase(in EtsiTs102941TypesEnrolment.InnerEcRequest p) return bitstring + with {extension "prototype(convert) encode(PER)"} + + external function fx_dec_CertificateBase(inout bitstring b, out EtsiTs102941TypesEnrolment.InnerEcRequest p) return integer + with {extension "prototype(sliding) decode(PER)"} + + +} // End of module LibItsPki_EncdecDeclarations diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 309ab041..a31bd453 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -2505,7 +2505,7 @@ module LibItsSecurity_Functions { * @return true on success, false otherwise */ external function fx_loadCertificates(in charstring p_rootDirectory, in charstring p_configId) return boolean; - external function fx_store_certificate(in charstring p_cert_id, in octetstring p_cert, in octetstring p_private_key, in octetstring p_public_key_x, in octetstring p_public_key_y, in octetstring p_public_key_compressed, in integer p_public_key_compressed_mode, in octetstring p_hashid8, in octetstring p_issuer, in template (omit) octetstring p_private_enc_key, in template (omit) octetstring p_public_enc_key_x, in template (omit) octetstring p_public_enc_key_y) return boolean; + external function fx_store_certificate(in charstring p_cert_id, in octetstring p_cert, in octetstring p_private_key, in octetstring p_public_key_x, in octetstring p_public_key_y, in octetstring p_public_key_compressed, in integer p_public_key_compressed_mode, in octetstring p_hashid8, in octetstring p_issuer, in template (omit) octetstring p_private_enc_key, in template (omit) octetstring p_public_enc_key_x, in template (omit) octetstring p_public_enc_key_y, in template (omit) octetstring p_public_enc_compressed_key, in template (omit) integer p_public_enc_key_compressed_mode) return boolean; /** * @desc Unload from memory cache the certificates -- GitLab From 5ebb913498348b745b380894a0f059615a53e75e Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 28 Jun 2018 14:17:09 +0000 Subject: [PATCH 108/320] STF545: Finalyse first TC --- .../LibItsHttp_BinaryMessageBodyTypes.ttcn | 26 +++++++++++++++ ttcn/Http/LibItsHttp_BinaryTemplates.ttcn | 32 ++++++++++++++++++ ttcn/Http/LibItsHttp_BinaryTypes.ttcn | 9 +++++ ttcn/Http/LibItsHttp_MessageBodyTypes.ttcn | 5 ++- ttcn/Http/LibItsHttp_Templates.ttcn | 30 +++++++++++++++++ ttcn/Http/LibItsHttp_XMLTypes.ttcn | 14 ++++---- ttcn/Http/LibItsHttp_XmlMessageBodyTypes.ttcn | 5 ++- ttcn/Http/LibItsHttp_XmlTemplates.ttcn | 33 +++++++++++++++++++ ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn | 4 +-- ttcn/Pki/LibItsPki_Templates.ttcn | 11 +++++++ ttcn/Pki/LibItsPki_TestSystem.ttcn | 14 +++++--- 11 files changed, 164 insertions(+), 19 deletions(-) create mode 100644 ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn create mode 100644 ttcn/Http/LibItsHttp_BinaryTemplates.ttcn create mode 100644 ttcn/Http/LibItsHttp_BinaryTypes.ttcn create mode 100644 ttcn/Http/LibItsHttp_XmlTemplates.ttcn diff --git a/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn b/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn new file mode 100644 index 00000000..61ba41cc --- /dev/null +++ b/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn @@ -0,0 +1,26 @@ +/** + * @author ETSI / STF545 + * @version $URL$ + * $ID:$ + * @desc This module provides the custom binary types for ITS HTTP based protocols. + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + */ +module LibItsHttp_BinaryMessageBodyTypes { + + /** + * This file volontary contains a trivial declaration of the type BinaryBodu. + * In accordance with your TTCN-3 module LibItsHttp_XMLTypes, you have to change the BinaryBody typing. + */ + // TODO Add here your custom binary import + + type union BinaryBody { + // TODO Add here your custom variants + octetstring raw + } with { + variant "" + } + +} // End of LibItsHttp_BinaryMessageBodyTypes diff --git a/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn b/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn new file mode 100644 index 00000000..dde677b8 --- /dev/null +++ b/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn @@ -0,0 +1,32 @@ +/** + * @author ETSI / STF545 + * @version $URL$ + * $ID:$ + * @desc This module provides the custom templates for ITS HTTP based protocols. + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + */ +module LibItsHttp_BinaryTemplates { + + // LibItsHttp + import from LibItsHttp_BinaryMessageBodyTypes all; + + // TODO Add here your custom binary import + + template (value) BinaryBody m_binary_body_raw( + in template (value) octetstring p_raw + ) := { + raw := p_raw + } // End of template m_binary_body_raw + + template (present) BinaryBody mw_binary_body_raw( + template (present) octetstring p_raw := ? + ) := { + raw := p_raw + } // End of template mw_binary_body_raw + + // TODO Add here your custom binary template + +} // End of module LibItsHttp_BinaryTemplates diff --git a/ttcn/Http/LibItsHttp_BinaryTypes.ttcn b/ttcn/Http/LibItsHttp_BinaryTypes.ttcn new file mode 100644 index 00000000..da6d0f6b --- /dev/null +++ b/ttcn/Http/LibItsHttp_BinaryTypes.ttcn @@ -0,0 +1,9 @@ +module LibItsHttp_BinaryTypes { // FIXME To be removed + + /** + * This file is volontary empry. You have to declare all XSD files required by your project + * In addition, the TTCN-3 module LibItsHttp_XmlMessageBodyTypes have to be updated too. + */ + // TODO Add here your custom binary import + +} // End of module LibItsHttp_BinaryTypes diff --git a/ttcn/Http/LibItsHttp_MessageBodyTypes.ttcn b/ttcn/Http/LibItsHttp_MessageBodyTypes.ttcn index e8af8000..20907516 100644 --- a/ttcn/Http/LibItsHttp_MessageBodyTypes.ttcn +++ b/ttcn/Http/LibItsHttp_MessageBodyTypes.ttcn @@ -2,15 +2,14 @@ module LibItsHttp_MessageBodyTypes { // LibHttp import from LibItsHttp_XmlMessageBodyTypes all; - - type octetstring MsdBody; + import from LibItsHttp_BinaryMessageBodyTypes all; type charstring HtmlBody; type charstring TextBody; type union HttpMessageBody { - MsdBody ms_body, + BinaryBody binary_body, HtmlBody html_body, XmlBody xml_body, TextBody text_body diff --git a/ttcn/Http/LibItsHttp_Templates.ttcn b/ttcn/Http/LibItsHttp_Templates.ttcn index 9dfb21c5..474651ca 100644 --- a/ttcn/Http/LibItsHttp_Templates.ttcn +++ b/ttcn/Http/LibItsHttp_Templates.ttcn @@ -15,6 +15,7 @@ module LibItsHttp_Templates { import from LibItsHttp_TypesAndValues all; import from LibItsHttp_MessageBodyTypes all; import from LibItsHttp_XmlMessageBodyTypes all; + import from LibItsHttp_BinaryMessageBodyTypes all; group http_messages { @@ -71,6 +72,19 @@ module LibItsHttp_Templates { body := p_body } // End of template m_http_request_get + template (omit) Request m_http_request_post( + in charstring p_uri, + in template (value) HeaderLines p_headers, + in template (omit) HttpMessageBody p_body := omit + ) := { + method := "POST", + uri := p_uri, + version_major := c_http_version_major, + version_minor := c_http_version_minor, + header := p_headers, + body := p_body + } // End of template m_http_request_post + } // End of group http_requests group http_responses { @@ -105,4 +119,20 @@ module LibItsHttp_Templates { } // End of group http_xml_body + group http_binary_body { + + template (value) HttpMessageBody m_http_message_body_binary( + in template (value) BinaryBody p_binary_body + ) := { + binary_body := p_binary_body + } // End of template m_http_message_body_binary + + template (present) HttpMessageBody mw_http_message_body_binary( + template (present) BinaryBody p_binary_body := ? + ) := { + binary_body := p_binary_body + } // End of template mw_http_message_body_binary + + } // End of group http_binary_body + } // End of module LibItsHttp_Templates diff --git a/ttcn/Http/LibItsHttp_XMLTypes.ttcn b/ttcn/Http/LibItsHttp_XMLTypes.ttcn index abfb6cf7..d1e21347 100644 --- a/ttcn/Http/LibItsHttp_XMLTypes.ttcn +++ b/ttcn/Http/LibItsHttp_XMLTypes.ttcn @@ -1,9 +1,11 @@ module LibItsHttp_XMLTypes { // FIXME To be removed - - /** - * This file is volontary empry. You have to declare all XSD files required by your project - * In addition, the TTCN-3 module LibItsHttp_XmlMessageBodyTypes have to be updated too. - */ - // TODO Add here your custom RFCs import + + /** + * This file is volontary empry. You have to declare all XSD files required by your project + * In addition, the TTCN-3 module LibItsHttp_XmlMessageBodyTypes have to be updated too. + */ + // TODO Add here your custom RFCs import + + import from XSD all; } // End of module LibItsHttp_XMLTypes diff --git a/ttcn/Http/LibItsHttp_XmlMessageBodyTypes.ttcn b/ttcn/Http/LibItsHttp_XmlMessageBodyTypes.ttcn index 3d5ee86f..b839918a 100644 --- a/ttcn/Http/LibItsHttp_XmlMessageBodyTypes.ttcn +++ b/ttcn/Http/LibItsHttp_XmlMessageBodyTypes.ttcn @@ -1,8 +1,5 @@ module LibItsHttp_XmlMessageBodyTypes { - // LibItsHttp - import from LibItsHttp_XMLTypes all; - /** * This file volontary contains a trivial declaration of the type XmlBodu. * In accordance with your TTCN-3 module LibItsHttp_XMLTypes, you have to change the XmlBody typing. @@ -16,4 +13,6 @@ module LibItsHttp_XmlMessageBodyTypes { variant "" } +} with { + variant "" } // End of LibItsHttp_XmlMessageBodyTypes diff --git a/ttcn/Http/LibItsHttp_XmlTemplates.ttcn b/ttcn/Http/LibItsHttp_XmlTemplates.ttcn new file mode 100644 index 00000000..49934385 --- /dev/null +++ b/ttcn/Http/LibItsHttp_XmlTemplates.ttcn @@ -0,0 +1,33 @@ +/** + * @author ETSI / STF545 + * @version $URL$ + * $ID:$ + * @desc This module provides the custom templates for ITS HTTP based protocols. + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + */ +module LibItsHttp_XmlTemplates { + + // import from XSD all; + + // TODO Add here your custom RFCs import + + // LibItsHttp + import from LibItsHttp_XmlMessageBodyTypes all; + import from LibItsHttp_XMLTypes all; + + template (value) XmlBody m_xml_body_raw( + in template (value) octetstring p_raw + ) := { + raw := p_raw + } // End of template m_xml_body_raw + + template (present) XmlBody mw_xml_body_raw( + template (present) octetstring p_raw := ? + ) := { + raw := p_raw + } // End of template mw_xml_body_raw + +} // End of module LibItsHttp_XmlTemplates diff --git a/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn b/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn index 8c06a363..0abb5f96 100644 --- a/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn +++ b/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn @@ -12,10 +12,10 @@ module LibItsPki_EncdecDeclarations { * @param p The certificate to encode * @return The encode message in OER format */ - external function fx_enc_CertificateBase(in EtsiTs102941TypesEnrolment.InnerEcRequest p) return bitstring + external function fx_enc_InnerEcRequest(in EtsiTs102941TypesEnrolment.InnerEcRequest p) return bitstring with {extension "prototype(convert) encode(PER)"} - external function fx_dec_CertificateBase(inout bitstring b, out EtsiTs102941TypesEnrolment.InnerEcRequest p) return integer + external function fx_dec_InnerEcRequest(inout bitstring b, out EtsiTs102941TypesEnrolment.InnerEcRequest p) return integer with {extension "prototype(sliding) decode(PER)"} diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn index c6e188d1..5ca48034 100644 --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ b/ttcn/Pki/LibItsPki_Templates.ttcn @@ -33,12 +33,23 @@ module LibItsPki_Templates { ) modifies m_etsiTs103097Data_encrypted := { } // End of template m_enrolmentRequestMessage + template (present) EnrolmentRequestMessage mw_enrolmentResponseMessage( + template (present) EncryptedData p_encryptedData := ? + ) modifies mw_etsiTs103097Data_encrypted := { + } // End of template mw_enrolmentResponseMessage + template (value) EtsiTs102941DataContent m_enrolmentRequest( in template (value) InnerEcRequestSignedForPop p_enrolmentRequest ) := { enrolmentRequest := p_enrolmentRequest } // End of template m_enrolmentRequest + template (present) EtsiTs102941DataContent mw_enrolmentResponse( + template (present) InnerEcResponse p_enrolmentResponse + ) := { + enrolmentResponse := p_enrolmentResponse + } // End of template mw_enrolmentResponse + template (value) InnerEcRequest m_innerEcRequest( in template (value) charstring p_itsId, in template (value) PublicKeys p_publicKeys, diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index 826018c5..68fd87fb 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -22,19 +22,23 @@ module LibItsPki_TestSystem { import from EtsiTs102941MessagesItss language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; - // LibItsPki + // LibItsGeoNetworking + import from LibItsGeoNetworking_TestSystem all; + + // LibItsHttp + import from LibItsHttp_TestSystem all; type port PkiPort message { in PkiInd; out PkiReq; } // End of port PkiPort - type component ItsPkiSystem { - port PkiPort pkiPort; + type component ItsPkiSystem extends ItsGeoNetworkingSystem { + port HttpPort httpPort; } // End of component ItsPkiSystem - type component ItsPki extends ItsBaseComponent { - port PkiPort pkiPort; + type component ItsPki extends ItsGeoNetworking { + port HttpPort httpPort; } // End of component ItsPki type record PkiReq { -- GitLab From 5e8bed6ce1ab4994398ffd87cbd841f5bfb8a568 Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 2 Jul 2018 05:53:31 +0000 Subject: [PATCH 109/320] STF545: Finalyse first TC --- ttcn/Http/LibItsHttp_XMLTypes.ttcn | 2 +- ttcn/Http/LibItsHttp_XmlTemplates.ttcn | 4 ++-- ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn | 12 +++++++++++- ttcn/Pki/LibItsPki_TestSystem.ttcn | 13 ------------- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/ttcn/Http/LibItsHttp_XMLTypes.ttcn b/ttcn/Http/LibItsHttp_XMLTypes.ttcn index d1e21347..02202b7e 100644 --- a/ttcn/Http/LibItsHttp_XMLTypes.ttcn +++ b/ttcn/Http/LibItsHttp_XMLTypes.ttcn @@ -6,6 +6,6 @@ module LibItsHttp_XMLTypes { // FIXME To be removed */ // TODO Add here your custom RFCs import - import from XSD all; + //import from XSD all; } // End of module LibItsHttp_XMLTypes diff --git a/ttcn/Http/LibItsHttp_XmlTemplates.ttcn b/ttcn/Http/LibItsHttp_XmlTemplates.ttcn index 49934385..74dfdf5c 100644 --- a/ttcn/Http/LibItsHttp_XmlTemplates.ttcn +++ b/ttcn/Http/LibItsHttp_XmlTemplates.ttcn @@ -19,13 +19,13 @@ module LibItsHttp_XmlTemplates { import from LibItsHttp_XMLTypes all; template (value) XmlBody m_xml_body_raw( - in template (value) octetstring p_raw + in template (value) charstring p_raw ) := { raw := p_raw } // End of template m_xml_body_raw template (present) XmlBody mw_xml_body_raw( - template (present) octetstring p_raw := ? + template (present) charstring p_raw := ? ) := { raw := p_raw } // End of template mw_xml_body_raw diff --git a/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn b/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn index 0abb5f96..ca0042fe 100644 --- a/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn +++ b/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn @@ -8,7 +8,7 @@ module LibItsPki_EncdecDeclarations { import from LibItsSecurity_TypesAndValues all; /** - * @desc Encoding function for EtsiTs103097Certificate certificate + * @desc Encoding function for EtsiTs102941TypesEnrolment InnerEcRequest * @param p The certificate to encode * @return The encode message in OER format */ @@ -18,5 +18,15 @@ module LibItsPki_EncdecDeclarations { external function fx_dec_InnerEcRequest(inout bitstring b, out EtsiTs102941TypesEnrolment.InnerEcRequest p) return integer with {extension "prototype(sliding) decode(PER)"} + /** + * @desc Encoding function for EtsiTs102941TypesEnrolment InnerEcResponse + * @param p The certificate to encode + * @return The encode message in OER format + */ + external function fx_enc_InnerEcResponse(in EtsiTs102941TypesEnrolment.InnerEcResponse p) return bitstring + with {extension "prototype(convert) encode(PER)"} + + external function fx_dec_InnerEcResponse(inout bitstring b, out EtsiTs102941TypesEnrolment.InnerEcResponse p) return integer + with {extension "prototype(sliding) decode(PER)"} } // End of module LibItsPki_EncdecDeclarations diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index 68fd87fb..721ba1de 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -28,11 +28,6 @@ module LibItsPki_TestSystem { // LibItsHttp import from LibItsHttp_TestSystem all; - type port PkiPort message { - in PkiInd; - out PkiReq; - } // End of port PkiPort - type component ItsPkiSystem extends ItsGeoNetworkingSystem { port HttpPort httpPort; } // End of component ItsPkiSystem @@ -41,12 +36,4 @@ module LibItsPki_TestSystem { port HttpPort httpPort; } // End of component ItsPki - type record PkiReq { - - } // End of type PkiReq - - type record PkiInd { - - } // End of type PkiInd - } // End of module LibItsPki_TestSystem -- GitLab From ba2ba8bb0be744b9d8c10775224dbbde6377c39d Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 3 Jul 2018 14:08:50 +0000 Subject: [PATCH 110/320] Bug fixed on self signed certificate signature --- ttcn/Security/LibItsSecurity_Functions.ttcn | 149 ++++++++++---------- 1 file changed, 73 insertions(+), 76 deletions(-) diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index a31bd453..cc27ac2b 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -57,14 +57,14 @@ module LibItsSecurity_Functions { /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature - * @param p_toBeSignedSecuredMessage The data to be signed (Hash ( Hash (Data input) || Hash (Signer identifier input) )) - * @param p_certificateIssuer The hash of the canonical certificate issuer + * @param p_toBeSignedSecuredMessage The data to be signed + * @param p_certificateIssuer The certificate issuer or '0000000000000000'O in case of self signed certificate * @param p_privateKey The private key for signature * @return The signature value */ function f_signWithEcdsaNistp256WithSha256( in octetstring p_toBeSignedSecuredMessage, - in Oct32 p_certificateIssuer, + in Oct8 p_certificateIssuer, in Oct32 p_privateKey ) return octetstring { return fx_signWithEcdsaNistp256WithSha256( @@ -77,14 +77,14 @@ module LibItsSecurity_Functions { /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature - * @param p_toBeSignedSecuredMessage The data to be signed (Hash ( Hash (Data input) || Hash (Signer identifier input) )) - * @param p_certificateIssuer The hash of the canonical certificate issuer + * @param p_toBeSignedSecuredMessage The data to be signed )) + * @param p_certificateIssuer The certificate issuer or '0000000000000000'O in case of self signed certificate * @param p_privateKey The private key for signature * @return The signature value */ function f_signWithEcdsaBrainpoolp256WithSha256( in octetstring p_toBeSignedSecuredMessage, - in Oct32 p_certificateIssuer, + in Oct8 p_certificateIssuer, in Oct32 p_privateKey ) return octetstring { return fx_signWithEcdsaBrainpoolp256WithSha256( @@ -97,14 +97,14 @@ module LibItsSecurity_Functions { /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature - * @param p_toBeSignedSecuredMessage The data to be signed (Hash ( Hash (Data input) || Hash (Signer identifier input) )) - * @param p_certificateIssuer The hash of the canonical certificate issuer + * @param p_toBeSignedSecuredMessage The data to be signed + * @param p_certificateIssuer The certificate issuer or '0000000000000000'O in case of self signed certificate * @param p_privateKey The private key for signature * @return The signature value */ function f_signWithEcdsaBrainpoolp384WithSha384( in octetstring p_toBeSignedSecuredMessage, - in Oct48 p_certificateIssuer, + in Oct8 p_certificateIssuer, in Oct48 p_privateKey ) return octetstring { return fx_signWithEcdsaBrainpoolp384WithSha384( @@ -398,7 +398,7 @@ module LibItsSecurity_Functions { /** * @desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The hash of the canonical certificate issuer + * @param p_certificateIssuer The certificate issuer or '0000000000000000'O in case of self signed certificate * @param p_signature The signature * @param p_ecdsaNistp256PublicKeyCompressed The compressed public key * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise @@ -406,7 +406,7 @@ module LibItsSecurity_Functions { */ function f_verifyWithEcdsaNistp256WithSha256( in octetstring p_toBeVerifiedData, - in Oct32 p_certificateIssuer, + in Oct8 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyCompressed, in integer p_compressedMode @@ -427,7 +427,7 @@ module LibItsSecurity_Functions { /** * @desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The hash of the canonical certificate issuer + * @param p_certificateIssuer The certificate issuer or '0000000000000000'O in case of self signed certificate * @param p_signature The signature * @param p_ecdsaNistp256PublicKeyX The public key (x coordinate) * @param p_ecdsaNistp256PublicKeyY The public key (y coordinate) @@ -435,7 +435,7 @@ module LibItsSecurity_Functions { */ function f_verifyWithEcdsaNistp256WithSha256_1( // TODO To be removed in octetstring p_toBeVerifiedData, - in Oct32 p_certificateIssuer, + in Oct8 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyX, in Oct32 p_ecdsaNistp256PublicKeyY @@ -456,7 +456,7 @@ module LibItsSecurity_Functions { /** * @Desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The hash of the canonical certificate issuer + * @param p_certificateIssuer The certificate issuer or '0000000000000000'O in case of self signed certificate * @param p_signature The signature * @param p_ecdsaBrainpoolp256PublicKeyCompressed The compressed public key * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise @@ -464,7 +464,7 @@ module LibItsSecurity_Functions { */ function f_verifyWithEcdsaBrainpoolp256WithSha256( in octetstring p_toBeVerifiedData, - in Oct32 p_certificateIssuer, + in Oct8 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyCompressed, in integer p_compressedMode @@ -485,7 +485,7 @@ module LibItsSecurity_Functions { /** * @Desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The hash of the canonical certificate issuer + * @param p_certificateIssuer The certificate issuer or '0000000000000000'O in case of self signed certificate * @param p_signature The signature * @param p_ecdsaBrainpoolp256PublicKeyX The public key (x coordinate) * @param p_ecdsaBrainpoolp256PublicKeyY The public key (y coordinate) @@ -493,7 +493,7 @@ module LibItsSecurity_Functions { */ function f_verifyWithEcdsaBrainpoolp256WithSha256_1( // TODO To be removed in octetstring p_toBeVerifiedData, - in Oct32 p_certificateIssuer, + in Oct8 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyX, in Oct32 p_ecdsaBrainpoolp256PublicKeyY @@ -514,7 +514,7 @@ module LibItsSecurity_Functions { /** * @Desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The hash of the canonical certificate issuer + * @param p_certificateIssuer The certificate issuer or '0000000000000000'O in case of self signed certificate * @param p_signature The signature * @param p_ecdsaBrainpoolp384PublicKeyX The public key (x coordinate) * @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate) @@ -523,7 +523,7 @@ module LibItsSecurity_Functions { */ function f_verifyWithEcdsaBrainpoolp384WithSha384( in octetstring p_toBeVerifiedData, - in Oct48 p_certificateIssuer, + in Oct8 p_certificateIssuer, in octetstring p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyCompressed, in integer p_compressedMode @@ -544,7 +544,7 @@ module LibItsSecurity_Functions { /** * @Desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The hash of the canonical certificate issuer + * @param p_certificateIssuer The certificate issuer or '0000000000000000'O in case of self signed certificate * @param p_signature The signature * @param p_ecdsaBrainpoolp384PublicKeyX The public key (x coordinate) * @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate) @@ -552,7 +552,7 @@ module LibItsSecurity_Functions { */ function f_verifyWithEcdsaBrainpoolp384WithSha384_1( // TODO To be removed in octetstring p_toBeVerifiedData, - in Oct48 p_certificateIssuer, + in Oct8 p_certificateIssuer, in octetstring p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyX, in Oct48 p_ecdsaBrainpoolp384PublicKeyY @@ -763,7 +763,7 @@ module LibItsSecurity_Functions { var octetstring v_secPayload, v_signature; var ToBeSignedData v_toBeSignedData; var Ieee1609Dot2Content v_toBeSignedPayload; - var octetstring v_certificateHash; + var Oct8 v_certificateIssuer; var octetstring v_privateKey; //log(">>> f_buildGnSecuredMessage: p_securedMessage=", p_securedMessage); @@ -782,12 +782,12 @@ module LibItsSecurity_Functions { return false; } } - f_getCertificateHash(p_certificateName, v_certificateHash); + f_getCertificateDigest(p_certificateName, v_certificateIssuer); if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature)) { v_signature := f_signWithEcdsaNistp256WithSha256( v_secPayload, - v_certificateHash, + v_certificateIssuer, v_privateKey ); p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaNistP256( @@ -799,7 +799,7 @@ module LibItsSecurity_Functions { } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { v_signature := f_signWithEcdsaBrainpoolp256WithSha256( v_secPayload, - v_certificateHash, + v_certificateIssuer, v_privateKey ); p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP256r1( @@ -811,7 +811,7 @@ module LibItsSecurity_Functions { } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature)) { v_signature := f_signWithEcdsaBrainpoolp384WithSha384( v_secPayload, - v_certificateHash, + v_certificateIssuer, v_privateKey ); p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP384r1( @@ -1547,6 +1547,7 @@ module LibItsSecurity_Functions { var ToBeSignedCertificate v_toBeSignedCertificate; var octetstring v_enc_msg; var octetstring v_signature; + var Oct8 v_issuer; log(">>> f_verifyCertificateSignatureWithPublicKey: p_certificateToBeVerified=", p_certificateToBeVerified); log(">>> f_verifyCertificateSignatureWithPublicKey: p_publicVerificationKey=", p_publicVerificationKey); @@ -1560,10 +1561,10 @@ module LibItsSecurity_Functions { // Verify payload if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1)) { - var Oct32 v_hash; + if (ischosen(p_certificateToBeVerified.issuer.self_)) { - v_hash := int2oct(0, 32); + v_issuer := int2oct(0, 8); } else { var charstring v_certificate; @@ -1571,7 +1572,7 @@ module LibItsSecurity_Functions { log("f_verifyCertificateSignatureWithPublicKey: Invalid issuer: ", p_certificateToBeVerified.issuer.sha256AndDigest); return false; } - if (f_getCertificateHash(v_certificate, v_hash) == false) { + if (f_getCertificateDigest(v_certificate, v_issuer) == false) { log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate: " & v_certificate); return false; } @@ -1581,7 +1582,7 @@ module LibItsSecurity_Functions { if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1.uncompressedP256)) { return f_verifyWithEcdsaBrainpoolp256WithSha256_1( v_enc_msg, - v_hash, + v_issuer, v_signature, valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.uncompressedP256.x), valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.uncompressedP256.y) @@ -1589,7 +1590,7 @@ module LibItsSecurity_Functions { } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1.compressed_y_0)) { return f_verifyWithEcdsaBrainpoolp256WithSha256( v_enc_msg, - v_hash, + v_issuer, v_signature, valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.compressed_y_0), 0 // Latest bit of the Y-coordinate is 0 @@ -1597,7 +1598,7 @@ module LibItsSecurity_Functions { } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1.compressed_y_1)) { return f_verifyWithEcdsaBrainpoolp256WithSha256( v_enc_msg, - v_hash, + v_issuer, v_signature, valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.compressed_y_1), 1 // Latest bit of the Y-coordinate is 1 @@ -1607,10 +1608,9 @@ module LibItsSecurity_Functions { return false; } } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1)) { - var Oct48 v_hash; if (ischosen(p_certificateToBeVerified.issuer.self_)) { - v_hash := int2oct(0, 48); + v_issuer := int2oct(0, 8); } else { var charstring v_certificate; @@ -1618,7 +1618,7 @@ module LibItsSecurity_Functions { log("f_verifyCertificateSignatureWithPublicKey: Invalid issuer: ", p_certificateToBeVerified.issuer.sha384AndDigest); return false; } - if (f_getCertificateHash(v_certificate, v_hash) == false) { + if (f_getCertificateDigest(v_certificate, v_issuer) == false) { log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate: " & v_certificate); return false; } @@ -1628,7 +1628,7 @@ module LibItsSecurity_Functions { if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1.uncompressedP384)) { return f_verifyWithEcdsaBrainpoolp384WithSha384_1( v_enc_msg, - v_hash, + v_issuer, v_signature, valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.uncompressedP384.x), valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.uncompressedP384.y) @@ -1636,7 +1636,7 @@ module LibItsSecurity_Functions { } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1.compressed_y_0)) { return f_verifyWithEcdsaBrainpoolp384WithSha384( v_enc_msg, - v_hash, + v_issuer, v_signature, valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.compressed_y_0), 0 // Latest bit of the Y-coordinate is 0 @@ -1644,7 +1644,7 @@ module LibItsSecurity_Functions { } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1.compressed_y_1)) { return f_verifyWithEcdsaBrainpoolp384WithSha384( v_enc_msg, - v_hash, + v_issuer, v_signature, valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.compressed_y_1), 1 // Latest bit of the Y-coordinate is 1 @@ -1654,10 +1654,9 @@ module LibItsSecurity_Functions { return false; } } else if (ischosen(p_publicVerificationKey.ecdsaNistP256)) { - var Oct32 v_hash; if (ischosen(p_certificateToBeVerified.issuer.self_)) { - v_hash := int2oct(0, 32); + v_issuer := int2oct(0, 8); } else { var charstring v_certificate; @@ -1665,7 +1664,7 @@ module LibItsSecurity_Functions { log("f_verifyCertificateSignatureWithPublicKey: Invalid issuer: ", p_certificateToBeVerified.issuer.sha256AndDigest); return false; } - if (f_getCertificateHash(v_certificate, v_hash) == false) { + if (f_getCertificateDigest(v_certificate, v_issuer) == false) { log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate: " & v_certificate); return false; } @@ -1675,7 +1674,7 @@ module LibItsSecurity_Functions { if (ischosen(p_publicVerificationKey.ecdsaNistP256.uncompressedP256)) { return f_verifyWithEcdsaNistp256WithSha256_1( v_enc_msg, - v_hash, + v_issuer, v_signature, valueof(p_publicVerificationKey.ecdsaNistP256.uncompressedP256.x), valueof(p_publicVerificationKey.ecdsaNistP256.uncompressedP256.y) @@ -1683,7 +1682,7 @@ module LibItsSecurity_Functions { } else if (ischosen(p_publicVerificationKey.ecdsaNistP256.compressed_y_0)) { return f_verifyWithEcdsaNistp256WithSha256( v_enc_msg, - v_hash, + v_issuer, v_signature, valueof(p_publicVerificationKey.ecdsaNistP256.compressed_y_0), 0 // Latest bit of the Y-coordinate is 0 @@ -1691,7 +1690,7 @@ module LibItsSecurity_Functions { } else if (ischosen(p_publicVerificationKey.ecdsaNistP256.compressed_y_1)) { return f_verifyWithEcdsaNistp256WithSha256( v_enc_msg, - v_hash, + v_issuer, v_signature, valueof(p_publicVerificationKey.ecdsaNistP256.compressed_y_1), 1 // Latest bit of the Y-coordinate is 1 @@ -1737,7 +1736,7 @@ module LibItsSecurity_Functions { */ function f_verifyGnSecuredMessageSignature_ecdsaNistP256( in template (value) Ieee1609Dot2Data p_securedMessage, - in template (value) Oct32 p_certificateIssuer, + in template (value) Oct8 p_certificateIssuer, in template (value) EccP256CurvePoint p_publicKey ) return boolean { @@ -1801,7 +1800,7 @@ module LibItsSecurity_Functions { */ function f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1( in template (value) Ieee1609Dot2Data p_securedMessage, - in template (value) Oct32 p_certificateIssuer, + in template (value) Oct8 p_certificateIssuer, in template (value) EccP256CurvePoint p_publicKey ) return boolean { @@ -1865,7 +1864,7 @@ module LibItsSecurity_Functions { */ function f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1( in template (value) Ieee1609Dot2Data p_securedMessage, - in template (value) Oct48 p_certificateIssuer, + in template (value) Oct8 p_certificateIssuer, in template (value) EccP384CurvePoint p_publicKey ) return boolean { @@ -1930,46 +1929,44 @@ module LibItsSecurity_Functions { in template (value) Ieee1609Dot2Data p_securedMessage, in template (value) EtsiTs103097Certificate p_certificate ) return boolean { - + var Oct8 v_issuer; + if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { var charstring v_certificate; - var Oct32 v_hash; if (fx_readCertificateFromDigest(valueof(p_certificate.issuer.sha256AndDigest), v_certificate) == false) { log("f_verifyCertificateSignatureWithPublicKey: Invalid issuer: ", p_certificate.issuer.sha256AndDigest); return false; } - if (f_getCertificateHash(v_certificate, v_hash) == false) { + if (f_getCertificateDigest(v_certificate, v_issuer) == false) { log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate: " & v_certificate); return false; } - return f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1(p_securedMessage, v_hash, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1); + return f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1(p_securedMessage, v_issuer, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1); } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature)) { var charstring v_certificate; - var Oct48 v_hash; if (fx_readCertificateFromDigest(valueof(p_certificate.issuer.sha384AndDigest), v_certificate) == false) { log("f_verifyCertificateSignatureWithPublicKey: Invalid issuer: ", p_certificate.issuer.sha384AndDigest); return false; } - if (f_getCertificateHash(v_certificate, v_hash) == false) { + if (f_getCertificateDigest(v_certificate, v_issuer) == false) { log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate: " & v_certificate); return false; } - return f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1(p_securedMessage, v_hash, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1); + return f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1(p_securedMessage, v_issuer, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1); } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature)) { var charstring v_certificate; - var Oct32 v_hash; if (fx_readCertificateFromDigest(valueof(p_certificate.issuer.sha256AndDigest), v_certificate) == false) { log("f_verifyCertificateSignatureWithPublicKey: Invalid issuer: ", p_certificate.issuer.sha256AndDigest); return false; } - if (f_getCertificateHash(v_certificate, v_hash) == false) { + if (f_getCertificateDigest(v_certificate, v_issuer) == false) { log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate: " & v_certificate); return false; } - return f_verifyGnSecuredMessageSignature_ecdsaNistP256(p_securedMessage, v_hash, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256); + return f_verifyGnSecuredMessageSignature_ecdsaNistP256(p_securedMessage, v_issuer, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256); } return false; @@ -2362,85 +2359,85 @@ module LibItsSecurity_Functions { /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature - * @param p_toBeSignedSecuredMessage The data to be signed + * @param p_toBeSignedSecuredMessage The data to be signed * @param p_certificateIssuer The hash of the canonical certificate issuer - * @param p_privateKey The private key + * @param p_privateKey The private key * @return The signature value */ - external function fx_signWithEcdsaNistp256WithSha256(in Oct32 p_toBeSignedSecuredMessage, in Oct32 p_certificateIssuer, in Oct32 p_privateKey) return octetstring; + external function fx_signWithEcdsaNistp256WithSha256(in Oct32 p_toBeSignedSecuredMessage, in Oct8 p_certificateIssuer, in Oct32 p_privateKey) return octetstring; /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature * @param p_toBeSignedSecuredMessage The data to be signed (Hash ( Hash (Data input) || Hash (Signer identifier input) )) - * @param p_certificateIssuer The hash of the canonical certificate issuer + * @param p_certificateIssuer The certificate issuer * @param p_privateKey The private key for signature * @return The signature value */ - external function fx_signWithEcdsaBrainpoolp256WithSha256(in Oct32 p_toBeSignedSecuredMessage, in Oct32 p_certificateIssuer, in Oct32 p_privateKey) return octetstring; + external function fx_signWithEcdsaBrainpoolp256WithSha256(in Oct32 p_toBeSignedSecuredMessage, in Oct8 p_certificateIssuer, in Oct32 p_privateKey) return octetstring; /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature * @param p_toBeSignedSecuredMessage The data to be signed (Hash ( Hash (Data input) || Hash (Signer identifier input) )) - * @param p_certificateIssuer The hash of the canonical certificate issuer + * @param p_certificateIssuer The certificate issuer * @param p_privateKey The private key for signature * @return The signature value */ - external function fx_signWithEcdsaBrainpoolp384WithSha384(in Oct48 p_toBeSignedSecuredMessage, in Oct48 p_certificateIssuer, in Oct48 p_privateKey) return octetstring; + external function fx_signWithEcdsaBrainpoolp384WithSha384(in Oct48 p_toBeSignedSecuredMessage, in Oct8 p_certificateIssuer, in Oct48 p_privateKey) return octetstring; /** * @desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified (Hash ( Hash (Data input) || Hash (Signer identifier input) )) - * @param p_certificateIssuer The hash of the canonical certificate issuer + * @param p_certificateIssuer The certificate issuer * @param p_signature The signature * @param p_ecdsaNistp256PublicKeyCompressed The compressed public key - * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaNistp256WithSha256(in Oct32 p_toBeVerifiedData, in Oct32 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyCompressed, in integer p_compressedMode) return boolean; + external function fx_verifyWithEcdsaNistp256WithSha256(in Oct32 p_toBeVerifiedData, in Oct8 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyCompressed, in integer p_compressedMode) return boolean; /** * @desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified (Hash ( Hash (Data input) || Hash (Signer identifier input) )) - * @param p_certificateIssuer The hash of the canonical certificate issuer + * @param p_certificateIssuer The certificate issuer * @param p_signature The signature * @param p_ecdsaNistp256PublicKeyX The public key (x coordinate) * @param p_ecdsaNistp256PublicKeyY The public key (y coordinate) * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaNistp256WithSha256_1(in Oct32 p_toBeVerifiedData, in Oct32 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyX, in Oct32 p_ecdsaNistp256PublicKeyY) return boolean; + external function fx_verifyWithEcdsaNistp256WithSha256_1(in Oct32 p_toBeVerifiedData, in Oct8 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyX, in Oct32 p_ecdsaNistp256PublicKeyY) return boolean; /** * @desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified (Hash ( Hash (Data input) || Hash (Signer identifier input) )) - * @param p_certificateIssuer The hash of the canonical certificate issuer + * @param p_certificateIssuer The certificate issuer * @param p_signature The signature * @param p_ecdsaBrainpoolp256PublicKeyCompressed The compressed public key * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaBrainpoolp256WithSha256(in Oct32 p_toBeVerifiedData, in Oct32 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyCompressed, in integer p_compressedMode) return boolean; + external function fx_verifyWithEcdsaBrainpoolp256WithSha256(in Oct32 p_toBeVerifiedData, in Oct8 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyCompressed, in integer p_compressedMode) return boolean; /** * @desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified (Hash ( Hash (Data input) || Hash (Signer identifier input) )) - * @param p_certificateIssuer The hash of the canonical certificate issuer + * @param p_certificateIssuer The certificate issuer * @param p_signature The signature * @param p_ecdsaBrainpoolp256PublicKeyX The public key (x coordinate) * @param p_ecdsaBrainpoolp256PublicKeyY The public key (y coordinate) * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaBrainpoolp256WithSha256_1(in Oct32 p_toBeVerifiedData, in Oct32 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyX, in Oct32 p_ecdsaBrainpoolp256PublicKeyY) return boolean; + external function fx_verifyWithEcdsaBrainpoolp256WithSha256_1(in Oct32 p_toBeVerifiedData, in Oct8 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyX, in Oct32 p_ecdsaBrainpoolp256PublicKeyY) return boolean; /** * @desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified (Hash ( Hash (Data input) || Hash (Signer identifier input) )) - * @param p_certificateIssuer The hash of the canonical certificate issuer + * @param p_certificateIssuer The certificate issuer * @param p_signature The signature * @param p_ecdsaBrainpoolp384PublicKeyCompressed The compressed public key * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaBrainpoolp384WithSha384(in Oct48 p_toBeVerifiedData, in Oct48 p_certificateIssuer, in octetstring p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyCompressed, in integer p_compressedMode) return boolean; + external function fx_verifyWithEcdsaBrainpoolp384WithSha384(in Oct48 p_toBeVerifiedData, in Oct8 p_certificateIssuer, in octetstring p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyCompressed, in integer p_compressedMode) return boolean; /** * @desc Verify the signature of the specified data @@ -2451,7 +2448,7 @@ module LibItsSecurity_Functions { * @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate) * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaBrainpoolp384WithSha384_1(in Oct48 p_toBeVerifiedData, in Oct48 p_certificateIssuer, in octetstring p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyX, in Oct48 p_ecdsaBrainpoolp384PublicKeyY) return boolean; + external function fx_verifyWithEcdsaBrainpoolp384WithSha384_1(in Oct48 p_toBeVerifiedData, in Oct8 p_certificateIssuer, in octetstring p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyX, in Oct48 p_ecdsaBrainpoolp384PublicKeyY) return boolean; /** * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. -- GitLab From c445eea1b982fb0f5c6ca6ae2ab14c223312970c Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 5 Jul 2018 08:02:36 +0000 Subject: [PATCH 111/320] Bug fixed on self signed certificate signature --- ttcn/Http/LibItsHttp_Functions.ttcn | 7 +- ttcn/Http/LibItsHttp_Templates.ttcn | 14 ++- ttcn/Http/LibItsHttp_TypesAndValues.ttcn | 1 + ttcn/Security/LibItsSecurity_Functions.ttcn | 131 ++++++++++---------- 4 files changed, 81 insertions(+), 72 deletions(-) diff --git a/ttcn/Http/LibItsHttp_Functions.ttcn b/ttcn/Http/LibItsHttp_Functions.ttcn index 3e98c3f2..e7894d0a 100644 --- a/ttcn/Http/LibItsHttp_Functions.ttcn +++ b/ttcn/Http/LibItsHttp_Functions.ttcn @@ -9,9 +9,10 @@ module LibItsHttp_Functions { ) { p_headers[0] := { c_header_host, { PICS_HEADER_HOST } }; p_headers[1] := { c_header_content_type, { PICS_HEADER_CONTENT_TYPE } }; - p_headers[2] := { c_header_connection, { "keep-alive" } }; - p_headers[3] := { c_header_pragma, { "no-cache" } }; - p_headers[4] := { c_header_cache_control, { "no-cache" } }; + p_headers[2] := { c_header_content_length, { "0" } }; + p_headers[3] := { c_header_connection, { "keep-alive" } }; + p_headers[4] := { c_header_pragma, { "no-cache" } }; + p_headers[5] := { c_header_cache_control, { "no-cache" } }; } // End of function f_init_default_headers_list diff --git a/ttcn/Http/LibItsHttp_Templates.ttcn b/ttcn/Http/LibItsHttp_Templates.ttcn index 474651ca..7456f421 100644 --- a/ttcn/Http/LibItsHttp_Templates.ttcn +++ b/ttcn/Http/LibItsHttp_Templates.ttcn @@ -88,7 +88,7 @@ module LibItsHttp_Templates { } // End of group http_requests group http_responses { - + template (present) Response mw_http_response_ok( template (present) HttpMessageBody p_body := ?, template (present) HeaderLines p_header := ? @@ -101,6 +101,18 @@ module LibItsHttp_Templates { body := p_body } // End of template mw_http_response_ok + template (present) Response mw_http_response_ko( + template (present) HttpMessageBody p_body := ?, + template (present) HeaderLines p_header := ? + ) := { + version_major := 1, + version_minor := 1, + statuscode := complement(200), + statustext := ?, + header := p_header, + body := p_body + } // End of template mw_http_response_ok + } // End of group http_responses group http_xml_body { diff --git a/ttcn/Http/LibItsHttp_TypesAndValues.ttcn b/ttcn/Http/LibItsHttp_TypesAndValues.ttcn index 616b1375..bf643a85 100644 --- a/ttcn/Http/LibItsHttp_TypesAndValues.ttcn +++ b/ttcn/Http/LibItsHttp_TypesAndValues.ttcn @@ -17,6 +17,7 @@ module LibItsHttp_TypesAndValues { const charstring c_header_host := "Host"; const charstring c_header_content_type := "Content-type"; + const charstring c_header_content_length := "Content-length"; const charstring c_header_accept := "Accept"; const charstring c_header_connection := "Connection"; const charstring c_header_pragma := "Pragma"; diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index cc27ac2b..f5dc36ec 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -58,13 +58,13 @@ module LibItsSecurity_Functions { /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature * @param p_toBeSignedSecuredMessage The data to be signed - * @param p_certificateIssuer The certificate issuer or '0000000000000000'O in case of self signed certificate + * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate * @param p_privateKey The private key for signature * @return The signature value */ function f_signWithEcdsaNistp256WithSha256( in octetstring p_toBeSignedSecuredMessage, - in Oct8 p_certificateIssuer, + in Oct32 p_certificateIssuer, in Oct32 p_privateKey ) return octetstring { return fx_signWithEcdsaNistp256WithSha256( @@ -77,14 +77,14 @@ module LibItsSecurity_Functions { /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature - * @param p_toBeSignedSecuredMessage The data to be signed )) - * @param p_certificateIssuer The certificate issuer or '0000000000000000'O in case of self signed certificate + * @param p_toBeSignedSecuredMessage The data to be signed + * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate * @param p_privateKey The private key for signature * @return The signature value */ function f_signWithEcdsaBrainpoolp256WithSha256( in octetstring p_toBeSignedSecuredMessage, - in Oct8 p_certificateIssuer, + in Oct32 p_certificateIssuer, in Oct32 p_privateKey ) return octetstring { return fx_signWithEcdsaBrainpoolp256WithSha256( @@ -98,13 +98,13 @@ module LibItsSecurity_Functions { /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature * @param p_toBeSignedSecuredMessage The data to be signed - * @param p_certificateIssuer The certificate issuer or '0000000000000000'O in case of self signed certificate + * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate * @param p_privateKey The private key for signature * @return The signature value */ function f_signWithEcdsaBrainpoolp384WithSha384( in octetstring p_toBeSignedSecuredMessage, - in Oct8 p_certificateIssuer, + in Oct48 p_certificateIssuer, in Oct48 p_privateKey ) return octetstring { return fx_signWithEcdsaBrainpoolp384WithSha384( @@ -398,7 +398,7 @@ module LibItsSecurity_Functions { /** * @desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The certificate issuer or '0000000000000000'O in case of self signed certificate + * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate * @param p_signature The signature * @param p_ecdsaNistp256PublicKeyCompressed The compressed public key * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise @@ -406,8 +406,8 @@ module LibItsSecurity_Functions { */ function f_verifyWithEcdsaNistp256WithSha256( in octetstring p_toBeVerifiedData, - in Oct8 p_certificateIssuer, - in octetstring p_signature, + in Oct32 p_certificateIssuer, + in Oct64 p_signature, in Oct32 p_ecdsaNistp256PublicKeyCompressed, in integer p_compressedMode ) return boolean { @@ -427,7 +427,7 @@ module LibItsSecurity_Functions { /** * @desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The certificate issuer or '0000000000000000'O in case of self signed certificate + * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate * @param p_signature The signature * @param p_ecdsaNistp256PublicKeyX The public key (x coordinate) * @param p_ecdsaNistp256PublicKeyY The public key (y coordinate) @@ -435,8 +435,8 @@ module LibItsSecurity_Functions { */ function f_verifyWithEcdsaNistp256WithSha256_1( // TODO To be removed in octetstring p_toBeVerifiedData, - in Oct8 p_certificateIssuer, - in octetstring p_signature, + in Oct32 p_certificateIssuer, + in Oct64 p_signature, in Oct32 p_ecdsaNistp256PublicKeyX, in Oct32 p_ecdsaNistp256PublicKeyY ) return boolean { @@ -456,7 +456,7 @@ module LibItsSecurity_Functions { /** * @Desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The certificate issuer or '0000000000000000'O in case of self signed certificate + * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate * @param p_signature The signature * @param p_ecdsaBrainpoolp256PublicKeyCompressed The compressed public key * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise @@ -464,8 +464,8 @@ module LibItsSecurity_Functions { */ function f_verifyWithEcdsaBrainpoolp256WithSha256( in octetstring p_toBeVerifiedData, - in Oct8 p_certificateIssuer, - in octetstring p_signature, + in Oct32 p_certificateIssuer, + in Oct64 p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyCompressed, in integer p_compressedMode ) return boolean { @@ -485,7 +485,7 @@ module LibItsSecurity_Functions { /** * @Desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The certificate issuer or '0000000000000000'O in case of self signed certificate + * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate * @param p_signature The signature * @param p_ecdsaBrainpoolp256PublicKeyX The public key (x coordinate) * @param p_ecdsaBrainpoolp256PublicKeyY The public key (y coordinate) @@ -493,8 +493,8 @@ module LibItsSecurity_Functions { */ function f_verifyWithEcdsaBrainpoolp256WithSha256_1( // TODO To be removed in octetstring p_toBeVerifiedData, - in Oct8 p_certificateIssuer, - in octetstring p_signature, + in Oct32 p_certificateIssuer, + in Oct64 p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyX, in Oct32 p_ecdsaBrainpoolp256PublicKeyY ) return boolean { @@ -514,7 +514,7 @@ module LibItsSecurity_Functions { /** * @Desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The certificate issuer or '0000000000000000'O in case of self signed certificate + * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate * @param p_signature The signature * @param p_ecdsaBrainpoolp384PublicKeyX The public key (x coordinate) * @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate) @@ -523,8 +523,8 @@ module LibItsSecurity_Functions { */ function f_verifyWithEcdsaBrainpoolp384WithSha384( in octetstring p_toBeVerifiedData, - in Oct8 p_certificateIssuer, - in octetstring p_signature, + in Oct48 p_certificateIssuer, + in Oct96 p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyCompressed, in integer p_compressedMode ) return boolean { @@ -544,7 +544,7 @@ module LibItsSecurity_Functions { /** * @Desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The certificate issuer or '0000000000000000'O in case of self signed certificate + * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate * @param p_signature The signature * @param p_ecdsaBrainpoolp384PublicKeyX The public key (x coordinate) * @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate) @@ -552,8 +552,8 @@ module LibItsSecurity_Functions { */ function f_verifyWithEcdsaBrainpoolp384WithSha384_1( // TODO To be removed in octetstring p_toBeVerifiedData, - in Oct8 p_certificateIssuer, - in octetstring p_signature, + in Oct48 p_certificateIssuer, + in Oct96 p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyX, in Oct48 p_ecdsaBrainpoolp384PublicKeyY ) return boolean { @@ -763,7 +763,7 @@ module LibItsSecurity_Functions { var octetstring v_secPayload, v_signature; var ToBeSignedData v_toBeSignedData; var Ieee1609Dot2Content v_toBeSignedPayload; - var Oct8 v_certificateIssuer; + var octetstring v_certificateIssuer; var octetstring v_privateKey; //log(">>> f_buildGnSecuredMessage: p_securedMessage=", p_securedMessage); @@ -782,7 +782,7 @@ module LibItsSecurity_Functions { return false; } } - f_getCertificateDigest(p_certificateName, v_certificateIssuer); + f_getCertificateHash(p_certificateName, v_certificateIssuer); if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature)) { v_signature := f_signWithEcdsaNistp256WithSha256( @@ -1547,7 +1547,7 @@ module LibItsSecurity_Functions { var ToBeSignedCertificate v_toBeSignedCertificate; var octetstring v_enc_msg; var octetstring v_signature; - var Oct8 v_issuer; + var octetstring v_issuer; log(">>> f_verifyCertificateSignatureWithPublicKey: p_certificateToBeVerified=", p_certificateToBeVerified); log(">>> f_verifyCertificateSignatureWithPublicKey: p_publicVerificationKey=", p_publicVerificationKey); @@ -1561,10 +1561,8 @@ module LibItsSecurity_Functions { // Verify payload if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1)) { - - if (ischosen(p_certificateToBeVerified.issuer.self_)) { - v_issuer := int2oct(0, 8); + v_issuer := int2oct(0, 32); } else { var charstring v_certificate; @@ -1572,7 +1570,7 @@ module LibItsSecurity_Functions { log("f_verifyCertificateSignatureWithPublicKey: Invalid issuer: ", p_certificateToBeVerified.issuer.sha256AndDigest); return false; } - if (f_getCertificateDigest(v_certificate, v_issuer) == false) { + if (f_getCertificateHash(v_certificate, v_issuer) == false) { log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate: " & v_certificate); return false; } @@ -1608,9 +1606,8 @@ module LibItsSecurity_Functions { return false; } } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1)) { - if (ischosen(p_certificateToBeVerified.issuer.self_)) { - v_issuer := int2oct(0, 8); + v_issuer := int2oct(0, 48); } else { var charstring v_certificate; @@ -1618,7 +1615,7 @@ module LibItsSecurity_Functions { log("f_verifyCertificateSignatureWithPublicKey: Invalid issuer: ", p_certificateToBeVerified.issuer.sha384AndDigest); return false; } - if (f_getCertificateDigest(v_certificate, v_issuer) == false) { + if (f_getCertificateHash(v_certificate, v_issuer) == false) { log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate: " & v_certificate); return false; } @@ -1654,9 +1651,8 @@ module LibItsSecurity_Functions { return false; } } else if (ischosen(p_publicVerificationKey.ecdsaNistP256)) { - if (ischosen(p_certificateToBeVerified.issuer.self_)) { - v_issuer := int2oct(0, 8); + v_issuer := int2oct(0, 32); } else { var charstring v_certificate; @@ -1664,7 +1660,7 @@ module LibItsSecurity_Functions { log("f_verifyCertificateSignatureWithPublicKey: Invalid issuer: ", p_certificateToBeVerified.issuer.sha256AndDigest); return false; } - if (f_getCertificateDigest(v_certificate, v_issuer) == false) { + if (f_getCertificateHash(v_certificate, v_issuer) == false) { log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate: " & v_certificate); return false; } @@ -1736,7 +1732,7 @@ module LibItsSecurity_Functions { */ function f_verifyGnSecuredMessageSignature_ecdsaNistP256( in template (value) Ieee1609Dot2Data p_securedMessage, - in template (value) Oct8 p_certificateIssuer, + in template (value) Oct32 p_certificateIssuer, in template (value) EccP256CurvePoint p_publicKey ) return boolean { @@ -1800,7 +1796,7 @@ module LibItsSecurity_Functions { */ function f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1( in template (value) Ieee1609Dot2Data p_securedMessage, - in template (value) Oct8 p_certificateIssuer, + in template (value) Oct32 p_certificateIssuer, in template (value) EccP256CurvePoint p_publicKey ) return boolean { @@ -1864,7 +1860,7 @@ module LibItsSecurity_Functions { */ function f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1( in template (value) Ieee1609Dot2Data p_securedMessage, - in template (value) Oct8 p_certificateIssuer, + in template (value) Oct48 p_certificateIssuer, in template (value) EccP384CurvePoint p_publicKey ) return boolean { @@ -1929,7 +1925,7 @@ module LibItsSecurity_Functions { in template (value) Ieee1609Dot2Data p_securedMessage, in template (value) EtsiTs103097Certificate p_certificate ) return boolean { - var Oct8 v_issuer; + var octetstring v_issuer; if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { var charstring v_certificate; @@ -1938,7 +1934,7 @@ module LibItsSecurity_Functions { log("f_verifyCertificateSignatureWithPublicKey: Invalid issuer: ", p_certificate.issuer.sha256AndDigest); return false; } - if (f_getCertificateDigest(v_certificate, v_issuer) == false) { + if (f_getCertificateHash(v_certificate, v_issuer) == false) { log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate: " & v_certificate); return false; } @@ -1950,7 +1946,7 @@ module LibItsSecurity_Functions { log("f_verifyCertificateSignatureWithPublicKey: Invalid issuer: ", p_certificate.issuer.sha384AndDigest); return false; } - if (f_getCertificateDigest(v_certificate, v_issuer) == false) { + if (f_getCertificateHash(v_certificate, v_issuer) == false) { log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate: " & v_certificate); return false; } @@ -1962,7 +1958,7 @@ module LibItsSecurity_Functions { log("f_verifyCertificateSignatureWithPublicKey: Invalid issuer: ", p_certificate.issuer.sha256AndDigest); return false; } - if (f_getCertificateDigest(v_certificate, v_issuer) == false) { + if (f_getCertificateHash(v_certificate, v_issuer) == false) { log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate: " & v_certificate); return false; } @@ -2360,95 +2356,94 @@ module LibItsSecurity_Functions { /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature * @param p_toBeSignedSecuredMessage The data to be signed - * @param p_certificateIssuer The hash of the canonical certificate issuer + * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate * @param p_privateKey The private key * @return The signature value */ - external function fx_signWithEcdsaNistp256WithSha256(in Oct32 p_toBeSignedSecuredMessage, in Oct8 p_certificateIssuer, in Oct32 p_privateKey) return octetstring; + external function fx_signWithEcdsaNistp256WithSha256(in octetstring p_toBeSignedSecuredMessage, in Oct32 p_certificateIssuer, in Oct32 p_privateKey) return octetstring; /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature - * @param p_toBeSignedSecuredMessage The data to be signed (Hash ( Hash (Data input) || Hash (Signer identifier input) )) - * @param p_certificateIssuer The certificate issuer + * @param p_toBeSignedSecuredMessage The data to be signed + * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate * @param p_privateKey The private key for signature * @return The signature value */ - external function fx_signWithEcdsaBrainpoolp256WithSha256(in Oct32 p_toBeSignedSecuredMessage, in Oct8 p_certificateIssuer, in Oct32 p_privateKey) return octetstring; + external function fx_signWithEcdsaBrainpoolp256WithSha256(in octetstring p_toBeSignedSecuredMessage, in Oct32 p_certificateIssuer, in Oct32 p_privateKey) return octetstring; /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature - * @param p_toBeSignedSecuredMessage The data to be signed (Hash ( Hash (Data input) || Hash (Signer identifier input) )) - * @param p_certificateIssuer The certificate issuer + * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate * @param p_privateKey The private key for signature * @return The signature value */ - external function fx_signWithEcdsaBrainpoolp384WithSha384(in Oct48 p_toBeSignedSecuredMessage, in Oct8 p_certificateIssuer, in Oct48 p_privateKey) return octetstring; + external function fx_signWithEcdsaBrainpoolp384WithSha384(in octetstring p_toBeSignedSecuredMessage, in Oct48 p_certificateIssuer, in Oct48 p_privateKey) return octetstring; /** * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified (Hash ( Hash (Data input) || Hash (Signer identifier input) )) - * @param p_certificateIssuer The certificate issuer + * @param p_toBeVerifiedData The data to be verified + * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate * @param p_signature The signature * @param p_ecdsaNistp256PublicKeyCompressed The compressed public key * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaNistp256WithSha256(in Oct32 p_toBeVerifiedData, in Oct8 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyCompressed, in integer p_compressedMode) return boolean; + external function fx_verifyWithEcdsaNistp256WithSha256(in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyCompressed, in integer p_compressedMode) return boolean; /** * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified (Hash ( Hash (Data input) || Hash (Signer identifier input) )) - * @param p_certificateIssuer The certificate issuer + * @param p_toBeVerifiedData The data to be verified + * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate * @param p_signature The signature * @param p_ecdsaNistp256PublicKeyX The public key (x coordinate) * @param p_ecdsaNistp256PublicKeyY The public key (y coordinate) * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaNistp256WithSha256_1(in Oct32 p_toBeVerifiedData, in Oct8 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyX, in Oct32 p_ecdsaNistp256PublicKeyY) return boolean; + external function fx_verifyWithEcdsaNistp256WithSha256_1(in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in Oct64 p_signature, in Oct32 p_ecdsaNistp256PublicKeyX, in Oct32 p_ecdsaNistp256PublicKeyY) return boolean; /** * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified (Hash ( Hash (Data input) || Hash (Signer identifier input) )) - * @param p_certificateIssuer The certificate issuer + * @param p_toBeVerifiedData The data to be verified + * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate * @param p_signature The signature * @param p_ecdsaBrainpoolp256PublicKeyCompressed The compressed public key * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaBrainpoolp256WithSha256(in Oct32 p_toBeVerifiedData, in Oct8 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyCompressed, in integer p_compressedMode) return boolean; + external function fx_verifyWithEcdsaBrainpoolp256WithSha256(in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in Oct64 p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyCompressed, in integer p_compressedMode) return boolean; /** * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified (Hash ( Hash (Data input) || Hash (Signer identifier input) )) + * @param p_toBeVerifiedData The data to be verified * @param p_certificateIssuer The certificate issuer * @param p_signature The signature * @param p_ecdsaBrainpoolp256PublicKeyX The public key (x coordinate) * @param p_ecdsaBrainpoolp256PublicKeyY The public key (y coordinate) * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaBrainpoolp256WithSha256_1(in Oct32 p_toBeVerifiedData, in Oct8 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyX, in Oct32 p_ecdsaBrainpoolp256PublicKeyY) return boolean; + external function fx_verifyWithEcdsaBrainpoolp256WithSha256_1(in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in Oct64 p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyX, in Oct32 p_ecdsaBrainpoolp256PublicKeyY) return boolean; /** * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified (Hash ( Hash (Data input) || Hash (Signer identifier input) )) + * @param p_toBeVerifiedData The data to be verified * @param p_certificateIssuer The certificate issuer * @param p_signature The signature * @param p_ecdsaBrainpoolp384PublicKeyCompressed The compressed public key * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaBrainpoolp384WithSha384(in Oct48 p_toBeVerifiedData, in Oct8 p_certificateIssuer, in octetstring p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyCompressed, in integer p_compressedMode) return boolean; + external function fx_verifyWithEcdsaBrainpoolp384WithSha384(in octetstring p_toBeVerifiedData, in Oct48 p_certificateIssuer, in Oct96 p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyCompressed, in integer p_compressedMode) return boolean; /** * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified (Hash ( Hash (Data input) || Hash (Signer identifier input) )) + * @param p_toBeVerifiedData The data to be verified * @param p_certificateIssuer The hash of the canonical certificate issuer * @param p_signature The signature * @param p_ecdsaBrainpoolp384PublicKeyX The public key (x coordinate) * @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate) * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaBrainpoolp384WithSha384_1(in Oct48 p_toBeVerifiedData, in Oct8 p_certificateIssuer, in octetstring p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyX, in Oct48 p_ecdsaBrainpoolp384PublicKeyY) return boolean; + external function fx_verifyWithEcdsaBrainpoolp384WithSha384_1(in octetstring p_toBeVerifiedData, in Oct48 p_certificateIssuer, in Oct96 p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyX, in Oct48 p_ecdsaBrainpoolp384PublicKeyY) return boolean; /** * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. -- GitLab From d6fe46505a5996f351c9f77f9767d506602e62b3 Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 9 Jul 2018 09:14:31 +0000 Subject: [PATCH 112/320] Add codec tests for Pki --- ttcn/Pki/LibItsPki_Templates.ttcn | 33 +++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn index 5ca48034..a7ba5390 100644 --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ b/ttcn/Pki/LibItsPki_Templates.ttcn @@ -11,6 +11,16 @@ */ module LibItsPki_Templates { + // LibCommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; + + // LibItsCommon + import from LibItsCommon_TypesAndValues all; + import from LibItsCommon_Functions all; + import from LibItsCommon_TypesAndValues all; + import from LibItsCommon_ASN1_NamedNumbers all; + // LibIts import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; import from IEEE1609dot2 language "ASN.1:1997" all; @@ -19,12 +29,6 @@ module LibItsPki_Templates { import from EtsiTs102941MessagesItss language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - import from LibItsCommon_Functions all; - import from LibItsCommon_TypesAndValues all; - import from LibItsCommon_ASN1_NamedNumbers all; - // LibItsSecurity import from LibItsSecurity_Templates all; @@ -91,6 +95,23 @@ module LibItsPki_Templates { certIssuePermissions := omit } // End of template m_certificateSubjectAttributes + template (value) InnerEcResponse m_innerEcResponse_ok( + in template (value) Oct16 p_requestHash, + in template (value) EtsiTs103097Certificate p_certificate + ) := { + requestHash := p_requestHash, + responseCode := ok, + certificate := p_certificate + } // End of template m_innerEcResponse + + template (value) InnerEcResponse m_innerEcResponse_ko( + in template (value) Oct16 p_requestHash, + in template (value) EnrolmentResponseCode p_responseCode + ) := { + requestHash := p_requestHash, + responseCode := p_responseCode, + certificate := omit + } // End of template m_innerEcResponse -- GitLab From 5e231cd75c0a0c42f99897c2cbfe7d5472b74cab Mon Sep 17 00:00:00 2001 From: filatov Date: Wed, 18 Jul 2018 20:32:38 +0000 Subject: [PATCH 113/320] remove unused variables --- ttcn/DCC/LibItsDcc_Functions.ttcn | 2 +- ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn | 4 ++-- ttcn/Security/LibItsSecurity_Functions.ttcn | 7 ++----- ttcn/Security/LibItsSecurity_Pixits.ttcn | 4 ++-- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/ttcn/DCC/LibItsDcc_Functions.ttcn b/ttcn/DCC/LibItsDcc_Functions.ttcn index 69b4d6b6..e0b16e31 100644 --- a/ttcn/DCC/LibItsDcc_Functions.ttcn +++ b/ttcn/DCC/LibItsDcc_Functions.ttcn @@ -938,7 +938,7 @@ module LibItsDcc_Functions { * @param p_float The float value * @return The string representation of the float value */ - external function fx_float2str(float p_float) return charstring; + // external function fx_float2str(float p_float) return charstring; } } // End of module LibItsDcc_Functions \ No newline at end of file diff --git a/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn b/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn index ba3ba3e5..7ddd482b 100644 --- a/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn +++ b/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn @@ -1,9 +1,9 @@ module LibItsSecurity_EncdecDeclarations { // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + //import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; import from IEEE1609dot2 language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; + //import from EtsiTs103097Module language "ASN.1:1997" all; import from LibItsSecurity_TypesAndValues all; diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index f5dc36ec..54cbccc2 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -21,8 +21,8 @@ module LibItsSecurity_Functions { import from EtsiTs103097Module language "ASN.1:1997" all; // LibItsCommon - import from LibItsCommon_Functions all; - import from LibItsCommon_TypesAndValues all; + //import from LibItsCommon_Functions all; + //import from LibItsCommon_TypesAndValues all; // LibItsSecurity import from LibItsSecurity_TypesAndValues all; @@ -762,7 +762,6 @@ module LibItsSecurity_Functions { // Local variables var octetstring v_secPayload, v_signature; var ToBeSignedData v_toBeSignedData; - var Ieee1609Dot2Content v_toBeSignedPayload; var octetstring v_certificateIssuer; var octetstring v_privateKey; @@ -853,8 +852,6 @@ module LibItsSecurity_Functions { // Local variables var octetstring v_secPayload, v_signature; -// FIXME(DF)UNUSED -// var Oct32 v_hash; var template (value) ToBeSignedData v_toBeSignedData; var integer i, j, k, n; var HeaderInfo v_headerFields := {}; diff --git a/ttcn/Security/LibItsSecurity_Pixits.ttcn b/ttcn/Security/LibItsSecurity_Pixits.ttcn index 8d59a57e..73c25144 100644 --- a/ttcn/Security/LibItsSecurity_Pixits.ttcn +++ b/ttcn/Security/LibItsSecurity_Pixits.ttcn @@ -42,9 +42,9 @@ module LibItsSecurity_Pixits { modulepar Psid PX_OTHER_ITS_AID := 141; // Assign to GN-MGMT, Other than CA, DEN, MAP, SPAT, IVI, SRE, SSE & GN-MGMT: 38 /** - * @desc Invalid protocol version. Default: 1 + * @desc Invalid protocol version. Default: 2 */ - modulepar UInt8 PX_WRONG_PROTOCOL_VERSION := 1; + modulepar UInt8 PX_WRONG_PROTOCOL_VERSION := 2; /** * @desc Invalid WGS longitude -- GitLab From 5dde00a372d9088bc6fbb9979af9ca010b7aa717 Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 7 Aug 2018 13:38:16 +0000 Subject: [PATCH 114/320] Merge with STF549_NG112 --- ttcn/Http/LibItsHttp_Templates.ttcn | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/ttcn/Http/LibItsHttp_Templates.ttcn b/ttcn/Http/LibItsHttp_Templates.ttcn index 7456f421..47579911 100644 --- a/ttcn/Http/LibItsHttp_Templates.ttcn +++ b/ttcn/Http/LibItsHttp_Templates.ttcn @@ -101,9 +101,9 @@ module LibItsHttp_Templates { body := p_body } // End of template mw_http_response_ok - template (present) Response mw_http_response_ko( - template (present) HttpMessageBody p_body := ?, - template (present) HeaderLines p_header := ? + template Response mw_http_response_ko( + template HttpMessageBody p_body := *, + template (present) HeaderLines p_header := ? ) := { version_major := 1, version_minor := 1, @@ -111,6 +111,14 @@ module LibItsHttp_Templates { statustext := ?, header := p_header, body := p_body + } // End of template mw_http_response_ko + + template Response mw_http_response_404_not_found( + template HttpMessageBody p_body := *, + template (present) HeaderLines p_header := ? + ) modifies mw_http_response_ko := { + statuscode := 404, + statustext := ? // TODO Add pattern for not found } // End of template mw_http_response_ok } // End of group http_responses -- GitLab From debeafe4827781b396ee613b01eedea5ea18f991 Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 14 Aug 2018 12:43:54 +0000 Subject: [PATCH 115/320] Add missing parameter --- ttcn/Security/LibItsSecurity_Functions.ttcn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 54cbccc2..b8d92dbd 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -2494,7 +2494,7 @@ module LibItsSecurity_Functions { * @return true on success, false otherwise */ external function fx_loadCertificates(in charstring p_rootDirectory, in charstring p_configId) return boolean; - external function fx_store_certificate(in charstring p_cert_id, in octetstring p_cert, in octetstring p_private_key, in octetstring p_public_key_x, in octetstring p_public_key_y, in octetstring p_public_key_compressed, in integer p_public_key_compressed_mode, in octetstring p_hashid8, in octetstring p_issuer, in template (omit) octetstring p_private_enc_key, in template (omit) octetstring p_public_enc_key_x, in template (omit) octetstring p_public_enc_key_y, in template (omit) octetstring p_public_enc_compressed_key, in template (omit) integer p_public_enc_key_compressed_mode) return boolean; + external function fx_store_certificate(in charstring p_cert_id, in octetstring p_cert, in octetstring p_private_key, in octetstring p_public_key_x, in octetstring p_public_key_y, in octetstring p_public_key_compressed, in integer p_public_key_compressed_mode, in octetstring p_hash, in octetstring p_hashid8, in octetstring p_issuer, in template (omit) octetstring p_private_enc_key, in template (omit) octetstring p_public_enc_key_x, in template (omit) octetstring p_public_enc_key_y, in template (omit) octetstring p_public_enc_compressed_key, in template (omit) integer p_public_enc_key_compressed_mode) return boolean; /** * @desc Unload from memory cache the certificates -- GitLab From f91443ce56c8a83ad689ddcf97e2f122c3b85ed8 Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 3 Sep 2018 16:58:37 +0200 Subject: [PATCH 116/320] Bug fixed in GeoNetworking codec --- ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn index fd05f8da..ceef4d13 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn @@ -768,7 +768,7 @@ module LibItsGeoNetworking_Templates { p_destinationShortPosVec, p_seqNumber ), - payload := ? + payload := * } /** -- GitLab From 38cbc05c1cb464519d63dfc1b277973a89eacc9d Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 5 Sep 2018 13:14:46 +0200 Subject: [PATCH 117/320] First validation with Nordsys --- ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn index ceef4d13..05734f4d 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn @@ -993,7 +993,7 @@ module LibItsGeoNetworking_Templates { p_sourceLongPosVec, p_seqNumber ), - payload := ? + payload := * } /** -- GitLab From 11883972346b9439c74a8c72a5ff67dee79d1b51 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 6 Sep 2018 10:41:16 +0200 Subject: [PATCH 118/320] Bug fixed on multi-components support --- .../LibItsGeoNetworking_Functions.ttcn | 5677 +++++++++-------- 1 file changed, 2849 insertions(+), 2828 deletions(-) diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn index 0c1e9373..1b88f93e 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn @@ -1,2828 +1,2849 @@ -/** - * @author ETSI / STF405 / STF449 / STF484 / STF517 / STF525 - * @version $URL$ -* $Id$ - * @desc Module containing functions for GeoNetworking - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsGeoNetworking_Functions { - - // Libcommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - import from LibCommon_VerdictControl all; - import from LibCommon_Sync all; - import from LibCommon_Time all; - - // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - import from LibItsExternal_TypesAndValues all; - import from LibItsCommon_Templates all; - import from LibItsCommon_Functions all; - import from LibItsCommon_Pixits all; - // import from LibItsCommon_TestSystem 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_TypesAndValues all; - import from LibItsGeoNetworking_Templates all; - import from LibItsGeoNetworking_Pixits all; - import from LibItsGeoNetworking_Pics all; - // import from LibItsGeoNetworking_EncdecDeclarations all; - - group utFuntions { - - /** - * @desc Requests to bring the IUT in an initial state - * @param p_init The initialisation to trigger. - */ - function f_utInitializeIut(template (value) UtGnInitialize p_init) runs on ItsBaseGeoNetworking { - - //deactivate gnPort default alts - vc_gnDefaultActive := false; - - utPort.send(p_init); - tc_wait.start; - alt { - [] utPort.receive(UtGnResults: { utGnInitializeResult := true }) { - tc_wait.stop; - log("*** f_utInitializeIut: INFO: IUT initialized ***"); - } - [] utPort.receive { - tc_wait.stop; - log("*** f_utInitializeIut: INFO: IUT could not be initialized ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_wait.timeout { - log("*** f_utInitializeIut: INFO: IUT could not be initialized in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //activate gnPort default alts - vc_gnDefaultActive := true; - - } - - /** - * @desc Requests to change the position of the IUT - */ - function f_utChangePosition() runs on ItsBaseGeoNetworking { - - //deactivate gnPort default alts - vc_gnDefaultActive := false; - - utPort.send(m_changePosition); - tc_wait.start; - alt { - [] utPort.receive(UtGnResults: { utGnChangePositionResult := true} ) { - tc_wait.stop; - log("*** f_utChangePosition: INFO: IUT position changed ***"); - } - [] utPort.receive(UtGnResults: { utGnChangePositionResult := false }) { - tc_wait.stop; - log("*** f_utChangePosition: INFO: IUT position change was not successful ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] a_utDefault() { - } - [] tc_wait.timeout { - log("*** f_utChangePosition: INFO: IUT position not changed in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //activate gnPort default alts - vc_gnDefaultActive := true; - - } - - /** - * @desc Triggers event from the application layer - * @param p_event The event to trigger. - */ - function f_utTriggerEvent(template (value) UtGnTrigger p_event) runs on ItsBaseGeoNetworking return boolean { - - // Variables - var boolean v_return := true; - - //deactivate gnPort default alts - vc_gnDefaultActive := false; - - utPort.send(p_event); - tc_wait.start; - alt { - [] utPort.receive(UtGnResults: { utGnTriggerResult := true }) { - tc_wait.stop; - } - [] utPort.receive(UtGnResults: { utGnTriggerResult := false }) { - tc_wait.stop; - log("*** UtGnTriggerResult: INFO: UT trigger was not successful ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] a_utDefault() { - } - [] tc_wait.timeout { - v_return := false; - } - } - - //activate gnPort default alts - vc_gnDefaultActive := true; - - return v_return; - } - - } // End of group utFunctions - - group geoConfigurationFunctions { - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - two ITS nodes (nodeA, nodeB) - * - Area1 which only includes NodeB and IUT - * - Area2 which only includes NodeB - * NodeB being close to the area center - */ - //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf01Up(Scenario p_scenario := e_staticPosition) runs on ItsGeoNetworking /* TITAN TODO: system ItsGeoNetworkingSystem */ { - - // Variables - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - - // Map - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - map(self:geoNetworkingPort, system:geoNetworkingPort); - - // Connect - f_connect4SelfOrClientSync(); - activate(a_cf01Down()); - - // Initialise secured mode - f_initialiseSecuredMode(); - - //Initialze the IUT - f_initialState(p_scenario); - - // Positions & Areas - f_preparePositionsAndAreas(v_positionTable, v_areaTable); - - f_initialiseComponent(v_positionTable, v_areaTable, c_compNodeB); - - } // end f_cf01Up - - //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf01Down() runs on ItsGeoNetworking /* TITAN TODO: system ItsGeoNetworkingSystem */ { - - f_uninitialiseSecuredMode(); - - // Unmap - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - unmap(self:geoNetworkingPort, system:geoNetworkingPort); - - // Disconnect - f_disconnect4SelfOrClientSync(); - - } // end f_cf01Down - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - one ITS node (NodeB) - * - one ITS node (NodeD) - * - Area1 which only includes NodeB, NodeD and IUT - * - Area2 which only includes NodeB and NodeD - * NodeB being close to the area center - * - * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages - */ - - //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf02Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { - - // Variables - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - var ItsGeoNetworking v_component; - var integer i; - - // Select components - vc_componentTable := {{c_compNodeB, omit}, {c_compNodeD, omit}}; - - // Create components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; - } - - // Map & Connect - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - connect(self:syncPort, mtc:syncPort); - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - map(vc_componentTable[i].gnComponent:acPort, system:acPort); - map(vc_componentTable[i].gnComponent:utPort, system:utPort); - map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - - activate(a_cf02Down()); - - //Initialze the IUT - if(p_mainUtComponent == c_compMTC) { - // Initialise secured mode - f_initialiseSecuredMode(); - - // MTC intializes IUT - f_initialState(p_scenario); - } - else { - v_component := f_getComponent(p_mainUtComponent); - v_component.start(f_initialState(p_scenario)); - v_component.done; - } - - // Positions & Areas - f_preparePositionsAndAreas(v_positionTable, v_areaTable); - - // Initialize components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); - } - } - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.done; - } - } - - } // end f_cf02Up - - /** - * @desc Deletes configuration cf02 - */ - - //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf02Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { - - // Local variables - var integer i; - - f_uninitialiseSecuredMode(); - - // Unmap & Disconnect - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); - unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); - unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - disconnect(self:syncPort, mtc:syncPort); - - } // end f_cf02Down - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - one ITS node (NodeA) - * - one ITS node in direction of NodeA (NodeB) - * - one ITS node not in direction of NodeA (NodeC) - * - Area1 which only includes NodeB and IUT - * - Area2 which only includes NodeB - * NodeB being close to the area center - * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages - */ - //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf03Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { - - // Variables - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - var ItsGeoNetworking v_component; - var integer i; - - // Select components - vc_componentTable := {{c_compNodeB, omit}, {c_compNodeC, omit}}; - - // Create components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; - } - - // Map & Connect - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - connect(self:syncPort, mtc:syncPort); - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - map(vc_componentTable[i].gnComponent:acPort, system:acPort); - map(vc_componentTable[i].gnComponent:utPort, system:utPort); - map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - - activate(a_cf03Down()); - - //Initialze the IUT - if(p_mainUtComponent == c_compMTC) { - // Initialise secured mode - f_initialiseSecuredMode(); - - // MTC intializes IUT - f_initialState(p_scenario); - } - else { - v_component := f_getComponent(p_mainUtComponent); - v_component.start(f_initialState(p_scenario)); - v_component.done; - } - - // Positions & Areas - f_preparePositionsAndAreas(v_positionTable, v_areaTable); - - // Initialize components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); - } - } - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.done; - } - } - - } // end f_cf03Up - - /** - * @desc Deletes configuration cf03 - */ - - //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf03Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { - - // Local variables - var integer i; - - f_uninitialiseSecuredMode(); - - // Unmap & Disconnect - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); - unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); - unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - disconnect(self:syncPort, mtc:syncPort); - - } // end f_cf03Down - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - one ITS node (NodeA) - * - one ITS node in direction of NodeA and having - * shortest distance to NodeA (NodeB) - * - one ITS node in direction of NodeA (NodeD) - * - one ITS node not in direction of NodeA (NodeC) - * - Area1 which only includes NodeB, NodeD and IUT - * - Area2 which only includes NodeA, NodeB and NodeD - * NodeB being close to the area center - * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages - */ - - //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf04Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { - - // Variables - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - var ItsGeoNetworking v_component; - var integer i; - - // Select components - vc_componentTable := {{c_compNodeB, omit}, {c_compNodeC, omit}, {c_compNodeD, omit}}; - - // Create components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; - } - - // Map & Connect - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - connect(self:syncPort, mtc:syncPort); - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - map(vc_componentTable[i].gnComponent:acPort, system:acPort); - map(vc_componentTable[i].gnComponent:utPort, system:utPort); - map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - - activate(a_cf04Down()); - - //Initialze the IUT - if(p_mainUtComponent == c_compMTC) { - // Initialise secured mode - f_initialiseSecuredMode(); - - // MTC intializes IUT - f_initialState(p_scenario); - } - else { - v_component := f_getComponent(p_mainUtComponent); - v_component.start(f_initialState(p_scenario)); - v_component.done; - } - - // Positions & Areas - f_preparePositionsAndAreas(v_positionTable, v_areaTable); - - // Initialize components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); - } - } - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.done; - } - } - - } // end f_cf04Up - - /** - * @desc Deletes configuration cf04 - */ - - //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf04Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */{ - - // Local variables - var integer i; - - f_uninitialiseSecuredMode(); - - // Unmap & Disconnect - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); - unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); - unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - disconnect(self:syncPort, mtc:syncPort); - - } // end f_cf04Down - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - one ITS node (NodeB) - * - one ITS node not in direction of NodeB and having - * longest distance to NodeB (NodeE) - * - Area1 which only includes NodeB, NodeD and IUT - * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages - */ - - //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf05Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { - - // Variables - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - var ItsGeoNetworking v_component; - var integer i; - - // Select components - vc_componentTable := {{c_compNodeB, omit}, {c_compNodeE, omit}}; - - // Create components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; - } - - // Map & Connect - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - connect(self:syncPort, mtc:syncPort); - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - map(vc_componentTable[i].gnComponent:acPort, system:acPort); - map(vc_componentTable[i].gnComponent:utPort, system:utPort); - map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - - activate(a_cf05Down()); - - //Initialze the IUT - if(p_mainUtComponent == c_compMTC) { - // Initialise secured mode - f_initialiseSecuredMode(); - - // MTC intializes IUT - f_initialState(p_scenario); - } - else { - v_component := f_getComponent(p_mainUtComponent); - v_component.start(f_initialState(p_scenario)); - v_component.done; - } - - // Positions & Areas - f_preparePositionsAndAreas(v_positionTable, v_areaTable); - - // Initialize components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); - } - } - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.done; - } - } - } - - /** - * @desc Deletes configuration cf05 - */ - - //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf05Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { - - // Local variables - var integer i; - - f_uninitialiseSecuredMode(); - - // Unmap & Disconnect - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); - unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); - unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - disconnect(self:syncPort, mtc:syncPort); - - } // end f_cf05Down - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - one ITS node (NodeB) - * - one ITS node not in direction of NodeB and having - * shortest distance to NodeB (NodeF) - * - Area1 which only includes NodeB, NodeD and IUT - * - IUT not in sectorial area of NodeB-NodeF - * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages - */ - //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf06Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { - - // Variables - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - var ItsGeoNetworking v_component; - var integer i; - - // Select components - vc_componentTable := {{c_compNodeB, omit}, {c_compNodeF, omit}}; - - // Create components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; - } - - // Map & Connect - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - connect(self:syncPort, mtc:syncPort); - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - map(vc_componentTable[i].gnComponent:acPort, system:acPort); - map(vc_componentTable[i].gnComponent:utPort, system:utPort); - map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - - activate(a_cf06Down()); - - //Initialze the IUT - if(p_mainUtComponent == c_compMTC) { - // Initialise secured mode - f_initialiseSecuredMode(); - - // MTC intializes IUT - f_initialState(p_scenario); - } - else { - v_component := f_getComponent(p_mainUtComponent); - v_component.start(f_initialState(p_scenario)); - v_component.done; - } - - // Positions & Areas - f_preparePositionsAndAreas(v_positionTable, v_areaTable); - - // Initialize components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); - } - } - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.done; - } - } - } - - /** - * @desc Deletes configuration cf06 - */ - - //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf06Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { - - // Local variables - var integer i; - - f_uninitialiseSecuredMode(); - - // Unmap & Disconnect - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); - unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); - unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - disconnect(self:syncPort, mtc:syncPort); - - } // end f_cf06Down - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - one ITS node (NodeB) - * - one ITS node in direction of NodeB and having - * shortest distance to NodeB (NodeD) - * - Area1 which only includes NodeB, NodeD and IUT - * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages - */ - - //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf07Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO mtc ItsMtc system ItsGeoNetworkingSystem */{ - - // Variables - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - var ItsGeoNetworking v_component; - var integer i; - - // Select components - vc_componentTable := {{c_compNodeB, omit}, {c_compNodeD, omit}}; - - // Create components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; - } - - // Map & Connect - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - connect(self:syncPort, mtc:syncPort); - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - map(vc_componentTable[i].gnComponent:acPort, system:acPort); - map(vc_componentTable[i].gnComponent:utPort, system:utPort); - map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - - activate(a_cf07Down()); - - //Initialze the IUT - if(p_mainUtComponent == c_compMTC) { - // Initialise secured mode - f_initialiseSecuredMode(); - - // MTC intializes IUT - f_initialState(p_scenario); - } - else { - v_component := f_getComponent(p_mainUtComponent); - v_component.start(f_initialState(p_scenario)); - v_component.done; - } - - // Positions & Areas - f_preparePositionsAndAreas(v_positionTable, v_areaTable); - - // Initialize components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); - } - } - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.done; - } - } - } - - /** - * @desc Deletes configuration cf06 - */ - //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf07Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { - - // Local variables - var integer i; - - f_uninitialiseSecuredMode(); - - // Unmap & Disconnect - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); - unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); - unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - disconnect(self:syncPort, mtc:syncPort); - - } // end f_cf0yDown - - /** - * @desc Behavior function for initializing component's variables and tables - * @param p_positionTable Table containing position vectors of all nodes - * @param p_areaTable Table containing all defined geoAreas - * @param p_componentName Name of the component - */ - function f_initialiseComponent( - in PositionTable p_positionTable, - in GeoAreaTable p_areaTable, - in charstring p_componentName) - runs on ItsGeoNetworking { - - vc_positionTable := p_positionTable; - vc_areaTable := p_areaTable; - vc_componentName := p_componentName; - - vc_localSeqNumber := f_getInitialSequenceNumber(); - vc_multipleMessagesCount := f_getMessageCount(); - - } // end f_initialiseComponent - - /** - * @desc Makes the simulated ITS node behave as a neighbour of IUT - */ - function f_startBeingNeighbour() runs on ItsGeoNetworking { - - vc_neighbourDefault := activate(a_neighbourDefault()); - f_acTriggerEvent(m_startBeaconing(m_beaconHeader(f_getPosition(vc_componentName)).beaconHeader)); - f_sleepIgnoreDef(PX_NEIGHBOUR_DISCOVERY_DELAY); - } // end f_startBeingNeighbour - - /** - * @desc Makes the simulated ITS node behave as not being a neighbour of IUT - */ - function f_stopBeingNeighbour() runs on ItsGeoNetworking { - - f_acTriggerEvent(m_stopBeaconing); - if (PICS_GN_SECURITY == true) { - deactivate(vc_neighbourDefault); - } - } // end f_stopBeingNeighbour - - /** - * @desc Initialise secure mode if required - */ - function f_initialiseSecuredMode() runs on ItsBaseGeoNetworking { - - // Local variables - - // Load certificates - if (PICS_GN_SECURITY == true) { - if( not f_loadCertificates(PX_IUT_SEC_CONFIG_NAME) ) { - log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); - stop; - } - - // Initialize vc_location - f_setGenerationLocation( - f_getTsLatitude(), - f_getTsLongitude() - ); - } else if (PICS_IS_IUT_SECURED == true) { - if(e_success != f_acEnableSecurity()){ - log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); - stop; - } - } - } // End of function f_initialiseSecuredMode() - - function f_uninitialiseSecuredMode() runs on ItsBaseGeoNetworking { - if ((PICS_GN_SECURITY == true) or (PICS_IS_IUT_SECURED == true)) { - f_acDisableSecurity(); - } - } // End of function f_uninitialiseSecuredMode() - - } // end geoConfigurationFunctions - - group componentFunctions { - /** - * @desc Get the component corresponding to a key - * @param p_componentName Name searched component - * @return ItsGeoNetworking - The searched position vector - */ - function f_getComponent( - in charstring p_componentName - ) runs on ItsMtc - return ItsGeoNetworking { - - var ItsGeoNetworking v_return := null; - var integer i := 0; - - for (i:=0; i value v_ind { - //store every upper tester indication received - vc_utInds[lengthof(vc_utInds)] := v_ind; - repeat; - } - [vc_utDefaultActive] utPort.receive { - log("*** " & testcasename() & ": INFO: Received unexpected UT message from IUT ***"); - repeat; - } - } - - /** - * @desc Default handling cf01 de-initialisation. - */ - altstep a_cf01Down() runs on ItsGeoNetworking { - [] a_shutdown() { - f_poDefault(); - f_cf01Down(); - log("*** a_cf01Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc Default handling cf02 de-initialisation. - */ - altstep a_cf02Down() runs on ItsMtc { - [] a_shutdown() { - f_cf02Down(); - log("*** a_cf02Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc Default handling cf03 de-initialisation. - */ - altstep a_cf03Down() runs on ItsMtc { - [] a_shutdown() { - f_cf03Down(); - log("*** a_cf03Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc Default handling cf04 de-initialisation. - */ - altstep a_cf04Down() runs on ItsMtc { - [] a_shutdown() { - f_cf04Down(); - log("*** a_cf04Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc Default handling cf05 de-initialisation. - */ - altstep a_cf05Down() runs on ItsMtc { - [] a_shutdown() { - f_cf05Down(); - log("*** a_cf05Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc Default handling cf06 de-initialisation. - */ - altstep a_cf06Down() runs on ItsMtc { - [] a_shutdown() { - f_cf06Down(); - log("*** a_cf06Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc Default handling cf07 de-initialisation. - */ - altstep a_cf07Down() runs on ItsMtc { - [] a_shutdown() { - f_cf07Down(); - log("*** a_cf07Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - group geoGeoUnicastAltsteps { - - /** - * @desc Receive GeoUnicast packet - * @param p_sourceLongPosVec Expected source position vector - * @param p_destinationShortPosVec Expected destination position vector - * @param p_seqNumber Expected sequence number - */ - altstep a_receiveGeoUnicast( - in template (present) ShortPosVector p_destinationShortPosVec, - in template (present) UInt16 p_seqNumber - ) runs on ItsGeoNetworking { - - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwUnicastPacket( - p_destinationShortPosVec, - p_seqNumber)))) { - } - } - - /** - * @desc Receive GeoUnicast packet for specific destination - * @param p_destinationShortPosVec Expected destination position vector - */ - altstep a_receiveGeoUnicastWithDestination(in template (present) ShortPosVector p_destinationShortPosVec) runs on ItsGeoNetworking { - - [vc_gnDefaultActive] a_receiveGeoUnicast(p_destinationShortPosVec, ?) {} - } - - /** - * @desc Receive any GeoUnicast packet - */ - altstep a_receiveAnyGeoUnicast() runs on ItsGeoNetworking { - - [vc_gnDefaultActive] a_receiveGeoUnicast(?, ?) {} - } - - } // end geoGeoUnicastAltsteps - - group geoGeoBroadcastAltsteps { - - /** - * @desc Receive GeoBroadcast packet - * @param p_srcLongPosVec Expected source position vector - * @param p_seqNumber Expected sequence number - */ - altstep a_receiveGeoBroadcast( - in template (present) LongPosVector p_srcLongPosVec, - in template (present) UInt16 p_seqNumber - ) runs on ItsGeoNetworking { - - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacket( - p_srcLongPosVec, - p_seqNumber - )))) { - } - } - - /** - * @desc Receive GeoBroadcast packet with specific Area and HopLimit - * @param p_srcLongPosVec Expected source position vector - * @param p_seqNumber Expected sequence number - * @param p_broadcastArea Expected geoBroadcastArea - * @param p_routerHopLimit Expected router hop limit - * @param p_maxHopLimit Expected max hop limit (Default: ?) - */ - altstep a_receiveGeoBroadcastWithAreaWithHopLimit( - in template (present) LongPosVector p_srcLongPosVec, - in template (present) UInt16 p_seqNumber, - in template (present) GeoBroadcastArea p_broadcastArea, - in template (present) UInt8 p_routerHopLimit, - in template (present) UInt8 p_maxHopLimit := ? - ) runs on ItsGeoNetworking { - - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithAreaAndHl( - p_srcLongPosVec, - p_seqNumber, - p_broadcastArea, - p_maxHopLimit - ), - -, - p_routerHopLimit - ))) { - } - } - - /** - * @desc Receive GeoBroadcast packet for specific Geobroadcast Area - * @param p_srcLongPosVec Expected source position vector - * @param p_seqNumber Expected sequence number - * @param p_broadcastArea Expected geoBroadcastArea - */ - altstep a_receiveGeoBroadcastWithArea( - in template (present) LongPosVector p_srcLongPosVec, - in template (present) UInt16 p_seqNumber, - in template (present) GeoBroadcastArea p_broadcastArea - ) runs on ItsGeoNetworking { - - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( - p_srcLongPosVec, - p_seqNumber, - p_broadcastArea - )))) { - } - } - - } // end geoGeoBroadcastAltsteps - - group geoGeoAnycastAltsteps { - - /** - * @desc Receive GeoAnycast packet - * @param p_srcLongPosVec Expected source position vector - * @param p_senderLongPosVec Expected sender position vector - * @param p_seqNumber Expected sequence number - */ - altstep a_receiveGeoAnycast( - in template (present) LongPosVector p_srcLongPosVec, - in template (present) LongPosVector p_senderLongPosVec, - in template (present) UInt16 p_seqNumber - ) runs on ItsGeoNetworking { - - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacket( - p_srcLongPosVec, - p_seqNumber - )))) { - } - } - - /** - * @desc Receive GeoAnycast packet with specific Area and HopLimit - * @param p_srcLongPosVec Expected source position vector - * @param p_senderLongPosVec Expected sender position vector - * @param p_seqNumber Expected sequence number - * @param p_anycastArea Expected geoAnycastArea - * @param p_hopLimit Expected hop limit - * @param p_maxHopLimit Expected max hop limit (Default: ?) - */ - altstep a_receiveGeoAnycastWithAreaWithHopLimit( - in template (present) LongPosVector p_srcLongPosVec, - in template (present) UInt16 p_seqNumber, - in template (present) GeoAnycastArea p_anycastArea, - in template (present) UInt8 p_hopLimit, - in template (present) UInt8 p_maxHopLimit := ? - ) runs on ItsGeoNetworking { - - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( - p_srcLongPosVec, - p_seqNumber, - p_anycastArea - ), - -, - p_hopLimit - ))) { - } - } - - /** - * @desc Receive GeoAnycast packet for specific GeoAnycast Area - * @param p_srcLongPosVec Expected source position vector - * @param p_senderLongPosVec Expected sender position vector - * @param p_seqNumber Expected sequence number - * @param p_anycastArea Expected geoAnycastArea - */ - altstep a_receiveGeoAnycastWithArea( - in template (present) LongPosVector p_srcLongPosVec, - in template (present) UInt16 p_seqNumber, - in template (present) GeoAnycastArea p_anycastArea - ) runs on ItsGeoNetworking { - - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( - p_srcLongPosVec, - p_seqNumber, - p_anycastArea - )))) { - } - } - - } // end geoGeoAnycastAltsteps - - group geoLocationServiceAltsteps { - - /** - * @desc Receive Location Service Request - * @param p_seqNumber Expected sequence number of the received LS Request - * @param p_gnAddress GN address expected in received LS Request - * @param p_reqSrcPosVector Expected source position vector of the received LS Request - */ - altstep a_receiveLsRequest( - in template (present) UInt16 p_seqNumber, - in template (present) GN_Address.mid p_mid, - out LongPosVector p_reqSrcPosVector - ) runs on ItsGeoNetworking { - var GeoNetworkingInd v_msg; - - [vc_gnDefaultActive] geoNetworkingPort.receive( - mw_geoNwInd( - mw_geoNwPdu( - mw_geoNwLsRequestPacket( - p_seqNumber, - p_mid - ) - ) - ) - ) -> value v_msg { - p_reqSrcPosVector := valueof(v_msg.msgIn.gnPacket.packet.extendedHeader.lsRequestHeader.srcPosVector); - } - } - - /** - * @desc Receive any Location Service Request - */ - altstep a_receiveAnyLsRequest() runs on ItsGeoNetworking { - var LongPosVector v_reqSrcPosVector; - - [vc_gnDefaultActive] a_receiveLsRequest(?, ?, v_reqSrcPosVector) {} - } - - /** - * @desc Receive any Location Service Reply - */ - altstep a_receiveAnyLsReply() runs on ItsGeoNetworking { - [vc_gnDefaultActive] geoNetworkingPort.receive( mw_geoNwInd( mw_geoNwPdu( mw_geoNwLsReplyPacket(?, ?) ))) { - //ignore and repeat - repeat; - } - } - - /** - * @desc Receive Location Service Request and send Location Service Reply - * @param p_reqSeqNumber Expected sequence number of the received LS Request - * @param p_gnAddress GN address expected in received LS Request - * @param p_repSrcPosVector Source position vector of the sent LS Response - * @param p_repSenderPosVector Sender position vector of the sent LS Response - */ - altstep a_receiveLsRequestAndReply( - in template (present) UInt16 p_reqSeqNumber, - in template (value) GN_Address.mid p_mid, - in template (value) LongPosVector p_repSrcPosVector, - in template (value) LongPosVector p_repSenderPosVector - ) runs on ItsGeoNetworking { - var LongPosVector v_repDstPosVector; - - [vc_gnDefaultActive] a_receiveLsRequest(p_reqSeqNumber, p_mid, v_repDstPosVector) { - f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(m_geoNwPdu( - m_geoNwLsReplyPacket( - p_repSrcPosVector, - f_longPosVector2ShortPosVector(v_repDstPosVector), - vc_localSeqNumber - ))))); - } - } - - } // end geoLocationServiceAltsteps - - - } // end geoAltsteps - - group preambles { - - /** - * @desc The default preamble. - */ - function f_prDefault() runs on ItsGeoNetworking { - activate(a_default()); - activate(a_utDefault()); - } - - /** - * @desc Preamble for non-neighbour nodes - */ - function f_prNonNeighbour() runs on ItsGeoNetworking { - f_prDefault(); - } - - /** - * @desc Preamble for neighbour nodes - */ - function f_prNeighbour() runs on ItsGeoNetworking { - f_prDefault(); - f_startBeingNeighbour(); - } - - /** - * @desc Brings the IUT into an initial state. - * @remark Component variable vc_hashedId8ToBeUsed shall be set with the IUT certificate to be used - */ - function f_initialState(Scenario p_scenario := e_staticPosition) runs on ItsBaseGeoNetworking { - - if (PICS_GN_SECURITY) { - var Oct8 v_hashedId8ToBeUsed := f_setupIutCertificate(vc_hashedId8ToBeUsed); - if (oct2int(v_hashedId8ToBeUsed) == 0) { - v_hashedId8ToBeUsed := 'FFFFFFFFFFFFFFFF'O; // Reset to unknown value, the IUT will use its own certificates - } - f_utInitializeIut(m_secGnInitialize(v_hashedId8ToBeUsed)); - } // else, default behavior - else { - f_utInitializeIut(m_gnInitialize); - } - f_sleep(PX_NEIGHBOUR_DISCOVERY_DELAY); - - f_acLoadScenario(p_scenario); - f_acStartScenario(); - } - - /** - * @desc Receive and reply to LS Requests - * @param p_reqSeqNumber Expected sequence number of the received LS Request - * @param p_gnAddress GN address expected in received LS Request - * @param p_repSrcPosVector Source position vector of the sent LS Response - * @param p_repSenderPosVector Sender position vector of the sent LS Response - */ - function f_handleLocationService( - in template (present) UInt16 p_reqSeqNumber, - in template (value) GN_Address.mid p_mid, - in template (value) LongPosVector p_repSrcPosVector, - in template (value) LongPosVector p_repSenderPosVector - ) runs on ItsGeoNetworking { - - tc_ac.start; - alt { - [] a_receiveLsRequestAndReply(p_reqSeqNumber, p_mid, p_repSrcPosVector, p_repSenderPosVector) { - tc_ac.stop; - } - } - - } - - /** - * @desc Send LS request and receive LS Reply - * @param p_reqSrcPosVector Source position vector of the sent LS Request - * @param p_reqSeqNumber Sequence number of the sent LS Request - * @param p_gnAddress GN address for which the LS Request is sent - * @param p_repSrcPosVector Expected source position vector in received LS Response - * @return FncRetCode - */ - function f_processLocationService( - in template (value) LongPosVector p_reqSrcPosVector, - in template (value) UInt16 p_reqSeqNumber, - in template (value) GN_Address p_gnAddress, - out LongPosVector p_repSrcPosVector - ) runs on ItsGeoNetworking return FncRetCode { - var FncRetCode v_ret := e_error; - var GeoNetworkingInd v_msg; - - f_sendGeoNetMessage( - valueof( - m_geoNwReq_linkLayerBroadcast( - m_geoNwPdu( - m_geoNwLsRequestPacket( - p_reqSrcPosVector, - p_reqSeqNumber, - p_gnAddress - ) - ) - ) - ) - ); - - tc_ac.start; - alt { - [] geoNetworkingPort.receive( - mw_geoNwInd( - mw_geoNwPdu( - mw_geoNwLsReplyPacket( - ?, - mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(valueof(p_reqSrcPosVector))) - ) - ) - ) - ) -> value v_msg { - tc_ac.stop; - p_repSrcPosVector := valueof(v_msg.msgIn.gnPacket.packet.extendedHeader.lsReplyHeader.srcPosVector); - v_ret := e_success; - } - } - - return v_ret; - } - - } // end preambles - - group postambles { - - /** - * @desc The default postamble. - */ - function f_poDefault() runs on ItsGeoNetworking { - f_acStopScenario(); - } - - /** - * @desc Postamble for neighbour nodes - */ - function f_poNeighbour() runs on ItsGeoNetworking { - f_stopBeingNeighbour(); - f_poDefault(); - } - - } // end postambles - - group adapterControl { - - /** - * @desc Triggers event in the test system adaptation. - * @param p_event The event to trigger - * @return FncRetCode - */ - function f_acTriggerEvent(template (value) AcGnPrimitive p_event) runs on ItsBaseGeoNetworking return FncRetCode { - var FncRetCode v_ret := e_success; - - acPort.send(p_event); - - return v_ret; - } - - /** - * @desc Get the position vector corresponding to a specific GN address - * @param p_gnAddress GN address for which the search is performed - * @return LongPosVector - IUT's position - */ - function f_acGetLongPosVector(GN_Address p_gnAddress) runs on ItsBaseGeoNetworking return LongPosVector { - var AcGnResponse v_result; - - f_acTriggerEvent(m_getLongPosVector(p_gnAddress)); - tc_ac.start; - alt { - [] acPort.receive(mw_getLongPosVectorAny(p_gnAddress)) -> value v_result { - tc_ac.stop; - } - [] acPort.receive { - tc_ac.stop; - log("*** f_acGetLongPosVector: ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** f_acGetLongPosVector: ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - return v_result.getLongPosVector; - } - - /** - * @desc Triggers test adapter to send beacons for multiple neighbours - * @param p_numberOfNeighbour Number of neighbours to simulate - * @return FncRetCode - */ - function f_acStartBeaconingMultipleNeighbour(in integer p_numberOfNeighbour) runs on ItsGeoNetworking return FncRetCode { - - return f_acTriggerEvent(m_startBeaconingMultipleNeighbour(m_beaconHeader(f_getPosition(vc_componentName)).beaconHeader, p_numberOfNeighbour)); - - } - - /** - * @desc Triggers test adapter to enable security support - * @return FncRetCode - */ - function f_acEnableSecurity() runs on ItsBaseGeoNetworking return FncRetCode { - return f_acTriggerSecEvent(m_acEnableSecurity(PX_CERT_FOR_TS)); - } - - /** - * @desc Triggers test adapter to disable security support - * @return FncRetCode - */ - function f_acDisableSecurity() runs on ItsBaseGeoNetworking return FncRetCode { - - f_unloadCertificates(); - - return f_acTriggerSecEvent(m_acDisableSecurity); - - } - - /** - * @desc Triggers event in the test system adaptation. - * @param p_event The event to trigger - * @return FncRetCode - */ - function f_acTriggerSecEvent( - in template (value) AcSecPrimitive p_event - ) runs on ItsBaseGeoNetworking return FncRetCode { - var FncRetCode v_ret := e_success; - - acPort.send(p_event); - tc_ac.start; - alt { - [] acPort.receive(m_acSecResponseSuccess) { - tc_ac.stop; - } - [] acPort.receive { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - return v_ret; - } - - /** - * @desc Triggers event in the test system adaptation. - * @param p_event The event to trigger - * @return FncRetCode - */ - function f_acTriggerGnssEvent(template (value) AcGnssPrimitive p_event) runs on ItsBaseGeoNetworking return FncRetCode { - var FncRetCode v_ret := e_success; - - acPort.send(p_event); - tc_ac.start; - alt { - [] acPort.receive(m_acGnssResponseSuccess) { - tc_ac.stop; - } - [] acPort.receive { - tc_ac.stop; - log("*** f_acTriggerGnssEvent: ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** f_acTriggerGnssEvent: ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - return v_ret; - } - - /** - * @desc Loads the given scenario - * - * @param p_scenario The scenario to load. - */ - function f_acLoadScenario(Scenario p_scenario) runs on ItsBaseGeoNetworking { - - if (PX_GNSS_SCENARIO_SUPPORT==true) { - f_acTriggerGnssEvent(m_loadScenario(p_scenario)); - } - } // end f_acLoadScenario - - /** - * @desc Starts a loaded scenario - */ - function f_acStartScenario() runs on ItsBaseGeoNetworking { - - if (PX_GNSS_SCENARIO_SUPPORT==true) { - f_acTriggerGnssEvent(m_startScenario); - vc_scenarioStarted := true; - } - } // end f_acStartScenario - - /** - * @desc Stops a loaded scenario - */ - function f_acStopScenario() runs on ItsBaseGeoNetworking { - - if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { - f_acTriggerGnssEvent(m_stopScenario); - vc_scenarioStarted := false; - } - } // end f_acStopScenario - - } // end adapterControl - - group commonFunctions { - - /** - * @desc Gets the value of the lifetime in seconds. - * @param p_lifetime Lifetime to be converted - * @return Lifetime in seconds - */ - function f_getLifetimeValue(in Lifetime p_lifetime) runs on ItsGeoNetworking return float { - var float v_lifetime := 0.0; - - select (p_lifetime.ltBase) { - case (e_50ms) { - v_lifetime := int2float(p_lifetime.multiplier) * 0.5; - } - case (e_1s) { - v_lifetime := int2float(p_lifetime.multiplier) * 1.0; - } - case (e_10s) { - v_lifetime := int2float(p_lifetime.multiplier) * 10.0; - } - case (e_100s) { - v_lifetime := int2float(p_lifetime.multiplier) * 100.0; - } - } - - return v_lifetime; - } - - /** - * @desc Computes GN timestamp based on current time - * @return Unix-Epoch-Time mod 2^32 - */ - function f_computeGnTimestamp() return UInt32 { - - // Timestamp is 1s older than current time to avoid sending beacons coming from the future (time sync between nodes) - var UInt32 v_timestamp := fx_computeGnTimestamp() - 1000; - return v_timestamp; - } - - } // end commonFunctions - - group testerFunctions { - - /** - * @desc Gets the tester GN local address for a specific node - * @param p_node Simulated node - * @return GN address of simulated node - */ - function f_getTsGnLocalAddress(in charstring p_node) return GN_Address { - var GN_Address v_gnAddr := valueof(m_dummyGnAddr); - - select (p_node) { - case (c_compNodeA) { - v_gnAddr := PX_TS_NODE_A_LOCAL_GN_ADDR; - } - case (c_compNodeB) { - v_gnAddr := PX_TS_NODE_B_LOCAL_GN_ADDR; - } - case (c_compNodeC) { - v_gnAddr := PX_TS_NODE_C_LOCAL_GN_ADDR; - } - case (c_compNodeD) { - v_gnAddr := PX_TS_NODE_D_LOCAL_GN_ADDR; - } - case (c_compNodeE) { - v_gnAddr := PX_TS_NODE_E_LOCAL_GN_ADDR; - } - case (c_compNodeF) { - v_gnAddr := PX_TS_NODE_F_LOCAL_GN_ADDR; - } - case else { - log("*** f_getTsGnLocalAddress: INFO: Unknown component " & p_node & " ***"); - } - } - - return v_gnAddr; - } - - /** - * @desc Sends a GeoNetworking message and in case of an included sequence number in the message the - * local sequence number will be increased by one. - * @param p_geoNetReq The message to send. - */ - function f_sendGeoNetMessage(in template (value) GeoNetworkingReq p_geoNetReq) runs on ItsGeoNetworking { - geoNetworkingPort.send(p_geoNetReq); - if (not (ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.shbHeader) - or ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.beaconHeader))) { - f_setLocalSequenceNumber(); - } - } - - /** - * @desc Sends a GeoNetworking message with a payload and in case of an included sequence number in the message the - * local sequence number will be increased by one. - * @param p_geoNetReq The message to send. - * @param p_payload The payload to include. - */ - function f_sendGeoNetMessageWithPayload( - in template (value) GeoNetworkingReq p_geoNetReq, - in template (value) GnRawPayload p_payload - ) runs on ItsGeoNetworking { - p_geoNetReq.msgOut.gnPacket.packet.payload := p_payload; - geoNetworkingPort.send(p_geoNetReq); - if (not (ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.shbHeader) - or ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.beaconHeader))) { - f_setLocalSequenceNumber(); - } - } - - /** - * @desc Receive a GeoNetworking message with a payload and in case of an included sequence number in the message the - * local sequence number will be increased by one. - * @param p_geoNetInd The message to receive. - * @param p_payload The payload to include. - */ - function f_receiveGeoNetMessageWithPayload( - in template (present) GeoNetworkingInd p_geoNetInd, - in template (present) GnRawPayload p_payload - ) return template (present) GeoNetworkingInd { - var template (present) GeoNetworkingInd v_geoNetInd := p_geoNetInd; - - v_geoNetInd.msgIn.gnPacket.packet.payload := p_payload; - - return v_geoNetInd; - } - - /** - * @desc Sets the value of the sequence number for the next event. - */ - function f_setLocalSequenceNumber() runs on ItsGeoNetworking { - vc_localSeqNumber := (vc_localSeqNumber + 1) mod c_uInt16Max; - } - - /** - * @desc Creates an initial seqence number - * @return Time based initial sequence number (increasing with time) - */ - function f_getInitialSequenceNumber() return UInt16 { - - return (f_computeGnTimestamp() / 1000) mod c_uInt16Max; - } - - /** - * @desc Number of messages to be sent - * @return Number of messages to be sent - */ - function f_getMessageCount() return integer { - return PX_MESSAGE_COUNT; - } - - } // end testerFunctions - - group iutFunctions { - - /** - * @desc Gets the IUT GN local address - * @return IUT's GN_Address - * @see PICS_GN_LOCAL_GN_ADDR - */ - function f_getIutGnLocalAddress() return GN_Address { - - return PICS_GN_LOCAL_GN_ADDR; - } - - /** - * @desc Gets the IUT GN local address configuration method - * @return GnAddressConfigurationMethod - IUT's GN local address configuration method - * @see PICS_GN_LOCAL_ADDR_CONF_METHOD - */ - function f_getIutGnLocalAddressConfigurationMethod() return GnAddressConfigurationMethod { - return PICS_GN_LOCAL_ADDR_CONF_METHOD; - } - - /** - * @desc Gets the IUT MAc address - * @return MacAddress - IUT's MAc Address - * @see PICS_IUT_MAC_ADDRESS - */ - function f_getIutMacAddress() return MacAddress { - return PICS_IUT_MAC_ADDRESS; - } - - /** - * @desc Gets the GeoUnicast forwarding algorithm - * @return IUT's GeoUnicast forwarding algorithm - * @see PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM - */ - function f_getGeoUnicastForwardingAlgorithm() return GeoUnicastForwardingAlgorithm { - return PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM; - } - - /** - * @desc Gets the GeoBroadcast forwarding algorithm - * @return IUT's GeoBroadcast forwarding algorithm - * @see PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM - */ - function f_getGeoBroadcastForwardingAlgorithm() return GeoBroadcastForwardingAlgorithm { - return PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM; - } - - /** - * @desc Gets the IUT default hop limit - * @return IUT's default hop limit - * @see PICS_GN_DEFAULT_HOP_LIMIT - */ - function f_getDefaultHopLimit() return UInt8 { - return PICS_GN_DEFAULT_HOP_LIMIT; - } - - /** - * @desc Is the ITS-S mobile or stationary? - * @return Flags indicating whether the ITS-S is mobile or stationary. - * @see PICS_GN_IS_MOBILE - */ - function f_isMobile() return Bit8 { - if (PICS_GN_IS_MOBILE) { - return '10000000'B; - } - return '00000000'B; - } - - /** - * @desc Gets the LS retransmission timer.. Valid for NetRepInterval = default (cong. ctrl). - * @return LS retransmission timer in seconds - * @see PICS_GN_LOCATION_SERVICE_RETRANSMIT_TIMER - */ - function f_getLsRetransmitTimer() return float { - var float v_itsGnLocationServiceRetransmitTimer := int2float(PICS_GN_LOCATION_SERVICE_RETRANSMIT_TIMER/1000); - - return v_itsGnLocationServiceRetransmitTimer; - } - - /** - * @desc Gets the LS retransmission timer for NetRepInterval = medium (cong. ctrl). - * @return LS retransmission timer (medium) in seconds - * @see PX_GN_LOCATION_SERVICE_TIMER_MEDIUM - */ - function f_getLsRetransmitTimerMedium() return float { - var float v_itsGnLocationServiceRetransmitTimerMedium := int2float(PX_GN_LOCATION_SERVICE_TIMER_MEDIUM/1000); - - return v_itsGnLocationServiceRetransmitTimerMedium; - } - - /** - * @desc Gets the LS retransmission timer for NetRepInterval = maximum (cong. ctrl). - * @return LS retransmission timer (maximum) in seconds - * @see PX_GN_LOCATION_SERVICE_TIMER_MAXIMUM - */ - function f_getLsRetransmitTimerMaximum() return float { - var float v_itsGnLocationServiceRetransmitTimerMaximum := int2float(PX_GN_LOCATION_SERVICE_TIMER_MAXIMUM/1000); - - return v_itsGnLocationServiceRetransmitTimerMaximum; - } - - /** - * @desc Gets the App retransmission timer. Valid for AppRepInterval = default (cong. ctrl). - * @return App retransmission timer in seconds - * @see PX_GN_APPLICATION_RETRANSMIT_TIMER - */ - function f_getAppRetransmitTimer() return float { - var float v_itsGnLocationApplicationRetransmitTimer := int2float(PX_GN_APPLICATION_RETRANSMIT_TIMER/1000); - - return v_itsGnLocationApplicationRetransmitTimer; - } - - /** - * @desc Gets the App retransmission timer for AppRepInterval = medium (cong. ctrl). - * @return App retransmission timer (medium) in seconds - * @see PX_GN_APPLICATION_RETRANSMIT_TIMER_MEDIUM - */ - function f_getAppRetransmitTimerMedium() return float { - var float v_itsGnLocationApplicationRetransmitTimerMedium := int2float(PX_GN_APPLICATION_RETRANSMIT_TIMER_MEDIUM/1000); - - return v_itsGnLocationApplicationRetransmitTimerMedium; - } - - /** - * @desc Gets the App retransmission timer for AppRepInterval = maximum (cong. ctrl). - * @return App retransmission timer (maximum) in seconds - * @see PX_GN_APPLICATION_RETRANSMIT_TIMER_MAXIMUM - */ - function f_getAppRetransmitTimerMaximum() return float { - var float v_itsGnLocationApplicationRetransmitTimerMaximum := int2float(PX_GN_APPLICATION_RETRANSMIT_TIMER_MAXIMUM/1000); - - return v_itsGnLocationApplicationRetransmitTimerMaximum; - } - - /** - * @desc Gets the LS maximum retransmission number. - * @return LS maximum retransmission number - * @see PICS_GN_LOCATION_SERVICE_MAX_RETRANS - */ - function f_getLsMaxRetrans() return integer { - var integer v_itsGnLocationServiceMaxRetrans := PICS_GN_LOCATION_SERVICE_MAX_RETRANS; - - return v_itsGnLocationServiceMaxRetrans; - } - - /** - * @desc Gets the Application maximum retransmission number. - * @return Application maximum retransmission number - * @see PX_GN_APPLICATION_MAX_RETRANS - */ - function f_getAppMaxRetrans() return integer { - var integer v_itsGnApplicationMaxRetrans := PX_GN_APPLICATION_MAX_RETRANS; - - return v_itsGnApplicationMaxRetrans; - } - - /** - * @desc Gets the Location Service packet buffer size. - * @return Location Service packet buffer size in Kbytes - * @see PICS_GN_LOCATION_SERVICE_PACKET_BUFFER_SIZE - */ - function f_getLsPacketBufferSize() return integer { - var integer v_itsGnLocationServicePacketBufferSize := PICS_GN_LOCATION_SERVICE_PACKET_BUFFER_SIZE; - - return v_itsGnLocationServicePacketBufferSize; - } // end f_getLsPacketBufferSize - - /** - * @desc Gets the UC forwarding packet buffer size. - * @return UC forwarding packet buffer size in bytes - * @see PICS_GN_UC_FORWARDING_PACKET_BUFFER_SIZE - */ - function f_getUcForwardingPacketBufferSize() return integer { - var integer v_itsGnUcForwardingPacketBufferSize := PICS_GN_UC_FORWARDING_PACKET_BUFFER_SIZE; - - return v_itsGnUcForwardingPacketBufferSize * 1024; - } // end f_getUcForwardingPacketBufferSize - - /** - * @desc Gets the BC forwarding packet buffer size. - * @return BC forwarding packet buffer size in bytes - * @see PICS_GN_BC_FORWARDING_PACKET_BUFFER_SIZE - */ - function f_getBcForwardingPacketBufferSize() return integer { - var integer v_itsGnBcForwardingPacketBufferSize := PICS_GN_BC_FORWARDING_PACKET_BUFFER_SIZE; - - return v_itsGnBcForwardingPacketBufferSize * 1024; - } // end f_getBcForwardingPacketBufferSize - - /** - * @desc Gets the maximum lifetime of a packet. - * @return Maximum lifetime of a packet in seconds - * @see PICS_GN_MAX_PACKET_LIFETIME - */ - function f_getMaxPacketLifeTime() return float { - var float v_itsGnMaxPacketLifetime := int2float(PICS_GN_MAX_PACKET_LIFETIME); - - return v_itsGnMaxPacketLifetime; - } - - /** - * @desc Gets delta for timers. - * @return Delta for timers in seconds - * @see PX_T_DELTA - */ - function f_getDeltaTimer() return float { - var float v_deltaTimer := PX_T_DELTA; - - return v_deltaTimer; - } - - /** - * @desc Gets the beacon service retransmit timer. - * @return Beacon service retransmit timer - */ - function f_getBsRetransmitTimer() return float { - var float v_itsGnBeaconServiceRetransmitTimer; - - v_itsGnBeaconServiceRetransmitTimer := int2float( - (PICS_GN_BEACON_SERVICE_RETRANSMIT_TIMER/1000)); - - return v_itsGnBeaconServiceRetransmitTimer; - } - - /** - * @desc Gets the beacon service retransmit timer for NetBeaconInterval = medium (cong. ctrl). - * @return Beacon service retransmit timer (medium) - */ - function f_getBsRetransmitTimerMedium() return float { - var float v_itsGnBeaconServiceRetransmitTimerMedium; // timer value increased (medium) - - v_itsGnBeaconServiceRetransmitTimerMedium := int2float( - (PX_GN_BEACON_SERVICE_TIMER_MEDIUM+float2int((f_getBsMaxJitter() - 0.0 +1.0)*rnd()) + 0)/1000); - - return v_itsGnBeaconServiceRetransmitTimerMedium; - } - - /** - * @desc Gets the beacon service retransmit timer for NetBeaconInterval = maximum (cong. ctrl). - * @return Beacon service retransmit timer (maximum) - */ - function f_getBsRetransmitTimerMaximum() return float { - var float v_itsGnBeaconServiceRetransmitTimerMaximum; // timer value increased (maximum) - - v_itsGnBeaconServiceRetransmitTimerMaximum := int2float( - (PX_GN_BEACON_SERVICE_TIMER_MAXIMUM+float2int((f_getBsMaxJitter() - 0.0 +1.0)*rnd()) + 0)/1000); - - return v_itsGnBeaconServiceRetransmitTimerMaximum; - } - - /** - * @desc Gets the maximum beacon service jitter. - * @return Maximum beacon service jitter - */ - function f_getBsMaxJitter() return float { - var float v_itsGnBeaconServiceMaxJitter := int2float(PICS_GN_BEACON_SERVICE_MAX_JITTER)/1000.0; - - return v_itsGnBeaconServiceMaxJitter; - } - - /** - * @desc Gets the Lifetime of a Location Table Entry. - * @return Lifetime of a Location Table Entry in seconds - * @see PICS_GN_LIFETIME_LOC_TE - */ - function f_getLifetimeLocTableEntry() return float { - var float v_itsGnLifetimeLocTableEntry := int2float(PICS_GN_LIFETIME_LOC_TE); - - return v_itsGnLifetimeLocTableEntry; - } // end f_getLifetimeLocTableEntry - - /** - * @desc Gets the maximum communication range for CBF algorithm - * @return Maximum communication range for CBF algorithm in meters - * @see PICS_GN_DEFAULT_MAX_COMMUNICATION_RANGE - */ - function f_getCbfMaxCommunicationRange() return integer { - var integer v_maxCommunicationRange := PICS_GN_DEFAULT_MAX_COMMUNICATION_RANGE; - - return v_maxCommunicationRange; - } // end f_getCbfMaxCommunicationRange - - function f_getGeoUnicastCbfMaxTime() return integer { - var integer v_cbfMaxTime := PICS_GN_GEOUNICAST_CBF_MAX_TIME; - - return v_cbfMaxTime; - } // end f_getGeoUnicastCbfMaxTime - - function f_getGeoUnicastCbfMinTime() return integer { - var integer v_cbfMinTime := PICS_GN_GEOUNICAST_CBF_MIN_TIME; - - return v_cbfMinTime; - } // end f_getGeoUnicastCbfMinTime - - function f_getGeoBroadcastCbfMaxTime() return integer { - var integer v_cbfMaxTime := PICS_GN_GEOBROADCAST_CBF_MAX_TIME; - - return v_cbfMaxTime; - } // end f_getGeoBroadcastCbfMaxTime - - function f_getGeoBroadcastCbfMinTime() return integer { - var integer v_cbfMinTime := PICS_GN_GEOBROADCAST_CBF_MIN_TIME; - - return v_cbfMinTime; - } // end f_getGeoBroadcastCbfMinTime - - function f_getGnMaxAreaSize() return float { - var float v_maxAreaSize := PICS_GN_MAX_GEO_AREA_SIZE; - - return v_maxAreaSize; - } // end f_getGnMaxAreaSize - - function f_getAdvancedGbcForwardingMaxCounter() return integer { - var integer v_maxCounter := PICS_GN_ADVANCED_BC_FORWARDING_MAX_COUNTER; - - return v_maxCounter; - } - - /** - * @desc Set the number of neighbour in the Location Table. - * @see PX_MIN_NR_NEIGHBOUR - */ - function f_setNrNeighbourLocTableDefault() runs on ItsGeoNetworking { - var integer v_nrNeighbour := f_random (0, PX_MIN_NR_NEIGHBOUR); - - f_acStartBeaconingMultipleNeighbour(v_nrNeighbour); - - } // end f_setNrNeighbourLocTableDefault - - /** - * @desc Set the number of neighbour in the Location Table (medium). - * @see PX_MIN_NR_NEIGHBOUR - * @see PX_MAX_NR_NEIGHBOUR - */ - function f_setNrNeighbourLocTableMedium() runs on ItsGeoNetworking { - var integer v_nrNeighbour := f_random (PX_MIN_NR_NEIGHBOUR, PX_MAX_NR_NEIGHBOUR); - - f_acStartBeaconingMultipleNeighbour(v_nrNeighbour); - - } // end f_setNrNeighbourLocTableMedium - - /** - * @desc Set the number of neighbour in the Location Table (maximum). - * @see PX_MAX_NR_NEIGHBOUR - * @see PX_MIN_NR_NEIGHBOUR - */ - function f_setNrNeighbourLocTableMaximum() runs on ItsGeoNetworking { - var integer v_nrNeighbour := f_random (PX_MAX_NR_NEIGHBOUR, (2*PX_MIN_NR_NEIGHBOUR)); - - f_acStartBeaconingMultipleNeighbour(v_nrNeighbour); - - } // end f_setNrNeighbourLocTableMaximum - - } // end iutFunctions - - group posVectorFunctions { - - /** - * @desc Convert long position vector to short position vector - * @param p_longPosVector Long position vector to be converted - * @return Short position vector - */ - function f_longPosVector2ShortPosVector(in LongPosVector p_longPosVector) return ShortPosVector { - var ShortPosVector v_shortPosVector; - - v_shortPosVector := { - gnAddr := p_longPosVector.gnAddr, - timestamp_ := p_longPosVector.timestamp_, - latitude := p_longPosVector.latitude, - longitude := p_longPosVector.longitude - }; - - return v_shortPosVector; - } - - /** - * @desc Get IUT's long position vector - * @return IUT's long position vector - */ - function f_getIutLongPosVector() runs on ItsBaseGeoNetworking return LongPosVector { - return f_acGetLongPosVector(f_getIutGnLocalAddress()); - } - - /** - * @desc Get IUT's short position vector - * @return IUT's short position vector - */ - function f_getIutShortPosVector() runs on ItsGeoNetworking return ShortPosVector { - var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); - - if (not isbound(v_longPosVectorIut)) { - v_longPosVectorIut := f_getIutLongPosVector(); - } - return f_longPosVector2ShortPosVector(v_longPosVectorIut); - } - - /** - * @desc Compute a position using a reference position, a distance and an orientation - * @param p_iutLongPosVector Reference position - * @param p_distance Distance to the reference position (in meter) - * @param p_orientation direction of the computed position (0 to 359; 0 means North) - * @return LongPosVector - */ - function f_computePositionUsingDistance(in LongPosVector p_iutLongPosVector, in float p_distance, in integer p_orientation) - return LongPosVector { - var LongPosVector v_result := p_iutLongPosVector; - - log("*** f_computePositionUsingDistance: INFO: calling fx_computePositionUsingDistance() ***"); - fx_computePositionUsingDistance(p_iutLongPosVector.latitude, p_iutLongPosVector.longitude, p_distance, p_orientation, v_result.latitude, v_result.longitude); - - return v_result; - } - - } // end posVectorFunctions - - group externalFunctions { - - /** - * @desc External function to compute timestamp based on current time - * @return Unix-Epoch-Time mod 2^32 - */ - external function fx_computeGnTimestamp() return UInt32; - - } // End of group externalFunctions - - group security { - - /** - * @desc Waiting for the GN message with Security - * @param p_InSecMsg SecurityMessage template - * @param p_received returns received SecurityMessage - */ - altstep a_securedMessage ( - in template (present) EtsiTs103097Data p_InSecMsg, - out EtsiTs103097Data p_received - ) runs on ItsGeoNetworking { - var GeoNetworkingInd v_geoNw; - [] geoNetworkingPort.receive(mw_geoNwInd( - mw_geoNwSecPdu( - p_InSecMsg, - mw_geoNwAnyPacket_withPayload(?) - ))) -> value v_geoNw { - p_received := f_getSecuredMessage(v_geoNw.msgIn); - } - } // End of 'altstep' statement - - /** - * @desc Receive GN message with security containing certificate as a signer info - * @param p_cert returns the certificate used for sign received message - */ - altstep a_securedMessageWithCertificate( - out EtsiTs103097Data p_received - ) runs on ItsGeoNetworking { - - [] a_securedMessage ( - mw_etsiTs103097Data_signed( - mw_signedData( - -, - mw_toBeSignedData( - mw_signedDataPayload - ), - mw_signerIdentifier_certificate // containing certificate - ) - ), - p_received - ) { - // Nothing to do - } - } // End of altstep a_securedMessageWithCertificate - - /** - * @desc Receive GN message with security containing digest as a signer info - * @param p_cert returns the certificate used for sign received message - */ - altstep a_securedMessageWithDigest( - out EtsiTs103097Data p_received - ) runs on ItsGeoNetworking { - [] a_securedMessage ( - mw_etsiTs103097Data_signed( - mw_signedData( - -, - mw_toBeSignedData( - mw_signedDataPayload - ), - mw_signerIdentifier_digest // containing digest - ) - ), - p_received - ) { - // Nothing to do - } - } // End of altstep a_securedMessageWithDigest - - } // End of group altSteps - - group waitingHelpers { - - /** - * @desc Wait for GN message with security containing certificate as a signer info - * @return the certificate used for sign received message - */ - function f_waitForCertificate( - out EtsiTs103097Certificate p_cert - ) runs on ItsGeoNetworking return boolean { - var EtsiTs103097Data v_recv; - var boolean v_ret := false; - - alt { - [] a_securedMessageWithCertificate(v_recv) { - var SignerIdentifier v_signerIdentifier; - if (f_getMsgSignerIdentifier(v_recv, v_signerIdentifier) == true) { - if (ischosen(v_signerIdentifier.certificate)) { - p_cert := v_signerIdentifier.certificate[0]; - v_ret := true; - } - } - } - } // End of 'alt' statement - - return v_ret; - } // End of function f_waitForCertificate - - /** - * @desc Ask for the certificate chain and wait for GN message with security containing certificate chain as a signer info - * @return the certificate chain used for sign received message - */ - function f_askForCertificateChain (in template(value) octetstring p_CamPayload) - runs on ItsGeoNetworking - return boolean { - var EtsiTs103097Data v_recv; - var boolean v_ret := false; - - alt { - [] a_securedMessageWithCertificate(v_recv) { - var SignerIdentifier v_signerIdentifier; - if (f_getMsgSignerIdentifier(v_recv, v_signerIdentifier) == true) { // Get AT certificate - if(ischosen(v_signerIdentifier.digest)) { - f_sendCertificateRequest(v_signerIdentifier.digest, p_CamPayload); // Request issuer - if(tc_ac.running) { - tc_ac.stop; - tc_ac.start; - } - v_ret := true; - } - } - } - } - return v_ret; - } // End of function f_askForCertificateChain - - /** - * @desc Ask for the certificate chain and wait for GN message with security containing certificate chain as a signer info - * @return the certificate chain used for sign received message - */ - function f_askAndWaitForCertificateChain( - out SequenceOfCertificate p_chain, - in template(value) octetstring p_CamPayload - ) runs on ItsGeoNetworking return boolean { - // Local variables - var EtsiTs103097Data v_recv; - var SignerIdentifier v_signerIdentifier; - var boolean v_ret := false; - - f_askForCertificateChain(p_CamPayload); // Get AT certificate and request for the issuer - alt { - [] a_securedMessageWithCertificate(v_recv) { // Get AA certificate - tc_ac.stop; - - if (f_getMsgSignerIdentifier(v_recv, v_signerIdentifier) == true) { - p_chain := v_signerIdentifier.certificate; - } - } - } // End of 'alt' statement - - return v_ret; - } // End of function f_askAndWaitForCertificateChain - - /** - * @desc Send a CAM message with a certificate and wait the certificate chain request message - * @remark This function is used only for testing against another ATS - * @param p_certificate The certificate identifier - * @param p_CamPayload The CAM paylaod - * @return true on success, flase otherwise - */ - function f_sendCertificateAndWaitForCertificateChainRequest( - in charstring p_certificate, - in template(value) octetstring p_CamPayload - ) runs on ItsGeoNetworking return boolean { - // Local variables - var EtsiTs103097Data v_recv; - - f_sendCertificate(p_certificate, p_CamPayload); - /* FIXME To be reviewed alt { - [] a_securedMessage ( - mw_securedMessage( - superset( - mw_header_field_unrecognised_certificate - )), - v_recv - ) { - // Nothing to do - log("*** " & testcasename() & ": DEBUG: Receive certificate ***") - } - }*/ // End of 'alt' statement - - return true; - } // End of function f_sendCertificateAndWaitForCertificateChainRequest - - } // End of group waitingHelpers - - group CertRequests{ - - function f_sendCertificateRequest( - in template (value) HashedId8 p_digest, - in template (value) octetstring p_payload - ) runs on ItsGeoNetworking { - var GeoNetworkingReq v_gnReq; - var GnNonSecuredPacket v_gnNonSecuredPacket; - var template (value) ToBeSignedData v_toBeSignedData; - var template (value) EtsiTs103097Data v_securedMessage; - - // Build signed EtsiTs103097Data - v_gnNonSecuredPacket := valueof(m_geoNwShbPacket( - f_getPosition(c_compNodeC) // FIXME To be verified YANN - )); - // Add CAM payload - v_gnNonSecuredPacket.payload := valueof(p_payload); - - /* FIXME To be reviewed f_buildGnSecuredCam( - v_securedMessage, - m_payload_signed(bit2oct(encvalue(v_gnNonSecuredPacket))), - e_certificate, - { - m_header_field_unrecognised_certificate( - f_HashedId3FromHashedId8( - valueof(p_digest) - )) - }, - "" - ); - - // Build secured Gn packet - v_gnReq := valueof(m_geoNwReq_linkLayerBroadcast( - m_geoNwSecPdu( - v_gnNonSecuredPacket, - v_securedMessage - ) // End of template m_geoNwSecPdu - )); // End of template m_geoNwReq_linkLayerBroadcast - - // Send Message - f_sendGeoNetMessage(v_gnReq);*/ - - } // End of function f_sendCertificateRequest - - /** - * @desc Send a CAM message with a certificate - * @remark This function is used only for testing against another ATS - * @param p_certificate The certificate identifier - * @param p_CamPayload The CAM paylaod - * @return true on success, flase otherwise - * @see f_sendCertificateAndWaitForCertificateChainRequest - */ - function f_sendCertificate( - in charstring p_certificate, - in template (value) octetstring p_payload - ) runs on ItsGeoNetworking { - var GeoNetworkingReq v_gnReq; - var GnNonSecuredPacket v_gnNonSecuredPacket; - var template (value) ToBeSignedData v_toBeSignedData; - var template (value) EtsiTs103097Data v_securedMessage; - - // Build signed EtsiTs103097Data - /* FIXME To be reviewed v_gnNonSecuredPacket := valueof(m_geoNwShbPacket( - f_getPosition(c_compNodeC) // FIXME To be verified YANN - )); - // Add CAM payload - v_gnNonSecuredPacket.payload := valueof(p_payload); - - f_buildGnSecuredCam( - v_securedMessage, - m_payload_signed(bit2oct(encvalue(v_gnNonSecuredPacket))), - e_certificate, - -, - p_certificate - ); - - // Build secured Gn packet - v_gnReq := valueof(m_geoNwReq_linkLayerBroadcast( - m_geoNwSecPdu( - v_gnNonSecuredPacket, - v_securedMessage - ) // End of template m_geoNwSecPdu - )); // End of template m_geoNwReq_linkLayerBroadcast - - // Send Message - f_sendGeoNetMessage(v_gnReq);*/ - - } // End of function f_sendCertificate - - } // End of group CertRequests - - group messageGetters { - - /** - * @desc return EtsiTs103097Data field of GeoNetworking packet - * @param p_msg GeoNetworking packet - * @return the EtsiTs103097Data if any - */ - function f_getSecuredMessage(in GeoNetworkingPdu p_msg) - return EtsiTs103097Data { - return p_msg.gnPacket.securedMsg; - } - - } - -} // end LibItsGeoNetworking_Functions +/** + * @author ETSI / STF405 / STF449 / STF484 / STF517 / STF525 + * @version $URL$ +* $Id$ + * @desc Module containing functions for GeoNetworking + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * + */ +module LibItsGeoNetworking_Functions { + + // Libcommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; + import from LibCommon_VerdictControl all; + import from LibCommon_Sync all; + import from LibCommon_Time all; + + // LibIts + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + import from IEEE1609dot2 language "ASN.1:1997" all; + import from EtsiTs103097Module language "ASN.1:1997" all; + + // LibItsCommon + import from LibItsCommon_TypesAndValues all; + import from LibItsExternal_TypesAndValues all; + import from LibItsCommon_Templates all; + import from LibItsCommon_Functions all; + import from LibItsCommon_Pixits all; + // import from LibItsCommon_TestSystem 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_TypesAndValues all; + import from LibItsGeoNetworking_Templates all; + import from LibItsGeoNetworking_Pixits all; + import from LibItsGeoNetworking_Pics all; + // import from LibItsGeoNetworking_EncdecDeclarations all; + + group utFuntions { + + /** + * @desc Requests to bring the IUT in an initial state + * @param p_init The initialisation to trigger. + */ + function f_utInitializeIut(template (value) UtGnInitialize p_init) runs on ItsBaseGeoNetworking { + + //deactivate gnPort default alts + vc_gnDefaultActive := false; + + utPort.send(p_init); + tc_wait.start; + alt { + [] utPort.receive(UtGnResults: { utGnInitializeResult := true }) { + tc_wait.stop; + log("*** f_utInitializeIut: INFO: IUT initialized ***"); + } + [] utPort.receive { + tc_wait.stop; + log("*** f_utInitializeIut: INFO: IUT could not be initialized ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] tc_wait.timeout { + log("*** f_utInitializeIut: INFO: IUT could not be initialized in time ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } + + //activate gnPort default alts + vc_gnDefaultActive := true; + + } + + /** + * @desc Requests to change the position of the IUT + */ + function f_utChangePosition() runs on ItsBaseGeoNetworking { + + //deactivate gnPort default alts + vc_gnDefaultActive := false; + + utPort.send(m_changePosition); + tc_wait.start; + alt { + [] utPort.receive(UtGnResults: { utGnChangePositionResult := true} ) { + tc_wait.stop; + log("*** f_utChangePosition: INFO: IUT position changed ***"); + } + [] utPort.receive(UtGnResults: { utGnChangePositionResult := false }) { + tc_wait.stop; + log("*** f_utChangePosition: INFO: IUT position change was not successful ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] a_utDefault() { + } + [] tc_wait.timeout { + log("*** f_utChangePosition: INFO: IUT position not changed in time ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } + + //activate gnPort default alts + vc_gnDefaultActive := true; + + } + + /** + * @desc Triggers event from the application layer + * @param p_event The event to trigger. + */ + function f_utTriggerEvent(template (value) UtGnTrigger p_event) runs on ItsBaseGeoNetworking return boolean { + + // Variables + var boolean v_return := true; + + //deactivate gnPort default alts + vc_gnDefaultActive := false; + + utPort.send(p_event); + tc_wait.start; + alt { + [] utPort.receive(UtGnResults: { utGnTriggerResult := true }) { + tc_wait.stop; + } + [] utPort.receive(UtGnResults: { utGnTriggerResult := false }) { + tc_wait.stop; + log("*** UtGnTriggerResult: INFO: UT trigger was not successful ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] a_utDefault() { + } + [] tc_wait.timeout { + v_return := false; + } + } + + //activate gnPort default alts + vc_gnDefaultActive := true; + + return v_return; + } + + } // End of group utFunctions + + group geoConfigurationFunctions { + + /** + * @desc This configuration features: + * - one ITS node (IUT) + * - two ITS nodes (nodeA, nodeB) + * - Area1 which only includes NodeB and IUT + * - Area2 which only includes NodeB + * NodeB being close to the area center + */ + //FIXME RGY Titan doesn't support mtc and system clauses yet + function f_cf01Up(Scenario p_scenario := e_staticPosition) runs on ItsGeoNetworking /* TITAN TODO: system ItsGeoNetworkingSystem */ { + + // Variables + var PositionTable v_positionTable := {}; + var GeoAreaTable v_areaTable := {}; + + // Map + map(self:acPort, system:acPort); + map(self:utPort, system:utPort); + map(self:geoNetworkingPort, system:geoNetworkingPort); + + // Connect + f_connect4SelfOrClientSync(); + activate(a_cf01Down()); + + // Initialise secured mode + f_initialiseSecuredMode(); + + //Initialze the IUT + f_initialState(p_scenario); + + // Positions & Areas + f_preparePositionsAndAreas(v_positionTable, v_areaTable); + + f_initialiseComponent(v_positionTable, v_areaTable, c_compNodeB); + + } // end f_cf01Up + + //FIXME RGY Titan doesn't support mtc and system clauses yet + function f_cf01Down() runs on ItsGeoNetworking /* TITAN TODO: system ItsGeoNetworkingSystem */ { + + f_uninitialiseSecuredMode(); + + // Unmap + unmap(self:acPort, system:acPort); + unmap(self:utPort, system:utPort); + unmap(self:geoNetworkingPort, system:geoNetworkingPort); + + // Disconnect + f_disconnect4SelfOrClientSync(); + + } // end f_cf01Down + + /** + * @desc This configuration features: + * - one ITS node (IUT) + * - one ITS node (NodeB) + * - one ITS node (NodeD) + * - Area1 which only includes NodeB, NodeD and IUT + * - Area2 which only includes NodeB and NodeD + * NodeB being close to the area center + * + * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages + */ + + //FIXME RGY Titan doesn't support mtc and system clauses yet + function f_cf02Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { + + // Variables + var LongPosVector v_longPosVectorIut := valueof(m_dummyLongPosVector); + var PositionTable v_positionTable := {}; + var GeoAreaTable v_areaTable := {}; + var ItsGeoNetworking v_component; + var integer i; + + // Select components + vc_componentTable := {{c_compNodeB, omit}, {c_compNodeD, omit}}; + + // Create components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; + } + + // Map & Connect + map(self:acPort, system:acPort); + map(self:utPort, system:utPort); + connect(self:syncPort, mtc:syncPort); + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + map(vc_componentTable[i].gnComponent:acPort, system:acPort); + map(vc_componentTable[i].gnComponent:utPort, system:utPort); + map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + + activate(a_cf02Down()); + + //Initialze the IUT + if(p_mainUtComponent == c_compMTC) { + // Initialise secured mode + f_initialiseSecuredMode(); + + // MTC intializes IUT + f_initialState(p_scenario); + } + else { + v_component := f_getComponent(p_mainUtComponent); + v_component.start(f_initialState(p_scenario)); + v_component.done; + } + + // Positions & Areas + vc_componentTable[0].gnComponent.start(f_getIutLongPosVector_1(v_longPosVectorIut)); // Get positions + vc_componentTable[0].gnComponent.done; + f_preparePositionsAndAreas(v_positionTable, v_areaTable, v_longPosVectorIut); + + // Initialize components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); + } + } + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.done; + } + } + + } // end f_cf02Up + + /** + * @desc Deletes configuration cf02 + */ + + //FIXME RGY Titan doesn't support mtc and system clauses yet + function f_cf02Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { + + // Local variables + var integer i; + + f_uninitialiseSecuredMode(); + + // Unmap & Disconnect + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); + unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); + unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + unmap(self:acPort, system:acPort); + unmap(self:utPort, system:utPort); + disconnect(self:syncPort, mtc:syncPort); + + } // end f_cf02Down + + /** + * @desc This configuration features: + * - one ITS node (IUT) + * - one ITS node (NodeA) + * - one ITS node in direction of NodeA (NodeB) + * - one ITS node not in direction of NodeA (NodeC) + * - Area1 which only includes NodeB and IUT + * - Area2 which only includes NodeB + * NodeB being close to the area center + * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages + */ + //FIXME RGY Titan doesn't support mtc and system clauses yet + function f_cf03Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { + + // Variables + var PositionTable v_positionTable := {}; + var GeoAreaTable v_areaTable := {}; + var ItsGeoNetworking v_component; + var integer i; + + // Select components + vc_componentTable := {{c_compNodeB, omit}, {c_compNodeC, omit}}; + + // Create components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; + } + + // Map & Connect + map(self:acPort, system:acPort); + map(self:utPort, system:utPort); + connect(self:syncPort, mtc:syncPort); + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + map(vc_componentTable[i].gnComponent:acPort, system:acPort); + map(vc_componentTable[i].gnComponent:utPort, system:utPort); + map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + + activate(a_cf03Down()); + + //Initialze the IUT + if(p_mainUtComponent == c_compMTC) { + // Initialise secured mode + f_initialiseSecuredMode(); + + // MTC intializes IUT + f_initialState(p_scenario); + } + else { + v_component := f_getComponent(p_mainUtComponent); + v_component.start(f_initialState(p_scenario)); + v_component.done; + } + + // Positions & Areas + vc_componentTable[0].gnComponent.start(f_getIutLongPosVector_1(v_longPosVectorIut)); // Get positions + vc_componentTable[0].gnComponent.done; + f_preparePositionsAndAreas(v_positionTable, v_areaTable, v_longPosVectorIut); + + // Initialize components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); + } + } + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.done; + } + } + + } // end f_cf03Up + + /** + * @desc Deletes configuration cf03 + */ + + //FIXME RGY Titan doesn't support mtc and system clauses yet + function f_cf03Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { + + // Local variables + var integer i; + + f_uninitialiseSecuredMode(); + + // Unmap & Disconnect + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); + unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); + unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + unmap(self:acPort, system:acPort); + unmap(self:utPort, system:utPort); + disconnect(self:syncPort, mtc:syncPort); + + } // end f_cf03Down + + /** + * @desc This configuration features: + * - one ITS node (IUT) + * - one ITS node (NodeA) + * - one ITS node in direction of NodeA and having + * shortest distance to NodeA (NodeB) + * - one ITS node in direction of NodeA (NodeD) + * - one ITS node not in direction of NodeA (NodeC) + * - Area1 which only includes NodeB, NodeD and IUT + * - Area2 which only includes NodeA, NodeB and NodeD + * NodeB being close to the area center + * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages + */ + + //FIXME RGY Titan doesn't support mtc and system clauses yet + function f_cf04Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { + + // Variables + var PositionTable v_positionTable := {}; + var GeoAreaTable v_areaTable := {}; + var ItsGeoNetworking v_component; + var integer i; + + // Select components + vc_componentTable := {{c_compNodeB, omit}, {c_compNodeC, omit}, {c_compNodeD, omit}}; + + // Create components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; + } + + // Map & Connect + map(self:acPort, system:acPort); + map(self:utPort, system:utPort); + connect(self:syncPort, mtc:syncPort); + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + map(vc_componentTable[i].gnComponent:acPort, system:acPort); + map(vc_componentTable[i].gnComponent:utPort, system:utPort); + map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + + activate(a_cf04Down()); + + //Initialze the IUT + if(p_mainUtComponent == c_compMTC) { + // Initialise secured mode + f_initialiseSecuredMode(); + + // MTC intializes IUT + f_initialState(p_scenario); + } + else { + v_component := f_getComponent(p_mainUtComponent); + v_component.start(f_initialState(p_scenario)); + v_component.done; + } + + // Positions & Areas + vc_componentTable[0].gnComponent.start(f_getIutLongPosVector_1(v_longPosVectorIut)); // Get positions + vc_componentTable[0].gnComponent.done; + f_preparePositionsAndAreas(v_positionTable, v_areaTable, v_longPosVectorIut); + + // Initialize components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); + } + } + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.done; + } + } + + } // end f_cf04Up + + /** + * @desc Deletes configuration cf04 + */ + + //FIXME RGY Titan doesn't support mtc and system clauses yet + function f_cf04Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */{ + + // Local variables + var integer i; + + f_uninitialiseSecuredMode(); + + // Unmap & Disconnect + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); + unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); + unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + unmap(self:acPort, system:acPort); + unmap(self:utPort, system:utPort); + disconnect(self:syncPort, mtc:syncPort); + + } // end f_cf04Down + + /** + * @desc This configuration features: + * - one ITS node (IUT) + * - one ITS node (NodeB) + * - one ITS node not in direction of NodeB and having + * longest distance to NodeB (NodeE) + * - Area1 which only includes NodeB, NodeD and IUT + * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages + */ + + //FIXME RGY Titan doesn't support mtc and system clauses yet + function f_cf05Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { + + // Variables + var PositionTable v_positionTable := {}; + var GeoAreaTable v_areaTable := {}; + var ItsGeoNetworking v_component; + var integer i; + + // Select components + vc_componentTable := {{c_compNodeB, omit}, {c_compNodeE, omit}}; + + // Create components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; + } + + // Map & Connect + map(self:acPort, system:acPort); + map(self:utPort, system:utPort); + connect(self:syncPort, mtc:syncPort); + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + map(vc_componentTable[i].gnComponent:acPort, system:acPort); + map(vc_componentTable[i].gnComponent:utPort, system:utPort); + map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + + activate(a_cf05Down()); + + //Initialze the IUT + if(p_mainUtComponent == c_compMTC) { + // Initialise secured mode + f_initialiseSecuredMode(); + + // MTC intializes IUT + f_initialState(p_scenario); + } + else { + v_component := f_getComponent(p_mainUtComponent); + v_component.start(f_initialState(p_scenario)); + v_component.done; + } + + // Positions & Areas + vc_componentTable[0].gnComponent.start(f_getIutLongPosVector_1(v_longPosVectorIut)); // Get positions + vc_componentTable[0].gnComponent.done; + f_preparePositionsAndAreas(v_positionTable, v_areaTable, v_longPosVectorIut); + + // Initialize components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); + } + } + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.done; + } + } + } + + /** + * @desc Deletes configuration cf05 + */ + + //FIXME RGY Titan doesn't support mtc and system clauses yet + function f_cf05Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { + + // Local variables + var integer i; + + f_uninitialiseSecuredMode(); + + // Unmap & Disconnect + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); + unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); + unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + unmap(self:acPort, system:acPort); + unmap(self:utPort, system:utPort); + disconnect(self:syncPort, mtc:syncPort); + + } // end f_cf05Down + + /** + * @desc This configuration features: + * - one ITS node (IUT) + * - one ITS node (NodeB) + * - one ITS node not in direction of NodeB and having + * shortest distance to NodeB (NodeF) + * - Area1 which only includes NodeB, NodeD and IUT + * - IUT not in sectorial area of NodeB-NodeF + * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages + */ + //FIXME RGY Titan doesn't support mtc and system clauses yet + function f_cf06Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { + + // Variables + var PositionTable v_positionTable := {}; + var GeoAreaTable v_areaTable := {}; + var ItsGeoNetworking v_component; + var integer i; + + // Select components + vc_componentTable := {{c_compNodeB, omit}, {c_compNodeF, omit}}; + + // Create components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; + } + + // Map & Connect + map(self:acPort, system:acPort); + map(self:utPort, system:utPort); + connect(self:syncPort, mtc:syncPort); + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + map(vc_componentTable[i].gnComponent:acPort, system:acPort); + map(vc_componentTable[i].gnComponent:utPort, system:utPort); + map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + + activate(a_cf06Down()); + + //Initialze the IUT + if(p_mainUtComponent == c_compMTC) { + // Initialise secured mode + f_initialiseSecuredMode(); + + // MTC intializes IUT + f_initialState(p_scenario); + } + else { + v_component := f_getComponent(p_mainUtComponent); + v_component.start(f_initialState(p_scenario)); + v_component.done; + } + + // Positions & Areas + vc_componentTable[0].gnComponent.start(f_getIutLongPosVector_1(v_longPosVectorIut)); // Get positions + vc_componentTable[0].gnComponent.done; + f_preparePositionsAndAreas(v_positionTable, v_areaTable, v_longPosVectorIut); + + // Initialize components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); + } + } + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.done; + } + } + } + + /** + * @desc Deletes configuration cf06 + */ + + //FIXME RGY Titan doesn't support mtc and system clauses yet + function f_cf06Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { + + // Local variables + var integer i; + + f_uninitialiseSecuredMode(); + + // Unmap & Disconnect + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); + unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); + unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + unmap(self:acPort, system:acPort); + unmap(self:utPort, system:utPort); + disconnect(self:syncPort, mtc:syncPort); + + } // end f_cf06Down + + /** + * @desc This configuration features: + * - one ITS node (IUT) + * - one ITS node (NodeB) + * - one ITS node in direction of NodeB and having + * shortest distance to NodeB (NodeD) + * - Area1 which only includes NodeB, NodeD and IUT + * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages + */ + + //FIXME RGY Titan doesn't support mtc and system clauses yet + function f_cf07Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO mtc ItsMtc system ItsGeoNetworkingSystem */{ + + // Variables + var PositionTable v_positionTable := {}; + var GeoAreaTable v_areaTable := {}; + var ItsGeoNetworking v_component; + var integer i; + + // Select components + vc_componentTable := {{c_compNodeB, omit}, {c_compNodeD, omit}}; + + // Create components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; + } + + // Map & Connect + map(self:acPort, system:acPort); + map(self:utPort, system:utPort); + connect(self:syncPort, mtc:syncPort); + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + map(vc_componentTable[i].gnComponent:acPort, system:acPort); + map(vc_componentTable[i].gnComponent:utPort, system:utPort); + map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + + activate(a_cf07Down()); + + //Initialze the IUT + if(p_mainUtComponent == c_compMTC) { + // Initialise secured mode + f_initialiseSecuredMode(); + + // MTC intializes IUT + f_initialState(p_scenario); + } + else { + v_component := f_getComponent(p_mainUtComponent); + v_component.start(f_initialState(p_scenario)); + v_component.done; + } + + // Positions & Areas + vc_componentTable[0].gnComponent.start(f_getIutLongPosVector_1(v_longPosVectorIut)); // Get positions + vc_componentTable[0].gnComponent.done; + f_preparePositionsAndAreas(v_positionTable, v_areaTable, v_longPosVectorIut); + + // Initialize components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); + } + } + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.done; + } + } + } + + /** + * @desc Deletes configuration cf06 + */ + //FIXME RGY Titan doesn't support mtc and system clauses yet + function f_cf07Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { + + // Local variables + var integer i; + + f_uninitialiseSecuredMode(); + + // Unmap & Disconnect + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); + unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); + unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + unmap(self:acPort, system:acPort); + unmap(self:utPort, system:utPort); + disconnect(self:syncPort, mtc:syncPort); + + } // end f_cf07Down + + /** + * @desc Behavior function for initializing component's variables and tables + * @param p_positionTable Table containing position vectors of all nodes + * @param p_areaTable Table containing all defined geoAreas + * @param p_componentName Name of the component + */ + function f_initialiseComponent( + in PositionTable p_positionTable, + in GeoAreaTable p_areaTable, + in charstring p_componentName) + runs on ItsGeoNetworking { + + vc_positionTable := p_positionTable; + vc_areaTable := p_areaTable; + vc_componentName := p_componentName; + + vc_localSeqNumber := f_getInitialSequenceNumber(); + vc_multipleMessagesCount := f_getMessageCount(); + + } // end f_initialiseComponent + + /** + * @desc Makes the simulated ITS node behave as a neighbour of IUT + */ + function f_startBeingNeighbour() runs on ItsGeoNetworking { + + vc_neighbourDefault := activate(a_neighbourDefault()); + f_acTriggerEvent(m_startBeaconing(m_beaconHeader(f_getPosition(vc_componentName)).beaconHeader)); + f_sleepIgnoreDef(PX_NEIGHBOUR_DISCOVERY_DELAY); + } // end f_startBeingNeighbour + + /** + * @desc Makes the simulated ITS node behave as not being a neighbour of IUT + */ + function f_stopBeingNeighbour() runs on ItsGeoNetworking { + + f_acTriggerEvent(m_stopBeaconing); + if (PICS_GN_SECURITY == true) { + deactivate(vc_neighbourDefault); + } + } // end f_stopBeingNeighbour + + /** + * @desc Initialise secure mode if required + */ + function f_initialiseSecuredMode() runs on ItsBaseGeoNetworking { + + // Local variables + + // Load certificates + if (PICS_GN_SECURITY == true) { + if( not f_loadCertificates(PX_IUT_SEC_CONFIG_NAME) ) { + log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); + stop; + } + + // Initialize vc_location + f_setGenerationLocation( + f_getTsLatitude(), + f_getTsLongitude() + ); + } else if (PICS_IS_IUT_SECURED == true) { + if(e_success != f_acEnableSecurity()){ + log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); + stop; + } + } + } // End of function f_initialiseSecuredMode() + + function f_uninitialiseSecuredMode() runs on ItsBaseGeoNetworking { + if ((PICS_GN_SECURITY == true) or (PICS_IS_IUT_SECURED == true)) { + f_acDisableSecurity(); + } + } // End of function f_uninitialiseSecuredMode() + + } // end geoConfigurationFunctions + + group componentFunctions { + /** + * @desc Get the component corresponding to a key + * @param p_componentName Name searched component + * @return ItsGeoNetworking - The searched position vector + */ + function f_getComponent( + in charstring p_componentName + ) runs on ItsMtc + return ItsGeoNetworking { + + var ItsGeoNetworking v_return := null; + var integer i := 0; + + for (i:=0; i value v_ind { + //store every upper tester indication received + vc_utInds[lengthof(vc_utInds)] := v_ind; + repeat; + } + [vc_utDefaultActive] utPort.receive { + log("*** " & testcasename() & ": INFO: Received unexpected UT message from IUT ***"); + repeat; + } + } + + /** + * @desc Default handling cf01 de-initialisation. + */ + altstep a_cf01Down() runs on ItsGeoNetworking { + [] a_shutdown() { + f_poDefault(); + f_cf01Down(); + log("*** a_cf01Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } + } + + /** + * @desc Default handling cf02 de-initialisation. + */ + altstep a_cf02Down() runs on ItsMtc { + [] a_shutdown() { + f_cf02Down(); + log("*** a_cf02Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } + } + + /** + * @desc Default handling cf03 de-initialisation. + */ + altstep a_cf03Down() runs on ItsMtc { + [] a_shutdown() { + f_cf03Down(); + log("*** a_cf03Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } + } + + /** + * @desc Default handling cf04 de-initialisation. + */ + altstep a_cf04Down() runs on ItsMtc { + [] a_shutdown() { + f_cf04Down(); + log("*** a_cf04Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } + } + + /** + * @desc Default handling cf05 de-initialisation. + */ + altstep a_cf05Down() runs on ItsMtc { + [] a_shutdown() { + f_cf05Down(); + log("*** a_cf05Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } + } + + /** + * @desc Default handling cf06 de-initialisation. + */ + altstep a_cf06Down() runs on ItsMtc { + [] a_shutdown() { + f_cf06Down(); + log("*** a_cf06Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } + } + + /** + * @desc Default handling cf07 de-initialisation. + */ + altstep a_cf07Down() runs on ItsMtc { + [] a_shutdown() { + f_cf07Down(); + log("*** a_cf07Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } + } + group geoGeoUnicastAltsteps { + + /** + * @desc Receive GeoUnicast packet + * @param p_sourceLongPosVec Expected source position vector + * @param p_destinationShortPosVec Expected destination position vector + * @param p_seqNumber Expected sequence number + */ + altstep a_receiveGeoUnicast( + in template (present) ShortPosVector p_destinationShortPosVec, + in template (present) UInt16 p_seqNumber + ) runs on ItsGeoNetworking { + + [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwUnicastPacket( + p_destinationShortPosVec, + p_seqNumber)))) { + } + } + + /** + * @desc Receive GeoUnicast packet for specific destination + * @param p_destinationShortPosVec Expected destination position vector + */ + altstep a_receiveGeoUnicastWithDestination(in template (present) ShortPosVector p_destinationShortPosVec) runs on ItsGeoNetworking { + + [vc_gnDefaultActive] a_receiveGeoUnicast(p_destinationShortPosVec, ?) {} + } + + /** + * @desc Receive any GeoUnicast packet + */ + altstep a_receiveAnyGeoUnicast() runs on ItsGeoNetworking { + + [vc_gnDefaultActive] a_receiveGeoUnicast(?, ?) {} + } + + } // end geoGeoUnicastAltsteps + + group geoGeoBroadcastAltsteps { + + /** + * @desc Receive GeoBroadcast packet + * @param p_srcLongPosVec Expected source position vector + * @param p_seqNumber Expected sequence number + */ + altstep a_receiveGeoBroadcast( + in template (present) LongPosVector p_srcLongPosVec, + in template (present) UInt16 p_seqNumber + ) runs on ItsGeoNetworking { + + [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacket( + p_srcLongPosVec, + p_seqNumber + )))) { + } + } + + /** + * @desc Receive GeoBroadcast packet with specific Area and HopLimit + * @param p_srcLongPosVec Expected source position vector + * @param p_seqNumber Expected sequence number + * @param p_broadcastArea Expected geoBroadcastArea + * @param p_routerHopLimit Expected router hop limit + * @param p_maxHopLimit Expected max hop limit (Default: ?) + */ + altstep a_receiveGeoBroadcastWithAreaWithHopLimit( + in template (present) LongPosVector p_srcLongPosVec, + in template (present) UInt16 p_seqNumber, + in template (present) GeoBroadcastArea p_broadcastArea, + in template (present) UInt8 p_routerHopLimit, + in template (present) UInt8 p_maxHopLimit := ? + ) runs on ItsGeoNetworking { + + [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithAreaAndHl( + p_srcLongPosVec, + p_seqNumber, + p_broadcastArea, + p_maxHopLimit + ), + -, + p_routerHopLimit + ))) { + } + } + + /** + * @desc Receive GeoBroadcast packet for specific Geobroadcast Area + * @param p_srcLongPosVec Expected source position vector + * @param p_seqNumber Expected sequence number + * @param p_broadcastArea Expected geoBroadcastArea + */ + altstep a_receiveGeoBroadcastWithArea( + in template (present) LongPosVector p_srcLongPosVec, + in template (present) UInt16 p_seqNumber, + in template (present) GeoBroadcastArea p_broadcastArea + ) runs on ItsGeoNetworking { + + [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + p_srcLongPosVec, + p_seqNumber, + p_broadcastArea + )))) { + } + } + + } // end geoGeoBroadcastAltsteps + + group geoGeoAnycastAltsteps { + + /** + * @desc Receive GeoAnycast packet + * @param p_srcLongPosVec Expected source position vector + * @param p_senderLongPosVec Expected sender position vector + * @param p_seqNumber Expected sequence number + */ + altstep a_receiveGeoAnycast( + in template (present) LongPosVector p_srcLongPosVec, + in template (present) LongPosVector p_senderLongPosVec, + in template (present) UInt16 p_seqNumber + ) runs on ItsGeoNetworking { + + [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacket( + p_srcLongPosVec, + p_seqNumber + )))) { + } + } + + /** + * @desc Receive GeoAnycast packet with specific Area and HopLimit + * @param p_srcLongPosVec Expected source position vector + * @param p_senderLongPosVec Expected sender position vector + * @param p_seqNumber Expected sequence number + * @param p_anycastArea Expected geoAnycastArea + * @param p_hopLimit Expected hop limit + * @param p_maxHopLimit Expected max hop limit (Default: ?) + */ + altstep a_receiveGeoAnycastWithAreaWithHopLimit( + in template (present) LongPosVector p_srcLongPosVec, + in template (present) UInt16 p_seqNumber, + in template (present) GeoAnycastArea p_anycastArea, + in template (present) UInt8 p_hopLimit, + in template (present) UInt8 p_maxHopLimit := ? + ) runs on ItsGeoNetworking { + + [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( + p_srcLongPosVec, + p_seqNumber, + p_anycastArea + ), + -, + p_hopLimit + ))) { + } + } + + /** + * @desc Receive GeoAnycast packet for specific GeoAnycast Area + * @param p_srcLongPosVec Expected source position vector + * @param p_senderLongPosVec Expected sender position vector + * @param p_seqNumber Expected sequence number + * @param p_anycastArea Expected geoAnycastArea + */ + altstep a_receiveGeoAnycastWithArea( + in template (present) LongPosVector p_srcLongPosVec, + in template (present) UInt16 p_seqNumber, + in template (present) GeoAnycastArea p_anycastArea + ) runs on ItsGeoNetworking { + + [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( + p_srcLongPosVec, + p_seqNumber, + p_anycastArea + )))) { + } + } + + } // end geoGeoAnycastAltsteps + + group geoLocationServiceAltsteps { + + /** + * @desc Receive Location Service Request + * @param p_seqNumber Expected sequence number of the received LS Request + * @param p_gnAddress GN address expected in received LS Request + * @param p_reqSrcPosVector Expected source position vector of the received LS Request + */ + altstep a_receiveLsRequest( + in template (present) UInt16 p_seqNumber, + in template (present) GN_Address.mid p_mid, + out LongPosVector p_reqSrcPosVector + ) runs on ItsGeoNetworking { + var GeoNetworkingInd v_msg; + + [vc_gnDefaultActive] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwLsRequestPacket( + p_seqNumber, + p_mid + ) + ) + ) + ) -> value v_msg { + p_reqSrcPosVector := valueof(v_msg.msgIn.gnPacket.packet.extendedHeader.lsRequestHeader.srcPosVector); + } + } + + /** + * @desc Receive any Location Service Request + */ + altstep a_receiveAnyLsRequest() runs on ItsGeoNetworking { + var LongPosVector v_reqSrcPosVector; + + [vc_gnDefaultActive] a_receiveLsRequest(?, ?, v_reqSrcPosVector) {} + } + + /** + * @desc Receive any Location Service Reply + */ + altstep a_receiveAnyLsReply() runs on ItsGeoNetworking { + [vc_gnDefaultActive] geoNetworkingPort.receive( mw_geoNwInd( mw_geoNwPdu( mw_geoNwLsReplyPacket(?, ?) ))) { + //ignore and repeat + repeat; + } + } + + /** + * @desc Receive Location Service Request and send Location Service Reply + * @param p_reqSeqNumber Expected sequence number of the received LS Request + * @param p_gnAddress GN address expected in received LS Request + * @param p_repSrcPosVector Source position vector of the sent LS Response + * @param p_repSenderPosVector Sender position vector of the sent LS Response + */ + altstep a_receiveLsRequestAndReply( + in template (present) UInt16 p_reqSeqNumber, + in template (value) GN_Address.mid p_mid, + in template (value) LongPosVector p_repSrcPosVector, + in template (value) LongPosVector p_repSenderPosVector + ) runs on ItsGeoNetworking { + var LongPosVector v_repDstPosVector; + + [vc_gnDefaultActive] a_receiveLsRequest(p_reqSeqNumber, p_mid, v_repDstPosVector) { + f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(m_geoNwPdu( + m_geoNwLsReplyPacket( + p_repSrcPosVector, + f_longPosVector2ShortPosVector(v_repDstPosVector), + vc_localSeqNumber + ))))); + } + } + + } // end geoLocationServiceAltsteps + + + } // end geoAltsteps + + group preambles { + + /** + * @desc The default preamble. + */ + function f_prDefault() runs on ItsGeoNetworking { + activate(a_default()); + activate(a_utDefault()); + } + + /** + * @desc Preamble for non-neighbour nodes + */ + function f_prNonNeighbour() runs on ItsGeoNetworking { + f_prDefault(); + } + + /** + * @desc Preamble for neighbour nodes + */ + function f_prNeighbour() runs on ItsGeoNetworking { + f_prDefault(); + f_startBeingNeighbour(); + } + + /** + * @desc Brings the IUT into an initial state. + * @remark Component variable vc_hashedId8ToBeUsed shall be set with the IUT certificate to be used + */ + function f_initialState(Scenario p_scenario := e_staticPosition) runs on ItsBaseGeoNetworking { + + if (PICS_GN_SECURITY) { + var Oct8 v_hashedId8ToBeUsed := f_setupIutCertificate(vc_hashedId8ToBeUsed); + if (oct2int(v_hashedId8ToBeUsed) == 0) { + v_hashedId8ToBeUsed := 'FFFFFFFFFFFFFFFF'O; // Reset to unknown value, the IUT will use its own certificates + } + f_utInitializeIut(m_secGnInitialize(v_hashedId8ToBeUsed)); + } // else, default behavior + else { + f_utInitializeIut(m_gnInitialize); + } + f_sleep(PX_NEIGHBOUR_DISCOVERY_DELAY); + + f_acLoadScenario(p_scenario); + f_acStartScenario(); + } + + /** + * @desc Receive and reply to LS Requests + * @param p_reqSeqNumber Expected sequence number of the received LS Request + * @param p_gnAddress GN address expected in received LS Request + * @param p_repSrcPosVector Source position vector of the sent LS Response + * @param p_repSenderPosVector Sender position vector of the sent LS Response + */ + function f_handleLocationService( + in template (present) UInt16 p_reqSeqNumber, + in template (value) GN_Address.mid p_mid, + in template (value) LongPosVector p_repSrcPosVector, + in template (value) LongPosVector p_repSenderPosVector + ) runs on ItsGeoNetworking { + + tc_ac.start; + alt { + [] a_receiveLsRequestAndReply(p_reqSeqNumber, p_mid, p_repSrcPosVector, p_repSenderPosVector) { + tc_ac.stop; + } + } + + } + + /** + * @desc Send LS request and receive LS Reply + * @param p_reqSrcPosVector Source position vector of the sent LS Request + * @param p_reqSeqNumber Sequence number of the sent LS Request + * @param p_gnAddress GN address for which the LS Request is sent + * @param p_repSrcPosVector Expected source position vector in received LS Response + * @return FncRetCode + */ + function f_processLocationService( + in template (value) LongPosVector p_reqSrcPosVector, + in template (value) UInt16 p_reqSeqNumber, + in template (value) GN_Address p_gnAddress, + out LongPosVector p_repSrcPosVector + ) runs on ItsGeoNetworking return FncRetCode { + var FncRetCode v_ret := e_error; + var GeoNetworkingInd v_msg; + + f_sendGeoNetMessage( + valueof( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwLsRequestPacket( + p_reqSrcPosVector, + p_reqSeqNumber, + p_gnAddress + ) + ) + ) + ) + ); + + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwLsReplyPacket( + ?, + mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(valueof(p_reqSrcPosVector))) + ) + ) + ) + ) -> value v_msg { + tc_ac.stop; + p_repSrcPosVector := valueof(v_msg.msgIn.gnPacket.packet.extendedHeader.lsReplyHeader.srcPosVector); + v_ret := e_success; + } + } + + return v_ret; + } + + } // end preambles + + group postambles { + + /** + * @desc The default postamble. + */ + function f_poDefault() runs on ItsGeoNetworking { + f_acStopScenario(); + } + + /** + * @desc Postamble for neighbour nodes + */ + function f_poNeighbour() runs on ItsGeoNetworking { + f_stopBeingNeighbour(); + f_poDefault(); + } + + } // end postambles + + group adapterControl { + + /** + * @desc Triggers event in the test system adaptation. + * @param p_event The event to trigger + * @return FncRetCode + */ + function f_acTriggerEvent(template (value) AcGnPrimitive p_event) runs on ItsBaseGeoNetworking return FncRetCode { + var FncRetCode v_ret := e_success; + + acPort.send(p_event); + + return v_ret; + } + + /** + * @desc Get the position vector corresponding to a specific GN address + * @param p_gnAddress GN address for which the search is performed + * @return LongPosVector - IUT's position + */ + function f_acGetLongPosVector(GN_Address p_gnAddress) runs on ItsBaseGeoNetworking return LongPosVector { + var AcGnResponse v_result; + + f_acTriggerEvent(m_getLongPosVector(p_gnAddress)); + tc_ac.start; + alt { + [] acPort.receive(mw_getLongPosVectorAny(p_gnAddress)) -> value v_result { + tc_ac.stop; + } + [] acPort.receive { + tc_ac.stop; + log("*** f_acGetLongPosVector: ERROR: Received unexpected message ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] tc_ac.timeout { + log("*** f_acGetLongPosVector: ERROR: Timeout while waiting for adapter control event result ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } + + return v_result.getLongPosVector; + } + + /** + * @desc Triggers test adapter to send beacons for multiple neighbours + * @param p_numberOfNeighbour Number of neighbours to simulate + * @return FncRetCode + */ + function f_acStartBeaconingMultipleNeighbour(in integer p_numberOfNeighbour) runs on ItsGeoNetworking return FncRetCode { + + return f_acTriggerEvent(m_startBeaconingMultipleNeighbour(m_beaconHeader(f_getPosition(vc_componentName)).beaconHeader, p_numberOfNeighbour)); + + } + + /** + * @desc Triggers test adapter to enable security support + * @return FncRetCode + */ + function f_acEnableSecurity() runs on ItsBaseGeoNetworking return FncRetCode { + return f_acTriggerSecEvent(m_acEnableSecurity(PX_CERT_FOR_TS)); + } + + /** + * @desc Triggers test adapter to disable security support + * @return FncRetCode + */ + function f_acDisableSecurity() runs on ItsBaseGeoNetworking return FncRetCode { + + f_unloadCertificates(); + + return f_acTriggerSecEvent(m_acDisableSecurity); + + } + + /** + * @desc Triggers event in the test system adaptation. + * @param p_event The event to trigger + * @return FncRetCode + */ + function f_acTriggerSecEvent( + in template (value) AcSecPrimitive p_event + ) runs on ItsBaseGeoNetworking return FncRetCode { + var FncRetCode v_ret := e_success; + + acPort.send(p_event); + tc_ac.start; + alt { + [] acPort.receive(m_acSecResponseSuccess) { + tc_ac.stop; + } + [] acPort.receive { + tc_ac.stop; + log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] tc_ac.timeout { + log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for adapter control event result ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } + + return v_ret; + } + + /** + * @desc Triggers event in the test system adaptation. + * @param p_event The event to trigger + * @return FncRetCode + */ + function f_acTriggerGnssEvent(template (value) AcGnssPrimitive p_event) runs on ItsBaseGeoNetworking return FncRetCode { + var FncRetCode v_ret := e_success; + + acPort.send(p_event); + tc_ac.start; + alt { + [] acPort.receive(m_acGnssResponseSuccess) { + tc_ac.stop; + } + [] acPort.receive { + tc_ac.stop; + log("*** f_acTriggerGnssEvent: ERROR: Received unexpected message ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] tc_ac.timeout { + log("*** f_acTriggerGnssEvent: ERROR: Timeout while waiting for adapter control event result ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } + + return v_ret; + } + + /** + * @desc Loads the given scenario + * + * @param p_scenario The scenario to load. + */ + function f_acLoadScenario(Scenario p_scenario) runs on ItsBaseGeoNetworking { + + if (PX_GNSS_SCENARIO_SUPPORT==true) { + f_acTriggerGnssEvent(m_loadScenario(p_scenario)); + } + } // end f_acLoadScenario + + /** + * @desc Starts a loaded scenario + */ + function f_acStartScenario() runs on ItsBaseGeoNetworking { + + if (PX_GNSS_SCENARIO_SUPPORT==true) { + f_acTriggerGnssEvent(m_startScenario); + vc_scenarioStarted := true; + } + } // end f_acStartScenario + + /** + * @desc Stops a loaded scenario + */ + function f_acStopScenario() runs on ItsBaseGeoNetworking { + + if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { + f_acTriggerGnssEvent(m_stopScenario); + vc_scenarioStarted := false; + } + } // end f_acStopScenario + + } // end adapterControl + + group commonFunctions { + + /** + * @desc Gets the value of the lifetime in seconds. + * @param p_lifetime Lifetime to be converted + * @return Lifetime in seconds + */ + function f_getLifetimeValue(in Lifetime p_lifetime) runs on ItsGeoNetworking return float { + var float v_lifetime := 0.0; + + select (p_lifetime.ltBase) { + case (e_50ms) { + v_lifetime := int2float(p_lifetime.multiplier) * 0.5; + } + case (e_1s) { + v_lifetime := int2float(p_lifetime.multiplier) * 1.0; + } + case (e_10s) { + v_lifetime := int2float(p_lifetime.multiplier) * 10.0; + } + case (e_100s) { + v_lifetime := int2float(p_lifetime.multiplier) * 100.0; + } + } + + return v_lifetime; + } + + /** + * @desc Computes GN timestamp based on current time + * @return Unix-Epoch-Time mod 2^32 + */ + function f_computeGnTimestamp() return UInt32 { + + // Timestamp is 1s older than current time to avoid sending beacons coming from the future (time sync between nodes) + var UInt32 v_timestamp := fx_computeGnTimestamp() - 1000; + return v_timestamp; + } + + } // end commonFunctions + + group testerFunctions { + + /** + * @desc Gets the tester GN local address for a specific node + * @param p_node Simulated node + * @return GN address of simulated node + */ + function f_getTsGnLocalAddress(in charstring p_node) return GN_Address { + var GN_Address v_gnAddr := valueof(m_dummyGnAddr); + + select (p_node) { + case (c_compNodeA) { + v_gnAddr := PX_TS_NODE_A_LOCAL_GN_ADDR; + } + case (c_compNodeB) { + v_gnAddr := PX_TS_NODE_B_LOCAL_GN_ADDR; + } + case (c_compNodeC) { + v_gnAddr := PX_TS_NODE_C_LOCAL_GN_ADDR; + } + case (c_compNodeD) { + v_gnAddr := PX_TS_NODE_D_LOCAL_GN_ADDR; + } + case (c_compNodeE) { + v_gnAddr := PX_TS_NODE_E_LOCAL_GN_ADDR; + } + case (c_compNodeF) { + v_gnAddr := PX_TS_NODE_F_LOCAL_GN_ADDR; + } + case else { + log("*** f_getTsGnLocalAddress: INFO: Unknown component " & p_node & " ***"); + } + } + + return v_gnAddr; + } + + /** + * @desc Sends a GeoNetworking message and in case of an included sequence number in the message the + * local sequence number will be increased by one. + * @param p_geoNetReq The message to send. + */ + function f_sendGeoNetMessage(in template (value) GeoNetworkingReq p_geoNetReq) runs on ItsGeoNetworking { + geoNetworkingPort.send(p_geoNetReq); + if (not (ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.shbHeader) + or ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.beaconHeader))) { + f_setLocalSequenceNumber(); + } + } + + /** + * @desc Sends a GeoNetworking message with a payload and in case of an included sequence number in the message the + * local sequence number will be increased by one. + * @param p_geoNetReq The message to send. + * @param p_payload The payload to include. + */ + function f_sendGeoNetMessageWithPayload( + in template (value) GeoNetworkingReq p_geoNetReq, + in template (value) GnRawPayload p_payload + ) runs on ItsGeoNetworking { + p_geoNetReq.msgOut.gnPacket.packet.payload := p_payload; + geoNetworkingPort.send(p_geoNetReq); + if (not (ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.shbHeader) + or ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.beaconHeader))) { + f_setLocalSequenceNumber(); + } + } + + /** + * @desc Receive a GeoNetworking message with a payload and in case of an included sequence number in the message the + * local sequence number will be increased by one. + * @param p_geoNetInd The message to receive. + * @param p_payload The payload to include. + */ + function f_receiveGeoNetMessageWithPayload( + in template (present) GeoNetworkingInd p_geoNetInd, + in template (present) GnRawPayload p_payload + ) return template (present) GeoNetworkingInd { + var template (present) GeoNetworkingInd v_geoNetInd := p_geoNetInd; + + v_geoNetInd.msgIn.gnPacket.packet.payload := p_payload; + + return v_geoNetInd; + } + + /** + * @desc Sets the value of the sequence number for the next event. + */ + function f_setLocalSequenceNumber() runs on ItsGeoNetworking { + vc_localSeqNumber := (vc_localSeqNumber + 1) mod c_uInt16Max; + } + + /** + * @desc Creates an initial seqence number + * @return Time based initial sequence number (increasing with time) + */ + function f_getInitialSequenceNumber() return UInt16 { + + return (f_computeGnTimestamp() / 1000) mod c_uInt16Max; + } + + /** + * @desc Number of messages to be sent + * @return Number of messages to be sent + */ + function f_getMessageCount() return integer { + return PX_MESSAGE_COUNT; + } + + } // end testerFunctions + + group iutFunctions { + + /** + * @desc Gets the IUT GN local address + * @return IUT's GN_Address + * @see PICS_GN_LOCAL_GN_ADDR + */ + function f_getIutGnLocalAddress() return GN_Address { + + return PICS_GN_LOCAL_GN_ADDR; + } + + /** + * @desc Gets the IUT GN local address configuration method + * @return GnAddressConfigurationMethod - IUT's GN local address configuration method + * @see PICS_GN_LOCAL_ADDR_CONF_METHOD + */ + function f_getIutGnLocalAddressConfigurationMethod() return GnAddressConfigurationMethod { + return PICS_GN_LOCAL_ADDR_CONF_METHOD; + } + + /** + * @desc Gets the IUT MAc address + * @return MacAddress - IUT's MAc Address + * @see PICS_IUT_MAC_ADDRESS + */ + function f_getIutMacAddress() return MacAddress { + return PICS_IUT_MAC_ADDRESS; + } + + /** + * @desc Gets the GeoUnicast forwarding algorithm + * @return IUT's GeoUnicast forwarding algorithm + * @see PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM + */ + function f_getGeoUnicastForwardingAlgorithm() return GeoUnicastForwardingAlgorithm { + return PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM; + } + + /** + * @desc Gets the GeoBroadcast forwarding algorithm + * @return IUT's GeoBroadcast forwarding algorithm + * @see PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM + */ + function f_getGeoBroadcastForwardingAlgorithm() return GeoBroadcastForwardingAlgorithm { + return PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM; + } + + /** + * @desc Gets the IUT default hop limit + * @return IUT's default hop limit + * @see PICS_GN_DEFAULT_HOP_LIMIT + */ + function f_getDefaultHopLimit() return UInt8 { + return PICS_GN_DEFAULT_HOP_LIMIT; + } + + /** + * @desc Is the ITS-S mobile or stationary? + * @return Flags indicating whether the ITS-S is mobile or stationary. + * @see PICS_GN_IS_MOBILE + */ + function f_isMobile() return Bit8 { + if (PICS_GN_IS_MOBILE) { + return '10000000'B; + } + return '00000000'B; + } + + /** + * @desc Gets the LS retransmission timer.. Valid for NetRepInterval = default (cong. ctrl). + * @return LS retransmission timer in seconds + * @see PICS_GN_LOCATION_SERVICE_RETRANSMIT_TIMER + */ + function f_getLsRetransmitTimer() return float { + var float v_itsGnLocationServiceRetransmitTimer := int2float(PICS_GN_LOCATION_SERVICE_RETRANSMIT_TIMER/1000); + + return v_itsGnLocationServiceRetransmitTimer; + } + + /** + * @desc Gets the LS retransmission timer for NetRepInterval = medium (cong. ctrl). + * @return LS retransmission timer (medium) in seconds + * @see PX_GN_LOCATION_SERVICE_TIMER_MEDIUM + */ + function f_getLsRetransmitTimerMedium() return float { + var float v_itsGnLocationServiceRetransmitTimerMedium := int2float(PX_GN_LOCATION_SERVICE_TIMER_MEDIUM/1000); + + return v_itsGnLocationServiceRetransmitTimerMedium; + } + + /** + * @desc Gets the LS retransmission timer for NetRepInterval = maximum (cong. ctrl). + * @return LS retransmission timer (maximum) in seconds + * @see PX_GN_LOCATION_SERVICE_TIMER_MAXIMUM + */ + function f_getLsRetransmitTimerMaximum() return float { + var float v_itsGnLocationServiceRetransmitTimerMaximum := int2float(PX_GN_LOCATION_SERVICE_TIMER_MAXIMUM/1000); + + return v_itsGnLocationServiceRetransmitTimerMaximum; + } + + /** + * @desc Gets the App retransmission timer. Valid for AppRepInterval = default (cong. ctrl). + * @return App retransmission timer in seconds + * @see PX_GN_APPLICATION_RETRANSMIT_TIMER + */ + function f_getAppRetransmitTimer() return float { + var float v_itsGnLocationApplicationRetransmitTimer := int2float(PX_GN_APPLICATION_RETRANSMIT_TIMER/1000); + + return v_itsGnLocationApplicationRetransmitTimer; + } + + /** + * @desc Gets the App retransmission timer for AppRepInterval = medium (cong. ctrl). + * @return App retransmission timer (medium) in seconds + * @see PX_GN_APPLICATION_RETRANSMIT_TIMER_MEDIUM + */ + function f_getAppRetransmitTimerMedium() return float { + var float v_itsGnLocationApplicationRetransmitTimerMedium := int2float(PX_GN_APPLICATION_RETRANSMIT_TIMER_MEDIUM/1000); + + return v_itsGnLocationApplicationRetransmitTimerMedium; + } + + /** + * @desc Gets the App retransmission timer for AppRepInterval = maximum (cong. ctrl). + * @return App retransmission timer (maximum) in seconds + * @see PX_GN_APPLICATION_RETRANSMIT_TIMER_MAXIMUM + */ + function f_getAppRetransmitTimerMaximum() return float { + var float v_itsGnLocationApplicationRetransmitTimerMaximum := int2float(PX_GN_APPLICATION_RETRANSMIT_TIMER_MAXIMUM/1000); + + return v_itsGnLocationApplicationRetransmitTimerMaximum; + } + + /** + * @desc Gets the LS maximum retransmission number. + * @return LS maximum retransmission number + * @see PICS_GN_LOCATION_SERVICE_MAX_RETRANS + */ + function f_getLsMaxRetrans() return integer { + var integer v_itsGnLocationServiceMaxRetrans := PICS_GN_LOCATION_SERVICE_MAX_RETRANS; + + return v_itsGnLocationServiceMaxRetrans; + } + + /** + * @desc Gets the Application maximum retransmission number. + * @return Application maximum retransmission number + * @see PX_GN_APPLICATION_MAX_RETRANS + */ + function f_getAppMaxRetrans() return integer { + var integer v_itsGnApplicationMaxRetrans := PX_GN_APPLICATION_MAX_RETRANS; + + return v_itsGnApplicationMaxRetrans; + } + + /** + * @desc Gets the Location Service packet buffer size. + * @return Location Service packet buffer size in Kbytes + * @see PICS_GN_LOCATION_SERVICE_PACKET_BUFFER_SIZE + */ + function f_getLsPacketBufferSize() return integer { + var integer v_itsGnLocationServicePacketBufferSize := PICS_GN_LOCATION_SERVICE_PACKET_BUFFER_SIZE; + + return v_itsGnLocationServicePacketBufferSize; + } // end f_getLsPacketBufferSize + + /** + * @desc Gets the UC forwarding packet buffer size. + * @return UC forwarding packet buffer size in bytes + * @see PICS_GN_UC_FORWARDING_PACKET_BUFFER_SIZE + */ + function f_getUcForwardingPacketBufferSize() return integer { + var integer v_itsGnUcForwardingPacketBufferSize := PICS_GN_UC_FORWARDING_PACKET_BUFFER_SIZE; + + return v_itsGnUcForwardingPacketBufferSize * 1024; + } // end f_getUcForwardingPacketBufferSize + + /** + * @desc Gets the BC forwarding packet buffer size. + * @return BC forwarding packet buffer size in bytes + * @see PICS_GN_BC_FORWARDING_PACKET_BUFFER_SIZE + */ + function f_getBcForwardingPacketBufferSize() return integer { + var integer v_itsGnBcForwardingPacketBufferSize := PICS_GN_BC_FORWARDING_PACKET_BUFFER_SIZE; + + return v_itsGnBcForwardingPacketBufferSize * 1024; + } // end f_getBcForwardingPacketBufferSize + + /** + * @desc Gets the maximum lifetime of a packet. + * @return Maximum lifetime of a packet in seconds + * @see PICS_GN_MAX_PACKET_LIFETIME + */ + function f_getMaxPacketLifeTime() return float { + var float v_itsGnMaxPacketLifetime := int2float(PICS_GN_MAX_PACKET_LIFETIME); + + return v_itsGnMaxPacketLifetime; + } + + /** + * @desc Gets delta for timers. + * @return Delta for timers in seconds + * @see PX_T_DELTA + */ + function f_getDeltaTimer() return float { + var float v_deltaTimer := PX_T_DELTA; + + return v_deltaTimer; + } + + /** + * @desc Gets the beacon service retransmit timer. + * @return Beacon service retransmit timer + */ + function f_getBsRetransmitTimer() return float { + var float v_itsGnBeaconServiceRetransmitTimer; + + v_itsGnBeaconServiceRetransmitTimer := int2float( + (PICS_GN_BEACON_SERVICE_RETRANSMIT_TIMER/1000)); + + return v_itsGnBeaconServiceRetransmitTimer; + } + + /** + * @desc Gets the beacon service retransmit timer for NetBeaconInterval = medium (cong. ctrl). + * @return Beacon service retransmit timer (medium) + */ + function f_getBsRetransmitTimerMedium() return float { + var float v_itsGnBeaconServiceRetransmitTimerMedium; // timer value increased (medium) + + v_itsGnBeaconServiceRetransmitTimerMedium := int2float( + (PX_GN_BEACON_SERVICE_TIMER_MEDIUM+float2int((f_getBsMaxJitter() - 0.0 +1.0)*rnd()) + 0)/1000); + + return v_itsGnBeaconServiceRetransmitTimerMedium; + } + + /** + * @desc Gets the beacon service retransmit timer for NetBeaconInterval = maximum (cong. ctrl). + * @return Beacon service retransmit timer (maximum) + */ + function f_getBsRetransmitTimerMaximum() return float { + var float v_itsGnBeaconServiceRetransmitTimerMaximum; // timer value increased (maximum) + + v_itsGnBeaconServiceRetransmitTimerMaximum := int2float( + (PX_GN_BEACON_SERVICE_TIMER_MAXIMUM+float2int((f_getBsMaxJitter() - 0.0 +1.0)*rnd()) + 0)/1000); + + return v_itsGnBeaconServiceRetransmitTimerMaximum; + } + + /** + * @desc Gets the maximum beacon service jitter. + * @return Maximum beacon service jitter + */ + function f_getBsMaxJitter() return float { + var float v_itsGnBeaconServiceMaxJitter := int2float(PICS_GN_BEACON_SERVICE_MAX_JITTER)/1000.0; + + return v_itsGnBeaconServiceMaxJitter; + } + + /** + * @desc Gets the Lifetime of a Location Table Entry. + * @return Lifetime of a Location Table Entry in seconds + * @see PICS_GN_LIFETIME_LOC_TE + */ + function f_getLifetimeLocTableEntry() return float { + var float v_itsGnLifetimeLocTableEntry := int2float(PICS_GN_LIFETIME_LOC_TE); + + return v_itsGnLifetimeLocTableEntry; + } // end f_getLifetimeLocTableEntry + + /** + * @desc Gets the maximum communication range for CBF algorithm + * @return Maximum communication range for CBF algorithm in meters + * @see PICS_GN_DEFAULT_MAX_COMMUNICATION_RANGE + */ + function f_getCbfMaxCommunicationRange() return integer { + var integer v_maxCommunicationRange := PICS_GN_DEFAULT_MAX_COMMUNICATION_RANGE; + + return v_maxCommunicationRange; + } // end f_getCbfMaxCommunicationRange + + function f_getGeoUnicastCbfMaxTime() return integer { + var integer v_cbfMaxTime := PICS_GN_GEOUNICAST_CBF_MAX_TIME; + + return v_cbfMaxTime; + } // end f_getGeoUnicastCbfMaxTime + + function f_getGeoUnicastCbfMinTime() return integer { + var integer v_cbfMinTime := PICS_GN_GEOUNICAST_CBF_MIN_TIME; + + return v_cbfMinTime; + } // end f_getGeoUnicastCbfMinTime + + function f_getGeoBroadcastCbfMaxTime() return integer { + var integer v_cbfMaxTime := PICS_GN_GEOBROADCAST_CBF_MAX_TIME; + + return v_cbfMaxTime; + } // end f_getGeoBroadcastCbfMaxTime + + function f_getGeoBroadcastCbfMinTime() return integer { + var integer v_cbfMinTime := PICS_GN_GEOBROADCAST_CBF_MIN_TIME; + + return v_cbfMinTime; + } // end f_getGeoBroadcastCbfMinTime + + function f_getGnMaxAreaSize() return float { + var float v_maxAreaSize := PICS_GN_MAX_GEO_AREA_SIZE; + + return v_maxAreaSize; + } // end f_getGnMaxAreaSize + + function f_getAdvancedGbcForwardingMaxCounter() return integer { + var integer v_maxCounter := PICS_GN_ADVANCED_BC_FORWARDING_MAX_COUNTER; + + return v_maxCounter; + } + + /** + * @desc Set the number of neighbour in the Location Table. + * @see PX_MIN_NR_NEIGHBOUR + */ + function f_setNrNeighbourLocTableDefault() runs on ItsGeoNetworking { + var integer v_nrNeighbour := f_random (0, PX_MIN_NR_NEIGHBOUR); + + f_acStartBeaconingMultipleNeighbour(v_nrNeighbour); + + } // end f_setNrNeighbourLocTableDefault + + /** + * @desc Set the number of neighbour in the Location Table (medium). + * @see PX_MIN_NR_NEIGHBOUR + * @see PX_MAX_NR_NEIGHBOUR + */ + function f_setNrNeighbourLocTableMedium() runs on ItsGeoNetworking { + var integer v_nrNeighbour := f_random (PX_MIN_NR_NEIGHBOUR, PX_MAX_NR_NEIGHBOUR); + + f_acStartBeaconingMultipleNeighbour(v_nrNeighbour); + + } // end f_setNrNeighbourLocTableMedium + + /** + * @desc Set the number of neighbour in the Location Table (maximum). + * @see PX_MAX_NR_NEIGHBOUR + * @see PX_MIN_NR_NEIGHBOUR + */ + function f_setNrNeighbourLocTableMaximum() runs on ItsGeoNetworking { + var integer v_nrNeighbour := f_random (PX_MAX_NR_NEIGHBOUR, (2*PX_MIN_NR_NEIGHBOUR)); + + f_acStartBeaconingMultipleNeighbour(v_nrNeighbour); + + } // end f_setNrNeighbourLocTableMaximum + + } // end iutFunctions + + group posVectorFunctions { + + /** + * @desc Convert long position vector to short position vector + * @param p_longPosVector Long position vector to be converted + * @return Short position vector + */ + function f_longPosVector2ShortPosVector(in LongPosVector p_longPosVector) return ShortPosVector { + var ShortPosVector v_shortPosVector; + + v_shortPosVector := { + gnAddr := p_longPosVector.gnAddr, + timestamp_ := p_longPosVector.timestamp_, + latitude := p_longPosVector.latitude, + longitude := p_longPosVector.longitude + }; + + return v_shortPosVector; + } + + /** + * @desc Get IUT's long position vector + * @return IUT's long position vector + */ + function f_getIutLongPosVector() runs on ItsBaseGeoNetworking return LongPosVector { + return f_acGetLongPosVector(f_getIutGnLocalAddress()); + } + function f_getIutLongPosVector_1(inout LongPosVector p_longPosVectorIut) runs on ItsGeoNetworking { + p_longPosVectorIut := f_acGetLongPosVector(f_getIutGnLocalAddress()); + } + + /** + * @desc Get IUT's short position vector + * @return IUT's short position vector + */ + function f_getIutShortPosVector() runs on ItsGeoNetworking return ShortPosVector { + var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); + + if (not isbound(v_longPosVectorIut)) { + v_longPosVectorIut := f_getIutLongPosVector(); + } + return f_longPosVector2ShortPosVector(v_longPosVectorIut); + } + + /** + * @desc Compute a position using a reference position, a distance and an orientation + * @param p_iutLongPosVector Reference position + * @param p_distance Distance to the reference position (in meter) + * @param p_orientation direction of the computed position (0 to 359; 0 means North) + * @return LongPosVector + */ + function f_computePositionUsingDistance(in LongPosVector p_iutLongPosVector, in float p_distance, in integer p_orientation) + return LongPosVector { + var LongPosVector v_result := p_iutLongPosVector; + + log("*** f_computePositionUsingDistance: INFO: calling fx_computePositionUsingDistance() ***"); + fx_computePositionUsingDistance(p_iutLongPosVector.latitude, p_iutLongPosVector.longitude, p_distance, p_orientation, v_result.latitude, v_result.longitude); + + return v_result; + } + + } // end posVectorFunctions + + group externalFunctions { + + /** + * @desc External function to compute timestamp based on current time + * @return Unix-Epoch-Time mod 2^32 + */ + external function fx_computeGnTimestamp() return UInt32; + + } // End of group externalFunctions + + group security { + + /** + * @desc Waiting for the GN message with Security + * @param p_InSecMsg SecurityMessage template + * @param p_received returns received SecurityMessage + */ + altstep a_securedMessage ( + in template (present) EtsiTs103097Data p_InSecMsg, + out EtsiTs103097Data p_received + ) runs on ItsGeoNetworking { + var GeoNetworkingInd v_geoNw; + [] geoNetworkingPort.receive(mw_geoNwInd( + mw_geoNwSecPdu( + p_InSecMsg, + mw_geoNwAnyPacket_withPayload(?) + ))) -> value v_geoNw { + p_received := f_getSecuredMessage(v_geoNw.msgIn); + } + } // End of 'altstep' statement + + /** + * @desc Receive GN message with security containing certificate as a signer info + * @param p_cert returns the certificate used for sign received message + */ + altstep a_securedMessageWithCertificate( + out EtsiTs103097Data p_received + ) runs on ItsGeoNetworking { + + [] a_securedMessage ( + mw_etsiTs103097Data_signed( + mw_signedData( + -, + mw_toBeSignedData( + mw_signedDataPayload + ), + mw_signerIdentifier_certificate // containing certificate + ) + ), + p_received + ) { + // Nothing to do + } + } // End of altstep a_securedMessageWithCertificate + + /** + * @desc Receive GN message with security containing digest as a signer info + * @param p_cert returns the certificate used for sign received message + */ + altstep a_securedMessageWithDigest( + out EtsiTs103097Data p_received + ) runs on ItsGeoNetworking { + [] a_securedMessage ( + mw_etsiTs103097Data_signed( + mw_signedData( + -, + mw_toBeSignedData( + mw_signedDataPayload + ), + mw_signerIdentifier_digest // containing digest + ) + ), + p_received + ) { + // Nothing to do + } + } // End of altstep a_securedMessageWithDigest + + } // End of group altSteps + + group waitingHelpers { + + /** + * @desc Wait for GN message with security containing certificate as a signer info + * @return the certificate used for sign received message + */ + function f_waitForCertificate( + out EtsiTs103097Certificate p_cert + ) runs on ItsGeoNetworking return boolean { + var EtsiTs103097Data v_recv; + var boolean v_ret := false; + + alt { + [] a_securedMessageWithCertificate(v_recv) { + var SignerIdentifier v_signerIdentifier; + if (f_getMsgSignerIdentifier(v_recv, v_signerIdentifier) == true) { + if (ischosen(v_signerIdentifier.certificate)) { + p_cert := v_signerIdentifier.certificate[0]; + v_ret := true; + } + } + } + } // End of 'alt' statement + + return v_ret; + } // End of function f_waitForCertificate + + /** + * @desc Ask for the certificate chain and wait for GN message with security containing certificate chain as a signer info + * @return the certificate chain used for sign received message + */ + function f_askForCertificateChain (in template(value) octetstring p_CamPayload) + runs on ItsGeoNetworking + return boolean { + var EtsiTs103097Data v_recv; + var boolean v_ret := false; + + alt { + [] a_securedMessageWithCertificate(v_recv) { + var SignerIdentifier v_signerIdentifier; + if (f_getMsgSignerIdentifier(v_recv, v_signerIdentifier) == true) { // Get AT certificate + if(ischosen(v_signerIdentifier.digest)) { + f_sendCertificateRequest(v_signerIdentifier.digest, p_CamPayload); // Request issuer + if(tc_ac.running) { + tc_ac.stop; + tc_ac.start; + } + v_ret := true; + } + } + } + } + return v_ret; + } // End of function f_askForCertificateChain + + /** + * @desc Ask for the certificate chain and wait for GN message with security containing certificate chain as a signer info + * @return the certificate chain used for sign received message + */ + function f_askAndWaitForCertificateChain( + out SequenceOfCertificate p_chain, + in template(value) octetstring p_CamPayload + ) runs on ItsGeoNetworking return boolean { + // Local variables + var EtsiTs103097Data v_recv; + var SignerIdentifier v_signerIdentifier; + var boolean v_ret := false; + + f_askForCertificateChain(p_CamPayload); // Get AT certificate and request for the issuer + alt { + [] a_securedMessageWithCertificate(v_recv) { // Get AA certificate + tc_ac.stop; + + if (f_getMsgSignerIdentifier(v_recv, v_signerIdentifier) == true) { + p_chain := v_signerIdentifier.certificate; + } + } + } // End of 'alt' statement + + return v_ret; + } // End of function f_askAndWaitForCertificateChain + + /** + * @desc Send a CAM message with a certificate and wait the certificate chain request message + * @remark This function is used only for testing against another ATS + * @param p_certificate The certificate identifier + * @param p_CamPayload The CAM paylaod + * @return true on success, flase otherwise + */ + function f_sendCertificateAndWaitForCertificateChainRequest( + in charstring p_certificate, + in template(value) octetstring p_CamPayload + ) runs on ItsGeoNetworking return boolean { + // Local variables + var EtsiTs103097Data v_recv; + + f_sendCertificate(p_certificate, p_CamPayload); + /* FIXME To be reviewed alt { + [] a_securedMessage ( + mw_securedMessage( + superset( + mw_header_field_unrecognised_certificate + )), + v_recv + ) { + // Nothing to do + log("*** " & testcasename() & ": DEBUG: Receive certificate ***") + } + }*/ // End of 'alt' statement + + return true; + } // End of function f_sendCertificateAndWaitForCertificateChainRequest + + } // End of group waitingHelpers + + group CertRequests{ + + function f_sendCertificateRequest( + in template (value) HashedId8 p_digest, + in template (value) octetstring p_payload + ) runs on ItsGeoNetworking { + var GeoNetworkingReq v_gnReq; + var GnNonSecuredPacket v_gnNonSecuredPacket; + var template (value) ToBeSignedData v_toBeSignedData; + var template (value) EtsiTs103097Data v_securedMessage; + + // Build signed EtsiTs103097Data + v_gnNonSecuredPacket := valueof(m_geoNwShbPacket( + f_getPosition(c_compNodeC) // FIXME To be verified YANN + )); + // Add CAM payload + v_gnNonSecuredPacket.payload := valueof(p_payload); + + /* FIXME To be reviewed f_buildGnSecuredCam( + v_securedMessage, + m_payload_signed(bit2oct(encvalue(v_gnNonSecuredPacket))), + e_certificate, + { + m_header_field_unrecognised_certificate( + f_HashedId3FromHashedId8( + valueof(p_digest) + )) + }, + "" + ); + + // Build secured Gn packet + v_gnReq := valueof(m_geoNwReq_linkLayerBroadcast( + m_geoNwSecPdu( + v_gnNonSecuredPacket, + v_securedMessage + ) // End of template m_geoNwSecPdu + )); // End of template m_geoNwReq_linkLayerBroadcast + + // Send Message + f_sendGeoNetMessage(v_gnReq);*/ + + } // End of function f_sendCertificateRequest + + /** + * @desc Send a CAM message with a certificate + * @remark This function is used only for testing against another ATS + * @param p_certificate The certificate identifier + * @param p_CamPayload The CAM paylaod + * @return true on success, flase otherwise + * @see f_sendCertificateAndWaitForCertificateChainRequest + */ + function f_sendCertificate( + in charstring p_certificate, + in template (value) octetstring p_payload + ) runs on ItsGeoNetworking { + var GeoNetworkingReq v_gnReq; + var GnNonSecuredPacket v_gnNonSecuredPacket; + var template (value) ToBeSignedData v_toBeSignedData; + var template (value) EtsiTs103097Data v_securedMessage; + + // Build signed EtsiTs103097Data + /* FIXME To be reviewed v_gnNonSecuredPacket := valueof(m_geoNwShbPacket( + f_getPosition(c_compNodeC) // FIXME To be verified YANN + )); + // Add CAM payload + v_gnNonSecuredPacket.payload := valueof(p_payload); + + f_buildGnSecuredCam( + v_securedMessage, + m_payload_signed(bit2oct(encvalue(v_gnNonSecuredPacket))), + e_certificate, + -, + p_certificate + ); + + // Build secured Gn packet + v_gnReq := valueof(m_geoNwReq_linkLayerBroadcast( + m_geoNwSecPdu( + v_gnNonSecuredPacket, + v_securedMessage + ) // End of template m_geoNwSecPdu + )); // End of template m_geoNwReq_linkLayerBroadcast + + // Send Message + f_sendGeoNetMessage(v_gnReq);*/ + + } // End of function f_sendCertificate + + } // End of group CertRequests + + group messageGetters { + + /** + * @desc return EtsiTs103097Data field of GeoNetworking packet + * @param p_msg GeoNetworking packet + * @return the EtsiTs103097Data if any + */ + function f_getSecuredMessage(in GeoNetworkingPdu p_msg) + return EtsiTs103097Data { + return p_msg.gnPacket.securedMsg; + } + + } + +} // end LibItsGeoNetworking_Functions -- GitLab From f22a3664752f329b55e039705d81bc1c7d73ef16 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 6 Sep 2018 10:47:27 +0200 Subject: [PATCH 119/320] Bug fixed on multi-components support --- ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn index 1b88f93e..336906e0 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn @@ -320,6 +320,7 @@ module LibItsGeoNetworking_Functions { function f_cf03Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { // Variables + var LongPosVector v_longPosVectorIut := valueof(m_dummyLongPosVector); var PositionTable v_positionTable := {}; var GeoAreaTable v_areaTable := {}; var ItsGeoNetworking v_component; @@ -422,6 +423,7 @@ module LibItsGeoNetworking_Functions { function f_cf04Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { // Variables + var LongPosVector v_longPosVectorIut := valueof(m_dummyLongPosVector); var PositionTable v_positionTable := {}; var GeoAreaTable v_areaTable := {}; var ItsGeoNetworking v_component; @@ -520,6 +522,7 @@ module LibItsGeoNetworking_Functions { function f_cf05Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { // Variables + var LongPosVector v_longPosVectorIut := valueof(m_dummyLongPosVector); var PositionTable v_positionTable := {}; var GeoAreaTable v_areaTable := {}; var ItsGeoNetworking v_component; @@ -617,6 +620,7 @@ module LibItsGeoNetworking_Functions { function f_cf06Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { // Variables + var LongPosVector v_longPosVectorIut := valueof(m_dummyLongPosVector); var PositionTable v_positionTable := {}; var GeoAreaTable v_areaTable := {}; var ItsGeoNetworking v_component; @@ -714,6 +718,7 @@ module LibItsGeoNetworking_Functions { function f_cf07Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO mtc ItsMtc system ItsGeoNetworkingSystem */{ // Variables + var LongPosVector v_longPosVectorIut := valueof(m_dummyLongPosVector); var PositionTable v_positionTable := {}; var GeoAreaTable v_areaTable := {}; var ItsGeoNetworking v_component; -- GitLab From 10d0d81a0b08db8b53ae74072a528dd0333e4dd7 Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 7 Sep 2018 14:36:16 +0200 Subject: [PATCH 120/320] Bug fixed in CAM values --- .../LibItsCommon_ASN1_NamedNumbers.ttcn | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn b/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn index 8ccbb257..583041d8 100644 --- a/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn +++ b/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn @@ -14,13 +14,13 @@ module LibItsCommon_ASN1_NamedNumbers { const AccelerationConfidence AccelerationConfidence_outOfRange_ := 101; const AccelerationConfidence AccelerationConfidence_unavailable_ := 102; - const AccelerationControl AccelerationControl_brakePedalEngaged_ := '0000000'B; - const AccelerationControl AccelerationControl_gasPedalEngaged_ := '0000001'B; - const AccelerationControl AccelerationControl_emergencyBrakeEngaged_ := '0000010'B; - const AccelerationControl AccelerationControl_collisionWarningEngaged_ := '0000011'B; + const AccelerationControl AccelerationControl_brakePedalEngaged_ := '1000000'B; + const AccelerationControl AccelerationControl_gasPedalEngaged_ := '0100000'B; + const AccelerationControl AccelerationControl_emergencyBrakeEngaged_ := '0010000'B; + const AccelerationControl AccelerationControl_collisionWarningEngaged_ := '0001000'B; const AccelerationControl AccelerationControl_accEngaged_ := '0000100'B; - const AccelerationControl AccelerationControl_cruiseControlEngaged_ := '0000101'B; - const AccelerationControl AccelerationControl_speedLimiterEngaged_ := '0000110'B; + const AccelerationControl AccelerationControl_cruiseControlEngaged_ := '0000010'B; + const AccelerationControl AccelerationControl_speedLimiterEngaged_ := '0000001'B; const AltitudeValue AltitudeValue_referenceEllipsoidSurface_ := 0; const AltitudeValue AltitudeValue_oneCentimeter_ := 1; @@ -31,14 +31,14 @@ module LibItsCommon_ASN1_NamedNumbers { const CurvatureValue CurvatureValue_reciprocalOf1MeterRadiusToLeft_ := 30000; const CurvatureValue CurvatureValue_unavailable_ := 30001; - const ExteriorLights ExteriorLights_lowBeamHeadlightsOn_ := '00000000'B; - const ExteriorLights ExteriorLights_highBeamHeadlightsOn_ := '01000000'B; - const ExteriorLights ExteriorLights_leftTurnSignalOn_ := '00100000'B; - const ExteriorLights ExteriorLights_rightTurnSignalOn_ := '00010000'B; + const ExteriorLights ExteriorLights_lowBeamHeadlightsOn_ := '10000000'B; + const ExteriorLights ExteriorLights_highBeamHeadlightsOn_ := '01000000'B; + const ExteriorLights ExteriorLights_leftTurnSignalOn_ := '00100000'B; + const ExteriorLights ExteriorLights_rightTurnSignalOn_ := '00010000'B; const ExteriorLights ExteriorLights_daytimeRunningLightsOn_ := '00001000'B; - const ExteriorLights ExteriorLights_reverseLightOn_ := '00000100'B; - const ExteriorLights ExteriorLights_fogLightOn_ := '00000010'B; - const ExteriorLights ExteriorLights_parkingLightsOn_ := '00000001'B; + const ExteriorLights ExteriorLights_reverseLightOn_ := '00000100'B; + const ExteriorLights ExteriorLights_fogLightOn_ := '00000010'B; + const ExteriorLights ExteriorLights_parkingLightsOn_ := '00000001'B; const HeadingConfidence HeadingConfidence_withinZeroPointOneDegree_ := 1; -- GitLab From 6b43493f4e7f1329dbd2ba7bdfc7e7628ea400ec Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 12 Sep 2018 08:27:17 +0200 Subject: [PATCH 121/320] STF545: Update test case to push security staff in the Test System --- .../LibItsHttp_BinaryMessageBodyTypes.ttcn | 61 +++-- ttcn/Http/LibItsHttp_BinaryTemplates.ttcn | 88 +++--- ttcn/Pki/LibItsPki_Templates.ttcn | 253 ++++++++++-------- 3 files changed, 226 insertions(+), 176 deletions(-) mode change 100644 => 100755 ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn mode change 100644 => 100755 ttcn/Http/LibItsHttp_BinaryTemplates.ttcn mode change 100644 => 100755 ttcn/Pki/LibItsPki_Templates.ttcn diff --git a/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn b/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn old mode 100644 new mode 100755 index 61ba41cc..32ae11c7 --- a/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn +++ b/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn @@ -1,26 +1,35 @@ -/** - * @author ETSI / STF545 - * @version $URL$ - * $ID:$ - * @desc This module provides the custom binary types for ITS HTTP based protocols. - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - */ -module LibItsHttp_BinaryMessageBodyTypes { - - /** - * This file volontary contains a trivial declaration of the type BinaryBodu. - * In accordance with your TTCN-3 module LibItsHttp_XMLTypes, you have to change the BinaryBody typing. - */ - // TODO Add here your custom binary import - - type union BinaryBody { - // TODO Add here your custom variants - octetstring raw - } with { - variant "" - } - -} // End of LibItsHttp_BinaryMessageBodyTypes +/** + * @author ETSI / STF545 + * @version $URL$ + * $ID:$ + * @desc This module provides the custom binary types for ITS HTTP based protocols. + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + */ +module LibItsHttp_BinaryMessageBodyTypes { + + /** + * This file volontary contains a trivial declaration of the type BinaryBodu. + * In accordance with your TTCN-3 module LibItsHttp_XMLTypes, you have to change the BinaryBody typing. + */ + // TODO Add here your custom binary import + // LibIts + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + import from IEEE1609dot2 language "ASN.1:1997" all; + import from EtsiTs102941BaseTypes language "ASN.1:1997" all; + import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; + import from EtsiTs102941MessagesItss language "ASN.1:1997" all; + import from EtsiTs103097Module language "ASN.1:1997" all; + + type union BinaryBody { + // TODO Add here your custom variants + InnerEcRequest innerEcRequest, + InnerEcResponse innerEcResponse, + octetstring raw + } with { + variant "" + } + +} // End of LibItsHttp_BinaryMessageBodyTypes diff --git a/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn b/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn old mode 100644 new mode 100755 index dde677b8..fb46c0d6 --- a/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn +++ b/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn @@ -1,32 +1,56 @@ -/** - * @author ETSI / STF545 - * @version $URL$ - * $ID:$ - * @desc This module provides the custom templates for ITS HTTP based protocols. - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - */ -module LibItsHttp_BinaryTemplates { - - // LibItsHttp - import from LibItsHttp_BinaryMessageBodyTypes all; - - // TODO Add here your custom binary import - - template (value) BinaryBody m_binary_body_raw( - in template (value) octetstring p_raw - ) := { - raw := p_raw - } // End of template m_binary_body_raw - - template (present) BinaryBody mw_binary_body_raw( - template (present) octetstring p_raw := ? - ) := { - raw := p_raw - } // End of template mw_binary_body_raw - - // TODO Add here your custom binary template - -} // End of module LibItsHttp_BinaryTemplates +/** + * @author ETSI / STF545 + * @version $URL$ + * $ID:$ + * @desc This module provides the custom templates for ITS HTTP based protocols. + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + */ +module LibItsHttp_BinaryTemplates { + + // LibItsHttp + import from LibItsHttp_BinaryMessageBodyTypes all; + + // TODO Add here your custom binary import + // LibIts + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + import from IEEE1609dot2 language "ASN.1:1997" all; + import from EtsiTs102941BaseTypes language "ASN.1:1997" all; + import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; + import from EtsiTs102941MessagesItss language "ASN.1:1997" all; + import from EtsiTs103097Module language "ASN.1:1997" all; + + template (value) BinaryBody m_binary_body_raw( + in template (value) octetstring p_raw + ) := { + raw := p_raw + } // End of template m_binary_body_raw + + template (present) BinaryBody mw_binary_body_raw( + template (present) octetstring p_raw := ? + ) := { + raw := p_raw + } // End of template mw_binary_body_raw + + // TODO Add here your custom binary template + template (value) BinaryBody m_binary_body_innerEcRequest( + in template (value) InnerEcRequest p_innerEcRequest + ) := { + innerEcRequest := p_innerEcRequest + } // End of template m_binary_body_innerEcRequest + + template (present) BinaryBody mw_binary_body_innerEcRequest( + template (present) InnerEcRequest p_innerEcRequest := ? + ) := { + innerEcRequest := p_innerEcRequest + } // End of template mw_binary_body_innerEcRequest + + template (present) BinaryBody mw_binary_body_innerEcResponse( + template (present) InnerEcResponse p_innerEcResponse := ? + ) := { + innerEcResponse := p_innerEcResponse + } // End of template mw_binary_body_innerEcResponse + +} // End of module LibItsHttp_BinaryTemplates diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn old mode 100644 new mode 100755 index a7ba5390..f0b2daef --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ b/ttcn/Pki/LibItsPki_Templates.ttcn @@ -1,119 +1,136 @@ -/** - * @author ETSI / STF545 - * @version $URL$ - * $Id$ - * @desc Module containing templates for IT PKI Protocol - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsPki_Templates { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - import from LibItsCommon_Functions all; - import from LibItsCommon_TypesAndValues all; - import from LibItsCommon_ASN1_NamedNumbers all; - - // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; - import from EtsiTs102941BaseTypes language "ASN.1:1997" all; - import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; - import from EtsiTs102941MessagesItss language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; - - // LibItsSecurity - import from LibItsSecurity_Templates all; - - template (value) EnrolmentRequestMessage m_enrolmentRequestMessage( - in template (value) EncryptedData p_encryptedData - ) modifies m_etsiTs103097Data_encrypted := { - } // End of template m_enrolmentRequestMessage - - template (present) EnrolmentRequestMessage mw_enrolmentResponseMessage( - template (present) EncryptedData p_encryptedData := ? - ) modifies mw_etsiTs103097Data_encrypted := { - } // End of template mw_enrolmentResponseMessage - - template (value) EtsiTs102941DataContent m_enrolmentRequest( - in template (value) InnerEcRequestSignedForPop p_enrolmentRequest - ) := { - enrolmentRequest := p_enrolmentRequest - } // End of template m_enrolmentRequest - - template (present) EtsiTs102941DataContent mw_enrolmentResponse( - template (present) InnerEcResponse p_enrolmentResponse - ) := { - enrolmentResponse := p_enrolmentResponse - } // End of template mw_enrolmentResponse - - template (value) InnerEcRequest m_innerEcRequest( - in template (value) charstring p_itsId, - in template (value) PublicKeys p_publicKeys, - in template (value) CertificateSubjectAttributes p_requestedSubjectAttributes //(WITH COMPONENTS{certIssuePermissions ABSENT}), - ) := { - itsId := p_itsId, - certificateFormat := 1, - publicKeys := p_publicKeys, - requestedSubjectAttributes := p_requestedSubjectAttributes - } // End of template m_innerEcRequest - - template (omit) PublicKeys m_publicKeys( - in template (value) PublicVerificationKey p_verificationKey, - in template (omit) PublicEncryptionKey p_encryptionKey := omit - ) := { - verificationKey := p_verificationKey, - encryptionKey := p_encryptionKey - } // End of template m_publicKeys - - template PublicKeys mw_publicKeys( - template (present) PublicVerificationKey p_verificationKey := ?, - template PublicEncryptionKey p_encryptionKey := * - ) := { - verificationKey := p_verificationKey, - encryptionKey := p_encryptionKey - } // End of template mw_publicKeys - - template (omit) CertificateSubjectAttributes m_certificateSubjectAttributes( - in template (value) SequenceOfPsidSsp p_appPermissions, - in template (omit) ValidityPeriod p_validityPeriod := omit, - in template (omit) GeographicRegion p_region := omit, - in template (omit) SubjectAssurance p_assuranceLevel := omit - ) := { - id := { none_ := NULL }, - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := omit - } // End of template m_certificateSubjectAttributes - - template (value) InnerEcResponse m_innerEcResponse_ok( - in template (value) Oct16 p_requestHash, - in template (value) EtsiTs103097Certificate p_certificate - ) := { - requestHash := p_requestHash, - responseCode := ok, - certificate := p_certificate - } // End of template m_innerEcResponse - - template (value) InnerEcResponse m_innerEcResponse_ko( - in template (value) Oct16 p_requestHash, - in template (value) EnrolmentResponseCode p_responseCode - ) := { - requestHash := p_requestHash, - responseCode := p_responseCode, - certificate := omit - } // End of template m_innerEcResponse - - - - +/** + * @author ETSI / STF545 + * @version $URL$ + * $Id$ + * @desc Module containing templates for IT PKI Protocol + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * + */ +module LibItsPki_Templates { + + // LibCommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; + + // LibItsCommon + import from LibItsCommon_TypesAndValues all; + import from LibItsCommon_Functions all; + import from LibItsCommon_TypesAndValues all; + import from LibItsCommon_ASN1_NamedNumbers all; + + // LibIts + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + import from IEEE1609dot2 language "ASN.1:1997" all; + import from EtsiTs102941BaseTypes language "ASN.1:1997" all; + import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; + import from EtsiTs102941MessagesItss language "ASN.1:1997" all; + import from EtsiTs103097Module language "ASN.1:1997" all; + + // LibItsSecurity + import from LibItsSecurity_Templates all; + + template (value) EnrolmentRequestMessage m_enrolmentRequestMessage( + in template (value) EncryptedData p_encryptedData + ) modifies m_etsiTs103097Data_encrypted := { + } // End of template m_enrolmentRequestMessage + + template (present) EnrolmentRequestMessage mw_enrolmentResponseMessage( + template (present) EncryptedData p_encryptedData := ? + ) modifies mw_etsiTs103097Data_encrypted := { + } // End of template mw_enrolmentResponseMessage + + template (value) EtsiTs102941DataContent m_enrolmentRequest( + in template (value) InnerEcRequestSignedForPop p_enrolmentRequest + ) := { + enrolmentRequest := p_enrolmentRequest + } // End of template m_enrolmentRequest + + template (present) EtsiTs102941DataContent mw_enrolmentResponse( + template (present) InnerEcResponse p_enrolmentResponse + ) := { + enrolmentResponse := p_enrolmentResponse + } // End of template mw_enrolmentResponse + + template (value) InnerEcRequest m_innerEcRequest( + in template (value) charstring p_itsId, + in template (value) PublicKeys p_publicKeys, + in template (value) CertificateSubjectAttributes p_requestedSubjectAttributes //(WITH COMPONENTS{certIssuePermissions ABSENT}), + ) := { + itsId := p_itsId, + certificateFormat := 1, + publicKeys := p_publicKeys, + requestedSubjectAttributes := p_requestedSubjectAttributes + } // End of template m_innerEcRequest + + template (omit) PublicKeys m_publicKeys( + in template (value) PublicVerificationKey p_verificationKey, + in template (omit) PublicEncryptionKey p_encryptionKey := omit + ) := { + verificationKey := p_verificationKey, + encryptionKey := p_encryptionKey + } // End of template m_publicKeys + + template PublicKeys mw_publicKeys( + template (present) PublicVerificationKey p_verificationKey := ?, + template PublicEncryptionKey p_encryptionKey := * + ) := { + verificationKey := p_verificationKey, + encryptionKey := p_encryptionKey + } // End of template mw_publicKeys + + template (omit) CertificateSubjectAttributes m_certificateSubjectAttributes( + in template (value) SequenceOfPsidSsp p_appPermissions, + in template (omit) ValidityPeriod p_validityPeriod := omit, + in template (omit) GeographicRegion p_region := omit, + in template (omit) SubjectAssurance p_assuranceLevel := omit + ) := { + id := { none_ := NULL }, + validityPeriod := p_validityPeriod, + region := p_region, + assuranceLevel := p_assuranceLevel, + appPermissions := p_appPermissions, + certIssuePermissions := omit + } // End of template m_certificateSubjectAttributes + + template (value) InnerEcResponse m_innerEcResponse_ok( + in template (value) Oct16 p_requestHash, + in template (value) EtsiTs103097Certificate p_certificate + ) := { + requestHash := p_requestHash, + responseCode := ok, + certificate := p_certificate + } // End of template m_innerEcResponse_ok + + template (present) InnerEcResponse mw_innerEcResponse_ok( + template (present) Oct16 p_requestHash := ?, + template (present) EtsiTs103097Certificate p_certificate := ? + ) := { + requestHash := p_requestHash, + responseCode := ok, + certificate := p_certificate + } // End of template mw_innerEcResponse_ok + + template (value) InnerEcResponse m_innerEcResponse_ko( + in template (value) Oct16 p_requestHash, + in template (value) EnrolmentResponseCode p_responseCode + ) := { + requestHash := p_requestHash, + responseCode := p_responseCode, + certificate := omit + } // End of template m_innerEcResponse_ko + + template (present) InnerEcResponse mw_innerEcResponse_ko( + template (present) Oct16 p_requestHash := ?, + template (present) EnrolmentResponseCode p_responseCode := complement(ok) + ) := { + requestHash := p_requestHash, + responseCode := p_responseCode, + certificate := * + } // End of template mw_innerEcResponse_ko + + + } // End of module LibItsPki_Templates \ No newline at end of file -- GitLab From 00f08fdf2fa8be4f21163899b4b419868d85011e Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 12 Sep 2018 08:27:46 +0200 Subject: [PATCH 122/320] STF545: Update test case to push security staff in the Test System --- ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn | 0 ttcn/Http/LibItsHttp_BinaryTemplates.ttcn | 0 ttcn/Pki/LibItsPki_Templates.ttcn | 0 3 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn mode change 100755 => 100644 ttcn/Http/LibItsHttp_BinaryTemplates.ttcn mode change 100755 => 100644 ttcn/Pki/LibItsPki_Templates.ttcn diff --git a/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn b/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn old mode 100755 new mode 100644 diff --git a/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn b/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn old mode 100755 new mode 100644 diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn old mode 100755 new mode 100644 -- GitLab From 2055629d7adf57e8db4ca1d3fb69abd2e2fc6a40 Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 14 Sep 2018 13:54:32 +0200 Subject: [PATCH 123/320] STF545: Review first test --- ttcn/Http/LibItsHttp_Pics.ttcn | 2 +- ttcn/Pki/LibItsPki_TestSystem.ttcn | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ttcn/Http/LibItsHttp_Pics.ttcn b/ttcn/Http/LibItsHttp_Pics.ttcn index 04bd2757..d9aaa7e7 100644 --- a/ttcn/Http/LibItsHttp_Pics.ttcn +++ b/ttcn/Http/LibItsHttp_Pics.ttcn @@ -8,6 +8,6 @@ module LibItsHttp_Pics { /** * @desc */ - modulepar charstring PICS_HEADER_CONTENT_TYPE := "application/held+xml;charset=utf-8"; + modulepar charstring PICS_HEADER_CONTENT_TYPE := "application/x-its-request"; } // End of module LibItsHttp_Pics diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index 721ba1de..2ee844e0 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -22,18 +22,19 @@ module LibItsPki_TestSystem { import from EtsiTs102941MessagesItss language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; - // LibItsGeoNetworking - import from LibItsGeoNetworking_TestSystem all; + // LibCam + import from LibItsCam_TestSystem all; // LibItsHttp import from LibItsHttp_TestSystem all; - type component ItsPkiSystem extends ItsGeoNetworkingSystem { + type component ItsPkiSystem extends ItsCamSystem { port HttpPort httpPort; } // End of component ItsPkiSystem - type component ItsPki extends ItsGeoNetworking { + type component ItsPki extends ItsCam { port HttpPort httpPort; + } // End of component ItsPki } // End of module LibItsPki_TestSystem -- GitLab From 49185ba3951b19fa93a3ef5735d678b18c526319 Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 21 Sep 2018 14:24:42 +0200 Subject: [PATCH 124/320] STF545: Review first test --- ttcn/Pki/LibItsPki_TestSystem.ttcn | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index 2ee844e0..b23300f1 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -22,6 +22,9 @@ module LibItsPki_TestSystem { import from EtsiTs102941MessagesItss language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; + // LibSecurity + import from LibItsSecurity_TestSystem all; + // LibCam import from LibItsCam_TestSystem all; @@ -32,7 +35,12 @@ module LibItsPki_TestSystem { port HttpPort httpPort; } // End of component ItsPkiSystem - type component ItsPki extends ItsCam { + type component ItsPkiItss extends ItsCam, ItsSecurityBaseComponent { + port HttpPort httpPort; + + } // End of component ItsPkiItss + + type component ItsPki extends ItsBaseComponent, ItsSecurityBaseComponent { port HttpPort httpPort; } // End of component ItsPki -- GitLab From cd7aba32ec08161c0d3171606189f8b33eabed7b Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Tue, 2 Oct 2018 08:28:42 +0200 Subject: [PATCH 125/320] STF545: reorganise ports & tests --- .../LibItsHttp_BinaryMessageBodyTypes.ttcn | 5 +- ttcn/Http/LibItsHttp_BinaryTemplates.ttcn | 35 +++++---- ttcn/Http/LibItsHttp_TestSystem.ttcn | 25 ++++--- ttcn/Pki/LibItsPki_TestSystem.ttcn | 72 ++++++++++++------- 4 files changed, 84 insertions(+), 53 deletions(-) diff --git a/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn b/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn index 32ae11c7..0441c828 100644 --- a/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn +++ b/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn @@ -25,8 +25,9 @@ module LibItsHttp_BinaryMessageBodyTypes { type union BinaryBody { // TODO Add here your custom variants - InnerEcRequest innerEcRequest, - InnerEcResponse innerEcResponse, +// InnerEcRequest innerEcRequest, Move to PkiPort +// InnerEcResponse innerEcResponse, + Ieee1609Dot2Data ieee1609dot2_data octetstring raw } with { variant "" diff --git a/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn b/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn index fb46c0d6..bb655d7a 100644 --- a/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn +++ b/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn @@ -35,22 +35,29 @@ module LibItsHttp_BinaryTemplates { } // End of template mw_binary_body_raw // TODO Add here your custom binary template - template (value) BinaryBody m_binary_body_innerEcRequest( - in template (value) InnerEcRequest p_innerEcRequest + template (value) BinaryBody m_binary_body_ieee1609dot2_data( + in template (value) Ieee1609Dot2Data p_ieee1609dot2_data ) := { - innerEcRequest := p_innerEcRequest - } // End of template m_binary_body_innerEcRequest + ieee1609dot2_data := p_ieee1609dot2_data + } // End of template m_binary_body_ieee1609dot2_data - template (present) BinaryBody mw_binary_body_innerEcRequest( - template (present) InnerEcRequest p_innerEcRequest := ? + template (present) BinaryBody mw_binary_body_ieee1609dot2_data( + template (present) Ieee1609Dot2Data p_ieee1609dot2_data := ? ) := { - innerEcRequest := p_innerEcRequest - } // End of template mw_binary_body_innerEcRequest - - template (present) BinaryBody mw_binary_body_innerEcResponse( - template (present) InnerEcResponse p_innerEcResponse := ? - ) := { - innerEcResponse := p_innerEcResponse - } // End of template mw_binary_body_innerEcResponse + ieee1609dot2_data := p_ieee1609dot2_data + } // End of template mw_binary_body_ieee1609dot2_data + // Move to Pki +// template (present) BinaryBody mw_binary_body_innerEcRequest( +// template (present) InnerEcRequest p_innerEcRequest := ? +// ) := { +// innerEcRequest := p_innerEcRequest +// } // End of template mw_binary_body_innerEcRequest +// +// template (present) BinaryBody mw_binary_body_innerEcResponse( +// template (present) InnerEcResponse p_innerEcResponse := ? +// ) := { +// innerEcResponse := p_innerEcResponse +// } // End of template mw_binary_body_innerEcResponse +// } // End of module LibItsHttp_BinaryTemplates diff --git a/ttcn/Http/LibItsHttp_TestSystem.ttcn b/ttcn/Http/LibItsHttp_TestSystem.ttcn index 69e02713..acbfdf75 100644 --- a/ttcn/Http/LibItsHttp_TestSystem.ttcn +++ b/ttcn/Http/LibItsHttp_TestSystem.ttcn @@ -1,12 +1,12 @@ /** * @author ETSI / STF545 * @version $URL$ - * $ID:$ + * $ID:$ * @desc This module provides the test system used by ITS HTTP based protocols. * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. * @see ETSI TS 103 478 */ module LibItsHttp_TestSystem { @@ -15,20 +15,25 @@ module LibItsHttp_TestSystem { import from LibCommon_Sync all; import from LibCommon_Time all; + // LibItsCommon + import from LibItsCommon_TestSystem all; + import from LibItsCommon_TypesAndValues all; + import from LibItsExternal_TypesAndValues all; + // LibItsHttp import from LibItsHttp_TypesAndValues all; type port HttpPort message { - inout HttpMessage; + inout HttpMessage; } - type component HttpComponent extends SelfSyncComp { + type component HttpComponent extends SelfSyncComp { // FIXME To be rename into HttpTest port HttpPort httpPort; timer tc_ac := PX_TAC; } // End of component HttpComponent - type component HttpTestAdapter { - port HttpPort httpPort; - } // End of component TestAdapter - + type component HttpTestAdapter { // FIXME To be rename into HttpTestSystem + port HttpPort httpPort; + } // End of component TestAdapter + } // End of module LibItsHttp_TestSystem diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index 2ee844e0..f0e87e59 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -10,31 +10,49 @@ * */ module LibItsPki_TestSystem { - - // LibItsCommon - import from LibItsCommon_TestSystem all; - - // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; - import from EtsiTs102941BaseTypes language "ASN.1:1997" all; - import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; - import from EtsiTs102941MessagesItss language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; - - // LibCam - import from LibItsCam_TestSystem all; - - // LibItsHttp - import from LibItsHttp_TestSystem all; - - type component ItsPkiSystem extends ItsCamSystem { - port HttpPort httpPort; - } // End of component ItsPkiSystem - - type component ItsPki extends ItsCam { - port HttpPort httpPort; - - } // End of component ItsPki - + + // LibCommon + import from LibCommon_Sync all; + import from LibCommon_Time all; + + // LibItsCommon + import from LibItsCommon_TestSystem all; + import from LibItsCommon_TypesAndValues all; + import from LibItsExternal_TypesAndValues all; + + // LibIts + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + import from IEEE1609dot2 language "ASN.1:1997" all; + import from EtsiTs102941BaseTypes language "ASN.1:1997" all; + import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; + import from EtsiTs102941MessagesItss language "ASN.1:1997" all; + import from EtsiTs103097Module language "ASN.1:1997" all; + + // LibItsSecurity + import from LibItsSecurity_TestSystem all; + + // LibItsGeoNetworking + import from LibItsGeoNetworking_TestSystem all; + + // LibItsHttp + import from LibItsHttp_TestSystem all; + + type component ItsPkiSystem { + port HttpPort httpPort; + } // End of component ItsPkiSystem + + type component ItsPkiSystemItss extends ItsPkiSystem { + port LibItsGeoNetworking_TestSystem.AdapterControlPort acPort; + port LibItsGeoNetworking_TestSystem.UpperTesterPort utPort; + port GeoNetworkingPort geoNetworkingPort; + } // End of component ItsPkiSystemItss + + type component ItsPki extends ItsSecurityBaseComponent, ItsBaseMtc { + port HttpPort httpPort; + } // End of component ItsPki + + type component ItsPkiItss extends ItsGeoNetworking { + port HttpPort httpPort; + } // End of component ItsPkiItss + } // End of module LibItsPki_TestSystem -- GitLab From 56d65ed3c8413efdfdd01fc6c6bcb1df5263fa65 Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Fri, 5 Oct 2018 13:34:31 +0200 Subject: [PATCH 126/320] Review Pki Test System --- .../LibItsHttp_BinaryMessageBodyTypes.ttcn | 4 +- ttcn/Http/LibItsHttp_Functions.ttcn | 104 ++++++++++++------ ttcn/Pki/LibItsPki_Templates.ttcn | 2 +- ttcn/Pki/LibItsPki_TestSystem.ttcn | 27 +++-- ttcn/Security/LibItsSecurity_Functions.ttcn | 3 + ttcn/Security/LibItsSecurity_Templates.ttcn | 5 + 6 files changed, 103 insertions(+), 42 deletions(-) diff --git a/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn b/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn index 0441c828..80058604 100644 --- a/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn +++ b/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn @@ -25,9 +25,7 @@ module LibItsHttp_BinaryMessageBodyTypes { type union BinaryBody { // TODO Add here your custom variants -// InnerEcRequest innerEcRequest, Move to PkiPort -// InnerEcResponse innerEcResponse, - Ieee1609Dot2Data ieee1609dot2_data + Ieee1609Dot2Data ieee1609dot2_data, octetstring raw } with { variant "" diff --git a/ttcn/Http/LibItsHttp_Functions.ttcn b/ttcn/Http/LibItsHttp_Functions.ttcn index e7894d0a..72a51320 100644 --- a/ttcn/Http/LibItsHttp_Functions.ttcn +++ b/ttcn/Http/LibItsHttp_Functions.ttcn @@ -1,40 +1,82 @@ module LibItsHttp_Functions { + // LibCommon + import from LibCommon_Time all; + import from LibCommon_VerdictControl all; + import from LibCommon_Sync all; + // LibHttp import from LibItsHttp_TypesAndValues all; import from LibItsHttp_Pics all; + import from LibItsHttp_TestSystem all; - function f_init_default_headers_list( - out HeaderLines p_headers - ) { - p_headers[0] := { c_header_host, { PICS_HEADER_HOST } }; - p_headers[1] := { c_header_content_type, { PICS_HEADER_CONTENT_TYPE } }; - p_headers[2] := { c_header_content_length, { "0" } }; - p_headers[3] := { c_header_connection, { "keep-alive" } }; - p_headers[4] := { c_header_pragma, { "no-cache" } }; - p_headers[5] := { c_header_cache_control, { "no-cache" } }; - - } // End of function f_init_default_headers_list + group http_preambles { + + /** + * @desc Setups default configuration + * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT + */ + function f_cfUp( + in charstring p_certificateId + ) runs on HttpComponent /* TITAN TODO: system HttpTestAdapter */ { + + map(self:httpPort, system:httpPort); + f_connect4SelfOrClientSync(); + + } // End of function f_cfUp + + } // End of group http_preambles - function f_remove_headears_list( - in charstring_list p_headers_to_remove, - inout HeaderLines p_headers - ) { - // Sanity checks - if (lengthof(p_headers_to_remove) == 0) { - return; - } else if (lengthof(p_headers) == 0) { - return; - } - - for (var integer v_idx := 0; v_idx < lengthof(p_headers_to_remove); v_idx := v_idx + 1) { + group http_postambles { + + /** + * @desc Deletes default configuration + */ + function f_cfDown() runs on HttpComponent /* TITAN TODO: system HttpTestAdapter */ { - for (var integer v_jdx := 0; v_jdx < lengthof(p_headers); v_jdx := v_jdx + 1) { - if (p_headers[v_jdx].header_name == p_headers_to_remove[v_idx]) { - p_headers[v_jdx].header_value := omit; // NOTE Codec won't encode it - } - } // End of 'for' statement - - } // End of 'for' statement - } // End of function f_init_default_headers_list + unmap(self:httpPort, system:httpPort); + f_disconnect4SelfOrClientSync(); + + } // End of function f_cfDown + + } // End of group http_postambles + + group http_headers { + + function f_init_default_headers_list( + out HeaderLines p_headers + ) { + p_headers[0] := { c_header_host, { PICS_HEADER_HOST } }; + p_headers[1] := { c_header_content_type, { PICS_HEADER_CONTENT_TYPE } }; + p_headers[2] := { c_header_content_length, { "0" } }; + p_headers[3] := { c_header_connection, { "keep-alive" } }; + p_headers[4] := { c_header_pragma, { "no-cache" } }; + p_headers[5] := { c_header_cache_control, { "no-cache" } }; + + } // End of function f_init_default_headers_list + + function f_remove_headears_list( + in charstring_list p_headers_to_remove, + inout HeaderLines p_headers + ) { + // Sanity checks + if (lengthof(p_headers_to_remove) == 0) { + return; + } else if (lengthof(p_headers) == 0) { + return; + } + + for (var integer v_idx := 0; v_idx < lengthof(p_headers_to_remove); v_idx := v_idx + 1) { + + for (var integer v_jdx := 0; v_jdx < lengthof(p_headers); v_jdx := v_jdx + 1) { + if (p_headers[v_jdx].header_name == p_headers_to_remove[v_idx]) { + p_headers[v_jdx].header_value := omit; // NOTE Codec won't encode it + } + } // End of 'for' statement + + } // End of 'for' statement + } // End of function f_init_default_headers_list + + } // End of group http_headers + } // End of module LibItsHttp_Functions diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn index f0b2daef..b325f2a8 100644 --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ b/ttcn/Pki/LibItsPki_Templates.ttcn @@ -49,7 +49,7 @@ module LibItsPki_Templates { } // End of template m_enrolmentRequest template (present) EtsiTs102941DataContent mw_enrolmentResponse( - template (present) InnerEcResponse p_enrolmentResponse + template (present) InnerEcResponse p_enrolmentResponse := ? ) := { enrolmentResponse := p_enrolmentResponse } // End of template mw_enrolmentResponse diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index f0e87e59..297bcefe 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -28,31 +28,44 @@ module LibItsPki_TestSystem { import from EtsiTs102941MessagesItss language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; + // LibItsHttp + import from LibItsHttp_TestSystem all; + // LibItsSecurity import from LibItsSecurity_TestSystem all; // LibItsGeoNetworking import from LibItsGeoNetworking_TestSystem all; - // LibItsHttp - import from LibItsHttp_TestSystem all; + type port PkiPort message { + inout InnerEcRequest, InnerEcResponse; + } type component ItsPkiSystem { - port HttpPort httpPort; + port PkiPort pkiPort; } // End of component ItsPkiSystem - type component ItsPkiSystemItss extends ItsPkiSystem { + type component ItsPkiHttpSystem extends HttpTestAdapter{ + } // End of component ItsPkiHttpSystem + + type component ItsPkiItssSystem extends ItsPkiSystem { port LibItsGeoNetworking_TestSystem.AdapterControlPort acPort; port LibItsGeoNetworking_TestSystem.UpperTesterPort utPort; port GeoNetworkingPort geoNetworkingPort; - } // End of component ItsPkiSystemItss + } // End of component ItsPkiItssSystem type component ItsPki extends ItsSecurityBaseComponent, ItsBaseMtc { - port HttpPort httpPort; + port PkiPort pkiPort; + + var Certificate vc_eaCertificate; /** Test Adapter EA certificate */ + } // End of component ItsPki + + type component ItsPkiHttp extends ItsSecurityBaseComponent, HttpComponent { + var Certificate vc_eaCertificate; /** Test Adapter EA certificate */ } // End of component ItsPki type component ItsPkiItss extends ItsGeoNetworking { - port HttpPort httpPort; + port PkiPort pkiPort; } // End of component ItsPkiItss } // End of module LibItsPki_TestSystem diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index b8d92dbd..2ec106ae 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -2359,6 +2359,9 @@ module LibItsSecurity_Functions { */ external function fx_signWithEcdsaNistp256WithSha256(in octetstring p_toBeSignedSecuredMessage, in Oct32 p_certificateIssuer, in Oct32 p_privateKey) return octetstring; + external function fx_signWithEcdsaNistp256WithSha256_1(in octetstring p_toBeSignedSecuredMessage, in EccP256CurvePoint p_curve_point, in Oct32 p_privateKey) return octetstring; + external function fx_signWithEcdsaBrainpoolp256WithSha256_1(in octetstring p_toBeSignedSecuredMessage, in EccP256CurvePoint p_curve_point, in Oct32 p_privateKey) return octetstring; + /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature * @param p_toBeSignedSecuredMessage The data to be signed diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index 977ac5a0..19071299 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -1005,6 +1005,11 @@ module LibItsSecurity_Templates { requestedCertificate := * } // End of template mw_headerInfo_gn + template (omit) HeaderInfo m_headerInfo_inner_ec_request( + in template (value) Psid p_psid := c_its_aid_GN, + in template (value) Time64 p_generationTime + ) modifies m_ieee1609Dot2_headerInfo := {}; + } // End of group headerFields group signatures { -- GitLab From 900b6d5f5956906f70e1906964535341384c9d1d Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 8 Oct 2018 08:34:33 +0200 Subject: [PATCH 127/320] STF545: Execute first EA tests --- ttcn/Security/LibItsSecurity_Functions.ttcn | 12 +++++++++--- ttcn/Security/LibItsSecurity_Pics.ttcn | 8 +++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 2ec106ae..2aba4e45 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -587,6 +587,15 @@ module LibItsSecurity_Functions { out Oct32 p_publicKeyCompressed, out integer p_compressedMode ) return boolean { + if (PICS_SEC_FIXED_KEYS) { + p_privateKey := 'F8EB15C001A03623A5B5E44D73869621877710712A498C98FF9E60EE10F390F8'O; + p_publicKeyX := '7029A9B20D22AE37B1344B7FCC2322C8F1E5ECE09C39CC289E500A9487298B9B'O; + p_publicKeyY := 'F9EFA8BCC4129BC43B640566A59AE5CED7106BBA76E5DC828AF37D315634D3DC'O; + p_publicKeyCompressed := '7029A9B20D22AE37B1344B7FCC2322C8F1E5ECE09C39CC289E500A9487298B9B'O; + p_compressedMode := 0; + + return true; + } return fx_generateKeyPair_nistp256(p_privateKey, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressedMode); } @@ -2359,9 +2368,6 @@ module LibItsSecurity_Functions { */ external function fx_signWithEcdsaNistp256WithSha256(in octetstring p_toBeSignedSecuredMessage, in Oct32 p_certificateIssuer, in Oct32 p_privateKey) return octetstring; - external function fx_signWithEcdsaNistp256WithSha256_1(in octetstring p_toBeSignedSecuredMessage, in EccP256CurvePoint p_curve_point, in Oct32 p_privateKey) return octetstring; - external function fx_signWithEcdsaBrainpoolp256WithSha256_1(in octetstring p_toBeSignedSecuredMessage, in EccP256CurvePoint p_curve_point, in Oct32 p_privateKey) return octetstring; - /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature * @param p_toBeSignedSecuredMessage The data to be signed diff --git a/ttcn/Security/LibItsSecurity_Pics.ttcn b/ttcn/Security/LibItsSecurity_Pics.ttcn index 007ec3f4..57257853 100644 --- a/ttcn/Security/LibItsSecurity_Pics.ttcn +++ b/ttcn/Security/LibItsSecurity_Pics.ttcn @@ -98,5 +98,11 @@ module LibItsSecurity_Pics { * Does the IUT support encryption data? */ modulepar boolean PICS_SEC_ENCRYPTION_SUPPORT := true; + + /** + * @desc Generate fixed private/public keys. + Used for debug only + */ + modulepar boolean PICS_SEC_FIXED_KEYS := true; -} // End of module LibItsSecurity_Pics \ No newline at end of file +} // End of module LibItsSecurity_Pics -- GitLab From aabcd1ceff5219dc4d53fda9db26d841e2dd6673 Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Mon, 8 Oct 2018 12:59:53 +0200 Subject: [PATCH 128/320] Review Pki Test System --- ttcn/Pki/LibItsPki_Functions.ttcn | 277 +++++++++++++++++++++++++ ttcn/Security/LibItsSecurity_Pics.ttcn | 2 +- 2 files changed, 278 insertions(+), 1 deletion(-) create mode 100644 ttcn/Pki/LibItsPki_Functions.ttcn diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn new file mode 100644 index 00000000..7edf9280 --- /dev/null +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -0,0 +1,277 @@ +/** + * @author ETSI / STF544 + * @version $URL$ + * $Id$ + * @desc Module containing functions for ITS PKI ATS + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * + */ +module LibItsPki_Functions { + + // LibCommon + import from LibCommon_Time all; + import from LibCommon_VerdictControl all; + import from LibCommon_Sync all; + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; + + // LibIts + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + import from IEEE1609dot2 language "ASN.1:1997" all; + import from EtsiTs102941BaseTypes language "ASN.1:1997" all; + import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; + import from EtsiTs102941MessagesItss language "ASN.1:1997" all; + import from EtsiTs103097Module language "ASN.1:1997" all; + import from ITS_Container language "ASN.1:1997" all; + import from CAM_PDU_Descriptions language "ASN.1:1997" all; + + // LibItsCommon + import from LibItsCommon_TestSystem all; + import from LibItsCommon_Functions all; + import from LibItsCommon_ASN1_NamedNumbers all; + import from LibItsCommon_Pixits all; + + // LibItsSecurity + import from LibItsSecurity_TypesAndValues all; + import from LibItsSecurity_Templates all; + import from LibItsSecurity_Functions all; + import from LibItsSecurity_Pixits all; + + // LibItsHttp + import from LibItsHttp_TypesAndValues all; + import from LibItsHttp_TestSystem all; + + // LibItsPki + import from LibItsPki_Templates all; + import from LibItsPki_TestSystem all; + + group pkiConfigurationFunctions { + + /** + * @desc Setups default configuration + * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT + */ + function f_cfUp( + in charstring p_certificateId := "CERT_TS_A_EA" // TODO Use a constant + ) runs on ItsPki /* TITAN TODO: system ItsPkiSystem */ { + + map(self:pkiPort, system:pkiPort); + f_connect4SelfOrClientSync(); + + if( not f_loadCertificates(PX_IUT_SEC_CONFIG_NAME) ) { + log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); + stop; + } + + f_prepareCertificates(p_certificateId, vc_aaCertificate, vc_atCertificate); + f_readCertificate(p_certificateId, vc_eaCertificate); + } // End of function f_cfUp + + /** + * @desc Setups default configuration + * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT + */ + function f_cfHttpUp( + in charstring p_certificateId := "CERT_TS_A_EA" // TODO Use a constant + ) runs on ItsPkiHttp /* TITAN TODO: system ItsPkiHttpSystem */ { + + map(self:httpPort, system:httpPort); + f_connect4SelfOrClientSync(); + + if( not f_loadCertificates(PX_IUT_SEC_CONFIG_NAME) ) { + log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); + stop; + } + + f_prepareCertificates(p_certificateId, vc_aaCertificate, vc_atCertificate); + f_readCertificate(p_certificateId, vc_eaCertificate); + } // End of function f_cfHttpUp + + /** + * @desc Deletes default configuration + */ + function f_cfDown() runs on ItsPki /* TITAN TODO: system ItsPkiSystem */ { + unmap(self:pkiPort, system:pkiPort); + f_disconnect4SelfOrClientSync(); + } // End of function f_cfDown + + /** + * @desc Deletes default configuration + */ + function f_cfHttpDown() runs on ItsPkiHttp /* TITAN TODO: system ItsPkiHttpSystem */ { + unmap(self:httpPort, system:httpPort); + f_disconnect4SelfOrClientSync(); + } // End of function f_cfHttpDown + + /** + * @desc Initialise secure mode if required + */ + function f_initialiseSecuredMode() runs on ItsPki { + // Local variables + + // Load certificates + if( not f_loadCertificates(PX_IUT_SEC_CONFIG_NAME) ) { + log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); + stop; + } + + } // End of function f_initialiseSecuredMode() + + function f_uninitialiseSecuredMode() runs on ItsPki { + f_unloadCertificates(); + } // End of function f_uninitialiseSecuredMode() + + } // End of pkiConfigurationFunctions + + group inner_ec_xxx { + + function f_generate_innerEcRequestSignedForPop( + out Oct32 p_private_key, + out Oct32 p_publicKeyX, + out Oct32 p_publicKeyY, + out Oct32 p_publicKeyCompressed, + out integer p_compressedMode, + out InnerEcRequest p_inner_ec_request + ) return boolean { + // Local variables + var template (value) EccP256CurvePoint v_eccP256_curve_point; + + // Generate keys for the certificate to be requested + if (f_generate_key_pair_nistp256(p_private_key, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressedMode) == false) { + return false; + } + log("p_private_key = ", p_private_key); + log("p_public_key X= ", p_publicKeyX); + log("p_public_key Y= ", p_publicKeyY); + log("p_public_key compressed= ", p_publicKeyCompressed, p_compressedMode); + if (p_compressedMode == 0) { + v_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_0(p_publicKeyCompressed); + } else { + v_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_1(p_publicKeyCompressed); + } + // Build the Proof of Possession InnerEcRequestSignedForPop + p_inner_ec_request := valueof( + m_innerEcRequest( + "CanonicalItsId", + m_publicKeys( + m_publicVerificationKey_ecdsaNistP256(v_eccP256_curve_point), + m_encryptionKey( + -, + m_publicEncryptionKey_ecdsaNistP256(v_eccP256_curve_point) + ) + ), + m_certificateSubjectAttributes( + { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs + valueof(m_appPermissions(36, { bitmapSsp := '830001'O })), + valueof(m_appPermissions(37, { bitmapSsp := '830001'O })) + }, + m_validityPeriod( + 17469212, + m_duration_years(10) + ), + m_geographicRegion_identifiedRegion( + { + m_identifiedRegion_country_only(12), + m_identifiedRegion_country_only(34) + } + ), + 'C0'O + ) + ) + ); + + return true; + } // End of function f_generate_innerEcRequestSignedForPop + + function f_buildPkiSecuredinnerEcRequestSignedForPop( + in Oct32 p_private_key, + in Oct32 p_publicKeyCompressed, + in integer p_compressedMode, + in InnerEcRequest p_inner_ec_request, + out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data + ) return boolean { + // Local variables + var template (value) EccP256CurvePoint v_eccP256_curve_point; + var octetstring v_encoded_inner_ec_request; + var template (value) ToBeSignedData v_tbs; + var Oct32 v_tbs_signed; + var template (value) Ieee1609Dot2Data v_ieee1609dot2_signed_data; + var Oct12 v_nonce; + var Oct16 v_authentication_vector; + var Oct16 v_encrypted_sym_key; + var Oct32 v_publicEphemeralKeyCompressed; + var integer v_ephemeralKeyModeCompressed; + var HashedId8 v_recipientId; + var octetstring v_encrypted_inner_ec_request; + + // Encode it + v_encoded_inner_ec_request := bit2oct(encvalue(p_inner_ec_request)); + // Signed the encoded InnerEcRequestSignedForPop + v_tbs := m_toBeSignedData( + m_signedDataPayload( + m_etsiTs103097Data_unsecured(v_encoded_inner_ec_request) + ), + m_headerInfo_inner_ec_request(12345, f_getCurrentTime()) // TODO Use PIXIT + ); + // Signed the encoded InnerEcRequestSignedForPop + v_tbs_signed := fx_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), int2oct(0, 32), p_private_key); // TODO Use wrapping function + // Finalyse signed InnerEcRequestSignedForPop + v_ieee1609dot2_signed_data := m_etsiTs103097Data_signed( + m_signedData( + sha256, + v_tbs, + m_signerIdentifier_self, + m_signature_ecdsaNistP256( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only( + substr(v_tbs_signed, 0, 32) + ), + substr(v_tbs_signed, 32, 32) + ) + ) + ) + ); + // Encode InnerEcRequestSignedForPop + v_encoded_inner_ec_request := bit2oct(encvalue(v_ieee1609dot2_signed_data)); + // Encrypt the encoded signed InnerEcRequestSignedForPop + v_encrypted_inner_ec_request := f_encryptWithEciesNistp256WithSha256(v_encoded_inner_ec_request, p_publicKeyCompressed, p_compressedMode, v_publicEphemeralKeyCompressed, v_ephemeralKeyModeCompressed, v_encrypted_sym_key, v_authentication_vector, v_nonce); + v_recipientId := f_HashedId8FromSha256(f_hashWithSha256(v_encrypted_inner_ec_request)); // IEEE Std 1609.2a-2017 Clause 6.3.34 PKRecipientInfo + // Fill Certificate template with the public compressed keys (canonical form) + if (v_ephemeralKeyModeCompressed == 0) { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_publicEphemeralKeyCompressed)); + } else { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_publicEphemeralKeyCompressed)); + } + p_ieee1609dot2_signed_and_encrypted_data := valueof( + m_etsiTs103097Data_encrypted( + m_encryptedData( + { + m_recipientInfo_signedDataRecipInfo( + m_pKRecipientInfo( + v_recipientId, + m_encryptedDataEncryptionKey_eciesNistP256( + m_evciesP256EncryptedKey( + v_eccP256_curve_point, + v_encrypted_sym_key, + v_authentication_vector + )))) + }, + m_SymmetricCiphertext_aes128ccm( + m_aesCcmCiphertext( + v_nonce, + v_encrypted_inner_ec_request + ) + ) + ) + ) + ); + + return true; + } // End of function f_buildPkiSecuredinnerEcRequestSignedForPop + + } // End of group inner_ec_xxx + +} // End of module LibItsPki_Functions diff --git a/ttcn/Security/LibItsSecurity_Pics.ttcn b/ttcn/Security/LibItsSecurity_Pics.ttcn index 57257853..d22e1ff9 100644 --- a/ttcn/Security/LibItsSecurity_Pics.ttcn +++ b/ttcn/Security/LibItsSecurity_Pics.ttcn @@ -103,6 +103,6 @@ module LibItsSecurity_Pics { * @desc Generate fixed private/public keys. Used for debug only */ - modulepar boolean PICS_SEC_FIXED_KEYS := true; + modulepar boolean PICS_SEC_FIXED_KEYS := false; } // End of module LibItsSecurity_Pics -- GitLab From 15ed56907addc3e8af880b5363e3616a3842f7a6 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 10 Oct 2018 14:49:40 +0200 Subject: [PATCH 129/320] STF545: Execute first EA tests --- ttcn/Common/LibItsCommon_TypesAndValues.ttcn | 10 +- ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn | 54 ++-- ttcn/Pki/LibItsPki_Functions.ttcn | 127 +++++++-- ttcn/Pki/LibItsPki_Templates.ttcn | 275 ++++++++++--------- 4 files changed, 287 insertions(+), 179 deletions(-) diff --git a/ttcn/Common/LibItsCommon_TypesAndValues.ttcn b/ttcn/Common/LibItsCommon_TypesAndValues.ttcn index b14fbc29..85104033 100644 --- a/ttcn/Common/LibItsCommon_TypesAndValues.ttcn +++ b/ttcn/Common/LibItsCommon_TypesAndValues.ttcn @@ -140,15 +140,19 @@ module LibItsCommon_TypesAndValues { with { encode "AdapterControl" } - + + /** + * @see ETSI TS 102 965 Intelligent Transport Systems (ITS); Application Object Identifier (ITS-AID); Registration list ETSI ITS registration list + */ group securityConstants { const integer c_its_aid_CAM := 36; const integer c_its_aid_DENM := 37; const integer c_its_aid_SPAT := 137; const integer c_its_aid_MAP := 138; const integer c_its_aid_IVI := 139; - const integer c_its_aid_TLC := 140; - const integer c_its_aid_GN := 141; + const integer c_its_aid_TLC := 140; + const integer c_its_aid_GN := 141; + const integer c_its_aid_SCR := 36; // Secured Certificate Request } } with { diff --git a/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn b/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn index ca0042fe..41c9fdde 100644 --- a/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn +++ b/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn @@ -1,32 +1,40 @@ module LibItsPki_EncdecDeclarations { - // LibIts - import from EtsiTs102941BaseTypes language "ASN.1:1997" all; - import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; + // LibIts + import from EtsiTs102941BaseTypes language "ASN.1:1997" all; + import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; + import from EtsiTs102941MessagesItss language "ASN.1:1997" all; + import from EtsiTs103097Module language "ASN.1:1997" all; - import from LibItsSecurity_TypesAndValues all; + import from LibItsSecurity_TypesAndValues all; - /** - * @desc Encoding function for EtsiTs102941TypesEnrolment InnerEcRequest - * @param p The certificate to encode - * @return The encode message in OER format - */ - external function fx_enc_InnerEcRequest(in EtsiTs102941TypesEnrolment.InnerEcRequest p) return bitstring - with {extension "prototype(convert) encode(PER)"} + external function fx_enc_EtsiTs102941Data(in EtsiTs102941MessagesItss.EtsiTs102941Data p_etsi_ts_102941_data) return bitstring + with {extension "prototype(convert) encode(PER)"} + + + external function fx_dec_EtsiTs102941Data(inout bitstring b, out EtsiTs102941MessagesItss.EtsiTs102941Data p_etsi_ts_102941_data)return integer + with {extension "prototype(sliding) decode(PER)"} + + /** + * @desc Encoding function for EtsiTs102941TypesEnrolment InnerEcRequest + * @param p The certificate to encode + * @return The encode message in OER format + */ + external function fx_enc_InnerEcRequest(in EtsiTs102941TypesEnrolment.InnerEcRequest p) return bitstring + with {extension "prototype(convert) encode(PER)"} - external function fx_dec_InnerEcRequest(inout bitstring b, out EtsiTs102941TypesEnrolment.InnerEcRequest p) return integer - with {extension "prototype(sliding) decode(PER)"} + external function fx_dec_InnerEcRequest(inout bitstring b, out EtsiTs102941TypesEnrolment.InnerEcRequest p) return integer + with {extension "prototype(sliding) decode(PER)"} - /** - * @desc Encoding function for EtsiTs102941TypesEnrolment InnerEcResponse - * @param p The certificate to encode - * @return The encode message in OER format - */ - external function fx_enc_InnerEcResponse(in EtsiTs102941TypesEnrolment.InnerEcResponse p) return bitstring - with {extension "prototype(convert) encode(PER)"} + /** + * @desc Encoding function for EtsiTs102941TypesEnrolment InnerEcResponse + * @param p The certificate to encode + * @return The encode message in OER format + */ + external function fx_enc_InnerEcResponse(in EtsiTs102941TypesEnrolment.InnerEcResponse p) return bitstring + with {extension "prototype(convert) encode(PER)"} - external function fx_dec_InnerEcResponse(inout bitstring b, out EtsiTs102941TypesEnrolment.InnerEcResponse p) return integer - with {extension "prototype(sliding) decode(PER)"} + external function fx_dec_InnerEcResponse(inout bitstring b, out EtsiTs102941TypesEnrolment.InnerEcResponse p) return integer + with {extension "prototype(sliding) decode(PER)"} } // End of module LibItsPki_EncdecDeclarations diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 7edf9280..ae70db79 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -29,7 +29,7 @@ module LibItsPki_Functions { import from CAM_PDU_Descriptions language "ASN.1:1997" all; // LibItsCommon - import from LibItsCommon_TestSystem all; + import from LibItsCommon_TypesAndValues all; import from LibItsCommon_Functions all; import from LibItsCommon_ASN1_NamedNumbers all; import from LibItsCommon_Pixits all; @@ -128,14 +128,14 @@ module LibItsPki_Functions { group inner_ec_xxx { - function f_generate_innerEcRequestSignedForPop( - out Oct32 p_private_key, - out Oct32 p_publicKeyX, - out Oct32 p_publicKeyY, - out Oct32 p_publicKeyCompressed, - out integer p_compressedMode, - out InnerEcRequest p_inner_ec_request - ) return boolean { + function f_generate_inner_ec_request( + out Oct32 p_private_key, + out Oct32 p_publicKeyX, + out Oct32 p_publicKeyY, + out Oct32 p_publicKeyCompressed, + out integer p_compressedMode, + out InnerEcRequest p_inner_ec_request + ) return boolean { // Local variables var template (value) EccP256CurvePoint v_eccP256_curve_point; @@ -152,10 +152,10 @@ module LibItsPki_Functions { } else { v_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_1(p_publicKeyCompressed); } - // Build the Proof of Possession InnerEcRequestSignedForPop + // Build the Proof of Possession InnerEcRequest p_inner_ec_request := valueof( m_innerEcRequest( - "CanonicalItsId", + "CanonicalItsId", // TODO Use PIXIT m_publicKeys( m_publicVerificationKey_ecdsaNistP256(v_eccP256_curve_point), m_encryptionKey( @@ -165,40 +165,91 @@ module LibItsPki_Functions { ), m_certificateSubjectAttributes( { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs - valueof(m_appPermissions(36, { bitmapSsp := '830001'O })), - valueof(m_appPermissions(37, { bitmapSsp := '830001'O })) + valueof(m_appPermissions(36, { bitmapSsp := '830001'O })), // TODO Use PIXIT + valueof(m_appPermissions(37, { bitmapSsp := '830001'O })) // TODO Use PIXIT }, m_validityPeriod( 17469212, - m_duration_years(10) + m_duration_years(10) // TODO Use PIXIT ), m_geographicRegion_identifiedRegion( { - m_identifiedRegion_country_only(12), - m_identifiedRegion_country_only(34) + m_identifiedRegion_country_only(12), // TODO Use PIXIT + m_identifiedRegion_country_only(34) // TODO Use PIXIT } ), - 'C0'O + 'C0'O // TODO Use PIXIT ) ) - ); + ); return true; - } // End of function f_generate_innerEcRequestSignedForPop + } // End of function f_generate_inner_ec_request - function f_buildPkiSecuredinnerEcRequestSignedForPop( - in Oct32 p_private_key, - in Oct32 p_publicKeyCompressed, - in integer p_compressedMode, - in InnerEcRequest p_inner_ec_request, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data + function f_generate_inner_ec_request_signed_for_pop( + in Oct32 p_private_key, + in InnerEcRequest p_inner_ec_request, + out Ieee1609Dot2Data p_inner_ec_request_signed_for_pop ) return boolean { // Local variables var template (value) EccP256CurvePoint v_eccP256_curve_point; var octetstring v_encoded_inner_ec_request; var template (value) ToBeSignedData v_tbs; var Oct32 v_tbs_signed; + + // Encode it + v_encoded_inner_ec_request := bit2oct(encvalue(p_inner_ec_request)); + // Signed the encoded InnerEcRequestSignedForPop + v_tbs := m_toBeSignedData( + m_signedDataPayload( + m_etsiTs103097Data_unsecured( + v_encoded_inner_ec_request + ) + ), + m_headerInfo_inner_ec_request( + c_its_aid_SCR, + f_getCurrentTime()) + ); + // Signed the encoded InnerEcRequestSignedForPop + v_tbs_signed := f_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), int2oct(0, 32), p_private_key); + // Finalyse signed InnerEcRequestSignedForPop + p_inner_ec_request_signed_for_pop := valueof( + m_etsiTs103097Data_signed( + m_signedData( + sha256, + v_tbs, + m_signerIdentifier_self, + m_signature_ecdsaNistP256( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only( + substr(v_tbs_signed, 0, 32) + ), + substr(v_tbs_signed, 32, 32) + ) + ) + ) + ) + ); + return true; + } // End of function f_generate_inner_ec_request_signed_for_pop + + } // End of group inner_ec_xxx + + group pki_functions { + + function f_build_pki_secured_message( + in Oct32 p_private_key, + in Oct32 p_publicKeyCompressed, + in integer p_compressedMode, + in octetstring p_pki_message, + out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data + ) return boolean { + // Local variables + var template (value) EccP256CurvePoint v_eccP256_curve_point; + var template (value) ToBeSignedData v_tbs; + var Oct32 v_tbs_signed; var template (value) Ieee1609Dot2Data v_ieee1609dot2_signed_data; + var octetstring v_encoded_inner_ec_request; var Oct12 v_nonce; var Oct16 v_authentication_vector; var Oct16 v_encrypted_sym_key; @@ -207,12 +258,10 @@ module LibItsPki_Functions { var HashedId8 v_recipientId; var octetstring v_encrypted_inner_ec_request; - // Encode it - v_encoded_inner_ec_request := bit2oct(encvalue(p_inner_ec_request)); // Signed the encoded InnerEcRequestSignedForPop v_tbs := m_toBeSignedData( m_signedDataPayload( - m_etsiTs103097Data_unsecured(v_encoded_inner_ec_request) + m_etsiTs103097Data_unsecured(p_pki_message) ), m_headerInfo_inner_ec_request(12345, f_getCurrentTime()) // TODO Use PIXIT ); @@ -223,7 +272,7 @@ module LibItsPki_Functions { m_signedData( sha256, v_tbs, - m_signerIdentifier_self, + m_signerIdentifier_self, // TODO ETSI TS 102 941 Clause 6.2.3.2.1 bullet 5 dash 3: Using disgest of EC if non canonical indentifier m_signature_ecdsaNistP256( m_ecdsaP256Signature( m_eccP256CurvePoint_x_only( @@ -270,7 +319,25 @@ module LibItsPki_Functions { ); return true; - } // End of function f_buildPkiSecuredinnerEcRequestSignedForPop + } // End of function f_build_pki_secured_message + + function f_generate_inner_ec_response( + in Oct32 p_inner_ec_request_hashed_id, + in EtsiTs103097Certificate p_certificate, + out InnerEcResponse p_inner_ec_response + ) return boolean { + // Local variables + + // Build the Proof of Possession InnerEcResponse + p_inner_ec_response := valueof( + m_innerEcResponse_ok( + substr(p_inner_ec_request_hashed_id, 0, 16), + p_certificate + ) + ); + + return true; + } // End of function f_generate_inner_ec_response } // End of group inner_ec_xxx diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn index b325f2a8..710b4617 100644 --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ b/ttcn/Pki/LibItsPki_Templates.ttcn @@ -10,127 +10,156 @@ * */ module LibItsPki_Templates { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - import from LibItsCommon_Functions all; - import from LibItsCommon_TypesAndValues all; - import from LibItsCommon_ASN1_NamedNumbers all; - - // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; - import from EtsiTs102941BaseTypes language "ASN.1:1997" all; - import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; - import from EtsiTs102941MessagesItss language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; - - // LibItsSecurity - import from LibItsSecurity_Templates all; - - template (value) EnrolmentRequestMessage m_enrolmentRequestMessage( - in template (value) EncryptedData p_encryptedData - ) modifies m_etsiTs103097Data_encrypted := { - } // End of template m_enrolmentRequestMessage - - template (present) EnrolmentRequestMessage mw_enrolmentResponseMessage( - template (present) EncryptedData p_encryptedData := ? - ) modifies mw_etsiTs103097Data_encrypted := { - } // End of template mw_enrolmentResponseMessage - - template (value) EtsiTs102941DataContent m_enrolmentRequest( - in template (value) InnerEcRequestSignedForPop p_enrolmentRequest - ) := { - enrolmentRequest := p_enrolmentRequest - } // End of template m_enrolmentRequest - - template (present) EtsiTs102941DataContent mw_enrolmentResponse( - template (present) InnerEcResponse p_enrolmentResponse := ? - ) := { - enrolmentResponse := p_enrolmentResponse - } // End of template mw_enrolmentResponse - - template (value) InnerEcRequest m_innerEcRequest( - in template (value) charstring p_itsId, - in template (value) PublicKeys p_publicKeys, - in template (value) CertificateSubjectAttributes p_requestedSubjectAttributes //(WITH COMPONENTS{certIssuePermissions ABSENT}), - ) := { - itsId := p_itsId, - certificateFormat := 1, - publicKeys := p_publicKeys, - requestedSubjectAttributes := p_requestedSubjectAttributes - } // End of template m_innerEcRequest - - template (omit) PublicKeys m_publicKeys( - in template (value) PublicVerificationKey p_verificationKey, - in template (omit) PublicEncryptionKey p_encryptionKey := omit - ) := { - verificationKey := p_verificationKey, - encryptionKey := p_encryptionKey - } // End of template m_publicKeys - - template PublicKeys mw_publicKeys( - template (present) PublicVerificationKey p_verificationKey := ?, - template PublicEncryptionKey p_encryptionKey := * - ) := { - verificationKey := p_verificationKey, - encryptionKey := p_encryptionKey - } // End of template mw_publicKeys - - template (omit) CertificateSubjectAttributes m_certificateSubjectAttributes( - in template (value) SequenceOfPsidSsp p_appPermissions, - in template (omit) ValidityPeriod p_validityPeriod := omit, - in template (omit) GeographicRegion p_region := omit, - in template (omit) SubjectAssurance p_assuranceLevel := omit - ) := { - id := { none_ := NULL }, - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := omit - } // End of template m_certificateSubjectAttributes + + // LibCommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; + + // LibItsCommon + import from LibItsCommon_TypesAndValues all; + import from LibItsCommon_Functions all; + import from LibItsCommon_TypesAndValues all; + import from LibItsCommon_ASN1_NamedNumbers all; + + // LibIts + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + import from IEEE1609dot2 language "ASN.1:1997" all; + import from EtsiTs102941BaseTypes language "ASN.1:1997" all; + import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; + import from EtsiTs102941MessagesItss language "ASN.1:1997" all; + import from EtsiTs103097Module language "ASN.1:1997" all; + + // LibItsSecurity + import from LibItsSecurity_Templates all; - template (value) InnerEcResponse m_innerEcResponse_ok( - in template (value) Oct16 p_requestHash, - in template (value) EtsiTs103097Certificate p_certificate - ) := { - requestHash := p_requestHash, - responseCode := ok, - certificate := p_certificate - } // End of template m_innerEcResponse_ok - - template (present) InnerEcResponse mw_innerEcResponse_ok( - template (present) Oct16 p_requestHash := ?, - template (present) EtsiTs103097Certificate p_certificate := ? - ) := { - requestHash := p_requestHash, - responseCode := ok, - certificate := p_certificate - } // End of template mw_innerEcResponse_ok - - template (value) InnerEcResponse m_innerEcResponse_ko( - in template (value) Oct16 p_requestHash, - in template (value) EnrolmentResponseCode p_responseCode - ) := { - requestHash := p_requestHash, - responseCode := p_responseCode, - certificate := omit - } // End of template m_innerEcResponse_ko - - template (present) InnerEcResponse mw_innerEcResponse_ko( - template (present) Oct16 p_requestHash := ?, - template (present) EnrolmentResponseCode p_responseCode := complement(ok) - ) := { - requestHash := p_requestHash, - responseCode := p_responseCode, - certificate := * - } // End of template mw_innerEcResponse_ko - - - -} // End of module LibItsPki_Templates \ No newline at end of file + template (value) EtsiTs102941Data m_etsiTs102941Data_inner_ec_request_signed_for_pop( + in template (value) InnerEcRequestSignedForPop p_inner_ec_request_signed_for_pop + ) := { + version := 1, + content := { + enrolmentRequest := p_inner_ec_request_signed_for_pop + } + } // End of template m_etsiTs102941Data_inner_ec_request_signed_for_pop + + template (value) EtsiTs102941Data m_etsiTs102941Data_inner_ec_response( + in template (value) InnerEcResponse p_inner_ec_response + ) := { + version := 1, + content := { + enrolmentResponse := p_inner_ec_response + } + } // End of template m_etsiTs102941Data_inner_ec_response + + template (value) EnrolmentRequestMessage m_enrolmentRequestMessage( + in template (value) EncryptedData p_encryptedData + ) modifies m_etsiTs103097Data_encrypted := { + } // End of template m_enrolmentRequestMessage + + template (present) EnrolmentRequestMessage mw_enrolmentResponseMessage( + template (present) EncryptedData p_encryptedData := ? + ) modifies mw_etsiTs103097Data_encrypted := { + } // End of template mw_enrolmentResponseMessage + + template (value) EtsiTs102941DataContent m_enrolmentRequest( + in template (value) InnerEcRequestSignedForPop p_enrolmentRequest + ) := { + enrolmentRequest := p_enrolmentRequest + } // End of template m_enrolmentRequest + + template (present) EtsiTs102941DataContent mw_enrolmentResponse( + template (present) InnerEcResponse p_enrolmentResponse := ? + ) := { + enrolmentResponse := p_enrolmentResponse + } // End of template mw_enrolmentResponse + + template (value) InnerEcRequest m_innerEcRequest( + in template (value) charstring p_itsId, + in template (value) PublicKeys p_publicKeys, + in template (value) CertificateSubjectAttributes p_requestedSubjectAttributes + ) := { + itsId := p_itsId, + certificateFormat := 1, + publicKeys := p_publicKeys, + requestedSubjectAttributes := p_requestedSubjectAttributes + } // End of template m_innerEcRequest + + template (present) InnerEcRequest mw_innerEcRequest( + template (present) charstring p_itsId := ?, + template (present) PublicKeys p_publicKeys := ?, + template (present) CertificateSubjectAttributes p_requestedSubjectAttributes := ? + ) := { + itsId := p_itsId, + certificateFormat := 1, + publicKeys := p_publicKeys, + requestedSubjectAttributes := p_requestedSubjectAttributes + } // End of template mw_innerEcRequest + + template (omit) PublicKeys m_publicKeys( + in template (value) PublicVerificationKey p_verificationKey, + in template (omit) PublicEncryptionKey p_encryptionKey := omit + ) := { + verificationKey := p_verificationKey, + encryptionKey := p_encryptionKey + } // End of template m_publicKeys + + template PublicKeys mw_publicKeys( + template (present) PublicVerificationKey p_verificationKey := ?, + template PublicEncryptionKey p_encryptionKey := * + ) := { + verificationKey := p_verificationKey, + encryptionKey := p_encryptionKey + } // End of template mw_publicKeys + + template (omit) CertificateSubjectAttributes m_certificateSubjectAttributes( + in template (value) SequenceOfPsidSsp p_appPermissions, + in template (omit) ValidityPeriod p_validityPeriod := omit, + in template (omit) GeographicRegion p_region := omit, + in template (omit) SubjectAssurance p_assuranceLevel := omit + ) := { + id := { none_ := NULL }, + validityPeriod := p_validityPeriod, + region := p_region, + assuranceLevel := p_assuranceLevel, + appPermissions := p_appPermissions, + certIssuePermissions := omit + } // End of template m_certificateSubjectAttributes + + template (value) InnerEcResponse m_innerEcResponse_ok( + in template (value) Oct16 p_requestHash, + in template (value) EtsiTs103097Certificate p_certificate + ) := { + requestHash := p_requestHash, + responseCode := ok, + certificate := p_certificate + } // End of template m_innerEcResponse_ok + + template (present) InnerEcResponse mw_innerEcResponse_ok( + template (present) Oct16 p_requestHash := ?, + template (present) EtsiTs103097Certificate p_certificate := ? + ) := { + requestHash := p_requestHash, + responseCode := ok, + certificate := p_certificate + } // End of template mw_innerEcResponse_ok + + template (value) InnerEcResponse m_innerEcResponse_ko( + in template (value) Oct16 p_requestHash, + in template (value) EnrolmentResponseCode p_responseCode + ) := { + requestHash := p_requestHash, + responseCode := p_responseCode, + certificate := omit + } // End of template m_innerEcResponse_ko + + template (present) InnerEcResponse mw_innerEcResponse_ko( + template (present) Oct16 p_requestHash := ?, + template (present) EnrolmentResponseCode p_responseCode := complement(ok) + ) := { + requestHash := p_requestHash, + responseCode := p_responseCode, + certificate := * + } // End of template mw_innerEcResponse_ko + + + +} // End of module LibItsPki_Templates -- GitLab From 19386aa9bcb5fd5e70525ed2340e429ef1fbf02e Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Wed, 10 Oct 2018 15:17:00 +0200 Subject: [PATCH 130/320] Review Pki Layer --- ttcn/Pki/LibItsPki_TypesAndValues.ttcn | 50 ++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 ttcn/Pki/LibItsPki_TypesAndValues.ttcn diff --git a/ttcn/Pki/LibItsPki_TypesAndValues.ttcn b/ttcn/Pki/LibItsPki_TypesAndValues.ttcn new file mode 100644 index 00000000..039dba3c --- /dev/null +++ b/ttcn/Pki/LibItsPki_TypesAndValues.ttcn @@ -0,0 +1,50 @@ +/** + * @author ETSI / STF545 + * @version $URL$ + * $Id$ + * @desc Module containing templates for IT PKI Protocol + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + */ +module LibItsPki_TypesAndValues { + + group acPrimitives { + + /** + * @desc TA primitives for Pki + */ + type union AcPkiPrimitive { + AcSetSecurityData acSetSecurityData + } with { + variant "" + } + + /** + * @desc Primitive for receiveing response from TA + */ + type union AcPkiResponse { + boolean result + } + + type record AcSetSecurityData { + charstring certificateId, + octetstring private_key, + octetstring public_key_compressed, + integer public_key_compressed_mode + } with { + variant "" + encode "LibItsPki" + } // AcSetSecurityData + + } // end acPrimitives + with { + variant "" + encode "AdapterControl" + } +} +with { + variant "" + encode "LibItsPki" +} // End of module LibItsPki_TypesAndValues -- GitLab From c3af4d2dc08f61555cb2ab63f9c900cae051201c Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 10 Oct 2018 18:09:16 +0200 Subject: [PATCH 131/320] STF545: Add acPort support for Pki --- ttcn/Pki/LibItsPki_TestSystem.ttcn | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index 297bcefe..3a42a7fc 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -37,6 +37,17 @@ module LibItsPki_TestSystem { // LibItsGeoNetworking import from LibItsGeoNetworking_TestSystem all; + // LibItsPki + import from LibItsPki_TypesAndValues all; + + /** + * @desc Adapter control port + */ + type port AdapterControlPort message { + out AcPkiPrimitive; + in AcPkiResponse; + } // End of AdapterControlPort + type port PkiPort message { inout InnerEcRequest, InnerEcResponse; } -- GitLab From 311f461d726a794d9cf30cf5a14b1f6ca5b74ddc Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 11 Oct 2018 10:51:26 +0200 Subject: [PATCH 132/320] STF545: Add acPort support for Pki --- ttcn/Pki/LibItsPki_TestSystem.ttcn | 16 ++++++++-------- ttcn/Pki/LibItsPki_TypesAndValues.ttcn | 1 + 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index 3a42a7fc..d4ddc914 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -43,29 +43,28 @@ module LibItsPki_TestSystem { /** * @desc Adapter control port */ - type port AdapterControlPort message { - out AcPkiPrimitive; - in AcPkiResponse; - } // End of AdapterControlPort + // type port AdapterControlPort message { + // out AcPkiPrimitive; + // in AcPkiResponse; + // } // End of AdapterControlPort type port PkiPort message { inout InnerEcRequest, InnerEcResponse; } type component ItsPkiSystem { + // port LibItsPki_TestSystem.AdapterControlPort acPkiPort; port PkiPort pkiPort; } // End of component ItsPkiSystem type component ItsPkiHttpSystem extends HttpTestAdapter{ } // End of component ItsPkiHttpSystem - type component ItsPkiItssSystem extends ItsPkiSystem { - port LibItsGeoNetworking_TestSystem.AdapterControlPort acPort; - port LibItsGeoNetworking_TestSystem.UpperTesterPort utPort; - port GeoNetworkingPort geoNetworkingPort; + type component ItsPkiItssSystem extends ItsPkiSystem, ItsGeoNetworking { } // End of component ItsPkiItssSystem type component ItsPki extends ItsSecurityBaseComponent, ItsBaseMtc { + // port LibItsPki_TestSystem.AdapterControlPort acPkiPort; port PkiPort pkiPort; var Certificate vc_eaCertificate; /** Test Adapter EA certificate */ @@ -77,6 +76,7 @@ module LibItsPki_TestSystem { type component ItsPkiItss extends ItsGeoNetworking { port PkiPort pkiPort; + // port LibItsPki_TestSystem.AdapterControlPort acPkiPort; } // End of component ItsPkiItss } // End of module LibItsPki_TestSystem diff --git a/ttcn/Pki/LibItsPki_TypesAndValues.ttcn b/ttcn/Pki/LibItsPki_TypesAndValues.ttcn index 039dba3c..44387e50 100644 --- a/ttcn/Pki/LibItsPki_TypesAndValues.ttcn +++ b/ttcn/Pki/LibItsPki_TypesAndValues.ttcn @@ -30,6 +30,7 @@ module LibItsPki_TypesAndValues { type record AcSetSecurityData { charstring certificateId, + charstring peer_certificateId, octetstring private_key, octetstring public_key_compressed, integer public_key_compressed_mode -- GitLab From 302a7df961902fe0be1e35cbf6e8cb848f2f3577 Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 16 Oct 2018 14:15:55 +0200 Subject: [PATCH 133/320] STF545: Add acPkiPort support for Pki. Conflict with acPort to be fixed --- ttcn/Pki/LibItsPki_Functions.ttcn | 37 +++++++++++++++++++------- ttcn/Pki/LibItsPki_TestSystem.ttcn | 14 +++++----- ttcn/Pki/LibItsPki_TypesAndValues.ttcn | 2 ++ 3 files changed, 37 insertions(+), 16 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index ae70db79..6a9abf4f 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -59,6 +59,7 @@ module LibItsPki_Functions { ) runs on ItsPki /* TITAN TODO: system ItsPkiSystem */ { map(self:pkiPort, system:pkiPort); + map(self:acPkiPort, system:acPkiPort); f_connect4SelfOrClientSync(); if( not f_loadCertificates(PX_IUT_SEC_CONFIG_NAME) ) { @@ -95,6 +96,7 @@ module LibItsPki_Functions { */ function f_cfDown() runs on ItsPki /* TITAN TODO: system ItsPkiSystem */ { unmap(self:pkiPort, system:pkiPort); + unmap(self:acPkiPort, system:acPkiPort); f_disconnect4SelfOrClientSync(); } // End of function f_cfDown @@ -239,6 +241,8 @@ module LibItsPki_Functions { function f_build_pki_secured_message( in Oct32 p_private_key, + in SignerIdentifier p_signer_identifier, + in HashedId8 p_recipientId, in Oct32 p_publicKeyCompressed, in integer p_compressedMode, in octetstring p_pki_message, @@ -253,26 +257,33 @@ module LibItsPki_Functions { var Oct12 v_nonce; var Oct16 v_authentication_vector; var Oct16 v_encrypted_sym_key; + var HashedId8 v_recipientId; var Oct32 v_publicEphemeralKeyCompressed; var integer v_ephemeralKeyModeCompressed; - var HashedId8 v_recipientId; var octetstring v_encrypted_inner_ec_request; - // Signed the encoded InnerEcRequestSignedForPop + // Signed the encoded PKI message v_tbs := m_toBeSignedData( m_signedDataPayload( m_etsiTs103097Data_unsecured(p_pki_message) ), m_headerInfo_inner_ec_request(12345, f_getCurrentTime()) // TODO Use PIXIT ); - // Signed the encoded InnerEcRequestSignedForPop - v_tbs_signed := fx_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), int2oct(0, 32), p_private_key); // TODO Use wrapping function - // Finalyse signed InnerEcRequestSignedForPop + if (ischosen(p_signer_identifier.self_)) { + v_tbs_signed := f_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), int2oct(0, 32), p_private_key); + } else { + var charstring v_certificate_id; + var octetstring v_hash; + fx_readCertificateFromDigest(p_signer_identifier.digest, v_certificate_id); // TODO Add a wrapper function + f_getCertificateHash(v_certificate_id, v_hash); + v_tbs_signed := f_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), v_hash, p_private_key); + } + // Add the signature and create EtsiTs103097Data-Signed data structure v_ieee1609dot2_signed_data := m_etsiTs103097Data_signed( m_signedData( sha256, v_tbs, - m_signerIdentifier_self, // TODO ETSI TS 102 941 Clause 6.2.3.2.1 bullet 5 dash 3: Using disgest of EC if non canonical indentifier + p_signer_identifier, m_signature_ecdsaNistP256( m_ecdsaP256Signature( m_eccP256CurvePoint_x_only( @@ -283,11 +294,19 @@ module LibItsPki_Functions { ) ) ); - // Encode InnerEcRequestSignedForPop + // Encode EtsiTs103097Data-Signed data structure v_encoded_inner_ec_request := bit2oct(encvalue(v_ieee1609dot2_signed_data)); - // Encrypt the encoded signed InnerEcRequestSignedForPop + // Encrypt encode EtsiTs103097Data-Signed data structure v_encrypted_inner_ec_request := f_encryptWithEciesNistp256WithSha256(v_encoded_inner_ec_request, p_publicKeyCompressed, p_compressedMode, v_publicEphemeralKeyCompressed, v_ephemeralKeyModeCompressed, v_encrypted_sym_key, v_authentication_vector, v_nonce); - v_recipientId := f_HashedId8FromSha256(f_hashWithSha256(v_encrypted_inner_ec_request)); // IEEE Std 1609.2a-2017 Clause 6.3.34 PKRecipientInfo + log("p_recipientId=", p_recipientId); + if (p_recipientId == int2oct(0, 8)) { + log("v_encrypted_sym_key=", v_encrypted_sym_key); + log("f_hashWithSha256(v_encrypted_sym_key=", f_hashWithSha256(v_encrypted_sym_key)); + v_recipientId := f_HashedId8FromSha256(f_hashWithSha256(v_encrypted_sym_key)); + } else { + v_recipientId := p_recipientId; + } + log("v_recipientId=", v_recipientId); // Fill Certificate template with the public compressed keys (canonical form) if (v_ephemeralKeyModeCompressed == 0) { v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_publicEphemeralKeyCompressed)); diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index d4ddc914..16b30fb0 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -43,17 +43,17 @@ module LibItsPki_TestSystem { /** * @desc Adapter control port */ - // type port AdapterControlPort message { - // out AcPkiPrimitive; - // in AcPkiResponse; - // } // End of AdapterControlPort + type port AdapterControlPkiPort message { + out AcPkiPrimitive; + in AcPkiResponse; + } // End of AdapterControlPkiPort type port PkiPort message { inout InnerEcRequest, InnerEcResponse; } type component ItsPkiSystem { - // port LibItsPki_TestSystem.AdapterControlPort acPkiPort; + port AdapterControlPkiPort acPkiPort; port PkiPort pkiPort; } // End of component ItsPkiSystem @@ -64,7 +64,7 @@ module LibItsPki_TestSystem { } // End of component ItsPkiItssSystem type component ItsPki extends ItsSecurityBaseComponent, ItsBaseMtc { - // port LibItsPki_TestSystem.AdapterControlPort acPkiPort; + port AdapterControlPkiPort acPkiPort; port PkiPort pkiPort; var Certificate vc_eaCertificate; /** Test Adapter EA certificate */ @@ -75,8 +75,8 @@ module LibItsPki_TestSystem { } // End of component ItsPki type component ItsPkiItss extends ItsGeoNetworking { + port AdapterControlPkiPort acPkiPort; port PkiPort pkiPort; - // port LibItsPki_TestSystem.AdapterControlPort acPkiPort; } // End of component ItsPkiItss } // End of module LibItsPki_TestSystem diff --git a/ttcn/Pki/LibItsPki_TypesAndValues.ttcn b/ttcn/Pki/LibItsPki_TypesAndValues.ttcn index 44387e50..c02194a8 100644 --- a/ttcn/Pki/LibItsPki_TypesAndValues.ttcn +++ b/ttcn/Pki/LibItsPki_TypesAndValues.ttcn @@ -26,6 +26,8 @@ module LibItsPki_TypesAndValues { */ type union AcPkiResponse { boolean result + } with { + variant "" } type record AcSetSecurityData { -- GitLab From f18d6e1245310ecab9e33e80c741d40694590ff8 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 17 Oct 2018 10:53:49 +0200 Subject: [PATCH 134/320] STF545: Finalyse & validate first test case --- ttcn/Common/LibItsCommon_Functions.ttcn | 21 ++++++++++++++++- ttcn/Pki/LibItsPki_Functions.ttcn | 26 ++++++++++++++++----- ttcn/Pki/LibItsPki_Templates.ttcn | 2 +- ttcn/Pki/LibItsPki_TestSystem.ttcn | 2 ++ ttcn/Security/LibItsSecurity_Templates.ttcn | 2 +- 5 files changed, 44 insertions(+), 9 deletions(-) diff --git a/ttcn/Common/LibItsCommon_Functions.ttcn b/ttcn/Common/LibItsCommon_Functions.ttcn index ec4082a1..8a51ee99 100644 --- a/ttcn/Common/LibItsCommon_Functions.ttcn +++ b/ttcn/Common/LibItsCommon_Functions.ttcn @@ -117,6 +117,19 @@ module LibItsCommon_Functions { return v_timeStamp; } + /** + * @desc Gets the current time since 01/01/1970 in UTC format + * @return The current time since 01/01/1970 in UTC format + */ + function f_getCurrentTimeUtc() return UInt64 { + var UInt64 v_time := 0; + +// log("*** f_getCurrentTimeUtc: INFO: calling fx_getCurrentTimeUtc() ***"); + v_time := fx_getCurrentTimeUtc(); + + return v_time; + } + /** * @desc Gets the current time since 01/01/2004 * @return TimeMark - tenths of a second in the current or next hour in units of 1/10th second from UTC time @@ -228,6 +241,12 @@ module LibItsCommon_Functions { */ external function fx_getCurrentTime() return UInt64; + /** + * @desc Gets the current time since 01/01/1970 in UTC format + * @return The current time since 01/01/1970 in UTC format + */ + external function fx_getCurrentTimeUtc() return UInt64; + /** * @desc Gets the tenths of a second in the current or next hour in units of 1/10th second from UTC time * @return TimeMark - tenths of a second in the current or next hour in units of 1/10th second from UTC time @@ -288,4 +307,4 @@ module LibItsCommon_Functions { } // end externalFunctions -} // end of module \ No newline at end of file +} // end of module diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 6a9abf4f..0847805c 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -89,8 +89,10 @@ module LibItsPki_Functions { f_prepareCertificates(p_certificateId, vc_aaCertificate, vc_atCertificate); f_readCertificate(p_certificateId, vc_eaCertificate); + f_readSigningKey(p_certificateId, vc_eaPrivateKey); + f_getCertificateDigest(p_certificateId, vc_eaHashedId8); } // End of function f_cfHttpUp - + /** * @desc Deletes default configuration */ @@ -210,7 +212,7 @@ module LibItsPki_Functions { ), m_headerInfo_inner_ec_request( c_its_aid_SCR, - f_getCurrentTime()) + f_getCurrentTimeUtc()) ); // Signed the encoded InnerEcRequestSignedForPop v_tbs_signed := f_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), int2oct(0, 32), p_private_key); @@ -238,9 +240,21 @@ module LibItsPki_Functions { } // End of group inner_ec_xxx group pki_functions { - + + /** + * @desc Build a signed and encrypted PKI message + * @param p_private_key Private key for signature + * @param p_signer_identifier Signer identifier for signature, could be self or certificate HashedId8 + * @param p_recipientId Recipient identifier to be inclued in encrypted layer. + * If value is int2oct(0. 8), the recipient id is the HashedId8 of the symmetric key used by the sender to encrypt the message to which the response is built + * @param p_publicKeyCompressed The public compressed key (canonical form) for encryption + * @param p_compressedMode The compressed mode of the public compressed key (canonical form) for encryption + * @param p_pki_message The PKI message to be secured + * @param p_ieee1609dot2_signed_and_encrypted_data The secured message + * @return true on success, false otherwise + */ function f_build_pki_secured_message( - in Oct32 p_private_key, + in octetstring p_private_key, in SignerIdentifier p_signer_identifier, in HashedId8 p_recipientId, in Oct32 p_publicKeyCompressed, @@ -261,13 +275,13 @@ module LibItsPki_Functions { var Oct32 v_publicEphemeralKeyCompressed; var integer v_ephemeralKeyModeCompressed; var octetstring v_encrypted_inner_ec_request; - + // Signed the encoded PKI message v_tbs := m_toBeSignedData( m_signedDataPayload( m_etsiTs103097Data_unsecured(p_pki_message) ), - m_headerInfo_inner_ec_request(12345, f_getCurrentTime()) // TODO Use PIXIT + m_headerInfo_inner_ec_request(12345, f_getCurrentTimeUtc()) // TODO Use PIXIT ); if (ischosen(p_signer_identifier.self_)) { v_tbs_signed := f_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), int2oct(0, 32), p_private_key); diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn index 710b4617..e641266f 100644 --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ b/ttcn/Pki/LibItsPki_Templates.ttcn @@ -116,7 +116,7 @@ module LibItsPki_Templates { in template (omit) GeographicRegion p_region := omit, in template (omit) SubjectAssurance p_assuranceLevel := omit ) := { - id := { none_ := NULL }, + id := { none_ := NULL }, validityPeriod := p_validityPeriod, region := p_region, assuranceLevel := p_assuranceLevel, diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index 16b30fb0..1dd7f998 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -72,6 +72,8 @@ module LibItsPki_TestSystem { type component ItsPkiHttp extends ItsSecurityBaseComponent, HttpComponent { var Certificate vc_eaCertificate; /** Test Adapter EA certificate */ + var octetstring vc_eaPrivateKey; /** Test Adapter EA proivate key for signature */ + var HashedId8 vc_eaHashedId8; /** Test Adapter EA HashedId8 for RecipientId */ } // End of component ItsPki type component ItsPkiItss extends ItsGeoNetworking { diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index 19071299..7c905a4c 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -1008,7 +1008,7 @@ module LibItsSecurity_Templates { template (omit) HeaderInfo m_headerInfo_inner_ec_request( in template (value) Psid p_psid := c_its_aid_GN, in template (value) Time64 p_generationTime - ) modifies m_ieee1609Dot2_headerInfo := {}; + ) modifies m_headerInfo_gn := {}; } // End of group headerFields -- GitLab From 5862afa57a4efc6bff2c3d7b19461c7a3a2ec8f4 Mon Sep 17 00:00:00 2001 From: Denis Filatov Date: Wed, 17 Oct 2018 12:47:17 +0200 Subject: [PATCH 135/320] fix default eeType value --- asn1/Security/1609Dot2/IEEE1609dot2.asn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asn1/Security/1609Dot2/IEEE1609dot2.asn b/asn1/Security/1609Dot2/IEEE1609dot2.asn index 67d7682c..18293c86 100644 --- a/asn1/Security/1609Dot2/IEEE1609dot2.asn +++ b/asn1/Security/1609Dot2/IEEE1609dot2.asn @@ -289,7 +289,7 @@ PsidGroupPermissions ::= SEQUENCE { subjectPermissions SubjectPermissions, minChainLength INTEGER DEFAULT 1, chainLengthRange INTEGER DEFAULT 0, - eeType EndEntityType DEFAULT '00'H + eeType EndEntityType DEFAULT '80'H } SequenceOfPsidGroupPermissions ::= SEQUENCE OF PsidGroupPermissions -- GitLab From 4a6200798b3d0fa3b20d1941ec9d9c8cbd6d35a2 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 17 Oct 2018 16:30:53 +0200 Subject: [PATCH 136/320] STF545: Validate first test case --- ttcn/Pki/LibItsPki_Functions.ttcn | 42 +++++++++++++++++++++++++++---- ttcn/Pki/LibItsPki_Pics.ttcn | 28 +++++++++++++++++++++ 2 files changed, 65 insertions(+), 5 deletions(-) create mode 100644 ttcn/Pki/LibItsPki_Pics.ttcn diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 0847805c..742c2b03 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -33,22 +33,24 @@ module LibItsPki_Functions { import from LibItsCommon_Functions all; import from LibItsCommon_ASN1_NamedNumbers all; import from LibItsCommon_Pixits all; - + // LibItsSecurity import from LibItsSecurity_TypesAndValues all; import from LibItsSecurity_Templates all; import from LibItsSecurity_Functions all; import from LibItsSecurity_Pixits all; - + // LibItsHttp import from LibItsHttp_TypesAndValues all; import from LibItsHttp_TestSystem all; - + // LibItsPki + import from LibItsPki_TypesAndValues all; import from LibItsPki_Templates all; + import from LibItsPki_Pics all; import from LibItsPki_TestSystem all; - - group pkiConfigurationFunctions { + + group pkiConfigurationFunctions { /** * @desc Setups default configuration @@ -129,6 +131,36 @@ module LibItsPki_Functions { } // End of function f_uninitialiseSecuredMode() } // End of pkiConfigurationFunctions + + group ac_port { + + function f_sendAcPkiPrimitive( + in octetstring p_private_key, + in octetstring p_publicKeyCompressed, + in integer p_compressedMode + ) runs on ItsPki { + var AcSetSecurityData v_ac_set_security_data; + + v_ac_set_security_data := { PICS_TS_CERTIFICATE_ID, PICS_IUT_CERTIFICATE_ID, p_private_key, p_publicKeyCompressed, p_compressedMode }; + acPkiPort.send(AcPkiPrimitive: { acSetSecurityData := v_ac_set_security_data }); + tc_ac.start; + alt { + [] acPkiPort.receive(AcPkiResponse: { result := true }) { + tc_ac.stop; + } + [] acPkiPort.receive(AcPkiResponse: { result := false }) { + tc_ac.stop; + log("*** f_sendAcPkiPrimitive: ERROR: Received unexpected message ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] tc_ac.timeout { + log("*** f_sendAcPkiPrimitive: ERROR: Timeout while waiting for adapter control event result ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } // End of 'alt' statement + } + + } // End of group ac_port group inner_ec_xxx { diff --git a/ttcn/Pki/LibItsPki_Pics.ttcn b/ttcn/Pki/LibItsPki_Pics.ttcn new file mode 100644 index 00000000..8dd99594 --- /dev/null +++ b/ttcn/Pki/LibItsPki_Pics.ttcn @@ -0,0 +1,28 @@ +module LibItsPki_Pics { + + /** + * @desc Does the IUT act as ITS-S device? + */ + modulepar boolean PICS_IUT_ITS_S_ROLE := false; + + /** + * @desc Does the IUT act as EA device? + */ + modulepar boolean PICS_IUT_EA_ROLE := true; + + /** + * @desc Does the IUT act as AA device? + */ + modulepar boolean PICS_IUT_AA_ROLE := false; + + /** + * @desc Certificate used by the IUT + */ + modulepar charstring PICS_IUT_CERTIFICATE_ID := "CERT_IUT_A_EA"; + + /** + * @desc Certificate used by the Test System + */ + modulepar charstring PICS_TS_CERTIFICATE_ID := "CERT_TS_A_EA"; + +} // End of module LibItsPki_Pics -- GitLab From b8fe1ca2e826050cb7de7c354e5c15c27e0f68f0 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 18 Oct 2018 12:31:35 +0200 Subject: [PATCH 137/320] STF545: Execute tests TC_SEC_PKI_SND_EA_BV_01 & TC_SEC_PKI_SND_EA_BV_02 --- ttcn/Pki/LibItsPki_Functions.ttcn | 141 ++++++++++++++++++++----- ttcn/Pki/LibItsPki_TestSystem.ttcn | 6 +- ttcn/Pki/LibItsPki_TypesAndValues.ttcn | 6 ++ 3 files changed, 126 insertions(+), 27 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 742c2b03..38e26093 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -78,7 +78,8 @@ module LibItsPki_Functions { * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT */ function f_cfHttpUp( - in charstring p_certificateId := "CERT_TS_A_EA" // TODO Use a constant + in charstring p_certificateId := "CERT_TS_A_EA", // TODO Use a constant + in charstring p_peerCertificateId := "CERT_IUT_A_EA" ) runs on ItsPkiHttp /* TITAN TODO: system ItsPkiHttpSystem */ { map(self:httpPort, system:httpPort); @@ -92,7 +93,9 @@ module LibItsPki_Functions { f_prepareCertificates(p_certificateId, vc_aaCertificate, vc_atCertificate); f_readCertificate(p_certificateId, vc_eaCertificate); f_readSigningKey(p_certificateId, vc_eaPrivateKey); + f_readEncryptingKey(p_certificateId, vc_eaPrivateEncKey); f_getCertificateDigest(p_certificateId, vc_eaHashedId8); + f_getCertificateHash(p_peerCertificateId, vc_eaPeerWholeHash); } // End of function f_cfHttpUp /** @@ -161,14 +164,48 @@ module LibItsPki_Functions { } } // End of group ac_port + + group http { + + function f_http_build_enrolment_request( + out octetstring p_private_key, + out octetstring p_publicKeyX, + out octetstring p_publicKeyY, + out octetstring p_publicKeyCompressed, + out integer p_compressedMode, + out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data + ) runs on ItsPkiHttp { + var InnerEcRequest v_inner_ec_request; + var Ieee1609Dot2Data v_inner_ec_request_signed_for_pop; + var bitstring v_inner_ec_request_signed_for_pop_msg; + + if (f_generate_inner_ec_request(p_private_key, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressedMode, v_inner_ec_request) == false) { + log("*** f_http_build_enrolment_request: ERROR: Failed to generate InnerEcRequest ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + // Generate InnerEcRequestSignedForPoP + if (f_generate_inner_ec_request_signed_for_pop(p_private_key, v_inner_ec_request, v_inner_ec_request_signed_for_pop) == false) { + log("*** f_http_build_enrolment_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + // Secure InnerEcRequestSignedForPoP message + v_inner_ec_request_signed_for_pop_msg := encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop)); + if (f_build_pki_secured_message(vc_eaPrivateKey, valueof(m_signerIdentifier_self), vc_eaHashedId8, p_publicKeyCompressed, p_compressedMode, bit2oct(v_inner_ec_request_signed_for_pop_msg), p_ieee1609dot2_signed_and_encrypted_data) == false) { + log("*** f_http_build_enrolment_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + log("*** f_http_build_enrolment_request: DEBUF: p_ieee1609dot2_signed_and_encrypted_data = ", p_ieee1609dot2_signed_and_encrypted_data); + } // End of function f_http_build_enrolment_request + + } // End of group http group inner_ec_xxx { function f_generate_inner_ec_request( - out Oct32 p_private_key, - out Oct32 p_publicKeyX, - out Oct32 p_publicKeyY, - out Oct32 p_publicKeyCompressed, + out octetstring p_private_key, + out octetstring p_publicKeyX, + out octetstring p_publicKeyY, + out octetstring p_publicKeyCompressed, out integer p_compressedMode, out InnerEcRequest p_inner_ec_request ) return boolean { @@ -223,7 +260,7 @@ module LibItsPki_Functions { } // End of function f_generate_inner_ec_request function f_generate_inner_ec_request_signed_for_pop( - in Oct32 p_private_key, + in octetstring p_private_key, in InnerEcRequest p_inner_ec_request, out Ieee1609Dot2Data p_inner_ec_request_signed_for_pop ) return boolean { @@ -231,7 +268,7 @@ module LibItsPki_Functions { var template (value) EccP256CurvePoint v_eccP256_curve_point; var octetstring v_encoded_inner_ec_request; var template (value) ToBeSignedData v_tbs; - var Oct32 v_tbs_signed; + var octetstring v_tbs_signed; // Encode it v_encoded_inner_ec_request := bit2oct(encvalue(p_inner_ec_request)); @@ -269,6 +306,24 @@ module LibItsPki_Functions { return true; } // End of function f_generate_inner_ec_request_signed_for_pop + function f_generate_inner_ec_response( + in octetstring p_inner_ec_request_hashed_id, + in EtsiTs103097Certificate p_certificate, + out InnerEcResponse p_inner_ec_response + ) return boolean { + // Local variables + + // Build the Proof of Possession InnerEcResponse + p_inner_ec_response := valueof( + m_innerEcResponse_ok( + substr(p_inner_ec_request_hashed_id, 0, 16), + p_certificate + ) + ); + + return true; + } // End of function f_generate_inner_ec_response + } // End of group inner_ec_xxx group pki_functions { @@ -289,7 +344,7 @@ module LibItsPki_Functions { in octetstring p_private_key, in SignerIdentifier p_signer_identifier, in HashedId8 p_recipientId, - in Oct32 p_publicKeyCompressed, + in octetstring p_publicKeyCompressed, in integer p_compressedMode, in octetstring p_pki_message, out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data @@ -297,14 +352,14 @@ module LibItsPki_Functions { // Local variables var template (value) EccP256CurvePoint v_eccP256_curve_point; var template (value) ToBeSignedData v_tbs; - var Oct32 v_tbs_signed; + var octetstring v_tbs_signed; var template (value) Ieee1609Dot2Data v_ieee1609dot2_signed_data; var octetstring v_encoded_inner_ec_request; var Oct12 v_nonce; var Oct16 v_authentication_vector; var Oct16 v_encrypted_sym_key; var HashedId8 v_recipientId; - var Oct32 v_publicEphemeralKeyCompressed; + var octetstring v_publicEphemeralKeyCompressed; var integer v_ephemeralKeyModeCompressed; var octetstring v_encrypted_inner_ec_request; @@ -385,25 +440,61 @@ module LibItsPki_Functions { return true; } // End of function f_build_pki_secured_message - - function f_generate_inner_ec_response( - in Oct32 p_inner_ec_request_hashed_id, - in EtsiTs103097Certificate p_certificate, - out InnerEcResponse p_inner_ec_response - ) return boolean { + + function f_verify_pki_message( + in octetstring v_private_enc_key, + in octetstring p_issuer, + in Certificate p_peer_certificate, + in Ieee1609Dot2Data p_ieee1609dot2_encrypted_and_signed_data, + in boolean p_check_signature := true, + out EtsiTs102941Data p_etsi_ts_102941_data + ) return boolean { // Local variables + var Ieee1609Dot2Data v_ieee1609dot2_signed_data; + var bitstring v_etsi_ts_102941_data_msg; + var bitstring v_tbs; + var boolean v_ret; - // Build the Proof of Possession InnerEcResponse - p_inner_ec_response := valueof( - m_innerEcResponse_ok( - substr(p_inner_ec_request_hashed_id, 0, 16), - p_certificate - ) - ); + // 1. Decrypt the data + if (f_decrypt(v_private_enc_key, p_ieee1609dot2_encrypted_and_signed_data, v_ieee1609dot2_signed_data) == false) { + return false; + } + log("v_ieee1609dot2_signed_data= ", v_ieee1609dot2_signed_data); + + // 2. Check the signature + v_tbs := encvalue(v_ieee1609dot2_signed_data.content.signedData.tbsData); + if (ischosen(p_peer_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256.compressed_y_0)) { + v_ret := f_verifyWithEcdsaNistp256WithSha256( + bit2oct(v_tbs), + p_issuer, + v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaNistP256Signature.rSig.x_only & v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaNistP256Signature.sSig, + p_peer_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256.compressed_y_0, + 0); + } else { + v_ret := f_verifyWithEcdsaNistp256WithSha256( + bit2oct(v_tbs), + p_issuer, + v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaNistP256Signature.rSig.x_only & v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaNistP256Signature.sSig, + p_peer_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256.compressed_y_1, + 1); + } + if ((v_ret == false) and (p_check_signature == true)) { + return false; + } + + // 3. Retrun the PKI message + v_etsi_ts_102941_data_msg := oct2bit(v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); + if (decvalue(v_etsi_ts_102941_data_msg, p_etsi_ts_102941_data) != 0) { + return false; + } + + if (p_etsi_ts_102941_data.version != PkiProtocolVersion) { + return false; + } return true; - } // End of function f_generate_inner_ec_response - + } // End of function f_verify_pki_message + } // End of group inner_ec_xxx } // End of module LibItsPki_Functions diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index 1dd7f998..e6680422 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -72,8 +72,10 @@ module LibItsPki_TestSystem { type component ItsPkiHttp extends ItsSecurityBaseComponent, HttpComponent { var Certificate vc_eaCertificate; /** Test Adapter EA certificate */ - var octetstring vc_eaPrivateKey; /** Test Adapter EA proivate key for signature */ - var HashedId8 vc_eaHashedId8; /** Test Adapter EA HashedId8 for RecipientId */ + var octetstring vc_eaPrivateKey; /** Test Adapter EA private key for signature */ + var octetstring vc_eaPrivateEncKey; /** Test Adapter EA private key for encryption */ + var HashedId8 vc_eaHashedId8; /** Test Adapter EA HashedId8 for decryption of IUT's response */ + var octetstring vc_eaPeerWholeHash; /** IUT EA whole-hash for signature check */ } // End of component ItsPki type component ItsPkiItss extends ItsGeoNetworking { diff --git a/ttcn/Pki/LibItsPki_TypesAndValues.ttcn b/ttcn/Pki/LibItsPki_TypesAndValues.ttcn index c02194a8..425c4285 100644 --- a/ttcn/Pki/LibItsPki_TypesAndValues.ttcn +++ b/ttcn/Pki/LibItsPki_TypesAndValues.ttcn @@ -9,6 +9,12 @@ * All rights reserved. */ module LibItsPki_TypesAndValues { + + group constants { + + const integer PkiProtocolVersion := 1; + + } // End of group constants group acPrimitives { -- GitLab From 919a3f4268398c424b892ce4b7bc79f88f3baa3f Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 19 Oct 2018 07:52:21 +0200 Subject: [PATCH 138/320] Add support of AcSecPrimitive for CAM & DENM --- ttcn/Pki/LibItsPki_Functions.ttcn | 70 ++++++++++++++++++++++++++++-- ttcn/Pki/LibItsPki_TestSystem.ttcn | 8 ++-- 2 files changed, 70 insertions(+), 8 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 38e26093..075ee346 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -42,6 +42,7 @@ module LibItsPki_Functions { // LibItsHttp import from LibItsHttp_TypesAndValues all; + import from LibItsHttp_Templates all; import from LibItsHttp_TestSystem all; // LibItsPki @@ -71,6 +72,8 @@ module LibItsPki_Functions { f_prepareCertificates(p_certificateId, vc_aaCertificate, vc_atCertificate); f_readCertificate(p_certificateId, vc_eaCertificate); + + activate(a_default_pki()); } // End of function f_cfUp /** @@ -96,8 +99,21 @@ module LibItsPki_Functions { f_readEncryptingKey(p_certificateId, vc_eaPrivateEncKey); f_getCertificateDigest(p_certificateId, vc_eaHashedId8); f_getCertificateHash(p_peerCertificateId, vc_eaPeerWholeHash); + + activate(a_default_pki_http()); } // End of function f_cfHttpUp + function f_cfUp_itss( + in charstring p_certificateId := "CERT_TS_A_EA" // TODO Use a constant + ) runs on ItsPkiItss /* TITAN TODO: system ItsPkiItssSystem */ { + + f_cfUp(); + + map(self:geoNetworkingPort, system:geoNetworkingPort); + + activate(a_default_pki()); + } // End of function f_cfUp_itss + /** * @desc Deletes default configuration */ @@ -115,6 +131,15 @@ module LibItsPki_Functions { f_disconnect4SelfOrClientSync(); } // End of function f_cfHttpDown + /** + * @desc Deletes default configuration + */ + function f_cfDown_itss() runs on ItsPkiItss /* TITAN TODO: system ItsPkiItssSystem */ { + unmap(self:geoNetworkingPort, system:geoNetworkingPort); + + f_cfDown(); + } // End of function f_cfDown + /** * @desc Initialise secure mode if required */ @@ -446,7 +471,7 @@ module LibItsPki_Functions { in octetstring p_issuer, in Certificate p_peer_certificate, in Ieee1609Dot2Data p_ieee1609dot2_encrypted_and_signed_data, - in boolean p_check_signature := true, + in boolean p_check_security := true, out EtsiTs102941Data p_etsi_ts_102941_data ) return boolean { // Local variables @@ -456,7 +481,7 @@ module LibItsPki_Functions { var boolean v_ret; // 1. Decrypt the data - if (f_decrypt(v_private_enc_key, p_ieee1609dot2_encrypted_and_signed_data, v_ieee1609dot2_signed_data) == false) { + if ((p_check_security == true) and (f_decrypt(v_private_enc_key, p_ieee1609dot2_encrypted_and_signed_data, v_ieee1609dot2_signed_data) == false)) { return false; } log("v_ieee1609dot2_signed_data= ", v_ieee1609dot2_signed_data); @@ -478,7 +503,7 @@ module LibItsPki_Functions { p_peer_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256.compressed_y_1, 1); } - if ((v_ret == false) and (p_check_signature == true)) { + if ((v_ret == false) and (p_check_security == true)) { return false; } @@ -488,7 +513,7 @@ module LibItsPki_Functions { return false; } - if (p_etsi_ts_102941_data.version != PkiProtocolVersion) { + if ((p_check_security == true) and (p_etsi_ts_102941_data.version != PkiProtocolVersion)) { return false; } @@ -497,4 +522,41 @@ module LibItsPki_Functions { } // End of group inner_ec_xxx + group altstes { + + altstep a_default_pki() runs on ItsPki { + [] pkiPort.receive { + tc_ac.stop; + log("*** a_default: ERROR: Unexpected PKI message received ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + } + + altstep a_default_pki_http() runs on ItsPkiHttp { + [] httpPort.receive( + mw_http_response( + mw_http_response_ko + )) { + tc_ac.stop; + log("*** a_default: ERROR: HTTP Server error ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] httpPort.receive(mw_http_request) { + tc_ac.stop; + log("*** a_default: ERROR: Unexpected HTTP Request received ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] httpPort.receive(mw_http_response) { + tc_ac.stop; + log("*** a_default: ERROR: Unexpected HTTP Response received ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] httpPort.receive { + tc_ac.stop; + log("*** a_default: ERROR: Unexpected HTTP message received ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + } + } + } // End of module LibItsPki_Functions diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index e6680422..aa10d241 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -60,7 +60,8 @@ module LibItsPki_TestSystem { type component ItsPkiHttpSystem extends HttpTestAdapter{ } // End of component ItsPkiHttpSystem - type component ItsPkiItssSystem extends ItsPkiSystem, ItsGeoNetworking { + type component ItsPkiItssSystem extends ItsPkiSystem { + port GeoNetworkingPort geoNetworkingPort; } // End of component ItsPkiItssSystem type component ItsPki extends ItsSecurityBaseComponent, ItsBaseMtc { @@ -78,9 +79,8 @@ module LibItsPki_TestSystem { var octetstring vc_eaPeerWholeHash; /** IUT EA whole-hash for signature check */ } // End of component ItsPki - type component ItsPkiItss extends ItsGeoNetworking { - port AdapterControlPkiPort acPkiPort; - port PkiPort pkiPort; + type component ItsPkiItss extends ItsPki { + port GeoNetworkingPort geoNetworkingPort; } // End of component ItsPkiItss } // End of module LibItsPki_TestSystem -- GitLab From 82720e1582ec32c60abcbb99d5ac0db17a8c93e5 Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 19 Oct 2018 12:03:26 +0200 Subject: [PATCH 139/320] STF545: Review TPlan --- ttcn/Pki/LibItsPki_Functions.ttcn | 18 ++++++++++++------ ttcn/Pki/LibItsPki_Pixits.ttcn | 4 ++++ 2 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 ttcn/Pki/LibItsPki_Pixits.ttcn diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 075ee346..a499a1b2 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -481,8 +481,10 @@ module LibItsPki_Functions { var boolean v_ret; // 1. Decrypt the data - if ((p_check_security == true) and (f_decrypt(v_private_enc_key, p_ieee1609dot2_encrypted_and_signed_data, v_ieee1609dot2_signed_data) == false)) { - return false; + if (f_decrypt(v_private_enc_key, p_ieee1609dot2_encrypted_and_signed_data, v_ieee1609dot2_signed_data) == false) { + if (p_check_security == true) { + return false; + } } log("v_ieee1609dot2_signed_data= ", v_ieee1609dot2_signed_data); @@ -503,8 +505,10 @@ module LibItsPki_Functions { p_peer_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256.compressed_y_1, 1); } - if ((v_ret == false) and (p_check_security == true)) { - return false; + if (v_ret == false) { + if (p_check_security == true) { + return false; + } } // 3. Retrun the PKI message @@ -513,8 +517,10 @@ module LibItsPki_Functions { return false; } - if ((p_check_security == true) and (p_etsi_ts_102941_data.version != PkiProtocolVersion)) { - return false; + if (p_etsi_ts_102941_data.version != PkiProtocolVersion) { + if (p_check_security == true) { + return false; + } } return true; diff --git a/ttcn/Pki/LibItsPki_Pixits.ttcn b/ttcn/Pki/LibItsPki_Pixits.ttcn new file mode 100644 index 00000000..578a8194 --- /dev/null +++ b/ttcn/Pki/LibItsPki_Pixits.ttcn @@ -0,0 +1,4 @@ +module LibItsPki_Pixits { + + +} // End of module LibItsPki_Pixits -- GitLab From ac2eae90843f4b2de20374f51d8de85787d56bee Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Tue, 23 Oct 2018 13:52:35 +0200 Subject: [PATCH 140/320] Implement EA test cases, clause 5.4.2 Enrolment response --- ttcn/Pki/LibItsPki_Functions.ttcn | 121 +++++++++++++++++++++++-- ttcn/Pki/LibItsPki_Pics.ttcn | 5 + ttcn/Pki/LibItsPki_TypesAndValues.ttcn | 7 +- 3 files changed, 126 insertions(+), 7 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index a499a1b2..179d7c03 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -198,7 +198,8 @@ module LibItsPki_Functions { out octetstring p_publicKeyY, out octetstring p_publicKeyCompressed, out integer p_compressedMode, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data + out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, + out Oct32 p_hash_inner_ec_request_signed_for_pop ) runs on ItsPkiHttp { var InnerEcRequest v_inner_ec_request; var Ieee1609Dot2Data v_inner_ec_request_signed_for_pop; @@ -215,11 +216,46 @@ module LibItsPki_Functions { } // Secure InnerEcRequestSignedForPoP message v_inner_ec_request_signed_for_pop_msg := encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop)); + // Get 16 last byte of SHA256 of InnerEcRequestSignedForPop + p_hash_inner_ec_request_signed_for_pop := f_hashWithSha256(bit2oct(v_inner_ec_request_signed_for_pop_msg)); if (f_build_pki_secured_message(vc_eaPrivateKey, valueof(m_signerIdentifier_self), vc_eaHashedId8, p_publicKeyCompressed, p_compressedMode, bit2oct(v_inner_ec_request_signed_for_pop_msg), p_ieee1609dot2_signed_and_encrypted_data) == false) { log("*** f_http_build_enrolment_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); f_selfOrClientSyncAndVerdict("error", e_error); } - log("*** f_http_build_enrolment_request: DEBUF: p_ieee1609dot2_signed_and_encrypted_data = ", p_ieee1609dot2_signed_and_encrypted_data); + log("*** f_http_build_enrolment_request: DEBUG: p_ieee1609dot2_signed_and_encrypted_data = ", p_ieee1609dot2_signed_and_encrypted_data); + } // End of function f_http_build_enrolment_request + + function f_http_build_invalid_enrolment_request( + out octetstring p_private_key, + out octetstring p_publicKeyX, + out octetstring p_publicKeyY, + out octetstring p_publicKeyCompressed, + out integer p_compressedMode, + out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, + out Oct32 p_hash_inner_ec_request_signed_for_pop + ) runs on ItsPkiHttp { + var InnerEcRequest v_inner_ec_request; + var Ieee1609Dot2Data v_inner_ec_request_signed_for_pop; + var bitstring v_inner_ec_request_signed_for_pop_msg; + + if (f_generate_inner_ec_request(p_private_key, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressedMode, v_inner_ec_request) == false) { + log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequest ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + // Generate InnerEcRequestSignedForPoP + if (f_generate_inner_ec_request_signed_for_pop(p_private_key, v_inner_ec_request, v_inner_ec_request_signed_for_pop) == false) { + log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + // Secure InnerEcRequestSignedForPoP message + v_inner_ec_request_signed_for_pop_msg := encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop)); + // Get 16 last byte of SHA256 of InnerEcRequestSignedForPop + p_hash_inner_ec_request_signed_for_pop := f_hashWithSha256(bit2oct(int2oct(12345, 32))); // Invalue InnseEcRequestSignedForPop + if (f_build_pki_secured_message(vc_eaPrivateKey, valueof(m_signerIdentifier_self), vc_eaHashedId8, p_publicKeyCompressed, p_compressedMode, bit2oct(v_inner_ec_request_signed_for_pop_msg), p_ieee1609dot2_signed_and_encrypted_data) == false) { + log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + log("*** f_http_build_invalid_enrolment_request: DEBUG: p_ieee1609dot2_signed_and_encrypted_data = ", p_ieee1609dot2_signed_and_encrypted_data); } // End of function f_http_build_enrolment_request } // End of group http @@ -352,7 +388,7 @@ module LibItsPki_Functions { } // End of group inner_ec_xxx group pki_functions { - + /** * @desc Build a signed and encrypted PKI message * @param p_private_key Private key for signature @@ -387,7 +423,8 @@ module LibItsPki_Functions { var octetstring v_publicEphemeralKeyCompressed; var integer v_ephemeralKeyModeCompressed; var octetstring v_encrypted_inner_ec_request; - + + // Signed the encoded PKI message v_tbs := m_toBeSignedData( m_signedDataPayload( @@ -465,7 +502,17 @@ module LibItsPki_Functions { return true; } // End of function f_build_pki_secured_message - + + /** + * @desc Verify the protocol element of the Pki message + * @param p_private_key Private key for encryption + * @param p_issuer Issuer + * @param p_peer_certificate IUT EA certificate identifier + * @param p_ieee1609dot2_encrypted_and_signed_data The public compressed key (canonical form) for encryption + * @param p_check_security Set to true to check signatures + * @param p_etsi_ts_102941_data The EtsiTs102941Data message + * @return true on success, false otherwise + */ function f_verify_pki_message( in octetstring v_private_enc_key, in octetstring p_issuer, @@ -525,7 +572,69 @@ module LibItsPki_Functions { return true; } // End of function f_verify_pki_message - + + /** + * @desc Verify the generated EA certificate + * @param p_ea_certificate The new EA certificate + * @param p_publicKeyCompressed The public compressed key (canonical form) for signature check + * @param p_compressedMode The public compressed key mode + * @return true on success, false otherwise + */ + function f_verify_ea_certificate( + in Certificate p_ea_certificate, + in octetstring p_publicKeyCompressed, + in integer p_compressedMode + ) return boolean { + var bitstring v_encoded_tbs; + var boolean v_result; + + // Check certificate format + v_result := match(p_ea_certificate, mw_etsiTs103097Certificate(mw_issuerIdentifier_self, mw_toBeSignedCertificate_ea, -)); + // Check the signer + + // Check EA certificate signature + v_encoded_tbs := encvalue(p_ea_certificate.toBeSigned); + v_result := v_result and f_verifyWithEcdsaNistp256WithSha256( + bit2oct(v_encoded_tbs), + int2oct(0, 32), // self + p_ea_certificate.signature_.ecdsaNistP256Signature.rSig.x_only & p_ea_certificate.signature_.ecdsaNistP256Signature.sSig, + p_publicKeyCompressed, + p_compressedMode); + + return v_result; + } // End of function f_verify_ea_certificate + + /** + * @desc Verify the generated AA certificate + * @param p_aa_certificate The new EA certificate + * @param p_publicKeyCompressed The public compressed key (canonical form) for signature check + * @param p_compressedMode The public compressed key mode + * @return true on success, false otherwise + */ + function f_verify_aa_certificate( + in Certificate p_aa_certificate, + in octetstring p_publicKeyCompressed, + in integer p_compressedMode + ) return boolean { + var bitstring v_encoded_tbs; + var boolean v_result; + + // Check certificate format + v_result := match(p_aa_certificate, mw_etsiTs103097Certificate(mw_issuerIdentifier_self, mw_toBeSignedCertificate_aa, -)); + // Check the signer + + // Check EA certificate signature + v_encoded_tbs := encvalue(p_aa_certificate.toBeSigned); + v_result := v_result and f_verifyWithEcdsaNistp256WithSha256( + bit2oct(v_encoded_tbs), + int2oct(0, 32), // self + p_aa_certificate.signature_.ecdsaNistP256Signature.rSig.x_only & p_aa_certificate.signature_.ecdsaNistP256Signature.sSig, + p_publicKeyCompressed, + p_compressedMode); + + return v_result; + } // End of function f_verify_aa_certificate + } // End of group inner_ec_xxx group altstes { diff --git a/ttcn/Pki/LibItsPki_Pics.ttcn b/ttcn/Pki/LibItsPki_Pics.ttcn index 8dd99594..484455ab 100644 --- a/ttcn/Pki/LibItsPki_Pics.ttcn +++ b/ttcn/Pki/LibItsPki_Pics.ttcn @@ -25,4 +25,9 @@ module LibItsPki_Pics { */ modulepar charstring PICS_TS_CERTIFICATE_ID := "CERT_TS_A_EA"; + /** + * @desc Certificate used by the Test System + */ + modulepar charstring PICS_HTTP_GET_URI := "/its/inner_ec_request"; + } // End of module LibItsPki_Pics diff --git a/ttcn/Pki/LibItsPki_TypesAndValues.ttcn b/ttcn/Pki/LibItsPki_TypesAndValues.ttcn index 425c4285..f326acc0 100644 --- a/ttcn/Pki/LibItsPki_TypesAndValues.ttcn +++ b/ttcn/Pki/LibItsPki_TypesAndValues.ttcn @@ -9,10 +9,15 @@ * All rights reserved. */ module LibItsPki_TypesAndValues { - + + // LibIts + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + group constants { const integer PkiProtocolVersion := 1; + + const Psid its_aid_secured_cert_request := 12345; } // End of group constants -- GitLab From 8e744cf391c13c37d39cb7de10b6d265e94d5013 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 25 Oct 2018 10:33:35 +0200 Subject: [PATCH 141/320] STF545: Add InnerAcRequest/Response support, UpperTester port for ITS-S --- ttcn/Common/LibItsCommon_TypesAndValues.ttcn | 2 +- ttcn/Pki/LibItsPki_Functions.ttcn | 78 ++++++++++++- ttcn/Pki/LibItsPki_Templates.ttcn | 111 +++++++++++++++++-- ttcn/Pki/LibItsPki_TestSystem.ttcn | 20 ++++ ttcn/Pki/LibItsPki_TypesAndValues.ttcn | 61 +++++++++- 5 files changed, 252 insertions(+), 20 deletions(-) diff --git a/ttcn/Common/LibItsCommon_TypesAndValues.ttcn b/ttcn/Common/LibItsCommon_TypesAndValues.ttcn index 85104033..41c700e1 100644 --- a/ttcn/Common/LibItsCommon_TypesAndValues.ttcn +++ b/ttcn/Common/LibItsCommon_TypesAndValues.ttcn @@ -152,7 +152,7 @@ module LibItsCommon_TypesAndValues { const integer c_its_aid_IVI := 139; const integer c_its_aid_TLC := 140; const integer c_its_aid_GN := 141; - const integer c_its_aid_SCR := 36; // Secured Certificate Request + const integer c_its_aid_SCR := 35; // Secured Certificate Request } } with { diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 179d7c03..2924a249 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -98,6 +98,7 @@ module LibItsPki_Functions { f_readSigningKey(p_certificateId, vc_eaPrivateKey); f_readEncryptingKey(p_certificateId, vc_eaPrivateEncKey); f_getCertificateDigest(p_certificateId, vc_eaHashedId8); + f_readCertificate(p_peerCertificateId, vc_peerEaCertificate); f_getCertificateHash(p_peerCertificateId, vc_eaPeerWholeHash); activate(a_default_pki_http()); @@ -110,6 +111,8 @@ module LibItsPki_Functions { f_cfUp(); map(self:geoNetworkingPort, system:geoNetworkingPort); + map(self:utPort, system:utPort); + map(self:acPort, system:acPort); activate(a_default_pki()); } // End of function f_cfUp_itss @@ -136,6 +139,8 @@ module LibItsPki_Functions { */ function f_cfDown_itss() runs on ItsPkiItss /* TITAN TODO: system ItsPkiItssSystem */ { unmap(self:geoNetworkingPort, system:geoNetworkingPort); + unmap(self:utPort, system:utPort); + unmap(self:acPort, system:acPort); f_cfDown(); } // End of function f_cfDown @@ -186,10 +191,70 @@ module LibItsPki_Functions { f_selfOrClientSyncAndVerdict("error", e_timeout); } } // End of 'alt' statement - } + } // End of function f_sendAcPkiPrimitive } // End of group ac_port + group ut_port { + + function f_utInitializeIut(template (value) UtPkiInitialize p_init) runs on ItsPkiItss { + + utPort.send(p_init); + tc_wait.start; + alt { + [] utPort.receive(UtPkiResults: { utPkiInitializeResult := true }) { + tc_wait.stop; + log("*** f_utInitializeIut: INFO: IUT initialized ***"); + } + [] utPort.receive { + tc_wait.stop; + log("*** f_utInitializeIut: INFO: IUT could not be initialized ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] tc_wait.timeout { + log("*** f_utInitializeIut: INFO: IUT could not be initialized in time ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } + + } // End of function f_utInitializeIut + + function f_sendUtTriggerPrimitive( + in HashAlgorithm p_hashAlgorithm, + in octetstring p_private_key, + in octetstring p_publicKeyCompressed, + in integer p_compressedMode + ) runs on ItsPkiItss { + var TriggerEnrolmentRequest v_ut_trigger_enrolment_request; + var octetstring v_compressed_public_key; + + if (p_compressedMode == 2) { // TODO v_compressed_public_key := int2oct(p_compressedMode, 1) & p_publicKeyCompressed? + v_compressed_public_key := '02'O & p_publicKeyCompressed; + } else { + v_compressed_public_key := '03'O & p_publicKeyCompressed; + } + + v_ut_trigger_enrolment_request := { p_hashAlgorithm, p_private_key, v_compressed_public_key }; + utPort.send(UtPkiTrigger: { triggerEnrolmentRequest := v_ut_trigger_enrolment_request }); + tc_ac.start; + alt { + [] utPort.receive(UtPkiResults: { utPkiTriggerResult := true }) { + tc_ac.stop; + } + [] utPort.receive(UtPkiResults: { utPkiTriggerResult := false }) { + tc_ac.stop; + log("*** f_sendUtTriggerPrimitive: ERROR: Received unexpected message ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] tc_ac.timeout { + log("*** f_sendAcPkiPrimitive: ERROR: Timeout while waiting for adapter control event result ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } // End of 'alt' statement + } // End of function f_sendUtTriggerPrimitive + + } // End of group ut_port + group http { function f_http_build_enrolment_request( @@ -222,7 +287,9 @@ module LibItsPki_Functions { log("*** f_http_build_enrolment_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); f_selfOrClientSyncAndVerdict("error", e_error); } - log("*** f_http_build_enrolment_request: DEBUG: p_ieee1609dot2_signed_and_encrypted_data = ", p_ieee1609dot2_signed_and_encrypted_data); + log("*** f_http_build_enrolment_request: DEBUG: v_inner_ec_request_signed_for_pop_msg= ", v_inner_ec_request_signed_for_pop_msg); + log("*** f_http_build_enrolment_request: DEBUG: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); + log("*** f_http_build_enrolment_request: DEBUG: p_hash_inner_ec_request_signed_for_pop= ", p_hash_inner_ec_request_signed_for_pop); } // End of function f_http_build_enrolment_request function f_http_build_invalid_enrolment_request( @@ -250,13 +317,13 @@ module LibItsPki_Functions { // Secure InnerEcRequestSignedForPoP message v_inner_ec_request_signed_for_pop_msg := encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop)); // Get 16 last byte of SHA256 of InnerEcRequestSignedForPop - p_hash_inner_ec_request_signed_for_pop := f_hashWithSha256(bit2oct(int2oct(12345, 32))); // Invalue InnseEcRequestSignedForPop + p_hash_inner_ec_request_signed_for_pop := f_hashWithSha256(int2oct(12345, 32)); // Invalid InnseEcRequestSignedForPop if (f_build_pki_secured_message(vc_eaPrivateKey, valueof(m_signerIdentifier_self), vc_eaHashedId8, p_publicKeyCompressed, p_compressedMode, bit2oct(v_inner_ec_request_signed_for_pop_msg), p_ieee1609dot2_signed_and_encrypted_data) == false) { log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); f_selfOrClientSyncAndVerdict("error", e_error); } log("*** f_http_build_invalid_enrolment_request: DEBUG: p_ieee1609dot2_signed_and_encrypted_data = ", p_ieee1609dot2_signed_and_encrypted_data); - } // End of function f_http_build_enrolment_request + } // End of function f_http_build_invalid_enrolment_request } // End of group http @@ -424,13 +491,12 @@ module LibItsPki_Functions { var integer v_ephemeralKeyModeCompressed; var octetstring v_encrypted_inner_ec_request; - // Signed the encoded PKI message v_tbs := m_toBeSignedData( m_signedDataPayload( m_etsiTs103097Data_unsecured(p_pki_message) ), - m_headerInfo_inner_ec_request(12345, f_getCurrentTimeUtc()) // TODO Use PIXIT + m_headerInfo_inner_ec_request(c_its_aid_SCR, f_getCurrentTimeUtc()) ); if (ischosen(p_signer_identifier.self_)) { v_tbs_signed := f_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), int2oct(0, 32), p_private_key); diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn index e641266f..a931c2d2 100644 --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ b/ttcn/Pki/LibItsPki_Templates.ttcn @@ -26,16 +26,20 @@ module LibItsPki_Templates { import from IEEE1609dot2 language "ASN.1:1997" all; import from EtsiTs102941BaseTypes language "ASN.1:1997" all; import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; + import from EtsiTs102941TypesAuthorization language "ASN.1:1997" all; import from EtsiTs102941MessagesItss language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; // LibItsSecurity import from LibItsSecurity_Templates all; + // LibItsPki + import from LibItsPki_TypesAndValues all; + template (value) EtsiTs102941Data m_etsiTs102941Data_inner_ec_request_signed_for_pop( in template (value) InnerEcRequestSignedForPop p_inner_ec_request_signed_for_pop ) := { - version := 1, + version := PkiProtocolVersion, content := { enrolmentRequest := p_inner_ec_request_signed_for_pop } @@ -44,12 +48,30 @@ module LibItsPki_Templates { template (value) EtsiTs102941Data m_etsiTs102941Data_inner_ec_response( in template (value) InnerEcResponse p_inner_ec_response ) := { - version := 1, + version := PkiProtocolVersion, content := { enrolmentResponse := p_inner_ec_response } } // End of template m_etsiTs102941Data_inner_ec_response + template (value) EtsiTs102941Data m_etsiTs102941Data_inner_at_request( + in template (value) InnerAtRequest p_inner_at_response + ) := { + version := PkiProtocolVersion, + content := { + authorizationRequest := p_inner_at_response + } + } // End of template m_etsiTs102941Data_inner_at_request + + template (value) EtsiTs102941Data m_etsiTs102941Data_inner_at_response( + in template (value) InnerAtResponse p_inner_at_response + ) := { + version := PkiProtocolVersion, + content := { + authorizationResponse := p_inner_at_response + } + } // End of template m_etsiTs102941Data_inner_at_response + template (value) EnrolmentRequestMessage m_enrolmentRequestMessage( in template (value) EncryptedData p_encryptedData ) modifies m_etsiTs103097Data_encrypted := { @@ -59,6 +81,16 @@ module LibItsPki_Templates { template (present) EncryptedData p_encryptedData := ? ) modifies mw_etsiTs103097Data_encrypted := { } // End of template mw_enrolmentResponseMessage + + template (value) AuthorizationRequestMessage m_authorizationRequestMessage( + in template (value) EncryptedData p_encryptedData + ) modifies m_etsiTs103097Data_encrypted := { + } // End of template m_authorizationRequestMessage + + template (value) AuthorizationResponseMessage m_authorizationResponseMessage( + in template (value) EncryptedData p_encryptedData + ) modifies m_etsiTs103097Data_encrypted := { + } // End of template m_authorizationResponseMessage template (value) EtsiTs102941DataContent m_enrolmentRequest( in template (value) InnerEcRequestSignedForPop p_enrolmentRequest @@ -72,6 +104,18 @@ module LibItsPki_Templates { enrolmentResponse := p_enrolmentResponse } // End of template mw_enrolmentResponse + template (value) EtsiTs102941DataContent m_authorizationRequest( + in template (value) InnerAtRequest p_authorizationRequest + ) := { + authorizationRequest := p_authorizationRequest + } // End of template m_authorizationRequest + + template (present) EtsiTs102941DataContent mw_authorizationResponse( + template (present) InnerAtResponse p_authorizationResponse := ? + ) := { + authorizationResponse := p_authorizationResponse + } // End of template mw_authorizationResponse + template (value) InnerEcRequest m_innerEcRequest( in template (value) charstring p_itsId, in template (value) PublicKeys p_publicKeys, @@ -94,6 +138,30 @@ module LibItsPki_Templates { requestedSubjectAttributes := p_requestedSubjectAttributes } // End of template mw_innerEcRequest + template (value) InnerAtRequest m_innerAtRequest( + in template (value) PublicKeys p_publicKeys, + in template (value) Oct32 p_hmacKey, + in template (value) SharedAtRequest p_sharedAtRequest, + in template (value) EcSignature p_ecSignature + ) := { + publicKeys := p_publicKeys, + hmacKey := p_hmacKey, + sharedAtRequest := p_sharedAtRequest, + ecSignature := p_ecSignature + } // End of template m_innerAtRequest + + template (present) InnerAtRequest mw_innerAtRequest( + template (present) PublicKeys p_publicKeys := ?, + template (present) Oct32 p_hmacKey := ?, + template (present) SharedAtRequest p_sharedAtRequest := ?, + template (present) EcSignature p_ecSignature := ? + ) := { + publicKeys := p_publicKeys, + hmacKey := p_hmacKey, + sharedAtRequest := p_sharedAtRequest, + ecSignature := p_ecSignature + } // End of template mw_innerAtRequest + template (omit) PublicKeys m_publicKeys( in template (value) PublicVerificationKey p_verificationKey, in template (omit) PublicEncryptionKey p_encryptionKey := omit @@ -101,7 +169,7 @@ module LibItsPki_Templates { verificationKey := p_verificationKey, encryptionKey := p_encryptionKey } // End of template m_publicKeys - + template PublicKeys mw_publicKeys( template (present) PublicVerificationKey p_verificationKey := ?, template PublicEncryptionKey p_encryptionKey := * @@ -109,7 +177,7 @@ module LibItsPki_Templates { verificationKey := p_verificationKey, encryptionKey := p_encryptionKey } // End of template mw_publicKeys - + template (omit) CertificateSubjectAttributes m_certificateSubjectAttributes( in template (value) SequenceOfPsidSsp p_appPermissions, in template (omit) ValidityPeriod p_validityPeriod := omit, @@ -123,7 +191,7 @@ module LibItsPki_Templates { appPermissions := p_appPermissions, certIssuePermissions := omit } // End of template m_certificateSubjectAttributes - + template (value) InnerEcResponse m_innerEcResponse_ok( in template (value) Oct16 p_requestHash, in template (value) EtsiTs103097Certificate p_certificate @@ -132,7 +200,7 @@ module LibItsPki_Templates { responseCode := ok, certificate := p_certificate } // End of template m_innerEcResponse_ok - + template (present) InnerEcResponse mw_innerEcResponse_ok( template (present) Oct16 p_requestHash := ?, template (present) EtsiTs103097Certificate p_certificate := ? @@ -141,7 +209,7 @@ module LibItsPki_Templates { responseCode := ok, certificate := p_certificate } // End of template mw_innerEcResponse_ok - + template (value) InnerEcResponse m_innerEcResponse_ko( in template (value) Oct16 p_requestHash, in template (value) EnrolmentResponseCode p_responseCode @@ -150,16 +218,41 @@ module LibItsPki_Templates { responseCode := p_responseCode, certificate := omit } // End of template m_innerEcResponse_ko - + template (present) InnerEcResponse mw_innerEcResponse_ko( template (present) Oct16 p_requestHash := ?, template (present) EnrolmentResponseCode p_responseCode := complement(ok) ) := { requestHash := p_requestHash, responseCode := p_responseCode, - certificate := * + certificate := omit } // End of template mw_innerEcResponse_ko + template (value) InnerAtResponse m_innerAtResponse_ok( + in template (value) Oct16 p_requestHash, + in template (value) EtsiTs103097Certificate p_certificate + ) := { + requestHash := p_requestHash, + responseCode := ok, + certificate := p_certificate + } // End of template m_innerAtResponse_ok + + template (present) InnerAtResponse mw_innerAtResponse_ok( + template (present) Oct16 p_requestHash := ?, + template (present) EtsiTs103097Certificate p_certificate := ? + ) := { + requestHash := p_requestHash, + responseCode := ok, + certificate := p_certificate + } // End of template mw_innerAtResponse_ok + template (present) InnerAtResponse mw_innerAtResponse_ko( + template (present) Oct16 p_requestHash := ?, + template (present) AuthorizationResponseCode p_responseCode := complement(ok) + ) := { + requestHash := p_requestHash, + responseCode := p_responseCode, + certificate := omit + } // End of template mw_innerAtResponse_ko } // End of module LibItsPki_Templates diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index aa10d241..87cbf884 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -47,6 +47,21 @@ module LibItsPki_TestSystem { out AcPkiPrimitive; in AcPkiResponse; } // End of AdapterControlPkiPort + /** + * @desc Adapter control port + */ + type port AdapterControlPort message { + out AcPkiPrimitive; + in AcPkiResponse; + } // End of AdapterControlPort + + /** + * @desc Upper Tester port + */ + type port UpperTesterPort message { + out UtPkiInitialize, UtPkiTrigger; + in UtPkiResults; + } // End of UpperTesterPort type port PkiPort message { inout InnerEcRequest, InnerEcResponse; @@ -61,6 +76,8 @@ module LibItsPki_TestSystem { } // End of component ItsPkiHttpSystem type component ItsPkiItssSystem extends ItsPkiSystem { + port AdapterControlPort acPort; + port UpperTesterPort utPort; port GeoNetworkingPort geoNetworkingPort; } // End of component ItsPkiItssSystem @@ -76,10 +93,13 @@ module LibItsPki_TestSystem { var octetstring vc_eaPrivateKey; /** Test Adapter EA private key for signature */ var octetstring vc_eaPrivateEncKey; /** Test Adapter EA private key for encryption */ var HashedId8 vc_eaHashedId8; /** Test Adapter EA HashedId8 for decryption of IUT's response */ + var Certificate vc_peerEaCertificate; /** IUT EA certificate for signature check */ var octetstring vc_eaPeerWholeHash; /** IUT EA whole-hash for signature check */ } // End of component ItsPki type component ItsPkiItss extends ItsPki { + port AdapterControlPort acPort; + port UpperTesterPort utPort; port GeoNetworkingPort geoNetworkingPort; } // End of component ItsPkiItss diff --git a/ttcn/Pki/LibItsPki_TypesAndValues.ttcn b/ttcn/Pki/LibItsPki_TypesAndValues.ttcn index f326acc0..c6fc9492 100644 --- a/ttcn/Pki/LibItsPki_TypesAndValues.ttcn +++ b/ttcn/Pki/LibItsPki_TypesAndValues.ttcn @@ -10,6 +10,10 @@ */ module LibItsPki_TypesAndValues { + // LibCommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; + // LibIts import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; @@ -17,8 +21,6 @@ module LibItsPki_TypesAndValues { const integer PkiProtocolVersion := 1; - const Psid its_aid_secured_cert_request := 12345; - } // End of group constants group acPrimitives { @@ -52,11 +54,62 @@ module LibItsPki_TypesAndValues { encode "LibItsPki" } // AcSetSecurityData - } // end acPrimitives - with { + } with { variant "" encode "AdapterControl" + } // End of group acPrimitives + + group utPrimitives { + + /** + * @desc Upper Tester message to initialize ITS-S IUT + * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use + */ + type record UtPkiInitialize { + Oct8 hashedId8 + } with { + variant "FIELDORDER(msb)" } + + /** + * @desc Upper Tester results message of the PKI ITS-S IUT + */ + type union UtPkiResults { + boolean utPkiInitializeResult, + boolean utPkiTriggerResult + } with { + variant "" + } // End of type UtPkiResults + + /** + * @desc UT primitives for PKI ITS-S IUT + * @member triggerEnrolmentRequest Request to trigger an EnrolmentRequest + */ + type union UtPkiTrigger { + TriggerEnrolmentRequest triggerEnrolmentRequest + } with { + variant "" + } // End of type UtPkiTrigger + + /** + * @desc Request to trigger an EnrolmentRequest + * @member hashAlgorithm The Hash algorithm to be used (sha256 or sha384) + * @member privateKey The private key to be used for signature of the requested EA certificate + * @member compressedPublickey The compressed public key to be used for signature of the requested EA certificate (format: [02|03] + */ + type record TriggerEnrolmentRequest { + HashAlgorithm hashAlgorithm, + octetstring privateKey, + octetstring compressedPublickey + } with { + variant "FIELDORDER(msb)" + } // End of type TriggerEnrolmentRequest + + } with { + encode "UpperTester" + variant "" + } // End of group utPrimitives + } with { variant "" -- GitLab From 4f886d5386270e1172f354bebb75c2808a9638ac Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 26 Oct 2018 10:08:01 +0200 Subject: [PATCH 142/320] STF545: Add InnerAcRequest/Response support, UpperTester port for ITS-S --- ttcn/Pki/LibItsPki_Functions.ttcn | 55 ++++++++----- ttcn/Pki/LibItsPki_Templates.ttcn | 20 ++++- ttcn/Pki/LibItsPki_TestSystem.ttcn | 110 ++++++++++++++----------- ttcn/Pki/LibItsPki_TypesAndValues.ttcn | 72 ++++++++-------- 4 files changed, 151 insertions(+), 106 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 2924a249..e7001039 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -34,11 +34,15 @@ module LibItsPki_Functions { import from LibItsCommon_ASN1_NamedNumbers all; import from LibItsCommon_Pixits all; + // LibItsGeoNetworking + import from LibItsGeoNetworking_Pixits all; + // LibItsSecurity import from LibItsSecurity_TypesAndValues all; import from LibItsSecurity_Templates all; import from LibItsSecurity_Functions all; import from LibItsSecurity_Pixits all; + import from LibItsSecurity_TestSystem all; // LibItsHttp import from LibItsHttp_TypesAndValues all; @@ -58,19 +62,16 @@ module LibItsPki_Functions { * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT */ function f_cfUp( - in charstring p_certificateId := "CERT_TS_A_EA" // TODO Use a constant + in charstring p_certificateId := "CERT_TS_A_EA", // TODO Use a constant + in charstring p_peerCertificateId := "CERT_IUT_A_EA" ) runs on ItsPki /* TITAN TODO: system ItsPkiSystem */ { - + map(self:pkiPort, system:pkiPort); map(self:acPkiPort, system:acPkiPort); f_connect4SelfOrClientSync(); - if( not f_loadCertificates(PX_IUT_SEC_CONFIG_NAME) ) { - log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); - stop; - } + f_initialiseSecuredMode(p_certificateId, p_peerCertificateId); - f_prepareCertificates(p_certificateId, vc_aaCertificate, vc_atCertificate); f_readCertificate(p_certificateId, vc_eaCertificate); activate(a_default_pki()); @@ -87,13 +88,9 @@ module LibItsPki_Functions { map(self:httpPort, system:httpPort); f_connect4SelfOrClientSync(); + + f_initialiseSecuredMode(p_certificateId, p_peerCertificateId); - if( not f_loadCertificates(PX_IUT_SEC_CONFIG_NAME) ) { - log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); - stop; - } - - f_prepareCertificates(p_certificateId, vc_aaCertificate, vc_atCertificate); f_readCertificate(p_certificateId, vc_eaCertificate); f_readSigningKey(p_certificateId, vc_eaPrivateKey); f_readEncryptingKey(p_certificateId, vc_eaPrivateEncKey); @@ -114,9 +111,11 @@ module LibItsPki_Functions { map(self:utPort, system:utPort); map(self:acPort, system:acPort); + f_initializeState(); + activate(a_default_pki()); } // End of function f_cfUp_itss - + /** * @desc Deletes default configuration */ @@ -124,6 +123,7 @@ module LibItsPki_Functions { unmap(self:pkiPort, system:pkiPort); unmap(self:acPkiPort, system:acPkiPort); f_disconnect4SelfOrClientSync(); + f_uninitialiseSecuredMode(); } // End of function f_cfDown /** @@ -132,6 +132,7 @@ module LibItsPki_Functions { function f_cfHttpDown() runs on ItsPkiHttp /* TITAN TODO: system ItsPkiHttpSystem */ { unmap(self:httpPort, system:httpPort); f_disconnect4SelfOrClientSync(); + f_uninitialiseSecuredMode(); } // End of function f_cfHttpDown /** @@ -148,21 +149,37 @@ module LibItsPki_Functions { /** * @desc Initialise secure mode if required */ - function f_initialiseSecuredMode() runs on ItsPki { + function f_initialiseSecuredMode( + in charstring p_certificateId := "CERT_TS_A_EA", // TODO Use a constant + in charstring p_peerCertificateId := "CERT_IUT_A_EA" + ) runs on ItsSecurityBaseComponent { // Local variables // Load certificates if( not f_loadCertificates(PX_IUT_SEC_CONFIG_NAME) ) { log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); + setverdict(inconc); stop; } + f_prepareCertificates(p_certificateId, vc_aaCertificate, vc_atCertificate); } // End of function f_initialiseSecuredMode() - - function f_uninitialiseSecuredMode() runs on ItsPki { + + function f_uninitialiseSecuredMode() runs on ItsSecurityBaseComponent { f_unloadCertificates(); } // End of function f_uninitialiseSecuredMode() - + + function f_initializeState() runs on ItsPkiItss { + var Oct8 v_hashedId8ToBeUsed := f_setupIutCertificate(vc_hashedId8ToBeUsed); + + f_utInitializeIut(UtPkiInitialize: { v_hashedId8ToBeUsed } ); + + f_sleep(PX_NEIGHBOUR_DISCOVERY_DELAY); + + // f_acLoadScenario(p_scenario); + // f_acStartScenario(); + } + } // End of pkiConfigurationFunctions group ac_port { @@ -281,7 +298,7 @@ module LibItsPki_Functions { } // Secure InnerEcRequestSignedForPoP message v_inner_ec_request_signed_for_pop_msg := encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop)); - // Get 16 last byte of SHA256 of InnerEcRequestSignedForPop + // Prepae for getting the 16 most bytes of SHA256 of InnerEcRequestSignedForPop p_hash_inner_ec_request_signed_for_pop := f_hashWithSha256(bit2oct(v_inner_ec_request_signed_for_pop_msg)); if (f_build_pki_secured_message(vc_eaPrivateKey, valueof(m_signerIdentifier_self), vc_eaHashedId8, p_publicKeyCompressed, p_compressedMode, bit2oct(v_inner_ec_request_signed_for_pop_msg), p_ieee1609dot2_signed_and_encrypted_data) == false) { log("*** f_http_build_enrolment_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn index a931c2d2..bdf6e9b6 100644 --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ b/ttcn/Pki/LibItsPki_Templates.ttcn @@ -77,6 +77,11 @@ module LibItsPki_Templates { ) modifies m_etsiTs103097Data_encrypted := { } // End of template m_enrolmentRequestMessage + template (present) EnrolmentRequestMessage mw_enrolmentRequestMessage( + template (present) EncryptedData p_encryptedData := ? + ) modifies mw_etsiTs103097Data_encrypted := { + } // End of template mw_enrolmentRequestMessage + template (present) EnrolmentRequestMessage mw_enrolmentResponseMessage( template (present) EncryptedData p_encryptedData := ? ) modifies mw_etsiTs103097Data_encrypted := { @@ -88,8 +93,8 @@ module LibItsPki_Templates { } // End of template m_authorizationRequestMessage template (value) AuthorizationResponseMessage m_authorizationResponseMessage( - in template (value) EncryptedData p_encryptedData - ) modifies m_etsiTs103097Data_encrypted := { + in template (value) EncryptedData p_encryptedData + ) modifies m_etsiTs103097Data_encrypted := { } // End of template m_authorizationResponseMessage template (value) EtsiTs102941DataContent m_enrolmentRequest( @@ -98,6 +103,17 @@ module LibItsPki_Templates { enrolmentRequest := p_enrolmentRequest } // End of template m_enrolmentRequest + template (present) EtsiTs102941DataContent mw_enrolmentRequest( + template (present) InnerEcRequestSignedForPop p_enrolmentRequest := ? + ) := { + enrolmentRequest := p_enrolmentRequest + } // End of template mw_enrolmentRequest + + template (present) InnerEcRequestSignedForPop mw_innerEcRequestSignedForPop( + template (present) SignedData p_signedData := ? + ) modifies mw_etsiTs103097Data_signed := { + } // End of template mw_innerEcRequestSignedForPop + template (present) EtsiTs102941DataContent mw_enrolmentResponse( template (present) InnerEcResponse p_enrolmentResponse := ? ) := { diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index 87cbf884..ac4f1f33 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -15,11 +15,6 @@ module LibItsPki_TestSystem { import from LibCommon_Sync all; import from LibCommon_Time all; - // LibItsCommon - import from LibItsCommon_TestSystem all; - import from LibItsCommon_TypesAndValues all; - import from LibItsExternal_TypesAndValues all; - // LibIts import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; import from IEEE1609dot2 language "ASN.1:1997" all; @@ -28,58 +23,75 @@ module LibItsPki_TestSystem { import from EtsiTs102941MessagesItss language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; - // LibItsHttp - import from LibItsHttp_TestSystem all; - - // LibItsSecurity - import from LibItsSecurity_TestSystem all; - - // LibItsGeoNetworking - import from LibItsGeoNetworking_TestSystem all; + // LibItsCommon + import from LibItsCommon_TestSystem all; + import from LibItsCommon_TypesAndValues all; // LibItsPki import from LibItsPki_TypesAndValues all; - /** - * @desc Adapter control port - */ - type port AdapterControlPkiPort message { - out AcPkiPrimitive; - in AcPkiResponse; - } // End of AdapterControlPkiPort - /** - * @desc Adapter control port - */ - type port AdapterControlPort message { - out AcPkiPrimitive; - in AcPkiResponse; - } // End of AdapterControlPort - - /** - * @desc Upper Tester port - */ - type port UpperTesterPort message { - out UtPkiInitialize, UtPkiTrigger; - in UtPkiResults; - } // End of UpperTesterPort + // LibItsGeoNetworking + import from LibItsGeoNetworking_TestSystem all; - type port PkiPort message { - inout InnerEcRequest, InnerEcResponse; - } + // LibItsSecurity + import from LibItsSecurity_TestSystem all; - type component ItsPkiSystem { - port AdapterControlPkiPort acPkiPort; - port PkiPort pkiPort; - } // End of component ItsPkiSystem + // LibItsHttp + import from LibItsHttp_TestSystem all; - type component ItsPkiHttpSystem extends HttpTestAdapter{ - } // End of component ItsPkiHttpSystem + group portDefinitions { + + /** + * @desc Adapter control port + */ + type port AdapterControlPort message { + out AcPkiPrimitive; + in AcPkiResponse; + } // End of AdapterControlPort + + /** + * @desc Adapter control port + */ + type port AdapterControlPkiPort message { + out AcPkiPrimitive; + in AcPkiResponse; + } // End of AdapterControlPkiPort + + /** + * @desc Upper Tester port + */ + type port UpperTesterPort message { + out UtPkiInitialize, UtPkiTrigger; + in UtPkiResults; + } // End of UpperTesterPort + + } // End of group portDefinitions + + group interfacePorts { + + type port PkiPort message { + inout InnerEcRequest, InnerEcResponse; + } // End of PkiPort + + } // End of group interfacePorts - type component ItsPkiItssSystem extends ItsPkiSystem { - port AdapterControlPort acPort; - port UpperTesterPort utPort; - port GeoNetworkingPort geoNetworkingPort; - } // End of component ItsPkiItssSystem + group componentDefinitions { + + type component ItsPkiSystem { + port AdapterControlPkiPort acPkiPort; + port PkiPort pkiPort; + } // End of component ItsPkiSystem + + type component ItsPkiHttpSystem extends HttpTestAdapter{ + } // End of component ItsPkiHttpSystem + + type component ItsPkiItssSystem extends ItsPkiSystem { + port AdapterControlPort acPort; + port UpperTesterPort utPort; + port GeoNetworkingPort geoNetworkingPort; + } // End of component ItsPkiItssSystem + + } // End of group componentDefinitions type component ItsPki extends ItsSecurityBaseComponent, ItsBaseMtc { port AdapterControlPkiPort acPkiPort; diff --git a/ttcn/Pki/LibItsPki_TypesAndValues.ttcn b/ttcn/Pki/LibItsPki_TypesAndValues.ttcn index c6fc9492..259ef17c 100644 --- a/ttcn/Pki/LibItsPki_TypesAndValues.ttcn +++ b/ttcn/Pki/LibItsPki_TypesAndValues.ttcn @@ -23,42 +23,6 @@ module LibItsPki_TypesAndValues { } // End of group constants - group acPrimitives { - - /** - * @desc TA primitives for Pki - */ - type union AcPkiPrimitive { - AcSetSecurityData acSetSecurityData - } with { - variant "" - } - - /** - * @desc Primitive for receiveing response from TA - */ - type union AcPkiResponse { - boolean result - } with { - variant "" - } - - type record AcSetSecurityData { - charstring certificateId, - charstring peer_certificateId, - octetstring private_key, - octetstring public_key_compressed, - integer public_key_compressed_mode - } with { - variant "" - encode "LibItsPki" - } // AcSetSecurityData - - } with { - variant "" - encode "AdapterControl" - } // End of group acPrimitives - group utPrimitives { /** @@ -110,6 +74,42 @@ module LibItsPki_TypesAndValues { variant "" } // End of group utPrimitives + group acPrimitives { + + /** + * @desc TA primitives for Pki + */ + type union AcPkiPrimitive { + AcSetSecurityData acSetSecurityData + } with { + variant "" + } + + /** + * @desc Primitive for receiveing response from TA + */ + type union AcPkiResponse { + boolean result + } with { + variant "" + } + + type record AcSetSecurityData { + charstring certificateId, + charstring peer_certificateId, + octetstring private_key, + octetstring public_key_compressed, + integer public_key_compressed_mode + } with { + variant "" + encode "LibItsPki" + } // AcSetSecurityData + + } with { + variant "" + encode "AdapterControl" + } // End of group acPrimitives + } with { variant "" -- GitLab From d704b5eb249a02ecae138415370d7153fa25f687 Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 26 Oct 2018 10:42:05 +0200 Subject: [PATCH 143/320] STF545: Remove useless files --- ttcn/Pki/LibItsPki_Functions.ttcn | 10 +++++----- ttcn/Pki/LibItsPki_TestSystem.ttcn | 14 ++------------ 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index e7001039..c13c1f27 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -67,7 +67,7 @@ module LibItsPki_Functions { ) runs on ItsPki /* TITAN TODO: system ItsPkiSystem */ { map(self:pkiPort, system:pkiPort); - map(self:acPkiPort, system:acPkiPort); + map(self:acPort, system:acPort); f_connect4SelfOrClientSync(); f_initialiseSecuredMode(p_certificateId, p_peerCertificateId); @@ -121,7 +121,7 @@ module LibItsPki_Functions { */ function f_cfDown() runs on ItsPki /* TITAN TODO: system ItsPkiSystem */ { unmap(self:pkiPort, system:pkiPort); - unmap(self:acPkiPort, system:acPkiPort); + unmap(self:acPort, system:acPort); f_disconnect4SelfOrClientSync(); f_uninitialiseSecuredMode(); } // End of function f_cfDown @@ -192,13 +192,13 @@ module LibItsPki_Functions { var AcSetSecurityData v_ac_set_security_data; v_ac_set_security_data := { PICS_TS_CERTIFICATE_ID, PICS_IUT_CERTIFICATE_ID, p_private_key, p_publicKeyCompressed, p_compressedMode }; - acPkiPort.send(AcPkiPrimitive: { acSetSecurityData := v_ac_set_security_data }); + acPort.send(AcPkiPrimitive: { acSetSecurityData := v_ac_set_security_data }); tc_ac.start; alt { - [] acPkiPort.receive(AcPkiResponse: { result := true }) { + [] acPort.receive(AcPkiResponse: { result := true }) { tc_ac.stop; } - [] acPkiPort.receive(AcPkiResponse: { result := false }) { + [] acPort.receive(AcPkiResponse: { result := false }) { tc_ac.stop; log("*** f_sendAcPkiPrimitive: ERROR: Received unexpected message ***"); f_selfOrClientSyncAndVerdict("error", e_error); diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index ac4f1f33..426a0b7a 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -49,14 +49,6 @@ module LibItsPki_TestSystem { in AcPkiResponse; } // End of AdapterControlPort - /** - * @desc Adapter control port - */ - type port AdapterControlPkiPort message { - out AcPkiPrimitive; - in AcPkiResponse; - } // End of AdapterControlPkiPort - /** * @desc Upper Tester port */ @@ -78,7 +70,7 @@ module LibItsPki_TestSystem { group componentDefinitions { type component ItsPkiSystem { - port AdapterControlPkiPort acPkiPort; + port AdapterControlPort acPort; port PkiPort pkiPort; } // End of component ItsPkiSystem @@ -86,7 +78,6 @@ module LibItsPki_TestSystem { } // End of component ItsPkiHttpSystem type component ItsPkiItssSystem extends ItsPkiSystem { - port AdapterControlPort acPort; port UpperTesterPort utPort; port GeoNetworkingPort geoNetworkingPort; } // End of component ItsPkiItssSystem @@ -94,7 +85,7 @@ module LibItsPki_TestSystem { } // End of group componentDefinitions type component ItsPki extends ItsSecurityBaseComponent, ItsBaseMtc { - port AdapterControlPkiPort acPkiPort; + port AdapterControlPort acPort; port PkiPort pkiPort; var Certificate vc_eaCertificate; /** Test Adapter EA certificate */ @@ -110,7 +101,6 @@ module LibItsPki_TestSystem { } // End of component ItsPki type component ItsPkiItss extends ItsPki { - port AdapterControlPort acPort; port UpperTesterPort utPort; port GeoNetworkingPort geoNetworkingPort; } // End of component ItsPkiItss -- GitLab From 2550f00a115fba30d0e326aba6a744b4a4e961be Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 30 Oct 2018 15:35:06 +0100 Subject: [PATCH 144/320] Add work-around for PKI AdanpterControlPort and UpperTesterPort due to incomplete _BASE class declaration --- ttcn/Pki/LibItsPki_Functions.ttcn | 5 ++-- ttcn/Pki/LibItsPki_Templates.ttcn | 34 +++++++++++++++++++++++--- ttcn/Pki/LibItsPki_TestSystem.ttcn | 12 ++++----- ttcn/Pki/LibItsPki_TypesAndValues.ttcn | 6 +++-- 4 files changed, 43 insertions(+), 14 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index c13c1f27..2924ab65 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -237,7 +237,8 @@ module LibItsPki_Functions { } // End of function f_utInitializeIut function f_sendUtTriggerPrimitive( - in HashAlgorithm p_hashAlgorithm, + in charstring p_cannonicalId, + in Oct1 p_encAlgorithm, in octetstring p_private_key, in octetstring p_publicKeyCompressed, in integer p_compressedMode @@ -251,7 +252,7 @@ module LibItsPki_Functions { v_compressed_public_key := '03'O & p_publicKeyCompressed; } - v_ut_trigger_enrolment_request := { p_hashAlgorithm, p_private_key, v_compressed_public_key }; + v_ut_trigger_enrolment_request := { p_cannonicalId, p_encAlgorithm, p_private_key, v_compressed_public_key }; utPort.send(UtPkiTrigger: { triggerEnrolmentRequest := v_ut_trigger_enrolment_request }); tc_ac.start; alt { diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn index bdf6e9b6..0becc37d 100644 --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ b/ttcn/Pki/LibItsPki_Templates.ttcn @@ -27,6 +27,7 @@ module LibItsPki_Templates { import from EtsiTs102941BaseTypes language "ASN.1:1997" all; import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; import from EtsiTs102941TypesAuthorization language "ASN.1:1997" all; + import from EtsiTs102941TypesAuthorizationValidation language "ASN.1:1997" all; import from EtsiTs102941MessagesItss language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; @@ -72,10 +73,10 @@ module LibItsPki_Templates { } } // End of template m_etsiTs102941Data_inner_at_response - template (value) EnrolmentRequestMessage m_enrolmentRequestMessage( - in template (value) EncryptedData p_encryptedData - ) modifies m_etsiTs103097Data_encrypted := { - } // End of template m_enrolmentRequestMessage + template (value) EtsiTs103097Data m_authorizationValidationRequestMessage( + in template (value) EncryptedData p_encryptedData + ) modifies m_etsiTs103097Data_encrypted := { + } // End of template m_authorizationValidationRequestMessage template (present) EnrolmentRequestMessage mw_enrolmentRequestMessage( template (present) EncryptedData p_encryptedData := ? @@ -271,4 +272,29 @@ module LibItsPki_Templates { certificate := omit } // End of template mw_innerAtResponse_ko + template (value) AuthorizationValidationRequest m_authorizationValidationRequest( + in template (value) SharedAtRequest p_sharedAtRequest, + in template (value) EcSignature p_ecSignature + ) := { + sharedAtRequest := p_sharedAtRequest, + ecSignature := p_ecSignature + } // End of template m_authorizationValidationRequest + + template (present) AuthorizationValidationResponse mw_authorizationValidationResponse_ok( + template (present) Oct16 p_requestHash := ?, + template (present) CertificateSubjectAttributes p_confirmedSubjectAttributes := ? + ) := { + requestHash := p_requestHash, + responseCode := ok, + confirmedSubjectAttributes := p_confirmedSubjectAttributes + } // End of template mw_authorizationValidationResponse_ok + + template (present) AuthorizationValidationResponse mw_authorizationValidationResponse_ko( + template (present) Oct16 p_requestHash := ? + ) := { + requestHash := p_requestHash, + responseCode := complement(ok), + confirmedSubjectAttributes := omit + } // End of template mw_authorizationValidationResponse_ko + } // End of module LibItsPki_Templates diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index 426a0b7a..2f58761e 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -44,7 +44,7 @@ module LibItsPki_TestSystem { /** * @desc Adapter control port */ - type port AdapterControlPort message { + type port AdapterControlPkiPort message { out AcPkiPrimitive; in AcPkiResponse; } // End of AdapterControlPort @@ -52,7 +52,7 @@ module LibItsPki_TestSystem { /** * @desc Upper Tester port */ - type port UpperTesterPort message { + type port UpperTesterPkiPort message { // TODO This is a work-around for a TITAN bug: UpperTesterPort_BASE class declared after UpperTesterPort class out UtPkiInitialize, UtPkiTrigger; in UtPkiResults; } // End of UpperTesterPort @@ -70,7 +70,7 @@ module LibItsPki_TestSystem { group componentDefinitions { type component ItsPkiSystem { - port AdapterControlPort acPort; + port AdapterControlPkiPort acPort; port PkiPort pkiPort; } // End of component ItsPkiSystem @@ -78,14 +78,14 @@ module LibItsPki_TestSystem { } // End of component ItsPkiHttpSystem type component ItsPkiItssSystem extends ItsPkiSystem { - port UpperTesterPort utPort; + port UpperTesterPkiPort utPort; port GeoNetworkingPort geoNetworkingPort; } // End of component ItsPkiItssSystem } // End of group componentDefinitions type component ItsPki extends ItsSecurityBaseComponent, ItsBaseMtc { - port AdapterControlPort acPort; + port AdapterControlPkiPort acPort; port PkiPort pkiPort; var Certificate vc_eaCertificate; /** Test Adapter EA certificate */ @@ -101,7 +101,7 @@ module LibItsPki_TestSystem { } // End of component ItsPki type component ItsPkiItss extends ItsPki { - port UpperTesterPort utPort; + port UpperTesterPkiPort utPort; port GeoNetworkingPort geoNetworkingPort; } // End of component ItsPkiItss diff --git a/ttcn/Pki/LibItsPki_TypesAndValues.ttcn b/ttcn/Pki/LibItsPki_TypesAndValues.ttcn index 259ef17c..c064e282 100644 --- a/ttcn/Pki/LibItsPki_TypesAndValues.ttcn +++ b/ttcn/Pki/LibItsPki_TypesAndValues.ttcn @@ -57,12 +57,14 @@ module LibItsPki_TypesAndValues { /** * @desc Request to trigger an EnrolmentRequest - * @member hashAlgorithm The Hash algorithm to be used (sha256 or sha384) + * @member cannonicalId The canonical identifier of the ITS-S + * @member encAlgorithm The encrypion algorithm to be used (Nist P256 or Brainpool P256) * @member privateKey The private key to be used for signature of the requested EA certificate * @member compressedPublickey The compressed public key to be used for signature of the requested EA certificate (format: [02|03] */ type record TriggerEnrolmentRequest { - HashAlgorithm hashAlgorithm, + charstring cannonicalId, + Oct1 encAlgorithm, octetstring privateKey, octetstring compressedPublickey } with { -- GitLab From b74f5807ac05ad5862f26df23cdf75d6519c5ffa Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 1 Nov 2018 13:58:58 +0100 Subject: [PATCH 145/320] Add support of AuthorizarionRequest/Response --- ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn | 13 + ttcn/Pki/LibItsPki_Functions.ttcn | 382 ++++++++++++++++++-- ttcn/Pki/LibItsPki_Pics.ttcn | 5 + ttcn/Pki/LibItsPki_Templates.ttcn | 64 ++++ ttcn/Pki/LibItsPki_TestSystem.ttcn | 7 +- ttcn/Security/LibItsSecurity_Templates.ttcn | 3 +- 6 files changed, 443 insertions(+), 31 deletions(-) diff --git a/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn b/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn index 41c9fdde..c0605f1c 100644 --- a/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn +++ b/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn @@ -3,6 +3,8 @@ module LibItsPki_EncdecDeclarations { // LibIts import from EtsiTs102941BaseTypes language "ASN.1:1997" all; import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; + import from EtsiTs102941TypesAuthorization language "ASN.1:1997" all; + import from EtsiTs102941TypesAuthorizationValidation language "ASN.1:1997" all; import from EtsiTs102941MessagesItss language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; @@ -37,4 +39,15 @@ module LibItsPki_EncdecDeclarations { external function fx_dec_InnerEcResponse(inout bitstring b, out EtsiTs102941TypesEnrolment.InnerEcResponse p) return integer with {extension "prototype(sliding) decode(PER)"} + /** + * @desc Encoding function for EtsiTs102941TypesAuthorization SharedAtRequest + * @param p The certificate to encode + * @return The encode message in OER format + */ + external function fx_enc_SharedAtRequest(in EtsiTs102941TypesAuthorization.SharedAtRequest p) return bitstring + with {extension "prototype(convert) encode(PER)"} + + external function fx_dec_SharedAtRequest(inout bitstring b, out EtsiTs102941TypesAuthorization.SharedAtRequest p) return integer + with {extension "prototype(sliding) decode(PER)"} + } // End of module LibItsPki_EncdecDeclarations diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 2924ab65..a2ef750b 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -23,6 +23,8 @@ module LibItsPki_Functions { import from IEEE1609dot2 language "ASN.1:1997" all; import from EtsiTs102941BaseTypes language "ASN.1:1997" all; import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; + import from EtsiTs102941TypesAuthorization language "ASN.1:1997" all; + import from EtsiTs102941TypesAuthorizationValidation language "ASN.1:1997" all; import from EtsiTs102941MessagesItss language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; import from ITS_Container language "ASN.1:1997" all; @@ -73,6 +75,7 @@ module LibItsPki_Functions { f_initialiseSecuredMode(p_certificateId, p_peerCertificateId); f_readCertificate(p_certificateId, vc_eaCertificate); + f_getCertificateDigest(p_certificateId, vc_eaHashedId8); activate(a_default_pki()); } // End of function f_cfUp @@ -252,7 +255,7 @@ module LibItsPki_Functions { v_compressed_public_key := '03'O & p_publicKeyCompressed; } - v_ut_trigger_enrolment_request := { p_cannonicalId, p_encAlgorithm, p_private_key, v_compressed_public_key }; + v_ut_trigger_enrolment_request := { p_cannonicalId, p_encAlgorithm, p_private_key, v_compressed_public_key }; utPort.send(UtPkiTrigger: { triggerEnrolmentRequest := v_ut_trigger_enrolment_request }); tc_ac.start; alt { @@ -309,7 +312,7 @@ module LibItsPki_Functions { log("*** f_http_build_enrolment_request: DEBUG: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); log("*** f_http_build_enrolment_request: DEBUG: p_hash_inner_ec_request_signed_for_pop= ", p_hash_inner_ec_request_signed_for_pop); } // End of function f_http_build_enrolment_request - + function f_http_build_invalid_enrolment_request( out octetstring p_private_key, out octetstring p_publicKeyX, @@ -344,6 +347,114 @@ module LibItsPki_Functions { } // End of function f_http_build_invalid_enrolment_request } // End of group http + + group generate_certificates { + + function f_generate_ec_certificate( + in octetstring p_private_key, + in InnerEcRequest p_inner_ec_request, + out Certificate p_ec_certificate + ) return boolean { + var SequenceOfPsidSsp v_appPermissions := { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs + valueof(m_appPermissions(36, { bitmapSsp := '830001'O })), + valueof(m_appPermissions(37, { bitmapSsp := '830001'O })) + }; + var template (value) EtsiTs103097Certificate v_cert; + var bitstring v_tbs; + var Oct32 v_sig; + var bitstring v_enc_msg; + + v_cert := m_etsiTs103097Certificate( + m_issuerIdentifier_sha256AndDigest(f_HashedId8FromSha256(f_hashWithSha256('616263'O))), + m_toBeSignedCertificate_at( + v_appPermissions, + m_verificationKeyIndicator_verificationKey( + m_publicVerificationKey_ecdsaNistP256( + p_inner_ec_request.publicKeys.verificationKey.ecdsaNistP256 + )), + m_validityPeriod( + 17469212, + m_duration_years(10) + ), + m_geographicRegion_identifiedRegion( + { + m_identifiedRegion_country_only(12), + m_identifiedRegion_country_only(34) + } + ) + ) + ); + // Encode it ==> Get octetstring + v_tbs := encvalue(v_cert.toBeSigned); + // Sign the certificate using ECDSA/SHA-256 (NIST p-256) + v_sig := f_signWithEcdsaNistp256WithSha256(bit2oct(v_tbs), int2oct(11, 32), p_private_key); + v_cert.signature_ := m_signature_ecdsaNistP256( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only( + substr(v_sig, 0, 32) + ), + substr(v_sig, 32, 32) + ) + ); + log("v_cert= ", v_cert); + + p_ec_certificate := valueof(v_cert); + return true; + } // End of function f_generate_ec_certificate + + function f_generate_at_certificate( + in octetstring p_private_key, + in InnerEcRequest p_inner_ec_request, + out Certificate p_at_certificate + ) return boolean { + var SequenceOfPsidSsp v_appPermissions := { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs + valueof(m_appPermissions(36, { bitmapSsp := '830001'O })), + valueof(m_appPermissions(37, { bitmapSsp := '830001'O })) + }; + var template (value) EtsiTs103097Certificate v_cert; + var bitstring v_tbs; + var Oct32 v_sig; + var bitstring v_enc_msg; + + v_cert := m_etsiTs103097Certificate( + m_issuerIdentifier_sha256AndDigest(f_HashedId8FromSha256(f_hashWithSha256('616263'O))), + m_toBeSignedCertificate_at( + v_appPermissions, + m_verificationKeyIndicator_verificationKey( + m_publicVerificationKey_ecdsaNistP256( + p_inner_ec_request.publicKeys.verificationKey.ecdsaNistP256 + )), + m_validityPeriod( + 17469212, + m_duration_years(10) + ), + m_geographicRegion_identifiedRegion( + { + m_identifiedRegion_country_only(12), + m_identifiedRegion_country_only(34) + } + ) + ) + ); + // Encode it ==> Get octetstring + v_tbs := encvalue(v_cert.toBeSigned); + // Sign the certificate using ECDSA/SHA-256 (NIST p-256) + v_sig := f_signWithEcdsaNistp256WithSha256(bit2oct(v_tbs), int2oct(11, 32), p_private_key); + v_cert.signature_ := m_signature_ecdsaNistP256( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only( + substr(v_sig, 0, 32) + ), + substr(v_sig, 32, 32) + ) + ); + log("v_cert= ", v_cert); + + p_at_certificate := valueof(v_cert); + return true; + } // End of function f_generate_at_certificate + + } // End of group generate_certificates group inner_ec_xxx { @@ -356,31 +467,26 @@ module LibItsPki_Functions { out InnerEcRequest p_inner_ec_request ) return boolean { // Local variables - var template (value) EccP256CurvePoint v_eccP256_curve_point; - + var EccP256CurvePoint v_eccP256_curve_point; + + log (">>> f_generate_inner_ec_request"); // Generate keys for the certificate to be requested if (f_generate_key_pair_nistp256(p_private_key, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressedMode) == false) { + log ("f_generate_inner_ec_request: failed to generate keys"); return false; } - log("p_private_key = ", p_private_key); - log("p_public_key X= ", p_publicKeyX); - log("p_public_key Y= ", p_publicKeyY); - log("p_public_key compressed= ", p_publicKeyCompressed, p_compressedMode); if (p_compressedMode == 0) { - v_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_0(p_publicKeyCompressed); + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(p_publicKeyCompressed)); } else { - v_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_1(p_publicKeyCompressed); + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(p_publicKeyCompressed)); } + log ("f_generate_inner_ec_request: ", v_eccP256_curve_point); // Build the Proof of Possession InnerEcRequest p_inner_ec_request := valueof( m_innerEcRequest( - "CanonicalItsId", // TODO Use PIXIT + PICS_ITS_S_CANONICAL_ID, m_publicKeys( - m_publicVerificationKey_ecdsaNistP256(v_eccP256_curve_point), - m_encryptionKey( - -, - m_publicEncryptionKey_ecdsaNistP256(v_eccP256_curve_point) - ) + m_publicVerificationKey_ecdsaNistP256(v_eccP256_curve_point) ), m_certificateSubjectAttributes( { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs @@ -388,19 +494,20 @@ module LibItsPki_Functions { valueof(m_appPermissions(37, { bitmapSsp := '830001'O })) // TODO Use PIXIT }, m_validityPeriod( - 17469212, - m_duration_years(10) // TODO Use PIXIT - ), + 17469212, + m_duration_years(10) // TODO Use PIXIT + ), m_geographicRegion_identifiedRegion( - { - m_identifiedRegion_country_only(12), // TODO Use PIXIT - m_identifiedRegion_country_only(34) // TODO Use PIXIT - } - ), + { + m_identifiedRegion_country_only(12), // TODO Use PIXIT + m_identifiedRegion_country_only(34) // TODO Use PIXIT + } + ), 'C0'O // TODO Use PIXIT - ) - ) + ) + ) ); + log ("f_generate_inner_ec_request: ", p_inner_ec_request); return true; } // End of function f_generate_inner_ec_request @@ -472,6 +579,227 @@ module LibItsPki_Functions { } // End of group inner_ec_xxx + group inner_at_xxx { + + function f_generate_inner_at_request( + in Certificate p_ec_certificate, + in octetstring p_private_key, + in Certificate p_ea_certificate, + in HashedId8 p_eaHashedId8, + in boolean p_itss_privacy, + out octetstring p_private_enc_key, + out octetstring p_publicEncKeyX, + out octetstring p_publicEncKeyY, + out octetstring p_publicEncKeyCompressed, + out integer p_compressedMode, + out InnerAtRequest p_inner_at_request, + out Ieee1609Dot2Data p_inner_at_request_data + ) return boolean { + // Local variables + var template (value) EccP256CurvePoint v_eccP256_curve_point; + var Oct32 v_hmac_key; + var octetstring v_message_to_tag; + var Oct16 v_key_tag; + var octetstring v_whole_certificate_hash; + var octetstring v_hash_shared_at_request; + var template (value) ToBeSignedData v_tbs; + var octetstring v_tbs_signed; + var Ieee1609Dot2Data v_signed_ec_signature; + + // Generate encryption keys for the certificate to be requested + if (f_generate_key_pair_nistp256(p_private_enc_key, p_publicEncKeyX, p_publicEncKeyY, p_publicEncKeyCompressed, p_compressedMode) == false) { + return false; + } + if (p_compressedMode == 0) { + v_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_0(p_publicEncKeyCompressed); + } else { + v_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_1(p_publicEncKeyCompressed); + } + + // Generate 32 octets length secret key + v_hmac_key := f_hashWithSha256(int2oct(f_getCurrentTime(), 128)); + log("v_hmac_key=", v_hmac_key); + + // Generate tag based on the concatenation of ??? + if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey)) { + if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256)) { + if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256.compressed_y_0)) { + v_message_to_tag := '02'O & p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256.compressed_y_0; + } else { + v_message_to_tag := '03'O & p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256.compressed_y_1; + } + } else { + // TODO + /* if (ischosen(p_ec_certificate.verifyKeyIndicator.ecdsaBrainpoolP256.compressed_y_0)) { */ + /* v_message_to_tag := '02'O & p_ec_certificate.verifyKeyIndicator.ecdsaBrainpoolP256.compressed_y_0; */ + /* } else { */ + /* v_message_to_tag := '03'O & p_ec_certificate.verifyKeyIndicator.ecdsaBrainpoolP256.compressed_y_1; */ + /* } */ + } + } else { + return false; + } + if (p_compressedMode == 0) { + v_message_to_tag := v_message_to_tag & '02'O & p_publicEncKeyCompressed; + } else { + v_message_to_tag := v_message_to_tag & '03'O & p_publicEncKeyCompressed; + } + log("v_message_to_tag=", v_message_to_tag); + v_key_tag := fx_test_hmac_sha256(v_hmac_key, v_message_to_tag); // TODO Rename and use a wrapper function + log("v_key_tag=", v_key_tag); + + // Build the SharedAtRequest + p_inner_at_request.publicKeys := valueof( + m_publicKeys( + m_publicVerificationKey_ecdsaNistP256( + p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256 + ), + m_encryptionKey( + -, + m_publicEncryptionKey_ecdsaNistP256(v_eccP256_curve_point) + ) + ) + ); + p_inner_at_request.hmacKey := v_hmac_key; + p_inner_at_request.sharedAtRequest := valueof( + m_shared_at_request( + p_eaHashedId8, + v_key_tag, + valueof( + m_certificate_subject_attributes( + p_ec_certificate.toBeSigned.id, + p_ec_certificate.toBeSigned.validityPeriod, + p_ec_certificate.toBeSigned.region, + p_ec_certificate.toBeSigned.assuranceLevel, + p_ec_certificate.toBeSigned.appPermissions + )))); + v_hash_shared_at_request := f_hashWithSha256(bit2oct(encvalue(p_inner_at_request.sharedAtRequest))); + log("v_hash_shared_at_request=", v_hash_shared_at_request); + // Build the ToBeSigned payload + v_tbs := m_toBeSignedData( + m_signedDataPayload_ext(v_hash_shared_at_request), + m_headerInfo_inner_ec_request( + c_its_aid_SCR, + f_getCurrentTimeUtc()) + ); + // Signed ToBeSigned payload + v_whole_certificate_hash := f_hashWithSha256(bit2oct(encvalue(p_ec_certificate))); + v_tbs_signed := f_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), v_whole_certificate_hash, p_private_key); + v_signed_ec_signature := valueof( + m_etsiTs103097Data_signed( + m_signedData( + sha256, + v_tbs, + m_signerIdentifier_digest( + f_HashedId8FromSha256( + v_whole_certificate_hash + ) + ), + m_signature_ecdsaNistP256( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only( + substr(v_tbs_signed, 0, 32) + ), + substr(v_tbs_signed, 32, 32) + ) + ) + ) + ) + ); + // Encrypt EcSignature with EA certificate + if (p_itss_privacy) { + var octetstring v_public_enc_key; + var integer v_compressed_mode; + var Oct12 v_nonce; + var Oct16 v_authentication_vector; + var Oct16 v_encrypted_sym_key; + var HashedId8 v_recipientId; + var octetstring v_publicEphemeralKeyCompressed; + var integer v_ephemeralKeyModeCompressed; + var octetstring v_enc_signed_ec_signature; + + v_enc_signed_ec_signature := f_encryptWithEciesNistp256WithSha256(bit2oct(encvalue(v_signed_ec_signature)), v_public_enc_key, v_compressed_mode, v_publicEphemeralKeyCompressed, v_ephemeralKeyModeCompressed, v_encrypted_sym_key, v_authentication_vector, v_nonce); + v_recipientId := p_eaHashedId8; + log("v_recipientId=", v_recipientId); + // Fill Certificate template with the public compressed keys (canonical form) + if (v_ephemeralKeyModeCompressed == 0) { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_publicEphemeralKeyCompressed)); + } else { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_publicEphemeralKeyCompressed)); + } + p_inner_at_request.ecSignature := valueof( + m_ec_signature( + m_etsiTs103097Data_encrypted( + m_encryptedData( + { + m_recipientInfo_signedDataRecipInfo( + m_pKRecipientInfo( + v_recipientId, + m_encryptedDataEncryptionKey_eciesNistP256( + m_evciesP256EncryptedKey( + v_eccP256_curve_point, + v_encrypted_sym_key, + v_authentication_vector + )))) + }, + m_SymmetricCiphertext_aes128ccm( + m_aesCcmCiphertext( + v_nonce, + v_enc_signed_ec_signature + ) + ) + ) + ) + ) + ); + } else { + p_inner_at_request.ecSignature := valueof(m_ec_signature_ext_payload(v_signed_ec_signature)); + } + log("p_inner_at_request=", p_inner_at_request); + + return true; + } // End of function f_generate_inner_at_request + + function f_generate_inner_at_response( + in Certificate p_ec_certificate, + in octetstring p_private_key, + in HashedId8 p_eaHashedId8, + out octetstring p_private_enc_key, + out octetstring p_publicEncKeyX, + out octetstring p_publicEncKeyY, + out octetstring p_publicEncKeyCompressed, + out integer p_compressedMode, + out InnerAtRequest p_inner_at_request, + out Ieee1609Dot2Data p_inner_at_request_data + ) return boolean { + // Local variables + return false; + } // End of function f_generate_inner_at_response + + } // End of group inner_at_xxx + + group authorization_validation_xxx { + + function f_generate_authorization_validation_request( + in InnerAtRequest p_inner_at_request, + in Certificate p_certificate, + out AuthorizationValidationRequest p_authorization_validation_request + ) return boolean { + // TODO + return false; + } // End of function f_generate_authorization_validation_request + + function f_generate_authorization_validation_response( + in InnerAtRequest p_inner_at_request, + in Certificate p_certificate, + out AuthorizationValidationRequest p_authorization_validation_request + ) return boolean { + // TODO + return false; + } // End of function f_generate_authorization_validation_response + + } // End of group authorization_validation_xxx + group pki_functions { /** @@ -492,7 +820,7 @@ module LibItsPki_Functions { in HashedId8 p_recipientId, in octetstring p_publicKeyCompressed, in integer p_compressedMode, - in octetstring p_pki_message, + in octetstring p_pki_message, out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data ) return boolean { // Local variables diff --git a/ttcn/Pki/LibItsPki_Pics.ttcn b/ttcn/Pki/LibItsPki_Pics.ttcn index 484455ab..f345cce4 100644 --- a/ttcn/Pki/LibItsPki_Pics.ttcn +++ b/ttcn/Pki/LibItsPki_Pics.ttcn @@ -29,5 +29,10 @@ module LibItsPki_Pics { * @desc Certificate used by the Test System */ modulepar charstring PICS_HTTP_GET_URI := "/its/inner_ec_request"; + + /** + * @desc Canonical ITSS-S identifier + */ + modulepar charstring PICS_ITS_S_CANONICAL_ID := "CanonicalItsId"; } // End of module LibItsPki_Pics diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn index 0becc37d..562fa77b 100644 --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ b/ttcn/Pki/LibItsPki_Templates.ttcn @@ -296,5 +296,69 @@ module LibItsPki_Templates { responseCode := complement(ok), confirmedSubjectAttributes := omit } // End of template mw_authorizationValidationResponse_ko + + template (value) SharedAtRequest m_shared_at_request( + in template (value) HashedId8 p_eaId, + in template (value) Oct16 p_keyTag, + in template (value) CertificateSubjectAttributes p_requestedSubjectAttributes + ) := { + eaId := p_eaId, + keyTag := p_keyTag, + certificateFormat := 1, + requestedSubjectAttributes := p_requestedSubjectAttributes + } // End of template m_shared_at_request + + template (present) SharedAtRequest mw_shared_at_request( + template (present) HashedId8 p_eaId := ?, + template (present) Oct16 p_keyTag := ?, + template (present) CertificateSubjectAttributes p_requestedSubjectAttributes := ? + ) := { + eaId := p_eaId, + keyTag := p_keyTag, + certificateFormat := 1, + requestedSubjectAttributes := p_requestedSubjectAttributes + } // End of template mw_shared_at_request + + template (value) EcSignature m_ec_signature( + in template (value) EtsiTs103097Data p_encryptedEcSignature + ) := { + encryptedEcSignature := p_encryptedEcSignature + } // End of template m_ec_signature + + template (present) EcSignature mw_ec_signature( + template (present) EtsiTs103097Data p_encryptedEcSignature := ? + ) := { + encryptedEcSignature := p_encryptedEcSignature + } // End of template mw_ec_signature + + template (value) EcSignature m_ec_signature_ext_payload( + in template (value) EtsiTs103097Data p_ecSignature + ) := { + ecSignature := p_ecSignature + } // End of template m_ec_signature_ext_payload + + template (present) EcSignature mw_ec_signature_ext_payload( + template (present) EtsiTs103097Data p_ecSignature := ? + ) := { + ecSignature := p_ecSignature + } // End of template mw_ec_signature_ext_payload + + + + template (omit) CertificateSubjectAttributes m_certificate_subject_attributes( + in template (omit) CertificateId p_id := omit, + in template (omit) ValidityPeriod p_validityPeriod := omit, + in template (omit) GeographicRegion p_region := omit, + in template (omit) SubjectAssurance p_assuranceLevel := omit, + in template (omit) SequenceOfPsidSsp p_appPermissions := omit, + in template (omit) SequenceOfPsidGroupPermissions p_certIssuePermissions := omit + ) := { + id := p_id, + validityPeriod := p_validityPeriod, + region := p_region, + assuranceLevel := p_assuranceLevel, + appPermissions := p_appPermissions, + certIssuePermissions := p_certIssuePermissions + } // End of template m_certificate_subject_attributes } // End of module LibItsPki_Templates diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index 2f58761e..22090f95 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -19,7 +19,9 @@ module LibItsPki_TestSystem { import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; import from IEEE1609dot2 language "ASN.1:1997" all; import from EtsiTs102941BaseTypes language "ASN.1:1997" all; - import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; + import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; + import from EtsiTs102941TypesAuthorization language "ASN.1:1997" all; + import from EtsiTs102941TypesAuthorizationValidation language "ASN.1:1997" all; import from EtsiTs102941MessagesItss language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; @@ -62,7 +64,7 @@ module LibItsPki_TestSystem { group interfacePorts { type port PkiPort message { - inout InnerEcRequest, InnerEcResponse; + inout InnerEcRequest, InnerEcResponse, AuthorizationValidationRequest, AuthorizationValidationResponse; } // End of PkiPort } // End of group interfacePorts @@ -89,6 +91,7 @@ module LibItsPki_TestSystem { port PkiPort pkiPort; var Certificate vc_eaCertificate; /** Test Adapter EA certificate */ + var HashedId8 vc_eaHashedId8; /** Test Adapter EA HashedId8 for decryption of IUT's response */ } // End of component ItsPki type component ItsPkiHttp extends ItsSecurityBaseComponent, HttpComponent { diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index 7c905a4c..584008fd 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -629,10 +629,9 @@ module LibItsSecurity_Templates { } // End of template mw_signedDataPayload template (value) SignedDataPayload m_signedDataPayload_ext( - in template (value) Ieee1609Dot2Data p_data, in template (value) Oct32 p_extDataHash ) := { - data := p_data, + data := omit, extDataHash := { sha256HashedData := p_extDataHash } } // End of template m_signedDataPayload_ext -- GitLab From 866e58fea050293a73c48bd69ad1130c9ed48b4e Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 1 Nov 2018 14:03:12 +0100 Subject: [PATCH 146/320] Add support of AuthorizarionRequest/Response --- ttcn/Http/LibItsHttp_TestSystem.ttcn | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ttcn/Http/LibItsHttp_TestSystem.ttcn b/ttcn/Http/LibItsHttp_TestSystem.ttcn index acbfdf75..5576bfa0 100644 --- a/ttcn/Http/LibItsHttp_TestSystem.ttcn +++ b/ttcn/Http/LibItsHttp_TestSystem.ttcn @@ -15,11 +15,6 @@ module LibItsHttp_TestSystem { import from LibCommon_Sync all; import from LibCommon_Time all; - // LibItsCommon - import from LibItsCommon_TestSystem all; - import from LibItsCommon_TypesAndValues all; - import from LibItsExternal_TypesAndValues all; - // LibItsHttp import from LibItsHttp_TypesAndValues all; -- GitLab From 6c6c9f384fe0e21495422b375494209d9eb5d863 Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Thu, 1 Nov 2018 16:02:47 +0100 Subject: [PATCH 147/320] Bug fixed on ItsRSUsSimulator --- ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn index 336906e0..94382b1a 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn @@ -1571,7 +1571,6 @@ module LibItsGeoNetworking_Functions { /** * @desc Receive GeoAnycast packet for specific GeoAnycast Area * @param p_srcLongPosVec Expected source position vector - * @param p_senderLongPosVec Expected sender position vector * @param p_seqNumber Expected sequence number * @param p_anycastArea Expected geoAnycastArea */ @@ -1596,7 +1595,7 @@ module LibItsGeoNetworking_Functions { /** * @desc Receive Location Service Request * @param p_seqNumber Expected sequence number of the received LS Request - * @param p_gnAddress GN address expected in received LS Request + * @param p_mid GN address expected in received LS Request * @param p_reqSrcPosVector Expected source position vector of the received LS Request */ altstep a_receiveLsRequest( @@ -1605,7 +1604,7 @@ module LibItsGeoNetworking_Functions { out LongPosVector p_reqSrcPosVector ) runs on ItsGeoNetworking { var GeoNetworkingInd v_msg; - + [vc_gnDefaultActive] geoNetworkingPort.receive( mw_geoNwInd( mw_geoNwPdu( -- GitLab From b31f565ae97899e5bf9f80e65130b0ba177fbcc4 Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Thu, 1 Nov 2018 17:51:03 +0100 Subject: [PATCH 148/320] Add unit tests --- ttcn/Http/LibItsHttp_BinaryTemplates.ttcn | 13 ----- ttcn/Pki/LibItsPki_Functions.ttcn | 58 +++++++++++++---------- ttcn/Pki/LibItsPki_Pics.ttcn | 12 ++++- ttcn/Pki/LibItsPki_Templates.ttcn | 7 ++- 4 files changed, 51 insertions(+), 39 deletions(-) diff --git a/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn b/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn index bb655d7a..d1957bc8 100644 --- a/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn +++ b/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn @@ -47,17 +47,4 @@ module LibItsHttp_BinaryTemplates { ieee1609dot2_data := p_ieee1609dot2_data } // End of template mw_binary_body_ieee1609dot2_data - // Move to Pki -// template (present) BinaryBody mw_binary_body_innerEcRequest( -// template (present) InnerEcRequest p_innerEcRequest := ? -// ) := { -// innerEcRequest := p_innerEcRequest -// } // End of template mw_binary_body_innerEcRequest -// -// template (present) BinaryBody mw_binary_body_innerEcResponse( -// template (present) InnerEcResponse p_innerEcResponse := ? -// ) := { -// innerEcResponse := p_innerEcResponse -// } // End of template mw_binary_body_innerEcResponse -// } // End of module LibItsHttp_BinaryTemplates diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index a2ef750b..5d3e808d 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -188,13 +188,14 @@ module LibItsPki_Functions { group ac_port { function f_sendAcPkiPrimitive( + in charstring p_certificate, in octetstring p_private_key, in octetstring p_publicKeyCompressed, in integer p_compressedMode ) runs on ItsPki { var AcSetSecurityData v_ac_set_security_data; - v_ac_set_security_data := { PICS_TS_CERTIFICATE_ID, PICS_IUT_CERTIFICATE_ID, p_private_key, p_publicKeyCompressed, p_compressedMode }; + v_ac_set_security_data := { p_certificate, PICS_IUT_CERTIFICATE_ID, p_private_key, p_publicKeyCompressed, p_compressedMode }; acPort.send(AcPkiPrimitive: { acSetSecurityData := v_ac_set_security_data }); tc_ac.start; alt { @@ -278,26 +279,26 @@ module LibItsPki_Functions { group http { - function f_http_build_enrolment_request( + function f_http_build_inner_ec_request( out octetstring p_private_key, - out octetstring p_publicKeyX, - out octetstring p_publicKeyY, out octetstring p_publicKeyCompressed, out integer p_compressedMode, out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, out Oct32 p_hash_inner_ec_request_signed_for_pop ) runs on ItsPkiHttp { + var octetstring v_publicKeyX; + var octetstring v_publicKeyY var InnerEcRequest v_inner_ec_request; var Ieee1609Dot2Data v_inner_ec_request_signed_for_pop; var bitstring v_inner_ec_request_signed_for_pop_msg; - if (f_generate_inner_ec_request(p_private_key, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressedMode, v_inner_ec_request) == false) { - log("*** f_http_build_enrolment_request: ERROR: Failed to generate InnerEcRequest ***"); + if (f_generate_inner_ec_request(p_private_key, p_publicKeyCompressed, p_compressedMode, v_inner_ec_request) == false) { + log("*** f_http_build_inner_ec_request: ERROR: Failed to generate InnerEcRequest ***"); f_selfOrClientSyncAndVerdict("error", e_error); } // Generate InnerEcRequestSignedForPoP if (f_generate_inner_ec_request_signed_for_pop(p_private_key, v_inner_ec_request, v_inner_ec_request_signed_for_pop) == false) { - log("*** f_http_build_enrolment_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); + log("*** f_http_build_inner_ec_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); f_selfOrClientSyncAndVerdict("error", e_error); } // Secure InnerEcRequestSignedForPoP message @@ -305,18 +306,16 @@ module LibItsPki_Functions { // Prepae for getting the 16 most bytes of SHA256 of InnerEcRequestSignedForPop p_hash_inner_ec_request_signed_for_pop := f_hashWithSha256(bit2oct(v_inner_ec_request_signed_for_pop_msg)); if (f_build_pki_secured_message(vc_eaPrivateKey, valueof(m_signerIdentifier_self), vc_eaHashedId8, p_publicKeyCompressed, p_compressedMode, bit2oct(v_inner_ec_request_signed_for_pop_msg), p_ieee1609dot2_signed_and_encrypted_data) == false) { - log("*** f_http_build_enrolment_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); + log("*** f_http_build_inner_ec_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); f_selfOrClientSyncAndVerdict("error", e_error); } - log("*** f_http_build_enrolment_request: DEBUG: v_inner_ec_request_signed_for_pop_msg= ", v_inner_ec_request_signed_for_pop_msg); - log("*** f_http_build_enrolment_request: DEBUG: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); - log("*** f_http_build_enrolment_request: DEBUG: p_hash_inner_ec_request_signed_for_pop= ", p_hash_inner_ec_request_signed_for_pop); - } // End of function f_http_build_enrolment_request + log("*** f_http_build_inner_ec_request: DEBUG: v_inner_ec_request_signed_for_pop_msg= ", v_inner_ec_request_signed_for_pop_msg); + log("*** f_http_build_inner_ec_request: DEBUG: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); + log("*** f_http_build_inner_ec_request: DEBUG: p_hash_inner_ec_request_signed_for_pop= ", p_hash_inner_ec_request_signed_for_pop); + } // End of function f_http_build_inner_ec_request function f_http_build_invalid_enrolment_request( out octetstring p_private_key, - out octetstring p_publicKeyX, - out octetstring p_publicKeyY, out octetstring p_publicKeyCompressed, out integer p_compressedMode, out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, @@ -326,7 +325,7 @@ module LibItsPki_Functions { var Ieee1609Dot2Data v_inner_ec_request_signed_for_pop; var bitstring v_inner_ec_request_signed_for_pop_msg; - if (f_generate_inner_ec_request(p_private_key, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressedMode, v_inner_ec_request) == false) { + if (f_generate_inner_ec_request(p_private_key, p_publicKeyCompressed, p_compressedMode, v_inner_ec_request) == false) { log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequest ***"); f_selfOrClientSyncAndVerdict("error", e_error); } @@ -346,6 +345,15 @@ module LibItsPki_Functions { log("*** f_http_build_invalid_enrolment_request: DEBUG: p_ieee1609dot2_signed_and_encrypted_data = ", p_ieee1609dot2_signed_and_encrypted_data); } // End of function f_http_build_invalid_enrolment_request + function f_http_build_authorization_validation_request( + out octetstring p_private_key, + out octetstring p_publicKeyCompressed, + out integer p_compressedMode, + out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data + ) runs on ItsPkiHttp { + log("*** f_http_build_invalid_enrolment_request: DEBUG: p_ieee1609dot2_signed_and_encrypted_data = ", p_ieee1609dot2_signed_and_encrypted_data); + } + } // End of group http group generate_certificates { @@ -460,18 +468,18 @@ module LibItsPki_Functions { function f_generate_inner_ec_request( out octetstring p_private_key, - out octetstring p_publicKeyX, - out octetstring p_publicKeyY, out octetstring p_publicKeyCompressed, out integer p_compressedMode, out InnerEcRequest p_inner_ec_request ) return boolean { // Local variables + var Oct32 v_publicKeyX; + var Oct32 v_publicKeyY; var EccP256CurvePoint v_eccP256_curve_point; log (">>> f_generate_inner_ec_request"); // Generate keys for the certificate to be requested - if (f_generate_key_pair_nistp256(p_private_key, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressedMode) == false) { + if (f_generate_key_pair_nistp256(p_private_key, v_publicKeyX, v_publicKeyY, p_publicKeyCompressed, p_compressedMode) == false) { log ("f_generate_inner_ec_request: failed to generate keys"); return false; } @@ -588,14 +596,14 @@ module LibItsPki_Functions { in HashedId8 p_eaHashedId8, in boolean p_itss_privacy, out octetstring p_private_enc_key, - out octetstring p_publicEncKeyX, - out octetstring p_publicEncKeyY, out octetstring p_publicEncKeyCompressed, out integer p_compressedMode, out InnerAtRequest p_inner_at_request, out Ieee1609Dot2Data p_inner_at_request_data ) return boolean { // Local variables + var octetstring public_enc_key_x; + var octetstring public_enc_key_y; var template (value) EccP256CurvePoint v_eccP256_curve_point; var Oct32 v_hmac_key; var octetstring v_message_to_tag; @@ -607,7 +615,7 @@ module LibItsPki_Functions { var Ieee1609Dot2Data v_signed_ec_signature; // Generate encryption keys for the certificate to be requested - if (f_generate_key_pair_nistp256(p_private_enc_key, p_publicEncKeyX, p_publicEncKeyY, p_publicEncKeyCompressed, p_compressedMode) == false) { + if (f_generate_key_pair_nistp256(p_private_enc_key, public_enc_key_x, public_enc_key_y, p_publicEncKeyCompressed, p_compressedMode) == false) { return false; } if (p_compressedMode == 0) { @@ -785,14 +793,16 @@ module LibItsPki_Functions { in Certificate p_certificate, out AuthorizationValidationRequest p_authorization_validation_request ) return boolean { - // TODO - return false; + p_authorization_validation_request.sharedAtRequest := p_inner_at_request.sharedAtRequest; + p_authorization_validation_request.ecSignature := p_inner_at_request.ecSignature; + + return true; } // End of function f_generate_authorization_validation_request function f_generate_authorization_validation_response( in InnerAtRequest p_inner_at_request, in Certificate p_certificate, - out AuthorizationValidationRequest p_authorization_validation_request + out AuthorizationValidationResponse p_authorization_validation_response ) return boolean { // TODO return false; diff --git a/ttcn/Pki/LibItsPki_Pics.ttcn b/ttcn/Pki/LibItsPki_Pics.ttcn index f345cce4..430527f4 100644 --- a/ttcn/Pki/LibItsPki_Pics.ttcn +++ b/ttcn/Pki/LibItsPki_Pics.ttcn @@ -21,10 +21,20 @@ module LibItsPki_Pics { modulepar charstring PICS_IUT_CERTIFICATE_ID := "CERT_IUT_A_EA"; /** - * @desc Certificate used by the Test System + * @desc Certificate used by the Test System acting as ITS-S */ modulepar charstring PICS_TS_CERTIFICATE_ID := "CERT_TS_A_EA"; + /** + * @desc Certificate used by the Test System acting as EA + */ + modulepar charstring PICS_TS_EA_CERTIFICATE_ID := "CERT_TS_A_EA"; + + /** + * @desc Certificate used by the Test System acting as AA + */ + modulepar charstring PICS_TS_AA_CERTIFICATE_ID := "CERT_TS_A_EA"; + /** * @desc Certificate used by the Test System */ diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn index 562fa77b..259332e6 100644 --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ b/ttcn/Pki/LibItsPki_Templates.ttcn @@ -78,6 +78,11 @@ module LibItsPki_Templates { ) modifies m_etsiTs103097Data_encrypted := { } // End of template m_authorizationValidationRequestMessage + template (present) EtsiTs103097Data mw_authorizationValidationResponseMessage( + template (present) EncryptedData p_encryptedData := ? + ) modifies mw_etsiTs103097Data_encrypted := { + } // End of template mw_authorizationValidationResponseMessage + template (present) EnrolmentRequestMessage mw_enrolmentRequestMessage( template (present) EncryptedData p_encryptedData := ? ) modifies mw_etsiTs103097Data_encrypted := { @@ -201,7 +206,7 @@ module LibItsPki_Templates { in template (omit) GeographicRegion p_region := omit, in template (omit) SubjectAssurance p_assuranceLevel := omit ) := { - id := { none_ := NULL }, + id := { none_ := NULL }, validityPeriod := p_validityPeriod, region := p_region, assuranceLevel := p_assuranceLevel, -- GitLab From a1a1ccbca9016e26be86f0129a1f31b2252ed0dc Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 2 Nov 2018 14:14:00 +0100 Subject: [PATCH 149/320] Add first AA tests --- ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn | 11 +++ ttcn/Pki/LibItsPki_Functions.ttcn | 87 ++++++++++++++++++---- ttcn/Pki/LibItsPki_Pics.ttcn | 12 ++- ttcn/Pki/LibItsPki_Templates.ttcn | 30 +++++--- 4 files changed, 116 insertions(+), 24 deletions(-) diff --git a/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn b/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn index c0605f1c..feedb525 100644 --- a/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn +++ b/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn @@ -50,4 +50,15 @@ module LibItsPki_EncdecDeclarations { external function fx_dec_SharedAtRequest(inout bitstring b, out EtsiTs102941TypesAuthorization.SharedAtRequest p) return integer with {extension "prototype(sliding) decode(PER)"} + /** + * @desc Encoding function for EtsiTs102941TypesAuthorizationValidation AuthorizationValidationRequest + * @param p The certificate to encode + * @return The encode message in OER format + */ + external function fx_enc_AuthorizationValidationRequest(in EtsiTs102941TypesAuthorizationValidation.AuthorizationValidationRequest p) return bitstring + with {extension "prototype(convert) encode(PER)"} + + external function fx_dec_AuthorizationValidationRequest(inout bitstring b, out EtsiTs102941TypesAuthorizationValidation.AuthorizationValidationRequest p) return integer + with {extension "prototype(sliding) decode(PER)"} + } // End of module LibItsPki_EncdecDeclarations diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 5d3e808d..47fab367 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -303,7 +303,7 @@ module LibItsPki_Functions { } // Secure InnerEcRequestSignedForPoP message v_inner_ec_request_signed_for_pop_msg := encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop)); - // Prepae for getting the 16 most bytes of SHA256 of InnerEcRequestSignedForPop + // Prepare for getting the 16 most bytes of SHA256 of InnerEcRequestSignedForPop p_hash_inner_ec_request_signed_for_pop := f_hashWithSha256(bit2oct(v_inner_ec_request_signed_for_pop_msg)); if (f_build_pki_secured_message(vc_eaPrivateKey, valueof(m_signerIdentifier_self), vc_eaHashedId8, p_publicKeyCompressed, p_compressedMode, bit2oct(v_inner_ec_request_signed_for_pop_msg), p_ieee1609dot2_signed_and_encrypted_data) == false) { log("*** f_http_build_inner_ec_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); @@ -344,15 +344,41 @@ module LibItsPki_Functions { } log("*** f_http_build_invalid_enrolment_request: DEBUG: p_ieee1609dot2_signed_and_encrypted_data = ", p_ieee1609dot2_signed_and_encrypted_data); } // End of function f_http_build_invalid_enrolment_request + + function f_http_build_inner_at_request( + out octetstring p_private_key, + out octetstring p_publicKeyCompressed, + out integer p_compressedMode, + out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, + out HashedId8 p_hash_inner_at_request + ) runs on ItsPkiHttp { + // Local variables + + } // End of function f_http_build_inner_at_request function f_http_build_authorization_validation_request( - out octetstring p_private_key, - out octetstring p_publicKeyCompressed, - out integer p_compressedMode, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data - ) runs on ItsPkiHttp { - log("*** f_http_build_invalid_enrolment_request: DEBUG: p_ieee1609dot2_signed_and_encrypted_data = ", p_ieee1609dot2_signed_and_encrypted_data); - } + out octetstring p_private_key, + out octetstring p_publicKeyCompressed, + out integer p_compressedMode, + out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data + ) runs on ItsPkiHttp { + // Local variables + var AuthorizationValidationRequest v_authorization_validation_request; + + if (f_generate_authorization_validation_request(vc_eaCertificate, vc_eaHashedId8, p_private_key, p_publicKeyCompressed, p_compressedMode, v_authorization_validation_request) == false) { + log("*** f_http_build_authorization_validation_request: ERROR: Failed to generate AuthorizationValidationRequest ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + + // FIXME Encapsulate v_authorization_validation_request into EtsiTs102941Data structure + + if (f_build_pki_secured_message(vc_eaPrivateKey, valueof(m_signerIdentifier_self), vc_eaHashedId8, p_publicKeyCompressed, p_compressedMode, bit2oct(encvalue(v_authorization_validation_request)), p_ieee1609dot2_signed_and_encrypted_data) == false) { + log("*** f_http_build_authorization_validation_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + + log("*** f_http_build_authorization_validation_request: DEBUG: p_ieee1609dot2_signed_and_encrypted_data = ", p_ieee1609dot2_signed_and_encrypted_data); + } // End of function f_http_build_authorization_validation_request } // End of group http @@ -625,7 +651,7 @@ module LibItsPki_Functions { } // Generate 32 octets length secret key - v_hmac_key := f_hashWithSha256(int2oct(f_getCurrentTime(), 128)); + v_hmac_key := f_hashWithSha256(int2oct(f_getCurrentTime(), 12)); log("v_hmac_key=", v_hmac_key); // Generate tag based on the concatenation of ??? @@ -690,8 +716,10 @@ module LibItsPki_Functions { c_its_aid_SCR, f_getCurrentTimeUtc()) ); + log("v_tbs=", v_tbs); // Signed ToBeSigned payload v_whole_certificate_hash := f_hashWithSha256(bit2oct(encvalue(p_ec_certificate))); + log("v_whole_certificate_hash=", v_whole_certificate_hash); v_tbs_signed := f_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), v_whole_certificate_hash, p_private_key); v_signed_ec_signature := valueof( m_etsiTs103097Data_signed( @@ -726,6 +754,15 @@ module LibItsPki_Functions { var integer v_ephemeralKeyModeCompressed; var octetstring v_enc_signed_ec_signature; + if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0)) { + v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0; + v_compressed_mode := 0; + } else if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_1)) { + v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_1; + v_compressed_mode := 1; + } else { + return false; + } v_enc_signed_ec_signature := f_encryptWithEciesNistp256WithSha256(bit2oct(encvalue(v_signed_ec_signature)), v_public_enc_key, v_compressed_mode, v_publicEphemeralKeyCompressed, v_ephemeralKeyModeCompressed, v_encrypted_sym_key, v_authentication_vector, v_nonce); v_recipientId := p_eaHashedId8; log("v_recipientId=", v_recipientId); @@ -789,12 +826,36 @@ module LibItsPki_Functions { group authorization_validation_xxx { function f_generate_authorization_validation_request( - in InnerAtRequest p_inner_at_request, - in Certificate p_certificate, + in Certificate p_ea_certificate, + in HashedId8 p_ea_certificate_hashed_id8, + out octetstring p_private_key, + out octetstring p_publicKeyCompressed, + out integer p_compressedMode, out AuthorizationValidationRequest p_authorization_validation_request ) return boolean { - p_authorization_validation_request.sharedAtRequest := p_inner_at_request.sharedAtRequest; - p_authorization_validation_request.ecSignature := p_inner_at_request.ecSignature; + // Local variables + var octetstring v_private_enc_key; + var Oct32 v_publicEncKeyCompressed; + var integer v_compressedMode; + var InnerEcRequest v_inner_ec_request; + var Certificate v_ec_certificate; + var InnerAtRequest v_inner_at_request; + var Ieee1609Dot2Data v_inner_at_request_data; + + if (f_generate_inner_ec_request(p_private_key, p_publicKeyCompressed, p_compressedMode, v_inner_ec_request) == false) { + return false; + } + if (f_generate_ec_certificate(p_private_key, v_inner_ec_request, v_ec_certificate) == false) { + return false; + } + if (f_generate_inner_at_request(v_ec_certificate, p_private_key, p_ea_certificate, p_ea_certificate_hashed_id8, true, v_private_enc_key, v_publicEncKeyCompressed, v_compressedMode, v_inner_at_request, v_inner_at_request_data) == false) { + return false; + } + + p_authorization_validation_request.sharedAtRequest := v_inner_at_request.sharedAtRequest; + p_authorization_validation_request.ecSignature := v_inner_at_request.ecSignature; + + log("f_generate_authorization_validation_request: ", p_authorization_validation_request); return true; } // End of function f_generate_authorization_validation_request diff --git a/ttcn/Pki/LibItsPki_Pics.ttcn b/ttcn/Pki/LibItsPki_Pics.ttcn index 430527f4..21275fd3 100644 --- a/ttcn/Pki/LibItsPki_Pics.ttcn +++ b/ttcn/Pki/LibItsPki_Pics.ttcn @@ -16,10 +16,20 @@ module LibItsPki_Pics { modulepar boolean PICS_IUT_AA_ROLE := false; /** - * @desc Certificate used by the IUT + * @desc Certificate used by the IUT acting as ITS-S */ modulepar charstring PICS_IUT_CERTIFICATE_ID := "CERT_IUT_A_EA"; + /** + * @desc Certificate used by the IUT acting as EA + */ + modulepar charstring PICS_IUT_EA_CERTIFICATE_ID := "CERT_IUT_A__EA_EA"; + + /** + * @desc Certificate used by the IUT acting as AA + */ + modulepar charstring PICS_IUT_AA_CERTIFICATE_ID := "CERT_IUT_A_AA_EA"; + /** * @desc Certificate used by the Test System acting as ITS-S */ diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn index 259332e6..4964c672 100644 --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ b/ttcn/Pki/LibItsPki_Templates.ttcn @@ -73,6 +73,16 @@ module LibItsPki_Templates { } } // End of template m_etsiTs102941Data_inner_at_response + template (present) EnrolmentRequestMessage mw_enrolmentRequestMessage( + template (present) EncryptedData p_encryptedData := ? + ) modifies mw_etsiTs103097Data_encrypted := { + } // End of template mw_enrolmentRequestMessage + + template (present) EnrolmentResponseMessage mw_enrolmentResponseMessage( + template (present) EncryptedData p_encryptedData := ? + ) modifies mw_etsiTs103097Data_encrypted := { + } // End of template mw_enrolmentResponseMessage + template (value) EtsiTs103097Data m_authorizationValidationRequestMessage( in template (value) EncryptedData p_encryptedData ) modifies m_etsiTs103097Data_encrypted := { @@ -83,26 +93,26 @@ module LibItsPki_Templates { ) modifies mw_etsiTs103097Data_encrypted := { } // End of template mw_authorizationValidationResponseMessage - template (present) EnrolmentRequestMessage mw_enrolmentRequestMessage( - template (present) EncryptedData p_encryptedData := ? - ) modifies mw_etsiTs103097Data_encrypted := { - } // End of template mw_enrolmentRequestMessage - - template (present) EnrolmentRequestMessage mw_enrolmentResponseMessage( - template (present) EncryptedData p_encryptedData := ? - ) modifies mw_etsiTs103097Data_encrypted := { - } // End of template mw_enrolmentResponseMessage - template (value) AuthorizationRequestMessage m_authorizationRequestMessage( in template (value) EncryptedData p_encryptedData ) modifies m_etsiTs103097Data_encrypted := { } // End of template m_authorizationRequestMessage + template (present) AuthorizationRequestMessage mw_authorizationRequestMessage( + template (present) EncryptedData p_encryptedData := ? + ) modifies mw_etsiTs103097Data_encrypted := { + } // End of template mw_authorizationRequestMessage + template (value) AuthorizationResponseMessage m_authorizationResponseMessage( in template (value) EncryptedData p_encryptedData ) modifies m_etsiTs103097Data_encrypted := { } // End of template m_authorizationResponseMessage + template (present) AuthorizationResponseMessage mw_authorizationResponseMessage( + template (present) EncryptedData p_encryptedData := ? + ) modifies mw_etsiTs103097Data_encrypted := { + } // End of template mw_authorizationResponseMessage + template (value) EtsiTs102941DataContent m_enrolmentRequest( in template (value) InnerEcRequestSignedForPop p_enrolmentRequest ) := { -- GitLab From b951e6f197f1fe65a99a0916cf63d6a98a506e09 Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Tue, 6 Nov 2018 18:32:35 +0100 Subject: [PATCH 150/320] Change module EtsiTs102941MessagesItss into EtsiTs102941MessagesCa --- .../LibItsHttp_BinaryMessageBodyTypes.ttcn | 2 +- ttcn/Http/LibItsHttp_BinaryTemplates.ttcn | 2 +- ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn | 6 ++-- ttcn/Pki/LibItsPki_Functions.ttcn | 11 +++---- ttcn/Pki/LibItsPki_Templates.ttcn | 30 +++++++++++++++++-- ttcn/Pki/LibItsPki_TestSystem.ttcn | 14 ++++----- 6 files changed, 43 insertions(+), 22 deletions(-) diff --git a/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn b/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn index 80058604..c7650134 100644 --- a/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn +++ b/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn @@ -20,7 +20,7 @@ module LibItsHttp_BinaryMessageBodyTypes { import from IEEE1609dot2 language "ASN.1:1997" all; import from EtsiTs102941BaseTypes language "ASN.1:1997" all; import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; - import from EtsiTs102941MessagesItss language "ASN.1:1997" all; + import from EtsiTs102941MessagesCa language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; type union BinaryBody { diff --git a/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn b/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn index d1957bc8..45c6df15 100644 --- a/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn +++ b/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn @@ -19,7 +19,7 @@ module LibItsHttp_BinaryTemplates { import from IEEE1609dot2 language "ASN.1:1997" all; import from EtsiTs102941BaseTypes language "ASN.1:1997" all; import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; - import from EtsiTs102941MessagesItss language "ASN.1:1997" all; + import from EtsiTs102941MessagesCa language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; template (value) BinaryBody m_binary_body_raw( diff --git a/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn b/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn index feedb525..fb30eae7 100644 --- a/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn +++ b/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn @@ -5,16 +5,16 @@ module LibItsPki_EncdecDeclarations { import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; import from EtsiTs102941TypesAuthorization language "ASN.1:1997" all; import from EtsiTs102941TypesAuthorizationValidation language "ASN.1:1997" all; - import from EtsiTs102941MessagesItss language "ASN.1:1997" all; + import from EtsiTs102941MessagesCa language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; import from LibItsSecurity_TypesAndValues all; - external function fx_enc_EtsiTs102941Data(in EtsiTs102941MessagesItss.EtsiTs102941Data p_etsi_ts_102941_data) return bitstring + external function fx_enc_EtsiTs102941Data(in EtsiTs102941MessagesCa.EtsiTs102941Data p_etsi_ts_102941_data) return bitstring with {extension "prototype(convert) encode(PER)"} - external function fx_dec_EtsiTs102941Data(inout bitstring b, out EtsiTs102941MessagesItss.EtsiTs102941Data p_etsi_ts_102941_data)return integer + external function fx_dec_EtsiTs102941Data(inout bitstring b, out EtsiTs102941MessagesCa.EtsiTs102941Data p_etsi_ts_102941_data)return integer with {extension "prototype(sliding) decode(PER)"} /** diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 47fab367..c34e2a53 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -25,7 +25,7 @@ module LibItsPki_Functions { import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; import from EtsiTs102941TypesAuthorization language "ASN.1:1997" all; import from EtsiTs102941TypesAuthorizationValidation language "ASN.1:1997" all; - import from EtsiTs102941MessagesItss language "ASN.1:1997" all; + import from EtsiTs102941MessagesCa language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; import from ITS_Container language "ASN.1:1997" all; import from CAM_PDU_Descriptions language "ASN.1:1997" all; @@ -323,7 +323,6 @@ module LibItsPki_Functions { ) runs on ItsPkiHttp { var InnerEcRequest v_inner_ec_request; var Ieee1609Dot2Data v_inner_ec_request_signed_for_pop; - var bitstring v_inner_ec_request_signed_for_pop_msg; if (f_generate_inner_ec_request(p_private_key, p_publicKeyCompressed, p_compressedMode, v_inner_ec_request) == false) { log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequest ***"); @@ -335,10 +334,9 @@ module LibItsPki_Functions { f_selfOrClientSyncAndVerdict("error", e_error); } // Secure InnerEcRequestSignedForPoP message - v_inner_ec_request_signed_for_pop_msg := encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop)); // Get 16 last byte of SHA256 of InnerEcRequestSignedForPop p_hash_inner_ec_request_signed_for_pop := f_hashWithSha256(int2oct(12345, 32)); // Invalid InnseEcRequestSignedForPop - if (f_build_pki_secured_message(vc_eaPrivateKey, valueof(m_signerIdentifier_self), vc_eaHashedId8, p_publicKeyCompressed, p_compressedMode, bit2oct(v_inner_ec_request_signed_for_pop_msg), p_ieee1609dot2_signed_and_encrypted_data) == false) { + if (f_build_pki_secured_message(vc_eaPrivateKey, valueof(m_signerIdentifier_self), vc_eaHashedId8, p_publicKeyCompressed, p_compressedMode, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data) == false) { log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); f_selfOrClientSyncAndVerdict("error", e_error); } @@ -364,15 +362,14 @@ module LibItsPki_Functions { ) runs on ItsPkiHttp { // Local variables var AuthorizationValidationRequest v_authorization_validation_request; + var bitstring v_authorization_validation_request_msg; if (f_generate_authorization_validation_request(vc_eaCertificate, vc_eaHashedId8, p_private_key, p_publicKeyCompressed, p_compressedMode, v_authorization_validation_request) == false) { log("*** f_http_build_authorization_validation_request: ERROR: Failed to generate AuthorizationValidationRequest ***"); f_selfOrClientSyncAndVerdict("error", e_error); } - // FIXME Encapsulate v_authorization_validation_request into EtsiTs102941Data structure - - if (f_build_pki_secured_message(vc_eaPrivateKey, valueof(m_signerIdentifier_self), vc_eaHashedId8, p_publicKeyCompressed, p_compressedMode, bit2oct(encvalue(v_authorization_validation_request)), p_ieee1609dot2_signed_and_encrypted_data) == false) { + if (f_build_pki_secured_message(vc_eaPrivateKey, valueof(m_signerIdentifier_self), vc_eaHashedId8, p_publicKeyCompressed, p_compressedMode, bit2oct(encvalue(m_etsiTs102941Data_authorization_validation_request(v_authorization_validation_request))), p_ieee1609dot2_signed_and_encrypted_data) == false) { log("*** f_http_build_authorization_validation_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); f_selfOrClientSyncAndVerdict("error", e_error); } diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn index 4964c672..14d0a5b2 100644 --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ b/ttcn/Pki/LibItsPki_Templates.ttcn @@ -28,7 +28,7 @@ module LibItsPki_Templates { import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; import from EtsiTs102941TypesAuthorization language "ASN.1:1997" all; import from EtsiTs102941TypesAuthorizationValidation language "ASN.1:1997" all; - import from EtsiTs102941MessagesItss language "ASN.1:1997" all; + import from EtsiTs102941MessagesCa language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; // LibItsSecurity @@ -56,11 +56,11 @@ module LibItsPki_Templates { } // End of template m_etsiTs102941Data_inner_ec_response template (value) EtsiTs102941Data m_etsiTs102941Data_inner_at_request( - in template (value) InnerAtRequest p_inner_at_response + in template (value) InnerAtRequest p_inner_at_request ) := { version := PkiProtocolVersion, content := { - authorizationRequest := p_inner_at_response + authorizationRequest := p_inner_at_request } } // End of template m_etsiTs102941Data_inner_at_request @@ -73,6 +73,24 @@ module LibItsPki_Templates { } } // End of template m_etsiTs102941Data_inner_at_response + template (value) EtsiTs102941Data m_etsiTs102941Data_authorization_validation_request( + in template (value) AuthorizationValidationRequest p_authorization_validation_request + ) := { + version := PkiProtocolVersion, + content := { + authorizationValidationRequest := p_authorization_validation_request + } + } // End of template m_etsiTs102941Data_authorization_validation_request + + template (value) EtsiTs102941Data m_etsiTs102941Data_authorization_validation_response( + in template (value) AuthorizationValidationResponse p_authorization_validation_response + ) := { + version := PkiProtocolVersion, + content := { + authorizationValidationResponse := p_authorization_validation_response + } + } // End of template m_etsiTs102941Data_authorization_validation_response + template (present) EnrolmentRequestMessage mw_enrolmentRequestMessage( template (present) EncryptedData p_encryptedData := ? ) modifies mw_etsiTs103097Data_encrypted := { @@ -148,6 +166,12 @@ module LibItsPki_Templates { authorizationResponse := p_authorizationResponse } // End of template mw_authorizationResponse + template (present) EtsiTs102941DataContent mw_authorizationValidationResponse( + template (present) AuthorizationValidationResponse p_authorization_alidation_response := ? + ) := { + authorizationValidationResponse := p_authorization_alidation_response + } // End of template mw_authorizationValidationResponse + template (value) InnerEcRequest m_innerEcRequest( in template (value) charstring p_itsId, in template (value) PublicKeys p_publicKeys, diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index 22090f95..447bf30f 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -22,7 +22,7 @@ module LibItsPki_TestSystem { import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; import from EtsiTs102941TypesAuthorization language "ASN.1:1997" all; import from EtsiTs102941TypesAuthorizationValidation language "ASN.1:1997" all; - import from EtsiTs102941MessagesItss language "ASN.1:1997" all; + import from EtsiTs102941MessagesCa language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; // LibItsCommon @@ -46,7 +46,7 @@ module LibItsPki_TestSystem { /** * @desc Adapter control port */ - type port AdapterControlPkiPort message { + type port AdapterControlPort message { out AcPkiPrimitive; in AcPkiResponse; } // End of AdapterControlPort @@ -54,7 +54,7 @@ module LibItsPki_TestSystem { /** * @desc Upper Tester port */ - type port UpperTesterPkiPort message { // TODO This is a work-around for a TITAN bug: UpperTesterPort_BASE class declared after UpperTesterPort class + type port UpperTesterPort message { out UtPkiInitialize, UtPkiTrigger; in UtPkiResults; } // End of UpperTesterPort @@ -72,7 +72,7 @@ module LibItsPki_TestSystem { group componentDefinitions { type component ItsPkiSystem { - port AdapterControlPkiPort acPort; + port AdapterControlPort acPort; port PkiPort pkiPort; } // End of component ItsPkiSystem @@ -80,14 +80,14 @@ module LibItsPki_TestSystem { } // End of component ItsPkiHttpSystem type component ItsPkiItssSystem extends ItsPkiSystem { - port UpperTesterPkiPort utPort; + port UpperTesterPort utPort; port GeoNetworkingPort geoNetworkingPort; } // End of component ItsPkiItssSystem } // End of group componentDefinitions type component ItsPki extends ItsSecurityBaseComponent, ItsBaseMtc { - port AdapterControlPkiPort acPort; + port AdapterControlPort acPort; port PkiPort pkiPort; var Certificate vc_eaCertificate; /** Test Adapter EA certificate */ @@ -104,7 +104,7 @@ module LibItsPki_TestSystem { } // End of component ItsPki type component ItsPkiItss extends ItsPki { - port UpperTesterPkiPort utPort; + port UpperTesterPort utPort; port GeoNetworkingPort geoNetworkingPort; } // End of component ItsPkiItss -- GitLab From ee0529068f3ecf75f6845029f10935668a70340d Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Thu, 8 Nov 2018 06:58:20 +0100 Subject: [PATCH 151/320] Change module EtsiTs102941MessagesItss into EtsiTs102941MessagesCa --- ttcn/Common/LibItsCommon_TypesAndValues.ttcn | 2 +- ttcn/Pki/LibItsPki_Functions.ttcn | 31 +++++++++++++------- ttcn/Pki/LibItsPki_Templates.ttcn | 31 +++++++++++++++----- 3 files changed, 45 insertions(+), 19 deletions(-) diff --git a/ttcn/Common/LibItsCommon_TypesAndValues.ttcn b/ttcn/Common/LibItsCommon_TypesAndValues.ttcn index 41c700e1..8f06347a 100644 --- a/ttcn/Common/LibItsCommon_TypesAndValues.ttcn +++ b/ttcn/Common/LibItsCommon_TypesAndValues.ttcn @@ -152,7 +152,7 @@ module LibItsCommon_TypesAndValues { const integer c_its_aid_IVI := 139; const integer c_its_aid_TLC := 140; const integer c_its_aid_GN := 141; - const integer c_its_aid_SCR := 35; // Secured Certificate Request + const integer c_its_aid_SCR := 623; // Secured Certificate Request, https://standards.ieee.org/products-services/regauth/psid/public.html } } with { diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index c34e2a53..92449ab1 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -565,7 +565,8 @@ module LibItsPki_Functions { ), m_headerInfo_inner_ec_request( c_its_aid_SCR, - f_getCurrentTimeUtc()) + f_getCurrentTimeUtc() + ) ); // Signed the encoded InnerEcRequestSignedForPop v_tbs_signed := f_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), int2oct(0, 32), p_private_key); @@ -591,7 +592,7 @@ module LibItsPki_Functions { } // End of function f_generate_inner_ec_request_signed_for_pop function f_generate_inner_ec_response( - in octetstring p_inner_ec_request_hashed_id, + in octetstring p_inner_ec_request_hash, in EtsiTs103097Certificate p_certificate, out InnerEcResponse p_inner_ec_response ) return boolean { @@ -600,7 +601,7 @@ module LibItsPki_Functions { // Build the Proof of Possession InnerEcResponse p_inner_ec_response := valueof( m_innerEcResponse_ok( - substr(p_inner_ec_request_hashed_id, 0, 16), + substr(p_inner_ec_request_hash, 0, 16), p_certificate ) ); @@ -697,12 +698,13 @@ module LibItsPki_Functions { p_eaHashedId8, v_key_tag, valueof( - m_certificate_subject_attributes( + m_certificate_subject_attributes( // FIXME Review subjectPermissions + p_ec_certificate.toBeSigned.appPermissions, + { { subjectPermissions := { all_ := NULL }, minChainLength := 1, chainLengthRange := 0, eeType := '00000000'B } }, p_ec_certificate.toBeSigned.id, p_ec_certificate.toBeSigned.validityPeriod, p_ec_certificate.toBeSigned.region, - p_ec_certificate.toBeSigned.assuranceLevel, - p_ec_certificate.toBeSigned.appPermissions + p_ec_certificate.toBeSigned.assuranceLevel )))); v_hash_shared_at_request := f_hashWithSha256(bit2oct(encvalue(p_inner_at_request.sharedAtRequest))); log("v_hash_shared_at_request=", v_hash_shared_at_request); @@ -858,12 +860,21 @@ module LibItsPki_Functions { } // End of function f_generate_authorization_validation_request function f_generate_authorization_validation_response( - in InnerAtRequest p_inner_at_request, - in Certificate p_certificate, + in octetstring p_authorization_validation_request_hash, + in CertificateSubjectAttributes p_Certificate_subject_attributes, out AuthorizationValidationResponse p_authorization_validation_response ) return boolean { - // TODO - return false; + // Local variables + + // Build the Proof of Possession InnerEcResponse + p_authorization_validation_response := valueof( + m_authorizationValidationResponse_ok( + substr(p_authorization_validation_request_hash, 0, 16), + p_Certificate_subject_attributes + ) + ); + + return true; } // End of function f_generate_authorization_validation_response } // End of group authorization_validation_xxx diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn index 14d0a5b2..64b342ce 100644 --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ b/ttcn/Pki/LibItsPki_Templates.ttcn @@ -83,8 +83,8 @@ module LibItsPki_Templates { } // End of template m_etsiTs102941Data_authorization_validation_request template (value) EtsiTs102941Data m_etsiTs102941Data_authorization_validation_response( - in template (value) AuthorizationValidationResponse p_authorization_validation_response - ) := { + in template (value) AuthorizationValidationResponse p_authorization_validation_response + ) := { version := PkiProtocolVersion, content := { authorizationValidationResponse := p_authorization_validation_response @@ -319,6 +319,23 @@ module LibItsPki_Templates { ecSignature := p_ecSignature } // End of template m_authorizationValidationRequest + template (present) AuthorizationValidationRequest mw_authorizationValidationRequest( + template (present) SharedAtRequest p_sharedAtRequest := ?, + template (present) EcSignature p_ecSignature := ? + ) := { + sharedAtRequest := p_sharedAtRequest, + ecSignature := p_ecSignature + } // End of template mw_authorizationValidationRequest + + template (value) AuthorizationValidationResponse m_authorizationValidationResponse_ok( + template (value) Oct16 p_requestHash, + template (value) CertificateSubjectAttributes p_confirmedSubjectAttributes + ) := { + requestHash := p_requestHash, + responseCode := ok, + confirmedSubjectAttributes := p_confirmedSubjectAttributes + } // End of template m_authorizationValidationResponse_ok + template (present) AuthorizationValidationResponse mw_authorizationValidationResponse_ok( template (present) Oct16 p_requestHash := ?, template (present) CertificateSubjectAttributes p_confirmedSubjectAttributes := ? @@ -381,16 +398,14 @@ module LibItsPki_Templates { ) := { ecSignature := p_ecSignature } // End of template mw_ec_signature_ext_payload - - - + template (omit) CertificateSubjectAttributes m_certificate_subject_attributes( + in template (value) SequenceOfPsidSsp p_appPermissions, + in template (value) SequenceOfPsidGroupPermissions p_certIssuePermissions, in template (omit) CertificateId p_id := omit, in template (omit) ValidityPeriod p_validityPeriod := omit, in template (omit) GeographicRegion p_region := omit, - in template (omit) SubjectAssurance p_assuranceLevel := omit, - in template (omit) SequenceOfPsidSsp p_appPermissions := omit, - in template (omit) SequenceOfPsidGroupPermissions p_certIssuePermissions := omit + in template (omit) SubjectAssurance p_assuranceLevel := omit ) := { id := p_id, validityPeriod := p_validityPeriod, -- GitLab From 119269254ac0b6bb4a5cdef3bd64ced8502353ce Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 12 Nov 2018 14:07:24 +0100 Subject: [PATCH 152/320] AtsPki validation with Gemalto --- ttcn/Pki/LibItsPki_Functions.ttcn | 127 +++++++++++++++++++++++++---- ttcn/Pki/LibItsPki_Pics.ttcn | 62 +++++++++++++- ttcn/Pki/LibItsPki_Pixits.ttcn | 1 + ttcn/Pki/LibItsPki_TestSystem.ttcn | 15 ++-- 4 files changed, 180 insertions(+), 25 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 92449ab1..a047d156 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -55,6 +55,7 @@ module LibItsPki_Functions { import from LibItsPki_TypesAndValues all; import from LibItsPki_Templates all; import from LibItsPki_Pics all; + import from LibItsPki_Pixits all; import from LibItsPki_TestSystem all; group pkiConfigurationFunctions { @@ -85,19 +86,23 @@ module LibItsPki_Functions { * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT */ function f_cfHttpUp( - in charstring p_certificateId := "CERT_TS_A_EA", // TODO Use a constant + in charstring p_ea_certificate_id := "CERT_TS_A_EA", // TODO Use a constant + in charstring p_ec_certificate_id := "CERT_TS_A_EC", in charstring p_peerCertificateId := "CERT_IUT_A_EA" - ) runs on ItsPkiHttp /* TITAN TODO: system ItsPkiHttpSystem */ { + ) runs on ItsPkiHttp /* TITAN TODO: system ItsPkiHttpSystem */ { map(self:httpPort, system:httpPort); f_connect4SelfOrClientSync(); - f_initialiseSecuredMode(p_certificateId, p_peerCertificateId); + f_initialiseSecuredMode(p_ea_certificate_id, p_peerCertificateId); - f_readCertificate(p_certificateId, vc_eaCertificate); - f_readSigningKey(p_certificateId, vc_eaPrivateKey); - f_readEncryptingKey(p_certificateId, vc_eaPrivateEncKey); - f_getCertificateDigest(p_certificateId, vc_eaHashedId8); + f_readCertificate(p_ea_certificate_id, vc_eaCertificate); + f_readSigningKey(p_ea_certificate_id, vc_eaPrivateKey); + f_readCertificate(p_ec_certificate_id, vc_ecCertificate); + f_readSigningKey(p_ec_certificate_id, vc_ecPrivateKey); + f_readEncryptingKey(p_ea_certificate_id, vc_eaPrivateEncKey); + f_getCertificateDigest(p_ea_certificate_id, vc_eaHashedId8); + f_getCertificateDigest(p_ec_certificate_id, vc_ecHashedId8); f_readCertificate(p_peerCertificateId, vc_peerEaCertificate); f_getCertificateHash(p_peerCertificateId, vc_eaPeerWholeHash); @@ -280,17 +285,20 @@ module LibItsPki_Functions { group http { function f_http_build_inner_ec_request( - out octetstring p_private_key, - out octetstring p_publicKeyCompressed, - out integer p_compressedMode, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, - out Oct32 p_hash_inner_ec_request_signed_for_pop - ) runs on ItsPkiHttp { + out octetstring p_private_key, + out octetstring p_publicKeyCompressed, + out integer p_compressedMode, + out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, + out Oct32 p_hash_inner_ec_request_signed_for_pop + ) runs on ItsPkiHttp { var octetstring v_publicKeyX; var octetstring v_publicKeyY var InnerEcRequest v_inner_ec_request; var Ieee1609Dot2Data v_inner_ec_request_signed_for_pop; var bitstring v_inner_ec_request_signed_for_pop_msg; + var octetstring v_public_enc_key; + var integer v_compressed_enc_key_mode; + var boolean v_ret_code; if (f_generate_inner_ec_request(p_private_key, p_publicKeyCompressed, p_compressedMode, v_inner_ec_request) == false) { log("*** f_http_build_inner_ec_request: ERROR: Failed to generate InnerEcRequest ***"); @@ -305,7 +313,20 @@ module LibItsPki_Functions { v_inner_ec_request_signed_for_pop_msg := encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop)); // Prepare for getting the 16 most bytes of SHA256 of InnerEcRequestSignedForPop p_hash_inner_ec_request_signed_for_pop := f_hashWithSha256(bit2oct(v_inner_ec_request_signed_for_pop_msg)); - if (f_build_pki_secured_message(vc_eaPrivateKey, valueof(m_signerIdentifier_self), vc_eaHashedId8, p_publicKeyCompressed, p_compressedMode, bit2oct(v_inner_ec_request_signed_for_pop_msg), p_ieee1609dot2_signed_and_encrypted_data) == false) { + // Secure the Pki message + if (f_extract_enc_key(vc_eaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { + log("*** f_http_build_inner_ec_request: ERROR: Non canonical EA certificate ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + log("*** f_http_build_inner_ec_request: Public encryption key: ", v_public_enc_key); + log("*** f_http_build_inner_ec_request: Public encryption key comp: ", v_compressed_enc_key_mode); + log("*** f_http_build_inner_ec_request: First enrolment: ", PX_FIRST_ENROLMENT); + if (PX_FIRST_ENROLMENT == true) { // This is the first enrolment, we used Factory keys + v_ret_code := f_build_pki_secured_message(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, bit2oct(v_inner_ec_request_signed_for_pop_msg), p_ieee1609dot2_signed_and_encrypted_data); + } else { // We use last valid EC certificate + v_ret_code := f_build_pki_secured_message(vc_ecPrivateKey, valueof(m_signerIdentifier_digest(vc_ecHashedId8)), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, bit2oct(v_inner_ec_request_signed_for_pop_msg), p_ieee1609dot2_signed_and_encrypted_data); + } + if (v_ret_code == false) { log("*** f_http_build_inner_ec_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); f_selfOrClientSyncAndVerdict("error", e_error); } @@ -323,6 +344,9 @@ module LibItsPki_Functions { ) runs on ItsPkiHttp { var InnerEcRequest v_inner_ec_request; var Ieee1609Dot2Data v_inner_ec_request_signed_for_pop; + var octetstring v_public_enc_key; + var integer v_compressed_enc_key_mode; + var boolean v_ret_code; if (f_generate_inner_ec_request(p_private_key, p_publicKeyCompressed, p_compressedMode, v_inner_ec_request) == false) { log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequest ***"); @@ -336,7 +360,19 @@ module LibItsPki_Functions { // Secure InnerEcRequestSignedForPoP message // Get 16 last byte of SHA256 of InnerEcRequestSignedForPop p_hash_inner_ec_request_signed_for_pop := f_hashWithSha256(int2oct(12345, 32)); // Invalid InnseEcRequestSignedForPop - if (f_build_pki_secured_message(vc_eaPrivateKey, valueof(m_signerIdentifier_self), vc_eaHashedId8, p_publicKeyCompressed, p_compressedMode, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data) == false) { + // Secure the Pki message + if (f_extract_enc_key(vc_eaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { + log("*** f_http_build_inner_ec_request: ERROR: Non canonical EA certificate ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + log("*** f_http_build_inner_ec_request: Public encryption key: ", v_public_enc_key); + log("*** f_http_build_inner_ec_request: Public encryption key comp: ", v_compressed_enc_key_mode); + if (PX_FIRST_ENROLMENT == true) { // This is the first enrolment, we used Factory keys + v_ret_code := f_build_pki_secured_message(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data); + } else { // We use last valid EC certificate + v_ret_code := f_build_pki_secured_message(vc_ecPrivateKey, valueof(m_signerIdentifier_digest(vc_ecHashedId8)), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data); + } + if (v_ret_code == false) { log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); f_selfOrClientSyncAndVerdict("error", e_error); } @@ -363,16 +399,32 @@ module LibItsPki_Functions { // Local variables var AuthorizationValidationRequest v_authorization_validation_request; var bitstring v_authorization_validation_request_msg; + var octetstring v_public_enc_key; + var integer v_compressed_enc_key_mode; if (f_generate_authorization_validation_request(vc_eaCertificate, vc_eaHashedId8, p_private_key, p_publicKeyCompressed, p_compressedMode, v_authorization_validation_request) == false) { log("*** f_http_build_authorization_validation_request: ERROR: Failed to generate AuthorizationValidationRequest ***"); f_selfOrClientSyncAndVerdict("error", e_error); } - - if (f_build_pki_secured_message(vc_eaPrivateKey, valueof(m_signerIdentifier_self), vc_eaHashedId8, p_publicKeyCompressed, p_compressedMode, bit2oct(encvalue(m_etsiTs102941Data_authorization_validation_request(v_authorization_validation_request))), p_ieee1609dot2_signed_and_encrypted_data) == false) { - log("*** f_http_build_authorization_validation_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); + // Secure the Pki message + if (f_extract_enc_key(vc_eaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { + log("*** f_http_build_inner_ec_request: ERROR: Non canonical EA certificate ***"); f_selfOrClientSyncAndVerdict("error", e_error); } + log("*** f_http_build_authorization_validation_request: Public encryption key: ", v_public_enc_key); + log("*** f_http_build_authorization_validation_request: Public encryption key comp: ", v_compressed_enc_key_mode); + + + /** + TODO: Load certificate according to the IUT role + ==> a complete fucntion which set up the TestSustem certificate,keyy... according to the IUT role + **/ + log("*** f_http_build_inner_ec_request: ERROR: Need to add TestSystem variable vc_aa ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + /* if (f_build_pki_secured_message(vc_aaPrivateKey, valueof(m_signerIdentifier_digest(vc_aaHashedId8)), vc_eaHashedId8/\*recipientId*\/, v_public_enc_key, v_compressed_enc_key_mode, bit2oct(encvalue(m_etsiTs102941Data_authorization_validation_request(v_authorization_validation_request))), p_ieee1609dot2_signed_and_encrypted_data) == false) { */ + /* log("*** f_http_build_authorization_validation_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); */ + /* f_selfOrClientSyncAndVerdict("error", e_error); */ + /* } */ log("*** f_http_build_authorization_validation_request: DEBUG: p_ieee1609dot2_signed_and_encrypted_data = ", p_ieee1609dot2_signed_and_encrypted_data); } // End of function f_http_build_authorization_validation_request @@ -1127,6 +1179,45 @@ module LibItsPki_Functions { } // End of function f_verify_aa_certificate } // End of group inner_ec_xxx + + group security_function { // TODO To be moved in LibItsSecurity_Function module + + function f_extract_enc_key( + in Certificate p_certificate, + out octetstring p_public_enc_key, + out integer p_compressed_enc_key_mode + ) return boolean { + if (ischosen(p_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256)) { + if (ischosen(p_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0)) { + p_public_enc_key := p_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0; + p_compressed_enc_key_mode := 0; + } else if (ischosen(p_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_1)) { + p_public_enc_key := p_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_1; + p_compressed_enc_key_mode := 1; + } else { + log("f_extract_enc_key: Non canonical EA certificate"); + return false; + } + } else if (ischosen(p_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1)) { + if (ischosen(p_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0)) { + p_public_enc_key := p_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0; + p_compressed_enc_key_mode := 0; + } else if (ischosen(p_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_1)) { + p_public_enc_key := p_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_1; + p_compressed_enc_key_mode := 0; + } else { + log("f_extract_enc_key: Non canonical EA certificate"); + return false; + } + } else { + log("f_extract_enc_key: Invalid EA certificate"); + return false; + } + + return true; + } // End of function f_extract_enc_key + + } // End of group security_function group altstes { diff --git a/ttcn/Pki/LibItsPki_Pics.ttcn b/ttcn/Pki/LibItsPki_Pics.ttcn index 21275fd3..2d3b99ee 100644 --- a/ttcn/Pki/LibItsPki_Pics.ttcn +++ b/ttcn/Pki/LibItsPki_Pics.ttcn @@ -50,9 +50,69 @@ module LibItsPki_Pics { */ modulepar charstring PICS_HTTP_GET_URI := "/its/inner_ec_request"; + /** + * @desc Factory private key for verification Nist P256 + */ + modulepar octetstring PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY := '5C25F97607DFC62972A147FAD8B7A7C939569F0F95ECD4C641724A68B51836E5'O; + + /** + * @desc Factory compressed public key for verification Nist P256 + */ + modulepar octetstring PICS_ITS_S_SIGN_NISTP256_PUBLIC_KEY := '020144E5174B0AFDA86BDB8B643B68D40030F5BDB9A9F090C64852CC3C20C9D5AD'O; + + /** + * @desc Factory private key for encryption Nist P256 + */ + modulepar octetstring PICS_ITS_S_ENC_NITSP256_PRIVATE_KEY := 'EDEBEADCAA9514CD4B30256126FB7DF958B911C6EB58CCF702983C3DCD3DECBD'O; + + /** + * @desc Factory compressed public key for encryption Nist P256 + */ + modulepar octetstring PICS_ITS_S_ENC_NISTP256_PUBLIC_KEY := '023A4ADDCDD5EE66DAB2116B0C3AB47CCEDAE92CD9ACE98A84B10EB63A9DCA798C'O; + + /** + * @desc Factory private key for encryption Brainpool P256 r1 + */ + modulepar octetstring PICS_ITS_S_ENC_BRAINPOOLP256r1_PRIVATE_KEY := '9F155D40B6C920BA45D8027093C8ADADAF3AA6F9F71F0CC0F8279FF0146A8A48'O; + + /** + * @desc Factory compressed public key for encryption Brainpool P256 r1 + */ + modulepar octetstring PICS_ITS_S_ENC_BRAINPOOLP256r1_PUBLIC_KEY := '038602F468BD334EA4D2BA416295E204D58BD1F42C85FB9BE57237C74544F6A69A'O; + + /** + * @desc Factory private key for verification Brainpool P256 r1 + */ + modulepar octetstring PICS_ITS_S_SIGN_BRAINPOOLP256r1_PRIVATE_KEY := '6D585B716D06F75EC2B8A8ADEBFCE6ED35B0640C2AFBFF25FE48FC81A6732D4F'O; + + /** + * @desc Factory compressed public key for verification Brainpool P256 r1 + */ + modulepar octetstring PICS_ITS_S_SIGN_BRAINPOOLP256r1_PUBLIC_KEY := '02A92BA3B770B040B8D958D5BD2CC9B537212D6963F50EA3E4784FEFA5D0454C12'O; + + /** + * @desc Factory private key for encryption Brainpool P384 r1 + */ + modulepar octetstring PICS_ITS_S_ENC_BRAINPOOLP384r1_PRIVATE_KEY := '6B4B4392511B252C904801466F5DA0A7F28E038E6656800CBB0CDCB3D32F862CA4D59CBDC1A19E98E9191582AF1DB3D7'O; + + /** + * @desc Factory compressed public key for encryption Brainpool P384 r1 + */ + modulepar octetstring PICS_ITS_S_ENC_BRAINPOOLP384r1_PUBLIC_KEY := '027BB3104998F30B86B0C7C6CC9BFAECA7F7E99E8CE575D07B550028CCB15E1C95581B9B8520D40A35256021DDA63B785C'O; + + /** + * @desc Factory private key for verification Brainpool P384 r1 + */ + modulepar octetstring PICS_ITS_S_SIGN_BRAINPOOLP384r1_PRIVATE_KEY := '3CD977195A579787C84D5900F4CB6341E0C3D2750B140C5380E6F03CE3FBA0022F7541DEABDCED4790D313ED8F56ACA8'O; + + /** + * @desc Factory compressed public key for verification Brainpool P384 r1 + */ + modulepar octetstring PICS_ITS_S_SIGN_BRAINPOOLP384r1_PUBLIC_KEY := '0243FF5C96984C2C3F5FD5C5F6551C90F5FAEE1E5E8301763E4AF1E9D627F3474E554B82EE98EC4B49808DFF61B35F8313'O; + /** * @desc Canonical ITSS-S identifier */ - modulepar charstring PICS_ITS_S_CANONICAL_ID := "CanonicalItsId"; + modulepar charstring PICS_ITS_S_CANONICAL_ID := "1B4CA1210123AE900BBE6C3EBAE7E87DA20DBDAB1E7B2EC0691C51C1021900AA"; } // End of module LibItsPki_Pics diff --git a/ttcn/Pki/LibItsPki_Pixits.ttcn b/ttcn/Pki/LibItsPki_Pixits.ttcn index 578a8194..5cc81596 100644 --- a/ttcn/Pki/LibItsPki_Pixits.ttcn +++ b/ttcn/Pki/LibItsPki_Pixits.ttcn @@ -1,4 +1,5 @@ module LibItsPki_Pixits { + modulepar boolean PX_FIRST_ENROLMENT := true; } // End of module LibItsPki_Pixits diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index 447bf30f..2e3b11e2 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -46,7 +46,7 @@ module LibItsPki_TestSystem { /** * @desc Adapter control port */ - type port AdapterControlPort message { + type port AdapterControlPkiPort message { out AcPkiPrimitive; in AcPkiResponse; } // End of AdapterControlPort @@ -54,7 +54,7 @@ module LibItsPki_TestSystem { /** * @desc Upper Tester port */ - type port UpperTesterPort message { + type port UpperTesterPkiPort message { out UtPkiInitialize, UtPkiTrigger; in UtPkiResults; } // End of UpperTesterPort @@ -72,7 +72,7 @@ module LibItsPki_TestSystem { group componentDefinitions { type component ItsPkiSystem { - port AdapterControlPort acPort; + port AdapterControlPkiPort acPort; port PkiPort pkiPort; } // End of component ItsPkiSystem @@ -80,14 +80,14 @@ module LibItsPki_TestSystem { } // End of component ItsPkiHttpSystem type component ItsPkiItssSystem extends ItsPkiSystem { - port UpperTesterPort utPort; + port UpperTesterPkiPort utPort; port GeoNetworkingPort geoNetworkingPort; } // End of component ItsPkiItssSystem } // End of group componentDefinitions type component ItsPki extends ItsSecurityBaseComponent, ItsBaseMtc { - port AdapterControlPort acPort; + port AdapterControlPkiPort acPort; port PkiPort pkiPort; var Certificate vc_eaCertificate; /** Test Adapter EA certificate */ @@ -97,14 +97,17 @@ module LibItsPki_TestSystem { type component ItsPkiHttp extends ItsSecurityBaseComponent, HttpComponent { var Certificate vc_eaCertificate; /** Test Adapter EA certificate */ var octetstring vc_eaPrivateKey; /** Test Adapter EA private key for signature */ + var Certificate vc_ecCertificate; /** Test Adapter EC certificate */ + var octetstring vc_ecPrivateKey; /** Test Adapter EC private key for signature */ var octetstring vc_eaPrivateEncKey; /** Test Adapter EA private key for encryption */ var HashedId8 vc_eaHashedId8; /** Test Adapter EA HashedId8 for decryption of IUT's response */ + var HashedId8 vc_ecHashedId8; /** Test Adapter EC HashedId8 for decryption of IUT's response */ var Certificate vc_peerEaCertificate; /** IUT EA certificate for signature check */ var octetstring vc_eaPeerWholeHash; /** IUT EA whole-hash for signature check */ } // End of component ItsPki type component ItsPkiItss extends ItsPki { - port UpperTesterPort utPort; + port UpperTesterPkiPort utPort; port GeoNetworkingPort geoNetworkingPort; } // End of component ItsPkiItss -- GitLab From 907f56d1e4797e04be1c9baacff582312c2eb813 Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Wed, 14 Nov 2018 18:01:00 +0100 Subject: [PATCH 153/320] Merge with STF549_NG112 --- ttcn/Http/LibItsHttp_Templates.ttcn | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ttcn/Http/LibItsHttp_Templates.ttcn b/ttcn/Http/LibItsHttp_Templates.ttcn index 47579911..d77da983 100644 --- a/ttcn/Http/LibItsHttp_Templates.ttcn +++ b/ttcn/Http/LibItsHttp_Templates.ttcn @@ -85,6 +85,19 @@ module LibItsHttp_Templates { body := p_body } // End of template m_http_request_post + template Request mw_http_request_post( + template (present) charstring p_uri := ?, + template (present) HeaderLines p_headers := ?, + template HttpMessageBody p_body := * + ) := { + method := "POST", + uri := p_uri, + version_major := c_http_version_major, + version_minor := c_http_version_minor, + header := p_headers, + body := p_body + } // End of template mw_http_request_post + } // End of group http_requests group http_responses { -- GitLab From 1a58023b9207204eb0fa982352530b201cc69878 Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 16 Nov 2018 16:00:49 +0100 Subject: [PATCH 154/320] Major bugs fixed in security_ecc, remove useless folders for STF525 --- ttcn/Pki/LibItsPki_Functions.ttcn | 18 +++++++------- ttcn/Pki/LibItsPki_TestSystem.ttcn | 1 + ttcn/Security/LibItsSecurity_Functions.ttcn | 26 ++++++++++++++++----- 3 files changed, 31 insertions(+), 14 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index a047d156..fb625620 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -102,6 +102,7 @@ module LibItsPki_Functions { f_readSigningKey(p_ec_certificate_id, vc_ecPrivateKey); f_readEncryptingKey(p_ea_certificate_id, vc_eaPrivateEncKey); f_getCertificateDigest(p_ea_certificate_id, vc_eaHashedId8); + f_getCertificateHash(p_ea_certificate_id, vc_eaWholeHash); f_getCertificateDigest(p_ec_certificate_id, vc_ecHashedId8); f_readCertificate(p_peerCertificateId, vc_peerEaCertificate); f_getCertificateHash(p_peerCertificateId, vc_eaPeerWholeHash); @@ -322,9 +323,9 @@ module LibItsPki_Functions { log("*** f_http_build_inner_ec_request: Public encryption key comp: ", v_compressed_enc_key_mode); log("*** f_http_build_inner_ec_request: First enrolment: ", PX_FIRST_ENROLMENT); if (PX_FIRST_ENROLMENT == true) { // This is the first enrolment, we used Factory keys - v_ret_code := f_build_pki_secured_message(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, bit2oct(v_inner_ec_request_signed_for_pop_msg), p_ieee1609dot2_signed_and_encrypted_data); + v_ret_code := f_build_pki_secured_message(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, vc_eaWholeHash, bit2oct(v_inner_ec_request_signed_for_pop_msg), p_ieee1609dot2_signed_and_encrypted_data); } else { // We use last valid EC certificate - v_ret_code := f_build_pki_secured_message(vc_ecPrivateKey, valueof(m_signerIdentifier_digest(vc_ecHashedId8)), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, bit2oct(v_inner_ec_request_signed_for_pop_msg), p_ieee1609dot2_signed_and_encrypted_data); + v_ret_code := f_build_pki_secured_message(vc_ecPrivateKey, valueof(m_signerIdentifier_digest(vc_ecHashedId8)), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, vc_eaWholeHash, bit2oct(v_inner_ec_request_signed_for_pop_msg), p_ieee1609dot2_signed_and_encrypted_data); } if (v_ret_code == false) { log("*** f_http_build_inner_ec_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); @@ -368,9 +369,9 @@ module LibItsPki_Functions { log("*** f_http_build_inner_ec_request: Public encryption key: ", v_public_enc_key); log("*** f_http_build_inner_ec_request: Public encryption key comp: ", v_compressed_enc_key_mode); if (PX_FIRST_ENROLMENT == true) { // This is the first enrolment, we used Factory keys - v_ret_code := f_build_pki_secured_message(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data); + v_ret_code := f_build_pki_secured_message(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, vc_eaWholeHash, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data); } else { // We use last valid EC certificate - v_ret_code := f_build_pki_secured_message(vc_ecPrivateKey, valueof(m_signerIdentifier_digest(vc_ecHashedId8)), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data); + v_ret_code := f_build_pki_secured_message(vc_ecPrivateKey, valueof(m_signerIdentifier_digest(vc_ecHashedId8)), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, vc_eaWholeHash, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data); } if (v_ret_code == false) { log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); @@ -421,7 +422,7 @@ module LibItsPki_Functions { **/ log("*** f_http_build_inner_ec_request: ERROR: Need to add TestSystem variable vc_aa ***"); f_selfOrClientSyncAndVerdict("error", e_error); - /* if (f_build_pki_secured_message(vc_aaPrivateKey, valueof(m_signerIdentifier_digest(vc_aaHashedId8)), vc_eaHashedId8/\*recipientId*\/, v_public_enc_key, v_compressed_enc_key_mode, bit2oct(encvalue(m_etsiTs102941Data_authorization_validation_request(v_authorization_validation_request))), p_ieee1609dot2_signed_and_encrypted_data) == false) { */ + /* if (f_build_pki_secured_message(vc_aaPrivateKey, valueof(m_signerIdentifier_digest(vc_aaHashedId8)), vc_eaHashedId8/\*recipientId*\/, v_public_enc_key, v_compressed_enc_key_mode, vc_eaWholeHash, bit2oct(encvalue(m_etsiTs102941Data_authorization_validation_request(v_authorization_validation_request))), p_ieee1609dot2_signed_and_encrypted_data) == false) { */ /* log("*** f_http_build_authorization_validation_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); */ /* f_selfOrClientSyncAndVerdict("error", e_error); */ /* } */ @@ -814,7 +815,7 @@ module LibItsPki_Functions { } else { return false; } - v_enc_signed_ec_signature := f_encryptWithEciesNistp256WithSha256(bit2oct(encvalue(v_signed_ec_signature)), v_public_enc_key, v_compressed_mode, v_publicEphemeralKeyCompressed, v_ephemeralKeyModeCompressed, v_encrypted_sym_key, v_authentication_vector, v_nonce); + v_enc_signed_ec_signature := f_encryptWithEciesNistp256WithSha256(bit2oct(encvalue(v_signed_ec_signature)), v_public_enc_key, v_compressed_mode, ''O, v_publicEphemeralKeyCompressed, v_ephemeralKeyModeCompressed, v_encrypted_sym_key, v_authentication_vector, v_nonce); v_recipientId := p_eaHashedId8; log("v_recipientId=", v_recipientId); // Fill Certificate template with the public compressed keys (canonical form) @@ -951,6 +952,7 @@ module LibItsPki_Functions { in HashedId8 p_recipientId, in octetstring p_publicKeyCompressed, in integer p_compressedMode, + in octetstring p_salt, in octetstring p_pki_message, out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data ) return boolean { @@ -1003,7 +1005,7 @@ module LibItsPki_Functions { // Encode EtsiTs103097Data-Signed data structure v_encoded_inner_ec_request := bit2oct(encvalue(v_ieee1609dot2_signed_data)); // Encrypt encode EtsiTs103097Data-Signed data structure - v_encrypted_inner_ec_request := f_encryptWithEciesNistp256WithSha256(v_encoded_inner_ec_request, p_publicKeyCompressed, p_compressedMode, v_publicEphemeralKeyCompressed, v_ephemeralKeyModeCompressed, v_encrypted_sym_key, v_authentication_vector, v_nonce); + v_encrypted_inner_ec_request := f_encryptWithEciesNistp256WithSha256(v_encoded_inner_ec_request, p_publicKeyCompressed, p_compressedMode, p_salt, v_publicEphemeralKeyCompressed, v_ephemeralKeyModeCompressed, v_encrypted_sym_key, v_authentication_vector, v_nonce); log("p_recipientId=", p_recipientId); if (p_recipientId == int2oct(0, 8)) { log("v_encrypted_sym_key=", v_encrypted_sym_key); @@ -1071,7 +1073,7 @@ module LibItsPki_Functions { var boolean v_ret; // 1. Decrypt the data - if (f_decrypt(v_private_enc_key, p_ieee1609dot2_encrypted_and_signed_data, v_ieee1609dot2_signed_data) == false) { + if (f_decrypt(v_private_enc_key, p_ieee1609dot2_encrypted_and_signed_data, ''O, v_ieee1609dot2_signed_data) == false) { if (p_check_security == true) { return false; } diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index 2e3b11e2..98abf598 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -101,6 +101,7 @@ module LibItsPki_TestSystem { var octetstring vc_ecPrivateKey; /** Test Adapter EC private key for signature */ var octetstring vc_eaPrivateEncKey; /** Test Adapter EA private key for encryption */ var HashedId8 vc_eaHashedId8; /** Test Adapter EA HashedId8 for decryption of IUT's response */ + var octetstring vc_eaWholeHash; /** TS EA whole-hash for signature check */ var HashedId8 vc_ecHashedId8; /** Test Adapter EC HashedId8 for decryption of IUT's response */ var Certificate vc_peerEaCertificate; /** IUT EA certificate for signature check */ var octetstring vc_eaPeerWholeHash; /** IUT EA whole-hash for signature check */ diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 2aba4e45..42e32bce 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -118,6 +118,7 @@ module LibItsSecurity_Functions { function f_decrypt( in octetstring p_encryptPrivateKey, in EtsiTs103097Data p_encrypedSecuredMessage, + in octetstring p_salt, out EtsiTs103097Data p_decrypedSecuredMessage ) return boolean { if (ischosen(p_encrypedSecuredMessage.content.encryptedData)) { @@ -152,7 +153,8 @@ module LibItsSecurity_Functions { 0, v_pKRecipientInfo.encKey.eciesNistP256.c, v_pKRecipientInfo.encKey.eciesNistP256.t, - v_ciphertext.aes128ccm.nonce + v_ciphertext.aes128ccm.nonce, + p_salt ); } else if (ischosen(v_pKRecipientInfo.encKey.eciesNistP256.v.compressed_y_1)) { v_decryptedSecuredMessage := f_decryptWithEciesNistp256WithSha256( @@ -162,7 +164,8 @@ module LibItsSecurity_Functions { 1, v_pKRecipientInfo.encKey.eciesNistP256.c, v_pKRecipientInfo.encKey.eciesNistP256.t, - v_ciphertext.aes128ccm.nonce + v_ciphertext.aes128ccm.nonce, + p_salt ); } else { log("*** " & testcasename() & ":ERROR: Non canonical ephemeral encryption keys ***"); @@ -238,6 +241,7 @@ module LibItsSecurity_Functions { in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyCompressed, in integer p_compressedMode, + in octetstring p_salt, out Oct32 p_publicEphemeralKeyCompressed, out integer p_ephemeralKeyModeCompressed, out Oct16 p_encrypted_sym_key, @@ -248,6 +252,7 @@ module LibItsSecurity_Functions { p_toBeEncryptedSecuredMessage, p_recipientsPublicKeyCompressed, p_compressedMode, + p_salt, p_publicEphemeralKeyCompressed, p_ephemeralKeyModeCompressed, p_encrypted_sym_key, @@ -276,7 +281,8 @@ module LibItsSecurity_Functions { in integer p_ephemeralKeyModeCompressed, in Oct16 p_encrypted_sym_key, in Oct16 p_authentication_vector, - in Oct12 p_nonce + in Oct12 p_nonce, + in octetstring p_salt ) return octetstring { return fx_decryptWithEciesNistp256WithSha256( p_encryptedSecuredMessage, @@ -285,7 +291,8 @@ module LibItsSecurity_Functions { p_ephemeralKeyModeCompressed, p_encrypted_sym_key, p_authentication_vector, - p_nonce + p_nonce, + p_salt ); } // End of function f_decryptWithEcdsaNistp256WithSha256 @@ -2307,6 +2314,12 @@ module LibItsSecurity_Functions { */ external function fx_test_decrypt_aes_128_ccm_test(in octetstring p_k, in octetstring p_n, in octetstring p_pt) return octetstring; + /** + * @desc Test function the validate AES128 CCM encryption based on AES-GCM-256 + * @return The decrypted test + */ + external function fx_test_encrypt_aes_128_gcm_test(in octetstring p_k, in octetstring p_n, in octetstring p_pt) return octetstring; + /** * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption using Nist-P256 algorithm * @param p_toBeEncryptedSecuredMessage The data to be encrypted @@ -2319,8 +2332,9 @@ module LibItsSecurity_Functions { * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption * @return The encrypted message */ - external function fx_encryptWithEciesNistp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyCompressed, in integer p_compressedMode, out Oct32 p_publicEphemeralKeyCompressed, out integer p_ephemeralKeyModeCompressed, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; + external function fx_encryptWithEciesNistp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyCompressed, in integer p_compressedMode, in octetstring p_salt, out Oct32 p_publicEphemeralKeyCompressed, out integer p_ephemeralKeyModeCompressed, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; + external function fx_test_encryptWithEciesNistp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_privateEphemeralKey, in Oct32 p_recipientPublicKeyX, in Oct32 p_recipientPublicKeyY, in octetstring p_salt, out Oct32 p_publicEphemeralKeyX, out Oct32 p_publicEphemeralKeyY, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; /** * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Nist-P256 algorithm * @param p_encryptedSecuredMessage The data to be decrypted @@ -2331,7 +2345,7 @@ module LibItsSecurity_Functions { * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption * @return The decrypted message */ - external function fx_decryptWithEciesNistp256WithSha256(in octetstring p_encryptedSecuredMessage, in Oct32 p_privateEncKey, in Oct32 p_publicEphemeralKeyCompressed, in integer p_ephemeralKeyModeCompressed, in Oct16 p_encrypted_sym_key, in Oct16 p_authentication_vector, in Oct12 p_nonce) return octetstring; + external function fx_decryptWithEciesNistp256WithSha256(in octetstring p_encryptedSecuredMessage, in Oct32 p_privateEncKey, in Oct32 p_publicEphemeralKeyCompressed, in integer p_ephemeralKeyModeCompressed, in Oct16 p_encrypted_sym_key, in Oct16 p_authentication_vector, in Oct12 p_nonce, in octetstring p_salt) return octetstring; /** * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption using Brainpool-P256 algorithm -- GitLab From bbaa3f8252456b8849a183aa849f2cb69827ff24 Mon Sep 17 00:00:00 2001 From: vagrant Date: Thu, 22 Nov 2018 17:35:33 +0100 Subject: [PATCH 155/320] AtsPki validation: major bugs fixed --- ttcn/Http/LibItsHttp_TestSystem.ttcn | 1 + ttcn/Pki/LibItsPki_Functions.ttcn | 98 ++++++++++++++++----- ttcn/Pki/LibItsPki_Pics.ttcn | 2 +- ttcn/Security/LibItsSecurity_Functions.ttcn | 40 ++++++--- ttcn/Security/LibItsSecurity_Templates.ttcn | 6 ++ 5 files changed, 111 insertions(+), 36 deletions(-) diff --git a/ttcn/Http/LibItsHttp_TestSystem.ttcn b/ttcn/Http/LibItsHttp_TestSystem.ttcn index 5576bfa0..b94479b4 100644 --- a/ttcn/Http/LibItsHttp_TestSystem.ttcn +++ b/ttcn/Http/LibItsHttp_TestSystem.ttcn @@ -25,6 +25,7 @@ module LibItsHttp_TestSystem { type component HttpComponent extends SelfSyncComp { // FIXME To be rename into HttpTest port HttpPort httpPort; timer tc_ac := PX_TAC; + timer tc_noac := PX_TNOAC; } // End of component HttpComponent type component HttpTestAdapter { // FIXME To be rename into HttpTestSystem diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index fb625620..6a75bf91 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -43,6 +43,7 @@ module LibItsPki_Functions { import from LibItsSecurity_TypesAndValues all; import from LibItsSecurity_Templates all; import from LibItsSecurity_Functions all; + import from LibItsSecurity_Pics all; import from LibItsSecurity_Pixits all; import from LibItsSecurity_TestSystem all; @@ -285,10 +286,15 @@ module LibItsPki_Functions { group http { - function f_http_build_inner_ec_request( + function f_http_build_inner_ec_request( // TODO Cleanup parameters out octetstring p_private_key, out octetstring p_publicKeyCompressed, out integer p_compressedMode, + out Oct16 p_aes_sym_key, + out Oct16 p_encrypted_sym_key, + out Oct16 p_authentication_vector, + out Oct12 p_nonce, + out octetstring p_salt, out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, out Oct32 p_hash_inner_ec_request_signed_for_pop ) runs on ItsPkiHttp { @@ -322,6 +328,7 @@ module LibItsPki_Functions { log("*** f_http_build_inner_ec_request: Public encryption key: ", v_public_enc_key); log("*** f_http_build_inner_ec_request: Public encryption key comp: ", v_compressed_enc_key_mode); log("*** f_http_build_inner_ec_request: First enrolment: ", PX_FIRST_ENROLMENT); + p_salt := vc_eaWholeHash; if (PX_FIRST_ENROLMENT == true) { // This is the first enrolment, we used Factory keys v_ret_code := f_build_pki_secured_message(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, vc_eaWholeHash, bit2oct(v_inner_ec_request_signed_for_pop_msg), p_ieee1609dot2_signed_and_encrypted_data); } else { // We use last valid EC certificate @@ -340,6 +347,11 @@ module LibItsPki_Functions { out octetstring p_private_key, out octetstring p_publicKeyCompressed, out integer p_compressedMode, + out Oct16 p_aes_sym_key, + out Oct16 p_encrypted_sym_key, + out Oct16 p_authentication_vector, + out Oct12 p_nonce, + out octetstring p_salt, out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, out Oct32 p_hash_inner_ec_request_signed_for_pop ) runs on ItsPkiHttp { @@ -368,6 +380,7 @@ module LibItsPki_Functions { } log("*** f_http_build_inner_ec_request: Public encryption key: ", v_public_enc_key); log("*** f_http_build_inner_ec_request: Public encryption key comp: ", v_compressed_enc_key_mode); + p_salt := vc_eaWholeHash; if (PX_FIRST_ENROLMENT == true) { // This is the first enrolment, we used Factory keys v_ret_code := f_build_pki_secured_message(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, vc_eaWholeHash, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data); } else { // We use last valid EC certificate @@ -800,6 +813,7 @@ module LibItsPki_Functions { var integer v_compressed_mode; var Oct12 v_nonce; var Oct16 v_authentication_vector; + var Oct16 v_aes_sym_key; var Oct16 v_encrypted_sym_key; var HashedId8 v_recipientId; var octetstring v_publicEphemeralKeyCompressed; @@ -815,7 +829,7 @@ module LibItsPki_Functions { } else { return false; } - v_enc_signed_ec_signature := f_encryptWithEciesNistp256WithSha256(bit2oct(encvalue(v_signed_ec_signature)), v_public_enc_key, v_compressed_mode, ''O, v_publicEphemeralKeyCompressed, v_ephemeralKeyModeCompressed, v_encrypted_sym_key, v_authentication_vector, v_nonce); + v_enc_signed_ec_signature := f_encryptWithEciesNistp256WithSha256(bit2oct(encvalue(v_signed_ec_signature)), v_public_enc_key, v_compressed_mode, ''O, v_publicEphemeralKeyCompressed, v_ephemeralKeyModeCompressed, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce); v_recipientId := p_eaHashedId8; log("v_recipientId=", v_recipientId); // Fill Certificate template with the public compressed keys (canonical form) @@ -954,7 +968,11 @@ module LibItsPki_Functions { in integer p_compressedMode, in octetstring p_salt, in octetstring p_pki_message, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data + out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, + out Oct16 p_aes_sym_key, + out Oct16 p_encrypted_sym_key, + out Oct16 p_authentication_vector, + out Oct12 p_nonce ) return boolean { // Local variables var template (value) EccP256CurvePoint v_eccP256_curve_point; @@ -962,9 +980,6 @@ module LibItsPki_Functions { var octetstring v_tbs_signed; var template (value) Ieee1609Dot2Data v_ieee1609dot2_signed_data; var octetstring v_encoded_inner_ec_request; - var Oct12 v_nonce; - var Oct16 v_authentication_vector; - var Oct16 v_encrypted_sym_key; var HashedId8 v_recipientId; var octetstring v_publicEphemeralKeyCompressed; var integer v_ephemeralKeyModeCompressed; @@ -1005,12 +1020,20 @@ module LibItsPki_Functions { // Encode EtsiTs103097Data-Signed data structure v_encoded_inner_ec_request := bit2oct(encvalue(v_ieee1609dot2_signed_data)); // Encrypt encode EtsiTs103097Data-Signed data structure - v_encrypted_inner_ec_request := f_encryptWithEciesNistp256WithSha256(v_encoded_inner_ec_request, p_publicKeyCompressed, p_compressedMode, p_salt, v_publicEphemeralKeyCompressed, v_ephemeralKeyModeCompressed, v_encrypted_sym_key, v_authentication_vector, v_nonce); + if (PICS_SEC_FIXED_KEYS) { + p_publicKeyCompressed := '8C5E20FE31935F6FA682A1F6D46E4468534FFEA1A698B14B0B12513EED8DEB11'O; + p_compressedMode := 0; + p_salt := '9169155B08B07674CBADF75FB46A7B0D'O; + } + v_encrypted_inner_ec_request := f_encryptWithEciesNistp256WithSha256(v_encoded_inner_ec_request, p_publicKeyCompressed, p_compressedMode, p_salt, v_publicEphemeralKeyCompressed, v_ephemeralKeyModeCompressed, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, PICS_SEC_FIXED_KEYS); + log("p_aes_sym_key=", p_aes_sym_key); + log("p_encrypted_sym_key=", p_encrypted_sym_key); + log("p_authentication_vector=", p_authentication_vector); + log("p_nonce=", p_nonce); log("p_recipientId=", p_recipientId); if (p_recipientId == int2oct(0, 8)) { - log("v_encrypted_sym_key=", v_encrypted_sym_key); - log("f_hashWithSha256(v_encrypted_sym_key=", f_hashWithSha256(v_encrypted_sym_key)); - v_recipientId := f_HashedId8FromSha256(f_hashWithSha256(v_encrypted_sym_key)); + log("f_hashWithSha256(v_encrypted_sym_key)=", f_hashWithSha256(p_encrypted_sym_key)); + v_recipientId := f_HashedId8FromSha256(f_hashWithSha256(p_encrypted_sym_key)); } else { v_recipientId := p_recipientId; } @@ -1031,13 +1054,13 @@ module LibItsPki_Functions { m_encryptedDataEncryptionKey_eciesNistP256( m_evciesP256EncryptedKey( v_eccP256_curve_point, - v_encrypted_sym_key, - v_authentication_vector + p_encrypted_sym_key, + p_authentication_vector )))) }, m_SymmetricCiphertext_aes128ccm( m_aesCcmCiphertext( - v_nonce, + p_nonce, v_encrypted_inner_ec_request ) ) @@ -1059,51 +1082,82 @@ module LibItsPki_Functions { * @return true on success, false otherwise */ function f_verify_pki_message( - in octetstring v_private_enc_key, + in octetstring p_private_enc_key, + // in octetstring p_publicEphemeralCompressedKey, // TODO Useless, to be removed + // in integer p_publicEphemeralCompressedKeyMode, // TODO Useless, to be removed + in Oct16 p_aes_sym_key, + in Oct16 p_authentication_vector, // TODO Tobe removed + // in Oct12 p_nonce, // TODO Tobe removed + // in octetstring p_salt, in octetstring p_issuer, - in Certificate p_peer_certificate, + in Certificate p_certificate, // TODO Perhaps the peer certificate will be required for signature in Ieee1609Dot2Data p_ieee1609dot2_encrypted_and_signed_data, in boolean p_check_security := true, out EtsiTs102941Data p_etsi_ts_102941_data ) return boolean { // Local variables + var octetstring v_public_enc_key; + var integer v_compressed_enc_key_mode; + var octetstring v_plain_message; var Ieee1609Dot2Data v_ieee1609dot2_signed_data; var bitstring v_etsi_ts_102941_data_msg; var bitstring v_tbs; var boolean v_ret; + //var octetstring v_cyphered_text; + var Oct16 v_authentication_vector; + + log(">>> f_verify_pki_message: p_private_enc_key= ", p_private_enc_key); + //log(">>> f_verify_pki_message: p_publicEphemeralCompressedKey= ", p_publicEphemeralCompressedKey); + log(">>> f_verify_pki_message: p_aes_sym_key=", p_aes_sym_key); + log(">>> f_verify_pki_message: p_authentication_vector=", p_authentication_vector); + log(">>> f_verify_pki_message: p_issuer=", p_issuer); + //log(">>> f_verify_pki_message: p_salt=", p_salt); + + // TODO Check p_ieee1609dot2_encrypted_and_signed_data.content.encryptedData.recipients[0].pskRecipInfo. See IEEE Std 1609.2-2017 Clause 6.3.34 PreSharedKeyRecipientInfo + // 1. Decrypt the data - if (f_decrypt(v_private_enc_key, p_ieee1609dot2_encrypted_and_signed_data, ''O, v_ieee1609dot2_signed_data) == false) { + v_plain_message := fx_test_decrypt_aes_128_ccm_test(p_aes_sym_key, p_ieee1609dot2_encrypted_and_signed_data.content.encryptedData.ciphertext.aes128ccm.nonce, p_ieee1609dot2_encrypted_and_signed_data.content.encryptedData.ciphertext.aes128ccm.ccmCiphertext); + if (isbound(v_plain_message) == false) { + return false; + } + log("v_plain_message= ", v_plain_message); + + // 2. Decode it + v_tbs := oct2bit(v_plain_message); + if (decvalue(v_tbs, v_ieee1609dot2_signed_data) != 0) { if (p_check_security == true) { return false; } } log("v_ieee1609dot2_signed_data= ", v_ieee1609dot2_signed_data); - // 2. Check the signature + // 3. Check the signature + log("v_ieee1609dot2_signed_data.content.signedData.tbsData= ", v_ieee1609dot2_signed_data.content.signedData.tbsData); v_tbs := encvalue(v_ieee1609dot2_signed_data.content.signedData.tbsData); - if (ischosen(p_peer_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256.compressed_y_0)) { + /*if (ischosen(p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256.compressed_y_0)) { v_ret := f_verifyWithEcdsaNistp256WithSha256( bit2oct(v_tbs), p_issuer, v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaNistP256Signature.rSig.x_only & v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaNistP256Signature.sSig, - p_peer_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256.compressed_y_0, + p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256.compressed_y_0, // TODO Use the signer digest to get the EA certificate 0); } else { v_ret := f_verifyWithEcdsaNistp256WithSha256( bit2oct(v_tbs), p_issuer, v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaNistP256Signature.rSig.x_only & v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaNistP256Signature.sSig, - p_peer_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256.compressed_y_1, + p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256.compressed_y_1, // TODO Use the signer digest to get the EA certificate 1); } if (v_ret == false) { if (p_check_security == true) { return false; } - } + }*/ - // 3. Retrun the PKI message + // 4. Return the PKI message + log("v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData= ", v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); v_etsi_ts_102941_data_msg := oct2bit(v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); if (decvalue(v_etsi_ts_102941_data_msg, p_etsi_ts_102941_data) != 0) { return false; diff --git a/ttcn/Pki/LibItsPki_Pics.ttcn b/ttcn/Pki/LibItsPki_Pics.ttcn index 2d3b99ee..d82caf1a 100644 --- a/ttcn/Pki/LibItsPki_Pics.ttcn +++ b/ttcn/Pki/LibItsPki_Pics.ttcn @@ -38,7 +38,7 @@ module LibItsPki_Pics { /** * @desc Certificate used by the Test System acting as EA */ - modulepar charstring PICS_TS_EA_CERTIFICATE_ID := "CERT_TS_A_EA"; + modulepar charstring PICS_TS_EA_CERTIFICATE_ID := "CERT_EA"; /** * @desc Certificate used by the Test System acting as AA diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 42e32bce..a9660d66 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -124,6 +124,7 @@ module LibItsSecurity_Functions { if (ischosen(p_encrypedSecuredMessage.content.encryptedData)) { var PKRecipientInfo v_pKRecipientInfo; var RecipientInfo v_recipientInfo := p_encrypedSecuredMessage.content.encryptedData.recipients[0]; + var octetstring v_decryptedSecuredMessage; // Check the private encryption key if (not(isbound(p_encryptPrivateKey))) { @@ -142,8 +143,8 @@ module LibItsSecurity_Functions { return false; } + if (isbound(v_pKRecipientInfo)) { if (ischosen(v_pKRecipientInfo.encKey.eciesNistP256)) { - var octetstring v_decryptedSecuredMessage; var SymmetricCiphertext v_ciphertext := p_encrypedSecuredMessage.content.encryptedData.ciphertext; if (ischosen(v_pKRecipientInfo.encKey.eciesNistP256.v.compressed_y_0)) { v_decryptedSecuredMessage := f_decryptWithEciesNistp256WithSha256( @@ -180,7 +181,6 @@ module LibItsSecurity_Functions { } } } else if (ischosen(v_pKRecipientInfo.encKey.eciesBrainpoolP256r1)) { - var octetstring v_decryptedSecuredMessage; var SymmetricCiphertext v_ciphertext := p_encrypedSecuredMessage.content.encryptedData.ciphertext; if (ischosen(v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.compressed_y_0)) { v_decryptedSecuredMessage := f_decryptWithEciesBrainpoolp256WithSha256( @@ -206,6 +206,15 @@ module LibItsSecurity_Functions { log("*** " & testcasename() & ":ERROR: Non canonical ephemeral encryption keys ***"); return false; } + } else { + log("*** " & testcasename() & ":ERROR: Non canonical ephemeral encryption keys ***"); + return false; + } + // TODO else, other variants shall be processed here if + } else { + log("*** " & testcasename() & ":ERROR: Invalid recipient info ***"); + return false; + } if (isbound(v_decryptedSecuredMessage)) { var bitstring v_decode := oct2bit(v_decryptedSecuredMessage); if (decvalue(v_decode, p_decrypedSecuredMessage) == 0) { @@ -214,7 +223,6 @@ module LibItsSecurity_Functions { log("*** " & testcasename() & ":ERROR: Faild to decode secured message ***"); } } - } } else { log("*** " & testcasename() & ":ERROR: Message not encrypted ***"); } @@ -244,9 +252,11 @@ module LibItsSecurity_Functions { in octetstring p_salt, out Oct32 p_publicEphemeralKeyCompressed, out integer p_ephemeralKeyModeCompressed, + out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, - out Oct12 p_nonce + out Oct12 p_nonce, + in boolean p_use_hardcoded_values := false ) return octetstring { return fx_encryptWithEciesNistp256WithSha256( p_toBeEncryptedSecuredMessage, @@ -255,9 +265,11 @@ module LibItsSecurity_Functions { p_salt, p_publicEphemeralKeyCompressed, p_ephemeralKeyModeCompressed, + p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, - p_nonce + p_nonce, + p_use_hardcoded_values ); } // End of function f_encryptWithEciesNistp256WithSha256 @@ -317,6 +329,7 @@ module LibItsSecurity_Functions { in integer p_compressedMode, out Oct32 p_publicEphemeralKeyCompressed, out integer p_ephemeralKeyModeCompressed, + out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce @@ -327,6 +340,7 @@ module LibItsSecurity_Functions { p_compressedMode, p_publicEphemeralKeyCompressed, p_ephemeralKeyModeCompressed, + p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce @@ -595,11 +609,11 @@ module LibItsSecurity_Functions { out integer p_compressedMode ) return boolean { if (PICS_SEC_FIXED_KEYS) { - p_privateKey := 'F8EB15C001A03623A5B5E44D73869621877710712A498C98FF9E60EE10F390F8'O; - p_publicKeyX := '7029A9B20D22AE37B1344B7FCC2322C8F1E5ECE09C39CC289E500A9487298B9B'O; - p_publicKeyY := 'F9EFA8BCC4129BC43B640566A59AE5CED7106BBA76E5DC828AF37D315634D3DC'O; - p_publicKeyCompressed := '7029A9B20D22AE37B1344B7FCC2322C8F1E5ECE09C39CC289E500A9487298B9B'O; - p_compressedMode := 0; + p_privateKey := 'D418760F0CB2DCB856BC3C7217AD3AA36DB6742AE1DB655A3D28DF88CBBF84E1'O; + p_publicKeyX := 'EE9CC7FBD9EDECEA41F7C8BD258E8D2E988E75BD069ADDCA1E5A38E534AC6818'O; + p_publicKeyY := '5AE3C8D9FE0B1FC7438F29417C240F8BF81C358EC1A4D0C6E98D8EDBCC714017'O; + p_publicKeyCompressed := 'EE9CC7FBD9EDECEA41F7C8BD258E8D2E988E75BD069ADDCA1E5A38E534AC6818'O; + p_compressedMode := 1; return true; } @@ -2332,9 +2346,9 @@ module LibItsSecurity_Functions { * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption * @return The encrypted message */ - external function fx_encryptWithEciesNistp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyCompressed, in integer p_compressedMode, in octetstring p_salt, out Oct32 p_publicEphemeralKeyCompressed, out integer p_ephemeralKeyModeCompressed, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; + external function fx_encryptWithEciesNistp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyCompressed, in integer p_compressedMode, in octetstring p_salt, out Oct32 p_publicEphemeralKeyCompressed, out integer p_ephemeralKeyModeCompressed, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce, in boolean p_use_hardcoded_values := false) return octetstring; - external function fx_test_encryptWithEciesNistp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_privateEphemeralKey, in Oct32 p_recipientPublicKeyX, in Oct32 p_recipientPublicKeyY, in octetstring p_salt, out Oct32 p_publicEphemeralKeyX, out Oct32 p_publicEphemeralKeyY, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; + external function fx_test_encryptWithEciesNistp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_privateEphemeralKey, in Oct32 p_recipientPublicKeyX, in Oct32 p_recipientPublicKeyY, in octetstring p_salt, out Oct32 p_publicEphemeralKeyX, out Oct32 p_publicEphemeralKeyY, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; /** * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Nist-P256 algorithm * @param p_encryptedSecuredMessage The data to be decrypted @@ -2359,7 +2373,7 @@ module LibItsSecurity_Functions { * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption * @return The encrypted message */ - external function fx_encryptWithEciesBrainpoolp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyCompressed, in integer p_compressedMode, out Oct32 p_publicEphemeralKeyCompressed, out integer p_ephemeralKeyModeCompressed, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; + external function fx_encryptWithEciesBrainpoolp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyCompressed, in integer p_compressedMode, out Oct32 p_publicEphemeralKeyCompressed, out integer p_ephemeralKeyModeCompressed, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; /** * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Brainpool-P256 algorithm diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index 584008fd..17ec2182 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -665,6 +665,12 @@ module LibItsSecurity_Templates { pskRecipInfo := p_pskRecipInfo } // End of template m_recipientInfo_pskRecipInfo + template (present) RecipientInfo mw_recipientInfo_pskRecipInfo( + template (present) PreSharedKeyRecipientInfo p_pskRecipInfo := ? + ) := { + pskRecipInfo := p_pskRecipInfo + } // End of template mw_recipientInfo_pskRecipInfo + template (value) RecipientInfo m_recipientInfo_symmRecipInfo( in template (value) SymmRecipientInfo p_symmRecipInfo ) := { -- GitLab From d7fb38fe273bdf9835b7ef676efb1b2b91b34af1 Mon Sep 17 00:00:00 2001 From: vagrant Date: Thu, 22 Nov 2018 18:09:53 +0100 Subject: [PATCH 156/320] AtsPki validation: major bugs fixed --- ttcn/Pki/LibItsPki_Functions.ttcn | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 6a75bf91..5aef1b10 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -330,9 +330,9 @@ module LibItsPki_Functions { log("*** f_http_build_inner_ec_request: First enrolment: ", PX_FIRST_ENROLMENT); p_salt := vc_eaWholeHash; if (PX_FIRST_ENROLMENT == true) { // This is the first enrolment, we used Factory keys - v_ret_code := f_build_pki_secured_message(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, vc_eaWholeHash, bit2oct(v_inner_ec_request_signed_for_pop_msg), p_ieee1609dot2_signed_and_encrypted_data); + v_ret_code := f_build_pki_secured_message(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(v_inner_ec_request_signed_for_pop_msg), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); } else { // We use last valid EC certificate - v_ret_code := f_build_pki_secured_message(vc_ecPrivateKey, valueof(m_signerIdentifier_digest(vc_ecHashedId8)), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, vc_eaWholeHash, bit2oct(v_inner_ec_request_signed_for_pop_msg), p_ieee1609dot2_signed_and_encrypted_data); + v_ret_code := f_build_pki_secured_message(vc_ecPrivateKey, valueof(m_signerIdentifier_digest(vc_ecHashedId8)), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(v_inner_ec_request_signed_for_pop_msg), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); } if (v_ret_code == false) { log("*** f_http_build_inner_ec_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); @@ -382,9 +382,9 @@ module LibItsPki_Functions { log("*** f_http_build_inner_ec_request: Public encryption key comp: ", v_compressed_enc_key_mode); p_salt := vc_eaWholeHash; if (PX_FIRST_ENROLMENT == true) { // This is the first enrolment, we used Factory keys - v_ret_code := f_build_pki_secured_message(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, vc_eaWholeHash, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data); + v_ret_code := f_build_pki_secured_message(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); } else { // We use last valid EC certificate - v_ret_code := f_build_pki_secured_message(vc_ecPrivateKey, valueof(m_signerIdentifier_digest(vc_ecHashedId8)), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, vc_eaWholeHash, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data); + v_ret_code := f_build_pki_secured_message(vc_ecPrivateKey, valueof(m_signerIdentifier_digest(vc_ecHashedId8)), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); } if (v_ret_code == false) { log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); @@ -1073,10 +1073,12 @@ module LibItsPki_Functions { /** * @desc Verify the protocol element of the Pki message - * @param p_private_key Private key for encryption + * @param p_private_key Private key for decryption + * @param p_publicEphemeralCompressedKey + * @param p_publicEphemeralCompressedKeyMode * @param p_issuer Issuer - * @param p_peer_certificate IUT EA certificate identifier - * @param p_ieee1609dot2_encrypted_and_signed_data The public compressed key (canonical form) for encryption + * @param p_certificate Certificate to use for verification key + * @param p_ieee1609dot2_encrypted_and_signed_data The received encrypted and signed data * @param p_check_security Set to true to check signatures * @param p_etsi_ts_102941_data The EtsiTs102941Data message * @return true on success, false otherwise @@ -1103,7 +1105,7 @@ module LibItsPki_Functions { var bitstring v_etsi_ts_102941_data_msg; var bitstring v_tbs; var boolean v_ret; - + //var octetstring v_cyphered_text; var Oct16 v_authentication_vector; @@ -1155,7 +1157,7 @@ module LibItsPki_Functions { return false; } }*/ - + // 4. Return the PKI message log("v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData= ", v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); v_etsi_ts_102941_data_msg := oct2bit(v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); -- GitLab From 419abe762498812e1d5c8eccc7d90a397153be88 Mon Sep 17 00:00:00 2001 From: vagrant Date: Fri, 23 Nov 2018 16:47:28 +0100 Subject: [PATCH 157/320] AtsPki validation: minor bugs fixed --- ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn | 7 ++++++ ttcn/Pki/LibItsPki_Functions.ttcn | 29 +++++++++++++--------- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn b/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn index fb30eae7..80d8a8aa 100644 --- a/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn +++ b/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn @@ -17,6 +17,13 @@ module LibItsPki_EncdecDeclarations { external function fx_dec_EtsiTs102941Data(inout bitstring b, out EtsiTs102941MessagesCa.EtsiTs102941Data p_etsi_ts_102941_data)return integer with {extension "prototype(sliding) decode(PER)"} + external function fx_enc_EtsiTs102941DataContent(in EtsiTs102941MessagesCa.EtsiTs102941DataContent p_etsi_ts_102941_data) return bitstring + with {extension "prototype(convert) encode(PER)"} + + + external function fx_dec_EtsiTs102941DataContent(inout bitstring b, out EtsiTs102941MessagesCa.EtsiTs102941DataContent p_etsi_ts_102941_data)return integer + with {extension "prototype(sliding) decode(PER)"} + /** * @desc Encoding function for EtsiTs102941TypesEnrolment InnerEcRequest * @param p The certificate to encode diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 5aef1b10..6020da6e 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -317,7 +317,10 @@ module LibItsPki_Functions { f_selfOrClientSyncAndVerdict("error", e_error); } // Secure InnerEcRequestSignedForPoP message + log("v_inner_ec_request_signed_for_pop= ", v_inner_ec_request_signed_for_pop); v_inner_ec_request_signed_for_pop_msg := encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop)); + log("v_inner_ec_request_signed_for_pop_msg= ", v_inner_ec_request_signed_for_pop_msg); + // Prepare for getting the 16 most bytes of SHA256 of InnerEcRequestSignedForPop p_hash_inner_ec_request_signed_for_pop := f_hashWithSha256(bit2oct(v_inner_ec_request_signed_for_pop_msg)); // Secure the Pki message @@ -591,8 +594,8 @@ module LibItsPki_Functions { valueof(m_appPermissions(37, { bitmapSsp := '830001'O })) // TODO Use PIXIT }, m_validityPeriod( - 17469212, - m_duration_years(10) // TODO Use PIXIT + f_getCurrentTime() / 1000, + m_duration_years(1) // TODO Use PIXIT ), m_geographicRegion_identifiedRegion( { @@ -1092,7 +1095,7 @@ module LibItsPki_Functions { // in Oct12 p_nonce, // TODO Tobe removed // in octetstring p_salt, in octetstring p_issuer, - in Certificate p_certificate, // TODO Perhaps the peer certificate will be required for signature + in Certificate p_certificate, // TODO Tobe removed in Ieee1609Dot2Data p_ieee1609dot2_encrypted_and_signed_data, in boolean p_check_security := true, out EtsiTs102941Data p_etsi_ts_102941_data @@ -1102,19 +1105,15 @@ module LibItsPki_Functions { var integer v_compressed_enc_key_mode; var octetstring v_plain_message; var Ieee1609Dot2Data v_ieee1609dot2_signed_data; + var Certificate v_certificate; var bitstring v_etsi_ts_102941_data_msg; var bitstring v_tbs; var boolean v_ret; - - //var octetstring v_cyphered_text; - var Oct16 v_authentication_vector; log(">>> f_verify_pki_message: p_private_enc_key= ", p_private_enc_key); - //log(">>> f_verify_pki_message: p_publicEphemeralCompressedKey= ", p_publicEphemeralCompressedKey); log(">>> f_verify_pki_message: p_aes_sym_key=", p_aes_sym_key); log(">>> f_verify_pki_message: p_authentication_vector=", p_authentication_vector); log(">>> f_verify_pki_message: p_issuer=", p_issuer); - //log(">>> f_verify_pki_message: p_salt=", p_salt); // TODO Check p_ieee1609dot2_encrypted_and_signed_data.content.encryptedData.recipients[0].pskRecipInfo. See IEEE Std 1609.2-2017 Clause 6.3.34 PreSharedKeyRecipientInfo @@ -1137,26 +1136,32 @@ module LibItsPki_Functions { // 3. Check the signature log("v_ieee1609dot2_signed_data.content.signedData.tbsData= ", v_ieee1609dot2_signed_data.content.signedData.tbsData); v_tbs := encvalue(v_ieee1609dot2_signed_data.content.signedData.tbsData); - /*if (ischosen(p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256.compressed_y_0)) { + if (f_getCertificateFromDigest(v_ieee1609dot2_signed_data.content.signedData.signer.digest, v_certificate) == false) { + if (p_check_security == true) { + return false; + } + } + log("v_certificate= ", v_certificate); + if (ischosen(v_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256.compressed_y_0)) { v_ret := f_verifyWithEcdsaNistp256WithSha256( bit2oct(v_tbs), p_issuer, v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaNistP256Signature.rSig.x_only & v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaNistP256Signature.sSig, - p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256.compressed_y_0, // TODO Use the signer digest to get the EA certificate + v_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256.compressed_y_0, 0); } else { v_ret := f_verifyWithEcdsaNistp256WithSha256( bit2oct(v_tbs), p_issuer, v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaNistP256Signature.rSig.x_only & v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaNistP256Signature.sSig, - p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256.compressed_y_1, // TODO Use the signer digest to get the EA certificate + v_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256.compressed_y_1, 1); } if (v_ret == false) { if (p_check_security == true) { return false; } - }*/ + } // 4. Return the PKI message log("v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData= ", v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); -- GitLab From 31fa685dc4be0cb5b2f1a751565080e88ce71a97 Mon Sep 17 00:00:00 2001 From: vagrant Date: Thu, 29 Nov 2018 10:32:22 +0100 Subject: [PATCH 158/320] Bug fixed in UDP layer --- ttcn/Security/LibItsSecurity_Functions.ttcn | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index a9660d66..570d2365 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -2395,6 +2395,7 @@ module LibItsSecurity_Functions { * @return The signature value */ external function fx_signWithEcdsaNistp256WithSha256(in octetstring p_toBeSignedSecuredMessage, in Oct32 p_certificateIssuer, in Oct32 p_privateKey) return octetstring; + external function fx_test_signWithEcdsaNistp256WithSha256(in octetstring p_toBeSignedSecuredMessage, in Oct32 p_privateKey) return octetstring; /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature @@ -2424,6 +2425,8 @@ module LibItsSecurity_Functions { */ external function fx_verifyWithEcdsaNistp256WithSha256(in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyCompressed, in integer p_compressedMode) return boolean; + external function fx_test_verifyWithEcdsaNistp256WithSha256(in octetstring p_toBeVerifiedData, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyCompressed, in integer p_compressedMode) return boolean; + /** * @desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified -- GitLab From a9d34302019d60f227ffc340f92a9a65c806bc02 Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Thu, 29 Nov 2018 17:22:11 +0100 Subject: [PATCH 159/320] Remove useless PKI port --- ttcn/Pki/LibItsPki_Functions.ttcn | 88 ++------------------- ttcn/Pki/LibItsPki_TestSystem.ttcn | 73 ++++++----------- ttcn/Security/LibItsSecurity_Functions.ttcn | 39 +++++---- 3 files changed, 56 insertions(+), 144 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 6020da6e..146342c3 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -61,28 +61,7 @@ module LibItsPki_Functions { group pkiConfigurationFunctions { - /** - * @desc Setups default configuration - * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT - */ - function f_cfUp( - in charstring p_certificateId := "CERT_TS_A_EA", // TODO Use a constant - in charstring p_peerCertificateId := "CERT_IUT_A_EA" - ) runs on ItsPki /* TITAN TODO: system ItsPkiSystem */ { - - map(self:pkiPort, system:pkiPort); - map(self:acPort, system:acPort); - f_connect4SelfOrClientSync(); - - f_initialiseSecuredMode(p_certificateId, p_peerCertificateId); - - f_readCertificate(p_certificateId, vc_eaCertificate); - f_getCertificateDigest(p_certificateId, vc_eaHashedId8); - - activate(a_default_pki()); - } // End of function f_cfUp - - /** + /** * @desc Setups default configuration * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT */ @@ -115,27 +94,15 @@ module LibItsPki_Functions { in charstring p_certificateId := "CERT_TS_A_EA" // TODO Use a constant ) runs on ItsPkiItss /* TITAN TODO: system ItsPkiItssSystem */ { - f_cfUp(); - map(self:geoNetworkingPort, system:geoNetworkingPort); map(self:utPort, system:utPort); - map(self:acPort, system:acPort); + //map(self:acPort, system:acPort); f_initializeState(); - activate(a_default_pki()); + // activate(a_default_pki()); TOTO Defualt from geoNet } // End of function f_cfUp_itss - /** - * @desc Deletes default configuration - */ - function f_cfDown() runs on ItsPki /* TITAN TODO: system ItsPkiSystem */ { - unmap(self:pkiPort, system:pkiPort); - unmap(self:acPort, system:acPort); - f_disconnect4SelfOrClientSync(); - f_uninitialiseSecuredMode(); - } // End of function f_cfDown - /** * @desc Deletes default configuration */ @@ -151,9 +118,8 @@ module LibItsPki_Functions { function f_cfDown_itss() runs on ItsPkiItss /* TITAN TODO: system ItsPkiItssSystem */ { unmap(self:geoNetworkingPort, system:geoNetworkingPort); unmap(self:utPort, system:utPort); - unmap(self:acPort, system:acPort); + //unmap(self:acPort, system:acPort); - f_cfDown(); } // End of function f_cfDown /** @@ -192,40 +158,10 @@ module LibItsPki_Functions { } // End of pkiConfigurationFunctions - group ac_port { - - function f_sendAcPkiPrimitive( - in charstring p_certificate, - in octetstring p_private_key, - in octetstring p_publicKeyCompressed, - in integer p_compressedMode - ) runs on ItsPki { - var AcSetSecurityData v_ac_set_security_data; - - v_ac_set_security_data := { p_certificate, PICS_IUT_CERTIFICATE_ID, p_private_key, p_publicKeyCompressed, p_compressedMode }; - acPort.send(AcPkiPrimitive: { acSetSecurityData := v_ac_set_security_data }); - tc_ac.start; - alt { - [] acPort.receive(AcPkiResponse: { result := true }) { - tc_ac.stop; - } - [] acPort.receive(AcPkiResponse: { result := false }) { - tc_ac.stop; - log("*** f_sendAcPkiPrimitive: ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** f_sendAcPkiPrimitive: ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } // End of 'alt' statement - } // End of function f_sendAcPkiPrimitive - - } // End of group ac_port - group ut_port { function f_utInitializeIut(template (value) UtPkiInitialize p_init) runs on ItsPkiItss { + timer tc_wait := PX_TAC; utPort.send(p_init); tc_wait.start; @@ -298,8 +234,6 @@ module LibItsPki_Functions { out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, out Oct32 p_hash_inner_ec_request_signed_for_pop ) runs on ItsPkiHttp { - var octetstring v_publicKeyX; - var octetstring v_publicKeyY var InnerEcRequest v_inner_ec_request; var Ieee1609Dot2Data v_inner_ec_request_signed_for_pop; var bitstring v_inner_ec_request_signed_for_pop_msg; @@ -746,7 +680,7 @@ module LibItsPki_Functions { v_message_to_tag := v_message_to_tag & '03'O & p_publicEncKeyCompressed; } log("v_message_to_tag=", v_message_to_tag); - v_key_tag := fx_test_hmac_sha256(v_hmac_key, v_message_to_tag); // TODO Rename and use a wrapper function + v_key_tag := fx_hmac_sha256(v_hmac_key, v_message_to_tag); // TODO Rename and use a wrapper function log("v_key_tag=", v_key_tag); // Build the SharedAtRequest @@ -1118,7 +1052,7 @@ module LibItsPki_Functions { // TODO Check p_ieee1609dot2_encrypted_and_signed_data.content.encryptedData.recipients[0].pskRecipInfo. See IEEE Std 1609.2-2017 Clause 6.3.34 PreSharedKeyRecipientInfo // 1. Decrypt the data - v_plain_message := fx_test_decrypt_aes_128_ccm_test(p_aes_sym_key, p_ieee1609dot2_encrypted_and_signed_data.content.encryptedData.ciphertext.aes128ccm.nonce, p_ieee1609dot2_encrypted_and_signed_data.content.encryptedData.ciphertext.aes128ccm.ccmCiphertext); + v_plain_message := fx_decrypt_aes_128_ccm_test(p_aes_sym_key, p_ieee1609dot2_encrypted_and_signed_data.content.encryptedData.ciphertext.aes128ccm.nonce, p_ieee1609dot2_encrypted_and_signed_data.content.encryptedData.ciphertext.aes128ccm.ccmCiphertext); if (isbound(v_plain_message) == false) { return false; } @@ -1284,14 +1218,6 @@ module LibItsPki_Functions { group altstes { - altstep a_default_pki() runs on ItsPki { - [] pkiPort.receive { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected PKI message received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - } - altstep a_default_pki_http() runs on ItsPkiHttp { [] httpPort.receive( mw_http_response( diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index 98abf598..c8a44ade 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -43,14 +43,6 @@ module LibItsPki_TestSystem { group portDefinitions { - /** - * @desc Adapter control port - */ - type port AdapterControlPkiPort message { - out AcPkiPrimitive; - in AcPkiResponse; - } // End of AdapterControlPort - /** * @desc Upper Tester port */ @@ -61,55 +53,38 @@ module LibItsPki_TestSystem { } // End of group portDefinitions - group interfacePorts { - - type port PkiPort message { - inout InnerEcRequest, InnerEcResponse, AuthorizationValidationRequest, AuthorizationValidationResponse; - } // End of PkiPort - - } // End of group interfacePorts - group componentDefinitions { - type component ItsPkiSystem { - port AdapterControlPkiPort acPort; - port PkiPort pkiPort; - } // End of component ItsPkiSystem - + /** + * @desc System component + */ type component ItsPkiHttpSystem extends HttpTestAdapter{ } // End of component ItsPkiHttpSystem - type component ItsPkiItssSystem extends ItsPkiSystem { + /** + * @desc Test component for PKI entities execpt ITS-S + */ + type component ItsPkiHttp extends ItsSecurityBaseComponent, HttpComponent { + var Certificate vc_eaCertificate; /** Test Adapter EA certificate */ + var octetstring vc_eaPrivateKey; /** Test Adapter EA private key for signature */ + var Certificate vc_ecCertificate; /** Test Adapter EC certificate */ + var octetstring vc_ecPrivateKey; /** Test Adapter EC private key for signature */ + var octetstring vc_eaPrivateEncKey; /** Test Adapter EA private key for encryption */ + var HashedId8 vc_eaHashedId8; /** Test Adapter EA HashedId8 for decryption of IUT's response */ + var octetstring vc_eaWholeHash; /** TS EA whole-hash for signature check */ + var HashedId8 vc_ecHashedId8; /** Test Adapter EC HashedId8 for decryption of IUT's response */ + var Certificate vc_peerEaCertificate; /** IUT EA certificate for signature check */ + var octetstring vc_eaPeerWholeHash; /** IUT EA whole-hash for signature check */ + } // End of component ItsPki + + /** + * @desc Test component for ITS-S entity + */ + type component ItsPkiItss extends ItsPkiHttp { port UpperTesterPkiPort utPort; port GeoNetworkingPort geoNetworkingPort; - } // End of component ItsPkiItssSystem + } // End of component ItsPkiItss } // End of group componentDefinitions - type component ItsPki extends ItsSecurityBaseComponent, ItsBaseMtc { - port AdapterControlPkiPort acPort; - port PkiPort pkiPort; - - var Certificate vc_eaCertificate; /** Test Adapter EA certificate */ - var HashedId8 vc_eaHashedId8; /** Test Adapter EA HashedId8 for decryption of IUT's response */ - } // End of component ItsPki - - type component ItsPkiHttp extends ItsSecurityBaseComponent, HttpComponent { - var Certificate vc_eaCertificate; /** Test Adapter EA certificate */ - var octetstring vc_eaPrivateKey; /** Test Adapter EA private key for signature */ - var Certificate vc_ecCertificate; /** Test Adapter EC certificate */ - var octetstring vc_ecPrivateKey; /** Test Adapter EC private key for signature */ - var octetstring vc_eaPrivateEncKey; /** Test Adapter EA private key for encryption */ - var HashedId8 vc_eaHashedId8; /** Test Adapter EA HashedId8 for decryption of IUT's response */ - var octetstring vc_eaWholeHash; /** TS EA whole-hash for signature check */ - var HashedId8 vc_ecHashedId8; /** Test Adapter EC HashedId8 for decryption of IUT's response */ - var Certificate vc_peerEaCertificate; /** IUT EA certificate for signature check */ - var octetstring vc_eaPeerWholeHash; /** IUT EA whole-hash for signature check */ - } // End of component ItsPki - - type component ItsPkiItss extends ItsPki { - port UpperTesterPkiPort utPort; - port GeoNetworkingPort geoNetworkingPort; - } // End of component ItsPkiItss - } // End of module LibItsPki_TestSystem diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 570d2365..1110a43a 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -56,7 +56,7 @@ module LibItsSecurity_Functions { } // End of function f_hashWithSha256 /** - * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature + * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature based on standard IEEE 1609.2 * @param p_toBeSignedSecuredMessage The data to be signed * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate * @param p_privateKey The private key for signature @@ -76,7 +76,7 @@ module LibItsSecurity_Functions { } // End of function f_signWithEcdsaNistp256WithSha256 /** - * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature + * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature based on standard IEEE 1609.2 * @param p_toBeSignedSecuredMessage The data to be signed * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate * @param p_privateKey The private key for signature @@ -96,7 +96,7 @@ module LibItsSecurity_Functions { } // End of function f_signWithEcdsaBrainpoolp256WithSha256 /** - * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature + * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature based on standard IEEE 1609.2 * @param p_toBeSignedSecuredMessage The data to be signed * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate * @param p_privateKey The private key for signature @@ -2315,24 +2315,33 @@ module LibItsSecurity_Functions { */ external function fx_hashWithSha384(in octetstring p_toBeHashedData) return Oct48; - external function fx_test_hmac_sha256(in octetstring p_k, in octetstring p_m) return octetstring; + external function fx_hmac_sha256(in octetstring p_k, in octetstring p_m) return octetstring; /** - * @desc Test function the validate AES128 CCM encryption based on IEEE Std 1609.2-20XX Annex D.6.1 AES-CCM-128 - * @return The encrypted test + * @desc This function validates AES128 CCM encryption based on IEEE Std 1609.2-20XX Annex D.6.1 AES-CCM-128 + * @param[in] The symmetric AES 128 encryption key + * @param[in] The initial vector (aka nonce) + * @param[in] The raw payload + * @return The encrypted payload */ - external function fx_test_encrypt_aes_128_ccm_test(in octetstring p_k, in octetstring p_n, in octetstring p_pt) return octetstring; + external function fx_encrypt_aes_128_ccm_test(in octetstring p_k, in octetstring p_n, in octetstring p_pt) return octetstring; /** - * @desc Test function the validate AES128 CCM decryption based on IEEE Std 1609.2-20XX Annex D.6.1 AES-CCM-128 - * @return The decrypted test + * @desc TThis function validates AES128 CCM encryption based on AES-GCM-256 + * @param[in] The symmetric AES 128 encryption key + * @param[in] The initial vector (aka nonce) + * @param[in] The raw payload + * @return The encrypted payload */ - external function fx_test_decrypt_aes_128_ccm_test(in octetstring p_k, in octetstring p_n, in octetstring p_pt) return octetstring; + external function fx_encrypt_aes_128_gcm_test(in octetstring p_k, in octetstring p_n, in octetstring p_pt) return octetstring; /** - * @desc Test function the validate AES128 CCM encryption based on AES-GCM-256 - * @return The decrypted test + * @desc This function validates AES128 CCM decryption based on IEEE Std 1609.2-20XX Annex D.6.1 AES-CCM-128 + * @param[in] The symmetric AES 128 encryption key + * @param[in] The initial vector (aka nonce) + * @param[in] The cyphered payload + * @return The raw payload */ - external function fx_test_encrypt_aes_128_gcm_test(in octetstring p_k, in octetstring p_n, in octetstring p_pt) return octetstring; + external function fx_decrypt_aes_128_ccm_test(in octetstring p_k, in octetstring p_n, in octetstring p_pt) return octetstring; /** * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption using Nist-P256 algorithm @@ -2349,6 +2358,7 @@ module LibItsSecurity_Functions { external function fx_encryptWithEciesNistp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyCompressed, in integer p_compressedMode, in octetstring p_salt, out Oct32 p_publicEphemeralKeyCompressed, out integer p_ephemeralKeyModeCompressed, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce, in boolean p_use_hardcoded_values := false) return octetstring; external function fx_test_encryptWithEciesNistp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_privateEphemeralKey, in Oct32 p_recipientPublicKeyX, in Oct32 p_recipientPublicKeyY, in octetstring p_salt, out Oct32 p_publicEphemeralKeyX, out Oct32 p_publicEphemeralKeyY, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; + /** * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Nist-P256 algorithm * @param p_encryptedSecuredMessage The data to be decrypted @@ -2395,8 +2405,9 @@ module LibItsSecurity_Functions { * @return The signature value */ external function fx_signWithEcdsaNistp256WithSha256(in octetstring p_toBeSignedSecuredMessage, in Oct32 p_certificateIssuer, in Oct32 p_privateKey) return octetstring; + external function fx_test_signWithEcdsaNistp256WithSha256(in octetstring p_toBeSignedSecuredMessage, in Oct32 p_privateKey) return octetstring; - + /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature * @param p_toBeSignedSecuredMessage The data to be signed -- GitLab From 86687be8341fe9446d178e273a0ee9ce47f2d26f Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Tue, 4 Dec 2018 12:57:20 +0100 Subject: [PATCH 160/320] Add constraint on Version to force TITAN to encode COER one byte --- asn1/Security/TS102921/EtsiTs102941BaseTypes.asn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asn1/Security/TS102921/EtsiTs102941BaseTypes.asn b/asn1/Security/TS102921/EtsiTs102941BaseTypes.asn index 0a489830..bcac045e 100644 --- a/asn1/Security/TS102921/EtsiTs102941BaseTypes.asn +++ b/asn1/Security/TS102921/EtsiTs102941BaseTypes.asn @@ -47,7 +47,7 @@ PublicKeys ::= SEQUENCE { encryptionKey PublicEncryptionKey OPTIONAL } -Version ::= INTEGER {v1(1)} +Version ::= INTEGER {v1(1)} (1..255) EtsiTs103097Data-Encrypted-Unicast {ToBeEncryptedDataContent} ::= EtsiTs103097Data-Encrypted {ToBeEncryptedDataContent} (WITH COMPONENTS {..., -- GitLab From aa5c210a36c8d7aa155f4cc972c49db08f9b7f0f Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Tue, 4 Dec 2018 14:01:11 +0100 Subject: [PATCH 161/320] Update GeoNetworking version number (ETSI EN 302 636-4-1 (2017-08)) --- .../LibItsGeoNetworking_TypesAndValues.ttcn | 2398 ++++++++--------- 1 file changed, 1199 insertions(+), 1199 deletions(-) diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn index 5aac89ce..9642e7c7 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn @@ -1,1199 +1,1199 @@ -/** - * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $URL$ - * $Id$ - * @desc Module containing types and values for GeoNetworking Protocol - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsGeoNetworking_TypesAndValues { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from EtsiTs103097Module language "ASN.1:1997" all; - - group geoConfigurationValues { - - const charstring c_compIut := "IUT"; - const charstring c_compMTC := "MTC"; - const charstring c_compNodeA := "NodeA"; - const charstring c_compNodeB := "NodeB"; - const charstring c_compNodeC := "NodeC"; - const charstring c_compNodeD := "NodeD"; - const charstring c_compNodeE := "NodeE"; - const charstring c_compNodeF := "NodeF"; - - const charstring c_area1 := "AREA1"; - const charstring c_area2 := "AREA2"; - - const integer c_latitudeFactorNodeA := 10; - const integer c_latitudeFactorNodeB := 2; - const integer c_latitudeFactorNodeC := -6; - const integer c_latitudeFactorNodeD := 1; - const integer c_latitudeFactorNodeE := -1; - const integer c_latitudeFactorNodeF := 2; - const integer c_longitudeFactorNodeA := 0; - const integer c_longitudeFactorNodeB := 0; - const integer c_longitudeFactorNodeC := 0; - const integer c_longitudeFactorNodeD := 0; - const integer c_longitudeFactorNodeE := 0; - const integer c_longitudeFactorNodeF := -3; - } // end geoConfigurationValues - - group geoSyncMessages { - - const charstring c_msgSent := "Message sent"; - - } // end geoSyncMessages - - group geoTestingConstants { - - const UInt6 c_defaultLifetime := 10; // in seconds - const UInt16 c_lifetime := 1000 * c_defaultLifetime; // in seconds - - } // end geoTestingConstants - - group units { - - const float c_squareKm := 1000000.0; - - } // end units - - group geoConfigurationTypes { - - /** - * @desc Entry of position table - * @member key Reference key of the entry - * @member position Position vector stored in the entry - */ - type record PositionEntry { - charstring key, - LongPosVector position - } - - /** - * @desc Table containing node positions - */ - type record of PositionEntry PositionTable; - - /** - * @desc Parameters of a geometric area - * @member geoAreaPosLatitude Latitude of area's center - * @member geoAreaPosLongitude Longitude of area's center - * @member distanceA Distance A - * @member distanceB Distance B - * @member angle Angle - */ - type record Area { - Int32 geoAreaPosLatitude, - Int32 geoAreaPosLongitude, - UInt16 distanceA, - UInt16 distanceB, - UInt16 angle - } - - /** - * @desc Compact definition of GeoBroadcastArea - * @member geoBroadcastSubType Type of GeoBroadcastArea (=shape) - * @member geoBroadcastArea Parameters of the geometric area - */ - type record GeoBroadcastArea { - HeaderSubTypeGeoBroadcast geoBroadcastSubType, - Area geoBroadcastArea - } - - /** - * @desc Compact definition of GeoAnycastArea - * @member geoAnycastSubType Type of GeoAnycastArea (=shape) - * @member geoAnycastArea Parameters of the geometric area - */ - type record GeoAnycastArea { - HeaderSubTypeGeoAnycast geoAnycastSubType, - Area geoAnycastArea - } - - /** - * @desc Compact definition of a GeoArea (either GeoBroadcastArea or GeoAnycastArea) - * @member shape Shape of the GeoArea - * @member area Parameters of the geometric area - */ - type record GeoArea { - GeoShape shape, - Area area - } - - /** - * @desc Geometric shapes used to define GeoAreas - */ - type enumerated GeoShape { - e_geoCircle(0), - e_geoRect(1), - e_geoElip(2), - e_reserved - } - - /** - * @desc Entry of GeoArea table - * @member key Reference key of the entry - * @member geoArea GeoArea stored in the entry - */ - type record GeoAreaEntry { - charstring key, - GeoArea geoArea - } - - /** - * @desc Table containing geoArea definitions - */ - type record of GeoAreaEntry GeoAreaTable; - - } // end geoConfigurationTypes - - group geoNwValues { - - group geoNwHeaderConstants { - - const UInt4 c_geoNwProtocolVersion := 0; - - const UInt8 c_hopLimit1 := 1; - const UInt8 c_defaultHopLimit := 10; - - } // end geoNwHeaderConstants - - } // end geoNwValues - - group geoNetworkingPdus { - - /** - * @desc GeoNetworking Packet - * - * @see ETSI EN 302 636-4-1 chapter 8.2, 8.3, 8.4 - * - * @member basicHeader - * @member gnPacket - */ - type record GeoNetworkingPdu { - BasicHeader basicHeader, - GeoNetworkingPacket gnPacket - } - - type record GeoNetworkingPacket { - GnNonSecuredPacket packet, - EtsiTs103097Data securedMsg optional - } with { - encode (securedMsg) "LibItsSecurity" - } - - type octetstring GnRawPayload; - - type record GnNonSecuredPacket { - CommonHeader commonHeader, - ExtendedHeader extendedHeader optional, - GnRawPayload payload optional - } - } // end group geoNetworkingPdus - - group geoNetworkingHeader { - - group geoNetworkingBasicHeader { - - /** - * @desc Basic Header - * - *
    -       *  0               1               2               3
    -       *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
    -       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -       * |   V   |  NH   |    Reserved   |      LT       |      RHL      |
    -       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -       * 
    - * - * @see ETSI EN 302 636-4-1 chapter 8.6.1 - * - * @member version - * @member nextHeader - * @member reserved - * @member lifeTime - * @member routerHopLimit - */ - type record BasicHeader { - UInt4 version, - BasicNextHeader nextHeader, - UInt8 reserved, - Lifetime lifeTime, - UInt8 routerHopLimit - } with { - variant "FIELDORDER(msb)" - } - - type enumerated BasicNextHeader { - e_any(0), - e_commonHeader(1), - e_securedPacket(2), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } - - /** - * @desc Indicates the maximum tolerable time a packet can be buffered until it reaches its destination. - * @member multiplier - * @member ltBase - */ - type record Lifetime { - UInt6 multiplier, - LtBase ltBase - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc The base for the calculation of the lifetime. - */ - type enumerated LtBase { - e_50ms(0), - e_1s(1), - e_10s(2), - e_100s(3) - } with { - variant "FIELDLENGTH(2)" //variant "2 bit" - } - - } // end group geoNetworkingBasicHeader - - group geoNetworkingCommonHeader { - - /** - * @desc Common header for GeoNetworking - * - *
    -       *  0               1               2               3
    -       *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
    -       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -       * |  NH   |   R   |  HT   |  HST  |      TC       |     Flags     |
    -       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -       * |              PL               |     MHL       |    Reserved   |
    -       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -       * 
    - * - * @see ETSI EN 302 636-4-1 chapter 8.7.2 - * - * @member nextHeader - * @member reserved - * @member headerTST Header type + Header Sub Type - * @member trafficClass - * @member flags - * @member plLength - * @member maxHopLimit - * @member reserved2 - */ - type record CommonHeader { - NextHeader nextHeader, - UInt4 reserved, - HeaderTST headerTST, - TrafficClass trafficClass, - Bit8 flags, - UInt16 plLength, // The Codec shall set the length of the paylaod if present - UInt8 maxHopLimit, - UInt8 reserved2 - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the type of header immediately following the Common Header (4Bits). - */ - type enumerated NextHeader { - e_any(0), - e_btpA(1), - e_btpB(2), - e_ipv6(3), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } - - /** - * @desc TrafficClass - * - *
    -       *  0   1   2   3   4   5   6   7
    -       * +---+---+---+---+---+---+---+---+
    -       * |SCF|Ch.|         TC ID         |
    -       * |   |Off|                       |
    -       * +---+---+---+---+---+---+---+---+
    -       * 
    - * - * @see ETSI EN 302 636-4-1 chapter 8.7.5 - * - * @member scf - * @member channelOffload - * @member tcId - */ - type record TrafficClass { - SCF scf, - ChannelOffload channelOffload, - TcId tcId - } with { - variant "FIELDORDER(msb)" - } - - type enumerated SCF { - e_scfDisabled(0), - e_scfEnable (1) - } with { - variant "FIELDLENGTH(1)" //variant "1 bit" - } - type enumerated ChannelOffload { - e_choffDisabled(0), - e_choffEnable (1) - } with { - variant "FIELDLENGTH(1)" //variant "1 bit" - } - type UInt6 TcId; - - } // end group geoNetworkingCommonHeader - - group geoNetworkingExtendedHeaders { - - /** - * @desc GeoNetworking ExtendedHeader - * - * @see ETSI EN 302 636-4-1 chapter 8.3 - * - * @member commonHeader - * @member gnExtHeader - */ - type union ExtendedHeader { - GeoUnicastHeader geoUnicastHeader, - TSBHeader tsbHeader, - SHBHeader shbHeader, - GeoBroadcastHeader geoBroadcastHeader, - GeoAnycastHeader geoAnycastHeader, - BeaconHeader beaconHeader, - LSRequestHeader lsRequestHeader, - LSReplyHeader lsReplyHeader, - AnyHeader saHeader, // FIXME Cannot find description, AnyHeader was used as default - AnyHeader saEosHeader, // FIXME Cannot find description, AnyHeader was used as default - AnyHeader anyHeader - } with { - variant "" - } - - /** - * @desc The unspecified ANY header. - * - * @member seqNumber - * @member reserved - */ - type record AnyHeader { - UInt16 seqNumber, - UInt16 reserved - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc The BEACON packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.6 - * - * @member commonHeader - */ - type record BeaconHeader { - LongPosVector srcPosVector - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc The GEOANYCAST packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.5 - * - * @member seqNumber - * @member reserved - * @member srcPosVector - * @member geoAreaPosLatitude - * @member geoAreaPosLongitude - * @member distanceA - * @member distanceB - * @member angle - * @member reserved - */ - type record GeoAnycastHeader { - UInt16 seqNumber, - UInt16 reserved, - LongPosVector srcPosVector, - Int32 geoAreaPosLatitude, - Int32 geoAreaPosLongitude, - UInt16 distanceA, - UInt16 distanceB, - UInt16 angle, - UInt16 reserved2 - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc The GEOBROADCAST packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.5 - * - * @member seqNumber - * @member reserved - * @member srcPosVector - * @member geoAreaPosLatitude - * @member geoAreaPosLongitude - * @member distanceA - * @member distanceB - * @member angle - * @member reserved - */ - type GeoAnycastHeader GeoBroadcastHeader; - - /** - * @desc The GEOUNICAST packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.2 - * - * @member seqNumber - * @member reserved - * @member srcPosVector - * @member dstPosVector - */ - type record GeoUnicastHeader { - UInt16 seqNumber, - UInt16 reserved, - LongPosVector srcPosVector, - ShortPosVector dstPosVector - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc The Location Service (LS) Reply packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.8 - * - * @member seqNumber - * @member reserved - * @member srcPosVector - * @member dstPosVector - */ - type record LSReplyHeader { - UInt16 seqNumber, - UInt16 reserved, - LongPosVector srcPosVector, - ShortPosVector dstPosVector - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc The Location Service (LS) Request packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.7 - * - * @member seqNumber - * @member reserved - * @member srcPosVector - * @member gnAddress - */ - type record LSRequestHeader { - UInt16 seqNumber, - UInt16 reserved, - LongPosVector srcPosVector, - GN_Address gnAddress - } with { - variant "FIELDORDER(msb)" - } - - /** - * The Single Hop Broadcast (SHB) packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.4 - * - * @member srcPosVector - * @member reserved - */ - type record SHBHeader { - LongPosVector srcPosVector, - UInt32 reserved - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc The Topologically-Scoped Broadcast (TSB) packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.3 - * - * @member seqNumber - * @member reserved - * @member srcPosVector - */ - type record TSBHeader { - UInt16 seqNumber, - UInt16 reserved, - LongPosVector srcPosVector - } with { - variant "FIELDORDER(msb)" - } - - group geoNetworkingHeadersSubtypes { - - /** - * @desc Identifies the header type and the header subtype for ANY. - * @member headerType - * @member reserved - */ - type record AnyHeaderType { - HeaderType headerType(e_any), - UInt4 headerSubType - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the header type and the header subtype for BEACON. - * @member headerType - * @member reserved - */ - type record BeaconHeaderType { - HeaderType headerType(e_beacon), - UInt4 headerSubType - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the header type and the header subtype for GEOANYCAST. - * @member headerType - * @member reserved - */ - type record GeoAnycastHeaderType { - HeaderType headerType(e_geoAnycast), - HeaderSubTypeGeoAnycast headerSubType - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the header type and the header subtype for GEOBROADCAST. - * @member headerType - * @member reserved - */ - type record GeoBroadcastHeaderType { - HeaderType headerType(e_geoBroadcast), - HeaderSubTypeGeoBroadcast headerSubType - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the header type and the header subtype for GEOUNICAST. - * @member headerType - * @member reserved - */ - type record GeoUnicastHeaderType { - HeaderType headerType(e_geoUnicast), - UInt4 headerSubType - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the header type and the header subtype for Location Service LS. - * @member headerType - * @member reserved - */ - type record LsHeaderType { - HeaderType headerType(e_locationService), - HeaderSubTypeLs headerSubType - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the header type and the header subtype for Service Announcement SA. - * @member headerType - * @member reserved - */ - type record SaHeaderType { - HeaderType headerType(e_serviceAnnouncement), - HeaderSubTypeSa headerSubType - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the header type and the header subtype for Topologically-Scoped Broadcast TSB. - * @member headerType - * @member headerSubType - */ - type record TsbHeaderType { - HeaderType headerType(e_topologicallyScopedBroadcast), - HeaderSubTypeTSB headerSubType - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the header subtype for GEOANYCAST. - */ - type enumerated HeaderSubTypeGeoAnycast { - e_geoAnycastCircle(0), - e_geoAnycastRect(1), - e_geoAnycastElip(2), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } - - /** - * @desc Identifies the header subtype for GEOBROADCAST. - */ - type enumerated HeaderSubTypeGeoBroadcast { - e_geoBroadcastCircle(0), - e_geoBroadcastRect(1), - e_geoBroadcastElip(2), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } - - /** - * @desc Identifies the header subtype for Topologically-scoped broadcast TSB. - */ - type enumerated HeaderSubTypeTSB { - e_singleHop(0), - e_multiHop(1), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } - - /** - * @desc Identifies the header subtype for Location Service LS. - */ - type enumerated HeaderSubTypeLs { - e_lsRequest(0), - e_lsReply(1), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } - - /** - * @desc Identifies the header subtype for Service Announcement SA. - */ - type enumerated HeaderSubTypeSa { - e_sa(0), - e_saEos(1), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } - - /** - * @desc Identifies the header type and the header subtype. - * @member anyHdr - * @member beaconHdr - * @member geoUnicastHdr - * @member geoAnycastHdr - * @member geoBroadcastHdr - * @member tsbHdr - * @member lsHdr - * @member saHdr - * @member reserved - */ - type union HeaderTST { - AnyHeaderType anyHdr, - BeaconHeaderType beaconHdr, - GeoUnicastHeaderType geoUnicastHdr, - GeoAnycastHeaderType geoAnycastHdr, - GeoBroadcastHeaderType geoBroadcastHdr, - TsbHeaderType tsbHdr, - LsHeaderType lsHdr, - SaHeaderType saHdr, - UInt8 reserved - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the type of the GeoAdhoc header type (4Bits). - */ - type enumerated HeaderType { - e_any(0), - e_beacon(1), - e_geoUnicast(2), - e_geoAnycast(3), - e_geoBroadcast(4), - e_topologicallyScopedBroadcast(5), - e_locationService(6), - e_serviceAnnouncement(7), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } - - /** - * @desc Long Position Vector - * - *
    -         *  0               1               2               3
    -         *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
    -         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         * |                           GN_ADDR                             |
    -         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         * |                             TST                               |
    -         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         * |                             Lat                               |
    -         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         * |                             Long                              |
    -         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         * |P|              S              |               H               |
    -         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         * 
    - * - * @see ETSI EN 302 636-4-1 chapter 8.5.2 - * - * @member gnAddr - * @member timestamp_ - * @member latitude - * @member longitude - * @member pai Position Accuracy Indicator - * @member speed - * @member heading - */ - type record LongPosVector { - GN_Address gnAddr, - UInt32 timestamp_, - Int32 latitude, - Int32 longitude, - Bit1 pai, - Int15 speed, - UInt16 heading - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Short Position Vector - * - *
    -         *  0               1               2               3
    -         *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
    -         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         * |                           GN_ADDR                             |
    -         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         * |                             TST                               |
    -         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         * |                             Lat                               |
    -         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         * |                             Long                              |
    -         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         * 
    - * - * @see ETSI EN 302 636-4-1 chapter 8.5.3 - * - * @member gnAddr - * @member timestamp - * @member latitude - * @member longitude - */ - type record ShortPosVector { - GN_Address gnAddr, - UInt32 timestamp_, - Int32 latitude, - Int32 longitude - } with { - variant "FIELDORDER(msb)" - } - - group geoNetworkingAddress { - /** - * @desc GeoNetworking address - * - *
    -           *  0               1               2               3
    -           *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
    -           * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -           * |M|  S_T    |       S_CC        |             M_ID              |
    -           * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -           * |                              M_ID                             |
    -           * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -           * 
    - * - * @see ETSI EN 302 636-4-1 chapter 6.2 - * - * @member typeOfAddress - * @member stationType - * @member mid - */ - type record GN_Address { - TypeOfAddress typeOfAddress, - StationType stationType, - UInt10 stationCountryCode, - Oct6 mid - } with { - variant "FIELDORDER(msb)" - } - - group geoNetworkingAddressSubtypes { - - /** - * @desc Identifies the ITS station (5Bits). - */ - type enumerated StationType { - e_unknown(0), - e_pedestrian(1), - e_cyclist(2), - e_moped(3), - e_motorcycle(4), - e_passengerCar(5), - e_bus(6), - e_lightTruck(7), - e_heavyTruck(8), - e_trailer(9), - e_specialVehicle(10), - e_tram(11), - e_roadSideUnit(15) - } with { - variant "FIELDLENGTH(5)" //variant "5 bit" - } - - /** - * @desc Distinguish between manually configured - * network address and the initial GeoNetwork address (1Bit). - */ - type enumerated TypeOfAddress { - e_manual(1), - e_initial(0) - } with { - variant "FIELDLENGTH(1)" //variant "1 bit" - } - - } // end group geoNetworkingAddressSubtypes - - } // end group geoNetworkingAddress - - } // end group geoNetworkingHeadersSubtypes - - } // end group geoNetworkingExtendedHeaders - - } // end group geoNetworkingHeader - - group geoNwPicsTypes { - - /** - * @desc The GeoUnicast forwarding algorithm. - */ - type enumerated GeoUnicastForwardingAlgorithm { - e_unspecified(0), - e_greedy(1), - e_cbf(2) - } - - /** - * @desc The GeoBroadcast forwarding algorithm. - */ - type enumerated GeoBroadcastForwardingAlgorithm { - e_unspecified(0), - e_simple(1), - e_cbf(2), - e_advanced(3) - } - - /** - * @desc GN address configuration method. - */ - type enumerated GnAddressConfigurationMethod { - e_auto(0), - e_managed(1), - e_anonymous(2) - } - - } // end geoNwPicsTypes - - group utPrimitives { - - /** - * @desc Upper Tester message to initialize IUT - * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use - */ - type record UtGnInitialize { - Oct8 hashedId8 - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester results message of the GeoNetworking IUT - * @member utGnInitialize - - * @member utGnTriggerResult - - * @member utAutoInteropTriggerResult - - * @member utGnChangePositionResult - - */ - type union UtGnResults { - boolean utGnInitializeResult, - boolean utGnTriggerResult, - boolean utAutoInteropTriggerResult, // FIXME Remove UtAutoInteropTrigger from GN component, create an AutoInterop component - boolean utGnChangePositionResult - } with { - variant "" - } // End of type UtGnResults - - /** - * @desc AutoInterop UpperTester trigger - * @member utRadioOnOff Set to true to power on the radio (on-link mode), false to power off the radio (off-link). - */ - type union UtAutoInteropTrigger { - boolean utRadioOnOff - } with { - variant "" - } // End of type UtAutoInteropTrigger - - /** - * @desc Upper Tester message to change the position of IUT. Values a relatives - */ - type record UtGnChangePosition { - Int32 latitude, - Int32 longitude, - Int32 elevation - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc UT primitives for GeoNetworking - * @member geoUnicast - - * @member geoBroadcast - - * @member geoAnycast - - * @member shb - - * @member tsb - - * @member changePosition - - * @member checkPacket - - */ - type union UtGnTrigger { - GenerateGeoUnicastMessage geoUnicast, - GenerateGeoBroadcastMessage geoBroadcast, - GenerateGeoAnycastMessage geoAnycast, - GenerateSHBMessage shb, - GenerateTSBMessage tsb - } with { - variant "" - } - - /** - * @desc UT primitive for IUT to send a GeoUnicast packet - * @member gnAddress Destination of the packet - * @member lifetime Lifetime of the packet - * @member trafficClass Traffic class of the packet - * @member payload GnRawPayload of the packet - */ - type record GenerateGeoUnicastMessage { - GN_Address gnAddress, - UInt16 lifetime, - TrafficClass trafficClass, - GnRawPayload payload - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc UT primitive for IUT to send a GeoBroadcast packet - * @member shape Shape of the area - * @member lifetime Lifetime of the packet - * @member trafficClass Traffic class of the packet - * @member area Destination GeoArea - * @member payload GnRawPayload of the packet - */ - type record GenerateGeoBroadcastMessage { - GeoShape shape, - UInt16 lifetime, - TrafficClass trafficClass, - UInt24 reserved, - Area area, - GnRawPayload payload - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc UT primitive for IUT to send a Geoanycast packet - */ - type GenerateGeoBroadcastMessage GenerateGeoAnycastMessage; - - /** - * @desc UT primitive for IUT to send a SHB packet - * @member trafficClass Traffic class of the packet - * @member payload GnRawPayload of the packet - */ - type record GenerateSHBMessage { - TrafficClass trafficClass, - GnRawPayload payload - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc UT primitive for IUT to send a SHB packet - * @member nbHops Number of Hops - * @member lifetime Lifetime of the packet - * @member trafficClass Traffic class of the packet - * @member payload GnRawPayload of the packet - */ - type record GenerateTSBMessage { - UInt8 nbHops, - UInt16 lifetime, - TrafficClass trafficClass, - GnRawPayload payload - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to check Upper Layer message transmission on GN IUT - */ - type record UtGnEventInd { - // GeoNetworkingPdu gnPdu - GnRawPayload rawPayload - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc List of Upper Tester messages to check Upper Layer message transmission on GN IUT - */ - type record of UtGnEventInd UtGnEventIndList; - - } // end utPrimitives - with { - encode "UpperTester"; - variant "" - } - - group acPrimitives { - - /** - * @desc TA primitives for GeoNetworking - * @member startBeaconing - - * @member stopBeaconing - - * @member startPassBeaconing - - * @member stopPassBeaconing - - * @member startBeaconingMultipleNeighbour - - * @member stopBeaconingMultipleNeighbour - - * @member getLongPosVector - - */ - type union AcGnPrimitive { - AcStartBeaconing startBeaconing, - AcStopBeaconing stopBeaconing, - AcStartPassBeaconing startPassBeaconing, - AcStopPassBeaconing stopPassBeaconing, - AcStartBeaconingMultipleNeighbour startBeaconingMultipleNeighbour, - AcStopBeaconingMultipleNeighbour stopBeaconingMultipleNeighbour, - AcGetLongPosVector getLongPosVector - } with { - variant "" - } - - /** - * @desc Primitive for receiveing response from TA - * @member getLongPosVector - */ - type union AcGnResponse { - LongPosVector getLongPosVector, - AcGnResponseFailure failure - } - with { - variant "" - encode(getLongPosVector) "LibItsGeoNetworking" - } - - type record AcGnResponseFailure { - boolean failure - } - - /** - * @desc Primitive for TA to start sending beacons for the test component - * @member beaconHeader Beacon template - */ - type record AcStartBeaconing { - GeoNetworkingPdu beaconPacket - } - with { - encode(beaconPacket) "LibItsGeoNetworking" - } - - /** - * @desc Primitive for TA to stop sending beacons for the test component - */ - type record AcStopBeaconing { - } - - /** - * @desc Primitive for TA to start enqueueing received beacons - * @member beaconHeader Filter - */ - type record AcStartPassBeaconing { - BeaconHeader beaconHeader - } - with { - encode(beaconHeader) "LibItsGeoNetworking" - }; - - /** - * @desc Primitive for TA to stop enqueueing received beacons - */ - type record AcStopPassBeaconing { - } - - /** - * @desc Primitive for TA to start sending beacons for multiple neighbours - * @member beaconHeader Beacon template - * @member numberOfNeighbour Number of neighbours to simulate - */ - type record AcStartBeaconingMultipleNeighbour { - GeoNetworkingPdu beaconPacket, - integer numberOfNeighbour - } - with { - encode(beaconPacket) "LibItsGeoNetworking" - }; - - /** - * @desc Primitive for TA to stop sending beacons for multiple neighbours - */ - type record AcStopBeaconingMultipleNeighbour { - } - - /** - * @desc Primitive for retrieving the position vector corresponding to a specific GN address - * @member gnAddress GN address to be searched - */ - type record AcGetLongPosVector { - GN_Address gnAddress - } - with { - encode(gnAddress) "LibItsGeoNetworking" - }; - - } // end acPrimitives - with { - variant "" - encode "AdapterControl" - } -} -with { - variant "" - encode "LibItsGeoNetworking" - } +/** + * @author ETSI / STF405 / STF449 / STF484 / STF517 + * @version $URL$ + * $Id$ + * @desc Module containing types and values for GeoNetworking Protocol + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * + */ +module LibItsGeoNetworking_TypesAndValues { + + // LibCommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; + + // LibIts + import from EtsiTs103097Module language "ASN.1:1997" all; + + group geoConfigurationValues { + + const charstring c_compIut := "IUT"; + const charstring c_compMTC := "MTC"; + const charstring c_compNodeA := "NodeA"; + const charstring c_compNodeB := "NodeB"; + const charstring c_compNodeC := "NodeC"; + const charstring c_compNodeD := "NodeD"; + const charstring c_compNodeE := "NodeE"; + const charstring c_compNodeF := "NodeF"; + + const charstring c_area1 := "AREA1"; + const charstring c_area2 := "AREA2"; + + const integer c_latitudeFactorNodeA := 10; + const integer c_latitudeFactorNodeB := 2; + const integer c_latitudeFactorNodeC := -6; + const integer c_latitudeFactorNodeD := 1; + const integer c_latitudeFactorNodeE := -1; + const integer c_latitudeFactorNodeF := 2; + const integer c_longitudeFactorNodeA := 0; + const integer c_longitudeFactorNodeB := 0; + const integer c_longitudeFactorNodeC := 0; + const integer c_longitudeFactorNodeD := 0; + const integer c_longitudeFactorNodeE := 0; + const integer c_longitudeFactorNodeF := -3; + } // end geoConfigurationValues + + group geoSyncMessages { + + const charstring c_msgSent := "Message sent"; + + } // end geoSyncMessages + + group geoTestingConstants { + + const UInt6 c_defaultLifetime := 10; // in seconds + const UInt16 c_lifetime := 1000 * c_defaultLifetime; // in seconds + + } // end geoTestingConstants + + group units { + + const float c_squareKm := 1000000.0; + + } // end units + + group geoConfigurationTypes { + + /** + * @desc Entry of position table + * @member key Reference key of the entry + * @member position Position vector stored in the entry + */ + type record PositionEntry { + charstring key, + LongPosVector position + } + + /** + * @desc Table containing node positions + */ + type record of PositionEntry PositionTable; + + /** + * @desc Parameters of a geometric area + * @member geoAreaPosLatitude Latitude of area's center + * @member geoAreaPosLongitude Longitude of area's center + * @member distanceA Distance A + * @member distanceB Distance B + * @member angle Angle + */ + type record Area { + Int32 geoAreaPosLatitude, + Int32 geoAreaPosLongitude, + UInt16 distanceA, + UInt16 distanceB, + UInt16 angle + } + + /** + * @desc Compact definition of GeoBroadcastArea + * @member geoBroadcastSubType Type of GeoBroadcastArea (=shape) + * @member geoBroadcastArea Parameters of the geometric area + */ + type record GeoBroadcastArea { + HeaderSubTypeGeoBroadcast geoBroadcastSubType, + Area geoBroadcastArea + } + + /** + * @desc Compact definition of GeoAnycastArea + * @member geoAnycastSubType Type of GeoAnycastArea (=shape) + * @member geoAnycastArea Parameters of the geometric area + */ + type record GeoAnycastArea { + HeaderSubTypeGeoAnycast geoAnycastSubType, + Area geoAnycastArea + } + + /** + * @desc Compact definition of a GeoArea (either GeoBroadcastArea or GeoAnycastArea) + * @member shape Shape of the GeoArea + * @member area Parameters of the geometric area + */ + type record GeoArea { + GeoShape shape, + Area area + } + + /** + * @desc Geometric shapes used to define GeoAreas + */ + type enumerated GeoShape { + e_geoCircle(0), + e_geoRect(1), + e_geoElip(2), + e_reserved + } + + /** + * @desc Entry of GeoArea table + * @member key Reference key of the entry + * @member geoArea GeoArea stored in the entry + */ + type record GeoAreaEntry { + charstring key, + GeoArea geoArea + } + + /** + * @desc Table containing geoArea definitions + */ + type record of GeoAreaEntry GeoAreaTable; + + } // end geoConfigurationTypes + + group geoNwValues { + + group geoNwHeaderConstants { + + const UInt4 c_geoNwProtocolVersion := 0; + + const UInt8 c_hopLimit1 := 1; + const UInt8 c_defaultHopLimit := 10; + + } // end geoNwHeaderConstants + + } // end geoNwValues + + group geoNetworkingPdus { + + /** + * @desc GeoNetworking Packet + * + * @see ETSI EN 302 636-4-1 chapter 8.2, 8.3, 8.4 + * + * @member basicHeader + * @member gnPacket + */ + type record GeoNetworkingPdu { + BasicHeader basicHeader, + GeoNetworkingPacket gnPacket + } + + type record GeoNetworkingPacket { + GnNonSecuredPacket packet, + EtsiTs103097Data securedMsg optional + } with { + encode (securedMsg) "LibItsSecurity" + } + + type octetstring GnRawPayload; + + type record GnNonSecuredPacket { + CommonHeader commonHeader, + ExtendedHeader extendedHeader optional, + GnRawPayload payload optional + } + } // end group geoNetworkingPdus + + group geoNetworkingHeader { + + group geoNetworkingBasicHeader { + + /** + * @desc Basic Header + * + *
    +       *  0               1               2               3
    +       *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
    +       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +       * |   V   |  NH   |    Reserved   |      LT       |      RHL      |
    +       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +       * 
    + * + * @see ETSI EN 302 636-4-1 chapter 8.6.1 + * + * @member version + * @member nextHeader + * @member reserved + * @member lifeTime + * @member routerHopLimit + */ + type record BasicHeader { + UInt4 version, + BasicNextHeader nextHeader, + UInt8 reserved, + Lifetime lifeTime, + UInt8 routerHopLimit + } with { + variant "FIELDORDER(msb)" + } + + type enumerated BasicNextHeader { + e_any(0), + e_commonHeader(1), + e_securedPacket(2), + e_reserved + } with { + variant "FIELDLENGTH(4)" //variant "4 bit" + } + + /** + * @desc Indicates the maximum tolerable time a packet can be buffered until it reaches its destination. + * @member multiplier + * @member ltBase + */ + type record Lifetime { + UInt6 multiplier, + LtBase ltBase + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc The base for the calculation of the lifetime. + */ + type enumerated LtBase { + e_50ms(0), + e_1s(1), + e_10s(2), + e_100s(3) + } with { + variant "FIELDLENGTH(2)" //variant "2 bit" + } + + } // end group geoNetworkingBasicHeader + + group geoNetworkingCommonHeader { + + /** + * @desc Common header for GeoNetworking + * + *
    +       *  0               1               2               3
    +       *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
    +       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +       * |  NH   |   R   |  HT   |  HST  |      TC       |     Flags     |
    +       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +       * |              PL               |     MHL       |    Reserved   |
    +       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +       * 
    + * + * @see ETSI EN 302 636-4-1 chapter 8.7.2 + * + * @member nextHeader + * @member reserved + * @member headerTST Header type + Header Sub Type + * @member trafficClass + * @member flags + * @member plLength + * @member maxHopLimit + * @member reserved2 + */ + type record CommonHeader { + NextHeader nextHeader, + UInt4 reserved, + HeaderTST headerTST, + TrafficClass trafficClass, + Bit8 flags, + UInt16 plLength, // The Codec shall set the length of the paylaod if present + UInt8 maxHopLimit, + UInt8 reserved2 + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Identifies the type of header immediately following the Common Header (4Bits). + */ + type enumerated NextHeader { + e_any(0), + e_btpA(1), + e_btpB(2), + e_ipv6(3), + e_reserved + } with { + variant "FIELDLENGTH(4)" //variant "4 bit" + } + + /** + * @desc TrafficClass + * + *
    +       *  0   1   2   3   4   5   6   7
    +       * +---+---+---+---+---+---+---+---+
    +       * |SCF|Ch.|         TC ID         |
    +       * |   |Off|                       |
    +       * +---+---+---+---+---+---+---+---+
    +       * 
    + * + * @see ETSI EN 302 636-4-1 chapter 8.7.5 + * + * @member scf + * @member channelOffload + * @member tcId + */ + type record TrafficClass { + SCF scf, + ChannelOffload channelOffload, + TcId tcId + } with { + variant "FIELDORDER(msb)" + } + + type enumerated SCF { + e_scfDisabled(0), + e_scfEnable (1) + } with { + variant "FIELDLENGTH(1)" //variant "1 bit" + } + type enumerated ChannelOffload { + e_choffDisabled(0), + e_choffEnable (1) + } with { + variant "FIELDLENGTH(1)" //variant "1 bit" + } + type UInt6 TcId; + + } // end group geoNetworkingCommonHeader + + group geoNetworkingExtendedHeaders { + + /** + * @desc GeoNetworking ExtendedHeader + * + * @see ETSI EN 302 636-4-1 chapter 8.3 + * + * @member commonHeader + * @member gnExtHeader + */ + type union ExtendedHeader { + GeoUnicastHeader geoUnicastHeader, + TSBHeader tsbHeader, + SHBHeader shbHeader, + GeoBroadcastHeader geoBroadcastHeader, + GeoAnycastHeader geoAnycastHeader, + BeaconHeader beaconHeader, + LSRequestHeader lsRequestHeader, + LSReplyHeader lsReplyHeader, + AnyHeader saHeader, // FIXME Cannot find description, AnyHeader was used as default + AnyHeader saEosHeader, // FIXME Cannot find description, AnyHeader was used as default + AnyHeader anyHeader + } with { + variant "" + } + + /** + * @desc The unspecified ANY header. + * + * @member seqNumber + * @member reserved + */ + type record AnyHeader { + UInt16 seqNumber, + UInt16 reserved + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc The BEACON packet header. + * + * @see ETSI EN 302 636-4-1 chapter 8.8.6 + * + * @member commonHeader + */ + type record BeaconHeader { + LongPosVector srcPosVector + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc The GEOANYCAST packet header. + * + * @see ETSI EN 302 636-4-1 chapter 8.8.5 + * + * @member seqNumber + * @member reserved + * @member srcPosVector + * @member geoAreaPosLatitude + * @member geoAreaPosLongitude + * @member distanceA + * @member distanceB + * @member angle + * @member reserved + */ + type record GeoAnycastHeader { + UInt16 seqNumber, + UInt16 reserved, + LongPosVector srcPosVector, + Int32 geoAreaPosLatitude, + Int32 geoAreaPosLongitude, + UInt16 distanceA, + UInt16 distanceB, + UInt16 angle, + UInt16 reserved2 + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc The GEOBROADCAST packet header. + * + * @see ETSI EN 302 636-4-1 chapter 8.8.5 + * + * @member seqNumber + * @member reserved + * @member srcPosVector + * @member geoAreaPosLatitude + * @member geoAreaPosLongitude + * @member distanceA + * @member distanceB + * @member angle + * @member reserved + */ + type GeoAnycastHeader GeoBroadcastHeader; + + /** + * @desc The GEOUNICAST packet header. + * + * @see ETSI EN 302 636-4-1 chapter 8.8.2 + * + * @member seqNumber + * @member reserved + * @member srcPosVector + * @member dstPosVector + */ + type record GeoUnicastHeader { + UInt16 seqNumber, + UInt16 reserved, + LongPosVector srcPosVector, + ShortPosVector dstPosVector + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc The Location Service (LS) Reply packet header. + * + * @see ETSI EN 302 636-4-1 chapter 8.8.8 + * + * @member seqNumber + * @member reserved + * @member srcPosVector + * @member dstPosVector + */ + type record LSReplyHeader { + UInt16 seqNumber, + UInt16 reserved, + LongPosVector srcPosVector, + ShortPosVector dstPosVector + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc The Location Service (LS) Request packet header. + * + * @see ETSI EN 302 636-4-1 chapter 8.8.7 + * + * @member seqNumber + * @member reserved + * @member srcPosVector + * @member gnAddress + */ + type record LSRequestHeader { + UInt16 seqNumber, + UInt16 reserved, + LongPosVector srcPosVector, + GN_Address gnAddress + } with { + variant "FIELDORDER(msb)" + } + + /** + * The Single Hop Broadcast (SHB) packet header. + * + * @see ETSI EN 302 636-4-1 chapter 8.8.4 + * + * @member srcPosVector + * @member reserved + */ + type record SHBHeader { + LongPosVector srcPosVector, + UInt32 reserved + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc The Topologically-Scoped Broadcast (TSB) packet header. + * + * @see ETSI EN 302 636-4-1 chapter 8.8.3 + * + * @member seqNumber + * @member reserved + * @member srcPosVector + */ + type record TSBHeader { + UInt16 seqNumber, + UInt16 reserved, + LongPosVector srcPosVector + } with { + variant "FIELDORDER(msb)" + } + + group geoNetworkingHeadersSubtypes { + + /** + * @desc Identifies the header type and the header subtype for ANY. + * @member headerType + * @member reserved + */ + type record AnyHeaderType { + HeaderType headerType(e_any), + UInt4 headerSubType + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Identifies the header type and the header subtype for BEACON. + * @member headerType + * @member reserved + */ + type record BeaconHeaderType { + HeaderType headerType(e_beacon), + UInt4 headerSubType + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Identifies the header type and the header subtype for GEOANYCAST. + * @member headerType + * @member reserved + */ + type record GeoAnycastHeaderType { + HeaderType headerType(e_geoAnycast), + HeaderSubTypeGeoAnycast headerSubType + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Identifies the header type and the header subtype for GEOBROADCAST. + * @member headerType + * @member reserved + */ + type record GeoBroadcastHeaderType { + HeaderType headerType(e_geoBroadcast), + HeaderSubTypeGeoBroadcast headerSubType + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Identifies the header type and the header subtype for GEOUNICAST. + * @member headerType + * @member reserved + */ + type record GeoUnicastHeaderType { + HeaderType headerType(e_geoUnicast), + UInt4 headerSubType + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Identifies the header type and the header subtype for Location Service LS. + * @member headerType + * @member reserved + */ + type record LsHeaderType { + HeaderType headerType(e_locationService), + HeaderSubTypeLs headerSubType + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Identifies the header type and the header subtype for Service Announcement SA. + * @member headerType + * @member reserved + */ + type record SaHeaderType { + HeaderType headerType(e_serviceAnnouncement), + HeaderSubTypeSa headerSubType + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Identifies the header type and the header subtype for Topologically-Scoped Broadcast TSB. + * @member headerType + * @member headerSubType + */ + type record TsbHeaderType { + HeaderType headerType(e_topologicallyScopedBroadcast), + HeaderSubTypeTSB headerSubType + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Identifies the header subtype for GEOANYCAST. + */ + type enumerated HeaderSubTypeGeoAnycast { + e_geoAnycastCircle(0), + e_geoAnycastRect(1), + e_geoAnycastElip(2), + e_reserved + } with { + variant "FIELDLENGTH(4)" //variant "4 bit" + } + + /** + * @desc Identifies the header subtype for GEOBROADCAST. + */ + type enumerated HeaderSubTypeGeoBroadcast { + e_geoBroadcastCircle(0), + e_geoBroadcastRect(1), + e_geoBroadcastElip(2), + e_reserved + } with { + variant "FIELDLENGTH(4)" //variant "4 bit" + } + + /** + * @desc Identifies the header subtype for Topologically-scoped broadcast TSB. + */ + type enumerated HeaderSubTypeTSB { + e_singleHop(0), + e_multiHop(1), + e_reserved + } with { + variant "FIELDLENGTH(4)" //variant "4 bit" + } + + /** + * @desc Identifies the header subtype for Location Service LS. + */ + type enumerated HeaderSubTypeLs { + e_lsRequest(0), + e_lsReply(1), + e_reserved + } with { + variant "FIELDLENGTH(4)" //variant "4 bit" + } + + /** + * @desc Identifies the header subtype for Service Announcement SA. + */ + type enumerated HeaderSubTypeSa { + e_sa(0), + e_saEos(1), + e_reserved + } with { + variant "FIELDLENGTH(4)" //variant "4 bit" + } + + /** + * @desc Identifies the header type and the header subtype. + * @member anyHdr + * @member beaconHdr + * @member geoUnicastHdr + * @member geoAnycastHdr + * @member geoBroadcastHdr + * @member tsbHdr + * @member lsHdr + * @member saHdr + * @member reserved + */ + type union HeaderTST { + AnyHeaderType anyHdr, + BeaconHeaderType beaconHdr, + GeoUnicastHeaderType geoUnicastHdr, + GeoAnycastHeaderType geoAnycastHdr, + GeoBroadcastHeaderType geoBroadcastHdr, + TsbHeaderType tsbHdr, + LsHeaderType lsHdr, + SaHeaderType saHdr, + UInt8 reserved + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Identifies the type of the GeoAdhoc header type (4Bits). + */ + type enumerated HeaderType { + e_any(0), + e_beacon(1), + e_geoUnicast(2), + e_geoAnycast(3), + e_geoBroadcast(4), + e_topologicallyScopedBroadcast(5), + e_locationService(6), + e_serviceAnnouncement(7), + e_reserved + } with { + variant "FIELDLENGTH(4)" //variant "4 bit" + } + + /** + * @desc Long Position Vector + * + *
    +         *  0               1               2               3
    +         *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
    +         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +         * |                           GN_ADDR                             |
    +         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +         * |                             TST                               |
    +         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +         * |                             Lat                               |
    +         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +         * |                             Long                              |
    +         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +         * |P|              S              |               H               |
    +         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +         * 
    + * + * @see ETSI EN 302 636-4-1 chapter 8.5.2 + * + * @member gnAddr + * @member timestamp_ + * @member latitude + * @member longitude + * @member pai Position Accuracy Indicator + * @member speed + * @member heading + */ + type record LongPosVector { + GN_Address gnAddr, + UInt32 timestamp_, + Int32 latitude, + Int32 longitude, + Bit1 pai, + Int15 speed, + UInt16 heading + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Short Position Vector + * + *
    +         *  0               1               2               3
    +         *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
    +         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +         * |                           GN_ADDR                             |
    +         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +         * |                             TST                               |
    +         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +         * |                             Lat                               |
    +         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +         * |                             Long                              |
    +         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +         * 
    + * + * @see ETSI EN 302 636-4-1 chapter 8.5.3 + * + * @member gnAddr + * @member timestamp + * @member latitude + * @member longitude + */ + type record ShortPosVector { + GN_Address gnAddr, + UInt32 timestamp_, + Int32 latitude, + Int32 longitude + } with { + variant "FIELDORDER(msb)" + } + + group geoNetworkingAddress { + /** + * @desc GeoNetworking address + * + *
    +           *  0               1               2               3
    +           *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
    +           * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +           * |M|  S_T    |       S_CC        |             M_ID              |
    +           * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +           * |                              M_ID                             |
    +           * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +           * 
    + * + * @see ETSI EN 302 636-4-1 chapter 6.2 + * + * @member typeOfAddress + * @member stationType + * @member mid + */ + type record GN_Address { + TypeOfAddress typeOfAddress, + StationType stationType, + UInt10 stationCountryCode, + Oct6 mid + } with { + variant "FIELDORDER(msb)" + } + + group geoNetworkingAddressSubtypes { + + /** + * @desc Identifies the ITS station (5Bits). + */ + type enumerated StationType { + e_unknown(0), + e_pedestrian(1), + e_cyclist(2), + e_moped(3), + e_motorcycle(4), + e_passengerCar(5), + e_bus(6), + e_lightTruck(7), + e_heavyTruck(8), + e_trailer(9), + e_specialVehicle(10), + e_tram(11), + e_roadSideUnit(15) + } with { + variant "FIELDLENGTH(5)" //variant "5 bit" + } + + /** + * @desc Distinguish between manually configured + * network address and the initial GeoNetwork address (1Bit). + */ + type enumerated TypeOfAddress { + e_manual(1), + e_initial(0) + } with { + variant "FIELDLENGTH(1)" //variant "1 bit" + } + + } // end group geoNetworkingAddressSubtypes + + } // end group geoNetworkingAddress + + } // end group geoNetworkingHeadersSubtypes + + } // end group geoNetworkingExtendedHeaders + + } // end group geoNetworkingHeader + + group geoNwPicsTypes { + + /** + * @desc The GeoUnicast forwarding algorithm. + */ + type enumerated GeoUnicastForwardingAlgorithm { + e_unspecified(0), + e_greedy(1), + e_cbf(2) + } + + /** + * @desc The GeoBroadcast forwarding algorithm. + */ + type enumerated GeoBroadcastForwardingAlgorithm { + e_unspecified(0), + e_simple(1), + e_cbf(2), + e_advanced(3) + } + + /** + * @desc GN address configuration method. + */ + type enumerated GnAddressConfigurationMethod { + e_auto(0), + e_managed(1), + e_anonymous(2) + } + + } // end geoNwPicsTypes + + group utPrimitives { + + /** + * @desc Upper Tester message to initialize IUT + * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use + */ + type record UtGnInitialize { + Oct8 hashedId8 + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Upper Tester results message of the GeoNetworking IUT + * @member utGnInitialize - + * @member utGnTriggerResult - + * @member utAutoInteropTriggerResult - + * @member utGnChangePositionResult - + */ + type union UtGnResults { + boolean utGnInitializeResult, + boolean utGnTriggerResult, + boolean utAutoInteropTriggerResult, // FIXME Remove UtAutoInteropTrigger from GN component, create an AutoInterop component + boolean utGnChangePositionResult + } with { + variant "" + } // End of type UtGnResults + + /** + * @desc AutoInterop UpperTester trigger + * @member utRadioOnOff Set to true to power on the radio (on-link mode), false to power off the radio (off-link). + */ + type union UtAutoInteropTrigger { + boolean utRadioOnOff + } with { + variant "" + } // End of type UtAutoInteropTrigger + + /** + * @desc Upper Tester message to change the position of IUT. Values a relatives + */ + type record UtGnChangePosition { + Int32 latitude, + Int32 longitude, + Int32 elevation + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc UT primitives for GeoNetworking + * @member geoUnicast - + * @member geoBroadcast - + * @member geoAnycast - + * @member shb - + * @member tsb - + * @member changePosition - + * @member checkPacket - + */ + type union UtGnTrigger { + GenerateGeoUnicastMessage geoUnicast, + GenerateGeoBroadcastMessage geoBroadcast, + GenerateGeoAnycastMessage geoAnycast, + GenerateSHBMessage shb, + GenerateTSBMessage tsb + } with { + variant "" + } + + /** + * @desc UT primitive for IUT to send a GeoUnicast packet + * @member gnAddress Destination of the packet + * @member lifetime Lifetime of the packet + * @member trafficClass Traffic class of the packet + * @member payload GnRawPayload of the packet + */ + type record GenerateGeoUnicastMessage { + GN_Address gnAddress, + UInt16 lifetime, + TrafficClass trafficClass, + GnRawPayload payload + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc UT primitive for IUT to send a GeoBroadcast packet + * @member shape Shape of the area + * @member lifetime Lifetime of the packet + * @member trafficClass Traffic class of the packet + * @member area Destination GeoArea + * @member payload GnRawPayload of the packet + */ + type record GenerateGeoBroadcastMessage { + GeoShape shape, + UInt16 lifetime, + TrafficClass trafficClass, + UInt24 reserved, + Area area, + GnRawPayload payload + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc UT primitive for IUT to send a Geoanycast packet + */ + type GenerateGeoBroadcastMessage GenerateGeoAnycastMessage; + + /** + * @desc UT primitive for IUT to send a SHB packet + * @member trafficClass Traffic class of the packet + * @member payload GnRawPayload of the packet + */ + type record GenerateSHBMessage { + TrafficClass trafficClass, + GnRawPayload payload + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc UT primitive for IUT to send a SHB packet + * @member nbHops Number of Hops + * @member lifetime Lifetime of the packet + * @member trafficClass Traffic class of the packet + * @member payload GnRawPayload of the packet + */ + type record GenerateTSBMessage { + UInt8 nbHops, + UInt16 lifetime, + TrafficClass trafficClass, + GnRawPayload payload + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Upper Tester message to check Upper Layer message transmission on GN IUT + */ + type record UtGnEventInd { + // GeoNetworkingPdu gnPdu + GnRawPayload rawPayload + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc List of Upper Tester messages to check Upper Layer message transmission on GN IUT + */ + type record of UtGnEventInd UtGnEventIndList; + + } // end utPrimitives + with { + encode "UpperTester"; + variant "" + } + + group acPrimitives { + + /** + * @desc TA primitives for GeoNetworking + * @member startBeaconing - + * @member stopBeaconing - + * @member startPassBeaconing - + * @member stopPassBeaconing - + * @member startBeaconingMultipleNeighbour - + * @member stopBeaconingMultipleNeighbour - + * @member getLongPosVector - + */ + type union AcGnPrimitive { + AcStartBeaconing startBeaconing, + AcStopBeaconing stopBeaconing, + AcStartPassBeaconing startPassBeaconing, + AcStopPassBeaconing stopPassBeaconing, + AcStartBeaconingMultipleNeighbour startBeaconingMultipleNeighbour, + AcStopBeaconingMultipleNeighbour stopBeaconingMultipleNeighbour, + AcGetLongPosVector getLongPosVector + } with { + variant "" + } + + /** + * @desc Primitive for receiveing response from TA + * @member getLongPosVector + */ + type union AcGnResponse { + LongPosVector getLongPosVector, + AcGnResponseFailure failure + } + with { + variant "" + encode(getLongPosVector) "LibItsGeoNetworking" + } + + type record AcGnResponseFailure { + boolean failure + } + + /** + * @desc Primitive for TA to start sending beacons for the test component + * @member beaconHeader Beacon template + */ + type record AcStartBeaconing { + GeoNetworkingPdu beaconPacket + } + with { + encode(beaconPacket) "LibItsGeoNetworking" + } + + /** + * @desc Primitive for TA to stop sending beacons for the test component + */ + type record AcStopBeaconing { + } + + /** + * @desc Primitive for TA to start enqueueing received beacons + * @member beaconHeader Filter + */ + type record AcStartPassBeaconing { + BeaconHeader beaconHeader + } + with { + encode(beaconHeader) "LibItsGeoNetworking" + }; + + /** + * @desc Primitive for TA to stop enqueueing received beacons + */ + type record AcStopPassBeaconing { + } + + /** + * @desc Primitive for TA to start sending beacons for multiple neighbours + * @member beaconHeader Beacon template + * @member numberOfNeighbour Number of neighbours to simulate + */ + type record AcStartBeaconingMultipleNeighbour { + GeoNetworkingPdu beaconPacket, + integer numberOfNeighbour + } + with { + encode(beaconPacket) "LibItsGeoNetworking" + }; + + /** + * @desc Primitive for TA to stop sending beacons for multiple neighbours + */ + type record AcStopBeaconingMultipleNeighbour { + } + + /** + * @desc Primitive for retrieving the position vector corresponding to a specific GN address + * @member gnAddress GN address to be searched + */ + type record AcGetLongPosVector { + GN_Address gnAddress + } + with { + encode(gnAddress) "LibItsGeoNetworking" + }; + + } // end acPrimitives + with { + variant "" + encode "AdapterControl" + } +} +with { + variant "" + encode "LibItsGeoNetworking" + } -- GitLab From 7f527d2d46a51dccc95abfb21fa0fc9bf2acfff2 Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Wed, 5 Dec 2018 14:42:35 +0100 Subject: [PATCH 162/320] Final validation of Enrolment request/response --- ttcn/Pki/LibItsPki_Functions.ttcn | 54 +++++++++++++------------------ 1 file changed, 23 insertions(+), 31 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 146342c3..af5ca337 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -232,11 +232,10 @@ module LibItsPki_Functions { out Oct12 p_nonce, out octetstring p_salt, out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, - out Oct32 p_hash_inner_ec_request_signed_for_pop + out Oct32 p_request_hash ) runs on ItsPkiHttp { var InnerEcRequest v_inner_ec_request; var Ieee1609Dot2Data v_inner_ec_request_signed_for_pop; - var bitstring v_inner_ec_request_signed_for_pop_msg; var octetstring v_public_enc_key; var integer v_compressed_enc_key_mode; var boolean v_ret_code; @@ -250,14 +249,9 @@ module LibItsPki_Functions { log("*** f_http_build_inner_ec_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); f_selfOrClientSyncAndVerdict("error", e_error); } - // Secure InnerEcRequestSignedForPoP message log("v_inner_ec_request_signed_for_pop= ", v_inner_ec_request_signed_for_pop); - v_inner_ec_request_signed_for_pop_msg := encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop)); - log("v_inner_ec_request_signed_for_pop_msg= ", v_inner_ec_request_signed_for_pop_msg); - // Prepare for getting the 16 most bytes of SHA256 of InnerEcRequestSignedForPop - p_hash_inner_ec_request_signed_for_pop := f_hashWithSha256(bit2oct(v_inner_ec_request_signed_for_pop_msg)); - // Secure the Pki message + // Secure InnerEcRequestSignedForPoP message if (f_extract_enc_key(vc_eaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { log("*** f_http_build_inner_ec_request: ERROR: Non canonical EA certificate ***"); f_selfOrClientSyncAndVerdict("error", e_error); @@ -267,17 +261,16 @@ module LibItsPki_Functions { log("*** f_http_build_inner_ec_request: First enrolment: ", PX_FIRST_ENROLMENT); p_salt := vc_eaWholeHash; if (PX_FIRST_ENROLMENT == true) { // This is the first enrolment, we used Factory keys - v_ret_code := f_build_pki_secured_message(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(v_inner_ec_request_signed_for_pop_msg), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); + v_ret_code := f_build_pki_secured_message(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } else { // We use last valid EC certificate - v_ret_code := f_build_pki_secured_message(vc_ecPrivateKey, valueof(m_signerIdentifier_digest(vc_ecHashedId8)), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(v_inner_ec_request_signed_for_pop_msg), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); + v_ret_code := f_build_pki_secured_message(vc_ecPrivateKey, valueof(m_signerIdentifier_digest(vc_ecHashedId8)), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } if (v_ret_code == false) { log("*** f_http_build_inner_ec_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); f_selfOrClientSyncAndVerdict("error", e_error); } - log("*** f_http_build_inner_ec_request: DEBUG: v_inner_ec_request_signed_for_pop_msg= ", v_inner_ec_request_signed_for_pop_msg); log("*** f_http_build_inner_ec_request: DEBUG: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); - log("*** f_http_build_inner_ec_request: DEBUG: p_hash_inner_ec_request_signed_for_pop= ", p_hash_inner_ec_request_signed_for_pop); + log("*** f_http_build_inner_ec_request: DEBUG: p_request_hash= ", p_request_hash); } // End of function f_http_build_inner_ec_request function f_http_build_invalid_enrolment_request( @@ -290,7 +283,7 @@ module LibItsPki_Functions { out Oct12 p_nonce, out octetstring p_salt, out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, - out Oct32 p_hash_inner_ec_request_signed_for_pop + out Oct32 p_request_hash ) runs on ItsPkiHttp { var InnerEcRequest v_inner_ec_request; var Ieee1609Dot2Data v_inner_ec_request_signed_for_pop; @@ -307,10 +300,10 @@ module LibItsPki_Functions { log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); f_selfOrClientSyncAndVerdict("error", e_error); } + + log("v_inner_ec_request_signed_for_pop= ", v_inner_ec_request_signed_for_pop); + // Secure InnerEcRequestSignedForPoP message - // Get 16 last byte of SHA256 of InnerEcRequestSignedForPop - p_hash_inner_ec_request_signed_for_pop := f_hashWithSha256(int2oct(12345, 32)); // Invalid InnseEcRequestSignedForPop - // Secure the Pki message if (f_extract_enc_key(vc_eaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { log("*** f_http_build_inner_ec_request: ERROR: Non canonical EA certificate ***"); f_selfOrClientSyncAndVerdict("error", e_error); @@ -319,9 +312,9 @@ module LibItsPki_Functions { log("*** f_http_build_inner_ec_request: Public encryption key comp: ", v_compressed_enc_key_mode); p_salt := vc_eaWholeHash; if (PX_FIRST_ENROLMENT == true) { // This is the first enrolment, we used Factory keys - v_ret_code := f_build_pki_secured_message(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); + v_ret_code := f_build_pki_secured_message(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } else { // We use last valid EC certificate - v_ret_code := f_build_pki_secured_message(vc_ecPrivateKey, valueof(m_signerIdentifier_digest(vc_ecHashedId8)), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); + v_ret_code := f_build_pki_secured_message(vc_ecPrivateKey, valueof(m_signerIdentifier_digest(vc_ecHashedId8)), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } if (v_ret_code == false) { log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); @@ -335,7 +328,7 @@ module LibItsPki_Functions { out octetstring p_publicKeyCompressed, out integer p_compressedMode, out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, - out HashedId8 p_hash_inner_at_request + out Oct32 p_request_hash ) runs on ItsPkiHttp { // Local variables @@ -372,7 +365,7 @@ module LibItsPki_Functions { **/ log("*** f_http_build_inner_ec_request: ERROR: Need to add TestSystem variable vc_aa ***"); f_selfOrClientSyncAndVerdict("error", e_error); - /* if (f_build_pki_secured_message(vc_aaPrivateKey, valueof(m_signerIdentifier_digest(vc_aaHashedId8)), vc_eaHashedId8/\*recipientId*\/, v_public_enc_key, v_compressed_enc_key_mode, vc_eaWholeHash, bit2oct(encvalue(m_etsiTs102941Data_authorization_validation_request(v_authorization_validation_request))), p_ieee1609dot2_signed_and_encrypted_data) == false) { */ + /* if (f_build_pki_secured_message(vc_aaPrivateKey, valueof(m_signerIdentifier_digest(vc_aaHashedId8)), vc_eaHashedId8/\*recipientId*\/, v_public_enc_key, v_compressed_enc_key_mode, vc_eaWholeHash, bit2oct(encvalue(m_etsiTs102941Data_authorization_validation_request(v_authorization_validation_request))), p_ieee1609dot2_signed_and_encrypted_data, p_request_hash) == false) { */ /* log("*** f_http_build_authorization_validation_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); */ /* f_selfOrClientSyncAndVerdict("error", e_error); */ /* } */ @@ -909,7 +902,8 @@ module LibItsPki_Functions { out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, - out Oct12 p_nonce + out Oct12 p_nonce, + out Oct32 p_request_hash ) return boolean { // Local variables var template (value) EccP256CurvePoint v_eccP256_curve_point; @@ -956,6 +950,9 @@ module LibItsPki_Functions { ); // Encode EtsiTs103097Data-Signed data structure v_encoded_inner_ec_request := bit2oct(encvalue(v_ieee1609dot2_signed_data)); + // Calculate the SHA256 of v_encoded_inner_ec_request + p_request_hash := f_hashWithSha256(v_encoded_inner_ec_request); + log("p_request_hash= ", p_request_hash); // Encrypt encode EtsiTs103097Data-Signed data structure if (PICS_SEC_FIXED_KEYS) { p_publicKeyCompressed := '8C5E20FE31935F6FA682A1F6D46E4468534FFEA1A698B14B0B12513EED8DEB11'O; @@ -1009,25 +1006,22 @@ module LibItsPki_Functions { } // End of function f_build_pki_secured_message /** - * @desc Verify the protocol element of the Pki message + * @desc Verify the protocol element of the Pki message. + * If p_check_security is set to false, only decryption and decoding of the outer message are verified. * @param p_private_key Private key for decryption * @param p_publicEphemeralCompressedKey * @param p_publicEphemeralCompressedKeyMode * @param p_issuer Issuer * @param p_certificate Certificate to use for verification key * @param p_ieee1609dot2_encrypted_and_signed_data The received encrypted and signed data - * @param p_check_security Set to true to check signatures + * @param p_check_security Set to true to verify PKI protocol element such as signatures... * @param p_etsi_ts_102941_data The EtsiTs102941Data message * @return true on success, false otherwise */ function f_verify_pki_message( in octetstring p_private_enc_key, - // in octetstring p_publicEphemeralCompressedKey, // TODO Useless, to be removed - // in integer p_publicEphemeralCompressedKeyMode, // TODO Useless, to be removed in Oct16 p_aes_sym_key, in Oct16 p_authentication_vector, // TODO Tobe removed - // in Oct12 p_nonce, // TODO Tobe removed - // in octetstring p_salt, in octetstring p_issuer, in Certificate p_certificate, // TODO Tobe removed in Ieee1609Dot2Data p_ieee1609dot2_encrypted_and_signed_data, @@ -1061,9 +1055,7 @@ module LibItsPki_Functions { // 2. Decode it v_tbs := oct2bit(v_plain_message); if (decvalue(v_tbs, v_ieee1609dot2_signed_data) != 0) { - if (p_check_security == true) { - return false; - } + return false; } log("v_ieee1609dot2_signed_data= ", v_ieee1609dot2_signed_data); @@ -1075,7 +1067,7 @@ module LibItsPki_Functions { return false; } } - log("v_certificate= ", v_certificate); + //log("v_certificate= ", v_certificate); if (ischosen(v_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256.compressed_y_0)) { v_ret := f_verifyWithEcdsaNistp256WithSha256( bit2oct(v_tbs), -- GitLab From 9762518193609ba46d9b89895ddee2cc9a31cc2c Mon Sep 17 00:00:00 2001 From: vagrant Date: Thu, 6 Dec 2018 01:57:32 -0800 Subject: [PATCH 163/320] AtsPki validation: major bugs fixed --- ttcn/Pki/LibItsPki_Functions.ttcn | 90 ++++++++++++++++++++++++++++++- ttcn/Pki/LibItsPki_Pics.ttcn | 5 ++ 2 files changed, 93 insertions(+), 2 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index af5ca337..0a43feac 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -331,7 +331,37 @@ module LibItsPki_Functions { out Oct32 p_request_hash ) runs on ItsPkiHttp { // Local variables + // Local variables + var InnerAtRequest v_authorization_request; + var bitstring v_authorization_request_msg; + var octetstring v_public_enc_key; + var integer v_compressed_enc_key_mode; + + if (f_generate_authorization_request(vc_eaCertificate, vc_eaHashedId8, p_private_key, p_publicKeyCompressed, p_compressedMode, v_authorization_request) == false) { + log("*** f_http_build_authorization_request: ERROR: Failed to generate AuthorizationValidationRequest ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + // Secure the Pki message + if (f_extract_enc_key(vc_eaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { + log("*** f_http_build_inner_ec_request: ERROR: Non canonical EA certificate ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + log("*** f_http_build_authorization_request: Public encryption key: ", v_public_enc_key); + log("*** f_http_build_authorization_request: Public encryption key comp: ", v_compressed_enc_key_mode); + + + /** + TODO: Load certificate according to the IUT role + ==> a complete fucntion which set up the TestSustem certificate,keyy... according to the IUT role + **/ + log("*** f_http_build_inner_ec_request: ERROR: Need to add TestSystem variable vc_aa ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + /* if (f_build_pki_secured_message(vc_aaPrivateKey, valueof(m_signerIdentifier_digest(vc_aaHashedId8)), vc_eaHashedId8/\*recipientId*\/, v_public_enc_key, v_compressed_enc_key_mode, vc_eaWholeHash, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_authorization_request))), p_ieee1609dot2_signed_and_encrypted_data, p_request_hash) == false) { */ + /* log("*** f_http_build_authorization_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); */ + /* f_selfOrClientSyncAndVerdict("error", e_error); */ + /* } */ + log("*** f_http_build_authorization_request: DEBUG: p_ieee1609dot2_signed_and_encrypted_data = ", p_ieee1609dot2_signed_and_encrypted_data); } // End of function f_http_build_inner_at_request function f_http_build_authorization_validation_request( @@ -517,8 +547,7 @@ module LibItsPki_Functions { ), m_certificateSubjectAttributes( { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs - valueof(m_appPermissions(36, { bitmapSsp := '830001'O })), // TODO Use PIXIT - valueof(m_appPermissions(37, { bitmapSsp := '830001'O })) // TODO Use PIXIT + valueof(m_appPermissions(623, { bitmapSsp := '00C0'O })) }, m_validityPeriod( f_getCurrentTime() / 1000, @@ -819,6 +848,63 @@ module LibItsPki_Functions { } // End of group inner_at_xxx + group authorization_xxx { + + function f_generate_authorization_request( + in Certificate p_ea_certificate, + in HashedId8 p_ea_certificate_hashed_id8, + out octetstring p_private_key, + out octetstring p_publicKeyCompressed, + out integer p_compressedMode, + out InnerAtRequest p_authorization_request + ) return boolean { + // Local variables + var octetstring v_private_enc_key; + var Oct32 v_publicEncKeyCompressed; + var integer v_compressedMode; + var InnerEcRequest v_inner_ec_request; + var Certificate v_ec_certificate; + var InnerAtRequest v_inner_at_request; + var Ieee1609Dot2Data v_inner_at_request_data; + + if (f_generate_inner_ec_request(p_private_key, p_publicKeyCompressed, p_compressedMode, v_inner_ec_request) == false) { + return false; + } + if (f_generate_ec_certificate(p_private_key, v_inner_ec_request, v_ec_certificate) == false) { + return false; + } + if (f_generate_inner_at_request(v_ec_certificate, p_private_key, p_ea_certificate, p_ea_certificate_hashed_id8, true, v_private_enc_key, v_publicEncKeyCompressed, v_compressedMode, v_inner_at_request, v_inner_at_request_data) == false) { + return false; + } + + p_authorization_request.sharedAtRequest := v_inner_at_request.sharedAtRequest; + p_authorization_request.ecSignature := v_inner_at_request.ecSignature; + + log("f_generate_authorization_request: ", p_authorization_request); + + return true; + } // End of function f_generate_authorization_request + + function f_generate_authorization_response( + in octetstring p_authorization_request_hash, + in CertificateSubjectAttributes p_Certificate_subject_attributes, + out InnerAtResponse p_authorization_response + ) return boolean { + // Local variables + + // Build the Proof of Possession InnerAtResponse + /*p_authorization_response := valueof( + m_innerAtResponse_ok( + p_authorization_request_hash, + p_Certificate_subject_attributes + ) + );*/ + + return true; + } // End of function f_generate_authorization_response + + } // End of group authorization_xxx + group authorization_validation_xxx { function f_generate_authorization_validation_request( diff --git a/ttcn/Pki/LibItsPki_Pics.ttcn b/ttcn/Pki/LibItsPki_Pics.ttcn index d82caf1a..97492c2c 100644 --- a/ttcn/Pki/LibItsPki_Pics.ttcn +++ b/ttcn/Pki/LibItsPki_Pics.ttcn @@ -15,6 +15,11 @@ module LibItsPki_Pics { */ modulepar boolean PICS_IUT_AA_ROLE := false; + /** + * @desc Does the IUT act as combined EA-AA device? + */ + modulepar boolean PICS_IUT_COMBINED_EA_AA_ROLE := true; + /** * @desc Certificate used by the IUT acting as ITS-S */ -- GitLab From b745c0b23fc463ff118fc60c06831711651b77ec Mon Sep 17 00:00:00 2001 From: vagrant Date: Tue, 18 Dec 2018 22:09:45 -0800 Subject: [PATCH 164/320] Finalyze support of AuthorizarionRequest/Response --- ttcn/Http/LibItsHttp_Functions.ttcn | 85 ++- ttcn/Http/LibItsHttp_TypesAndValues.ttcn | 1 + ttcn/Pki/LibItsPki_Functions.ttcn | 659 +++++++++++--------- ttcn/Pki/LibItsPki_Pics.ttcn | 11 +- ttcn/Pki/LibItsPki_Pixits.ttcn | 15 +- ttcn/Pki/LibItsPki_Templates.ttcn | 16 +- ttcn/Pki/LibItsPki_TestSystem.ttcn | 12 +- ttcn/Security/LibItsSecurity_Functions.ttcn | 10 +- ttcn/Security/LibItsSecurity_Templates.ttcn | 5 + 9 files changed, 463 insertions(+), 351 deletions(-) diff --git a/ttcn/Http/LibItsHttp_Functions.ttcn b/ttcn/Http/LibItsHttp_Functions.ttcn index 72a51320..385b3ff8 100644 --- a/ttcn/Http/LibItsHttp_Functions.ttcn +++ b/ttcn/Http/LibItsHttp_Functions.ttcn @@ -44,38 +44,75 @@ module LibItsHttp_Functions { group http_headers { function f_init_default_headers_list( + in charstring p_header_content_type := PICS_HEADER_CONTENT_TYPE, + in charstring p_header_content_text := "", out HeaderLines p_headers ) { - p_headers[0] := { c_header_host, { PICS_HEADER_HOST } }; - p_headers[1] := { c_header_content_type, { PICS_HEADER_CONTENT_TYPE } }; - p_headers[2] := { c_header_content_length, { "0" } }; - p_headers[3] := { c_header_connection, { "keep-alive" } }; - p_headers[4] := { c_header_pragma, { "no-cache" } }; - p_headers[5] := { c_header_cache_control, { "no-cache" } }; - + var integer v_i := 0; + + p_headers[v_i] := { c_header_host, { PICS_HEADER_HOST } }; + v_i := v_i + 1; + p_headers[v_i] := { c_header_content_type, { p_header_content_type } }; + v_i := v_i + 1; + if (p_header_content_text != "") { + p_headers[v_i] := { c_header_content_text, { p_header_content_text } }; + v_i := v_i + 1; + } + p_headers[v_i] := { c_header_content_length, { "0" } }; + v_i := v_i + 1; + p_headers[v_i] := { c_header_connection, { "keep-alive" } }; + v_i := v_i + 1; + p_headers[v_i] := { c_header_pragma, { "no-cache" } }; + v_i := v_i + 1; + p_headers[v_i] := { c_header_cache_control, { "no-cache" } }; } // End of function f_init_default_headers_list + function f_set_headears_list( + in charstring_list p_headers_to_set, + in charstring_list p_headers_value, + inout HeaderLines p_headers + ) { + // Sanity checks + if (lengthof(p_headers_to_set) == 0) { + return; + } else if (lengthof(p_headers) == 0) { + return; + } + + for (var integer v_idx := 0; v_idx < lengthof(p_headers_to_set); v_idx := v_idx + 1) { + var integer v_jdx; + for (v_jdx := 0; v_jdx < lengthof(p_headers); v_jdx := v_jdx + 1) { + if (p_headers[v_jdx].header_name == p_headers_to_set[v_idx]) { + p_headers[v_jdx].header_value := p_headers_value; // NOTE Codec won't encode it + break; + } + if (v_jdx == lengthof(p_headers)) { + p_headers[v_jdx].header_value := p_headers_value; + } + } // End of 'for' statement + } // End of 'for' statement + } // End of function f_set_headears_list + function f_remove_headears_list( in charstring_list p_headers_to_remove, inout HeaderLines p_headers - ) { - // Sanity checks - if (lengthof(p_headers_to_remove) == 0) { - return; - } else if (lengthof(p_headers) == 0) { - return; - } - - for (var integer v_idx := 0; v_idx < lengthof(p_headers_to_remove); v_idx := v_idx + 1) { - - for (var integer v_jdx := 0; v_jdx < lengthof(p_headers); v_jdx := v_jdx + 1) { - if (p_headers[v_jdx].header_name == p_headers_to_remove[v_idx]) { - p_headers[v_jdx].header_value := omit; // NOTE Codec won't encode it - } - } // End of 'for' statement - + ) { + // Sanity checks + if (lengthof(p_headers_to_remove) == 0) { + return; + } else if (lengthof(p_headers) == 0) { + return; + } + + for (var integer v_idx := 0; v_idx < lengthof(p_headers_to_remove); v_idx := v_idx + 1) { + for (var integer v_jdx := 0; v_jdx < lengthof(p_headers); v_jdx := v_jdx + 1) { + if (p_headers[v_jdx].header_name == p_headers_to_remove[v_idx]) { + p_headers[v_jdx].header_value := omit; // NOTE Codec won't encode it + break; + } } // End of 'for' statement - } // End of function f_init_default_headers_list + } // End of 'for' statement + } // End of function f_remove_headears_list } // End of group http_headers diff --git a/ttcn/Http/LibItsHttp_TypesAndValues.ttcn b/ttcn/Http/LibItsHttp_TypesAndValues.ttcn index bf643a85..a96ba19d 100644 --- a/ttcn/Http/LibItsHttp_TypesAndValues.ttcn +++ b/ttcn/Http/LibItsHttp_TypesAndValues.ttcn @@ -17,6 +17,7 @@ module LibItsHttp_TypesAndValues { const charstring c_header_host := "Host"; const charstring c_header_content_type := "Content-type"; + const charstring c_header_content_text := "Content-text"; const charstring c_header_content_length := "Content-length"; const charstring c_header_accept := "Accept"; const charstring c_header_connection := "Connection"; diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 0a43feac..c3adc48d 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -62,30 +62,36 @@ module LibItsPki_Functions { group pkiConfigurationFunctions { /** - * @desc Setups default configuration + * @desc Setups default configuration * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT */ function f_cfHttpUp( in charstring p_ea_certificate_id := "CERT_TS_A_EA", // TODO Use a constant - in charstring p_ec_certificate_id := "CERT_TS_A_EC", - in charstring p_peerCertificateId := "CERT_IUT_A_EA" + in charstring p_aa_certificate_id := "CERT_TS_A_AA" ) runs on ItsPkiHttp /* TITAN TODO: system ItsPkiHttpSystem */ { map(self:httpPort, system:httpPort); f_connect4SelfOrClientSync(); - f_initialiseSecuredMode(p_ea_certificate_id, p_peerCertificateId); - + f_initialiseSecuredMode(p_ea_certificate_id, p_aa_certificate_id); // TODO To be removed??? + + // Setup EA certificate shared with PKI EA entity f_readCertificate(p_ea_certificate_id, vc_eaCertificate); - f_readSigningKey(p_ea_certificate_id, vc_eaPrivateKey); - f_readCertificate(p_ec_certificate_id, vc_ecCertificate); - f_readSigningKey(p_ec_certificate_id, vc_ecPrivateKey); - f_readEncryptingKey(p_ea_certificate_id, vc_eaPrivateEncKey); + // f_readSigningKey(p_ea_certificate_id, vc_eaPrivateKey); // TODO To be removed + // f_readCertificate(p_aa_certificate_id, vc_ecCertificate); // TODO To be removed + // f_readSigningKey(p_aa_certificate_id, vc_ecPrivateKey); // TODO To be removed + // f_readEncryptingKey(p_ea_certificate_id, vc_eaPrivateEncKey); // TODO To be removed f_getCertificateDigest(p_ea_certificate_id, vc_eaHashedId8); f_getCertificateHash(p_ea_certificate_id, vc_eaWholeHash); - f_getCertificateDigest(p_ec_certificate_id, vc_ecHashedId8); - f_readCertificate(p_peerCertificateId, vc_peerEaCertificate); - f_getCertificateHash(p_peerCertificateId, vc_eaPeerWholeHash); + + // Setup AA certificate shared with PKI AA entity + f_readCertificate(p_aa_certificate_id, vc_aaCertificate); + f_getCertificateDigest(p_aa_certificate_id, vc_aaHashedId8); + f_getCertificateHash(p_aa_certificate_id, vc_aaWholeHash); + log("vc_aaHashedId8= ", vc_aaHashedId8); + log("vc_aaWholeHash= ", vc_aaWholeHash); + // f_readCertificate(p_peerCertificateId, vc_peerEaCertificate); // TODO To be removed + // f_getCertificateHash(p_peerCertificateId, vc_eaPeerWholeHash); // TODO To be removed activate(a_default_pki_http()); } // End of function f_cfHttpUp @@ -132,13 +138,13 @@ module LibItsPki_Functions { // Local variables // Load certificates - if( not f_loadCertificates(PX_IUT_SEC_CONFIG_NAME) ) { + if(not(f_loadCertificates(PX_IUT_SEC_CONFIG_NAME))) { log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); setverdict(inconc); stop; } - f_prepareCertificates(p_certificateId, vc_aaCertificate, vc_atCertificate); + // f_prepareCertificates(p_certificateId, vc_aaCertificate, vc_atCertificate); } // End of function f_initialiseSecuredMode() function f_uninitialiseSecuredMode() runs on ItsSecurityBaseComponent { @@ -220,7 +226,7 @@ module LibItsPki_Functions { } // End of group ut_port - group http { + group http { // TODO Split into EinnerEc, Authorization & AuthorizationValidation function f_http_build_inner_ec_request( // TODO Cleanup parameters out octetstring p_private_key, @@ -256,14 +262,22 @@ module LibItsPki_Functions { log("*** f_http_build_inner_ec_request: ERROR: Non canonical EA certificate ***"); f_selfOrClientSyncAndVerdict("error", e_error); } + if (PICS_SEC_FIXED_KEYS) { // Debug mode: Use fixed values + v_public_enc_key := 'DD4F6B0DF57C6E3BD0E32B565CACA1D858CEB08A5C2BBAB2C23E203C6DE697FF'O; + v_compressed_enc_key_mode := 0; + } log("*** f_http_build_inner_ec_request: Public encryption key: ", v_public_enc_key); log("*** f_http_build_inner_ec_request: Public encryption key comp: ", v_compressed_enc_key_mode); log("*** f_http_build_inner_ec_request: First enrolment: ", PX_FIRST_ENROLMENT); p_salt := vc_eaWholeHash; if (PX_FIRST_ENROLMENT == true) { // This is the first enrolment, we used Factory keys - v_ret_code := f_build_pki_secured_message(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); + v_ret_code := f_build_pki_secured_request_message(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } else { // We use last valid EC certificate - v_ret_code := f_build_pki_secured_message(vc_ecPrivateKey, valueof(m_signerIdentifier_digest(vc_ecHashedId8)), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); + var Oct32 v_ec_private_key; + var HashedId8 v_ec_hashed_id8; + // Retrieve EC certificate from the first enrolment + // TODO Set v_ec_private_key & v_ec_hashed_id8 + v_ret_code := f_build_pki_secured_request_message(v_ec_private_key, valueof(m_signerIdentifier_digest(v_ec_hashed_id8)), v_ec_hashed_id8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } if (v_ret_code == false) { log("*** f_http_build_inner_ec_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); @@ -300,8 +314,13 @@ module LibItsPki_Functions { log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); f_selfOrClientSyncAndVerdict("error", e_error); } - log("v_inner_ec_request_signed_for_pop= ", v_inner_ec_request_signed_for_pop); + // Modify signature to get an error + if (ischosen(v_inner_ec_request_signed_for_pop.content.signedData.signature_.ecdsaNistP256Signature)) { + v_inner_ec_request_signed_for_pop.content.signedData.signature_.ecdsaNistP256Signature.sSig[1] := bit2oct('10101010'B xor4b oct2bit(v_inner_ec_request_signed_for_pop.content.signedData.signature_.ecdsaNistP256Signature.sSig[1])); + } else { + v_inner_ec_request_signed_for_pop.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig[1] := bit2oct('10101010'B xor4b oct2bit(v_inner_ec_request_signed_for_pop.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig[1])); + } // Secure InnerEcRequestSignedForPoP message if (f_extract_enc_key(vc_eaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { @@ -312,57 +331,98 @@ module LibItsPki_Functions { log("*** f_http_build_inner_ec_request: Public encryption key comp: ", v_compressed_enc_key_mode); p_salt := vc_eaWholeHash; if (PX_FIRST_ENROLMENT == true) { // This is the first enrolment, we used Factory keys - v_ret_code := f_build_pki_secured_message(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); + v_ret_code := f_build_pki_secured_request_message(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } else { // We use last valid EC certificate - v_ret_code := f_build_pki_secured_message(vc_ecPrivateKey, valueof(m_signerIdentifier_digest(vc_ecHashedId8)), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); + var Oct32 v_ec_private_key; + var HashedId8 v_ec_hashed_id8; + // Retrieve EC certificate from the first enrolment + // TODO Set v_ec_private_key & v_ec_hashed_id8 + v_ret_code := f_build_pki_secured_request_message(v_ec_private_key, valueof(m_signerIdentifier_digest(v_ec_hashed_id8)), v_ec_hashed_id8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } if (v_ret_code == false) { log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); f_selfOrClientSyncAndVerdict("error", e_error); + return; } log("*** f_http_build_invalid_enrolment_request: DEBUG: p_ieee1609dot2_signed_and_encrypted_data = ", p_ieee1609dot2_signed_and_encrypted_data); } // End of function f_http_build_invalid_enrolment_request - function f_http_build_inner_at_request( - out octetstring p_private_key, - out octetstring p_publicKeyCompressed, - out integer p_compressedMode, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, - out Oct32 p_request_hash - ) runs on ItsPkiHttp { - // Local variables + function f_http_build_authorization_request( + in Certificate p_ec_certificate, // Enrolment credentials certificate + in octetstring p_ec_private_key, + out octetstring p_private_key, + out octetstring p_publicKeyCompressed, + out integer p_compressedMode, + out octetstring p_private_enc_key, + out octetstring p_publicEncKeyCompressed, + out integer p_compressedEncMode, + out Oct16 p_aes_sym_key, + out Oct16 p_encrypted_sym_key, + out Oct16 p_authentication_vector, + out Oct12 p_nonce, + out octetstring p_salt, + out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, + out Oct32 p_request_hash + ) runs on ItsPkiHttp { // Local variables - var InnerAtRequest v_authorization_request; - var bitstring v_authorization_request_msg; + var octetstring v_public_key_x; + var octetstring v_public_key_y; + var octetstring v_public_enc_key_x; + var octetstring v_public_enc_key_y; var octetstring v_public_enc_key; var integer v_compressed_enc_key_mode; + var InnerAtRequest v_inner_at_request; + var Ieee1609Dot2Data v_inner_at_request_data; + var InnerAtRequest v_authorization_request; + var bitstring v_authorization_request_msg; + + // Generate verification keys for the certificate to be requested + if (f_generate_key_pair_nistp256(p_private_key, v_public_key_x, v_public_key_y, p_publicKeyCompressed, p_compressedMode) == false) { + log("*** f_http_build_authorization_request: ERROR: Failed to generate verification key ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + return; + } + // Generate encryption keys for the certificate to be requested + if (PX_INCLUDE_ENCRYPTION_KEYS) { + if (f_generate_key_pair_nistp256(p_private_enc_key, v_public_enc_key_x, v_public_enc_key_y, p_publicEncKeyCompressed, p_compressedEncMode) == false) { + log("*** f_http_build_authorization_request: ERROR: Failed to generate encryption key ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + return; + } + } - if (f_generate_authorization_request(vc_eaCertificate, vc_eaHashedId8, p_private_key, p_publicKeyCompressed, p_compressedMode, v_authorization_request) == false) { + if (f_generate_inner_at_request(vc_eaCertificate, vc_eaHashedId8, p_ec_certificate, p_ec_private_key, p_private_key, v_public_key_x, v_public_key_y, p_compressedMode, p_private_enc_key, v_public_enc_key_x, v_public_enc_key_y, p_compressedEncMode, v_inner_at_request) == false) { log("*** f_http_build_authorization_request: ERROR: Failed to generate AuthorizationValidationRequest ***"); f_selfOrClientSyncAndVerdict("error", e_error); + return; } - // Secure the Pki message - if (f_extract_enc_key(vc_eaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { - log("*** f_http_build_inner_ec_request: ERROR: Non canonical EA certificate ***"); + log("v_inner_at_request= ", v_inner_at_request); + + if (PX_AUTHORIZATION_REQUEST_WITH_POP) { + // TODO Set Ieee1609Dot2Data p_inner_at_request_data + } // else TODO Check what to do + + // Secure InnerAtRequest message + if (f_extract_enc_key(vc_aaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { + log("*** f_http_build_inner_ec_request: ERROR: Non canonical AA certificate ***"); f_selfOrClientSyncAndVerdict("error", e_error); } + if (PICS_SEC_FIXED_KEYS) { // Debug mode: Use fixed values + v_public_enc_key := 'DD4F6B0DF57C6E3BD0E32B565CACA1D858CEB08A5C2BBAB2C23E203C6DE697FF'O; + v_compressed_enc_key_mode := 0; + } log("*** f_http_build_authorization_request: Public encryption key: ", v_public_enc_key); log("*** f_http_build_authorization_request: Public encryption key comp: ", v_compressed_enc_key_mode); - - - /** - TODO: Load certificate according to the IUT role - ==> a complete fucntion which set up the TestSustem certificate,keyy... according to the IUT role - **/ - log("*** f_http_build_inner_ec_request: ERROR: Need to add TestSystem variable vc_aa ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - /* if (f_build_pki_secured_message(vc_aaPrivateKey, valueof(m_signerIdentifier_digest(vc_aaHashedId8)), vc_eaHashedId8/\*recipientId*\/, v_public_enc_key, v_compressed_enc_key_mode, vc_eaWholeHash, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_authorization_request))), p_ieee1609dot2_signed_and_encrypted_data, p_request_hash) == false) { */ - /* log("*** f_http_build_authorization_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); */ - /* f_selfOrClientSyncAndVerdict("error", e_error); */ - /* } */ - - log("*** f_http_build_authorization_request: DEBUG: p_ieee1609dot2_signed_and_encrypted_data = ", p_ieee1609dot2_signed_and_encrypted_data); - } // End of function f_http_build_inner_at_request + log("*** f_http_build_authorization_request: First enrolment: ", PX_FIRST_ENROLMENT); + p_salt := vc_aaWholeHash; + log("*** f_http_build_authorization_request: p_salt: ", p_salt); + if(f_build_pki_secured_request_message(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { + log("*** f_http_build_authorization_request: ERROR: Failed to generate Authorization Request ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + log("*** f_http_build_authorization_request: DEBUG: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); + log("*** f_http_build_authorization_request: DEBUG: p_request_hash= ", p_request_hash); + } // End of function f_http_build_authorization_request function f_http_build_authorization_validation_request( out octetstring p_private_key, @@ -376,10 +436,10 @@ module LibItsPki_Functions { var octetstring v_public_enc_key; var integer v_compressed_enc_key_mode; - if (f_generate_authorization_validation_request(vc_eaCertificate, vc_eaHashedId8, p_private_key, p_publicKeyCompressed, p_compressedMode, v_authorization_validation_request) == false) { + /* TODO if (f_generate_authorization_validation_request(vc_eaCertificate, vc_eaHashedId8, p_private_key, p_publicKeyCompressed, p_compressedMode, v_authorization_validation_request) == false) { log("*** f_http_build_authorization_validation_request: ERROR: Failed to generate AuthorizationValidationRequest ***"); f_selfOrClientSyncAndVerdict("error", e_error); - } + }*/ // Secure the Pki message if (f_extract_enc_key(vc_eaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { log("*** f_http_build_inner_ec_request: ERROR: Non canonical EA certificate ***"); @@ -395,7 +455,7 @@ module LibItsPki_Functions { **/ log("*** f_http_build_inner_ec_request: ERROR: Need to add TestSystem variable vc_aa ***"); f_selfOrClientSyncAndVerdict("error", e_error); - /* if (f_build_pki_secured_message(vc_aaPrivateKey, valueof(m_signerIdentifier_digest(vc_aaHashedId8)), vc_eaHashedId8/\*recipientId*\/, v_public_enc_key, v_compressed_enc_key_mode, vc_eaWholeHash, bit2oct(encvalue(m_etsiTs102941Data_authorization_validation_request(v_authorization_validation_request))), p_ieee1609dot2_signed_and_encrypted_data, p_request_hash) == false) { */ + /* if (f_build_pki_secured_request_message(vc_aaPrivateKey, valueof(m_signerIdentifier_digest(vc_aaHashedId8)), vc_eaHashedId8/\*recipientId*\/, v_public_enc_key, v_compressed_enc_key_mode, vc_eaWholeHash, bit2oct(encvalue(m_etsiTs102941Data_authorization_validation_request(v_authorization_validation_request))), p_ieee1609dot2_signed_and_encrypted_data, p_request_hash) == false) { */ /* log("*** f_http_build_authorization_validation_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); */ /* f_selfOrClientSyncAndVerdict("error", e_error); */ /* } */ @@ -639,122 +699,99 @@ module LibItsPki_Functions { group inner_at_xxx { function f_generate_inner_at_request( + in Certificate p_ea_certificate, + in Oct8 p_ea_hashed_id8, in Certificate p_ec_certificate, + in octetstring p_ec_private_key, in octetstring p_private_key, - in Certificate p_ea_certificate, - in HashedId8 p_eaHashedId8, - in boolean p_itss_privacy, - out octetstring p_private_enc_key, - out octetstring p_publicEncKeyCompressed, - out integer p_compressedMode, - out InnerAtRequest p_inner_at_request, - out Ieee1609Dot2Data p_inner_at_request_data + in octetstring p_public_key_x, + in octetstring p_public_key_y, + in integer p_compressed_key_mode, + in octetstring p_private_enc_key, + in octetstring p_public_enc_key_x, + in octetstring p_public_enc_key_y, + in integer p_compressed_enc_key_mode, + out InnerAtRequest p_inner_at_request ) return boolean { // Local variables + var bitstring v_enc_value; + var octetstring v_ec_hash; + var Oct8 v_ec_hashed_id8; var octetstring public_enc_key_x; var octetstring public_enc_key_y; - var template (value) EccP256CurvePoint v_eccP256_curve_point; var Oct32 v_hmac_key; var octetstring v_message_to_tag; var Oct16 v_key_tag; - var octetstring v_whole_certificate_hash; var octetstring v_hash_shared_at_request; var template (value) ToBeSignedData v_tbs; var octetstring v_tbs_signed; var Ieee1609Dot2Data v_signed_ec_signature; - - // Generate encryption keys for the certificate to be requested - if (f_generate_key_pair_nistp256(p_private_enc_key, public_enc_key_x, public_enc_key_y, p_publicEncKeyCompressed, p_compressedMode) == false) { - return false; - } - if (p_compressedMode == 0) { - v_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_0(p_publicEncKeyCompressed); + var template (value) EccP256CurvePoint v_eccP256_curve_point; + var template (value) EccP256CurvePoint v_enc_eccP256_curve_point; + var HashAlgorithm v_hashId; + + // Calculate the whole certificate SHA + v_enc_value := encvalue(p_ec_certificate); + if (ischosen(p_ec_certificate.issuer.sha256AndDigest)) { + v_ec_hash := f_hashWithSha256(bit2oct(v_enc_value)); + v_ec_hashed_id8 := f_HashedId8FromSha256(v_ec_hash); } else { - v_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_1(p_publicEncKeyCompressed); + v_ec_hash := f_hashWithSha384(bit2oct(v_enc_value)); + v_ec_hashed_id8 := f_HashedId8FromSha384(v_ec_hash); } + log("v_ec_hash= ", v_ec_hash); // Generate 32 octets length secret key v_hmac_key := f_hashWithSha256(int2oct(f_getCurrentTime(), 12)); - log("v_hmac_key=", v_hmac_key); + log("v_hmac_key= ", v_hmac_key); - // Generate tag based on the concatenation of ??? - if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey)) { - if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256)) { - if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256.compressed_y_0)) { - v_message_to_tag := '02'O & p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256.compressed_y_0; - } else { - v_message_to_tag := '03'O & p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256.compressed_y_1; - } - } else { - // TODO - /* if (ischosen(p_ec_certificate.verifyKeyIndicator.ecdsaBrainpoolP256.compressed_y_0)) { */ - /* v_message_to_tag := '02'O & p_ec_certificate.verifyKeyIndicator.ecdsaBrainpoolP256.compressed_y_0; */ - /* } else { */ - /* v_message_to_tag := '03'O & p_ec_certificate.verifyKeyIndicator.ecdsaBrainpoolP256.compressed_y_1; */ - /* } */ - } - } else { - return false; - } - if (p_compressedMode == 0) { - v_message_to_tag := v_message_to_tag & '02'O & p_publicEncKeyCompressed; - } else { - v_message_to_tag := v_message_to_tag & '03'O & p_publicEncKeyCompressed; - } - log("v_message_to_tag=", v_message_to_tag); + // Generate tag based on the concatenation of verification keys & encryption keys + v_message_to_tag := p_public_key_x & p_public_key_y & p_public_enc_key_x & p_public_enc_key_y; + log("v_message_to_tag= ", v_message_to_tag); // FIXME encryption keys could be optional v_key_tag := fx_hmac_sha256(v_hmac_key, v_message_to_tag); // TODO Rename and use a wrapper function - log("v_key_tag=", v_key_tag); + log("v_key_tag= ", v_key_tag); // Build the SharedAtRequest - p_inner_at_request.publicKeys := valueof( - m_publicKeys( - m_publicVerificationKey_ecdsaNistP256( - p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256 - ), - m_encryptionKey( - -, - m_publicEncryptionKey_ecdsaNistP256(v_eccP256_curve_point) - ) - ) - ); - p_inner_at_request.hmacKey := v_hmac_key; - p_inner_at_request.sharedAtRequest := valueof( - m_shared_at_request( - p_eaHashedId8, - v_key_tag, - valueof( - m_certificate_subject_attributes( // FIXME Review subjectPermissions - p_ec_certificate.toBeSigned.appPermissions, - { { subjectPermissions := { all_ := NULL }, minChainLength := 1, chainLengthRange := 0, eeType := '00000000'B } }, - p_ec_certificate.toBeSigned.id, - p_ec_certificate.toBeSigned.validityPeriod, - p_ec_certificate.toBeSigned.region, - p_ec_certificate.toBeSigned.assuranceLevel - )))); + p_inner_at_request.sharedAtRequest := valueof( + m_shared_at_request( + p_ea_hashed_id8, // eaId identifies the EA certificate shared with EA entity + substr(v_key_tag, 0, 16), // Calculated keyTag + valueof( + m_certificate_subject_attributes( // FIXME Review subjectPermissions + p_ec_certificate.toBeSigned.appPermissions, + { { subjectPermissions := { all_ := NULL }, minChainLength := 1, chainLengthRange := 0, eeType := '00000000'B } }, + p_ec_certificate.toBeSigned.id, + p_ec_certificate.toBeSigned.validityPeriod, + p_ec_certificate.toBeSigned.region, + p_ec_certificate.toBeSigned.assuranceLevel + ))) // Desired attributes + ); + // Calculate the hash of the SharedAtRequest v_hash_shared_at_request := f_hashWithSha256(bit2oct(encvalue(p_inner_at_request.sharedAtRequest))); - log("v_hash_shared_at_request=", v_hash_shared_at_request); - // Build the ToBeSigned payload + log("v_hash_shared_at_request= ", v_hash_shared_at_request); + + // Build the ETsiTs103097Data-SignedExternalPayload v_tbs := m_toBeSignedData( - m_signedDataPayload_ext(v_hash_shared_at_request), - m_headerInfo_inner_ec_request( + m_signedDataPayload_ext(v_hash_shared_at_request), // Payload containing extDataHash + m_headerInfo_inner_ec_request( // HeaderInfo c_its_aid_SCR, f_getCurrentTimeUtc()) ); - log("v_tbs=", v_tbs); - // Signed ToBeSigned payload - v_whole_certificate_hash := f_hashWithSha256(bit2oct(encvalue(p_ec_certificate))); - log("v_whole_certificate_hash=", v_whole_certificate_hash); - v_tbs_signed := f_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), v_whole_certificate_hash, p_private_key); + log("v_tbs= ", v_tbs); + // Signed ToBeSigned payload using the private key of EC certificate obtained from Enrolment request + v_tbs_signed := f_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); + // In case of ITS-S privacy, v_signed_ec_signature contained the data to be encrypted + if (ischosen(p_ec_certificate.signature_.ecdsaBrainpoolP384r1Signature)) { + v_hashId := sha384; + } else { + v_hashId := sha256; + } v_signed_ec_signature := valueof( m_etsiTs103097Data_signed( m_signedData( - sha256, + v_hashId, v_tbs, - m_signerIdentifier_digest( - f_HashedId8FromSha256( - v_whole_certificate_hash - ) - ), + m_signerIdentifier_digest(v_ec_hashed_id8), // Signer is thehasheId8 of the EC certificate obtained from Enrolment request m_signature_ecdsaNistP256( m_ecdsaP256Signature( m_eccP256CurvePoint_x_only( @@ -766,8 +803,9 @@ module LibItsPki_Functions { ) ) ); - // Encrypt EcSignature with EA certificate - if (p_itss_privacy) { + log("v_signed_ec_signature= ", v_signed_ec_signature); + + if (PICS_ITS_S_WITH_PRIVACY) { // Build EtsiTs102097Data-Encrypted structure var octetstring v_public_enc_key; var integer v_compressed_mode; var Oct12 v_nonce; @@ -778,7 +816,8 @@ module LibItsPki_Functions { var octetstring v_publicEphemeralKeyCompressed; var integer v_ephemeralKeyModeCompressed; var octetstring v_enc_signed_ec_signature; - + + // Use EA certificate for the encryption if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0)) { v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0; v_compressed_mode := 0; @@ -788,9 +827,9 @@ module LibItsPki_Functions { } else { return false; } - v_enc_signed_ec_signature := f_encryptWithEciesNistp256WithSha256(bit2oct(encvalue(v_signed_ec_signature)), v_public_enc_key, v_compressed_mode, ''O, v_publicEphemeralKeyCompressed, v_ephemeralKeyModeCompressed, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce); - v_recipientId := p_eaHashedId8; - log("v_recipientId=", v_recipientId); + v_enc_signed_ec_signature := f_encryptWithEciesNistp256WithSha256(bit2oct(encvalue(v_signed_ec_signature)), v_public_enc_key, v_compressed_mode, ''O, v_publicEphemeralKeyCompressed, v_ephemeralKeyModeCompressed, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); + v_recipientId := p_ea_hashed_id8; // RecipientId is the HashedId8 of the EA certificate + log("v_recipientId= ", v_recipientId); // Fill Certificate template with the public compressed keys (canonical form) if (v_ephemeralKeyModeCompressed == 0) { v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_publicEphemeralKeyCompressed)); @@ -808,13 +847,13 @@ module LibItsPki_Functions { m_encryptedDataEncryptionKey_eciesNistP256( m_evciesP256EncryptedKey( v_eccP256_curve_point, - v_encrypted_sym_key, + v_encrypted_sym_key, v_authentication_vector )))) }, m_SymmetricCiphertext_aes128ccm( m_aesCcmCiphertext( - v_nonce, + v_nonce, v_enc_signed_ec_signature ) ) @@ -822,150 +861,69 @@ module LibItsPki_Functions { ) ) ); - } else { + } else { // Skip the encryption, alowed to be re-identified by the AA p_inner_at_request.ecSignature := valueof(m_ec_signature_ext_payload(v_signed_ec_signature)); } - log("p_inner_at_request=", p_inner_at_request); + // Build the InnerAtRequest, EcSignature field is already set + if (p_compressed_key_mode == 0) { + v_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_0(p_public_key_x); + } else { + v_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_1(p_public_key_x); + } + if (p_compressed_enc_key_mode == 0) { + v_enc_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_0(p_public_enc_key_x); + } else { + v_enc_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_1(p_public_enc_key_x); + } + p_inner_at_request.publicKeys := valueof( // The freshly generated public keys to be used for the requested AT certificate + m_publicKeys( + m_publicVerificationKey_ecdsaNistP256( + v_eccP256_curve_point + ), + m_encryptionKey( // FIXME Encryption keys could be optional + -, + m_publicEncryptionKey_ecdsaNistP256(v_enc_eccP256_curve_point) + ) + ) + ); + p_inner_at_request.hmacKey := v_hmac_key; + log("p_inner_at_request= ", p_inner_at_request); return true; } // End of function f_generate_inner_at_request function f_generate_inner_at_response( - in Certificate p_ec_certificate, - in octetstring p_private_key, - in HashedId8 p_eaHashedId8, - out octetstring p_private_enc_key, - out octetstring p_publicEncKeyX, - out octetstring p_publicEncKeyY, - out octetstring p_publicEncKeyCompressed, - out integer p_compressedMode, - out InnerAtRequest p_inner_at_request, - out Ieee1609Dot2Data p_inner_at_request_data + in octetstring p_authorization_request_hash, + in EtsiTs103097Certificate p_certificate, + out InnerAtResponse p_authorization_response ) return boolean { // Local variables - return false; - } // End of function f_generate_inner_at_response - - } // End of group inner_at_xxx - - group authorization_xxx { - - function f_generate_authorization_request( - in Certificate p_ea_certificate, - in HashedId8 p_ea_certificate_hashed_id8, - out octetstring p_private_key, - out octetstring p_publicKeyCompressed, - out integer p_compressedMode, - out InnerAtRequest p_authorization_request - ) return boolean { - // Local variables - var octetstring v_private_enc_key; - var Oct32 v_publicEncKeyCompressed; - var integer v_compressedMode; - var InnerEcRequest v_inner_ec_request; - var Certificate v_ec_certificate; - var InnerAtRequest v_inner_at_request; - var Ieee1609Dot2Data v_inner_at_request_data; - - if (f_generate_inner_ec_request(p_private_key, p_publicKeyCompressed, p_compressedMode, v_inner_ec_request) == false) { - return false; - } - if (f_generate_ec_certificate(p_private_key, v_inner_ec_request, v_ec_certificate) == false) { - return false; - } - if (f_generate_inner_at_request(v_ec_certificate, p_private_key, p_ea_certificate, p_ea_certificate_hashed_id8, true, v_private_enc_key, v_publicEncKeyCompressed, v_compressedMode, v_inner_at_request, v_inner_at_request_data) == false) { - return false; - } - - p_authorization_request.sharedAtRequest := v_inner_at_request.sharedAtRequest; - p_authorization_request.ecSignature := v_inner_at_request.ecSignature; - - log("f_generate_authorization_request: ", p_authorization_request); - return true; - } // End of function f_generate_authorization_request - - function f_generate_authorization_response( - in octetstring p_authorization_request_hash, - in CertificateSubjectAttributes p_Certificate_subject_attributes, - out InnerAtResponse p_authorization_response - ) return boolean { - // Local variables - - // Build the Proof of Possession InnerAtResponse - /*p_authorization_response := valueof( + // Build the Proof of Possession InnerEcResponse + p_authorization_response := valueof( m_innerAtResponse_ok( - p_authorization_request_hash, - p_Certificate_subject_attributes + substr(p_authorization_request_hash, 0, 16), + p_certificate ) - );*/ + ); return true; - } // End of function f_generate_authorization_response + } // End of function f_generate_inner_at_response + + } // End of group inner_at_xxx + + group authorization_xxx { } // End of group authorization_xxx group authorization_validation_xxx { - function f_generate_authorization_validation_request( - in Certificate p_ea_certificate, - in HashedId8 p_ea_certificate_hashed_id8, - out octetstring p_private_key, - out octetstring p_publicKeyCompressed, - out integer p_compressedMode, - out AuthorizationValidationRequest p_authorization_validation_request - ) return boolean { - // Local variables - var octetstring v_private_enc_key; - var Oct32 v_publicEncKeyCompressed; - var integer v_compressedMode; - var InnerEcRequest v_inner_ec_request; - var Certificate v_ec_certificate; - var InnerAtRequest v_inner_at_request; - var Ieee1609Dot2Data v_inner_at_request_data; - - if (f_generate_inner_ec_request(p_private_key, p_publicKeyCompressed, p_compressedMode, v_inner_ec_request) == false) { - return false; - } - if (f_generate_ec_certificate(p_private_key, v_inner_ec_request, v_ec_certificate) == false) { - return false; - } - if (f_generate_inner_at_request(v_ec_certificate, p_private_key, p_ea_certificate, p_ea_certificate_hashed_id8, true, v_private_enc_key, v_publicEncKeyCompressed, v_compressedMode, v_inner_at_request, v_inner_at_request_data) == false) { - return false; - } - - p_authorization_validation_request.sharedAtRequest := v_inner_at_request.sharedAtRequest; - p_authorization_validation_request.ecSignature := v_inner_at_request.ecSignature; - - log("f_generate_authorization_validation_request: ", p_authorization_validation_request); - - return true; - } // End of function f_generate_authorization_validation_request - - function f_generate_authorization_validation_response( - in octetstring p_authorization_validation_request_hash, - in CertificateSubjectAttributes p_Certificate_subject_attributes, - out AuthorizationValidationResponse p_authorization_validation_response - ) return boolean { - // Local variables - - // Build the Proof of Possession InnerEcResponse - p_authorization_validation_response := valueof( - m_authorizationValidationResponse_ok( - substr(p_authorization_validation_request_hash, 0, 16), - p_Certificate_subject_attributes - ) - ); - - return true; - } // End of function f_generate_authorization_validation_response - } // End of group authorization_validation_xxx group pki_functions { /** - * @desc Build a signed and encrypted PKI message + * @desc Build a signed and encrypted PKI request message * @param p_private_key Private key for signature * @param p_signer_identifier Signer identifier for signature, could be self or certificate HashedId8 * @param p_recipientId Recipient identifier to be inclued in encrypted layer. @@ -976,21 +934,21 @@ module LibItsPki_Functions { * @param p_ieee1609dot2_signed_and_encrypted_data The secured message * @return true on success, false otherwise */ - function f_build_pki_secured_message( - in octetstring p_private_key, - in SignerIdentifier p_signer_identifier, - in HashedId8 p_recipientId, - in octetstring p_publicKeyCompressed, - in integer p_compressedMode, - in octetstring p_salt, - in octetstring p_pki_message, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce, - out Oct32 p_request_hash - ) return boolean { + function f_build_pki_secured_request_message( + in octetstring p_private_key, + in SignerIdentifier p_signer_identifier, + in HashedId8 p_recipientId, + in octetstring p_publicKeyCompressed, + in integer p_compressedMode, + in octetstring p_salt, + in octetstring p_pki_message, + out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, + out Oct16 p_aes_sym_key, + out Oct16 p_encrypted_sym_key, + out Oct16 p_authentication_vector, + out Oct12 p_nonce, + out Oct32 p_request_hash + ) return boolean { // Local variables var template (value) EccP256CurvePoint v_eccP256_curve_point; var template (value) ToBeSignedData v_tbs; @@ -1037,27 +995,29 @@ module LibItsPki_Functions { // Encode EtsiTs103097Data-Signed data structure v_encoded_inner_ec_request := bit2oct(encvalue(v_ieee1609dot2_signed_data)); // Calculate the SHA256 of v_encoded_inner_ec_request - p_request_hash := f_hashWithSha256(v_encoded_inner_ec_request); - log("p_request_hash= ", p_request_hash); + if (PICS_SEC_FIXED_KEYS) { + p_request_hash := '10ED97A2F2933DD3AC55F47022D125E18F5E1AA024613E616A75BA4979EFE318'O; + } else { + p_request_hash := f_hashWithSha256(v_encoded_inner_ec_request); + log("p_request_hash= ", p_request_hash); + } // Encrypt encode EtsiTs103097Data-Signed data structure if (PICS_SEC_FIXED_KEYS) { - p_publicKeyCompressed := '8C5E20FE31935F6FA682A1F6D46E4468534FFEA1A698B14B0B12513EED8DEB11'O; - p_compressedMode := 0; - p_salt := '9169155B08B07674CBADF75FB46A7B0D'O; + p_salt := '77C0637C3558B3238FDE1EEC376DA080BE4076FB8491CA0F8C19FD34DF298CEB'O; } v_encrypted_inner_ec_request := f_encryptWithEciesNistp256WithSha256(v_encoded_inner_ec_request, p_publicKeyCompressed, p_compressedMode, p_salt, v_publicEphemeralKeyCompressed, v_ephemeralKeyModeCompressed, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, PICS_SEC_FIXED_KEYS); - log("p_aes_sym_key=", p_aes_sym_key); - log("p_encrypted_sym_key=", p_encrypted_sym_key); - log("p_authentication_vector=", p_authentication_vector); - log("p_nonce=", p_nonce); - log("p_recipientId=", p_recipientId); + log("p_aes_sym_key= ", p_aes_sym_key); + log("p_encrypted_sym_key= ", p_encrypted_sym_key); + log("p_authentication_vector= ", p_authentication_vector); + log("p_nonce= ", p_nonce); + log("p_recipientId= ", p_recipientId); if (p_recipientId == int2oct(0, 8)) { - log("f_hashWithSha256(v_encrypted_sym_key)=", f_hashWithSha256(p_encrypted_sym_key)); + log("f_hashWithSha256(v_encrypted_sym_key)= ", f_hashWithSha256(p_encrypted_sym_key)); v_recipientId := f_HashedId8FromSha256(f_hashWithSha256(p_encrypted_sym_key)); } else { v_recipientId := p_recipientId; } - log("v_recipientId=", v_recipientId); + log("v_recipientId= ", v_recipientId); // Fill Certificate template with the public compressed keys (canonical form) if (v_ephemeralKeyModeCompressed == 0) { v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_publicEphemeralKeyCompressed)); @@ -1089,7 +1049,94 @@ module LibItsPki_Functions { ); return true; - } // End of function f_build_pki_secured_message + } // End of function f_build_pki_secured_request_message + + /** + * @desc Build a signed and encrypted PKI response message + * @param p_private_key Private key for signature + * @param p_signer_identifier Signer identifier for signature, could be self or certificate HashedId8 + * @param p_recipientId Recipient identifier to be inclued in encrypted layer. + * If value is int2oct(0. 8), the recipient id is the HashedId8 of the symmetric key used by the sender to encrypt the message to which the response is built + * @param p_publicKeyCompressed The public compressed key (canonical form) for encryption + * @param p_compressedMode The compressed mode of the public compressed key (canonical form) for encryption + * @param p_pki_message The PKI message to be secured + * @param p_ieee1609dot2_signed_and_encrypted_data The secured message + * @return true on success, false otherwise + */ + function f_build_pki_secured_response_message( + in octetstring p_private_key, + in SignerIdentifier p_signer_identifier, + in octetstring p_pki_message, + in Oct16 p_aes_sym_key, + in Oct12 p_nonce, + out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data + ) return boolean { + // Local variables + var template (value) ToBeSignedData v_tbs; + var octetstring v_tbs_signed; + var template (value) Ieee1609Dot2Data v_ieee1609dot2_signed_data; + var octetstring v_encoded_inner_ec_response; + var HashedId8 v_recipientId; + var octetstring v_encrypted_inner_ec_response; + + // Signed the encoded PKI message + v_tbs := m_toBeSignedData( + m_signedDataPayload( + m_etsiTs103097Data_unsecured(p_pki_message) + ), + m_headerInfo_inner_ec_response(c_its_aid_SCR, f_getCurrentTimeUtc()) + ); + if (ischosen(p_signer_identifier.self_)) { + v_tbs_signed := f_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), int2oct(0, 32), p_private_key); + } else { + var charstring v_certificate_id; + var octetstring v_hash; + fx_readCertificateFromDigest(p_signer_identifier.digest, v_certificate_id); // TODO Add a wrapper function + f_getCertificateHash(v_certificate_id, v_hash); + v_tbs_signed := f_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), v_hash, p_private_key); + } + // Add the signature and create EtsiTs103097Data-Signed data structure + v_ieee1609dot2_signed_data := m_etsiTs103097Data_signed( + m_signedData( + sha256, + v_tbs, + p_signer_identifier, + m_signature_ecdsaNistP256( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only( + substr(v_tbs_signed, 0, 32) + ), + substr(v_tbs_signed, 32, 32) + ) + ) + ) + ); + // Encode EtsiTs103097Data-Signed data structure + v_encoded_inner_ec_response := bit2oct(encvalue(v_ieee1609dot2_signed_data)); + v_encrypted_inner_ec_response := fx_encrypt_aes_128_ccm_test(p_aes_sym_key, p_nonce, v_encoded_inner_ec_response); + v_recipientId := f_HashedId8FromSha256(f_hashWithSha256(p_aes_sym_key)); + log("v_recipientId= ", v_recipientId); + // Fill Certificate template with the public compressed keys (canonical form) + p_ieee1609dot2_signed_and_encrypted_data := valueof( + m_etsiTs103097Data_encrypted( + m_encryptedData( + { + m_recipientInfo_pskRecipInfo( + v_recipientId + ) + }, + m_SymmetricCiphertext_aes128ccm( + m_aesCcmCiphertext( + p_nonce, + v_encrypted_inner_ec_response + ) + ) + ) + ) + ); + + return true; + } // End of function f_build_pki_secured_response_message /** * @desc Verify the protocol element of the Pki message. @@ -1125,9 +1172,9 @@ module LibItsPki_Functions { var boolean v_ret; log(">>> f_verify_pki_message: p_private_enc_key= ", p_private_enc_key); - log(">>> f_verify_pki_message: p_aes_sym_key=", p_aes_sym_key); - log(">>> f_verify_pki_message: p_authentication_vector=", p_authentication_vector); - log(">>> f_verify_pki_message: p_issuer=", p_issuer); + log(">>> f_verify_pki_message: p_aes_sym_key= ", p_aes_sym_key); + log(">>> f_verify_pki_message: p_authentication_vector= ", p_authentication_vector); + log(">>> f_verify_pki_message: p_issuer= ", p_issuer); // TODO Check p_ieee1609dot2_encrypted_and_signed_data.content.encryptedData.recipients[0].pskRecipInfo. See IEEE Std 1609.2-2017 Clause 6.3.34 PreSharedKeyRecipientInfo @@ -1262,30 +1309,32 @@ module LibItsPki_Functions { out octetstring p_public_enc_key, out integer p_compressed_enc_key_mode ) return boolean { + log(">>> f_extract_enc_key: ", p_certificate); + if (ischosen(p_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256)) { if (ischosen(p_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0)) { - p_public_enc_key := p_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0; - p_compressed_enc_key_mode := 0; + p_public_enc_key := p_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0; + p_compressed_enc_key_mode := 0; } else if (ischosen(p_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_1)) { - p_public_enc_key := p_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_1; - p_compressed_enc_key_mode := 1; + p_public_enc_key := p_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_1; + p_compressed_enc_key_mode := 1; } else { - log("f_extract_enc_key: Non canonical EA certificate"); + log("f_extract_enc_key: Non canonical certificate: ", p_certificate); return false; } } else if (ischosen(p_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1)) { if (ischosen(p_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0)) { - p_public_enc_key := p_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0; - p_compressed_enc_key_mode := 0; + p_public_enc_key := p_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0; + p_compressed_enc_key_mode := 0; } else if (ischosen(p_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_1)) { p_public_enc_key := p_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_1; p_compressed_enc_key_mode := 0; } else { - log("f_extract_enc_key: Non canonical EA certificate"); + log("f_extract_enc_key: Non canonical certificate: ", p_certificate); return false; } } else { - log("f_extract_enc_key: Invalid EA certificate"); + log("f_extract_enc_key: Invalid certificate: ", p_certificate); return false; } diff --git a/ttcn/Pki/LibItsPki_Pics.ttcn b/ttcn/Pki/LibItsPki_Pics.ttcn index 97492c2c..0abd5c9b 100644 --- a/ttcn/Pki/LibItsPki_Pics.ttcn +++ b/ttcn/Pki/LibItsPki_Pics.ttcn @@ -48,13 +48,18 @@ module LibItsPki_Pics { /** * @desc Certificate used by the Test System acting as AA */ - modulepar charstring PICS_TS_AA_CERTIFICATE_ID := "CERT_TS_A_EA"; + modulepar charstring PICS_TS_AA_CERTIFICATE_ID := "CERT_AA"; /** * @desc Certificate used by the Test System */ - modulepar charstring PICS_HTTP_GET_URI := "/its/inner_ec_request"; - + modulepar charstring PICS_HTTP_POST_URI := "/its/inner_ec_request"; + + /** + * @desc ITS-S with privacy + */ + modulepar boolean PICS_ITS_S_WITH_PRIVACY := true; + /** * @desc Factory private key for verification Nist P256 */ diff --git a/ttcn/Pki/LibItsPki_Pixits.ttcn b/ttcn/Pki/LibItsPki_Pixits.ttcn index 5cc81596..5ea567c3 100644 --- a/ttcn/Pki/LibItsPki_Pixits.ttcn +++ b/ttcn/Pki/LibItsPki_Pixits.ttcn @@ -1,5 +1,18 @@ module LibItsPki_Pixits { - + + /** + * @desc Is the first enrolment? + */ modulepar boolean PX_FIRST_ENROLMENT := true; + /** + * @desc Do the encryption keys be included in Authorization Request? + */ + modulepar boolean PX_INCLUDE_ENCRYPTION_KEYS := true; + + /** + * @desc Do the Authorization Request use SignedWithPop mechanism? + */ + modulepar boolean PX_AUTHORIZATION_REQUEST_WITH_POP := true; + } // End of module LibItsPki_Pixits diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn index 64b342ce..4e2bf934 100644 --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ b/ttcn/Pki/LibItsPki_Templates.ttcn @@ -55,23 +55,23 @@ module LibItsPki_Templates { } } // End of template m_etsiTs102941Data_inner_ec_response - template (value) EtsiTs102941Data m_etsiTs102941Data_inner_at_request( - in template (value) InnerAtRequest p_inner_at_request - ) := { + template (value) EtsiTs102941Data m_etsiTs102941Data_authorization_request( + in template (value) InnerAtRequest p_inner_at_request + ) := { version := PkiProtocolVersion, content := { authorizationRequest := p_inner_at_request } - } // End of template m_etsiTs102941Data_inner_at_request + } // End of template m_etsiTs102941Data_authorization_request - template (value) EtsiTs102941Data m_etsiTs102941Data_inner_at_response( - in template (value) InnerAtResponse p_inner_at_response - ) := { + template (value) EtsiTs102941Data m_etsiTs102941Data_authorization_response( + in template (value) InnerAtResponse p_inner_at_response + ) := { version := PkiProtocolVersion, content := { authorizationResponse := p_inner_at_response } - } // End of template m_etsiTs102941Data_inner_at_response + } // End of template m_etsiTs102941Data_authorization_response template (value) EtsiTs102941Data m_etsiTs102941Data_authorization_validation_request( in template (value) AuthorizationValidationRequest p_authorization_validation_request diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index c8a44ade..3770639c 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -67,14 +67,16 @@ module LibItsPki_TestSystem { type component ItsPkiHttp extends ItsSecurityBaseComponent, HttpComponent { var Certificate vc_eaCertificate; /** Test Adapter EA certificate */ var octetstring vc_eaPrivateKey; /** Test Adapter EA private key for signature */ - var Certificate vc_ecCertificate; /** Test Adapter EC certificate */ - var octetstring vc_ecPrivateKey; /** Test Adapter EC private key for signature */ + // var Certificate vc_ecCertificate; /** Test Adapter AA certificate */ + // var octetstring vc_ecPrivateKey; /** Test Adapter AA private key for signature */ var octetstring vc_eaPrivateEncKey; /** Test Adapter EA private key for encryption */ var HashedId8 vc_eaHashedId8; /** Test Adapter EA HashedId8 for decryption of IUT's response */ var octetstring vc_eaWholeHash; /** TS EA whole-hash for signature check */ - var HashedId8 vc_ecHashedId8; /** Test Adapter EC HashedId8 for decryption of IUT's response */ - var Certificate vc_peerEaCertificate; /** IUT EA certificate for signature check */ - var octetstring vc_eaPeerWholeHash; /** IUT EA whole-hash for signature check */ + var HashedId8 vc_aaHashedId8; /** Test Adapter AA HashedId8 for decryption of IUT's response */ + var octetstring vc_aaWholeHash; /** TS AA whole-hash for signature check */ + // var HashedId8 vc_ecHashedId8; /** Test Adapter AA HashedId8 for decryption of IUT's response */ + // var Certificate vc_peerEaCertificate; /** IUT EA certificate for signature check */ + // var octetstring vc_eaPeerWholeHash; /** IUT EA whole-hash for signature check */ } // End of component ItsPki /** diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 1110a43a..ac9d3def 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -608,11 +608,11 @@ module LibItsSecurity_Functions { out Oct32 p_publicKeyCompressed, out integer p_compressedMode ) return boolean { - if (PICS_SEC_FIXED_KEYS) { - p_privateKey := 'D418760F0CB2DCB856BC3C7217AD3AA36DB6742AE1DB655A3D28DF88CBBF84E1'O; - p_publicKeyX := 'EE9CC7FBD9EDECEA41F7C8BD258E8D2E988E75BD069ADDCA1E5A38E534AC6818'O; - p_publicKeyY := '5AE3C8D9FE0B1FC7438F29417C240F8BF81C358EC1A4D0C6E98D8EDBCC714017'O; - p_publicKeyCompressed := 'EE9CC7FBD9EDECEA41F7C8BD258E8D2E988E75BD069ADDCA1E5A38E534AC6818'O; + if (PICS_SEC_FIXED_KEYS) { // Debug mode: Use fixed values + p_privateKey := '43481BC44C073C1432DB6EC4F0EF57062BEA08E4C19F811567325AD1FD1C6577'O; + p_publicKeyX := '0B5D74B033531C51D17B4F218DD4E39289AE4BF2EE3D7BAB7C07DAF0C14F0317'O; + p_publicKeyY := '5D49B139A9237832FDE24D77555878CE65D6C2284A1BDA4CE08ABDD4071E0255'O; + p_publicKeyCompressed := '0B5D74B033531C51D17B4F218DD4E39289AE4BF2EE3D7BAB7C07DAF0C14F0317'O; p_compressedMode := 1; return true; diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index 17ec2182..eb34d1ae 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -1015,6 +1015,11 @@ module LibItsSecurity_Templates { in template (value) Time64 p_generationTime ) modifies m_headerInfo_gn := {}; + template (omit) HeaderInfo m_headerInfo_inner_ec_response( + in template (value) Psid p_psid := c_its_aid_GN, + in template (value) Time64 p_generationTime + ) modifies m_headerInfo_gn := {}; + } // End of group headerFields group signatures { -- GitLab From b1e9bdd7e3007035abfa808cf21ea00c772aa127 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 20 Dec 2018 06:58:03 +0000 Subject: [PATCH 165/320] Rename variables & parameters --- ttcn/CAM/LibItsCam_Functions.ttcn | 10 +- ttcn/Common/LibItsCommon_Templates.ttcn | 4 +- ttcn/DENM/LibItsDenm_Functions.ttcn | 10 +- ttcn/Http/LibItsHttp_Functions.ttcn | 4 +- ttcn/IVIM/LibItsIvim_Functions.ttcn | 10 +- .../LibItsMapemSpatem_Functions.ttcn | 10 +- ttcn/Pki/LibItsPki_Functions.ttcn | 203 ++++++++++++------ ttcn/Security/LibItsSecurity_Functions.ttcn | 122 +++++------ ttcn/SremSsem/LibItsSremSsem_Functions.ttcn | 10 +- 9 files changed, 229 insertions(+), 154 deletions(-) diff --git a/ttcn/CAM/LibItsCam_Functions.ttcn b/ttcn/CAM/LibItsCam_Functions.ttcn index d7f53a5d..1ab3b4b6 100644 --- a/ttcn/CAM/LibItsCam_Functions.ttcn +++ b/ttcn/CAM/LibItsCam_Functions.ttcn @@ -136,12 +136,12 @@ module LibItsCam_Functions { * @desc Initialise secure mode if required */ function f_initialiseSecuredMode( - in charstring p_certificateId := PX_CERT_FOR_TS + in charstring p_certificate_id := PX_CERT_FOR_TS ) runs on ItsCam { if (PICS_IS_IUT_SECURED == true) { - if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificateId))) { + if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificate_id))) { log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); stop; } @@ -293,10 +293,10 @@ module LibItsCam_Functions { /** * @desc Setups default configuration - * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT + * @param p_certificate_id The certificate identifier the TA shall use in case of secured IUT */ function f_cfUp( - in charstring p_certificateId := PX_CERT_FOR_TS + in charstring p_certificate_id := PX_CERT_FOR_TS ) runs on ItsCam /* TITAN TODO: system ItsCamSystem */ { map(self:utPort, system:utPort); @@ -305,7 +305,7 @@ module LibItsCam_Functions { f_connect4SelfOrClientSync(); // Initialise secured mode - f_initialiseSecuredMode(p_certificateId); + f_initialiseSecuredMode(p_certificate_id); } // End of function f_cfUp diff --git a/ttcn/Common/LibItsCommon_Templates.ttcn b/ttcn/Common/LibItsCommon_Templates.ttcn index f172b4ed..9fee09f7 100644 --- a/ttcn/Common/LibItsCommon_Templates.ttcn +++ b/ttcn/Common/LibItsCommon_Templates.ttcn @@ -26,11 +26,11 @@ module LibItsCommon_Templates { * @desc Enable security support */ template (value) AcSecPrimitive m_acEnableSecurity( - in charstring p_certificateId, + in charstring p_certificate_id, in boolean p_enforceSecurity := false ) := { acEnableSecurity := { - certificateId := p_certificateId, + certificateId := p_certificate_id, enforceSecurity := p_enforceSecurity } } // End of template m_acEnableSecurity diff --git a/ttcn/DENM/LibItsDenm_Functions.ttcn b/ttcn/DENM/LibItsDenm_Functions.ttcn index 9d0a5ac2..1483f25b 100644 --- a/ttcn/DENM/LibItsDenm_Functions.ttcn +++ b/ttcn/DENM/LibItsDenm_Functions.ttcn @@ -237,12 +237,12 @@ module LibItsDenm_Functions { * @desc Initialise secure mode if required */ function f_initialiseSecuredMode( - in charstring p_certificateId := PX_CERT_FOR_TS + in charstring p_certificate_id := PX_CERT_FOR_TS ) runs on ItsDenm { if (PICS_IS_IUT_SECURED == true) { - if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificateId))) { + if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificate_id))) { log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); stop; } @@ -382,10 +382,10 @@ module LibItsDenm_Functions { /** * @desc Setups default configuration - * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT + * @param p_certificate_id The certificate identifier the TA shall use in case of secured IUT */ function f_cfUp( - in charstring p_certificateId := PX_CERT_FOR_TS + in charstring p_certificate_id := PX_CERT_FOR_TS ) runs on ItsDenm /* TITAN TODO: system ItsDenmSystem */ { map(self:acPort, system:acPort); @@ -394,7 +394,7 @@ module LibItsDenm_Functions { f_connect4SelfOrClientSync(); // Initialise secured mode - f_initialiseSecuredMode(p_certificateId); + f_initialiseSecuredMode(p_certificate_id); } // End of function f_cfUp diff --git a/ttcn/Http/LibItsHttp_Functions.ttcn b/ttcn/Http/LibItsHttp_Functions.ttcn index 385b3ff8..cb138f54 100644 --- a/ttcn/Http/LibItsHttp_Functions.ttcn +++ b/ttcn/Http/LibItsHttp_Functions.ttcn @@ -14,10 +14,10 @@ module LibItsHttp_Functions { /** * @desc Setups default configuration - * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT + * @param p_certificate_id The certificate identifier the TA shall use in case of secured IUT */ function f_cfUp( - in charstring p_certificateId + in charstring p_certificate_id ) runs on HttpComponent /* TITAN TODO: system HttpTestAdapter */ { map(self:httpPort, system:httpPort); diff --git a/ttcn/IVIM/LibItsIvim_Functions.ttcn b/ttcn/IVIM/LibItsIvim_Functions.ttcn index 46e8af2c..af933c60 100644 --- a/ttcn/IVIM/LibItsIvim_Functions.ttcn +++ b/ttcn/IVIM/LibItsIvim_Functions.ttcn @@ -187,12 +187,12 @@ module LibItsIvim_Functions { * @desc Initialise secure mode if required */ function f_initialiseSecuredMode( - in charstring p_certificateId := PX_CERT_FOR_TS + in charstring p_certificate_id := PX_CERT_FOR_TS ) runs on ItsIvim { if (PICS_IS_IUT_SECURED == true) { - if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificateId))) { + if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificate_id))) { log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); stop; } @@ -242,10 +242,10 @@ module LibItsIvim_Functions { /** * @desc Setups default configuration - * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT + * @param p_certificate_id The certificate identifier the TA shall use in case of secured IUT */ function f_cfUp( - in charstring p_certificateId := PX_CERT_FOR_TS + in charstring p_certificate_id := PX_CERT_FOR_TS ) runs on ItsIvim /* TITAN TODO: system ItsIvimSystem */{ map(self:acPort, system:acPort); @@ -254,7 +254,7 @@ module LibItsIvim_Functions { f_connect4SelfOrClientSync(); // Initialise secured mode - f_initialiseSecuredMode(p_certificateId); + f_initialiseSecuredMode(p_certificate_id); } // End of function f_cfUp diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn index ef637f7e..5db1144e 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn @@ -97,12 +97,12 @@ module LibItsMapemSpatem_Functions { * @desc Initialise secure mode if required */ function f_initialiseSecuredMode( - in charstring p_certificateId := PX_CERT_FOR_TS + in charstring p_certificate_id := PX_CERT_FOR_TS ) runs on ItsMapemSpatem { if (PICS_IS_IUT_SECURED == true) { - if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificateId))) { + if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificate_id))) { log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); stop; } @@ -220,10 +220,10 @@ module LibItsMapemSpatem_Functions { /** * @desc Setups default configuration - * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT + * @param p_certificate_id The certificate identifier the TA shall use in case of secured IUT */ function f_cfUp( - in charstring p_certificateId := PX_CERT_FOR_TS + in charstring p_certificate_id := PX_CERT_FOR_TS ) runs on ItsMapemSpatem /* TITAN TODO: system ItsMapemSpatemSystem */ { map(self:acPort, system:acPort); @@ -235,7 +235,7 @@ module LibItsMapemSpatem_Functions { activate(a_cf01Down()); // Initialise secured mode - f_initialiseSecuredMode(p_certificateId); + f_initialiseSecuredMode(p_certificate_id); } // End of f_cfUp diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index c3adc48d..379dd8b8 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -50,6 +50,8 @@ module LibItsPki_Functions { // LibItsHttp import from LibItsHttp_TypesAndValues all; import from LibItsHttp_Templates all; + import from LibItsHttp_BinaryTemplates all; + import from LibItsHttp_Functions all; import from LibItsHttp_TestSystem all; // LibItsPki @@ -63,7 +65,7 @@ module LibItsPki_Functions { /** * @desc Setups default configuration - * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT + * @param p_certificate_id The certificate identifier the TA shall use in case of secured IUT */ function f_cfHttpUp( in charstring p_ea_certificate_id := "CERT_TS_A_EA", // TODO Use a constant @@ -97,7 +99,7 @@ module LibItsPki_Functions { } // End of function f_cfHttpUp function f_cfUp_itss( - in charstring p_certificateId := "CERT_TS_A_EA" // TODO Use a constant + in charstring p_certificate_id := "CERT_TS_A_EA" // TODO Use a constant ) runs on ItsPkiItss /* TITAN TODO: system ItsPkiItssSystem */ { map(self:geoNetworkingPort, system:geoNetworkingPort); @@ -132,7 +134,7 @@ module LibItsPki_Functions { * @desc Initialise secure mode if required */ function f_initialiseSecuredMode( - in charstring p_certificateId := "CERT_TS_A_EA", // TODO Use a constant + in charstring p_certificate_id := "CERT_TS_A_EA", // TODO Use a constant in charstring p_peerCertificateId := "CERT_IUT_A_EA" ) runs on ItsSecurityBaseComponent { // Local variables @@ -144,7 +146,7 @@ module LibItsPki_Functions { stop; } - // f_prepareCertificates(p_certificateId, vc_aaCertificate, vc_atCertificate); + // f_prepareCertificates(p_certificate_id, vc_aaCertificate, vc_atCertificate); } // End of function f_initialiseSecuredMode() function f_uninitialiseSecuredMode() runs on ItsSecurityBaseComponent { @@ -190,22 +192,22 @@ module LibItsPki_Functions { } // End of function f_utInitializeIut function f_sendUtTriggerPrimitive( - in charstring p_cannonicalId, - in Oct1 p_encAlgorithm, + in charstring p_canonical_id, + in Oct1 p_enc_algorithm, in octetstring p_private_key, - in octetstring p_publicKeyCompressed, - in integer p_compressedMode + in octetstring p_public_key_compressed, + in integer p_compressed_mode ) runs on ItsPkiItss { var TriggerEnrolmentRequest v_ut_trigger_enrolment_request; var octetstring v_compressed_public_key; - if (p_compressedMode == 2) { // TODO v_compressed_public_key := int2oct(p_compressedMode, 1) & p_publicKeyCompressed? - v_compressed_public_key := '02'O & p_publicKeyCompressed; + if (p_compressed_mode == 2) { // TODO v_compressed_public_key := int2oct(p_compressed_mode, 1) & p_public_key_compressed? + v_compressed_public_key := '02'O & p_public_key_compressed; } else { - v_compressed_public_key := '03'O & p_publicKeyCompressed; + v_compressed_public_key := '03'O & p_public_key_compressed; } - v_ut_trigger_enrolment_request := { p_cannonicalId, p_encAlgorithm, p_private_key, v_compressed_public_key }; + v_ut_trigger_enrolment_request := { p_canonical_id, p_enc_algorithm, p_private_key, v_compressed_public_key }; utPort.send(UtPkiTrigger: { triggerEnrolmentRequest := v_ut_trigger_enrolment_request }); tc_ac.start; alt { @@ -226,12 +228,12 @@ module LibItsPki_Functions { } // End of group ut_port - group http { // TODO Split into EinnerEc, Authorization & AuthorizationValidation + group http { // TODO Split into EnnerEc, Authorization & AuthorizationValidation function f_http_build_inner_ec_request( // TODO Cleanup parameters out octetstring p_private_key, - out octetstring p_publicKeyCompressed, - out integer p_compressedMode, + out octetstring p_public_key_compressed, + out integer p_compressed_mode, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, @@ -246,7 +248,7 @@ module LibItsPki_Functions { var integer v_compressed_enc_key_mode; var boolean v_ret_code; - if (f_generate_inner_ec_request(p_private_key, p_publicKeyCompressed, p_compressedMode, v_inner_ec_request) == false) { + if (f_generate_inner_ec_request(p_private_key, p_public_key_compressed, p_compressed_mode, v_inner_ec_request) == false) { log("*** f_http_build_inner_ec_request: ERROR: Failed to generate InnerEcRequest ***"); f_selfOrClientSyncAndVerdict("error", e_error); } @@ -289,8 +291,8 @@ module LibItsPki_Functions { function f_http_build_invalid_enrolment_request( out octetstring p_private_key, - out octetstring p_publicKeyCompressed, - out integer p_compressedMode, + out octetstring p_public_key_compressed, + out integer p_compressed_mode, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, @@ -305,7 +307,7 @@ module LibItsPki_Functions { var integer v_compressed_enc_key_mode; var boolean v_ret_code; - if (f_generate_inner_ec_request(p_private_key, p_publicKeyCompressed, p_compressedMode, v_inner_ec_request) == false) { + if (f_generate_inner_ec_request(p_private_key, p_public_key_compressed, p_compressed_mode, v_inner_ec_request) == false) { log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequest ***"); f_selfOrClientSyncAndVerdict("error", e_error); } @@ -351,10 +353,10 @@ module LibItsPki_Functions { in Certificate p_ec_certificate, // Enrolment credentials certificate in octetstring p_ec_private_key, out octetstring p_private_key, - out octetstring p_publicKeyCompressed, - out integer p_compressedMode, + out octetstring p_public_key_compressed, + out integer p_compressed_mode, out octetstring p_private_enc_key, - out octetstring p_publicEncKeyCompressed, + out octetstring p_public_compressed_enc_key, out integer p_compressedEncMode, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, @@ -377,21 +379,21 @@ module LibItsPki_Functions { var bitstring v_authorization_request_msg; // Generate verification keys for the certificate to be requested - if (f_generate_key_pair_nistp256(p_private_key, v_public_key_x, v_public_key_y, p_publicKeyCompressed, p_compressedMode) == false) { + if (f_generate_key_pair_nistp256(p_private_key, v_public_key_x, v_public_key_y, p_public_key_compressed, p_compressed_mode) == false) { log("*** f_http_build_authorization_request: ERROR: Failed to generate verification key ***"); f_selfOrClientSyncAndVerdict("error", e_error); return; } // Generate encryption keys for the certificate to be requested if (PX_INCLUDE_ENCRYPTION_KEYS) { - if (f_generate_key_pair_nistp256(p_private_enc_key, v_public_enc_key_x, v_public_enc_key_y, p_publicEncKeyCompressed, p_compressedEncMode) == false) { + if (f_generate_key_pair_nistp256(p_private_enc_key, v_public_enc_key_x, v_public_enc_key_y, p_public_compressed_enc_key, p_compressedEncMode) == false) { log("*** f_http_build_authorization_request: ERROR: Failed to generate encryption key ***"); f_selfOrClientSyncAndVerdict("error", e_error); return; } } - if (f_generate_inner_at_request(vc_eaCertificate, vc_eaHashedId8, p_ec_certificate, p_ec_private_key, p_private_key, v_public_key_x, v_public_key_y, p_compressedMode, p_private_enc_key, v_public_enc_key_x, v_public_enc_key_y, p_compressedEncMode, v_inner_at_request) == false) { + if (f_generate_inner_at_request(vc_eaCertificate, vc_eaHashedId8, p_ec_certificate, p_ec_private_key, p_private_key, v_public_key_x, v_public_key_y, p_compressed_mode, p_private_enc_key, v_public_enc_key_x, v_public_enc_key_y, p_compressedEncMode, v_inner_at_request) == false) { log("*** f_http_build_authorization_request: ERROR: Failed to generate AuthorizationValidationRequest ***"); f_selfOrClientSyncAndVerdict("error", e_error); return; @@ -426,8 +428,8 @@ module LibItsPki_Functions { function f_http_build_authorization_validation_request( out octetstring p_private_key, - out octetstring p_publicKeyCompressed, - out integer p_compressedMode, + out octetstring p_public_key_compressed, + out integer p_compressed_mode, out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data ) runs on ItsPkiHttp { // Local variables @@ -436,7 +438,7 @@ module LibItsPki_Functions { var octetstring v_public_enc_key; var integer v_compressed_enc_key_mode; - /* TODO if (f_generate_authorization_validation_request(vc_eaCertificate, vc_eaHashedId8, p_private_key, p_publicKeyCompressed, p_compressedMode, v_authorization_validation_request) == false) { + /* TODO if (f_generate_authorization_validation_request(vc_eaCertificate, vc_eaHashedId8, p_private_key, p_public_key_compressed, p_compressed_mode, v_authorization_validation_request) == false) { log("*** f_http_build_authorization_validation_request: ERROR: Failed to generate AuthorizationValidationRequest ***"); f_selfOrClientSyncAndVerdict("error", e_error); }*/ @@ -577,8 +579,8 @@ module LibItsPki_Functions { function f_generate_inner_ec_request( out octetstring p_private_key, - out octetstring p_publicKeyCompressed, - out integer p_compressedMode, + out octetstring p_public_key_compressed, + out integer p_compressed_mode, out InnerEcRequest p_inner_ec_request ) return boolean { // Local variables @@ -588,14 +590,14 @@ module LibItsPki_Functions { log (">>> f_generate_inner_ec_request"); // Generate keys for the certificate to be requested - if (f_generate_key_pair_nistp256(p_private_key, v_publicKeyX, v_publicKeyY, p_publicKeyCompressed, p_compressedMode) == false) { + if (f_generate_key_pair_nistp256(p_private_key, v_publicKeyX, v_publicKeyY, p_public_key_compressed, p_compressed_mode) == false) { log ("f_generate_inner_ec_request: failed to generate keys"); return false; } - if (p_compressedMode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(p_publicKeyCompressed)); + if (p_compressed_mode == 0) { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(p_public_key_compressed)); } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(p_publicKeyCompressed)); + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(p_public_key_compressed)); } log ("f_generate_inner_ec_request: ", v_eccP256_curve_point); // Build the Proof of Possession InnerEcRequest @@ -813,7 +815,7 @@ module LibItsPki_Functions { var Oct16 v_aes_sym_key; var Oct16 v_encrypted_sym_key; var HashedId8 v_recipientId; - var octetstring v_publicEphemeralKeyCompressed; + var octetstring v_public_compressed_ephemeral_key; var integer v_ephemeralKeyModeCompressed; var octetstring v_enc_signed_ec_signature; @@ -827,14 +829,14 @@ module LibItsPki_Functions { } else { return false; } - v_enc_signed_ec_signature := f_encryptWithEciesNistp256WithSha256(bit2oct(encvalue(v_signed_ec_signature)), v_public_enc_key, v_compressed_mode, ''O, v_publicEphemeralKeyCompressed, v_ephemeralKeyModeCompressed, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); + v_enc_signed_ec_signature := f_encryptWithEciesNistp256WithSha256(bit2oct(encvalue(v_signed_ec_signature)), v_public_enc_key, v_compressed_mode, ''O, v_public_compressed_ephemeral_key, v_ephemeralKeyModeCompressed, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); v_recipientId := p_ea_hashed_id8; // RecipientId is the HashedId8 of the EA certificate log("v_recipientId= ", v_recipientId); // Fill Certificate template with the public compressed keys (canonical form) if (v_ephemeralKeyModeCompressed == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_publicEphemeralKeyCompressed)); + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_publicEphemeralKeyCompressed)); + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_compressed_ephemeral_key)); } p_inner_at_request.ecSignature := valueof( m_ec_signature( @@ -912,14 +914,87 @@ module LibItsPki_Functions { } // End of group inner_at_xxx - group authorization_xxx { - - } // End of group authorization_xxx - group authorization_validation_xxx { } // End of group authorization_validation_xxx + group awaiting_messages { + + function f_await_http_inner_ec_request_response( + in Oct32 p_private_key, + in Oct32 p_compressed_public_key, + in integer p_compressed_mode, + out InnerEcResponse p_inner_ec_response + ) runs on ItsPkiHttp return boolean { + var HeaderLines v_headers; + var Oct32 v_request_hash; + var Oct16 v_encrypted_sym_key; + var Oct16 v_aes_sym_key; + var Oct16 v_authentication_vector; + var Oct12 v_nonce; + var octetstring v_salt; + var Ieee1609Dot2Data v_ieee1609dot2_signed_and_encrypted_data; + var EtsiTs102941Data v_etsi_ts_102941_data; + var HttpMessage v_response; + + f_http_build_inner_ec_request(p_private_key, p_compressed_public_key, p_compressed_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, v_salt, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash); + f_init_default_headers_list(-, "inner_ec_request", v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_HTTP_POST_URI, + v_headers, + m_http_message_body_binary( + m_binary_body_ieee1609dot2_data( + v_ieee1609dot2_signed_and_encrypted_data + ))))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_binary( + mw_binary_body_ieee1609dot2_data( + mw_enrolmentResponseMessage( + mw_encryptedData( + -, + mw_SymmetricCiphertext_aes128ccm + ))))))) -> value v_response { + tc_ac.stop; + + if (f_verify_pki_message(p_private_key, v_aes_sym_key, v_authentication_vector, vc_eaWholeHash, vc_eaCertificate, v_response.response.body.binary_body.ieee1609dot2_data, false, v_etsi_ts_102941_data) == false) { + log("f_await_http_inner_ec_request_response: Failed to verify PKI message ***"); + } else { + log("f_await_http_inner_ec_request_response: Receive ", v_etsi_ts_102941_data, " ***"); + log("f_await_http_inner_ec_request_response: match ", match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(substr(v_request_hash, 0, 16), mw_etsiTs103097Certificate(mw_issuerIdentifier_self, mw_toBeSignedCertificate_ea, mw_signature_ecdsaNistP256)))), " ***"); // TODO In TITAN, this is the only way to get the unmatching in log + if (match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(substr(v_request_hash, 0, 16), mw_etsiTs103097Certificate(mw_issuerIdentifier_self, mw_toBeSignedCertificate_ea, mw_signature_ecdsaNistP256))))) { + p_inner_ec_response := v_etsi_ts_102941_data.content.enrolmentResponse; + log("f_await_http_inner_ec_request_response: Well-secured EA certificate received ***"); + log("p_inner_ec_response= ", p_inner_ec_response); + return true; + } else { + log("f_await_http_inner_ec_request_response: Unexpected message received ***"); + } + } + } + [] httpPort.receive( + mw_http_response( + mw_http_response_ko + )) { + tc_ac.stop; + + log("f_await_http_inner_ec_request_response: Unexpected message received ***"); + } + [] tc_ac.timeout { + log("f_await_http_inner_ec_request_response: Expected message not received ***"); + } + } // End of 'alt' statement + + return false; + } // End of function f_await_http_inner_ec_request_response + + } // End of group awaiting_messages + group pki_functions { /** @@ -928,8 +1003,8 @@ module LibItsPki_Functions { * @param p_signer_identifier Signer identifier for signature, could be self or certificate HashedId8 * @param p_recipientId Recipient identifier to be inclued in encrypted layer. * If value is int2oct(0. 8), the recipient id is the HashedId8 of the symmetric key used by the sender to encrypt the message to which the response is built - * @param p_publicKeyCompressed The public compressed key (canonical form) for encryption - * @param p_compressedMode The compressed mode of the public compressed key (canonical form) for encryption + * @param p_public_key_compressed The public compressed key (canonical form) for encryption + * @param p_compressed_mode The compressed mode of the public compressed key (canonical form) for encryption * @param p_pki_message The PKI message to be secured * @param p_ieee1609dot2_signed_and_encrypted_data The secured message * @return true on success, false otherwise @@ -938,8 +1013,8 @@ module LibItsPki_Functions { in octetstring p_private_key, in SignerIdentifier p_signer_identifier, in HashedId8 p_recipientId, - in octetstring p_publicKeyCompressed, - in integer p_compressedMode, + in octetstring p_public_key_compressed, + in integer p_compressed_mode, in octetstring p_salt, in octetstring p_pki_message, out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, @@ -956,7 +1031,7 @@ module LibItsPki_Functions { var template (value) Ieee1609Dot2Data v_ieee1609dot2_signed_data; var octetstring v_encoded_inner_ec_request; var HashedId8 v_recipientId; - var octetstring v_publicEphemeralKeyCompressed; + var octetstring v_public_compressed_ephemeral_key; var integer v_ephemeralKeyModeCompressed; var octetstring v_encrypted_inner_ec_request; @@ -1005,7 +1080,7 @@ module LibItsPki_Functions { if (PICS_SEC_FIXED_KEYS) { p_salt := '77C0637C3558B3238FDE1EEC376DA080BE4076FB8491CA0F8C19FD34DF298CEB'O; } - v_encrypted_inner_ec_request := f_encryptWithEciesNistp256WithSha256(v_encoded_inner_ec_request, p_publicKeyCompressed, p_compressedMode, p_salt, v_publicEphemeralKeyCompressed, v_ephemeralKeyModeCompressed, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, PICS_SEC_FIXED_KEYS); + v_encrypted_inner_ec_request := f_encryptWithEciesNistp256WithSha256(v_encoded_inner_ec_request, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_ephemeralKeyModeCompressed, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, PICS_SEC_FIXED_KEYS); log("p_aes_sym_key= ", p_aes_sym_key); log("p_encrypted_sym_key= ", p_encrypted_sym_key); log("p_authentication_vector= ", p_authentication_vector); @@ -1020,9 +1095,9 @@ module LibItsPki_Functions { log("v_recipientId= ", v_recipientId); // Fill Certificate template with the public compressed keys (canonical form) if (v_ephemeralKeyModeCompressed == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_publicEphemeralKeyCompressed)); + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_publicEphemeralKeyCompressed)); + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_compressed_ephemeral_key)); } p_ieee1609dot2_signed_and_encrypted_data := valueof( m_etsiTs103097Data_encrypted( @@ -1057,8 +1132,8 @@ module LibItsPki_Functions { * @param p_signer_identifier Signer identifier for signature, could be self or certificate HashedId8 * @param p_recipientId Recipient identifier to be inclued in encrypted layer. * If value is int2oct(0. 8), the recipient id is the HashedId8 of the symmetric key used by the sender to encrypt the message to which the response is built - * @param p_publicKeyCompressed The public compressed key (canonical form) for encryption - * @param p_compressedMode The compressed mode of the public compressed key (canonical form) for encryption + * @param p_public_key_compressed The public compressed key (canonical form) for encryption + * @param p_compressed_mode The compressed mode of the public compressed key (canonical form) for encryption * @param p_pki_message The PKI message to be secured * @param p_ieee1609dot2_signed_and_encrypted_data The secured message * @return true on success, false otherwise @@ -1241,14 +1316,14 @@ module LibItsPki_Functions { /** * @desc Verify the generated EA certificate * @param p_ea_certificate The new EA certificate - * @param p_publicKeyCompressed The public compressed key (canonical form) for signature check - * @param p_compressedMode The public compressed key mode + * @param p_public_key_compressed The public compressed key (canonical form) for signature check + * @param p_compressed_mode The public compressed key mode * @return true on success, false otherwise */ function f_verify_ea_certificate( in Certificate p_ea_certificate, - in octetstring p_publicKeyCompressed, - in integer p_compressedMode + in octetstring p_public_key_compressed, + in integer p_compressed_mode ) return boolean { var bitstring v_encoded_tbs; var boolean v_result; @@ -1263,8 +1338,8 @@ module LibItsPki_Functions { bit2oct(v_encoded_tbs), int2oct(0, 32), // self p_ea_certificate.signature_.ecdsaNistP256Signature.rSig.x_only & p_ea_certificate.signature_.ecdsaNistP256Signature.sSig, - p_publicKeyCompressed, - p_compressedMode); + p_public_key_compressed, + p_compressed_mode); return v_result; } // End of function f_verify_ea_certificate @@ -1272,14 +1347,14 @@ module LibItsPki_Functions { /** * @desc Verify the generated AA certificate * @param p_aa_certificate The new EA certificate - * @param p_publicKeyCompressed The public compressed key (canonical form) for signature check - * @param p_compressedMode The public compressed key mode + * @param p_public_key_compressed The public compressed key (canonical form) for signature check + * @param p_compressed_mode The public compressed key mode * @return true on success, false otherwise */ function f_verify_aa_certificate( in Certificate p_aa_certificate, - in octetstring p_publicKeyCompressed, - in integer p_compressedMode + in octetstring p_public_key_compressed, + in integer p_compressed_mode ) return boolean { var bitstring v_encoded_tbs; var boolean v_result; @@ -1294,8 +1369,8 @@ module LibItsPki_Functions { bit2oct(v_encoded_tbs), int2oct(0, 32), // self p_aa_certificate.signature_.ecdsaNistP256Signature.rSig.x_only & p_aa_certificate.signature_.ecdsaNistP256Signature.sSig, - p_publicKeyCompressed, - p_compressedMode); + p_public_key_compressed, + p_compressed_mode); return v_result; } // End of function f_verify_aa_certificate diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index ac9d3def..f9081f6b 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -234,7 +234,7 @@ module LibItsSecurity_Functions { * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption using Nist-P256 algorithm * @param p_toBeEncryptedSecuredMessage The data to be encrypted * @param p_recipientsPublicKeyCompressed The Recipient's compressed public key - * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key @@ -248,7 +248,7 @@ module LibItsSecurity_Functions { function f_encryptWithEciesNistp256WithSha256( in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyCompressed, - in integer p_compressedMode, + in integer p_compressed_mode, in octetstring p_salt, out Oct32 p_publicEphemeralKeyCompressed, out integer p_ephemeralKeyModeCompressed, @@ -261,7 +261,7 @@ module LibItsSecurity_Functions { return fx_encryptWithEciesNistp256WithSha256( p_toBeEncryptedSecuredMessage, p_recipientsPublicKeyCompressed, - p_compressedMode, + p_compressed_mode, p_salt, p_publicEphemeralKeyCompressed, p_ephemeralKeyModeCompressed, @@ -312,7 +312,7 @@ module LibItsSecurity_Functions { * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption using Brainpool-P256 algorithm * @param p_toBeEncryptedSecuredMessage The data to be encrypted * @param p_recipientsPublicKeyCompressed The Recipient's compressed public key - * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key @@ -326,7 +326,7 @@ module LibItsSecurity_Functions { function f_encryptWithEciesBrainpoolp256WithSha256( in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyX, - in integer p_compressedMode, + in integer p_compressed_mode, out Oct32 p_publicEphemeralKeyCompressed, out integer p_ephemeralKeyModeCompressed, out Oct16 p_aes_sym_key, @@ -337,7 +337,7 @@ module LibItsSecurity_Functions { return fx_encryptWithEciesBrainpoolp256WithSha256( p_toBeEncryptedSecuredMessage, p_recipientsPublicKeyX, - p_compressedMode, + p_compressed_mode, p_publicEphemeralKeyCompressed, p_ephemeralKeyModeCompressed, p_aes_sym_key, @@ -422,7 +422,7 @@ module LibItsSecurity_Functions { * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate * @param p_signature The signature * @param p_ecdsaNistp256PublicKeyCompressed The compressed public key - * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @return true on success, false otherwise */ function f_verifyWithEcdsaNistp256WithSha256( @@ -430,7 +430,7 @@ module LibItsSecurity_Functions { in Oct32 p_certificateIssuer, in Oct64 p_signature, in Oct32 p_ecdsaNistp256PublicKeyCompressed, - in integer p_compressedMode + in integer p_compressed_mode ) return boolean { // log("f_verifyWithEcdsaNistp256WithSha256: toBeVerifiedData", p_toBeVerifiedData); // log("f_verifyWithEcdsaNistp256WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); @@ -441,7 +441,7 @@ module LibItsSecurity_Functions { p_certificateIssuer, p_signature, p_ecdsaNistp256PublicKeyCompressed, - p_compressedMode + p_compressed_mode ); } // End of function f_verifyWithEcdsaNistp256WithSha256 @@ -480,7 +480,7 @@ module LibItsSecurity_Functions { * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate * @param p_signature The signature * @param p_ecdsaBrainpoolp256PublicKeyCompressed The compressed public key - * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @return true on success, false otherwise */ function f_verifyWithEcdsaBrainpoolp256WithSha256( @@ -488,7 +488,7 @@ module LibItsSecurity_Functions { in Oct32 p_certificateIssuer, in Oct64 p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyCompressed, - in integer p_compressedMode + in integer p_compressed_mode ) return boolean { // log("f_verifyWithEcdsaBrainpoolp256WithSha256: toBeVerifiedData", p_toBeVerifiedData); // log("f_verifyWithEcdsaBrainpoolp256WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); @@ -499,7 +499,7 @@ module LibItsSecurity_Functions { p_certificateIssuer, p_signature, p_ecdsaBrainpoolp256PublicKeyCompressed, - p_compressedMode + p_compressed_mode ); } // End of function f_verifyWithEcdsaBrainpoolp256WithSha256 @@ -539,7 +539,7 @@ module LibItsSecurity_Functions { * @param p_signature The signature * @param p_ecdsaBrainpoolp384PublicKeyX The public key (x coordinate) * @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate) - * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @return true on success, false otherwise */ function f_verifyWithEcdsaBrainpoolp384WithSha384( @@ -547,7 +547,7 @@ module LibItsSecurity_Functions { in Oct48 p_certificateIssuer, in Oct96 p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyCompressed, - in integer p_compressedMode + in integer p_compressed_mode ) return boolean { // log("f_verifyWithEcdsaBrainpoolp384WithSha384: toBeVerifiedData", p_toBeVerifiedData); // log("f_verifyWithEcdsaBrainpoolp384WithSha384: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); @@ -558,7 +558,7 @@ module LibItsSecurity_Functions { p_certificateIssuer, p_signature, p_ecdsaBrainpoolp384PublicKeyCompressed, - p_compressedMode + p_compressed_mode ); } // End of function f_verifyWithEcdsaBrainpoolp384WithSha384 @@ -598,7 +598,7 @@ module LibItsSecurity_Functions { * @param p_publicKeyX The new public key value (x coordinate) * @param p_publicKeyX The new public key value (y coordinate) * @param p_publicKeyCompressed The compressed public keys - * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @return true on success, false otherwise */ function f_generate_key_pair_nistp256( @@ -606,18 +606,18 @@ module LibItsSecurity_Functions { out Oct32 p_publicKeyX, out Oct32 p_publicKeyY, out Oct32 p_publicKeyCompressed, - out integer p_compressedMode + out integer p_compressed_mode ) return boolean { if (PICS_SEC_FIXED_KEYS) { // Debug mode: Use fixed values p_privateKey := '43481BC44C073C1432DB6EC4F0EF57062BEA08E4C19F811567325AD1FD1C6577'O; p_publicKeyX := '0B5D74B033531C51D17B4F218DD4E39289AE4BF2EE3D7BAB7C07DAF0C14F0317'O; p_publicKeyY := '5D49B139A9237832FDE24D77555878CE65D6C2284A1BDA4CE08ABDD4071E0255'O; p_publicKeyCompressed := '0B5D74B033531C51D17B4F218DD4E39289AE4BF2EE3D7BAB7C07DAF0C14F0317'O; - p_compressedMode := 1; + p_compressed_mode := 1; return true; } - return fx_generateKeyPair_nistp256(p_privateKey, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressedMode); + return fx_generateKeyPair_nistp256(p_privateKey, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressed_mode); } /** @@ -627,7 +627,7 @@ module LibItsSecurity_Functions { * @param p_publicKeyX The new public key value (x coordinate) * @param p_publicKeyX The new public key value (y coordinate) * @param p_publicKeyCompressed The compressed public keys - * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @return true on success, false otherwise */ function f_generate_key_pair_brainpoolp256( @@ -635,9 +635,9 @@ module LibItsSecurity_Functions { out Oct32 p_publicKeyX, out Oct32 p_publicKeyY, out Oct32 p_publicKeyCompressed, - out integer p_compressedMode + out integer p_compressed_mode ) return boolean { - return fx_generateKeyPair_brainpoolp256(p_privateKey, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressedMode); + return fx_generateKeyPair_brainpoolp256(p_privateKey, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressed_mode); } /** @@ -647,7 +647,7 @@ module LibItsSecurity_Functions { * @param p_publicKeyX The new public key value (x coordinate) * @param p_publicKeyX The new public key value (y coordinate) * @param p_publicKeyCompressed The compressed public keys - * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @return true on success, false otherwise */ function f_generate_key_pair_brainpoolp384( @@ -655,9 +655,9 @@ module LibItsSecurity_Functions { out Oct48 p_publicKeyX, out Oct48 p_publicKeyY, out Oct48 p_publicKeyCompressed, - out integer p_compressedMode + out integer p_compressed_mode ) return boolean { - return fx_generateKeyPair_brainpoolp384(p_privateKey, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressedMode); + return fx_generateKeyPair_brainpoolp384(p_privateKey, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressed_mode); } /** @@ -2124,17 +2124,17 @@ module LibItsSecurity_Functions { /** * @desc Read the specified certificate - * @param p_certificateId the certificate identifier + * @param p_certificate_id the certificate identifier * @param p_certificate the expected certificate * @return true on success, false otherwise */ function f_readCertificate( - in charstring p_certificateId, + in charstring p_certificate_id, out EtsiTs103097Certificate p_certificate ) return boolean { var octetstring v_certificate; - if (fx_readCertificate(p_certificateId, v_certificate) == true) { + if (fx_readCertificate(p_certificate_id, v_certificate) == true) { var bitstring v_oct2bit; var integer v_result; @@ -2145,22 +2145,22 @@ module LibItsSecurity_Functions { } } - log("f_readCertificate: Failed to retrieve ", p_certificateId); + log("f_readCertificate: Failed to retrieve ", p_certificate_id); return false; } // End of function f_readCertificate /** * @desc Read the specified certificate - * @param p_certificateId the certificate identifier + * @param p_certificate_id the certificate identifier * @param p_digest the digest of the certificate * @return true on success, false otherwise */ function f_getCertificateDigest( - in charstring p_certificateId, + in charstring p_certificate_id, out HashedId8 p_digest ) return boolean { - if (not fx_readCertificateDigest(p_certificateId, p_digest)){ - log("f_getCertificateDigest: Failed to retrieve digest for ", p_certificateId); + if (not fx_readCertificateDigest(p_certificate_id, p_digest)){ + log("f_getCertificateDigest: Failed to retrieve digest for ", p_certificate_id); return false; } return true; @@ -2168,16 +2168,16 @@ module LibItsSecurity_Functions { /** * @desc Read the whole-hash of the certificate - * @param p_certificateId the certificate identifier + * @param p_certificate_id the certificate identifier * @param p_hash the whole-hash of the certificate * @return true on success, false otherwise */ function f_getCertificateHash( - in charstring p_certificateId, + in charstring p_certificate_id, out octetstring p_hash ) return boolean { - if (not fx_readCertificateHash(p_certificateId, p_hash)){ - log("f_getCertificateHash: Failed to retrieve digest for ", p_certificateId); + if (not fx_readCertificateHash(p_certificate_id, p_hash)){ + log("f_getCertificateHash: Failed to retrieve digest for ", p_certificate_id); return false; } return true; @@ -2347,7 +2347,7 @@ module LibItsSecurity_Functions { * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption using Nist-P256 algorithm * @param p_toBeEncryptedSecuredMessage The data to be encrypted * @param p_recipientsPublicKeyCompressed The Recipient's compressed public key - * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key @@ -2355,7 +2355,7 @@ module LibItsSecurity_Functions { * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption * @return The encrypted message */ - external function fx_encryptWithEciesNistp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyCompressed, in integer p_compressedMode, in octetstring p_salt, out Oct32 p_publicEphemeralKeyCompressed, out integer p_ephemeralKeyModeCompressed, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce, in boolean p_use_hardcoded_values := false) return octetstring; + external function fx_encryptWithEciesNistp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyCompressed, in integer p_compressed_mode, in octetstring p_salt, out Oct32 p_publicEphemeralKeyCompressed, out integer p_ephemeralKeyModeCompressed, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce, in boolean p_use_hardcoded_values := false) return octetstring; external function fx_test_encryptWithEciesNistp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_privateEphemeralKey, in Oct32 p_recipientPublicKeyX, in Oct32 p_recipientPublicKeyY, in octetstring p_salt, out Oct32 p_publicEphemeralKeyX, out Oct32 p_publicEphemeralKeyY, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; @@ -2375,7 +2375,7 @@ module LibItsSecurity_Functions { * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption using Brainpool-P256 algorithm * @param p_toBeEncryptedSecuredMessage The data to be encrypted * @param p_recipientsPublicKeyCompressed The Recipient's compressed public key - * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key @@ -2383,7 +2383,7 @@ module LibItsSecurity_Functions { * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption * @return The encrypted message */ - external function fx_encryptWithEciesBrainpoolp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyCompressed, in integer p_compressedMode, out Oct32 p_publicEphemeralKeyCompressed, out integer p_ephemeralKeyModeCompressed, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; + external function fx_encryptWithEciesBrainpoolp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyCompressed, in integer p_compressed_mode, out Oct32 p_publicEphemeralKeyCompressed, out integer p_ephemeralKeyModeCompressed, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; /** * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Brainpool-P256 algorithm @@ -2431,12 +2431,12 @@ module LibItsSecurity_Functions { * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate * @param p_signature The signature * @param p_ecdsaNistp256PublicKeyCompressed The compressed public key - * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaNistp256WithSha256(in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyCompressed, in integer p_compressedMode) return boolean; + external function fx_verifyWithEcdsaNistp256WithSha256(in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyCompressed, in integer p_compressed_mode) return boolean; - external function fx_test_verifyWithEcdsaNistp256WithSha256(in octetstring p_toBeVerifiedData, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyCompressed, in integer p_compressedMode) return boolean; + external function fx_test_verifyWithEcdsaNistp256WithSha256(in octetstring p_toBeVerifiedData, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyCompressed, in integer p_compressed_mode) return boolean; /** * @desc Verify the signature of the specified data @@ -2455,10 +2455,10 @@ module LibItsSecurity_Functions { * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate * @param p_signature The signature * @param p_ecdsaBrainpoolp256PublicKeyCompressed The compressed public key - * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaBrainpoolp256WithSha256(in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in Oct64 p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyCompressed, in integer p_compressedMode) return boolean; + external function fx_verifyWithEcdsaBrainpoolp256WithSha256(in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in Oct64 p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyCompressed, in integer p_compressed_mode) return boolean; /** * @desc Verify the signature of the specified data @@ -2477,10 +2477,10 @@ module LibItsSecurity_Functions { * @param p_certificateIssuer The certificate issuer * @param p_signature The signature * @param p_ecdsaBrainpoolp384PublicKeyCompressed The compressed public key - * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaBrainpoolp384WithSha384(in octetstring p_toBeVerifiedData, in Oct48 p_certificateIssuer, in Oct96 p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyCompressed, in integer p_compressedMode) return boolean; + external function fx_verifyWithEcdsaBrainpoolp384WithSha384(in octetstring p_toBeVerifiedData, in Oct48 p_certificateIssuer, in Oct96 p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyCompressed, in integer p_compressed_mode) return boolean; /** * @desc Verify the signature of the specified data @@ -2500,10 +2500,10 @@ module LibItsSecurity_Functions { * @param p_publicKeyX The new public key value (x coordinate) * @param p_publicKeyX The new public key value (y coordinate) * @param p_publicKeyCompressed The compressed public keys - * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @return true on success, false otherwise */ - external function fx_generateKeyPair_nistp256(out Oct32 p_privateKey, out Oct32 p_publicKeyX, out Oct32 p_publicKeyY, out Oct32 p_publicKeyCompressed, out integer p_compressedMode) return boolean; + external function fx_generateKeyPair_nistp256(out Oct32 p_privateKey, out Oct32 p_publicKeyX, out Oct32 p_publicKeyY, out Oct32 p_publicKeyCompressed, out integer p_compressed_mode) return boolean; /** * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. @@ -2512,10 +2512,10 @@ module LibItsSecurity_Functions { * @param p_publicKeyX The new public key value (x coordinate) * @param p_publicKeyX The new public key value (y coordinate) * @param p_publicKeyCompressed The compressed public keys - * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @return true on success, false otherwise */ - external function fx_generateKeyPair_brainpoolp256(out Oct32 p_privateKey, out Oct32 p_publicKeyX, out Oct32 p_publicKeyY, out Oct32 p_publicKeyCompressed, out integer p_compressedMode) return boolean; + external function fx_generateKeyPair_brainpoolp256(out Oct32 p_privateKey, out Oct32 p_publicKeyX, out Oct32 p_publicKeyY, out Oct32 p_publicKeyCompressed, out integer p_compressed_mode) return boolean; /** * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. @@ -2524,10 +2524,10 @@ module LibItsSecurity_Functions { * @param p_publicKeyX The new public key value (x coordinate) * @param p_publicKeyX The new public key value (y coordinate) * @param p_publicKeyCompressed The compressed public keys - * @param p_compressedMode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @return true on success, false otherwise */ - external function fx_generateKeyPair_brainpoolp384(out Oct48 p_privateKey, out Oct48 p_publicKeyX, out Oct48 p_publicKeyY, out Oct48 p_publicKeyCompressed, out integer p_compressedMode) return boolean; + external function fx_generateKeyPair_brainpoolp384(out Oct48 p_privateKey, out Oct48 p_publicKeyX, out Oct48 p_publicKeyY, out Oct48 p_publicKeyCompressed, out integer p_compressed_mode) return boolean; } // End of group signing @@ -2555,29 +2555,29 @@ module LibItsSecurity_Functions { /** * @desc Read the specified certificate - * @param p_certificateId the certificate identifier + * @param p_certificate_id the certificate identifier * @param p_certificate the expected certificate * @return true on success, false otherwise */ - external function fx_readCertificate(in charstring p_certificateId, out octetstring p_certificate) return boolean; + external function fx_readCertificate(in charstring p_certificate_id, out octetstring p_certificate) return boolean; /** * @desc Read the specified certificate digest - * @param p_certificateId the certificate identifier + * @param p_certificate_id the certificate identifier * @param p_digest the expected certificate * @return true on success, false otherwise */ - external function fx_readCertificateDigest(in charstring p_certificateId, out HashedId8 p_digest) return boolean; + external function fx_readCertificateDigest(in charstring p_certificate_id, out HashedId8 p_digest) return boolean; /** * @desc Read the whole-hash of the specified certificate - * @param p_certificateId the certificate identifier + * @param p_certificate_id the certificate identifier * @param p_hash the whole-hash of the certificate * @return true on success, false otherwise */ - external function fx_readCertificateHash(in charstring p_certificateId, out octetstring p_hash) return boolean; + external function fx_readCertificateHash(in charstring p_certificate_id, out octetstring p_hash) return boolean; - external function fx_readCertificateFromDigest(in HashedId8 p_digest, out charstring p_certificateId) return boolean; + external function fx_readCertificateFromDigest(in HashedId8 p_digest, out charstring p_certificate_id) return boolean; /** * @desc Read the private keys for the specified certificate diff --git a/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn b/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn index 81ef45a2..96d5e5af 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn @@ -129,12 +129,12 @@ module LibItsSremSsem_Functions { * @desc Initialise secure mode if required */ function f_initialiseSecuredMode( - in charstring p_certificateId := PX_CERT_FOR_TS + in charstring p_certificate_id := PX_CERT_FOR_TS ) runs on ItsSremSsem { if (PICS_IS_IUT_SECURED == true) { - if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificateId))) { + if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificate_id))) { log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); stop; } @@ -252,10 +252,10 @@ module LibItsSremSsem_Functions { /** * @desc Setups default configuration - * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT + * @param p_certificate_id The certificate identifier the TA shall use in case of secured IUT */ function f_cfUp( - in charstring p_certificateId := PX_CERT_FOR_TS + in charstring p_certificate_id := PX_CERT_FOR_TS ) runs on ItsSremSsem /* TITAN TODO: system ItsSremSsemSystem */ { map(self:acPort, system:acPort); @@ -267,7 +267,7 @@ module LibItsSremSsem_Functions { activate(a_cf01Down()); // Initialise secured mode - f_initialiseSecuredMode(p_certificateId); + f_initialiseSecuredMode(p_certificate_id); //Initialze the IUT f_prInitialState(); -- GitLab From 6ad3b76d67a4ecdb137405e4c93decdc510110b9 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 20 Dec 2018 23:43:35 -0800 Subject: [PATCH 166/320] Bug fixed in http_codec --- ttcn/Pki/LibItsPki_Functions.ttcn | 94 +++++++++++++-------- ttcn/Pki/LibItsPki_Pics.ttcn | 4 +- ttcn/Security/LibItsSecurity_Functions.ttcn | 2 +- ttcn/Security/LibItsSecurity_Templates.ttcn | 26 ++++++ 4 files changed, 87 insertions(+), 39 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 379dd8b8..67a41907 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -247,7 +247,8 @@ module LibItsPki_Functions { var octetstring v_public_enc_key; var integer v_compressed_enc_key_mode; var boolean v_ret_code; - + + log(">>> f_http_build_inner_ec_request"); if (f_generate_inner_ec_request(p_private_key, p_public_key_compressed, p_compressed_mode, v_inner_ec_request) == false) { log("*** f_http_build_inner_ec_request: ERROR: Failed to generate InnerEcRequest ***"); f_selfOrClientSyncAndVerdict("error", e_error); @@ -285,8 +286,8 @@ module LibItsPki_Functions { log("*** f_http_build_inner_ec_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); f_selfOrClientSyncAndVerdict("error", e_error); } - log("*** f_http_build_inner_ec_request: DEBUG: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); - log("*** f_http_build_inner_ec_request: DEBUG: p_request_hash= ", p_request_hash); + log("*** f_http_build_inner_ec_request: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); + log("*** f_http_build_inner_ec_request: p_request_hash= ", p_request_hash); } // End of function f_http_build_inner_ec_request function f_http_build_invalid_enrolment_request( @@ -344,7 +345,6 @@ module LibItsPki_Functions { if (v_ret_code == false) { log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); f_selfOrClientSyncAndVerdict("error", e_error); - return; } log("*** f_http_build_invalid_enrolment_request: DEBUG: p_ieee1609dot2_signed_and_encrypted_data = ", p_ieee1609dot2_signed_and_encrypted_data); } // End of function f_http_build_invalid_enrolment_request @@ -470,10 +470,14 @@ module LibItsPki_Functions { group generate_certificates { function f_generate_ec_certificate( - in octetstring p_private_key, - in InnerEcRequest p_inner_ec_request, + out octetstring p_private_key, out Certificate p_ec_certificate ) return boolean { + var octetstring v_public_key_x; + var octetstring v_public_key_y; + var octetstring p_public_key_compressed; + var integer p_compressed_mode; + var EccP256CurvePoint v_ecc_p256_curve_point; var SequenceOfPsidSsp v_appPermissions := { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs valueof(m_appPermissions(36, { bitmapSsp := '830001'O })), valueof(m_appPermissions(37, { bitmapSsp := '830001'O })) @@ -483,13 +487,26 @@ module LibItsPki_Functions { var Oct32 v_sig; var bitstring v_enc_msg; + log(">>> f_generate_ec_certificate"); + + // Generate verification keys for the certificate + if (f_generate_key_pair_nistp256(p_private_key, v_public_key_x, v_public_key_y, p_public_key_compressed, p_compressed_mode) == false) { + log("f_generate_ec_certificate: Failed to generate verification key"); + return false; + } + if (p_compressed_mode == 0) { + v_ecc_p256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(p_public_key_compressed)); + } else { + v_ecc_p256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(p_public_key_compressed)); + } + v_cert := m_etsiTs103097Certificate( m_issuerIdentifier_sha256AndDigest(f_HashedId8FromSha256(f_hashWithSha256('616263'O))), m_toBeSignedCertificate_at( v_appPermissions, m_verificationKeyIndicator_verificationKey( m_publicVerificationKey_ecdsaNistP256( - p_inner_ec_request.publicKeys.verificationKey.ecdsaNistP256 + v_ecc_p256_curve_point )), m_validityPeriod( 17469212, @@ -515,7 +532,7 @@ module LibItsPki_Functions { substr(v_sig, 32, 32) ) ); - log("v_cert= ", v_cert); + log("f_generate_ec_certificate: v_cert= ", v_cert); p_ec_certificate := valueof(v_cert); return true; @@ -921,9 +938,9 @@ module LibItsPki_Functions { group awaiting_messages { function f_await_http_inner_ec_request_response( - in Oct32 p_private_key, - in Oct32 p_compressed_public_key, - in integer p_compressed_mode, + out Oct32 p_private_key, + out Oct32 p_compressed_public_key, + out integer p_compressed_mode, out InnerEcResponse p_inner_ec_response ) runs on ItsPkiHttp return boolean { var HeaderLines v_headers; @@ -936,7 +953,8 @@ module LibItsPki_Functions { var Ieee1609Dot2Data v_ieee1609dot2_signed_and_encrypted_data; var EtsiTs102941Data v_etsi_ts_102941_data; var HttpMessage v_response; - + + log(">>> f_await_http_inner_ec_request_response"); f_http_build_inner_ec_request(p_private_key, p_compressed_public_key, p_compressed_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, v_salt, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash); f_init_default_headers_list(-, "inner_ec_request", v_headers); httpPort.send( @@ -966,12 +984,17 @@ module LibItsPki_Functions { log("f_await_http_inner_ec_request_response: Failed to verify PKI message ***"); } else { log("f_await_http_inner_ec_request_response: Receive ", v_etsi_ts_102941_data, " ***"); - log("f_await_http_inner_ec_request_response: match ", match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(substr(v_request_hash, 0, 16), mw_etsiTs103097Certificate(mw_issuerIdentifier_self, mw_toBeSignedCertificate_ea, mw_signature_ecdsaNistP256)))), " ***"); // TODO In TITAN, this is the only way to get the unmatching in log - if (match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(substr(v_request_hash, 0, 16), mw_etsiTs103097Certificate(mw_issuerIdentifier_self, mw_toBeSignedCertificate_ea, mw_signature_ecdsaNistP256))))) { - p_inner_ec_response := v_etsi_ts_102941_data.content.enrolmentResponse; - log("f_await_http_inner_ec_request_response: Well-secured EA certificate received ***"); - log("p_inner_ec_response= ", p_inner_ec_response); - return true; + // Verify the received EC certificate + log("f_await_http_inner_ec_request_response: match ", match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(substr(v_request_hash, 0, 16), mw_etsiTs103097Certificate(-, mw_toBeSignedCertificate_ec, -)))), " ***"); // TODO In TITAN, this is the only way to get the unmatching in log + if (match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(substr(v_request_hash, 0, 16), mw_etsiTs103097Certificate(-, mw_toBeSignedCertificate_ec, -))))) { + if (f_verify_ec_certificate(v_etsi_ts_102941_data.content.enrolmentResponse.certificate, p_compressed_public_key, p_compressed_mode)) { + p_inner_ec_response := v_etsi_ts_102941_data.content.enrolmentResponse; + log("f_await_http_inner_ec_request_response: Well-secured EA certificate received ***"); + log("p_inner_ec_response= ", p_inner_ec_response); + return true; + } else { + log("f_await_http_inner_ec_request_response: Cannot verify EC certificate signature ***"); + } } else { log("f_await_http_inner_ec_request_response: Unexpected message received ***"); } @@ -1314,35 +1337,34 @@ module LibItsPki_Functions { } // End of function f_verify_pki_message /** - * @desc Verify the generated EA certificate - * @param p_ea_certificate The new EA certificate + * @desc Verify the EC certificate generated by the EA entity + * @param p_ec_certificate The new EC certificate * @param p_public_key_compressed The public compressed key (canonical form) for signature check - * @param p_compressed_mode The public compressed key mode + * @param p_compressed_mode The public compressed key mode * @return true on success, false otherwise */ - function f_verify_ea_certificate( - in Certificate p_ea_certificate, + function f_verify_ec_certificate( + in Certificate p_ec_certificate, in octetstring p_public_key_compressed, in integer p_compressed_mode ) return boolean { var bitstring v_encoded_tbs; - var boolean v_result; - // Check certificate format - v_result := match(p_ea_certificate, mw_etsiTs103097Certificate(mw_issuerIdentifier_self, mw_toBeSignedCertificate_ea, -)); // Check the signer + log("f_verify_ec_certificate: ", match(p_ec_certificate.issuer, mw_issuerIdentifier_self())); + if (match(p_ec_certificate.issuer, mw_issuerIdentifier_self)) { + return false; + } - // Check EA certificate signature - v_encoded_tbs := encvalue(p_ea_certificate.toBeSigned); - v_result := v_result and f_verifyWithEcdsaNistp256WithSha256( - bit2oct(v_encoded_tbs), - int2oct(0, 32), // self - p_ea_certificate.signature_.ecdsaNistP256Signature.rSig.x_only & p_ea_certificate.signature_.ecdsaNistP256Signature.sSig, - p_public_key_compressed, - p_compressed_mode); + // Check EC certificate signature + // TODO Who sign the EC certificate? + /*if (f_verifyCertificateSignatureWithPublicKey(p_ec_certificate, p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey) == false) { + log("f_verify_ec_certificate: Signature not verified"); + return false; + }*/ - return v_result; - } // End of function f_verify_ea_certificate + return true; + } // End of function f_verify_ec_certificate /** * @desc Verify the generated AA certificate diff --git a/ttcn/Pki/LibItsPki_Pics.ttcn b/ttcn/Pki/LibItsPki_Pics.ttcn index 0abd5c9b..87388910 100644 --- a/ttcn/Pki/LibItsPki_Pics.ttcn +++ b/ttcn/Pki/LibItsPki_Pics.ttcn @@ -13,12 +13,12 @@ module LibItsPki_Pics { /** * @desc Does the IUT act as AA device? */ - modulepar boolean PICS_IUT_AA_ROLE := false; + modulepar boolean PICS_IUT_AA_ROLE := true; /** * @desc Does the IUT act as combined EA-AA device? */ - modulepar boolean PICS_IUT_COMBINED_EA_AA_ROLE := true; + modulepar boolean PICS_IUT_COMBINED_EA_AA_ROLE := false; /** * @desc Certificate used by the IUT acting as ITS-S diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index f9081f6b..da5c1199 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -768,7 +768,7 @@ module LibItsSecurity_Functions { p_atCertificate := vc_atCertificate; p_aaCertificate := vc_aaCertificate; } - // Store the certificte to build this message + // Store the certificate to build this message vc_lastAtCertificateUsed := p_atCertificate; return true; diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index eb34d1ae..22cca22f 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -1409,6 +1409,32 @@ module LibItsSecurity_Templates { verifyKeyIndicator := p_verifyKeyIndicator } // End of template mw_toBeSignedCertificate_ea + /** + * @desc Send template for ToBeSignedCertificate with Enrolment credential restrictions + * @see ETSI TS 103 097 V1.3.1 Clause 7.2.2 Enrolment credential + */ + template ToBeSignedCertificate mw_toBeSignedCertificate_ec( + template (present) CertificateId p_id := ?, + template (present) SequenceOfPsidSsp p_appPermissions := ?, + template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, + template (present) ValidityPeriod p_validityPeriod := ?, + template GeographicRegion p_region := *, + template SubjectAssurance p_assuranceLevel := * + ) := { + id := p_id, + cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 + crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 + validityPeriod := p_validityPeriod, + region := p_region, + assuranceLevel := p_assuranceLevel, + appPermissions := p_appPermissions, + certIssuePermissions := omit, + certRequestPermissions := omit, + canRequestRollover := omit, + encryptionKey := omit, + verifyKeyIndicator := p_verifyKeyIndicator + } // End of template mw_toBeSignedCertificate_ec + /** * @desc Send template for ToBeSignedCertificate with Authorization authority restrictions * @see ETSI TS 103 097 V1.3.1 Clause 7.2.4 Subordinate certification authority certificates -- GitLab From 4be38c825dc727bd6be6efe0112914e0c5a21af0 Mon Sep 17 00:00:00 2001 From: garciay Date: Sat, 5 Jan 2019 06:29:33 -0800 Subject: [PATCH 167/320] Change requestHash calculation as specified in CMS-ITS 6 ERRATA --- ttcn/Pki/LibItsPki_Functions.ttcn | 173 +++++++++++++++++++++++------- 1 file changed, 134 insertions(+), 39 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 67a41907..8b1624e2 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -274,13 +274,13 @@ module LibItsPki_Functions { log("*** f_http_build_inner_ec_request: First enrolment: ", PX_FIRST_ENROLMENT); p_salt := vc_eaWholeHash; if (PX_FIRST_ENROLMENT == true) { // This is the first enrolment, we used Factory keys - v_ret_code := f_build_pki_secured_request_message(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); + v_ret_code := f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } else { // We use last valid EC certificate var Oct32 v_ec_private_key; var HashedId8 v_ec_hashed_id8; // Retrieve EC certificate from the first enrolment // TODO Set v_ec_private_key & v_ec_hashed_id8 - v_ret_code := f_build_pki_secured_request_message(v_ec_private_key, valueof(m_signerIdentifier_digest(v_ec_hashed_id8)), v_ec_hashed_id8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); + v_ret_code := f_build_pki_secured_request_message_signed_with_pop(v_ec_private_key, valueof(m_signerIdentifier_digest(v_ec_hashed_id8)), v_ec_hashed_id8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } if (v_ret_code == false) { log("*** f_http_build_inner_ec_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); @@ -334,13 +334,13 @@ module LibItsPki_Functions { log("*** f_http_build_inner_ec_request: Public encryption key comp: ", v_compressed_enc_key_mode); p_salt := vc_eaWholeHash; if (PX_FIRST_ENROLMENT == true) { // This is the first enrolment, we used Factory keys - v_ret_code := f_build_pki_secured_request_message(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); + v_ret_code := f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } else { // We use last valid EC certificate var Oct32 v_ec_private_key; var HashedId8 v_ec_hashed_id8; // Retrieve EC certificate from the first enrolment // TODO Set v_ec_private_key & v_ec_hashed_id8 - v_ret_code := f_build_pki_secured_request_message(v_ec_private_key, valueof(m_signerIdentifier_digest(v_ec_hashed_id8)), v_ec_hashed_id8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); + v_ret_code := f_build_pki_secured_request_message_signed_with_pop(v_ec_private_key, valueof(m_signerIdentifier_digest(v_ec_hashed_id8)), v_ec_hashed_id8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } if (v_ret_code == false) { log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); @@ -399,10 +399,6 @@ module LibItsPki_Functions { return; } log("v_inner_at_request= ", v_inner_at_request); - - if (PX_AUTHORIZATION_REQUEST_WITH_POP) { - // TODO Set Ieee1609Dot2Data p_inner_at_request_data - } // else TODO Check what to do // Secure InnerAtRequest message if (f_extract_enc_key(vc_aaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { @@ -418,9 +414,17 @@ module LibItsPki_Functions { log("*** f_http_build_authorization_request: First enrolment: ", PX_FIRST_ENROLMENT); p_salt := vc_aaWholeHash; log("*** f_http_build_authorization_request: p_salt: ", p_salt); - if(f_build_pki_secured_request_message(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { - log("*** f_http_build_authorization_request: ERROR: Failed to generate Authorization Request ***"); - f_selfOrClientSyncAndVerdict("error", e_error); + if (PX_AUTHORIZATION_REQUEST_WITH_POP) { + if(f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { + log("*** f_http_build_authorization_request: ERROR: Failed to generate Authorization Request ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + } else { // Only encryption of EtsiTs102941Data/InnerAtRequest + log("*** f_http_build_authorization_request: POP signature not applied"); + if(f_build_pki_secured_request_message(vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { + log("*** f_http_build_authorization_request: ERROR: Failed to generate Authorization Request ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } } log("*** f_http_build_authorization_request: DEBUG: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); log("*** f_http_build_authorization_request: DEBUG: p_request_hash= ", p_request_hash); @@ -457,7 +461,7 @@ module LibItsPki_Functions { **/ log("*** f_http_build_inner_ec_request: ERROR: Need to add TestSystem variable vc_aa ***"); f_selfOrClientSyncAndVerdict("error", e_error); - /* if (f_build_pki_secured_request_message(vc_aaPrivateKey, valueof(m_signerIdentifier_digest(vc_aaHashedId8)), vc_eaHashedId8/\*recipientId*\/, v_public_enc_key, v_compressed_enc_key_mode, vc_eaWholeHash, bit2oct(encvalue(m_etsiTs102941Data_authorization_validation_request(v_authorization_validation_request))), p_ieee1609dot2_signed_and_encrypted_data, p_request_hash) == false) { */ + /* if (f_build_pki_secured_request_message_signed_with_pop(vc_aaPrivateKey, valueof(m_signerIdentifier_digest(vc_aaHashedId8)), vc_eaHashedId8/\*recipientId*\/, v_public_enc_key, v_compressed_enc_key_mode, vc_eaWholeHash, bit2oct(encvalue(m_etsiTs102941Data_authorization_validation_request(v_authorization_validation_request))), p_ieee1609dot2_signed_and_encrypted_data, p_request_hash) == false) { */ /* log("*** f_http_build_authorization_validation_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); */ /* f_selfOrClientSyncAndVerdict("error", e_error); */ /* } */ @@ -833,7 +837,7 @@ module LibItsPki_Functions { var Oct16 v_encrypted_sym_key; var HashedId8 v_recipientId; var octetstring v_public_compressed_ephemeral_key; - var integer v_ephemeralKeyModeCompressed; + var integer v_public_compressed_ephemeral_mode; var octetstring v_enc_signed_ec_signature; // Use EA certificate for the encryption @@ -846,11 +850,11 @@ module LibItsPki_Functions { } else { return false; } - v_enc_signed_ec_signature := f_encryptWithEciesNistp256WithSha256(bit2oct(encvalue(v_signed_ec_signature)), v_public_enc_key, v_compressed_mode, ''O, v_public_compressed_ephemeral_key, v_ephemeralKeyModeCompressed, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); + v_enc_signed_ec_signature := f_encryptWithEciesNistp256WithSha256(bit2oct(encvalue(v_signed_ec_signature)), v_public_enc_key, v_compressed_mode, ''O, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); v_recipientId := p_ea_hashed_id8; // RecipientId is the HashedId8 of the EA certificate log("v_recipientId= ", v_recipientId); // Fill Certificate template with the public compressed keys (canonical form) - if (v_ephemeralKeyModeCompressed == 0) { + if (v_public_compressed_ephemeral_mode == 0) { v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); } else { v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_compressed_ephemeral_key)); @@ -1032,32 +1036,41 @@ module LibItsPki_Functions { * @param p_ieee1609dot2_signed_and_encrypted_data The secured message * @return true on success, false otherwise */ - function f_build_pki_secured_request_message( - in octetstring p_private_key, - in SignerIdentifier p_signer_identifier, - in HashedId8 p_recipientId, - in octetstring p_public_key_compressed, - in integer p_compressed_mode, - in octetstring p_salt, - in octetstring p_pki_message, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce, - out Oct32 p_request_hash - ) return boolean { + function f_build_pki_secured_request_message_signed_with_pop( + in octetstring p_private_key, + in SignerIdentifier p_signer_identifier, + in HashedId8 p_recipientId, + in octetstring p_public_key_compressed, + in integer p_compressed_mode, + in octetstring p_salt, + in octetstring p_pki_message, + out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, + out Oct16 p_aes_sym_key, + out Oct16 p_encrypted_sym_key, + out Oct16 p_authentication_vector, + out Oct12 p_nonce, + out Oct32 p_request_hash + ) return boolean { // Local variables var template (value) EccP256CurvePoint v_eccP256_curve_point; var template (value) ToBeSignedData v_tbs; var octetstring v_tbs_signed; var template (value) Ieee1609Dot2Data v_ieee1609dot2_signed_data; - var octetstring v_encoded_inner_ec_request; + var octetstring v_encoded_request; var HashedId8 v_recipientId; var octetstring v_public_compressed_ephemeral_key; - var integer v_ephemeralKeyModeCompressed; - var octetstring v_encrypted_inner_ec_request; + var integer v_public_compressed_ephemeral_mode; + var octetstring v_encrypted_request; + + log(">>> f_build_pki_secured_request_message_signed_with_pop"); + // The 'p_request_hash' shall be the SHA256 digest of the OER representation of the topmost EtsiTs103097Data-Encoded structure + if (PICS_SEC_FIXED_KEYS) { + p_request_hash := '10ED97A2F2933DD3AC55F47022D125E18F5E1AA024613E616A75BA4979EFE318'O; + } else { + p_request_hash := f_hashWithSha256(p_pki_message); + log("p_request_hash= ", p_request_hash); + } // Signed the encoded PKI message v_tbs := m_toBeSignedData( m_signedDataPayload( @@ -1091,19 +1104,101 @@ module LibItsPki_Functions { ) ); // Encode EtsiTs103097Data-Signed data structure - v_encoded_inner_ec_request := bit2oct(encvalue(v_ieee1609dot2_signed_data)); - // Calculate the SHA256 of v_encoded_inner_ec_request + v_encoded_request := bit2oct(encvalue(v_ieee1609dot2_signed_data)); + // Encrypt encode EtsiTs103097Data-Signed data structure + if (PICS_SEC_FIXED_KEYS) { + p_salt := '77C0637C3558B3238FDE1EEC376DA080BE4076FB8491CA0F8C19FD34DF298CEB'O; + } + v_encrypted_request := f_encryptWithEciesNistp256WithSha256(v_encoded_request, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, PICS_SEC_FIXED_KEYS); + log("p_aes_sym_key= ", p_aes_sym_key); + log("p_encrypted_sym_key= ", p_encrypted_sym_key); + log("p_authentication_vector= ", p_authentication_vector); + log("p_nonce= ", p_nonce); + log("p_recipientId= ", p_recipientId); + if (p_recipientId == int2oct(0, 8)) { + log("f_hashWithSha256(v_encrypted_sym_key)= ", f_hashWithSha256(p_encrypted_sym_key)); + v_recipientId := f_HashedId8FromSha256(f_hashWithSha256(p_encrypted_sym_key)); + } else { + v_recipientId := p_recipientId; + } + log("v_recipientId= ", v_recipientId); + // Fill Certificate template with the public compressed keys (canonical form) + if (v_public_compressed_ephemeral_mode == 0) { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); + } else { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_compressed_ephemeral_key)); + } + p_ieee1609dot2_signed_and_encrypted_data := valueof( + m_etsiTs103097Data_encrypted( + m_encryptedData( + { + m_recipientInfo_signedDataRecipInfo( + m_pKRecipientInfo( + v_recipientId, + m_encryptedDataEncryptionKey_eciesNistP256( + m_evciesP256EncryptedKey( + v_eccP256_curve_point, + p_encrypted_sym_key, + p_authentication_vector + )))) + }, + m_SymmetricCiphertext_aes128ccm( + m_aesCcmCiphertext( + p_nonce, + v_encrypted_request + ) + ) + ) + ) + ); + + return true; + } // End of function f_build_pki_secured_request_message_signed_with_pop + + /** + * @desc Build a signed and encrypted PKI request message without POP with signature + * @param p_recipientId Recipient identifier to be inclued in encrypted layer. + * If value is int2oct(0. 8), the recipient id is the HashedId8 of the symmetric key used by the sender to encrypt the message to which the response is built + * @param p_public_key_compressed The public compressed key (canonical form) for encryption + * @param p_compressed_mode The compressed mode of the public compressed key (canonical form) for encryption + * @param p_pki_message The PKI message to be secured + * @param p_ieee1609dot2_signed_and_encrypted_data The secured message + * @return true on success, false otherwise + */ + function f_build_pki_secured_request_message( + in HashedId8 p_recipientId, + in octetstring p_public_key_compressed, + in integer p_compressed_mode, + in octetstring p_salt, + in octetstring p_pki_message, + out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, + out Oct16 p_aes_sym_key, + out Oct16 p_encrypted_sym_key, + out Oct16 p_authentication_vector, + out Oct12 p_nonce, + out Oct32 p_request_hash + ) return boolean { + // Local variables + var template (value) EccP256CurvePoint v_eccP256_curve_point; + var HashedId8 v_recipientId; + var octetstring v_public_compressed_ephemeral_key; + var integer v_public_compressed_ephemeral_mode; + var octetstring v_encrypted_request; + + log(">>> f_build_pki_secured_request_message"); + + // The 'p_request_hash' shall be the SHA256 digest of the OER representation of the topmost EtsiTs103097Data-Encoded structure if (PICS_SEC_FIXED_KEYS) { p_request_hash := '10ED97A2F2933DD3AC55F47022D125E18F5E1AA024613E616A75BA4979EFE318'O; } else { - p_request_hash := f_hashWithSha256(v_encoded_inner_ec_request); + p_request_hash := f_hashWithSha256(p_pki_message); log("p_request_hash= ", p_request_hash); } // Encrypt encode EtsiTs103097Data-Signed data structure if (PICS_SEC_FIXED_KEYS) { p_salt := '77C0637C3558B3238FDE1EEC376DA080BE4076FB8491CA0F8C19FD34DF298CEB'O; } - v_encrypted_inner_ec_request := f_encryptWithEciesNistp256WithSha256(v_encoded_inner_ec_request, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_ephemeralKeyModeCompressed, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, PICS_SEC_FIXED_KEYS); + v_encrypted_request := f_encryptWithEciesNistp256WithSha256(p_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, PICS_SEC_FIXED_KEYS); log("p_aes_sym_key= ", p_aes_sym_key); log("p_encrypted_sym_key= ", p_encrypted_sym_key); log("p_authentication_vector= ", p_authentication_vector); @@ -1117,7 +1212,7 @@ module LibItsPki_Functions { } log("v_recipientId= ", v_recipientId); // Fill Certificate template with the public compressed keys (canonical form) - if (v_ephemeralKeyModeCompressed == 0) { + if (v_public_compressed_ephemeral_mode == 0) { v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); } else { v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_compressed_ephemeral_key)); @@ -1139,7 +1234,7 @@ module LibItsPki_Functions { m_SymmetricCiphertext_aes128ccm( m_aesCcmCiphertext( p_nonce, - v_encrypted_inner_ec_request + v_encrypted_request ) ) ) -- GitLab From ad43a4f966911f73ff11306aede88f97c20ff40b Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 10 Jan 2019 05:03:23 -0800 Subject: [PATCH 168/320] Update ASN.1 files with latest version --- asn1/CAM/CAM.asn | 72 +- asn1/DENM/DENM.asn | 129 ++-- ...argingSpotReservation_PDU_Descriptions.asn | 4 +- asn1/EVCSN/EVCSN_PDU_Descriptions.asn | 4 +- .../ETSI_TS_103301/IVIM_PDU_Descriptions.asn | 2 +- .../ETSI_TS_103301/MAPEM_PDU_Descriptions.asn | 2 +- .../SPATEM_PDU_Descriptions.asn | 2 +- .../ETSI_TS_103301/SREM_PDU_Descriptions.asn | 2 +- .../ETSI_TS_103301/SSEM_PDU_Descriptions.asn | 2 +- asn1/IS/ISO_TS_19091/AddGrpC.asn | 2 +- asn1/IS/ISO_TS_19091/DSRC.asn | 2 +- .../ISO_TS_19091/DSRC_REGION_noCircular.asn | 2 +- asn1/IS/ISO_TS_19091/original/AddGrpC.asn | 2 +- asn1/IS/ISO_TS_19091/original/DSRC.asn | 2 +- asn1/IS/ISO_TS_19321/IVI.asn | 2 +- asn1/ITS-Container/ITS_Container.asn | 122 ++-- .../1609Dot2/IEEE1609dot2BaseTypes.asn | 667 +++++++++--------- asn1/Security/EtsiTs103097Module.asn | 210 +++--- .../TS102921/EtsiTs102941BaseTypes.asn | 126 ++-- .../TS102921/EtsiTs102941MessagesCA.asn | 174 ++--- .../TS102921/EtsiTs102941MessagesItss.asn | 164 ++--- ...siTs102941MessagesItss_OptionalPrivacy.asn | 151 ++-- .../TS102921/EtsiTs102941TrustLists.asn | 284 ++++---- .../EtsiTs102941TypesAuthorization.asn | 182 ++--- ...siTs102941TypesAuthorizationValidation.asn | 131 ++-- .../EtsiTs102941TypesCaManagement.asn | 62 +- .../TS102921/EtsiTs102941TypesEnrolment.asn | 134 ++-- .../LibItsCommon_ASN1_NamedNumbers.ttcn | 6 +- ttcn/Pki/LibItsPki_Functions.ttcn | 2 +- ttcn/Pki/LibItsPki_Pics.ttcn | 2 +- ttcn/Pki/LibItsPki_Templates.ttcn | 4 +- ttcn/Pki/LibItsPki_TypesAndValues.ttcn | 2 +- 32 files changed, 1330 insertions(+), 1324 deletions(-) diff --git a/asn1/CAM/CAM.asn b/asn1/CAM/CAM.asn index e6cb301a..13e1488a 100644 --- a/asn1/CAM/CAM.asn +++ b/asn1/CAM/CAM.asn @@ -1,5 +1,5 @@ CAM-PDU-Descriptions { -itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) en (302637) cam (2) version (1) +itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) en (302637) cam (2) version (2) } DEFINITIONS AUTOMATIC TAGS ::= @@ -8,15 +8,15 @@ BEGIN IMPORTS ItsPduHeader, CauseCode, ReferencePosition, AccelerationControl, Curvature, CurvatureCalculationMode, Heading, LanePosition, EmergencyPriority, EmbarkationStatus, Speed, DriveDirection, LongitudinalAcceleration, LateralAcceleration, VerticalAcceleration, StationType, ExteriorLights, DangerousGoodsBasic, SpecialTransportType, LightBarSirenInUse, VehicleRole, VehicleLength, VehicleWidth, PathHistory, RoadworksSubCauseCode, ClosedLanes, TrafficRule, SpeedLimit, SteeringWheelAngle, PerformanceClass, YawRate, ProtectedCommunicationZone, PtActivation, Latitude, Longitude, ProtectedCommunicationZonesRSU, CenDsrcTollingZone FROM ITS-Container { -itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) +itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) }; --- The root data frame for cooperative awareness messages +-- The root data frame for cooperative awareness messages CAM ::= SEQUENCE { - header ItsPduHeader, - cam CoopAwareness + header ItsPduHeader, + cam CoopAwareness } CoopAwareness ::= SEQUENCE { @@ -29,18 +29,18 @@ CamParameters ::= SEQUENCE { highFrequencyContainer HighFrequencyContainer, lowFrequencyContainer LowFrequencyContainer OPTIONAL, specialVehicleContainer SpecialVehicleContainer OPTIONAL, - ... + ... } HighFrequencyContainer ::= CHOICE { basicVehicleContainerHighFrequency BasicVehicleContainerHighFrequency, rsuContainerHighFrequency RSUContainerHighFrequency, - ... + ... } LowFrequencyContainer ::= CHOICE { basicVehicleContainerLowFrequency BasicVehicleContainerLowFrequency, - ... + ... } SpecialVehicleContainer ::= CHOICE { @@ -51,48 +51,48 @@ SpecialVehicleContainer ::= CHOICE { rescueContainer RescueContainer, emergencyContainer EmergencyContainer, safetyCarContainer SafetyCarContainer, - ... + ... } BasicContainer ::= SEQUENCE { - stationType StationType, - referencePosition ReferencePosition, - ... + stationType StationType, + referencePosition ReferencePosition, + ... } BasicVehicleContainerHighFrequency ::= SEQUENCE { heading Heading, speed Speed, - driveDirection DriveDirection, - vehicleLength VehicleLength, - vehicleWidth VehicleWidth, - longitudinalAcceleration LongitudinalAcceleration, + driveDirection DriveDirection, + vehicleLength VehicleLength, + vehicleWidth VehicleWidth, + longitudinalAcceleration LongitudinalAcceleration, curvature Curvature, - curvatureCalculationMode CurvatureCalculationMode, + curvatureCalculationMode CurvatureCalculationMode, yawRate YawRate, - accelerationControl AccelerationControl OPTIONAL, - lanePosition LanePosition OPTIONAL, + accelerationControl AccelerationControl OPTIONAL, + lanePosition LanePosition OPTIONAL, steeringWheelAngle SteeringWheelAngle OPTIONAL, - lateralAcceleration LateralAcceleration OPTIONAL, - verticalAcceleration VerticalAcceleration OPTIONAL, + lateralAcceleration LateralAcceleration OPTIONAL, + verticalAcceleration VerticalAcceleration OPTIONAL, performanceClass PerformanceClass OPTIONAL, - cenDsrcTollingZone CenDsrcTollingZone OPTIONAL + cenDsrcTollingZone CenDsrcTollingZone OPTIONAL } BasicVehicleContainerLowFrequency ::= SEQUENCE { - vehicleRole VehicleRole, - exteriorLights ExteriorLights, + vehicleRole VehicleRole, + exteriorLights ExteriorLights, pathHistory PathHistory } PublicTransportContainer ::= SEQUENCE { - embarkationStatus EmbarkationStatus, + embarkationStatus EmbarkationStatus, ptActivation PtActivation OPTIONAL } SpecialTransportContainer ::= SEQUENCE { - specialTransportType SpecialTransportType, - lightBarSirenInUse LightBarSirenInUse + specialTransportType SpecialTransportType, + lightBarSirenInUse LightBarSirenInUse } DangerousGoodsContainer ::= SEQUENCE { @@ -106,25 +106,25 @@ SpecialTransportContainer ::= SEQUENCE { } RescueContainer ::= SEQUENCE { - lightBarSirenInUse LightBarSirenInUse + lightBarSirenInUse LightBarSirenInUse } EmergencyContainer ::= SEQUENCE { - lightBarSirenInUse LightBarSirenInUse, - incidentIndication CauseCode OPTIONAL, - emergencyPriority EmergencyPriority OPTIONAL + lightBarSirenInUse LightBarSirenInUse, + incidentIndication CauseCode OPTIONAL, + emergencyPriority EmergencyPriority OPTIONAL } SafetyCarContainer ::= SEQUENCE { - lightBarSirenInUse LightBarSirenInUse, - incidentIndication CauseCode OPTIONAL, - trafficRule TrafficRule OPTIONAL, + lightBarSirenInUse LightBarSirenInUse, + incidentIndication CauseCode OPTIONAL, + trafficRule TrafficRule OPTIONAL, speedLimit SpeedLimit OPTIONAL } RSUContainerHighFrequency ::= SEQUENCE { - protectedCommunicationZonesRSU ProtectedCommunicationZonesRSU OPTIONAL, - ... + protectedCommunicationZonesRSU ProtectedCommunicationZonesRSU OPTIONAL, + ... } GenerationDeltaTime ::= INTEGER { oneMilliSec(1) } (0..65535) diff --git a/asn1/DENM/DENM.asn b/asn1/DENM/DENM.asn index 20546bda..8bfee2d1 100644 --- a/asn1/DENM/DENM.asn +++ b/asn1/DENM/DENM.asn @@ -1,103 +1,102 @@ -DENM-PDU-Descriptions { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) en (302637) denm (1) version (1) +DENM-PDU-Descriptions {itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) en (302637) denm (1) version (2) } -DEFINITIONS AUTOMATIC TAGS ::= +DEFINITIONS AUTOMATIC TAGS ::= BEGIN IMPORTS ItsPduHeader, CauseCode, Speed, InformationQuality, ReferencePosition, ClosedLanes, DangerousGoodsExtended, Heading, LanePosition, LightBarSirenInUse, RoadType, HeightLonCarr, PosLonCarr, PosCentMass, PositioningSolutionType, RequestResponseIndication, StationType, SpeedLimit, StationarySince, TimestampIts, WheelBaseVehicle, TurningRadius, PosFrontAx, PositionOfOccupants, Temperature, VehicleMass, VehicleIdentification, EnergyStorageType, ActionID, ItineraryPath, NumberOfOccupants, PositionOfPillars, RelevanceTrafficDirection, RestrictedTypes, Traces, TransmissionInterval, ValidityDuration, RelevanceDistance, EventHistory, TrafficRule, DeltaReferencePosition FROM ITS-Container { -itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) +itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) }; DENM ::= SEQUENCE { - header ItsPduHeader, - denm DecentralizedEnvironmentalNotificationMessage + header ItsPduHeader, + denm DecentralizedEnvironmentalNotificationMessage } DecentralizedEnvironmentalNotificationMessage ::= SEQUENCE { - management ManagementContainer, - situation SituationContainer OPTIONAL, - location LocationContainer OPTIONAL, - alacarte AlacarteContainer OPTIONAL + management ManagementContainer, + situation SituationContainer OPTIONAL, + location LocationContainer OPTIONAL, + alacarte AlacarteContainer OPTIONAL } ManagementContainer ::= SEQUENCE { - actionID ActionID, - detectionTime TimestampIts, - referenceTime TimestampIts, - termination Termination OPTIONAL, - eventPosition ReferencePosition, - relevanceDistance RelevanceDistance OPTIONAL, - relevanceTrafficDirection RelevanceTrafficDirection OPTIONAL, - validityDuration ValidityDuration DEFAULT defaultValidity, - transmissionInterval TransmissionInterval OPTIONAL, - stationType StationType, - ... + actionID ActionID, + detectionTime TimestampIts, + referenceTime TimestampIts, + termination Termination OPTIONAL, + eventPosition ReferencePosition, + relevanceDistance RelevanceDistance OPTIONAL, + relevanceTrafficDirection RelevanceTrafficDirection OPTIONAL, + validityDuration ValidityDuration DEFAULT defaultValidity, + transmissionInterval TransmissionInterval OPTIONAL, + stationType StationType, + ... } SituationContainer ::= SEQUENCE { - informationQuality InformationQuality, - eventType CauseCode, - linkedCause CauseCode OPTIONAL, - eventHistory EventHistory OPTIONAL, - ... + informationQuality InformationQuality, + eventType CauseCode, + linkedCause CauseCode OPTIONAL, + eventHistory EventHistory OPTIONAL, + ... } LocationContainer ::= SEQUENCE { - eventSpeed Speed OPTIONAL, - eventPositionHeading Heading OPTIONAL, - traces Traces, - roadType RoadType OPTIONAL, - ... + eventSpeed Speed OPTIONAL, + eventPositionHeading Heading OPTIONAL, + traces Traces, + roadType RoadType OPTIONAL, + ... } ImpactReductionContainer ::= SEQUENCE { - heightLonCarrLeft HeightLonCarr, - heightLonCarrRight HeightLonCarr, - posLonCarrLeft PosLonCarr, - posLonCarrRight PosLonCarr, - positionOfPillars PositionOfPillars, - posCentMass PosCentMass, - wheelBaseVehicle WheelBaseVehicle, - turningRadius TurningRadius, - posFrontAx PosFrontAx, - positionOfOccupants PositionOfOccupants, - vehicleMass VehicleMass, - requestResponseIndication RequestResponseIndication + heightLonCarrLeft HeightLonCarr, + heightLonCarrRight HeightLonCarr, + posLonCarrLeft PosLonCarr, + posLonCarrRight PosLonCarr, + positionOfPillars PositionOfPillars, + posCentMass PosCentMass, + wheelBaseVehicle WheelBaseVehicle, + turningRadius TurningRadius, + posFrontAx PosFrontAx, + positionOfOccupants PositionOfOccupants, + vehicleMass VehicleMass, + requestResponseIndication RequestResponseIndication } RoadWorksContainerExtended ::= SEQUENCE { - lightBarSirenInUse LightBarSirenInUse OPTIONAL, - closedLanes ClosedLanes OPTIONAL, - restriction RestrictedTypes OPTIONAL, - speedLimit SpeedLimit OPTIONAL, - incidentIndication CauseCode OPTIONAL, - recommendedPath ItineraryPath OPTIONAL, - startingPointSpeedLimit DeltaReferencePosition OPTIONAL, - trafficFlowRule TrafficRule OPTIONAL, - referenceDenms ReferenceDenms OPTIONAL + lightBarSirenInUse LightBarSirenInUse OPTIONAL, + closedLanes ClosedLanes OPTIONAL, + restriction RestrictedTypes OPTIONAL, + speedLimit SpeedLimit OPTIONAL, + incidentIndication CauseCode OPTIONAL, + recommendedPath ItineraryPath OPTIONAL, + startingPointSpeedLimit DeltaReferencePosition OPTIONAL, + trafficFlowRule TrafficRule OPTIONAL, + referenceDenms ReferenceDenms OPTIONAL } StationaryVehicleContainer ::= SEQUENCE { - stationarySince StationarySince OPTIONAL, - stationaryCause CauseCode OPTIONAL, - carryingDangerousGoods DangerousGoodsExtended OPTIONAL, - numberOfOccupants NumberOfOccupants OPTIONAL, - vehicleIdentification VehicleIdentification OPTIONAL, - energyStorageType EnergyStorageType OPTIONAL + stationarySince StationarySince OPTIONAL, + stationaryCause CauseCode OPTIONAL, + carryingDangerousGoods DangerousGoodsExtended OPTIONAL, + numberOfOccupants NumberOfOccupants OPTIONAL, + vehicleIdentification VehicleIdentification OPTIONAL, + energyStorageType EnergyStorageType OPTIONAL } AlacarteContainer ::= SEQUENCE { - lanePosition LanePosition OPTIONAL, - impactReduction ImpactReductionContainer OPTIONAL, - externalTemperature Temperature OPTIONAL, - roadWorks RoadWorksContainerExtended OPTIONAL, - positioningSolution PositioningSolutionType OPTIONAL, - stationaryVehicle StationaryVehicleContainer OPTIONAL, - ... + lanePosition LanePosition OPTIONAL, + impactReduction ImpactReductionContainer OPTIONAL, + externalTemperature Temperature OPTIONAL, + roadWorks RoadWorksContainerExtended OPTIONAL, + positioningSolution PositioningSolutionType OPTIONAL, + stationaryVehicle StationaryVehicleContainer OPTIONAL, + ... } defaultValidity INTEGER ::= 600 diff --git a/asn1/EV-RSR/EV_RechargingSpotReservation_PDU_Descriptions.asn b/asn1/EV-RSR/EV_RechargingSpotReservation_PDU_Descriptions.asn index d8f79ac3..8a61a6e4 100644 --- a/asn1/EV-RSR/EV_RechargingSpotReservation_PDU_Descriptions.asn +++ b/asn1/EV-RSR/EV_RechargingSpotReservation_PDU_Descriptions.asn @@ -8,7 +8,7 @@ BEGIN IMPORTS ItsPduHeader FROM ITS-Container { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) + itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) }; EV-RSR ::= SEQUENCE { @@ -154,4 +154,4 @@ UpdateResponseCode ::= ENUMERATED { ok, unknown-Reservation-ID, mismatching-Rese StatusResponseCode ::= ENUMERATED { charging-Spot-Occupied, charging-Spot-Unoccupied, charging-Ongoing, reservation-Limit-Exceeded, reservation-Cancelled, unknown-Reservation-ID, expired-Reservation-ID } -END \ No newline at end of file +END diff --git a/asn1/EVCSN/EVCSN_PDU_Descriptions.asn b/asn1/EVCSN/EVCSN_PDU_Descriptions.asn index 8d67d8f6..a8ffa3c6 100644 --- a/asn1/EVCSN/EVCSN_PDU_Descriptions.asn +++ b/asn1/EVCSN/EVCSN_PDU_Descriptions.asn @@ -18,7 +18,7 @@ IMPORTS TimestampIts, ReferencePosition FROM ITS-Container { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) + itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) }; -- Root Message PDU: EvcsnPdu @@ -99,4 +99,4 @@ SpotAvailability ::= SEQUENCE { POIType ::= INTEGER(0..65535) NumberStations ::= INTEGER(1..256) -END \ No newline at end of file +END diff --git a/asn1/IS/ETSI_TS_103301/IVIM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/IVIM_PDU_Descriptions.asn index a3263b72..1b80fe88 100644 --- a/asn1/IS/ETSI_TS_103301/IVIM_PDU_Descriptions.asn +++ b/asn1/IS/ETSI_TS_103301/IVIM_PDU_Descriptions.asn @@ -14,7 +14,7 @@ BEGIN IMPORTS IviStructure FROM IVI {iso (1) standard (0) ivi (19321) version1 (1)} -ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1)}; +ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2)}; IVIM ::= SEQUENCE { diff --git a/asn1/IS/ETSI_TS_103301/MAPEM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/MAPEM_PDU_Descriptions.asn index efad7d23..990ed1c5 100644 --- a/asn1/IS/ETSI_TS_103301/MAPEM_PDU_Descriptions.asn +++ b/asn1/IS/ETSI_TS_103301/MAPEM_PDU_Descriptions.asn @@ -14,7 +14,7 @@ BEGIN IMPORTS MapData FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } -ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1)}; +ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2)}; MAPEM ::= SEQUENCE { diff --git a/asn1/IS/ETSI_TS_103301/SPATEM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/SPATEM_PDU_Descriptions.asn index 6adc54fa..fea567f3 100644 --- a/asn1/IS/ETSI_TS_103301/SPATEM_PDU_Descriptions.asn +++ b/asn1/IS/ETSI_TS_103301/SPATEM_PDU_Descriptions.asn @@ -16,7 +16,7 @@ BEGIN IMPORTS SPAT FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } -ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) }; +ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) }; SPATEM ::= SEQUENCE { diff --git a/asn1/IS/ETSI_TS_103301/SREM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/SREM_PDU_Descriptions.asn index 8d584dec..914dff6b 100644 --- a/asn1/IS/ETSI_TS_103301/SREM_PDU_Descriptions.asn +++ b/asn1/IS/ETSI_TS_103301/SREM_PDU_Descriptions.asn @@ -14,7 +14,7 @@ BEGIN IMPORTS SignalRequestMessage FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } -ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) }; +ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) }; SREM ::= SEQUENCE { header ItsPduHeader, diff --git a/asn1/IS/ETSI_TS_103301/SSEM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/SSEM_PDU_Descriptions.asn index 50e8b835..5eed2365 100644 --- a/asn1/IS/ETSI_TS_103301/SSEM_PDU_Descriptions.asn +++ b/asn1/IS/ETSI_TS_103301/SSEM_PDU_Descriptions.asn @@ -14,7 +14,7 @@ BEGIN IMPORTS SignalStatusMessage FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } -ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) }; +ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) }; SSEM ::= SEQUENCE { diff --git a/asn1/IS/ISO_TS_19091/AddGrpC.asn b/asn1/IS/ISO_TS_19091/AddGrpC.asn index 733d324a..bbe44e92 100644 --- a/asn1/IS/ISO_TS_19091/AddGrpC.asn +++ b/asn1/IS/ISO_TS_19091/AddGrpC.asn @@ -24,7 +24,7 @@ IMPORTS --FIXME RGY all definitions are moved to IS-DSRC-noCircular to cut circular import loop --NodeOffsetPointXY, NodeSetXY, PrioritizationResponseStatus, SignalGroupID, DeltaTime, LaneID FROM DSRC NodeOffsetPointXY, NodeSetXY, PrioritizationResponseStatus, SignalGroupID, DeltaTime, LaneID FROM DSRC-REGION-noCircular -Altitude, StationID, DeltaAltitude FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) }; +Altitude, StationID, DeltaAltitude FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) }; ConnectionManeuverAssist-addGrpC ::= SEQUENCE { diff --git a/asn1/IS/ISO_TS_19091/DSRC.asn b/asn1/IS/ISO_TS_19091/DSRC.asn index 6d9b86d8..bc326b27 100644 --- a/asn1/IS/ISO_TS_19091/DSRC.asn +++ b/asn1/IS/ISO_TS_19091/DSRC.asn @@ -20,7 +20,7 @@ DEFINITIONS AUTOMATIC TAGS::= BEGIN IMPORTS --FIXME RGY definitions moved to module DSRC-REGION-noCircular are commented our below -StationID, Longitude, Latitude, SpeedConfidence FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) } +StationID, Longitude, Latitude, SpeedConfidence FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) } Reg-SPAT,Reg-SignalRequestMessage, Reg-SignalStatusMessage, Reg-MapData, Reg-AdvisorySpeed, Reg-ComputedLane, Reg-ConnectionManeuverAssist, Reg-GenericLane, Reg-IntersectionGeometry, Reg-IntersectionState, Reg-LaneAttributes, /*Reg-LaneDataAttribute,*/ Reg-MovementEvent, Reg-MovementState, /*Reg-NodeAttributeSetXY, Reg-NodeOffsetPointXY,*/ Reg-Position3D, Reg-RequestorDescription, Reg-RequestorType, Reg-RestrictionUserType, Reg-RoadSegment, diff --git a/asn1/IS/ISO_TS_19091/DSRC_REGION_noCircular.asn b/asn1/IS/ISO_TS_19091/DSRC_REGION_noCircular.asn index f352d2ae..af0c3c1c 100644 --- a/asn1/IS/ISO_TS_19091/DSRC_REGION_noCircular.asn +++ b/asn1/IS/ISO_TS_19091/DSRC_REGION_noCircular.asn @@ -12,7 +12,7 @@ DSRC-REGION-noCircular { iso (1) standard (0) signalizedIntersection (19091) pro DEFINITIONS AUTOMATIC TAGS::= BEGIN IMPORTS -Longitude, Latitude FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) } +Longitude, Latitude FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) } Control-addGrpC FROM AddGrpC-noCircular { iso (1) standard (0) signalizedIntersection (19091) profilec(2) addgrpc (0) version (1) }; diff --git a/asn1/IS/ISO_TS_19091/original/AddGrpC.asn b/asn1/IS/ISO_TS_19091/original/AddGrpC.asn index ce1f9d68..ae7936d1 100644 --- a/asn1/IS/ISO_TS_19091/original/AddGrpC.asn +++ b/asn1/IS/ISO_TS_19091/original/AddGrpC.asn @@ -23,7 +23,7 @@ DEFINITIONS AUTOMATIC TAGS::= BEGIN IMPORTS NodeOffsetPointXY, NodeSetXY, PrioritizationResponseStatus, SignalGroupID, DeltaTime, LaneID FROM DSRC -Altitude, StationID, DeltaAltitude FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) }; +Altitude, StationID, DeltaAltitude FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) }; ConnectionManeuverAssist-addGrpC ::= SEQUENCE { diff --git a/asn1/IS/ISO_TS_19091/original/DSRC.asn b/asn1/IS/ISO_TS_19091/original/DSRC.asn index 6dd38f02..8ae9c1c1 100644 --- a/asn1/IS/ISO_TS_19091/original/DSRC.asn +++ b/asn1/IS/ISO_TS_19091/original/DSRC.asn @@ -21,7 +21,7 @@ DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) DEFINITIONS AUTOMATIC TAGS::= BEGIN IMPORTS -StationID, Longitude, Latitude, SpeedConfidence FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) } +StationID, Longitude, Latitude, SpeedConfidence FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) } Reg-SPAT,Reg-SignalRequestMessage, Reg-SignalStatusMessage, Reg-MapData, Reg-AdvisorySpeed, Reg-ComputedLane, Reg-ConnectionManeuverAssist, Reg-GenericLane, Reg-IntersectionGeometry, Reg-IntersectionState, Reg-LaneAttributes, Reg-LaneDataAttribute, Reg-MovementEvent, Reg-MovementState, Reg-NodeAttributeSetXY, Reg-NodeOffsetPointXY,Reg-Position3D, Reg-RequestorDescription, Reg-RequestorType, Reg-RestrictionUserType, Reg-RoadSegment, diff --git a/asn1/IS/ISO_TS_19321/IVI.asn b/asn1/IS/ISO_TS_19321/IVI.asn index c923226b..d9b3773c 100644 --- a/asn1/IS/ISO_TS_19321/IVI.asn +++ b/asn1/IS/ISO_TS_19321/IVI.asn @@ -16,7 +16,7 @@ DEFINITIONS AUTOMATIC TAGS ::= BEGIN IMPORTS ItsPduHeader, Altitude, DangerousGoodsBasic , DeltaLatitude, DeltaLongitude, DeltaReferencePosition, Heading, HeadingValue, Latitude, LanePosition, Longitude, ReferencePosition, RoadType, SpecialTransportType, Speed, StationType, TimestampIts, VehicleRole -FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) } +FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) } AxleWeightLimits, DieselEmissionValues, ExhaustEmissionValues, EngineCharacteristics, EnvironmentalCharacteristics, PassengerCapacity , Provider, SoundLevel, VehicleDimensions, VehicleWeightLimits FROM EfcDsrcApplication {iso(1) standard(0) 14906 application(0) version5(5)} diff --git a/asn1/ITS-Container/ITS_Container.asn b/asn1/ITS-Container/ITS_Container.asn index a67ab8c8..29e19c35 100644 --- a/asn1/ITS-Container/ITS_Container.asn +++ b/asn1/ITS-Container/ITS_Container.asn @@ -1,5 +1,5 @@ ITS-Container { -itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) +itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) } DEFINITIONS AUTOMATIC TAGS ::= @@ -9,8 +9,8 @@ BEGIN IMPORTS; ItsPduHeader ::= SEQUENCE { - protocolVersion INTEGER{currentVersion(1)} (0..255), - messageID INTEGER{ denm(1), cam(2), poi(3), spatem(4), mapem(5), ivim(6), ev-rsr(7), tistpgtransaction(8), srem(9), ssem(10), evcsn(11) } (0..255), -- Mantis #7209, #7005 + protocolVersion INTEGER (0..255), + messageID INTEGER{ denm(1), cam(2), poi(3), spatem(4), mapem(5), ivim(6), ev-rsr(7), tistpgtransaction(8), srem(9), ssem(10), evcsn(11), saem(12), rtcmem(13) } (0..255), -- Mantis #7209, #7005 stationID StationID } @@ -34,8 +34,8 @@ Longitude ::= INTEGER {oneMicrodegreeEast (10), oneMicrodegreeWest (-10), unavai Latitude ::= INTEGER {oneMicrodegreeNorth (10), oneMicrodegreeSouth (-10), unavailable(900000001)} (-900000000..900000001) Altitude ::= SEQUENCE { - altitudeValue AltitudeValue, - altitudeConfidence AltitudeConfidence + altitudeValue AltitudeValue, + altitudeConfidence AltitudeConfidence } AltitudeValue ::= INTEGER {referenceEllipsoidSurface(0), oneCentimeter(1), unavailable(800001)} (-100000..800001) @@ -61,7 +61,7 @@ AltitudeConfidence ::= ENUMERATED { DeltaLongitude ::= INTEGER {oneMicrodegreeEast (10), oneMicrodegreeWest (-10), unavailable(131072)} (-131071..131072) -DeltaLatitude ::= INTEGER {oneMicrodegreeNorth (10), oneMicrodegreeSouth (-10) , unavailable(131072)} (-131071..131072) +DeltaLatitude ::= INTEGER {oneMicrodegreeNorth (10), oneMicrodegreeSouth (-10) , unavailable(131072)} (-131071..131072) DeltaAltitude ::= INTEGER {oneCentimeterUp (1), oneCentimeterDown (-1), unavailable(12800)} (-12700..12800) @@ -97,12 +97,12 @@ AccelerationControl ::= BIT STRING { speedLimiterEngaged (6) } (SIZE(7)) - SemiAxisLength ::= INTEGER{oneCentimeter(1), outOfRange(4094), unavailable(4095)} (0..4095) CauseCode ::= SEQUENCE { causeCode CauseCodeType, - subCauseCode SubCauseCodeType + subCauseCode SubCauseCodeType, + ... } CauseCodeType ::= INTEGER { @@ -110,7 +110,9 @@ CauseCodeType ::= INTEGER { trafficCondition (1), accident (2), roadworks (3), + impassability (5), adverseWeatherCondition-Adhesion (6), + aquaplannning (7), hazardousLocation-SurfaceCondition (9), hazardousLocation-ObstacleOnTheRoad (10), hazardousLocation-AnimalOnTheRoad (11), @@ -133,7 +135,7 @@ CauseCodeType ::= INTEGER { dangerousSituation (99) } (0..255) -SubCauseCodeType ::= INTEGER (0..255) +SubCauseCodeType ::= INTEGER (0..255) TrafficConditionSubCauseCode ::= INTEGER {unavailable(0), increasedVolumeOfTraffic(1), trafficJamSlowlyIncreasing(2), trafficJamIncreasing(3), trafficJamStronglyIncreasing(4), trafficStationary(5), trafficJamSlightlyDecreasing(6), trafficJamDecreasing(7), trafficJamStronglyDecreasing(8)} (0..255) @@ -154,7 +156,7 @@ AdverseWeatherCondition-VisibilitySubCauseCode ::= INTEGER {unavailable(0), fog( AdverseWeatherCondition-PrecipitationSubCauseCode ::= INTEGER {unavailable(0), heavyRain(1), heavySnowfall(2), softHail(3)} (0..255) SlowVehicleSubCauseCode ::= INTEGER {unavailable(0), maintenanceVehicle(1), vehiclesSlowingToLookAtAccident(2), abnormalLoad(3), abnormalWideLoad(4), convoy(5), snowplough(6), deicing(7), saltingVehicles(8)} (0..255) - + StationaryVehicleSubCauseCode ::= INTEGER {unavailable(0), humanProblem(1), vehicleBreakdown(2), postCrash(3), publicTransportStop(4), carryingDangerousGoods(5)} (0..255) HumanProblemSubCauseCode ::= INTEGER {unavailable(0), glycemiaProblem(1), heartProblem(2)} (0..255) @@ -169,26 +171,26 @@ HazardousLocation-ObstacleOnTheRoadSubCauseCode ::= INTEGER {unavailable(0), she HazardousLocation-AnimalOnTheRoadSubCauseCode ::= INTEGER {unavailable(0), wildAnimals(1), herdOfAnimals(2), smallAnimals(3), largeAnimals(4)} (0..255) - CollisionRiskSubCauseCode ::= INTEGER {unavailable(0), longitudinalCollisionRisk(1), crossingCollisionRisk(2), lateralCollisionRisk(3), vulnerableRoadUser(4)} (0..255) - - SignalViolationSubCauseCode ::= INTEGER {unavailable(0), stopSignViolation(1), trafficLightViolation(2), turningRegulationViolation(3)} (0..255) +CollisionRiskSubCauseCode ::= INTEGER {unavailable(0), longitudinalCollisionRisk(1), crossingCollisionRisk(2), lateralCollisionRisk(3), vulnerableRoadUser(4)} (0..255) + +SignalViolationSubCauseCode ::= INTEGER {unavailable(0), stopSignViolation(1), trafficLightViolation(2), turningRegulationViolation(3)} (0..255) RescueAndRecoveryWorkInProgressSubCauseCode ::= INTEGER {unavailable(0), emergencyVehicles(1), rescueHelicopterLanding(2), policeActivityOngoing(3), medicalEmergencyOngoing(4), childAbductionInProgress(5)} (0..255) DangerousEndOfQueueSubCauseCode ::= INTEGER {unavailable(0), suddenEndOfQueue(1), queueOverHill(2), queueAroundBend(3), queueInTunnel(4)} (0..255) -DangerousSituationSubCauseCode ::= INTEGER {unavailable(0), emergencyElectronicBrakeEngaged(1), preCrashSystemEngaged(2), espEngaged(3), absEngaged(4), aebEngaged(5), brakeWarningEngaged(6), collisionRiskWarningEngaged(7)} (0..255) +DangerousSituationSubCauseCode ::= INTEGER {unavailable(0), emergencyElectronicBrakeEngaged(1), preCrashSystemEngaged(2), espEngaged(3), absEngaged(4), aebEngaged(5), brakeWarningEngaged(6), collisionRiskWarningEngaged(7)} (0..255) -VehicleBreakdownSubCauseCode ::= INTEGER {unavailable(0), lackOfFuel (1), lackOfBatteryPower (2), engineProblem(3), transmissionProblem(4), engineCoolingProblem(5), brakingSystemProblem(6), steeringProblem(7), tyrePuncture(8)} (0..255) +VehicleBreakdownSubCauseCode ::= INTEGER {unavailable(0), lackOfFuel (1), lackOfBatteryPower (2), engineProblem(3), transmissionProblem(4), engineCoolingProblem(5), brakingSystemProblem(6), steeringProblem(7), tyrePuncture(8), tyrePressureProblem(9)} (0..255) PostCrashSubCauseCode ::= INTEGER {unavailable(0), accidentWithoutECallTriggered (1), accidentWithECallManuallyTriggered (2), accidentWithECallAutomaticallyTriggered (3), accidentWithECallTriggeredWithoutAccessToCellularNetwork(4)} (0..255) Curvature ::= SEQUENCE { - curvatureValue CurvatureValue, - curvatureConfidence CurvatureConfidence + curvatureValue CurvatureValue, + curvatureConfidence CurvatureConfidence } -CurvatureValue ::= INTEGER {straight(0), reciprocalOf1MeterRadiusToRight(-30000), reciprocalOf1MeterRadiusToLeft(30000), unavailable(30001)} (-30000..30001) +CurvatureValue ::= INTEGER {straight(0), unavailable(1023)} (-1023..1023) CurvatureConfidence ::= ENUMERATED { onePerMeter-0-00002 (0), @@ -211,20 +213,18 @@ Heading ::= SEQUENCE { HeadingValue ::= INTEGER {wgs84North(0), wgs84East(900), wgs84South(1800), wgs84West(2700), unavailable(3601)} (0..3601) HeadingConfidence ::= INTEGER {equalOrWithinZeroPointOneDegree (1), equalOrWithinOneDegree (10), outOfRange(126), unavailable(127)} (1..127) - -LanePosition::= INTEGER {offTheRoad(-1), hardShoulder(0), -outermostDrivingLane(1), secondLaneFromOutside(2)} (-1..14) +LanePosition::= INTEGER {offTheRoad(-1), hardShoulder(0), outermostDrivingLane(1), secondLaneFromOutside(2)} (-1..14) ClosedLanes ::= SEQUENCE { - hardShoulderStatus HardShoulderStatus OPTIONAL, - drivingLaneStatus DrivingLaneStatus, + innerhardShoulderStatus HardShoulderStatus OPTIONAL, + outerhardShoulderStatus HardShoulderStatus OPTIONAL, + drivingLaneStatus DrivingLaneStatus OPTIONAL, ... } HardShoulderStatus ::= ENUMERATED {availableForStopping(0), closed(1), availableForDriving(2)} -DrivingLaneStatus ::= BIT STRING (SIZE (1..14)) - +DrivingLaneStatus ::= BIT STRING (SIZE (1..13)) PerformanceClass ::= INTEGER {unavailable(0), performanceClassA(1), performanceClassB(2)} (0..7) @@ -232,7 +232,7 @@ SpeedValue ::= INTEGER {standstill(0), oneCentimeterPerSec(1), unavailable(16383 SpeedConfidence ::= INTEGER {equalOrWithinOneCentimeterPerSec(1), equalOrWithinOneMeterPerSec(100), outOfRange(126), unavailable(127)} (1..127) -VehicleMass ::= INTEGER {hundredKg(1), unavailable(1024)} (1..1024) +VehicleMass ::= INTEGER {hundredKg(1), unavailable(1024)} (1..1024) Speed ::= SEQUENCE { speedValue SpeedValue, @@ -245,7 +245,7 @@ EmbarkationStatus ::= BOOLEAN LongitudinalAcceleration ::= SEQUENCE { longitudinalAccelerationValue LongitudinalAccelerationValue, - longitudinalAccelerationConfidence AccelerationConfidence + longitudinalAccelerationConfidence AccelerationConfidence } LongitudinalAccelerationValue ::= INTEGER {pointOneMeterPerSecSquaredForward(1), pointOneMeterPerSecSquaredBackward(-1), unavailable(161)} (-160 .. 161) @@ -266,18 +266,17 @@ VerticalAcceleration ::= SEQUENCE { VerticalAccelerationValue ::= INTEGER {pointOneMeterPerSecSquaredUp(1), pointOneMeterPerSecSquaredDown(-1), unavailable(161)} (-160 .. 161) -StationType ::= INTEGER {unknown(0), pedestrian(1), cyclist(2), moped(3), motorcycle(4), passengerCar(5), bus(6), -lightTruck(7), heavyTruck(8), trailer(9), specialVehicles(10), tram(11), roadSideUnit(15)} (0..255) +StationType ::= INTEGER {unknown(0), pedestrian(1), cyclist(2), moped(3), motorcycle(4), passengerCar(5), bus(6), lightTruck(7), heavyTruck(8), trailer(9), specialVehicles(10), tram(11), roadSideUnit(15)} (0..255) ExteriorLights ::= BIT STRING { - lowBeamHeadlightsOn (0), - highBeamHeadlightsOn (1), - leftTurnSignalOn (2), - rightTurnSignalOn (3), - daytimeRunningLightsOn (4), - reverseLightOn (5), - fogLightOn (6), - parkingLightsOn (7) + lowBeamHeadlightsOn (0), + highBeamHeadlightsOn (1), + leftTurnSignalOn (2), + rightTurnSignalOn (3), + daytimeRunningLightsOn (4), + reverseLightOn (5), + fogLightOn (6), + parkingLightsOn (7) } (SIZE(8)) DangerousGoodsBasic::= ENUMERATED { @@ -310,14 +309,15 @@ DangerousGoodsExtended ::= SEQUENCE { tunnelsRestricted BOOLEAN, limitedQuantity BOOLEAN, emergencyActionCode IA5String (SIZE (1..24)) OPTIONAL, - phoneNumber IA5String (SIZE (1..24)) OPTIONAL, - companyName UTF8String (SIZE (1..24)) OPTIONAL + phoneNumber PhoneNumber OPTIONAL, + companyName UTF8String (SIZE (1..24)) OPTIONAL, + ... } SpecialTransportType ::= BIT STRING {heavyLoad(0), excessWidth(1), excessLength(2), excessHeight(3)} (SIZE(4)) LightBarSirenInUse ::= BIT STRING { - lightBarActivated (0), + lightBarActivated (0), sirenActivated (1) } (SIZE(2)) @@ -337,8 +337,7 @@ StationarySince ::= ENUMERATED {lessThan1Minute(0), lessThan2Minutes(1), lessTha Temperature ::= INTEGER {equalOrSmallerThanMinus60Deg (-60), oneDegreeCelsius(1), equalOrGreaterThan67Deg(67)} (-60..67) -TrafficRule ::= ENUMERATED {noPassing(0), noPassingForTrucks(1), passToRight(2), passToLeft(3), ... -} +TrafficRule ::= ENUMERATED {noPassing(0), noPassingForTrucks(1), passToRight(2), passToLeft(3), ... } WheelBaseVehicle ::= INTEGER {tenCentimeters(1), unavailable(127)} (1..127) @@ -366,7 +365,8 @@ PositionOfOccupants ::= BIT STRING { row4RightOccupied (16), row4MidOccupied (17), row4NotDetectable (18), - row4NotPresent (19)} (SIZE(20)) + row4NotPresent (19) +} (SIZE(20)) PositioningSolutionType ::= ENUMERATED {noPositioningSolution(0), sGNSS(1), dGNSS(2), sGNSSplusDR(3), dGNSSplusDR(4), dR(5), ...} @@ -387,7 +387,7 @@ VehicleLength ::= SEQUENCE { vehicleLengthConfidenceIndication VehicleLengthConfidenceIndication } -VehicleLengthValue ::= INTEGER {tenCentimeters(1), outOfRange(1022), unavailable(1023)} (1..1023) +VehicleLengthValue ::= INTEGER {tenCentimeters(1), outOfRange(1022), unavailable(1023)} (1..1023) VehicleLengthConfidenceIndication ::= ENUMERATED {noTrailerPresent(0), trailerPresentWithKnownLength(1), trailerPresentWithUnknownLength(2), trailerPresenceIsUnknown(3), unavailable(4)} @@ -403,7 +403,8 @@ RoadType ::= ENUMERATED { urban-NoStructuralSeparationToOppositeLanes(0), urban-WithStructuralSeparationToOppositeLanes(1), nonUrban-NoStructuralSeparationToOppositeLanes(2), - nonUrban-WithStructuralSeparationToOppositeLanes(3)} + nonUrban-WithStructuralSeparationToOppositeLanes(3) +} SteeringWheelAngle ::= SEQUENCE { steeringWheelAngleValue SteeringWheelAngleValue, @@ -416,7 +417,7 @@ SteeringWheelAngleConfidence ::= INTEGER {equalOrWithinOnePointFiveDegree (1), o TimestampIts ::= INTEGER {utcStartOf2004(0), oneMillisecAfterUTCStartOf2004(1)} (0..4398046511103) -VehicleRole ::= ENUMERATED {default(0), publicTransport(1), specialTransport(2), dangerousGoods(3), roadWork(4), rescue(5), emergency(6), safetyCar(7), agriculture(8),commercial(9),military(10),roadOperator(11),taxi(12), reserved1(13), reserved2(14), reserved3(15)} +VehicleRole ::= ENUMERATED {default(0), publicTransport(1), specialTransport(2), dangerousGoods(3), roadWork(4), rescue(5), emergency(6), safetyCar(7), agriculture(8), commercial(9), military(10), roadOperator(11), taxi(12), reserved1(13), reserved2(14), reserved3(15)} YawRate::= SEQUENCE { yawRateValue YawRateValue, @@ -437,7 +438,7 @@ YawRateConfidence ::= ENUMERATED { unavailable (8) } -ProtectedZoneType::= ENUMERATED { cenDsrcTolling (0), ... } +ProtectedZoneType::= ENUMERATED { permanentCenDsrcTolling (0), ..., temporaryCenDsrcTolling (1) } RelevanceDistance ::= ENUMERATED {lessThan50m(0), lessThan100m(1), lessThan200m(2), lessThan500m(3), lessThan1000m(4), lessThan5km(5), lessThan10km(6), over10km(7)} @@ -445,7 +446,7 @@ RelevanceTrafficDirection ::= ENUMERATED {allTrafficDirections(0), upstreamTraff TransmissionInterval ::= INTEGER {oneMilliSecond(1), tenSeconds(10000)} (1..10000) -ValidityDuration ::= INTEGER {timeOfDetection(0), oneSecondAfterDetection(1)} (0..86400) +ValidityDuration ::= INTEGER {timeOfDetection(0), oneSecondAfterDetection(1)} (0..86400) ActionID ::= SEQUENCE { originatingStationID StationID, @@ -455,19 +456,20 @@ ActionID ::= SEQUENCE { ItineraryPath ::= SEQUENCE SIZE(1..40) OF ReferencePosition ProtectedCommunicationZone ::= SEQUENCE { - protectedZoneType ProtectedZoneType, + protectedZoneType ProtectedZoneType, expiryTime TimestampIts OPTIONAL, - protectedZoneLatitude Latitude, - protectedZoneLongitude Longitude, + protectedZoneLatitude Latitude, + protectedZoneLongitude Longitude, protectedZoneRadius ProtectedZoneRadius OPTIONAL, - protectedZoneID ProtectedZoneID OPTIONAL + protectedZoneID ProtectedZoneID OPTIONAL, + ... } Traces ::= SEQUENCE SIZE(1..7) OF PathHistory NumberOfOccupants ::= INTEGER {oneOccupant (1), unavailable(127)} (0 .. 127) -SequenceNumber ::= INTEGER (0..65535) +SequenceNumber ::= INTEGER (0..65535) PositionOfPillars ::= SEQUENCE (SIZE(1..3, ...)) OF PosPillar @@ -481,14 +483,13 @@ EventPoint ::= SEQUENCE { informationQuality InformationQuality } -ProtectedCommunicationZonesRSU ::= SEQUENCE (SIZE(1..16)) OF ProtectedCommunicationZone - - +ProtectedCommunicationZonesRSU ::= SEQUENCE (SIZE(1..16)) OF ProtectedCommunicationZone CenDsrcTollingZone ::= SEQUENCE { protectedZoneLatitude Latitude, protectedZoneLongitude Longitude, - cenDsrcTollingZoneID CenDsrcTollingZoneID OPTIONAL + cenDsrcTollingZoneID CenDsrcTollingZoneID OPTIONAL, + ... } ProtectedZoneRadius ::= INTEGER {oneMeter(1)} (1..255,...) @@ -497,4 +498,9 @@ ProtectedZoneID ::= INTEGER (0.. 134217727) CenDsrcTollingZoneID ::= ProtectedZoneID -END +DigitalMap ::= SEQUENCE (SIZE(1..256)) OF ReferencePosition + +OpeningDaysHours ::= UTF8String + +PhoneNumber ::= NumericString (SIZE(1..16)) +END diff --git a/asn1/Security/1609Dot2/IEEE1609dot2BaseTypes.asn b/asn1/Security/1609Dot2/IEEE1609dot2BaseTypes.asn index d4965a03..700f7b9b 100644 --- a/asn1/Security/1609Dot2/IEEE1609dot2BaseTypes.asn +++ b/asn1/Security/1609Dot2/IEEE1609dot2BaseTypes.asn @@ -1,334 +1,333 @@ -IEEE1609dot2BaseTypes {iso(1) identified-organization(3) ieee(111) -standards-association-numbered-series-standards(2) wave-stds(1609) -dot2(2) base(1) base-types(2) major-version-2(2)} - --- ---******************************************************************** --- IEEE P1609.2 Base Data Types --- ---******************************************************************** - -DEFINITIONS AUTOMATIC TAGS ::= BEGIN - -EXPORTS ALL; -IMPORTS; - --- ------------------------------------------------------------------ --- --- Integers --- --- ------------------------------------------------------------------ - - -Uint3 ::= INTEGER (0..7) -- (hex) 07 -Uint8 ::= INTEGER (0..255) -- (hex) ff -Uint16 ::= INTEGER (0..65535) -- (hex) ff ff -Uint32 ::= INTEGER (0..4294967295)---- -- (hex) ff ff ff ff -Uint64 ::= INTEGER (0..18446744073709551615) -- (hex) ff ff ff ff ff ff ff ff --- Uint64 ::= INTEGER -- -- (hex) ff ff ff ff ff ff ff ff - -SequenceOfUint8 ::= SEQUENCE OF Uint8 -SequenceOfUint16 ::= SEQUENCE OF Uint16 - --- ------------------------------------------------------------------ --- --- OCTET STRING types --- --- ------------------------------------------------------------------ - - -Opaque ::= OCTET STRING - - -HashedId10 ::= OCTET STRING (SIZE(10)) -HashedId8 ::= OCTET STRING (SIZE(8)) -HashedId3 ::= OCTET STRING (SIZE(3)) -SequenceOfHashedId3 ::= SEQUENCE OF HashedId3 - - --- ------------------------------------------------------------------ --- --- Time --- --- ------------------------------------------------------------------ - -Time32 ::= Uint32 -Time64 ::= Uint64 - -ValidityPeriod ::= SEQUENCE { - start Time32, - duration Duration -} - -Duration ::= CHOICE { - microseconds Uint16, - milliseconds Uint16, - seconds Uint16, - minutes Uint16, - hours Uint16, - sixtyHours Uint16, - years Uint16 -} - --- ------------------------------------------------------------------ --- --- Location --- --- ------------------------------------------------------------------ - - -GeographicRegion ::= CHOICE { - circularRegion CircularRegion, - rectangularRegion SequenceOfRectangularRegion, - polygonalRegion PolygonalRegion, - identifiedRegion SequenceOfIdentifiedRegion, - ... -} - -CircularRegion ::= SEQUENCE { - center TwoDLocation, - radius Uint16 -} - -RectangularRegion ::= SEQUENCE { - northWest TwoDLocation, - southEast TwoDLocation -} - -SequenceOfRectangularRegion ::= SEQUENCE OF RectangularRegion - -PolygonalRegion ::= SEQUENCE SIZE(3..MAX) OF TwoDLocation - -TwoDLocation ::= SEQUENCE { - latitude SecLatitude, - longitude SecLongitude -} - -IdentifiedRegion ::= CHOICE { - countryOnly CountryOnly, - countryAndRegions CountryAndRegions, - countryAndSubregions CountryAndSubregions, - ... -} - -SequenceOfIdentifiedRegion ::= SEQUENCE OF IdentifiedRegion - -CountryOnly ::= Uint16 - -CountryAndRegions ::= SEQUENCE { - countryOnly CountryOnly, - regions SequenceOfUint8 -} - -CountryAndSubregions ::= SEQUENCE { - country CountryOnly, - regionAndSubregions SequenceOfRegionAndSubregions -} - -RegionAndSubregions ::= SEQUENCE { - region Uint8, - subregions SequenceOfUint16 -} - -SequenceOfRegionAndSubregions ::= SEQUENCE OF RegionAndSubregions - -ThreeDLocation ::= SEQUENCE { - latitude SecLatitude, - longitude SecLongitude, - elevation SecElevation -} - -SecLatitude ::= NinetyDegreeInt -SecLongitude ::= OneEightyDegreeInt -SecElevation ::= ElevInt - -NinetyDegreeInt ::= INTEGER { - min (-900000000), - max (900000000), - unknown (900000001) -} (-900000000..900000001) - -KnownLatitude ::= NinetyDegreeInt (min..max) -- Minus 90deg to +90deg in microdegree intervals -UnknownLatitude ::= NinetyDegreeInt (unknown) - -OneEightyDegreeInt ::= INTEGER { - min (-1799999999), - max (1800000000), - unknown (1800000001) -} (-1799999999..1800000001) - -KnownLongitude ::= OneEightyDegreeInt (min..max) -UnknownLongitude ::= OneEightyDegreeInt (unknown) - -ElevInt ::= Uint16 -- Range is from -4096 to 61439 in units of one-tenth of a meter - --- ------------------------------------------------------------------ --- --- Crypto --- --- ------------------------------------------------------------------ - -Signature ::= CHOICE { - ecdsaNistP256Signature EcdsaP256Signature, - ecdsaBrainpoolP256r1Signature EcdsaP256Signature, - ..., - ecdsaBrainpoolP384r1Signature EcdsaP384Signature -} - -EcdsaP256Signature ::= SEQUENCE { - rSig EccP256CurvePoint, - sSig OCTET STRING (SIZE (32)) -} - -EcdsaP384Signature ::= SEQUENCE { - rSig EccP384CurvePoint, - sSig OCTET STRING (SIZE (48)) -} - -EccP256CurvePoint ::= CHOICE { - x-only OCTET STRING (SIZE (32)), - fill NULL, -- consistency with 1363 / X9.62 - compressed-y-0 OCTET STRING (SIZE (32)), - compressed-y-1 OCTET STRING (SIZE (32)), - uncompressedP256 SEQUENCE { - x OCTET STRING (SIZE (32)), - y OCTET STRING (SIZE (32)) - } -} - -EccP384CurvePoint::= CHOICE { - x-only OCTET STRING (SIZE (48)), - fill NULL, -- consistency w 1363 / X9.62 - compressed-y-0 OCTET STRING (SIZE (48)), - compressed-y-1 OCTET STRING (SIZE (48)), - uncompressedP384 SEQUENCE { - x OCTET STRING (SIZE (48)), - y OCTET STRING (SIZE (48)) - } -} - - -SymmAlgorithm ::= ENUMERATED { - aes128Ccm, - ... -} - -HashAlgorithm ::= ENUMERATED { - sha256, - ..., - sha384 -} - -EciesP256EncryptedKey ::= SEQUENCE { - v EccP256CurvePoint, - c OCTET STRING (SIZE (16)), - t OCTET STRING (SIZE (16)) -} - -EncryptionKey ::= CHOICE { - public PublicEncryptionKey, - symmetric SymmetricEncryptionKey -} - -PublicEncryptionKey ::= SEQUENCE { - supportedSymmAlg SymmAlgorithm, - publicKey BasePublicEncryptionKey -} - -BasePublicEncryptionKey ::= CHOICE { - eciesNistP256 EccP256CurvePoint, - eciesBrainpoolP256r1 EccP256CurvePoint, - ... -} - -PublicVerificationKey ::= CHOICE { - ecdsaNistP256 EccP256CurvePoint, - ecdsaBrainpoolP256r1 EccP256CurvePoint, - ..., - ecdsaBrainpoolP384r1 EccP384CurvePoint -} - -SymmetricEncryptionKey ::= CHOICE { - aes128Ccm OCTET STRING(SIZE(16)), - ... -} - --- ------------------------------------------------------------------ --- --- PSID / ITS-AID --- --- ------------------------------------------------------------------ - - -PsidSsp ::= SEQUENCE { - psid Psid, - ssp ServiceSpecificPermissions OPTIONAL -} - -SequenceOfPsidSsp ::= SEQUENCE OF PsidSsp - -Psid ::= INTEGER (0..MAX) - -SequenceOfPsid ::= SEQUENCE OF Psid - -ServiceSpecificPermissions ::= CHOICE { - opaque OCTET STRING (SIZE(0..MAX)), - ..., - bitmapSsp BitmapSsp -} - -BitmapSsp ::= OCTET STRING (SIZE(0..31)) - -PsidSspRange ::= SEQUENCE { - psid Psid, - sspRange SspRange OPTIONAL -} - -SequenceOfPsidSspRange ::= SEQUENCE OF PsidSspRange - -SspRange ::= CHOICE { - opaque SequenceOfOctetString, - all NULL, - ... , - bitmapSspRange BitmapSspRange -} - -BitmapSspRange ::= SEQUENCE { - sspValue OCTET STRING (SIZE(1..32)), - sspBitmask OCTET STRING (SIZE(1..32)) -} - -SequenceOfOctetString ::= SEQUENCE (SIZE (0..MAX)) OF - OCTET STRING (SIZE(0..MAX)) - - --- ------------------------------------------------------------------ --- --- Goes in certs --- --- ------------------------------------------------------------------ - -SubjectAssurance ::= OCTET STRING (SIZE(1)) - -CrlSeries ::= Uint16 - - --- ------------------------------------------------------------------ --- --- Pseudonym Linkage --- --- ------------------------------------------------------------------ - -IValue ::= Uint16 -Hostname ::= UTF8String (SIZE(0..255)) -LinkageValue ::= OCTET STRING (SIZE(9)) -GroupLinkageValue ::= SEQUENCE { - jValue OCTET STRING (SIZE(4)), - value OCTET STRING (SIZE(9)) -} - -LaId ::= OCTET STRING (SIZE(2)) -LinkageSeed ::= OCTET STRING (SIZE(16)) - -END - +IEEE1609dot2BaseTypes {iso(1) identified-organization(3) ieee(111) +standards-association-numbered-series-standards(2) wave-stds(1609) +dot2(2) base(1) base-types(2) major-version-2(2)} + +-- +--******************************************************************** +-- IEEE P1609.2 Base Data Types +-- +--******************************************************************** + +DEFINITIONS AUTOMATIC TAGS ::= BEGIN + +EXPORTS ALL; + + +-- ------------------------------------------------------------------ +-- +-- Integers +-- +-- ------------------------------------------------------------------ + + +Uint3 ::= INTEGER (0..7) -- (hex) 07 +Uint8 ::= INTEGER (0..255) -- (hex) ff +Uint16 ::= INTEGER (0..65535) -- (hex) ff ff +Uint32 ::= INTEGER (0..4294967295)---- -- (hex) ff ff ff ff +Uint64 ::= INTEGER (0..18446744073709551615) -- (hex) ff ff ff ff ff ff ff ff + +SequenceOfUint8 ::= SEQUENCE OF Uint8 +SequenceOfUint16 ::= SEQUENCE OF Uint16 + +-- ------------------------------------------------------------------ +-- +-- OCTET STRING types +-- +-- ------------------------------------------------------------------ + + +Opaque ::= OCTET STRING + + +HashedId10 ::= OCTET STRING (SIZE(10)) +HashedId8 ::= OCTET STRING (SIZE(8)) +HashedId3 ::= OCTET STRING (SIZE(3)) +SequenceOfHashedId3 ::= SEQUENCE OF HashedId3 + + +-- ------------------------------------------------------------------ +-- +-- Time +-- +-- ------------------------------------------------------------------ + +Time32 ::= Uint32 +Time64 ::= Uint64 + +ValidityPeriod ::= SEQUENCE { + start Time32, + duration Duration +} + +Duration ::= CHOICE { + microseconds Uint16, + milliseconds Uint16, + seconds Uint16, + minutes Uint16, + hours Uint16, + sixtyHours Uint16, + years Uint16 +} + +-- ------------------------------------------------------------------ +-- +-- Location +-- +-- ------------------------------------------------------------------ + + +GeographicRegion ::= CHOICE { + circularRegion CircularRegion, + rectangularRegion SequenceOfRectangularRegion, + polygonalRegion PolygonalRegion, + identifiedRegion SequenceOfIdentifiedRegion, + ... +} + +CircularRegion ::= SEQUENCE { + center TwoDLocation, + radius Uint16 +} + +RectangularRegion ::= SEQUENCE { + northWest TwoDLocation, + southEast TwoDLocation +} + +SequenceOfRectangularRegion ::= SEQUENCE OF RectangularRegion + +PolygonalRegion ::= SEQUENCE SIZE(3..MAX) OF TwoDLocation + +TwoDLocation ::= SEQUENCE { + latitude SecLatitude, + longitude SecLongitude +} + +IdentifiedRegion ::= CHOICE { + countryOnly CountryOnly, + countryAndRegions CountryAndRegions, + countryAndSubregions CountryAndSubregions, + ... +} + +SequenceOfIdentifiedRegion ::= SEQUENCE OF IdentifiedRegion + +CountryOnly ::= Uint16 + +CountryAndRegions ::= SEQUENCE { + countryOnly CountryOnly, + regions SequenceOfUint8 +} + +CountryAndSubregions ::= SEQUENCE { + country CountryOnly, + regionAndSubregions SequenceOfRegionAndSubregions +} + +RegionAndSubregions ::= SEQUENCE { + region Uint8, + subregions SequenceOfUint16 +} + +SequenceOfRegionAndSubregions ::= SEQUENCE OF RegionAndSubregions + +ThreeDLocation ::= SEQUENCE { + latitude SecLatitude, + longitude SecLongitude, + elevation SecElevation +} + +SecLatitude ::= NinetyDegreeInt +SecLongitude ::= OneEightyDegreeInt +SecElevation ::= ElevInt + +NinetyDegreeInt ::= INTEGER { + min (-900000000), + max (900000000), + unknown (900000001) +} (-900000000..900000001) + +KnownLatitude ::= NinetyDegreeInt (min..max) -- Minus 90deg to +90deg in microdegree intervals +UnknownLatitude ::= NinetyDegreeInt (unknown) + +OneEightyDegreeInt ::= INTEGER { + min (-1799999999), + max (1800000000), + unknown (1800000001) +} (-1799999999..1800000001) + +KnownLongitude ::= OneEightyDegreeInt (min..max) +UnknownLongitude ::= OneEightyDegreeInt (unknown) + +ElevInt ::= Uint16 -- Range is from -4096 to 61439 in units of one-tenth of a meter + +-- ------------------------------------------------------------------ +-- +-- Crypto +-- +-- ------------------------------------------------------------------ + +Signature ::= CHOICE { + ecdsaNistP256Signature EcdsaP256Signature, + ecdsaBrainpoolP256r1Signature EcdsaP256Signature, + ..., + ecdsaBrainpoolP384r1Signature EcdsaP384Signature +} + +EcdsaP256Signature ::= SEQUENCE { + rSig EccP256CurvePoint, + sSig OCTET STRING (SIZE (32)) +} + +EcdsaP384Signature ::= SEQUENCE { + rSig EccP384CurvePoint, + sSig OCTET STRING (SIZE (48)) +} + +EccP256CurvePoint ::= CHOICE { + x-only OCTET STRING (SIZE (32)), + fill NULL, -- consistency with 1363 / X9.62 + compressed-y-0 OCTET STRING (SIZE (32)), + compressed-y-1 OCTET STRING (SIZE (32)), + uncompressedP256 SEQUENCE { + x OCTET STRING (SIZE (32)), + y OCTET STRING (SIZE (32)) + } +} + +EccP384CurvePoint::= CHOICE { + x-only OCTET STRING (SIZE (48)), + fill NULL, -- consistency w 1363 / X9.62 + compressed-y-0 OCTET STRING (SIZE (48)), + compressed-y-1 OCTET STRING (SIZE (48)), + uncompressedP384 SEQUENCE { + x OCTET STRING (SIZE (48)), + y OCTET STRING (SIZE (48)) + } +} + + +SymmAlgorithm ::= ENUMERATED { + aes128Ccm, + ... +} + +HashAlgorithm ::= ENUMERATED { + sha256, + ..., + sha384 +} + +EciesP256EncryptedKey ::= SEQUENCE { + v EccP256CurvePoint, + c OCTET STRING (SIZE (16)), + t OCTET STRING (SIZE (16)) +} + +EncryptionKey ::= CHOICE { + public PublicEncryptionKey, + symmetric SymmetricEncryptionKey +} + +PublicEncryptionKey ::= SEQUENCE { + supportedSymmAlg SymmAlgorithm, + publicKey BasePublicEncryptionKey +} + +BasePublicEncryptionKey ::= CHOICE { + eciesNistP256 EccP256CurvePoint, + eciesBrainpoolP256r1 EccP256CurvePoint, + ... +} + +PublicVerificationKey ::= CHOICE { + ecdsaNistP256 EccP256CurvePoint, + ecdsaBrainpoolP256r1 EccP256CurvePoint, + ..., + ecdsaBrainpoolP384r1 EccP384CurvePoint +} + +SymmetricEncryptionKey ::= CHOICE { + aes128Ccm OCTET STRING(SIZE(16)), + ... +} + +-- ------------------------------------------------------------------ +-- +-- PSID / ITS-AID +-- +-- ------------------------------------------------------------------ + + +PsidSsp ::= SEQUENCE { + psid Psid, + ssp ServiceSpecificPermissions OPTIONAL +} + +SequenceOfPsidSsp ::= SEQUENCE OF PsidSsp + +Psid ::= INTEGER (0..MAX) + +SequenceOfPsid ::= SEQUENCE OF Psid + +ServiceSpecificPermissions ::= CHOICE { + opaque OCTET STRING (SIZE(0..MAX)), + ..., + bitmapSsp BitmapSsp +} + +BitmapSsp ::= OCTET STRING (SIZE(0..31)) + +PsidSspRange ::= SEQUENCE { + psid Psid, + sspRange SspRange OPTIONAL +} + +SequenceOfPsidSspRange ::= SEQUENCE OF PsidSspRange + +SspRange ::= CHOICE { + opaque SequenceOfOctetString, + all NULL, + ... , + bitmapSspRange BitmapSspRange +} + +BitmapSspRange ::= SEQUENCE { + sspValue OCTET STRING (SIZE(1..32)), + sspBitmask OCTET STRING (SIZE(1..32)) +} + +SequenceOfOctetString ::= SEQUENCE (SIZE (0..MAX)) OF + OCTET STRING (SIZE(0..MAX)) + + +-- ------------------------------------------------------------------ +-- +-- Goes in certs +-- +-- ------------------------------------------------------------------ + +SubjectAssurance ::= OCTET STRING (SIZE(1)) + +CrlSeries ::= Uint16 + + +-- ------------------------------------------------------------------ +-- +-- Pseudonym Linkage +-- +-- ------------------------------------------------------------------ + +IValue ::= Uint16 +Hostname ::= UTF8String (SIZE(0..255)) +LinkageValue ::= OCTET STRING (SIZE(9)) +GroupLinkageValue ::= SEQUENCE { + jValue OCTET STRING (SIZE(4)), + value OCTET STRING (SIZE(9)) +} + +LaId ::= OCTET STRING (SIZE(2)) +LinkageSeed ::= OCTET STRING (SIZE(16)) + +END + diff --git a/asn1/Security/EtsiTs103097Module.asn b/asn1/Security/EtsiTs103097Module.asn index 9477ab6f..88ed76a6 100644 --- a/asn1/Security/EtsiTs103097Module.asn +++ b/asn1/Security/EtsiTs103097Module.asn @@ -1,105 +1,105 @@ -EtsiTs103097Module -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) v1(0) } - -DEFINITIONS AUTOMATIC TAGS ::= BEGIN - -IMPORTS - -Ieee1609Dot2Data, ExplicitCertificate - -FROM - -IEEE1609dot2 {iso(1) identified-organization(3) ieee(111) -standards-association-numbered-series-standards(2) wave-stds(1609) -dot2(2) base (1) schema (1) major-version-2(2)}; - -EtsiTs103097Certificate::= ExplicitCertificate - (WITH COMPONENTS{..., - toBeSigned (WITH COMPONENTS{..., - id (WITH COMPONENTS{..., - linkageData ABSENT, - binaryId ABSENT - }), - certRequestPermissions ABSENT, - canRequestRollover ABSENT - }) - }) - -SingleEtsiTs103097Certificate ::= SEQUENCE { - only EtsiTs103097Certificate -} - - -EtsiTs103097Data::=Ieee1609Dot2Data (WITH COMPONENTS {..., - content (WITH COMPONENTS {..., - signedData (WITH COMPONENTS {..., -- constraints on signed data headers - tbsData (WITH COMPONENTS { - headerInfo (WITH COMPONENTS {..., - generationTime PRESENT, - p2pcdLearningRequest ABSENT, - missingCrlIdentifier ABSENT - }) - }), - signer (WITH COMPONENTS {..., --constraints on the certificate - certificate (SIZE(1)) - }) - }), - encryptedData (WITH COMPONENTS {..., -- constraints on encrypted data headers - recipients (WITH COMPONENT ( - (WITH COMPONENTS {..., - pskRecipInfo ABSENT, - symmRecipInfo ABSENT, - rekRecipInfo ABSENT - }) - )) - }), - signedCertificateRequest ABSENT - }) -}) - -EtsiTs103097Data-Signed {ToBeSignedDataContent} ::= EtsiTs103097Data (WITH COMPONENTS {..., - content (WITH COMPONENTS { - signedData (WITH COMPONENTS {..., - tbsData (WITH COMPONENTS { - payload (WITH COMPONENTS { - data (WITH COMPONENTS {..., - content (WITH COMPONENTS { - unsecuredData (CONTAINING ToBeSignedDataContent) - }) - }) PRESENT - }) - }) - }) - }) -}) - -EtsiTs103097Data-SignedExternalPayload ::= EtsiTs103097Data (WITH COMPONENTS {..., - content (WITH COMPONENTS { - signedData (WITH COMPONENTS {..., - tbsData (WITH COMPONENTS { - payload (WITH COMPONENTS { - extDataHash (WITH COMPONENTS { - sha256HashedData PRESENT - }) PRESENT - }) - }) - }) - }) -}) - -EtsiTs103097Data-Encrypted {ToBeEncryptedDataContent} ::= EtsiTs103097Data (WITH COMPONENTS {..., - content (WITH COMPONENTS { - encryptedData (WITH COMPONENTS {..., - ciphertext (WITH COMPONENTS {..., - aes128ccm (WITH COMPONENTS {..., - ccmCiphertext (CONSTRAINED BY {-- ccm encryption of -- ToBeEncryptedDataContent}) - }) - }) - }) - }) -}) - - -EtsiTs103097Data-SignedAndEncrypted {ToBesignedAndEncryptedDataContent} ::= EtsiTs103097Data-Encrypted {EtsiTs103097Data-Signed {ToBesignedAndEncryptedDataContent}} - -END +EtsiTs103097Module +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) v1(0) } + +DEFINITIONS AUTOMATIC TAGS ::= BEGIN + +IMPORTS + +Ieee1609Dot2Data, ExplicitCertificate + +FROM + +IEEE1609dot2 {iso(1) identified-organization(3) ieee(111) +standards-association-numbered-series-standards(2) wave-stds(1609) +dot2(2) base (1) schema (1) major-version-2(2)}; + +EtsiTs103097Certificate::= ExplicitCertificate + (WITH COMPONENTS{..., + toBeSigned (WITH COMPONENTS{..., + id (WITH COMPONENTS{..., + linkageData ABSENT, + binaryId ABSENT + }), + certRequestPermissions ABSENT, + canRequestRollover ABSENT + }) + }) + +SingleEtsiTs103097Certificate ::= SEQUENCE { + only EtsiTs103097Certificate +} + + +EtsiTs103097Data::=Ieee1609Dot2Data (WITH COMPONENTS {..., + content (WITH COMPONENTS {..., + signedData (WITH COMPONENTS {..., -- constraints on signed data headers + tbsData (WITH COMPONENTS { + headerInfo (WITH COMPONENTS {..., + generationTime PRESENT, + p2pcdLearningRequest ABSENT, + missingCrlIdentifier ABSENT + }) + }), + signer (WITH COMPONENTS {..., --constraints on the certificate + certificate (SIZE(1)) + }) + }), + encryptedData (WITH COMPONENTS {..., -- constraints on encrypted data headers + recipients (WITH COMPONENT ( + (WITH COMPONENTS {..., + pskRecipInfo ABSENT, + symmRecipInfo ABSENT, + rekRecipInfo ABSENT + }) + )) + }), + signedCertificateRequest ABSENT + }) +}) + +EtsiTs103097Data-Signed {ToBeSignedDataContent} ::= EtsiTs103097Data (WITH COMPONENTS {..., + content (WITH COMPONENTS { + signedData (WITH COMPONENTS {..., + tbsData (WITH COMPONENTS { + payload (WITH COMPONENTS { + data (WITH COMPONENTS {..., + content (WITH COMPONENTS { + unsecuredData (CONTAINING ToBeSignedDataContent) + }) + }) PRESENT + }) + }) + }) + }) +}) + +EtsiTs103097Data-SignedExternalPayload ::= EtsiTs103097Data (WITH COMPONENTS {..., + content (WITH COMPONENTS { + signedData (WITH COMPONENTS {..., + tbsData (WITH COMPONENTS { + payload (WITH COMPONENTS { + extDataHash (WITH COMPONENTS { + sha256HashedData PRESENT + }) PRESENT + }) + }) + }) + }) +}) + +EtsiTs103097Data-Encrypted {ToBeEncryptedDataContent} ::= EtsiTs103097Data (WITH COMPONENTS {..., + content (WITH COMPONENTS { + encryptedData (WITH COMPONENTS {..., + ciphertext (WITH COMPONENTS {..., + aes128ccm (WITH COMPONENTS {..., + ccmCiphertext (CONSTRAINED BY {-- ccm encryption of -- ToBeEncryptedDataContent}) + }) + }) + }) + }) +}) + + +EtsiTs103097Data-SignedAndEncrypted {ToBesignedAndEncryptedDataContent} ::= EtsiTs103097Data-Encrypted {EtsiTs103097Data-Signed {ToBesignedAndEncryptedDataContent}} + +END diff --git a/asn1/Security/TS102921/EtsiTs102941BaseTypes.asn b/asn1/Security/TS102921/EtsiTs102941BaseTypes.asn index bcac045e..9d16c7ec 100644 --- a/asn1/Security/TS102921/EtsiTs102941BaseTypes.asn +++ b/asn1/Security/TS102921/EtsiTs102941BaseTypes.asn @@ -1,63 +1,63 @@ -EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1) } - -DEFINITIONS AUTOMATIC TAGS ::= -BEGIN - -IMPORTS -HashedId8, Time32, PublicEncryptionKey, PublicVerificationKey, Signature -FROM -IEEE1609dot2BaseTypes {iso(1) identified-organization(3) ieee(111) -standards-association-numbered-series-standards(2) wave-stds(1609) -dot2(2) base(1) base-types(2) major-version-2(2)} - -CertificateId, SubjectAssurance, SequenceOfPsidSsp, SequenceOfPsidGroupPermissions, ValidityPeriod, GeographicRegion -FROM -IEEE1609dot2 {iso(1) identified-organization(3) ieee(111) -standards-association-numbered-series-standards(2) wave-stds(1609) -dot2(2) base (1) schema (1) major-version-2(2)} - -EtsiTs103097Data-Encrypted, EtsiTs103097Data-Signed, EtsiTs103097Data-SignedExternalPayload -FROM EtsiTs103097Module -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} -; - -CertificateFormat::= INTEGER { - ts103097v131 (1) - }(1..255) - -CertificateSubjectAttributes ::= SEQUENCE { - id CertificateId OPTIONAL, - validityPeriod ValidityPeriod OPTIONAL, - region GeographicRegion OPTIONAL, - assuranceLevel SubjectAssurance OPTIONAL, - appPermissions SequenceOfPsidSsp OPTIONAL, - certIssuePermissions SequenceOfPsidGroupPermissions OPTIONAL, - ... - }(WITH COMPONENTS { ..., appPermissions PRESENT} | - WITH COMPONENTS { ..., certIssuePermissions PRESENT}) - -EcSignature::= CHOICE { - encryptedEcSignature EtsiTs103097Data-Encrypted{EtsiTs103097Data-SignedExternalPayload}, - ecSignature EtsiTs103097Data-SignedExternalPayload - } - -PublicKeys ::= SEQUENCE { - verificationKey PublicVerificationKey, - encryptionKey PublicEncryptionKey OPTIONAL - } - -Version ::= INTEGER {v1(1)} (1..255) - -EtsiTs103097Data-Encrypted-Unicast {ToBeEncryptedDataContent} ::= EtsiTs103097Data-Encrypted {ToBeEncryptedDataContent} -(WITH COMPONENTS {..., - content (WITH COMPONENTS { - encryptedData (WITH COMPONENTS {..., - recipients (SIZE(1)) - }) - }) -}) - -EtsiTs103097Data-SignedAndEncrypted-Unicast {ToBesignedAndEncryptedDataContent} ::= EtsiTs103097Data-Encrypted-Unicast {EtsiTs103097Data-Signed {ToBesignedAndEncryptedDataContent}} - -END +EtsiTs102941BaseTypes +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1) } + +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +IMPORTS +HashedId8, Time32, PublicEncryptionKey, PublicVerificationKey, Signature +FROM +IEEE1609dot2BaseTypes {iso(1) identified-organization(3) ieee(111) +standards-association-numbered-series-standards(2) wave-stds(1609) +dot2(2) base(1) base-types(2) major-version-2(2)} + +CertificateId, SubjectAssurance, SequenceOfPsidSsp, SequenceOfPsidGroupPermissions, ValidityPeriod, GeographicRegion +FROM +IEEE1609dot2 {iso(1) identified-organization(3) ieee(111) +standards-association-numbered-series-standards(2) wave-stds(1609) +dot2(2) base (1) schema (1) major-version-2(2)} + +EtsiTs103097Data-Encrypted, EtsiTs103097Data-Signed, EtsiTs103097Data-SignedExternalPayload +FROM EtsiTs103097Module +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} +; + +CertificateFormat::= INTEGER { + ts103097v131 (1) + }(1..255) + +CertificateSubjectAttributes ::= SEQUENCE { + id CertificateId OPTIONAL, + validityPeriod ValidityPeriod OPTIONAL, + region GeographicRegion OPTIONAL, + assuranceLevel SubjectAssurance OPTIONAL, + appPermissions SequenceOfPsidSsp OPTIONAL, + certIssuePermissions SequenceOfPsidGroupPermissions OPTIONAL, + ... + }(WITH COMPONENTS { ..., appPermissions PRESENT} | + WITH COMPONENTS { ..., certIssuePermissions PRESENT}) + +EcSignature::= CHOICE { + encryptedEcSignature EtsiTs103097Data-Encrypted{EtsiTs103097Data-SignedExternalPayload}, + ecSignature EtsiTs103097Data-SignedExternalPayload + } + +PublicKeys ::= SEQUENCE { + verificationKey PublicVerificationKey, + encryptionKey PublicEncryptionKey OPTIONAL + } + +Version ::= INTEGER {v1(1)} + +EtsiTs103097Data-Encrypted-Unicast {ToBeEncryptedDataContent} ::= EtsiTs103097Data-Encrypted {ToBeEncryptedDataContent} +(WITH COMPONENTS {..., + content (WITH COMPONENTS { + encryptedData (WITH COMPONENTS {..., + recipients (SIZE(1)) + }) + }) +}) + +EtsiTs103097Data-SignedAndEncrypted-Unicast {ToBesignedAndEncryptedDataContent} ::= EtsiTs103097Data-Encrypted-Unicast {EtsiTs103097Data-Signed {ToBesignedAndEncryptedDataContent}} + +END diff --git a/asn1/Security/TS102921/EtsiTs102941MessagesCA.asn b/asn1/Security/TS102921/EtsiTs102941MessagesCA.asn index 13b9c766..12f7133d 100644 --- a/asn1/Security/TS102921/EtsiTs102941MessagesCA.asn +++ b/asn1/Security/TS102921/EtsiTs102941MessagesCA.asn @@ -1,87 +1,87 @@ -/************************************************************************************* - This file contains the EtsiTs102941Messages module containing all possible PKI messages. - It should be used when all PKI messages needs to be implemented (for example, for CA development) -**************************************************************************************/ -EtsiTs102941MessagesCa - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) messagesCa(0) version1(1)} - -DEFINITIONS AUTOMATIC TAGS ::= -BEGIN - -IMPORTS - -EtsiTs103097Data-Signed, ---EtsiTs103097Data-Encrypted, -EtsiTs103097Data-SignedExternalPayload ---EtsiTs103097Data-SignedAndEncrypted -FROM EtsiTs103097Module -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} - -Version, -EtsiTs103097Data-Encrypted-Unicast, -EtsiTs103097Data-SignedAndEncrypted-Unicast -FROM EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1) } - -InnerEcRequestSignedForPop, InnerEcResponse -FROM EtsiTs102941TypesEnrolment -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) enrolment(4) version1(1) } - -InnerAtRequest, InnerAtResponse -FROM EtsiTs102941TypesAuthorization -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version1(1) } - -ToBeSignedCrl, ToBeSignedTlmCtl, ToBeSignedRcaCtl -FROM EtsiTs102941TrustLists -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) trustLists(6) version1(1) } - -AuthorizationValidationRequest, AuthorizationValidationResponse -FROM EtsiTs102941TypesAuthorizationValidation -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authValidation(7) version1(1) } - -CaCertificateRequest -FROM EtsiTs102941TypesCaManagement -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) caManagement(8) version1(1) } - -; - -/************ --- Messages -************/ -EnrolmentRequestMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentRequest PRESENT})})} -EnrolmentResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentResponse PRESENT})})} -AuthorizationRequestMessage ::= EtsiTs103097Data-Encrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} -AuthorizationRequestMessageWithPop ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} -AuthorizationResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationResponse PRESENT})})} -CertificateRevocationListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateRevocationList PRESENT})})} -TlmCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListTlm PRESENT})})} -RcaCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListRca PRESENT})})} -AuthorizationValidationRequestMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationValidationRequest PRESENT})})} -AuthorizationValidationResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationValidationResponse PRESENT})})} -CaCertificateRequestMessage ::= EtsiTs103097Data-Signed {EtsiTs102941Data(WITH COMPONENTS{..., content (WITH COMPONENTS{caCertificateRequest PRESENT})})} -CaCertificateRekeyingMessage ::= EtsiTs103097Data-Signed {EtsiTs103097Data-Signed {EtsiTs102941Data(WITH COMPONENTS{..., content (WITH COMPONENTS{caCertificateRequest PRESENT})})}} - -/************ --- EtsiTs102941Data -************/ - -EtsiTs102941Data::= SEQUENCE { - version Version (v1), - content EtsiTs102941DataContent - } - -EtsiTs102941DataContent ::= CHOICE { - enrolmentRequest InnerEcRequestSignedForPop, - enrolmentResponse InnerEcResponse, - authorizationRequest InnerAtRequest, - authorizationResponse InnerAtResponse, - certificateRevocationList ToBeSignedCrl, - certificateTrustListTlm ToBeSignedTlmCtl, - certificateTrustListRca ToBeSignedRcaCtl, - authorizationValidationRequest AuthorizationValidationRequest, - authorizationValidationResponse AuthorizationValidationResponse, - caCertificateRequest CaCertificateRequest, - ... - } - -END +/************************************************************************************* + This file contains the EtsiTs102941Messages module containing all possible PKI messages. + It should be used when all PKI messages needs to be implemented (for example, for CA development) +**************************************************************************************/ +EtsiTs102941MessagesCa + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) messagesCa(0) version1(1)} + +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +IMPORTS + +EtsiTs103097Data-Signed, +--EtsiTs103097Data-Encrypted, +EtsiTs103097Data-SignedExternalPayload +--EtsiTs103097Data-SignedAndEncrypted +FROM EtsiTs103097Module +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} + +Version, +EtsiTs103097Data-Encrypted-Unicast, +EtsiTs103097Data-SignedAndEncrypted-Unicast +FROM EtsiTs102941BaseTypes +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1) } + +InnerEcRequestSignedForPop, InnerEcResponse +FROM EtsiTs102941TypesEnrolment +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) enrolment(4) version1(1) } + +InnerAtRequest, InnerAtResponse +FROM EtsiTs102941TypesAuthorization +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version1(1) } + +ToBeSignedCrl, ToBeSignedTlmCtl, ToBeSignedRcaCtl +FROM EtsiTs102941TrustLists +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) trustLists(6) version1(1) } + +AuthorizationValidationRequest, AuthorizationValidationResponse +FROM EtsiTs102941TypesAuthorizationValidation +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authValidation(7) version1(1) } + +CaCertificateRequest +FROM EtsiTs102941TypesCaManagement +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) caManagement(8) version1(1) } + +; + +/************ +-- Messages +************/ +EnrolmentRequestMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentRequest PRESENT})})} +EnrolmentResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentResponse PRESENT})})} +AuthorizationRequestMessage ::= EtsiTs103097Data-Encrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} +AuthorizationRequestMessageWithPop ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} +AuthorizationResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationResponse PRESENT})})} +CertificateRevocationListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateRevocationList PRESENT})})} +TlmCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListTlm PRESENT})})} +RcaCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListRca PRESENT})})} +AuthorizationValidationRequestMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationValidationRequest PRESENT})})} +AuthorizationValidationResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationValidationResponse PRESENT})})} +CaCertificateRequestMessage ::= EtsiTs103097Data-Signed {EtsiTs102941Data(WITH COMPONENTS{..., content (WITH COMPONENTS{caCertificateRequest PRESENT})})} +CaCertificateRekeyingMessage ::= EtsiTs103097Data-Signed {EtsiTs103097Data-Signed {EtsiTs102941Data(WITH COMPONENTS{..., content (WITH COMPONENTS{caCertificateRequest PRESENT})})}} + +/************ +-- EtsiTs102941Data +************/ + +EtsiTs102941Data::= SEQUENCE { + version Version (v1), + content EtsiTs102941DataContent + } + +EtsiTs102941DataContent ::= CHOICE { + enrolmentRequest InnerEcRequestSignedForPop, + enrolmentResponse InnerEcResponse, + authorizationRequest InnerAtRequest, + authorizationResponse InnerAtResponse, + certificateRevocationList ToBeSignedCrl, + certificateTrustListTlm ToBeSignedTlmCtl, + certificateTrustListRca ToBeSignedRcaCtl, + authorizationValidationRequest AuthorizationValidationRequest, + authorizationValidationResponse AuthorizationValidationResponse, + caCertificateRequest CaCertificateRequest, + ... + } + +END diff --git a/asn1/Security/TS102921/EtsiTs102941MessagesItss.asn b/asn1/Security/TS102921/EtsiTs102941MessagesItss.asn index b1fc08db..a80eaa9c 100644 --- a/asn1/Security/TS102921/EtsiTs102941MessagesItss.asn +++ b/asn1/Security/TS102921/EtsiTs102941MessagesItss.asn @@ -1,82 +1,82 @@ -/************************************************************************************* - This file contains the EtsiTs102941MessagesItss module providing the ITS-S subset - of messages defined in the module EtsiTs102941MessagesCA - It should never be imported together with the module EtsiTs102941MessagesCA. - Use the EtsiTs102941MessagesCA if all possible PKI message types are needed. - - This module blocks the usage of unencrypted EC signature for AA requests. -**************************************************************************************/ -EtsiTs102941MessagesItss - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) messagesItss(1) version1(1)} - -DEFINITIONS AUTOMATIC TAGS ::= -BEGIN - -IMPORTS - -EtsiTs103097Data-Signed ---EtsiTs103097Data-Encrypted, ---EtsiTs103097Data-SignedAndEncrypted -FROM EtsiTs103097Module -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0) } - -EtsiTs103097Data-Encrypted-Unicast, -EtsiTs103097Data-SignedAndEncrypted-Unicast, -Version -FROM EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1) } - -InnerEcRequestSignedForPop, InnerEcResponse -FROM EtsiTs102941TypesEnrolment -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) enrolment(4) version1(1) } - -InnerAtRequest, InnerAtResponse -FROM EtsiTs102941TypesAuthorization -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version1(1) } - -ToBeSignedCrl, ToBeSignedTlmCtl, ToBeSignedRcaCtl -FROM EtsiTs102941TrustLists -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) trustLists(6) version1(1) } - -; - -/************ --- Messages -************/ - -EnrolmentRequestMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentRequest PRESENT})})} -EnrolmentResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentResponse PRESENT})})} -AuthorizationRequestMessage ::= EtsiTs103097Data-Encrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} -AuthorizationRequestMessageWithPop ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} -AuthorizationResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationResponse PRESENT})})} -CertificateRevocationListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateRevocationList PRESENT})})} -TlmCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListTlm PRESENT})})} -RcaCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListRca PRESENT})})} - -/************ --- EtsiTs102941Data -************/ - -EtsiTs102941Data::= SEQUENCE { - version Version (v1), - content EtsiTs102941DataContent - } - -EtsiTs102941DataContent ::= CHOICE { - enrolmentRequest InnerEcRequestSignedForPop, - enrolmentResponse InnerEcResponse, - authorizationRequest InnerAtRequest, - authorizationResponse InnerAtResponse, - certificateRevocationList ToBeSignedCrl, - certificateTrustListTlm ToBeSignedTlmCtl, - certificateTrustListRca ToBeSignedRcaCtl, - ... - } (WITH COMPONENTS{..., - authorizationRequest (WITH COMPONENTS{..., - ecSignature (WITH COMPONENTS{..., - encryptedEcSignature PRESENT - }) - }) - }) - -END +/************************************************************************************* + This file contains the EtsiTs102941MessagesItss module providing the ITS-S subset + of messages defined in the module EtsiTs102941MessagesCA + It should never be imported together with the module EtsiTs102941MessagesCA. + Use the EtsiTs102941MessagesCA if all possible PKI message types are needed. + + This module blocks the usage of unencrypted EC signature for AA requests. +**************************************************************************************/ +EtsiTs102941MessagesItss + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) messagesItss(1) version1(1)} + +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +IMPORTS + +EtsiTs103097Data-Signed +--EtsiTs103097Data-Encrypted, +--EtsiTs103097Data-SignedAndEncrypted +FROM EtsiTs103097Module +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0) } + +EtsiTs103097Data-Encrypted-Unicast, +EtsiTs103097Data-SignedAndEncrypted-Unicast, +Version +FROM EtsiTs102941BaseTypes +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1) } + +InnerEcRequestSignedForPop, InnerEcResponse +FROM EtsiTs102941TypesEnrolment +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) enrolment(4) version1(1) } + +InnerAtRequest, InnerAtResponse +FROM EtsiTs102941TypesAuthorization +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version1(1) } + +ToBeSignedCrl, ToBeSignedTlmCtl, ToBeSignedRcaCtl +FROM EtsiTs102941TrustLists +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) trustLists(6) version1(1) } + +; + +/************ +-- Messages +************/ + +EnrolmentRequestMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentRequest PRESENT})})} +EnrolmentResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentResponse PRESENT})})} +AuthorizationRequestMessage ::= EtsiTs103097Data-Encrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} +AuthorizationRequestMessageWithPop ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} +AuthorizationResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationResponse PRESENT})})} +CertificateRevocationListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateRevocationList PRESENT})})} +TlmCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListTlm PRESENT})})} +RcaCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListRca PRESENT})})} + +/************ +-- EtsiTs102941Data +************/ + +EtsiTs102941Data::= SEQUENCE { + version Version (v1), + content EtsiTs102941DataContent + } + +EtsiTs102941DataContent ::= CHOICE { + enrolmentRequest InnerEcRequestSignedForPop, + enrolmentResponse InnerEcResponse, + authorizationRequest InnerAtRequest, + authorizationResponse InnerAtResponse, + certificateRevocationList ToBeSignedCrl, + certificateTrustListTlm ToBeSignedTlmCtl, + certificateTrustListRca ToBeSignedRcaCtl, + ... + } (WITH COMPONENTS{..., + authorizationRequest (WITH COMPONENTS{..., + ecSignature (WITH COMPONENTS{..., + encryptedEcSignature PRESENT + }) + }) + }) + +END diff --git a/asn1/Security/TS102921/EtsiTs102941MessagesItss_OptionalPrivacy.asn b/asn1/Security/TS102921/EtsiTs102941MessagesItss_OptionalPrivacy.asn index fcce41a0..f0675238 100644 --- a/asn1/Security/TS102921/EtsiTs102941MessagesItss_OptionalPrivacy.asn +++ b/asn1/Security/TS102921/EtsiTs102941MessagesItss_OptionalPrivacy.asn @@ -1,76 +1,75 @@ -/************************************************************************************* - This file contains the EtsiTs102941MessagesItss-OptionalPrivacy module providing the - same subset of messages as the EtsiTs102941MessagesItss module. - It should never be used together with the EtsiTs102941MessagesCA and EtsiTs102941MessagesItss - - This module allows the usage of unencrypted EC signature for AA requests. -**************************************************************************************/ -EtsiTs102941MessagesItss-OptionalPrivacy - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) messagesItssOp(2) version1(1)} - -DEFINITIONS AUTOMATIC TAGS ::= -BEGIN - -IMPORTS - -EtsiTs103097Data-Signed ---EtsiTs103097Data-Encrypted, ---EtsiTs103097Data-SignedAndEncrypted -FROM EtsiTs103097Module -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0) } - -EtsiTs103097Data-Encrypted-Unicast, -EtsiTs103097Data-SignedAndEncrypted-Unicast, -Version -FROM EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1) } - -InnerEcRequestSignedForPop, InnerEcResponse -FROM EtsiTs102941TypesEnrolment -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) enrolment(4) version1(1) } - -InnerAtRequest, -InnerAtResponse -FROM EtsiTs102941TypesAuthorization -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version1(1) } - -ToBeSignedCrl, ToBeSignedTlmCtl, ToBeSignedRcaCtl -FROM EtsiTs102941TrustLists -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) trustLists(6) version1(1) } - -; - -/************ --- Messages -************/ - -EnrolmentRequestMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentRequest PRESENT})})} -EnrolmentResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentResponse PRESENT})})} -AuthorizationRequestMessage ::= EtsiTs103097Data-Encrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} -AuthorizationRequestMessageWithPop ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} -AuthorizationResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationResponse PRESENT})})} -CertificateRevocationListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateRevocationList PRESENT})})} -TlmCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListTlm PRESENT})})} -RcaCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListRca PRESENT})})} - -/************ --- EtsiTs102941Data -************/ - -EtsiTs102941Data::= SEQUENCE { - version Version (v1), - content EtsiTs102941DataContent - } - -EtsiTs102941DataContent ::= CHOICE { - enrolmentRequest InnerEcRequestSignedForPop, - enrolmentResponse InnerEcResponse, - authorizationRequest InnerAtRequest, - authorizationResponse InnerAtResponse, - certificateRevocationList ToBeSignedCrl, - certificateTrustListTlm ToBeSignedTlmCtl, - certificateTrustListRca ToBeSignedRcaCtl, - ... - } - -END +/************************************************************************************* + This file contains the EtsiTs102941MessagesItss-OptionalPrivacy module providing the + same subset of messages as the EtsiTs102941MessagesItss module. + It should never be used together with the EtsiTs102941MessagesCA and EtsiTs102941MessagesItss + + This module allows the usage of unencrypted EC signature for AA requests. +**************************************************************************************/ +EtsiTs102941MessagesItss-OptionalPrivacy + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) messagesItssOp(2) version1(1)} + +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +IMPORTS + +EtsiTs103097Data-Signed +--EtsiTs103097Data-Encrypted, +--EtsiTs103097Data-SignedAndEncrypted +FROM EtsiTs103097Module +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0) } + +EtsiTs103097Data-Encrypted-Unicast, +EtsiTs103097Data-SignedAndEncrypted-Unicast, +Version +FROM EtsiTs102941BaseTypes +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1) } + +InnerEcRequestSignedForPop, InnerEcResponse +FROM EtsiTs102941TypesEnrolment +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) enrolment(4) version1(1) } + +InnerAtRequest, InnerAtResponse +FROM EtsiTs102941TypesAuthorization +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version1(1) } + +ToBeSignedCrl, ToBeSignedTlmCtl, ToBeSignedRcaCtl +FROM EtsiTs102941TrustLists +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) trustLists(6) version1(1) } + +; + +/************ +-- Messages +************/ + +EnrolmentRequestMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentRequest PRESENT})})} +EnrolmentResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentResponse PRESENT})})} +AuthorizationRequestMessage ::= EtsiTs103097Data-Encrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} +AuthorizationRequestMessageWithPop ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} +AuthorizationResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationResponse PRESENT})})} +CertificateRevocationListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateRevocationList PRESENT})})} +TlmCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListTlm PRESENT})})} +RcaCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListRca PRESENT})})} + +/************ +-- EtsiTs102941Data +************/ + +EtsiTs102941Data::= SEQUENCE { + version Version (v1), + content EtsiTs102941DataContent + } + +EtsiTs102941DataContent ::= CHOICE { + enrolmentRequest InnerEcRequestSignedForPop, + enrolmentResponse InnerEcResponse, + authorizationRequest InnerAtRequest, + authorizationResponse InnerAtResponse, + certificateRevocationList ToBeSignedCrl, + certificateTrustListTlm ToBeSignedTlmCtl, + certificateTrustListRca ToBeSignedRcaCtl, + ... + } + +END diff --git a/asn1/Security/TS102921/EtsiTs102941TrustLists.asn b/asn1/Security/TS102921/EtsiTs102941TrustLists.asn index 5b0434ed..7b93f3f8 100644 --- a/asn1/Security/TS102921/EtsiTs102941TrustLists.asn +++ b/asn1/Security/TS102921/EtsiTs102941TrustLists.asn @@ -1,142 +1,142 @@ -EtsiTs102941TrustLists - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) trustLists(6) version1(1)} - -DEFINITIONS AUTOMATIC TAGS ::= -BEGIN - -IMPORTS - -EtsiTs103097Certificate, EtsiTs103097Data-SignedAndEncrypted, EtsiTs103097Data-Signed -FROM -EtsiTs103097Module -{itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} - -HashedId8, Time32, Version --, CertificateAuthorityConstraints -FROM EtsiTs102941BaseTypes -{itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1)} - -; - -/************ --- CRL -************/ -ToBeSignedCrl ::= SEQUENCE { - version Version, - thisUpdate Time32, - nextUpdate Time32, - entries SEQUENCE OF CrlEntry, - ... -} - -CrlEntry ::= HashedId8 - -/************ --- TLM CTL -************/ - -ToBeSignedTlmCtl ::= CtlFormat (FullCtl | DeltaCtl) (WITH COMPONENTS {..., - ctlCommands ( WITH COMPONENT( - ( WITH COMPONENTS {..., - add ( WITH COMPONENTS {..., - ea ABSENT, - aa ABSENT - }) - }) - )) -}) - -/************ --- RCA CTL -************/ - -ToBeSignedRcaCtl ::= CtlFormat (FullCtl | DeltaCtl) ( WITH COMPONENTS {..., - ctlCommands ( WITH COMPONENT( - ( WITH COMPONENTS {..., - add ( WITH COMPONENTS {..., - rca ABSENT, - tlm ABSENT - }) - }) - )) -}) - -/************ --- CTL -************/ - -FullCtl::= CtlFormat ( WITH COMPONENTS {..., - isFullCtl ( TRUE ), - ctlCommands ( WITH COMPONENT( - ( WITH COMPONENTS {..., - delete ABSENT - }) - )) -}) - -DeltaCtl::= CtlFormat (WITH COMPONENTS {..., - isFullCtl(FALSE) -}) - - -CtlFormat ::= SEQUENCE { - version Version, - nextUpdate Time32, - isFullCtl BOOLEAN, - ctlSequence INTEGER (0..255), - ctlCommands SEQUENCE OF CtlCommand, - ... -} - -CtlCommand ::= CHOICE { - add CtlEntry, - delete CtlDelete, - ... -} - -CtlEntry ::= CHOICE { - rca RootCaEntry, - ea EaEntry, - aa AaEntry, - dc DcEntry, - tlm TlmEntry, - ... -} - -CtlDelete ::= CHOICE { - cert HashedId8, - dc DcDelete, - ... -} - -TlmEntry::= SEQUENCE { - selfSignedTLMCertificate EtsiTs103097Certificate, - linkTLMCertificate EtsiTs103097Certificate OPTIONAL, - accessPoint Url -} - -RootCaEntry ::= SEQUENCE { - selfsignedRootCa EtsiTs103097Certificate, - linkRootCaCertificate EtsiTs103097Certificate OPTIONAL -} - -EaEntry ::= SEQUENCE { - eaCertificate EtsiTs103097Certificate, - aaAccessPoint Url, - itsAccessPoint Url OPTIONAL -} - -AaEntry ::= SEQUENCE { - aaCertificate EtsiTs103097Certificate, - accessPoint Url -} - -DcEntry ::= SEQUENCE { - url Url, - cert SEQUENCE OF HashedId8 -} - -DcDelete ::= Url - -Url::= IA5String - -END +EtsiTs102941TrustLists + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) trustLists(6) version1(1)} + +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +IMPORTS + +EtsiTs103097Certificate, EtsiTs103097Data-SignedAndEncrypted, EtsiTs103097Data-Signed +FROM +EtsiTs103097Module +{itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} + +HashedId8, Time32, Version --, CertificateAuthorityConstraints +FROM EtsiTs102941BaseTypes +{itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1)} + +; + +/************ +-- CRL +************/ +ToBeSignedCrl ::= SEQUENCE { + version Version, + thisUpdate Time32, + nextUpdate Time32, + entries SEQUENCE OF CrlEntry, + ... +} + +CrlEntry ::= HashedId8 + +/************ +-- TLM CTL +************/ + +ToBeSignedTlmCtl ::= CtlFormat (FullCtl | DeltaCtl) (WITH COMPONENTS {..., + ctlCommands ( WITH COMPONENT( + ( WITH COMPONENTS {..., + add ( WITH COMPONENTS {..., + ea ABSENT, + aa ABSENT + }) + }) + )) +}) + +/************ +-- RCA CTL +************/ + +ToBeSignedRcaCtl ::= CtlFormat (FullCtl | DeltaCtl) ( WITH COMPONENTS {..., + ctlCommands ( WITH COMPONENT( + ( WITH COMPONENTS {..., + add ( WITH COMPONENTS {..., + rca ABSENT, + tlm ABSENT + }) + }) + )) +}) + +/************ +-- CTL +************/ + +FullCtl::= CtlFormat ( WITH COMPONENTS {..., + isFullCtl ( TRUE ), + ctlCommands ( WITH COMPONENT( + ( WITH COMPONENTS {..., + delete ABSENT + }) + )) +}) + +DeltaCtl::= CtlFormat (WITH COMPONENTS {..., + isFullCtl(FALSE) +}) + + +CtlFormat ::= SEQUENCE { + version Version, + nextUpdate Time32, + isFullCtl BOOLEAN, + ctlSequence INTEGER (0..255), + ctlCommands SEQUENCE OF CtlCommand, + ... +} + +CtlCommand ::= CHOICE { + add CtlEntry, + delete CtlDelete, + ... +} + +CtlEntry ::= CHOICE { + rca RootCaEntry, + ea EaEntry, + aa AaEntry, + dc DcEntry, + tlm TlmEntry, + ... +} + +CtlDelete ::= CHOICE { + cert HashedId8, + dc DcDelete, + ... +} + +TlmEntry::= SEQUENCE { + selfSignedTLMCertificate EtsiTs103097Certificate, + linkTLMCertificate EtsiTs103097Certificate OPTIONAL, + accessPoint Url +} + +RootCaEntry ::= SEQUENCE { + selfsignedRootCa EtsiTs103097Certificate, + linkRootCaCertificate EtsiTs103097Certificate OPTIONAL +} + +EaEntry ::= SEQUENCE { + eaCertificate EtsiTs103097Certificate, + aaAccessPoint Url, + itsAccessPoint Url OPTIONAL +} + +AaEntry ::= SEQUENCE { + aaCertificate EtsiTs103097Certificate, + accessPoint Url +} + +DcEntry ::= SEQUENCE { + url Url, + cert SEQUENCE OF HashedId8 +} + +DcDelete ::= Url + +Url::= IA5String + +END diff --git a/asn1/Security/TS102921/EtsiTs102941TypesAuthorization.asn b/asn1/Security/TS102921/EtsiTs102941TypesAuthorization.asn index c30ab1e2..f119b24a 100644 --- a/asn1/Security/TS102921/EtsiTs102941TypesAuthorization.asn +++ b/asn1/Security/TS102921/EtsiTs102941TypesAuthorization.asn @@ -1,91 +1,91 @@ -EtsiTs102941TypesAuthorization - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version1(1)} - -DEFINITIONS AUTOMATIC TAGS ::= -BEGIN - -IMPORTS - -EtsiTs103097Certificate, -EtsiTs103097Data-Signed -FROM EtsiTs103097Module -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} - -CertificateFormat, CertificateSubjectAttributes, EcSignature, HashedId8, PublicKeys, Version -FROM EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1) } - -; - -/************ --- AuthorizationRequest/Response -************/ - -AuthorizationResponseCode ::= ENUMERATED { - ok(0), - -- ITS->AA - its-aa-cantparse, -- valid for any structure - its-aa-badcontenttype, -- not encrypted, not signed, not authorizationrequest - its-aa-imnottherecipient, -- the “recipients” of the outermost encrypted data doesn’t include me - its-aa-unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm - its-aa-decryptionfailed, -- works for ECIES-HMAC and AES-CCM - its-aa-keysdontmatch, -- HMAC keyTag verification fails - its-aa-incompleterequest, -- some elements are missing - its-aa-invalidencryptionkey, -- the responseEncryptionKey is bad - its-aa-outofsyncrequest, -- signingTime is outside acceptable limits - its-aa-unknownea, -- the EA identified by eaId is unknown to me - its-aa-invalidea, -- the EA certificate is revoked - its-aa-deniedpermissions, -- I, the AA, deny the requested permissions - -- AA->EA - aa-ea-cantreachea, -- the EA is unreachable (network error?) - -- EA->AA - ea-aa-cantparse, -- valid for any structure - ea-aa-badcontenttype, -- not encrypted, not signed, not authorizationrequest - ea-aa-imnottherecipient, -- the “recipients” of the outermost encrypted data doesn’t include me - ea-aa-unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm - ea-aa-decryptionfailed, -- works for ECIES-HMAC and AES-CCM - -- TODO: to be continued... - invalidaa, -- the AA certificate presented is invalid/revoked/whatever - invalidaasignature, -- the AA certificate presented can’t validate the request signature - wrongea, -- the encrypted signature doesn’t designate me as the EA - unknownits, -- can’t retrieve the EC/ITS in my DB - invalidsignature, -- signature verification of the request by the EC fails - invalidencryptionkey, -- signature is good, but the key is bad - deniedpermissions, -- permissions not granted - deniedtoomanycerts, -- parallel limit - ... } - - -InnerAtRequest ::= SEQUENCE { - publicKeys PublicKeys, - hmacKey OCTET STRING (SIZE(32)), - sharedAtRequest SharedAtRequest, - ecSignature EcSignature, - ... - } - -SharedAtRequest ::= SEQUENCE { - eaId HashedId8, - keyTag OCTET STRING (SIZE(16)), - certificateFormat CertificateFormat, - requestedSubjectAttributes CertificateSubjectAttributes (WITH COMPONENTS{certIssuePermissions ABSENT}), - ... - } - -InnerAtResponse ::= SEQUENCE { - requestHash OCTET STRING (SIZE(16)), - responseCode AuthorizationResponseCode, - certificate EtsiTs103097Certificate OPTIONAL, - ... - } - (WITH COMPONENTS { responseCode (ok), certificate PRESENT } - | WITH COMPONENTS { responseCode (ALL EXCEPT ok), certificate ABSENT } - ) - -END - - - - - - +EtsiTs102941TypesAuthorization + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version1(1)} + +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +IMPORTS + +EtsiTs103097Certificate, +EtsiTs103097Data-Signed +FROM EtsiTs103097Module +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} + +CertificateFormat, CertificateSubjectAttributes, EcSignature, HashedId8, PublicKeys, Version +FROM EtsiTs102941BaseTypes +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1) } + +; + +/************ +-- AuthorizationRequest/Response +************/ + +AuthorizationResponseCode ::= ENUMERATED { + ok(0), + -- ITS->AA + its-aa-cantparse, -- valid for any structure + its-aa-badcontenttype, -- not encrypted, not signed, not authorizationrequest + its-aa-imnottherecipient, -- the “recipients” of the outermost encrypted data doesn’t include me + its-aa-unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm + its-aa-decryptionfailed, -- works for ECIES-HMAC and AES-CCM + its-aa-keysdontmatch, -- HMAC keyTag verification fails + its-aa-incompleterequest, -- some elements are missing + its-aa-invalidencryptionkey, -- the responseEncryptionKey is bad + its-aa-outofsyncrequest, -- signingTime is outside acceptable limits + its-aa-unknownea, -- the EA identified by eaId is unknown to me + its-aa-invalidea, -- the EA certificate is revoked + its-aa-deniedpermissions, -- I, the AA, deny the requested permissions + -- AA->EA + aa-ea-cantreachea, -- the EA is unreachable (network error?) + -- EA->AA + ea-aa-cantparse, -- valid for any structure + ea-aa-badcontenttype, -- not encrypted, not signed, not authorizationrequest + ea-aa-imnottherecipient, -- the “recipients” of the outermost encrypted data doesn’t include me + ea-aa-unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm + ea-aa-decryptionfailed, -- works for ECIES-HMAC and AES-CCM + -- TODO: to be continued... + invalidaa, -- the AA certificate presented is invalid/revoked/whatever + invalidaasignature, -- the AA certificate presented can’t validate the request signature + wrongea, -- the encrypted signature doesn’t designate me as the EA + unknownits, -- can’t retrieve the EC/ITS in my DB + invalidsignature, -- signature verification of the request by the EC fails + invalidencryptionkey, -- signature is good, but the key is bad + deniedpermissions, -- permissions not granted + deniedtoomanycerts, -- parallel limit + ... } + + +InnerAtRequest ::= SEQUENCE { + publicKeys PublicKeys, + hmacKey OCTET STRING (SIZE(32)), + sharedAtRequest SharedAtRequest, + ecSignature EcSignature, + ... + } + +SharedAtRequest ::= SEQUENCE { + eaId HashedId8, + keyTag OCTET STRING (SIZE(16)), + certificateFormat CertificateFormat, + requestedSubjectAttributes CertificateSubjectAttributes (WITH COMPONENTS{...,certIssuePermissions ABSENT}), + ... + } + +InnerAtResponse ::= SEQUENCE { + requestHash OCTET STRING (SIZE(16)), + responseCode AuthorizationResponseCode, + certificate EtsiTs103097Certificate OPTIONAL, + ... + } + (WITH COMPONENTS { responseCode (ok), certificate PRESENT } + | WITH COMPONENTS { responseCode (ALL EXCEPT ok), certificate ABSENT } + ) + +END + + + + + + diff --git a/asn1/Security/TS102921/EtsiTs102941TypesAuthorizationValidation.asn b/asn1/Security/TS102921/EtsiTs102941TypesAuthorizationValidation.asn index 9ee99110..81d353cd 100644 --- a/asn1/Security/TS102921/EtsiTs102941TypesAuthorizationValidation.asn +++ b/asn1/Security/TS102921/EtsiTs102941TypesAuthorizationValidation.asn @@ -1,64 +1,67 @@ -EtsiTs102941TypesAuthorizationValidation - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authValidation(7) version1(1)} - -DEFINITIONS AUTOMATIC TAGS ::= -BEGIN - -IMPORTS - -EtsiTs103097Certificate -FROM EtsiTs103097Module -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} - -CertificateFormat, CertificateSubjectAttributes,EcSignature, HashedId8, PublicKeys, Version -FROM EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1) } - -SharedAtRequest -FROM EtsiTs102941TypesAuthorization -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version1(1)} - -; - -/************ --- AuthorizationValidationRequest/Response -************/ - -AuthorizationValidationResponseCode ::= ENUMERATED { - ok(0), - cantparse, -- valid for any structure - badcontenttype, -- not encrypted, not signed, not permissionsverificationrequest - imnottherecipient, -- the “recipients” of the outermost encrypted data doesn’t include me - unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm - decryptionfailed, -- works for ECIES-HMAC and AES-CCM - invalidaa, -- the AA certificate presented is invalid/revoked/whatever - invalidaasignature, -- the AA certificate presented can’t validate the request signature - wrongea, -- the encrypted signature doesn’t designate me as the EA - unknownits, -- can’t retrieve the EC/ITS in my DB - invalidsignature, -- signature verification of the request by the EC fails - invalidencryptionkey, -- signature is good, but the responseEncryptionKey is bad - deniedpermissions, -- requested permissions not granted - deniedtoomanycerts, -- parallel limit - deniedrequest, -- any other reason? - ... } - -AuthorizationValidationRequest ::= SEQUENCE { - sharedAtRequest SharedAtRequest, - ecSignature EcSignature, - ... - } - -AuthorizationValidationResponse ::= SEQUENCE { - requestHash OCTET STRING (SIZE(16)), - responseCode AuthorizationValidationResponseCode, - confirmedSubjectAttributes CertificateSubjectAttributes (WITH COMPONENTS{certIssuePermissions ABSENT}) OPTIONAL, - ... - } - -END - - - - - - +EtsiTs102941TypesAuthorizationValidation + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authValidation(7) version1(1)} + +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +IMPORTS + +EtsiTs103097Certificate +FROM EtsiTs103097Module +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} + +CertificateFormat, CertificateSubjectAttributes,EcSignature, HashedId8, PublicKeys, Version +FROM EtsiTs102941BaseTypes +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1) } + +SharedAtRequest +FROM EtsiTs102941TypesAuthorization +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version1(1)} + +; + +/************ +-- AuthorizationValidationRequest/Response +************/ + +AuthorizationValidationResponseCode ::= ENUMERATED { + ok(0), + cantparse, -- valid for any structure + badcontenttype, -- not encrypted, not signed, not permissionsverificationrequest + imnottherecipient, -- the “recipients” of the outermost encrypted data doesn’t include me + unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm + decryptionfailed, -- works for ECIES-HMAC and AES-CCM + invalidaa, -- the AA certificate presented is invalid/revoked/whatever + invalidaasignature, -- the AA certificate presented can’t validate the request signature + wrongea, -- the encrypted signature doesn’t designate me as the EA + unknownits, -- can’t retrieve the EC/ITS in my DB + invalidsignature, -- signature verification of the request by the EC fails + invalidencryptionkey, -- signature is good, but the responseEncryptionKey is bad + deniedpermissions, -- requested permissions not granted + deniedtoomanycerts, -- parallel limit + deniedrequest, -- any other reason? + ... } + +AuthorizationValidationRequest ::= SEQUENCE { + sharedAtRequest SharedAtRequest, + ecSignature EcSignature, + ... + } + +AuthorizationValidationResponse ::= SEQUENCE { + requestHash OCTET STRING (SIZE(16)), + responseCode AuthorizationValidationResponseCode, + confirmedSubjectAttributes CertificateSubjectAttributes (WITH COMPONENTS{certIssuePermissions ABSENT}) OPTIONAL, + ... + } + (WITH COMPONENTS { responseCode (ok), confirmedSubjectAttributes PRESENT } + | WITH COMPONENTS { responseCode (ALL EXCEPT ok), confirmedSubjectAttributes ABSENT } + ) + +END + + + + + + diff --git a/asn1/Security/TS102921/EtsiTs102941TypesCaManagement.asn b/asn1/Security/TS102921/EtsiTs102941TypesCaManagement.asn index 59465c98..1b31af63 100644 --- a/asn1/Security/TS102921/EtsiTs102941TypesCaManagement.asn +++ b/asn1/Security/TS102921/EtsiTs102941TypesCaManagement.asn @@ -1,31 +1,31 @@ -EtsiTs102941TypesCaManagement - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) caManagement(8) version1(1)} - -DEFINITIONS AUTOMATIC TAGS ::= -BEGIN - -IMPORTS - -EtsiTs103097Certificate, EtsiTs103097Data-Signed -FROM -EtsiTs103097Module -{itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} - -PublicKeys, CertificateSubjectAttributes -FROM EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1)} - -; - -/************ --- CA certificate request -************/ - -CaCertificateRequest ::= SEQUENCE { - publicKeys PublicKeys, - requestedSubjectAttributes CertificateSubjectAttributes, - ... -} - -END - +EtsiTs102941TypesCaManagement + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) caManagement(8) version1(1)} + +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +IMPORTS + +EtsiTs103097Certificate, EtsiTs103097Data-Signed +FROM +EtsiTs103097Module +{itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} + +PublicKeys, CertificateSubjectAttributes +FROM EtsiTs102941BaseTypes +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1)} + +; + +/************ +-- CA certificate request +************/ + +CaCertificateRequest ::= SEQUENCE { + publicKeys PublicKeys, + requestedSubjectAttributes CertificateSubjectAttributes, + ... +} + +END + diff --git a/asn1/Security/TS102921/EtsiTs102941TypesEnrolment.asn b/asn1/Security/TS102921/EtsiTs102941TypesEnrolment.asn index 04a4a1be..42a73c01 100644 --- a/asn1/Security/TS102921/EtsiTs102941TypesEnrolment.asn +++ b/asn1/Security/TS102921/EtsiTs102941TypesEnrolment.asn @@ -1,67 +1,67 @@ -EtsiTs102941TypesEnrolment - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) enrolment(4) version1(1)} - -DEFINITIONS AUTOMATIC TAGS ::= -BEGIN - -IMPORTS - -EtsiTs103097Certificate, -EtsiTs103097Data-Signed -FROM EtsiTs103097Module -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} - -CertificateFormat, CertificateSubjectAttributes, EcSignature, HashedId8, PublicKeys, Version -FROM EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1) } - -; - -/************ --- EnrolmentRequest/Response -************/ - -EnrolmentResponseCode ::= ENUMERATED { - ok(0), - cantparse, -- valid for any structure - badcontenttype, -- not encrypted, not signed, not enrolmentrequest - imnottherecipient, -- the “recipients†doesn’t include me - unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm - decryptionfailed, -- works for ECIES-HMAC and AES-CCM - unknownits, -- can’t retrieve the ITS from the itsId - invalidsignature, -- signature verification of the request fails - invalidencryptionkey, -- signature is good, but the responseEncryptionKey is bad - baditsstatus, -- revoked, not yet active - incompleterequest, -- some elements are missing - deniedpermissions, -- requested permissions are not granted - invalidkeys, -- either the verification_key of the encryption_key is bad - deniedrequest, -- any other reason? - ... } - -InnerEcRequestSignedForPop::= EtsiTs103097Data-Signed{InnerEcRequest} - -InnerEcRequest ::= SEQUENCE { - itsId IA5String, - certificateFormat CertificateFormat, - publicKeys PublicKeys, - requestedSubjectAttributes CertificateSubjectAttributes (WITH COMPONENTS{certIssuePermissions ABSENT}), - ... - } - -InnerEcResponse ::= SEQUENCE { - requestHash OCTET STRING (SIZE(16)), - responseCode EnrolmentResponseCode, - certificate EtsiTs103097Certificate OPTIONAL, - ... - } - (WITH COMPONENTS { responseCode (ok), certificate PRESENT } - | WITH COMPONENTS { responseCode (ALL EXCEPT ok), certificate ABSENT } - ) - -END - - - - - - +EtsiTs102941TypesEnrolment + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) enrolment(4) version1(1)} + +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +IMPORTS + +EtsiTs103097Certificate, +EtsiTs103097Data-Signed +FROM EtsiTs103097Module +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} + +CertificateFormat, CertificateSubjectAttributes, EcSignature, HashedId8, PublicKeys, Version +FROM EtsiTs102941BaseTypes +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1) } + +; + +/************ +-- EnrolmentRequest/Response +************/ + +EnrolmentResponseCode ::= ENUMERATED { + ok(0), + cantparse, -- valid for any structure + badcontenttype, -- not encrypted, not signed, not enrolmentrequest + imnottherecipient, -- the “recipients†doesn’t include me + unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm + decryptionfailed, -- works for ECIES-HMAC and AES-CCM + unknownits, -- can’t retrieve the ITS from the itsId + invalidsignature, -- signature verification of the request fails + invalidencryptionkey, -- signature is good, but the responseEncryptionKey is bad + baditsstatus, -- revoked, not yet active + incompleterequest, -- some elements are missing + deniedpermissions, -- requested permissions are not granted + invalidkeys, -- either the verification_key of the encryption_key is bad + deniedrequest, -- any other reason? + ... } + +InnerEcRequestSignedForPop::= EtsiTs103097Data-Signed{InnerEcRequest} + +InnerEcRequest ::= SEQUENCE { + itsId OCTET STRING, + certificateFormat CertificateFormat, + publicKeys PublicKeys, + requestedSubjectAttributes CertificateSubjectAttributes (WITH COMPONENTS{certIssuePermissions ABSENT}), + ... + } + +InnerEcResponse ::= SEQUENCE { + requestHash OCTET STRING (SIZE(16)), + responseCode EnrolmentResponseCode, + certificate EtsiTs103097Certificate OPTIONAL, + ... + } + (WITH COMPONENTS { responseCode (ok), certificate PRESENT } + | WITH COMPONENTS { responseCode (ALL EXCEPT ok), certificate ABSENT } + ) + +END + + + + + + diff --git a/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn b/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn index 583041d8..b98cf6a6 100644 --- a/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn +++ b/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn @@ -27,9 +27,9 @@ module LibItsCommon_ASN1_NamedNumbers { const AltitudeValue AltitudeValue_unavailable_ := 800001; const CurvatureValue CurvatureValue_straight_ := 0; - const CurvatureValue CurvatureValue_reciprocalOf1MeterRadiusToRight_ := -30000; - const CurvatureValue CurvatureValue_reciprocalOf1MeterRadiusToLeft_ := 30000; - const CurvatureValue CurvatureValue_unavailable_ := 30001; + const CurvatureValue CurvatureValue_reciprocalOf1MeterRadiusToRight_ := -1023; + const CurvatureValue CurvatureValue_reciprocalOf1MeterRadiusToLeft_ := 1023; + const CurvatureValue CurvatureValue_unavailable_ := 1023; const ExteriorLights ExteriorLights_lowBeamHeadlightsOn_ := '10000000'B; const ExteriorLights ExteriorLights_highBeamHeadlightsOn_ := '01000000'B; diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 8b1624e2..9b4f3d12 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -192,7 +192,7 @@ module LibItsPki_Functions { } // End of function f_utInitializeIut function f_sendUtTriggerPrimitive( - in charstring p_canonical_id, + in octetstring p_canonical_id, in Oct1 p_enc_algorithm, in octetstring p_private_key, in octetstring p_public_key_compressed, diff --git a/ttcn/Pki/LibItsPki_Pics.ttcn b/ttcn/Pki/LibItsPki_Pics.ttcn index 87388910..9aa745da 100644 --- a/ttcn/Pki/LibItsPki_Pics.ttcn +++ b/ttcn/Pki/LibItsPki_Pics.ttcn @@ -123,6 +123,6 @@ module LibItsPki_Pics { /** * @desc Canonical ITSS-S identifier */ - modulepar charstring PICS_ITS_S_CANONICAL_ID := "1B4CA1210123AE900BBE6C3EBAE7E87DA20DBDAB1E7B2EC0691C51C1021900AA"; + modulepar octetstring PICS_ITS_S_CANONICAL_ID := '1B4CA1210123AE900BBE6C3EBAE7E87DA20DBDAB1E7B2EC0691C51C1021900AA'O; } // End of module LibItsPki_Pics diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn index 4e2bf934..6e66faee 100644 --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ b/ttcn/Pki/LibItsPki_Templates.ttcn @@ -173,7 +173,7 @@ module LibItsPki_Templates { } // End of template mw_authorizationValidationResponse template (value) InnerEcRequest m_innerEcRequest( - in template (value) charstring p_itsId, + in template (value) octetstring p_itsId, in template (value) PublicKeys p_publicKeys, in template (value) CertificateSubjectAttributes p_requestedSubjectAttributes ) := { @@ -184,7 +184,7 @@ module LibItsPki_Templates { } // End of template m_innerEcRequest template (present) InnerEcRequest mw_innerEcRequest( - template (present) charstring p_itsId := ?, + template (present) octetstring p_itsId := ?, template (present) PublicKeys p_publicKeys := ?, template (present) CertificateSubjectAttributes p_requestedSubjectAttributes := ? ) := { diff --git a/ttcn/Pki/LibItsPki_TypesAndValues.ttcn b/ttcn/Pki/LibItsPki_TypesAndValues.ttcn index c064e282..ad69cd46 100644 --- a/ttcn/Pki/LibItsPki_TypesAndValues.ttcn +++ b/ttcn/Pki/LibItsPki_TypesAndValues.ttcn @@ -63,7 +63,7 @@ module LibItsPki_TypesAndValues { * @member compressedPublickey The compressed public key to be used for signature of the requested EA certificate (format: [02|03] */ type record TriggerEnrolmentRequest { - charstring cannonicalId, + octetstring cannonicalId, Oct1 encAlgorithm, octetstring privateKey, octetstring compressedPublickey -- GitLab From 560b4607a3769990ed4de39d1882c861c83f04a3 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 10 Jan 2019 08:23:17 -0800 Subject: [PATCH 169/320] Set GeoNetworking version to 1 --- ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn index 9642e7c7..657c86b3 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn @@ -159,7 +159,7 @@ module LibItsGeoNetworking_TypesAndValues { group geoNwHeaderConstants { - const UInt4 c_geoNwProtocolVersion := 0; + const UInt4 c_geoNwProtocolVersion := 1; const UInt8 c_hopLimit1 := 1; const UInt8 c_defaultHopLimit := 10; -- GitLab From edf2b2382575158a73e454e06382f4983efe000c Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 10 Jan 2019 22:45:33 -0800 Subject: [PATCH 170/320] Add patch for TITAN COER encoding/decoding --- asn1/Security/TS102921/EtsiTs102941BaseTypes.asn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asn1/Security/TS102921/EtsiTs102941BaseTypes.asn b/asn1/Security/TS102921/EtsiTs102941BaseTypes.asn index 9d16c7ec..9ae24c97 100644 --- a/asn1/Security/TS102921/EtsiTs102941BaseTypes.asn +++ b/asn1/Security/TS102921/EtsiTs102941BaseTypes.asn @@ -47,7 +47,7 @@ PublicKeys ::= SEQUENCE { encryptionKey PublicEncryptionKey OPTIONAL } -Version ::= INTEGER {v1(1)} +Version ::= INTEGER {v1(1)}(1..255) EtsiTs103097Data-Encrypted-Unicast {ToBeEncryptedDataContent} ::= EtsiTs103097Data-Encrypted {ToBeEncryptedDataContent} (WITH COMPONENTS {..., -- GitLab From fcbef4639f71d21943257c3a0f17602b8017cf10 Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 18 Jan 2019 07:18:15 -0800 Subject: [PATCH 171/320] Start PSAP tests --- ttcn/Http/LibItsHttp_Templates.ttcn | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/ttcn/Http/LibItsHttp_Templates.ttcn b/ttcn/Http/LibItsHttp_Templates.ttcn index d77da983..c647b882 100644 --- a/ttcn/Http/LibItsHttp_Templates.ttcn +++ b/ttcn/Http/LibItsHttp_Templates.ttcn @@ -102,8 +102,20 @@ module LibItsHttp_Templates { group http_responses { + template (value) Response m_http_response_ok( + in template (value) HttpMessageBody p_body, + in template (value) HeaderLines p_header + ) := { + version_major := 1, + version_minor := 1, + statuscode := 200, + statustext := "OK", + header := p_header, + body := p_body + } // End of template m_http_response_ok + template (present) Response mw_http_response_ok( - template (present) HttpMessageBody p_body := ?, + template (present) HttpMessageBody p_body := ?, template (present) HeaderLines p_header := ? ) := { version_major := 1, @@ -114,6 +126,20 @@ module LibItsHttp_Templates { body := p_body } // End of template mw_http_response_ok + template (value) Response m_http_response_ko( + in template (value) HttpMessageBody p_body, + in template (value) HeaderLines p_header, + in template (value) integer p_statuscode := 404, + in template (value) charstring p_statustext := "Not found" + ) := { + version_major := 1, + version_minor := 1, + statuscode := p_statuscode, + statustext := p_statustext, + header := p_header, + body := p_body + } // End of template m_http_response_ko + template Response mw_http_response_ko( template HttpMessageBody p_body := *, template (present) HeaderLines p_header := ? -- GitLab From d0692d41bcaeefafa243940e1b572f04e9a9e3b9 Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 21 Jan 2019 01:02:31 -0800 Subject: [PATCH 172/320] Bug fixed in CDD version number --- ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn b/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn index b98cf6a6..81ecb733 100644 --- a/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn +++ b/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn @@ -44,7 +44,7 @@ module LibItsCommon_ASN1_NamedNumbers { const HeadingValue HeadingValue_wgs84North_ := 0; - const ItsPduHeader.protocolVersion ItsPduHeader_protocolVersion_currentVersion_ := 1; + const ItsPduHeader.protocolVersion ItsPduHeader_protocolVersion_currentVersion_ := 2; const ItsPduHeader.messageID ItsPduHeader_messageID_denm_ := 1; const ItsPduHeader.messageID ItsPduHeader_messageID_cam_ := 2; const ItsPduHeader.messageID ItsPduHeader_messageID_poi_ := 3; @@ -56,6 +56,8 @@ module LibItsCommon_ASN1_NamedNumbers { const ItsPduHeader.messageID ItsPduHeader_messageID_srem_ := 9; const ItsPduHeader.messageID ItsPduHeader_messageID_ssem_ := 10; const ItsPduHeader.messageID ItsPduHeader_messageID_evcsn_ := 11; + const ItsPduHeader.messageID ItsPduHeader_messageID_saem_ := 12; + const ItsPduHeader.messageID ItsPduHeader_messageID_rtcem_ := 13; const LongitudinalAccelerationValue LongitudinalAccelerationValue_unavailable_ := 161; -- GitLab From 8f237707f4ced722496d1f0afc30122e9c8453a7 Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 22 Jan 2019 01:11:40 -0800 Subject: [PATCH 173/320] Bug fixed in Http headers namming --- ttcn/Http/LibItsHttp_TypesAndValues.ttcn | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ttcn/Http/LibItsHttp_TypesAndValues.ttcn b/ttcn/Http/LibItsHttp_TypesAndValues.ttcn index a96ba19d..03b89e9c 100644 --- a/ttcn/Http/LibItsHttp_TypesAndValues.ttcn +++ b/ttcn/Http/LibItsHttp_TypesAndValues.ttcn @@ -16,9 +16,9 @@ module LibItsHttp_TypesAndValues { import from LibItsHttp_XmlMessageBodyTypes all; const charstring c_header_host := "Host"; - const charstring c_header_content_type := "Content-type"; - const charstring c_header_content_text := "Content-text"; - const charstring c_header_content_length := "Content-length"; + const charstring c_header_content_type := "Content-Type"; + const charstring c_header_content_text := "Content-Text"; + const charstring c_header_content_length := "Content-Length"; const charstring c_header_accept := "Accept"; const charstring c_header_connection := "Connection"; const charstring c_header_pragma := "Pragma"; -- GitLab From eb8bd36ba10b5bf18773d509005a895f99ea26d2 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 23 Jan 2019 03:04:18 -0800 Subject: [PATCH 174/320] Bug fixed in Ats Security --- ttcn/Pki/LibItsPki_Functions.ttcn | 87 ++++++++++++------- ttcn/Pki/LibItsPki_Pixits.ttcn | 18 +++- ttcn/Security/LibItsSecurity_Functions.ttcn | 94 +++++++++++---------- 3 files changed, 121 insertions(+), 78 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 9b4f3d12..97eb453a 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -253,6 +253,9 @@ module LibItsPki_Functions { log("*** f_http_build_inner_ec_request: ERROR: Failed to generate InnerEcRequest ***"); f_selfOrClientSyncAndVerdict("error", e_error); } + log ("f_http_build_enrolment_request: EC verification private key: ", p_private_key); + log ("f_http_build_enrolment_request: EC verification public compressed key: ", p_public_key_compressed); + log ("f_http_build_enrolment_request: EC verification public compressed mode: ", p_compressed_mode); // Generate InnerEcRequestSignedForPoP if (f_generate_inner_ec_request_signed_for_pop(p_private_key, v_inner_ec_request, v_inner_ec_request_signed_for_pop) == false) { log("*** f_http_build_inner_ec_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); @@ -276,10 +279,9 @@ module LibItsPki_Functions { if (PX_FIRST_ENROLMENT == true) { // This is the first enrolment, we used Factory keys v_ret_code := f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } else { // We use last valid EC certificate - var Oct32 v_ec_private_key; - var HashedId8 v_ec_hashed_id8; + var Oct32 v_ec_private_key := PX_EC_PRIVATE_KEY; + var HashedId8 v_ec_hashed_id8 := PX_EC_HASHED_ID8; // Retrieve EC certificate from the first enrolment - // TODO Set v_ec_private_key & v_ec_hashed_id8 v_ret_code := f_build_pki_secured_request_message_signed_with_pop(v_ec_private_key, valueof(m_signerIdentifier_digest(v_ec_hashed_id8)), v_ec_hashed_id8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } if (v_ret_code == false) { @@ -312,6 +314,9 @@ module LibItsPki_Functions { log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequest ***"); f_selfOrClientSyncAndVerdict("error", e_error); } + log ("f_http_build_invalid_enrolment_request: EC verification private key: ", p_private_key); + log ("f_http_build_invalid_enrolment_request: EC verification public compressed key: ", p_public_key_compressed); + log ("f_http_build_invalid_enrolment_request: EC verification public compressed mode: ", p_compressed_mode); // Generate InnerEcRequestSignedForPoP if (f_generate_inner_ec_request_signed_for_pop(p_private_key, v_inner_ec_request, v_inner_ec_request_signed_for_pop) == false) { log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); @@ -384,6 +389,9 @@ module LibItsPki_Functions { f_selfOrClientSyncAndVerdict("error", e_error); return; } + log ("f_http_build_authorization_request: AT verification private key: ", p_private_key); + log ("f_http_build_authorization_request: AT verification public compressed key: ", p_public_key_compressed); + log ("f_http_build_authorization_request: AT verification public compressed mode: ", p_compressed_mode); // Generate encryption keys for the certificate to be requested if (PX_INCLUDE_ENCRYPTION_KEYS) { if (f_generate_key_pair_nistp256(p_private_enc_key, v_public_enc_key_x, v_public_enc_key_y, p_public_compressed_enc_key, p_compressedEncMode) == false) { @@ -620,7 +628,6 @@ module LibItsPki_Functions { } else { v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(p_public_key_compressed)); } - log ("f_generate_inner_ec_request: ", v_eccP256_curve_point); // Build the Proof of Possession InnerEcRequest p_inner_ec_request := valueof( m_innerEcRequest( @@ -942,9 +949,9 @@ module LibItsPki_Functions { group awaiting_messages { function f_await_http_inner_ec_request_response( - out Oct32 p_private_key, - out Oct32 p_compressed_public_key, - out integer p_compressed_mode, + out Oct32 p_private_key, + out Oct32 p_compressed_public_key, + out integer p_compressed_mode, out InnerEcResponse p_inner_ec_response ) runs on ItsPkiHttp return boolean { var HeaderLines v_headers; @@ -991,13 +998,14 @@ module LibItsPki_Functions { // Verify the received EC certificate log("f_await_http_inner_ec_request_response: match ", match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(substr(v_request_hash, 0, 16), mw_etsiTs103097Certificate(-, mw_toBeSignedCertificate_ec, -)))), " ***"); // TODO In TITAN, this is the only way to get the unmatching in log if (match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(substr(v_request_hash, 0, 16), mw_etsiTs103097Certificate(-, mw_toBeSignedCertificate_ec, -))))) { - if (f_verify_ec_certificate(v_etsi_ts_102941_data.content.enrolmentResponse.certificate, p_compressed_public_key, p_compressed_mode)) { - p_inner_ec_response := v_etsi_ts_102941_data.content.enrolmentResponse; + p_inner_ec_response := v_etsi_ts_102941_data.content.enrolmentResponse; + if (f_verify_ec_certificate(v_etsi_ts_102941_data.content.enrolmentResponse.certificate, vc_eaCertificate, p_compressed_public_key, p_compressed_mode)) { log("f_await_http_inner_ec_request_response: Well-secured EA certificate received ***"); log("p_inner_ec_response= ", p_inner_ec_response); return true; } else { log("f_await_http_inner_ec_request_response: Cannot verify EC certificate signature ***"); + return true; // For debug mode only } } else { log("f_await_http_inner_ec_request_response: Unexpected message received ***"); @@ -1434,16 +1442,24 @@ module LibItsPki_Functions { /** * @desc Verify the EC certificate generated by the EA entity * @param p_ec_certificate The new EC certificate - * @param p_public_key_compressed The public compressed key (canonical form) for signature check + * @param p_ea_certificate The certificate issuer + * @param p_public_key_compressed The public compressed key (canonical form) generated for the InnerEcRequest * @param p_compressed_mode The public compressed key mode * @return true on success, false otherwise */ function f_verify_ec_certificate( in Certificate p_ec_certificate, + in Certificate p_ea_certificate, in octetstring p_public_key_compressed, in integer p_compressed_mode ) return boolean { - var bitstring v_encoded_tbs; + var bitstring v_encoded_cert; + var HashedId8 v_ec_cert_hashed_id8; + + // Calculate the HashedId8 of the whole certificate + v_encoded_cert := encvalue(p_ec_certificate); + v_ec_cert_hashed_id8 := f_HashedId8FromSha256(f_hashWithSha256(bit2oct(v_encoded_cert))); + log("f_verify_ec_certificate: EC certificate HashedId8: ", v_ec_cert_hashed_id8); // Check the signer log("f_verify_ec_certificate: ", match(p_ec_certificate.issuer, mw_issuerIdentifier_self())); @@ -1453,44 +1469,51 @@ module LibItsPki_Functions { // Check EC certificate signature // TODO Who sign the EC certificate? - /*if (f_verifyCertificateSignatureWithPublicKey(p_ec_certificate, p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey) == false) { + if (f_verifyCertificateSignatureWithPublicKey(p_ec_certificate, p_ea_certificate.toBeSigned.verifyKeyIndicator.verificationKey) == false) { log("f_verify_ec_certificate: Signature not verified"); return false; - }*/ + } return true; } // End of function f_verify_ec_certificate /** - * @desc Verify the generated AA certificate - * @param p_aa_certificate The new EA certificate - * @param p_public_key_compressed The public compressed key (canonical form) for signature check - * @param p_compressed_mode The public compressed key mode + * @desc Verify the generated AT certificate + * @param p_at_certificate The new AT certificate + * @param p_ea_certificate The certificate issuer + * @param p_public_key_compressed The public compressed key (canonical form) generated for the InnerAtRequest + * @param p_compressed_mode The public compressed key mode * @return true on success, false otherwise */ - function f_verify_aa_certificate( + function f_verify_at_certificate( + in Certificate p_at_certificate, in Certificate p_aa_certificate, in octetstring p_public_key_compressed, in integer p_compressed_mode ) return boolean { - var bitstring v_encoded_tbs; - var boolean v_result; + var bitstring v_encoded_cert; + var HashedId8 v_at_cert_hashed_id8; + + // Calculate the HashedId8 of the whole certificate + v_encoded_cert := encvalue(p_at_certificate); + v_at_cert_hashed_id8 := f_HashedId8FromSha256(f_hashWithSha256(bit2oct(v_encoded_cert))); + log("f_verify_at_certificate: EC certificate HashedId8: ", v_at_cert_hashed_id8); - // Check certificate format - v_result := match(p_aa_certificate, mw_etsiTs103097Certificate(mw_issuerIdentifier_self, mw_toBeSignedCertificate_aa, -)); // Check the signer + log("f_verify_at_certificate: ", match(p_at_certificate.issuer, mw_issuerIdentifier_self())); + if (match(p_at_certificate.issuer, mw_issuerIdentifier_self)) { + return false; + } - // Check EA certificate signature - v_encoded_tbs := encvalue(p_aa_certificate.toBeSigned); - v_result := v_result and f_verifyWithEcdsaNistp256WithSha256( - bit2oct(v_encoded_tbs), - int2oct(0, 32), // self - p_aa_certificate.signature_.ecdsaNistP256Signature.rSig.x_only & p_aa_certificate.signature_.ecdsaNistP256Signature.sSig, - p_public_key_compressed, - p_compressed_mode); + // Check EC certificate signature + // TODO Who sign the EC certificate? + if (f_verifyCertificateSignatureWithPublicKey(p_at_certificate, p_aa_certificate.toBeSigned.verifyKeyIndicator.verificationKey) == false) { + log("f_verify_at_certificate: Signature not verified"); + return false; + } - return v_result; - } // End of function f_verify_aa_certificate + return true; + } // End of function f_verify_at_certificate } // End of group inner_ec_xxx diff --git a/ttcn/Pki/LibItsPki_Pixits.ttcn b/ttcn/Pki/LibItsPki_Pixits.ttcn index 5ea567c3..1f0701bd 100644 --- a/ttcn/Pki/LibItsPki_Pixits.ttcn +++ b/ttcn/Pki/LibItsPki_Pixits.ttcn @@ -1,5 +1,12 @@ module LibItsPki_Pixits { - + + // LibCommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; + + // LibIts + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + /** * @desc Is the first enrolment? */ @@ -14,5 +21,14 @@ module LibItsPki_Pixits { * @desc Do the Authorization Request use SignedWithPop mechanism? */ modulepar boolean PX_AUTHORIZATION_REQUEST_WITH_POP := true; + + /** + * @desc Contains the private key for the EC certificate, used in case of re-enrolment + */ + modulepar Oct32 PX_EC_PRIVATE_KEY := int2oct(0, 32); + /** + * @desc Contains the hashed id8 of the EC certificate, used in case of re-enrolment + */ + modulepar HashedId8 PX_EC_HASHED_ID8 := int2oct(0, 8); } // End of module LibItsPki_Pixits diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index da5c1199..09db5eba 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -795,7 +795,8 @@ module LibItsSecurity_Functions { var octetstring v_certificateIssuer; var octetstring v_privateKey; - //log(">>> f_buildGnSecuredMessage: p_securedMessage=", p_securedMessage); + log(">>> f_buildGnSecuredMessage: p_securedMessage=", p_securedMessage); + log(">>> f_buildGnSecuredMessage: p_payloadField=", p_payloadField); // Prepare payload to be signed v_toBeSignedData := valueof(p_payloadField); @@ -814,44 +815,44 @@ module LibItsSecurity_Functions { f_getCertificateHash(p_certificateName, v_certificateIssuer); if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature)) { - v_signature := f_signWithEcdsaNistp256WithSha256( - v_secPayload, - v_certificateIssuer, - v_privateKey - ); - p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only(substr(v_signature, 0, 32)), - substr(v_signature, 32, 32) - ) - )); + v_signature := f_signWithEcdsaNistp256WithSha256( + v_secPayload, + v_certificateIssuer, + v_privateKey + ); + p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaNistP256( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only(substr(v_signature, 0, 32)), + substr(v_signature, 32, 32) + ) + )); } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { v_signature := f_signWithEcdsaBrainpoolp256WithSha256( - v_secPayload, - v_certificateIssuer, - v_privateKey - ); + v_secPayload, + v_certificateIssuer, + v_privateKey + ); p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP256r1( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only(substr(v_signature, 0, 32)), - substr(v_signature, 32, 32) - ) - )); + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only(substr(v_signature, 0, 32)), + substr(v_signature, 32, 32) + ) + )); } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature)) { - v_signature := f_signWithEcdsaBrainpoolp384WithSha384( - v_secPayload, - v_certificateIssuer, - v_privateKey - ); - p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP384r1( - m_ecdsaP384Signature( - m_eccP384CurvePoint_x_only(substr(v_signature, 0, 32)), - substr(v_signature, 32, 32) - ) - )); + v_signature := f_signWithEcdsaBrainpoolp384WithSha384( + v_secPayload, + v_certificateIssuer, + v_privateKey + ); + p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP384r1( + m_ecdsaP384Signature( + m_eccP384CurvePoint_x_only(substr(v_signature, 0, 32)), + substr(v_signature, 32, 32) + ) + )); } // TODO To be continued - //log("<<< f_buildGnSecuredMessage: p_securedMessage=", p_securedMessage); + log("<<< f_buildGnSecuredMessage: p_securedMessage=", p_securedMessage); return true; } // End of function f_buildGnSecuredMessage @@ -1068,7 +1069,10 @@ module LibItsSecurity_Functions { ) runs on ItsSecurityBaseComponent return boolean { // Local variables var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; - + + log(">>> f_buildGnSecuredCam: p_securedMessage= ", p_securedMessage); + log(">>> f_buildGnSecuredCam: p_payloadField= ", p_payloadField); + // Load certificates if required if (f_prepareCertificates(p_certificateName, v_aaCertificate, v_atCertificate) == false) { return false; @@ -1077,17 +1081,17 @@ module LibItsSecurity_Functions { // Fill the structure with default values, these values will be updated later p_securedMessage := valueof(m_etsiTs103097Data_signed( - m_signedData( - sha256, - p_payloadField, - m_signerIdentifier_self, - m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only(int2oct(0, 32)), - int2oct(0, 32) - ) - ) - ) + m_signedData( + sha256, + p_payloadField, + m_signerIdentifier_self, + m_signature_ecdsaNistP256( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only(int2oct(0, 32)), + int2oct(0, 32) + ) + ) + ) )); // Prepare mandatory headers //log("f_buildGnSecuredCam: p_signerIdentifierType=", p_signerIdentifierType); -- GitLab From c7d7b24f14bed9f6088cc9df85d9f45327f4db96 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 24 Jan 2019 00:37:20 -0800 Subject: [PATCH 175/320] Minor bug fixed --- ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn | 1 + 1 file changed, 1 insertion(+) diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn index 94382b1a..5753fb17 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn @@ -264,6 +264,7 @@ module LibItsGeoNetworking_Functions { // Positions & Areas vc_componentTable[0].gnComponent.start(f_getIutLongPosVector_1(v_longPosVectorIut)); // Get positions vc_componentTable[0].gnComponent.done; + // TODO Check value of v_longPosVectorIut after the done, seems to be reseted to dummy value f_preparePositionsAndAreas(v_positionTable, v_areaTable, v_longPosVectorIut); // Initialize components -- GitLab From 6c4f7baa1861780639cc7fdf3e34446d8d9c343c Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 28 Jan 2019 07:39:17 -0800 Subject: [PATCH 176/320] Use PICs for HTTP version --- ttcn/Http/LibItsHttp_Pics.ttcn | 32 ++++++++++++++++-------- ttcn/Http/LibItsHttp_TypesAndValues.ttcn | 5 ++-- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/ttcn/Http/LibItsHttp_Pics.ttcn b/ttcn/Http/LibItsHttp_Pics.ttcn index d9aaa7e7..fdbb6b3c 100644 --- a/ttcn/Http/LibItsHttp_Pics.ttcn +++ b/ttcn/Http/LibItsHttp_Pics.ttcn @@ -1,13 +1,23 @@ module LibItsHttp_Pics { - - /** - * @desc - */ - modulepar charstring PICS_HEADER_HOST := "www.lisp.com"; - - /** - * @desc - */ - modulepar charstring PICS_HEADER_CONTENT_TYPE := "application/x-its-request"; - + + /** + * @desc HTTP major version + */ + modulepar integer PICS_HTTP_VERSION_MAJOR := 1; + + /** + * @desc HTTP minor version + */ + modulepar integer PICS_HTTP_VERSION_MINOR := 1; + + /** + * @desc + */ + modulepar charstring PICS_HEADER_HOST := "www.lisp.com"; + + /** + * @desc + */ + modulepar charstring PICS_HEADER_CONTENT_TYPE := "application/x-its-request"; + } // End of module LibItsHttp_Pics diff --git a/ttcn/Http/LibItsHttp_TypesAndValues.ttcn b/ttcn/Http/LibItsHttp_TypesAndValues.ttcn index 03b89e9c..45fe18a5 100644 --- a/ttcn/Http/LibItsHttp_TypesAndValues.ttcn +++ b/ttcn/Http/LibItsHttp_TypesAndValues.ttcn @@ -14,6 +14,7 @@ module LibItsHttp_TypesAndValues { // LibHttp import from LibItsHttp_MessageBodyTypes all; import from LibItsHttp_XmlMessageBodyTypes all; + import from LibItsHttp_Pics all; const charstring c_header_host := "Host"; const charstring c_header_content_type := "Content-Type"; @@ -24,8 +25,8 @@ module LibItsHttp_TypesAndValues { const charstring c_header_pragma := "Pragma"; const charstring c_header_cache_control := "Cache-Control"; - const integer c_http_version_major := 1; - const integer c_http_version_minor := 1; + const integer c_http_version_major := PICS_HTTP_VERSION_MAJOR; + const integer c_http_version_minor := PICS_HTTP_VERSION_MINOR; type record of charstring charstring_list; type record HeaderLine { -- GitLab From 5369be50ae61f0f8e9d158355ff5e8a2e024aac5 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 31 Jan 2019 04:23:14 -0800 Subject: [PATCH 177/320] Add ASN.1 fix for Version ::= INTEGER {v1(1)} COER encoding --- asn1/Security/TS102921/EtsiTs102941BaseTypes.asn | 2 +- asn1/Security/TS102921/EtsiTs102941MessagesCA.asn | 2 +- asn1/Security/TS102921/EtsiTs102941MessagesItss.asn | 2 +- .../TS102921/EtsiTs102941MessagesItss_OptionalPrivacy.asn | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/asn1/Security/TS102921/EtsiTs102941BaseTypes.asn b/asn1/Security/TS102921/EtsiTs102941BaseTypes.asn index 9ae24c97..b741b39d 100644 --- a/asn1/Security/TS102921/EtsiTs102941BaseTypes.asn +++ b/asn1/Security/TS102921/EtsiTs102941BaseTypes.asn @@ -47,7 +47,7 @@ PublicKeys ::= SEQUENCE { encryptionKey PublicEncryptionKey OPTIONAL } -Version ::= INTEGER {v1(1)}(1..255) + Version ::= INTEGER {v1(1)} EtsiTs103097Data-Encrypted-Unicast {ToBeEncryptedDataContent} ::= EtsiTs103097Data-Encrypted {ToBeEncryptedDataContent} (WITH COMPONENTS {..., diff --git a/asn1/Security/TS102921/EtsiTs102941MessagesCA.asn b/asn1/Security/TS102921/EtsiTs102941MessagesCA.asn index 12f7133d..32db789e 100644 --- a/asn1/Security/TS102921/EtsiTs102941MessagesCA.asn +++ b/asn1/Security/TS102921/EtsiTs102941MessagesCA.asn @@ -66,7 +66,7 @@ CaCertificateRekeyingMessage ::= EtsiTs103097Data-Signed {EtsiTs103097Data-Signe ************/ EtsiTs102941Data::= SEQUENCE { - version Version (v1), + version Version (v1)) (1..255), content EtsiTs102941DataContent } diff --git a/asn1/Security/TS102921/EtsiTs102941MessagesItss.asn b/asn1/Security/TS102921/EtsiTs102941MessagesItss.asn index a80eaa9c..3446544c 100644 --- a/asn1/Security/TS102921/EtsiTs102941MessagesItss.asn +++ b/asn1/Security/TS102921/EtsiTs102941MessagesItss.asn @@ -58,7 +58,7 @@ RcaCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WIT ************/ EtsiTs102941Data::= SEQUENCE { - version Version (v1), + version Version (v1) (1..255), content EtsiTs102941DataContent } diff --git a/asn1/Security/TS102921/EtsiTs102941MessagesItss_OptionalPrivacy.asn b/asn1/Security/TS102921/EtsiTs102941MessagesItss_OptionalPrivacy.asn index f0675238..48aa2172 100644 --- a/asn1/Security/TS102921/EtsiTs102941MessagesItss_OptionalPrivacy.asn +++ b/asn1/Security/TS102921/EtsiTs102941MessagesItss_OptionalPrivacy.asn @@ -57,7 +57,7 @@ RcaCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WIT ************/ EtsiTs102941Data::= SEQUENCE { - version Version (v1), + version Version (v1) (1..255), content EtsiTs102941DataContent } -- GitLab From 5918986b7fd1d70ddb2b8f50055cb65c662552a0 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 31 Jan 2019 05:15:59 -0800 Subject: [PATCH 178/320] Add ASN.1 fix for Version ::= INTEGER {v1(1)} COER encoding --- asn1/Security/TS102921/EtsiTs102941MessagesCA.asn | 2 +- asn1/Security/TS102921/EtsiTs102941MessagesItss.asn | 2 +- .../TS102921/EtsiTs102941MessagesItss_OptionalPrivacy.asn | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/asn1/Security/TS102921/EtsiTs102941MessagesCA.asn b/asn1/Security/TS102921/EtsiTs102941MessagesCA.asn index 32db789e..c7b2d400 100644 --- a/asn1/Security/TS102921/EtsiTs102941MessagesCA.asn +++ b/asn1/Security/TS102921/EtsiTs102941MessagesCA.asn @@ -66,7 +66,7 @@ CaCertificateRekeyingMessage ::= EtsiTs103097Data-Signed {EtsiTs103097Data-Signe ************/ EtsiTs102941Data::= SEQUENCE { - version Version (v1)) (1..255), + version INTEGER { v1(1) }(1..255), content EtsiTs102941DataContent } diff --git a/asn1/Security/TS102921/EtsiTs102941MessagesItss.asn b/asn1/Security/TS102921/EtsiTs102941MessagesItss.asn index 3446544c..1c67c1c9 100644 --- a/asn1/Security/TS102921/EtsiTs102941MessagesItss.asn +++ b/asn1/Security/TS102921/EtsiTs102941MessagesItss.asn @@ -58,7 +58,7 @@ RcaCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WIT ************/ EtsiTs102941Data::= SEQUENCE { - version Version (v1) (1..255), + version INTEGER { v1(1) }(1..255), content EtsiTs102941DataContent } diff --git a/asn1/Security/TS102921/EtsiTs102941MessagesItss_OptionalPrivacy.asn b/asn1/Security/TS102921/EtsiTs102941MessagesItss_OptionalPrivacy.asn index 48aa2172..cd63d350 100644 --- a/asn1/Security/TS102921/EtsiTs102941MessagesItss_OptionalPrivacy.asn +++ b/asn1/Security/TS102921/EtsiTs102941MessagesItss_OptionalPrivacy.asn @@ -57,7 +57,7 @@ RcaCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WIT ************/ EtsiTs102941Data::= SEQUENCE { - version Version (v1) (1..255), + version INTEGER { v1(1) }(1..255), content EtsiTs102941DataContent } -- GitLab From 447a5fff71873728964cd73a7b44b4a2185482df Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 31 Jan 2019 23:26:12 -0800 Subject: [PATCH 179/320] Add ASN.1 fix for Version ::= INTEGER {v1(1)} COER encoding --- asn1/Security/TS102921/EtsiTs102941TrustLists.asn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asn1/Security/TS102921/EtsiTs102941TrustLists.asn b/asn1/Security/TS102921/EtsiTs102941TrustLists.asn index 7b93f3f8..c180a6bf 100644 --- a/asn1/Security/TS102921/EtsiTs102941TrustLists.asn +++ b/asn1/Security/TS102921/EtsiTs102941TrustLists.asn @@ -21,7 +21,7 @@ FROM EtsiTs102941BaseTypes -- CRL ************/ ToBeSignedCrl ::= SEQUENCE { - version Version, + version INTEGER { v1(1) }(1..255), thisUpdate Time32, nextUpdate Time32, entries SEQUENCE OF CrlEntry, -- GitLab From 4835292111aede6da4023ad0085b871c6e10e696 Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 4 Feb 2019 06:28:30 -0800 Subject: [PATCH 180/320] Change LanePosition definition --- asn1/ITS-Container/ITS_Container.asn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asn1/ITS-Container/ITS_Container.asn b/asn1/ITS-Container/ITS_Container.asn index 29e19c35..39f66f5c 100644 --- a/asn1/ITS-Container/ITS_Container.asn +++ b/asn1/ITS-Container/ITS_Container.asn @@ -213,7 +213,7 @@ Heading ::= SEQUENCE { HeadingValue ::= INTEGER {wgs84North(0), wgs84East(900), wgs84South(1800), wgs84West(2700), unavailable(3601)} (0..3601) HeadingConfidence ::= INTEGER {equalOrWithinZeroPointOneDegree (1), equalOrWithinOneDegree (10), outOfRange(126), unavailable(127)} (1..127) -LanePosition::= INTEGER {offTheRoad(-1), hardShoulder(0), outermostDrivingLane(1), secondLaneFromOutside(2)} (-1..14) +LanePosition::= INTEGER {offTheRoad(-1), innerHardShoulder(0), innermostDrivingLane(1), secondLaneFromInside(2), outerHardShoulder(14)} (-1..14) ClosedLanes ::= SEQUENCE { innerhardShoulderStatus HardShoulderStatus OPTIONAL, -- GitLab From db77b62a8293872d53f3e2f5541adb46aebb8500 Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 4 Feb 2019 07:03:19 -0800 Subject: [PATCH 181/320] Add BrainpoolP256r1 encryption support in AtsPki --- ttcn/Pki/LibItsPki_Functions.ttcn | 514 +++++++++++++++----- ttcn/Pki/LibItsPki_Pics.ttcn | 25 +- ttcn/Pki/LibItsPki_Pixits.ttcn | 19 +- ttcn/Pki/LibItsPki_TypesAndValues.ttcn | 18 +- ttcn/Security/LibItsSecurity_Functions.ttcn | 16 +- 5 files changed, 442 insertions(+), 150 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 97eb453a..882c51e4 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -228,6 +228,45 @@ module LibItsPki_Functions { } // End of group ut_port + group helpers { + + function f_generate_key_pair( + out octetstring p_private_key, + out octetstring p_public_key_x, + out octetstring p_public_key_y, + out octetstring p_public_key_compressed, + out integer p_compressed_mode + ) return boolean { + if (PX_EC_ALG == e_nist_p256) { + f_generate_key_pair_nistp256(p_private_key, p_public_key_x, p_public_key_y, p_public_key_compressed, p_compressed_mode); + } else if (PX_EC_ALG == e_brainpool_p256_r1) { + f_generate_key_pair_brainpoolp256(p_private_key, p_public_key_x, p_public_key_y, p_public_key_compressed, p_compressed_mode); + } else { + // error + return false; + } + + return true; + } + + function f_signWithEcdsa( + in octetstring p_toBeSignedSecuredMessage, + in octetstring p_certificateIssuer, + in octetstring p_privateKey + ) return octetstring { + if (PX_VE_ALG == e_nist_p256) { + return f_signWithEcdsaNistp256WithSha256(p_toBeSignedSecuredMessage, p_certificateIssuer, p_privateKey); + } else if (PX_VE_ALG == e_brainpool_p256_r1) { + return f_signWithEcdsaBrainpoolp256WithSha256(p_toBeSignedSecuredMessage, p_certificateIssuer, p_privateKey); + } else if (PX_VE_ALG == e_brainpool_p384_r1) { + return f_signWithEcdsaBrainpoolp384WithSha384(p_toBeSignedSecuredMessage, p_certificateIssuer, p_privateKey); + } + + return ''O; + } + + } // End of group helpers + group http { // TODO Split into EnnerEc, Authorization & AuthorizationValidation function f_http_build_inner_ec_request( // TODO Cleanup parameters @@ -274,9 +313,8 @@ module LibItsPki_Functions { } log("*** f_http_build_inner_ec_request: Public encryption key: ", v_public_enc_key); log("*** f_http_build_inner_ec_request: Public encryption key comp: ", v_compressed_enc_key_mode); - log("*** f_http_build_inner_ec_request: First enrolment: ", PX_FIRST_ENROLMENT); p_salt := vc_eaWholeHash; - if (PX_FIRST_ENROLMENT == true) { // This is the first enrolment, we used Factory keys + if (PICS_SECPKI_REENROLMENT == false) { // This is the first enrolment, we used Factory keys v_ret_code := f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } else { // We use last valid EC certificate var Oct32 v_ec_private_key := PX_EC_PRIVATE_KEY; @@ -338,7 +376,7 @@ module LibItsPki_Functions { log("*** f_http_build_inner_ec_request: Public encryption key: ", v_public_enc_key); log("*** f_http_build_inner_ec_request: Public encryption key comp: ", v_compressed_enc_key_mode); p_salt := vc_eaWholeHash; - if (PX_FIRST_ENROLMENT == true) { // This is the first enrolment, we used Factory keys + if (PICS_SECPKI_REENROLMENT == false) { // This is the first enrolment, we used Factory keys v_ret_code := f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } else { // We use last valid EC certificate var Oct32 v_ec_private_key; @@ -384,7 +422,7 @@ module LibItsPki_Functions { var bitstring v_authorization_request_msg; // Generate verification keys for the certificate to be requested - if (f_generate_key_pair_nistp256(p_private_key, v_public_key_x, v_public_key_y, p_public_key_compressed, p_compressed_mode) == false) { + if (f_generate_key_pair(p_private_key, v_public_key_x, v_public_key_y, p_public_key_compressed, p_compressed_mode) == false) { log("*** f_http_build_authorization_request: ERROR: Failed to generate verification key ***"); f_selfOrClientSyncAndVerdict("error", e_error); return; @@ -394,7 +432,7 @@ module LibItsPki_Functions { log ("f_http_build_authorization_request: AT verification public compressed mode: ", p_compressed_mode); // Generate encryption keys for the certificate to be requested if (PX_INCLUDE_ENCRYPTION_KEYS) { - if (f_generate_key_pair_nistp256(p_private_enc_key, v_public_enc_key_x, v_public_enc_key_y, p_public_compressed_enc_key, p_compressedEncMode) == false) { + if (f_generate_key_pair(p_private_enc_key, v_public_enc_key_x, v_public_enc_key_y, p_public_compressed_enc_key, p_compressedEncMode) == false) { log("*** f_http_build_authorization_request: ERROR: Failed to generate encryption key ***"); f_selfOrClientSyncAndVerdict("error", e_error); return; @@ -419,7 +457,6 @@ module LibItsPki_Functions { } log("*** f_http_build_authorization_request: Public encryption key: ", v_public_enc_key); log("*** f_http_build_authorization_request: Public encryption key comp: ", v_compressed_enc_key_mode); - log("*** f_http_build_authorization_request: First enrolment: ", PX_FIRST_ENROLMENT); p_salt := vc_aaWholeHash; log("*** f_http_build_authorization_request: p_salt: ", p_salt); if (PX_AUTHORIZATION_REQUEST_WITH_POP) { @@ -498,11 +535,12 @@ module LibItsPki_Functions { var bitstring v_tbs; var Oct32 v_sig; var bitstring v_enc_msg; + var PublicVerificationKey v_public_verification_key; log(">>> f_generate_ec_certificate"); // Generate verification keys for the certificate - if (f_generate_key_pair_nistp256(p_private_key, v_public_key_x, v_public_key_y, p_public_key_compressed, p_compressed_mode) == false) { + if (f_generate_key_pair(p_private_key, v_public_key_x, v_public_key_y, p_public_key_compressed, p_compressed_mode) == false) { log("f_generate_ec_certificate: Failed to generate verification key"); return false; } @@ -511,18 +549,31 @@ module LibItsPki_Functions { } else { v_ecc_p256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(p_public_key_compressed)); } - + + if (PX_EC_ALG == e_nist_p256) { + v_public_verification_key := valueof( + m_publicVerificationKey_ecdsaNistP256( + v_ecc_p256_curve_point + )); + } else if (PX_EC_ALG == e_brainpool_p256_r1) { + v_public_verification_key := valueof( + m_publicVerificationKey_ecdsaBrainpoolP256r1( + v_ecc_p256_curve_point + )); + } else { + log("f_generate_ec_certificate: Wrong encryption algorithm, check PX_EC_ALG"); + return false; + } v_cert := m_etsiTs103097Certificate( m_issuerIdentifier_sha256AndDigest(f_HashedId8FromSha256(f_hashWithSha256('616263'O))), m_toBeSignedCertificate_at( v_appPermissions, m_verificationKeyIndicator_verificationKey( - m_publicVerificationKey_ecdsaNistP256( - v_ecc_p256_curve_point - )), + v_public_verification_key + ), m_validityPeriod( - 17469212, - m_duration_years(10) + f_getCurrentTime(), + m_duration_years(1) ), m_geographicRegion_identifiedRegion( { @@ -534,16 +585,27 @@ module LibItsPki_Functions { ); // Encode it ==> Get octetstring v_tbs := encvalue(v_cert.toBeSigned); - // Sign the certificate using ECDSA/SHA-256 (NIST p-256) - v_sig := f_signWithEcdsaNistp256WithSha256(bit2oct(v_tbs), int2oct(11, 32), p_private_key); - v_cert.signature_ := m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_sig, 0, 32) - ), - substr(v_sig, 32, 32) - ) - ); + // Sign the certificate + v_sig := f_signWithEcdsa(bit2oct(v_tbs), int2oct(11, 32), p_private_key); + if ((PX_VE_ALG == e_nist_p256) or (PX_VE_ALG == e_brainpool_p256_r1)) { + v_cert.signature_ := m_signature_ecdsaNistP256( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only( + substr(v_sig, 0, 32) + ), + substr(v_sig, 32, 32) + ) + ); + } else if (PX_VE_ALG == e_brainpool_p384_r1) { + v_cert.signature_ := m_signature_ecdsaBrainpoolP384r1( + m_ecdsaP384Signature( + m_eccP384CurvePoint_x_only( + substr(v_sig, 0, 48) + ), + substr(v_sig, 48, 48) + ) + ); + } log("f_generate_ec_certificate: v_cert= ", v_cert); p_ec_certificate := valueof(v_cert); @@ -563,18 +625,33 @@ module LibItsPki_Functions { var bitstring v_tbs; var Oct32 v_sig; var bitstring v_enc_msg; + var PublicVerificationKey v_public_verification_key; + if (PX_EC_ALG == e_nist_p256) { + v_public_verification_key := valueof( + m_publicVerificationKey_ecdsaNistP256( + p_inner_ec_request.publicKeys.verificationKey.ecdsaNistP256 + )); + } else if (PX_EC_ALG == e_brainpool_p256_r1) { + v_public_verification_key := valueof( + m_publicVerificationKey_ecdsaBrainpoolP256r1( + p_inner_ec_request.publicKeys.verificationKey.ecdsaBrainpoolP256r1 + )); + } else { + // Error + log("f_generate_ec_certificate: Wrong encryption algorithm, check PX_EC_ALG"); + return false; + } v_cert := m_etsiTs103097Certificate( m_issuerIdentifier_sha256AndDigest(f_HashedId8FromSha256(f_hashWithSha256('616263'O))), m_toBeSignedCertificate_at( v_appPermissions, m_verificationKeyIndicator_verificationKey( - m_publicVerificationKey_ecdsaNistP256( - p_inner_ec_request.publicKeys.verificationKey.ecdsaNistP256 - )), + v_public_verification_key + ), m_validityPeriod( - 17469212, - m_duration_years(10) + f_getCurrentTime(), + m_duration_years(1) ), m_geographicRegion_identifiedRegion( { @@ -586,16 +663,28 @@ module LibItsPki_Functions { ); // Encode it ==> Get octetstring v_tbs := encvalue(v_cert.toBeSigned); - // Sign the certificate using ECDSA/SHA-256 (NIST p-256) - v_sig := f_signWithEcdsaNistp256WithSha256(bit2oct(v_tbs), int2oct(11, 32), p_private_key); - v_cert.signature_ := m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_sig, 0, 32) - ), - substr(v_sig, 32, 32) - ) - ); + + // Sign the certificate + v_sig := f_signWithEcdsa(bit2oct(v_tbs), int2oct(11, 32), p_private_key); + if ((PX_VE_ALG == e_nist_p256) or (PX_VE_ALG == e_brainpool_p256_r1)) { + v_cert.signature_ := m_signature_ecdsaNistP256( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only( + substr(v_sig, 0, 32) + ), + substr(v_sig, 32, 32) + ) + ); + } else if (PX_VE_ALG == e_brainpool_p384_r1) { + v_cert.signature_ := m_signature_ecdsaBrainpoolP384r1( + m_ecdsaP384Signature( + m_eccP384CurvePoint_x_only( + substr(v_sig, 0, 48) + ), + substr(v_sig, 48, 48) + ) + ); + } log("v_cert= ", v_cert); p_at_certificate := valueof(v_cert); @@ -619,7 +708,7 @@ module LibItsPki_Functions { log (">>> f_generate_inner_ec_request"); // Generate keys for the certificate to be requested - if (f_generate_key_pair_nistp256(p_private_key, v_publicKeyX, v_publicKeyY, p_public_key_compressed, p_compressed_mode) == false) { + if (f_generate_key_pair(p_private_key, v_publicKeyX, v_publicKeyY, p_public_key_compressed, p_compressed_mode) == false) { log ("f_generate_inner_ec_request: failed to generate keys"); return false; } @@ -637,10 +726,10 @@ module LibItsPki_Functions { ), m_certificateSubjectAttributes( { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs - valueof(m_appPermissions(623, { bitmapSsp := '00C0'O })) + valueof(m_appPermissions(c_its_aid_SCR, { bitmapSsp := '00C0'O })) }, m_validityPeriod( - f_getCurrentTime() / 1000, + f_getCurrentTime(), m_duration_years(1) // TODO Use PIXIT ), m_geographicRegion_identifiedRegion( @@ -668,6 +757,7 @@ module LibItsPki_Functions { var octetstring v_encoded_inner_ec_request; var template (value) ToBeSignedData v_tbs; var octetstring v_tbs_signed; + var Signature v_signature; // Encode it v_encoded_inner_ec_request := bit2oct(encvalue(p_inner_ec_request)); @@ -684,25 +774,55 @@ module LibItsPki_Functions { ) ); // Signed the encoded InnerEcRequestSignedForPop - v_tbs_signed := f_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), int2oct(0, 32), p_private_key); + v_tbs_signed := f_signWithEcdsa(bit2oct(encvalue(v_tbs)), int2oct(0, 32), p_private_key); // Finalyse signed InnerEcRequestSignedForPop + if (PX_VE_ALG == e_nist_p256) { + v_signature := valueof( + m_signature_ecdsaNistP256( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only( + substr(v_tbs_signed, 0, 32) + ), + substr(v_tbs_signed, 32, 32) + ) + ) + ); + } else if (PX_VE_ALG == e_brainpool_p256_r1) { + v_signature := valueof( + m_signature_ecdsaBrainpoolP256r1( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only( + substr(v_tbs_signed, 0, 32) + ), + substr(v_tbs_signed, 32, 32) + ) + ) + ); + } else if (PX_VE_ALG == e_brainpool_p384_r1) { + v_signature := valueof( + m_signature_ecdsaBrainpoolP384r1( + m_ecdsaP384Signature( + m_eccP384CurvePoint_x_only( + substr(v_tbs_signed, 0, 48) + ), + substr(v_tbs_signed, 48, 48) + ) + ) + ); + } + log("f_generate_inner_ec_request_signed_for_pop: v_signature= ", v_signature); p_inner_ec_request_signed_for_pop := valueof( m_etsiTs103097Data_signed( m_signedData( sha256, v_tbs, m_signerIdentifier_self, - m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_tbs_signed, 0, 32) - ), - substr(v_tbs_signed, 32, 32) - ) - ) + v_signature ) ) ); + + log("<<< f_generate_inner_ec_request_signed_for_pop: p_inner_ec_request_signed_for_pop= ", p_inner_ec_request_signed_for_pop); return true; } // End of function f_generate_inner_ec_request_signed_for_pop @@ -759,6 +879,7 @@ module LibItsPki_Functions { var template (value) EccP256CurvePoint v_eccP256_curve_point; var template (value) EccP256CurvePoint v_enc_eccP256_curve_point; var HashAlgorithm v_hashId; + var Signature v_signature; // Calculate the whole certificate SHA v_enc_value := encvalue(p_ec_certificate); @@ -769,17 +890,17 @@ module LibItsPki_Functions { v_ec_hash := f_hashWithSha384(bit2oct(v_enc_value)); v_ec_hashed_id8 := f_HashedId8FromSha384(v_ec_hash); } - log("v_ec_hash= ", v_ec_hash); + log("f_generate_inner_at_request: v_ec_hash= ", v_ec_hash); // Generate 32 octets length secret key v_hmac_key := f_hashWithSha256(int2oct(f_getCurrentTime(), 12)); - log("v_hmac_key= ", v_hmac_key); + log("f_generate_inner_at_request: v_hmac_key= ", v_hmac_key); // Generate tag based on the concatenation of verification keys & encryption keys v_message_to_tag := p_public_key_x & p_public_key_y & p_public_enc_key_x & p_public_enc_key_y; - log("v_message_to_tag= ", v_message_to_tag); // FIXME encryption keys could be optional + log("f_generate_inner_at_request: v_message_to_tag= ", v_message_to_tag); // FIXME encryption keys could be optional v_key_tag := fx_hmac_sha256(v_hmac_key, v_message_to_tag); // TODO Rename and use a wrapper function - log("v_key_tag= ", v_key_tag); + log("f_generate_inner_at_request: v_key_tag= ", v_key_tag); // Build the SharedAtRequest p_inner_at_request.sharedAtRequest := valueof( @@ -798,7 +919,7 @@ module LibItsPki_Functions { ); // Calculate the hash of the SharedAtRequest v_hash_shared_at_request := f_hashWithSha256(bit2oct(encvalue(p_inner_at_request.sharedAtRequest))); - log("v_hash_shared_at_request= ", v_hash_shared_at_request); + log("f_generate_inner_at_request: v_hash_shared_at_request= ", v_hash_shared_at_request); // Build the ETsiTs103097Data-SignedExternalPayload v_tbs := m_toBeSignedData( @@ -807,14 +928,53 @@ module LibItsPki_Functions { c_its_aid_SCR, f_getCurrentTimeUtc()) ); - log("v_tbs= ", v_tbs); + log("f_generate_inner_at_request: v_tbs= ", v_tbs); // Signed ToBeSigned payload using the private key of EC certificate obtained from Enrolment request - v_tbs_signed := f_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); // In case of ITS-S privacy, v_signed_ec_signature contained the data to be encrypted if (ischosen(p_ec_certificate.signature_.ecdsaBrainpoolP384r1Signature)) { v_hashId := sha384; + v_tbs_signed := f_signWithEcdsaBrainpoolp384WithSha384(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); + v_signature := valueof( + m_signature_ecdsaBrainpoolP384r1( + m_ecdsaP384Signature( + m_eccP384CurvePoint_x_only( + substr(v_tbs_signed, 0, 48) + ), + substr(v_tbs_signed, 48, 48) + ) + ) + ); } else { v_hashId := sha256; + if (ischosen(p_ec_certificate.signature_.ecdsaBrainpoolP256r1Signature)) { + v_tbs_signed := f_signWithEcdsaBrainpoolp256WithSha256(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); + v_signature := valueof( + m_signature_ecdsaBrainpoolP256r1( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only( + substr(v_tbs_signed, 0, 32) + ), + substr(v_tbs_signed, 32, 32) + ) + ) + ); + } else if (ischosen(p_ec_certificate.signature_.ecdsaNistP256Signature)) { + v_tbs_signed := f_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); + v_signature := valueof( + m_signature_ecdsaNistP256( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only( + substr(v_tbs_signed, 0, 32) + ), + substr(v_tbs_signed, 32, 32) + ) + ) + ); + } else { + // Error + log("f_generate_inner_at_request: Failed to process signature"); + return false; + } } v_signed_ec_signature := valueof( m_etsiTs103097Data_signed( @@ -822,18 +982,11 @@ module LibItsPki_Functions { v_hashId, v_tbs, m_signerIdentifier_digest(v_ec_hashed_id8), // Signer is thehasheId8 of the EC certificate obtained from Enrolment request - m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_tbs_signed, 0, 32) - ), - substr(v_tbs_signed, 32, 32) - ) - ) + v_signature ) ) ); - log("v_signed_ec_signature= ", v_signed_ec_signature); + log("f_generate_inner_at_request: v_signed_ec_signature= ", v_signed_ec_signature); if (PICS_ITS_S_WITH_PRIVACY) { // Build EtsiTs102097Data-Encrypted structure var octetstring v_public_enc_key; @@ -846,18 +999,51 @@ module LibItsPki_Functions { var octetstring v_public_compressed_ephemeral_key; var integer v_public_compressed_ephemeral_mode; var octetstring v_enc_signed_ec_signature; + var EncryptedDataEncryptionKey v_encrypted_data_encryption_key; // Use EA certificate for the encryption - if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0)) { - v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0; - v_compressed_mode := 0; - } else if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_1)) { - v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_1; - v_compressed_mode := 1; + if (PX_EC_ALG == e_nist_p256) { + if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0)) { + v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0; + v_compressed_mode := 0; + } else if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_1)) { + v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_1; + v_compressed_mode := 1; + } else { + log("f_generate_inner_at_request: Wrong NistP256 encryption variant"); + return false; + } + v_enc_signed_ec_signature := f_encryptWithEciesNistp256WithSha256(bit2oct(encvalue(v_signed_ec_signature)), v_public_enc_key, v_compressed_mode, ''O, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); + v_encrypted_data_encryption_key := valueof( + m_encryptedDataEncryptionKey_eciesNistP256( + m_evciesP256EncryptedKey( + v_eccP256_curve_point, + v_encrypted_sym_key, + v_authentication_vector + ))); + } else if (PX_EC_ALG == e_brainpool_p256_r1) { + if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0)) { + v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0; + v_compressed_mode := 0; + } else if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_1)) { + v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_1; + v_compressed_mode := 1; + } else { + log("f_generate_inner_at_request: Wrong BrainpoolP256r1 encryption variant"); + return false; + } + v_enc_signed_ec_signature := f_encryptWithEciesBrainpoolp256WithSha256(bit2oct(encvalue(v_signed_ec_signature)), v_public_enc_key, v_compressed_mode, ''O, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); + v_encrypted_data_encryption_key := valueof( + m_encryptedDataEncryptionKey_eciesBrainpoolP256r1( + m_evciesP256EncryptedKey( + v_eccP256_curve_point, + v_encrypted_sym_key, + v_authentication_vector + ))); } else { + log("f_generate_inner_at_request: Wrong encryption variant"); return false; } - v_enc_signed_ec_signature := f_encryptWithEciesNistp256WithSha256(bit2oct(encvalue(v_signed_ec_signature)), v_public_enc_key, v_compressed_mode, ''O, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); v_recipientId := p_ea_hashed_id8; // RecipientId is the HashedId8 of the EA certificate log("v_recipientId= ", v_recipientId); // Fill Certificate template with the public compressed keys (canonical form) @@ -874,12 +1060,8 @@ module LibItsPki_Functions { m_recipientInfo_signedDataRecipInfo( m_pKRecipientInfo( v_recipientId, - m_encryptedDataEncryptionKey_eciesNistP256( - m_evciesP256EncryptedKey( - v_eccP256_curve_point, - v_encrypted_sym_key, - v_authentication_vector - )))) + + v_encrypted_data_encryption_key )) }, m_SymmetricCiphertext_aes128ccm( m_aesCcmCiphertext( @@ -888,7 +1070,7 @@ module LibItsPki_Functions { ) ) ) - ) + ) ) ); } else { // Skip the encryption, alowed to be re-identified by the AA @@ -1063,12 +1245,14 @@ module LibItsPki_Functions { var template (value) EccP256CurvePoint v_eccP256_curve_point; var template (value) ToBeSignedData v_tbs; var octetstring v_tbs_signed; + var Signature v_signature; var template (value) Ieee1609Dot2Data v_ieee1609dot2_signed_data; var octetstring v_encoded_request; var HashedId8 v_recipientId; var octetstring v_public_compressed_ephemeral_key; var integer v_public_compressed_ephemeral_mode; var octetstring v_encrypted_request; + var EncryptedDataEncryptionKey v_encrypted_data_encryption_key; log(">>> f_build_pki_secured_request_message_signed_with_pop"); @@ -1077,8 +1261,8 @@ module LibItsPki_Functions { p_request_hash := '10ED97A2F2933DD3AC55F47022D125E18F5E1AA024613E616A75BA4979EFE318'O; } else { p_request_hash := f_hashWithSha256(p_pki_message); - log("p_request_hash= ", p_request_hash); } + log("f_build_pki_secured_request_message_signed_with_pop: p_request_hash= ", p_request_hash); // Signed the encoded PKI message v_tbs := m_toBeSignedData( m_signedDataPayload( @@ -1087,30 +1271,58 @@ module LibItsPki_Functions { m_headerInfo_inner_ec_request(c_its_aid_SCR, f_getCurrentTimeUtc()) ); if (ischosen(p_signer_identifier.self_)) { - v_tbs_signed := f_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), int2oct(0, 32), p_private_key); + v_tbs_signed := f_signWithEcdsa(bit2oct(encvalue(v_tbs)), int2oct(0, 32), p_private_key); } else { var charstring v_certificate_id; var octetstring v_hash; fx_readCertificateFromDigest(p_signer_identifier.digest, v_certificate_id); // TODO Add a wrapper function f_getCertificateHash(v_certificate_id, v_hash); - v_tbs_signed := f_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), v_hash, p_private_key); + v_tbs_signed := f_signWithEcdsa(bit2oct(encvalue(v_tbs)), v_hash, p_private_key); } // Add the signature and create EtsiTs103097Data-Signed data structure + if (PX_VE_ALG == e_nist_p256) { + v_signature := valueof( + m_signature_ecdsaNistP256( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only( + substr(v_tbs_signed, 0, 32) + ), + substr(v_tbs_signed, 32, 32) + ) + ) + ); + } else if (PX_VE_ALG == e_brainpool_p256_r1) { + v_signature := valueof( + m_signature_ecdsaBrainpoolP256r1( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only( + substr(v_tbs_signed, 0, 32) + ), + substr(v_tbs_signed, 32, 32) + ) + ) + ); + } else if (PX_VE_ALG == e_brainpool_p384_r1) { + v_signature := valueof( + m_signature_ecdsaBrainpoolP384r1( + m_ecdsaP384Signature( + m_eccP384CurvePoint_x_only( + substr(v_tbs_signed, 0, 48) + ), + substr(v_tbs_signed, 48, 48) + ) + ) + ); + } + log("f_build_pki_secured_request_message_signed_with_pop: v_signature= ", v_signature); v_ieee1609dot2_signed_data := m_etsiTs103097Data_signed( m_signedData( sha256, v_tbs, p_signer_identifier, - m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_tbs_signed, 0, 32) - ), - substr(v_tbs_signed, 32, 32) - ) - ) + v_signature ) - ); + ); // Encode EtsiTs103097Data-Signed data structure v_encoded_request := bit2oct(encvalue(v_ieee1609dot2_signed_data)); // Encrypt encode EtsiTs103097Data-Signed data structure @@ -1118,48 +1330,66 @@ module LibItsPki_Functions { p_salt := '77C0637C3558B3238FDE1EEC376DA080BE4076FB8491CA0F8C19FD34DF298CEB'O; } v_encrypted_request := f_encryptWithEciesNistp256WithSha256(v_encoded_request, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, PICS_SEC_FIXED_KEYS); - log("p_aes_sym_key= ", p_aes_sym_key); - log("p_encrypted_sym_key= ", p_encrypted_sym_key); - log("p_authentication_vector= ", p_authentication_vector); - log("p_nonce= ", p_nonce); - log("p_recipientId= ", p_recipientId); + log("f_build_pki_secured_request_message_signed_with_pop: p_aes_sym_key= ", p_aes_sym_key); + log("f_build_pki_secured_request_message_signed_with_pop: p_encrypted_sym_key= ", p_encrypted_sym_key); + log("f_build_pki_secured_request_message_signed_with_pop: p_authentication_vector= ", p_authentication_vector); + log("f_build_pki_secured_request_message_signed_with_pop: p_nonce= ", p_nonce); + log("f_build_pki_secured_request_message_signed_with_pop: p_recipientId= ", p_recipientId); if (p_recipientId == int2oct(0, 8)) { - log("f_hashWithSha256(v_encrypted_sym_key)= ", f_hashWithSha256(p_encrypted_sym_key)); + log("f_build_pki_secured_request_message_signed_with_pop: f_hashWithSha256(v_encrypted_sym_key)= ", f_hashWithSha256(p_encrypted_sym_key)); v_recipientId := f_HashedId8FromSha256(f_hashWithSha256(p_encrypted_sym_key)); } else { v_recipientId := p_recipientId; } - log("v_recipientId= ", v_recipientId); + log("f_build_pki_secured_request_message_signed_with_pop: v_recipientId= ", v_recipientId); // Fill Certificate template with the public compressed keys (canonical form) if (v_public_compressed_ephemeral_mode == 0) { v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); } else { v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_compressed_ephemeral_key)); } + if (PX_EC_ALG == e_nist_p256) { + v_encrypted_data_encryption_key := valueof( + m_encryptedDataEncryptionKey_eciesNistP256( + m_evciesP256EncryptedKey( + v_eccP256_curve_point, + p_encrypted_sym_key, + p_authentication_vector + ))); + } else if (PX_EC_ALG == e_brainpool_p256_r1) { + v_encrypted_data_encryption_key := valueof( + m_encryptedDataEncryptionKey_eciesBrainpoolP256r1( + m_evciesP256EncryptedKey( + v_eccP256_curve_point, + p_encrypted_sym_key, + p_authentication_vector + ))); + } else { + log("f_build_pki_secured_request_message_signed_with_pop: Wrong encryption variant"); + return false; + } + p_ieee1609dot2_signed_and_encrypted_data := valueof( m_etsiTs103097Data_encrypted( m_encryptedData( { - m_recipientInfo_signedDataRecipInfo( - m_pKRecipientInfo( - v_recipientId, - m_encryptedDataEncryptionKey_eciesNistP256( - m_evciesP256EncryptedKey( - v_eccP256_curve_point, - p_encrypted_sym_key, - p_authentication_vector - )))) + m_recipientInfo_signedDataRecipInfo( + m_pKRecipientInfo( + v_recipientId, + v_encrypted_data_encryption_key + )) }, - m_SymmetricCiphertext_aes128ccm( - m_aesCcmCiphertext( - p_nonce, - v_encrypted_request - ) - ) - ) + m_SymmetricCiphertext_aes128ccm( + m_aesCcmCiphertext( + p_nonce, + v_encrypted_request + ) + ) + ) ) - ); + ); + log("<<< f_build_pki_secured_request_message_signed_with_pop: ", p_ieee1609dot2_signed_and_encrypted_data); return true; } // End of function f_build_pki_secured_request_message_signed_with_pop @@ -1192,6 +1422,7 @@ module LibItsPki_Functions { var octetstring v_public_compressed_ephemeral_key; var integer v_public_compressed_ephemeral_mode; var octetstring v_encrypted_request; + var EncryptedDataEncryptionKey v_encrypted_data_encryption_key; log(">>> f_build_pki_secured_request_message"); @@ -1200,31 +1431,48 @@ module LibItsPki_Functions { p_request_hash := '10ED97A2F2933DD3AC55F47022D125E18F5E1AA024613E616A75BA4979EFE318'O; } else { p_request_hash := f_hashWithSha256(p_pki_message); - log("p_request_hash= ", p_request_hash); } + log("f_build_pki_secured_request_message: p_request_hash= ", p_request_hash); // Encrypt encode EtsiTs103097Data-Signed data structure if (PICS_SEC_FIXED_KEYS) { p_salt := '77C0637C3558B3238FDE1EEC376DA080BE4076FB8491CA0F8C19FD34DF298CEB'O; } v_encrypted_request := f_encryptWithEciesNistp256WithSha256(p_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, PICS_SEC_FIXED_KEYS); - log("p_aes_sym_key= ", p_aes_sym_key); - log("p_encrypted_sym_key= ", p_encrypted_sym_key); - log("p_authentication_vector= ", p_authentication_vector); - log("p_nonce= ", p_nonce); - log("p_recipientId= ", p_recipientId); + log("f_build_pki_secured_request_message: p_aes_sym_key= ", p_aes_sym_key); + log("f_build_pki_secured_request_message: p_encrypted_sym_key= ", p_encrypted_sym_key); + log("f_build_pki_secured_request_message: p_authentication_vector= ", p_authentication_vector); + log("f_build_pki_secured_request_message: p_nonce= ", p_nonce); + log("f_build_pki_secured_request_message: p_recipientId= ", p_recipientId); if (p_recipientId == int2oct(0, 8)) { - log("f_hashWithSha256(v_encrypted_sym_key)= ", f_hashWithSha256(p_encrypted_sym_key)); + log("f_build_pki_secured_request_message: f_hashWithSha256(v_encrypted_sym_key)= ", f_hashWithSha256(p_encrypted_sym_key)); v_recipientId := f_HashedId8FromSha256(f_hashWithSha256(p_encrypted_sym_key)); } else { v_recipientId := p_recipientId; } - log("v_recipientId= ", v_recipientId); + log("f_build_pki_secured_request_message: v_recipientId= ", v_recipientId); // Fill Certificate template with the public compressed keys (canonical form) if (v_public_compressed_ephemeral_mode == 0) { v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); } else { v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_compressed_ephemeral_key)); } + if (PX_EC_ALG == e_nist_p256) { + v_encrypted_data_encryption_key := valueof( + m_encryptedDataEncryptionKey_eciesNistP256( + m_evciesP256EncryptedKey( + v_eccP256_curve_point, + p_encrypted_sym_key, + p_authentication_vector + ))); + } else if (PX_EC_ALG == e_brainpool_p256_r1) { + v_encrypted_data_encryption_key := valueof( + m_encryptedDataEncryptionKey_eciesBrainpoolP256r1( + m_evciesP256EncryptedKey( + v_eccP256_curve_point, + p_encrypted_sym_key, + p_authentication_vector + ))); + } p_ieee1609dot2_signed_and_encrypted_data := valueof( m_etsiTs103097Data_encrypted( m_encryptedData( @@ -1232,23 +1480,20 @@ module LibItsPki_Functions { m_recipientInfo_signedDataRecipInfo( m_pKRecipientInfo( v_recipientId, - m_encryptedDataEncryptionKey_eciesNistP256( - m_evciesP256EncryptedKey( - v_eccP256_curve_point, - p_encrypted_sym_key, - p_authentication_vector - )))) - }, + v_encrypted_data_encryption_key + )) + }, m_SymmetricCiphertext_aes128ccm( m_aesCcmCiphertext( p_nonce, v_encrypted_request - ) - ) + ) + ) ) ) - ); + ); + log("<<< f_build_pki_secured_request_message: ", p_ieee1609dot2_signed_and_encrypted_data); return true; } // End of function f_build_pki_secured_request_message @@ -1336,6 +1581,7 @@ module LibItsPki_Functions { ) ); + log("<<< f_build_pki_secured_response_message: ", p_ieee1609dot2_signed_and_encrypted_data); return true; } // End of function f_build_pki_secured_response_message diff --git a/ttcn/Pki/LibItsPki_Pics.ttcn b/ttcn/Pki/LibItsPki_Pics.ttcn index 9aa745da..57b5f39b 100644 --- a/ttcn/Pki/LibItsPki_Pics.ttcn +++ b/ttcn/Pki/LibItsPki_Pics.ttcn @@ -19,6 +19,26 @@ module LibItsPki_Pics { * @desc Does the IUT act as combined EA-AA device? */ modulepar boolean PICS_IUT_COMBINED_EA_AA_ROLE := false; + + /** + * @desc Does the IUT support enrolment? + */ + modulepar boolean PICS_SECPKI_ENROLMENT := true; + + /** + * @desc Does the IUT support autorization? + */ + modulepar boolean PICS_SECPKI_AUTHORIZATION := true; + + /** + * @desc Is a re-enrolment request? + */ + modulepar boolean PICS_SECPKI_REENROLMENT := true; + + /** + * @desc ? + */ + modulepar boolean PICS_SECPKI_CRL := false; /** * @desc Certificate used by the IUT acting as ITS-S @@ -105,11 +125,6 @@ module LibItsPki_Pics { */ modulepar octetstring PICS_ITS_S_ENC_BRAINPOOLP384r1_PRIVATE_KEY := '6B4B4392511B252C904801466F5DA0A7F28E038E6656800CBB0CDCB3D32F862CA4D59CBDC1A19E98E9191582AF1DB3D7'O; - /** - * @desc Factory compressed public key for encryption Brainpool P384 r1 - */ - modulepar octetstring PICS_ITS_S_ENC_BRAINPOOLP384r1_PUBLIC_KEY := '027BB3104998F30B86B0C7C6CC9BFAECA7F7E99E8CE575D07B550028CCB15E1C95581B9B8520D40A35256021DDA63B785C'O; - /** * @desc Factory private key for verification Brainpool P384 r1 */ diff --git a/ttcn/Pki/LibItsPki_Pixits.ttcn b/ttcn/Pki/LibItsPki_Pixits.ttcn index 1f0701bd..3699685d 100644 --- a/ttcn/Pki/LibItsPki_Pixits.ttcn +++ b/ttcn/Pki/LibItsPki_Pixits.ttcn @@ -6,11 +6,9 @@ module LibItsPki_Pixits { // LibIts import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - - /** - * @desc Is the first enrolment? - */ - modulepar boolean PX_FIRST_ENROLMENT := true; + + // LibItsPki + import from LibItsPki_TypesAndValues all; /** * @desc Do the encryption keys be included in Authorization Request? @@ -31,4 +29,15 @@ module LibItsPki_Pixits { * @desc Contains the hashed id8 of the EC certificate, used in case of re-enrolment */ modulepar HashedId8 PX_EC_HASHED_ID8 := int2oct(0, 8); + + /** + * @desc Indicate which encryption algorithem to be used + */ + modulepar SecurityAlg PX_EC_ALG := e_nist_p256; + + /** + * @desc Indicate which verification algorithem to be used + */ + modulepar SecurityAlg PX_VE_ALG := e_nist_p256; + } // End of module LibItsPki_Pixits diff --git a/ttcn/Pki/LibItsPki_TypesAndValues.ttcn b/ttcn/Pki/LibItsPki_TypesAndValues.ttcn index ad69cd46..4c013ee8 100644 --- a/ttcn/Pki/LibItsPki_TypesAndValues.ttcn +++ b/ttcn/Pki/LibItsPki_TypesAndValues.ttcn @@ -23,6 +23,12 @@ module LibItsPki_TypesAndValues { } // End of group constants + type enumerated SecurityAlg { + e_nist_p256 (0), + e_brainpool_p256_r1 (1), + e_brainpool_p384_r1 (2) + } // End of type SecurityAlg + group utPrimitives { /** @@ -50,7 +56,8 @@ module LibItsPki_TypesAndValues { * @member triggerEnrolmentRequest Request to trigger an EnrolmentRequest */ type union UtPkiTrigger { - TriggerEnrolmentRequest triggerEnrolmentRequest + TriggerEnrolmentRequest triggerEnrolmentRequest, + TriggerAuthorizationRequest triggerAuthorizationRequest } with { variant "" } // End of type UtPkiTrigger @@ -71,6 +78,15 @@ module LibItsPki_TypesAndValues { variant "FIELDORDER(msb)" } // End of type TriggerEnrolmentRequest + type record TriggerAuthorizationRequest { + octetstring cannonicalId, + Oct1 encAlgorithm, + octetstring privateKey, + octetstring compressedPublickey + } with { + variant "FIELDORDER(msb)" + } // End of type TriggerAuthorizationRequest + } with { encode "UpperTester" variant "" diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 09db5eba..cd9b8ecf 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -325,25 +325,29 @@ module LibItsSecurity_Functions { */ function f_encryptWithEciesBrainpoolp256WithSha256( in octetstring p_toBeEncryptedSecuredMessage, - in Oct32 p_recipientsPublicKeyX, + in Oct32 p_recipientsPublicKeyCompressed, in integer p_compressed_mode, + in octetstring p_salt, out Oct32 p_publicEphemeralKeyCompressed, out integer p_ephemeralKeyModeCompressed, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, - out Oct12 p_nonce + out Oct12 p_nonce, + in boolean p_use_hardcoded_values := false ) return octetstring { return fx_encryptWithEciesBrainpoolp256WithSha256( p_toBeEncryptedSecuredMessage, - p_recipientsPublicKeyX, + p_recipientsPublicKeyCompressed, p_compressed_mode, + p_salt, p_publicEphemeralKeyCompressed, p_ephemeralKeyModeCompressed, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, - p_nonce + p_nonce, + p_use_hardcoded_values ); } // End of function f_encryptWithEciesBrainpoolp256WithSha256 @@ -2387,7 +2391,9 @@ module LibItsSecurity_Functions { * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption * @return The encrypted message */ - external function fx_encryptWithEciesBrainpoolp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyCompressed, in integer p_compressed_mode, out Oct32 p_publicEphemeralKeyCompressed, out integer p_ephemeralKeyModeCompressed, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; + external function fx_encryptWithEciesBrainpoolp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyCompressed, in integer p_compressed_mode, in octetstring p_salt, out Oct32 p_publicEphemeralKeyCompressed, out integer p_ephemeralKeyModeCompressed, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce, in boolean p_use_hardcoded_values := false) return octetstring; + + external function fx_test_encryptWithEciesBrainpoolp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_privateEphemeralKey, in Oct32 p_recipientPublicKeyX, in Oct32 p_recipientPublicKeyY, in octetstring p_salt, out Oct32 p_publicEphemeralKeyX, out Oct32 p_publicEphemeralKeyY, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; /** * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Brainpool-P256 algorithm -- GitLab From 4f503327e80ec1096c8d4396a5c7da2b718d684a Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 6 Feb 2019 06:49:27 -0800 Subject: [PATCH 182/320] Validation with Escrypt PKI --- ttcn/DENM/LibItsDenm_Functions.ttcn | 4 + .../LibItsGeoNetworking_Functions.ttcn | 2 +- ttcn/Pki/LibItsPki_Functions.ttcn | 133 +++++++++++++----- ttcn/Pki/LibItsPki_Pics.ttcn | 2 +- ttcn/Security/LibItsSecurity_Functions.ttcn | 18 +++ 5 files changed, 123 insertions(+), 36 deletions(-) diff --git a/ttcn/DENM/LibItsDenm_Functions.ttcn b/ttcn/DENM/LibItsDenm_Functions.ttcn index 1483f25b..8665cd9c 100644 --- a/ttcn/DENM/LibItsDenm_Functions.ttcn +++ b/ttcn/DENM/LibItsDenm_Functions.ttcn @@ -107,11 +107,15 @@ module LibItsDenm_Functions { function f_utTriggerEvent(template (value) UtDenmTrigger p_event) runs on ItsDenm return ActionID { var ActionID v_actionId; var UtDenmResults v_result; + + log(">>> f_utTriggerEvent: ", p_event); //deactivate denmPort default alts vc_denmDefaultActive := false; + log("f_utTriggerEvent: Send message"); utPort.send(p_event); + log("f_utTriggerEvent: Wait response"); tc_wait.start; alt { [] utPort.receive(UtDenmResults: { utDenmTriggerResult := ? }) -> value v_result { diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn index 5753fb17..5ed83ed8 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn @@ -828,7 +828,7 @@ module LibItsGeoNetworking_Functions { */ function f_startBeingNeighbour() runs on ItsGeoNetworking { - vc_neighbourDefault := activate(a_neighbourDefault()); + vc_neighbourDefault := activate(a_neighbourDefault()); f_acTriggerEvent(m_startBeaconing(m_beaconHeader(f_getPosition(vc_componentName)).beaconHeader)); f_sleepIgnoreDef(PX_NEIGHBOUR_DISCOVERY_DELAY); } // end f_startBeingNeighbour diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 882c51e4..c8f2e2f0 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -1013,7 +1013,14 @@ module LibItsPki_Functions { log("f_generate_inner_at_request: Wrong NistP256 encryption variant"); return false; } - v_enc_signed_ec_signature := f_encryptWithEciesNistp256WithSha256(bit2oct(encvalue(v_signed_ec_signature)), v_public_enc_key, v_compressed_mode, ''O, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); + if (PX_EC_ALG == e_nist_p256) { + v_enc_signed_ec_signature := f_encryptWithEciesNistp256WithSha256(bit2oct(encvalue(v_signed_ec_signature)), v_public_enc_key, v_compressed_mode, ''O, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); + } else if (PX_EC_ALG == e_brainpool_p256_r1) { + v_enc_signed_ec_signature := f_encryptWithEciesBrainpoolp256WithSha256(bit2oct(encvalue(v_signed_ec_signature)), v_public_enc_key, v_compressed_mode, ''O, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); + } else { + log("f_generate_inner_at_request: Wrong encryption variant"); + return false; + } v_encrypted_data_encryption_key := valueof( m_encryptedDataEncryptionKey_eciesNistP256( m_evciesP256EncryptedKey( @@ -1032,7 +1039,14 @@ module LibItsPki_Functions { log("f_generate_inner_at_request: Wrong BrainpoolP256r1 encryption variant"); return false; } - v_enc_signed_ec_signature := f_encryptWithEciesBrainpoolp256WithSha256(bit2oct(encvalue(v_signed_ec_signature)), v_public_enc_key, v_compressed_mode, ''O, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); + if (PX_EC_ALG == e_nist_p256) { + v_enc_signed_ec_signature := f_encryptWithEciesNistp256WithSha256(bit2oct(encvalue(v_signed_ec_signature)), v_public_enc_key, v_compressed_mode, ''O, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); + } else if (PX_EC_ALG == e_brainpool_p256_r1) { + v_enc_signed_ec_signature := f_encryptWithEciesBrainpoolp256WithSha256(bit2oct(encvalue(v_signed_ec_signature)), v_public_enc_key, v_compressed_mode, ''O, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); + } else { + log("f_generate_inner_at_request: Wrong encryption variant"); + return false; + } v_encrypted_data_encryption_key := valueof( m_encryptedDataEncryptionKey_eciesBrainpoolP256r1( m_evciesP256EncryptedKey( @@ -1270,6 +1284,7 @@ module LibItsPki_Functions { ), m_headerInfo_inner_ec_request(c_its_aid_SCR, f_getCurrentTimeUtc()) ); + log("f_build_pki_secured_request_message_signed_with_pop: signer: ", p_signer_identifier); if (ischosen(p_signer_identifier.self_)) { v_tbs_signed := f_signWithEcdsa(bit2oct(encvalue(v_tbs)), int2oct(0, 32), p_private_key); } else { @@ -1329,7 +1344,15 @@ module LibItsPki_Functions { if (PICS_SEC_FIXED_KEYS) { p_salt := '77C0637C3558B3238FDE1EEC376DA080BE4076FB8491CA0F8C19FD34DF298CEB'O; } - v_encrypted_request := f_encryptWithEciesNistp256WithSha256(v_encoded_request, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, PICS_SEC_FIXED_KEYS); + + if (PX_EC_ALG == e_nist_p256) { + v_encrypted_request := f_encryptWithEciesNistp256WithSha256(v_encoded_request, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, PICS_SEC_FIXED_KEYS); + } else if (PX_EC_ALG == e_brainpool_p256_r1) { + v_encrypted_request := f_encryptWithEciesBrainpoolp256WithSha256(v_encoded_request, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, PICS_SEC_FIXED_KEYS); + } else { + log("f_build_pki_secured_request_message_signed_with_pop: Wrong encryption variant"); + return false; + } log("f_build_pki_secured_request_message_signed_with_pop: p_aes_sym_key= ", p_aes_sym_key); log("f_build_pki_secured_request_message_signed_with_pop: p_encrypted_sym_key= ", p_encrypted_sym_key); log("f_build_pki_secured_request_message_signed_with_pop: p_authentication_vector= ", p_authentication_vector); @@ -1373,18 +1396,18 @@ module LibItsPki_Functions { m_etsiTs103097Data_encrypted( m_encryptedData( { - m_recipientInfo_signedDataRecipInfo( - m_pKRecipientInfo( - v_recipientId, - v_encrypted_data_encryption_key - )) - }, - m_SymmetricCiphertext_aes128ccm( - m_aesCcmCiphertext( - p_nonce, - v_encrypted_request - ) - ) + m_recipientInfo_certRecipInfo( + m_pKRecipientInfo( + v_recipientId, + v_encrypted_data_encryption_key + )) + }, + m_SymmetricCiphertext_aes128ccm( + m_aesCcmCiphertext( + p_nonce, + v_encrypted_request + ) + ) ) ) ); @@ -1437,7 +1460,14 @@ module LibItsPki_Functions { if (PICS_SEC_FIXED_KEYS) { p_salt := '77C0637C3558B3238FDE1EEC376DA080BE4076FB8491CA0F8C19FD34DF298CEB'O; } - v_encrypted_request := f_encryptWithEciesNistp256WithSha256(p_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, PICS_SEC_FIXED_KEYS); + if (PX_EC_ALG == e_nist_p256) { + v_encrypted_request := f_encryptWithEciesNistp256WithSha256(p_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, PICS_SEC_FIXED_KEYS); + } else if (PX_EC_ALG == e_brainpool_p256_r1) { + v_encrypted_request := f_encryptWithEciesBrainpoolp256WithSha256(p_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, PICS_SEC_FIXED_KEYS); + } else { + log("f_build_pki_secured_request_message: Wrong encryption variant"); + return false; + } log("f_build_pki_secured_request_message: p_aes_sym_key= ", p_aes_sym_key); log("f_build_pki_secured_request_message: p_encrypted_sym_key= ", p_encrypted_sym_key); log("f_build_pki_secured_request_message: p_authentication_vector= ", p_authentication_vector); @@ -1630,38 +1660,73 @@ module LibItsPki_Functions { if (isbound(v_plain_message) == false) { return false; } - log("v_plain_message= ", v_plain_message); + log("f_verify_pki_message: v_plain_message= ", v_plain_message); // 2. Decode it v_tbs := oct2bit(v_plain_message); if (decvalue(v_tbs, v_ieee1609dot2_signed_data) != 0) { return false; } - log("v_ieee1609dot2_signed_data= ", v_ieee1609dot2_signed_data); + log("f_verify_pki_message: v_ieee1609dot2_signed_data= ", v_ieee1609dot2_signed_data); // 3. Check the signature - log("v_ieee1609dot2_signed_data.content.signedData.tbsData= ", v_ieee1609dot2_signed_data.content.signedData.tbsData); + log("f_verify_pki_message: v_ieee1609dot2_signed_data.content.signedData.tbsData= ", v_ieee1609dot2_signed_data.content.signedData.tbsData); v_tbs := encvalue(v_ieee1609dot2_signed_data.content.signedData.tbsData); if (f_getCertificateFromDigest(v_ieee1609dot2_signed_data.content.signedData.signer.digest, v_certificate) == false) { if (p_check_security == true) { return false; } } - //log("v_certificate= ", v_certificate); - if (ischosen(v_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256.compressed_y_0)) { - v_ret := f_verifyWithEcdsaNistp256WithSha256( - bit2oct(v_tbs), - p_issuer, - v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaNistP256Signature.rSig.x_only & v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaNistP256Signature.sSig, - v_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256.compressed_y_0, - 0); - } else { - v_ret := f_verifyWithEcdsaNistp256WithSha256( - bit2oct(v_tbs), - p_issuer, - v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaNistP256Signature.rSig.x_only & v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaNistP256Signature.sSig, - v_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256.compressed_y_1, - 1); + //log("f_verify_pki_message: v_certificate= ", v_certificate); + v_ret := false; + if (ischosen(v_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256)) { + if (ischosen(v_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256.compressed_y_0)) { + v_ret := f_verifyWithEcdsaNistp256WithSha256( + bit2oct(v_tbs), + p_issuer, + v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaNistP256Signature.rSig.x_only & v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaNistP256Signature.sSig, + v_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256.compressed_y_0, + 0); + } else { + v_ret := f_verifyWithEcdsaNistp256WithSha256( + bit2oct(v_tbs), + p_issuer, + v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaNistP256Signature.rSig.x_only & v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaNistP256Signature.sSig, + v_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256.compressed_y_1, + 1); + } + } else if (ischosen(v_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1)) { + if (ischosen(v_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1.compressed_y_0)) { + v_ret := f_verifyWithEcdsaBrainpoolp256WithSha256( + bit2oct(v_tbs), + p_issuer, + v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only & v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig, + v_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1.compressed_y_0, + 0); + } else { + v_ret := f_verifyWithEcdsaBrainpoolp256WithSha256( + bit2oct(v_tbs), + p_issuer, + v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only & v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig, + v_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1.compressed_y_1, + 1); + } + } else if (ischosen(v_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1)) { + if (ischosen(v_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1.compressed_y_0)) { + v_ret := f_verifyWithEcdsaBrainpoolp384WithSha384( + bit2oct(v_tbs), + p_issuer, + v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only & v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig, + v_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1.compressed_y_0, + 0); + } else { + v_ret := f_verifyWithEcdsaBrainpoolp384WithSha384( + bit2oct(v_tbs), + p_issuer, + v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only & v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig, + v_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1.compressed_y_1, + 1); + } } if (v_ret == false) { if (p_check_security == true) { diff --git a/ttcn/Pki/LibItsPki_Pics.ttcn b/ttcn/Pki/LibItsPki_Pics.ttcn index 57b5f39b..822eb408 100644 --- a/ttcn/Pki/LibItsPki_Pics.ttcn +++ b/ttcn/Pki/LibItsPki_Pics.ttcn @@ -33,7 +33,7 @@ module LibItsPki_Pics { /** * @desc Is a re-enrolment request? */ - modulepar boolean PICS_SECPKI_REENROLMENT := true; + modulepar boolean PICS_SECPKI_REENROLMENT := false; /** * @desc ? diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index cd9b8ecf..6dee8bc6 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -2207,6 +2207,22 @@ module LibItsSecurity_Functions { return true; } // End of function f_getCertificateFromDigest + function f_getCertificateFromHashedId3( + in HashedId3 p_digest, + out EtsiTs103097Certificate p_certificate + ) return boolean { + var charstring v_certificate_id; + if (not(fx_readCertificateFromHashedId3(p_digest, v_certificate_id))) { + log("f_getCertificateFromHashedId3: Failed to retrieve digest for ", p_digest); + return false; + } + if (not(f_readCertificate(v_certificate_id, p_certificate))) { + log("f_getCertificateFromHashedId3: Failed to retrieve digest for ", v_certificate_id); + return false; + } + return true; + } // End of function f_getCertificateFromHashedId3 + /** * @desc Read the signing private key for the specified certificate * @param p_keysId the keys identifier @@ -2589,6 +2605,8 @@ module LibItsSecurity_Functions { external function fx_readCertificateFromDigest(in HashedId8 p_digest, out charstring p_certificate_id) return boolean; + external function fx_readCertificateFromHashedId3(in HashedId3 p_digest, out charstring p_certificate_id) return boolean; + /** * @desc Read the private keys for the specified certificate * @param p_keysId the keys identifier -- GitLab From cdcc7f0f5bc5c590db75ec4e106697e81106efbf Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 8 Feb 2019 06:46:24 -0800 Subject: [PATCH 183/320] Validating ERRATA changes --- ttcn/Http/LibItsHttp_Functions.ttcn | 46 ++- ttcn/Pki/LibItsPki_Functions.ttcn | 452 ++++++++++++++++++++-------- ttcn/Pki/LibItsPki_Pics.ttcn | 40 ++- ttcn/Pki/LibItsPki_TestSystem.ttcn | 8 + 4 files changed, 408 insertions(+), 138 deletions(-) diff --git a/ttcn/Http/LibItsHttp_Functions.ttcn b/ttcn/Http/LibItsHttp_Functions.ttcn index cb138f54..b480f399 100644 --- a/ttcn/Http/LibItsHttp_Functions.ttcn +++ b/ttcn/Http/LibItsHttp_Functions.ttcn @@ -13,7 +13,7 @@ module LibItsHttp_Functions { group http_preambles { /** - * @desc Setups default configuration + * @desc Setups default configuration * @param p_certificate_id The certificate identifier the TA shall use in case of secured IUT */ function f_cfUp( @@ -65,13 +65,15 @@ module LibItsHttp_Functions { p_headers[v_i] := { c_header_pragma, { "no-cache" } }; v_i := v_i + 1; p_headers[v_i] := { c_header_cache_control, { "no-cache" } }; + //v_i := v_i + 1; + //p_headers[v_i] := { c_header_accept, { "application/x-its-response" } }; } // End of function f_init_default_headers_list - function f_set_headears_list( - in charstring_list p_headers_to_set, - in charstring_list p_headers_value, - inout HeaderLines p_headers - ) { + function f_set_headers_list( + in charstring_list p_headers_to_set, + in charstring_list p_headers_value, + inout HeaderLines p_headers + ) { // Sanity checks if (lengthof(p_headers_to_set) == 0) { return; @@ -91,12 +93,12 @@ module LibItsHttp_Functions { } } // End of 'for' statement } // End of 'for' statement - } // End of function f_set_headears_list + } // End of function f_set_headers_list - function f_remove_headears_list( - in charstring_list p_headers_to_remove, - inout HeaderLines p_headers - ) { + function f_remove_headers_list( + in charstring_list p_headers_to_remove, + inout HeaderLines p_headers + ) { // Sanity checks if (lengthof(p_headers_to_remove) == 0) { return; @@ -112,7 +114,27 @@ module LibItsHttp_Functions { } } // End of 'for' statement } // End of 'for' statement - } // End of function f_remove_headears_list + } // End of function f_remove_headers_list + + function f_get_header( + in HeaderLines p_headers, + in charstring p_header_name := c_header_content_text, + out charstring_list p_header_value + ) { + // Sanity checks + if (lengthof(p_header_name) == 0) { + return; + } else if (lengthof(p_headers) == 0) { + return; + } + + for (var integer v_jdx := 0; v_jdx < lengthof(p_headers); v_jdx := v_jdx + 1) { + if (p_headers[v_jdx].header_name == p_header_name) { + p_header_value := p_headers[v_jdx].header_value; // NOTE Codec won't encode it + break; + } + } // End of 'for' statement + } // End of function f_get_header } // End of group http_headers diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index c8f2e2f0..117fad62 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -71,8 +71,14 @@ module LibItsPki_Functions { in charstring p_ea_certificate_id := "CERT_TS_A_EA", // TODO Use a constant in charstring p_aa_certificate_id := "CERT_TS_A_AA" ) runs on ItsPkiHttp /* TITAN TODO: system ItsPkiHttpSystem */ { - - map(self:httpPort, system:httpPort); + + if (LibItsPki_Pics.PICS_MULTIPLE_END_POINT == false) { + map(self:httpPort, system:httpPort); + } else { + map(self:httpEcPort, system:httpEcPort); + map(self:httpAtVPort, system:httpAtVPort); + map(self:httpAtPort, system:httpAtPort); + } f_connect4SelfOrClientSync(); f_initialiseSecuredMode(p_ea_certificate_id, p_aa_certificate_id); // TODO To be removed??? @@ -94,8 +100,14 @@ module LibItsPki_Functions { log("vc_aaWholeHash= ", vc_aaWholeHash); // f_readCertificate(p_peerCertificateId, vc_peerEaCertificate); // TODO To be removed // f_getCertificateHash(p_peerCertificateId, vc_eaPeerWholeHash); // TODO To be removed - - activate(a_default_pki_http()); + + if (PICS_MULTIPLE_END_POINT == false) { + activate(a_default_pki_http()); + } else { + activate(a_default_pki_http_ec()); + activate(a_default_pki_http_atv()); + activate(a_default_pki_http_at()); + } } // End of function f_cfHttpUp function f_cfUp_itss( @@ -115,7 +127,13 @@ module LibItsPki_Functions { * @desc Deletes default configuration */ function f_cfHttpDown() runs on ItsPkiHttp /* TITAN TODO: system ItsPkiHttpSystem */ { - unmap(self:httpPort, system:httpPort); + if (PICS_MULTIPLE_END_POINT == false) { + unmap(self:httpPort, system:httpPort); + } else { + unmap(self:httpEcPort, system:httpEcPort); + unmap(self:httpAtVPort, system:httpAtVPort); + unmap(self:httpAtPort, system:httpAtPort); + } f_disconnect4SelfOrClientSync(); f_uninitialiseSecuredMode(); } // End of function f_cfHttpDown @@ -360,7 +378,7 @@ module LibItsPki_Functions { log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); f_selfOrClientSyncAndVerdict("error", e_error); } - log("v_inner_ec_request_signed_for_pop= ", v_inner_ec_request_signed_for_pop); + log("f_http_build_invalid_enrolment_request: v_inner_ec_request_signed_for_pop= ", v_inner_ec_request_signed_for_pop); // Modify signature to get an error if (ischosen(v_inner_ec_request_signed_for_pop.content.signedData.signature_.ecdsaNistP256Signature)) { v_inner_ec_request_signed_for_pop.content.signedData.signature_.ecdsaNistP256Signature.sSig[1] := bit2oct('10101010'B xor4b oct2bit(v_inner_ec_request_signed_for_pop.content.signedData.signature_.ecdsaNistP256Signature.sSig[1])); @@ -370,11 +388,11 @@ module LibItsPki_Functions { // Secure InnerEcRequestSignedForPoP message if (f_extract_enc_key(vc_eaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { - log("*** f_http_build_inner_ec_request: ERROR: Non canonical EA certificate ***"); + log("*** f_http_build_invalid_enrolment_request: ERROR: Non canonical EA certificate ***"); f_selfOrClientSyncAndVerdict("error", e_error); } - log("*** f_http_build_inner_ec_request: Public encryption key: ", v_public_enc_key); - log("*** f_http_build_inner_ec_request: Public encryption key comp: ", v_compressed_enc_key_mode); + log("*** f_http_build_invalid_enrolment_request: Public encryption key: ", v_public_enc_key); + log("*** f_http_build_invalid_enrolment_request: Public encryption key comp: ", v_compressed_enc_key_mode); p_salt := vc_eaWholeHash; if (PICS_SECPKI_REENROLMENT == false) { // This is the first enrolment, we used Factory keys v_ret_code := f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); @@ -397,10 +415,10 @@ module LibItsPki_Functions { in octetstring p_ec_private_key, out octetstring p_private_key, out octetstring p_public_key_compressed, - out integer p_compressed_mode, + out integer p_compressed_key_mode, out octetstring p_private_enc_key, out octetstring p_public_compressed_enc_key, - out integer p_compressedEncMode, + out integer p_compressed_enc_key_mode, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, @@ -420,35 +438,18 @@ module LibItsPki_Functions { var Ieee1609Dot2Data v_inner_at_request_data; var InnerAtRequest v_authorization_request; var bitstring v_authorization_request_msg; - - // Generate verification keys for the certificate to be requested - if (f_generate_key_pair(p_private_key, v_public_key_x, v_public_key_y, p_public_key_compressed, p_compressed_mode) == false) { - log("*** f_http_build_authorization_request: ERROR: Failed to generate verification key ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - return; - } - log ("f_http_build_authorization_request: AT verification private key: ", p_private_key); - log ("f_http_build_authorization_request: AT verification public compressed key: ", p_public_key_compressed); - log ("f_http_build_authorization_request: AT verification public compressed mode: ", p_compressed_mode); - // Generate encryption keys for the certificate to be requested - if (PX_INCLUDE_ENCRYPTION_KEYS) { - if (f_generate_key_pair(p_private_enc_key, v_public_enc_key_x, v_public_enc_key_y, p_public_compressed_enc_key, p_compressedEncMode) == false) { - log("*** f_http_build_authorization_request: ERROR: Failed to generate encryption key ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - return; - } - } - - if (f_generate_inner_at_request(vc_eaCertificate, vc_eaHashedId8, p_ec_certificate, p_ec_private_key, p_private_key, v_public_key_x, v_public_key_y, p_compressed_mode, p_private_enc_key, v_public_enc_key_x, v_public_enc_key_y, p_compressedEncMode, v_inner_at_request) == false) { + + // Generate the InnerAtRequest + if (f_generate_inner_at_request(vc_eaCertificate, vc_eaHashedId8, p_ec_certificate, p_ec_private_key, p_private_key, p_public_key_compressed, p_compressed_key_mode, p_private_enc_key, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_inner_at_request) == false) { log("*** f_http_build_authorization_request: ERROR: Failed to generate AuthorizationValidationRequest ***"); f_selfOrClientSyncAndVerdict("error", e_error); return; } - log("v_inner_at_request= ", v_inner_at_request); + log("f_http_build_authorization_request: v_inner_at_request= ", v_inner_at_request); // Secure InnerAtRequest message if (f_extract_enc_key(vc_aaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { - log("*** f_http_build_inner_ec_request: ERROR: Non canonical AA certificate ***"); + log("*** f_http_build_authorization_request: ERROR: Non canonical AA certificate ***"); f_selfOrClientSyncAndVerdict("error", e_error); } if (PICS_SEC_FIXED_KEYS) { // Debug mode: Use fixed values @@ -476,42 +477,66 @@ module LibItsPki_Functions { } // End of function f_http_build_authorization_request function f_http_build_authorization_validation_request( + in InnerAtRequest p_inner_at_request, out octetstring p_private_key, out octetstring p_public_key_compressed, - out integer p_compressed_mode, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data + out integer p_compressed_key_mode, + out octetstring p_private_enc_key, + out octetstring p_public_compressed_enc_key, + out integer p_compressed_enc_key_mode, + out Oct16 p_aes_sym_key, + out Oct16 p_encrypted_sym_key, + out Oct16 p_authentication_vector, + out Oct12 p_nonce, + out octetstring p_salt, + out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, + out Oct32 p_request_hash ) runs on ItsPkiHttp { // Local variables var AuthorizationValidationRequest v_authorization_validation_request; var bitstring v_authorization_validation_request_msg; var octetstring v_public_enc_key; var integer v_compressed_enc_key_mode; - - /* TODO if (f_generate_authorization_validation_request(vc_eaCertificate, vc_eaHashedId8, p_private_key, p_public_key_compressed, p_compressed_mode, v_authorization_validation_request) == false) { - log("*** f_http_build_authorization_validation_request: ERROR: Failed to generate AuthorizationValidationRequest ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - }*/ + + // Copy the sharedAtRequest component from the InnerAtRequest received in the AuthorizationRequestMessage + v_authorization_validation_request.sharedAtRequest := p_inner_at_request.sharedAtRequest; + // Copy the ecSignature component from the InnerAtRequest received in the AuthorizationRequestMessage or AuthorizationRequestMessageWithPop + v_authorization_validation_request.ecSignature := p_inner_at_request.ecSignature; // Secure the Pki message if (f_extract_enc_key(vc_eaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { - log("*** f_http_build_inner_ec_request: ERROR: Non canonical EA certificate ***"); + log("*** f_http_build_authorization_validation_request: ERROR: Non canonical EA certificate ***"); f_selfOrClientSyncAndVerdict("error", e_error); } log("*** f_http_build_authorization_validation_request: Public encryption key: ", v_public_enc_key); log("*** f_http_build_authorization_validation_request: Public encryption key comp: ", v_compressed_enc_key_mode); - - /** - TODO: Load certificate according to the IUT role - ==> a complete fucntion which set up the TestSustem certificate,keyy... according to the IUT role - **/ - log("*** f_http_build_inner_ec_request: ERROR: Need to add TestSystem variable vc_aa ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - /* if (f_build_pki_secured_request_message_signed_with_pop(vc_aaPrivateKey, valueof(m_signerIdentifier_digest(vc_aaHashedId8)), vc_eaHashedId8/\*recipientId*\/, v_public_enc_key, v_compressed_enc_key_mode, vc_eaWholeHash, bit2oct(encvalue(m_etsiTs102941Data_authorization_validation_request(v_authorization_validation_request))), p_ieee1609dot2_signed_and_encrypted_data, p_request_hash) == false) { */ - /* log("*** f_http_build_authorization_validation_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); */ - /* f_selfOrClientSyncAndVerdict("error", e_error); */ - /* } */ - - log("*** f_http_build_authorization_validation_request: DEBUG: p_ieee1609dot2_signed_and_encrypted_data = ", p_ieee1609dot2_signed_and_encrypted_data); + // Secure InnerAtRequest message + if (f_extract_enc_key(vc_eaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { + log("*** f_http_build_authorization_validation_request: ERROR: Non canonical EA certificate ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + if (PICS_SEC_FIXED_KEYS) { // Debug mode: Use fixed values + v_public_enc_key := 'DD4F6B0DF57C6E3BD0E32B565CACA1D858CEB08A5C2BBAB2C23E203C6DE697FF'O; + v_compressed_enc_key_mode := 0; + } + log("*** f_http_build_authorization_validation_request: Public encryption key: ", v_public_enc_key); + log("*** f_http_build_authorization_validation_request: Public encryption key comp: ", v_compressed_enc_key_mode); + p_salt := vc_eaWholeHash; + log("*** f_http_build_authorization_validation_request: p_salt: ", p_salt); + if (PX_AUTHORIZATION_REQUEST_WITH_POP) { + if(f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_validation_request(v_authorization_validation_request))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { + log("*** f_http_build_authorization_validation_request: ERROR: Failed to generate Authorization Request ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + } else { // Only encryption of EtsiTs102941Data/InnerAtRequest + log("*** f_http_build_authorization_validation_request: POP signature not applied"); + if(f_build_pki_secured_request_message(vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_validation_request(v_authorization_validation_request))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { + log("*** f_http_build_authorization_validation_request: ERROR: Failed to generate Authorization Request ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + } + log("*** f_http_build_authorization_validation_request: DEBUG: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); + log("*** f_http_build_authorization_validation_request: DEBUG: p_request_hash= ", p_request_hash); } // End of function f_http_build_authorization_validation_request } // End of group http @@ -572,7 +597,7 @@ module LibItsPki_Functions { v_public_verification_key ), m_validityPeriod( - f_getCurrentTime(), + f_getCurrentTime() / 1000, m_duration_years(1) ), m_geographicRegion_identifiedRegion( @@ -650,7 +675,7 @@ module LibItsPki_Functions { v_public_verification_key ), m_validityPeriod( - f_getCurrentTime(), + f_getCurrentTime() / 1000, m_duration_years(1) ), m_geographicRegion_identifiedRegion( @@ -729,7 +754,7 @@ module LibItsPki_Functions { valueof(m_appPermissions(c_its_aid_SCR, { bitmapSsp := '00C0'O })) }, m_validityPeriod( - f_getCurrentTime(), + f_getCurrentTime() / 1000, m_duration_years(1) // TODO Use PIXIT ), m_geographicRegion_identifiedRegion( @@ -853,17 +878,19 @@ module LibItsPki_Functions { in Oct8 p_ea_hashed_id8, in Certificate p_ec_certificate, in octetstring p_ec_private_key, - in octetstring p_private_key, - in octetstring p_public_key_x, - in octetstring p_public_key_y, - in integer p_compressed_key_mode, - in octetstring p_private_enc_key, - in octetstring p_public_enc_key_x, - in octetstring p_public_enc_key_y, - in integer p_compressed_enc_key_mode, + out octetstring p_private_key, + out octetstring p_public_key_compressed, + out integer p_compressed_key_mode, + out octetstring p_private_enc_key, + out octetstring p_public_compressed_enc_key, + out integer p_compressed_enc_key_mode, out InnerAtRequest p_inner_at_request ) return boolean { // Local variables + var octetstring v_public_key_x; + var octetstring v_public_key_y; + var octetstring v_public_enc_key_x; + var octetstring v_public_enc_key_y; var bitstring v_enc_value; var octetstring v_ec_hash; var Oct8 v_ec_hashed_id8; @@ -881,6 +908,26 @@ module LibItsPki_Functions { var HashAlgorithm v_hashId; var Signature v_signature; + // Generate verification keys for the certificate to be requested + if (f_generate_key_pair(p_private_key, v_public_key_x, v_public_key_y, p_public_key_compressed, p_compressed_key_mode) == false) { + log("f_generate_inner_at_request: Failed to generate verification key"); + return false; + } + log ("f_generate_inner_at_request: AT verification private key: ", p_private_key); + log ("f_generate_inner_at_request: AT verification public compressed key: ", p_public_key_compressed); + log ("f_generate_inner_at_request: AT verification public compressed mode: ", p_compressed_key_mode); + // Generate encryption keys for the certificate to be requested + if (PX_INCLUDE_ENCRYPTION_KEYS) { + if (f_generate_key_pair(p_private_enc_key, v_public_enc_key_x, v_public_enc_key_y, p_public_compressed_enc_key, p_compressed_enc_key_mode) == false) { + log("f_generate_inner_at_request: Failed to generate encryption key"); + return false; + } + } else { + p_private_enc_key := ''O; + p_public_compressed_enc_key := ''O; + p_compressed_enc_key_mode := -1; + } + // Calculate the whole certificate SHA v_enc_value := encvalue(p_ec_certificate); if (ischosen(p_ec_certificate.issuer.sha256AndDigest)) { @@ -897,7 +944,7 @@ module LibItsPki_Functions { log("f_generate_inner_at_request: v_hmac_key= ", v_hmac_key); // Generate tag based on the concatenation of verification keys & encryption keys - v_message_to_tag := p_public_key_x & p_public_key_y & p_public_enc_key_x & p_public_enc_key_y; + v_message_to_tag := v_public_key_x & v_public_key_y & v_public_enc_key_x & v_public_enc_key_y; log("f_generate_inner_at_request: v_message_to_tag= ", v_message_to_tag); // FIXME encryption keys could be optional v_key_tag := fx_hmac_sha256(v_hmac_key, v_message_to_tag); // TODO Rename and use a wrapper function log("f_generate_inner_at_request: v_key_tag= ", v_key_tag); @@ -1092,14 +1139,14 @@ module LibItsPki_Functions { } // Build the InnerAtRequest, EcSignature field is already set if (p_compressed_key_mode == 0) { - v_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_0(p_public_key_x); + v_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_0(v_public_key_x); } else { - v_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_1(p_public_key_x); + v_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_1(v_public_key_x); } if (p_compressed_enc_key_mode == 0) { - v_enc_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_0(p_public_enc_key_x); + v_enc_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_0(v_public_enc_key_x); } else { - v_enc_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_1(p_public_enc_key_x); + v_enc_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_1(v_public_enc_key_x); } p_inner_at_request.publicKeys := valueof( // The freshly generated public keys to be used for the requested AT certificate m_publicKeys( @@ -1144,6 +1191,54 @@ module LibItsPki_Functions { group awaiting_messages { + function f_http_send( + in HeaderLines p_headers, + in template (value) HttpMessage p_http_message + ) runs on ItsPkiHttp { + if (not(PICS_MULTIPLE_END_POINT)) { + httpPort.send(p_http_message); + } else { + var charstring_list v_content_text; + + f_get_header(p_headers, c_header_content_text, v_content_text); + + if (not(isvalue(v_content_text))) { + log("f_http_send: Failed to send message: header not found: ", c_header_content_text); + return; + } + if (v_content_text == { "inner_ec_request" }) { + log("f_http_send: Send on EC end point"); + f_set_headers_list({ c_header_host }, { PICS_HEADER_HOST_EC }, p_headers); + if (ischosen(p_http_message.request)) { + p_http_message.request.header := p_headers; + } else { + p_http_message.response.header := p_headers; + } + httpEcPort.send(p_http_message); + } else if (v_content_text == { "inner_atv_request" }) { + log("f_http_send: Send on ATV end point"); + f_set_headers_list({ c_header_host }, { PICS_HEADER_HOST_ATV }, p_headers); + if (ischosen(p_http_message.request)) { + p_http_message.request.header := p_headers; + } else { + p_http_message.response.header := p_headers; + } + httpAtVPort.send(p_http_message); + } else if (v_content_text == { "inner_at_request" }) { + log("f_http_send: Send on AT end point"); + f_set_headers_list({ c_header_host }, { PICS_HEADER_HOST_AT }, p_headers); + if (ischosen(p_http_message.request)) { + p_http_message.request.header := p_headers; + } else { + p_http_message.response.header := p_headers; + } + httpAtPort.send(p_http_message); + } else { + log("f_http_send: Invalid header value: ", v_content_text); + } + } + } // End of function f_http_send + function f_await_http_inner_ec_request_response( out Oct32 p_private_key, out Oct32 p_compressed_public_key, @@ -1164,29 +1259,30 @@ module LibItsPki_Functions { log(">>> f_await_http_inner_ec_request_response"); f_http_build_inner_ec_request(p_private_key, p_compressed_public_key, p_compressed_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, v_salt, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash); f_init_default_headers_list(-, "inner_ec_request", v_headers); - httpPort.send( - m_http_request( - m_http_request_post( - PICS_HTTP_POST_URI, - v_headers, - m_http_message_body_binary( - m_binary_body_ieee1609dot2_data( - v_ieee1609dot2_signed_and_encrypted_data - ))))); + f_http_send( + v_headers, + m_http_request( + m_http_request_post( + PICS_HTTP_POST_URI_EC, + v_headers, + m_http_message_body_binary( + m_binary_body_ieee1609dot2_data( + v_ieee1609dot2_signed_and_encrypted_data + ))))); tc_ac.start; alt { - [] httpPort.receive( - mw_http_response( - mw_http_response_ok( - mw_http_message_body_binary( - mw_binary_body_ieee1609dot2_data( - mw_enrolmentResponseMessage( - mw_encryptedData( - -, - mw_SymmetricCiphertext_aes128ccm - ))))))) -> value v_response { + [not(PICS_MULTIPLE_END_POINT)] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_binary( + mw_binary_body_ieee1609dot2_data( + mw_enrolmentResponseMessage( + mw_encryptedData( + -, + mw_SymmetricCiphertext_aes128ccm + ))))))) -> value v_response { tc_ac.stop; - + if (f_verify_pki_message(p_private_key, v_aes_sym_key, v_authentication_vector, vc_eaWholeHash, vc_eaCertificate, v_response.response.body.binary_body.ieee1609dot2_data, false, v_etsi_ts_102941_data) == false) { log("f_await_http_inner_ec_request_response: Failed to verify PKI message ***"); } else { @@ -1208,13 +1304,38 @@ module LibItsPki_Functions { } } } - [] httpPort.receive( - mw_http_response( - mw_http_response_ko - )) { + [PICS_MULTIPLE_END_POINT] httpEcPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_binary( + mw_binary_body_ieee1609dot2_data( + mw_enrolmentResponseMessage( + mw_encryptedData( + -, + mw_SymmetricCiphertext_aes128ccm + ))))))) -> value v_response { tc_ac.stop; - log("f_await_http_inner_ec_request_response: Unexpected message received ***"); + if (f_verify_pki_message(p_private_key, v_aes_sym_key, v_authentication_vector, vc_eaWholeHash, vc_eaCertificate, v_response.response.body.binary_body.ieee1609dot2_data, false, v_etsi_ts_102941_data) == false) { + log("f_await_http_inner_ec_request_response: Failed to verify PKI message ***"); + } else { + log("f_await_http_inner_ec_request_response: Receive ", v_etsi_ts_102941_data, " ***"); + // Verify the received EC certificate + log("f_await_http_inner_ec_request_response: match ", match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(substr(v_request_hash, 0, 16), mw_etsiTs103097Certificate(-, mw_toBeSignedCertificate_ec, -)))), " ***"); // TODO In TITAN, this is the only way to get the unmatching in log + if (match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(substr(v_request_hash, 0, 16), mw_etsiTs103097Certificate(-, mw_toBeSignedCertificate_ec, -))))) { + p_inner_ec_response := v_etsi_ts_102941_data.content.enrolmentResponse; + if (f_verify_ec_certificate(v_etsi_ts_102941_data.content.enrolmentResponse.certificate, vc_eaCertificate, p_compressed_public_key, p_compressed_mode)) { + log("f_await_http_inner_ec_request_response: Well-secured EA certificate received ***"); + log("p_inner_ec_response= ", p_inner_ec_response); + return true; + } else { + log("f_await_http_inner_ec_request_response: Cannot verify EC certificate signature ***"); + return true; // For debug mode only + } + } else { + log("f_await_http_inner_ec_request_response: Unexpected message received ***"); + } + } } [] tc_ac.timeout { log("f_await_http_inner_ec_request_response: Expected message not received ***"); @@ -1267,16 +1388,10 @@ module LibItsPki_Functions { var integer v_public_compressed_ephemeral_mode; var octetstring v_encrypted_request; var EncryptedDataEncryptionKey v_encrypted_data_encryption_key; + var bitstring v_enc_value; log(">>> f_build_pki_secured_request_message_signed_with_pop"); - // The 'p_request_hash' shall be the SHA256 digest of the OER representation of the topmost EtsiTs103097Data-Encoded structure - if (PICS_SEC_FIXED_KEYS) { - p_request_hash := '10ED97A2F2933DD3AC55F47022D125E18F5E1AA024613E616A75BA4979EFE318'O; - } else { - p_request_hash := f_hashWithSha256(p_pki_message); - } - log("f_build_pki_secured_request_message_signed_with_pop: p_request_hash= ", p_request_hash); // Signed the encoded PKI message v_tbs := m_toBeSignedData( m_signedDataPayload( @@ -1412,7 +1527,16 @@ module LibItsPki_Functions { ) ); - log("<<< f_build_pki_secured_request_message_signed_with_pop: ", p_ieee1609dot2_signed_and_encrypted_data); + // The 'p_request_hash' shall be the SHA256 digest of the OER representation of the topmost EtsiTs103097Data-Encoded structure + v_enc_value := encvalue(p_ieee1609dot2_signed_and_encrypted_data); + if (PICS_SEC_FIXED_KEYS) { + p_request_hash := '10ED97A2F2933DD3AC55F47022D125E18F5E1AA024613E616A75BA4979EFE318'O; + } else { + p_request_hash := f_hashWithSha256(bit2oct(v_enc_value)); + } + log("f_build_pki_secured_request_message_signed_with_pop: p_request_hash= ", p_request_hash); + + log("<<< f_build_pki_secured_request_message_signed_with_pop: ", p_pki_message); return true; } // End of function f_build_pki_secured_request_message_signed_with_pop @@ -1446,16 +1570,10 @@ module LibItsPki_Functions { var integer v_public_compressed_ephemeral_mode; var octetstring v_encrypted_request; var EncryptedDataEncryptionKey v_encrypted_data_encryption_key; + var bitstring v_enc_value; log(">>> f_build_pki_secured_request_message"); - // The 'p_request_hash' shall be the SHA256 digest of the OER representation of the topmost EtsiTs103097Data-Encoded structure - if (PICS_SEC_FIXED_KEYS) { - p_request_hash := '10ED97A2F2933DD3AC55F47022D125E18F5E1AA024613E616A75BA4979EFE318'O; - } else { - p_request_hash := f_hashWithSha256(p_pki_message); - } - log("f_build_pki_secured_request_message: p_request_hash= ", p_request_hash); // Encrypt encode EtsiTs103097Data-Signed data structure if (PICS_SEC_FIXED_KEYS) { p_salt := '77C0637C3558B3238FDE1EEC376DA080BE4076FB8491CA0F8C19FD34DF298CEB'O; @@ -1523,6 +1641,15 @@ module LibItsPki_Functions { ) ); + // The 'p_request_hash' shall be the SHA256 digest of the OER representation of the topmost EtsiTs103097Data-Encoded structure + v_enc_value := encvalue(p_ieee1609dot2_signed_and_encrypted_data); + if (PICS_SEC_FIXED_KEYS) { + p_request_hash := '10ED97A2F2933DD3AC55F47022D125E18F5E1AA024613E616A75BA4979EFE318'O; + } else { + p_request_hash := f_hashWithSha256(bit2oct(v_enc_value)); + } + log("f_build_pki_secured_request_message: p_request_hash= ", p_request_hash); + log("<<< f_build_pki_secured_request_message: ", p_ieee1609dot2_signed_and_encrypted_data); return true; } // End of function f_build_pki_secured_request_message @@ -1869,33 +1996,116 @@ module LibItsPki_Functions { } // End of group security_function - group altstes { + group altsteps { altstep a_default_pki_http() runs on ItsPkiHttp { - [] httpPort.receive( - mw_http_response( - mw_http_response_ko - )) { + [not(PICS_MULTIPLE_END_POINT)] httpPort.receive( + mw_http_response( + mw_http_response_ko + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": FAIL: Unexpected message received ***"); + f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); + } + [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(mw_http_request) { tc_ac.stop; - log("*** a_default: ERROR: HTTP Server error ***"); + log("*** a_default: ERROR: Unexpected HTTP Request received ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(mw_http_response) { + tc_ac.stop; + log("*** a_default: ERROR: Unexpected HTTP Response received ***"); f_selfOrClientSyncAndVerdict("error", e_error); } - [] httpPort.receive(mw_http_request) { + [not(PICS_MULTIPLE_END_POINT)] httpPort.receive { + tc_ac.stop; + log("*** a_default: ERROR: Unexpected HTTP message received ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + } // End of altstep a_default_pki_http + + altstep a_default_pki_http_ec() runs on ItsPkiHttp { + [PICS_MULTIPLE_END_POINT] httpEcPort.receive( + mw_http_response( + mw_http_response_ko + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": FAIL: Unexpected message received ***"); + f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); + } + [PICS_MULTIPLE_END_POINT] httpEcPort.receive(mw_http_request) { tc_ac.stop; log("*** a_default: ERROR: Unexpected HTTP Request received ***"); f_selfOrClientSyncAndVerdict("error", e_error); } - [] httpPort.receive(mw_http_response) { + [PICS_MULTIPLE_END_POINT] httpEcPort.receive(mw_http_response) { tc_ac.stop; log("*** a_default: ERROR: Unexpected HTTP Response received ***"); f_selfOrClientSyncAndVerdict("error", e_error); } - [] httpPort.receive { + [PICS_MULTIPLE_END_POINT] httpEcPort.receive { tc_ac.stop; log("*** a_default: ERROR: Unexpected HTTP message received ***"); f_selfOrClientSyncAndVerdict("error", e_error); } - } - } + } // End of altstep a_default_pki_http_ec + + altstep a_default_pki_http_atv() runs on ItsPkiHttp { + [PICS_MULTIPLE_END_POINT] httpAtVPort.receive( + mw_http_response( + mw_http_response_ko + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": FAIL: Unexpected message received ***"); + f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); + } + [PICS_MULTIPLE_END_POINT] httpAtVPort.receive(mw_http_request) { + tc_ac.stop; + log("*** a_default: ERROR: Unexpected HTTP Request received ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [PICS_MULTIPLE_END_POINT] httpAtVPort.receive(mw_http_response) { + tc_ac.stop; + log("*** a_default: ERROR: Unexpected HTTP Response received ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [PICS_MULTIPLE_END_POINT] httpAtVPort.receive { + tc_ac.stop; + log("*** a_default: ERROR: Unexpected HTTP message received ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + } // End of altstep a_default_pki_http_atv + + altstep a_default_pki_http_at() runs on ItsPkiHttp { + [PICS_MULTIPLE_END_POINT] httpAtPort.receive( + mw_http_response( + mw_http_response_ko + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": FAIL: Unexpected message received ***"); + f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); + } + [PICS_MULTIPLE_END_POINT] httpAtPort.receive(mw_http_request) { + tc_ac.stop; + log("*** a_default: ERROR: Unexpected HTTP Request received ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [PICS_MULTIPLE_END_POINT] httpAtPort.receive(mw_http_response) { + tc_ac.stop; + log("*** a_default: ERROR: Unexpected HTTP Response received ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [PICS_MULTIPLE_END_POINT] httpAtPort.receive { + tc_ac.stop; + log("*** a_default: ERROR: Unexpected HTTP message received ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + } // End of altstep a_default_pki_http_at + + } // End of group altsteps } // End of module LibItsPki_Functions diff --git a/ttcn/Pki/LibItsPki_Pics.ttcn b/ttcn/Pki/LibItsPki_Pics.ttcn index 822eb408..2bb0ef7d 100644 --- a/ttcn/Pki/LibItsPki_Pics.ttcn +++ b/ttcn/Pki/LibItsPki_Pics.ttcn @@ -15,11 +15,6 @@ module LibItsPki_Pics { */ modulepar boolean PICS_IUT_AA_ROLE := true; - /** - * @desc Does the IUT act as combined EA-AA device? - */ - modulepar boolean PICS_IUT_COMBINED_EA_AA_ROLE := false; - /** * @desc Does the IUT support enrolment? */ @@ -70,6 +65,26 @@ module LibItsPki_Pics { */ modulepar charstring PICS_TS_AA_CERTIFICATE_ID := "CERT_AA"; + /** + * @desc Set to true if different end points are used for EC and AT + */ + modulepar boolean PICS_MULTIPLE_END_POINT := false; + + /** + * @desc End point for the enrolment + */ + modulepar charstring PICS_HEADER_HOST_EC := "www.its.ec.org"; + + /** + * @desc End point for the authorization validation + */ + modulepar charstring PICS_HEADER_HOST_ATV := "www.its.atv.org"; + + /** + * @desc End point for the authorization + */ + modulepar charstring PICS_HEADER_HOST_AT := "www.its.at.org"; + /** * @desc Certificate used by the Test System */ @@ -80,6 +95,21 @@ module LibItsPki_Pics { */ modulepar boolean PICS_ITS_S_WITH_PRIVACY := true; + /** + * @desc HTTP POST URI for InnerECRequest + */ + modulepar charstring PICS_HTTP_POST_URI_EC := "/enrolment"; + + /** + * @desc HTTP POST URI for InnerATRequest + */ + modulepar charstring PICS_HTTP_POST_URI_AT := "/authorize"; + + /** + * @desc HTTP POST URI for authorization validation + */ + modulepar charstring PICS_HTTP_POST_URI_ATV := "/authorize_validate"; + /** * @desc Factory private key for verification Nist P256 */ diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index 3770639c..076f488f 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -59,12 +59,20 @@ module LibItsPki_TestSystem { * @desc System component */ type component ItsPkiHttpSystem extends HttpTestAdapter{ + /** Use httPort when EC and AT are served by the same end point */ + port HttpPort httpEcPort; /** Enrolment end point */ + port HttpPort httpAtVPort; /** Authorization Validation end point */ + port HttpPort httpAtPort; /** Authorization end point */ } // End of component ItsPkiHttpSystem /** * @desc Test component for PKI entities execpt ITS-S */ type component ItsPkiHttp extends ItsSecurityBaseComponent, HttpComponent { + /** Use httPort when EC and AT are served by the same end point */ + port HttpPort httpEcPort; /** Enrolment end point */ + port HttpPort httpAtVPort; /** Authorization Validation end point */ + port HttpPort httpAtPort; /** Authorization end point */ var Certificate vc_eaCertificate; /** Test Adapter EA certificate */ var octetstring vc_eaPrivateKey; /** Test Adapter EA private key for signature */ // var Certificate vc_ecCertificate; /** Test Adapter AA certificate */ -- GitLab From 74a8b47dc5acbccb6074901af553e94c5b6ed9cd Mon Sep 17 00:00:00 2001 From: garciay Date: Sat, 9 Feb 2019 06:19:21 -0800 Subject: [PATCH 184/320] Bug fixed in AtsSecurity --- ttcn/Security/LibItsSecurity_Functions.ttcn | 41 ++++++--------------- 1 file changed, 11 insertions(+), 30 deletions(-) diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 6dee8bc6..5b59b9f0 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -1958,45 +1958,26 @@ module LibItsSecurity_Functions { */ function f_verifyGnSecuredMessageSignatureWithCertificate( in template (value) Ieee1609Dot2Data p_securedMessage, + in template (value) charstring p_certificate_id, in template (value) EtsiTs103097Certificate p_certificate + ) return boolean { var octetstring v_issuer; + var EtsiTs103097Certificate v_certificate; + + log(">>> f_verifyGnSecuredMessageSignatureWithCertificate: p_securedMessage=", p_securedMessage); + log(">>> f_verifyGnSecuredMessageSignatureWithCertificate: p_certificate_id=", p_certificate_id); + log(">>> f_verifyGnSecuredMessageSignatureWithCertificate: p_certificate=", p_certificate); + if (f_getCertificateHash(valueof(p_certificate_id), v_issuer) == false) { + log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate id: " & p_certificate_id); + return false; + } if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { - var charstring v_certificate; - - if (fx_readCertificateFromDigest(valueof(p_certificate.issuer.sha256AndDigest), v_certificate) == false) { - log("f_verifyCertificateSignatureWithPublicKey: Invalid issuer: ", p_certificate.issuer.sha256AndDigest); - return false; - } - if (f_getCertificateHash(v_certificate, v_issuer) == false) { - log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate: " & v_certificate); - return false; - } return f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1(p_securedMessage, v_issuer, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1); } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature)) { - var charstring v_certificate; - - if (fx_readCertificateFromDigest(valueof(p_certificate.issuer.sha384AndDigest), v_certificate) == false) { - log("f_verifyCertificateSignatureWithPublicKey: Invalid issuer: ", p_certificate.issuer.sha384AndDigest); - return false; - } - if (f_getCertificateHash(v_certificate, v_issuer) == false) { - log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate: " & v_certificate); - return false; - } return f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1(p_securedMessage, v_issuer, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1); } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature)) { - var charstring v_certificate; - - if (fx_readCertificateFromDigest(valueof(p_certificate.issuer.sha256AndDigest), v_certificate) == false) { - log("f_verifyCertificateSignatureWithPublicKey: Invalid issuer: ", p_certificate.issuer.sha256AndDigest); - return false; - } - if (f_getCertificateHash(v_certificate, v_issuer) == false) { - log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate: " & v_certificate); - return false; - } return f_verifyGnSecuredMessageSignature_ecdsaNistP256(p_securedMessage, v_issuer, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256); } -- GitLab From 5be823f1a8fdd1ab14ae0c0e75f4c313d73bc0fc Mon Sep 17 00:00:00 2001 From: garciay Date: Sun, 10 Feb 2019 01:55:03 -0800 Subject: [PATCH 185/320] Bug fixed in AtsPki-ITSS --- ttcn/Pki/LibItsPki_Functions.ttcn | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 117fad62..d6db9bc7 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -172,7 +172,11 @@ module LibItsPki_Functions { } // End of function f_uninitialiseSecuredMode() function f_initializeState() runs on ItsPkiItss { - var Oct8 v_hashedId8ToBeUsed := f_setupIutCertificate(vc_hashedId8ToBeUsed); + var Oct8 v_hashedId8ToBeUsed; + + log(">>> f_initializeState: vc_hashedId8ToBeUsed= ", vc_hashedId8ToBeUsed); + v_hashedId8ToBeUsed := f_setupIutCertificate(vc_hashedId8ToBeUsed); + log("f_initializeState: v_hashedId8ToBeUsed= ", v_hashedId8ToBeUsed); f_utInitializeIut(UtPkiInitialize: { v_hashedId8ToBeUsed } ); -- GitLab From b1729a03676613e0233209066db2209f1cfdf853 Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 12 Feb 2019 11:41:53 -0800 Subject: [PATCH 186/320] Bug fixed in AtsSecurity --- ttcn/Pki/LibItsPki_Functions.ttcn | 476 ++++++++++++++---- ttcn/Security/LibItsSecurity_Functions.ttcn | 34 +- .../LibItsSecurity_TypesAndValues.ttcn | 8 +- 3 files changed, 417 insertions(+), 101 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index d6db9bc7..cdc96f29 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -37,6 +37,8 @@ module LibItsPki_Functions { import from LibItsCommon_Pixits all; // LibItsGeoNetworking + import from LibItsGeoNetworking_TypesAndValues all; + import from LibItsGeoNetworking_TestSystem all; import from LibItsGeoNetworking_Pixits all; // LibItsSecurity @@ -62,8 +64,20 @@ module LibItsPki_Functions { import from LibItsPki_TestSystem all; group pkiConfigurationFunctions { - - /** + + function f_cfMtcUp( + out ItsPkiItss p_itss, + out ItsPkiHttp p_pki + ) runs on ItsMtc { + p_itss := ItsPkiItss.create("IUT") alive; + p_pki := ItsPkiHttp.create("TS") alive; + + connect(self:syncPort, mtc:syncPort); + connect(p_itss:syncPort, self:syncPort); + connect(p_pki:syncPort, self:syncPort); + } + + /** * @desc Setups default configuration * @param p_certificate_id The certificate identifier the TA shall use in case of secured IUT */ @@ -72,7 +86,7 @@ module LibItsPki_Functions { in charstring p_aa_certificate_id := "CERT_TS_A_AA" ) runs on ItsPkiHttp /* TITAN TODO: system ItsPkiHttpSystem */ { - if (LibItsPki_Pics.PICS_MULTIPLE_END_POINT == false) { + if (PICS_MULTIPLE_END_POINT == false) { map(self:httpPort, system:httpPort); } else { map(self:httpEcPort, system:httpEcPort); @@ -85,21 +99,20 @@ module LibItsPki_Functions { // Setup EA certificate shared with PKI EA entity f_readCertificate(p_ea_certificate_id, vc_eaCertificate); - // f_readSigningKey(p_ea_certificate_id, vc_eaPrivateKey); // TODO To be removed - // f_readCertificate(p_aa_certificate_id, vc_ecCertificate); // TODO To be removed - // f_readSigningKey(p_aa_certificate_id, vc_ecPrivateKey); // TODO To be removed - // f_readEncryptingKey(p_ea_certificate_id, vc_eaPrivateEncKey); // TODO To be removed + f_readSigningKey(p_ea_certificate_id, vc_eaPrivateKey); // TODO To be removed + f_readEncryptingKey(p_ea_certificate_id, vc_eaPrivateEncKey); f_getCertificateDigest(p_ea_certificate_id, vc_eaHashedId8); f_getCertificateHash(p_ea_certificate_id, vc_eaWholeHash); + log("f_cfHttpUp: vc_eaPrivateKey= ", vc_eaPrivateKey); + log("f_cfHttpUp: vc_eaHashedId8= ", vc_eaHashedId8); + log("f_cfHttpUp: vc_eaWholeHash= ", vc_eaWholeHash); // Setup AA certificate shared with PKI AA entity f_readCertificate(p_aa_certificate_id, vc_aaCertificate); f_getCertificateDigest(p_aa_certificate_id, vc_aaHashedId8); f_getCertificateHash(p_aa_certificate_id, vc_aaWholeHash); - log("vc_aaHashedId8= ", vc_aaHashedId8); - log("vc_aaWholeHash= ", vc_aaWholeHash); - // f_readCertificate(p_peerCertificateId, vc_peerEaCertificate); // TODO To be removed - // f_getCertificateHash(p_peerCertificateId, vc_eaPeerWholeHash); // TODO To be removed + log("f_cfHttpUp: vc_aaHashedId8= ", vc_aaHashedId8); + log("f_cfHttpUp: vc_aaWholeHash= ", vc_aaWholeHash); if (PICS_MULTIPLE_END_POINT == false) { activate(a_default_pki_http()); @@ -123,6 +136,24 @@ module LibItsPki_Functions { // activate(a_default_pki()); TOTO Defualt from geoNet } // End of function f_cfUp_itss + /** + * @desc Deletes default configuration + */ + function f_cfMtcDown( + inout ItsPkiItss p_itss, + inout ItsPkiHttp p_pki + ) runs on ItsMtc { + p_itss := ItsPkiItss.create("IUT") alive; + p_pki := ItsPkiHttp.create("TS") alive; + + disconnect(self:syncPort, mtc:syncPort); + disconnect(p_itss:syncPort, self:syncPort); + disconnect(p_pki:syncPort, self:syncPort); + + p_itss.done; + p_pki.done; + } + /** * @desc Deletes default configuration */ @@ -285,7 +316,70 @@ module LibItsPki_Functions { } return ''O; - } + } // End of function f_signWithEcdsa + + function f_verifyEcdsa( + in octetstring p_tbs, + in octetstring p_issuer, + in Signature p_signature_, + in PublicVerificationKey p_verification_key + ) return boolean { + var boolean v_ret := false; + + log(" >>> f_verifyEcdsa"); + + if (ischosen(p_verification_key.ecdsaNistP256)) { + if (ischosen(p_verification_key.ecdsaNistP256.compressed_y_0)) { + v_ret := f_verifyWithEcdsaNistp256WithSha256( + p_tbs, + p_issuer, + p_signature_.ecdsaNistP256Signature.rSig.x_only & p_signature_.ecdsaNistP256Signature.sSig, + p_verification_key.ecdsaNistP256.compressed_y_0, + 0); + } else { + v_ret := f_verifyWithEcdsaNistp256WithSha256( + p_tbs, + p_issuer, + p_signature_.ecdsaNistP256Signature.rSig.x_only & p_signature_.ecdsaNistP256Signature.sSig, + p_verification_key.ecdsaNistP256.compressed_y_1, + 1); + } + } else if (ischosen(p_verification_key.ecdsaBrainpoolP256r1)) { + if (ischosen(p_verification_key.ecdsaBrainpoolP256r1.compressed_y_0)) { + v_ret := f_verifyWithEcdsaBrainpoolp256WithSha256( + p_tbs, + p_issuer, + p_signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only & p_signature_.ecdsaBrainpoolP256r1Signature.sSig, + p_verification_key.ecdsaBrainpoolP256r1.compressed_y_0, + 0); + } else { + v_ret := f_verifyWithEcdsaBrainpoolp256WithSha256( + p_tbs, + p_issuer, + p_signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only & p_signature_.ecdsaBrainpoolP256r1Signature.sSig, + p_verification_key.ecdsaBrainpoolP256r1.compressed_y_1, + 1); + } + } else if (ischosen(p_verification_key.ecdsaBrainpoolP384r1)) { + if (ischosen(p_verification_key.ecdsaBrainpoolP384r1.compressed_y_0)) { + v_ret := f_verifyWithEcdsaBrainpoolp384WithSha384( + p_tbs, + p_issuer, + p_signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only & p_signature_.ecdsaBrainpoolP384r1Signature.sSig, + p_verification_key.ecdsaBrainpoolP384r1.compressed_y_0, + 0); + } else { + v_ret := f_verifyWithEcdsaBrainpoolp384WithSha384( + p_tbs, + p_issuer, + p_signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only & p_signature_.ecdsaBrainpoolP384r1Signature.sSig, + p_verification_key.ecdsaBrainpoolP384r1.compressed_y_1, + 1); + } + } + + return v_ret; + } // End of function f_verifyEcdsa } // End of group helpers @@ -414,6 +508,80 @@ module LibItsPki_Functions { log("*** f_http_build_invalid_enrolment_request: DEBUG: p_ieee1609dot2_signed_and_encrypted_data = ", p_ieee1609dot2_signed_and_encrypted_data); } // End of function f_http_build_invalid_enrolment_request + function f_http_build_inner_ec_response( + in InnerEcRequest p_inner_ec_request, + in EnrolmentResponseCode p_responseCode := ok, + in Oct16 p_request_hash, + in Oct32 p_private_key, + in HashedId8 p_hashed_id8, + in Oct16 p_aes_sym_key, + out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data + ) return boolean { + // Local variables + var bitstring v_msg_bit; + var octetstring v_msg; + var Oct12 v_nonce; + var Ieee1609Dot2Data v_ieee1609dot2_signed_data; + var InnerEcResponse v_inner_ec_response; + var EtsiTs103097Certificate v_ec_certificate; + var boolean p_result := false; + + log(">>> f_http_build_inner_ec_response"); + + // Check expectred response + if (p_responseCode != ok) { + v_inner_ec_response := valueof( + m_innerEcResponse_ko( + p_request_hash, + p_responseCode + ) + ); + p_result := true; + } else { + // Generate the certificate + if (f_generate_ec_certificate_for_inner_ec_response(p_inner_ec_request, v_ec_certificate) == false) { + log("f_http_build_inner_ec_response: Failed to generate the certificate"); + v_inner_ec_response := valueof( + m_innerEcResponse_ko( + p_request_hash, + incompleterequest + ) + ); + } else { + v_inner_ec_response := valueof( + m_innerEcResponse_ok( + p_request_hash, + v_ec_certificate + ) + ); + } + } + + // Secure the response + log("f_http_build_inner_ec_response: v_inner_ec_response= ", v_inner_ec_response); + v_msg := bit2oct(encvalue(v_inner_ec_response)); + v_nonce := int2oct(f_getCurrentTime(), 32); // Random value + if (f_build_pki_secured_response_message(p_private_key, + valueof(m_signerIdentifier_digest(p_hashed_id8)),// in SignerIdentifier p_signer_identifier, + v_msg, + p_aes_sym_key, + v_nonce, + p_ieee1609dot2_signed_and_encrypted_data + ) == false) { + log("f_http_build_inner_ec_response: Failed to generate the certificate"); + v_inner_ec_response := valueof( + m_innerEcResponse_ko( + p_request_hash, + deniedrequest + ) + ); + } else { + p_result := true; + } + + return p_result; + } // End of function f_http_build_inner_ec_response + function f_http_build_authorization_request( in Certificate p_ec_certificate, // Enrolment credentials certificate in octetstring p_ec_private_key, @@ -641,6 +809,58 @@ module LibItsPki_Functions { return true; } // End of function f_generate_ec_certificate + function f_generate_ec_certificate_for_inner_ec_response( + in InnerEcRequest p_inner_ec_request, + out EtsiTs103097Certificate p_ec_certificate + ) return boolean { + /*v_cert := m_etsiTs103097Certificate( + m_issuerIdentifier_sha256AndDigest(f_HashedId8FromSha256(f_hashWithSha256('616263'O))), + m_toBeSignedCertificate_at( + v_appPermissions, + m_verificationKeyIndicator_verificationKey( + v_public_verification_key + ), + m_validityPeriod( + f_getCurrentTime() / 1000, + m_duration_years(1) + ), + m_geographicRegion_identifiedRegion( + { + m_identifiedRegion_country_only(12), + m_identifiedRegion_country_only(34) + } + ) + ) + ); + // Encode it ==> Get octetstring + v_tbs := encvalue(v_cert.toBeSigned); + // Sign the certificate + v_sig := f_signWithEcdsa(bit2oct(v_tbs), int2oct(11, 32), p_private_key); + if ((PX_VE_ALG == e_nist_p256) or (PX_VE_ALG == e_brainpool_p256_r1)) { + v_cert.signature_ := m_signature_ecdsaNistP256( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only( + substr(v_sig, 0, 32) + ), + substr(v_sig, 32, 32) + ) + ); + } else if (PX_VE_ALG == e_brainpool_p384_r1) { + v_cert.signature_ := m_signature_ecdsaBrainpoolP384r1( + m_ecdsaP384Signature( + m_eccP384CurvePoint_x_only( + substr(v_sig, 0, 48) + ), + substr(v_sig, 48, 48) + ) + ); + } + log("f_generate_ec_certificate_for_inner_ec_response: v_cert= ", v_cert); + + p_ec_certificate := valueof(v_cert);*/ + return true; + } // End of function f_generate_ec_certificate_for_inner_ec_response + function f_generate_at_certificate( in octetstring p_private_key, in InnerEcRequest p_inner_ec_request, @@ -854,6 +1074,29 @@ module LibItsPki_Functions { log("<<< f_generate_inner_ec_request_signed_for_pop: p_inner_ec_request_signed_for_pop= ", p_inner_ec_request_signed_for_pop); return true; } // End of function f_generate_inner_ec_request_signed_for_pop + + function f_verify_inner_ec_request_signed_for_pop( + in EtsiTs102941Data p_etsi_ts_102941_data, + out InnerEcRequest p_inner_ec_request + ) return boolean { + var bitstring v_msg_bit; + + log(">>> f_verify_inner_ec_request_signed_for_pop: ", p_etsi_ts_102941_data); + + // 1. Decode content + v_msg_bit := oct2bit(p_etsi_ts_102941_data.content.enrolmentRequest.content.signedData.tbsData.payload.data.content.unsecuredData); + if (decvalue(v_msg_bit, p_inner_ec_request) != 0) { + log("f_verify_inner_ec_request_signed_for_pop: Failed to decode InnerEcRequest"); + return false; + } else { + log("f_verify_inner_ec_request_signed_for_pop: v_inner_ec_request= ", p_inner_ec_request); + + // 2. Verify the InnerEcRequestSignedForPop signature + + } + + return true; + } // End of function f_verify_inner_ec_request_signed_for_pop function f_generate_inner_ec_response( in octetstring p_inner_ec_request_hash, @@ -1287,7 +1530,7 @@ module LibItsPki_Functions { ))))))) -> value v_response { tc_ac.stop; - if (f_verify_pki_message(p_private_key, v_aes_sym_key, v_authentication_vector, vc_eaWholeHash, vc_eaCertificate, v_response.response.body.binary_body.ieee1609dot2_data, false, v_etsi_ts_102941_data) == false) { + if (f_verify_pki_response_message(p_private_key, v_aes_sym_key, v_authentication_vector, vc_eaWholeHash, v_response.response.body.binary_body.ieee1609dot2_data, false, v_etsi_ts_102941_data) == false) { log("f_await_http_inner_ec_request_response: Failed to verify PKI message ***"); } else { log("f_await_http_inner_ec_request_response: Receive ", v_etsi_ts_102941_data, " ***"); @@ -1320,7 +1563,7 @@ module LibItsPki_Functions { ))))))) -> value v_response { tc_ac.stop; - if (f_verify_pki_message(p_private_key, v_aes_sym_key, v_authentication_vector, vc_eaWholeHash, vc_eaCertificate, v_response.response.body.binary_body.ieee1609dot2_data, false, v_etsi_ts_102941_data) == false) { + if (f_verify_pki_response_message(p_private_key, v_aes_sym_key, v_authentication_vector, vc_eaWholeHash, v_response.response.body.binary_body.ieee1609dot2_data, false, v_etsi_ts_102941_data) == false) { log("f_await_http_inner_ec_request_response: Failed to verify PKI message ***"); } else { log("f_await_http_inner_ec_request_response: Receive ", v_etsi_ts_102941_data, " ***"); @@ -1746,6 +1989,101 @@ module LibItsPki_Functions { return true; } // End of function f_build_pki_secured_response_message + /** + * @desc Verify the protocol element of the Pki message. + * If p_check_security is set to false, only decryption and decoding of the outer message are verified. + * @param p_private_enc_key Private key for decryption + * @param p_salt + * @param p_p_ieee1609dot2_encrypted_and_signed_data + * @param p_check_security Set to true to verify PKI protocol element such as signatures... + * @param p_request_hash The request hash for to be used to build the response + * @param p_etsi_ts_102941_data The EtsiTs102941Data message + * @param p_aes_enc_key The AES 128 encrytion key to be used to encrypt the response + * @return true on success, false otherwise + */ + function f_verify_pki_request_message( + in Oct32 p_private_enc_key, + in Oct32 p_salt, + in octetstring p_issuer, + in Ieee1609Dot2Data p_ieee1609dot2_encrypted_and_signed_data, + in boolean p_check_security := true, + out Oct16 p_request_hash, + out EtsiTs102941Data p_etsi_ts_102941_data, + out Oct16 p_aes_enc_key + ) return boolean { + // Local variables + var bitstring v_msg_bit; + var octetstring v_msg; + var Ieee1609Dot2Data v_ieee1609dot2_signed_data; + var Certificate v_certificate; + + log(">>> f_verify_pki_request_message: p_private_enc_key= ", p_private_enc_key); + log(">>> f_verify_pki_request_message: p_salt= ", p_salt); + log(">>> f_verify_pki_request_message: p_issuer= ", p_issuer); + + // 1. Calculate the request Hash + v_msg := bit2oct(encvalue(p_ieee1609dot2_encrypted_and_signed_data)); + log("f_verify_pki_request_message: Encoded request: ", v_msg); + p_request_hash := substr(f_hashWithSha256(v_msg), 0, 16); + log("f_verify_pki_request_message: v_request_hash= ", p_request_hash); + + // 2. Decrypt the InnerEcRequest + log("f_verify_pki_request_message: p_private_enc_key= ", p_private_enc_key); + if (f_decrypt(p_private_enc_key, p_ieee1609dot2_encrypted_and_signed_data, p_salt, v_ieee1609dot2_signed_data, p_aes_enc_key) == false) { + log("f_verify_pki_request_message: Failed to decrypt message"); + return false; + } + log("f_verify_pki_request_message: v_ieee1609dot2_signed_data= ", v_ieee1609dot2_signed_data); + log("f_verify_pki_request_message: p_aes_enc_key= ", p_aes_enc_key); + + // 3. Check basics security + log( + match( + v_ieee1609dot2_signed_data, + mw_etsiTs103097Data_signed( + mw_signedData( + -, + mw_toBeSignedData( + mw_signedDataPayload, + mw_ieee1609Dot2_headerInfo(c_its_aid_SCR) + ) + ) + ))); + if (match(v_ieee1609dot2_signed_data, mw_etsiTs103097Data_signed(mw_signedData(-, mw_toBeSignedData(mw_signedDataPayload)))) == false) { + log("f_verify_pki_request_message: Failed to check basic security"); + if (p_check_security == true) { + return false; + } + } + + // 4. Verifiy signature + log("f_verify_pki_request_message: v_ieee1609dot2_signed_data.content.signedData.tbsData= ", v_ieee1609dot2_signed_data.content.signedData.tbsData); + v_msg := bit2oct(encvalue(v_ieee1609dot2_signed_data.content.signedData.tbsData)); + if (f_getCertificateFromDigest(f_HashedId8FromSha256(p_issuer), v_certificate) == false) { + return false; + } + log("f_verify_pki_request_message: v_certificate= ", v_certificate); + if (f_verifyEcdsa(v_msg, p_issuer, v_ieee1609dot2_signed_data.content.signedData.signature_, v_certificate.toBeSigned.verifyKeyIndicator.verificationKey) == false) { + if (p_check_security == true) { + return false; + } + } + + // 4. Return the PKI message + log("f_verify_pki_request_message: v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData= ", v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); + v_msg_bit := oct2bit(v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); + if (decvalue(v_msg_bit, p_etsi_ts_102941_data) != 0) { + return false; + } + + if (p_etsi_ts_102941_data.version != PkiProtocolVersion) { + return false; + } + + log("<<< f_verify_pki_request_message: true"); + return true; + } // End of function f_verify_pki_request_message + /** * @desc Verify the protocol element of the Pki message. * If p_check_security is set to false, only decryption and decoding of the outer message are verified. @@ -1759,16 +2097,15 @@ module LibItsPki_Functions { * @param p_etsi_ts_102941_data The EtsiTs102941Data message * @return true on success, false otherwise */ - function f_verify_pki_message( - in octetstring p_private_enc_key, - in Oct16 p_aes_sym_key, - in Oct16 p_authentication_vector, // TODO Tobe removed - in octetstring p_issuer, - in Certificate p_certificate, // TODO Tobe removed - in Ieee1609Dot2Data p_ieee1609dot2_encrypted_and_signed_data, - in boolean p_check_security := true, - out EtsiTs102941Data p_etsi_ts_102941_data - ) return boolean { + function f_verify_pki_response_message( + in octetstring p_private_enc_key, + in Oct16 p_aes_sym_key, + in Oct16 p_authentication_vector, // TODO Tobe removed + in octetstring p_issuer, + in Ieee1609Dot2Data p_ieee1609dot2_encrypted_and_signed_data, + in boolean p_check_security := true, + out EtsiTs102941Data p_etsi_ts_102941_data + ) return boolean { // Local variables var octetstring v_public_enc_key; var integer v_compressed_enc_key_mode; @@ -1779,10 +2116,10 @@ module LibItsPki_Functions { var bitstring v_tbs; var boolean v_ret; - log(">>> f_verify_pki_message: p_private_enc_key= ", p_private_enc_key); - log(">>> f_verify_pki_message: p_aes_sym_key= ", p_aes_sym_key); - log(">>> f_verify_pki_message: p_authentication_vector= ", p_authentication_vector); - log(">>> f_verify_pki_message: p_issuer= ", p_issuer); + log(">>> f_verify_pki_response_message: p_private_enc_key= ", p_private_enc_key); + log(">>> f_verify_pki_response_message: p_aes_sym_key= ", p_aes_sym_key); + log(">>> f_verify_pki_response_message: p_authentication_vector= ", p_authentication_vector); + log(">>> f_verify_pki_response_message: p_issuer= ", p_issuer); // TODO Check p_ieee1609dot2_encrypted_and_signed_data.content.encryptedData.recipients[0].pskRecipInfo. See IEEE Std 1609.2-2017 Clause 6.3.34 PreSharedKeyRecipientInfo @@ -1791,95 +2128,42 @@ module LibItsPki_Functions { if (isbound(v_plain_message) == false) { return false; } - log("f_verify_pki_message: v_plain_message= ", v_plain_message); + log("f_verify_pki_response_message: v_plain_message= ", v_plain_message); // 2. Decode it v_tbs := oct2bit(v_plain_message); if (decvalue(v_tbs, v_ieee1609dot2_signed_data) != 0) { return false; } - log("f_verify_pki_message: v_ieee1609dot2_signed_data= ", v_ieee1609dot2_signed_data); + log("f_verify_pki_response_message: v_ieee1609dot2_signed_data= ", v_ieee1609dot2_signed_data); // 3. Check the signature - log("f_verify_pki_message: v_ieee1609dot2_signed_data.content.signedData.tbsData= ", v_ieee1609dot2_signed_data.content.signedData.tbsData); + log("f_verify_pki_response_message: v_ieee1609dot2_signed_data.content.signedData.tbsData= ", v_ieee1609dot2_signed_data.content.signedData.tbsData); v_tbs := encvalue(v_ieee1609dot2_signed_data.content.signedData.tbsData); if (f_getCertificateFromDigest(v_ieee1609dot2_signed_data.content.signedData.signer.digest, v_certificate) == false) { if (p_check_security == true) { return false; } } - //log("f_verify_pki_message: v_certificate= ", v_certificate); - v_ret := false; - if (ischosen(v_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256)) { - if (ischosen(v_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256.compressed_y_0)) { - v_ret := f_verifyWithEcdsaNistp256WithSha256( - bit2oct(v_tbs), - p_issuer, - v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaNistP256Signature.rSig.x_only & v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaNistP256Signature.sSig, - v_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256.compressed_y_0, - 0); - } else { - v_ret := f_verifyWithEcdsaNistp256WithSha256( - bit2oct(v_tbs), - p_issuer, - v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaNistP256Signature.rSig.x_only & v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaNistP256Signature.sSig, - v_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256.compressed_y_1, - 1); - } - } else if (ischosen(v_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1)) { - if (ischosen(v_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1.compressed_y_0)) { - v_ret := f_verifyWithEcdsaBrainpoolp256WithSha256( - bit2oct(v_tbs), - p_issuer, - v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only & v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig, - v_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1.compressed_y_0, - 0); - } else { - v_ret := f_verifyWithEcdsaBrainpoolp256WithSha256( - bit2oct(v_tbs), - p_issuer, - v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only & v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig, - v_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1.compressed_y_1, - 1); - } - } else if (ischosen(v_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1)) { - if (ischosen(v_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1.compressed_y_0)) { - v_ret := f_verifyWithEcdsaBrainpoolp384WithSha384( - bit2oct(v_tbs), - p_issuer, - v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only & v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig, - v_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1.compressed_y_0, - 0); - } else { - v_ret := f_verifyWithEcdsaBrainpoolp384WithSha384( - bit2oct(v_tbs), - p_issuer, - v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only & v_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig, - v_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1.compressed_y_1, - 1); - } - } - if (v_ret == false) { + if (f_verifyEcdsa(bit2oct(v_tbs), p_issuer, v_ieee1609dot2_signed_data.content.signedData.signature_, v_certificate.toBeSigned.verifyKeyIndicator.verificationKey) == false) { if (p_check_security == true) { return false; } } // 4. Return the PKI message - log("v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData= ", v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); + log("f_verify_pki_response_message: v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData= ", v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); v_etsi_ts_102941_data_msg := oct2bit(v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); if (decvalue(v_etsi_ts_102941_data_msg, p_etsi_ts_102941_data) != 0) { return false; } if (p_etsi_ts_102941_data.version != PkiProtocolVersion) { - if (p_check_security == true) { - return false; - } + return false; } return true; - } // End of function f_verify_pki_message + } // End of function f_verify_pki_response_message /** * @desc Verify the EC certificate generated by the EA entity @@ -2027,6 +2311,10 @@ module LibItsPki_Functions { log("*** a_default: ERROR: Unexpected HTTP message received ***"); f_selfOrClientSyncAndVerdict("error", e_error); } + [] a_shutdown() { + log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } } // End of altstep a_default_pki_http altstep a_default_pki_http_ec() runs on ItsPkiHttp { @@ -2054,6 +2342,10 @@ module LibItsPki_Functions { log("*** a_default: ERROR: Unexpected HTTP message received ***"); f_selfOrClientSyncAndVerdict("error", e_error); } + [] a_shutdown() { + log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } } // End of altstep a_default_pki_http_ec altstep a_default_pki_http_atv() runs on ItsPkiHttp { @@ -2081,6 +2373,10 @@ module LibItsPki_Functions { log("*** a_default: ERROR: Unexpected HTTP message received ***"); f_selfOrClientSyncAndVerdict("error", e_error); } + [] a_shutdown() { + log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } } // End of altstep a_default_pki_http_atv altstep a_default_pki_http_at() runs on ItsPkiHttp { @@ -2108,6 +2404,10 @@ module LibItsPki_Functions { log("*** a_default: ERROR: Unexpected HTTP message received ***"); f_selfOrClientSyncAndVerdict("error", e_error); } + [] a_shutdown() { + log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } } // End of altstep a_default_pki_http_at } // End of group altsteps diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 5b59b9f0..3066698e 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -119,7 +119,8 @@ module LibItsSecurity_Functions { in octetstring p_encryptPrivateKey, in EtsiTs103097Data p_encrypedSecuredMessage, in octetstring p_salt, - out EtsiTs103097Data p_decrypedSecuredMessage + out EtsiTs103097Data p_decrypedSecuredMessage, + out octetstring p_aes_sym_enc_key ) return boolean { if (ischosen(p_encrypedSecuredMessage.content.encryptedData)) { var PKRecipientInfo v_pKRecipientInfo; @@ -155,7 +156,8 @@ module LibItsSecurity_Functions { v_pKRecipientInfo.encKey.eciesNistP256.c, v_pKRecipientInfo.encKey.eciesNistP256.t, v_ciphertext.aes128ccm.nonce, - p_salt + p_salt, + p_aes_sym_enc_key ); } else if (ischosen(v_pKRecipientInfo.encKey.eciesNistP256.v.compressed_y_1)) { v_decryptedSecuredMessage := f_decryptWithEciesNistp256WithSha256( @@ -166,7 +168,8 @@ module LibItsSecurity_Functions { v_pKRecipientInfo.encKey.eciesNistP256.c, v_pKRecipientInfo.encKey.eciesNistP256.t, v_ciphertext.aes128ccm.nonce, - p_salt + p_salt, + p_aes_sym_enc_key ); } else { log("*** " & testcasename() & ":ERROR: Non canonical ephemeral encryption keys ***"); @@ -190,7 +193,8 @@ module LibItsSecurity_Functions { 0, v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.c, v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.t, - v_ciphertext.aes128ccm.nonce + v_ciphertext.aes128ccm.nonce, + p_salt, p_aes_sym_enc_key ); } else if (ischosen(v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.compressed_y_1)) { v_decryptedSecuredMessage := f_decryptWithEciesBrainpoolp256WithSha256( @@ -200,7 +204,9 @@ module LibItsSecurity_Functions { 1, v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.c, v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.t, - v_ciphertext.aes128ccm.nonce + v_ciphertext.aes128ccm.nonce, + p_salt, + p_aes_sym_enc_key ); } else { log("*** " & testcasename() & ":ERROR: Non canonical ephemeral encryption keys ***"); @@ -294,7 +300,8 @@ module LibItsSecurity_Functions { in Oct16 p_encrypted_sym_key, in Oct16 p_authentication_vector, in Oct12 p_nonce, - in octetstring p_salt + in Oct32 p_salt, + out Oct16 p_aes_sym_enc_key ) return octetstring { return fx_decryptWithEciesNistp256WithSha256( p_encryptedSecuredMessage, @@ -304,7 +311,8 @@ module LibItsSecurity_Functions { p_encrypted_sym_key, p_authentication_vector, p_nonce, - p_salt + p_salt, + p_aes_sym_enc_key ); } // End of function f_decryptWithEcdsaNistp256WithSha256 @@ -371,7 +379,9 @@ module LibItsSecurity_Functions { in integer p_ephemeralKeyModeCompressed, in Oct16 p_encrypted_sym_key, in Oct16 p_authentication_vector, - in Oct12 p_nonce + in Oct12 p_nonce, + in Oct32 p_salt, + out Oct16 p_aes_sym_enc_key ) return octetstring { return fx_decryptWithEciesBrainpoolp256WithSha256( p_encryptedSecuredMessage, @@ -380,7 +390,9 @@ module LibItsSecurity_Functions { p_ephemeralKeyModeCompressed, p_encrypted_sym_key, p_authentication_vector, - p_nonce + p_nonce, + p_salt, + p_aes_sym_enc_key ); } // End of function f_decryptWithEcdsaBrainpoolp256WithSha256 @@ -2374,7 +2386,7 @@ module LibItsSecurity_Functions { * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption * @return The decrypted message */ - external function fx_decryptWithEciesNistp256WithSha256(in octetstring p_encryptedSecuredMessage, in Oct32 p_privateEncKey, in Oct32 p_publicEphemeralKeyCompressed, in integer p_ephemeralKeyModeCompressed, in Oct16 p_encrypted_sym_key, in Oct16 p_authentication_vector, in Oct12 p_nonce, in octetstring p_salt) return octetstring; + external function fx_decryptWithEciesNistp256WithSha256(in octetstring p_encryptedSecuredMessage, in Oct32 p_privateEncKey, in Oct32 p_publicEphemeralKeyCompressed, in integer p_ephemeralKeyModeCompressed, in Oct16 p_encrypted_sym_key, in Oct16 p_authentication_vector, in Oct12 p_nonce, in Oct32 p_salt, out Oct16 p_aes_sym_enc_key) return octetstring; /** * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption using Brainpool-P256 algorithm @@ -2402,7 +2414,7 @@ module LibItsSecurity_Functions { * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption * @return The decrypted message */ - external function fx_decryptWithEciesBrainpoolp256WithSha256(in octetstring p_encryptedSecuredMessage, in Oct32 p_privateEncKey, in Oct32 p_publicEphemeralKeyCompressed, in integer p_ephemeralKeyModeCompressed, in Oct16 p_encrypted_sym_key, in Oct16 p_authentication_vector, in Oct12 p_nonce) return octetstring; + external function fx_decryptWithEciesBrainpoolp256WithSha256(in octetstring p_encryptedSecuredMessage, in Oct32 p_privateEncKey, in Oct32 p_publicEphemeralKeyCompressed, in integer p_ephemeralKeyModeCompressed, in Oct16 p_encrypted_sym_key, in Oct16 p_authentication_vector, in Oct12 p_nonce, in Oct32 p_salt, out Oct16 p_aes_sym_enc_key) return octetstring; /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature diff --git a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn index 3072a013..345d14f0 100644 --- a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn +++ b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn @@ -22,11 +22,15 @@ module LibItsSecurity_TypesAndValues { // Test Adapter certificates & private keys - Valid behavior const charstring cc_taCert_A := "CERT_TS_A_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_A1 := "CERT_TS_A_1_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_A1 := "CERT_TS_A_A1_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_A2 := "CERT_TS_A_A2_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_A3 := "CERT_TS_A_A3_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_B := "CERT_TS_B_AT"; /** Default certificate, with circular region, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_B1 := "CERT_TS_B_1_AT"; const charstring cc_taCert_B_AA := "CERT_TS_B_1_AA"; const charstring cc_taCert_C := "CERT_TS_C_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_C1 := "CERT_TS_C1_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_CA1 := "CERT_TS_CA1_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_D := "CERT_TS_D_AT"; /** Certificate with a polygonal region, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_E := "CERT_TS_E_AT"; /** Certificate with a region identifier, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_F := "CERT_TS_F_AT"; /** Certificate that can be used as an unknown certificate for IUT. */ @@ -128,8 +132,8 @@ module LibItsSecurity_TypesAndValues { const charstring cc_taCert1901_BO := "CERT_TS_19_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the reserved region type has been used in region validity restriction of the AT certificate */ // IUT certificates & private keys - const charstring cc_taCert_CA1 := "CERT_IUT_CA1_AT"; const charstring cc_taCert_CA2 := "CERT_IUT_CA2_AT"; + const charstring cc_taCert_CA3 := "CERT_IUT_CA3_AT"; const charstring cc_taCert_CC_AA := "CERT_IUT_CC_AA"; const charstring cc_iutCert_A := "CERT_IUT_A_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ const charstring cc_iutCert_B := "CERT_IUT_B_AT"; /** Default certificate, with circular region, to be used when secured messages are sent from TA to IUT */ -- GitLab From 467ea0b72dbef25dc1a8ce0c938f77442a7fdf4d Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 13 Feb 2019 09:04:00 -0800 Subject: [PATCH 187/320] Validate Authorization/AuthorizationValidation --- ttcn/Pki/LibItsPki_Functions.ttcn | 283 +++++++++++++++----- ttcn/Security/LibItsSecurity_Templates.ttcn | 30 ++- 2 files changed, 238 insertions(+), 75 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index cdc96f29..917d0ebc 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -104,6 +104,7 @@ module LibItsPki_Functions { f_getCertificateDigest(p_ea_certificate_id, vc_eaHashedId8); f_getCertificateHash(p_ea_certificate_id, vc_eaWholeHash); log("f_cfHttpUp: vc_eaPrivateKey= ", vc_eaPrivateKey); + log("f_cfHttpUp: vc_eaPrivateEncKey= ", vc_eaPrivateEncKey); log("f_cfHttpUp: vc_eaHashedId8= ", vc_eaHashedId8); log("f_cfHttpUp: vc_eaWholeHash= ", vc_eaWholeHash); @@ -512,8 +513,8 @@ module LibItsPki_Functions { in InnerEcRequest p_inner_ec_request, in EnrolmentResponseCode p_responseCode := ok, in Oct16 p_request_hash, - in Oct32 p_private_key, - in HashedId8 p_hashed_id8, + in octetstring p_private_key := ''O, + in octetstring p_digest := ''O, in Oct16 p_aes_sym_key, out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data ) return boolean { @@ -526,7 +527,12 @@ module LibItsPki_Functions { var EtsiTs103097Certificate v_ec_certificate; var boolean p_result := false; - log(">>> f_http_build_inner_ec_response"); + log(">>> f_http_build_inner_ec_response: p_inner_ec_request= ", p_inner_ec_request); + log(">>> f_http_build_inner_ec_response: p_responseCode= ", p_responseCode); + log(">>> f_http_build_inner_ec_response: p_request_hash= ", p_request_hash); + log(">>> f_http_build_inner_ec_response: p_private_key= ", p_private_key); + log(">>> f_http_build_inner_ec_response: p_digest= ", p_digest); + log(">>> f_http_build_inner_ec_response: p_aes_sym_key= ", p_aes_sym_key); // Check expectred response if (p_responseCode != ok) { @@ -539,7 +545,7 @@ module LibItsPki_Functions { p_result := true; } else { // Generate the certificate - if (f_generate_ec_certificate_for_inner_ec_response(p_inner_ec_request, v_ec_certificate) == false) { + if (f_generate_ec_certificate_for_inner_ec_response(p_inner_ec_request, p_private_key, p_digest, v_ec_certificate) == false) { log("f_http_build_inner_ec_response: Failed to generate the certificate"); v_inner_ec_response := valueof( m_innerEcResponse_ko( @@ -561,8 +567,9 @@ module LibItsPki_Functions { log("f_http_build_inner_ec_response: v_inner_ec_response= ", v_inner_ec_response); v_msg := bit2oct(encvalue(v_inner_ec_response)); v_nonce := int2oct(f_getCurrentTime(), 32); // Random value + // TODO Consider Sha384: m_signerIdentifier_digest(f_HashedId8FromSha384(p_digest)) if (f_build_pki_secured_response_message(p_private_key, - valueof(m_signerIdentifier_digest(p_hashed_id8)),// in SignerIdentifier p_signer_identifier, + valueof(m_signerIdentifier_digest(f_HashedId8FromSha256(p_digest))),// in SignerIdentifier p_signer_identifier, v_msg, p_aes_sym_key, v_nonce, @@ -639,7 +646,7 @@ module LibItsPki_Functions { } } else { // Only encryption of EtsiTs102941Data/InnerAtRequest log("*** f_http_build_authorization_request: POP signature not applied"); - if(f_build_pki_secured_request_message(vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { + if(f_build_pki_secured_request_message_for_authorization(vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { log("*** f_http_build_authorization_request: ERROR: Failed to generate Authorization Request ***"); f_selfOrClientSyncAndVerdict("error", e_error); } @@ -695,17 +702,9 @@ module LibItsPki_Functions { log("*** f_http_build_authorization_validation_request: Public encryption key comp: ", v_compressed_enc_key_mode); p_salt := vc_eaWholeHash; log("*** f_http_build_authorization_validation_request: p_salt: ", p_salt); - if (PX_AUTHORIZATION_REQUEST_WITH_POP) { - if(f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_validation_request(v_authorization_validation_request))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { - log("*** f_http_build_authorization_validation_request: ERROR: Failed to generate Authorization Request ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - } else { // Only encryption of EtsiTs102941Data/InnerAtRequest - log("*** f_http_build_authorization_validation_request: POP signature not applied"); - if(f_build_pki_secured_request_message(vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_validation_request(v_authorization_validation_request))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { - log("*** f_http_build_authorization_validation_request: ERROR: Failed to generate Authorization Request ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } + if(f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_validation_request(v_authorization_validation_request))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { + log("*** f_http_build_authorization_validation_request: ERROR: Failed to generate Authorization Request ***"); + f_selfOrClientSyncAndVerdict("error", e_error); } log("*** f_http_build_authorization_validation_request: DEBUG: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); log("*** f_http_build_authorization_validation_request: DEBUG: p_request_hash= ", p_request_hash); @@ -811,53 +810,75 @@ module LibItsPki_Functions { function f_generate_ec_certificate_for_inner_ec_response( in InnerEcRequest p_inner_ec_request, + in octetstring p_private_key, + in octetstring p_digest, out EtsiTs103097Certificate p_ec_certificate ) return boolean { - /*v_cert := m_etsiTs103097Certificate( - m_issuerIdentifier_sha256AndDigest(f_HashedId8FromSha256(f_hashWithSha256('616263'O))), - m_toBeSignedCertificate_at( - v_appPermissions, - m_verificationKeyIndicator_verificationKey( - v_public_verification_key - ), - m_validityPeriod( - f_getCurrentTime() / 1000, - m_duration_years(1) - ), - m_geographicRegion_identifiedRegion( - { - m_identifiedRegion_country_only(12), - m_identifiedRegion_country_only(34) - } - ) - ) - ); + var EtsiTs103097Certificate v_cert; + var IssuerIdentifier v_issuer; + var bitstring v_tbs; + var octetstring v_sig; + + log(">>> f_generate_ec_certificate_for_inner_ec_response"); + + v_issuer := valueof(m_issuerIdentifier_sha256AndDigest(f_HashedId8FromSha256(p_digest))); // TODO Check sha256/384 f_HashedId8FromSha384 + v_cert := valueof( + m_etsiTs103097Certificate( + v_issuer, + m_toBeSignedCertificate_ec( + p_inner_ec_request.requestedSubjectAttributes.id, + p_inner_ec_request.requestedSubjectAttributes.appPermissions, + m_verificationKeyIndicator_verificationKey( + p_inner_ec_request.publicKeys.verificationKey + ), + p_inner_ec_request.requestedSubjectAttributes.validityPeriod, + p_inner_ec_request.requestedSubjectAttributes.region, + p_inner_ec_request.requestedSubjectAttributes.assuranceLevel, + p_inner_ec_request.publicKeys.encryptionKey + ) + ) + ); // Encode it ==> Get octetstring v_tbs := encvalue(v_cert.toBeSigned); // Sign the certificate - v_sig := f_signWithEcdsa(bit2oct(v_tbs), int2oct(11, 32), p_private_key); - if ((PX_VE_ALG == e_nist_p256) or (PX_VE_ALG == e_brainpool_p256_r1)) { - v_cert.signature_ := m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_sig, 0, 32) - ), - substr(v_sig, 32, 32) - ) - ); + v_sig := f_signWithEcdsa(bit2oct(v_tbs), p_digest, p_private_key); + if (PX_VE_ALG == e_nist_p256) { + v_cert.signature_ := valueof( + m_signature_ecdsaNistP256( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only( + substr(v_sig, 0, 32) + ), + substr(v_sig, 32, 32) + ) + ) + ); + } else if (PX_VE_ALG == e_brainpool_p256_r1) { + v_cert.signature_ := valueof( + m_signature_ecdsaBrainpoolP256r1( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only( + substr(v_sig, 0, 32) + ), + substr(v_sig, 32, 32) + ) + ) + ); } else if (PX_VE_ALG == e_brainpool_p384_r1) { - v_cert.signature_ := m_signature_ecdsaBrainpoolP384r1( - m_ecdsaP384Signature( - m_eccP384CurvePoint_x_only( - substr(v_sig, 0, 48) - ), - substr(v_sig, 48, 48) - ) - ); + v_cert.signature_ := valueof( + m_signature_ecdsaBrainpoolP384r1( + m_ecdsaP384Signature( + m_eccP384CurvePoint_x_only( + substr(v_sig, 0, 48) + ), + substr(v_sig, 48, 48) + ) + ) + ); } - log("f_generate_ec_certificate_for_inner_ec_response: v_cert= ", v_cert); + p_ec_certificate := valueof(v_cert); + log("f_generate_ec_certificate_for_inner_ec_response: p_ec_certificate= ", p_ec_certificate); - p_ec_certificate := valueof(v_cert);*/ return true; } // End of function f_generate_ec_certificate_for_inner_ec_response @@ -1149,7 +1170,7 @@ module LibItsPki_Functions { var octetstring v_hash_shared_at_request; var template (value) ToBeSignedData v_tbs; var octetstring v_tbs_signed; - var Ieee1609Dot2Data v_signed_ec_signature; + var Ieee1609Dot2Data v_signed_at_signature; var template (value) EccP256CurvePoint v_eccP256_curve_point; var template (value) EccP256CurvePoint v_enc_eccP256_curve_point; var HashAlgorithm v_hashId; @@ -1204,7 +1225,7 @@ module LibItsPki_Functions { valueof( m_certificate_subject_attributes( // FIXME Review subjectPermissions p_ec_certificate.toBeSigned.appPermissions, - { { subjectPermissions := { all_ := NULL }, minChainLength := 1, chainLengthRange := 0, eeType := '00000000'B } }, + p_ec_certificate.toBeSigned.certRequestPermissions, p_ec_certificate.toBeSigned.id, p_ec_certificate.toBeSigned.validityPeriod, p_ec_certificate.toBeSigned.region, @@ -1224,7 +1245,7 @@ module LibItsPki_Functions { ); log("f_generate_inner_at_request: v_tbs= ", v_tbs); // Signed ToBeSigned payload using the private key of EC certificate obtained from Enrolment request - // In case of ITS-S privacy, v_signed_ec_signature contained the data to be encrypted + // In case of ITS-S privacy, v_signed_at_signature contained the data to be encrypted if (ischosen(p_ec_certificate.signature_.ecdsaBrainpoolP384r1Signature)) { v_hashId := sha384; v_tbs_signed := f_signWithEcdsaBrainpoolp384WithSha384(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); @@ -1270,7 +1291,7 @@ module LibItsPki_Functions { return false; } } - v_signed_ec_signature := valueof( + v_signed_at_signature := valueof( m_etsiTs103097Data_signed( m_signedData( v_hashId, @@ -1280,7 +1301,7 @@ module LibItsPki_Functions { ) ) ); - log("f_generate_inner_at_request: v_signed_ec_signature= ", v_signed_ec_signature); + log("f_generate_inner_at_request: v_signed_at_signature= ", v_signed_at_signature); if (PICS_ITS_S_WITH_PRIVACY) { // Build EtsiTs102097Data-Encrypted structure var octetstring v_public_enc_key; @@ -1294,7 +1315,7 @@ module LibItsPki_Functions { var integer v_public_compressed_ephemeral_mode; var octetstring v_enc_signed_ec_signature; var EncryptedDataEncryptionKey v_encrypted_data_encryption_key; - + // Use EA certificate for the encryption if (PX_EC_ALG == e_nist_p256) { if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0)) { @@ -1308,13 +1329,21 @@ module LibItsPki_Functions { return false; } if (PX_EC_ALG == e_nist_p256) { - v_enc_signed_ec_signature := f_encryptWithEciesNistp256WithSha256(bit2oct(encvalue(v_signed_ec_signature)), v_public_enc_key, v_compressed_mode, ''O, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); + v_enc_signed_ec_signature := f_encryptWithEciesNistp256WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, ''O, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); } else if (PX_EC_ALG == e_brainpool_p256_r1) { - v_enc_signed_ec_signature := f_encryptWithEciesBrainpoolp256WithSha256(bit2oct(encvalue(v_signed_ec_signature)), v_public_enc_key, v_compressed_mode, ''O, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); + v_enc_signed_ec_signature := f_encryptWithEciesBrainpoolp256WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, ''O, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); } else { log("f_generate_inner_at_request: Wrong encryption variant"); return false; } + if (v_compressed_mode == 0) { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_enc_key)); + } else { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_enc_key)); + } + log("f_generate_inner_at_request: v_eccP256_curve_point= ", v_eccP256_curve_point); + log("f_generate_inner_at_request: v_encrypted_sym_key= ", v_encrypted_sym_key); + log("f_generate_inner_at_request: v_authentication_vector= ", v_authentication_vector); v_encrypted_data_encryption_key := valueof( m_encryptedDataEncryptionKey_eciesNistP256( m_evciesP256EncryptedKey( @@ -1334,9 +1363,9 @@ module LibItsPki_Functions { return false; } if (PX_EC_ALG == e_nist_p256) { - v_enc_signed_ec_signature := f_encryptWithEciesNistp256WithSha256(bit2oct(encvalue(v_signed_ec_signature)), v_public_enc_key, v_compressed_mode, ''O, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); + v_enc_signed_ec_signature := f_encryptWithEciesNistp256WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, ''O, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); } else if (PX_EC_ALG == e_brainpool_p256_r1) { - v_enc_signed_ec_signature := f_encryptWithEciesBrainpoolp256WithSha256(bit2oct(encvalue(v_signed_ec_signature)), v_public_enc_key, v_compressed_mode, ''O, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); + v_enc_signed_ec_signature := f_encryptWithEciesBrainpoolp256WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, ''O, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); } else { log("f_generate_inner_at_request: Wrong encryption variant"); return false; @@ -1382,7 +1411,7 @@ module LibItsPki_Functions { ) ); } else { // Skip the encryption, alowed to be re-identified by the AA - p_inner_at_request.ecSignature := valueof(m_ec_signature_ext_payload(v_signed_ec_signature)); + p_inner_at_request.ecSignature := valueof(m_ec_signature_ext_payload(v_signed_at_signature)); } // Build the InnerAtRequest, EcSignature field is already set if (p_compressed_key_mode == 0) { @@ -1872,11 +1901,11 @@ module LibItsPki_Functions { m_etsiTs103097Data_encrypted( m_encryptedData( { - m_recipientInfo_signedDataRecipInfo( - m_pKRecipientInfo( - v_recipientId, - v_encrypted_data_encryption_key - )) + m_recipientInfo_certRecipInfo( + m_pKRecipientInfo( + v_recipientId, + v_encrypted_data_encryption_key + )) }, m_SymmetricCiphertext_aes128ccm( m_aesCcmCiphertext( @@ -1901,6 +1930,116 @@ module LibItsPki_Functions { return true; } // End of function f_build_pki_secured_request_message + function f_build_pki_secured_request_message_for_authorization( + in HashedId8 p_recipientId, + in octetstring p_public_key_compressed, + in integer p_compressed_mode, + in octetstring p_salt, + in octetstring p_pki_message, + out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, + out Oct16 p_aes_sym_key, + out Oct16 p_encrypted_sym_key, + out Oct16 p_authentication_vector, + out Oct12 p_nonce, + out Oct32 p_request_hash + ) return boolean { + // Local variables + var Ieee1609Dot2Data v_unsecured_data; + var octetstring v_pki_message; + var template (value) EccP256CurvePoint v_eccP256_curve_point; + var HashedId8 v_recipientId; + var octetstring v_public_compressed_ephemeral_key; + var integer v_public_compressed_ephemeral_mode; + var octetstring v_encrypted_request; + var EncryptedDataEncryptionKey v_encrypted_data_encryption_key; + var bitstring v_enc_value; + + log(">>> f_build_pki_secured_request_message"); + + // Add Ieee1609Dot2Data layer + v_unsecured_data := valueof(m_etsiTs103097Data_unsecured(p_pki_message)); + v_pki_message := bit2oct(encvalue(v_unsecured_data)); + + // Encrypt encode EtsiTs103097Data-Signed data structure + if (PICS_SEC_FIXED_KEYS) { + p_salt := '77C0637C3558B3238FDE1EEC376DA080BE4076FB8491CA0F8C19FD34DF298CEB'O; + } + if (PX_EC_ALG == e_nist_p256) { + v_encrypted_request := f_encryptWithEciesNistp256WithSha256(v_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, PICS_SEC_FIXED_KEYS); + } else if (PX_EC_ALG == e_brainpool_p256_r1) { + v_encrypted_request := f_encryptWithEciesBrainpoolp256WithSha256(v_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, PICS_SEC_FIXED_KEYS); + } else { + log("f_build_pki_secured_request_message: Wrong encryption variant"); + return false; + } + log("f_build_pki_secured_request_message: p_aes_sym_key= ", p_aes_sym_key); + log("f_build_pki_secured_request_message: p_encrypted_sym_key= ", p_encrypted_sym_key); + log("f_build_pki_secured_request_message: p_authentication_vector= ", p_authentication_vector); + log("f_build_pki_secured_request_message: p_nonce= ", p_nonce); + log("f_build_pki_secured_request_message: p_recipientId= ", p_recipientId); + if (p_recipientId == int2oct(0, 8)) { + log("f_build_pki_secured_request_message: f_hashWithSha256(v_encrypted_sym_key)= ", f_hashWithSha256(p_encrypted_sym_key)); + v_recipientId := f_HashedId8FromSha256(f_hashWithSha256(p_encrypted_sym_key)); + } else { + v_recipientId := p_recipientId; + } + log("f_build_pki_secured_request_message: v_recipientId= ", v_recipientId); + // Fill Certificate template with the public compressed keys (canonical form) + if (v_public_compressed_ephemeral_mode == 0) { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); + } else { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_compressed_ephemeral_key)); + } + if (PX_EC_ALG == e_nist_p256) { + v_encrypted_data_encryption_key := valueof( + m_encryptedDataEncryptionKey_eciesNistP256( + m_evciesP256EncryptedKey( + v_eccP256_curve_point, + p_encrypted_sym_key, + p_authentication_vector + ))); + } else if (PX_EC_ALG == e_brainpool_p256_r1) { + v_encrypted_data_encryption_key := valueof( + m_encryptedDataEncryptionKey_eciesBrainpoolP256r1( + m_evciesP256EncryptedKey( + v_eccP256_curve_point, + p_encrypted_sym_key, + p_authentication_vector + ))); + } + p_ieee1609dot2_signed_and_encrypted_data := valueof( + m_etsiTs103097Data_encrypted( + m_encryptedData( + { + m_recipientInfo_certRecipInfo( + m_pKRecipientInfo( + v_recipientId, + v_encrypted_data_encryption_key + )) + }, + m_SymmetricCiphertext_aes128ccm( + m_aesCcmCiphertext( + p_nonce, + v_encrypted_request + ) + ) + ) + ) + ); + + // The 'p_request_hash' shall be the SHA256 digest of the OER representation of the topmost EtsiTs103097Data-Encoded structure + v_enc_value := encvalue(p_ieee1609dot2_signed_and_encrypted_data); + if (PICS_SEC_FIXED_KEYS) { + p_request_hash := '10ED97A2F2933DD3AC55F47022D125E18F5E1AA024613E616A75BA4979EFE318'O; + } else { + p_request_hash := f_hashWithSha256(bit2oct(v_enc_value)); + } + log("f_build_pki_secured_request_message: p_request_hash= ", p_request_hash); + + log("<<< f_build_pki_secured_request_message: ", p_ieee1609dot2_signed_and_encrypted_data); + return true; + } // End of function f_build_pki_secured_request_message_for_authorization + /** * @desc Build a signed and encrypted PKI response message * @param p_private_key Private key for signature diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index 22cca22f..74bb568b 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -1259,7 +1259,7 @@ module LibItsSecurity_Templates { group issuerIdentifier { template (value) IssuerIdentifier m_issuerIdentifier_self( - in template (value) HashAlgorithm p_self + in template (value) HashAlgorithm p_self := sha256 ) := { self_ := p_self } // End of template m_issuerIdentifier_self @@ -1409,6 +1409,29 @@ module LibItsSecurity_Templates { verifyKeyIndicator := p_verifyKeyIndicator } // End of template mw_toBeSignedCertificate_ea + template (omit) ToBeSignedCertificate m_toBeSignedCertificate_ec( + in template (value) CertificateId p_id, + in template (value) SequenceOfPsidSsp p_appPermissions, + in template (value) VerificationKeyIndicator p_verifyKeyIndicator, + in template (value) ValidityPeriod p_validityPeriod, + in template (omit) GeographicRegion p_region := omit, + in template (omit) SubjectAssurance p_assuranceLevel := omit, + in template (omit) PublicEncryptionKey p_encryptionKey := omit + ) := { + id := p_id, + cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 + crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 + validityPeriod := p_validityPeriod, + region := p_region, + assuranceLevel := p_assuranceLevel, + appPermissions := p_appPermissions, + certIssuePermissions := omit, + certRequestPermissions := omit, + canRequestRollover := omit, + encryptionKey := p_encryptionKey, + verifyKeyIndicator := p_verifyKeyIndicator + } // End of template m_toBeSignedCertificate_ec + /** * @desc Send template for ToBeSignedCertificate with Enrolment credential restrictions * @see ETSI TS 103 097 V1.3.1 Clause 7.2.2 Enrolment credential @@ -1419,7 +1442,8 @@ module LibItsSecurity_Templates { template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, template (present) ValidityPeriod p_validityPeriod := ?, template GeographicRegion p_region := *, - template SubjectAssurance p_assuranceLevel := * + template SubjectAssurance p_assuranceLevel := *, + template PublicEncryptionKey p_encryptionKey := * ) := { id := p_id, cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 @@ -1431,7 +1455,7 @@ module LibItsSecurity_Templates { certIssuePermissions := omit, certRequestPermissions := omit, canRequestRollover := omit, - encryptionKey := omit, + encryptionKey := p_encryptionKey, verifyKeyIndicator := p_verifyKeyIndicator } // End of template mw_toBeSignedCertificate_ec -- GitLab From d2d6eae8e179a226e372c6ede69cb9a0863f654e Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 15 Feb 2019 02:43:58 -0800 Subject: [PATCH 188/320] Start reviewing ITS-S EC tests --- ttcn/Http/LibItsHttp_Templates.ttcn | 13 ++ ttcn/Pki/LibItsPki_Functions.ttcn | 199 ++++++++++++++------ ttcn/Pki/LibItsPki_Pixits.ttcn | 5 + ttcn/Pki/LibItsPki_Templates.ttcn | 16 ++ ttcn/Pki/LibItsPki_TypesAndValues.ttcn | 2 + ttcn/Security/LibItsSecurity_Functions.ttcn | 2 +- ttcn/Security/LibItsSecurity_Templates.ttcn | 23 ++- 7 files changed, 194 insertions(+), 66 deletions(-) diff --git a/ttcn/Http/LibItsHttp_Templates.ttcn b/ttcn/Http/LibItsHttp_Templates.ttcn index c647b882..f1d7f8e5 100644 --- a/ttcn/Http/LibItsHttp_Templates.ttcn +++ b/ttcn/Http/LibItsHttp_Templates.ttcn @@ -140,6 +140,19 @@ module LibItsHttp_Templates { body := p_body } // End of template m_http_response_ko + template (value) Response m_http_response_ko_no_body( + in template (value) HeaderLines p_header, + in template (value) integer p_statuscode := 404, + in template (value) charstring p_statustext := "Not found" + ) := { + version_major := 1, + version_minor := 1, + statuscode := p_statuscode, + statustext := p_statustext, + header := p_header, + body := omit + } // End of template m_http_response_ko_no_body + template Response mw_http_response_ko( template HttpMessageBody p_body := *, template (present) HeaderLines p_header := ? diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 917d0ebc..ef0de12a 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -144,9 +144,6 @@ module LibItsPki_Functions { inout ItsPkiItss p_itss, inout ItsPkiHttp p_pki ) runs on ItsMtc { - p_itss := ItsPkiItss.create("IUT") alive; - p_pki := ItsPkiHttp.create("TS") alive; - disconnect(self:syncPort, mtc:syncPort); disconnect(p_itss:syncPort, self:syncPort); disconnect(p_pki:syncPort, self:syncPort); @@ -245,13 +242,13 @@ module LibItsPki_Functions { } // End of function f_utInitializeIut - function f_sendUtTriggerPrimitive( - in octetstring p_canonical_id, - in Oct1 p_enc_algorithm, - in octetstring p_private_key, - in octetstring p_public_key_compressed, - in integer p_compressed_mode - ) runs on ItsPkiItss { + function f_sendUtTriggerEnrolmentRequestPrimitive( + in octetstring p_canonical_id := ''O, + in Oct1 p_enc_algorithm := '00'O, + in octetstring p_private_key := ''O, + in octetstring p_public_key_compressed := ''O, + in integer p_compressed_mode := 0 + ) runs on ItsPkiItss { var TriggerEnrolmentRequest v_ut_trigger_enrolment_request; var octetstring v_compressed_public_key; @@ -270,7 +267,42 @@ module LibItsPki_Functions { } [] utPort.receive(UtPkiResults: { utPkiTriggerResult := false }) { tc_ac.stop; - log("*** f_sendUtTriggerPrimitive: ERROR: Received unexpected message ***"); + log("*** f_sendUtTriggerEnrolmentRequestPrimitive: ERROR: Received unexpected message ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] tc_ac.timeout { + log("*** f_sendAcPkiPrimitive: ERROR: Timeout while waiting for adapter control event result ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } // End of 'alt' statement + } // End of function f_sendUtTriggerEnrolmentRequestPrimitive + + function f_sendUtTriggerAuthorizationRequestPrimitive( + in octetstring p_canonical_id := ''O, + in Oct1 p_enc_algorithm := '00'O, + in octetstring p_private_key := ''O, + in octetstring p_public_key_compressed := ''O, + in integer p_compressed_mode := 0 + ) runs on ItsPkiItss { + var TriggerAuthorizationRequest v_ut_trigger_enrolment_request; + var octetstring v_compressed_public_key; + + if (p_compressed_mode == 2) { // TODO v_compressed_public_key := int2oct(p_compressed_mode, 1) & p_public_key_compressed? + v_compressed_public_key := '02'O & p_public_key_compressed; + } else { + v_compressed_public_key := '03'O & p_public_key_compressed; + } + + v_ut_trigger_enrolment_request := { p_canonical_id, p_enc_algorithm, p_private_key, v_compressed_public_key }; + utPort.send(UtPkiTrigger: { triggerAuthorizationRequest := v_ut_trigger_enrolment_request }); + tc_ac.start; + alt { + [] utPort.receive(UtPkiResults: { utPkiTriggerResult := true }) { + tc_ac.stop; + } + [] utPort.receive(UtPkiResults: { utPkiTriggerResult := false }) { + tc_ac.stop; + log("*** f_sendUtTriggerAuthorizationRequestPrimitive: ERROR: Received unexpected message ***"); f_selfOrClientSyncAndVerdict("error", e_error); } [] tc_ac.timeout { @@ -278,7 +310,7 @@ module LibItsPki_Functions { f_selfOrClientSyncAndVerdict("error", e_timeout); } } // End of 'alt' statement - } // End of function f_sendUtTriggerPrimitive + } // End of function f_sendUtTriggerAuthorizationRequestPrimitive } // End of group ut_port @@ -327,7 +359,10 @@ module LibItsPki_Functions { ) return boolean { var boolean v_ret := false; - log(" >>> f_verifyEcdsa"); + log(" >>> f_verifyEcdsa: p_tbs", p_tbs); + log(" >>> f_verifyEcdsa: p_issuer", p_issuer); + log(" >>> f_verifyEcdsa: p_signature_", p_signature_); + log(" >>> f_verifyEcdsa: p_verification_key", p_verification_key); if (ischosen(p_verification_key.ecdsaNistP256)) { if (ischosen(p_verification_key.ecdsaNistP256.compressed_y_0)) { @@ -402,22 +437,22 @@ module LibItsPki_Functions { var Ieee1609Dot2Data v_inner_ec_request_signed_for_pop; var octetstring v_public_enc_key; var integer v_compressed_enc_key_mode; - var boolean v_ret_code; + var boolean v_result; log(">>> f_http_build_inner_ec_request"); if (f_generate_inner_ec_request(p_private_key, p_public_key_compressed, p_compressed_mode, v_inner_ec_request) == false) { log("*** f_http_build_inner_ec_request: ERROR: Failed to generate InnerEcRequest ***"); f_selfOrClientSyncAndVerdict("error", e_error); } - log ("f_http_build_enrolment_request: EC verification private key: ", p_private_key); - log ("f_http_build_enrolment_request: EC verification public compressed key: ", p_public_key_compressed); - log ("f_http_build_enrolment_request: EC verification public compressed mode: ", p_compressed_mode); + log ("f_http_build_enrolment_request: ==> EC verification private key: ", p_private_key); + log ("f_http_build_enrolment_request: ==> EC verification public compressed key: ", p_public_key_compressed); + log ("f_http_build_enrolment_request: ==> EC verification public compressed mode: ", p_compressed_mode); // Generate InnerEcRequestSignedForPoP if (f_generate_inner_ec_request_signed_for_pop(p_private_key, v_inner_ec_request, v_inner_ec_request_signed_for_pop) == false) { log("*** f_http_build_inner_ec_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); f_selfOrClientSyncAndVerdict("error", e_error); } - log("v_inner_ec_request_signed_for_pop= ", v_inner_ec_request_signed_for_pop); + log("f_http_build_enrolment_request: v_inner_ec_request_signed_for_pop= ", v_inner_ec_request_signed_for_pop); // Secure InnerEcRequestSignedForPoP message if (f_extract_enc_key(vc_eaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { @@ -428,23 +463,24 @@ module LibItsPki_Functions { v_public_enc_key := 'DD4F6B0DF57C6E3BD0E32B565CACA1D858CEB08A5C2BBAB2C23E203C6DE697FF'O; v_compressed_enc_key_mode := 0; } - log("*** f_http_build_inner_ec_request: Public encryption key: ", v_public_enc_key); - log("*** f_http_build_inner_ec_request: Public encryption key comp: ", v_compressed_enc_key_mode); + log("f_http_build_inner_ec_request: Public encryption key: ", v_public_enc_key); + log("f_http_build_inner_ec_request: Public encryption key comp: ", v_compressed_enc_key_mode); p_salt := vc_eaWholeHash; if (PICS_SECPKI_REENROLMENT == false) { // This is the first enrolment, we used Factory keys - v_ret_code := f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); + v_result := f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } else { // We use last valid EC certificate - var Oct32 v_ec_private_key := PX_EC_PRIVATE_KEY; - var HashedId8 v_ec_hashed_id8 := PX_EC_HASHED_ID8; - // Retrieve EC certificate from the first enrolment - v_ret_code := f_build_pki_secured_request_message_signed_with_pop(v_ec_private_key, valueof(m_signerIdentifier_digest(v_ec_hashed_id8)), v_ec_hashed_id8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); + // TODO Retrieve EC certificate from the first enrolment instead of PX + log("f_http_build_inner_ec_request: v_ec_private_key: ", PX_EC_PRIVATE_KEY); + log("f_http_build_inner_ec_request: v_ec_hashed_id8: ", PX_EC_HASHED_ID8); + v_result := f_build_pki_secured_request_message_signed_with_pop(PX_EC_PRIVATE_KEY, valueof(m_signerIdentifier_digest(PX_EC_HASHED_ID8)), PX_EC_HASHED_ID8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } - if (v_ret_code == false) { + if (v_result == false) { log("*** f_http_build_inner_ec_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); f_selfOrClientSyncAndVerdict("error", e_error); + } else { + log("f_http_build_inner_ec_request: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); + log("f_http_build_inner_ec_request: p_request_hash= ", p_request_hash); } - log("*** f_http_build_inner_ec_request: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); - log("*** f_http_build_inner_ec_request: p_request_hash= ", p_request_hash); } // End of function f_http_build_inner_ec_request function f_http_build_invalid_enrolment_request( @@ -496,11 +532,10 @@ module LibItsPki_Functions { if (PICS_SECPKI_REENROLMENT == false) { // This is the first enrolment, we used Factory keys v_ret_code := f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } else { // We use last valid EC certificate - var Oct32 v_ec_private_key; - var HashedId8 v_ec_hashed_id8; - // Retrieve EC certificate from the first enrolment - // TODO Set v_ec_private_key & v_ec_hashed_id8 - v_ret_code := f_build_pki_secured_request_message_signed_with_pop(v_ec_private_key, valueof(m_signerIdentifier_digest(v_ec_hashed_id8)), v_ec_hashed_id8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); + // TODO Retrieve EC certificate from the first enrolment instead of PX + log("f_http_build_inner_ec_request: v_ec_private_key: ", PX_EC_PRIVATE_KEY); + log("f_http_build_inner_ec_request: v_ec_hashed_id8: ", PX_EC_HASHED_ID8); + v_ret_code := f_build_pki_secured_request_message_signed_with_pop(PX_EC_PRIVATE_KEY, valueof(m_signerIdentifier_digest(PX_EC_HASHED_ID8)), PX_EC_HASHED_ID8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } if (v_ret_code == false) { log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); @@ -1012,7 +1047,11 @@ module LibItsPki_Functions { ) ) ); - log ("f_generate_inner_ec_request: ", p_inner_ec_request); + if (PICS_SECPKI_REENROLMENT) { // This is a re-enrolment, the identifier of its current valid Enrolment Credential + log("f_generate_inner_ec_request: This is a re-enrolment"); + p_inner_ec_request.itsId := PX_EC_HASHED_ID8; + } + log("f_generate_inner_ec_request: ", p_inner_ec_request); return true; } // End of function f_generate_inner_ec_request @@ -1038,10 +1077,10 @@ module LibItsPki_Functions { v_encoded_inner_ec_request ) ), - m_headerInfo_inner_ec_request( - c_its_aid_SCR, - f_getCurrentTimeUtc() - ) + m_headerInfo_inner_pki_request( + -, + f_getCurrentTimeUtc() + ) ); // Signed the encoded InnerEcRequestSignedForPop v_tbs_signed := f_signWithEcdsa(bit2oct(encvalue(v_tbs)), int2oct(0, 32), p_private_key); @@ -1113,7 +1152,7 @@ module LibItsPki_Functions { log("f_verify_inner_ec_request_signed_for_pop: v_inner_ec_request= ", p_inner_ec_request); // 2. Verify the InnerEcRequestSignedForPop signature - + // TODO } return true; @@ -1239,9 +1278,9 @@ module LibItsPki_Functions { // Build the ETsiTs103097Data-SignedExternalPayload v_tbs := m_toBeSignedData( m_signedDataPayload_ext(v_hash_shared_at_request), // Payload containing extDataHash - m_headerInfo_inner_ec_request( // HeaderInfo - c_its_aid_SCR, - f_getCurrentTimeUtc()) + m_headerInfo_inner_pki_request( // HeaderInfo + -, + f_getCurrentTimeUtc()) ); log("f_generate_inner_at_request: v_tbs= ", v_tbs); // Signed ToBeSigned payload using the private key of EC certificate obtained from Enrolment request @@ -1673,17 +1712,18 @@ module LibItsPki_Functions { m_signedDataPayload( m_etsiTs103097Data_unsecured(p_pki_message) ), - m_headerInfo_inner_ec_request(c_its_aid_SCR, f_getCurrentTimeUtc()) + m_headerInfo_inner_pki_request(-, f_getCurrentTimeUtc()) ); log("f_build_pki_secured_request_message_signed_with_pop: signer: ", p_signer_identifier); - if (ischosen(p_signer_identifier.self_)) { + if (PICS_SECPKI_REENROLMENT == false) { // This is the first enrolment, we used Factory keys + //if (ischosen(p_signer_identifier.self_)) { v_tbs_signed := f_signWithEcdsa(bit2oct(encvalue(v_tbs)), int2oct(0, 32), p_private_key); } else { - var charstring v_certificate_id; + /*var charstring v_certificate_id; var octetstring v_hash; fx_readCertificateFromDigest(p_signer_identifier.digest, v_certificate_id); // TODO Add a wrapper function - f_getCertificateHash(v_certificate_id, v_hash); - v_tbs_signed := f_signWithEcdsa(bit2oct(encvalue(v_tbs)), v_hash, p_private_key); + f_getCertificateHash(v_certificate_id, v_hash);*/ + v_tbs_signed := f_signWithEcdsa(bit2oct(encvalue(v_tbs)), PX_EC_HASH, p_private_key); } // Add the signature and create EtsiTs103097Data-Signed data structure if (PX_VE_ALG == e_nist_p256) { @@ -2073,7 +2113,7 @@ module LibItsPki_Functions { m_signedDataPayload( m_etsiTs103097Data_unsecured(p_pki_message) ), - m_headerInfo_inner_ec_response(c_its_aid_SCR, f_getCurrentTimeUtc()) + m_headerInfo_inner_pki_response(-, f_getCurrentTimeUtc()) ); if (ischosen(p_signer_identifier.self_)) { v_tbs_signed := f_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), int2oct(0, 32), p_private_key); @@ -2199,7 +2239,9 @@ module LibItsPki_Functions { log("f_verify_pki_request_message: v_ieee1609dot2_signed_data.content.signedData.tbsData= ", v_ieee1609dot2_signed_data.content.signedData.tbsData); v_msg := bit2oct(encvalue(v_ieee1609dot2_signed_data.content.signedData.tbsData)); if (f_getCertificateFromDigest(f_HashedId8FromSha256(p_issuer), v_certificate) == false) { - return false; + if (p_check_security == true) { + return false; + } } log("f_verify_pki_request_message: v_certificate= ", v_certificate); if (f_verifyEcdsa(v_msg, p_issuer, v_ieee1609dot2_signed_data.content.signedData.signature_, v_certificate.toBeSigned.verifyKeyIndicator.verificationKey) == false) { @@ -2212,11 +2254,14 @@ module LibItsPki_Functions { log("f_verify_pki_request_message: v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData= ", v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); v_msg_bit := oct2bit(v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); if (decvalue(v_msg_bit, p_etsi_ts_102941_data) != 0) { - return false; + if (p_check_security == true) { + return false; + } } - if (p_etsi_ts_102941_data.version != PkiProtocolVersion) { - return false; + if (p_check_security == true) { + return false; + } } log("<<< f_verify_pki_request_message: true"); @@ -2319,16 +2364,19 @@ module LibItsPki_Functions { in integer p_compressed_mode ) return boolean { var bitstring v_encoded_cert; + var Oct32 v_ec_cert_hash; var HashedId8 v_ec_cert_hashed_id8; // Calculate the HashedId8 of the whole certificate v_encoded_cert := encvalue(p_ec_certificate); - v_ec_cert_hashed_id8 := f_HashedId8FromSha256(f_hashWithSha256(bit2oct(v_encoded_cert))); - log("f_verify_ec_certificate: EC certificate HashedId8: ", v_ec_cert_hashed_id8); + v_ec_cert_hash := f_hashWithSha256(bit2oct(v_encoded_cert)); + log("f_verify_ec_certificate: ==> EC certificate Hash: ", v_ec_cert_hash); + v_ec_cert_hashed_id8 := f_HashedId8FromSha256(v_ec_cert_hash); + log("f_verify_ec_certificate: ==> EC certificate HashedId8: ", v_ec_cert_hashed_id8); // Check the signer - log("f_verify_ec_certificate: ", match(p_ec_certificate.issuer, mw_issuerIdentifier_self())); - if (match(p_ec_certificate.issuer, mw_issuerIdentifier_self)) { + log("f_verify_ec_certificate: ", match(p_ec_certificate.issuer, mw_issuerIdentifier_sha256AndDigest)); + if (match(p_ec_certificate.issuer, mw_issuerIdentifier_sha256AndDigest)) { return false; } @@ -2338,6 +2386,9 @@ module LibItsPki_Functions { log("f_verify_ec_certificate: Signature not verified"); return false; } + + // TODO Check that requested information are present + return true; } // End of function f_verify_ec_certificate @@ -2548,6 +2599,42 @@ module LibItsPki_Functions { stop; } } // End of altstep a_default_pki_http_at + + altstep a_await_ec_http_response_from_iut( + template HttpMessage p_http_message, + out HttpMessage p_response + ) runs on ItsPkiHttp { + [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_response { + log("a_await_ec_http_response_from_iut: Received message on httpPort"); + } + [PICS_MULTIPLE_END_POINT] httpEcPort.receive(p_http_message) -> value p_response { + log("a_await_ec_http_response_from_iut: Received message on httpEcPort"); + } + } // End of altstep a_await_ec_http_response_from_iut + + altstep a_await_at_http_response_from_iut( + template HttpMessage p_http_message, + out HttpMessage p_response + ) runs on ItsPkiHttp { + [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_response { + log("a_await_at_http_response_from_iut: Received message on httpPort"); + } + [PICS_MULTIPLE_END_POINT] httpAtPort.receive(p_http_message) -> value p_response { + log("a_await_at_http_response_from_iut: Received message on httpAtPort"); + } + } // End of altstep a_await_at_http_response_from_iut + + altstep a_await_avt_http_response_from_iut( + template HttpMessage p_http_message, + out HttpMessage p_response + ) runs on ItsPkiHttp { + [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_response { + log("a_await_avt_http_response_from_iut: Received message on httpPort"); + } + [PICS_MULTIPLE_END_POINT] httpAtVPort.receive(p_http_message) -> value p_response { + log("a_await_avt_http_response_from_iut: Received message on httpAtVPort"); + } + } // End of altstep a_await_avt_http_response_from_iut } // End of group altsteps diff --git a/ttcn/Pki/LibItsPki_Pixits.ttcn b/ttcn/Pki/LibItsPki_Pixits.ttcn index 3699685d..30a76a52 100644 --- a/ttcn/Pki/LibItsPki_Pixits.ttcn +++ b/ttcn/Pki/LibItsPki_Pixits.ttcn @@ -29,6 +29,11 @@ module LibItsPki_Pixits { * @desc Contains the hashed id8 of the EC certificate, used in case of re-enrolment */ modulepar HashedId8 PX_EC_HASHED_ID8 := int2oct(0, 8); + + /** + * @desc Contains the hash of the EC certificate, used in case of re-enrolment + */ + modulepar Oct32 PX_EC_HASH := int2oct(0, 32); /** * @desc Indicate which encryption algorithem to be used diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn index 6e66faee..082e570e 100644 --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ b/ttcn/Pki/LibItsPki_Templates.ttcn @@ -415,4 +415,20 @@ module LibItsPki_Templates { certIssuePermissions := p_certIssuePermissions } // End of template m_certificate_subject_attributes + template CertificateSubjectAttributes mw_certificate_subject_attributes( + template (present) SequenceOfPsidSsp p_appPermissions := ?, + template (present) CertificateId p_id := ?, + template (present) ValidityPeriod p_validityPeriod := ?, + template (present) SubjectAssurance p_assuranceLevel := ?, + template GeographicRegion p_region := *, + template SequenceOfPsidGroupPermissions p_certIssuePermissions := omit + ) := { + id := p_id, + validityPeriod := p_validityPeriod, + region := p_region, + assuranceLevel := p_assuranceLevel, + appPermissions := p_appPermissions, + certIssuePermissions := p_certIssuePermissions + } // End of template mw_certificate_subject_attributes + } // End of module LibItsPki_Templates diff --git a/ttcn/Pki/LibItsPki_TypesAndValues.ttcn b/ttcn/Pki/LibItsPki_TypesAndValues.ttcn index 4c013ee8..e09985cf 100644 --- a/ttcn/Pki/LibItsPki_TypesAndValues.ttcn +++ b/ttcn/Pki/LibItsPki_TypesAndValues.ttcn @@ -28,6 +28,8 @@ module LibItsPki_TypesAndValues { e_brainpool_p256_r1 (1), e_brainpool_p384_r1 (2) } // End of type SecurityAlg + + type set of PublicVerificationKey ListOfPublicVerificationKey; group utPrimitives { diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 3066698e..f3cdaa50 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -1,5 +1,5 @@ /** - * @author ETSI / STF481 / STF507 / STF517 / STF538 + * @author ETSI / STF481 / STF507 / STF517 / STF538 / STF545 * @version $URL$ * $Id$ * @desc Module containing functions for Security Protocol diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index 74bb568b..73fe3323 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -1,5 +1,5 @@ /** - * @author ETSI / STF481 / STF507 / STF517 / STF538 + * @author ETSI / STF481 / STF507 / STF517 / STF538 / STF545 * @version $URL$ * $Id$ * @desc Module containing templates for Security Protocol @@ -1010,15 +1010,20 @@ module LibItsSecurity_Templates { requestedCertificate := * } // End of template mw_headerInfo_gn - template (omit) HeaderInfo m_headerInfo_inner_ec_request( - in template (value) Psid p_psid := c_its_aid_GN, - in template (value) Time64 p_generationTime - ) modifies m_headerInfo_gn := {}; - - template (omit) HeaderInfo m_headerInfo_inner_ec_response( - in template (value) Psid p_psid := c_its_aid_GN, + template (omit) HeaderInfo m_headerInfo_inner_pki_request( + in template (value) Psid p_psid := c_its_aid_SCR, in template (value) Time64 p_generationTime - ) modifies m_headerInfo_gn := {}; + ) modifies m_headerInfo_gn := {}; + + template (omit) HeaderInfo m_headerInfo_inner_pki_response( + in template (value) Psid p_psid := c_its_aid_SCR, + in template (value) Time64 p_generationTime + ) modifies m_headerInfo_gn := {}; + + template (present) HeaderInfo mw_headerInfo_inner_pki_request( + template (present) Psid p_psid := c_its_aid_SCR, + template (present) Time64 p_generationTime := ? + ) modifies mw_headerInfo_gn := {}; } // End of group headerFields -- GitLab From b90de034d822448787ed192b35e5936f4e693427 Mon Sep 17 00:00:00 2001 From: garciay Date: Sun, 17 Feb 2019 01:39:28 -0800 Subject: [PATCH 189/320] Continue PKI ATS development --- ttcn/Pki/LibItsPki_Functions.ttcn | 187 ++++++++++++++++++++--------- ttcn/Pki/LibItsPki_TestSystem.ttcn | 11 +- 2 files changed, 136 insertions(+), 62 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index ef0de12a..7df28c96 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -110,8 +110,12 @@ module LibItsPki_Functions { // Setup AA certificate shared with PKI AA entity f_readCertificate(p_aa_certificate_id, vc_aaCertificate); + f_readSigningKey(p_ea_certificate_id, vc_aaPrivateKey); // TODO To be removed + f_readEncryptingKey(p_ea_certificate_id, vc_aaPrivateEncKey); f_getCertificateDigest(p_aa_certificate_id, vc_aaHashedId8); f_getCertificateHash(p_aa_certificate_id, vc_aaWholeHash); + log("f_cfHttpUp: vc_aaPrivateKey= ", vc_aaPrivateKey); + log("f_cfHttpUp: vc_aaPrivateEncKey= ", vc_aaPrivateEncKey); log("f_cfHttpUp: vc_aaHashedId8= ", vc_aaHashedId8); log("f_cfHttpUp: vc_aaWholeHash= ", vc_aaWholeHash); @@ -417,6 +421,54 @@ module LibItsPki_Functions { return v_ret; } // End of function f_verifyEcdsa + function f_http_send( + in HeaderLines p_headers, + in template (value) HttpMessage p_http_message + ) runs on ItsPkiHttp { + if (not(PICS_MULTIPLE_END_POINT)) { + httpPort.send(p_http_message); + } else { + var charstring_list v_content_text; + + f_get_header(p_headers, c_header_content_text, v_content_text); + + if (not(isvalue(v_content_text))) { + log("f_http_send: Failed to send message: header not found: ", c_header_content_text); + return; + } + if (v_content_text == { "inner_ec_request" }) { + log("f_http_send: Send on EC end point"); + f_set_headers_list({ c_header_host }, { PICS_HEADER_HOST_EC }, p_headers); + if (ischosen(p_http_message.request)) { + p_http_message.request.header := p_headers; + } else { + p_http_message.response.header := p_headers; + } + httpEcPort.send(p_http_message); + } else if (v_content_text == { "inner_atv_request" }) { + log("f_http_send: Send on ATV end point"); + f_set_headers_list({ c_header_host }, { PICS_HEADER_HOST_ATV }, p_headers); + if (ischosen(p_http_message.request)) { + p_http_message.request.header := p_headers; + } else { + p_http_message.response.header := p_headers; + } + httpAtVPort.send(p_http_message); + } else if (v_content_text == { "inner_at_request" }) { + log("f_http_send: Send on AT end point"); + f_set_headers_list({ c_header_host }, { PICS_HEADER_HOST_AT }, p_headers); + if (ischosen(p_http_message.request)) { + p_http_message.request.header := p_headers; + } else { + p_http_message.response.header := p_headers; + } + httpAtPort.send(p_http_message); + } else { + log("f_http_send: Invalid header value: ", v_content_text); + } + } + } // End of function f_http_send + } // End of group helpers group http { // TODO Split into EnnerEc, Authorization & AuthorizationValidation @@ -551,6 +603,7 @@ module LibItsPki_Functions { in octetstring p_private_key := ''O, in octetstring p_digest := ''O, in Oct16 p_aes_sym_key, + out InnerEcResponse p_inner_ec_response, out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data ) return boolean { // Local variables @@ -558,7 +611,6 @@ module LibItsPki_Functions { var octetstring v_msg; var Oct12 v_nonce; var Ieee1609Dot2Data v_ieee1609dot2_signed_data; - var InnerEcResponse v_inner_ec_response; var EtsiTs103097Certificate v_ec_certificate; var boolean p_result := false; @@ -571,7 +623,7 @@ module LibItsPki_Functions { // Check expectred response if (p_responseCode != ok) { - v_inner_ec_response := valueof( + p_inner_ec_response := valueof( m_innerEcResponse_ko( p_request_hash, p_responseCode @@ -582,14 +634,14 @@ module LibItsPki_Functions { // Generate the certificate if (f_generate_ec_certificate_for_inner_ec_response(p_inner_ec_request, p_private_key, p_digest, v_ec_certificate) == false) { log("f_http_build_inner_ec_response: Failed to generate the certificate"); - v_inner_ec_response := valueof( + p_inner_ec_response := valueof( m_innerEcResponse_ko( p_request_hash, incompleterequest ) ); } else { - v_inner_ec_response := valueof( + p_inner_ec_response := valueof( m_innerEcResponse_ok( p_request_hash, v_ec_certificate @@ -599,8 +651,8 @@ module LibItsPki_Functions { } // Secure the response - log("f_http_build_inner_ec_response: v_inner_ec_response= ", v_inner_ec_response); - v_msg := bit2oct(encvalue(v_inner_ec_response)); + log("f_http_build_inner_ec_response: p_inner_ec_response= ", p_inner_ec_response); + v_msg := bit2oct(encvalue(p_inner_ec_response)); v_nonce := int2oct(f_getCurrentTime(), 32); // Random value // TODO Consider Sha384: m_signerIdentifier_digest(f_HashedId8FromSha384(p_digest)) if (f_build_pki_secured_response_message(p_private_key, @@ -611,7 +663,7 @@ module LibItsPki_Functions { p_ieee1609dot2_signed_and_encrypted_data ) == false) { log("f_http_build_inner_ec_response: Failed to generate the certificate"); - v_inner_ec_response := valueof( + p_inner_ec_response := valueof( m_innerEcResponse_ko( p_request_hash, deniedrequest @@ -1506,54 +1558,6 @@ module LibItsPki_Functions { group awaiting_messages { - function f_http_send( - in HeaderLines p_headers, - in template (value) HttpMessage p_http_message - ) runs on ItsPkiHttp { - if (not(PICS_MULTIPLE_END_POINT)) { - httpPort.send(p_http_message); - } else { - var charstring_list v_content_text; - - f_get_header(p_headers, c_header_content_text, v_content_text); - - if (not(isvalue(v_content_text))) { - log("f_http_send: Failed to send message: header not found: ", c_header_content_text); - return; - } - if (v_content_text == { "inner_ec_request" }) { - log("f_http_send: Send on EC end point"); - f_set_headers_list({ c_header_host }, { PICS_HEADER_HOST_EC }, p_headers); - if (ischosen(p_http_message.request)) { - p_http_message.request.header := p_headers; - } else { - p_http_message.response.header := p_headers; - } - httpEcPort.send(p_http_message); - } else if (v_content_text == { "inner_atv_request" }) { - log("f_http_send: Send on ATV end point"); - f_set_headers_list({ c_header_host }, { PICS_HEADER_HOST_ATV }, p_headers); - if (ischosen(p_http_message.request)) { - p_http_message.request.header := p_headers; - } else { - p_http_message.response.header := p_headers; - } - httpAtVPort.send(p_http_message); - } else if (v_content_text == { "inner_at_request" }) { - log("f_http_send: Send on AT end point"); - f_set_headers_list({ c_header_host }, { PICS_HEADER_HOST_AT }, p_headers); - if (ischosen(p_http_message.request)) { - p_http_message.request.header := p_headers; - } else { - p_http_message.response.header := p_headers; - } - httpAtPort.send(p_http_message); - } else { - log("f_http_send: Invalid header value: ", v_content_text); - } - } - } // End of function f_http_send - function f_await_http_inner_ec_request_response( out Oct32 p_private_key, out Oct32 p_compressed_public_key, @@ -1586,6 +1590,7 @@ module LibItsPki_Functions { ))))); tc_ac.start; alt { + // TODO Create a a_await_at_http_request_from_iut( [not(PICS_MULTIPLE_END_POINT)] httpPort.receive( mw_http_response( mw_http_response_ok( @@ -1660,6 +1665,78 @@ module LibItsPki_Functions { return false; } // End of function f_await_http_inner_ec_request_response + function f_await_ec_request_send_response( + out InnerEcResponse p_inner_ec_response + ) runs on ItsPkiHttp return boolean { + var HttpMessage v_request; + var boolean v_result := false; + + log(">>> f_await_ec_request_send_response"); + + tc_ac.start; + alt { + [] a_await_at_http_response_from_iut( + mw_http_request( + mw_http_request_post( + PICS_HTTP_POST_URI_EC, + -, + mw_http_message_body_binary( + mw_binary_body_ieee1609dot2_data( + mw_enrolmentRequestMessage( + mw_encryptedData( + -, + mw_SymmetricCiphertext_aes128ccm + )))))), + v_request + ) { + var Ieee1609Dot2Data v_ieee1609dot2_signed_and_encrypted_data; + var EtsiTs102941Data v_etsi_ts_102941_data; + var Oct16 v_request_hash; + var Oct16 v_aes_enc_key; + var InnerEcRequest v_inner_ec_request; + var template (value) HttpMessage v_response; + var HeaderLines v_headers; + + tc_ac.stop; + + f_init_default_headers_list(-, "inner_ec_response", v_headers); + + if (f_verify_pki_request_message(vc_eaPrivateEncKey, vc_eaWholeHash/*salt*/, vc_eaWholeHash, v_request.request.body.binary_body.ieee1609dot2_data, false, v_request_hash, v_etsi_ts_102941_data, v_aes_enc_key) == false) { // Cannot decrypt the message + log("f_await_ec_request_send_response: Failed to verify PKI message ***"); + // Send error message + v_response := m_http_response(m_http_response_ko(m_http_message_body_binary(m_binary_body_ieee1609dot2_data(v_ieee1609dot2_signed_and_encrypted_data)), v_headers, 400, "Bad request")); // Initialize v_reponse with an error message + } else { + log("f_await_ec_request_send_response: Receive ", v_etsi_ts_102941_data, " ***"); + if (f_verify_inner_ec_request_signed_for_pop(v_etsi_ts_102941_data, v_inner_ec_request) == false) { + log("f_await_ec_request_send_response: Failed to verify PKI message ***"); + // Send error message + f_http_build_inner_ec_response(v_inner_ec_request/*Not required*/, cantparse, v_request_hash, -, -, v_aes_enc_key, p_inner_ec_response, v_ieee1609dot2_signed_and_encrypted_data); + v_response := m_http_response(m_http_response_ok(m_http_message_body_binary(m_binary_body_ieee1609dot2_data(v_ieee1609dot2_signed_and_encrypted_data)), v_headers)); + } else { + f_http_build_inner_ec_response(v_inner_ec_request, ok, v_request_hash, vc_eaPrivateKey, vc_eaWholeHash, v_aes_enc_key, p_inner_ec_response, v_ieee1609dot2_signed_and_encrypted_data); + v_response := m_http_response(m_http_response_ok(m_http_message_body_binary(m_binary_body_ieee1609dot2_data(v_ieee1609dot2_signed_and_encrypted_data)), v_headers)); + v_result := true; + } + f_http_send( + v_headers, + m_http_request( + m_http_request_post( + PICS_HTTP_POST_URI_EC, + v_headers, + m_http_message_body_binary( + m_binary_body_ieee1609dot2_data( + v_ieee1609dot2_signed_and_encrypted_data + ))))); + } + } + [] tc_ac.timeout { + log("f_await_ec_request_send_response: Expected message not received ***"); + } + } // End of 'alt' statement + + return v_result; + } // End of function f_await_ec_request_send_response + } // End of group awaiting_messages group pki_functions { diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index 076f488f..71a8a515 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -75,16 +75,13 @@ module LibItsPki_TestSystem { port HttpPort httpAtPort; /** Authorization end point */ var Certificate vc_eaCertificate; /** Test Adapter EA certificate */ var octetstring vc_eaPrivateKey; /** Test Adapter EA private key for signature */ - // var Certificate vc_ecCertificate; /** Test Adapter AA certificate */ - // var octetstring vc_ecPrivateKey; /** Test Adapter AA private key for signature */ var octetstring vc_eaPrivateEncKey; /** Test Adapter EA private key for encryption */ + var octetstring vc_eaWholeHash; /** Test Adapter EA whole-hash for signature check */ var HashedId8 vc_eaHashedId8; /** Test Adapter EA HashedId8 for decryption of IUT's response */ - var octetstring vc_eaWholeHash; /** TS EA whole-hash for signature check */ + var octetstring vc_aaPrivateKey; /** Test Adapter AA private key for signature */ + var octetstring vc_aaPrivateEncKey; /** Test Adapter AA private key for encryption */ var HashedId8 vc_aaHashedId8; /** Test Adapter AA HashedId8 for decryption of IUT's response */ - var octetstring vc_aaWholeHash; /** TS AA whole-hash for signature check */ - // var HashedId8 vc_ecHashedId8; /** Test Adapter AA HashedId8 for decryption of IUT's response */ - // var Certificate vc_peerEaCertificate; /** IUT EA certificate for signature check */ - // var octetstring vc_eaPeerWholeHash; /** IUT EA whole-hash for signature check */ + var octetstring vc_aaWholeHash; /** Test Adapter AA whole-hash for signature check */ } // End of component ItsPki /** -- GitLab From a944e1ac531f806374c7b969701bb04363045250 Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 18 Feb 2019 02:24:53 -0800 Subject: [PATCH 190/320] Continue PKI ATS development --- ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn | 22 +++ ttcn/Pki/LibItsPki_Functions.ttcn | 177 +++++++++++++++++++++ ttcn/Pki/LibItsPki_Templates.ttcn | 6 + 3 files changed, 205 insertions(+) diff --git a/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn b/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn index 80d8a8aa..de10b7a7 100644 --- a/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn +++ b/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn @@ -46,6 +46,28 @@ module LibItsPki_EncdecDeclarations { external function fx_dec_InnerEcResponse(inout bitstring b, out EtsiTs102941TypesEnrolment.InnerEcResponse p) return integer with {extension "prototype(sliding) decode(PER)"} + /** + * @desc Encoding function for EtsiTs102941TypesAuthorization InnerAtRequest + * @param p The certificate to encode + * @return The encode message in OER format + */ + external function fx_enc_InnerAtRequest(in EtsiTs102941TypesAuthorization.InnerAtRequest p) return bitstring + with {extension "prototype(convert) encode(PER)"} + + external function fx_dec_InnerAtRequest(inout bitstring b, out EtsiTs102941TypesAuthorization.InnerAtRequest p) return integer + with {extension "prototype(sliding) decode(PER)"} + + /** + * @desc Encoding function for EtsiTs102941TypesAuthorization InnerAtResponse + * @param p The certificate to encode + * @return The encode message in OER format + */ + external function fx_enc_InnerAtResponse(in EtsiTs102941TypesAuthorization.InnerAtResponse p) return bitstring + with {extension "prototype(convert) encode(PER)"} + + external function fx_dec_InnerAtResponse(inout bitstring b, out EtsiTs102941TypesAuthorization.InnerAtResponse p) return integer + with {extension "prototype(sliding) decode(PER)"} + /** * @desc Encoding function for EtsiTs102941TypesAuthorization SharedAtRequest * @param p The certificate to encode diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 7df28c96..cca44441 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -741,6 +741,86 @@ module LibItsPki_Functions { log("*** f_http_build_authorization_request: DEBUG: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); log("*** f_http_build_authorization_request: DEBUG: p_request_hash= ", p_request_hash); } // End of function f_http_build_authorization_request + + function f_http_build_authorization_response( + in InnerAtRequest p_inner_at_request, + in EnrolmentResponseCode p_responseCode := ok, + in Oct16 p_request_hash, + in octetstring p_private_key := ''O, + in octetstring p_digest := ''O, + in Oct16 p_aes_sym_key, + out InnerAtResponse p_inner_at_response, + out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data + ) return boolean { + // Local variables + var bitstring v_msg_bit; + var octetstring v_msg; + var Oct12 v_nonce; + var Ieee1609Dot2Data v_ieee1609dot2_signed_data; + var EtsiTs103097Certificate v_at_certificate; + var boolean p_result := false; + + log(">>> f_http_build_authorization_response: p_inner_at_request= ", p_inner_at_request); + log(">>> f_http_build_authorization_response: p_responseCode= ", p_responseCode); + log(">>> f_http_build_authorization_response: p_request_hash= ", p_request_hash); + log(">>> f_http_build_authorization_response: p_private_key= ", p_private_key); + log(">>> f_http_build_authorization_response: p_digest= ", p_digest); + log(">>> f_http_build_authorization_response: p_aes_sym_key= ", p_aes_sym_key); + + // Check expectred response + /*if (p_responseCode != ok) { + p_inner_at_response := valueof( + m_innerEcResponse_ko( + p_request_hash, + p_responseCode + ) + ); + p_result := true; + } else { + // Generate the certificate + if (f_generate_at_certificate_for_inner_at_response(p_inner_at_request, p_private_key, p_digest, v_at_certificate) == false) { + log("f_http_build_inner_at_response: Failed to generate the certificate"); + p_inner_at_response := valueof( + m_innerEcResponse_ko( + p_request_hash, + incompleterequest + ) + ); + } else { + p_inner_at_response := valueof( + m_innerEcResponse_ok( + p_request_hash, + v_at_certificate + ) + ); + } + } + + // Secure the response + log("f_http_build_inner_at_response: p_inner_at_response= ", p_inner_at_response); + v_msg := bit2oct(encvalue(p_inner_at_response)); + v_nonce := int2oct(f_getCurrentTime(), 32); // Random value + // TODO Consider Sha384: m_signerIdentifier_digest(f_HashedId8FromSha384(p_digest)) + if (f_build_pki_secured_response_message(p_private_key, + valueof(m_signerIdentifier_digest(f_HashedId8FromSha256(p_digest))),// in SignerIdentifier p_signer_identifier, + v_msg, + p_aes_sym_key, + v_nonce, + p_ieee1609dot2_signed_and_encrypted_data + ) == false) { + log("f_http_build_inner_at_response: Failed to generate the certificate"); + p_inner_at_response := valueof( + m_innerEcResponse_ko( + p_request_hash, + deniedrequest + ) + ); + } else { + p_result := true; + }*/ + + return p_result; + } // End of function f_http_build_authorization_request function f_http_build_authorization_validation_request( in InnerAtRequest p_inner_at_request, @@ -1048,6 +1128,80 @@ module LibItsPki_Functions { return true; } // End of function f_generate_at_certificate + function f_generate_at_certificate_for_authorization_response( + in InnerAtRequest p_inner_at_request, + in octetstring p_private_key, + in octetstring p_digest, + out EtsiTs103097Certificate p_at_certificate + ) return boolean { + var EtsiTs103097Certificate v_cert; + var IssuerIdentifier v_issuer; + var bitstring v_tbs; + var octetstring v_sig; + + log(">>> f_generate_at_certificate_for_authorization_response"); + + /*v_issuer := valueof(m_issuerIdentifier_sha256AndDigest(f_HashedId8FromSha256(p_digest))); // TODO Check sha256/384 f_HashedId8FromSha384 + v_cert := valueof( + m_etsiTs103097Certificate( + v_issuer, + m_toBeSignedCertificate_ec( + p_inner_at_request.requestedSubjectAttributes.id, + p_inner_at_request.requestedSubjectAttributes.appPermissions, + m_verificationKeyIndicator_verificationKey( + p_inner_at_request.publicKeys.verificationKey + ), + p_inner_at_request.requestedSubjectAttributes.validityPeriod, + p_inner_at_request.requestedSubjectAttributes.region, + p_inner_at_request.requestedSubjectAttributes.assuranceLevel, + p_inner_at_request.publicKeys.encryptionKey + ) + ) + ); + // Encode it ==> Get octetstring + v_tbs := encvalue(v_cert.toBeSigned); + // Sign the certificate + v_sig := f_signWithEcdsa(bit2oct(v_tbs), p_digest, p_private_key); + if (PX_VE_ALG == e_nist_p256) { + v_cert.signature_ := valueof( + m_signature_ecdsaNistP256( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only( + substr(v_sig, 0, 32) + ), + substr(v_sig, 32, 32) + ) + ) + ); + } else if (PX_VE_ALG == e_brainpool_p256_r1) { + v_cert.signature_ := valueof( + m_signature_ecdsaBrainpoolP256r1( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only( + substr(v_sig, 0, 32) + ), + substr(v_sig, 32, 32) + ) + ) + ); + } else if (PX_VE_ALG == e_brainpool_p384_r1) { + v_cert.signature_ := valueof( + m_signature_ecdsaBrainpoolP384r1( + m_ecdsaP384Signature( + m_eccP384CurvePoint_x_only( + substr(v_sig, 0, 48) + ), + substr(v_sig, 48, 48) + ) + ) + ); + } + p_at_certificate := valueof(v_cert);*/ + log("f_generate_at_certificate_for_authorization_response: p_at_certificate= ", p_at_certificate); + + return true; + } // End of function f_generate_at_certificate_for_authorization_response + } // End of group generate_certificates group inner_ec_xxx { @@ -1532,6 +1686,29 @@ module LibItsPki_Functions { return true; } // End of function f_generate_inner_at_request + function f_verify_inner_at_request_signed_for_pop( + in EtsiTs102941Data p_etsi_ts_102941_data, + out InnerAtRequest p_inner_at_request + ) return boolean { + var bitstring v_msg_bit; + + log(">>> f_verify_inner_at_request_signed_for_pop: ", p_etsi_ts_102941_data); + + // 1. Decode content + v_msg_bit := oct2bit(p_etsi_ts_102941_data.content.enrolmentRequest.content.signedData.tbsData.payload.data.content.unsecuredData); + if (decvalue(v_msg_bit, p_inner_at_request) != 0) { + log("f_verify_inner_at_request_signed_for_pop: Failed to decode InnerEcRequest"); + return false; + } else { + log("f_verify_inner_at_request_signed_for_pop: v_inner_at_request= ", p_inner_at_request); + + // 2. Verify the InnerEcRequestSignedForPop signature + // TODO + } + + return true; + } // End of function f_verify_inner_at_request_signed_for_pop + function f_generate_inner_at_response( in octetstring p_authorization_request_hash, in EtsiTs103097Certificate p_certificate, diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn index 082e570e..cf4b7113 100644 --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ b/ttcn/Pki/LibItsPki_Templates.ttcn @@ -160,6 +160,12 @@ module LibItsPki_Templates { authorizationRequest := p_authorizationRequest } // End of template m_authorizationRequest + template (present) EtsiTs102941DataContent mw_authorizationRequest( + in template (present) InnerAtRequest p_authorizationRequest := ? + ) := { + authorizationRequest := p_authorizationRequest + } // End of template mw_authorizationRequest + template (present) EtsiTs102941DataContent mw_authorizationResponse( template (present) InnerAtResponse p_authorizationResponse := ? ) := { -- GitLab From 50f63dfd0cdfa7fef7d0faefda39883e184ea45b Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 18 Feb 2019 11:30:41 -0800 Subject: [PATCH 191/320] Bug fixed on generationTime calculation --- ttcn/Pki/LibItsPki_Functions.ttcn | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index cca44441..a9b53e71 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -1285,7 +1285,7 @@ module LibItsPki_Functions { ), m_headerInfo_inner_pki_request( -, - f_getCurrentTimeUtc() + (f_getCurrentTime() * 1000) //us ) ); // Signed the encoded InnerEcRequestSignedForPop @@ -1486,7 +1486,7 @@ module LibItsPki_Functions { m_signedDataPayload_ext(v_hash_shared_at_request), // Payload containing extDataHash m_headerInfo_inner_pki_request( // HeaderInfo -, - f_getCurrentTimeUtc()) + (f_getCurrentTime()) * 1000) //us ); log("f_generate_inner_at_request: v_tbs= ", v_tbs); // Signed ToBeSigned payload using the private key of EC certificate obtained from Enrolment request @@ -1966,7 +1966,7 @@ module LibItsPki_Functions { m_signedDataPayload( m_etsiTs103097Data_unsecured(p_pki_message) ), - m_headerInfo_inner_pki_request(-, f_getCurrentTimeUtc()) + m_headerInfo_inner_pki_request(-, (f_getCurrentTime() * 1000)/*us*/) ); log("f_build_pki_secured_request_message_signed_with_pop: signer: ", p_signer_identifier); if (PICS_SECPKI_REENROLMENT == false) { // This is the first enrolment, we used Factory keys @@ -2367,7 +2367,7 @@ module LibItsPki_Functions { m_signedDataPayload( m_etsiTs103097Data_unsecured(p_pki_message) ), - m_headerInfo_inner_pki_response(-, f_getCurrentTimeUtc()) + m_headerInfo_inner_pki_response(-, (f_getCurrentTime() * 1000)/*us*/) ); if (ischosen(p_signer_identifier.self_)) { v_tbs_signed := f_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), int2oct(0, 32), p_private_key); -- GitLab From c59baf961ec499e041a3224fd2308f9381791810 Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 18 Feb 2019 23:13:43 -0800 Subject: [PATCH 192/320] Continue PKI ATS development --- ttcn/Pki/LibItsPki_Functions.ttcn | 39 ++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index a9b53e71..8e000435 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -706,7 +706,7 @@ module LibItsPki_Functions { var bitstring v_authorization_request_msg; // Generate the InnerAtRequest - if (f_generate_inner_at_request(vc_eaCertificate, vc_eaHashedId8, p_ec_certificate, p_ec_private_key, p_private_key, p_public_key_compressed, p_compressed_key_mode, p_private_enc_key, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_inner_at_request) == false) { + if (f_generate_inner_at_request(vc_aaCertificate, vc_aaHashedId8, vc_eaHashedId8, p_ec_certificate, p_ec_private_key, p_private_key, p_public_key_compressed, p_compressed_key_mode, p_private_enc_key, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_inner_at_request) == false) { log("*** f_http_build_authorization_request: ERROR: Failed to generate AuthorizationValidationRequest ***"); f_selfOrClientSyncAndVerdict("error", e_error); return; @@ -1387,7 +1387,8 @@ module LibItsPki_Functions { group inner_at_xxx { function f_generate_inner_at_request( - in Certificate p_ea_certificate, + in Certificate p_aa_certificate, + in Oct8 p_aa_hashed_id8, in Oct8 p_ea_hashed_id8, in Certificate p_ec_certificate, in octetstring p_ec_private_key, @@ -1434,6 +1435,10 @@ module LibItsPki_Functions { if (f_generate_key_pair(p_private_enc_key, v_public_enc_key_x, v_public_enc_key_y, p_public_compressed_enc_key, p_compressed_enc_key_mode) == false) { log("f_generate_inner_at_request: Failed to generate encryption key"); return false; + } else { + log ("f_generate_inner_at_request: AT encryption private key: ", p_private_enc_key); + log ("f_generate_inner_at_request: AT encryption public compressed key: ", p_public_compressed_enc_key); + log ("f_generate_inner_at_request: AT encryption public compressed mode: ", p_compressed_enc_key_mode); } } else { p_private_enc_key := ''O; @@ -1453,20 +1458,26 @@ module LibItsPki_Functions { log("f_generate_inner_at_request: v_ec_hash= ", v_ec_hash); // Generate 32 octets length secret key - v_hmac_key := f_hashWithSha256(int2oct(f_getCurrentTime(), 12)); + v_hmac_key := f_hashWithSha256(int2oct((f_getCurrentTimeUtc() * 1000), 12)); log("f_generate_inner_at_request: v_hmac_key= ", v_hmac_key); // Generate tag based on the concatenation of verification keys & encryption keys v_message_to_tag := v_public_key_x & v_public_key_y & v_public_enc_key_x & v_public_enc_key_y; log("f_generate_inner_at_request: v_message_to_tag= ", v_message_to_tag); // FIXME encryption keys could be optional - v_key_tag := fx_hmac_sha256(v_hmac_key, v_message_to_tag); // TODO Rename and use a wrapper function + v_key_tag := substr( + fx_hmac_sha256( // TODO Rename and use a wrapper function + v_hmac_key, + v_message_to_tag + ), + 0, + 16); // Leftmost 128 bits of the HMAC-SHA256 tag computed previously log("f_generate_inner_at_request: v_key_tag= ", v_key_tag); // Build the SharedAtRequest p_inner_at_request.sharedAtRequest := valueof( m_shared_at_request( p_ea_hashed_id8, // eaId identifies the EA certificate shared with EA entity - substr(v_key_tag, 0, 16), // Calculated keyTag + v_key_tag, // Calculated keyTag valueof( m_certificate_subject_attributes( // FIXME Review subjectPermissions p_ec_certificate.toBeSigned.appPermissions, @@ -1563,11 +1574,11 @@ module LibItsPki_Functions { // Use EA certificate for the encryption if (PX_EC_ALG == e_nist_p256) { - if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0)) { - v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0; + if (ischosen(p_aa_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0)) { + v_public_enc_key := p_aa_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0; v_compressed_mode := 0; - } else if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_1)) { - v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_1; + } else if (ischosen(p_aa_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_1)) { + v_public_enc_key := p_aa_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_1; v_compressed_mode := 1; } else { log("f_generate_inner_at_request: Wrong NistP256 encryption variant"); @@ -1597,11 +1608,11 @@ module LibItsPki_Functions { v_authentication_vector ))); } else if (PX_EC_ALG == e_brainpool_p256_r1) { - if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0)) { - v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0; + if (ischosen(p_aa_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0)) { + v_public_enc_key := p_aa_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0; v_compressed_mode := 0; - } else if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_1)) { - v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_1; + } else if (ischosen(p_aa_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_1)) { + v_public_enc_key := p_aa_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_1; v_compressed_mode := 1; } else { log("f_generate_inner_at_request: Wrong BrainpoolP256r1 encryption variant"); @@ -1626,7 +1637,7 @@ module LibItsPki_Functions { log("f_generate_inner_at_request: Wrong encryption variant"); return false; } - v_recipientId := p_ea_hashed_id8; // RecipientId is the HashedId8 of the EA certificate + v_recipientId := p_aa_hashed_id8; // RecipientId is the HashedId8 of the EA certificate log("v_recipientId= ", v_recipientId); // Fill Certificate template with the public compressed keys (canonical form) if (v_public_compressed_ephemeral_mode == 0) { -- GitLab From ec376d2696b590bef28271376d9be45b23f52277 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 20 Feb 2019 10:04:38 -0800 Subject: [PATCH 193/320] Continue PKI ATS development --- ttcn/Http/LibItsHttp_Templates.ttcn | 2 +- ttcn/Pki/LibItsPki_Functions.ttcn | 426 +++++++++++------- ttcn/Pki/LibItsPki_Pixits.ttcn | 2 +- ttcn/Pki/LibItsPki_Templates.ttcn | 24 +- .../LibItsSecurity_TypesAndValues.ttcn | 1 + 5 files changed, 277 insertions(+), 178 deletions(-) diff --git a/ttcn/Http/LibItsHttp_Templates.ttcn b/ttcn/Http/LibItsHttp_Templates.ttcn index f1d7f8e5..a805a9e9 100644 --- a/ttcn/Http/LibItsHttp_Templates.ttcn +++ b/ttcn/Http/LibItsHttp_Templates.ttcn @@ -121,7 +121,7 @@ module LibItsHttp_Templates { version_major := 1, version_minor := 1, statuscode := 200, - statustext := "OK", + statustext := ?,//"OK", header := p_header, body := p_body } // End of template mw_http_response_ok diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 8e000435..c1468b22 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -706,7 +706,7 @@ module LibItsPki_Functions { var bitstring v_authorization_request_msg; // Generate the InnerAtRequest - if (f_generate_inner_at_request(vc_aaCertificate, vc_aaHashedId8, vc_eaHashedId8, p_ec_certificate, p_ec_private_key, p_private_key, p_public_key_compressed, p_compressed_key_mode, p_private_enc_key, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_inner_at_request) == false) { + if (f_generate_inner_at_request(vc_aaCertificate, vc_aaHashedId8, vc_eaCertificate, vc_eaWholeHash/*salt*/, vc_eaHashedId8, p_ec_certificate, p_ec_private_key, p_private_key, p_public_key_compressed, p_compressed_key_mode, p_private_enc_key, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_inner_at_request) == false) { log("*** f_http_build_authorization_request: ERROR: Failed to generate AuthorizationValidationRequest ***"); f_selfOrClientSyncAndVerdict("error", e_error); return; @@ -726,8 +726,8 @@ module LibItsPki_Functions { log("*** f_http_build_authorization_request: Public encryption key comp: ", v_compressed_enc_key_mode); p_salt := vc_aaWholeHash; log("*** f_http_build_authorization_request: p_salt: ", p_salt); - if (PX_AUTHORIZATION_REQUEST_WITH_POP) { - if(f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { + if (PICS_PKI_AUTH_POP) { + if(f_build_pki_secured_request_message_signed_with_pop(p_private_key, valueof(m_signerIdentifier_self), vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { log("*** f_http_build_authorization_request: ERROR: Failed to generate Authorization Request ***"); f_selfOrClientSyncAndVerdict("error", e_error); } @@ -742,9 +742,78 @@ module LibItsPki_Functions { log("*** f_http_build_authorization_request: DEBUG: p_request_hash= ", p_request_hash); } // End of function f_http_build_authorization_request + function f_http_build_authorization_request_with_wrong_private_key( + in Certificate p_ec_certificate, // Enrolment credentials certificate + in octetstring p_ec_private_key, + out octetstring p_private_key, + out octetstring p_public_key_compressed, + out integer p_compressed_key_mode, + out octetstring p_private_enc_key, + out octetstring p_public_compressed_enc_key, + out integer p_compressed_enc_key_mode, + out Oct16 p_aes_sym_key, + out Oct16 p_encrypted_sym_key, + out Oct16 p_authentication_vector, + out Oct12 p_nonce, + out octetstring p_salt, + out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, + out Oct32 p_request_hash + ) runs on ItsPkiHttp { + // Local variables + var octetstring v_public_key_x; + var octetstring v_public_key_y; + var octetstring v_public_enc_key_x; + var octetstring v_public_enc_key_y; + var octetstring v_public_enc_key; + var integer v_compressed_enc_key_mode; + var InnerAtRequest v_inner_at_request; + var Ieee1609Dot2Data v_inner_at_request_data; + var InnerAtRequest v_authorization_request; + var bitstring v_authorization_request_msg; + + // Generate the InnerAtRequest + if (f_generate_inner_at_request(vc_aaCertificate, vc_aaHashedId8, vc_eaCertificate, vc_eaWholeHash/*salt*/, vc_eaHashedId8, p_ec_certificate, p_ec_private_key, p_private_key, p_public_key_compressed, p_compressed_key_mode, p_private_enc_key, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_inner_at_request) == false) { + log("*** f_http_build_authorization_request_with_wrong_private_key: ERROR: Failed to generate AuthorizationValidationRequest ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + return; + } + log("f_http_build_authorization_request_with_wrong_private_key: v_inner_at_request= ", v_inner_at_request); + + // Secure InnerAtRequest message + /*** + Use the wrong private key + ***/ + if (f_extract_enc_key(vc_eaCertificate/*Insted of vc_aaCertificate/*/, v_public_enc_key, v_compressed_enc_key_mode) == false) { + log("*** f_http_build_authorization_request_with_wrong_private_key: ERROR: Non canonical EA certificate ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + if (PICS_SEC_FIXED_KEYS) { // Debug mode: Use fixed values + v_public_enc_key := 'DD4F6B0DF57C6E3BD0E32B565CACA1D858CEB08A5C2BBAB2C23E203C6DE697FF'O; + v_compressed_enc_key_mode := 0; + } + log("*** f_http_build_authorization_request_with_wrong_private_key: Public encryption key: ", v_public_enc_key); + log("*** f_http_build_authorization_request_with_wrong_private_key: Public encryption key comp: ", v_compressed_enc_key_mode); + p_salt := vc_aaWholeHash; + log("*** f_http_build_authorization_request_with_wrong_private_key: p_salt: ", p_salt); + if (PICS_PKI_AUTH_POP) { + if(f_build_pki_secured_request_message_signed_with_pop(p_private_key, valueof(m_signerIdentifier_self), vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { + log("*** f_http_build_authorization_request_with_wrong_private_key: ERROR: Failed to generate Authorization Request ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + } else { // Only encryption of EtsiTs102941Data/InnerAtRequest + log("*** f_http_build_authorization_request_with_wrong_private_key: POP signature not applied"); + if(f_build_pki_secured_request_message_for_authorization(vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { + log("*** f_http_build_authorization_request_with_wrong_private_key: ERROR: Failed to generate Authorization Request ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + } + log("*** f_http_build_authorization_request_with_wrong_private_key: DEBUG: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); + log("*** f_http_build_authorization_request_with_wrong_private_key: DEBUG: p_request_hash= ", p_request_hash); + } // End of function f_http_build_authorization_request_with_wrong_private_key + function f_http_build_authorization_response( in InnerAtRequest p_inner_at_request, - in EnrolmentResponseCode p_responseCode := ok, + in AuthorizationResponseCode p_responseCode := ok, in Oct16 p_request_hash, in octetstring p_private_key := ''O, in octetstring p_digest := ''O, @@ -768,15 +837,15 @@ module LibItsPki_Functions { log(">>> f_http_build_authorization_response: p_aes_sym_key= ", p_aes_sym_key); // Check expectred response - /*if (p_responseCode != ok) { + if (p_responseCode != ok) { p_inner_at_response := valueof( - m_innerEcResponse_ko( + m_innerAtResponse_ko( p_request_hash, p_responseCode ) ); p_result := true; - } else { + } else {/* // Generate the certificate if (f_generate_at_certificate_for_inner_at_response(p_inner_at_request, p_private_key, p_digest, v_at_certificate) == false) { log("f_http_build_inner_at_response: Failed to generate the certificate"); @@ -816,20 +885,20 @@ module LibItsPki_Functions { ) ); } else { - p_result := true; - }*/ + p_result := true;*/ + } return p_result; } // End of function f_http_build_authorization_request function f_http_build_authorization_validation_request( in InnerAtRequest p_inner_at_request, - out octetstring p_private_key, - out octetstring p_public_key_compressed, - out integer p_compressed_key_mode, - out octetstring p_private_enc_key, - out octetstring p_public_compressed_enc_key, - out integer p_compressed_enc_key_mode, + in octetstring p_private_key, + in octetstring p_public_key_compressed, + in integer p_compressed_key_mode, + in octetstring p_private_enc_key, + in octetstring p_public_compressed_enc_key, + in integer p_compressed_enc_key_mode, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, @@ -844,37 +913,31 @@ module LibItsPki_Functions { var octetstring v_public_enc_key; var integer v_compressed_enc_key_mode; + log(">>> f_http_build_authorization_validation_request"); + // Copy the sharedAtRequest component from the InnerAtRequest received in the AuthorizationRequestMessage v_authorization_validation_request.sharedAtRequest := p_inner_at_request.sharedAtRequest; // Copy the ecSignature component from the InnerAtRequest received in the AuthorizationRequestMessage or AuthorizationRequestMessageWithPop v_authorization_validation_request.ecSignature := p_inner_at_request.ecSignature; - // Secure the Pki message + // Secure the InnerAtRequest message if (f_extract_enc_key(vc_eaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { - log("*** f_http_build_authorization_validation_request: ERROR: Non canonical EA certificate ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log("*** f_http_build_authorization_validation_request: Public encryption key: ", v_public_enc_key); - log("*** f_http_build_authorization_validation_request: Public encryption key comp: ", v_compressed_enc_key_mode); - - // Secure InnerAtRequest message - if (f_extract_enc_key(vc_eaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { - log("*** f_http_build_authorization_validation_request: ERROR: Non canonical EA certificate ***"); + log("f_http_build_authorization_validation_request: Non canonical EA certificate"); f_selfOrClientSyncAndVerdict("error", e_error); } if (PICS_SEC_FIXED_KEYS) { // Debug mode: Use fixed values v_public_enc_key := 'DD4F6B0DF57C6E3BD0E32B565CACA1D858CEB08A5C2BBAB2C23E203C6DE697FF'O; v_compressed_enc_key_mode := 0; } - log("*** f_http_build_authorization_validation_request: Public encryption key: ", v_public_enc_key); - log("*** f_http_build_authorization_validation_request: Public encryption key comp: ", v_compressed_enc_key_mode); + log("f_http_build_authorization_validation_request: Public encryption key: ", v_public_enc_key); + log("f_http_build_authorization_validation_request: Public encryption key comp: ", v_compressed_enc_key_mode); p_salt := vc_eaWholeHash; - log("*** f_http_build_authorization_validation_request: p_salt: ", p_salt); - if(f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_validation_request(v_authorization_validation_request))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { - log("*** f_http_build_authorization_validation_request: ERROR: Failed to generate Authorization Request ***"); + log("f_http_build_authorization_validation_request: p_salt: ", p_salt); + if(f_build_pki_secured_request_message_signed_with_pop(p_private_key, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_validation_request(v_authorization_validation_request))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { + log("f_http_build_authorization_validation_request: Failed to generate Authorization Request"); f_selfOrClientSyncAndVerdict("error", e_error); } - log("*** f_http_build_authorization_validation_request: DEBUG: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); - log("*** f_http_build_authorization_validation_request: DEBUG: p_request_hash= ", p_request_hash); + log("f_http_build_authorization_validation_request: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); + log("f_http_build_authorization_validation_request: p_request_hash= ", p_request_hash); } // End of function f_http_build_authorization_validation_request } // End of group http @@ -1389,6 +1452,8 @@ module LibItsPki_Functions { function f_generate_inner_at_request( in Certificate p_aa_certificate, in Oct8 p_aa_hashed_id8, + in Certificate p_ea_certificate, + in octetstring p_salt, in Oct8 p_ea_hashed_id8, in Certificate p_ec_certificate, in octetstring p_ec_private_key, @@ -1421,7 +1486,11 @@ module LibItsPki_Functions { var template (value) EccP256CurvePoint v_enc_eccP256_curve_point; var HashAlgorithm v_hashId; var Signature v_signature; - + var SequenceOfPsidSsp v_appPermissions := { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs + valueof(m_appPermissions(c_its_aid_CAM, { bitmapSsp := '01FFFC'O })), + valueof(m_appPermissions(c_its_aid_DENM, { bitmapSsp := '01FFFFFF'O })) + }; + // Generate verification keys for the certificate to be requested if (f_generate_key_pair(p_private_key, v_public_key_x, v_public_key_y, p_public_key_compressed, p_compressed_key_mode) == false) { log("f_generate_inner_at_request: Failed to generate verification key"); @@ -1442,6 +1511,8 @@ module LibItsPki_Functions { } } else { p_private_enc_key := ''O; + v_public_enc_key_x := ''O; + v_public_enc_key_y := ''O; p_public_compressed_enc_key := ''O; p_compressed_enc_key_mode := -1; } @@ -1462,7 +1533,18 @@ module LibItsPki_Functions { log("f_generate_inner_at_request: v_hmac_key= ", v_hmac_key); // Generate tag based on the concatenation of verification keys & encryption keys - v_message_to_tag := v_public_key_x & v_public_key_y & v_public_enc_key_x & v_public_enc_key_y; + if (p_compressed_key_mode == 0) { + v_message_to_tag := '02'O & p_public_key_compressed; + } else { + v_message_to_tag := '03'O & p_public_key_compressed; + } + if (PX_INCLUDE_ENCRYPTION_KEYS) { + if (p_compressed_enc_key_mode == 0) { + v_message_to_tag := v_message_to_tag & '02'O & p_public_compressed_enc_key; + } else { + v_message_to_tag := v_message_to_tag & '03'O & p_public_compressed_enc_key; + } + } log("f_generate_inner_at_request: v_message_to_tag= ", v_message_to_tag); // FIXME encryption keys could be optional v_key_tag := substr( fx_hmac_sha256( // TODO Rename and use a wrapper function @@ -1479,15 +1561,22 @@ module LibItsPki_Functions { p_ea_hashed_id8, // eaId identifies the EA certificate shared with EA entity v_key_tag, // Calculated keyTag valueof( - m_certificate_subject_attributes( // FIXME Review subjectPermissions - p_ec_certificate.toBeSigned.appPermissions, + m_certificate_subject_attributes( // FIXME Review fsubjectPermissions + v_appPermissions,//p_ec_certificate.toBeSigned.appPermissions, p_ec_certificate.toBeSigned.certRequestPermissions, p_ec_certificate.toBeSigned.id, p_ec_certificate.toBeSigned.validityPeriod, - p_ec_certificate.toBeSigned.region, + p_ec_certificate.toBeSigned.region,/*m_geographicRegion_identifiedRegion( + { + m_identifiedRegion_country_only(250), + m_identifiedRegion_country_only(380) + } + ) +,*/ p_ec_certificate.toBeSigned.assuranceLevel ))) // Desired attributes ); + // Calculate the hash of the SharedAtRequest v_hash_shared_at_request := f_hashWithSha256(bit2oct(encvalue(p_inner_at_request.sharedAtRequest))); log("f_generate_inner_at_request: v_hash_shared_at_request= ", v_hash_shared_at_request); @@ -1502,7 +1591,8 @@ module LibItsPki_Functions { log("f_generate_inner_at_request: v_tbs= ", v_tbs); // Signed ToBeSigned payload using the private key of EC certificate obtained from Enrolment request // In case of ITS-S privacy, v_signed_at_signature contained the data to be encrypted - if (ischosen(p_ec_certificate.signature_.ecdsaBrainpoolP384r1Signature)) { + // TODO Simplify with f_signWithEcdsa + if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1)) { v_hashId := sha384; v_tbs_signed := f_signWithEcdsaBrainpoolp384WithSha384(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); v_signature := valueof( @@ -1517,7 +1607,7 @@ module LibItsPki_Functions { ); } else { v_hashId := sha256; - if (ischosen(p_ec_certificate.signature_.ecdsaBrainpoolP256r1Signature)) { + if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1)) { v_tbs_signed := f_signWithEcdsaBrainpoolp256WithSha256(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); v_signature := valueof( m_signature_ecdsaBrainpoolP256r1( @@ -1529,7 +1619,7 @@ module LibItsPki_Functions { ) ) ); - } else if (ischosen(p_ec_certificate.signature_.ecdsaNistP256Signature)) { + } else if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256)) { v_tbs_signed := f_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); v_signature := valueof( m_signature_ecdsaNistP256( @@ -1574,32 +1664,22 @@ module LibItsPki_Functions { // Use EA certificate for the encryption if (PX_EC_ALG == e_nist_p256) { - if (ischosen(p_aa_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0)) { - v_public_enc_key := p_aa_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0; + if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0)) { + v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0; v_compressed_mode := 0; - } else if (ischosen(p_aa_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_1)) { - v_public_enc_key := p_aa_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_1; + } else if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_1)) { + v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_1; v_compressed_mode := 1; } else { log("f_generate_inner_at_request: Wrong NistP256 encryption variant"); return false; } - if (PX_EC_ALG == e_nist_p256) { - v_enc_signed_ec_signature := f_encryptWithEciesNistp256WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, ''O, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); - } else if (PX_EC_ALG == e_brainpool_p256_r1) { - v_enc_signed_ec_signature := f_encryptWithEciesBrainpoolp256WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, ''O, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); - } else { - log("f_generate_inner_at_request: Wrong encryption variant"); - return false; - } - if (v_compressed_mode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_enc_key)); + v_enc_signed_ec_signature := f_encryptWithEciesNistp256WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); + if (v_public_compressed_ephemeral_mode == 0) { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_enc_key)); + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_compressed_ephemeral_key)); } - log("f_generate_inner_at_request: v_eccP256_curve_point= ", v_eccP256_curve_point); - log("f_generate_inner_at_request: v_encrypted_sym_key= ", v_encrypted_sym_key); - log("f_generate_inner_at_request: v_authentication_vector= ", v_authentication_vector); v_encrypted_data_encryption_key := valueof( m_encryptedDataEncryptionKey_eciesNistP256( m_evciesP256EncryptedKey( @@ -1608,23 +1688,21 @@ module LibItsPki_Functions { v_authentication_vector ))); } else if (PX_EC_ALG == e_brainpool_p256_r1) { - if (ischosen(p_aa_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0)) { - v_public_enc_key := p_aa_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0; + if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0)) { + v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0; v_compressed_mode := 0; - } else if (ischosen(p_aa_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_1)) { - v_public_enc_key := p_aa_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_1; + } else if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_1)) { + v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_1; v_compressed_mode := 1; } else { log("f_generate_inner_at_request: Wrong BrainpoolP256r1 encryption variant"); return false; } - if (PX_EC_ALG == e_nist_p256) { - v_enc_signed_ec_signature := f_encryptWithEciesNistp256WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, ''O, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); - } else if (PX_EC_ALG == e_brainpool_p256_r1) { - v_enc_signed_ec_signature := f_encryptWithEciesBrainpoolp256WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, ''O, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); + v_enc_signed_ec_signature := f_encryptWithEciesBrainpoolp256WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); + if (v_public_compressed_ephemeral_mode == 0) { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); } else { - log("f_generate_inner_at_request: Wrong encryption variant"); - return false; + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_compressed_ephemeral_key)); } v_encrypted_data_encryption_key := valueof( m_encryptedDataEncryptionKey_eciesBrainpoolP256r1( @@ -1637,24 +1715,20 @@ module LibItsPki_Functions { log("f_generate_inner_at_request: Wrong encryption variant"); return false; } - v_recipientId := p_aa_hashed_id8; // RecipientId is the HashedId8 of the EA certificate - log("v_recipientId= ", v_recipientId); + log("f_generate_inner_at_request: v_encrypted_data_encryption_key= ", v_encrypted_data_encryption_key); + v_recipientId := p_ea_hashed_id8; // RecipientId is the HashedId8 of the EA certificate + log("f_generate_inner_at_request: v_recipientId= ", v_recipientId); // Fill Certificate template with the public compressed keys (canonical form) - if (v_public_compressed_ephemeral_mode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); - } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_compressed_ephemeral_key)); - } p_inner_at_request.ecSignature := valueof( m_ec_signature( m_etsiTs103097Data_encrypted( m_encryptedData( { - m_recipientInfo_signedDataRecipInfo( - m_pKRecipientInfo( - v_recipientId, - - v_encrypted_data_encryption_key )) + m_recipientInfo_certRecipInfo( + m_pKRecipientInfo( + v_recipientId, + + v_encrypted_data_encryption_key )) }, m_SymmetricCiphertext_aes128ccm( m_aesCcmCiphertext( @@ -1680,19 +1754,29 @@ module LibItsPki_Functions { } else { v_enc_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_1(v_public_enc_key_x); } - p_inner_at_request.publicKeys := valueof( // The freshly generated public keys to be used for the requested AT certificate - m_publicKeys( - m_publicVerificationKey_ecdsaNistP256( - v_eccP256_curve_point - ), - m_encryptionKey( // FIXME Encryption keys could be optional - -, - m_publicEncryptionKey_ecdsaNistP256(v_enc_eccP256_curve_point) - ) - ) - ); + if (PX_INCLUDE_ENCRYPTION_KEYS) { + p_inner_at_request.publicKeys := valueof( // The freshly generated public verification & encrypition keys to be used for the requested AT certificate + m_publicKeys( + m_publicVerificationKey_ecdsaNistP256( + v_eccP256_curve_point + ), + m_encryptionKey( // FIXME Encryption keys could be optional + -, + m_publicEncryptionKey_ecdsaNistP256(v_enc_eccP256_curve_point) + ) + ) + ); + } else { + p_inner_at_request.publicKeys := valueof( // The freshly generated public verification keys to be used for the requested AT certificate + m_publicKeys( + m_publicVerificationKey_ecdsaNistP256( + v_eccP256_curve_point + ) + ) + ); + } p_inner_at_request.hmacKey := v_hmac_key; - log("p_inner_at_request= ", p_inner_at_request); + log("f_generate_inner_at_request: p_inner_at_request= ", p_inner_at_request); return true; } // End of function f_generate_inner_at_request @@ -1750,7 +1834,8 @@ module LibItsPki_Functions { out Oct32 p_private_key, out Oct32 p_compressed_public_key, out integer p_compressed_mode, - out InnerEcResponse p_inner_ec_response + out InnerEcResponse p_inner_ec_response, + in boolean p_strict_checks := true ) runs on ItsPkiHttp return boolean { var HeaderLines v_headers; var Oct32 v_request_hash; @@ -1763,7 +1848,8 @@ module LibItsPki_Functions { var EtsiTs102941Data v_etsi_ts_102941_data; var HttpMessage v_response; - log(">>> f_await_http_inner_ec_request_response"); + log(">>> f_await_http_inner_ec_request_response: p_strict_checks=", p_strict_checks); + f_http_build_inner_ec_request(p_private_key, p_compressed_public_key, p_compressed_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, v_salt, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash); f_init_default_headers_list(-, "inner_ec_request", v_headers); f_http_send( @@ -1778,71 +1864,48 @@ module LibItsPki_Functions { ))))); tc_ac.start; alt { - // TODO Create a a_await_at_http_request_from_iut( - [not(PICS_MULTIPLE_END_POINT)] httpPort.receive( - mw_http_response( - mw_http_response_ok( - mw_http_message_body_binary( - mw_binary_body_ieee1609dot2_data( - mw_enrolmentResponseMessage( - mw_encryptedData( - -, - mw_SymmetricCiphertext_aes128ccm - ))))))) -> value v_response { + [] a_await_ec_http_request_from_iut( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_binary( + mw_binary_body_ieee1609dot2_data( + mw_enrolmentResponseMessage( + mw_encryptedData( + -, + mw_SymmetricCiphertext_aes128ccm + )))))), + v_response + ) { tc_ac.stop; - if (f_verify_pki_response_message(p_private_key, v_aes_sym_key, v_authentication_vector, vc_eaWholeHash, v_response.response.body.binary_body.ieee1609dot2_data, false, v_etsi_ts_102941_data) == false) { + if (f_verify_pki_response_message(p_private_key, v_aes_sym_key, v_authentication_vector, vc_eaWholeHash, v_response.response.body.binary_body.ieee1609dot2_data, p_strict_checks, v_etsi_ts_102941_data) == false) { log("f_await_http_inner_ec_request_response: Failed to verify PKI message ***"); - } else { - log("f_await_http_inner_ec_request_response: Receive ", v_etsi_ts_102941_data, " ***"); - // Verify the received EC certificate - log("f_await_http_inner_ec_request_response: match ", match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(substr(v_request_hash, 0, 16), mw_etsiTs103097Certificate(-, mw_toBeSignedCertificate_ec, -)))), " ***"); // TODO In TITAN, this is the only way to get the unmatching in log - if (match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(substr(v_request_hash, 0, 16), mw_etsiTs103097Certificate(-, mw_toBeSignedCertificate_ec, -))))) { - p_inner_ec_response := v_etsi_ts_102941_data.content.enrolmentResponse; - if (f_verify_ec_certificate(v_etsi_ts_102941_data.content.enrolmentResponse.certificate, vc_eaCertificate, p_compressed_public_key, p_compressed_mode)) { - log("f_await_http_inner_ec_request_response: Well-secured EA certificate received ***"); - log("p_inner_ec_response= ", p_inner_ec_response); - return true; - } else { - log("f_await_http_inner_ec_request_response: Cannot verify EC certificate signature ***"); - return true; // For debug mode only - } - } else { - log("f_await_http_inner_ec_request_response: Unexpected message received ***"); + if (p_strict_checks) { + return false; } } - } - [PICS_MULTIPLE_END_POINT] httpEcPort.receive( - mw_http_response( - mw_http_response_ok( - mw_http_message_body_binary( - mw_binary_body_ieee1609dot2_data( - mw_enrolmentResponseMessage( - mw_encryptedData( - -, - mw_SymmetricCiphertext_aes128ccm - ))))))) -> value v_response { - tc_ac.stop; - - if (f_verify_pki_response_message(p_private_key, v_aes_sym_key, v_authentication_vector, vc_eaWholeHash, v_response.response.body.binary_body.ieee1609dot2_data, false, v_etsi_ts_102941_data) == false) { - log("f_await_http_inner_ec_request_response: Failed to verify PKI message ***"); - } else { - log("f_await_http_inner_ec_request_response: Receive ", v_etsi_ts_102941_data, " ***"); - // Verify the received EC certificate - log("f_await_http_inner_ec_request_response: match ", match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(substr(v_request_hash, 0, 16), mw_etsiTs103097Certificate(-, mw_toBeSignedCertificate_ec, -)))), " ***"); // TODO In TITAN, this is the only way to get the unmatching in log - if (match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(substr(v_request_hash, 0, 16), mw_etsiTs103097Certificate(-, mw_toBeSignedCertificate_ec, -))))) { - p_inner_ec_response := v_etsi_ts_102941_data.content.enrolmentResponse; - if (f_verify_ec_certificate(v_etsi_ts_102941_data.content.enrolmentResponse.certificate, vc_eaCertificate, p_compressed_public_key, p_compressed_mode)) { - log("f_await_http_inner_ec_request_response: Well-secured EA certificate received ***"); - log("p_inner_ec_response= ", p_inner_ec_response); - return true; - } else { - log("f_await_http_inner_ec_request_response: Cannot verify EC certificate signature ***"); - return true; // For debug mode only + log("f_await_http_inner_ec_request_response: Receive ", v_etsi_ts_102941_data, " ***"); + // Verify the received EC certificate + log("f_await_http_inner_ec_request_response: match ", match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(substr(v_request_hash, 0, 16), mw_etsiTs103097Certificate(-, mw_toBeSignedCertificate_ec)))), " ***"); // TODO In TITAN, this is the only way to get the unmatching in log + if (match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(substr(v_request_hash, 0, 16), mw_etsiTs103097Certificate(-, mw_toBeSignedCertificate_ec)))) == false) { + log("f_await_http_inner_ec_request_response: Unexpected message received ***"); + if (p_strict_checks) { + return false; + } + } + if (ispresent(v_etsi_ts_102941_data.content.enrolmentResponse) and ispresent(v_etsi_ts_102941_data.content.enrolmentResponse.certificate)) { + if (f_verify_ec_certificate(v_etsi_ts_102941_data.content.enrolmentResponse.certificate, vc_eaCertificate, p_compressed_public_key, p_compressed_mode) == false) { + log("f_await_http_inner_ec_request_response: Cannot verify EC certificate signature ***"); + if (p_strict_checks) { + return false; } - } else { - log("f_await_http_inner_ec_request_response: Unexpected message received ***"); } + p_inner_ec_response := v_etsi_ts_102941_data.content.enrolmentResponse; + log("f_await_http_inner_ec_request_response: Well-secured EA certificate received ***"); + log("p_inner_ec_response= ", p_inner_ec_response); + } else { + log("f_await_http_inner_ec_request_response: Invalid message received ***"); + return false; } } [] tc_ac.timeout { @@ -1850,7 +1913,7 @@ module LibItsPki_Functions { } } // End of 'alt' statement - return false; + return true; } // End of function f_await_http_inner_ec_request_response function f_await_ec_request_send_response( @@ -1863,20 +1926,20 @@ module LibItsPki_Functions { tc_ac.start; alt { - [] a_await_at_http_response_from_iut( - mw_http_request( - mw_http_request_post( - PICS_HTTP_POST_URI_EC, - -, - mw_http_message_body_binary( - mw_binary_body_ieee1609dot2_data( - mw_enrolmentRequestMessage( - mw_encryptedData( - -, - mw_SymmetricCiphertext_aes128ccm - )))))), - v_request - ) { + [] a_await_ec_http_request_from_iut( + mw_http_request( + mw_http_request_post( + PICS_HTTP_POST_URI_EC, + -, + mw_http_message_body_binary( + mw_binary_body_ieee1609dot2_data( + mw_enrolmentRequestMessage( + mw_encryptedData( + -, + mw_SymmetricCiphertext_aes128ccm + )))))), + v_request + ) { var Ieee1609Dot2Data v_ieee1609dot2_signed_and_encrypted_data; var EtsiTs102941Data v_etsi_ts_102941_data; var Oct16 v_request_hash; @@ -1903,7 +1966,7 @@ module LibItsPki_Functions { } else { f_http_build_inner_ec_response(v_inner_ec_request, ok, v_request_hash, vc_eaPrivateKey, vc_eaWholeHash, v_aes_enc_key, p_inner_ec_response, v_ieee1609dot2_signed_and_encrypted_data); v_response := m_http_response(m_http_response_ok(m_http_message_body_binary(m_binary_body_ieee1609dot2_data(v_ieee1609dot2_signed_and_encrypted_data)), v_headers)); - v_result := true; + v_result := true; } f_http_send( v_headers, @@ -1913,7 +1976,7 @@ module LibItsPki_Functions { v_headers, m_http_message_body_binary( m_binary_body_ieee1609dot2_data( - v_ieee1609dot2_signed_and_encrypted_data + v_ieee1609dot2_signed_and_encrypted_data ))))); } } @@ -1970,7 +2033,12 @@ module LibItsPki_Functions { var EncryptedDataEncryptionKey v_encrypted_data_encryption_key; var bitstring v_enc_value; - log(">>> f_build_pki_secured_request_message_signed_with_pop"); + log(">>> f_build_pki_secured_request_message_signed_with_pop: p_private_key= ", p_private_key); + log(">>> f_build_pki_secured_request_message_signed_with_pop: p_signer_identifier= ", p_signer_identifier); + log(">>> f_build_pki_secured_request_message_signed_with_pop: p_recipientId= ", p_recipientId); + log(">>> f_build_pki_secured_request_message_signed_with_pop: p_public_key_compressed= ", p_public_key_compressed); + log(">>> f_build_pki_secured_request_message_signed_with_pop: p_salt= ", p_salt); + log(">>> f_build_pki_secured_request_message_signed_with_pop: p_pki_message= ", p_pki_message); // Signed the encoded PKI message v_tbs := m_toBeSignedData( @@ -2865,6 +2933,18 @@ module LibItsPki_Functions { } } // End of altstep a_default_pki_http_at + altstep a_await_ec_http_request_from_iut( + template HttpMessage p_http_message, + out HttpMessage p_response + ) runs on ItsPkiHttp { + [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_response { + log("a_await_ec_http_request_from_iut: Received message on httpPort"); + } + [PICS_MULTIPLE_END_POINT] httpEcPort.receive(p_http_message) -> value p_response { + log("a_await_ec_http_request_from_iut: Received message on httpEcPort"); + } + } // End of altstep a_await_ec_http_request_from_iut + altstep a_await_ec_http_response_from_iut( template HttpMessage p_http_message, out HttpMessage p_response @@ -2889,17 +2969,17 @@ module LibItsPki_Functions { } } // End of altstep a_await_at_http_response_from_iut - altstep a_await_avt_http_response_from_iut( + altstep a_await_atv_http_response_from_iut( template HttpMessage p_http_message, out HttpMessage p_response ) runs on ItsPkiHttp { [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_response { - log("a_await_avt_http_response_from_iut: Received message on httpPort"); + log("a_await_atv_http_response_from_iut: Received message on httpPort"); } [PICS_MULTIPLE_END_POINT] httpAtVPort.receive(p_http_message) -> value p_response { log("a_await_avt_http_response_from_iut: Received message on httpAtVPort"); } - } // End of altstep a_await_avt_http_response_from_iut + } // End of altstep a_await_atv_http_response_from_iut } // End of group altsteps diff --git a/ttcn/Pki/LibItsPki_Pixits.ttcn b/ttcn/Pki/LibItsPki_Pixits.ttcn index 30a76a52..22d42fc1 100644 --- a/ttcn/Pki/LibItsPki_Pixits.ttcn +++ b/ttcn/Pki/LibItsPki_Pixits.ttcn @@ -18,7 +18,7 @@ module LibItsPki_Pixits { /** * @desc Do the Authorization Request use SignedWithPop mechanism? */ - modulepar boolean PX_AUTHORIZATION_REQUEST_WITH_POP := true; + modulepar boolean PICS_PKI_AUTH_POP := true; /** * @desc Contains the private key for the EC certificate, used in case of re-enrolment diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn index cf4b7113..82d6f2ab 100644 --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ b/ttcn/Pki/LibItsPki_Templates.ttcn @@ -55,6 +55,15 @@ module LibItsPki_Templates { } } // End of template m_etsiTs102941Data_inner_ec_response + template (present) EtsiTs102941Data mw_etsiTs102941Data_inner_ec_response( + template (present) InnerEcResponse p_inner_ec_response := ? + ) := { + version := PkiProtocolVersion, + content := { + enrolmentResponse := p_inner_ec_response + } + } // End of template mw_etsiTs102941Data_inner_ec_response + template (value) EtsiTs102941Data m_etsiTs102941Data_authorization_request( in template (value) InnerAtRequest p_inner_at_request ) := { @@ -303,11 +312,20 @@ module LibItsPki_Templates { template (present) Oct16 p_requestHash := ?, template (present) EtsiTs103097Certificate p_certificate := ? ) := { - requestHash := p_requestHash, - responseCode := ok, - certificate := p_certificate + requestHash := p_requestHash, + responseCode := ok, + certificate := p_certificate } // End of template mw_innerAtResponse_ok + template (value) InnerAtResponse m_innerAtResponse_ko( + in template (value) Oct16 p_requestHash, + in template (value) AuthorizationResponseCode p_responseCode + ) := { + requestHash := p_requestHash, + responseCode := p_responseCode, + certificate := omit + } // End of template m_innerAtResponse_ko + template (present) InnerAtResponse mw_innerAtResponse_ko( template (present) Oct16 p_requestHash := ?, template (present) AuthorizationResponseCode p_responseCode := complement(ok) diff --git a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn index 345d14f0..cf5104a6 100644 --- a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn +++ b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn @@ -136,6 +136,7 @@ module LibItsSecurity_TypesAndValues { const charstring cc_taCert_CA3 := "CERT_IUT_CA3_AT"; const charstring cc_taCert_CC_AA := "CERT_IUT_CC_AA"; const charstring cc_iutCert_A := "CERT_IUT_A_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ + const charstring cc_iutCert_A_AA := "CERT_IUT_A_AA"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ const charstring cc_iutCert_B := "CERT_IUT_B_AT"; /** Default certificate, with circular region, to be used when secured messages are sent from TA to IUT */ const charstring cc_iutCert_C := "CERT_IUT_C_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ const charstring cc_iutCert_D := "CERT_IUT_D_AT"; /** Certificate with a polygonal region, to be used when secured messages are sent from TA to IUT */ -- GitLab From d35994abec9c87855fa869c8832b5be9bbea3d57 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 21 Feb 2019 09:30:17 -0800 Subject: [PATCH 194/320] Continue PKI ATS development --- ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn | 34 ++++ ttcn/Pki/LibItsPki_Functions.ttcn | 186 ++++++++++++------ ttcn/Pki/LibItsPki_Pixits.ttcn | 10 +- ttcn/Security/LibItsSecurity_Functions.ttcn | 3 + ttcn/Security/LibItsSecurity_Templates.ttcn | 11 ++ .../LibItsSecurity_TypesAndValues.ttcn | 3 +- 6 files changed, 182 insertions(+), 65 deletions(-) diff --git a/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn b/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn index de10b7a7..aa4aa70d 100644 --- a/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn +++ b/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn @@ -1,6 +1,7 @@ module LibItsPki_EncdecDeclarations { // LibIts + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; import from EtsiTs102941BaseTypes language "ASN.1:1997" all; import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; import from EtsiTs102941TypesAuthorization language "ASN.1:1997" all; @@ -90,4 +91,37 @@ module LibItsPki_EncdecDeclarations { external function fx_dec_AuthorizationValidationRequest(inout bitstring b, out EtsiTs102941TypesAuthorizationValidation.AuthorizationValidationRequest p) return integer with {extension "prototype(sliding) decode(PER)"} + /** + * @desc Encoding function for EtsiTs102941BaseTypes PublicKeys + * @param p The certificate to encode + * @return The encode message in OER format + */ + external function fx_enc_PublicKeys(in EtsiTs102941BaseTypes.PublicKeys p) return bitstring + with {extension "prototype(convert) encode(PER)"} + + external function fx_dec_PublicKeys(inout bitstring b, out EtsiTs102941BaseTypes.PublicKeys p) return integer + with {extension "prototype(sliding) decode(PER)"} + + /** + * @desc Encoding function for IEEE1609dot2BaseTypes PublicVerificationKey + * @param p The certificate to encode + * @return The encode message in OER format + */ + external function fx_enc_PublicVerificationKey(in IEEE1609dot2BaseTypes.PublicVerificationKey p) return bitstring + with {extension "prototype(convert) encode(PER)"} + + external function fx_dec_PublicVerificationKey(inout bitstring b, out IEEE1609dot2BaseTypes.PublicVerificationKey p) return integer + with {extension "prototype(sliding) decode(PER)"} + + /** + * @desc Encoding function for IEEE1609dot2BaseTypes PublicEncryptionKey + * @param p The certificate to encode + * @return The encode message in OER format + */ + external function fx_enc_PublicEncryptionKey(in IEEE1609dot2BaseTypes.PublicEncryptionKey p) return bitstring + with {extension "prototype(convert) encode(PER)"} + + external function fx_dec_PublicEncryptionKey(inout bitstring b, out IEEE1609dot2BaseTypes.PublicEncryptionKey p) return integer + with {extension "prototype(sliding) decode(PER)"} + } // End of module LibItsPki_EncdecDeclarations diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index c1468b22..a2a09565 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -327,9 +327,31 @@ module LibItsPki_Functions { out octetstring p_public_key_compressed, out integer p_compressed_mode ) return boolean { - if (PX_EC_ALG == e_nist_p256) { + if (PX_VE_ALG == e_nist_p256) { + f_generate_key_pair_nistp256(p_private_key, p_public_key_x, p_public_key_y, p_public_key_compressed, p_compressed_mode); + } else if (PX_VE_ALG == e_brainpool_p256_r1) { + f_generate_key_pair_brainpoolp256(p_private_key, p_public_key_x, p_public_key_y, p_public_key_compressed, p_compressed_mode); + } else if (PX_VE_ALG == e_brainpool_p384_r1) { + f_generate_key_pair_brainpoolp384(p_private_key, p_public_key_x, p_public_key_y, p_public_key_compressed, p_compressed_mode); + } else { + // error + return false; + } + + return true; + } + + function f_generate_key_pair_for_encryption( + in SecurityAlg p_algorithm, + out octetstring p_private_key, + out octetstring p_public_key_x, + out octetstring p_public_key_y, + out octetstring p_public_key_compressed, + out integer p_compressed_mode + ) return boolean { + if (p_algorithm == e_nist_p256) { f_generate_key_pair_nistp256(p_private_key, p_public_key_x, p_public_key_y, p_public_key_compressed, p_compressed_mode); - } else if (PX_EC_ALG == e_brainpool_p256_r1) { + } else if (p_algorithm == e_brainpool_p256_r1) { f_generate_key_pair_brainpoolp256(p_private_key, p_public_key_x, p_public_key_y, p_public_key_compressed, p_compressed_mode); } else { // error @@ -519,12 +541,12 @@ module LibItsPki_Functions { log("f_http_build_inner_ec_request: Public encryption key comp: ", v_compressed_enc_key_mode); p_salt := vc_eaWholeHash; if (PICS_SECPKI_REENROLMENT == false) { // This is the first enrolment, we used Factory keys - v_result := f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); + v_result := f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } else { // We use last valid EC certificate // TODO Retrieve EC certificate from the first enrolment instead of PX log("f_http_build_inner_ec_request: v_ec_private_key: ", PX_EC_PRIVATE_KEY); log("f_http_build_inner_ec_request: v_ec_hashed_id8: ", PX_EC_HASHED_ID8); - v_result := f_build_pki_secured_request_message_signed_with_pop(PX_EC_PRIVATE_KEY, valueof(m_signerIdentifier_digest(PX_EC_HASHED_ID8)), PX_EC_HASHED_ID8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); + v_result := f_build_pki_secured_request_message_signed_with_pop(PX_EC_PRIVATE_KEY, valueof(m_signerIdentifier_digest(PX_EC_HASHED_ID8)), PX_EC_HASHED_ID8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } if (v_result == false) { log("*** f_http_build_inner_ec_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); @@ -582,12 +604,12 @@ module LibItsPki_Functions { log("*** f_http_build_invalid_enrolment_request: Public encryption key comp: ", v_compressed_enc_key_mode); p_salt := vc_eaWholeHash; if (PICS_SECPKI_REENROLMENT == false) { // This is the first enrolment, we used Factory keys - v_ret_code := f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); + v_ret_code := f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } else { // We use last valid EC certificate // TODO Retrieve EC certificate from the first enrolment instead of PX log("f_http_build_inner_ec_request: v_ec_private_key: ", PX_EC_PRIVATE_KEY); log("f_http_build_inner_ec_request: v_ec_hashed_id8: ", PX_EC_HASHED_ID8); - v_ret_code := f_build_pki_secured_request_message_signed_with_pop(PX_EC_PRIVATE_KEY, valueof(m_signerIdentifier_digest(PX_EC_HASHED_ID8)), PX_EC_HASHED_ID8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); + v_ret_code := f_build_pki_secured_request_message_signed_with_pop(PX_EC_PRIVATE_KEY, valueof(m_signerIdentifier_digest(PX_EC_HASHED_ID8)), PX_EC_HASHED_ID8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } if (v_ret_code == false) { log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); @@ -727,13 +749,13 @@ module LibItsPki_Functions { p_salt := vc_aaWholeHash; log("*** f_http_build_authorization_request: p_salt: ", p_salt); if (PICS_PKI_AUTH_POP) { - if(f_build_pki_secured_request_message_signed_with_pop(p_private_key, valueof(m_signerIdentifier_self), vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { + if(f_build_pki_secured_request_message_signed_with_pop(p_private_key, valueof(m_signerIdentifier_self), vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), PX_EC_ALG_FOR_AT, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { log("*** f_http_build_authorization_request: ERROR: Failed to generate Authorization Request ***"); f_selfOrClientSyncAndVerdict("error", e_error); } } else { // Only encryption of EtsiTs102941Data/InnerAtRequest log("*** f_http_build_authorization_request: POP signature not applied"); - if(f_build_pki_secured_request_message_for_authorization(vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { + if(f_build_pki_secured_request_message_for_authorization(vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), PX_EC_ALG_FOR_AT, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { log("*** f_http_build_authorization_request: ERROR: Failed to generate Authorization Request ***"); f_selfOrClientSyncAndVerdict("error", e_error); } @@ -796,13 +818,13 @@ module LibItsPki_Functions { p_salt := vc_aaWholeHash; log("*** f_http_build_authorization_request_with_wrong_private_key: p_salt: ", p_salt); if (PICS_PKI_AUTH_POP) { - if(f_build_pki_secured_request_message_signed_with_pop(p_private_key, valueof(m_signerIdentifier_self), vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { + if(f_build_pki_secured_request_message_signed_with_pop(p_private_key, valueof(m_signerIdentifier_self), vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), PX_EC_ALG_FOR_AT, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { log("*** f_http_build_authorization_request_with_wrong_private_key: ERROR: Failed to generate Authorization Request ***"); f_selfOrClientSyncAndVerdict("error", e_error); } } else { // Only encryption of EtsiTs102941Data/InnerAtRequest log("*** f_http_build_authorization_request_with_wrong_private_key: POP signature not applied"); - if(f_build_pki_secured_request_message_for_authorization(vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { + if(f_build_pki_secured_request_message_for_authorization(vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), PX_EC_ALG_FOR_AT, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { log("*** f_http_build_authorization_request_with_wrong_private_key: ERROR: Failed to generate Authorization Request ***"); f_selfOrClientSyncAndVerdict("error", e_error); } @@ -932,7 +954,7 @@ module LibItsPki_Functions { log("f_http_build_authorization_validation_request: Public encryption key comp: ", v_compressed_enc_key_mode); p_salt := vc_eaWholeHash; log("f_http_build_authorization_validation_request: p_salt: ", p_salt); - if(f_build_pki_secured_request_message_signed_with_pop(p_private_key, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_validation_request(v_authorization_validation_request))), p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { + if(f_build_pki_secured_request_message_signed_with_pop(p_private_key, valueof(m_signerIdentifier_digest(vc_aaHashedId8)), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_validation_request(v_authorization_validation_request))), PX_EC_ALG_FOR_ATV, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { log("f_http_build_authorization_validation_request: Failed to generate Authorization Request"); f_selfOrClientSyncAndVerdict("error", e_error); } @@ -976,18 +998,18 @@ module LibItsPki_Functions { v_ecc_p256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(p_public_key_compressed)); } - if (PX_EC_ALG == e_nist_p256) { + if (PX_EC_ALG_FOR_EC == e_nist_p256) { v_public_verification_key := valueof( m_publicVerificationKey_ecdsaNistP256( v_ecc_p256_curve_point )); - } else if (PX_EC_ALG == e_brainpool_p256_r1) { + } else if (PX_EC_ALG_FOR_EC == e_brainpool_p256_r1) { v_public_verification_key := valueof( m_publicVerificationKey_ecdsaBrainpoolP256r1( v_ecc_p256_curve_point )); } else { - log("f_generate_ec_certificate: Wrong encryption algorithm, check PX_EC_ALG"); + log("f_generate_ec_certificate: Wrong encryption algorithm, check PX_EC_ALG_FOR_xx"); return false; } v_cert := m_etsiTs103097Certificate( @@ -1127,19 +1149,19 @@ module LibItsPki_Functions { var bitstring v_enc_msg; var PublicVerificationKey v_public_verification_key; - if (PX_EC_ALG == e_nist_p256) { + if (PX_EC_ALG_FOR_AT == e_nist_p256) { v_public_verification_key := valueof( m_publicVerificationKey_ecdsaNistP256( p_inner_ec_request.publicKeys.verificationKey.ecdsaNistP256 )); - } else if (PX_EC_ALG == e_brainpool_p256_r1) { + } else if (PX_EC_ALG_FOR_AT == e_brainpool_p256_r1) { v_public_verification_key := valueof( m_publicVerificationKey_ecdsaBrainpoolP256r1( p_inner_ec_request.publicKeys.verificationKey.ecdsaBrainpoolP256r1 )); } else { // Error - log("f_generate_ec_certificate: Wrong encryption algorithm, check PX_EC_ALG"); + log("f_generate_ec_certificate: Wrong encryption algorithm, check PX_EC_ALG_FOR_xx"); return false; } v_cert := m_etsiTs103097Certificate( @@ -1300,19 +1322,19 @@ module LibItsPki_Functions { ), m_certificateSubjectAttributes( { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs - valueof(m_appPermissions(c_its_aid_SCR, { bitmapSsp := '00C0'O })) + valueof(m_appPermissions(c_its_aid_SCR, { bitmapSsp := '01C0'O })) }, m_validityPeriod( f_getCurrentTime() / 1000, - m_duration_years(1) // TODO Use PIXIT + m_duration_in_hours(120) // TODO Use PIXIT ), - m_geographicRegion_identifiedRegion( + omit/*YANN TO restore m_geographicRegion_identifiedRegion( { m_identifiedRegion_country_only(12), // TODO Use PIXIT m_identifiedRegion_country_only(34) // TODO Use PIXIT } - ), - 'C0'O // TODO Use PIXIT + )*/, + omit/*'C0'O*/ // TODO Use PIXIT ) ) ); @@ -1476,7 +1498,9 @@ module LibItsPki_Functions { var octetstring public_enc_key_x; var octetstring public_enc_key_y; var Oct32 v_hmac_key; - var octetstring v_message_to_tag; + var PublicVerificationKey v_verification_tag; + var PublicEncryptionKey v_encryption_tag; + var octetstring v_encoded_tag; var Oct16 v_key_tag; var octetstring v_hash_shared_at_request; var template (value) ToBeSignedData v_tbs; @@ -1488,7 +1512,7 @@ module LibItsPki_Functions { var Signature v_signature; var SequenceOfPsidSsp v_appPermissions := { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs valueof(m_appPermissions(c_its_aid_CAM, { bitmapSsp := '01FFFC'O })), - valueof(m_appPermissions(c_its_aid_DENM, { bitmapSsp := '01FFFFFF'O })) + valueof(m_appPermissions(c_its_aid_DENM, { bitmapSsp := '01FFFFFF'O })) // TODO Use PIXIT }; // Generate verification keys for the certificate to be requested @@ -1501,7 +1525,7 @@ module LibItsPki_Functions { log ("f_generate_inner_at_request: AT verification public compressed mode: ", p_compressed_key_mode); // Generate encryption keys for the certificate to be requested if (PX_INCLUDE_ENCRYPTION_KEYS) { - if (f_generate_key_pair(p_private_enc_key, v_public_enc_key_x, v_public_enc_key_y, p_public_compressed_enc_key, p_compressed_enc_key_mode) == false) { + if (f_generate_key_pair_for_encryption(PX_EC_ALG_FOR_AT, p_private_enc_key, v_public_enc_key_x, v_public_enc_key_y, p_public_compressed_enc_key, p_compressed_enc_key_mode) == false) { log("f_generate_inner_at_request: Failed to generate encryption key"); return false; } else { @@ -1533,23 +1557,56 @@ module LibItsPki_Functions { log("f_generate_inner_at_request: v_hmac_key= ", v_hmac_key); // Generate tag based on the concatenation of verification keys & encryption keys - if (p_compressed_key_mode == 0) { - v_message_to_tag := '02'O & p_public_key_compressed; + if (PX_VE_ALG == e_nist_p256) { + if (p_compressed_key_mode == 0) { + v_verification_tag.ecdsaNistP256.compressed_y_0 := p_public_key_compressed; + } else { + v_verification_tag.ecdsaNistP256.compressed_y_1 := p_public_key_compressed; + } + } else if (PX_VE_ALG == e_brainpool_p256_r1) { + if (p_compressed_key_mode == 0) { + v_verification_tag.ecdsaBrainpoolP256r1.compressed_y_0 := p_public_key_compressed; + } else { + v_verification_tag.ecdsaBrainpoolP256r1.compressed_y_1 := p_public_key_compressed; + } + } else if (PX_VE_ALG == e_brainpool_p384_r1) { + if (p_compressed_key_mode == 0) { + v_verification_tag.ecdsaBrainpoolP384r1.compressed_y_0 := p_public_key_compressed; + } else { + v_verification_tag.ecdsaBrainpoolP384r1.compressed_y_1 := p_public_key_compressed; + } } else { - v_message_to_tag := '03'O & p_public_key_compressed; + log("f_generate_inner_at_request: Failed to generate HMAC tag"); + return false; } + log("f_generate_inner_at_request: v_verification_tag= ", v_verification_tag); + v_encoded_tag := bit2oct(encvalue(v_verification_tag)); if (PX_INCLUDE_ENCRYPTION_KEYS) { - if (p_compressed_enc_key_mode == 0) { - v_message_to_tag := v_message_to_tag & '02'O & p_public_compressed_enc_key; + v_encryption_tag.supportedSymmAlg := aes128Ccm; + if (PX_EC_ALG_FOR_AT == e_nist_p256) { + if (p_compressed_enc_key_mode == 0) { + v_encryption_tag.publicKey.eciesNistP256.compressed_y_0 := p_public_compressed_enc_key; + } else { + v_encryption_tag.publicKey.eciesNistP256.compressed_y_1 := p_public_compressed_enc_key; + } + } else if (PX_EC_ALG_FOR_AT == e_brainpool_p256_r1) { + if (p_compressed_enc_key_mode == 0) { + v_encryption_tag.publicKey.eciesBrainpoolP256r1.compressed_y_0 := p_public_compressed_enc_key; + } else { + v_encryption_tag.publicKey.eciesBrainpoolP256r1.compressed_y_1 := p_public_compressed_enc_key; + } } else { - v_message_to_tag := v_message_to_tag & '03'O & p_public_compressed_enc_key; + log("f_generate_inner_at_request: Failed to generate HMAC tag (enc)"); + return false; } + log("f_generate_inner_at_request: v_encryption_tag= ", v_encryption_tag); + v_encoded_tag := v_encoded_tag & bit2oct(encvalue(v_encryption_tag)); } - log("f_generate_inner_at_request: v_message_to_tag= ", v_message_to_tag); // FIXME encryption keys could be optional + log("f_generate_inner_at_request: v_encoded_tag= ", v_encoded_tag); v_key_tag := substr( fx_hmac_sha256( // TODO Rename and use a wrapper function v_hmac_key, - v_message_to_tag + v_encoded_tag ), 0, 16); // Leftmost 128 bits of the HMAC-SHA256 tag computed previously @@ -1663,7 +1720,7 @@ module LibItsPki_Functions { var EncryptedDataEncryptionKey v_encrypted_data_encryption_key; // Use EA certificate for the encryption - if (PX_EC_ALG == e_nist_p256) { + if (PX_EC_ALG_FOR_AT == e_nist_p256) { if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0)) { v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0; v_compressed_mode := 0; @@ -1687,7 +1744,7 @@ module LibItsPki_Functions { v_encrypted_sym_key, v_authentication_vector ))); - } else if (PX_EC_ALG == e_brainpool_p256_r1) { + } else if (PX_EC_ALG_FOR_AT == e_brainpool_p256_r1) { if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0)) { v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0; v_compressed_mode := 0; @@ -2012,6 +2069,7 @@ module LibItsPki_Functions { in integer p_compressed_mode, in octetstring p_salt, in octetstring p_pki_message, + in SecurityAlg p_enc_algorithm, // TODO Use RCA to check encryption alg out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, @@ -2039,6 +2097,7 @@ module LibItsPki_Functions { log(">>> f_build_pki_secured_request_message_signed_with_pop: p_public_key_compressed= ", p_public_key_compressed); log(">>> f_build_pki_secured_request_message_signed_with_pop: p_salt= ", p_salt); log(">>> f_build_pki_secured_request_message_signed_with_pop: p_pki_message= ", p_pki_message); + log(">>> f_build_pki_secured_request_message_signed_with_pop: p_enc_algorithm= ", p_enc_algorithm); // Signed the encoded PKI message v_tbs := m_toBeSignedData( @@ -2048,15 +2107,14 @@ module LibItsPki_Functions { m_headerInfo_inner_pki_request(-, (f_getCurrentTime() * 1000)/*us*/) ); log("f_build_pki_secured_request_message_signed_with_pop: signer: ", p_signer_identifier); - if (PICS_SECPKI_REENROLMENT == false) { // This is the first enrolment, we used Factory keys - //if (ischosen(p_signer_identifier.self_)) { + if (ischosen(p_signer_identifier.self_)) { v_tbs_signed := f_signWithEcdsa(bit2oct(encvalue(v_tbs)), int2oct(0, 32), p_private_key); } else { - /*var charstring v_certificate_id; + var charstring v_certificate_id; var octetstring v_hash; fx_readCertificateFromDigest(p_signer_identifier.digest, v_certificate_id); // TODO Add a wrapper function - f_getCertificateHash(v_certificate_id, v_hash);*/ - v_tbs_signed := f_signWithEcdsa(bit2oct(encvalue(v_tbs)), PX_EC_HASH, p_private_key); + f_getCertificateHash(v_certificate_id, v_hash); + v_tbs_signed := f_signWithEcdsa(bit2oct(encvalue(v_tbs)), v_hash, p_private_key); } // Add the signature and create EtsiTs103097Data-Signed data structure if (PX_VE_ALG == e_nist_p256) { @@ -2109,9 +2167,9 @@ module LibItsPki_Functions { p_salt := '77C0637C3558B3238FDE1EEC376DA080BE4076FB8491CA0F8C19FD34DF298CEB'O; } - if (PX_EC_ALG == e_nist_p256) { + if (p_enc_algorithm == e_nist_p256) { v_encrypted_request := f_encryptWithEciesNistp256WithSha256(v_encoded_request, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, PICS_SEC_FIXED_KEYS); - } else if (PX_EC_ALG == e_brainpool_p256_r1) { + } else if (p_enc_algorithm == e_brainpool_p256_r1) { v_encrypted_request := f_encryptWithEciesBrainpoolp256WithSha256(v_encoded_request, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, PICS_SEC_FIXED_KEYS); } else { log("f_build_pki_secured_request_message_signed_with_pop: Wrong encryption variant"); @@ -2135,7 +2193,7 @@ module LibItsPki_Functions { } else { v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_compressed_ephemeral_key)); } - if (PX_EC_ALG == e_nist_p256) { + if (p_enc_algorithm == e_nist_p256) { v_encrypted_data_encryption_key := valueof( m_encryptedDataEncryptionKey_eciesNistP256( m_evciesP256EncryptedKey( @@ -2143,7 +2201,7 @@ module LibItsPki_Functions { p_encrypted_sym_key, p_authentication_vector ))); - } else if (PX_EC_ALG == e_brainpool_p256_r1) { + } else if (p_enc_algorithm == e_brainpool_p256_r1) { v_encrypted_data_encryption_key := valueof( m_encryptedDataEncryptionKey_eciesBrainpoolP256r1( m_evciesP256EncryptedKey( @@ -2205,6 +2263,7 @@ module LibItsPki_Functions { in integer p_compressed_mode, in octetstring p_salt, in octetstring p_pki_message, + in SecurityAlg p_enc_algorithm, out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, @@ -2227,9 +2286,9 @@ module LibItsPki_Functions { if (PICS_SEC_FIXED_KEYS) { p_salt := '77C0637C3558B3238FDE1EEC376DA080BE4076FB8491CA0F8C19FD34DF298CEB'O; } - if (PX_EC_ALG == e_nist_p256) { + if (p_enc_algorithm == e_nist_p256) { v_encrypted_request := f_encryptWithEciesNistp256WithSha256(p_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, PICS_SEC_FIXED_KEYS); - } else if (PX_EC_ALG == e_brainpool_p256_r1) { + } else if (p_enc_algorithm == e_brainpool_p256_r1) { v_encrypted_request := f_encryptWithEciesBrainpoolp256WithSha256(p_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, PICS_SEC_FIXED_KEYS); } else { log("f_build_pki_secured_request_message: Wrong encryption variant"); @@ -2253,7 +2312,7 @@ module LibItsPki_Functions { } else { v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_compressed_ephemeral_key)); } - if (PX_EC_ALG == e_nist_p256) { + if (p_enc_algorithm == e_nist_p256) { v_encrypted_data_encryption_key := valueof( m_encryptedDataEncryptionKey_eciesNistP256( m_evciesP256EncryptedKey( @@ -2261,7 +2320,7 @@ module LibItsPki_Functions { p_encrypted_sym_key, p_authentication_vector ))); - } else if (PX_EC_ALG == e_brainpool_p256_r1) { + } else if (p_enc_algorithm == e_brainpool_p256_r1) { v_encrypted_data_encryption_key := valueof( m_encryptedDataEncryptionKey_eciesBrainpoolP256r1( m_evciesP256EncryptedKey( @@ -2309,6 +2368,7 @@ module LibItsPki_Functions { in integer p_compressed_mode, in octetstring p_salt, in octetstring p_pki_message, + in SecurityAlg p_enc_algorithm, out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, @@ -2327,7 +2387,7 @@ module LibItsPki_Functions { var EncryptedDataEncryptionKey v_encrypted_data_encryption_key; var bitstring v_enc_value; - log(">>> f_build_pki_secured_request_message"); + log(">>> f_build_pki_secured_request_message_for_authorization"); // Add Ieee1609Dot2Data layer v_unsecured_data := valueof(m_etsiTs103097Data_unsecured(p_pki_message)); @@ -2337,33 +2397,33 @@ module LibItsPki_Functions { if (PICS_SEC_FIXED_KEYS) { p_salt := '77C0637C3558B3238FDE1EEC376DA080BE4076FB8491CA0F8C19FD34DF298CEB'O; } - if (PX_EC_ALG == e_nist_p256) { + if (p_enc_algorithm == e_nist_p256) { v_encrypted_request := f_encryptWithEciesNistp256WithSha256(v_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, PICS_SEC_FIXED_KEYS); - } else if (PX_EC_ALG == e_brainpool_p256_r1) { + } else if (p_enc_algorithm == e_brainpool_p256_r1) { v_encrypted_request := f_encryptWithEciesBrainpoolp256WithSha256(v_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, PICS_SEC_FIXED_KEYS); } else { - log("f_build_pki_secured_request_message: Wrong encryption variant"); + log("f_build_pki_secured_request_message_for_authorization: Wrong encryption variant"); return false; } - log("f_build_pki_secured_request_message: p_aes_sym_key= ", p_aes_sym_key); - log("f_build_pki_secured_request_message: p_encrypted_sym_key= ", p_encrypted_sym_key); - log("f_build_pki_secured_request_message: p_authentication_vector= ", p_authentication_vector); - log("f_build_pki_secured_request_message: p_nonce= ", p_nonce); - log("f_build_pki_secured_request_message: p_recipientId= ", p_recipientId); + log("f_build_pki_secured_request_message_for_authorization: p_aes_sym_key= ", p_aes_sym_key); + log("f_build_pki_secured_request_message_for_authorization: p_encrypted_sym_key= ", p_encrypted_sym_key); + log("f_build_pki_secured_request_message_for_authorization: p_authentication_vector= ", p_authentication_vector); + log("f_build_pki_secured_request_message_for_authorization: p_nonce= ", p_nonce); + log("f_build_pki_secured_request_message_for_authorization: p_recipientId= ", p_recipientId); if (p_recipientId == int2oct(0, 8)) { - log("f_build_pki_secured_request_message: f_hashWithSha256(v_encrypted_sym_key)= ", f_hashWithSha256(p_encrypted_sym_key)); + log("f_build_pki_secured_request_message_for_authorization: f_hashWithSha256(v_encrypted_sym_key)= ", f_hashWithSha256(p_encrypted_sym_key)); v_recipientId := f_HashedId8FromSha256(f_hashWithSha256(p_encrypted_sym_key)); } else { v_recipientId := p_recipientId; } - log("f_build_pki_secured_request_message: v_recipientId= ", v_recipientId); + log("f_build_pki_secured_request_message_for_authorization: v_recipientId= ", v_recipientId); // Fill Certificate template with the public compressed keys (canonical form) if (v_public_compressed_ephemeral_mode == 0) { v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); } else { v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_compressed_ephemeral_key)); } - if (PX_EC_ALG == e_nist_p256) { + if (p_enc_algorithm == e_nist_p256) { v_encrypted_data_encryption_key := valueof( m_encryptedDataEncryptionKey_eciesNistP256( m_evciesP256EncryptedKey( @@ -2371,7 +2431,7 @@ module LibItsPki_Functions { p_encrypted_sym_key, p_authentication_vector ))); - } else if (PX_EC_ALG == e_brainpool_p256_r1) { + } else if (p_enc_algorithm == e_brainpool_p256_r1) { v_encrypted_data_encryption_key := valueof( m_encryptedDataEncryptionKey_eciesBrainpoolP256r1( m_evciesP256EncryptedKey( @@ -2407,9 +2467,9 @@ module LibItsPki_Functions { } else { p_request_hash := f_hashWithSha256(bit2oct(v_enc_value)); } - log("f_build_pki_secured_request_message: p_request_hash= ", p_request_hash); + log("f_build_pki_secured_request_message_for_authorization: p_request_hash= ", p_request_hash); - log("<<< f_build_pki_secured_request_message: ", p_ieee1609dot2_signed_and_encrypted_data); + log("<<< f_build_pki_secured_request_message_for_authorization: ", p_ieee1609dot2_signed_and_encrypted_data); return true; } // End of function f_build_pki_secured_request_message_for_authorization diff --git a/ttcn/Pki/LibItsPki_Pixits.ttcn b/ttcn/Pki/LibItsPki_Pixits.ttcn index 22d42fc1..65ffc419 100644 --- a/ttcn/Pki/LibItsPki_Pixits.ttcn +++ b/ttcn/Pki/LibItsPki_Pixits.ttcn @@ -38,7 +38,15 @@ module LibItsPki_Pixits { /** * @desc Indicate which encryption algorithem to be used */ - modulepar SecurityAlg PX_EC_ALG := e_nist_p256; + modulepar SecurityAlg PX_EC_ALG_FOR_EC := e_nist_p256; // TODO Use RCA to determine encryption algorithm? + /** + * @desc Indicate which encryption algorithem to be used + */ + modulepar SecurityAlg PX_EC_ALG_FOR_AT := e_nist_p256; + /** + * @desc Indicate which encryption algorithem to be used + */ + modulepar SecurityAlg PX_EC_ALG_FOR_ATV := e_nist_p256; /** * @desc Indicate which verification algorithem to be used diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index f3cdaa50..f66bbf62 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -624,6 +624,8 @@ module LibItsSecurity_Functions { out Oct32 p_publicKeyCompressed, out integer p_compressed_mode ) return boolean { + log(">>> f_generate_key_pair_nistp256"); + if (PICS_SEC_FIXED_KEYS) { // Debug mode: Use fixed values p_privateKey := '43481BC44C073C1432DB6EC4F0EF57062BEA08E4C19F811567325AD1FD1C6577'O; p_publicKeyX := '0B5D74B033531C51D17B4F218DD4E39289AE4BF2EE3D7BAB7C07DAF0C14F0317'O; @@ -653,6 +655,7 @@ module LibItsSecurity_Functions { out Oct32 p_publicKeyCompressed, out integer p_compressed_mode ) return boolean { + log(">>> f_generate_key_pair_brainpoolp256"); return fx_generateKeyPair_brainpoolp256(p_privateKey, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressed_mode); } diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index 73fe3323..22e654de 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -1804,6 +1804,17 @@ module LibItsSecurity_Templates { seconds := p_duration } // End of template m_duration_in_seconds + /** + * @desc Send template for Duration (in hours) + * @param p_duration The duration value + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.18 Duration + */ + template (value) Duration m_duration_in_hours( + in template (value) Int16 p_duration + ) := { + hours := p_duration + } // End of template m_duration_in_hours + /** * @desc Receive template for Duration (in seconds) * @param p_duration The duration value diff --git a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn index cf5104a6..cc01b1c6 100644 --- a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn +++ b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn @@ -22,12 +22,13 @@ module LibItsSecurity_TypesAndValues { // Test Adapter certificates & private keys - Valid behavior const charstring cc_taCert_A := "CERT_TS_A_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_A_AA := "CERT_TS_A_AA"; const charstring cc_taCert_A1 := "CERT_TS_A_A1_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_A2 := "CERT_TS_A_A2_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_A3 := "CERT_TS_A_A3_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_B := "CERT_TS_B_AT"; /** Default certificate, with circular region, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_B1 := "CERT_TS_B_1_AT"; - const charstring cc_taCert_B_AA := "CERT_TS_B_1_AA"; + const charstring cc_taCert_B_AA := "CERT_TS_B_1_AA"; const charstring cc_taCert_C := "CERT_TS_C_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_C1 := "CERT_TS_C1_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_CA1 := "CERT_TS_CA1_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ -- GitLab From 4cddd0bd67aa6534337b775739b3878590b9ebcc Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 22 Feb 2019 01:42:26 -0800 Subject: [PATCH 195/320] Matching empty payload in TC_GEONW_FDV_SHB_BV_01 et.al. --- ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn | 6 +++--- ttcn/Pki/LibItsPki_Functions.ttcn | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn index 05734f4d..061b8e75 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn @@ -1277,7 +1277,7 @@ module LibItsGeoNetworking_Templates { p_hopLimit ), extendedHeader := mw_shbHeader(p_sourceLongPosVec), - payload := ? + payload := * } } // end group geoNwPacketShbTemplates @@ -1323,7 +1323,7 @@ module LibItsGeoNetworking_Templates { m_tsbHeaderType ), extendedHeader := mw_tsbHeader(p_seqNumber, p_sourceLongPosVec), - payload := ? + payload := * } /** @@ -1403,7 +1403,7 @@ module LibItsGeoNetworking_Templates { m_saHeaderType_sa ), extendedHeader := mw_saHeader(p_seqNumber, p_sourceLongPosVec), - payload := ? + payload := * } /** diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index a2a09565..b6148fad 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -110,8 +110,8 @@ module LibItsPki_Functions { // Setup AA certificate shared with PKI AA entity f_readCertificate(p_aa_certificate_id, vc_aaCertificate); - f_readSigningKey(p_ea_certificate_id, vc_aaPrivateKey); // TODO To be removed - f_readEncryptingKey(p_ea_certificate_id, vc_aaPrivateEncKey); + f_readSigningKey(p_aa_certificate_id, vc_aaPrivateKey); // Required for AuthorizationValidation request + f_readEncryptingKey(p_aa_certificate_id, vc_aaPrivateEncKey); f_getCertificateDigest(p_aa_certificate_id, vc_aaHashedId8); f_getCertificateHash(p_aa_certificate_id, vc_aaWholeHash); log("f_cfHttpUp: vc_aaPrivateKey= ", vc_aaPrivateKey); @@ -915,7 +915,6 @@ module LibItsPki_Functions { function f_http_build_authorization_validation_request( in InnerAtRequest p_inner_at_request, - in octetstring p_private_key, in octetstring p_public_key_compressed, in integer p_compressed_key_mode, in octetstring p_private_enc_key, @@ -954,7 +953,7 @@ module LibItsPki_Functions { log("f_http_build_authorization_validation_request: Public encryption key comp: ", v_compressed_enc_key_mode); p_salt := vc_eaWholeHash; log("f_http_build_authorization_validation_request: p_salt: ", p_salt); - if(f_build_pki_secured_request_message_signed_with_pop(p_private_key, valueof(m_signerIdentifier_digest(vc_aaHashedId8)), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_validation_request(v_authorization_validation_request))), PX_EC_ALG_FOR_ATV, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { + if(f_build_pki_secured_request_message_signed_with_pop(vc_aaPrivateKey, valueof(m_signerIdentifier_digest(vc_aaHashedId8)), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_validation_request(v_authorization_validation_request))), PX_EC_ALG_FOR_ATV, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { log("f_http_build_authorization_validation_request: Failed to generate Authorization Request"); f_selfOrClientSyncAndVerdict("error", e_error); } -- GitLab From e0f2ad9fa39772f3c690b83c8b6fd4a95a125381 Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 22 Feb 2019 07:01:41 -0800 Subject: [PATCH 196/320] Bug fixed on pskRecipInfog content --- ttcn/Pki/LibItsPki_Functions.ttcn | 44 ++++++++++++++----------------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index b6148fad..b1e470ff 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -1,4 +1,4 @@ -/** + /** * @author ETSI / STF544 * @version $URL$ * $Id$ @@ -385,10 +385,10 @@ module LibItsPki_Functions { ) return boolean { var boolean v_ret := false; - log(" >>> f_verifyEcdsa: p_tbs", p_tbs); - log(" >>> f_verifyEcdsa: p_issuer", p_issuer); - log(" >>> f_verifyEcdsa: p_signature_", p_signature_); - log(" >>> f_verifyEcdsa: p_verification_key", p_verification_key); + log(">>> f_verifyEcdsa: p_tbs= ", p_tbs); + log(">>> f_verifyEcdsa: p_issuer= ", p_issuer); + log(">>> f_verifyEcdsa: p_signature_= ", p_signature_); + log(">>> f_verifyEcdsa: p_verification_key= ", p_verification_key); if (ischosen(p_verification_key.ecdsaNistP256)) { if (ischosen(p_verification_key.ecdsaNistP256.compressed_y_0)) { @@ -1020,12 +1020,12 @@ module LibItsPki_Functions { ), m_validityPeriod( f_getCurrentTime() / 1000, - m_duration_years(1) + m_duration_in_hours(120) ), m_geographicRegion_identifiedRegion( { - m_identifiedRegion_country_only(12), - m_identifiedRegion_country_only(34) + m_identifiedRegion_country_only(250), // TODO PIXIT + m_identifiedRegion_country_only(380) } ) ) @@ -1172,12 +1172,12 @@ module LibItsPki_Functions { ), m_validityPeriod( f_getCurrentTime() / 1000, - m_duration_years(1) + m_duration_in_hours(120) ), m_geographicRegion_identifiedRegion( { - m_identifiedRegion_country_only(12), - m_identifiedRegion_country_only(34) + m_identifiedRegion_country_only(250), // TODO PIXIT + m_identifiedRegion_country_only(380) } ) ) @@ -1327,13 +1327,13 @@ module LibItsPki_Functions { f_getCurrentTime() / 1000, m_duration_in_hours(120) // TODO Use PIXIT ), - omit/*YANN TO restore m_geographicRegion_identifiedRegion( + m_geographicRegion_identifiedRegion( { - m_identifiedRegion_country_only(12), // TODO Use PIXIT - m_identifiedRegion_country_only(34) // TODO Use PIXIT + m_identifiedRegion_country_only(250), // TODO Use PIXIT + m_identifiedRegion_country_only(380) // TODO Use PIXIT } - )*/, - omit/*'C0'O*/ // TODO Use PIXIT + ), + '00'O//'C0'O // TODO Use PIXIT ) ) ); @@ -1622,13 +1622,7 @@ module LibItsPki_Functions { p_ec_certificate.toBeSigned.certRequestPermissions, p_ec_certificate.toBeSigned.id, p_ec_certificate.toBeSigned.validityPeriod, - p_ec_certificate.toBeSigned.region,/*m_geographicRegion_identifiedRegion( - { - m_identifiedRegion_country_only(250), - m_identifiedRegion_country_only(380) - } - ) -,*/ + p_ec_certificate.toBeSigned.region, p_ec_certificate.toBeSigned.assuranceLevel ))) // Desired attributes ); @@ -1897,6 +1891,7 @@ module LibItsPki_Functions { var Oct32 v_request_hash; var Oct16 v_encrypted_sym_key; var Oct16 v_aes_sym_key; + var HashedId8 v_aes_sym_key_hashed_id8; var Oct16 v_authentication_vector; var Oct12 v_nonce; var octetstring v_salt; @@ -1907,6 +1902,7 @@ module LibItsPki_Functions { log(">>> f_await_http_inner_ec_request_response: p_strict_checks=", p_strict_checks); f_http_build_inner_ec_request(p_private_key, p_compressed_public_key, p_compressed_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, v_salt, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash); + v_aes_sym_key_hashed_id8 := f_HashedId8FromSha256(f_hashWithSha256('80'O & v_aes_sym_key)); // Used to macth the response f_init_default_headers_list(-, "inner_ec_request", v_headers); f_http_send( v_headers, @@ -1927,7 +1923,7 @@ module LibItsPki_Functions { mw_binary_body_ieee1609dot2_data( mw_enrolmentResponseMessage( mw_encryptedData( - -, + { *, mw_recipientInfo_pskRecipInfo(v_aes_sym_key_hashed_id8), * }, mw_SymmetricCiphertext_aes128ccm )))))), v_response -- GitLab From aa689ac9f86aa49a1306dda851681e8d93c8e631 Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 25 Feb 2019 22:19:33 -0800 Subject: [PATCH 197/320] ITS-CMS6 Plugtest validation --- ttcn/Http/LibItsHttp_TestSystem.ttcn | 7 +- ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn | 11 + ttcn/Pki/LibItsPki_Functions.ttcn | 818 +++++++++++++++--- ttcn/Pki/LibItsPki_Templates.ttcn | 9 + .../LibItsSecurity_TypesAndValues.ttcn | 1 + 5 files changed, 720 insertions(+), 126 deletions(-) diff --git a/ttcn/Http/LibItsHttp_TestSystem.ttcn b/ttcn/Http/LibItsHttp_TestSystem.ttcn index b94479b4..fcfd65dc 100644 --- a/ttcn/Http/LibItsHttp_TestSystem.ttcn +++ b/ttcn/Http/LibItsHttp_TestSystem.ttcn @@ -14,6 +14,9 @@ module LibItsHttp_TestSystem { // LibCommon import from LibCommon_Sync all; import from LibCommon_Time all; + + // LibItsCommon + import from LibItsCommon_TestSystem all; // LibItsHttp import from LibItsHttp_TypesAndValues all; @@ -22,10 +25,8 @@ module LibItsHttp_TestSystem { inout HttpMessage; } - type component HttpComponent extends SelfSyncComp { // FIXME To be rename into HttpTest + type component HttpComponent extends ItsBaseComponent { // FIXME To be rename into HttpTest port HttpPort httpPort; - timer tc_ac := PX_TAC; - timer tc_noac := PX_TNOAC; } // End of component HttpComponent type component HttpTestAdapter { // FIXME To be rename into HttpTestSystem diff --git a/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn b/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn index aa4aa70d..a1dcf4f8 100644 --- a/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn +++ b/ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn @@ -91,6 +91,17 @@ module LibItsPki_EncdecDeclarations { external function fx_dec_AuthorizationValidationRequest(inout bitstring b, out EtsiTs102941TypesAuthorizationValidation.AuthorizationValidationRequest p) return integer with {extension "prototype(sliding) decode(PER)"} + /** + * @desc Encoding function for EtsiTs102941TypesAuthorizationValidation AuthorizationValidationResponse + * @param p The certificate to encode + * @return The encode message in OER format + */ + external function fx_enc_AuthorizationValidationResponse(in EtsiTs102941TypesAuthorizationValidation.AuthorizationValidationResponse p) return bitstring + with {extension "prototype(convert) encode(PER)"} + + external function fx_dec_AuthorizationValidationResponse(inout bitstring b, out EtsiTs102941TypesAuthorizationValidation.AuthorizationValidationResponse p) return integer + with {extension "prototype(sliding) decode(PER)"} + /** * @desc Encoding function for EtsiTs102941BaseTypes PublicKeys * @param p The certificate to encode diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index b1e470ff..772d222e 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -1,4 +1,4 @@ - /** +/** * @author ETSI / STF544 * @version $URL$ * $Id$ @@ -224,8 +224,6 @@ module LibItsPki_Functions { group ut_port { function f_utInitializeIut(template (value) UtPkiInitialize p_init) runs on ItsPkiItss { - timer tc_wait := PX_TAC; - utPort.send(p_init); tc_wait.start; alt { @@ -833,6 +831,138 @@ module LibItsPki_Functions { log("*** f_http_build_authorization_request_with_wrong_private_key: DEBUG: p_request_hash= ", p_request_hash); } // End of function f_http_build_authorization_request_with_wrong_private_key + function f_http_build_authorization_request_with_wrong_pop( + in Certificate p_ec_certificate, // Enrolment credentials certificate + in octetstring p_ec_private_key, + out octetstring p_private_key, + out octetstring p_public_key_compressed, + out integer p_compressed_key_mode, + out octetstring p_private_enc_key, + out octetstring p_public_compressed_enc_key, + out integer p_compressed_enc_key_mode, + out Oct16 p_aes_sym_key, + out Oct16 p_encrypted_sym_key, + out Oct16 p_authentication_vector, + out Oct12 p_nonce, + out octetstring p_salt, + out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, + out Oct32 p_request_hash + ) runs on ItsPkiHttp { + // Local variables + var octetstring v_public_key_x; + var octetstring v_public_key_y; + var octetstring v_public_enc_key_x; + var octetstring v_public_enc_key_y; + var octetstring v_public_enc_key; + var integer v_compressed_enc_key_mode; + var InnerAtRequest v_inner_at_request; + var Ieee1609Dot2Data v_inner_at_request_data; + var InnerAtRequest v_authorization_request; + var bitstring v_authorization_request_msg; + + // Generate the InnerAtRequest + if (f_generate_inner_at_request(vc_aaCertificate, vc_aaHashedId8, vc_eaCertificate, vc_eaWholeHash/*salt*/, vc_eaHashedId8, p_ec_certificate, p_ec_private_key, p_private_key, p_public_key_compressed, p_compressed_key_mode, p_private_enc_key, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_inner_at_request) == false) { + log("*** f_http_build_authorization_request_with_wrong_pop: ERROR: Failed to generate AuthorizationValidationRequest ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + return; + } + log("f_http_build_authorization_request_with_wrong_pop: v_inner_at_request= ", v_inner_at_request); + + // Secure InnerAtRequest message + if (f_extract_enc_key(vc_aaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { + log("*** f_http_build_authorization_request_with_wrong_pop: ERROR: Non canonical AA certificate ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + if (PICS_SEC_FIXED_KEYS) { // Debug mode: Use fixed values + v_public_enc_key := 'DD4F6B0DF57C6E3BD0E32B565CACA1D858CEB08A5C2BBAB2C23E203C6DE697FF'O; + v_compressed_enc_key_mode := 0; + } + log("*** f_http_build_authorization_request_with_wrong_pop: Public encryption key: ", v_public_enc_key); + log("*** f_http_build_authorization_request_with_wrong_pop: Public encryption key comp: ", v_compressed_enc_key_mode); + p_salt := vc_aaWholeHash; + log("*** f_http_build_authorization_request_with_wrong_pop: p_salt: ", p_salt); + if (PICS_PKI_AUTH_POP) { + if(f_build_pki_secured_request_message_signed_with_pop(p_ec_private_key/*Use the wrong verification private key*/, valueof(m_signerIdentifier_self), vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), PX_EC_ALG_FOR_AT, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { + log("*** f_http_build_authorization_request_with_wrong_pop: ERROR: Failed to generate Authorization Request ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + } else { // Only encryption of EtsiTs102941Data/InnerAtRequest + log("*** f_http_build_authorization_request_with_wrong_pop: POP signature not applied"); + if(f_build_pki_secured_request_message_for_authorization(vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), PX_EC_ALG_FOR_AT, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { + log("*** f_http_build_authorization_request_with_wrong_pop: ERROR: Failed to generate Authorization Request ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + } + log("*** f_http_build_authorization_request_with_wrong_pop: DEBUG: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); + log("*** f_http_build_authorization_request_with_wrong_pop: DEBUG: p_request_hash= ", p_request_hash); + } // End of function f_http_build_authorization_request_with_wrong_pop + + function f_http_build_authorization_request_with_wrong_hmac( + in Certificate p_ec_certificate, // Enrolment credentials certificate + in octetstring p_ec_private_key, + out octetstring p_private_key, + out octetstring p_public_key_compressed, + out integer p_compressed_key_mode, + out octetstring p_private_enc_key, + out octetstring p_public_compressed_enc_key, + out integer p_compressed_enc_key_mode, + out Oct16 p_aes_sym_key, + out Oct16 p_encrypted_sym_key, + out Oct16 p_authentication_vector, + out Oct12 p_nonce, + out octetstring p_salt, + out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, + out Oct32 p_request_hash + ) runs on ItsPkiHttp { + // Local variables + var octetstring v_public_key_x; + var octetstring v_public_key_y; + var octetstring v_public_enc_key_x; + var octetstring v_public_enc_key_y; + var octetstring v_public_enc_key; + var integer v_compressed_enc_key_mode; + var InnerAtRequest v_inner_at_request; + var Ieee1609Dot2Data v_inner_at_request_data; + var InnerAtRequest v_authorization_request; + var bitstring v_authorization_request_msg; + + // Generate the InnerAtRequest + if (f_generate_inner_at_request_with_wrong_hmac(vc_aaCertificate, vc_aaHashedId8, vc_eaCertificate, vc_eaWholeHash/*salt*/, vc_eaHashedId8, p_ec_certificate, p_ec_private_key, p_private_key, p_public_key_compressed, p_compressed_key_mode, p_private_enc_key, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_inner_at_request) == false) { + log("*** f_http_build_authorization_request_with_wrong_hmac: ERROR: Failed to generate AuthorizationValidationRequest ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + return; + } + log("f_http_build_authorization_request_with_wrong_hmac: v_inner_at_request= ", v_inner_at_request); + + // Secure InnerAtRequest message + if (f_extract_enc_key(vc_aaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { + log("*** f_http_build_authorization_request_with_wrong_hmac: ERROR: Non canonical AA certificate ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + if (PICS_SEC_FIXED_KEYS) { // Debug mode: Use fixed values + v_public_enc_key := 'DD4F6B0DF57C6E3BD0E32B565CACA1D858CEB08A5C2BBAB2C23E203C6DE697FF'O; + v_compressed_enc_key_mode := 0; + } + log("*** f_http_build_authorization_request_with_wrong_hmac: Public encryption key: ", v_public_enc_key); + log("*** f_http_build_authorization_request_with_wrong_hmac: Public encryption key comp: ", v_compressed_enc_key_mode); + p_salt := vc_aaWholeHash; + log("*** f_http_build_authorization_request_with_wrong_hmac: p_salt: ", p_salt); + if (PICS_PKI_AUTH_POP) { + if(f_build_pki_secured_request_message_signed_with_pop(p_private_key, valueof(m_signerIdentifier_self), vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), PX_EC_ALG_FOR_AT, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { + log("*** f_http_build_authorization_request_with_wrong_hmac: ERROR: Failed to generate Authorization Request ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + } else { // Only encryption of EtsiTs102941Data/InnerAtRequest + log("*** f_http_build_authorization_request_with_wrong_hmac: POP signature not applied"); + if(f_build_pki_secured_request_message_for_authorization(vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), PX_EC_ALG_FOR_AT, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { + log("*** f_http_build_authorization_request_with_wrong_hmac: ERROR: Failed to generate Authorization Request ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + } + log("*** f_http_build_authorization_request_with_wrong_hmac: DEBUG: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); + log("*** f_http_build_authorization_request_with_wrong_hmac: DEBUG: p_request_hash= ", p_request_hash); + } // End of function f_http_build_authorization_request_with_wrong_hmac + function f_http_build_authorization_response( in InnerAtRequest p_inner_at_request, in AuthorizationResponseCode p_responseCode := ok, @@ -867,19 +997,19 @@ module LibItsPki_Functions { ) ); p_result := true; - } else {/* + } else { // Generate the certificate if (f_generate_at_certificate_for_inner_at_response(p_inner_at_request, p_private_key, p_digest, v_at_certificate) == false) { log("f_http_build_inner_at_response: Failed to generate the certificate"); p_inner_at_response := valueof( - m_innerEcResponse_ko( + m_innerAtResponse_ko( p_request_hash, - incompleterequest + its_aa_incompleterequest ) ); } else { p_inner_at_response := valueof( - m_innerEcResponse_ok( + m_innerAtResponse_ok( p_request_hash, v_at_certificate ) @@ -890,7 +1020,7 @@ module LibItsPki_Functions { // Secure the response log("f_http_build_inner_at_response: p_inner_at_response= ", p_inner_at_response); v_msg := bit2oct(encvalue(p_inner_at_response)); - v_nonce := int2oct(f_getCurrentTime(), 32); // Random value + v_nonce := substr(f_hashWithSha256(int2oct((f_getCurrentTimeUtc() * 1000), 16)), 0, 16); // Random value // TODO Consider Sha384: m_signerIdentifier_digest(f_HashedId8FromSha384(p_digest)) if (f_build_pki_secured_response_message(p_private_key, valueof(m_signerIdentifier_digest(f_HashedId8FromSha256(p_digest))),// in SignerIdentifier p_signer_identifier, @@ -901,17 +1031,19 @@ module LibItsPki_Functions { ) == false) { log("f_http_build_inner_at_response: Failed to generate the certificate"); p_inner_at_response := valueof( - m_innerEcResponse_ko( + m_innerAtResponse_ko( p_request_hash, - deniedrequest + its_aa_deniedpermissions ) ); } else { - p_result := true;*/ + p_result := true; } + log("<<< f_http_build_authorization_response: p_result= ", p_result); + log("<<< f_http_build_authorization_response: p_inner_at_response= ", p_inner_at_response); return p_result; - } // End of function f_http_build_authorization_request + } // End of function f_http_build_authorization_response function f_http_build_authorization_validation_request( in InnerAtRequest p_inner_at_request, @@ -960,6 +1092,76 @@ module LibItsPki_Functions { log("f_http_build_authorization_validation_request: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); log("f_http_build_authorization_validation_request: p_request_hash= ", p_request_hash); } // End of function f_http_build_authorization_validation_request + + function f_http_build_authorization_validation_response( + in InnerAtRequest p_inner_at_request, + in AuthorizationValidationResponseCode p_responseCode := ok, + in Oct16 p_request_hash, + in octetstring p_private_key := ''O, + in octetstring p_digest := ''O, + in Oct16 p_aes_sym_key, + out AuthorizationValidationResponse p_authorization_validation_response, + out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data + ) return boolean { + // Local variables + var bitstring v_msg_bit; + var octetstring v_msg; + var Oct12 v_nonce; + var Ieee1609Dot2Data v_ieee1609dot2_signed_data; + var EtsiTs103097Certificate v_at_certificate; + var boolean p_result := false; + + log(">>> f_http_build_authorization_validation_response: p_inner_at_request= ", p_inner_at_request); + log(">>> f_http_build_authorization_validation_response: p_responseCode= ", p_responseCode); + log(">>> f_http_build_authorization_validation_response: p_request_hash= ", p_request_hash); + log(">>> f_http_build_authorization_validation_response: p_private_key= ", p_private_key); + log(">>> f_http_build_authorization_validation_response: p_digest= ", p_digest); + log(">>> f_http_build_authorization_validation_response: p_aes_sym_key= ", p_aes_sym_key); + + // Check expectred response + if (p_responseCode != ok) { + p_authorization_validation_response := valueof( + m_authorizationValidationResponse_ko( + p_request_hash, + p_responseCode + ) + ); + p_result := true; + } else { + p_authorization_validation_response := valueof(m_authorizationValidationResponse_ok( + p_request_hash, + p_inner_at_request.sharedAtRequest.requestedSubjectAttributes + ) + ); + } + + // Secure the response + log("f_http_build_authorization_validation_response: p_authorization_validation_response= ", p_authorization_validation_response); + v_msg := bit2oct(encvalue(p_authorization_validation_response)); + v_nonce := substr(f_hashWithSha256(int2oct((f_getCurrentTimeUtc() * 1000), 16)), 0, 16); // Random value + // TODO Consider Sha384: m_signerIdentifier_digest(f_HashedId8FromSha384(p_digest)) + if (f_build_pki_secured_response_message(p_private_key, + valueof(m_signerIdentifier_digest(f_HashedId8FromSha256(p_digest))),// in SignerIdentifier p_signer_identifier, + v_msg, + p_aes_sym_key, + v_nonce, + p_ieee1609dot2_signed_and_encrypted_data + ) == false) { + log("f_http_build_authorization_validation_response: Failed to generate the certificate"); + p_authorization_validation_response := valueof( + m_authorizationValidationResponse_ko( + p_request_hash, + deniedpermissions + ) + ); + } else { + p_result := true; + } + + log("<<< f_http_build_authorization_validation_response: p_result= ", p_result); + log("<<< f_http_build_authorization_validation_response: p_authorization_validation_response= ", p_authorization_validation_response); + return p_result; + } // End of function f_http_build_authorization_validation_response } // End of group http @@ -1022,12 +1224,12 @@ module LibItsPki_Functions { f_getCurrentTime() / 1000, m_duration_in_hours(120) ), - m_geographicRegion_identifiedRegion( + omit/*m_geographicRegion_identifiedRegion( { m_identifiedRegion_country_only(250), // TODO PIXIT m_identifiedRegion_country_only(380) } - ) + )*/ ) ); // Encode it ==> Get octetstring @@ -1133,84 +1335,76 @@ module LibItsPki_Functions { return true; } // End of function f_generate_ec_certificate_for_inner_ec_response - function f_generate_at_certificate( - in octetstring p_private_key, - in InnerEcRequest p_inner_ec_request, - out Certificate p_at_certificate - ) return boolean { - var SequenceOfPsidSsp v_appPermissions := { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs - valueof(m_appPermissions(36, { bitmapSsp := '830001'O })), - valueof(m_appPermissions(37, { bitmapSsp := '830001'O })) - }; - var template (value) EtsiTs103097Certificate v_cert; + function f_generate_at_certificate_for_inner_at_response( + in InnerAtRequest p_inner_at_request, + in octetstring p_private_key, + in octetstring p_digest, + out EtsiTs103097Certificate p_at_certificate + ) return boolean { + var EtsiTs103097Certificate v_cert; + var IssuerIdentifier v_issuer; var bitstring v_tbs; - var Oct32 v_sig; - var bitstring v_enc_msg; - var PublicVerificationKey v_public_verification_key; + var octetstring v_sig; - if (PX_EC_ALG_FOR_AT == e_nist_p256) { - v_public_verification_key := valueof( - m_publicVerificationKey_ecdsaNistP256( - p_inner_ec_request.publicKeys.verificationKey.ecdsaNistP256 - )); - } else if (PX_EC_ALG_FOR_AT == e_brainpool_p256_r1) { - v_public_verification_key := valueof( - m_publicVerificationKey_ecdsaBrainpoolP256r1( - p_inner_ec_request.publicKeys.verificationKey.ecdsaBrainpoolP256r1 - )); - } else { - // Error - log("f_generate_ec_certificate: Wrong encryption algorithm, check PX_EC_ALG_FOR_xx"); - return false; - } - v_cert := m_etsiTs103097Certificate( - m_issuerIdentifier_sha256AndDigest(f_HashedId8FromSha256(f_hashWithSha256('616263'O))), - m_toBeSignedCertificate_at( - v_appPermissions, - m_verificationKeyIndicator_verificationKey( - v_public_verification_key - ), - m_validityPeriod( - f_getCurrentTime() / 1000, - m_duration_in_hours(120) - ), - m_geographicRegion_identifiedRegion( - { - m_identifiedRegion_country_only(250), // TODO PIXIT - m_identifiedRegion_country_only(380) - } - ) - ) - ); + v_issuer := valueof(m_issuerIdentifier_sha256AndDigest(f_HashedId8FromSha256(p_digest))); // TODO Check sha256/384 f_HashedId8FromSha384 + v_cert := valueof( + m_etsiTs103097Certificate( + v_issuer, + m_toBeSignedCertificate_at( + p_inner_at_request.sharedAtRequest.requestedSubjectAttributes.appPermissions, + m_verificationKeyIndicator_verificationKey( + p_inner_at_request.publicKeys.verificationKey + ), + p_inner_at_request.sharedAtRequest.requestedSubjectAttributes.validityPeriod, + p_inner_at_request.sharedAtRequest.requestedSubjectAttributes.region, + p_inner_at_request.sharedAtRequest.requestedSubjectAttributes.assuranceLevel, + p_inner_at_request.publicKeys.encryptionKey + ) + ) + ); // Encode it ==> Get octetstring v_tbs := encvalue(v_cert.toBeSigned); - // Sign the certificate - v_sig := f_signWithEcdsa(bit2oct(v_tbs), int2oct(11, 32), p_private_key); - if ((PX_VE_ALG == e_nist_p256) or (PX_VE_ALG == e_brainpool_p256_r1)) { - v_cert.signature_ := m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_sig, 0, 32) - ), - substr(v_sig, 32, 32) - ) - ); + v_sig := f_signWithEcdsa(bit2oct(v_tbs), p_digest, p_private_key); + if (PX_VE_ALG == e_nist_p256) { + v_cert.signature_ := valueof( + m_signature_ecdsaNistP256( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only( + substr(v_sig, 0, 32) + ), + substr(v_sig, 32, 32) + ) + ) + ); + } else if (PX_VE_ALG == e_brainpool_p256_r1) { + v_cert.signature_ := valueof( + m_signature_ecdsaBrainpoolP256r1( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only( + substr(v_sig, 0, 32) + ), + substr(v_sig, 32, 32) + ) + ) + ); } else if (PX_VE_ALG == e_brainpool_p384_r1) { - v_cert.signature_ := m_signature_ecdsaBrainpoolP384r1( - m_ecdsaP384Signature( - m_eccP384CurvePoint_x_only( - substr(v_sig, 0, 48) - ), - substr(v_sig, 48, 48) - ) - ); + v_cert.signature_ := valueof( + m_signature_ecdsaBrainpoolP384r1( + m_ecdsaP384Signature( + m_eccP384CurvePoint_x_only( + substr(v_sig, 0, 48) + ), + substr(v_sig, 48, 48) + ) + ) + ); } - log("v_cert= ", v_cert); - p_at_certificate := valueof(v_cert); + log("f_generate_at_certificate_for_inner_at_response: p_ec_certificate= ", p_at_certificate); + return true; - } // End of function f_generate_at_certificate + } // End of function f_generate_at_certificate_for_inner_at_response function f_generate_at_certificate_for_authorization_response( in InnerAtRequest p_inner_at_request, @@ -1327,13 +1521,13 @@ module LibItsPki_Functions { f_getCurrentTime() / 1000, m_duration_in_hours(120) // TODO Use PIXIT ), - m_geographicRegion_identifiedRegion( + omit,/*m_geographicRegion_identifiedRegion( { m_identifiedRegion_country_only(250), // TODO Use PIXIT m_identifiedRegion_country_only(380) // TODO Use PIXIT } - ), - '00'O//'C0'O // TODO Use PIXIT + ),*/ + omit//'00'O//'C0'O // TODO Use PIXIT ) ) ); @@ -1831,40 +2025,405 @@ module LibItsPki_Functions { return true; } // End of function f_generate_inner_at_request - function f_verify_inner_at_request_signed_for_pop( - in EtsiTs102941Data p_etsi_ts_102941_data, - out InnerAtRequest p_inner_at_request - ) return boolean { - var bitstring v_msg_bit; - - log(">>> f_verify_inner_at_request_signed_for_pop: ", p_etsi_ts_102941_data); - - // 1. Decode content - v_msg_bit := oct2bit(p_etsi_ts_102941_data.content.enrolmentRequest.content.signedData.tbsData.payload.data.content.unsecuredData); - if (decvalue(v_msg_bit, p_inner_at_request) != 0) { - log("f_verify_inner_at_request_signed_for_pop: Failed to decode InnerEcRequest"); - return false; - } else { - log("f_verify_inner_at_request_signed_for_pop: v_inner_at_request= ", p_inner_at_request); - - // 2. Verify the InnerEcRequestSignedForPop signature - // TODO - } - - return true; - } // End of function f_verify_inner_at_request_signed_for_pop - - function f_generate_inner_at_response( - in octetstring p_authorization_request_hash, - in EtsiTs103097Certificate p_certificate, - out InnerAtResponse p_authorization_response - ) return boolean { + function f_generate_inner_at_request_with_wrong_hmac( + in Certificate p_aa_certificate, + in Oct8 p_aa_hashed_id8, + in Certificate p_ea_certificate, + in octetstring p_salt, + in Oct8 p_ea_hashed_id8, + in Certificate p_ec_certificate, + in octetstring p_ec_private_key, + out octetstring p_private_key, + out octetstring p_public_key_compressed, + out integer p_compressed_key_mode, + out octetstring p_private_enc_key, + out octetstring p_public_compressed_enc_key, + out integer p_compressed_enc_key_mode, + out InnerAtRequest p_inner_at_request + ) return boolean { // Local variables - - // Build the Proof of Possession InnerEcResponse - p_authorization_response := valueof( - m_innerAtResponse_ok( - substr(p_authorization_request_hash, 0, 16), + var octetstring v_public_key_x; + var octetstring v_public_key_y; + var octetstring v_public_enc_key_x; + var octetstring v_public_enc_key_y; + var bitstring v_enc_value; + var octetstring v_ec_hash; + var Oct8 v_ec_hashed_id8; + var octetstring public_enc_key_x; + var octetstring public_enc_key_y; + var Oct32 v_hmac_key; + var PublicVerificationKey v_verification_tag; + var PublicEncryptionKey v_encryption_tag; + var octetstring v_encoded_tag; + var Oct16 v_key_tag; + var octetstring v_hash_shared_at_request; + var template (value) ToBeSignedData v_tbs; + var octetstring v_tbs_signed; + var Ieee1609Dot2Data v_signed_at_signature; + var template (value) EccP256CurvePoint v_eccP256_curve_point; + var template (value) EccP256CurvePoint v_enc_eccP256_curve_point; + var HashAlgorithm v_hashId; + var Signature v_signature; + var SequenceOfPsidSsp v_appPermissions := { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs + valueof(m_appPermissions(c_its_aid_CAM, { bitmapSsp := '01FFFC'O })), + valueof(m_appPermissions(c_its_aid_DENM, { bitmapSsp := '01FFFFFF'O })) // TODO Use PIXIT + }; + + // Generate verification keys for the certificate to be requested + if (f_generate_key_pair(p_private_key, v_public_key_x, v_public_key_y, p_public_key_compressed, p_compressed_key_mode) == false) { + log("f_generate_inner_at_request_with_wrong_hmac: Failed to generate verification key"); + return false; + } + log ("f_generate_inner_at_request_with_wrong_hmac: AT verification private key: ", p_private_key); + log ("f_generate_inner_at_request_with_wrong_hmac: AT verification public compressed key: ", p_public_key_compressed); + log ("f_generate_inner_at_request_with_wrong_hmac: AT verification public compressed mode: ", p_compressed_key_mode); + // Generate encryption keys for the certificate to be requested + if (PX_INCLUDE_ENCRYPTION_KEYS) { + if (f_generate_key_pair_for_encryption(PX_EC_ALG_FOR_AT, p_private_enc_key, v_public_enc_key_x, v_public_enc_key_y, p_public_compressed_enc_key, p_compressed_enc_key_mode) == false) { + log("f_generate_inner_at_request_with_wrong_hmac: Failed to generate encryption key"); + return false; + } else { + log ("f_generate_inner_at_request_with_wrong_hmac: AT encryption private key: ", p_private_enc_key); + log ("f_generate_inner_at_request_with_wrong_hmac: AT encryption public compressed key: ", p_public_compressed_enc_key); + log ("f_generate_inner_at_request_with_wrong_hmac: AT encryption public compressed mode: ", p_compressed_enc_key_mode); + } + } else { + p_private_enc_key := ''O; + v_public_enc_key_x := ''O; + v_public_enc_key_y := ''O; + p_public_compressed_enc_key := ''O; + p_compressed_enc_key_mode := -1; + } + + // Calculate the whole certificate SHA + v_enc_value := encvalue(p_ec_certificate); + if (ischosen(p_ec_certificate.issuer.sha256AndDigest)) { + v_ec_hash := f_hashWithSha256(bit2oct(v_enc_value)); + v_ec_hashed_id8 := f_HashedId8FromSha256(v_ec_hash); + } else { + v_ec_hash := f_hashWithSha384(bit2oct(v_enc_value)); + v_ec_hashed_id8 := f_HashedId8FromSha384(v_ec_hash); + } + log("f_generate_inner_at_request_with_wrong_hmac: v_ec_hash= ", v_ec_hash); + + // Generate 32 octets length secret key + v_hmac_key := f_hashWithSha256(int2oct((f_getCurrentTimeUtc() * 1000), 12)); + log("f_generate_inner_at_request_with_wrong_hmac: v_hmac_key= ", v_hmac_key); + + // Generate tag based on the concatenation of verification keys & encryption keys + if (PX_VE_ALG == e_nist_p256) { + if (p_compressed_key_mode == 0) { + v_verification_tag.ecdsaNistP256.compressed_y_0 := p_public_key_compressed; + } else { + v_verification_tag.ecdsaNistP256.compressed_y_1 := p_public_key_compressed; + } + } else if (PX_VE_ALG == e_brainpool_p256_r1) { + if (p_compressed_key_mode == 0) { + v_verification_tag.ecdsaBrainpoolP256r1.compressed_y_0 := p_public_key_compressed; + } else { + v_verification_tag.ecdsaBrainpoolP256r1.compressed_y_1 := p_public_key_compressed; + } + } else if (PX_VE_ALG == e_brainpool_p384_r1) { + if (p_compressed_key_mode == 0) { + v_verification_tag.ecdsaBrainpoolP384r1.compressed_y_0 := p_public_key_compressed; + } else { + v_verification_tag.ecdsaBrainpoolP384r1.compressed_y_1 := p_public_key_compressed; + } + } else { + log("f_generate_inner_at_request_with_wrong_hmac: Failed to generate HMAC tag"); + return false; + } + log("f_generate_inner_at_request_with_wrong_hmac: v_verification_tag= ", v_verification_tag); + v_encoded_tag := bit2oct(encvalue(v_verification_tag)); + if (PX_INCLUDE_ENCRYPTION_KEYS) { + v_encryption_tag.supportedSymmAlg := aes128Ccm; + if (PX_EC_ALG_FOR_AT == e_nist_p256) { + if (p_compressed_enc_key_mode == 0) { + v_encryption_tag.publicKey.eciesNistP256.compressed_y_0 := p_public_compressed_enc_key; + } else { + v_encryption_tag.publicKey.eciesNistP256.compressed_y_1 := p_public_compressed_enc_key; + } + } else if (PX_EC_ALG_FOR_AT == e_brainpool_p256_r1) { + if (p_compressed_enc_key_mode == 0) { + v_encryption_tag.publicKey.eciesBrainpoolP256r1.compressed_y_0 := p_public_compressed_enc_key; + } else { + v_encryption_tag.publicKey.eciesBrainpoolP256r1.compressed_y_1 := p_public_compressed_enc_key; + } + } else { + log("f_generate_inner_at_request_with_wrong_hmac: Failed to generate HMAC tag (enc)"); + return false; + } + log("f_generate_inner_at_request_with_wrong_hmac: v_encryption_tag= ", v_encryption_tag); + v_encoded_tag := v_encoded_tag & bit2oct(encvalue(v_encryption_tag)); + } + log("f_generate_inner_at_request_with_wrong_hmac: v_encoded_tag= ", v_encoded_tag); + // Modify v_hmac_key + v_key_tag := substr( + fx_hmac_sha256( // TODO Rename and use a wrapper function + v_hmac_key, + v_encoded_tag + ), + 0, + 16); // Leftmost 128 bits of the HMAC-SHA256 tag computed previously + log("f_generate_inner_at_request_with_wrong_hmac: v_key_tag= ", v_key_tag); + v_hmac_key[0] := 'aa'O; + v_hmac_key[1] := 'bb'O; + log("f_generate_inner_at_request_with_wrong_hmac: Modified key_tag= ", v_hmac_key); + + // Build the SharedAtRequest + p_inner_at_request.sharedAtRequest := valueof( + m_shared_at_request( + p_ea_hashed_id8, // eaId identifies the EA certificate shared with EA entity + v_key_tag, // Calculated keyTag + valueof( + m_certificate_subject_attributes( // FIXME Review fsubjectPermissions + v_appPermissions,//p_ec_certificate.toBeSigned.appPermissions, + p_ec_certificate.toBeSigned.certRequestPermissions, + p_ec_certificate.toBeSigned.id, + p_ec_certificate.toBeSigned.validityPeriod, + p_ec_certificate.toBeSigned.region, + p_ec_certificate.toBeSigned.assuranceLevel + ))) // Desired attributes + ); + + // Calculate the hash of the SharedAtRequest + v_hash_shared_at_request := f_hashWithSha256(bit2oct(encvalue(p_inner_at_request.sharedAtRequest))); + log("f_generate_inner_at_request_with_wrong_hmac: v_hash_shared_at_request= ", v_hash_shared_at_request); + + // Build the ETsiTs103097Data-SignedExternalPayload + v_tbs := m_toBeSignedData( + m_signedDataPayload_ext(v_hash_shared_at_request), // Payload containing extDataHash + m_headerInfo_inner_pki_request( // HeaderInfo + -, + (f_getCurrentTime()) * 1000) //us + ); + log("f_generate_inner_at_request_with_wrong_hmac: v_tbs= ", v_tbs); + // Signed ToBeSigned payload using the private key of EC certificate obtained from Enrolment request + // In case of ITS-S privacy, v_signed_at_signature contained the data to be encrypted + // TODO Simplify with f_signWithEcdsa + if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1)) { + v_hashId := sha384; + v_tbs_signed := f_signWithEcdsaBrainpoolp384WithSha384(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); + v_signature := valueof( + m_signature_ecdsaBrainpoolP384r1( + m_ecdsaP384Signature( + m_eccP384CurvePoint_x_only( + substr(v_tbs_signed, 0, 48) + ), + substr(v_tbs_signed, 48, 48) + ) + ) + ); + } else { + v_hashId := sha256; + if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1)) { + v_tbs_signed := f_signWithEcdsaBrainpoolp256WithSha256(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); + v_signature := valueof( + m_signature_ecdsaBrainpoolP256r1( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only( + substr(v_tbs_signed, 0, 32) + ), + substr(v_tbs_signed, 32, 32) + ) + ) + ); + } else if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256)) { + v_tbs_signed := f_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); + v_signature := valueof( + m_signature_ecdsaNistP256( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only( + substr(v_tbs_signed, 0, 32) + ), + substr(v_tbs_signed, 32, 32) + ) + ) + ); + } else { + // Error + log("f_generate_inner_at_request_with_wrong_hmac: Failed to process signature"); + return false; + } + } + v_signed_at_signature := valueof( + m_etsiTs103097Data_signed( + m_signedData( + v_hashId, + v_tbs, + m_signerIdentifier_digest(v_ec_hashed_id8), // Signer is thehasheId8 of the EC certificate obtained from Enrolment request + v_signature + ) + ) + ); + log("f_generate_inner_at_request_with_wrong_hmac: v_signed_at_signature= ", v_signed_at_signature); + + if (PICS_ITS_S_WITH_PRIVACY) { // Build EtsiTs102097Data-Encrypted structure + var octetstring v_public_enc_key; + var integer v_compressed_mode; + var Oct12 v_nonce; + var Oct16 v_authentication_vector; + var Oct16 v_aes_sym_key; + var Oct16 v_encrypted_sym_key; + var HashedId8 v_recipientId; + var octetstring v_public_compressed_ephemeral_key; + var integer v_public_compressed_ephemeral_mode; + var octetstring v_enc_signed_ec_signature; + var EncryptedDataEncryptionKey v_encrypted_data_encryption_key; + + // Use EA certificate for the encryption + if (PX_EC_ALG_FOR_AT == e_nist_p256) { + if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0)) { + v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0; + v_compressed_mode := 0; + } else if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_1)) { + v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_1; + v_compressed_mode := 1; + } else { + log("f_generate_inner_at_request_with_wrong_hmac: Wrong NistP256 encryption variant"); + return false; + } + v_enc_signed_ec_signature := f_encryptWithEciesNistp256WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); + if (v_public_compressed_ephemeral_mode == 0) { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); + } else { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_compressed_ephemeral_key)); + } + v_encrypted_data_encryption_key := valueof( + m_encryptedDataEncryptionKey_eciesNistP256( + m_evciesP256EncryptedKey( + v_eccP256_curve_point, + v_encrypted_sym_key, + v_authentication_vector + ))); + } else if (PX_EC_ALG_FOR_AT == e_brainpool_p256_r1) { + if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0)) { + v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0; + v_compressed_mode := 0; + } else if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_1)) { + v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_1; + v_compressed_mode := 1; + } else { + log("f_generate_inner_at_request_with_wrong_hmac: Wrong BrainpoolP256r1 encryption variant"); + return false; + } + v_enc_signed_ec_signature := f_encryptWithEciesBrainpoolp256WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); + if (v_public_compressed_ephemeral_mode == 0) { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); + } else { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_compressed_ephemeral_key)); + } + v_encrypted_data_encryption_key := valueof( + m_encryptedDataEncryptionKey_eciesBrainpoolP256r1( + m_evciesP256EncryptedKey( + v_eccP256_curve_point, + v_encrypted_sym_key, + v_authentication_vector + ))); + } else { + log("f_generate_inner_at_request_with_wrong_hmac: Wrong encryption variant"); + return false; + } + log("f_generate_inner_at_request_with_wrong_hmac: v_encrypted_data_encryption_key= ", v_encrypted_data_encryption_key); + v_recipientId := p_ea_hashed_id8; // RecipientId is the HashedId8 of the EA certificate + log("f_generate_inner_at_request_with_wrong_hmac: v_recipientId= ", v_recipientId); + // Fill Certificate template with the public compressed keys (canonical form) + p_inner_at_request.ecSignature := valueof( + m_ec_signature( + m_etsiTs103097Data_encrypted( + m_encryptedData( + { + m_recipientInfo_certRecipInfo( + m_pKRecipientInfo( + v_recipientId, + + v_encrypted_data_encryption_key )) + }, + m_SymmetricCiphertext_aes128ccm( + m_aesCcmCiphertext( + v_nonce, + v_enc_signed_ec_signature + ) + ) + ) + ) + ) + ); + } else { // Skip the encryption, alowed to be re-identified by the AA + p_inner_at_request.ecSignature := valueof(m_ec_signature_ext_payload(v_signed_at_signature)); + } + // Build the InnerAtRequest, EcSignature field is already set + if (p_compressed_key_mode == 0) { + v_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_0(v_public_key_x); + } else { + v_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_1(v_public_key_x); + } + if (p_compressed_enc_key_mode == 0) { + v_enc_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_0(v_public_enc_key_x); + } else { + v_enc_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_1(v_public_enc_key_x); + } + if (PX_INCLUDE_ENCRYPTION_KEYS) { + p_inner_at_request.publicKeys := valueof( // The freshly generated public verification & encrypition keys to be used for the requested AT certificate + m_publicKeys( + m_publicVerificationKey_ecdsaNistP256( + v_eccP256_curve_point + ), + m_encryptionKey( // FIXME Encryption keys could be optional + -, + m_publicEncryptionKey_ecdsaNistP256(v_enc_eccP256_curve_point) + ) + ) + ); + } else { + p_inner_at_request.publicKeys := valueof( // The freshly generated public verification keys to be used for the requested AT certificate + m_publicKeys( + m_publicVerificationKey_ecdsaNistP256( + v_eccP256_curve_point + ) + ) + ); + } + p_inner_at_request.hmacKey := v_hmac_key; + log("f_generate_inner_at_request_with_wrong_hmac: p_inner_at_request= ", p_inner_at_request); + + return true; + } // End of function f_generate_inner_at_request_with_wrong_hmac + + function f_verify_inner_at_request_signed_for_pop( + in EtsiTs102941Data p_etsi_ts_102941_data, + out InnerAtRequest p_inner_at_request + ) return boolean { + var bitstring v_msg_bit; + + log(">>> f_verify_inner_at_request_signed_for_pop: ", p_etsi_ts_102941_data); + + // 1. Decode content + v_msg_bit := oct2bit(p_etsi_ts_102941_data.content.enrolmentRequest.content.signedData.tbsData.payload.data.content.unsecuredData); + if (decvalue(v_msg_bit, p_inner_at_request) != 0) { + log("f_verify_inner_at_request_signed_for_pop: Failed to decode InnerEcRequest"); + return false; + } else { + log("f_verify_inner_at_request_signed_for_pop: v_inner_at_request= ", p_inner_at_request); + + // 2. Verify the InnerEcRequestSignedForPop signature + // TODO + } + + return true; + } // End of function f_verify_inner_at_request_signed_for_pop + + function f_generate_inner_at_response( + in octetstring p_authorization_request_hash, + in EtsiTs103097Certificate p_certificate, + out InnerAtResponse p_authorization_response + ) return boolean { + // Local variables + + // Build the Proof of Possession InnerEcResponse + p_authorization_response := valueof( + m_innerAtResponse_ok( + substr(p_authorization_request_hash, 0, 16), p_certificate ) ); @@ -1923,7 +2482,7 @@ module LibItsPki_Functions { mw_binary_body_ieee1609dot2_data( mw_enrolmentResponseMessage( mw_encryptedData( - { *, mw_recipientInfo_pskRecipInfo(v_aes_sym_key_hashed_id8), * }, + { *, mw_recipientInfo_pskRecipInfo/*(v_aes_sym_key_hashed_id8)*/, * }, mw_SymmetricCiphertext_aes128ccm )))))), v_response @@ -1938,8 +2497,8 @@ module LibItsPki_Functions { } log("f_await_http_inner_ec_request_response: Receive ", v_etsi_ts_102941_data, " ***"); // Verify the received EC certificate - log("f_await_http_inner_ec_request_response: match ", match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(substr(v_request_hash, 0, 16), mw_etsiTs103097Certificate(-, mw_toBeSignedCertificate_ec)))), " ***"); // TODO In TITAN, this is the only way to get the unmatching in log - if (match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(substr(v_request_hash, 0, 16), mw_etsiTs103097Certificate(-, mw_toBeSignedCertificate_ec)))) == false) { + log("f_await_http_inner_ec_request_response: match ", match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(-/*Escryptsubstr(v_request_hash, 0, 16)*/, mw_etsiTs103097Certificate(-, mw_toBeSignedCertificate_ec)))), " ***"); // TODO In TITAN, this is the only way to get the unmatching in log + if (match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(-/*Escryptsubstr(v_request_hash, 0, 16)*/, mw_etsiTs103097Certificate(-, mw_toBeSignedCertificate_ec)))) == false) { log("f_await_http_inner_ec_request_response: Unexpected message received ***"); if (p_strict_checks) { return false; @@ -2764,7 +3323,8 @@ module LibItsPki_Functions { // Check the signer log("f_verify_ec_certificate: ", match(p_ec_certificate.issuer, mw_issuerIdentifier_sha256AndDigest)); - if (match(p_ec_certificate.issuer, mw_issuerIdentifier_sha256AndDigest)) { + if (match(p_ec_certificate.issuer, mw_issuerIdentifier_sha256AndDigest) == false) { + log("f_verify_ec_certificate: Wrong issuer"); return false; } @@ -3024,6 +3584,18 @@ module LibItsPki_Functions { } } // End of altstep a_await_at_http_response_from_iut + altstep a_await_atv_http_request_from_iut( + template HttpMessage p_http_message, + out HttpMessage p_request + ) runs on ItsPkiHttp { + [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_request { + log("a_await_atv_http_request_from_iut: Received message on httpPort"); + } + [PICS_MULTIPLE_END_POINT] httpAtVPort.receive(p_http_message) -> value p_request { + log("a_await_avt_http_request_from_iut: Received message on httpAtVPort"); + } + } // End of altstep a_await_atv_http_request_from_iut + altstep a_await_atv_http_response_from_iut( template HttpMessage p_http_message, out HttpMessage p_response diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn index 82d6f2ab..1818c237 100644 --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ b/ttcn/Pki/LibItsPki_Templates.ttcn @@ -369,6 +369,15 @@ module LibItsPki_Templates { confirmedSubjectAttributes := p_confirmedSubjectAttributes } // End of template mw_authorizationValidationResponse_ok + template (value) AuthorizationValidationResponse m_authorizationValidationResponse_ko( + in template (value) Oct16 p_requestHash, + in template (value) AuthorizationValidationResponseCode p_responseCode + ) := { + requestHash := p_requestHash, + responseCode := p_responseCode, + confirmedSubjectAttributes := omit + } // End of template m_authorizationValidationResponse_ko + template (present) AuthorizationValidationResponse mw_authorizationValidationResponse_ko( template (present) Oct16 p_requestHash := ? ) := { diff --git a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn index cc01b1c6..e0d7424c 100644 --- a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn +++ b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn @@ -23,6 +23,7 @@ module LibItsSecurity_TypesAndValues { // Test Adapter certificates & private keys - Valid behavior const charstring cc_taCert_A := "CERT_TS_A_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_A_AA := "CERT_TS_A_AA"; + const charstring cc_taCert_A_EA := "CERT_TS_A_EA"; const charstring cc_taCert_A1 := "CERT_TS_A_A1_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_A2 := "CERT_TS_A_A2_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_A3 := "CERT_TS_A_A3_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ -- GitLab From 7f9ffa8eaf73998f6b565a5e595ed2e54dcba9e8 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 27 Feb 2019 23:00:56 -0800 Subject: [PATCH 198/320] ITS-CMS6 Plugtest validation --- ttcn/Pki/LibItsPki_Functions.ttcn | 113 +++++++++++++++----- ttcn/Pki/LibItsPki_Templates.ttcn | 25 +++++ ttcn/Security/LibItsSecurity_Templates.ttcn | 6 +- 3 files changed, 114 insertions(+), 30 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 772d222e..6b94616d 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -672,8 +672,8 @@ module LibItsPki_Functions { // Secure the response log("f_http_build_inner_ec_response: p_inner_ec_response= ", p_inner_ec_response); - v_msg := bit2oct(encvalue(p_inner_ec_response)); - v_nonce := int2oct(f_getCurrentTime(), 32); // Random value + v_msg := bit2oct(encvalue(m_etsiTs102941Data_inner_ec_response(p_inner_ec_response))); + v_nonce := substr(f_hashWithSha256(int2oct((f_getCurrentTimeUtc() * 1000), 16)), 0, 12); // Random value // TODO Consider Sha384: m_signerIdentifier_digest(f_HashedId8FromSha384(p_digest)) if (f_build_pki_secured_response_message(p_private_key, valueof(m_signerIdentifier_digest(f_HashedId8FromSha256(p_digest))),// in SignerIdentifier p_signer_identifier, @@ -1019,8 +1019,8 @@ module LibItsPki_Functions { // Secure the response log("f_http_build_inner_at_response: p_inner_at_response= ", p_inner_at_response); - v_msg := bit2oct(encvalue(p_inner_at_response)); - v_nonce := substr(f_hashWithSha256(int2oct((f_getCurrentTimeUtc() * 1000), 16)), 0, 16); // Random value + v_msg := bit2oct(encvalue(m_etsiTs102941Data_inner_at_response(p_inner_at_response))); + v_nonce := substr(f_hashWithSha256(int2oct((f_getCurrentTimeUtc() * 1000), 16)), 0, 12); // Random value // TODO Consider Sha384: m_signerIdentifier_digest(f_HashedId8FromSha384(p_digest)) if (f_build_pki_secured_response_message(p_private_key, valueof(m_signerIdentifier_digest(f_HashedId8FromSha256(p_digest))),// in SignerIdentifier p_signer_identifier, @@ -1223,13 +1223,14 @@ module LibItsPki_Functions { m_validityPeriod( f_getCurrentTime() / 1000, m_duration_in_hours(120) - ), - omit/*m_geographicRegion_identifiedRegion( + )/*, + m_geographicRegion_identifiedRegion( { m_identifiedRegion_country_only(250), // TODO PIXIT m_identifiedRegion_country_only(380) } - )*/ + ), + '00'O*/ // TODO Use PIXIT ) ); // Encode it ==> Get octetstring @@ -1419,19 +1420,19 @@ module LibItsPki_Functions { log(">>> f_generate_at_certificate_for_authorization_response"); - /*v_issuer := valueof(m_issuerIdentifier_sha256AndDigest(f_HashedId8FromSha256(p_digest))); // TODO Check sha256/384 f_HashedId8FromSha384 + v_issuer := valueof(m_issuerIdentifier_sha256AndDigest(f_HashedId8FromSha256(p_digest))); // TODO Check sha256/384 f_HashedId8FromSha384 v_cert := valueof( m_etsiTs103097Certificate( v_issuer, m_toBeSignedCertificate_ec( - p_inner_at_request.requestedSubjectAttributes.id, - p_inner_at_request.requestedSubjectAttributes.appPermissions, + p_inner_at_request.sharedAtRequest.requestedSubjectAttributes.id, + p_inner_at_request.sharedAtRequest.requestedSubjectAttributes.appPermissions, m_verificationKeyIndicator_verificationKey( p_inner_at_request.publicKeys.verificationKey ), - p_inner_at_request.requestedSubjectAttributes.validityPeriod, - p_inner_at_request.requestedSubjectAttributes.region, - p_inner_at_request.requestedSubjectAttributes.assuranceLevel, + p_inner_at_request.sharedAtRequest.requestedSubjectAttributes.validityPeriod, + p_inner_at_request.sharedAtRequest.requestedSubjectAttributes.region, + p_inner_at_request.sharedAtRequest.requestedSubjectAttributes.assuranceLevel, p_inner_at_request.publicKeys.encryptionKey ) ) @@ -1474,7 +1475,7 @@ module LibItsPki_Functions { ) ); } - p_at_certificate := valueof(v_cert);*/ + p_at_certificate := valueof(v_cert); log("f_generate_at_certificate_for_authorization_response: p_at_certificate= ", p_at_certificate); return true; @@ -1520,14 +1521,14 @@ module LibItsPki_Functions { m_validityPeriod( f_getCurrentTime() / 1000, m_duration_in_hours(120) // TODO Use PIXIT - ), - omit,/*m_geographicRegion_identifiedRegion( + )/*, + m_geographicRegion_identifiedRegion( { m_identifiedRegion_country_only(250), // TODO Use PIXIT m_identifiedRegion_country_only(380) // TODO Use PIXIT } - ),*/ - omit//'00'O//'C0'O // TODO Use PIXIT + ), + '00'O*/ // TODO Use PIXIT ) ) ); @@ -2482,7 +2483,7 @@ module LibItsPki_Functions { mw_binary_body_ieee1609dot2_data( mw_enrolmentResponseMessage( mw_encryptedData( - { *, mw_recipientInfo_pskRecipInfo/*(v_aes_sym_key_hashed_id8)*/, * }, + { *, mw_recipientInfo_pskRecipInfo(v_aes_sym_key_hashed_id8), * }, mw_SymmetricCiphertext_aes128ccm )))))), v_response @@ -2497,8 +2498,8 @@ module LibItsPki_Functions { } log("f_await_http_inner_ec_request_response: Receive ", v_etsi_ts_102941_data, " ***"); // Verify the received EC certificate - log("f_await_http_inner_ec_request_response: match ", match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(-/*Escryptsubstr(v_request_hash, 0, 16)*/, mw_etsiTs103097Certificate(-, mw_toBeSignedCertificate_ec)))), " ***"); // TODO In TITAN, this is the only way to get the unmatching in log - if (match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(-/*Escryptsubstr(v_request_hash, 0, 16)*/, mw_etsiTs103097Certificate(-, mw_toBeSignedCertificate_ec)))) == false) { + log("f_await_http_inner_ec_request_response: match ", match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(substr(v_request_hash, 0, 16), mw_etsiTs103097Certificate(-, mw_toBeSignedCertificate_ec)))), " ***"); // TODO In TITAN, this is the only way to get the unmatching in log + if (match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(substr(v_request_hash, 0, 16), mw_etsiTs103097Certificate(-, mw_toBeSignedCertificate_ec)))) == false) { log("f_await_http_inner_ec_request_response: Unexpected message received ***"); if (p_strict_checks) { return false; @@ -2670,6 +2671,8 @@ module LibItsPki_Functions { f_getCertificateHash(v_certificate_id, v_hash); v_tbs_signed := f_signWithEcdsa(bit2oct(encvalue(v_tbs)), v_hash, p_private_key); } + log("f_build_pki_secured_request_message_signed_with_pop: lengthof(v_tbs_signed)= ", lengthof(v_tbs_signed)); + log("f_build_pki_secured_request_message_signed_with_pop: v_tbs_signed= ", v_tbs_signed); // Add the signature and create EtsiTs103097Data-Signed data structure if (PX_VE_ALG == e_nist_p256) { v_signature := valueof( @@ -3185,15 +3188,69 @@ module LibItsPki_Functions { // 4. Verifiy signature log("f_verify_pki_request_message: v_ieee1609dot2_signed_data.content.signedData.tbsData= ", v_ieee1609dot2_signed_data.content.signedData.tbsData); v_msg := bit2oct(encvalue(v_ieee1609dot2_signed_data.content.signedData.tbsData)); - if (f_getCertificateFromDigest(f_HashedId8FromSha256(p_issuer), v_certificate) == false) { - if (p_check_security == true) { + if (p_issuer == ''O) { // ITS-S/OBU + var PublicVerificationKey v_public_verification_key; + + log("f_verify_pki_request_message: Use ITS-S technical keys"); + if (PX_VE_ALG == e_nist_p256) { + var EccP256CurvePoint v_ecc_p256_curve_point; + + if (PICS_ITS_S_SIGN_NISTP256_PUBLIC_KEY[0] == '02'O) { + v_ecc_p256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(substr(PICS_ITS_S_SIGN_NISTP256_PUBLIC_KEY, 1, 32))); + } else { + v_ecc_p256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(substr(PICS_ITS_S_SIGN_NISTP256_PUBLIC_KEY, 1, 32))); + } + v_public_verification_key := valueof( + m_publicVerificationKey_ecdsaNistP256( + v_ecc_p256_curve_point + ) + ); + } else if (PX_VE_ALG == e_brainpool_p256_r1) { + var EccP256CurvePoint v_ecc_p256_curve_point; + + if (PICS_ITS_S_SIGN_BRAINPOOLP256r1_PUBLIC_KEY[0] == '02'O) { + v_ecc_p256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(substr(PICS_ITS_S_SIGN_BRAINPOOLP256r1_PUBLIC_KEY, 1, 32))); + } else { + v_ecc_p256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(substr(PICS_ITS_S_SIGN_BRAINPOOLP256r1_PUBLIC_KEY, 1, 32))); + } + v_public_verification_key := valueof( + m_publicVerificationKey_ecdsaBrainpoolP256r1( + v_ecc_p256_curve_point + ) + ); + } else if (PX_VE_ALG == e_brainpool_p384_r1) { + var EccP384CurvePoint v_ecc_p384_curve_point; + + if (PICS_ITS_S_SIGN_BRAINPOOLP384r1_PUBLIC_KEY[0] == '02'O) { + v_ecc_p384_curve_point := valueof(m_eccP384CurvePoint_compressed_y_0(substr(PICS_ITS_S_SIGN_BRAINPOOLP384r1_PUBLIC_KEY, 1, 48))); + } else { + v_ecc_p384_curve_point := valueof(m_eccP384CurvePoint_compressed_y_1(substr(PICS_ITS_S_SIGN_BRAINPOOLP384r1_PUBLIC_KEY, 1, 48))); + } + v_public_verification_key := valueof( + m_publicVerificationKey_ecdsaBrainpoolP384r1( + v_ecc_p384_curve_point + ) + ); + } else { return false; } - } - log("f_verify_pki_request_message: v_certificate= ", v_certificate); - if (f_verifyEcdsa(v_msg, p_issuer, v_ieee1609dot2_signed_data.content.signedData.signature_, v_certificate.toBeSigned.verifyKeyIndicator.verificationKey) == false) { - if (p_check_security == true) { - return false; + log("f_verify_pki_request_message: v_public_verification_key= ", v_public_verification_key); + if (f_verifyEcdsa(v_msg, int2oct(0, 32), v_ieee1609dot2_signed_data.content.signedData.signature_, v_public_verification_key) == false) { + if (p_check_security == true) { + return false; + } + } + } else { + if (f_getCertificateFromDigest(f_HashedId8FromSha256(p_issuer), v_certificate) == false) { + if (p_check_security == true) { + return false; + } + } + log("f_verify_pki_request_message: v_certificate= ", v_certificate); + if (f_verifyEcdsa(v_msg, p_issuer, v_ieee1609dot2_signed_data.content.signedData.signature_, v_certificate.toBeSigned.verifyKeyIndicator.verificationKey) == false) { + if (p_check_security == true) { + return false; + } } } diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn index 1818c237..87f98297 100644 --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ b/ttcn/Pki/LibItsPki_Templates.ttcn @@ -55,6 +55,15 @@ module LibItsPki_Templates { } } // End of template m_etsiTs102941Data_inner_ec_response + template (value) EtsiTs102941Data m_etsiTs102941Data_inner_at_response( + in template (value) InnerAtResponse p_inner_at_response + ) := { + version := PkiProtocolVersion, + content := { + authorizationResponse := p_inner_at_response + } + } // End of template m_etsiTs102941Data_inner_at_response + template (present) EtsiTs102941Data mw_etsiTs102941Data_inner_ec_response( template (present) InnerEcResponse p_inner_ec_response := ? ) := { @@ -464,4 +473,20 @@ module LibItsPki_Templates { certIssuePermissions := p_certIssuePermissions } // End of template mw_certificate_subject_attributes + template CertificateSubjectAttributes mw_certificate_subject_attributes_optional_assuranceLevel( + template (present) SequenceOfPsidSsp p_appPermissions := ?, + template (present) CertificateId p_id := ?, + template (present) ValidityPeriod p_validityPeriod := ?, + template SubjectAssurance p_assuranceLevel := *, + template GeographicRegion p_region := *, + template SequenceOfPsidGroupPermissions p_certIssuePermissions := omit + ) := { + id := p_id, + validityPeriod := p_validityPeriod, + region := p_region, + assuranceLevel := p_assuranceLevel, + appPermissions := p_appPermissions, + certIssuePermissions := p_certIssuePermissions + } // End of template mw_certificate_subject_attributes + } // End of module LibItsPki_Templates diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index 22e654de..857a9bff 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -803,7 +803,8 @@ module LibItsSecurity_Templates { */ template (value) Ieee1609Dot2Data m_ieee1609Dot2Data( in template (value) Ieee1609Dot2Content p_content - ) := { + ) := { + protocolVersion := c_protocol_version, content := p_content } // End of template m_ieee1609Dot2Data @@ -813,7 +814,8 @@ module LibItsSecurity_Templates { */ template (present) Ieee1609Dot2Data mw_ieee1609Dot2Data( template (present) Ieee1609Dot2Content p_content := ? - ) := { + ) := { + protocolVersion := c_protocol_version, content := p_content } // End of template mw_ieee1609Dot2Data -- GitLab From c2b587e66d74a936f870db1a9a17fd9e051f40cf Mon Sep 17 00:00:00 2001 From: garciay Date: Sat, 2 Mar 2019 06:35:37 -0800 Subject: [PATCH 199/320] ITS-CMS6 Plugtest validation --- ttcn/Pki/LibItsPki_Functions.ttcn | 158 +++++++++----------- ttcn/Security/LibItsSecurity_Functions.ttcn | 10 +- 2 files changed, 77 insertions(+), 91 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 6b94616d..fa2fe2c1 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -488,6 +488,66 @@ module LibItsPki_Functions { } } } // End of function f_http_send + + function f_generate_key_tag( + in octetstring p_public_key_compressed, + in integer p_compressed_key_mode, + in octetstring p_public_compressed_enc_key, + in integer p_compressed_enc_key_mode, + out octetstring p_encoded_tag + ) return boolean { + // Local variables + var PublicVerificationKey v_verification_tag; + var PublicEncryptionKey v_encryption_tag; + + if (PX_VE_ALG == e_nist_p256) { + if (p_compressed_key_mode == 0) { + v_verification_tag.ecdsaNistP256.compressed_y_0 := p_public_key_compressed; + } else { + v_verification_tag.ecdsaNistP256.compressed_y_1 := p_public_key_compressed; + } + } else if (PX_VE_ALG == e_brainpool_p256_r1) { + if (p_compressed_key_mode == 0) { + v_verification_tag.ecdsaBrainpoolP256r1.compressed_y_0 := p_public_key_compressed; + } else { + v_verification_tag.ecdsaBrainpoolP256r1.compressed_y_1 := p_public_key_compressed; + } + } else if (PX_VE_ALG == e_brainpool_p384_r1) { + if (p_compressed_key_mode == 0) { + v_verification_tag.ecdsaBrainpoolP384r1.compressed_y_0 := p_public_key_compressed; + } else { + v_verification_tag.ecdsaBrainpoolP384r1.compressed_y_1 := p_public_key_compressed; + } + } else { + log("f_generate_key_tag: Failed to generate HMAC tag"); + return false; + } + log("f_generate_key_tag: v_verification_tag= ", v_verification_tag); + p_encoded_tag := bit2oct(encvalue(v_verification_tag)); + if (PX_INCLUDE_ENCRYPTION_KEYS) { + v_encryption_tag.supportedSymmAlg := aes128Ccm; + if (PX_EC_ALG_FOR_AT == e_nist_p256) { + if (p_compressed_enc_key_mode == 0) { + v_encryption_tag.publicKey.eciesNistP256.compressed_y_0 := p_public_compressed_enc_key; + } else { + v_encryption_tag.publicKey.eciesNistP256.compressed_y_1 := p_public_compressed_enc_key; + } + } else if (PX_EC_ALG_FOR_AT == e_brainpool_p256_r1) { + if (p_compressed_enc_key_mode == 0) { + v_encryption_tag.publicKey.eciesBrainpoolP256r1.compressed_y_0 := p_public_compressed_enc_key; + } else { + v_encryption_tag.publicKey.eciesBrainpoolP256r1.compressed_y_1 := p_public_compressed_enc_key; + } + } else { + log("f_generate_key_tag: Failed to generate HMAC tag (enc)"); + return false; + } + log("f_generate_key_tag: v_encryption_tag= ", v_encryption_tag); + p_encoded_tag := p_encoded_tag & bit2oct(encvalue(v_encryption_tag)); + } + + return true; + } // End of function f_generate_key_tag } // End of group helpers @@ -1223,14 +1283,14 @@ module LibItsPki_Functions { m_validityPeriod( f_getCurrentTime() / 1000, m_duration_in_hours(120) - )/*, + ), m_geographicRegion_identifiedRegion( { m_identifiedRegion_country_only(250), // TODO PIXIT m_identifiedRegion_country_only(380) } ), - '00'O*/ // TODO Use PIXIT + '00'O // TODO Use PIXIT ) ); // Encode it ==> Get octetstring @@ -1521,14 +1581,14 @@ module LibItsPki_Functions { m_validityPeriod( f_getCurrentTime() / 1000, m_duration_in_hours(120) // TODO Use PIXIT - )/*, + ), m_geographicRegion_identifiedRegion( { m_identifiedRegion_country_only(250), // TODO Use PIXIT m_identifiedRegion_country_only(380) // TODO Use PIXIT } ), - '00'O*/ // TODO Use PIXIT + '00'O // TODO Use PIXIT ) ) ); @@ -1751,51 +1811,10 @@ module LibItsPki_Functions { log("f_generate_inner_at_request: v_hmac_key= ", v_hmac_key); // Generate tag based on the concatenation of verification keys & encryption keys - if (PX_VE_ALG == e_nist_p256) { - if (p_compressed_key_mode == 0) { - v_verification_tag.ecdsaNistP256.compressed_y_0 := p_public_key_compressed; - } else { - v_verification_tag.ecdsaNistP256.compressed_y_1 := p_public_key_compressed; - } - } else if (PX_VE_ALG == e_brainpool_p256_r1) { - if (p_compressed_key_mode == 0) { - v_verification_tag.ecdsaBrainpoolP256r1.compressed_y_0 := p_public_key_compressed; - } else { - v_verification_tag.ecdsaBrainpoolP256r1.compressed_y_1 := p_public_key_compressed; - } - } else if (PX_VE_ALG == e_brainpool_p384_r1) { - if (p_compressed_key_mode == 0) { - v_verification_tag.ecdsaBrainpoolP384r1.compressed_y_0 := p_public_key_compressed; - } else { - v_verification_tag.ecdsaBrainpoolP384r1.compressed_y_1 := p_public_key_compressed; - } - } else { - log("f_generate_inner_at_request: Failed to generate HMAC tag"); + if (f_generate_key_tag(p_public_key_compressed, p_compressed_key_mode, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_encoded_tag) == false) { + log("f_generate_inner_at_request: Failed to generate Key tag"); return false; } - log("f_generate_inner_at_request: v_verification_tag= ", v_verification_tag); - v_encoded_tag := bit2oct(encvalue(v_verification_tag)); - if (PX_INCLUDE_ENCRYPTION_KEYS) { - v_encryption_tag.supportedSymmAlg := aes128Ccm; - if (PX_EC_ALG_FOR_AT == e_nist_p256) { - if (p_compressed_enc_key_mode == 0) { - v_encryption_tag.publicKey.eciesNistP256.compressed_y_0 := p_public_compressed_enc_key; - } else { - v_encryption_tag.publicKey.eciesNistP256.compressed_y_1 := p_public_compressed_enc_key; - } - } else if (PX_EC_ALG_FOR_AT == e_brainpool_p256_r1) { - if (p_compressed_enc_key_mode == 0) { - v_encryption_tag.publicKey.eciesBrainpoolP256r1.compressed_y_0 := p_public_compressed_enc_key; - } else { - v_encryption_tag.publicKey.eciesBrainpoolP256r1.compressed_y_1 := p_public_compressed_enc_key; - } - } else { - log("f_generate_inner_at_request: Failed to generate HMAC tag (enc)"); - return false; - } - log("f_generate_inner_at_request: v_encryption_tag= ", v_encryption_tag); - v_encoded_tag := v_encoded_tag & bit2oct(encvalue(v_encryption_tag)); - } log("f_generate_inner_at_request: v_encoded_tag= ", v_encoded_tag); v_key_tag := substr( fx_hmac_sha256( // TODO Rename and use a wrapper function @@ -2112,51 +2131,10 @@ module LibItsPki_Functions { log("f_generate_inner_at_request_with_wrong_hmac: v_hmac_key= ", v_hmac_key); // Generate tag based on the concatenation of verification keys & encryption keys - if (PX_VE_ALG == e_nist_p256) { - if (p_compressed_key_mode == 0) { - v_verification_tag.ecdsaNistP256.compressed_y_0 := p_public_key_compressed; - } else { - v_verification_tag.ecdsaNistP256.compressed_y_1 := p_public_key_compressed; - } - } else if (PX_VE_ALG == e_brainpool_p256_r1) { - if (p_compressed_key_mode == 0) { - v_verification_tag.ecdsaBrainpoolP256r1.compressed_y_0 := p_public_key_compressed; - } else { - v_verification_tag.ecdsaBrainpoolP256r1.compressed_y_1 := p_public_key_compressed; - } - } else if (PX_VE_ALG == e_brainpool_p384_r1) { - if (p_compressed_key_mode == 0) { - v_verification_tag.ecdsaBrainpoolP384r1.compressed_y_0 := p_public_key_compressed; - } else { - v_verification_tag.ecdsaBrainpoolP384r1.compressed_y_1 := p_public_key_compressed; - } - } else { - log("f_generate_inner_at_request_with_wrong_hmac: Failed to generate HMAC tag"); + if (f_generate_key_tag(p_public_key_compressed, p_compressed_key_mode, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_encoded_tag) == false) { + log("f_generate_inner_at_request_with_wrong_hmac: Failed to generate Key tag"); return false; } - log("f_generate_inner_at_request_with_wrong_hmac: v_verification_tag= ", v_verification_tag); - v_encoded_tag := bit2oct(encvalue(v_verification_tag)); - if (PX_INCLUDE_ENCRYPTION_KEYS) { - v_encryption_tag.supportedSymmAlg := aes128Ccm; - if (PX_EC_ALG_FOR_AT == e_nist_p256) { - if (p_compressed_enc_key_mode == 0) { - v_encryption_tag.publicKey.eciesNistP256.compressed_y_0 := p_public_compressed_enc_key; - } else { - v_encryption_tag.publicKey.eciesNistP256.compressed_y_1 := p_public_compressed_enc_key; - } - } else if (PX_EC_ALG_FOR_AT == e_brainpool_p256_r1) { - if (p_compressed_enc_key_mode == 0) { - v_encryption_tag.publicKey.eciesBrainpoolP256r1.compressed_y_0 := p_public_compressed_enc_key; - } else { - v_encryption_tag.publicKey.eciesBrainpoolP256r1.compressed_y_1 := p_public_compressed_enc_key; - } - } else { - log("f_generate_inner_at_request_with_wrong_hmac: Failed to generate HMAC tag (enc)"); - return false; - } - log("f_generate_inner_at_request_with_wrong_hmac: v_encryption_tag= ", v_encryption_tag); - v_encoded_tag := v_encoded_tag & bit2oct(encvalue(v_encryption_tag)); - } log("f_generate_inner_at_request_with_wrong_hmac: v_encoded_tag= ", v_encoded_tag); // Modify v_hmac_key v_key_tag := substr( diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index f66bbf62..189e6125 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -1804,7 +1804,15 @@ module LibItsSecurity_Functions { log("f_verifyGnSecuredMessageSignature_ecdsaNistP256: v_secPayload=", v_secPayload); // Verify payload - v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig.x_only) & valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig); + + // TODO Check in standard if x-only only + if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig.x_only)) { + v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig.x_only) & valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig); + } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig.compressed_y_0)) { + v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig.compressed_y_0) & valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig); + } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig.compressed_y_1)) { + v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig.compressed_y_1) & valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig); + } log("f_verifyGnSecuredMessageSignature_ecdsaNistP256: v_signedData=", v_signedData); if (ischosen(p_publicKey.uncompressedP256)) { v_result := f_verifyWithEcdsaNistp256WithSha256_1( -- GitLab From 13eeec47fc27bf506420a9c8f4260b1dd237463f Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 12 Mar 2019 08:18:03 -0700 Subject: [PATCH 200/320] Update IS ASN.1 files --- .../ETSI_TS_103301/IVIM_PDU_Descriptions.asn | 6 +- .../ETSI_TS_103301/MAPEM_PDU_Descriptions.asn | 8 +- .../ETSI_TS_103301/RTCM_PDU_Descriptions.asn | 28 + .../SPATEM_PDU_Descriptions.asn | 8 +- .../ETSI_TS_103301/SREM_PDU_Descriptions.asn | 9 +- .../ETSI_TS_103301/SSEM_PDU_Descriptions.asn | 8 +- .../AVIAEINumberingAndDataStructures.asn | 58 +- asn1/IS/ISO_TS_14906/EfcDsrcApplication.asn | 8 +- asn1/IS/ISO_TS_17419/CITSapplMgmtIDs.asn | 88 +- asn1/IS/ISO_TS_19091/AddGrpC.asn | 142 +- asn1/IS/ISO_TS_19091/DSRC.asn | 1462 +++------ .../ISO_TS_19091/DSRC_REGION_noCircular.asn | 62 +- asn1/IS/ISO_TS_19091/REGION.asn | 39 +- asn1/IS/ISO_TS_19091/original/AddGrpC.asn | 239 +- asn1/IS/ISO_TS_19091/original/DSRC.asn | 2631 +++++++---------- asn1/IS/ISO_TS_19091/original/REGION.asn | 142 +- asn1/IS/ISO_TS_19321/IVI.asn | 9 +- ...trationIdentificationVehicleDataModule.asn | 172 +- .../LibItsMapemSpatem_Templates.ttcn | 2 +- ttcn/SremSsem/LibItsSremSsem_Templates.ttcn | 1 + 20 files changed, 2094 insertions(+), 3028 deletions(-) create mode 100644 asn1/IS/ETSI_TS_103301/RTCM_PDU_Descriptions.asn diff --git a/asn1/IS/ETSI_TS_103301/IVIM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/IVIM_PDU_Descriptions.asn index 1b80fe88..62cb689d 100644 --- a/asn1/IS/ETSI_TS_103301/IVIM_PDU_Descriptions.asn +++ b/asn1/IS/ETSI_TS_103301/IVIM_PDU_Descriptions.asn @@ -5,7 +5,7 @@ -- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- IVIM-PDU-Descriptions { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts-103301 (103301) ivim (2) version1 (1) + itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) en (103301) ivim (2) version2 (2) } DEFINITIONS AUTOMATIC TAGS ::= @@ -14,8 +14,10 @@ BEGIN IMPORTS IviStructure FROM IVI {iso (1) standard (0) ivi (19321) version1 (1)} -ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2)}; +ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2)} +; +-- End of IMPORTS IVIM ::= SEQUENCE { header ItsPduHeader, diff --git a/asn1/IS/ETSI_TS_103301/MAPEM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/MAPEM_PDU_Descriptions.asn index 990ed1c5..bb173416 100644 --- a/asn1/IS/ETSI_TS_103301/MAPEM_PDU_Descriptions.asn +++ b/asn1/IS/ETSI_TS_103301/MAPEM_PDU_Descriptions.asn @@ -5,7 +5,7 @@ -- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- MAPEM-PDU-Descriptions { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts-103301 (103301) mapem (1) version1 (1) + itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) en (103301) mapem (1) version2 (2) } DEFINITIONS AUTOMATIC TAGS ::= @@ -13,9 +13,11 @@ DEFINITIONS AUTOMATIC TAGS ::= BEGIN IMPORTS -MapData FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } -ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2)}; +MapData FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) } +ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2)} +; +-- End of IMPORTS MAPEM ::= SEQUENCE { header ItsPduHeader, diff --git a/asn1/IS/ETSI_TS_103301/RTCM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/RTCM_PDU_Descriptions.asn new file mode 100644 index 00000000..d55d840b --- /dev/null +++ b/asn1/IS/ETSI_TS_103301/RTCM_PDU_Descriptions.asn @@ -0,0 +1,28 @@ +-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +-- +-- module: RTCM corrections extended message +-- +-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- + +RTCMEM-PDU-Descriptions { + itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) en (103301) rtcmem (5) version1 (1) +} + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +IMPORTS +RTCMcorrections FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) } +ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2)} + +; +-- End of IMPORTS + +RTCMEM ::= SEQUENCE { + header ItsPduHeader, + rtcmc RTCMcorrections +} + +END + diff --git a/asn1/IS/ETSI_TS_103301/SPATEM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/SPATEM_PDU_Descriptions.asn index fea567f3..9de013fa 100644 --- a/asn1/IS/ETSI_TS_103301/SPATEM_PDU_Descriptions.asn +++ b/asn1/IS/ETSI_TS_103301/SPATEM_PDU_Descriptions.asn @@ -7,7 +7,7 @@ -- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- SPATEM-PDU-Descriptions { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts-103301 (103301) spatem (0) version1 (1) + itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) en (103301) spatem (0) version2 (2) } DEFINITIONS AUTOMATIC TAGS ::= @@ -15,9 +15,11 @@ DEFINITIONS AUTOMATIC TAGS ::= BEGIN IMPORTS -SPAT FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } -ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) }; +SPAT FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) } +ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) } +; +-- End of IMPORTS SPATEM ::= SEQUENCE { header ItsPduHeader, diff --git a/asn1/IS/ETSI_TS_103301/SREM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/SREM_PDU_Descriptions.asn index 914dff6b..d0d1b1c3 100644 --- a/asn1/IS/ETSI_TS_103301/SREM_PDU_Descriptions.asn +++ b/asn1/IS/ETSI_TS_103301/SREM_PDU_Descriptions.asn @@ -5,7 +5,7 @@ -- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- SREM-PDU-Descriptions { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts-103301 (103301) srem (3) version1 (1) + itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) en (103301) srem (3) version2 (2) } DEFINITIONS AUTOMATIC TAGS ::= @@ -13,8 +13,11 @@ DEFINITIONS AUTOMATIC TAGS ::= BEGIN IMPORTS -SignalRequestMessage FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } -ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) }; +SignalRequestMessage FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) } +ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2)} + +; +-- End of IMPORTS SREM ::= SEQUENCE { header ItsPduHeader, diff --git a/asn1/IS/ETSI_TS_103301/SSEM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/SSEM_PDU_Descriptions.asn index 5eed2365..f3f1199d 100644 --- a/asn1/IS/ETSI_TS_103301/SSEM_PDU_Descriptions.asn +++ b/asn1/IS/ETSI_TS_103301/SSEM_PDU_Descriptions.asn @@ -5,7 +5,7 @@ -- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- SSEM-PDU-Descriptions { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts-103301 (103301) ssem (4) version1 (1) + itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) en (103301) ssem (4) version2 (2) } DEFINITIONS AUTOMATIC TAGS ::= @@ -13,9 +13,11 @@ DEFINITIONS AUTOMATIC TAGS ::= BEGIN IMPORTS -SignalStatusMessage FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } -ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) }; +SignalStatusMessage FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) } +ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2)} +; +-- End of IMPORTS SSEM ::= SEQUENCE { header ItsPduHeader, diff --git a/asn1/IS/ISO_TS_14816/AVIAEINumberingAndDataStructures.asn b/asn1/IS/ISO_TS_14816/AVIAEINumberingAndDataStructures.asn index 9f7298f9..9fd119ba 100644 --- a/asn1/IS/ISO_TS_14816/AVIAEINumberingAndDataStructures.asn +++ b/asn1/IS/ISO_TS_14816/AVIAEINumberingAndDataStructures.asn @@ -1,29 +1,29 @@ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- ISO TS 14816 --- --- This ASN.1 was generateds: 30.08.2016 --- --- This document contains only the data element needed for the encoding of an IVI message --- as defined in ISO TS 19321(2015) --- --- Published version location: --- http://standards.iso.org/iso/14816/ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -AVIAEINumberingAndDataStructures {iso(1) standard(0) iso14816(14816) asnm1(1) version1(1)} - -DEFINITIONS AUTOMATIC TAGS::= BEGIN -IMPORTS; - -CS5::= SEQUENCE { - vin VisibleString, -- 17 characters VIN - fill BIT STRING (SIZE(9)) -- set to '000000000' -} - - - -CountryCode::= BIT STRING(SIZE(10)) - -AVIAEIIssuerIdentifier::= INTEGER(0 .. 16383) - -END +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- ISO TS 14816 +-- +-- This ASN.1 was generateds: 30.08.2016 +-- +-- This document contains only the data element needed for the encoding of an IVI message +-- as defined in ISO TS 19321(2015) +-- +-- Published version location: +-- http://standards.iso.org/iso/14816/ +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +AVIAEINumberingAndDataStructures {iso(1) standard(0) iso14816(14816) asnm1(1) version1(1)} + +DEFINITIONS AUTOMATIC TAGS::= BEGIN +IMPORTS; + +CS5::= SEQUENCE { + vin VisibleString, -- 17 characters VIN + fill BIT STRING (SIZE(9)) -- set to '000000000' +} + + + +CountryCode::= BIT STRING(SIZE(10)) + +AVIAEIIssuerIdentifier::= INTEGER(0 .. 16383) + +END diff --git a/asn1/IS/ISO_TS_14906/EfcDsrcApplication.asn b/asn1/IS/ISO_TS_14906/EfcDsrcApplication.asn index f5f1db97..67b999cf 100644 --- a/asn1/IS/ISO_TS_14906/EfcDsrcApplication.asn +++ b/asn1/IS/ISO_TS_14906/EfcDsrcApplication.asn @@ -18,12 +18,14 @@ IMPORTS CountryCode, CS5, AVIAEIIssuerIdentifier FROM AVIAEINumberingAndDataStructures {iso(1) standard(0) iso14816(14816) asnm1(1) version1(1)} -- defined in ISO 14816 -- --- AttributeIdList --- FROM EfcDsrcGeneric {iso(1) standard(0) 14906 generic(1) version5(5)}; -; +AttributeIdList, Attributes{}, AttributeList{} +FROM EfcDsrcGeneric {iso(1) standard(0) 14906 generic(1) version5(5)} -- NOTE: The following are the definitions of the action and response -- parameters +; +-- End of IMPORTS + AxleWeightLimits ::= SEQUENCE { maxLadenweightOnAxle1 Int2, maxLadenweightOnAxle2 Int2, diff --git a/asn1/IS/ISO_TS_17419/CITSapplMgmtIDs.asn b/asn1/IS/ISO_TS_17419/CITSapplMgmtIDs.asn index 8b0113f0..edeab5bd 100644 --- a/asn1/IS/ISO_TS_17419/CITSapplMgmtIDs.asn +++ b/asn1/IS/ISO_TS_17419/CITSapplMgmtIDs.asn @@ -1,44 +1,44 @@ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- ISO TS 17419 --- --- This ASN.1 was generateds: 30.08.2016 --- --- This document contains only the data element needed for the encoding of an IVI message --- as defined in ISO TS 19321(2015) --- --- Published version location: --- http://standards.iso.org/iso/ts/17419/ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -CITSapplMgmtIDs {iso(1) standard(0) cits-applMgmt (17419) ids (1) version1 (1)} - -DEFINITIONS AUTOMATIC TAGS::=BEGIN - -IMPORTS - -; - --- End of IMPORTS - --- Types - --- Variable length data types - -VarLengthNumber::=CHOICE{ - content [0] INTEGER(0..127), -- one octet length - extension [1] Ext1 - } - -Ext1::=CHOICE{ - content [0] INTEGER(128..16511), -- two octets length - extension [1] Ext2 -} - -Ext2::=CHOICE{ - content [0] INTEGER(16512..2113663), -- three octets length - extension [1] Ext3 - } - -Ext3::=INTEGER(2113664..270549119,...) -- four and more octets length - -END +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- ISO TS 17419 +-- +-- This ASN.1 was generateds: 30.08.2016 +-- +-- This document contains only the data element needed for the encoding of an IVI message +-- as defined in ISO TS 19321(2015) +-- +-- Published version location: +-- http://standards.iso.org/iso/ts/17419/ +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +CITSapplMgmtIDs {iso(1) standard(0) cits-applMgmt (17419) ids (1) version1 (1)} + +DEFINITIONS AUTOMATIC TAGS::=BEGIN + +IMPORTS + +; + +-- End of IMPORTS + +-- Types + +-- Variable length data types + +VarLengthNumber::=CHOICE{ + content [0] INTEGER(0..127), -- one octet length + extension [1] Ext1 + } + +Ext1::=CHOICE{ + content [0] INTEGER(128..16511), -- two octets length + extension [1] Ext2 +} + +Ext2::=CHOICE{ + content [0] INTEGER(16512..2113663), -- three octets length + extension [1] Ext3 + } + +Ext3::=INTEGER(2113664..270549119,...) -- four and more octets length + +END diff --git a/asn1/IS/ISO_TS_19091/AddGrpC.asn b/asn1/IS/ISO_TS_19091/AddGrpC.asn index bbe44e92..06315625 100644 --- a/asn1/IS/ISO_TS_19091/AddGrpC.asn +++ b/asn1/IS/ISO_TS_19091/AddGrpC.asn @@ -15,89 +15,144 @@ -- -- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- -AddGrpC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) addgrpc (0) version (1) } +AddGrpC { + iso (1) standard (0) signalizedIntersection (19091) profilec (2) addgrpc (0) + version2 (2) + } DEFINITIONS AUTOMATIC TAGS::= BEGIN IMPORTS --FIXME RGY all definitions are moved to IS-DSRC-noCircular to cut circular import loop ---NodeOffsetPointXY, NodeSetXY, PrioritizationResponseStatus, SignalGroupID, DeltaTime, LaneID FROM DSRC -NodeOffsetPointXY, NodeSetXY, PrioritizationResponseStatus, SignalGroupID, DeltaTime, LaneID FROM DSRC-REGION-noCircular -Altitude, StationID, DeltaAltitude FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) }; +--DeltaTime, FuelType, IntersectionID, LaneConnectionID, LaneID, NodeOffsetPointXY, NodeSetXY, PrioritizationResponseStatus, SignalGroupID, VehicleHeight FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) } +NodeOffsetPointXY, NodeSetXY, PrioritizationResponseStatus, SignalGroupID, DeltaTime, LaneID, LaneConnectionID, FuelType, VehicleHeight FROM DSRC-REGION-noCircular + +Altitude, StationID, DeltaAltitude, VehicleMass FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) }; ConnectionManeuverAssist-addGrpC ::= SEQUENCE { - itsStationPositions ItsStationPositionList OPTIONAL, - rsuGNSSOffset NodeOffsetPointXY OPTIONAL, + itsStationPosition ItsStationPositionList OPTIONAL, ... } ConnectionTrajectory-addGrpC ::= SEQUENCE { nodes NodeSetXY, + connectionID LaneConnectionID, ... } -/*FIXME RGY moved to AddGrpC-noCircular to cut circular import loop -Control-addGrpC ::= SEQUENCE { - ptvRequest PtvRequestType, - ... -} -*/ - IntersectionState-addGrpC ::= SEQUENCE { activePrioritizations PrioritizationResponseList OPTIONAL, ... } +LaneAttributes-addGrpC ::= SEQUENCE { + maxVehicleHeight VehicleHeight OPTIONAL, + maxVehicleWeight VehicleMass OPTIONAL, + ... +} MapData-addGrpC ::= SEQUENCE { signalHeadLocations SignalHeadLocationList OPTIONAL, ... } -Position3D-addGrpC ::= SEQUENCE { - altitude Altitude, +MovementEvent-addGrpC ::= SEQUENCE { + stateChangeReason ExceptionalCondition OPTIONAL, ... } -PrioritizationResponseList ::= SEQUENCE SIZE(1..10) OF PrioritizationResponse +/*FIXME RGY moved to AddGrpC-noCircular to cut circular import loop +NodeAttributeSet-addGrpC ::= SEQUENCE { + ptvRequest PtvRequestType OPTIONAL, + nodeLink NodeLink OPTIONAL, + node Node OPTIONAL, + ... +} +*/ + -PrioritizationResponse ::= SEQUENCE { - stationID StationID, - priorState PrioritizationResponseStatus, - signalGroup SignalGroupID, +Position3D-addGrpC ::= SEQUENCE { + altitude Altitude, ... } RestrictionUserType-addGrpC ::= SEQUENCE { emission EmissionType OPTIONAL, + fuel FuelType OPTIONAL, ... } -SignalHeadLocationList ::= SEQUENCE (SIZE(1..64)) OF SignalHeadLocation - -SignalHeadLocation ::= SEQUENCE { - nodeXY NodeOffsetPointXY, - nodeZ DeltaAltitude, - signalGroupID SignalGroupID, +RequestorDescription-addGrpC ::= SEQUENCE { + fuel FuelType OPTIONAL, + batteryStatus BatteryStatus OPTIONAL, ... } SignalStatusPackage-addGrpC ::= SEQUENCE { synchToSchedule DeltaTime OPTIONAL, + rejectedReason RejectedReason OPTIONAL, ... } -ItsStationPositionList::= SEQUENCE SIZE(1..5) OF ItsStationPosition +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- Data frames +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ItsStationPosition ::= SEQUENCE { - stationID StationID, + stationID StationID, laneID LaneID OPTIONAL, nodeXY NodeOffsetPointXY OPTIONAL, timeReference TimeReference OPTIONAL, ... } + +ItsStationPositionList ::= SEQUENCE SIZE(1..5) OF ItsStationPosition + +/*FIXME YGA Moved to DSRC-REGION_noCircular to cut circular import loop +Node ::= SEQUENCE { + id INTEGER, + lane LaneID OPTIONAL, + connectionID LaneConnectionID OPTIONAL, + intersectionID IntersectionID OPTIONAL, + ... +} + +NodeLink ::= SEQUENCE SIZE (1..5) OF Node +*/ + +PrioritizationResponse ::= SEQUENCE { + stationID StationID, + priorState PrioritizationResponseStatus, + signalGroup SignalGroupID, + ... +} + +PrioritizationResponseList ::= SEQUENCE SIZE(1..10) OF PrioritizationResponse + +SignalHeadLocation ::= SEQUENCE { + nodeXY NodeOffsetPointXY, + nodeZ DeltaAltitude, + signalGroupID SignalGroupID, + ... +} + +SignalHeadLocationList ::= SEQUENCE (SIZE(1..64)) OF SignalHeadLocation + + +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- Data elements +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +BatteryStatus ::= ENUMERATED { + unknown, + critical, + low, + good, + ... +} + EmissionType ::= ENUMERATED { euro1, euro2, @@ -108,6 +163,23 @@ EmissionType ::= ENUMERATED { ... } +ExceptionalCondition ::= ENUMERATED { + unknown, + publicTransportPriority, + emergencyVehiclePriority, + trainPriority, + bridgeOpen, + vehicleHeight, + weather, + trafficJam, + tunnelClosure, + meteringActive, + truckPriority, + bicyclePlatoonPriority, + vehiclePlatoonPriority, + ... +} + /*FIXME RGY moved to AddGrpC-noCircular to cut circular import loop PtvRequestType ::= ENUMERATED { preRequest, @@ -119,6 +191,18 @@ PtvRequestType ::= ENUMERATED { } */ -TimeReference ::= INTEGER { oneMilliSec(1) } (0..65535) +RejectedReason ::= ENUMERATED { + unknown, + exceptionalCondition, + maxWaitingTimeExceeded, + ptPriorityDisabled, + higherPTPriorityGranted, + vehicleTrackingUnknown, + ... +} + +TimeReference ::= INTEGER { oneMilliSec(1) } (0..60000) + + END diff --git a/asn1/IS/ISO_TS_19091/DSRC.asn b/asn1/IS/ISO_TS_19091/DSRC.asn index bc326b27..65a0ddb8 100644 --- a/asn1/IS/ISO_TS_19091/DSRC.asn +++ b/asn1/IS/ISO_TS_19091/DSRC.asn @@ -14,24 +14,26 @@ -- -- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- -DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } +DSRC { + iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) +} DEFINITIONS AUTOMATIC TAGS::= BEGIN IMPORTS --FIXME RGY definitions moved to module DSRC-REGION-noCircular are commented our below -StationID, Longitude, Latitude, SpeedConfidence FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) } Reg-SPAT,Reg-SignalRequestMessage, Reg-SignalStatusMessage, Reg-MapData, Reg-AdvisorySpeed, Reg-ComputedLane, Reg-ConnectionManeuverAssist, Reg-GenericLane, Reg-IntersectionGeometry, Reg-IntersectionState, Reg-LaneAttributes, /*Reg-LaneDataAttribute,*/ Reg-MovementEvent, Reg-MovementState, /*Reg-NodeAttributeSetXY, Reg-NodeOffsetPointXY,*/ Reg-Position3D, Reg-RequestorDescription, Reg-RequestorType, Reg-RestrictionUserType, Reg-RoadSegment, -Reg-SignalControlZone, Reg-SignalRequestPackage, Reg-SignalRequest, Reg-SignalStatusPackage, Reg-SignalStatus FROM REGION {iso (1) standard (0) signalizedIntersection (19091) profilec(2) region (1) version (1)} +Reg-SignalControlZone, Reg-SignalRequestPackage, Reg-SignalRequest, Reg-SignalStatusPackage, Reg-SignalStatus, Reg-RTCMcorrections FROM REGION {iso (1) standard (0) signalizedIntersection (19091) profilec (2) region (1) version2 (2)} --FIXME RGY definitions moved to DSRC-REGION-noCircular but also refernced here are re-imported -DeltaAngle, DeltaTime, LaneID, NodeSetXY, PrioritizationResponseStatus, RegionalExtension, SignalGroupID, SpeedLimitList, Velocity, -Reg-LaneDataAttribute, Reg-NodeAttributeSetXY, Reg-NodeOffsetPointXY FROM DSRC-REGION-noCircular -Iso3833VehicleType FROM ElectronicRegistrationIdentificationVehicleDataModule {iso(1) standard(0) iso24534 (24534) vehicleData (1) version (1)} -; +DeltaAngle, DeltaTime, LaneID, LaneConnectionID, IntersectionID, NodeSetXY, PrioritizationResponseStatus, RegionalExtension, SignalGroupID, SpeedLimitList, Velocity, NodeOffsetPointXY, NodeAttributeXY, Reg-LaneDataAttribute, Reg-NodeAttributeSetXY, Reg-NodeOffsetPointXY, Offset-B12, Offset-B09, Offset-B10 FROM DSRC-REGION-noCircular +Iso3833VehicleType FROM ElectronicRegistrationIdentificationVehicleDataModule {iso(1) standard(0) iso24534 (24534) vehicleData (1) version1 (1)} + +Longitude, Latitude, StationID FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) } +; -- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ -- @@ -73,18 +75,36 @@ RegionalExtension {REG-EXT-ID-AND-TYPE : Set} ::= SEQUENCE { } */ +MapData ::= SEQUENCE { + timeStamp MinuteOfTheYear OPTIONAL, + msgIssueRevision MsgCount, + layerType LayerType OPTIONAL, + layerID LayerID OPTIONAL, + intersections IntersectionGeometryList OPTIONAL, + roadSegments RoadSegmentList OPTIONAL, + dataParameters DataParameters OPTIONAL, + restrictionList RestrictionClassList OPTIONAL, + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-MapData}} OPTIONAL, + ... +} + +RTCMcorrections ::= SEQUENCE { + msgCnt MsgCount, + rev RTCM-Revision, + timeStamp MinuteOfTheYear OPTIONAL, + anchorPoint FullPositionVector OPTIONAL, + rtcmHeader RTCMheader OPTIONAL, + msgs RTCMmessageList, + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-RTCMcorrections}} OPTIONAL, + ... +} + SPAT ::= SEQUENCE { timeStamp MinuteOfTheYear OPTIONAL, name DescriptiveName OPTIONAL, - -- human readable name for this collection - -- to be used only in debug mode - intersections IntersectionStateList, - -- sets of SPAT data (one per intersection) - - -- If PrioritizationResponse data is required, it is found - -- in the RegionalSPAT entry below - regional SEQUENCE (SIZE(1..4)) OF RegionalExtension {{Reg-SPAT}} OPTIONAL, ... @@ -96,15 +116,7 @@ SignalRequestMessage ::= SEQUENCE { sequenceNumber MsgCount OPTIONAL, requests SignalRequestList OPTIONAL, - -- Request Data for one or more signalized - -- intersections that support SRM dialogs - requestor RequestorDescription, - -- Requesting Device and other User Data - -- contains vehicle ID (if from a vehicle) - -- as well as type data and current position - -- and may contain additional transit data - regional SEQUENCE (SIZE(1..4)) OF RegionalExtension {{Reg-SignalRequestMessage}} OPTIONAL, ... @@ -114,69 +126,26 @@ SignalStatusMessage ::= SEQUENCE { timeStamp MinuteOfTheYear OPTIONAL, second DSecond, sequenceNumber MsgCount OPTIONAL, - - -- Status Data for one of more signalized intersections status SignalStatusList, - regional SEQUENCE (SIZE(1..4)) OF RegionalExtension {{Reg-SignalStatusMessage}} OPTIONAL, ... } -MapData ::= SEQUENCE { - timeStamp MinuteOfTheYear OPTIONAL, - msgIssueRevision MsgCount, - layerType LayerType OPTIONAL, - layerID LayerID OPTIONAL, - intersections IntersectionGeometryList OPTIONAL, - -- All Intersection definitions - roadSegments RoadSegmentList OPTIONAL, - -- All roadway descriptions - - dataParameters DataParameters OPTIONAL, - -- Any meta data regarding the map contents - - restrictionList RestrictionClassList OPTIONAL, - -- Any restriction ID tables which have - -- established for these map entries - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-MapData}} OPTIONAL, - -- NOTE: - -- Other map data will be added here as it is defined - -- Examples of the type of content to be added include - -- curve warnings, construction routes, etc. - ... -} -- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ --- -- Start of entries from table Data_Frames... --- This table typicaly contains data frame entries. +-- Data frames -- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ --- AdvisorySpeed ::= SEQUENCE { type AdvisorySpeedType, - -- the type of advisory which this is. speed SpeedAdvice OPTIONAL, - -- See Section 11 for converting and translating speed - -- expressed in mph into units of m/s - -- This element is optional ONLY when superceded - -- by the presence of a regional speed element found in - -- Reg-AdvisorySpeed entry - confidence SpeedConfidence OPTIONAL, - -- A confidence value for the above speed + confidence SpeedConfidenceDSRC OPTIONAL, distance ZoneLength OPTIONAL, - -- Unit = 1 meter, - -- The distance indicates the region for which the advised speed - -- is recommended, it is specified upstream from the stop bar - -- along the connected egressing lane class RestrictionClassID OPTIONAL, - -- the vehicle types to which it applies - -- when absent, the AdvisorySpeed applies to - -- all motor vehicle types regional SEQUENCE (SIZE(1..4)) OF RegionalExtension {{Reg-AdvisorySpeed}} OPTIONAL, ... @@ -184,12 +153,14 @@ AdvisorySpeed ::= SEQUENCE { AdvisorySpeedList ::= SEQUENCE (SIZE(1..16)) OF AdvisorySpeed +AntennaOffsetSet ::= SEQUENCE { + antOffsetX Offset-B12, + antOffsetY Offset-B09, + antOffsetZ Offset-B10 + } + ComputedLane ::= SEQUENCE { - -- Data needed to created a computed lane referenceLaneId LaneID, - -- the lane ID upon which this - -- computed lane will be based - -- Lane Offset in X and Y direction offsetXaxis CHOICE { small DrivenLineOffsetSm, large DrivenLineOffsetLg @@ -198,27 +169,9 @@ ComputedLane ::= SEQUENCE { small DrivenLineOffsetSm, large DrivenLineOffsetLg }, - -- A path X offset value for translations of the - -- path's points when creating translated lanes. - -- The values found in the reference lane are - -- all offset based on the X and Y values from - -- the coordinates of the reference lane's - -- initial path point. - -- Lane Rotation rotateXY Angle OPTIONAL, - -- A path rotation value for the entire lane - -- Observe that this rotates the existing orientation - -- of the referenced lane, it does not replace it. - -- Rotation occurs about the initial path point. - -- Lane Path Scale (zooming) scaleXaxis Scale-B12 OPTIONAL, scaleYaxis Scale-B12 OPTIONAL, - -- value for translations or zooming of the path's - -- points. The values found in the reference lane - -- are all expanded or contracted based on the X - -- and Y and width values from the coordinates of - -- the reference lane's initial path point. - -- The Z axis remains untouched. regional SEQUENCE (SIZE(1..4)) OF RegionalExtension {{Reg-ComputedLane}} OPTIONAL, ... @@ -226,83 +179,26 @@ ComputedLane ::= SEQUENCE { ConnectsToList ::= SEQUENCE (SIZE(1..16)) OF Connection ConnectingLane ::= SEQUENCE { - lane LaneID, -- Index of the connecting lane + lane LaneID, maneuver AllowedManeuvers OPTIONAL - -- The Maneuver between - -- the enclosing lane and this lane - -- at the stop line to connect them } Connection ::= SEQUENCE { - -- The subject lane connecting to this lane is: connectingLane ConnectingLane, - -- The index of the connecting lane and also - -- the maneuver from the current lane to it remoteIntersection IntersectionReferenceID OPTIONAL, - -- This entry is only used when the - -- indicated connecting lane belongs - -- to another intersection layout. This - -- provides a means to create meshes of lanes - - -- SPAT mapping details at the stop line are: signalGroup SignalGroupID OPTIONAL, - -- The matching signal group send by - -- the SPAT message for this lane/maneuver. - -- Shall be present unless the connectingLane - -- has no signal group (is un-signalized) userClass RestrictionClassID OPTIONAL, - -- The Restriction Class of users this applies to - -- The use of some lane/maneuver and SignalGroupID - -- pairings are restricted to selected users. - -- When absent, the SignalGroupID applies to all - - -- Movement assist details are given by: connectionID LaneConnectionID OPTIONAL - -- An optional connection index used to - -- relate this lane connection to any dynamic - -- clearance data in the SPAT. Note that - -- the index may be shared with other - -- connections if the clearance data is common } ConnectionManeuverAssist ::= SEQUENCE { connectionID LaneConnectionID, - -- the common connectionID used by all lanes to which - -- this data applies - -- (this value traces to ConnectsTo entries in lanes) - -- Expected Clearance Information queueLength ZoneLength OPTIONAL, - -- Unit = 1 meter, 0 = no queue - -- The distance from the stop line to the back - -- edge of the last vehicle in the queue, - -- as measured along the lane center line. availableStorageLength ZoneLength OPTIONAL, - -- Unit = 1 meter, 0 = no space remains - -- Distance (e.g. beginning from the downstream - -- stop-line up to a given distance) with a high - -- probability for successfully executing the - -- connecting maneuver between the two lanes - -- during the current cycle. - -- Used for enhancing the awareness of vehicles - -- to anticipate if they can pass the stop line - -- of the lane. Used for optimizing the green wave, - -- due to knowledge of vehicles waiting in front - -- of a red light (downstream). - -- The element nextTime in TimeChangeDetails - -- in the containing data frame contains the next - -- timemark at which an active phase is expected, - -- a form of storage flush interval. waitOnStop WaitOnStopline OPTIONAL, - -- If "true", the vehicles on this specific connecting - -- maneuver have to stop on the stop-line and not - -- to enter the collision area pedBicycleDetect PedestrianBicycleDetect OPTIONAL, - -- true if ANY ped or bicycles are detected crossing - -- the above lanes. Set to false ONLY if there is a - -- high certainty that there are none present, - -- otherwise element is not sent. regional SEQUENCE (SIZE(1..4)) OF RegionalExtension {{Reg-ConnectionManeuverAssist}} OPTIONAL, ... @@ -316,45 +212,44 @@ DataParameters ::= SEQUENCE { ... } + +DDateTime ::= SEQUENCE { + year DYear OPTIONAL, + month DMonth OPTIONAL, + day DDay OPTIONAL, + hour DHour OPTIONAL, + minute DMinute OPTIONAL, + second DSecond OPTIONAL, + offset DOffset OPTIONAL + } + EnabledLaneList ::= SEQUENCE (SIZE(1..16)) OF LaneID - -- The unique ID numbers for each - -- lane object which is 'active' - -- as part of the dynamic map contents. + +FullPositionVector ::= SEQUENCE { + utcTime DDateTime OPTIONAL, -- time with mSec precision + long Longitude, + lat Latitude, + elevation Elevation OPTIONAL, + heading HeadingDSRC OPTIONAL, + speed TransmissionAndSpeed OPTIONAL, + posAccuracy PositionalAccuracy OPTIONAL, + timeConfidence TimeConfidence OPTIONAL, + posConfidence PositionConfidenceSet OPTIONAL, + speedConfidence SpeedandHeadingandThrottleConfidence OPTIONAL, + ... + } + GenericLane ::= SEQUENCE { laneID LaneID, - -- The unique ID number assigned - -- to this lane object name DescriptiveName OPTIONAL, - -- often for debug use only - -- but at times used to name ped crossings - ingressApproach ApproachID OPTIONAL, -- inbound - egressApproach ApproachID OPTIONAL, -- outbound - -- Approach IDs to which this lane belongs + ingressApproach ApproachID OPTIONAL, + egressApproach ApproachID OPTIONAL, laneAttributes LaneAttributes, - -- All Attribute information about - -- the basic selected lane type - -- Directions of use, Geometric co-sharing - -- and Type Specific Attributes - -- These Attributes are 'lane - global' that is, - -- they are true for the entire length of the lane maneuvers AllowedManeuvers OPTIONAL, - -- the permitted maneuvers for this lane nodeList NodeListXY, - -- Lane spatial path information as well as - -- various Attribute information along the node path - -- Attributes found here are more general and may - -- come and go over the length of the lane. connectsTo ConnectsToList OPTIONAL, - -- a list of other lanes and their signal group IDs - -- each connecting lane and its signal group ID - -- is given, therefore this element provides the - -- information formerly in "signalGroups" in prior - -- editions. overlays OverlayLaneList OPTIONAL, - -- A list of any lanes which have spatial paths that - -- overlay (run on top of, and not simply cross) - -- the path of this lane when used regional SEQUENCE (SIZE(1..4)) OF RegionalExtension {{Reg-GenericLane}} OPTIONAL, ... @@ -369,39 +264,13 @@ IntersectionAccessPoint ::= CHOICE { IntersectionGeometry ::= SEQUENCE { name DescriptiveName OPTIONAL, - -- For debug use only id IntersectionReferenceID, - -- A globally unique value set, - -- consisting of a regionID and - -- intersection ID assignment revision MsgCount, - - -- Required default values about lane descriptions follow - refPoint Position3D, -- The reference from which subsequent - -- data points are offset until a new - -- point is used. + refPoint Position3D, laneWidth LaneWidth OPTIONAL, - -- Reference width used by all subsequent - -- lanes unless a new width is given speedLimits SpeedLimitList OPTIONAL, - -- Reference regulatory speed limits - -- used by all subsequent - -- lanes unless a new speed is given - -- See Section 11 for converting and - -- translating speed expressed in mph - -- into units of m/s - -- Complete details regarding each lane type in this intersection - laneSet LaneList, -- Data about one or more lanes - -- (all lane data is found here) - - -- Data describing how to use and request preemption and - -- priority services from this intersection (if supported) - -- NOTE Additonal data may be added in the next release of the - -- standard at this point to handle this concept + laneSet LaneList, preemptPriorityData PreemptPriorityList OPTIONAL, - -- data about one or more regional - -- preempt or priority zones - regional SEQUENCE (SIZE(1..4)) OF RegionalExtension {{Reg-IntersectionGeometry}} OPTIONAL, ... @@ -411,47 +280,19 @@ IntersectionGeometryList ::= SEQUENCE (SIZE(1..32)) OF IntersectionGeometry IntersectionReferenceID ::= SEQUENCE { region RoadRegulatorID OPTIONAL, - -- a globally unique regional assignment value - -- typical assigned to a regional DOT authority - -- the value zero shall be used for testing needs id IntersectionID - -- a unique mapping to the intersection - -- in question within the above region of use } IntersectionState ::= SEQUENCE { name DescriptiveName OPTIONAL, - -- human readable name for intersection - -- to be used only in debug mode id IntersectionReferenceID, - -- A globally unique value set, consisting of a - -- regionID and intersection ID assignment - -- provides a unique mapping to the - -- intersection MAP in question - -- which provides complete location - -- and approach/move/lane data revision MsgCount, status IntersectionStatusObject, - -- general status of the controller(s) moy MinuteOfTheYear OPTIONAL, - -- Minute of current UTC year - -- used only with messages to be archived timeStamp DSecond OPTIONAL, - -- the mSec point in the current UTC minute that - -- this message was constructed enabledLanes EnabledLaneList OPTIONAL, - -- a list of lanes where the RevocableLane bit - -- has been set which are now active and - -- therefore part of the current intersection states MovementList, - -- Each Movement is given in turn - -- and contains its signal phase state, - -- mapping to the lanes it applies to, and - -- point in time it will end, and it - -- may contain both active and future states maneuverAssistList ManeuverAssistList OPTIONAL, - -- Assist data - regional SEQUENCE (SIZE(1..4)) OF RegionalExtension {{Reg-IntersectionState}} OPTIONAL, ... @@ -460,36 +301,20 @@ IntersectionState ::= SEQUENCE { IntersectionStateList ::= SEQUENCE (SIZE(1..32)) OF IntersectionState LaneAttributes ::= SEQUENCE { - directionalUse LaneDirection, -- directions of lane use - sharedWith LaneSharing, -- co-users of the lane path - laneType LaneTypeAttributes, -- specific lane type data + directionalUse LaneDirection, + sharedWith LaneSharing, + laneType LaneTypeAttributes, regional RegionalExtension {{Reg-LaneAttributes}} OPTIONAL } /*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop LaneDataAttribute ::= CHOICE { - -- Segment attribute types and the data needed for each pathEndPointAngle DeltaAngle, - -- adjusts final point/width slant - -- of the lane to align with the stop line laneCrownPointCenter RoadwayCrownAngle, - -- sets the canter of the road bed - -- from centerline point laneCrownPointLeft RoadwayCrownAngle, - -- sets the canter of the road bed - -- from left edge laneCrownPointRight RoadwayCrownAngle, - -- sets the canter of the road bed - -- from right edge laneAngle MergeDivergeNodeAngle, - -- the angle or direction of another lane - -- this is required to support Japan style - -- when a merge point angle is required speedLimits SpeedLimitList, - -- Reference regulatory speed limits - -- used by all segments - - -- Add others as needed, in regional space regional SEQUENCE (SIZE(1..4)) OF RegionalExtension {{Reg-LaneDataAttribute}}, ... @@ -501,17 +326,9 @@ LaneDataAttributeList ::= SEQUENCE (SIZE(1..8)) OF LaneDataAttribute LaneList ::= SEQUENCE (SIZE(1..255)) OF GenericLane LaneSharing ::= BIT STRING { - -- With bits as defined: overlappingLaneDescriptionProvided (0), - -- Assert when another lane object is present to describe the - -- path of the overlapping shared lane - -- this construct is not used for lane objects which simply cross multipleLanesTreatedAsOneLane (1), - -- Assert if the lane object path and width details represents - -- multiple lanes within it that are not further described - - -- Various modes and type of traffic that may share this lane: - otherNonMotorizedTrafficTypes (2), -- horse drawn etc. + otherNonMotorizedTrafficTypes (2), individualMotorizedVehicleTraffic (3), busVehicleTraffic (4), taxiVehicleTraffic (5), @@ -520,72 +337,39 @@ LaneSharing ::= BIT STRING { trackedVehicleTraffic (8), pedestrianTraffic (9) } (SIZE (10)) - -- All zeros would indicate 'not shared' and 'not overlapping' LaneTypeAttributes ::= CHOICE { - vehicle LaneAttributes-Vehicle, -- motor vehicle lanes - crosswalk LaneAttributes-Crosswalk, -- pedestrian crosswalks - bikeLane LaneAttributes-Bike, -- bike lanes - sidewalk LaneAttributes-Sidewalk, -- pedestrian sidewalk paths - median LaneAttributes-Barrier, -- medians & channelization - striping LaneAttributes-Striping, -- roadway markings - trackedVehicle LaneAttributes-TrackedVehicle, -- trains and trolleys - parking LaneAttributes-Parking, -- parking and stopping lanes + vehicle LaneAttributes-Vehicle, + crosswalk LaneAttributes-Crosswalk, + bikeLane LaneAttributes-Bike, + sidewalk LaneAttributes-Sidewalk, + median LaneAttributes-Barrier, + striping LaneAttributes-Striping, + trackedVehicle LaneAttributes-TrackedVehicle, + parking LaneAttributes-Parking, ... } ManeuverAssistList ::= SEQUENCE (SIZE(1..16)) OF ConnectionManeuverAssist -MovementEventList ::= SEQUENCE (SIZE(1..16)) OF MovementEvent - MovementEvent ::= SEQUENCE { eventState MovementPhaseState, - -- Consisting of: - -- Phase state (the basic 11 states) - -- Directional, protected, or permissive state - timing TimeChangeDetails OPTIONAL, - -- Timing Data in UTC time stamps for event - -- includes start and min/max end times of phase - -- confidence and estimated next occurrence - speeds AdvisorySpeedList OPTIONAL, - -- various speed advisories for use by - -- general and specific types of vehicles - -- supporting green-wave and other flow needs - -- See Section 11 for converting and translating - -- speed expressed in mph into units of m/s - regional SEQUENCE (SIZE(1..4)) OF RegionalExtension {{Reg-MovementEvent}} OPTIONAL, ... } +MovementEventList ::= SEQUENCE (SIZE(1..16)) OF MovementEvent + MovementList ::= SEQUENCE (SIZE(1..255)) OF MovementState MovementState ::= SEQUENCE { movementName DescriptiveName OPTIONAL, - -- uniquely defines movement by name - -- human readable name for intersection - -- to be used only in debug mode signalGroup SignalGroupID, - -- the group id is used to map to lists - -- of lanes (and their descriptions) - -- which this MovementState data applies to - -- see comments in the Remarks for usage details state-time-speed MovementEventList, - -- Consisting of sets of movement data with: - -- a) SignalPhaseState - -- b) TimeChangeDetails, and - -- c) AdvisorySpeeds (optional ) - -- Note one or more of the movement events may be for - -- a future time and that this allows conveying multiple - -- predictive phase and movement timing for various uses - -- for the current signal group maneuverAssistList ManeuverAssistList OPTIONAL, - -- This information may also be placed in the - -- IntersectionState when common information applies to - -- different lanes in the same way regional SEQUENCE (SIZE(1..4)) OF RegionalExtension {{Reg-MovementState}} OPTIONAL, ... @@ -594,74 +378,35 @@ MovementState ::= SEQUENCE { /*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop NodeAttributeSetXY ::= SEQUENCE { localNode NodeAttributeXYList OPTIONAL, - -- Attribute states which pertain to this node point disabled SegmentAttributeXYList OPTIONAL, - -- Attribute states which are disabled at this node point enabled SegmentAttributeXYList OPTIONAL, - -- Attribute states which are enabled at this node point - -- and which remain enabled until disabled or the lane ends data LaneDataAttributeList OPTIONAL, - -- Attributes which require an additional data values - -- some of these are local to the node point, while others - -- persist with the provided values until changed - -- and this is indicated in each entry dWidth Offset-B10 OPTIONAL, - -- A value added to the current lane width - -- at this node and from this node onwards, in 1cm steps - -- lane width between nodes are a linear taper between pts - -- the value of zero shall not be sent here dElevation Offset-B10 OPTIONAL, - -- A value added to the current Elevation - -- at this node from this node onwards, in 10cm steps - -- elevations between nodes are a linear taper between pts - -- the value of zero shall not be sent here regional SEQUENCE (SIZE(1..4)) OF RegionalExtension {{Reg-NodeAttributeSetXY}} OPTIONAL, ... } -NodeAttributeXYList ::= SEQUENCE (SIZE(1..8)) OF NodeAttributeXY - NodeAttributeXY ::= ENUMERATED { - -- Various values which pertain only to the current node point - - -- General Items reserved, - stopLine, -- point where a mid-path stop line exists - -- See also 'do not block' for segments - - -- Path finish details - roundedCapStyleA, -- Used to control final path rounded end shape - -- with edge of curve at final point in a circle - roundedCapStyleB, -- Used to control final path rounded end shape - -- with edge of curve extending 50% of width past - -- final point in a circle - - -- Topography Points (items with no concept of a distance along the path) - mergePoint, -- Japan merge with 1 or more lanes - divergePoint, -- Japan diverge with 1 or more lanes - downstreamStopLine, -- Japan style downstream intersection - -- (a 2nd intersection) stop line - downstreamStartNode, -- Japan style downstream intersection - -- (a 2nd intersection) start node - - -- Pedestrian Support Attributes - closedToTraffic, -- where a pedestrian may NOT go - -- to be used during construction events - safeIsland, -- a pedestrian safe stopping point - -- also called a traffic island - -- This usage described a point feature on a path, - -- other entries can describe a path - curbPresentAtStepOff, -- the sidewalk to street curb is NOT - -- angled where it meets the edge of the - -- roadway (user must step up/down) - - -- Lane geometry details (see standard for defined shapes) - hydrantPresent, -- Or other services access + stopLine, + roundedCapStyleA, + roundedCapStyleB, + mergePoint, + divergePoint, + downstreamStopLine, + downstreamStartNode, + closedToTraffic, + safeIsland, + curbPresentAtStepOff, + hydrantPresent, ... } */ +NodeAttributeXYList ::= SEQUENCE (SIZE(1..8)) OF NodeAttributeXY + Node-LLmD-64b ::= SEQUENCE { lon Longitude, lat Latitude @@ -706,54 +451,49 @@ Node-XY-32b ::= SEQUENCE { NodeListXY ::= CHOICE { nodes NodeSetXY, - -- a lane made up of two or more - -- XY node points and any attributes - -- defined in those nodes computed ComputedLane, - -- a lane path computed by translating - -- the data defined by another lane ... } /*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop NodeOffsetPointXY ::= CHOICE { - -- Nodes with X,Y content - node-XY1 Node-XY-20b, -- node is within 5.11m of last node - node-XY2 Node-XY-22b, -- node is within 10.23m of last node - node-XY3 Node-XY-24b, -- node is within 20.47m of last node - node-XY4 Node-XY-26b, -- node is within 40.96m of last node - node-XY5 Node-XY-28b, -- node is within 81.91m of last node - node-XY6 Node-XY-32b, -- node is within 327.67m of last node - node-LatLon Node-LLmD-64b, -- node is a full 32b Lat/Lon range + node-XY1 Node-XY-20b, + node-XY2 Node-XY-22b, + node-XY3 Node-XY-24b, + node-XY4 Node-XY-26b, + node-XY5 Node-XY-28b, + node-XY6 Node-XY-32b, + node-LatLon Node-LLmD-64b, regional RegionalExtension {{Reg-NodeOffsetPointXY}} - -- node which follows is of a - -- regional definition type } -NodeSetXY ::= SEQUENCE (SIZE(2..63)) OF NodeXY - NodeXY ::= SEQUENCE { delta NodeOffsetPointXY, - -- A choice of which X,Y offset value to use - -- this includes various delta values as well a regional choices attributes NodeAttributeSetXY OPTIONAL, - -- Any optional Attributes which are needed - -- This includes changes to the current lane width and elevation ... } + +NodeSetXY ::= SEQUENCE (SIZE(2..63)) OF NodeXY */ OverlayLaneList ::= SEQUENCE (SIZE(1..5)) OF LaneID - -- The unique ID numbers for any lane object which have - -- spatial paths that overlay (run on top of, and not - -- simply cross with) the current lane. - -- Such as a train path that overlays a motor vehicle - -- lane object for a roadway segment. + +PositionalAccuracy ::= SEQUENCE { + semiMajor SemiMajorAxisAccuracy, + semiMinor SemiMinorAxisAccuracy, + orientation SemiMajorAxisOrientation +} + +PositionConfidenceSet ::= SEQUENCE { + pos PositionConfidence, -- for both horizontal directions + elevation ElevationConfidence + } + Position3D ::= SEQUENCE { - lat Latitude, -- in 1/10th micro degrees - long Longitude, -- in 1/10th micro degrees - elevation Elevation OPTIONAL, -- in 10 cm units + lat Latitude, + long Longitude, + elevation Elevation OPTIONAL, regional SEQUENCE (SIZE(1..4)) OF RegionalExtension {{Reg-Position3D}} OPTIONAL, ... @@ -764,36 +504,19 @@ PreemptPriorityList ::= SEQUENCE (SIZE(1..32)) OF SignalControlZone /*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop RegulatorySpeedLimit ::= SEQUENCE { type SpeedLimitType, - -- The type of regulatory speed which follows speed Velocity - -- The speed in units of 0.02 m/s - -- See Section 11 for converting and translating - -- speed expressed in mph into units of m/s } */ RequestorDescription ::= SEQUENCE { id VehicleID, - -- The ID used in the BSM or CAM of the requestor - -- This ID is presumed not to change - -- during the exchange type RequestorType OPTIONAL, - -- Information regarding all type and class data - -- about the requesting vehicle position RequestorPositionVector OPTIONAL, - -- The location of the requesting vehicle name DescriptiveName OPTIONAL, - -- A human readable name for debugging use - -- Support for Transit requests routeName DescriptiveName OPTIONAL, - -- A string for transit operations use transitStatus TransitVehicleStatus OPTIONAL, - -- current vehicle state (loading, etc.) transitOccupancy TransitVehicleOccupancy OPTIONAL, - -- current vehicle occupancy transitSchedule DeltaTime OPTIONAL, - -- current vehicle schedule adherence - regional SEQUENCE (SIZE(1..4)) OF RegionalExtension {{Reg-RequestorDescription}} OPTIONAL, ... @@ -807,83 +530,46 @@ RequestorPositionVector ::= SEQUENCE { } RequestorType ::= SEQUENCE { - -- Defines who is requesting - role BasicVehicleRole, -- Basic role of this user at this time - subrole RequestSubRole OPTIONAL, -- A local list with role based items - - -- Defines what kind of request (a level of importance in the Priority Scheme) - request RequestImportanceLevel OPTIONAL, -- A local list with request items - - -- Additional classification details + role BasicVehicleRole, + subrole RequestSubRole OPTIONAL, + request RequestImportanceLevel OPTIONAL, iso3883 Iso3833VehicleType OPTIONAL, - hpmsType VehicleType OPTIONAL, -- HPMS classification types - + hpmsType VehicleType OPTIONAL, regional RegionalExtension {{Reg-RequestorType}} OPTIONAL, ... } RestrictionClassAssignment ::= SEQUENCE { id RestrictionClassID, - -- the unique value (within an intersection or local region) - -- that is assigned to this group of users users RestrictionUserTypeList - -- The list of user types/classes - -- to which this restriction ID applies } RestrictionClassList ::= SEQUENCE (SIZE(1..254)) OF RestrictionClassAssignment -RestrictionUserTypeList ::= SEQUENCE (SIZE(1..16)) OF RestrictionUserType - RestrictionUserType ::= CHOICE { basicType RestrictionAppliesTo, - -- a set of the most commonly used types regional SEQUENCE (SIZE(1..4)) OF RegionalExtension {{Reg-RestrictionUserType}}, ... } +RestrictionUserTypeList ::= SEQUENCE (SIZE(1..16)) OF RestrictionUserType + RoadLaneSetList ::= SEQUENCE (SIZE(1..255)) OF GenericLane RoadSegmentReferenceID ::= SEQUENCE { region RoadRegulatorID OPTIONAL, - -- a globally unique regional assignment value - -- typically assigned to a regional DOT authority - -- the value zero shall be used for testing needs id RoadSegmentID - -- a unique mapping to the road segment - -- in question within the above region of use - -- during its period of assignment and use - -- note that unlike intersectionID values, - -- this value can be reused by the region } RoadSegment ::= SEQUENCE { name DescriptiveName OPTIONAL, id RoadSegmentReferenceID, - -- a globally unique value for the segment revision MsgCount, - -- Required default values about the descriptions to follow - refPoint Position3D, -- the reference from which subsequent - -- data points are offset until a new - -- point is used. + refPoint Position3D, laneWidth LaneWidth OPTIONAL, - -- Reference width used by all subsequent - -- lanes unless a new width is given speedLimits SpeedLimitList OPTIONAL, - -- Reference regulatory speed limits - -- used by all subsequent - -- lanes unless a new speed is given - -- See Section 11 for converting and - -- translating speed expressed in mph - -- into units of m/s - - -- Data describing disruptions in the RoadSegment - -- such as work zones etc will be added here; - -- in the US the SAE ITIS codes would be used here - -- The details regarding each lane type in the RoadSegment roadLaneSet RoadLaneSetList, - regional SEQUENCE (SIZE(1..4)) OF RegionalExtension {{Reg-RoadSegment}} OPTIONAL, ... @@ -891,6 +577,13 @@ RoadSegment ::= SEQUENCE { RoadSegmentList ::= SEQUENCE (SIZE(1..32)) OF RoadSegment +RTCMheader ::= SEQUENCE { + status GNSSstatus, + offsetSet AntennaOffsetSet + } + +RTCMmessageList ::= SEQUENCE (SIZE(1..5)) OF RTCMmessage + /*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop SegmentAttributeXYList ::= SEQUENCE (SIZE(1..8)) OF SegmentAttributeXY */ @@ -901,17 +594,22 @@ SignalControlZone ::= SEQUENCE { } SignalRequesterInfo ::= SEQUENCE { - -- These three items serve to uniquely identify the requester - -- and the specific request to all parties id VehicleID, request RequestID, sequenceNumber MsgCount, role BasicVehicleRole OPTIONAL, + typeData RequestorType OPTIONAL, + ... +} - typeData RequestorType OPTIONAL, - -- Used when addition data besides the role - -- is needed, at which point the role entry - -- above is not sent. +SignalRequest ::= SEQUENCE { + id IntersectionReferenceID, + requestID RequestID, + requestType PriorityRequestType, + inBoundLane IntersectionAccessPoint, + outBoundLane IntersectionAccessPoint OPTIONAL, + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-SignalRequest}} OPTIONAL, ... } @@ -919,53 +617,20 @@ SignalRequestList ::= SEQUENCE (SIZE(1..32)) OF SignalRequestPackage SignalRequestPackage ::= SEQUENCE { request SignalRequest, - -- The specific request to the intersection - -- contains IntersectionID, request type, - -- requested action (approach/lane request) - - -- The Estimated Time of Arrival (ETA) when the service is requested minute MinuteOfTheYear OPTIONAL, second DSecond OPTIONAL, duration DSecond OPTIONAL, - -- The duration value is used to provide a short interval that - -- extends the ETA so that the requesting vehicle can arrive at - -- the point of service with uncertainty or with some desired - -- duration of service. This concept can be used to avoid needing - -- to frequently update the request. - -- The requester must update the ETA and duration values if the - -- period of services extends beyond the duration time. - -- It should be assumed that if the vehicle does not clear the - -- intersection when the duration is reached, the request will - -- be cancelled and the intersection will revert to - -- normal operation. - regional SEQUENCE (SIZE(1..4)) OF RegionalExtension {{Reg-SignalRequestPackage}} OPTIONAL, ... } -SignalRequest ::= SEQUENCE { - -- the unique ID of the target intersection +SignalStatus ::= SEQUENCE { + sequenceNumber MsgCount, id IntersectionReferenceID, - - -- The unique requestID used by the requestor - requestID RequestID, - - -- The type of request or cancel for priority or preempt use - -- when a prior request is canceled, only the requestID is needed - requestType PriorityRequestType, - - -- In typical use either an approach or a lane number would - -- be given, this indicates the requested - -- path through the intersection to the degree it is known. - inBoundLane IntersectionAccessPoint, - -- desired entry approach or lane - outBoundLane IntersectionAccessPoint OPTIONAL, - -- desired exit approach or lane - -- the values zero is used to indicate - -- intent to stop within the intersection + sigStatus SignalStatusPackageList, regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalRequest}} OPTIONAL, + RegionalExtension {{Reg-SignalStatus}} OPTIONAL, ... } @@ -974,58 +639,35 @@ SignalStatusList ::= SEQUENCE (SIZE(1..32)) OF SignalStatus SignalStatusPackageList ::= SEQUENCE (SIZE(1..32)) OF SignalStatusPackage SignalStatusPackage ::= SEQUENCE { - -- The party that made the initial SRM request requester SignalRequesterInfo OPTIONAL, - -- The lanes or approaches used in the request - inboundOn IntersectionAccessPoint, -- estimated lane / approach of vehicle + inboundOn IntersectionAccessPoint, outboundOn IntersectionAccessPoint OPTIONAL, - -- The Estimated Time of Arrival (ETA) when the service is requested - -- This data echos the data of the request minute MinuteOfTheYear OPTIONAL, second DSecond OPTIONAL, duration DSecond OPTIONAL, - - -- the SRM status for this request status PrioritizationResponseStatus, - -- Status of request, this may include rejection - regional SEQUENCE (SIZE(1..4)) OF RegionalExtension {{Reg-SignalStatusPackage}} OPTIONAL, ... } -SignalStatus ::= SEQUENCE { - sequenceNumber MsgCount, - -- changed whenever the below contents have change - id IntersectionReferenceID, - -- this provides a unique mapping to the - -- intersection map in question - -- which provides complete location - -- and approach/movement/lane data - -- as well as zones for priority/preemption - sigStatus SignalStatusPackageList, - -- a list of detailed status containing all - -- priority or preemption state data, both - -- active and pending, and who requested it - -- requests which are denied are also listed - -- here for a short period of time - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalStatus}} OPTIONAL, - ... +SpeedandHeadingandThrottleConfidence ::= SEQUENCE { + heading HeadingConfidenceDSRC, + speed SpeedConfidenceDSRC, + throttle ThrottleConfidence } /*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop SpeedLimitList ::= SEQUENCE (SIZE(1..9)) OF RegulatorySpeedLimit SpeedLimitType ::= ENUMERATED { - unknown, -- Speed limit type not available - maxSpeedInSchoolZone, -- Only sent when the limit is active - maxSpeedInSchoolZoneWhenChildrenArePresent, -- Sent at any time - maxSpeedInConstructionZone, -- Used for work zones, incident zones, etc. - -- where a reduced speed is present + unknown, + maxSpeedInSchoolZone, + maxSpeedInSchoolZoneWhenChildrenArePresent, + maxSpeedInConstructionZone, vehicleMinSpeed, - vehicleMaxSpeed, -- Regulatory speed limit for general traffic + vehicleMaxSpeed, vehicleNightMaxSpeed, truckMinSpeed, @@ -1041,33 +683,14 @@ SpeedLimitType ::= ENUMERATED { TimeChangeDetails ::= SEQUENCE { startTime TimeMark OPTIONAL, - -- When this phase 1st started minEndTime TimeMark, - -- Expected shortest end time maxEndTime TimeMark OPTIONAL, - -- Expected longest end time - likelyTime TimeMark OPTIONAL, - -- Best predicted value based on other data confidence TimeIntervalConfidence OPTIONAL, - -- Applies to above time element only - nextTime TimeMark OPTIONAL - -- A rough estimate of time when - -- this phase may next occur again - -- used to support various ECO driving power - -- management needs. } TimeMark ::= INTEGER (0..36001) - -- Tenths of a second in the current or next hour - -- In units of 1/10th second from UTC time - -- A range of 0~36000 covers one hour - -- The values 35991..36000 are used when a leap second occurs - -- The value 36001 is used to indicate time >3600 seconds - -- 36002 is to be used when value undefined or unknown - -- Note that this is NOT expressed in GPS time - -- or in local time TransmissionAndSpeed ::= SEQUENCE { transmisson TransmissionState, @@ -1081,11 +704,8 @@ VehicleID ::= CHOICE { -- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ --- --- Start of entries from table Data_Elements... --- This table typicaly contains data element entries. +-- data elements -- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ --- AdvisorySpeedType ::= ENUMERATED { none (0), @@ -1093,172 +713,153 @@ AdvisorySpeedType ::= ENUMERATED { ecoDrive (2), transit (3), ... - } -- Note: subject to further growth +} AllowedManeuvers ::= BIT STRING { - -- With bits as defined: - -- Allowed maneuvers at path end (stop line) - -- All maneuvers with bits not set are therefore prohibited ! - -- A value of zero shall be used for unknown, indicating no Maneuver maneuverStraightAllowed (0), - -- a Straight movement is allowed in this lane maneuverLeftAllowed (1), - -- a Left Turn movement is allowed in this lane maneuverRightAllowed (2), - -- a Right Turn movement is allowed in this lane maneuverUTurnAllowed (3), - -- a U turn movement is allowed in this lane maneuverLeftTurnOnRedAllowed (4), - -- a Stop, and then proceed when safe movement - -- is allowed in this lane maneuverRightTurnOnRedAllowed (5), - -- a Stop, and then proceed when safe movement - -- is allowed in this lane maneuverLaneChangeAllowed (6), - -- a movement which changes to an outer lane - -- on the egress side is allowed in this lane - -- (example: left into either outbound lane) maneuverNoStoppingAllowed (7), - -- the vehicle should not stop at the stop line - -- (example: a flashing green arrow) yieldAllwaysRequired (8), - -- the allowed movements above are not protected - -- (example: an permanent yellow condition) goWithHalt (9), - -- after making a full stop, may proceed caution (10), - -- proceed past stop line with caution reserved1 (11) - -- used to align to 12 Bit Field - } (SIZE(12)) Angle ::= INTEGER (0..28800) - -- LSB of 0.0125 degrees - -- A range of 0 to 359.9875 degrees -ApproachID ::= INTEGER (0..15) -- zero to be used when valid value is unknown +ApproachID ::= INTEGER (0..15) BasicVehicleRole ::= ENUMERATED { - -- Values used in the EU and in the US - basicVehicle (0), -- Light duty passenger vehicle type - publicTransport (1), -- Used in EU for Transit us - specialTransport (2), -- Used in EU (e.g. heavy load) - dangerousGoods (3), -- Used in EU for any HAZMAT - roadWork (4), -- Used in EU for State and Local DOT uses - roadRescue (5), -- Used in EU and in the US to include tow trucks. - emergency (6), -- Used in EU for Police, Fire and Ambulance units - safetyCar (7), -- Used in EU for Escort vehicles - -- Begin US unique numbering - none-unknown (8), -- added to follow current SAE style guidelines - truck (9), -- Heavy trucks with additional BSM rights and obligations - motorcycle (10), -- - roadSideSource (11), -- For infrastructure generated calls such as - -- fire house, rail infrastructure, roadwork site, etc. - police (12), -- - fire (13), -- - ambulance (14), -- (does not include private para-transit etc.) - dot (15), -- all roadwork vehicles - transit (16), -- all transit vehicles - slowMoving (17), -- to also include oversize etc. - stopNgo (18), -- to include trash trucks, school buses and others - -- that routinely disturb the free flow of traffic - cyclist (19), -- - pedestrian (20), -- also includes those with mobility limitations - nonMotorized (21), -- other, horse drawn, etc. - military (22), -- + basicVehicle (0), + publicTransport (1), + specialTransport (2), + dangerousGoods (3), + roadWork (4), + roadRescue (5), + emergency (6), + safetyCar (7), + none-unknown (8), + truck (9), + motorcycle (10), + roadSideSource (11), + police (12), + fire (13), + ambulance (14), + dot (15), + transit (16), + slowMoving (17), + stopNgo (18), + cyclist (19), + pedestrian (20), + nonMotorized (21), + military (22), ... } +DDay ::= INTEGER (0..31) + /*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop DeltaAngle ::= INTEGER (-150..150) - -- With an angle range from - -- negative 150 to positive 150 - -- in one degree steps where zero is directly - -- along the axis or the lane center line as defined by the - -- two closest points DeltaTime ::= INTEGER (-122 .. 121) - -- Supporting a range of +/- 20 minute in steps of 10 seconds - -- the value of -121 shall be used when more than -20 minutes - -- the value of +120 shall be used when more than +20 minutes - -- the value -122 shall be used when the value is unavailable */ DescriptiveName ::= IA5String (SIZE(1..63)) +DHour ::= INTEGER (0..31) + +DMinute ::= INTEGER (0..60) + +DMonth ::= INTEGER (0..12) + +DOffset ::= INTEGER (-840..840) + DrivenLineOffsetLg ::= INTEGER (-32767..32767) - -- LSB units are 1 cm. DrivenLineOffsetSm ::= INTEGER (-2047..2047) - -- LSB units are 1 cm. -DSecond ::= INTEGER (0..65535) -- units of milliseconds +DSecond ::= INTEGER (0..65535) DSRCmsgID ::= INTEGER (0..32767) - mapData DSRCmsgID ::= 18 -- MAP, intersections - signalPhaseAndTimingMessage DSRCmsgID ::= 19 -- SPAT - signalRequestMessage DSRCmsgID ::= 29 -- SRM - signalStatusMessage DSRCmsgID ::= 30 -- SSM + mapData DSRCmsgID ::= 18 + rtcmCorrections DSRCmsgID ::= 28 + signalPhaseAndTimingMessage DSRCmsgID ::= 19 + signalRequestMessage DSRCmsgID ::= 29 + signalStatusMessage DSRCmsgID ::= 30 + +DYear ::= INTEGER (0..4095) Elevation ::= INTEGER (-4096..61439) - -- In units of 10 cm steps above or below the reference ellipsoid - -- Providing a range of -409.5 to + 6143.9 meters - -- The value -4096 shall be used when Unknown is to be sent -IntersectionID ::= INTEGER (0..65535) - -- The values zero through 255 are allocated for testing purposes - -- Note that the value assigned to an intersection will be - -- unique within a given regional ID only +ElevationConfidence ::= ENUMERATED { + unavailable (0), + elev-500-00 (1), + elev-200-00 (2), + elev-100-00 (3), + elev-050-00 (4), + elev-020-00 (5), + elev-010-00 (6), + elev-005-00 (7), + elev-002-00 (8), + elev-001-00 (9), + elev-000-50 (10), + elev-000-20 (11), + elev-000-10 (12), + elev-000-05 (13), + elev-000-02 (14), + elev-000-01 (15) + } + + +GNSSstatus ::= BIT STRING { + unavailable (0), + isHealthy (1), + isMonitored (2), + baseStationType (3), + aPDOPofUnder5 (4), + inViewOfUnder5 (5), + localCorrectionsPresent (6), + networkCorrectionsPresent (7) + } (SIZE(8)) + +HeadingConfidenceDSRC ::= ENUMERATED { + unavailable (0), + prec10deg (1), + prec05deg (2), + prec01deg (3), + prec0-1deg (4), + prec0-05deg (5), + prec0-01deg (6), + prec0-0125deg (7) + } + +HeadingDSRC ::= INTEGER (0..28800) IntersectionStatusObject ::= BIT STRING { manualControlIsEnabled (0), - -- Timing reported is per programmed values, etc. but person - -- at cabinet can manually request that certain intervals are - -- terminated early (e.g. green). stopTimeIsActivated (1), - -- And all counting/timing has stopped. failureFlash (2), - -- Above to be used for any detected hardware failures, - -- e.g. conflict monitor as well as for police flash preemptIsActive (3), signalPriorityIsActive (4), - - -- Additional states fixedTimeOperation (5), - -- Schedule of signals is based on time only - -- (i.e. the state can be calculated) trafficDependentOperation (6), - -- Operation is based on different levels of traffic parameters - -- (requests, duration of gaps or more complex parameters) standbyOperation (7), - -- Controller: partially switched off or partially amber flashing failureMode (8), - -- Controller has a problem or failure in operation off (9), - -- Controller is switched off - - -- Related to MAP and SPAT bindings recentMAPmessageUpdate (10), - -- Map revision with content changes recentChangeInMAPassignedLanesIDsUsed (11), - -- Change in MAP's assigned lanes used (lane changes) - -- Changes in the active lane list description noValidMAPisAvailableAtThisTime (12), - -- MAP (and various lanes indexes) not available noValidSPATisAvailableAtThisTime (13) - -- SPAT system is not working at this time - - -- Bits 14,15 reserved at this time and shall be zero } (SIZE(16)) LaneAttributes-Barrier ::= BIT STRING { - -- With bits as defined: median-RevocableLane (0), - -- this lane may be activated or not based - -- on the current SPAT message contents - -- if not asserted, the lane is ALWAYS present median (1), whiteLineHashing (2), stripedLines (3), @@ -1268,197 +869,92 @@ LaneAttributes-Barrier ::= BIT STRING { trafficChannels (7), lowCurbs (8), highCurbs (9) - -- Bits 10~15 reserved and set to zero } (SIZE (16)) LaneAttributes-Bike ::= BIT STRING { - -- With bits as defined: bikeRevocableLane (0), - -- this lane may be activated or not based - -- on the current SPAT message contents - -- if not asserted, the lane is ALWAYS present pedestrianUseAllowed (1), - -- The path allows pedestrian traffic, - -- if not set, this mode is prohibited isBikeFlyOverLane (2), - -- path of lane is not at grade fixedCycleTime (3), - -- the phases use preset times - -- i.e. there is not a 'push to cross' button biDirectionalCycleTimes (4), - -- ped walk phases use different SignalGroupID - -- for each direction. The first SignalGroupID - -- in the first Connection represents 'inbound' - -- flow (the direction of travel towards the first - -- node point) while second SignalGroupID in the - -- next Connection entry represents the 'outbound' - -- flow. And use of RestrictionClassID entries - -- in the Connect follow this same pattern in pairs. isolatedByBarrier (5), unsignalizedSegmentsPresent (6) - -- The lane path consists of one of more segments - -- which are not part of a signal group ID - - -- Bits 7~15 reserved and set to zero } (SIZE (16)) LaneAttributes-Crosswalk ::= BIT STRING { - -- With bits as defined: - -- MUTCD provides no suitable "types" to use here crosswalkRevocableLane (0), - -- this lane may be activated or not based - -- on the current SPAT message contents - -- if not asserted, the lane is ALWAYS present bicyleUseAllowed (1), - -- The path allows bicycle traffic, - -- if not set, this mode is prohibited isXwalkFlyOverLane (2), - -- path of lane is not at grade fixedCycleTime (3), - -- ped walk phases use preset times - -- i.e. there is not a 'push to cross' button biDirectionalCycleTimes (4), - -- ped walk phases use different SignalGroupID - -- for each direction. The first SignalGroupID - -- in the first Connection represents 'inbound' - -- flow (the direction of travel towards the first - -- node point) while second SignalGroupID in the - -- next Connection entry represents the 'outbound' - -- flow. And use of RestrictionClassID entries - -- in the Connect follow this same pattern in pairs. hasPushToWalkButton (5), - -- Has a demand input audioSupport (6), - -- audio crossing cues present rfSignalRequestPresent (7), - -- Supports RF push to walk technologies unsignalizedSegmentsPresent (8) - -- The lane path consists of one of more segments - -- which are not part of a signal group ID - -- Bits 9~15 reserved and set to zero } (SIZE (16)) LaneAttributes-Parking ::= BIT STRING { - -- With bits as defined: - -- Parking use details, note that detailed restrictions such as - -- allowed hours are sent by way of ITIS codes in the TIM message parkingRevocableLane (0), - -- this lane may be activated or not based - -- on the current SPAT message contents - -- if not asserted, the lane is ALWAYS present parallelParkingInUse (1), headInParkingInUse (2), doNotParkZone (3), - -- used to denote fire hydrants as well as - -- short disruptions in a parking zone parkingForBusUse (4), parkingForTaxiUse (5), noPublicParkingUse (6) - -- private parking, as in front of - -- private property - -- Bits 7~15 reserved and set to zero } (SIZE (16)) LaneAttributes-Sidewalk ::= BIT STRING { - -- With bits as defined: sidewalk-RevocableLane (0), - -- this lane may be activated or not based - -- on the current SPAT message contents - -- if not asserted, the lane is ALWAYS present bicyleUseAllowed (1), - -- The path allows bicycle traffic, - -- if not set, this mode is prohibited isSidewalkFlyOverLane (2), - -- path of lane is not at grade walkBikes (3) - -- bike traffic must dismount and walk - -- Bits 4~15 reserved and set to zero } (SIZE (16)) LaneAttributes-Striping ::= BIT STRING { - -- With bits as defined: stripeToConnectingLanesRevocableLane (0), - -- this lane may be activated or not activated based - -- on the current SPAT message contents - -- if not asserted, the lane is ALWAYS present stripeDrawOnLeft (1), stripeDrawOnRight (2), - -- which side of lane to mark stripeToConnectingLanesLeft (3), stripeToConnectingLanesRight (4), stripeToConnectingLanesAhead (5) - -- the stripe type should be - -- presented to the user visually - -- to reflect stripes in the - -- intersection for the type of - -- movement indicated - -- Bits 6~15 reserved and set to zero } (SIZE (16)) LaneAttributes-TrackedVehicle ::= BIT STRING { - -- With bits as defined: spec-RevocableLane (0), - -- this lane may be activated or not based - -- on the current SPAT message contents - -- if not asserted, the lane is ALWAYS present spec-commuterRailRoadTrack (1), spec-lightRailRoadTrack (2), spec-heavyRailRoadTrack (3), spec-otherRailType (4) - -- Bits 5~15 reserved and set to zero } (SIZE (16)) LaneAttributes-Vehicle ::= BIT STRING { - -- With bits as defined: isVehicleRevocableLane (0), - -- this lane may be activated or not based - -- on the current SPAT message contents - -- if not asserted, the lane is ALWAYS present isVehicleFlyOverLane (1), - -- path of lane is not at grade hovLaneUseOnly (2), restrictedToBusUse (3), restrictedToTaxiUse (4), restrictedFromPublicUse (5), hasIRbeaconCoverage (6), - permissionOnRequest (7) -- e.g. to inform about a lane for e-cars - + permissionOnRequest (7) } (SIZE (8,...)) -LaneConnectionID ::= INTEGER (0..255) - LaneDirection ::= BIT STRING { - -- With bits as defined: - -- Allowed directions of travel in the lane object - -- All lanes are described from the stop line outwards ingressPath (0), - -- travel from rear of path to front - -- is allowed egressPath (1) - -- travel from front of path to rear - -- is allowed - -- Notes: No Travel, i.e. the lane object type does not support - -- travel (medians, curbs, etc.) is indicated by not - -- asserting any bit value - -- Bi-Directional Travel (such as a ped crosswalk) is - -- indicated by asserting both of the bits } (SIZE (2)) /*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop LaneID ::= INTEGER (0..255) - -- the value 0 shall be used when the lane ID is - -- not available or not known - -- the value 255 is reserved for future use */ LayerID ::= INTEGER (0..100) LayerType ::= ENUMERATED { none, - mixedContent, -- two or more of the below types + mixedContent, generalMapData, intersectionData, curveData, @@ -1468,152 +964,74 @@ LayerType ::= ENUMERATED { ... } -LaneWidth ::= INTEGER (0..32767) -- units of 1 cm +LaneWidth ::= INTEGER (0..32767) /*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop MergeDivergeNodeAngle ::= INTEGER (-180..180) - -- In units of 1.5 degrees from north - -- the value -180 shall be used to represent - -- data is not available or unknown */ MinuteOfTheYear ::= INTEGER (0..527040) - -- the value 527040 shall be used for invalid MovementPhaseState ::= ENUMERATED { - -- Note that based on the regions and the operating mode not every - -- phase will be used in all transportation modes and that not - -- every phase will be used in all transportation modes - unavailable (0), - -- This state is used for unknown or error dark (1), - -- The signal head is dark (unlit) - - -- Reds stop-Then-Proceed (2), - -- Often called 'flashing red' in US - -- Driver Action: - -- Stop vehicle at stop line. - -- Do not proceed unless it is safe. - -- Note that the right to proceed either right or left when - -- it is safe may be contained in the lane description to - -- handle what is called a 'right on red' stop-And-Remain (3), - -- e.g. called 'red light' in US - -- Driver Action: - -- Stop vehicle at stop line. - -- Do not proceed. - -- Note that the right to proceed either right or left when - -- it is safe may be contained in the lane description to - -- handle what is called a 'right on red' - - -- Greens pre-Movement (4), - -- Not used in the US, red+yellow partly in EU - -- Driver Action: - -- Stop vehicle. - -- Prepare to proceed (pending green) - -- (Prepare for transition to green/go) permissive-Movement-Allowed (5), - -- Often called 'permissive green' in US - -- Driver Action: - -- Proceed with caution, - -- must yield to all conflicting traffic - -- Conflicting traffic may be present - -- in the intersection conflict area protected-Movement-Allowed (6), - -- Often called 'protected green' in US - -- Driver Action: - -- Proceed, tossing caution to the wind, - -- in indicated (allowed) direction. - - -- Yellows / Ambers - -- The vehicle is not allowed to cross the stop bar if it is possible - -- to stop without danger. permissive-clearance (7), - -- Often called 'permissive yellow' in US - -- Driver Action: - -- Prepare to stop. - -- Proceed if unable to stop, - -- Clear Intersection. - -- Conflicting traffic may be present - -- in the intersection conflict area protected-clearance (8), - -- Often called 'protected yellow' in US - -- Driver Action: - -- Prepare to stop. - -- Proceed if unable to stop, - -- in indicated direction (to connected lane) - -- Clear Intersection. - caution-Conflicting-Traffic (9) - -- Often called 'flashing yellow' in US - -- Often used for extended periods of time - -- Driver Action: - -- Proceed with caution, - -- Conflicting traffic may be present - -- in the intersection conflict area } - -- The above number assignments are not used with UPER encoding - -- and are only to be used with DER or implicit encoding MsgCount ::= INTEGER (0..127) /*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop Offset-B10 ::= INTEGER (-512..511) - -- a range of +- 5.11 meters Offset-B11 ::= INTEGER (-1024..1023) - -- a range of +- 10.23 meters Offset-B12 ::= INTEGER (-2048..2047) - -- a range of +- 20.47 meters Offset-B13 ::= INTEGER (-4096..4095) - -- a range of +- 40.95 meters Offset-B14 ::= INTEGER (-8192..8191) - -- a range of +- 81.91 meters Offset-B16 ::= INTEGER (-32768..32767) - -- a range of +- 327.68 meters */ PedestrianBicycleDetect ::= BOOLEAN - -- true if ANY Pedestrians or Bicyclists are - -- detected crossing the target lane or lanes +PositionConfidence ::= ENUMERATED { + unavailable (0), + a500m (1), + a200m (2), + a100m (3), + a50m (4), + a20m (5), + a10m (6), + a5m (7), + a2m (8), + a1m (9), + a50cm (10), + a20cm (11), + a10cm (12), + a5cm (13), + a2cm (14), + a1cm (15) + } + /*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop PrioritizationResponseStatus ::= ENUMERATED { unknown (0), - -- Unknown state requested (1), - -- This prioritization request was detected - -- by the traffic controller processing (2), - -- Checking request - -- (request is in queue, other requests are prior) watchOtherTraffic (3), - -- Cannot give full permission, - -- therefore watch for other traffic - -- Note that other requests may be present granted (4), - -- Intervention was successful - -- and now prioritization is active rejected (5), - -- The prioritization or preemption request was - -- rejected by the traffic controller maxPresence (6), - -- The Request has exceeded maxPresence time - -- Used when the controller has determined that - -- the requester should then back off and - -- request an alternative. reserviceLocked (7), - -- Prior conditions have resulted in a reservice - -- locked event: the controller requires the - -- passage of time before another similar request - -- will be accepted ... } */ @@ -1628,23 +1046,21 @@ PriorityRequestType ::= ENUMERATED { /*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop RegionId ::= INTEGER (0..255) - noRegion RegionId ::= 0 -- Use default supplied stubs - addGrpA RegionId ::= 1 -- USA - addGrpB RegionId ::= 2 -- Japan - addGrpC RegionId ::= 3 -- EU - -- NOTE: new registered regional IDs will be added here - -- The values 128 and above are for local region use + noRegion RegionId ::= 0 + addGrpA RegionId ::= 1 + addGrpB RegionId ::= 2 + addGrpC RegionId ::= 3 */ RequestID ::= INTEGER (0..255) RequestImportanceLevel ::= ENUMERATED { requestImportanceLevelUnKnown (0), - requestImportanceLevel1 (1), -- The least important request - requestImportanceLevel2 (2), -- The values here shall be assigned - requestImportanceLevel3 (3), -- Meanings based on regional needs - requestImportanceLevel4 (4), -- for each of the basic roles which - requestImportanceLevel5 (5), -- are defined elsewhere + requestImportanceLevel1 (1), + requestImportanceLevel2 (2), + requestImportanceLevel3 (3), + requestImportanceLevel4 (4), + requestImportanceLevel5 (5), requestImportanceLevel6 (6), requestImportanceLevel7 (7), requestImportanceLevel8 (8), @@ -1653,17 +1069,17 @@ RequestImportanceLevel ::= ENUMERATED { requestImportanceLevel11 (11), requestImportanceLevel12 (12), requestImportanceLevel13 (13), - requestImportanceLevel14 (14), -- The most important request - requestImportanceReserved (15) -- Reserved for future use + requestImportanceLevel14 (14), + requestImportanceReserved (15) } RequestSubRole ::= ENUMERATED { requestSubRoleUnKnown (0), - requestSubRole1 (1), -- The first type of sub role - requestSubRole2 (2), -- The values here shall be assigned - requestSubRole3 (3), -- Meanings based on regional needs - requestSubRole4 (4), -- to refine and expand the basic - requestSubRole5 (5), -- roles which are defined elsewhere + requestSubRole1 (1), + requestSubRole2 (2), + requestSubRole3 (3), + requestSubRole4 (4), + requestSubRole5 (5), requestSubRole6 (6), requestSubRole7 (7), requestSubRole8 (8), @@ -1672,170 +1088,170 @@ RequestSubRole ::= ENUMERATED { requestSubRole11 (11), requestSubRole12 (12), requestSubRole13 (13), - requestSubRole14 (14), -- The last type of sub role - requestSubRoleReserved (15) -- Reserved for future use + requestSubRole14 (14), + requestSubRoleReserved (15) } RestrictionAppliesTo ::= ENUMERATED { - none, -- applies to nothing - equippedTransit, -- buses etc. + none, + equippedTransit, equippedTaxis, - equippedOther, -- other vehicle types with - -- necessary signal phase state - -- reception equipment - emissionCompliant, -- regional variants with more - -- definitive items also exist + equippedOther, + emissionCompliant, equippedBicycle, weightCompliant, heightCompliant, - -- Items dealing with traveler needs serviced by the infrastructure - -- These end users (which are not vehicles) are presumed to be suitably equipped pedestrians, slowMovingPersons, wheelchairUsers, visualDisabilities, - audioDisabilities, -- hearing + audioDisabilities, otherUnknownDisabilities, ... } RestrictionClassID ::= INTEGER (0..255) - -- An index value to identify data about classes of users - -- the value used varies with each intersection's - -- needs and is defined in the map to the assigned - -- classes of supported users. RoadRegulatorID ::= INTEGER (0..65535) - -- The value zero shall be used for testing only RoadSegmentID ::= INTEGER (0..65535) - -- The values zero to 255 shall be used for testing only - -- Note that the value assigned to an RoadSegment will be - -- unique within a given regional ID only during its use /*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop RoadwayCrownAngle ::= INTEGER (-128..127) - -- In LSB units of 0.3 degrees of angle - -- over a range of -38.1 to + 38.1 degrees - -- The value -128 shall be used for unknown - -- The value zero shall be used for angles - -- which are between -0.15 and +0.15 */ -Scale-B12 ::= INTEGER (-2048..2047) -- in steps of 0.05 percent +RTCMmessage ::= OCTET STRING (SIZE(1..1023)) + +RTCM-Revision ::= ENUMERATED { + unknown (0), + rtcmRev2 (1), -- Std 10402.x et al + rtcmRev3 (2), -- Std 10403.x et al + reserved (3), + ... +} + +Scale-B12 ::= INTEGER (-2048..2047) /*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop SignalGroupID ::= INTEGER (0..255) - -- The value 0 shall be used when the ID is - -- not available or not known - -- the value 255 is reserved to indicate a - -- permanent green movement state - -- therefore a simple 8 phase signal controller - -- device might use 1..9 as its groupIDs */ /*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop SegmentAttributeXY ::= ENUMERATED { - -- Various values which can be Enabled and Disabled for a lane segment - - -- General Items reserved , - doNotBlock , -- segment where a vehicle - -- may not come to a stop - whiteLine , -- segment where lane crossing not allowed - -- such as the final few meters of a lane - - -- Porous Lane states, merging, turn outs, parking etc. - - mergingLaneLeft , -- indicates porous lanes + doNotBlock , + whiteLine , + mergingLaneLeft , mergingLaneRight , - - curbOnLeft , -- indicates presence of curbs + curbOnLeft , curbOnRight , - - loadingzoneOnLeft , -- loading or drop off zones + loadingzoneOnLeft , loadingzoneOnRight , - - turnOutPointOnLeft , -- opening to adjacent street/alley/road + turnOutPointOnLeft , turnOutPointOnRight , - - adjacentParkingOnLeft , -- side of road parking + adjacentParkingOnLeft , adjacentParkingOnRight , - - -- Bike Lane Needs - adjacentBikeLaneOnLeft , -- presence of marked bike lanes + adjacentBikeLaneOnLeft , adjacentBikeLaneOnRight , - sharedBikeLane , -- right of way is shared with bikes - -- who may occupy entire lane width + sharedBikeLane , bikeBoxInFront , - - -- Transit Needs - transitStopOnLeft , -- any form of bus/transit loading - -- with pull in-out access to lane on left - transitStopOnRight , -- any form of bus/transit loading - -- with pull in-out access to lane on right - transitStopInLane , -- any form of bus/transit loading - -- in mid path of the lane - sharedWithTrackedVehicle , -- lane is shared with train or trolley - -- not used for crossing tracks - - - -- Pedestrian Support Attributes - safeIsland , -- begin/end a safety island in path - lowCurbsPresent , -- for ADA support - rumbleStripPresent , -- for ADA support - audibleSignalingPresent , -- for ADA support - adaptiveTimingPresent , -- for ADA support - rfSignalRequestPresent , -- Supports RF push to walk technologies - partialCurbIntrusion , -- path is blocked by a median or curb - -- but at least 1 meter remains open for use - -- and at-grade passage - - -- Lane geometry details (see standard for defined shapes) - taperToLeft , -- Used to control final path shape - taperToRight , -- Used to control final path shape - taperToCenterLine , -- Used to control final path shape - - -- Parking Lane and Curb Attributes - parallelParking , -- - headInParking , -- Parking at an angle with the street - freeParking , -- no restriction on use of parking - timeRestrictionsOnParking , -- Parking is not permitted at all times - -- typically used when the 'parking' lane - -- becomes a driving lane at times - costToPark , -- Used where parking has a cost - midBlockCurbPresent , -- a protruding curb near lane edge - unEvenPavementPresent , -- a disjoint height at lane edge + transitStopOnLeft , + transitStopOnRight , + transitStopInLane , + sharedWithTrackedVehicle , + safeIsland , + lowCurbsPresent , + rumbleStripPresent , + audibleSignalingPresent , + adaptiveTimingPresent , + rfSignalRequestPresent , + partialCurbIntrusion , + taperToLeft , + taperToRight , + taperToCenterLine , + parallelParking , + headInParking , + freeParking , + timeRestrictionsOnParking , + costToPark , + midBlockCurbPresent , + unEvenPavementPresent , ... } */ +SemiMajorAxisAccuracy ::= INTEGER (0..255) + +SemiMajorAxisOrientation ::= INTEGER (0..65535) + +SemiMinorAxisAccuracy ::= INTEGER (0..255) + SpeedAdvice ::= INTEGER (0..500) - -- LSB units are 0.1 m/s^2 - -- the value 499 shall be used for values at or greater than 49.9 m/s - -- the value 500 shall be used to indicate that speed is unavailable +SpeedConfidenceDSRC ::= ENUMERATED { + unavailable (0), -- Not Equipped or unavailable + prec100ms (1), -- 100 meters / sec + prec10ms (2), -- 10 meters / sec + prec5ms (3), -- 5 meters / sec + prec1ms (4), -- 1 meters / sec + prec0-1ms (5), -- 0.1 meters / sec + prec0-05ms (6), -- 0.05 meters / sec + prec0-01ms (7) -- 0.01 meters / sec + } TemporaryID ::= OCTET STRING (SIZE(4)) +ThrottleConfidence ::= ENUMERATED { + unavailable (0), + prec10percent (1), + prec1percent (2), + prec0-5percent (3) + } + +TimeConfidence ::= ENUMERATED { + unavailable (0), + time-100-000 (1), + time-050-000 (2), + time-020-000 (3), + time-010-000 (4), + time-002-000 (5), + time-001-000 (6), + time-000-500 (7), + time-000-200 (8), + time-000-100 (9), + time-000-050 (10), + time-000-020 (11), + time-000-010 (12), + time-000-005 (13), + time-000-002 (14), + time-000-001 (15), + time-000-000-5 (16), + time-000-000-2 (17), + time-000-000-1 (18), + time-000-000-05 (19), + time-000-000-02 (20), + time-000-000-01 (21), + time-000-000-005 (22), + time-000-000-002 (23), + time-000-000-001 (24), + time-000-000-000-5 (25), + time-000-000-000-2 (26), + time-000-000-000-1 (27), + time-000-000-000-05 (28), + time-000-000-000-02 (29), + time-000-000-000-01 (30), + time-000-000-000-005 (31), + time-000-000-000-002 (32), + time-000-000-000-001 (33), + time-000-000-000-000-5 (34), + time-000-000-000-000-2 (35), + time-000-000-000-000-1 (36), + time-000-000-000-000-05 (37), + time-000-000-000-000-02 (38), + time-000-000-000-000-01 (39) +} + TimeIntervalConfidence ::= INTEGER (0..15) - -- Value Probability - -- 0 21% - -- 1 36% - -- 2 47% - -- 3 56% - -- 4 62% - -- 5 68% - -- 6 73% - -- 7 77% - -- 8 81% - -- 9 85% - -- 10 88% - -- 11 91% - -- 12 94% - -- 13 96% - -- 14 98% - -- 15 100% TransitVehicleOccupancy ::= ENUMERATED { occupancyUnknown (0), @@ -1849,65 +1265,51 @@ TransitVehicleOccupancy ::= ENUMERATED { } TransitVehicleStatus ::= BIT STRING { - loading (0), -- parking and unable to move at this time - anADAuse (1), -- an ADA access is in progress (wheelchairs, kneeling, etc.) - aBikeLoad (2), -- loading of a bicycle is in progress - doorOpen (3), -- a vehicle door is open for passenger access - charging (4), -- a vehicle is connected to charging point - atStopLine (5) -- a vehicle is at the stop line for the lane it is in + loading (0), + anADAuse (1), + aBikeLoad (2), + doorOpen (3), + charging (4), + atStopLine (5) } (SIZE(8)) TransmissionState ::= ENUMERATED { - neutral (0), -- Neutral - park (1), -- Park - forwardGears (2), -- Forward gears - reverseGears (3), -- Reverse gears + neutral (0), + park (1), + forwardGears (2), + reverseGears (3), reserved1 (4), reserved2 (5), reserved3 (6), - unavailable (7) -- not-equipped or unavailable value, - -- Any related speed is relative to the vehicle reference frame used + unavailable (7) } VehicleType ::= ENUMERATED { - none (0), -- Not Equipped, Not known or unavailable - unknown (1), -- Does not fit any other category - special (2), -- Special use - moto (3), -- Motorcycle - car (4), -- Passenger car - carOther (5), -- Four tire single units - bus (6), -- Buses - axleCnt2 (7), -- Two axle, six tire single units - axleCnt3 (8), -- Three axle, single units - axleCnt4 (9), -- Four or more axle, single unit - axleCnt4Trailer (10), -- Four or less axle, single trailer - axleCnt5Trailer (11), -- Five or less axle, single trailer - axleCnt6Trailer (12), -- Six or more axle, single trailer - axleCnt5MultiTrailer (13), -- Five or less axle, multi-trailer - axleCnt6MultiTrailer (14), -- Six axle, multi-trailer - axleCnt7MultiTrailer (15), -- Seven or more axle, multi-trailer + none (0), + unknown (1), + special (2), + moto (3), + car (4), + carOther (5), + bus (6), + axleCnt2 (7), + axleCnt3 (8), + axleCnt4 (9), + axleCnt4Trailer (10), + axleCnt5Trailer (11), + axleCnt6Trailer (12), + axleCnt5MultiTrailer (13), + axleCnt6MultiTrailer (14), + axleCnt7MultiTrailer (15), ... } /*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -Velocity ::= INTEGER (0..8191) -- Units of 0.02 m/s - -- The value 8191 indicates that - -- velocity is unavailable +Velocity ::= INTEGER (0..8191) */ -WaitOnStopline ::= BOOLEAN -- - -- True or False - -- If "true", the vehicles on this specific connecting - -- maneuver have to stop on the stop-line - -- and not to enter the collision area +WaitOnStopline ::= BOOLEAN ZoneLength ::= INTEGER (0..10000) - -- Unit = 1 meter, 0 = unknown, - -- The value 10000 to be used for Distances >=10000 m - -- (e.g. from known point to another point along a - -- known path, often against traffic flow direction - -- when used for measuring queues) END - - diff --git a/asn1/IS/ISO_TS_19091/DSRC_REGION_noCircular.asn b/asn1/IS/ISO_TS_19091/DSRC_REGION_noCircular.asn index af0c3c1c..080e5150 100644 --- a/asn1/IS/ISO_TS_19091/DSRC_REGION_noCircular.asn +++ b/asn1/IS/ISO_TS_19091/DSRC_REGION_noCircular.asn @@ -1,5 +1,3 @@ ---FIXME RGY moved here from file SPAT_MAP_ISO_TS_19091.asn - -- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- -- -- module: DSRC @@ -7,19 +5,66 @@ -- -- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --FIXME RGY definitions are moved here from IS-DSRC and IS-REGION; created to cut circular import loops amongst ASN.1 files -DSRC-REGION-noCircular { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } +DSRC-REGION-noCircular { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (2) } DEFINITIONS AUTOMATIC TAGS::= BEGIN IMPORTS Longitude, Latitude FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) } -Control-addGrpC FROM AddGrpC-noCircular { iso (1) standard (0) signalizedIntersection (19091) profilec(2) addgrpc (0) version (1) }; +--NodeAttributeSet-addGrpC, LaneID FROM AddGrpC-noCircular { iso (1) standard (0) signalizedIntersection (19091) profilec(2) addgrpc (0) version (1) } +; ------------------------------------------------------ --FIXME RGY BELOW ARE DEFINITIONS MOVED FROM DSRC ------------------------------------------------------ +FuelType ::= INTEGER (0..15) + unknownFuel FuelType ::= 0 + gasoline FuelType ::= 1 + ethanol FuelType ::= 2 + diesel FuelType ::= 3 + electric FuelType ::= 4 + hybrid FuelType ::= 5 + hydrogen FuelType ::= 6 + natGasLiquid FuelType ::= 7 + natGasComp FuelType ::= 8 + propane FuelType ::= 9 + +VehicleHeight ::= INTEGER (0..127) + +LaneID ::= INTEGER (0..255) + +LaneConnectionID ::= INTEGER (0..255) + +IntersectionID ::= INTEGER (0..65535) + +Node ::= SEQUENCE { + id INTEGER, + lane LaneID OPTIONAL, + connectionID LaneConnectionID OPTIONAL, + intersectionID IntersectionID OPTIONAL, + ... +} + +NodeLink ::= SEQUENCE SIZE (1..5) OF Node + +NodeAttributeSet-addGrpC ::= SEQUENCE { + ptvRequest PtvRequestType OPTIONAL, + nodeLink NodeLink OPTIONAL, + node Node OPTIONAL, + ... +} + +PtvRequestType ::= ENUMERATED { + preRequest, + mainRequest, + doorCloseRequest, + cancelRequest, + emergencyRequest, + ... +} + DeltaAngle ::= INTEGER (-150..150) -- With an angle range from -- negative 150 to positive 150 @@ -63,11 +108,6 @@ LaneDataAttribute ::= CHOICE { LaneDataAttributeList ::= SEQUENCE (SIZE(1..8)) OF LaneDataAttribute -LaneID ::= INTEGER (0..255) - -- the value 0 shall be used when the lane ID is - -- not available or not known - -- the value 255 is reserved for future use - MergeDivergeNodeAngle ::= INTEGER (-180..180) -- In units of 1.5 degrees from north -- the value -180 shall be used to represent @@ -208,6 +248,8 @@ NodeAttributeXY ::= ENUMERATED { ... } +Offset-B09 ::= INTEGER (-256..255) + Offset-B10 ::= INTEGER (-512..511) -- a range of +- 5.11 meters @@ -413,7 +455,7 @@ Reg-LaneDataAttribute REG-EXT-ID-AND-TYPE ::= { ... } Reg-NodeOffsetPointXY REG-EXT-ID-AND-TYPE ::= { ... } Reg-NodeAttributeSetXY REG-EXT-ID-AND-TYPE ::= { - {Control-addGrpC IDENTIFIED BY addGrpC} , + {NodeAttributeSet-addGrpC IDENTIFIED BY addGrpC} , ... } END diff --git a/asn1/IS/ISO_TS_19091/REGION.asn b/asn1/IS/ISO_TS_19091/REGION.asn index 5e82f5dd..6a480ad7 100644 --- a/asn1/IS/ISO_TS_19091/REGION.asn +++ b/asn1/IS/ISO_TS_19091/REGION.asn @@ -14,18 +14,18 @@ -- -- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- -REGION { iso (1) standard (0) signalizedIntersection (19091) profilec(2) region (1) version (1) } +REGION {iso (1) standard (0) signalizedIntersection (19091) profilec (2) region (1) version2 (2)} DEFINITIONS AUTOMATIC TAGS::= BEGIN IMPORTS --FIXME RGY definitions moved to non-circularity module --addGrpC, REG-EXT-ID-AND-TYPE FROM DSRC -addGrpC, REG-EXT-ID-AND-TYPE FROM DSRC-REGION-noCircular ---FIXME RGY Control-addGrpC has been moved to a non-circularity module -Control-addGrpC FROM AddGrpC-noCircular -ConnectionManeuverAssist-addGrpC, ConnectionTrajectory-addGrpC, IntersectionState-addGrpC, /*Control-addGrpC,*/ Position3D-addGrpC, RestrictionUserType-addGrpC, -SignalStatusPackage-addGrpC, MapData-addGrpC FROM AddGrpC {iso (1) standard (0) signalizedIntersection (19091) profilec(2) addgrpc (0) version (1)}; +NodeAttributeSet-addGrpC, addGrpC, REG-EXT-ID-AND-TYPE FROM DSRC-REGION-noCircular +--FIXME RGY NodeAttributeSet-addGrpC has been moved to a non-circularity module +--NodeAttributeSet-addGrpC FROM AddGrpC-noCircular +ConnectionManeuverAssist-addGrpC, ConnectionTrajectory-addGrpC, IntersectionState-addGrpC, /*NodeAttributeSet-addGrpC,*/ Position3D-addGrpC, RestrictionUserType-addGrpC, LaneAttributes-addGrpC, MovementEvent-addGrpC, RequestorDescription-addGrpC, +SignalStatusPackage-addGrpC, MapData-addGrpC FROM AddGrpC {iso (1) standard (0) signalizedIntersection (19091) profilec (2) addgrpc (0) version2 (2)}; Reg-AdvisorySpeed REG-EXT-ID-AND-TYPE ::= { ... } @@ -49,31 +49,37 @@ Reg-IntersectionState REG-EXT-ID-AND-TYPE ::= { ... } -Reg-LaneAttributes REG-EXT-ID-AND-TYPE ::= { ... } +Reg-LaneAttributes REG-EXT-ID-AND-TYPE ::= { + {LaneAttributes-addGrpC IDENTIFIED BY addGrpC} , + ... +} /*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop Reg-LaneDataAttribute REG-EXT-ID-AND-TYPE ::= { ... } */ Reg-MapData REG-EXT-ID-AND-TYPE ::= { - {MapData-addGrpC IDENTIFIED BY addGrpC}, - ... + {MapData-addGrpC IDENTIFIED BY addGrpC}, + ... } -Reg-MovementEvent REG-EXT-ID-AND-TYPE ::= { ... } +Reg-MovementEvent REG-EXT-ID-AND-TYPE ::= { + {MovementEvent-addGrpC IDENTIFIED BY addGrpC} , + ... +} Reg-MovementState REG-EXT-ID-AND-TYPE ::= { ... } -Reg-NodeAttributeSetLL REG-EXT-ID-AND-TYPE ::= { ... } +-- Reg-NodeAttributeSetLL REG-EXT-ID-AND-TYPE ::= { ... } /*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop Reg-NodeAttributeSetXY REG-EXT-ID-AND-TYPE ::= { - {Control-addGrpC IDENTIFIED BY addGrpC} , + {NodeAttributeSet-addGrpC IDENTIFIED BY addGrpC} , ... } */ -Reg-NodeOffsetPointLL REG-EXT-ID-AND-TYPE ::= { ... } +-- Reg-NodeOffsetPointLL REG-EXT-ID-AND-TYPE ::= { ... } /*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop Reg-NodeOffsetPointXY REG-EXT-ID-AND-TYPE ::= { ... } @@ -84,7 +90,10 @@ Reg-Position3D REG-EXT-ID-AND-TYPE ::= { ... } -Reg-RequestorDescription REG-EXT-ID-AND-TYPE ::= { ... } +Reg-RequestorDescription REG-EXT-ID-AND-TYPE ::= { + { RequestorDescription-addGrpC IDENTIFIED BY addGrpC} , + ... +} Reg-RequestorType REG-EXT-ID-AND-TYPE ::= { ... } @@ -95,6 +104,8 @@ Reg-RestrictionUserType REG-EXT-ID-AND-TYPE ::= { Reg-RoadSegment REG-EXT-ID-AND-TYPE ::= { ... } +Reg-RTCMcorrections REG-EXT-ID-AND-TYPE ::= { ... } + Reg-SignalControlZone REG-EXT-ID-AND-TYPE ::= { ... } Reg-SignalRequest REG-EXT-ID-AND-TYPE ::= { ... } diff --git a/asn1/IS/ISO_TS_19091/original/AddGrpC.asn b/asn1/IS/ISO_TS_19091/original/AddGrpC.asn index ae7936d1..1183f8fa 100644 --- a/asn1/IS/ISO_TS_19091/original/AddGrpC.asn +++ b/asn1/IS/ISO_TS_19091/original/AddGrpC.asn @@ -1,122 +1,211 @@ -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- ISO TS 19091 +-- ISO TS 19091 2018 -- --- This ASN.1 was generated: 30.08.2016 +-- This document includes three ASN.1 modules +-- AddGrpC +-- REGION +-- DSRC -- --- This document contains the data element needed for the encoding the SPAT, MapData, SignalRequestMessage, SignalStatusMessage message --- as defined in ISO TS 19091 and SAEJ2735 +-- This document contains the data element needed for the encoding the SPAT, MapData, SignalRequestMessage, SignalStatusMessage, RTCMcorrections +-- as defined in ISO TS 19091 and basic data element referenced to SAEJ2735 -- --- It includes the addendunm extensions for Addgrp-C (e.g. Europe) --- +-- It includes the addendum extensions for Addgrp-C (e.g. Europe) +-- +-- ISO Standards maintenance Portal: +-- http://standards.iso.org/iso/ts/19091/addgrp_c/ -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --- +-- -- module: AddGrpC --- +-- -- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- -AddGrpC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) addgrpc (0) version (1) } +AddGrpC { + iso (1) standard (0) signalizedIntersection (19091) profilec (2) addgrpc (0) + version2 (2) + } - -DEFINITIONS AUTOMATIC TAGS::= BEGIN +DEFINITIONS AUTOMATIC TAGS::= BEGIN IMPORTS -NodeOffsetPointXY, NodeSetXY, PrioritizationResponseStatus, SignalGroupID, DeltaTime, LaneID FROM DSRC -Altitude, StationID, DeltaAltitude FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) }; - -ConnectionManeuverAssist-addGrpC ::= SEQUENCE { - itsStationPositions ItsStationPositionList OPTIONAL, - rsuGNSSOffset NodeOffsetPointXY OPTIONAL, - ... +DeltaTime, FuelType, IntersectionID, LaneConnectionID, LaneID, NodeOffsetPointXY, NodeSetXY, PrioritizationResponseStatus, SignalGroupID, VehicleHeight +FROM DSRC { + iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) } -ConnectionTrajectory-addGrpC ::= SEQUENCE { - nodes NodeSetXY, - ... + +Altitude, DeltaAltitude, StationID, VehicleMass +FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) }; + +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- AddGrpC data dictionary extensions to SAEJ2735 +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +ConnectionManeuverAssist-addGrpC ::= SEQUENCE { + itsStationPosition ItsStationPositionList OPTIONAL, + ... } -Control-addGrpC ::= SEQUENCE { - ptvRequest PtvRequestType, - ... +ConnectionTrajectory-addGrpC ::= SEQUENCE { + nodes NodeSetXY, + connectionID LaneConnectionID, + ... } -IntersectionState-addGrpC ::= SEQUENCE { - activePrioritizations PrioritizationResponseList OPTIONAL, - ... +IntersectionState-addGrpC ::= SEQUENCE { + activePrioritizations PrioritizationResponseList OPTIONAL, + ... } -MapData-addGrpC ::= SEQUENCE { - signalHeadLocations SignalHeadLocationList OPTIONAL, - ... +LaneAttributes-addGrpC ::= SEQUENCE { + maxVehicleHeight VehicleHeight OPTIONAL, + maxVehicleWeight VehicleMass OPTIONAL, + ... } -Position3D-addGrpC ::= SEQUENCE { - altitude Altitude, - ... +MapData-addGrpC ::= SEQUENCE { + signalHeadLocations SignalHeadLocationList OPTIONAL, + ... } -PrioritizationResponseList ::= SEQUENCE SIZE(1..10) OF PrioritizationResponse +MovementEvent-addGrpC ::= SEQUENCE { + stateChangeReason ExceptionalCondition OPTIONAL, + ... +} -PrioritizationResponse ::= SEQUENCE { - stationID StationID, - priorState PrioritizationResponseStatus, - signalGroup SignalGroupID, - ... +NodeAttributeSet-addGrpC ::= SEQUENCE { + ptvRequest PtvRequestType OPTIONAL, + nodeLink NodeLink OPTIONAL, + node Node OPTIONAL, + ... } -RestrictionUserType-addGrpC ::= SEQUENCE { - emission EmissionType OPTIONAL, - ... +Position3D-addGrpC ::= SEQUENCE { + altitude Altitude, + ... } -SignalHeadLocationList ::= SEQUENCE (SIZE(1..64)) OF SignalHeadLocation +RestrictionUserType-addGrpC ::= SEQUENCE { + emission EmissionType OPTIONAL, + fuel FuelType OPTIONAL, + ... +} -SignalHeadLocation ::= SEQUENCE { - nodeXY NodeOffsetPointXY, - nodeZ DeltaAltitude, - signalGroupID SignalGroupID, - ... +RequestorDescription-addGrpC ::= SEQUENCE { + fuel FuelType OPTIONAL, + batteryStatus BatteryStatus OPTIONAL, + ... } SignalStatusPackage-addGrpC ::= SEQUENCE { - synchToSchedule DeltaTime OPTIONAL, - ... + synchToSchedule DeltaTime OPTIONAL, + rejectedReason RejectedReason OPTIONAL, + ... } -ItsStationPositionList::= SEQUENCE SIZE(1..5) OF ItsStationPosition +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- Data frames +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -ItsStationPosition ::= SEQUENCE { - stationID StationID, - laneID LaneID OPTIONAL, - nodeXY NodeOffsetPointXY OPTIONAL, - timeReference TimeReference OPTIONAL, - ... +ItsStationPosition ::= SEQUENCE { + stationID StationID, + laneID LaneID OPTIONAL, + nodeXY NodeOffsetPointXY OPTIONAL, + timeReference TimeReference OPTIONAL, + ... } -EmissionType ::= ENUMERATED { - euro1, - euro2, - euro3, - euro4, - euro5, - euro6, - ... + +ItsStationPositionList ::= SEQUENCE SIZE(1..5) OF ItsStationPosition + +Node ::= SEQUENCE { + id INTEGER, + lane LaneID OPTIONAL, + connectionID LaneConnectionID OPTIONAL, + intersectionID IntersectionID OPTIONAL, + ... } -PtvRequestType ::= ENUMERATED { - preRequest, - mainRequest, - doorCloseRequest, - cancelRequest, - emergencyRequest, - ... +NodeLink ::= SEQUENCE SIZE (1..5) OF Node + +PrioritizationResponse ::= SEQUENCE { + stationID StationID, + priorState PrioritizationResponseStatus, + signalGroup SignalGroupID, + ... } -TimeReference ::= INTEGER { oneMilliSec(1) } (0..65535) +PrioritizationResponseList ::= SEQUENCE SIZE(1..10) OF PrioritizationResponse -END +SignalHeadLocation ::= SEQUENCE { + nodeXY NodeOffsetPointXY, + nodeZ DeltaAltitude, + signalGroupID SignalGroupID, + ... +} + +SignalHeadLocationList ::= SEQUENCE (SIZE(1..64)) OF SignalHeadLocation + + +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- Data elements +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +BatteryStatus ::= ENUMERATED { + unknown, + critical, + low, + good, + ... +} +EmissionType ::= ENUMERATED { + euro1, + euro2, + euro3, + euro4, + euro5, + euro6, + ... +} +ExceptionalCondition ::= ENUMERATED { + unknown, + publicTransportPriority, + emergencyVehiclePriority, + trainPriority, + bridgeOpen, + vehicleHeight, + weather, + trafficJam, + tunnelClosure, + meteringActive, + truckPriority, + bicyclePlatoonPriority, + vehiclePlatoonPriority, + ... +} + +PtvRequestType ::= ENUMERATED { + preRequest, + mainRequest, + doorCloseRequest, + cancelRequest, + emergencyRequest, + ... +} + +RejectedReason ::= ENUMERATED { + unknown, + exceptionalCondition, + maxWaitingTimeExceeded, + ptPriorityDisabled, + higherPTPriorityGranted, + vehicleTrackingUnknown, + ... +} + +TimeReference ::= INTEGER { oneMilliSec(1) } (0..60000) + +END diff --git a/asn1/IS/ISO_TS_19091/original/DSRC.asn b/asn1/IS/ISO_TS_19091/original/DSRC.asn index 8ae9c1c1..0f231d31 100644 --- a/asn1/IS/ISO_TS_19091/original/DSRC.asn +++ b/asn1/IS/ISO_TS_19091/original/DSRC.asn @@ -1,1870 +1,1257 @@ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- ISO TS 19091 --- --- This ASN.1 was generated: 30.08.2016 --- --- This document contains the data element needed for the encoding the SPAT, MapData, SignalRequestMessage, SignalStatusMessage message --- as defined in ISO TS 19091 and SAEJ2735 --- --- It includes the addendunm extensions for Addgrp-C (e.g. Europe) --- --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - -- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --- +-- -- module: DSRC --- +-- Some Types renamed (added xxxDSRC) to avoid name-clashes with CDD +-- -- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- -DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (1) } -DEFINITIONS AUTOMATIC TAGS::= BEGIN +DSRC { + iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) +} + +DEFINITIONS AUTOMATIC TAGS::= BEGIN IMPORTS -StationID, Longitude, Latitude, SpeedConfidence FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) } -Reg-SPAT,Reg-SignalRequestMessage, Reg-SignalStatusMessage, Reg-MapData, Reg-AdvisorySpeed, Reg-ComputedLane, Reg-ConnectionManeuverAssist, -Reg-GenericLane, Reg-IntersectionGeometry, Reg-IntersectionState, Reg-LaneAttributes, Reg-LaneDataAttribute, Reg-MovementEvent, Reg-MovementState, -Reg-NodeAttributeSetXY, Reg-NodeOffsetPointXY,Reg-Position3D, Reg-RequestorDescription, Reg-RequestorType, Reg-RestrictionUserType, Reg-RoadSegment, -Reg-SignalControlZone, Reg-SignalRequestPackage, Reg-SignalRequest, Reg-SignalStatusPackage, Reg-SignalStatus FROM REGION { iso (1) standard (0) signalizedIntersection (19091) profilec(2) region (1) version (1)} -Iso3833VehicleType FROM ElectronicRegistrationIdentificationVehicleDataModule { iso(1) standard(0) iso24534 (24534) vehicleData (1) version (1) }; --- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ --- --- Start of entries from table Messages... --- This table typicaly contains message entries. --- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ --- +Longitude, Latitude, StationID +FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) } -MessageFrame ::= SEQUENCE { - messageId MESSAGE-ID-AND-TYPE.&id({MessageTypes}), - value MESSAGE-ID-AND-TYPE.&Type({MessageTypes}{@.messageId}), - ... - } +Reg-AdvisorySpeed, Reg-ComputedLane, Reg-ConnectionManeuverAssist, Reg-GenericLane, +Reg-IntersectionGeometry, Reg-IntersectionState, Reg-LaneAttributes, Reg-MapData, +Reg-LaneDataAttribute, Reg-MovementEvent, Reg-MovementState, +Reg-NodeAttributeSetXY, Reg-NodeOffsetPointXY, Reg-Position3D, Reg-RequestorDescription, Reg-RequestorType, Reg-RestrictionUserType, Reg-RoadSegment, +Reg-RTCMcorrections, Reg-SignalControlZone, Reg-SignalRequestPackage, Reg-SignalRequest, Reg-SignalStatus, Reg-SignalStatusPackage, Reg-SignalRequestMessage, +Reg-SignalStatusMessage, Reg-SPAT +FROM REGION {iso (1) standard (0) signalizedIntersection (19091) profilec(2) region (1) version2 (2)} -MESSAGE-ID-AND-TYPE ::= CLASS { - &id DSRCmsgID UNIQUE, - &Type - } WITH SYNTAX {&Type IDENTIFIED BY &id} - -MessageTypes MESSAGE-ID-AND-TYPE ::= { - { MapData IDENTIFIED BY mapData } | - { SPAT IDENTIFIED BY signalPhaseAndTimingMessage } | - { SignalRequestMessage IDENTIFIED BY signalRequestMessage } | - { SignalStatusMessage IDENTIFIED BY signalStatusMessage }, - ... -- Expansion to be used only by the SAE J2735 DSRC TC - } +Iso3833VehicleType +FROM ElectronicRegistrationIdentificationVehicleDataModule { iso(1) standard(0) iso24534 (24534) vehicleData (1) version1 (1) }; + +-- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ +-- Messages +-- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ --- Regional extensions support REG-EXT-ID-AND-TYPE ::= CLASS { - &id RegionId UNIQUE, - &Type - } WITH SYNTAX {&Type IDENTIFIED BY &id} + &id RegionId UNIQUE, + &Type +} WITH SYNTAX {&Type IDENTIFIED BY &id} RegionalExtension {REG-EXT-ID-AND-TYPE : Set} ::= SEQUENCE { - regionId REG-EXT-ID-AND-TYPE.&id( {Set} ), - regExtValue REG-EXT-ID-AND-TYPE.&Type( {Set}{@regionId} ) - } - -SPAT ::= SEQUENCE { - timeStamp MinuteOfTheYear OPTIONAL, - name DescriptiveName OPTIONAL, - -- human readable name for this collection - -- to be used only in debug mode - - intersections IntersectionStateList, - -- sets of SPAT data (one per intersection) - - -- If PrioritizationResponse data is required, it is found - -- in the RegionalSPAT entry below - - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SPAT}} OPTIONAL, - ... - } + regionId REG-EXT-ID-AND-TYPE.&id( {Set} ), + regExtValue REG-EXT-ID-AND-TYPE.&Type( {Set}{@regionId} ) +} -SignalRequestMessage ::= SEQUENCE { - timeStamp MinuteOfTheYear OPTIONAL, - second DSecond, - sequenceNumber MsgCount OPTIONAL, +MapData ::= SEQUENCE { + timeStamp MinuteOfTheYear OPTIONAL, + msgIssueRevision MsgCount, + layerType LayerType OPTIONAL, + layerID LayerID OPTIONAL, + intersections IntersectionGeometryList OPTIONAL, + roadSegments RoadSegmentList OPTIONAL, + dataParameters DataParameters OPTIONAL, + restrictionList RestrictionClassList OPTIONAL, + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-MapData}} OPTIONAL, + ... +} - requests SignalRequestList OPTIONAL, - -- Request Data for one or more signalized - -- intersections that support SRM dialogs +RTCMcorrections ::= SEQUENCE { + msgCnt MsgCount, + rev RTCM-Revision, + timeStamp MinuteOfTheYear OPTIONAL, + anchorPoint FullPositionVector OPTIONAL, + rtcmHeader RTCMheader OPTIONAL, + msgs RTCMmessageList, + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-RTCMcorrections}} OPTIONAL, + ... +} - requestor RequestorDescription, - -- Requesting Device and other User Data - -- contains vehicle ID (if from a vehicle) - -- as well as type data and current position - -- and may contain additional transit data +SPAT ::= SEQUENCE { + timeStamp MinuteOfTheYear OPTIONAL, + name DescriptiveName OPTIONAL, + intersections IntersectionStateList, + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-SPAT}} OPTIONAL, + ... +} - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalRequestMessage}} OPTIONAL, - ... +SignalRequestMessage ::= SEQUENCE { + timeStamp MinuteOfTheYear OPTIONAL, + second DSecond, + sequenceNumber MsgCount OPTIONAL, + requests SignalRequestList OPTIONAL, + requestor RequestorDescription, + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-SignalRequestMessage}} OPTIONAL, + ... } SignalStatusMessage ::= SEQUENCE { - timeStamp MinuteOfTheYear OPTIONAL, - second DSecond, - sequenceNumber MsgCount OPTIONAL, - - -- Status Data for one of more signalized intersections - status SignalStatusList, - - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalStatusMessage}} OPTIONAL, - ... + timeStamp MinuteOfTheYear OPTIONAL, + second DSecond, + sequenceNumber MsgCount OPTIONAL, + status SignalStatusList, + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-SignalStatusMessage}} OPTIONAL, + ... } -MapData ::= SEQUENCE { - timeStamp MinuteOfTheYear OPTIONAL, - msgIssueRevision MsgCount, - layerType LayerType OPTIONAL, - layerID LayerID OPTIONAL, - intersections IntersectionGeometryList OPTIONAL, - -- All Intersection definitions - roadSegments RoadSegmentList OPTIONAL, - -- All roadway descriptions - - dataParameters DataParameters OPTIONAL, - -- Any meta data regarding the map contents - - restrictionList RestrictionClassList OPTIONAL, - -- Any restriction ID tables which have - -- established for these map entries - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-MapData}} OPTIONAL, - - -- NOTE: - -- Other map data will be added here as it is defined - -- Examples of the type of content to be added include - -- curve warnings, construction routes, etc. - ... -} + -- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ --- -- Start of entries from table Data_Frames... --- This table typicaly contains data frame entries. +-- Data frames -- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ --- AdvisorySpeed ::= SEQUENCE { - type AdvisorySpeedType, - -- the type of advisory which this is. - speed SpeedAdvice OPTIONAL, - -- See Section 11 for converting and translating speed - -- expressed in mph into units of m/s - -- This element is optional ONLY when superceded - -- by the presence of a regional speed element found in - -- Reg-AdvisorySpeed entry - confidence SpeedConfidence OPTIONAL, - -- A confidence value for the above speed - distance ZoneLength OPTIONAL, - -- Unit = 1 meter, - -- The distance indicates the region for which the advised speed - -- is recommended, it is specified upstream from the stop bar - -- along the connected egressing lane - class RestrictionClassID OPTIONAL, - -- the vehicle types to which it applies - -- when absent, the AdvisorySpeed applies to - -- all motor vehicle types - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-AdvisorySpeed}} OPTIONAL, - ... - } + type AdvisorySpeedType, + speed SpeedAdvice OPTIONAL, + confidence SpeedConfidenceDSRC OPTIONAL, + distance ZoneLength OPTIONAL, + class RestrictionClassID OPTIONAL, + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-AdvisorySpeed}} OPTIONAL, + ... +} AdvisorySpeedList ::= SEQUENCE (SIZE(1..16)) OF AdvisorySpeed -ComputedLane ::= SEQUENCE { - -- Data needed to created a computed lane - referenceLaneId LaneID, - -- the lane ID upon which this - -- computed lane will be based - -- Lane Offset in X and Y direction - offsetXaxis CHOICE { - small DrivenLineOffsetSm, - large DrivenLineOffsetLg - }, - offsetYaxis CHOICE { - small DrivenLineOffsetSm, - large DrivenLineOffsetLg - }, - -- A path X offset value for translations of the - -- path's points when creating translated lanes. - -- The values found in the reference lane are - -- all offset based on the X and Y values from - -- the coordinates of the reference lane's - -- initial path point. - -- Lane Rotation - rotateXY Angle OPTIONAL, - -- A path rotation value for the entire lane - -- Observe that this rotates the existing orientation - -- of the referenced lane, it does not replace it. - -- Rotation occurs about the initial path point. - -- Lane Path Scale (zooming) - scaleXaxis Scale-B12 OPTIONAL, - scaleYaxis Scale-B12 OPTIONAL, - -- value for translations or zooming of the path's - -- points. The values found in the reference lane - -- are all expanded or contracted based on the X - -- and Y and width values from the coordinates of - -- the reference lane's initial path point. - -- The Z axis remains untouched. - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-ComputedLane}} OPTIONAL, - ... +AntennaOffsetSet ::= SEQUENCE { + antOffsetX Offset-B12, + antOffsetY Offset-B09, + antOffsetZ Offset-B10 } + +ComputedLane ::= SEQUENCE { + referenceLaneId LaneID, + offsetXaxis CHOICE { + small DrivenLineOffsetSm, + large DrivenLineOffsetLg + }, + offsetYaxis CHOICE { + small DrivenLineOffsetSm, + large DrivenLineOffsetLg + }, + rotateXY Angle OPTIONAL, + scaleXaxis Scale-B12 OPTIONAL, + scaleYaxis Scale-B12 OPTIONAL, + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-ComputedLane}} OPTIONAL, + ... +} + ConnectsToList ::= SEQUENCE (SIZE(1..16)) OF Connection ConnectingLane ::= SEQUENCE { - lane LaneID, -- Index of the connecting lane - maneuver AllowedManeuvers OPTIONAL - -- The Maneuver between - -- the enclosing lane and this lane - -- at the stop line to connect them - } - + lane LaneID, + maneuver AllowedManeuvers OPTIONAL +} Connection ::= SEQUENCE { - -- The subject lane connecting to this lane is: - connectingLane ConnectingLane, - -- The index of the connecting lane and also - -- the maneuver from the current lane to it - remoteIntersection IntersectionReferenceID OPTIONAL, - -- This entry is only used when the - -- indicated connecting lane belongs - -- to another intersection layout. This - -- provides a means to create meshes of lanes - - -- SPAT mapping details at the stop line are: - signalGroup SignalGroupID OPTIONAL, - -- The matching signal group send by - -- the SPAT message for this lane/maneuver. - -- Shall be present unless the connectingLane - -- has no signal group (is un-signalized) - userClass RestrictionClassID OPTIONAL, - -- The Restriction Class of users this applies to - -- The use of some lane/maneuver and SignalGroupID - -- pairings are restricted to selected users. - -- When absent, the SignalGroupID applies to all - - -- Movement assist details are given by: - connectionID LaneConnectionID OPTIONAL - -- An optional connection index used to - -- relate this lane connection to any dynamic - -- clearance data in the SPAT. Note that - -- the index may be shared with other - -- connections if the clearance data is common - } - + connectingLane ConnectingLane, + remoteIntersection IntersectionReferenceID OPTIONAL, + signalGroup SignalGroupID OPTIONAL, + userClass RestrictionClassID OPTIONAL, + connectionID LaneConnectionID OPTIONAL +} ConnectionManeuverAssist ::= SEQUENCE { - connectionID LaneConnectionID, - -- the common connectionID used by all lanes to which - -- this data applies - -- (this value traces to ConnectsTo entries in lanes) - -- Expected Clearance Information - queueLength ZoneLength OPTIONAL, - -- Unit = 1 meter, 0 = no queue - -- The distance from the stop line to the back - -- edge of the last vehicle in the queue, - -- as measured along the lane center line. - availableStorageLength ZoneLength OPTIONAL, - -- Unit = 1 meter, 0 = no space remains - -- Distance (e.g. beginning from the downstream - -- stop-line up to a given distance) with a high - -- probability for successfully executing the - -- connecting maneuver between the two lanes - -- during the current cycle. - -- Used for enhancing the awareness of vehicles - -- to anticipate if they can pass the stop line - -- of the lane. Used for optimizing the green wave, - -- due to knowledge of vehicles waiting in front - -- of a red light (downstream). - -- The element nextTime in TimeChangeDetails - -- in the containing data frame contains the next - -- timemark at which an active phase is expected, - -- a form of storage flush interval. - waitOnStop WaitOnStopline OPTIONAL, - -- If "true", the vehicles on this specific connecting - -- maneuver have to stop on the stop-line and not - -- to enter the collision area - pedBicycleDetect PedestrianBicycleDetect OPTIONAL, - -- true if ANY ped or bicycles are detected crossing - -- the above lanes. Set to false ONLY if there is a - -- high certainty that there are none present, - -- otherwise element is not sent. - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-ConnectionManeuverAssist}} OPTIONAL, - ... - } + connectionID LaneConnectionID, + queueLength ZoneLength OPTIONAL, + availableStorageLength ZoneLength OPTIONAL, + waitOnStop WaitOnStopline OPTIONAL, + pedBicycleDetect PedestrianBicycleDetect OPTIONAL, + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-ConnectionManeuverAssist}} OPTIONAL, + ... +} DataParameters ::= SEQUENCE { - processMethod IA5String(SIZE(1..255)) OPTIONAL, - processAgency IA5String(SIZE(1..255)) OPTIONAL, - lastCheckedDate IA5String(SIZE(1..255)) OPTIONAL, - geoidUsed IA5String(SIZE(1..255)) OPTIONAL, - ... + processMethod IA5String(SIZE(1..255)) OPTIONAL, + processAgency IA5String(SIZE(1..255)) OPTIONAL, + lastCheckedDate IA5String(SIZE(1..255)) OPTIONAL, + geoidUsed IA5String(SIZE(1..255)) OPTIONAL, + ... +} + + +DDateTime ::= SEQUENCE { + year DYear OPTIONAL, + month DMonth OPTIONAL, + day DDay OPTIONAL, + hour DHour OPTIONAL, + minute DMinute OPTIONAL, + second DSecond OPTIONAL, + offset DOffset OPTIONAL } EnabledLaneList ::= SEQUENCE (SIZE(1..16)) OF LaneID - -- The unique ID numbers for each - -- lane object which is 'active' - -- as part of the dynamic map contents. - -GenericLane ::= SEQUENCE { - laneID LaneID, - -- The unique ID number assigned - -- to this lane object - name DescriptiveName OPTIONAL, - -- often for debug use only - -- but at times used to name ped crossings - ingressApproach ApproachID OPTIONAL, -- inbound - egressApproach ApproachID OPTIONAL, -- outbound - -- Approach IDs to which this lane belongs - laneAttributes LaneAttributes, - -- All Attribute information about - -- the basic selected lane type - -- Directions of use, Geometric co-sharing - -- and Type Specific Attributes - -- These Attributes are 'lane - global' that is, - -- they are true for the entire length of the lane - maneuvers AllowedManeuvers OPTIONAL, - -- the permitted maneuvers for this lane - nodeList NodeListXY, - -- Lane spatial path information as well as - -- various Attribute information along the node path - -- Attributes found here are more general and may - -- come and go over the length of the lane. - connectsTo ConnectsToList OPTIONAL, - -- a list of other lanes and their signal group IDs - -- each connecting lane and its signal group ID - -- is given, therefore this element provides the - -- information formerly in "signalGroups" in prior - -- editions. - overlays OverlayLaneList OPTIONAL, - -- A list of any lanes which have spatial paths that - -- overlay (run on top of, and not simply cross) - -- the path of this lane when used - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-GenericLane}} OPTIONAL, + +FullPositionVector ::= SEQUENCE { + utcTime DDateTime OPTIONAL, -- time with mSec precision + long Longitude, + lat Latitude, + elevation Elevation OPTIONAL, + heading HeadingDSRC OPTIONAL, + speed TransmissionAndSpeed OPTIONAL, + posAccuracy PositionalAccuracy OPTIONAL, + timeConfidence TimeConfidence OPTIONAL, + posConfidence PositionConfidenceSet OPTIONAL, + speedConfidence SpeedandHeadingandThrottleConfidence OPTIONAL, ... } + +GenericLane ::= SEQUENCE { + laneID LaneID, + name DescriptiveName OPTIONAL, + ingressApproach ApproachID OPTIONAL, + egressApproach ApproachID OPTIONAL, + laneAttributes LaneAttributes, + maneuvers AllowedManeuvers OPTIONAL, + nodeList NodeListXY, + connectsTo ConnectsToList OPTIONAL, + overlays OverlayLaneList OPTIONAL, + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-GenericLane}} OPTIONAL, + ... +} + IntersectionAccessPoint ::= CHOICE { - lane LaneID, - approach ApproachID, - connection LaneConnectionID, - ... - } + lane LaneID, + approach ApproachID, + connection LaneConnectionID, + ... +} IntersectionGeometry ::= SEQUENCE { - name DescriptiveName OPTIONAL, - -- For debug use only - id IntersectionReferenceID, - -- A globally unique value set, - -- consisting of a regionID and - -- intersection ID assignment - revision MsgCount, - - -- Required default values about lane descriptions follow - refPoint Position3D, -- The reference from which subsequent - -- data points are offset until a new - -- point is used. - laneWidth LaneWidth OPTIONAL, - -- Reference width used by all subsequent - -- lanes unless a new width is given - speedLimits SpeedLimitList OPTIONAL, - -- Reference regulatory speed limits - -- used by all subsequent - -- lanes unless a new speed is given - -- See Section 11 for converting and - -- translating speed expressed in mph - -- into units of m/s - -- Complete details regarding each lane type in this intersection - laneSet LaneList, -- Data about one or more lanes - -- (all lane data is found here) - - -- Data describing how to use and request preemption and - -- priority services from this intersection (if supported) - -- NOTE Additonal data may be added in the next release of the - -- standard at this point to handle this concept - preemptPriorityData PreemptPriorityList OPTIONAL, - -- data about one or more regional - -- preempt or priority zones - - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-IntersectionGeometry}} OPTIONAL, - ... - } + name DescriptiveName OPTIONAL, + id IntersectionReferenceID, + revision MsgCount, + refPoint Position3D, + laneWidth LaneWidth OPTIONAL, + speedLimits SpeedLimitList OPTIONAL, + laneSet LaneList, + preemptPriorityData PreemptPriorityList OPTIONAL, + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-IntersectionGeometry}} OPTIONAL, + ... +} IntersectionGeometryList ::= SEQUENCE (SIZE(1..32)) OF IntersectionGeometry - + IntersectionReferenceID ::= SEQUENCE { - region RoadRegulatorID OPTIONAL, - -- a globally unique regional assignment value - -- typical assigned to a regional DOT authority - -- the value zero shall be used for testing needs - id IntersectionID - -- a unique mapping to the intersection - -- in question within the above region of use - } - + region RoadRegulatorID OPTIONAL, + id IntersectionID +} + IntersectionState ::= SEQUENCE { - name DescriptiveName OPTIONAL, - -- human readable name for intersection - -- to be used only in debug mode - id IntersectionReferenceID, - -- A globally unique value set, consisting of a - -- regionID and intersection ID assignment - -- provides a unique mapping to the - -- intersection MAP in question - -- which provides complete location - -- and approach/move/lane data - revision MsgCount, - status IntersectionStatusObject, - -- general status of the controller(s) - moy MinuteOfTheYear OPTIONAL, - -- Minute of current UTC year - -- used only with messages to be archived - timeStamp DSecond OPTIONAL, - -- the mSec point in the current UTC minute that - -- this message was constructed - enabledLanes EnabledLaneList OPTIONAL, - -- a list of lanes where the RevocableLane bit - -- has been set which are now active and - -- therefore part of the current intersection - states MovementList, - -- Each Movement is given in turn - -- and contains its signal phase state, - -- mapping to the lanes it applies to, and - -- point in time it will end, and it - -- may contain both active and future states - maneuverAssistList ManeuverAssistList OPTIONAL, - -- Assist data - - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-IntersectionState}} OPTIONAL, - ... - } - + name DescriptiveName OPTIONAL, + id IntersectionReferenceID, + revision MsgCount, + status IntersectionStatusObject, + moy MinuteOfTheYear OPTIONAL, + timeStamp DSecond OPTIONAL, + enabledLanes EnabledLaneList OPTIONAL, + states MovementList, + maneuverAssistList ManeuverAssistList OPTIONAL, + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-IntersectionState}} OPTIONAL, + ... +} + IntersectionStateList ::= SEQUENCE (SIZE(1..32)) OF IntersectionState LaneAttributes ::= SEQUENCE { - directionalUse LaneDirection, -- directions of lane use - sharedWith LaneSharing, -- co-users of the lane path - laneType LaneTypeAttributes, -- specific lane type data - regional RegionalExtension {{Reg-LaneAttributes}} OPTIONAL - } + directionalUse LaneDirection, + sharedWith LaneSharing, + laneType LaneTypeAttributes, + regional RegionalExtension {{Reg-LaneAttributes}} OPTIONAL +} LaneDataAttribute ::= CHOICE { - -- Segment attribute types and the data needed for each - pathEndPointAngle DeltaAngle, - -- adjusts final point/width slant - -- of the lane to align with the stop line - laneCrownPointCenter RoadwayCrownAngle, - -- sets the canter of the road bed - -- from centerline point - laneCrownPointLeft RoadwayCrownAngle, - -- sets the canter of the road bed - -- from left edge - laneCrownPointRight RoadwayCrownAngle, - -- sets the canter of the road bed - -- from right edge - laneAngle MergeDivergeNodeAngle, - -- the angle or direction of another lane - -- this is required to support Japan style - -- when a merge point angle is required - speedLimits SpeedLimitList, - -- Reference regulatory speed limits - -- used by all segments - - -- Add others as needed, in regional space - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-LaneDataAttribute}}, - ... - } + pathEndPointAngle DeltaAngle, + laneCrownPointCenter RoadwayCrownAngle, + laneCrownPointLeft RoadwayCrownAngle, + laneCrownPointRight RoadwayCrownAngle, + laneAngle MergeDivergeNodeAngle, + speedLimits SpeedLimitList, + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-LaneDataAttribute}}, + ... +} LaneDataAttributeList ::= SEQUENCE (SIZE(1..8)) OF LaneDataAttribute LaneList ::= SEQUENCE (SIZE(1..255)) OF GenericLane LaneSharing ::= BIT STRING { - -- With bits as defined: - overlappingLaneDescriptionProvided (0), - -- Assert when another lane object is present to describe the - -- path of the overlapping shared lane - -- this construct is not used for lane objects which simply cross - multipleLanesTreatedAsOneLane (1), - -- Assert if the lane object path and width details represents - -- multiple lanes within it that are not further described - - -- Various modes and type of traffic that may share this lane: - otherNonMotorizedTrafficTypes (2), -- horse drawn etc. - individualMotorizedVehicleTraffic (3), - busVehicleTraffic (4), - taxiVehicleTraffic (5), - pedestriansTraffic (6), - cyclistVehicleTraffic (7), - trackedVehicleTraffic (8), - pedestrianTraffic (9) - } (SIZE (10)) - -- All zeros would indicate 'not shared' and 'not overlapping' + overlappingLaneDescriptionProvided (0), + multipleLanesTreatedAsOneLane (1), + otherNonMotorizedTrafficTypes (2), + individualMotorizedVehicleTraffic (3), + busVehicleTraffic (4), + taxiVehicleTraffic (5), + pedestriansTraffic (6), + cyclistVehicleTraffic (7), + trackedVehicleTraffic (8), + pedestrianTraffic (9) +} (SIZE (10)) LaneTypeAttributes ::= CHOICE { - vehicle LaneAttributes-Vehicle, -- motor vehicle lanes - crosswalk LaneAttributes-Crosswalk, -- pedestrian crosswalks - bikeLane LaneAttributes-Bike, -- bike lanes - sidewalk LaneAttributes-Sidewalk, -- pedestrian sidewalk paths - median LaneAttributes-Barrier, -- medians & channelization - striping LaneAttributes-Striping, -- roadway markings - trackedVehicle LaneAttributes-TrackedVehicle, -- trains and trolleys - parking LaneAttributes-Parking, -- parking and stopping lanes - ... - } + vehicle LaneAttributes-Vehicle, + crosswalk LaneAttributes-Crosswalk, + bikeLane LaneAttributes-Bike, + sidewalk LaneAttributes-Sidewalk, + median LaneAttributes-Barrier, + striping LaneAttributes-Striping, + trackedVehicle LaneAttributes-TrackedVehicle, + parking LaneAttributes-Parking, + ... +} ManeuverAssistList ::= SEQUENCE (SIZE(1..16)) OF ConnectionManeuverAssist -MovementEventList ::= SEQUENCE (SIZE(1..16)) OF MovementEvent - MovementEvent ::= SEQUENCE { - eventState MovementPhaseState, - -- Consisting of: - -- Phase state (the basic 11 states) - -- Directional, protected, or permissive state - - timing TimeChangeDetails OPTIONAL, - -- Timing Data in UTC time stamps for event - -- includes start and min/max end times of phase - -- confidence and estimated next occurrence - - speeds AdvisorySpeedList OPTIONAL, - -- various speed advisories for use by - -- general and specific types of vehicles - -- supporting green-wave and other flow needs - -- See Section 11 for converting and translating - -- speed expressed in mph into units of m/s - - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-MovementEvent}} OPTIONAL, - ... - } + eventState MovementPhaseState, + timing TimeChangeDetails OPTIONAL, + speeds AdvisorySpeedList OPTIONAL, + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-MovementEvent}} OPTIONAL, + ... +} + +MovementEventList ::= SEQUENCE (SIZE(1..16)) OF MovementEvent MovementList ::= SEQUENCE (SIZE(1..255)) OF MovementState MovementState ::= SEQUENCE { - movementName DescriptiveName OPTIONAL, - -- uniquely defines movement by name - -- human readable name for intersection - -- to be used only in debug mode - signalGroup SignalGroupID, - -- the group id is used to map to lists - -- of lanes (and their descriptions) - -- which this MovementState data applies to - -- see comments in the Remarks for usage details - state-time-speed MovementEventList, - -- Consisting of sets of movement data with: - -- a) SignalPhaseState - -- b) TimeChangeDetails, and - -- c) AdvisorySpeeds (optional ) - -- Note one or more of the movement events may be for - -- a future time and that this allows conveying multiple - -- predictive phase and movement timing for various uses - -- for the current signal group - maneuverAssistList ManeuverAssistList OPTIONAL, - -- This information may also be placed in the - -- IntersectionState when common information applies to - -- different lanes in the same way - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-MovementState}} OPTIONAL, - ... - } + movementName DescriptiveName OPTIONAL, + signalGroup SignalGroupID, + state-time-speed MovementEventList, + maneuverAssistList ManeuverAssistList OPTIONAL, + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-MovementState}} OPTIONAL, + ... +} NodeAttributeSetXY ::= SEQUENCE { - localNode NodeAttributeXYList OPTIONAL, - -- Attribute states which pertain to this node point - disabled SegmentAttributeXYList OPTIONAL, - -- Attribute states which are disabled at this node point - enabled SegmentAttributeXYList OPTIONAL, - -- Attribute states which are enabled at this node point - -- and which remain enabled until disabled or the lane ends - data LaneDataAttributeList OPTIONAL, - -- Attributes which require an additional data values - -- some of these are local to the node point, while others - -- persist with the provided values until changed - -- and this is indicated in each entry - dWidth Offset-B10 OPTIONAL, - -- A value added to the current lane width - -- at this node and from this node onwards, in 1cm steps - -- lane width between nodes are a linear taper between pts - -- the value of zero shall not be sent here - dElevation Offset-B10 OPTIONAL, - -- A value added to the current Elevation - -- at this node from this node onwards, in 10cm steps - -- elevations between nodes are a linear taper between pts - -- the value of zero shall not be sent here - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-NodeAttributeSetXY}} OPTIONAL, - ... - } - -NodeAttributeXYList ::= SEQUENCE (SIZE(1..8)) OF NodeAttributeXY + localNode NodeAttributeXYList OPTIONAL, + disabled SegmentAttributeXYList OPTIONAL, + enabled SegmentAttributeXYList OPTIONAL, + data LaneDataAttributeList OPTIONAL, + dWidth Offset-B10 OPTIONAL, + dElevation Offset-B10 OPTIONAL, + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-NodeAttributeSetXY}} OPTIONAL, + ... +} NodeAttributeXY ::= ENUMERATED { - -- Various values which pertain only to the current node point - - -- General Items - reserved, - stopLine, -- point where a mid-path stop line exists - -- See also 'do not block' for segments - - -- Path finish details - roundedCapStyleA, -- Used to control final path rounded end shape - -- with edge of curve at final point in a circle - roundedCapStyleB, -- Used to control final path rounded end shape - -- with edge of curve extending 50% of width past - -- final point in a circle - - -- Topography Points (items with no concept of a distance along the path) - mergePoint, -- Japan merge with 1 or more lanes - divergePoint, -- Japan diverge with 1 or more lanes - downstreamStopLine, -- Japan style downstream intersection - -- (a 2nd intersection) stop line - downstreamStartNode, -- Japan style downstream intersection - -- (a 2nd intersection) start node - - -- Pedestrian Support Attributes - closedToTraffic, -- where a pedestrian may NOT go - -- to be used during construction events - safeIsland, -- a pedestrian safe stopping point - -- also called a traffic island - -- This usage described a point feature on a path, - -- other entries can describe a path - curbPresentAtStepOff, -- the sidewalk to street curb is NOT - -- angled where it meets the edge of the - -- roadway (user must step up/down) - - -- Lane geometry details (see standard for defined shapes) - hydrantPresent, -- Or other services access - ... - } + reserved, + stopLine, + roundedCapStyleA, + roundedCapStyleB, + mergePoint, + divergePoint, + downstreamStopLine, + downstreamStartNode, + closedToTraffic, + safeIsland, + curbPresentAtStepOff, + hydrantPresent, + ... +} + +NodeAttributeXYList ::= SEQUENCE (SIZE(1..8)) OF NodeAttributeXY Node-LLmD-64b ::= SEQUENCE { - lon Longitude, - lat Latitude - } + lon Longitude, + lat Latitude +} - Node-XY-20b ::= SEQUENCE { - x Offset-B10, - y Offset-B10 - } +Node-XY-20b ::= SEQUENCE { + x Offset-B10, + y Offset-B10 +} Node-XY-22b ::= SEQUENCE { - x Offset-B11, - y Offset-B11 - } - + x Offset-B11, + y Offset-B11 +} Node-XY-24b ::= SEQUENCE { - x Offset-B12, - y Offset-B12 - } - + x Offset-B12, + y Offset-B12 +} Node-XY-26b ::= SEQUENCE { - x Offset-B13, - y Offset-B13 - } - + x Offset-B13, + y Offset-B13 +} Node-XY-28b ::= SEQUENCE { - x Offset-B14, - y Offset-B14 - } - + x Offset-B14, + y Offset-B14 +} Node-XY-32b ::= SEQUENCE { - x Offset-B16, - y Offset-B16 - } + x Offset-B16, + y Offset-B16 +} NodeListXY ::= CHOICE { - nodes NodeSetXY, - -- a lane made up of two or more - -- XY node points and any attributes - -- defined in those nodes - computed ComputedLane, - -- a lane path computed by translating - -- the data defined by another lane - ... - } + nodes NodeSetXY, + computed ComputedLane, + ... +} NodeOffsetPointXY ::= CHOICE { - -- Nodes with X,Y content - node-XY1 Node-XY-20b, -- node is within 5.11m of last node - node-XY2 Node-XY-22b, -- node is within 10.23m of last node - node-XY3 Node-XY-24b, -- node is within 20.47m of last node - node-XY4 Node-XY-26b, -- node is within 40.96m of last node - node-XY5 Node-XY-28b, -- node is within 81.91m of last node - node-XY6 Node-XY-32b, -- node is within 327.67m of last node - node-LatLon Node-LLmD-64b, -- node is a full 32b Lat/Lon range - regional RegionalExtension {{Reg-NodeOffsetPointXY}} - -- node which follows is of a - -- regional definition type - } - -NodeSetXY ::= SEQUENCE (SIZE(2..63)) OF NodeXY + node-XY1 Node-XY-20b, + node-XY2 Node-XY-22b, + node-XY3 Node-XY-24b, + node-XY4 Node-XY-26b, + node-XY5 Node-XY-28b, + node-XY6 Node-XY-32b, + node-LatLon Node-LLmD-64b, + regional RegionalExtension {{Reg-NodeOffsetPointXY}} +} NodeXY ::= SEQUENCE { - delta NodeOffsetPointXY, - -- A choice of which X,Y offset value to use - -- this includes various delta values as well a regional choices - attributes NodeAttributeSetXY OPTIONAL, - -- Any optional Attributes which are needed - -- This includes changes to the current lane width and elevation - ... + delta NodeOffsetPointXY, + attributes NodeAttributeSetXY OPTIONAL, + ... } +NodeSetXY ::= SEQUENCE (SIZE(2..63)) OF NodeXY + OverlayLaneList ::= SEQUENCE (SIZE(1..5)) OF LaneID - -- The unique ID numbers for any lane object which have - -- spatial paths that overlay (run on top of, and not - -- simply cross with) the current lane. - -- Such as a train path that overlays a motor vehicle - -- lane object for a roadway segment. -Position3D ::= SEQUENCE { - lat Latitude, -- in 1/10th micro degrees - long Longitude, -- in 1/10th micro degrees - elevation Elevation OPTIONAL, -- in 10 cm units - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-Position3D}} OPTIONAL, - ... +PositionalAccuracy ::= SEQUENCE { + semiMajor SemiMajorAxisAccuracy, + semiMinor SemiMinorAxisAccuracy, + orientation SemiMajorAxisOrientation +} + +PositionConfidenceSet ::= SEQUENCE { + pos PositionConfidence, -- for both horizontal directions + elevation ElevationConfidence } + +Position3D ::= SEQUENCE { + lat Latitude, + long Longitude, + elevation Elevation OPTIONAL, + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-Position3D}} OPTIONAL, + ... +} + PreemptPriorityList ::= SEQUENCE (SIZE(1..32)) OF SignalControlZone RegulatorySpeedLimit ::= SEQUENCE { - type SpeedLimitType, - -- The type of regulatory speed which follows - speed Velocity - -- The speed in units of 0.02 m/s - -- See Section 11 for converting and translating - -- speed expressed in mph into units of m/s - } + type SpeedLimitType, + speed Velocity +} RequestorDescription ::= SEQUENCE { - id VehicleID, - -- The ID used in the BSM or CAM of the requestor - -- This ID is presumed not to change - -- during the exchange - type RequestorType OPTIONAL, - -- Information regarding all type and class data - -- about the requesting vehicle - position RequestorPositionVector OPTIONAL, - -- The location of the requesting vehicle - name DescriptiveName OPTIONAL, - -- A human readable name for debugging use - -- Support for Transit requests - routeName DescriptiveName OPTIONAL, - -- A string for transit operations use - transitStatus TransitVehicleStatus OPTIONAL, - -- current vehicle state (loading, etc.) - transitOccupancy TransitVehicleOccupancy OPTIONAL, - -- current vehicle occupancy - transitSchedule DeltaTime OPTIONAL, - -- current vehicle schedule adherence - - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-RequestorDescription}} OPTIONAL, - ... - } + id VehicleID, + type RequestorType OPTIONAL, + position RequestorPositionVector OPTIONAL, + name DescriptiveName OPTIONAL, + routeName DescriptiveName OPTIONAL, + transitStatus TransitVehicleStatus OPTIONAL, + transitOccupancy TransitVehicleOccupancy OPTIONAL, + transitSchedule DeltaTime OPTIONAL, + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-RequestorDescription}} OPTIONAL, + ... +} RequestorPositionVector ::= SEQUENCE { - position Position3D, - heading Angle OPTIONAL, - speed TransmissionAndSpeed OPTIONAL, - ... - } + position Position3D, + heading Angle OPTIONAL, + speed TransmissionAndSpeed OPTIONAL, + ... +} RequestorType ::= SEQUENCE { - -- Defines who is requesting - role BasicVehicleRole, -- Basic role of this user at this time - subrole RequestSubRole OPTIONAL, -- A local list with role based items - - -- Defines what kind of request (a level of importance in the Priority Scheme) - request RequestImportanceLevel OPTIONAL, -- A local list with request items - - -- Additional classification details - iso3883 Iso3833VehicleType OPTIONAL, - hpmsType VehicleType OPTIONAL, -- HPMS classification types - - regional RegionalExtension {{Reg-RequestorType}} OPTIONAL, - ... - } + role BasicVehicleRole, + subrole RequestSubRole OPTIONAL, + request RequestImportanceLevel OPTIONAL, + iso3883 Iso3833VehicleType OPTIONAL, + hpmsType VehicleType OPTIONAL, + regional RegionalExtension {{Reg-RequestorType}} OPTIONAL, + ... +} RestrictionClassAssignment ::= SEQUENCE { - id RestrictionClassID, - -- the unique value (within an intersection or local region) - -- that is assigned to this group of users - users RestrictionUserTypeList - -- The list of user types/classes - -- to which this restriction ID applies - } + id RestrictionClassID, + users RestrictionUserTypeList +} RestrictionClassList ::= SEQUENCE (SIZE(1..254)) OF RestrictionClassAssignment -RestrictionUserTypeList ::= SEQUENCE (SIZE(1..16)) OF RestrictionUserType - RestrictionUserType ::= CHOICE { - basicType RestrictionAppliesTo, - -- a set of the most commonly used types - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-RestrictionUserType}}, - ... - } + basicType RestrictionAppliesTo, + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-RestrictionUserType}}, + ... +} + +RestrictionUserTypeList ::= SEQUENCE (SIZE(1..16)) OF RestrictionUserType RoadLaneSetList ::= SEQUENCE (SIZE(1..255)) OF GenericLane RoadSegmentReferenceID ::= SEQUENCE { - region RoadRegulatorID OPTIONAL, - -- a globally unique regional assignment value - -- typically assigned to a regional DOT authority - -- the value zero shall be used for testing needs - id RoadSegmentID - -- a unique mapping to the road segment - -- in question within the above region of use - -- during its period of assignment and use - -- note that unlike intersectionID values, - -- this value can be reused by the region - } + region RoadRegulatorID OPTIONAL, + id RoadSegmentID +} RoadSegment ::= SEQUENCE { - name DescriptiveName OPTIONAL, - id RoadSegmentReferenceID, - -- a globally unique value for the segment - revision MsgCount, - -- Required default values about the descriptions to follow - refPoint Position3D, -- the reference from which subsequent - -- data points are offset until a new - -- point is used. - laneWidth LaneWidth OPTIONAL, - -- Reference width used by all subsequent - -- lanes unless a new width is given - speedLimits SpeedLimitList OPTIONAL, - -- Reference regulatory speed limits - -- used by all subsequent - -- lanes unless a new speed is given - -- See Section 11 for converting and - -- translating speed expressed in mph - -- into units of m/s - - -- Data describing disruptions in the RoadSegment - -- such as work zones etc will be added here; - -- in the US the SAE ITIS codes would be used here - -- The details regarding each lane type in the RoadSegment - roadLaneSet RoadLaneSetList, - - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-RoadSegment}} OPTIONAL, - ... - } + name DescriptiveName OPTIONAL, + id RoadSegmentReferenceID, + revision MsgCount, + refPoint Position3D, + laneWidth LaneWidth OPTIONAL, + speedLimits SpeedLimitList OPTIONAL, + roadLaneSet RoadLaneSetList, + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-RoadSegment}} OPTIONAL, + ... +} RoadSegmentList ::= SEQUENCE (SIZE(1..32)) OF RoadSegment - + +RTCMheader ::= SEQUENCE { + status GNSSstatus, + offsetSet AntennaOffsetSet + } + +RTCMmessageList ::= SEQUENCE (SIZE(1..5)) OF RTCMmessage + SegmentAttributeXYList ::= SEQUENCE (SIZE(1..8)) OF SegmentAttributeXY SignalControlZone ::= SEQUENCE { zone RegionalExtension {{Reg-SignalControlZone}}, ... - } +} SignalRequesterInfo ::= SEQUENCE { - -- These three items serve to uniquely identify the requester - -- and the specific request to all parties - id VehicleID, - request RequestID, - sequenceNumber MsgCount, - role BasicVehicleRole OPTIONAL, - - typeData RequestorType OPTIONAL, - -- Used when addition data besides the role - -- is needed, at which point the role entry - -- above is not sent. - ... - } + id VehicleID, + request RequestID, + sequenceNumber MsgCount, + role BasicVehicleRole OPTIONAL, + typeData RequestorType OPTIONAL, + ... +} + +SignalRequest ::= SEQUENCE { + id IntersectionReferenceID, + requestID RequestID, + requestType PriorityRequestType, + inBoundLane IntersectionAccessPoint, + outBoundLane IntersectionAccessPoint OPTIONAL, + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-SignalRequest}} OPTIONAL, + ... +} SignalRequestList ::= SEQUENCE (SIZE(1..32)) OF SignalRequestPackage SignalRequestPackage ::= SEQUENCE { - request SignalRequest, - -- The specific request to the intersection - -- contains IntersectionID, request type, - -- requested action (approach/lane request) - - -- The Estimated Time of Arrival (ETA) when the service is requested - minute MinuteOfTheYear OPTIONAL, - second DSecond OPTIONAL, - duration DSecond OPTIONAL, - -- The duration value is used to provide a short interval that - -- extends the ETA so that the requesting vehicle can arrive at - -- the point of service with uncertainty or with some desired - -- duration of service. This concept can be used to avoid needing - -- to frequently update the request. - -- The requester must update the ETA and duration values if the - -- period of services extends beyond the duration time. - -- It should be assumed that if the vehicle does not clear the - -- intersection when the duration is reached, the request will - -- be cancelled and the intersection will revert to - -- normal operation. - - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalRequestPackage}} OPTIONAL, - ... - } + request SignalRequest, + minute MinuteOfTheYear OPTIONAL, + second DSecond OPTIONAL, + duration DSecond OPTIONAL, + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-SignalRequestPackage}} OPTIONAL, + ... +} -SignalRequest ::= SEQUENCE { - -- the unique ID of the target intersection - id IntersectionReferenceID, - - -- The unique requestID used by the requestor - requestID RequestID, - - -- The type of request or cancel for priority or preempt use - -- when a prior request is canceled, only the requestID is needed - requestType PriorityRequestType, - - -- In typical use either an approach or a lane number would - -- be given, this indicates the requested - -- path through the intersection to the degree it is known. - inBoundLane IntersectionAccessPoint, - -- desired entry approach or lane - outBoundLane IntersectionAccessPoint OPTIONAL, - -- desired exit approach or lane - -- the values zero is used to indicate - -- intent to stop within the intersection - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalRequest}} OPTIONAL, - ... - } +SignalStatus ::= SEQUENCE { + sequenceNumber MsgCount, + id IntersectionReferenceID, + sigStatus SignalStatusPackageList, + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-SignalStatus}} OPTIONAL, + ... +} SignalStatusList ::= SEQUENCE (SIZE(1..32)) OF SignalStatus SignalStatusPackageList ::= SEQUENCE (SIZE(1..32)) OF SignalStatusPackage SignalStatusPackage ::= SEQUENCE { - -- The party that made the initial SRM request - requester SignalRequesterInfo OPTIONAL, - -- The lanes or approaches used in the request - inboundOn IntersectionAccessPoint, -- estimated lane / approach of vehicle - outboundOn IntersectionAccessPoint OPTIONAL, - - -- The Estimated Time of Arrival (ETA) when the service is requested - -- This data echos the data of the request - minute MinuteOfTheYear OPTIONAL, - second DSecond OPTIONAL, - duration DSecond OPTIONAL, - - -- the SRM status for this request - status PrioritizationResponseStatus, - -- Status of request, this may include rejection - - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalStatusPackage}} OPTIONAL, - ... - } + requester SignalRequesterInfo OPTIONAL, + inboundOn IntersectionAccessPoint, + outboundOn IntersectionAccessPoint OPTIONAL, + + minute MinuteOfTheYear OPTIONAL, + second DSecond OPTIONAL, + duration DSecond OPTIONAL, + status PrioritizationResponseStatus, + regional SEQUENCE (SIZE(1..4)) OF + RegionalExtension {{Reg-SignalStatusPackage}} OPTIONAL, + ... +} -SignalStatus ::= SEQUENCE { - sequenceNumber MsgCount, - -- changed whenever the below contents have change - id IntersectionReferenceID, - -- this provides a unique mapping to the - -- intersection map in question - -- which provides complete location - -- and approach/movement/lane data - -- as well as zones for priority/preemption - sigStatus SignalStatusPackageList, - -- a list of detailed status containing all - -- priority or preemption state data, both - -- active and pending, and who requested it - -- requests which are denied are also listed - -- here for a short period of time - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalStatus}} OPTIONAL, - ... +SpeedandHeadingandThrottleConfidence ::= SEQUENCE { + heading HeadingConfidenceDSRC, + speed SpeedConfidenceDSRC, + throttle ThrottleConfidence } - + + SpeedLimitList ::= SEQUENCE (SIZE(1..9)) OF RegulatorySpeedLimit SpeedLimitType ::= ENUMERATED { - unknown, -- Speed limit type not available - maxSpeedInSchoolZone, -- Only sent when the limit is active - maxSpeedInSchoolZoneWhenChildrenArePresent, -- Sent at any time - maxSpeedInConstructionZone, -- Used for work zones, incident zones, etc. - -- where a reduced speed is present - vehicleMinSpeed, - vehicleMaxSpeed, -- Regulatory speed limit for general traffic - vehicleNightMaxSpeed, - - truckMinSpeed, - truckMaxSpeed, - truckNightMaxSpeed, - - vehiclesWithTrailersMinSpeed, - vehiclesWithTrailersMaxSpeed, - vehiclesWithTrailersNightMaxSpeed, - ... - } + unknown, + maxSpeedInSchoolZone, + maxSpeedInSchoolZoneWhenChildrenArePresent, + maxSpeedInConstructionZone, + vehicleMinSpeed, + vehicleMaxSpeed, + vehicleNightMaxSpeed, + truckMinSpeed, + truckMaxSpeed, + truckNightMaxSpeed, + vehiclesWithTrailersMinSpeed, + vehiclesWithTrailersMaxSpeed, + vehiclesWithTrailersNightMaxSpeed, + ... +} TimeChangeDetails ::= SEQUENCE { - startTime TimeMark OPTIONAL, - -- When this phase 1st started - minEndTime TimeMark, - -- Expected shortest end time - maxEndTime TimeMark OPTIONAL, - -- Expected longest end time - - likelyTime TimeMark OPTIONAL, - -- Best predicted value based on other data - confidence TimeIntervalConfidence OPTIONAL, - -- Applies to above time element only - - nextTime TimeMark OPTIONAL - -- A rough estimate of time when - -- this phase may next occur again - -- used to support various ECO driving power - -- management needs. - } + startTime TimeMark OPTIONAL, + minEndTime TimeMark, + maxEndTime TimeMark OPTIONAL, + likelyTime TimeMark OPTIONAL, + confidence TimeIntervalConfidence OPTIONAL, + nextTime TimeMark OPTIONAL +} TimeMark ::= INTEGER (0..36001) - -- Tenths of a second in the current or next hour - -- In units of 1/10th second from UTC time - -- A range of 0~36000 covers one hour - -- The values 35991..36000 are used when a leap second occurs - -- The value 36001 is used to indicate time >3600 seconds - -- 36002 is to be used when value undefined or unknown - -- Note that this is NOT expressed in GPS time - -- or in local time TransmissionAndSpeed ::= SEQUENCE { - transmisson TransmissionState, - speed Velocity - } + transmisson TransmissionState, + speed Velocity +} VehicleID ::= CHOICE { - entityID TemporaryID, - stationID StationID - } + entityID TemporaryID, + stationID StationID +} + - -- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ --- --- Start of entries from table Data_Elements... --- This table typicaly contains data element entries. +-- data elements -- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ --- AdvisorySpeedType ::= ENUMERATED { - none (0), - greenwave (1), - ecoDrive (2), - transit (3), - ... - } -- Note: subject to further growth + none (0), + greenwave (1), + ecoDrive (2), + transit (3), + ... +} AllowedManeuvers ::= BIT STRING { - -- With bits as defined: - -- Allowed maneuvers at path end (stop line) - -- All maneuvers with bits not set are therefore prohibited ! - -- A value of zero shall be used for unknown, indicating no Maneuver - maneuverStraightAllowed (0), - -- a Straight movement is allowed in this lane - maneuverLeftAllowed (1), - -- a Left Turn movement is allowed in this lane - maneuverRightAllowed (2), - -- a Right Turn movement is allowed in this lane - maneuverUTurnAllowed (3), - -- a U turn movement is allowed in this lane - maneuverLeftTurnOnRedAllowed (4), - -- a Stop, and then proceed when safe movement - -- is allowed in this lane - maneuverRightTurnOnRedAllowed (5), - -- a Stop, and then proceed when safe movement - -- is allowed in this lane - maneuverLaneChangeAllowed (6), - -- a movement which changes to an outer lane - -- on the egress side is allowed in this lane - -- (example: left into either outbound lane) - maneuverNoStoppingAllowed (7), - -- the vehicle should not stop at the stop line - -- (example: a flashing green arrow) - yieldAllwaysRequired (8), - -- the allowed movements above are not protected - -- (example: an permanent yellow condition) - goWithHalt (9), - -- after making a full stop, may proceed - caution (10), - -- proceed past stop line with caution - reserved1 (11) - -- used to align to 12 Bit Field - - } (SIZE(12)) - -Angle ::= INTEGER (0..28800) - -- LSB of 0.0125 degrees - -- A range of 0 to 359.9875 degrees - -ApproachID ::= INTEGER (0..15) -- zero to be used when valid value is unknown - + maneuverStraightAllowed (0), + maneuverLeftAllowed (1), + maneuverRightAllowed (2), + maneuverUTurnAllowed (3), + maneuverLeftTurnOnRedAllowed (4), + maneuverRightTurnOnRedAllowed (5), + maneuverLaneChangeAllowed (6), + maneuverNoStoppingAllowed (7), + yieldAllwaysRequired (8), + goWithHalt (9), + caution (10), + reserved1 (11) +} (SIZE(12)) + +Angle ::= INTEGER (0..28800) + +ApproachID ::= INTEGER (0..15) + BasicVehicleRole ::= ENUMERATED { - -- Values used in the EU and in the US - basicVehicle (0), -- Light duty passenger vehicle type - publicTransport (1), -- Used in EU for Transit us - specialTransport (2), -- Used in EU (e.g. heavy load) - dangerousGoods (3), -- Used in EU for any HAZMAT - roadWork (4), -- Used in EU for State and Local DOT uses - roadRescue (5), -- Used in EU and in the US to include tow trucks. - emergency (6), -- Used in EU for Police, Fire and Ambulance units - safetyCar (7), -- Used in EU for Escort vehicles - -- Begin US unique numbering - none-unknown (8), -- added to follow current SAE style guidelines - truck (9), -- Heavy trucks with additional BSM rights and obligations - motorcycle (10), -- - roadSideSource (11), -- For infrastructure generated calls such as - -- fire house, rail infrastructure, roadwork site, etc. - police (12), -- - fire (13), -- - ambulance (14), -- (does not include private para-transit etc.) - dot (15), -- all roadwork vehicles - transit (16), -- all transit vehicles - slowMoving (17), -- to also include oversize etc. - stopNgo (18), -- to include trash trucks, school buses and others - -- that routinely disturb the free flow of traffic - cyclist (19), -- - pedestrian (20), -- also includes those with mobility limitations - nonMotorized (21), -- other, horse drawn, etc. - military (22), -- - ... - } - -DeltaAngle ::= INTEGER (-150..150) - -- With an angle range from - -- negative 150 to positive 150 - -- in one degree steps where zero is directly - -- along the axis or the lane center line as defined by the - -- two closest points - -DeltaTime ::= INTEGER (-122 .. 121) - -- Supporting a range of +/- 20 minute in steps of 10 seconds - -- the value of -121 shall be used when more than -20 minutes - -- the value of +120 shall be used when more than +20 minutes - -- the value -122 shall be used when the value is unavailable + basicVehicle (0), + publicTransport (1), + specialTransport (2), + dangerousGoods (3), + roadWork (4), + roadRescue (5), + emergency (6), + safetyCar (7), + none-unknown (8), + truck (9), + motorcycle (10), + roadSideSource (11), + police (12), + fire (13), + ambulance (14), + dot (15), + transit (16), + slowMoving (17), + stopNgo (18), + cyclist (19), + pedestrian (20), + nonMotorized (21), + military (22), + ... +} + +DDay ::= INTEGER (0..31) + +DeltaAngle ::= INTEGER (-150..150) + +DeltaTime ::= INTEGER (-122 .. 121) DescriptiveName ::= IA5String (SIZE(1..63)) -DrivenLineOffsetLg ::= INTEGER (-32767..32767) - -- LSB units are 1 cm. +DHour ::= INTEGER (0..31) + +DMinute ::= INTEGER (0..60) + +DMonth ::= INTEGER (0..12) + +DOffset ::= INTEGER (-840..840) + +DrivenLineOffsetLg ::= INTEGER (-32767..32767) -DrivenLineOffsetSm ::= INTEGER (-2047..2047) - -- LSB units are 1 cm. +DrivenLineOffsetSm ::= INTEGER (-2047..2047) + +DSecond ::= INTEGER (0..65535) -DSecond ::= INTEGER (0..65535) -- units of milliseconds - DSRCmsgID ::= INTEGER (0..32767) - mapData DSRCmsgID ::= 18 -- MAP, intersections - signalPhaseAndTimingMessage DSRCmsgID ::= 19 -- SPAT - signalRequestMessage DSRCmsgID ::= 29 -- SRM - signalStatusMessage DSRCmsgID ::= 30 -- SSM + mapData DSRCmsgID ::= 18 + rtcmCorrections DSRCmsgID ::= 28 + signalPhaseAndTimingMessage DSRCmsgID ::= 19 + signalRequestMessage DSRCmsgID ::= 29 + signalStatusMessage DSRCmsgID ::= 30 + +DYear ::= INTEGER (0..4095) + +Elevation ::= INTEGER (-4096..61439) + +ElevationConfidence ::= ENUMERATED { + unavailable (0), + elev-500-00 (1), + elev-200-00 (2), + elev-100-00 (3), + elev-050-00 (4), + elev-020-00 (5), + elev-010-00 (6), + elev-005-00 (7), + elev-002-00 (8), + elev-001-00 (9), + elev-000-50 (10), + elev-000-20 (11), + elev-000-10 (12), + elev-000-05 (13), + elev-000-02 (14), + elev-000-01 (15) + } + + +FuelType ::= INTEGER (0..15) + unknownFuel FuelType ::= 0 + gasoline FuelType ::= 1 + ethanol FuelType ::= 2 + diesel FuelType ::= 3 + electric FuelType ::= 4 + hybrid FuelType ::= 5 + hydrogen FuelType ::= 6 + natGasLiquid FuelType ::= 7 + natGasComp FuelType ::= 8 + propane FuelType ::= 9 + +GNSSstatus ::= BIT STRING { + unavailable (0), + isHealthy (1), + isMonitored (2), + baseStationType (3), + aPDOPofUnder5 (4), + inViewOfUnder5 (5), + localCorrectionsPresent (6), + networkCorrectionsPresent (7) + } (SIZE(8)) + +HeadingConfidenceDSRC ::= ENUMERATED { + unavailable (0), + prec10deg (1), + prec05deg (2), + prec01deg (3), + prec0-1deg (4), + prec0-05deg (5), + prec0-01deg (6), + prec0-0125deg (7) + } -Elevation ::= INTEGER (-4096..61439) - -- In units of 10 cm steps above or below the reference ellipsoid - -- Providing a range of -409.5 to + 6143.9 meters - -- The value -4096 shall be used when Unknown is to be sent +HeadingDSRC ::= INTEGER (0..28800) IntersectionID ::= INTEGER (0..65535) - -- The values zero through 255 are allocated for testing purposes - -- Note that the value assigned to an intersection will be - -- unique within a given regional ID only IntersectionStatusObject ::= BIT STRING { - manualControlIsEnabled (0), - -- Timing reported is per programmed values, etc. but person - -- at cabinet can manually request that certain intervals are - -- terminated early (e.g. green). - stopTimeIsActivated (1), - -- And all counting/timing has stopped. - failureFlash (2), - -- Above to be used for any detected hardware failures, - -- e.g. conflict monitor as well as for police flash - preemptIsActive (3), - signalPriorityIsActive (4), - - -- Additional states - fixedTimeOperation (5), - -- Schedule of signals is based on time only - -- (i.e. the state can be calculated) - trafficDependentOperation (6), - -- Operation is based on different levels of traffic parameters - -- (requests, duration of gaps or more complex parameters) - standbyOperation (7), - -- Controller: partially switched off or partially amber flashing - failureMode (8), - -- Controller has a problem or failure in operation - off (9), - -- Controller is switched off - - -- Related to MAP and SPAT bindings - recentMAPmessageUpdate (10), - -- Map revision with content changes - recentChangeInMAPassignedLanesIDsUsed (11), - -- Change in MAP's assigned lanes used (lane changes) - -- Changes in the active lane list description - noValidMAPisAvailableAtThisTime (12), - -- MAP (and various lanes indexes) not available - noValidSPATisAvailableAtThisTime (13) - -- SPAT system is not working at this time - - -- Bits 14,15 reserved at this time and shall be zero - } (SIZE(16)) - + manualControlIsEnabled (0), + stopTimeIsActivated (1), + failureFlash (2), + preemptIsActive (3), + signalPriorityIsActive (4), + fixedTimeOperation (5), + trafficDependentOperation (6), + standbyOperation (7), + failureMode (8), + off (9), + recentMAPmessageUpdate (10), + recentChangeInMAPassignedLanesIDsUsed (11), + noValidMAPisAvailableAtThisTime (12), + noValidSPATisAvailableAtThisTime (13) +} (SIZE(16)) LaneAttributes-Barrier ::= BIT STRING { - -- With bits as defined: - median-RevocableLane (0), - -- this lane may be activated or not based - -- on the current SPAT message contents - -- if not asserted, the lane is ALWAYS present - median (1), - whiteLineHashing (2), - stripedLines (3), - doubleStripedLines (4), - trafficCones (5), - constructionBarrier (6), - trafficChannels (7), - lowCurbs (8), - highCurbs (9) - -- Bits 10~15 reserved and set to zero - } (SIZE (16)) + median-RevocableLane (0), + median (1), + whiteLineHashing (2), + stripedLines (3), + doubleStripedLines (4), + trafficCones (5), + constructionBarrier (6), + trafficChannels (7), + lowCurbs (8), + highCurbs (9) +} (SIZE (16)) LaneAttributes-Bike ::= BIT STRING { - -- With bits as defined: - bikeRevocableLane (0), - -- this lane may be activated or not based - -- on the current SPAT message contents - -- if not asserted, the lane is ALWAYS present - pedestrianUseAllowed (1), - -- The path allows pedestrian traffic, - -- if not set, this mode is prohibited - isBikeFlyOverLane (2), - -- path of lane is not at grade - fixedCycleTime (3), - -- the phases use preset times - -- i.e. there is not a 'push to cross' button - biDirectionalCycleTimes (4), - -- ped walk phases use different SignalGroupID - -- for each direction. The first SignalGroupID - -- in the first Connection represents 'inbound' - -- flow (the direction of travel towards the first - -- node point) while second SignalGroupID in the - -- next Connection entry represents the 'outbound' - -- flow. And use of RestrictionClassID entries - -- in the Connect follow this same pattern in pairs. - isolatedByBarrier (5), - unsignalizedSegmentsPresent (6) - -- The lane path consists of one of more segments - -- which are not part of a signal group ID - - -- Bits 7~15 reserved and set to zero - } (SIZE (16)) - -LaneAttributes-Crosswalk ::= BIT STRING { - -- With bits as defined: - -- MUTCD provides no suitable "types" to use here - crosswalkRevocableLane (0), - -- this lane may be activated or not based - -- on the current SPAT message contents - -- if not asserted, the lane is ALWAYS present - bicyleUseAllowed (1), - -- The path allows bicycle traffic, - -- if not set, this mode is prohibited - isXwalkFlyOverLane (2), - -- path of lane is not at grade - fixedCycleTime (3), - -- ped walk phases use preset times - -- i.e. there is not a 'push to cross' button - biDirectionalCycleTimes (4), - -- ped walk phases use different SignalGroupID - -- for each direction. The first SignalGroupID - -- in the first Connection represents 'inbound' - -- flow (the direction of travel towards the first - -- node point) while second SignalGroupID in the - -- next Connection entry represents the 'outbound' - -- flow. And use of RestrictionClassID entries - -- in the Connect follow this same pattern in pairs. - hasPushToWalkButton (5), - -- Has a demand input - audioSupport (6), - -- audio crossing cues present - rfSignalRequestPresent (7), - -- Supports RF push to walk technologies - unsignalizedSegmentsPresent (8) - -- The lane path consists of one of more segments - -- which are not part of a signal group ID - -- Bits 9~15 reserved and set to zero - } (SIZE (16)) - -LaneAttributes-Parking ::= BIT STRING { - -- With bits as defined: - -- Parking use details, note that detailed restrictions such as - -- allowed hours are sent by way of ITIS codes in the TIM message - parkingRevocableLane (0), - -- this lane may be activated or not based - -- on the current SPAT message contents - -- if not asserted, the lane is ALWAYS present - parallelParkingInUse (1), - headInParkingInUse (2), - doNotParkZone (3), - -- used to denote fire hydrants as well as - -- short disruptions in a parking zone - parkingForBusUse (4), - parkingForTaxiUse (5), - noPublicParkingUse (6) - -- private parking, as in front of - -- private property - -- Bits 7~15 reserved and set to zero - } (SIZE (16)) - -LaneAttributes-Sidewalk ::= BIT STRING { - -- With bits as defined: - sidewalk-RevocableLane (0), - -- this lane may be activated or not based - -- on the current SPAT message contents - -- if not asserted, the lane is ALWAYS present - bicyleUseAllowed (1), - -- The path allows bicycle traffic, - -- if not set, this mode is prohibited - isSidewalkFlyOverLane (2), - -- path of lane is not at grade - walkBikes (3) - -- bike traffic must dismount and walk - -- Bits 4~15 reserved and set to zero - } (SIZE (16)) - - -LaneAttributes-Striping ::= BIT STRING { - -- With bits as defined: - stripeToConnectingLanesRevocableLane (0), - -- this lane may be activated or not activated based - -- on the current SPAT message contents - -- if not asserted, the lane is ALWAYS present - stripeDrawOnLeft (1), - stripeDrawOnRight (2), - -- which side of lane to mark - stripeToConnectingLanesLeft (3), - stripeToConnectingLanesRight (4), - stripeToConnectingLanesAhead (5) - -- the stripe type should be - -- presented to the user visually - -- to reflect stripes in the - -- intersection for the type of - -- movement indicated - -- Bits 6~15 reserved and set to zero - } (SIZE (16)) - - -LaneAttributes-TrackedVehicle ::= BIT STRING { - -- With bits as defined: - spec-RevocableLane (0), - -- this lane may be activated or not based - -- on the current SPAT message contents - -- if not asserted, the lane is ALWAYS present - spec-commuterRailRoadTrack (1), - spec-lightRailRoadTrack (2), - spec-heavyRailRoadTrack (3), - spec-otherRailType (4) - -- Bits 5~15 reserved and set to zero - } (SIZE (16)) - - -LaneAttributes-Vehicle ::= BIT STRING { - -- With bits as defined: - isVehicleRevocableLane (0), - -- this lane may be activated or not based - -- on the current SPAT message contents - -- if not asserted, the lane is ALWAYS present - isVehicleFlyOverLane (1), - -- path of lane is not at grade - hovLaneUseOnly (2), - restrictedToBusUse (3), - restrictedToTaxiUse (4), - restrictedFromPublicUse (5), - hasIRbeaconCoverage (6), - permissionOnRequest (7) -- e.g. to inform about a lane for e-cars - - } (SIZE (8,...)) + bikeRevocableLane (0), + pedestrianUseAllowed (1), + isBikeFlyOverLane (2), + fixedCycleTime (3), + biDirectionalCycleTimes (4), + isolatedByBarrier (5), + unsignalizedSegmentsPresent (6) +} (SIZE (16)) + +LaneAttributes-Crosswalk ::= BIT STRING { + crosswalkRevocableLane (0), + bicyleUseAllowed (1), + isXwalkFlyOverLane (2), + fixedCycleTime (3), + biDirectionalCycleTimes (4), + hasPushToWalkButton (5), + audioSupport (6), + rfSignalRequestPresent (7), + unsignalizedSegmentsPresent (8) +} (SIZE (16)) + +LaneAttributes-Parking ::= BIT STRING { + parkingRevocableLane (0), + parallelParkingInUse (1), + headInParkingInUse (2), + doNotParkZone (3), + parkingForBusUse (4), + parkingForTaxiUse (5), + noPublicParkingUse (6) +} (SIZE (16)) + +LaneAttributes-Sidewalk ::= BIT STRING { + sidewalk-RevocableLane (0), + bicyleUseAllowed (1), + isSidewalkFlyOverLane (2), + walkBikes (3) +} (SIZE (16)) + +LaneAttributes-Striping ::= BIT STRING { + stripeToConnectingLanesRevocableLane (0), + stripeDrawOnLeft (1), + stripeDrawOnRight (2), + stripeToConnectingLanesLeft (3), + stripeToConnectingLanesRight (4), + stripeToConnectingLanesAhead (5) +} (SIZE (16)) + +LaneAttributes-TrackedVehicle ::= BIT STRING { + spec-RevocableLane (0), + spec-commuterRailRoadTrack (1), + spec-lightRailRoadTrack (2), + spec-heavyRailRoadTrack (3), + spec-otherRailType (4) +} (SIZE (16)) + + +LaneAttributes-Vehicle ::= BIT STRING { + isVehicleRevocableLane (0), + isVehicleFlyOverLane (1), + hovLaneUseOnly (2), + restrictedToBusUse (3), + restrictedToTaxiUse (4), + restrictedFromPublicUse (5), + hasIRbeaconCoverage (6), + permissionOnRequest (7) +} (SIZE (8,...)) LaneConnectionID ::= INTEGER (0..255) LaneDirection ::= BIT STRING { - -- With bits as defined: - -- Allowed directions of travel in the lane object - -- All lanes are described from the stop line outwards - ingressPath (0), - -- travel from rear of path to front - -- is allowed - egressPath (1) - -- travel from front of path to rear - -- is allowed - -- Notes: No Travel, i.e. the lane object type does not support - -- travel (medians, curbs, etc.) is indicated by not - -- asserting any bit value - -- Bi-Directional Travel (such as a ped crosswalk) is - -- indicated by asserting both of the bits - } (SIZE (2)) + ingressPath (0), + egressPath (1) +} (SIZE (2)) LaneID ::= INTEGER (0..255) - -- the value 0 shall be used when the lane ID is - -- not available or not known - -- the value 255 is reserved for future use LayerID ::= INTEGER (0..100) LayerType ::= ENUMERATED { - none, - mixedContent, -- two or more of the below types - generalMapData, - intersectionData, - curveData, - roadwaySectionData, - parkingAreaData, - sharedLaneData, - ... - } - -LaneWidth ::= INTEGER (0..32767) -- units of 1 cm - -MergeDivergeNodeAngle ::= INTEGER (-180..180) - -- In units of 1.5 degrees from north - -- the value -180 shall be used to represent - -- data is not available or unknown - -MinuteOfTheYear ::= INTEGER (0..527040) - -- the value 527040 shall be used for invalid + none, + mixedContent, + generalMapData, + intersectionData, + curveData, + roadwaySectionData, + parkingAreaData, + sharedLaneData, + ... +} + +LaneWidth ::= INTEGER (0..32767) + +MergeDivergeNodeAngle ::= INTEGER (-180..180) + +MinuteOfTheYear ::= INTEGER (0..527040) MovementPhaseState ::= ENUMERATED { - -- Note that based on the regions and the operating mode not every - -- phase will be used in all transportation modes and that not - -- every phase will be used in all transportation modes - - unavailable (0), - -- This state is used for unknown or error - dark (1), - -- The signal head is dark (unlit) - - -- Reds - stop-Then-Proceed (2), - -- Often called 'flashing red' in US - -- Driver Action: - -- Stop vehicle at stop line. - -- Do not proceed unless it is safe. - -- Note that the right to proceed either right or left when - -- it is safe may be contained in the lane description to - -- handle what is called a 'right on red' - stop-And-Remain (3), - -- e.g. called 'red light' in US - -- Driver Action: - -- Stop vehicle at stop line. - -- Do not proceed. - -- Note that the right to proceed either right or left when - -- it is safe may be contained in the lane description to - -- handle what is called a 'right on red' - - -- Greens - pre-Movement (4), - -- Not used in the US, red+yellow partly in EU - -- Driver Action: - -- Stop vehicle. - -- Prepare to proceed (pending green) - -- (Prepare for transition to green/go) - permissive-Movement-Allowed (5), - -- Often called 'permissive green' in US - -- Driver Action: - -- Proceed with caution, - -- must yield to all conflicting traffic - -- Conflicting traffic may be present - -- in the intersection conflict area - protected-Movement-Allowed (6), - -- Often called 'protected green' in US - -- Driver Action: - -- Proceed, tossing caution to the wind, - -- in indicated (allowed) direction. - - -- Yellows / Ambers - -- The vehicle is not allowed to cross the stop bar if it is possible - -- to stop without danger. - permissive-clearance (7), - -- Often called 'permissive yellow' in US - -- Driver Action: - -- Prepare to stop. - -- Proceed if unable to stop, - -- Clear Intersection. - -- Conflicting traffic may be present - -- in the intersection conflict area - protected-clearance (8), - -- Often called 'protected yellow' in US - -- Driver Action: - -- Prepare to stop. - -- Proceed if unable to stop, - -- in indicated direction (to connected lane) - -- Clear Intersection. - - caution-Conflicting-Traffic (9) - -- Often called 'flashing yellow' in US - -- Often used for extended periods of time - -- Driver Action: - -- Proceed with caution, - -- Conflicting traffic may be present - -- in the intersection conflict area - } - -- The above number assignments are not used with UPER encoding - -- and are only to be used with DER or implicit encoding + unavailable (0), + dark (1), + stop-Then-Proceed (2), + stop-And-Remain (3), + pre-Movement (4), + permissive-Movement-Allowed (5), + protected-Movement-Allowed (6), + permissive-clearance (7), + protected-clearance (8), + caution-Conflicting-Traffic (9) +} MsgCount ::= INTEGER (0..127) +Offset-B09 ::= INTEGER (-256..255) + Offset-B10 ::= INTEGER (-512..511) - -- a range of +- 5.11 meters Offset-B11 ::= INTEGER (-1024..1023) - -- a range of +- 10.23 meters Offset-B12 ::= INTEGER (-2048..2047) - -- a range of +- 20.47 meters Offset-B13 ::= INTEGER (-4096..4095) - -- a range of +- 40.95 meters Offset-B14 ::= INTEGER (-8192..8191) - -- a range of +- 81.91 meters Offset-B16 ::= INTEGER (-32768..32767) - -- a range of +- 327.68 meters -PedestrianBicycleDetect ::= BOOLEAN - -- true if ANY Pedestrians or Bicyclists are - -- detected crossing the target lane or lanes - +PedestrianBicycleDetect ::= BOOLEAN + +PositionConfidence ::= ENUMERATED { + unavailable (0), + a500m (1), + a200m (2), + a100m (3), + a50m (4), + a20m (5), + a10m (6), + a5m (7), + a2m (8), + a1m (9), + a50cm (10), + a20cm (11), + a10cm (12), + a5cm (13), + a2cm (14), + a1cm (15) + } + PrioritizationResponseStatus ::= ENUMERATED { - unknown (0), - -- Unknown state - requested (1), - -- This prioritization request was detected - -- by the traffic controller - processing (2), - -- Checking request - -- (request is in queue, other requests are prior) - watchOtherTraffic (3), - -- Cannot give full permission, - -- therefore watch for other traffic - -- Note that other requests may be present - granted (4), - -- Intervention was successful - -- and now prioritization is active - rejected (5), - -- The prioritization or preemption request was - -- rejected by the traffic controller - maxPresence (6), - -- The Request has exceeded maxPresence time - -- Used when the controller has determined that - -- the requester should then back off and - -- request an alternative. - reserviceLocked (7), - -- Prior conditions have resulted in a reservice - -- locked event: the controller requires the - -- passage of time before another similar request - -- will be accepted - ... + unknown (0), + requested (1), + processing (2), + watchOtherTraffic (3), + granted (4), + rejected (5), + maxPresence (6), + reserviceLocked (7), + ... } PriorityRequestType ::= ENUMERATED { - priorityRequestTypeReserved (0), - priorityRequest (1), - priorityRequestUpdate (2), - priorityCancellation (3), - ... - } + priorityRequestTypeReserved (0), + priorityRequest (1), + priorityRequestUpdate (2), + priorityCancellation (3), + ... +} RegionId ::= INTEGER (0..255) - noRegion RegionId ::= 0 -- Use default supplied stubs - addGrpA RegionId ::= 1 -- USA - addGrpB RegionId ::= 2 -- Japan - addGrpC RegionId ::= 3 -- EU - -- NOTE: new registered regional IDs will be added here - -- The values 128 and above are for local region use + noRegion RegionId ::= 0 + addGrpA RegionId ::= 1 + addGrpB RegionId ::= 2 + addGrpC RegionId ::= 3 RequestID ::= INTEGER (0..255) RequestImportanceLevel ::= ENUMERATED { - requestImportanceLevelUnKnown (0), - requestImportanceLevel1 (1), -- The least important request - requestImportanceLevel2 (2), -- The values here shall be assigned - requestImportanceLevel3 (3), -- Meanings based on regional needs - requestImportanceLevel4 (4), -- for each of the basic roles which - requestImportanceLevel5 (5), -- are defined elsewhere - requestImportanceLevel6 (6), - requestImportanceLevel7 (7), - requestImportanceLevel8 (8), - requestImportanceLevel9 (9), - requestImportanceLevel10 (10), - requestImportanceLevel11 (11), - requestImportanceLevel12 (12), - requestImportanceLevel13 (13), - requestImportanceLevel14 (14), -- The most important request - requestImportanceReserved (15) -- Reserved for future use - } + requestImportanceLevelUnKnown (0), + requestImportanceLevel1 (1), + requestImportanceLevel2 (2), + requestImportanceLevel3 (3), + requestImportanceLevel4 (4), + requestImportanceLevel5 (5), + requestImportanceLevel6 (6), + requestImportanceLevel7 (7), + requestImportanceLevel8 (8), + requestImportanceLevel9 (9), + requestImportanceLevel10 (10), + requestImportanceLevel11 (11), + requestImportanceLevel12 (12), + requestImportanceLevel13 (13), + requestImportanceLevel14 (14), + requestImportanceReserved (15) +} RequestSubRole ::= ENUMERATED { - requestSubRoleUnKnown (0), - requestSubRole1 (1), -- The first type of sub role - requestSubRole2 (2), -- The values here shall be assigned - requestSubRole3 (3), -- Meanings based on regional needs - requestSubRole4 (4), -- to refine and expand the basic - requestSubRole5 (5), -- roles which are defined elsewhere - requestSubRole6 (6), - requestSubRole7 (7), - requestSubRole8 (8), - requestSubRole9 (9), - requestSubRole10 (10), - requestSubRole11 (11), - requestSubRole12 (12), - requestSubRole13 (13), - requestSubRole14 (14), -- The last type of sub role - requestSubRoleReserved (15) -- Reserved for future use - } + requestSubRoleUnKnown (0), + requestSubRole1 (1), + requestSubRole2 (2), + requestSubRole3 (3), + requestSubRole4 (4), + requestSubRole5 (5), + requestSubRole6 (6), + requestSubRole7 (7), + requestSubRole8 (8), + requestSubRole9 (9), + requestSubRole10 (10), + requestSubRole11 (11), + requestSubRole12 (12), + requestSubRole13 (13), + requestSubRole14 (14), + requestSubRoleReserved (15) +} RestrictionAppliesTo ::= ENUMERATED { - none, -- applies to nothing - equippedTransit, -- buses etc. - equippedTaxis, - equippedOther, -- other vehicle types with - -- necessary signal phase state - -- reception equipment - emissionCompliant, -- regional variants with more - -- definitive items also exist - equippedBicycle, - weightCompliant, - heightCompliant, - -- Items dealing with traveler needs serviced by the infrastructure - -- These end users (which are not vehicles) are presumed to be suitably equipped - pedestrians, - slowMovingPersons, - wheelchairUsers, - visualDisabilities, - audioDisabilities, -- hearing - otherUnknownDisabilities, - ... - } + none, + equippedTransit, + equippedTaxis, + equippedOther, + emissionCompliant, + equippedBicycle, + weightCompliant, + heightCompliant, + pedestrians, + slowMovingPersons, + wheelchairUsers, + visualDisabilities, + audioDisabilities, + otherUnknownDisabilities, + ... +} RestrictionClassID ::= INTEGER (0..255) - -- An index value to identify data about classes of users - -- the value used varies with each intersection's - -- needs and is defined in the map to the assigned - -- classes of supported users. RoadRegulatorID ::= INTEGER (0..65535) - -- The value zero shall be used for testing only RoadSegmentID ::= INTEGER (0..65535) - -- The values zero to 255 shall be used for testing only - -- Note that the value assigned to an RoadSegment will be - -- unique within a given regional ID only during its use - -RoadwayCrownAngle ::= INTEGER (-128..127) - -- In LSB units of 0.3 degrees of angle - -- over a range of -38.1 to + 38.1 degrees - -- The value -128 shall be used for unknown - -- The value zero shall be used for angles - -- which are between -0.15 and +0.15 - -Scale-B12 ::= INTEGER (-2048..2047) -- in steps of 0.05 percent - -SignalGroupID ::= INTEGER (0..255) - -- The value 0 shall be used when the ID is - -- not available or not known - -- the value 255 is reserved to indicate a - -- permanent green movement state - -- therefore a simple 8 phase signal controller - -- device might use 1..9 as its groupIDs + +RoadwayCrownAngle ::= INTEGER (-128..127) + +RTCMmessage ::= OCTET STRING (SIZE(1..1023)) + +RTCM-Revision ::= ENUMERATED { + unknown (0), + rtcmRev2 (1), -- Std 10402.x et al + rtcmRev3 (2), -- Std 10403.x et al + reserved (3), + ... +} + +Scale-B12 ::= INTEGER (-2048..2047) + +SignalGroupID ::= INTEGER (0..255) SegmentAttributeXY ::= ENUMERATED { - -- Various values which can be Enabled and Disabled for a lane segment - - -- General Items - reserved , - doNotBlock , -- segment where a vehicle - -- may not come to a stop - whiteLine , -- segment where lane crossing not allowed - -- such as the final few meters of a lane - - -- Porous Lane states, merging, turn outs, parking etc. - - mergingLaneLeft , -- indicates porous lanes - mergingLaneRight , - - curbOnLeft , -- indicates presence of curbs - curbOnRight , - - loadingzoneOnLeft , -- loading or drop off zones - loadingzoneOnRight , - - turnOutPointOnLeft , -- opening to adjacent street/alley/road - turnOutPointOnRight , - - adjacentParkingOnLeft , -- side of road parking - adjacentParkingOnRight , - - -- Bike Lane Needs - adjacentBikeLaneOnLeft , -- presence of marked bike lanes - adjacentBikeLaneOnRight , - sharedBikeLane , -- right of way is shared with bikes - -- who may occupy entire lane width - bikeBoxInFront , - - -- Transit Needs - transitStopOnLeft , -- any form of bus/transit loading - -- with pull in-out access to lane on left - transitStopOnRight , -- any form of bus/transit loading - -- with pull in-out access to lane on right - transitStopInLane , -- any form of bus/transit loading - -- in mid path of the lane - sharedWithTrackedVehicle , -- lane is shared with train or trolley - -- not used for crossing tracks - - - -- Pedestrian Support Attributes - safeIsland , -- begin/end a safety island in path - lowCurbsPresent , -- for ADA support - rumbleStripPresent , -- for ADA support - audibleSignalingPresent , -- for ADA support - adaptiveTimingPresent , -- for ADA support - rfSignalRequestPresent , -- Supports RF push to walk technologies - partialCurbIntrusion , -- path is blocked by a median or curb - -- but at least 1 meter remains open for use - -- and at-grade passage - - -- Lane geometry details (see standard for defined shapes) - taperToLeft , -- Used to control final path shape - taperToRight , -- Used to control final path shape - taperToCenterLine , -- Used to control final path shape - - -- Parking Lane and Curb Attributes - parallelParking , -- - headInParking , -- Parking at an angle with the street - freeParking , -- no restriction on use of parking - timeRestrictionsOnParking , -- Parking is not permitted at all times - -- typically used when the 'parking' lane - -- becomes a driving lane at times - costToPark , -- Used where parking has a cost - midBlockCurbPresent , -- a protruding curb near lane edge - unEvenPavementPresent , -- a disjoint height at lane edge - ... - } + reserved , + doNotBlock , + whiteLine , + mergingLaneLeft , + mergingLaneRight , + curbOnLeft , + curbOnRight , + loadingzoneOnLeft , + loadingzoneOnRight , + turnOutPointOnLeft , + turnOutPointOnRight , + adjacentParkingOnLeft , + adjacentParkingOnRight , + adjacentBikeLaneOnLeft , + adjacentBikeLaneOnRight , + sharedBikeLane , + bikeBoxInFront , + transitStopOnLeft , + transitStopOnRight , + transitStopInLane , + sharedWithTrackedVehicle , + safeIsland , + lowCurbsPresent , + rumbleStripPresent , + audibleSignalingPresent , + adaptiveTimingPresent , + rfSignalRequestPresent , + partialCurbIntrusion , + taperToLeft , + taperToRight , + taperToCenterLine , + parallelParking , + headInParking , + freeParking , + timeRestrictionsOnParking , + costToPark , + midBlockCurbPresent , + unEvenPavementPresent , + ... +} -SpeedAdvice ::= INTEGER (0..500) - -- LSB units are 0.1 m/s^2 - -- the value 499 shall be used for values at or greater than 49.9 m/s - -- the value 500 shall be used to indicate that speed is unavailable +SemiMajorAxisAccuracy ::= INTEGER (0..255) +SemiMajorAxisOrientation ::= INTEGER (0..65535) + +SemiMinorAxisAccuracy ::= INTEGER (0..255) + +SpeedAdvice ::= INTEGER (0..500) + +SpeedConfidenceDSRC ::= ENUMERATED { + unavailable (0), -- Not Equipped or unavailable + prec100ms (1), -- 100 meters / sec + prec10ms (2), -- 10 meters / sec + prec5ms (3), -- 5 meters / sec + prec1ms (4), -- 1 meters / sec + prec0-1ms (5), -- 0.1 meters / sec + prec0-05ms (6), -- 0.05 meters / sec + prec0-01ms (7) -- 0.01 meters / sec + } TemporaryID ::= OCTET STRING (SIZE(4)) -TimeIntervalConfidence ::= INTEGER (0..15) - -- Value Probability - -- 0 21% - -- 1 36% - -- 2 47% - -- 3 56% - -- 4 62% - -- 5 68% - -- 6 73% - -- 7 77% - -- 8 81% - -- 9 85% - -- 10 88% - -- 11 91% - -- 12 94% - -- 13 96% - -- 14 98% - -- 15 100% +ThrottleConfidence ::= ENUMERATED { + unavailable (0), + prec10percent (1), + prec1percent (2), + prec0-5percent (3) + } + +TimeConfidence ::= ENUMERATED { + unavailable (0), + time-100-000 (1), + time-050-000 (2), + time-020-000 (3), + time-010-000 (4), + time-002-000 (5), + time-001-000 (6), + time-000-500 (7), + time-000-200 (8), + time-000-100 (9), + time-000-050 (10), + time-000-020 (11), + time-000-010 (12), + time-000-005 (13), + time-000-002 (14), + time-000-001 (15), + time-000-000-5 (16), + time-000-000-2 (17), + time-000-000-1 (18), + time-000-000-05 (19), + time-000-000-02 (20), + time-000-000-01 (21), + time-000-000-005 (22), + time-000-000-002 (23), + time-000-000-001 (24), + time-000-000-000-5 (25), + time-000-000-000-2 (26), + time-000-000-000-1 (27), + time-000-000-000-05 (28), + time-000-000-000-02 (29), + time-000-000-000-01 (30), + time-000-000-000-005 (31), + time-000-000-000-002 (32), + time-000-000-000-001 (33), + time-000-000-000-000-5 (34), + time-000-000-000-000-2 (35), + time-000-000-000-000-1 (36), + time-000-000-000-000-05 (37), + time-000-000-000-000-02 (38), + time-000-000-000-000-01 (39) +} + +TimeIntervalConfidence ::= INTEGER (0..15) TransitVehicleOccupancy ::= ENUMERATED { - occupancyUnknown (0), - occupancyEmpty (1), - occupancyVeryLow (2), - occupancyLow (3), - occupancyMed (4), - occupancyHigh (5), - occupancyNearlyFull (6), - occupancyFull (7) - } + occupancyUnknown (0), + occupancyEmpty (1), + occupancyVeryLow (2), + occupancyLow (3), + occupancyMed (4), + occupancyHigh (5), + occupancyNearlyFull (6), + occupancyFull (7) +} TransitVehicleStatus ::= BIT STRING { - loading (0), -- parking and unable to move at this time - anADAuse (1), -- an ADA access is in progress (wheelchairs, kneeling, etc.) - aBikeLoad (2), -- loading of a bicycle is in progress - doorOpen (3), -- a vehicle door is open for passenger access - charging (4), -- a vehicle is connected to charging point - atStopLine (5) -- a vehicle is at the stop line for the lane it is in - } (SIZE(8)) + loading (0), + anADAuse (1), + aBikeLoad (2), + doorOpen (3), + charging (4), + atStopLine (5) +} (SIZE(8)) TransmissionState ::= ENUMERATED { - neutral (0), -- Neutral - park (1), -- Park - forwardGears (2), -- Forward gears - reverseGears (3), -- Reverse gears - reserved1 (4), - reserved2 (5), - reserved3 (6), - unavailable (7) -- not-equipped or unavailable value, - -- Any related speed is relative to the vehicle reference frame used - } + neutral (0), + park (1), + forwardGears (2), + reverseGears (3), + reserved1 (4), + reserved2 (5), + reserved3 (6), + unavailable (7) +} + +VehicleHeight ::= INTEGER (0..127) VehicleType ::= ENUMERATED { - none (0), -- Not Equipped, Not known or unavailable - unknown (1), -- Does not fit any other category - special (2), -- Special use - moto (3), -- Motorcycle - car (4), -- Passenger car - carOther (5), -- Four tire single units - bus (6), -- Buses - axleCnt2 (7), -- Two axle, six tire single units - axleCnt3 (8), -- Three axle, single units - axleCnt4 (9), -- Four or more axle, single unit - axleCnt4Trailer (10), -- Four or less axle, single trailer - axleCnt5Trailer (11), -- Five or less axle, single trailer - axleCnt6Trailer (12), -- Six or more axle, single trailer - axleCnt5MultiTrailer (13), -- Five or less axle, multi-trailer - axleCnt6MultiTrailer (14), -- Six axle, multi-trailer - axleCnt7MultiTrailer (15), -- Seven or more axle, multi-trailer - ... - } - -Velocity ::= INTEGER (0..8191) -- Units of 0.02 m/s - -- The value 8191 indicates that - -- velocity is unavailable - -WaitOnStopline ::= BOOLEAN -- - -- True or False - -- If "true", the vehicles on this specific connecting - -- maneuver have to stop on the stop-line - -- and not to enter the collision area + none (0), + unknown (1), + special (2), + moto (3), + car (4), + carOther (5), + bus (6), + axleCnt2 (7), + axleCnt3 (8), + axleCnt4 (9), + axleCnt4Trailer (10), + axleCnt5Trailer (11), + axleCnt6Trailer (12), + axleCnt5MultiTrailer (13), + axleCnt6MultiTrailer (14), + axleCnt7MultiTrailer (15), + ... +} -ZoneLength ::= INTEGER (0..10000) - -- Unit = 1 meter, 0 = unknown, - -- The value 10000 to be used for Distances >=10000 m - -- (e.g. from known point to another point along a - -- known path, often against traffic flow direction - -- when used for measuring queues) +Velocity ::= INTEGER (0..8191) -END +WaitOnStopline ::= BOOLEAN + +ZoneLength ::= INTEGER (0..10000) +END diff --git a/asn1/IS/ISO_TS_19091/original/REGION.asn b/asn1/IS/ISO_TS_19091/original/REGION.asn index 9a5385d6..df216bf1 100644 --- a/asn1/IS/ISO_TS_19091/original/REGION.asn +++ b/asn1/IS/ISO_TS_19091/original/REGION.asn @@ -1,111 +1,115 @@ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- ISO TS 19091 --- --- This ASN.1 was generated: 30.08.2016 --- --- This document contains the data element needed for the encoding the SPAT, MapData, SignalRequestMessage, SignalStatusMessage message --- as defined in ISO TS 19091 and SAEJ2735 --- --- It includes the addendunm extensions for Addgrp-C (e.g. Europe) --- --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - -- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --- +-- -- module: REGION --- +-- -- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- -REGION { iso (1) standard (0) signalizedIntersection (19091) profilec(2) region (1) version (1) } -DEFINITIONS AUTOMATIC TAGS::= BEGIN +REGION { + iso (1) standard (0) signalizedIntersection (19091) profilec (2) region (1) + version2 (2) +} + +DEFINITIONS AUTOMATIC TAGS::= BEGIN IMPORTS -addGrpC, REG-EXT-ID-AND-TYPE FROM DSRC -ConnectionManeuverAssist-addGrpC, ConnectionTrajectory-addGrpC, IntersectionState-addGrpC, Control-addGrpC, Position3D-addGrpC, RestrictionUserType-addGrpC, -SignalStatusPackage-addGrpC, MapData-addGrpC FROM AddGrpC {iso (1) standard (0) signalizedIntersection (19091) profilec(2) addgrpc (0) version (1)}; -Reg-AdvisorySpeed REG-EXT-ID-AND-TYPE ::= { ... } +addGrpC, REG-EXT-ID-AND-TYPE +FROM DSRC { + iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) +} -Reg-ComputedLane REG-EXT-ID-AND-TYPE ::= { ... } +ConnectionManeuverAssist-addGrpC, ConnectionTrajectory-addGrpC, +IntersectionState-addGrpC, LaneAttributes-addGrpC, MapData-addGrpC, +MovementEvent-addGrpC, NodeAttributeSet-addGrpC, Position3D-addGrpC, RequestorDescription-addGrpC, RestrictionUserType-addGrpC, SignalStatusPackage-addGrpC +FROM AddGrpC {iso (1) standard (0) signalizedIntersection (19091) profilec(2) addgrpc (0) version2 (2)}; -Reg-ConnectionManeuverAssist REG-EXT-ID-AND-TYPE ::= { - {ConnectionManeuverAssist-addGrpC IDENTIFIED BY addGrpC} , - ... -} +Reg-AdvisorySpeed REG-EXT-ID-AND-TYPE ::= { ... } -Reg-GenericLane REG-EXT-ID-AND-TYPE ::= { - {ConnectionTrajectory-addGrpC IDENTIFIED BY addGrpC} , - ... -} +Reg-ComputedLane REG-EXT-ID-AND-TYPE ::= { ... } -Reg-IntersectionGeometry REG-EXT-ID-AND-TYPE ::= { ... } +Reg-ConnectionManeuverAssist REG-EXT-ID-AND-TYPE ::= { + {ConnectionManeuverAssist-addGrpC IDENTIFIED BY addGrpC}, + ... +} -Reg-IntersectionState REG-EXT-ID-AND-TYPE ::= { - {IntersectionState-addGrpC IDENTIFIED BY addGrpC} , - ... +Reg-GenericLane REG-EXT-ID-AND-TYPE ::= { + {ConnectionTrajectory-addGrpC IDENTIFIED BY addGrpC} , + ... } -Reg-LaneAttributes REG-EXT-ID-AND-TYPE ::= { ... } +Reg-IntersectionGeometry REG-EXT-ID-AND-TYPE ::= { ... } -Reg-LaneDataAttribute REG-EXT-ID-AND-TYPE ::= { ... } +Reg-IntersectionState REG-EXT-ID-AND-TYPE ::= { + {IntersectionState-addGrpC IDENTIFIED BY addGrpC}, + ... +} -Reg-MapData REG-EXT-ID-AND-TYPE ::= { - {MapData-addGrpC IDENTIFIED BY addGrpC}, - ... +Reg-LaneAttributes REG-EXT-ID-AND-TYPE ::= { + {LaneAttributes-addGrpC IDENTIFIED BY addGrpC} , + ... } +Reg-LaneDataAttribute REG-EXT-ID-AND-TYPE ::= { ... } -Reg-MovementEvent REG-EXT-ID-AND-TYPE ::= { ... } +Reg-MapData REG-EXT-ID-AND-TYPE ::= { + {MapData-addGrpC IDENTIFIED BY addGrpC}, + ... +} -Reg-MovementState REG-EXT-ID-AND-TYPE ::= { ... } +Reg-MovementEvent REG-EXT-ID-AND-TYPE ::= { + {MovementEvent-addGrpC IDENTIFIED BY addGrpC} , + ... +} +Reg-MovementState REG-EXT-ID-AND-TYPE ::= { ... } -Reg-NodeAttributeSetLL REG-EXT-ID-AND-TYPE ::= { ... } +-- Reg-NodeAttributeSetLL REG-EXT-ID-AND-TYPE ::= { ... } -Reg-NodeAttributeSetXY REG-EXT-ID-AND-TYPE ::= { - {Control-addGrpC IDENTIFIED BY addGrpC} , - ... +Reg-NodeAttributeSetXY REG-EXT-ID-AND-TYPE ::= { + {NodeAttributeSet-addGrpC IDENTIFIED BY addGrpC}, + ... } -Reg-NodeOffsetPointLL REG-EXT-ID-AND-TYPE ::= { ... } +-- Reg-NodeOffsetPointLL REG-EXT-ID-AND-TYPE ::= { ... } -Reg-NodeOffsetPointXY REG-EXT-ID-AND-TYPE ::= { ... } +Reg-NodeOffsetPointXY REG-EXT-ID-AND-TYPE ::= { ... } -Reg-Position3D REG-EXT-ID-AND-TYPE ::= { - {Position3D-addGrpC IDENTIFIED BY addGrpC} , - ... +Reg-Position3D REG-EXT-ID-AND-TYPE ::= { + {Position3D-addGrpC IDENTIFIED BY addGrpC} , + ... } -Reg-RequestorDescription REG-EXT-ID-AND-TYPE ::= { ... } +Reg-RequestorDescription REG-EXT-ID-AND-TYPE ::= { + { RequestorDescription-addGrpC IDENTIFIED BY addGrpC} , + ... +} -Reg-RequestorType REG-EXT-ID-AND-TYPE ::= { ... } +Reg-RequestorType REG-EXT-ID-AND-TYPE ::= { ... } -Reg-RestrictionUserType REG-EXT-ID-AND-TYPE ::= { - {RestrictionUserType-addGrpC IDENTIFIED BY addGrpC} , - ... +Reg-RestrictionUserType REG-EXT-ID-AND-TYPE ::= { + {RestrictionUserType-addGrpC IDENTIFIED BY addGrpC} , + ... } -Reg-RoadSegment REG-EXT-ID-AND-TYPE ::= { ... } +Reg-RoadSegment REG-EXT-ID-AND-TYPE ::= { ... } + +Reg-RTCMcorrections REG-EXT-ID-AND-TYPE ::= { ... } -Reg-SignalControlZone REG-EXT-ID-AND-TYPE ::= { ... } +Reg-SignalControlZone REG-EXT-ID-AND-TYPE ::= { ... } -Reg-SignalRequest REG-EXT-ID-AND-TYPE ::= { ... } +Reg-SignalRequest REG-EXT-ID-AND-TYPE ::= { ... } -Reg-SignalRequestMessage REG-EXT-ID-AND-TYPE ::= { ... } +Reg-SignalRequestMessage REG-EXT-ID-AND-TYPE ::= { ... } -Reg-SignalRequestPackage REG-EXT-ID-AND-TYPE ::= { ... } +Reg-SignalRequestPackage REG-EXT-ID-AND-TYPE ::= { ... } -Reg-SignalStatus REG-EXT-ID-AND-TYPE ::= { ... } +Reg-SignalStatus REG-EXT-ID-AND-TYPE ::= { ... } -Reg-SignalStatusMessage REG-EXT-ID-AND-TYPE ::= { ... } +Reg-SignalStatusMessage REG-EXT-ID-AND-TYPE ::= { ... } -Reg-SignalStatusPackage REG-EXT-ID-AND-TYPE ::= { - { SignalStatusPackage-addGrpC IDENTIFIED BY addGrpC} , - ... +Reg-SignalStatusPackage REG-EXT-ID-AND-TYPE ::= { + { SignalStatusPackage-addGrpC IDENTIFIED BY addGrpC }, + ... } -Reg-SPAT REG-EXT-ID-AND-TYPE ::= { ... } +Reg-SPAT REG-EXT-ID-AND-TYPE ::= { ... } END - - - diff --git a/asn1/IS/ISO_TS_19321/IVI.asn b/asn1/IS/ISO_TS_19321/IVI.asn index d9b3773c..0299d718 100644 --- a/asn1/IS/ISO_TS_19321/IVI.asn +++ b/asn1/IS/ISO_TS_19321/IVI.asn @@ -22,10 +22,15 @@ AxleWeightLimits, DieselEmissionValues, ExhaustEmissionValues, EngineCharacteris FROM EfcDsrcApplication {iso(1) standard(0) 14906 application(0) version5(5)} EuVehicleCategoryCode, Iso3833VehicleType -FROM ElectronicRegistrationIdentificationVehicleDataModule {iso(1) standard(0) iso24534 (24534) vehicleData (1) version (1)} +FROM ElectronicRegistrationIdentificationVehicleDataModule {iso(1) standard(0) iso24534 (24534) vehicleData (1) version1 (1)} + VarLengthNumber -FROM CITSapplMgmtIDs {iso(1) standard(0) cits-applMgmt (17419) ids (1) version1 (1)}; +FROM CITSapplMgmtIDs {iso(1) standard(0) cits-applMgmt (17419) ids (1) version1 (1)} + +; +-- End of IMPORTS + --Definition of IVI message to be send over the air is outside of the scope and given for information only: diff --git a/asn1/IS/ISO_TS_24534-3/ElectronicRegistrationIdentificationVehicleDataModule.asn b/asn1/IS/ISO_TS_24534-3/ElectronicRegistrationIdentificationVehicleDataModule.asn index f106babc..d097fd7c 100644 --- a/asn1/IS/ISO_TS_24534-3/ElectronicRegistrationIdentificationVehicleDataModule.asn +++ b/asn1/IS/ISO_TS_24534-3/ElectronicRegistrationIdentificationVehicleDataModule.asn @@ -1,86 +1,86 @@ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- ISO TS 24534-3:2015 --- --- This ASN.1 was generateds: 30.08.2016 --- --- This document contains only the data element needed for the encoding of an IVI message --- as defined in ISO TS 19321(2015) --- --- Published version location: --- http://standards.iso.org/iso/24534/-3/ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - --- ISO 24534-3:2015 --- Version 29.4.2015 - - -ElectronicRegistrationIdentificationVehicleDataModule {iso(1) standard(0) iso24534 (24534) vehicleData (1) version1 (1)} - - -DEFINITIONS AUTOMATIC TAGS ::= BEGIN -IMPORTS; - --- Electronic Registration Identification (ERI)- Vehicle Data - -EuVehicleCategoryCode ::= CHOICE { - euVehicleCategoryL EuVehicleCategoryL, -- conforms to EU 2002/24 and UNECE 1999 - euVehicleCategoryM EuVehicleCategoryM, -- conforms to EU 2001/116 and UNECE 1999 - euVehicleCategoryN EuVehicleCategoryN, -- conforms to EU 2001/116 and UNECE 1999 - euVehicleCategoryO EuVehicleCategoryO, -- conforms to EU 2001/116 and UNECE 1999 - euVehilcleCategoryT NULL, -- conforms to UNECE 1999 - euVehilcleCategoryG NULL -- conforms to EU 2001/116 and UNECE 1999 - } - -EuVehicleCategoryL ::= ENUMERATED { l1, l2, l3, l4, l5, l6, l7 } - -EuVehicleCategoryM ::= ENUMERATED {m1, m2, m3} - -EuVehicleCategoryN ::= ENUMERATED {n1, n2, n3} - -EuVehicleCategoryO ::= ENUMERATED {o1, o2, o3, o4} - -Iso3833VehicleType ::= INTEGER { - passengerCar (0), -- term No 3.1.1 - saloon (1), -- term No 3.1.1.1 (sedan) - convertibleSaloon (2), -- term No 3.1.1.2 - pullmanSaloon (3), -- term No 3.1.1.3 - stationWagon (4), -- term No 3.1.1.4 - truckStationWagon (5), -- term No 3.1.1.4.1 - coupe (6), -- term No 3.1.1.5 (coupé) - convertible (7), -- term No 3.1.1.6 (open tourer, roadstar, spider) - multipurposePassengerCar (8), -- term No 3.1.1.7 - forwardControlPassengerCar (9), -- term No 3.1.1.8 - specialPassengerCar (10), -- term No 3.1.1.9 - bus (11), -- term No 3.1.2 - minibus (12), -- term No 3.1.2.1 - urbanBus (13), -- term No 3.1.2.2 - interurbanCoach (14), -- term No 3.1.2.3 - longDistanceCoach (15), -- term No 3.1.2.4 - articulatedBus (16), -- term No 3.1.2.5 - trolleyBus (17), -- term No 3.1.2.6 - specialBus (18), -- term No 3.1.2.7 - commercialVehicle (19), -- term No 3.1.3 - specialCommercialVehicle (20), -- term No 3.1.3.1 - specialVehicle (21), -- term No 3.1.4 - trailingTowingVehicle (22), -- term No 3.1.5 (draw-bar tractor) - semiTrailerTowingVehicle (23), -- term No 3.1.6 (fifth wheel tractor) - trailer (24), -- term No 3.2.1 - busTrailer (25), -- term No 3.2.1.1 - generalPurposeTrailer (26), -- term No 3.2.1.2 - caravan (27), -- term No 3.2.1.3 - specialTrailer (28), -- term No 3.2.1.4 - semiTrailer (29), -- term No 3.2.2 - busSemiTrailer (30), -- term No 3.2.2.1 - generalPurposeSemiTrailer (31), -- term No 3.2.2.2 - specialSemiTrailer (32), -- term No 3.2.2.3 - roadTrain (33), -- term No 3.3.1 - passengerRoadTrain (34), -- term No 3.3.2 - articulatedRoadTrain (35), -- term No 3.3.3 - doubleRoadTrain (36), -- term No 3.3.4 - compositeRoadTrain (37), -- term No 3.3.5 - specialRoadTrain (38), -- term No 3.3.6 - moped (39), -- term No 3.4 - motorCycle (40) -- term No 3.5 - } (0..255) - -END +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- ISO TS 24534-3:2015 +-- +-- This ASN.1 was generateds: 30.08.2016 +-- +-- This document contains only the data element needed for the encoding of an IVI message +-- as defined in ISO TS 19321(2015) +-- +-- Published version location: +-- http://standards.iso.org/iso/24534/-3/ +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +-- ISO 24534-3:2015 +-- Version 29.4.2015 + + +ElectronicRegistrationIdentificationVehicleDataModule {iso(1) standard(0) iso24534 (24534) vehicleData (1) version1 (1)} + + +DEFINITIONS AUTOMATIC TAGS ::= BEGIN +IMPORTS; + +-- Electronic Registration Identification (ERI)- Vehicle Data + +EuVehicleCategoryCode ::= CHOICE { + euVehicleCategoryL EuVehicleCategoryL, -- conforms to EU 2002/24 and UNECE 1999 + euVehicleCategoryM EuVehicleCategoryM, -- conforms to EU 2001/116 and UNECE 1999 + euVehicleCategoryN EuVehicleCategoryN, -- conforms to EU 2001/116 and UNECE 1999 + euVehicleCategoryO EuVehicleCategoryO, -- conforms to EU 2001/116 and UNECE 1999 + euVehilcleCategoryT NULL, -- conforms to UNECE 1999 + euVehilcleCategoryG NULL -- conforms to EU 2001/116 and UNECE 1999 + } + +EuVehicleCategoryL ::= ENUMERATED { l1, l2, l3, l4, l5, l6, l7 } + +EuVehicleCategoryM ::= ENUMERATED {m1, m2, m3} + +EuVehicleCategoryN ::= ENUMERATED {n1, n2, n3} + +EuVehicleCategoryO ::= ENUMERATED {o1, o2, o3, o4} + +Iso3833VehicleType ::= INTEGER { + passengerCar (0), -- term No 3.1.1 + saloon (1), -- term No 3.1.1.1 (sedan) + convertibleSaloon (2), -- term No 3.1.1.2 + pullmanSaloon (3), -- term No 3.1.1.3 + stationWagon (4), -- term No 3.1.1.4 + truckStationWagon (5), -- term No 3.1.1.4.1 + coupe (6), -- term No 3.1.1.5 (coupé) + convertible (7), -- term No 3.1.1.6 (open tourer, roadstar, spider) + multipurposePassengerCar (8), -- term No 3.1.1.7 + forwardControlPassengerCar (9), -- term No 3.1.1.8 + specialPassengerCar (10), -- term No 3.1.1.9 + bus (11), -- term No 3.1.2 + minibus (12), -- term No 3.1.2.1 + urbanBus (13), -- term No 3.1.2.2 + interurbanCoach (14), -- term No 3.1.2.3 + longDistanceCoach (15), -- term No 3.1.2.4 + articulatedBus (16), -- term No 3.1.2.5 + trolleyBus (17), -- term No 3.1.2.6 + specialBus (18), -- term No 3.1.2.7 + commercialVehicle (19), -- term No 3.1.3 + specialCommercialVehicle (20), -- term No 3.1.3.1 + specialVehicle (21), -- term No 3.1.4 + trailingTowingVehicle (22), -- term No 3.1.5 (draw-bar tractor) + semiTrailerTowingVehicle (23), -- term No 3.1.6 (fifth wheel tractor) + trailer (24), -- term No 3.2.1 + busTrailer (25), -- term No 3.2.1.1 + generalPurposeTrailer (26), -- term No 3.2.1.2 + caravan (27), -- term No 3.2.1.3 + specialTrailer (28), -- term No 3.2.1.4 + semiTrailer (29), -- term No 3.2.2 + busSemiTrailer (30), -- term No 3.2.2.1 + generalPurposeSemiTrailer (31), -- term No 3.2.2.2 + specialSemiTrailer (32), -- term No 3.2.2.3 + roadTrain (33), -- term No 3.3.1 + passengerRoadTrain (34), -- term No 3.3.2 + articulatedRoadTrain (35), -- term No 3.3.3 + doubleRoadTrain (36), -- term No 3.3.4 + compositeRoadTrain (37), -- term No 3.3.5 + specialRoadTrain (38), -- term No 3.3.6 + moped (39), -- term No 3.4 + motorCycle (40) -- term No 3.5 + } (0..255) + +END diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn index bc975dda..4a43ebb5 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn @@ -656,7 +656,7 @@ module LibItsMapemSpatem_Templates { template (omit) AdvisorySpeed m_advisorySpeed( in template (value) AdvisorySpeedType p_type, in template (omit) SpeedAdvice p_speed := omit, - in template (omit) SpeedConfidence p_confidence := omit, + in template (omit) SpeedConfidenceDSRC p_confidence := omit, in template (omit) ZoneLength p_distance := omit, in template (omit) RestrictionClassID p_class := omit ) := { diff --git a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn index 7914f206..22e69d8b 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn @@ -20,6 +20,7 @@ module LibItsSremSsem_Templates { import from SREM_PDU_Descriptions language "ASN.1:1997" all; import from SSEM_PDU_Descriptions language "ASN.1:1997" all; import from DSRC language "ASN.1:1997" all; + import from DSRC_REGION_noCircular language "ASN.1:1997" all; // LibItsCommon import from LibItsCommon_TypesAndValues all; -- GitLab From 5732daf61719d7a32e3e456a1f0534e6f0659095 Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 7 May 2019 00:33:13 -0700 Subject: [PATCH 201/320] Add JSON support for STF569_MEC --- ttcn/Http/LibItsHttp_JSONTypes.ttcn | 9 ++++++ .../Http/LibItsHttp_JsonMessageBodyTypes.ttcn | 18 +++++++++++ ttcn/Http/LibItsHttp_JsonTemplates.ttcn | 31 +++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 ttcn/Http/LibItsHttp_JSONTypes.ttcn create mode 100644 ttcn/Http/LibItsHttp_JsonMessageBodyTypes.ttcn create mode 100644 ttcn/Http/LibItsHttp_JsonTemplates.ttcn diff --git a/ttcn/Http/LibItsHttp_JSONTypes.ttcn b/ttcn/Http/LibItsHttp_JSONTypes.ttcn new file mode 100644 index 00000000..4760f2f8 --- /dev/null +++ b/ttcn/Http/LibItsHttp_JSONTypes.ttcn @@ -0,0 +1,9 @@ +module LibItsHttp_JSONTypes { // FIXME To be removed + + /** + * This file is volontary empry. You have to declare all XSD files required by your project + * In addition, the TTCN-3 module LibItsHttp_XmlMessageBodyTypes have to be updated too. + */ + // TODO Add here your custom RFCs import + +} // End of module LibItsHttp_JSONTypes diff --git a/ttcn/Http/LibItsHttp_JsonMessageBodyTypes.ttcn b/ttcn/Http/LibItsHttp_JsonMessageBodyTypes.ttcn new file mode 100644 index 00000000..0551f926 --- /dev/null +++ b/ttcn/Http/LibItsHttp_JsonMessageBodyTypes.ttcn @@ -0,0 +1,18 @@ +module LibItsHttp_JsonMessageBodyTypes { + + /** + * This file volontary contains a trivial declaration of the type JsonBody. + * In accordance with your TTCN-3 module LibItsHttp_JSONTypes, you have to change the JsonBody typing. + */ + // TODO Add here your custom RFCs import + + type union JsonBody { + // TODO Add here your custom variants + universal charstring raw + } with { + variant "" + } + +} with { + variant "" +} // End of module LibItsHttp_JsonMessageBodyTypes diff --git a/ttcn/Http/LibItsHttp_JsonTemplates.ttcn b/ttcn/Http/LibItsHttp_JsonTemplates.ttcn new file mode 100644 index 00000000..4b31b78f --- /dev/null +++ b/ttcn/Http/LibItsHttp_JsonTemplates.ttcn @@ -0,0 +1,31 @@ +/** + * @author ETSI / STF569 + * @version $URL$ + * $ID:$ + * @desc This module provides the custom templates for ITS HTTP based protocols. + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + */ +module LibItsHttp_JsonTemplates { + + // TODO Add here your custom RFCs import + + // LibItsHttp + import from LibItsHttp_JsonMessageBodyTypes all; + import from LibItsHttp_XMLTypes all; + + template (value) JsonBody m_json_body_raw( + in template (value) charstring p_raw + ) := { + raw := p_raw + } // End of template m_json_body_raw + + template (present) JsonBody mw_json_body_raw( + template (present) charstring p_raw := ? + ) := { + raw := p_raw + } // End of template mw_json_body_raw + +} // End of module LibItsHttp_JsonTemplates -- GitLab From 8d871a9aa3ee9e8bb3e8bd0d399a35c09daae58b Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 7 May 2019 00:35:41 -0700 Subject: [PATCH 202/320] Add JSON support for STF569_MEC --- ttcn/Http/LibItsHttp_MessageBodyTypes.ttcn | 2 ++ ttcn/Http/LibItsHttp_Templates.ttcn | 17 +++++++++++++++++ ttcn/Http/LibItsHttp_TypesAndValues.ttcn | 1 - ttcn/Http/LibItsHttp_XmlMessageBodyTypes.ttcn | 2 +- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ttcn/Http/LibItsHttp_MessageBodyTypes.ttcn b/ttcn/Http/LibItsHttp_MessageBodyTypes.ttcn index 20907516..dfe0997b 100644 --- a/ttcn/Http/LibItsHttp_MessageBodyTypes.ttcn +++ b/ttcn/Http/LibItsHttp_MessageBodyTypes.ttcn @@ -2,6 +2,7 @@ module LibItsHttp_MessageBodyTypes { // LibHttp import from LibItsHttp_XmlMessageBodyTypes all; + import from LibItsHttp_JsonMessageBodyTypes all; import from LibItsHttp_BinaryMessageBodyTypes all; type charstring HtmlBody; @@ -12,6 +13,7 @@ module LibItsHttp_MessageBodyTypes { BinaryBody binary_body, HtmlBody html_body, XmlBody xml_body, + JsonBody json_body, TextBody text_body } with { variant "" diff --git a/ttcn/Http/LibItsHttp_Templates.ttcn b/ttcn/Http/LibItsHttp_Templates.ttcn index c647b882..347879a2 100644 --- a/ttcn/Http/LibItsHttp_Templates.ttcn +++ b/ttcn/Http/LibItsHttp_Templates.ttcn @@ -15,6 +15,7 @@ module LibItsHttp_Templates { import from LibItsHttp_TypesAndValues all; import from LibItsHttp_MessageBodyTypes all; import from LibItsHttp_XmlMessageBodyTypes all; + import from LibItsHttp_JsonMessageBodyTypes all; import from LibItsHttp_BinaryMessageBodyTypes all; group http_messages { @@ -178,6 +179,22 @@ module LibItsHttp_Templates { } // End of group http_xml_body + group http_json_body { + + template (value) HttpMessageBody m_http_message_body_json( + in template (value) JsonBody p_json_body + ) := { + json_body := p_json_body + } // End of template m_http_message_body_json + + template (present) HttpMessageBody mw_http_message_body_json( + template (present) JsonBody p_json_body := ? + ) := { + json_body := p_json_body + } // End of template mw_http_message_body_json + + } // End of group http_json_body + group http_binary_body { template (value) HttpMessageBody m_http_message_body_binary( diff --git a/ttcn/Http/LibItsHttp_TypesAndValues.ttcn b/ttcn/Http/LibItsHttp_TypesAndValues.ttcn index 45fe18a5..69f7dac5 100644 --- a/ttcn/Http/LibItsHttp_TypesAndValues.ttcn +++ b/ttcn/Http/LibItsHttp_TypesAndValues.ttcn @@ -13,7 +13,6 @@ module LibItsHttp_TypesAndValues { // LibHttp import from LibItsHttp_MessageBodyTypes all; - import from LibItsHttp_XmlMessageBodyTypes all; import from LibItsHttp_Pics all; const charstring c_header_host := "Host"; diff --git a/ttcn/Http/LibItsHttp_XmlMessageBodyTypes.ttcn b/ttcn/Http/LibItsHttp_XmlMessageBodyTypes.ttcn index b839918a..e5a26724 100644 --- a/ttcn/Http/LibItsHttp_XmlMessageBodyTypes.ttcn +++ b/ttcn/Http/LibItsHttp_XmlMessageBodyTypes.ttcn @@ -1,7 +1,7 @@ module LibItsHttp_XmlMessageBodyTypes { /** - * This file volontary contains a trivial declaration of the type XmlBodu. + * This file volontary contains a trivial declaration of the type XmlBody. * In accordance with your TTCN-3 module LibItsHttp_XMLTypes, you have to change the XmlBody typing. */ // TODO Add here your custom RFCs import -- GitLab From 4c79dd3fe0dd4559d6481b635fe29d684d342b17 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Thu, 20 Jun 2019 02:47:53 -0700 Subject: [PATCH 203/320] Enhance templates --- ttcn/Http/LibItsHttp_Templates.ttcn | 26 +++++++++++++++++++++++- ttcn/Http/LibItsHttp_TypesAndValues.ttcn | 1 + 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/ttcn/Http/LibItsHttp_Templates.ttcn b/ttcn/Http/LibItsHttp_Templates.ttcn index c0fcf6c7..767952dc 100644 --- a/ttcn/Http/LibItsHttp_Templates.ttcn +++ b/ttcn/Http/LibItsHttp_Templates.ttcn @@ -127,6 +127,14 @@ module LibItsHttp_Templates { body := p_body } // End of template mw_http_response_ok + template (present) Response mw_http_response_201_created( + template (present) HttpMessageBody p_body := ?, + template (present) HeaderLines p_header := ? + ) modifies mw_http_response_ok := { + statuscode := 201, + statustext := ?//"Created", + } // End of template mw_http_response_ok + template (value) Response m_http_response_ko( in template (value) HttpMessageBody p_body, in template (value) HeaderLines p_header, @@ -166,13 +174,29 @@ module LibItsHttp_Templates { body := p_body } // End of template mw_http_response_ko + template Response mw_http_response_400_bad_request( + template HttpMessageBody p_body := *, + template (present) HeaderLines p_header := ? + ) modifies mw_http_response_ko := { + statuscode := 400, + statustext := ? // TODO Add pattern for not found + } // End of template mw_http_response_400_bad_request + + template Response mw_http_response_403_forbidden( + template HttpMessageBody p_body := *, + template (present) HeaderLines p_header := ? + ) modifies mw_http_response_ko := { + statuscode := 403, + statustext := ? // TODO Add pattern for not found + } // End of template mw_http_response_404_not_found + template Response mw_http_response_404_not_found( template HttpMessageBody p_body := *, template (present) HeaderLines p_header := ? ) modifies mw_http_response_ko := { statuscode := 404, statustext := ? // TODO Add pattern for not found - } // End of template mw_http_response_ok + } // End of template mw_http_response_404_not_found } // End of group http_responses diff --git a/ttcn/Http/LibItsHttp_TypesAndValues.ttcn b/ttcn/Http/LibItsHttp_TypesAndValues.ttcn index 69f7dac5..0142bce2 100644 --- a/ttcn/Http/LibItsHttp_TypesAndValues.ttcn +++ b/ttcn/Http/LibItsHttp_TypesAndValues.ttcn @@ -23,6 +23,7 @@ module LibItsHttp_TypesAndValues { const charstring c_header_connection := "Connection"; const charstring c_header_pragma := "Pragma"; const charstring c_header_cache_control := "Cache-Control"; + const charstring c_header_authorization := "Authorization"; const integer c_http_version_major := PICS_HTTP_VERSION_MAJOR; const integer c_http_version_minor := PICS_HTTP_VERSION_MINOR; -- GitLab From 11218bf3a5e87a0823b57906542dfd4310061f84 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Tue, 2 Jul 2019 22:28:18 -0700 Subject: [PATCH 204/320] Remove circular import --- ttcn/IVIM/LibItsIvim_Functions.ttcn | 16 ---------------- ttcn/IVIM/LibItsIvim_Templates.ttcn | 18 +++++++++++++++++- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/ttcn/IVIM/LibItsIvim_Functions.ttcn b/ttcn/IVIM/LibItsIvim_Functions.ttcn index af933c60..5ce007a5 100644 --- a/ttcn/IVIM/LibItsIvim_Functions.ttcn +++ b/ttcn/IVIM/LibItsIvim_Functions.ttcn @@ -36,22 +36,6 @@ module LibItsIvim_Functions { import from LibItsIvim_Pics all; import from LibItsIvim_Pixits all; - group itsFunction { - - /** - * @desc Gets the Provifr of test system - * @return Test system's Provider value - * @see PX_PROVIDER - */ - function f_getProvider() - return Provider { - - return PX_PROVIDER; - - } // End of function f_getProvider - - } // End of group itsFunction - group utFuntions { /** diff --git a/ttcn/IVIM/LibItsIvim_Templates.ttcn b/ttcn/IVIM/LibItsIvim_Templates.ttcn index 1f5bdfce..bbca477b 100644 --- a/ttcn/IVIM/LibItsIvim_Templates.ttcn +++ b/ttcn/IVIM/LibItsIvim_Templates.ttcn @@ -31,7 +31,7 @@ module LibItsIvim_Templates { // LibItsIvim import from LibItsIvim_TestSystem all; import from LibItsIvim_TypesAndValues all; - import from LibItsIvim_Functions all; + import from LibItsIvim_Pixits all; import from LibItsIvim_ASN1_IVInamedNumbers all; group asn1Constants { @@ -597,4 +597,20 @@ module LibItsIvim_Templates { } // End of group roadConfigurationContainerGroup + group itsFunction { + + /** + * @desc Gets the Provifr of test system + * @return Test system's Provider value + * @see PX_PROVIDER + */ + function f_getProvider() + return Provider { + + return PX_PROVIDER; + + } // End of function f_getProvider + + } // End of group itsFunction + } // End of module LibItsIvimTemplates -- GitLab From acec63bf8091dd766ef41085b99128eecf54b8f0 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Thu, 11 Jul 2019 01:03:00 -0700 Subject: [PATCH 205/320] Add missing templates --- ttcn/Http/LibItsHttp_Templates.ttcn | 71 +++++++++++++++++++++-------- 1 file changed, 53 insertions(+), 18 deletions(-) diff --git a/ttcn/Http/LibItsHttp_Templates.ttcn b/ttcn/Http/LibItsHttp_Templates.ttcn index 767952dc..609e02e5 100644 --- a/ttcn/Http/LibItsHttp_Templates.ttcn +++ b/ttcn/Http/LibItsHttp_Templates.ttcn @@ -73,30 +73,49 @@ module LibItsHttp_Templates { body := p_body } // End of template m_http_request_get - template (omit) Request m_http_request_post( - in charstring p_uri, - in template (value) HeaderLines p_headers, - in template (omit) HttpMessageBody p_body := omit + template Request mw_http_request_get( + template (present) charstring p_uri := ?, + template (present) HeaderLines p_headers := ?, + template HttpMessageBody p_body := * ) := { - method := "POST", + method := "GET", uri := p_uri, version_major := c_http_version_major, version_minor := c_http_version_minor, header := p_headers, body := p_body + } // End of template mw_http_request_get + + template (omit) Request m_http_request_post( + in charstring p_uri, + in template (value) HeaderLines p_headers, + in template (omit) HttpMessageBody p_body := omit + ) modifies m_http_request_get := { + method := "POST" } // End of template m_http_request_post template Request mw_http_request_post( template (present) charstring p_uri := ?, template (present) HeaderLines p_headers := ?, template HttpMessageBody p_body := * - ) := { - method := "POST", - uri := p_uri, - version_major := c_http_version_major, - version_minor := c_http_version_minor, - header := p_headers, - body := p_body + ) modifies mw_http_request_get := { + method := "POST" + } // End of template mw_http_request_post + + template (omit) Request m_http_request_delete( + in charstring p_uri, + in template (value) HeaderLines p_headers, + in template (omit) HttpMessageBody p_body := omit + ) modifies m_http_request_get := { + method := "DELETE" + } // End of template m_http_request_delete + + template Request mw_http_request_delete( + template (present) charstring p_uri := ?, + template (present) HeaderLines p_headers := ?, + template HttpMessageBody p_body := * + ) modifies mw_http_request_get := { + method := "DELETE" } // End of template mw_http_request_post } // End of group http_requests @@ -122,7 +141,7 @@ module LibItsHttp_Templates { version_major := 1, version_minor := 1, statuscode := 200, - statustext := ?,//"OK", + statustext := "OK", header := p_header, body := p_body } // End of template mw_http_response_ok @@ -132,7 +151,15 @@ module LibItsHttp_Templates { template (present) HeaderLines p_header := ? ) modifies mw_http_response_ok := { statuscode := 201, - statustext := ?//"Created", + statustext := "Created" + } // End of template mw_http_response_ok + + template (present) Response mw_http_response_204_no_content( + template (present) HttpMessageBody p_body := ?, + template (present) HeaderLines p_header := ? + ) modifies mw_http_response_ok := { + statuscode := 204, + statustext := "No Content" } // End of template mw_http_response_ok template (value) Response m_http_response_ko( @@ -179,7 +206,7 @@ module LibItsHttp_Templates { template (present) HeaderLines p_header := ? ) modifies mw_http_response_ko := { statuscode := 400, - statustext := ? // TODO Add pattern for not found + statustext := "Bad Request" } // End of template mw_http_response_400_bad_request template Response mw_http_response_403_forbidden( @@ -187,17 +214,25 @@ module LibItsHttp_Templates { template (present) HeaderLines p_header := ? ) modifies mw_http_response_ko := { statuscode := 403, - statustext := ? // TODO Add pattern for not found - } // End of template mw_http_response_404_not_found + statustext := "Forbidden" + } // End of template mw_http_response_403_forbidden template Response mw_http_response_404_not_found( template HttpMessageBody p_body := *, template (present) HeaderLines p_header := ? ) modifies mw_http_response_ko := { statuscode := 404, - statustext := ? // TODO Add pattern for not found + statustext := "Not Found" } // End of template mw_http_response_404_not_found + template Response mw_http_response_412_precondition_failed( + template HttpMessageBody p_body := *, + template (present) HeaderLines p_header := ? + ) modifies mw_http_response_ko := { + statuscode := 412, + statustext := "Precondition Failed" + } // End of template mw_http_response_412_not_found + } // End of group http_responses group http_xml_body { -- GitLab From 806e133118639e261fc589daeffb078559ca605c Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Thu, 11 Jul 2019 01:04:03 -0700 Subject: [PATCH 206/320] Add missimg headers --- ttcn/Http/LibItsHttp_Functions.ttcn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ttcn/Http/LibItsHttp_Functions.ttcn b/ttcn/Http/LibItsHttp_Functions.ttcn index b480f399..b019a0c6 100644 --- a/ttcn/Http/LibItsHttp_Functions.ttcn +++ b/ttcn/Http/LibItsHttp_Functions.ttcn @@ -65,6 +65,8 @@ module LibItsHttp_Functions { p_headers[v_i] := { c_header_pragma, { "no-cache" } }; v_i := v_i + 1; p_headers[v_i] := { c_header_cache_control, { "no-cache" } }; + v_i := v_i + 1; + p_headers[v_i] := { c_header_authorization, { "Basic YWxhZGRpbjpvcGVuc2VzYW1l" } }; //v_i := v_i + 1; //p_headers[v_i] := { c_header_accept, { "application/x-its-response" } }; } // End of function f_init_default_headers_list -- GitLab From 767200b2a309e674bfa3c843d39634b3c5b0814d Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Wed, 7 Aug 2019 23:34:50 -0700 Subject: [PATCH 207/320] Fix Issue: Errors because of removing trailing 0A and 0D bytes from HTTP responses --- ttcn/Pki/LibItsPki_Functions.ttcn | 33 ++++++++++++++++--------------- ttcn/Pki/LibItsPki_Templates.ttcn | 31 +++++++++++++++++++++-------- 2 files changed, 40 insertions(+), 24 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index fa2fe2c1..0105222e 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -1574,22 +1574,23 @@ module LibItsPki_Functions { m_publicKeys( m_publicVerificationKey_ecdsaNistP256(v_eccP256_curve_point) ), - m_certificateSubjectAttributes( - { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs - valueof(m_appPermissions(c_its_aid_SCR, { bitmapSsp := '01C0'O })) - }, - m_validityPeriod( - f_getCurrentTime() / 1000, - m_duration_in_hours(120) // TODO Use PIXIT - ), - m_geographicRegion_identifiedRegion( - { - m_identifiedRegion_country_only(250), // TODO Use PIXIT - m_identifiedRegion_country_only(380) // TODO Use PIXIT - } - ), - '00'O // TODO Use PIXIT - ) + m_certificateSubjectAttributes_id_name( + oct2char(PICS_ITS_S_CANONICAL_ID), + { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs + valueof(m_appPermissions(c_its_aid_SCR, { bitmapSsp := '01C0'O })) + }, + m_validityPeriod( + f_getCurrentTime() / 1000, + m_duration_in_hours(120) // TODO Use PIXIT + ), + m_geographicRegion_identifiedRegion( + { + m_identifiedRegion_country_only(250), // TODO Use PIXIT + m_identifiedRegion_country_only(380) // TODO Use PIXIT + } + ), + '00'O // TODO Use PIXIT + ) ) ); if (PICS_SECPKI_REENROLMENT) { // This is a re-enrolment, the identifier of its current valid Enrolment Credential diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn index 87f98297..29931a67 100644 --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ b/ttcn/Pki/LibItsPki_Templates.ttcn @@ -258,19 +258,34 @@ module LibItsPki_Templates { encryptionKey := p_encryptionKey } // End of template mw_publicKeys - template (omit) CertificateSubjectAttributes m_certificateSubjectAttributes( - in template (value) SequenceOfPsidSsp p_appPermissions, - in template (omit) ValidityPeriod p_validityPeriod := omit, - in template (omit) GeographicRegion p_region := omit, - in template (omit) SubjectAssurance p_assuranceLevel := omit - ) := { - id := { none_ := NULL }, + template (omit) CertificateSubjectAttributes m_certificateSubjectAttributes_id_none( + in template (value) SequenceOfPsidSsp p_appPermissions, + in template (omit) ValidityPeriod p_validityPeriod := omit, + in template (omit) GeographicRegion p_region := omit, + in template (omit) SubjectAssurance p_assuranceLevel := omit + ) := { + id := { none_ := NULL }, + validityPeriod := p_validityPeriod, + region := p_region, + assuranceLevel := p_assuranceLevel, + appPermissions := p_appPermissions, + certIssuePermissions := omit + } // End of template m_certificateSubjectAttributes_id_none + + template (omit) CertificateSubjectAttributes m_certificateSubjectAttributes_id_name( + in template (value) Hostname p_name, + in template (value) SequenceOfPsidSsp p_appPermissions, + in template (omit) ValidityPeriod p_validityPeriod := omit, + in template (omit) GeographicRegion p_region := omit, + in template (omit) SubjectAssurance p_assuranceLevel := omit + ) := { + id := { name := p_name }, validityPeriod := p_validityPeriod, region := p_region, assuranceLevel := p_assuranceLevel, appPermissions := p_appPermissions, certIssuePermissions := omit - } // End of template m_certificateSubjectAttributes + } // End of template m_certificateSubjectAttributes_id_name template (value) InnerEcResponse m_innerEcResponse_ok( in template (value) Oct16 p_requestHash, -- GitLab From feee788b2dd1e9ed84c426ddbb9ef9846243dc0a Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Fri, 9 Aug 2019 00:58:03 -0700 Subject: [PATCH 208/320] Fix Issue: Add log to fix issue TC_GEONW_PON_SQN_BV_01 invalid speed --- ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn index 061b8e75..d3cd256a 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn @@ -1763,6 +1763,8 @@ module LibItsGeoNetworking_Templates { } function f_getDelta15(Int32 p_value, integer p_delta) return template (present) Int15 { + log(">>> f_getDelta15: ", p_value, ", ", p_delta); // FIXME To be removed when issue https://forge.etsi.org/rep/ITS/ITS/issues/13 will be clause + if (p_value == c_int15Min) { return (p_value .. p_value+p_delta); } -- GitLab From a6f53711a168921b93d59a0e95c8b0585fc75506 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Fri, 9 Aug 2019 02:36:26 -0700 Subject: [PATCH 209/320] Add template for HTTP PUT method --- ttcn/Http/LibItsHttp_Templates.ttcn | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ttcn/Http/LibItsHttp_Templates.ttcn b/ttcn/Http/LibItsHttp_Templates.ttcn index 609e02e5..951198c6 100644 --- a/ttcn/Http/LibItsHttp_Templates.ttcn +++ b/ttcn/Http/LibItsHttp_Templates.ttcn @@ -102,6 +102,22 @@ module LibItsHttp_Templates { method := "POST" } // End of template mw_http_request_post + template (omit) Request m_http_request_put( + in charstring p_uri, + in template (value) HeaderLines p_headers, + in template (omit) HttpMessageBody p_body := omit + ) modifies m_http_request_get := { + method := "PUT" + } // End of template m_http_request_put + + template Request mw_http_request_put( + template (present) charstring p_uri := ?, + template (present) HeaderLines p_headers := ?, + template HttpMessageBody p_body := * + ) modifies mw_http_request_get := { + method := "PUT" + } // End of template mw_http_request_put + template (omit) Request m_http_request_delete( in charstring p_uri, in template (value) HeaderLines p_headers, -- GitLab From fa803fc714e8896de7ce12d0ecec822b5e8949dc Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Tue, 20 Aug 2019 01:06:36 -0700 Subject: [PATCH 210/320] Add RnisNotifications support --- ttcn/Http/LibItsHttp_Templates.ttcn | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ttcn/Http/LibItsHttp_Templates.ttcn b/ttcn/Http/LibItsHttp_Templates.ttcn index 951198c6..fccdafdd 100644 --- a/ttcn/Http/LibItsHttp_Templates.ttcn +++ b/ttcn/Http/LibItsHttp_Templates.ttcn @@ -150,6 +150,24 @@ module LibItsHttp_Templates { body := p_body } // End of template m_http_response_ok + template (value) Response m_http_response_ok_no_body( + in template (value) HeaderLines p_header + ) := { + version_major := 1, + version_minor := 1, + statuscode := 200, + statustext := "OK", + header := p_header, + body := omit + } // End of template m_http_response_ok_no_body + + template (value) Response m_http_response_204_no_content( + in template (value) HeaderLines p_header + ) modifies m_http_response_ok_no_body := { + statuscode := 204, + statustext := "No Content" + } // End of template m_http_response_204_no_content + template (present) Response mw_http_response_ok( template (present) HttpMessageBody p_body := ?, template (present) HeaderLines p_header := ? -- GitLab From 8b156c8b0781f511dc4444742ee2eed9818aa865 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Mon, 23 Sep 2019 00:17:22 -0700 Subject: [PATCH 211/320] Add 202 Accepted receive template --- ttcn/Http/LibItsHttp_Templates.ttcn | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ttcn/Http/LibItsHttp_Templates.ttcn b/ttcn/Http/LibItsHttp_Templates.ttcn index fccdafdd..8a5ec058 100644 --- a/ttcn/Http/LibItsHttp_Templates.ttcn +++ b/ttcn/Http/LibItsHttp_Templates.ttcn @@ -175,7 +175,7 @@ module LibItsHttp_Templates { version_major := 1, version_minor := 1, statuscode := 200, - statustext := "OK", + statustext := ?, header := p_header, body := p_body } // End of template mw_http_response_ok @@ -188,6 +188,14 @@ module LibItsHttp_Templates { statustext := "Created" } // End of template mw_http_response_ok + template (present) Response mw_http_response_202_accepted( + template (present) HttpMessageBody p_body := ?, + template (present) HeaderLines p_header := ? + ) modifies mw_http_response_ok := { + statuscode := 202, + statustext := "Accepted" + } // End of template mw_http_response_ok + template (present) Response mw_http_response_204_no_content( template (present) HttpMessageBody p_body := ?, template (present) HeaderLines p_header := ? -- GitLab From 25c8a9e788ccd0fb17ef38dbf12b1a7e9a6c0085 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Fri, 27 Sep 2019 06:50:35 -0700 Subject: [PATCH 212/320] Enhance TOKEN HTTP header support --- ttcn/Http/LibItsHttp_Functions.ttcn | 6 ++++-- ttcn/Http/LibItsHttp_Pics.ttcn | 11 +++++++++++ ttcn/Http/LibItsHttp_Templates.ttcn | 8 ++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/ttcn/Http/LibItsHttp_Functions.ttcn b/ttcn/Http/LibItsHttp_Functions.ttcn index b019a0c6..80242369 100644 --- a/ttcn/Http/LibItsHttp_Functions.ttcn +++ b/ttcn/Http/LibItsHttp_Functions.ttcn @@ -66,8 +66,10 @@ module LibItsHttp_Functions { v_i := v_i + 1; p_headers[v_i] := { c_header_cache_control, { "no-cache" } }; v_i := v_i + 1; - p_headers[v_i] := { c_header_authorization, { "Basic YWxhZGRpbjpvcGVuc2VzYW1l" } }; - //v_i := v_i + 1; + if (PICS_USE_TOKEN_HEADER) { + p_headers[v_i] := { c_header_authorization, { PICS_TOKEN_HEADER } }; // aladdin:opensesame + v_i := v_i + 1; + } //p_headers[v_i] := { c_header_accept, { "application/x-its-response" } }; } // End of function f_init_default_headers_list diff --git a/ttcn/Http/LibItsHttp_Pics.ttcn b/ttcn/Http/LibItsHttp_Pics.ttcn index fdbb6b3c..922a8bc7 100644 --- a/ttcn/Http/LibItsHttp_Pics.ttcn +++ b/ttcn/Http/LibItsHttp_Pics.ttcn @@ -20,4 +20,15 @@ module LibItsHttp_Pics { */ modulepar charstring PICS_HEADER_CONTENT_TYPE := "application/x-its-request"; + /** + * @desc Set to false in TOKEN header shall not be used + */ + modulepar boolean PICS_USE_TOKEN_HEADER := true; + + /** + * @desc HTTP TOKEN value + * "YWxhZGRpbjpvcGVuc2VzYW1l==" is the base64 encoding of the login:password "aladdin:opensesame" + */ + modulepar charstring PICS_TOKEN_HEADER := "Basic " & "YWxhZGRpbjpvcGVuc2VzYW1l==" ; // aladdin:opensesame + } // End of module LibItsHttp_Pics diff --git a/ttcn/Http/LibItsHttp_Templates.ttcn b/ttcn/Http/LibItsHttp_Templates.ttcn index 8a5ec058..6e73acaf 100644 --- a/ttcn/Http/LibItsHttp_Templates.ttcn +++ b/ttcn/Http/LibItsHttp_Templates.ttcn @@ -251,6 +251,14 @@ module LibItsHttp_Templates { statustext := "Bad Request" } // End of template mw_http_response_400_bad_request + template Response mw_http_response_401_unauthorized( + template HttpMessageBody p_body := *, + template (present) HeaderLines p_header := ? + ) modifies mw_http_response_ko := { + statuscode := 401, + statustext := "Unauthorized" + } // End of template mw_http_response_401_unauthorized + template Response mw_http_response_403_forbidden( template HttpMessageBody p_body := *, template (present) HeaderLines p_header := ? -- GitLab From 8cf688e69fe05aaaaadf275a43a6dc77cebbadf6 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Tue, 1 Oct 2019 06:04:53 -0700 Subject: [PATCH 213/320] Implement additional BI test purposes proposal --- .../LibItsGeoNetworking_Templates.ttcn | 2 +- ttcn/Http/LibItsHttp_Templates.ttcn | 2 +- ttcn/Pki/LibItsPki_Functions.ttcn | 570 ++++++++++++------ ttcn/Pki/LibItsPki_Pics.ttcn | 41 +- ttcn/Pki/LibItsPki_Pixits.ttcn | 17 +- ttcn/Pki/LibItsPki_Templates.ttcn | 4 +- ttcn/Security/LibItsSecurity_Pixits.ttcn | 10 +- ttcn/Security/LibItsSecurity_Templates.ttcn | 9 + 8 files changed, 460 insertions(+), 195 deletions(-) diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn index d3cd256a..6da7130d 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn @@ -1763,7 +1763,7 @@ module LibItsGeoNetworking_Templates { } function f_getDelta15(Int32 p_value, integer p_delta) return template (present) Int15 { - log(">>> f_getDelta15: ", p_value, ", ", p_delta); // FIXME To be removed when issue https://forge.etsi.org/rep/ITS/ITS/issues/13 will be clause + log(">>> f_getDelta15: ", p_value, ", ", p_delta); if (p_value == c_int15Min) { return (p_value .. p_value+p_delta); diff --git a/ttcn/Http/LibItsHttp_Templates.ttcn b/ttcn/Http/LibItsHttp_Templates.ttcn index 609e02e5..3fb8312e 100644 --- a/ttcn/Http/LibItsHttp_Templates.ttcn +++ b/ttcn/Http/LibItsHttp_Templates.ttcn @@ -141,7 +141,7 @@ module LibItsHttp_Templates { version_major := 1, version_minor := 1, statuscode := 200, - statustext := "OK", + statustext := ?, header := p_header, body := p_body } // End of template mw_http_response_ok diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 0105222e..5c0fe41b 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -599,12 +599,12 @@ module LibItsPki_Functions { log("f_http_build_inner_ec_request: Public encryption key comp: ", v_compressed_enc_key_mode); p_salt := vc_eaWholeHash; if (PICS_SECPKI_REENROLMENT == false) { // This is the first enrolment, we used Factory keys - v_result := f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); + v_result := f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } else { // We use last valid EC certificate // TODO Retrieve EC certificate from the first enrolment instead of PX log("f_http_build_inner_ec_request: v_ec_private_key: ", PX_EC_PRIVATE_KEY); log("f_http_build_inner_ec_request: v_ec_hashed_id8: ", PX_EC_HASHED_ID8); - v_result := f_build_pki_secured_request_message_signed_with_pop(PX_EC_PRIVATE_KEY, valueof(m_signerIdentifier_digest(PX_EC_HASHED_ID8)), PX_EC_HASHED_ID8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); + v_result := f_build_pki_secured_request_message_signed_with_pop(PX_EC_PRIVATE_KEY, valueof(m_signerIdentifier_digest(PX_EC_HASHED_ID8)), PX_EC_HASHED_ID8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } if (v_result == false) { log("*** f_http_build_inner_ec_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); @@ -615,6 +615,73 @@ module LibItsPki_Functions { } } // End of function f_http_build_inner_ec_request + function f_http_build_inner_ec_request_with_wrong_parameters( // TODO Cleanup parameters + in SequenceOfPsidSsp p_appPermissions, + in octetstring p_canonical_id := PICS_ITS_S_CANONICAL_ID, + in Time32 p_start, + in Duration p_duration, + in boolean p_alter_private_key := false, + out octetstring p_private_key, + out octetstring p_public_key_compressed, + out integer p_compressed_mode, + out Oct16 p_aes_sym_key, + out Oct16 p_encrypted_sym_key, + out Oct16 p_authentication_vector, + out Oct12 p_nonce, + out octetstring p_salt, + out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, + out Oct32 p_request_hash + ) runs on ItsPkiHttp { + var InnerEcRequest v_inner_ec_request; + var Ieee1609Dot2Data v_inner_ec_request_signed_for_pop; + var octetstring v_public_enc_key; + var integer v_compressed_enc_key_mode; + var boolean v_result; + + log(">>> f_http_build_inner_ec_request_with_wrong_parameters"); + if (f_generate_inner_ec_request_with_wrong_parameters(p_appPermissions, p_canonical_id, p_start, p_duration, p_alter_private_key, p_private_key, p_public_key_compressed, p_compressed_mode, v_inner_ec_request) == false) { + log("*** f_http_build_inner_ec_request_with_wrong_parameters: ERROR: Failed to generate InnerEcRequest ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + log ("f_http_build_enrolment_request: ==> EC verification private key: ", p_private_key); + log ("f_http_build_enrolment_request: ==> EC verification public compressed key: ", p_public_key_compressed); + log ("f_http_build_enrolment_request: ==> EC verification public compressed mode: ", p_compressed_mode); + // Generate InnerEcRequestSignedForPoP + if (f_generate_inner_ec_request_signed_for_pop(p_private_key, v_inner_ec_request, v_inner_ec_request_signed_for_pop) == false) { + log("*** f_http_build_inner_ec_request_with_wrong_parameters: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + log("f_http_build_enrolment_request: v_inner_ec_request_signed_for_pop= ", v_inner_ec_request_signed_for_pop); + + // Secure InnerEcRequestSignedForPoP message + if (f_extract_enc_key(vc_eaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { + log("*** f_http_build_inner_ec_request_with_wrong_parameters: ERROR: Non canonical EA certificate ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + if (PICS_SEC_FIXED_KEYS) { // Debug mode: Use fixed values + v_public_enc_key := 'DD4F6B0DF57C6E3BD0E32B565CACA1D858CEB08A5C2BBAB2C23E203C6DE697FF'O; + v_compressed_enc_key_mode := 0; + } + log("f_http_build_inner_ec_request_with_wrong_parameters: Public encryption key: ", v_public_enc_key); + log("f_http_build_inner_ec_request_with_wrong_parameters: Public encryption key comp: ", v_compressed_enc_key_mode); + p_salt := vc_eaWholeHash; + if (PICS_SECPKI_REENROLMENT == false) { // This is the first enrolment, we used Factory keys + v_result := f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); + } else { // We use last valid EC certificate + // TODO Retrieve EC certificate from the first enrolment instead of PX + log("f_http_build_inner_ec_request_with_wrong_parameters: v_ec_private_key: ", PX_EC_PRIVATE_KEY); + log("f_http_build_inner_ec_request_with_wrong_parameters: v_ec_hashed_id8: ", PX_EC_HASHED_ID8); + v_result := f_build_pki_secured_request_message_signed_with_pop(PX_EC_PRIVATE_KEY, valueof(m_signerIdentifier_digest(PX_EC_HASHED_ID8)), PX_EC_HASHED_ID8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); + } + if (v_result == false) { + log("*** f_http_build_inner_ec_request_with_wrong_parameters: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } else { + log("f_http_build_inner_ec_request_with_wrong_parameters: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); + log("f_http_build_inner_ec_request_with_wrong_parameters: p_request_hash= ", p_request_hash); + } + } // End of function f_http_build_inner_ec_request_with_wrong_parameters + function f_http_build_invalid_enrolment_request( out octetstring p_private_key, out octetstring p_public_key_compressed, @@ -662,12 +729,12 @@ module LibItsPki_Functions { log("*** f_http_build_invalid_enrolment_request: Public encryption key comp: ", v_compressed_enc_key_mode); p_salt := vc_eaWholeHash; if (PICS_SECPKI_REENROLMENT == false) { // This is the first enrolment, we used Factory keys - v_ret_code := f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); + v_ret_code := f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } else { // We use last valid EC certificate // TODO Retrieve EC certificate from the first enrolment instead of PX log("f_http_build_inner_ec_request: v_ec_private_key: ", PX_EC_PRIVATE_KEY); log("f_http_build_inner_ec_request: v_ec_hashed_id8: ", PX_EC_HASHED_ID8); - v_ret_code := f_build_pki_secured_request_message_signed_with_pop(PX_EC_PRIVATE_KEY, valueof(m_signerIdentifier_digest(PX_EC_HASHED_ID8)), PX_EC_HASHED_ID8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); + v_ret_code := f_build_pki_secured_request_message_signed_with_pop(PX_EC_PRIVATE_KEY, valueof(m_signerIdentifier_digest(PX_EC_HASHED_ID8)), PX_EC_HASHED_ID8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } if (v_ret_code == false) { log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); @@ -807,7 +874,7 @@ module LibItsPki_Functions { p_salt := vc_aaWholeHash; log("*** f_http_build_authorization_request: p_salt: ", p_salt); if (PICS_PKI_AUTH_POP) { - if(f_build_pki_secured_request_message_signed_with_pop(p_private_key, valueof(m_signerIdentifier_self), vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), PX_EC_ALG_FOR_AT, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { + if(f_build_pki_secured_request_message_signed_with_pop(p_private_key, valueof(m_signerIdentifier_self), vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), PX_EC_ALG_FOR_AT, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { log("*** f_http_build_authorization_request: ERROR: Failed to generate Authorization Request ***"); f_selfOrClientSyncAndVerdict("error", e_error); } @@ -876,7 +943,7 @@ module LibItsPki_Functions { p_salt := vc_aaWholeHash; log("*** f_http_build_authorization_request_with_wrong_private_key: p_salt: ", p_salt); if (PICS_PKI_AUTH_POP) { - if(f_build_pki_secured_request_message_signed_with_pop(p_private_key, valueof(m_signerIdentifier_self), vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), PX_EC_ALG_FOR_AT, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { + if(f_build_pki_secured_request_message_signed_with_pop(p_private_key, valueof(m_signerIdentifier_self), vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), PX_EC_ALG_FOR_AT, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { log("*** f_http_build_authorization_request_with_wrong_private_key: ERROR: Failed to generate Authorization Request ***"); f_selfOrClientSyncAndVerdict("error", e_error); } @@ -891,23 +958,31 @@ module LibItsPki_Functions { log("*** f_http_build_authorization_request_with_wrong_private_key: DEBUG: p_request_hash= ", p_request_hash); } // End of function f_http_build_authorization_request_with_wrong_private_key - function f_http_build_authorization_request_with_wrong_pop( - in Certificate p_ec_certificate, // Enrolment credentials certificate - in octetstring p_ec_private_key, - out octetstring p_private_key, - out octetstring p_public_key_compressed, - out integer p_compressed_key_mode, - out octetstring p_private_enc_key, - out octetstring p_public_compressed_enc_key, - out integer p_compressed_enc_key_mode, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce, - out octetstring p_salt, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, - out Oct32 p_request_hash - ) runs on ItsPkiHttp { + function f_http_build_authorization_request_with_wrong_parameters( + in Certificate p_ec_certificate, // Enrolment credentials certificate + in octetstring p_ec_private_key, + in boolean p_alter_pop_signature := false, + in boolean p_alter_hmac := false, + in boolean p_alter_signer_digest := false, + in boolean p_alter_pks_recipient := false, + in boolean p_alter_enc_key := false, + in boolean p_alter_ea_id := false, + in template (omit) Time32 p_start := omit, + in template (omit) Duration p_duration := omit, + out octetstring p_private_key, + out octetstring p_public_key_compressed, + out integer p_compressed_key_mode, + out octetstring p_private_enc_key, + out octetstring p_public_compressed_enc_key, + out integer p_compressed_enc_key_mode, + out Oct16 p_aes_sym_key, + out Oct16 p_encrypted_sym_key, + out Oct16 p_authentication_vector, + out Oct12 p_nonce, + out octetstring p_salt, + out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, + out Oct32 p_request_hash + ) runs on ItsPkiHttp { // Local variables var octetstring v_public_key_x; var octetstring v_public_key_y; @@ -919,109 +994,70 @@ module LibItsPki_Functions { var Ieee1609Dot2Data v_inner_at_request_data; var InnerAtRequest v_authorization_request; var bitstring v_authorization_request_msg; + var boolean v_ret_code; // Generate the InnerAtRequest - if (f_generate_inner_at_request(vc_aaCertificate, vc_aaHashedId8, vc_eaCertificate, vc_eaWholeHash/*salt*/, vc_eaHashedId8, p_ec_certificate, p_ec_private_key, p_private_key, p_public_key_compressed, p_compressed_key_mode, p_private_enc_key, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_inner_at_request) == false) { - log("*** f_http_build_authorization_request_with_wrong_pop: ERROR: Failed to generate AuthorizationValidationRequest ***"); + if (p_alter_ea_id == true) { + var HashedId8 v_ea_hashed_id8 := vc_eaHashedId8; + v_ea_hashed_id8[0] := 'bb'O; + v_ea_hashed_id8[1] := 'cc'O; + log("f_http_build_authorization_request_with_wrong_parameters: Altered eaId= ", v_ea_hashed_id8); + v_ret_code := f_generate_inner_at_request(vc_aaCertificate, vc_aaHashedId8, vc_eaCertificate, vc_eaWholeHash/*salt*/, v_ea_hashed_id8, p_ec_certificate, p_ec_private_key, p_private_key, p_public_key_compressed, p_compressed_key_mode, p_private_enc_key, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_inner_at_request); + } else { + v_ret_code := f_generate_inner_at_request_with_wrong_parameters(vc_aaCertificate, vc_aaHashedId8, vc_eaCertificate, vc_eaWholeHash/*salt*/, vc_eaHashedId8, p_ec_certificate, p_ec_private_key, p_alter_hmac, p_alter_signer_digest, p_start, p_duration, p_private_key, p_public_key_compressed, p_compressed_key_mode, p_private_enc_key, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_inner_at_request); + } + if (v_ret_code == false) { + log("*** f_http_build_authorization_request_with_wrong_parameters: ERROR: Failed to generate AuthorizationValidationRequest ***"); f_selfOrClientSyncAndVerdict("error", e_error); return; } - log("f_http_build_authorization_request_with_wrong_pop: v_inner_at_request= ", v_inner_at_request); + log("f_http_build_authorization_request_with_wrong_parameters: v_inner_at_request= ", v_inner_at_request); // Secure InnerAtRequest message if (f_extract_enc_key(vc_aaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { - log("*** f_http_build_authorization_request_with_wrong_pop: ERROR: Non canonical AA certificate ***"); + log("*** f_http_build_authorization_request_with_wrong_parameters: ERROR: Non canonical AA certificate ***"); f_selfOrClientSyncAndVerdict("error", e_error); } if (PICS_SEC_FIXED_KEYS) { // Debug mode: Use fixed values v_public_enc_key := 'DD4F6B0DF57C6E3BD0E32B565CACA1D858CEB08A5C2BBAB2C23E203C6DE697FF'O; v_compressed_enc_key_mode := 0; } - log("*** f_http_build_authorization_request_with_wrong_pop: Public encryption key: ", v_public_enc_key); - log("*** f_http_build_authorization_request_with_wrong_pop: Public encryption key comp: ", v_compressed_enc_key_mode); + log("*** f_http_build_authorization_request_with_wrong_parameters: Public encryption key: ", v_public_enc_key); + log("*** f_http_build_authorization_request_with_wrong_parameters: Public encryption key comp: ", v_compressed_enc_key_mode); p_salt := vc_aaWholeHash; - log("*** f_http_build_authorization_request_with_wrong_pop: p_salt: ", p_salt); + log("*** f_http_build_authorization_request_with_wrong_parameters: p_salt: ", p_salt); if (PICS_PKI_AUTH_POP) { - if(f_build_pki_secured_request_message_signed_with_pop(p_ec_private_key/*Use the wrong verification private key*/, valueof(m_signerIdentifier_self), vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), PX_EC_ALG_FOR_AT, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { - log("*** f_http_build_authorization_request_with_wrong_pop: ERROR: Failed to generate Authorization Request ***"); + if(f_build_pki_secured_request_message_signed_with_pop(p_private_key, valueof(m_signerIdentifier_self), vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), PX_EC_ALG_FOR_AT, p_alter_pop_signature, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { + log("*** f_http_build_authorization_request_with_wrong_parameters: ERROR: Failed to generate Authorization Request ***"); f_selfOrClientSyncAndVerdict("error", e_error); } } else { // Only encryption of EtsiTs102941Data/InnerAtRequest - log("*** f_http_build_authorization_request_with_wrong_pop: POP signature not applied"); + log("*** f_http_build_authorization_request_with_wrong_parameters: POP signature not applied"); if(f_build_pki_secured_request_message_for_authorization(vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), PX_EC_ALG_FOR_AT, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { - log("*** f_http_build_authorization_request_with_wrong_pop: ERROR: Failed to generate Authorization Request ***"); + log("*** f_http_build_authorization_request_with_wrong_parameters: ERROR: Failed to generate Authorization Request ***"); f_selfOrClientSyncAndVerdict("error", e_error); } } - log("*** f_http_build_authorization_request_with_wrong_pop: DEBUG: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); - log("*** f_http_build_authorization_request_with_wrong_pop: DEBUG: p_request_hash= ", p_request_hash); - } // End of function f_http_build_authorization_request_with_wrong_pop - - function f_http_build_authorization_request_with_wrong_hmac( - in Certificate p_ec_certificate, // Enrolment credentials certificate - in octetstring p_ec_private_key, - out octetstring p_private_key, - out octetstring p_public_key_compressed, - out integer p_compressed_key_mode, - out octetstring p_private_enc_key, - out octetstring p_public_compressed_enc_key, - out integer p_compressed_enc_key_mode, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce, - out octetstring p_salt, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, - out Oct32 p_request_hash - ) runs on ItsPkiHttp { - // Local variables - var octetstring v_public_key_x; - var octetstring v_public_key_y; - var octetstring v_public_enc_key_x; - var octetstring v_public_enc_key_y; - var octetstring v_public_enc_key; - var integer v_compressed_enc_key_mode; - var InnerAtRequest v_inner_at_request; - var Ieee1609Dot2Data v_inner_at_request_data; - var InnerAtRequest v_authorization_request; - var bitstring v_authorization_request_msg; - - // Generate the InnerAtRequest - if (f_generate_inner_at_request_with_wrong_hmac(vc_aaCertificate, vc_aaHashedId8, vc_eaCertificate, vc_eaWholeHash/*salt*/, vc_eaHashedId8, p_ec_certificate, p_ec_private_key, p_private_key, p_public_key_compressed, p_compressed_key_mode, p_private_enc_key, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_inner_at_request) == false) { - log("*** f_http_build_authorization_request_with_wrong_hmac: ERROR: Failed to generate AuthorizationValidationRequest ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - return; - } - log("f_http_build_authorization_request_with_wrong_hmac: v_inner_at_request= ", v_inner_at_request); - - // Secure InnerAtRequest message - if (f_extract_enc_key(vc_aaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { - log("*** f_http_build_authorization_request_with_wrong_hmac: ERROR: Non canonical AA certificate ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - if (PICS_SEC_FIXED_KEYS) { // Debug mode: Use fixed values - v_public_enc_key := 'DD4F6B0DF57C6E3BD0E32B565CACA1D858CEB08A5C2BBAB2C23E203C6DE697FF'O; - v_compressed_enc_key_mode := 0; - } - log("*** f_http_build_authorization_request_with_wrong_hmac: Public encryption key: ", v_public_enc_key); - log("*** f_http_build_authorization_request_with_wrong_hmac: Public encryption key comp: ", v_compressed_enc_key_mode); - p_salt := vc_aaWholeHash; - log("*** f_http_build_authorization_request_with_wrong_hmac: p_salt: ", p_salt); - if (PICS_PKI_AUTH_POP) { - if(f_build_pki_secured_request_message_signed_with_pop(p_private_key, valueof(m_signerIdentifier_self), vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), PX_EC_ALG_FOR_AT, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { - log("*** f_http_build_authorization_request_with_wrong_hmac: ERROR: Failed to generate Authorization Request ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - } else { // Only encryption of EtsiTs102941Data/InnerAtRequest - log("*** f_http_build_authorization_request_with_wrong_hmac: POP signature not applied"); - if(f_build_pki_secured_request_message_for_authorization(vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), PX_EC_ALG_FOR_AT, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { - log("*** f_http_build_authorization_request_with_wrong_hmac: ERROR: Failed to generate Authorization Request ***"); - f_selfOrClientSyncAndVerdict("error", e_error); + log("*** f_http_build_authorization_request_with_wrong_parameters: DEBUG: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); + if (p_alter_enc_key == true) { + /*** + Alter encryption key to prevent decryption + ***/ + if (ischosen(p_ieee1609dot2_signed_and_encrypted_data.content.encryptedData.recipients[0].certRecipInfo.encKey.eciesNistP256)) { + p_ieee1609dot2_signed_and_encrypted_data.content.encryptedData.recipients[0].certRecipInfo.encKey.eciesNistP256.c[1] := 'aa'O; + p_ieee1609dot2_signed_and_encrypted_data.content.encryptedData.recipients[0].certRecipInfo.encKey.eciesNistP256.c[2] := 'bb'O; + } else { + p_ieee1609dot2_signed_and_encrypted_data.content.encryptedData.recipients[0].certRecipInfo.encKey.eciesBrainpoolP256r1.c[1] := 'aa'O; + p_ieee1609dot2_signed_and_encrypted_data.content.encryptedData.recipients[0].certRecipInfo.encKey.eciesBrainpoolP256r1.c[2] := 'bb'O; } + log("*** f_http_build_authorization_request_with_wrong_parameters: DEBUG: Altered enc key= ", p_ieee1609dot2_signed_and_encrypted_data); } - log("*** f_http_build_authorization_request_with_wrong_hmac: DEBUG: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); - log("*** f_http_build_authorization_request_with_wrong_hmac: DEBUG: p_request_hash= ", p_request_hash); - } // End of function f_http_build_authorization_request_with_wrong_hmac + if (p_alter_pks_recipient == true) { + p_ieee1609dot2_signed_and_encrypted_data.content.encryptedData.recipients[0].pskRecipInfo := int2oct(314259265, 8); // NOT equal to the HashedId8 of the certificate CERT_AA + log("*** f_http_build_authorization_request_with_wrong_parameters: DEBUG: Altered pskRecipInfo= ", p_ieee1609dot2_signed_and_encrypted_data); + } + log("*** f_http_build_authorization_request_with_wrong_parameters: DEBUG: p_request_hash= ", p_request_hash); + } // End of function f_http_build_authorization_request_with_wrong_parameters function f_http_build_authorization_response( in InnerAtRequest p_inner_at_request, @@ -1060,7 +1096,7 @@ module LibItsPki_Functions { } else { // Generate the certificate if (f_generate_at_certificate_for_inner_at_response(p_inner_at_request, p_private_key, p_digest, v_at_certificate) == false) { - log("f_http_build_inner_at_response: Failed to generate the certificate"); + log("f_http_build_authorization_response: Failed to generate the certificate"); p_inner_at_response := valueof( m_innerAtResponse_ko( p_request_hash, @@ -1078,7 +1114,7 @@ module LibItsPki_Functions { } // Secure the response - log("f_http_build_inner_at_response: p_inner_at_response= ", p_inner_at_response); + log("f_http_build_authorization_response: p_inner_at_response= ", p_inner_at_response); v_msg := bit2oct(encvalue(m_etsiTs102941Data_inner_at_response(p_inner_at_response))); v_nonce := substr(f_hashWithSha256(int2oct((f_getCurrentTimeUtc() * 1000), 16)), 0, 12); // Random value // TODO Consider Sha384: m_signerIdentifier_digest(f_HashedId8FromSha384(p_digest)) @@ -1089,7 +1125,7 @@ module LibItsPki_Functions { v_nonce, p_ieee1609dot2_signed_and_encrypted_data ) == false) { - log("f_http_build_inner_at_response: Failed to generate the certificate"); + log("f_http_build_authorization_response: Failed to generate the certificate"); p_inner_at_response := valueof( m_innerAtResponse_ko( p_request_hash, @@ -1144,8 +1180,9 @@ module LibItsPki_Functions { log("f_http_build_authorization_validation_request: Public encryption key: ", v_public_enc_key); log("f_http_build_authorization_validation_request: Public encryption key comp: ", v_compressed_enc_key_mode); p_salt := vc_eaWholeHash; + log("f_http_build_authorization_validation_request: vc_aaHashedId8: ", vc_aaHashedId8); log("f_http_build_authorization_validation_request: p_salt: ", p_salt); - if(f_build_pki_secured_request_message_signed_with_pop(vc_aaPrivateKey, valueof(m_signerIdentifier_digest(vc_aaHashedId8)), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_validation_request(v_authorization_validation_request))), PX_EC_ALG_FOR_ATV, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { + if(f_build_pki_secured_request_message_signed_with_pop(vc_aaPrivateKey, valueof(m_signerIdentifier_digest(vc_aaHashedId8)), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_validation_request(v_authorization_validation_request))), PX_EC_ALG_FOR_ATV, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { log("f_http_build_authorization_validation_request: Failed to generate Authorization Request"); f_selfOrClientSyncAndVerdict("error", e_error); } @@ -1153,6 +1190,55 @@ module LibItsPki_Functions { log("f_http_build_authorization_validation_request: p_request_hash= ", p_request_hash); } // End of function f_http_build_authorization_validation_request + function f_http_build_invalid_authorization_validation_request( + in InnerAtRequest p_inner_at_request, + in octetstring p_public_key_compressed, + in integer p_compressed_key_mode, + in octetstring p_private_enc_key, + in octetstring p_public_compressed_enc_key, + in integer p_compressed_enc_key_mode, + out Oct16 p_aes_sym_key, + out Oct16 p_encrypted_sym_key, + out Oct16 p_authentication_vector, + out Oct12 p_nonce, + out octetstring p_salt, + out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, + out Oct32 p_request_hash + ) runs on ItsPkiHttp { + // Local variables + var AuthorizationValidationRequest v_authorization_validation_request; + var bitstring v_authorization_validation_request_msg; + var octetstring v_public_enc_key; + var integer v_compressed_enc_key_mode; + + log(">>> f_http_build_invalid_authorization_validation_request"); + + // Copy the sharedAtRequest component from the InnerAtRequest received in the AuthorizationRequestMessage + v_authorization_validation_request.sharedAtRequest := p_inner_at_request.sharedAtRequest; + // Copy the ecSignature component from the InnerAtRequest received in the AuthorizationRequestMessage or AuthorizationRequestMessageWithPop + v_authorization_validation_request.ecSignature := p_inner_at_request.ecSignature; + // Secure the InnerAtRequest message + if (f_extract_enc_key(vc_eaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { + log("f_http_build_invalid_authorization_validation_request: Non canonical EA certificate"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + if (PICS_SEC_FIXED_KEYS) { // Debug mode: Use fixed values + v_public_enc_key := 'DD4F6B0DF57C6E3BD0E32B565CACA1D858CEB08A5C2BBAB2C23E203C6DE697FF'O; + v_compressed_enc_key_mode := 0; + } + log("f_http_build_invalid_authorization_validation_request: Public encryption key: ", v_public_enc_key); + log("f_http_build_invalid_authorization_validation_request: Public encryption key comp: ", v_compressed_enc_key_mode); + p_salt := vc_eaWholeHash; + log("f_http_build_invalid_authorization_validation_request: vc_aaHashedId8: ", vc_aaHashedId8); + log("f_http_build_invalid_authorization_validation_request: p_salt: ", p_salt); + if(f_build_pki_secured_request_message_signed_with_pop(vc_aaPrivateKey, valueof(m_signerIdentifier_digest(vc_aaHashedId8)), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_validation_request(v_authorization_validation_request))), PX_EC_ALG_FOR_ATV, true, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { + log("f_http_build_invalid_authorization_validation_request: Failed to generate Authorization Request"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + log("f_http_build_invalid_authorization_validation_request: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); + log("f_http_build_invalid_authorization_validation_request: p_request_hash= ", p_request_hash); + } // End of function f_http_build_invalid_authorization_validation_request + function f_http_build_authorization_validation_response( in InnerAtRequest p_inner_at_request, in AuthorizationValidationResponseCode p_responseCode := ok, @@ -1237,8 +1323,8 @@ module LibItsPki_Functions { var integer p_compressed_mode; var EccP256CurvePoint v_ecc_p256_curve_point; var SequenceOfPsidSsp v_appPermissions := { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs - valueof(m_appPermissions(36, { bitmapSsp := '830001'O })), - valueof(m_appPermissions(37, { bitmapSsp := '830001'O })) + valueof(m_appPermissions(36, { bitmapSsp := PX_INNER_EC_CERTFICATE_BITMAP_SSP_CAM })), + valueof(m_appPermissions(37, { bitmapSsp := PX_INNER_EC_CERTFICATE_BITMAP_SSP_DENM })) }; var template (value) EtsiTs103097Certificate v_cert; var bitstring v_tbs; @@ -1282,15 +1368,15 @@ module LibItsPki_Functions { ), m_validityPeriod( f_getCurrentTime() / 1000, - m_duration_in_hours(120) + m_duration_in_hours(PX_GENERATED_CERTIFICATE_DURATION) ), m_geographicRegion_identifiedRegion( { - m_identifiedRegion_country_only(250), // TODO PIXIT - m_identifiedRegion_country_only(380) + m_identifiedRegion_country_only(PX_GENERATED_CERTIFICATE_REGION_COUNTRY_2), + m_identifiedRegion_country_only(PX_GENERATED_CERTIFICATE_REGION_COUNTRY_2) } ), - '00'O // TODO Use PIXIT + PX_GENERATED_CERTIFICATE_SUBJECT_ASSURENCE_LEVEL ) ); // Encode it ==> Get octetstring @@ -1552,13 +1638,13 @@ module LibItsPki_Functions { out InnerEcRequest p_inner_ec_request ) return boolean { // Local variables - var Oct32 v_publicKeyX; - var Oct32 v_publicKeyY; + var Oct32 v_public_key_x; + var Oct32 v_public_key_y; var EccP256CurvePoint v_eccP256_curve_point; log (">>> f_generate_inner_ec_request"); // Generate keys for the certificate to be requested - if (f_generate_key_pair(p_private_key, v_publicKeyX, v_publicKeyY, p_public_key_compressed, p_compressed_mode) == false) { + if (f_generate_key_pair(p_private_key, v_public_key_x, v_public_key_y, p_public_key_compressed, p_compressed_mode) == false) { log ("f_generate_inner_ec_request: failed to generate keys"); return false; } @@ -1577,19 +1663,19 @@ module LibItsPki_Functions { m_certificateSubjectAttributes_id_name( oct2char(PICS_ITS_S_CANONICAL_ID), { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs - valueof(m_appPermissions(c_its_aid_SCR, { bitmapSsp := '01C0'O })) + valueof(m_appPermissions(c_its_aid_SCR, { bitmapSsp := PX_INNER_EC_CERTFICATE_BITMAP_SSP_SCR })) }, m_validityPeriod( f_getCurrentTime() / 1000, - m_duration_in_hours(120) // TODO Use PIXIT + m_duration_in_hours(PX_GENERATED_CERTIFICATE_DURATION) ), m_geographicRegion_identifiedRegion( { - m_identifiedRegion_country_only(250), // TODO Use PIXIT - m_identifiedRegion_country_only(380) // TODO Use PIXIT + m_identifiedRegion_country_only(PX_GENERATED_CERTIFICATE_REGION_COUNTRY_1), + m_identifiedRegion_country_only(PX_GENERATED_CERTIFICATE_REGION_COUNTRY_2) } ), - '00'O // TODO Use PIXIT + PX_GENERATED_CERTIFICATE_SUBJECT_ASSURENCE_LEVEL ) ) ); @@ -1602,6 +1688,83 @@ module LibItsPki_Functions { return true; } // End of function f_generate_inner_ec_request + function f_generate_inner_ec_request_with_wrong_parameters( + in SequenceOfPsidSsp p_appPermissions, + in octetstring p_canonical_id := PICS_ITS_S_CANONICAL_ID, + in Time32 p_start, + in Duration p_duration, + in boolean p_alter_private_key := false, + out octetstring p_private_key, + out octetstring p_public_key_compressed, + out integer p_compressed_mode, + out InnerEcRequest p_inner_ec_request + ) return boolean { + // Local variables + var Oct32 v_public_key_x; + var Oct32 v_public_key_y; + var EccP256CurvePoint v_eccP256_curve_point; + + log (">>> f_generate_inner_ec_request_with_wrong_parameters"); + // Generate keys for the certificate to be requested + if (f_generate_key_pair(p_private_key, v_public_key_x, v_public_key_y, p_public_key_compressed, p_compressed_mode) == false) { + log ("f_generate_inner_ec_request_with_wrong_parameters: failed to generate keys"); + return false; + } + if (p_alter_private_key == false) { + if (p_compressed_mode == 0) { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(p_public_key_compressed)); + } else { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(p_public_key_compressed)); + } + } else { + var octetstring v_private_key; + var octetstring v_public_key_compressed; + var integer v_compressed_mode; + + log ("f_generate_inner_ec_request_with_wrong_parameters: Alter verify private key"); + if (f_generate_key_pair(v_private_key, v_public_key_x, v_public_key_y, v_public_key_compressed, v_compressed_mode) == false) { + log ("f_generate_inner_ec_request_with_wrong_parameters: failed to generate keys"); + return false; + } + if (v_compressed_mode == 0) { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_key_compressed)); + } else { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_key_compressed)); + } + } + // Build the Proof of Possession InnerEcRequest + p_inner_ec_request := valueof( + m_innerEcRequest( + PICS_ITS_S_CANONICAL_ID, + m_publicKeys( + m_publicVerificationKey_ecdsaNistP256(v_eccP256_curve_point) + ), + m_certificateSubjectAttributes_id_name( + oct2char(p_canonical_id), + p_appPermissions, // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs + m_validityPeriod( + p_start, + m_duration_in_hours(PX_GENERATED_CERTIFICATE_DURATION) + ), + m_geographicRegion_identifiedRegion( + { + m_identifiedRegion_country_only(PX_GENERATED_CERTIFICATE_REGION_COUNTRY_1), + m_identifiedRegion_country_only(PX_GENERATED_CERTIFICATE_REGION_COUNTRY_2) + } + ), + PX_GENERATED_CERTIFICATE_SUBJECT_ASSURENCE_LEVEL + ) + ) + ); + if (PICS_SECPKI_REENROLMENT) { // This is a re-enrolment, the identifier of its current valid Enrolment Credential + log("f_generate_inner_ec_request_with_wrong_parameters: This is a re-enrolment"); + p_inner_ec_request.itsId := PX_EC_HASHED_ID8; + } + log("f_generate_inner_ec_request_with_wrong_parameters: ", p_inner_ec_request); + + return true; + } // End of function f_generate_inner_ec_request_with_wrong_parameters + function f_generate_inner_ec_request_signed_for_pop( in octetstring p_private_key, in InnerEcRequest p_inner_ec_request, @@ -1766,8 +1929,8 @@ module LibItsPki_Functions { var HashAlgorithm v_hashId; var Signature v_signature; var SequenceOfPsidSsp v_appPermissions := { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs - valueof(m_appPermissions(c_its_aid_CAM, { bitmapSsp := '01FFFC'O })), - valueof(m_appPermissions(c_its_aid_DENM, { bitmapSsp := '01FFFFFF'O })) // TODO Use PIXIT + valueof(m_appPermissions(c_its_aid_CAM, { bitmapSsp := PX_INNER_AT_CERTFICATE_BITMAP_SSP_CAM })), + valueof(m_appPermissions(c_its_aid_DENM, { bitmapSsp := PX_INNER_AT_CERTFICATE_BITMAP_SSP_DENM })) }; // Generate verification keys for the certificate to be requested @@ -1832,10 +1995,10 @@ module LibItsPki_Functions { p_ea_hashed_id8, // eaId identifies the EA certificate shared with EA entity v_key_tag, // Calculated keyTag valueof( - m_certificate_subject_attributes( // FIXME Review fsubjectPermissions + m_certificate_subject_attributes( // FIXME Review subjectPermissions v_appPermissions,//p_ec_certificate.toBeSigned.appPermissions, p_ec_certificate.toBeSigned.certRequestPermissions, - p_ec_certificate.toBeSigned.id, + { none_ := NULL },//p_ec_certificate.toBeSigned.id, p_ec_certificate.toBeSigned.validityPeriod, p_ec_certificate.toBeSigned.region, p_ec_certificate.toBeSigned.assuranceLevel @@ -2046,22 +2209,26 @@ module LibItsPki_Functions { return true; } // End of function f_generate_inner_at_request - function f_generate_inner_at_request_with_wrong_hmac( - in Certificate p_aa_certificate, - in Oct8 p_aa_hashed_id8, - in Certificate p_ea_certificate, - in octetstring p_salt, - in Oct8 p_ea_hashed_id8, - in Certificate p_ec_certificate, - in octetstring p_ec_private_key, - out octetstring p_private_key, - out octetstring p_public_key_compressed, - out integer p_compressed_key_mode, - out octetstring p_private_enc_key, - out octetstring p_public_compressed_enc_key, - out integer p_compressed_enc_key_mode, - out InnerAtRequest p_inner_at_request - ) return boolean { + function f_generate_inner_at_request_with_wrong_parameters( + in Certificate p_aa_certificate, + in Oct8 p_aa_hashed_id8, + in Certificate p_ea_certificate, + in octetstring p_salt, + in Oct8 p_ea_hashed_id8, + in Certificate p_ec_certificate, + in octetstring p_ec_private_key, + in boolean p_alter_hmac := false, + in boolean p_alter_signer_digest := false, + in template (omit) Time32 p_start := omit, + in template (omit) Duration p_duration := omit, + out octetstring p_private_key, + out octetstring p_public_key_compressed, + out integer p_compressed_key_mode, + out octetstring p_private_enc_key, + out octetstring p_public_compressed_enc_key, + out integer p_compressed_enc_key_mode, + out InnerAtRequest p_inner_at_request + ) return boolean { // Local variables var octetstring v_public_key_x; var octetstring v_public_key_y; @@ -2085,28 +2252,30 @@ module LibItsPki_Functions { var template (value) EccP256CurvePoint v_enc_eccP256_curve_point; var HashAlgorithm v_hashId; var Signature v_signature; - var SequenceOfPsidSsp v_appPermissions := { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs - valueof(m_appPermissions(c_its_aid_CAM, { bitmapSsp := '01FFFC'O })), - valueof(m_appPermissions(c_its_aid_DENM, { bitmapSsp := '01FFFFFF'O })) // TODO Use PIXIT - }; + var Time32 v_start; + var Duration v_duration; + /*var SequenceOfPsidSsp v_appPermissions := { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs + valueof(m_appPermissions(c_its_aid_CAM, { bitmapSsp := PX_INNER_AT_CERTFICATE_BITMAP_SSP_CAM })), + valueof(m_appPermissions(c_its_aid_DENM, { bitmapSsp := PX_INNER_AT_CERTFICATE_BITMAP_SSP_DENM })) + };*/ // Generate verification keys for the certificate to be requested if (f_generate_key_pair(p_private_key, v_public_key_x, v_public_key_y, p_public_key_compressed, p_compressed_key_mode) == false) { - log("f_generate_inner_at_request_with_wrong_hmac: Failed to generate verification key"); + log("f_generate_inner_at_request_with_wrong_parameters: Failed to generate verification key"); return false; } - log ("f_generate_inner_at_request_with_wrong_hmac: AT verification private key: ", p_private_key); - log ("f_generate_inner_at_request_with_wrong_hmac: AT verification public compressed key: ", p_public_key_compressed); - log ("f_generate_inner_at_request_with_wrong_hmac: AT verification public compressed mode: ", p_compressed_key_mode); + log ("f_generate_inner_at_request_with_wrong_parameters: AT verification private key: ", p_private_key); + log ("f_generate_inner_at_request_with_wrong_parameters: AT verification public compressed key: ", p_public_key_compressed); + log ("f_generate_inner_at_request_with_wrong_parameters: AT verification public compressed mode: ", p_compressed_key_mode); // Generate encryption keys for the certificate to be requested if (PX_INCLUDE_ENCRYPTION_KEYS) { if (f_generate_key_pair_for_encryption(PX_EC_ALG_FOR_AT, p_private_enc_key, v_public_enc_key_x, v_public_enc_key_y, p_public_compressed_enc_key, p_compressed_enc_key_mode) == false) { - log("f_generate_inner_at_request_with_wrong_hmac: Failed to generate encryption key"); + log("f_generate_inner_at_request_with_wrong_parameters: Failed to generate encryption key"); return false; } else { - log ("f_generate_inner_at_request_with_wrong_hmac: AT encryption private key: ", p_private_enc_key); - log ("f_generate_inner_at_request_with_wrong_hmac: AT encryption public compressed key: ", p_public_compressed_enc_key); - log ("f_generate_inner_at_request_with_wrong_hmac: AT encryption public compressed mode: ", p_compressed_enc_key_mode); + log ("f_generate_inner_at_request_with_wrong_parameters: AT encryption private key: ", p_private_enc_key); + log ("f_generate_inner_at_request_with_wrong_parameters: AT encryption public compressed key: ", p_public_compressed_enc_key); + log ("f_generate_inner_at_request_with_wrong_parameters: AT encryption public compressed mode: ", p_compressed_enc_key_mode); } } else { p_private_enc_key := ''O; @@ -2125,19 +2294,24 @@ module LibItsPki_Functions { v_ec_hash := f_hashWithSha384(bit2oct(v_enc_value)); v_ec_hashed_id8 := f_HashedId8FromSha384(v_ec_hash); } - log("f_generate_inner_at_request_with_wrong_hmac: v_ec_hash= ", v_ec_hash); + log("f_generate_inner_at_request_with_wrong_parameters: v_ec_hash= ", v_ec_hash); + log("f_generate_inner_at_request_with_wrong_parameters: v_ec_hashed_id8= ", v_ec_hashed_id8); + if (p_alter_signer_digest == true) { + v_ec_hashed_id8 := int2oct((f_getCurrentTimeUtc() * 1000), 8); + log("f_generate_inner_at_request_with_wrong_parameters: Altered v_ec_hashed_id8= ", v_ec_hashed_id8); + } // Generate 32 octets length secret key v_hmac_key := f_hashWithSha256(int2oct((f_getCurrentTimeUtc() * 1000), 12)); - log("f_generate_inner_at_request_with_wrong_hmac: v_hmac_key= ", v_hmac_key); + log("f_generate_inner_at_request_with_wrong_parameters: v_hmac_key= ", v_hmac_key); // Generate tag based on the concatenation of verification keys & encryption keys if (f_generate_key_tag(p_public_key_compressed, p_compressed_key_mode, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_encoded_tag) == false) { - log("f_generate_inner_at_request_with_wrong_hmac: Failed to generate Key tag"); + log("f_generate_inner_at_request_with_wrong_parameters: Failed to generate Key tag"); return false; } - log("f_generate_inner_at_request_with_wrong_hmac: v_encoded_tag= ", v_encoded_tag); - // Modify v_hmac_key + log("f_generate_inner_at_request_with_wrong_parameters: v_encoded_tag= ", v_encoded_tag); + // Generate hmac key v_key_tag := substr( fx_hmac_sha256( // TODO Rename and use a wrapper function v_hmac_key, @@ -2145,30 +2319,44 @@ module LibItsPki_Functions { ), 0, 16); // Leftmost 128 bits of the HMAC-SHA256 tag computed previously - log("f_generate_inner_at_request_with_wrong_hmac: v_key_tag= ", v_key_tag); - v_hmac_key[0] := 'aa'O; - v_hmac_key[1] := 'bb'O; - log("f_generate_inner_at_request_with_wrong_hmac: Modified key_tag= ", v_hmac_key); - + log("f_generate_inner_at_request_with_wrong_parameters: v_key_tag= ", v_key_tag); + if (p_alter_hmac == true) { + v_hmac_key[0] := 'aa'O; + v_hmac_key[1] := 'bb'O; + log("f_generate_inner_at_request_with_wrong_parameters: Altered key_tag= ", v_hmac_key); + } + // Build the SharedAtRequest + if (not(ispresent(p_start))) { + v_start := p_ec_certificate.toBeSigned.validityPeriod.start_; + } else { + v_start := valueof(p_start); + log("f_generate_inner_at_request_with_wrong_parameters: Altered ValidityPeriod.start= ", v_start); + } + if (not(ispresent(p_duration))) { + v_duration := p_ec_certificate.toBeSigned.validityPeriod.duration; + } else { + v_duration := valueof(p_duration); + log("f_generate_inner_at_request_with_wrong_parameters: Altered ValidityPeriod.duration= ", v_duration); + } p_inner_at_request.sharedAtRequest := valueof( m_shared_at_request( p_ea_hashed_id8, // eaId identifies the EA certificate shared with EA entity v_key_tag, // Calculated keyTag valueof( - m_certificate_subject_attributes( // FIXME Review fsubjectPermissions - v_appPermissions,//p_ec_certificate.toBeSigned.appPermissions, + m_certificate_subject_attributes( + p_ec_certificate.toBeSigned.appPermissions,//v_appPermissions, p_ec_certificate.toBeSigned.certRequestPermissions, - p_ec_certificate.toBeSigned.id, - p_ec_certificate.toBeSigned.validityPeriod, + { none_ := NULL },//p_ec_certificate.toBeSigned.id, + m_validityPeriod(v_start, v_duration), p_ec_certificate.toBeSigned.region, p_ec_certificate.toBeSigned.assuranceLevel - ))) // Desired attributes + ))) // Desired attributes ); // Calculate the hash of the SharedAtRequest v_hash_shared_at_request := f_hashWithSha256(bit2oct(encvalue(p_inner_at_request.sharedAtRequest))); - log("f_generate_inner_at_request_with_wrong_hmac: v_hash_shared_at_request= ", v_hash_shared_at_request); + log("f_generate_inner_at_request_with_wrong_parameters: v_hash_shared_at_request= ", v_hash_shared_at_request); // Build the ETsiTs103097Data-SignedExternalPayload v_tbs := m_toBeSignedData( @@ -2177,7 +2365,7 @@ module LibItsPki_Functions { -, (f_getCurrentTime()) * 1000) //us ); - log("f_generate_inner_at_request_with_wrong_hmac: v_tbs= ", v_tbs); + log("f_generate_inner_at_request_with_wrong_parameters: v_tbs= ", v_tbs); // Signed ToBeSigned payload using the private key of EC certificate obtained from Enrolment request // In case of ITS-S privacy, v_signed_at_signature contained the data to be encrypted // TODO Simplify with f_signWithEcdsa @@ -2222,7 +2410,7 @@ module LibItsPki_Functions { ); } else { // Error - log("f_generate_inner_at_request_with_wrong_hmac: Failed to process signature"); + log("f_generate_inner_at_request_with_wrong_parameters: Failed to process signature"); return false; } } @@ -2231,12 +2419,12 @@ module LibItsPki_Functions { m_signedData( v_hashId, v_tbs, - m_signerIdentifier_digest(v_ec_hashed_id8), // Signer is thehasheId8 of the EC certificate obtained from Enrolment request + m_signerIdentifier_digest(v_ec_hashed_id8), // Signer is the hasheId8 of the EC certificate obtained from Enrolment request v_signature ) ) ); - log("f_generate_inner_at_request_with_wrong_hmac: v_signed_at_signature= ", v_signed_at_signature); + log("f_generate_inner_at_request_with_wrong_parameters: v_signed_at_signature= ", v_signed_at_signature); if (PICS_ITS_S_WITH_PRIVACY) { // Build EtsiTs102097Data-Encrypted structure var octetstring v_public_enc_key; @@ -2260,7 +2448,7 @@ module LibItsPki_Functions { v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_1; v_compressed_mode := 1; } else { - log("f_generate_inner_at_request_with_wrong_hmac: Wrong NistP256 encryption variant"); + log("f_generate_inner_at_request_with_wrong_parameters: Wrong NistP256 encryption variant"); return false; } v_enc_signed_ec_signature := f_encryptWithEciesNistp256WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); @@ -2284,7 +2472,7 @@ module LibItsPki_Functions { v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_1; v_compressed_mode := 1; } else { - log("f_generate_inner_at_request_with_wrong_hmac: Wrong BrainpoolP256r1 encryption variant"); + log("f_generate_inner_at_request_with_wrong_parameters: Wrong BrainpoolP256r1 encryption variant"); return false; } v_enc_signed_ec_signature := f_encryptWithEciesBrainpoolp256WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); @@ -2301,12 +2489,12 @@ module LibItsPki_Functions { v_authentication_vector ))); } else { - log("f_generate_inner_at_request_with_wrong_hmac: Wrong encryption variant"); + log("f_generate_inner_at_request_with_wrong_parameters: Wrong encryption variant"); return false; } - log("f_generate_inner_at_request_with_wrong_hmac: v_encrypted_data_encryption_key= ", v_encrypted_data_encryption_key); + log("f_generate_inner_at_request_with_wrong_parameters: v_encrypted_data_encryption_key= ", v_encrypted_data_encryption_key); v_recipientId := p_ea_hashed_id8; // RecipientId is the HashedId8 of the EA certificate - log("f_generate_inner_at_request_with_wrong_hmac: v_recipientId= ", v_recipientId); + log("f_generate_inner_at_request_with_wrong_parameters: v_recipientId= ", v_recipientId); // Fill Certificate template with the public compressed keys (canonical form) p_inner_at_request.ecSignature := valueof( m_ec_signature( @@ -2365,10 +2553,10 @@ module LibItsPki_Functions { ); } p_inner_at_request.hmacKey := v_hmac_key; - log("f_generate_inner_at_request_with_wrong_hmac: p_inner_at_request= ", p_inner_at_request); + log("f_generate_inner_at_request_with_wrong_parameters: p_inner_at_request= ", p_inner_at_request); return true; - } // End of function f_generate_inner_at_request_with_wrong_hmac + } // End of function f_generate_inner_at_request_with_wrong_parameters function f_verify_inner_at_request_signed_for_pop( in EtsiTs102941Data p_etsi_ts_102941_data, @@ -2469,7 +2657,7 @@ module LibItsPki_Functions { ) { tc_ac.stop; - if (f_verify_pki_response_message(p_private_key, v_aes_sym_key, v_authentication_vector, vc_eaWholeHash, v_response.response.body.binary_body.ieee1609dot2_data, p_strict_checks, v_etsi_ts_102941_data) == false) { + if (f_verify_pki_response_message(p_private_key, v_aes_sym_key, v_authentication_vector, vc_eaWholeHash, v_response.response.body.binary_body.ieee1609dot2_data, p_strict_checks, -, v_etsi_ts_102941_data) == false) { log("f_await_http_inner_ec_request_response: Failed to verify PKI message ***"); if (p_strict_checks) { return false; @@ -2604,6 +2792,7 @@ module LibItsPki_Functions { in octetstring p_salt, in octetstring p_pki_message, in SecurityAlg p_enc_algorithm, // TODO Use RCA to check encryption alg + in boolean p_alter_signature := false, out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, @@ -2632,6 +2821,7 @@ module LibItsPki_Functions { log(">>> f_build_pki_secured_request_message_signed_with_pop: p_salt= ", p_salt); log(">>> f_build_pki_secured_request_message_signed_with_pop: p_pki_message= ", p_pki_message); log(">>> f_build_pki_secured_request_message_signed_with_pop: p_enc_algorithm= ", p_enc_algorithm); + log(">>> f_build_pki_secured_request_message_signed_with_pop: p_alter_signature= ", p_alter_signature); // Signed the encoded PKI message v_tbs := m_toBeSignedData( @@ -2652,6 +2842,11 @@ module LibItsPki_Functions { } log("f_build_pki_secured_request_message_signed_with_pop: lengthof(v_tbs_signed)= ", lengthof(v_tbs_signed)); log("f_build_pki_secured_request_message_signed_with_pop: v_tbs_signed= ", v_tbs_signed); + if (p_alter_signature == true) { + v_tbs_signed[0] := '0A'O; + v_tbs_signed[1] := '0A'O; + log("f_build_pki_secured_request_message_signed_with_pop: Altered signature= ", v_tbs_signed); + } // Add the signature and create EtsiTs103097Data-Signed data structure if (PX_VE_ALG == e_nist_p256) { v_signature := valueof( @@ -3261,6 +3456,7 @@ module LibItsPki_Functions { * @param p_certificate Certificate to use for verification key * @param p_ieee1609dot2_encrypted_and_signed_data The received encrypted and signed data * @param p_check_security Set to true to verify PKI protocol element such as signatures... + * @param p_response_type Response type (0: InnerEcResponse, 1: InnerAtResponse...). Default: 0 * @param p_etsi_ts_102941_data The EtsiTs102941Data message * @return true on success, false otherwise */ @@ -3271,6 +3467,7 @@ module LibItsPki_Functions { in octetstring p_issuer, in Ieee1609Dot2Data p_ieee1609dot2_encrypted_and_signed_data, in boolean p_check_security := true, + in integer p_response_type := 0, out EtsiTs102941Data p_etsi_ts_102941_data ) return boolean { // Local variables @@ -3287,6 +3484,8 @@ module LibItsPki_Functions { log(">>> f_verify_pki_response_message: p_aes_sym_key= ", p_aes_sym_key); log(">>> f_verify_pki_response_message: p_authentication_vector= ", p_authentication_vector); log(">>> f_verify_pki_response_message: p_issuer= ", p_issuer); + log(">>> f_verify_pki_response_message: p_check_security= ", p_check_security); + log(">>> f_verify_pki_response_message: p_response_type= ", p_response_type); // TODO Check p_ieee1609dot2_encrypted_and_signed_data.content.encryptedData.recipients[0].pskRecipInfo. See IEEE Std 1609.2-2017 Clause 6.3.34 PreSharedKeyRecipientInfo @@ -3317,8 +3516,19 @@ module LibItsPki_Functions { return false; } } + + // 4. Verify EtsiTs103097Data-Signed HeaderInfo + // TODO Parameter p_response_type seems to be useless + if ((p_response_type == 0) or (p_response_type == 1)) { // InnerEcResponse & InnerAtResponse + log("f_verify_pki_response_message: headerInfo matching= ", match(v_ieee1609dot2_signed_data.content.signedData.tbsData.headerInfo, mw_headerInfo_inner_pki_response)); + if (match(v_ieee1609dot2_signed_data.content.signedData.tbsData.headerInfo, mw_headerInfo_inner_pki_response) == false) { + if (p_check_security == true) { + return false; + } + } + } // else, no check - // 4. Return the PKI message + // 5. Return the PKI message log("f_verify_pki_response_message: v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData= ", v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); v_etsi_ts_102941_data_msg := oct2bit(v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); if (decvalue(v_etsi_ts_102941_data_msg, p_etsi_ts_102941_data) != 0) { diff --git a/ttcn/Pki/LibItsPki_Pics.ttcn b/ttcn/Pki/LibItsPki_Pics.ttcn index 2bb0ef7d..3b00c334 100644 --- a/ttcn/Pki/LibItsPki_Pics.ttcn +++ b/ttcn/Pki/LibItsPki_Pics.ttcn @@ -35,20 +35,30 @@ module LibItsPki_Pics { */ modulepar boolean PICS_SECPKI_CRL := false; + /** + * @desc Do the Authorization Request use SignedWithPop mechanism? + */ + modulepar boolean PICS_PKI_AUTH_POP := true; + /** * @desc Certificate used by the IUT acting as ITS-S */ - modulepar charstring PICS_IUT_CERTIFICATE_ID := "CERT_IUT_A_EA"; + modulepar charstring PICS_IUT_CERTIFICATE_ID := "CERT_IUT_A_AT"; /** * @desc Certificate used by the IUT acting as EA */ - modulepar charstring PICS_IUT_EA_CERTIFICATE_ID := "CERT_IUT_A__EA_EA"; + modulepar charstring PICS_IUT_EA_CERTIFICATE_ID := "CERT_IUT_A_EA"; /** * @desc Certificate used by the IUT acting as AA */ - modulepar charstring PICS_IUT_AA_CERTIFICATE_ID := "CERT_IUT_A_AA_EA"; + modulepar charstring PICS_IUT_AA_CERTIFICATE_ID := "CERT_IUT_A_AA"; + + /** + * @desc Certificate used by the IUT acting as AA + */ + modulepar charstring PICS_IUT_CA_CERTIFICATE_ID := "CERT_IUT_A_RCA"; /** * @desc Certificate used by the Test System acting as ITS-S @@ -58,12 +68,17 @@ module LibItsPki_Pics { /** * @desc Certificate used by the Test System acting as EA */ - modulepar charstring PICS_TS_EA_CERTIFICATE_ID := "CERT_EA"; + modulepar charstring PICS_TS_EA_CERTIFICATE_ID := "CERT_TS_A_EA"; /** * @desc Certificate used by the Test System acting as AA */ - modulepar charstring PICS_TS_AA_CERTIFICATE_ID := "CERT_AA"; + modulepar charstring PICS_TS_AA_CERTIFICATE_ID := "CERT_TS_A_AA"; + + /** + * @desc Certificate used by the Test System acting as EA + */ + modulepar charstring PICS_TS_CA_CERTIFICATE_ID := "CERT_TS_RCA_A"; /** * @desc Set to true if different end points are used for EC and AT @@ -95,6 +110,17 @@ module LibItsPki_Pics { */ modulepar boolean PICS_ITS_S_WITH_PRIVACY := true; + /** + * @desc Set to true if the PKI configuration authorize to configure an external EA entity + */ + + modulepar boolean PICS_SIMULATE_EA_ENTITY := false; + + /** + * @desc Set to true if the PKI configuration authorize to configure an external AA entity + */ + modulepar boolean PICS_SIMULATE_AA_ENTITY := false; + /** * @desc HTTP POST URI for InnerECRequest */ @@ -169,5 +195,10 @@ module LibItsPki_Pics { * @desc Canonical ITSS-S identifier */ modulepar octetstring PICS_ITS_S_CANONICAL_ID := '1B4CA1210123AE900BBE6C3EBAE7E87DA20DBDAB1E7B2EC0691C51C1021900AA'O; + + /** + * @desc Invalid Canonical ITSS-S identifier + */ + modulepar octetstring PICS_INVALID_ITS_S_CANONICAL_ID := '0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A'O; } // End of module LibItsPki_Pics diff --git a/ttcn/Pki/LibItsPki_Pixits.ttcn b/ttcn/Pki/LibItsPki_Pixits.ttcn index 65ffc419..eaf2245f 100644 --- a/ttcn/Pki/LibItsPki_Pixits.ttcn +++ b/ttcn/Pki/LibItsPki_Pixits.ttcn @@ -15,11 +15,6 @@ module LibItsPki_Pixits { */ modulepar boolean PX_INCLUDE_ENCRYPTION_KEYS := true; - /** - * @desc Do the Authorization Request use SignedWithPop mechanism? - */ - modulepar boolean PICS_PKI_AUTH_POP := true; - /** * @desc Contains the private key for the EC certificate, used in case of re-enrolment */ @@ -53,4 +48,16 @@ module LibItsPki_Pixits { */ modulepar SecurityAlg PX_VE_ALG := e_nist_p256; + modulepar octetstring PX_INNER_EC_CERTFICATE_BITMAP_SSP_SCR := '01C0'O; + + modulepar octetstring PX_INNER_EC_CERTFICATE_INCORRECT_BITMAP_SSP_SCR := '01FF'O; + + modulepar octetstring PX_INNER_EC_CERTFICATE_BITMAP_SSP_CAM := '830001'O; + + modulepar octetstring PX_INNER_EC_CERTFICATE_BITMAP_SSP_DENM := '830001'O; + + modulepar octetstring PX_INNER_AT_CERTFICATE_BITMAP_SSP_CAM := '01FFFC'O; + + modulepar octetstring PX_INNER_AT_CERTFICATE_BITMAP_SSP_DENM := '01FFFFFF'O; + } // End of module LibItsPki_Pixits diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn index 29931a67..9e2f3312 100644 --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ b/ttcn/Pki/LibItsPki_Templates.ttcn @@ -474,13 +474,13 @@ module LibItsPki_Templates { template CertificateSubjectAttributes mw_certificate_subject_attributes( template (present) SequenceOfPsidSsp p_appPermissions := ?, - template (present) CertificateId p_id := ?, + template CertificateId p_id := *, template (present) ValidityPeriod p_validityPeriod := ?, template (present) SubjectAssurance p_assuranceLevel := ?, template GeographicRegion p_region := *, template SequenceOfPsidGroupPermissions p_certIssuePermissions := omit ) := { - id := p_id, + id := p_id ifpresent, validityPeriod := p_validityPeriod, region := p_region, assuranceLevel := p_assuranceLevel, diff --git a/ttcn/Security/LibItsSecurity_Pixits.ttcn b/ttcn/Security/LibItsSecurity_Pixits.ttcn index 73c25144..e7a73bcc 100644 --- a/ttcn/Security/LibItsSecurity_Pixits.ttcn +++ b/ttcn/Security/LibItsSecurity_Pixits.ttcn @@ -65,5 +65,13 @@ module LibItsSecurity_Pixits { * @desc AES-128-CCM nonce public key */ modulepar Oct12 PX_ENCRYPTIONPARAMETERS_AES_128_CCM_NONCE := 'C0FFEEDECAC0FFEEDECA0000'O; + + modulepar CountryOnly PX_GENERATED_CERTIFICATE_REGION_COUNTRY_1 := 250; -} // End of module LibItsSecurity_Pixits \ No newline at end of file + modulepar CountryOnly PX_GENERATED_CERTIFICATE_REGION_COUNTRY_2 := 380; + + modulepar Int16 PX_GENERATED_CERTIFICATE_DURATION := 120; + + modulepar SubjectAssurance PX_GENERATED_CERTIFICATE_SUBJECT_ASSURENCE_LEVEL := '00'O; + +} // End of module LibItsSecurity_Pixits diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index 857a9bff..17390efd 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -1027,6 +1027,15 @@ module LibItsSecurity_Templates { template (present) Time64 p_generationTime := ? ) modifies mw_headerInfo_gn := {}; + template HeaderInfo mw_headerInfo_inner_pki_response( + template (present) Psid p_psid := c_its_aid_SCR, + template Time64 p_generationTime := * + ) modifies mw_ieee1609Dot2_headerInfo := { + generationTime := p_generationTime, + expiryTime := omit, + generationLocation := omit + } + } // End of group headerFields group signatures { -- GitLab From e7fd225d8556549ffee6a82f504ca032a78b6103 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Wed, 2 Oct 2019 00:10:00 -0700 Subject: [PATCH 214/320] Bug fixed on Verification algorithm support --- ttcn/Pki/LibItsPki_Functions.ttcn | 167 +++++++++++++++++++++--------- ttcn/Pki/LibItsPki_Pixits.ttcn | 6 +- 2 files changed, 121 insertions(+), 52 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 5c0fe41b..2e210e24 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -716,8 +716,10 @@ module LibItsPki_Functions { // Modify signature to get an error if (ischosen(v_inner_ec_request_signed_for_pop.content.signedData.signature_.ecdsaNistP256Signature)) { v_inner_ec_request_signed_for_pop.content.signedData.signature_.ecdsaNistP256Signature.sSig[1] := bit2oct('10101010'B xor4b oct2bit(v_inner_ec_request_signed_for_pop.content.signedData.signature_.ecdsaNistP256Signature.sSig[1])); - } else { + } else if (ischosen(v_inner_ec_request_signed_for_pop.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { v_inner_ec_request_signed_for_pop.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig[1] := bit2oct('10101010'B xor4b oct2bit(v_inner_ec_request_signed_for_pop.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig[1])); + } else { + v_inner_ec_request_signed_for_pop.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig[1] := bit2oct('10101010'B xor4b oct2bit(v_inner_ec_request_signed_for_pop.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig[1])); } // Secure InnerEcRequestSignedForPoP message @@ -1640,7 +1642,7 @@ module LibItsPki_Functions { // Local variables var Oct32 v_public_key_x; var Oct32 v_public_key_y; - var EccP256CurvePoint v_eccP256_curve_point; + var PublicVerificationKey v_public_verification_key; log (">>> f_generate_inner_ec_request"); // Generate keys for the certificate to be requested @@ -1648,17 +1650,37 @@ module LibItsPki_Functions { log ("f_generate_inner_ec_request: failed to generate keys"); return false; } - if (p_compressed_mode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(p_public_key_compressed)); + // Build the Proof of Possession InnerEcRequest + if (PX_VE_ALG == e_nist_p256) { + var EccP256CurvePoint v_eccP256_curve_point; + if (p_compressed_mode == 0) { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(p_public_key_compressed)); + } else { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(p_public_key_compressed)); + } + v_public_verification_key := valueof(m_publicVerificationKey_ecdsaNistP256(v_eccP256_curve_point)); + } else if (PX_VE_ALG == e_brainpool_p256_r1) { + var EccP256CurvePoint v_eccP256_curve_point; + if (p_compressed_mode == 0) { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(p_public_key_compressed)); + } else { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(p_public_key_compressed)); + } + v_public_verification_key := valueof(m_publicVerificationKey_ecdsaBrainpoolP256r1(v_eccP256_curve_point)); } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(p_public_key_compressed)); + var EccP384CurvePoint v_eccP384_curve_point; + if (p_compressed_mode == 0) { + v_eccP384_curve_point := valueof(m_eccP384CurvePoint_compressed_y_0(p_public_key_compressed)); + } else { + v_eccP384_curve_point := valueof(m_eccP384CurvePoint_compressed_y_1(p_public_key_compressed)); + } + v_public_verification_key := valueof(m_publicVerificationKey_ecdsaBrainpoolP384r1(v_eccP384_curve_point)); } - // Build the Proof of Possession InnerEcRequest p_inner_ec_request := valueof( m_innerEcRequest( PICS_ITS_S_CANONICAL_ID, m_publicKeys( - m_publicVerificationKey_ecdsaNistP256(v_eccP256_curve_point) + v_public_verification_key ), m_certificateSubjectAttributes_id_name( oct2char(PICS_ITS_S_CANONICAL_ID), @@ -1702,7 +1724,10 @@ module LibItsPki_Functions { // Local variables var Oct32 v_public_key_x; var Oct32 v_public_key_y; - var EccP256CurvePoint v_eccP256_curve_point; + var octetstring v_private_key; + var octetstring v_public_key_compressed; + var integer v_compressed_mode; + var PublicVerificationKey v_public_verification_key; log (">>> f_generate_inner_ec_request_with_wrong_parameters"); // Generate keys for the certificate to be requested @@ -1711,33 +1736,47 @@ module LibItsPki_Functions { return false; } if (p_alter_private_key == false) { - if (p_compressed_mode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(p_public_key_compressed)); - } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(p_public_key_compressed)); - } + v_private_key := p_private_key; + v_public_key_compressed := p_public_key_compressed; + v_compressed_mode := p_compressed_mode; } else { - var octetstring v_private_key; - var octetstring v_public_key_compressed; - var integer v_compressed_mode; - log ("f_generate_inner_ec_request_with_wrong_parameters: Alter verify private key"); if (f_generate_key_pair(v_private_key, v_public_key_x, v_public_key_y, v_public_key_compressed, v_compressed_mode) == false) { log ("f_generate_inner_ec_request_with_wrong_parameters: failed to generate keys"); return false; } + } + // Build the Proof of Possession InnerEcRequest + if (PX_VE_ALG == e_nist_p256) { + var EccP256CurvePoint v_eccP256_curve_point; + if (v_compressed_mode == 0) { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_key_compressed)); + } else { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_key_compressed)); + } + v_public_verification_key := valueof(m_publicVerificationKey_ecdsaNistP256(v_eccP256_curve_point)); + } else if (PX_VE_ALG == e_brainpool_p256_r1) { + var EccP256CurvePoint v_eccP256_curve_point; if (v_compressed_mode == 0) { v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_key_compressed)); } else { v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_key_compressed)); } + v_public_verification_key := valueof(m_publicVerificationKey_ecdsaBrainpoolP256r1(v_eccP256_curve_point)); + } else { + var EccP384CurvePoint v_eccP384_curve_point; + if (v_compressed_mode == 0) { + v_eccP384_curve_point := valueof(m_eccP384CurvePoint_compressed_y_0(v_public_key_compressed)); + } else { + v_eccP384_curve_point := valueof(m_eccP384CurvePoint_compressed_y_1(v_public_key_compressed)); + } + v_public_verification_key := valueof(m_publicVerificationKey_ecdsaBrainpoolP384r1(v_eccP384_curve_point)); } - // Build the Proof of Possession InnerEcRequest p_inner_ec_request := valueof( m_innerEcRequest( PICS_ITS_S_CANONICAL_ID, m_publicKeys( - m_publicVerificationKey_ecdsaNistP256(v_eccP256_curve_point) + v_public_verification_key ), m_certificateSubjectAttributes_id_name( oct2char(p_canonical_id), @@ -1912,6 +1951,7 @@ module LibItsPki_Functions { var octetstring v_public_enc_key_y; var bitstring v_enc_value; var octetstring v_ec_hash; + var PublicVerificationKey v_public_verification_key; var Oct8 v_ec_hashed_id8; var octetstring public_enc_key_x; var octetstring public_enc_key_y; @@ -1925,7 +1965,6 @@ module LibItsPki_Functions { var octetstring v_tbs_signed; var Ieee1609Dot2Data v_signed_at_signature; var template (value) EccP256CurvePoint v_eccP256_curve_point; - var template (value) EccP256CurvePoint v_enc_eccP256_curve_point; var HashAlgorithm v_hashId; var Signature v_signature; var SequenceOfPsidSsp v_appPermissions := { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs @@ -2019,7 +2058,6 @@ module LibItsPki_Functions { log("f_generate_inner_at_request: v_tbs= ", v_tbs); // Signed ToBeSigned payload using the private key of EC certificate obtained from Enrolment request // In case of ITS-S privacy, v_signed_at_signature contained the data to be encrypted - // TODO Simplify with f_signWithEcdsa if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1)) { v_hashId := sha384; v_tbs_signed := f_signWithEcdsaBrainpoolp384WithSha384(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); @@ -2172,22 +2210,40 @@ module LibItsPki_Functions { p_inner_at_request.ecSignature := valueof(m_ec_signature_ext_payload(v_signed_at_signature)); } // Build the InnerAtRequest, EcSignature field is already set - if (p_compressed_key_mode == 0) { - v_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_0(v_public_key_x); - } else { - v_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_1(v_public_key_x); - } - if (p_compressed_enc_key_mode == 0) { - v_enc_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_0(v_public_enc_key_x); + if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256)) { + if (p_compressed_key_mode == 0) { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_key_x)); + } else { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_key_x)); + } + v_public_verification_key := valueof(m_publicVerificationKey_ecdsaNistP256(v_eccP256_curve_point)); + } else if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1)) { + if (p_compressed_key_mode == 0) { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_key_x)); + } else { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_key_x)); + } + v_public_verification_key := valueof(m_publicVerificationKey_ecdsaBrainpoolP256r1(v_eccP256_curve_point)); } else { - v_enc_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_1(v_public_enc_key_x); + var EccP384CurvePoint v_eccP384_curve_point; + if (p_compressed_key_mode == 0) { + v_eccP384_curve_point := valueof(m_eccP384CurvePoint_compressed_y_0(v_public_key_x)); + } else { + v_eccP384_curve_point := valueof(m_eccP384CurvePoint_compressed_y_1(v_public_key_x)); + } + v_public_verification_key := valueof(m_publicVerificationKey_ecdsaBrainpoolP384r1(v_eccP384_curve_point)); } if (PX_INCLUDE_ENCRYPTION_KEYS) { + var template (value) EccP256CurvePoint v_enc_eccP256_curve_point; + + if (p_compressed_enc_key_mode == 0) { + v_enc_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_0(v_public_enc_key_x); + } else { + v_enc_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_1(v_public_enc_key_x); + } p_inner_at_request.publicKeys := valueof( // The freshly generated public verification & encrypition keys to be used for the requested AT certificate m_publicKeys( - m_publicVerificationKey_ecdsaNistP256( - v_eccP256_curve_point - ), + v_public_verification_key, m_encryptionKey( // FIXME Encryption keys could be optional -, m_publicEncryptionKey_ecdsaNistP256(v_enc_eccP256_curve_point) @@ -2197,9 +2253,7 @@ module LibItsPki_Functions { } else { p_inner_at_request.publicKeys := valueof( // The freshly generated public verification keys to be used for the requested AT certificate m_publicKeys( - m_publicVerificationKey_ecdsaNistP256( - v_eccP256_curve_point - ) + v_public_verification_key ) ); } @@ -2236,6 +2290,7 @@ module LibItsPki_Functions { var octetstring v_public_enc_key_y; var bitstring v_enc_value; var octetstring v_ec_hash; + var PublicVerificationKey v_public_verification_key; var Oct8 v_ec_hashed_id8; var octetstring public_enc_key_x; var octetstring public_enc_key_y; @@ -2521,22 +2576,38 @@ module LibItsPki_Functions { p_inner_at_request.ecSignature := valueof(m_ec_signature_ext_payload(v_signed_at_signature)); } // Build the InnerAtRequest, EcSignature field is already set - if (p_compressed_key_mode == 0) { - v_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_0(v_public_key_x); - } else { - v_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_1(v_public_key_x); - } - if (p_compressed_enc_key_mode == 0) { - v_enc_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_0(v_public_enc_key_x); + if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256)) { + if (p_compressed_key_mode == 0) { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_key_x)); + } else { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_key_x)); + } + v_public_verification_key := valueof(m_publicVerificationKey_ecdsaNistP256(v_eccP256_curve_point)); + } else if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1)) { + if (p_compressed_key_mode == 0) { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_key_x)); + } else { + v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_key_x)); + } + v_public_verification_key := valueof(m_publicVerificationKey_ecdsaBrainpoolP256r1(v_eccP256_curve_point)); } else { - v_enc_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_1(v_public_enc_key_x); + var EccP384CurvePoint v_eccP384_curve_point; + if (p_compressed_key_mode == 0) { + v_eccP384_curve_point := valueof(m_eccP384CurvePoint_compressed_y_0(v_public_key_x)); + } else { + v_eccP384_curve_point := valueof(m_eccP384CurvePoint_compressed_y_1(v_public_key_x)); + } + v_public_verification_key := valueof(m_publicVerificationKey_ecdsaBrainpoolP384r1(v_eccP384_curve_point)); } if (PX_INCLUDE_ENCRYPTION_KEYS) { + if (p_compressed_enc_key_mode == 0) { + v_enc_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_0(v_public_enc_key_x); + } else { + v_enc_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_1(v_public_enc_key_x); + } p_inner_at_request.publicKeys := valueof( // The freshly generated public verification & encrypition keys to be used for the requested AT certificate m_publicKeys( - m_publicVerificationKey_ecdsaNistP256( - v_eccP256_curve_point - ), + v_public_verification_key, m_encryptionKey( // FIXME Encryption keys could be optional -, m_publicEncryptionKey_ecdsaNistP256(v_enc_eccP256_curve_point) @@ -2546,9 +2617,7 @@ module LibItsPki_Functions { } else { p_inner_at_request.publicKeys := valueof( // The freshly generated public verification keys to be used for the requested AT certificate m_publicKeys( - m_publicVerificationKey_ecdsaNistP256( - v_eccP256_curve_point - ) + v_public_verification_key ) ); } diff --git a/ttcn/Pki/LibItsPki_Pixits.ttcn b/ttcn/Pki/LibItsPki_Pixits.ttcn index eaf2245f..5e42170f 100644 --- a/ttcn/Pki/LibItsPki_Pixits.ttcn +++ b/ttcn/Pki/LibItsPki_Pixits.ttcn @@ -31,15 +31,15 @@ module LibItsPki_Pixits { modulepar Oct32 PX_EC_HASH := int2oct(0, 32); /** - * @desc Indicate which encryption algorithem to be used + * @desc Indicate which encryption algorithem to be used for Enrolment Credencial */ modulepar SecurityAlg PX_EC_ALG_FOR_EC := e_nist_p256; // TODO Use RCA to determine encryption algorithm? /** - * @desc Indicate which encryption algorithem to be used + * @desc Indicate which encryption algorithem to be used for Authorization Request */ modulepar SecurityAlg PX_EC_ALG_FOR_AT := e_nist_p256; /** - * @desc Indicate which encryption algorithem to be used + * @desc Indicate which encryption algorithem to be used for Authorization Validation Request */ modulepar SecurityAlg PX_EC_ALG_FOR_ATV := e_nist_p256; -- GitLab From 81624a5e373011bca6067a08d6ff63a2d3b4413b Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Thu, 10 Oct 2019 23:07:18 -0700 Subject: [PATCH 215/320] Bug fixed on Encryption algorithm support --- ttcn/Pki/LibItsPki_Functions.ttcn | 20 ++++++++++++++++---- ttcn/Security/LibItsSecurity_Templates.ttcn | 8 ++++---- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 2e210e24..3c1d4574 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -1952,6 +1952,7 @@ module LibItsPki_Functions { var bitstring v_enc_value; var octetstring v_ec_hash; var PublicVerificationKey v_public_verification_key; + var BasePublicEncryptionKey v_public_encryption_key; var Oct8 v_ec_hashed_id8; var octetstring public_enc_key_x; var octetstring public_enc_key_y; @@ -2241,13 +2242,18 @@ module LibItsPki_Functions { } else { v_enc_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_1(v_public_enc_key_x); } + if (PX_EC_ALG_FOR_AT == e_nist_p256) { + v_public_encryption_key := valueof(m_publicEncryptionKey_eciesNistP256(v_enc_eccP256_curve_point)); + } else { + v_public_encryption_key := valueof(m_publicEncryptionKey_eciesBrainpoolP256r1(v_enc_eccP256_curve_point)); + } p_inner_at_request.publicKeys := valueof( // The freshly generated public verification & encrypition keys to be used for the requested AT certificate m_publicKeys( v_public_verification_key, m_encryptionKey( // FIXME Encryption keys could be optional -, - m_publicEncryptionKey_ecdsaNistP256(v_enc_eccP256_curve_point) - ) + v_public_encryption_key + ) ) ); } else { @@ -2291,6 +2297,7 @@ module LibItsPki_Functions { var bitstring v_enc_value; var octetstring v_ec_hash; var PublicVerificationKey v_public_verification_key; + var BasePublicEncryptionKey v_public_encryption_key; var Oct8 v_ec_hashed_id8; var octetstring public_enc_key_x; var octetstring public_enc_key_y; @@ -2605,13 +2612,18 @@ module LibItsPki_Functions { } else { v_enc_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_1(v_public_enc_key_x); } + if (PX_EC_ALG_FOR_AT == e_nist_p256) { + v_public_encryption_key := valueof(m_publicEncryptionKey_eciesNistP256(v_enc_eccP256_curve_point)); + } else { + v_public_encryption_key := valueof(m_publicEncryptionKey_eciesBrainpoolP256r1(v_enc_eccP256_curve_point)); + } p_inner_at_request.publicKeys := valueof( // The freshly generated public verification & encrypition keys to be used for the requested AT certificate m_publicKeys( v_public_verification_key, m_encryptionKey( // FIXME Encryption keys could be optional -, - m_publicEncryptionKey_ecdsaNistP256(v_enc_eccP256_curve_point) - ) + v_public_encryption_key + ) ) ); } else { diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index 17390efd..350e6765 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -1675,17 +1675,17 @@ module LibItsSecurity_Templates { publicKey := p_publicKey } // End of template mw_encryptionKey - template (value) BasePublicEncryptionKey m_publicEncryptionKey_ecdsaNistP256( + template (value) BasePublicEncryptionKey m_publicEncryptionKey_eciesNistP256( in template (value) EccP256CurvePoint p_eciesNistP256 ) := { eciesNistP256 := p_eciesNistP256 - } // End of template m_publicEncryptionKey_ecdsaNistP256 + } // End of template m_publicEncryptionKey_eciesNistP256 - template (present) BasePublicEncryptionKey mw_publicEncryptionKey_ecdsaNistP256( + template (present) BasePublicEncryptionKey mw_publicEncryptionKey_eciesNistP256( template (present) EccP256CurvePoint p_eciesNistP256 := ? ) := { eciesNistP256 := p_eciesNistP256 - } // End of template mw_publicEncryptionKey_ecdsaNistP256 + } // End of template mw_publicEncryptionKey_eciesNistP256 template (value) BasePublicEncryptionKey m_publicEncryptionKey_eciesBrainpoolP256r1( in template (value) EccP256CurvePoint p_eciesBrainpoolP256r1 -- GitLab From b67bce648fa3f252a1ae5926446861abc9229b1c Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Sat, 12 Oct 2019 07:37:06 -0700 Subject: [PATCH 216/320] Add SSP check --- ttcn/Http/LibItsHttp_Templates.ttcn | 2 +- ttcn/Pki/LibItsPki_Functions.ttcn | 13 ++++- ttcn/Pki/LibItsPki_Pics.ttcn | 10 ++++ ttcn/Security/LibItsSecurity_Functions.ttcn | 62 ++++++++++++++++++++- 4 files changed, 84 insertions(+), 3 deletions(-) diff --git a/ttcn/Http/LibItsHttp_Templates.ttcn b/ttcn/Http/LibItsHttp_Templates.ttcn index 951198c6..33f1df9d 100644 --- a/ttcn/Http/LibItsHttp_Templates.ttcn +++ b/ttcn/Http/LibItsHttp_Templates.ttcn @@ -157,7 +157,7 @@ module LibItsHttp_Templates { version_major := 1, version_minor := 1, statuscode := 200, - statustext := "OK", + statustext := ?, header := p_header, body := p_body } // End of template mw_http_response_ok diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 0105222e..65772106 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -3370,9 +3370,13 @@ module LibItsPki_Functions { log("f_verify_ec_certificate: Signature not verified"); return false; } - + // TODO Check that requested information are present + if (f_verifySspPermissions(p_ec_certificate.toBeSigned.appPermissions, p_ea_certificate.toBeSigned.appPermissions) == false) { + log("f_verify_ec_certificate: Ssp permissions not verified"); + return false; + } return true; } // End of function f_verify_ec_certificate @@ -3412,6 +3416,13 @@ module LibItsPki_Functions { return false; } + // TODO Check that requested information are present + + if (f_verifySspPermissions(p_aa_certificate.toBeSigned.appPermissions, p_at_certificate.toBeSigned.appPermissions) == false) { + log("f_verify_ec_certificate: Ssp permissions not verified"); + return false; + } + return true; } // End of function f_verify_at_certificate diff --git a/ttcn/Pki/LibItsPki_Pics.ttcn b/ttcn/Pki/LibItsPki_Pics.ttcn index 2bb0ef7d..3daa8170 100644 --- a/ttcn/Pki/LibItsPki_Pics.ttcn +++ b/ttcn/Pki/LibItsPki_Pics.ttcn @@ -95,6 +95,16 @@ module LibItsPki_Pics { */ modulepar boolean PICS_ITS_S_WITH_PRIVACY := true; + /** + * @desc Set to true if the PKI configuration authorize to configure an external EA entity + */ + modulepar boolean PICS_SIMULTE_EA_ENTITY := false; + + /** + * @desc Set to true if the PKI configuration authorize to configure an external AA entity + */ + modulepar boolean PICS_SIMULTE_AA_ENTITY := false; + /** * @desc HTTP POST URI for InnerECRequest */ diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 189e6125..f7438c27 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -1993,7 +1993,7 @@ module LibItsSecurity_Functions { log(">>> f_verifyGnSecuredMessageSignatureWithCertificate: p_certificate=", p_certificate); if (f_getCertificateHash(valueof(p_certificate_id), v_issuer) == false) { - log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate id: " & p_certificate_id); + log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate id: " & valueof(p_certificate_id)); return false; } if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { @@ -2009,6 +2009,66 @@ module LibItsSecurity_Functions { } // End of group deviceSignatureHelpers + group sspPermissions { + + function f_verifySspPermissions( + in SequenceOfPsidSsp p_issuer_ssp_permissions, + in SequenceOfPsidSsp p_subordinate_ssp_permissions + ) return boolean { + // Local variables + var integer v_idx := 0; + + for (v_idx := 0; v_idx < lengthof(p_issuer_ssp_permissions); v_idx := v_idx + 1) { + var PsidSsp v_issuerPsidSsp := p_issuer_ssp_permissions[v_idx]; + var PsidSsp v_subordinatePsidSsp; + var boolean v_found := false; + var integer v_jdx := 0; + // 1. Check permission from issuer is present + for (v_jdx := 0; v_jdx < lengthof(p_subordinate_ssp_permissions); v_jdx := v_jdx + 1) { + if (match(v_issuerPsidSsp, m_appPermissions(p_subordinate_ssp_permissions[v_jdx].psid, p_subordinate_ssp_permissions[v_jdx].ssp)) == true) { + v_subordinatePsidSsp := p_subordinate_ssp_permissions[v_jdx]; + v_found := true; + break; + } + } // End of 'for' statement + if (v_found == false) { + log("f_verifySspPermissions: Permission set not found: ", v_issuerPsidSsp) + return false; + } + // 2. Validate bits mask + if (ispresent(v_issuerPsidSsp.ssp)) { + if (ispresent(v_subordinatePsidSsp.ssp) == false) { + log("f_verifySspPermissions: Ssp shall not be omitted: ", v_issuerPsidSsp) + return false; + } + if ((ischosen(v_issuerPsidSsp.ssp.bitmapSsp) == false) or (ischosen(v_subordinatePsidSsp.ssp.bitmapSsp) == false)) { + log("f_verifySspPermissions: Wrong variant : ", v_issuerPsidSsp.ssp, " / ", v_subordinatePsidSsp.ssp); + return false; + } + if (lengthof(v_issuerPsidSsp.ssp.bitmapSsp) < lengthof(v_subordinatePsidSsp.ssp.bitmapSsp)) { + log("f_verifySspPermissions: Ssp not be compliant: ", v_issuerPsidSsp.ssp, " / ", v_subordinatePsidSsp.ssp); + return false; + } else { + var charstring v_issuerSsp := bit2str(oct2bit(v_issuerPsidSsp.ssp.bitmapSsp)); + var charstring v_subordinateSsp := bit2str(oct2bit(v_subordinatePsidSsp.ssp.bitmapSsp)); + + for (var integer i := 0; i < lengthof(v_issuerSsp); i := i + 1) { + if (v_issuerSsp[i] == "1") { // TODO How to check Permission using SspBitmask/SspValue + if (v_subordinateSsp[i] != "1") { + log("f_verifySspPermissions: Ssp bitmask mismatch at index: ", i); + return false; + } + } // else, no restriction, subordinate certificate can have any value. + } // End of 'for' statement + } + } + } // End of 'for' statement + + return true; + } // End of function f_verifySspPermissions + + } // End of group sspPermissions + group messageGetters { /** -- GitLab From 1c22c3f6e75d4c7c2d4b5a9531cda61b0c831321 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Sat, 12 Oct 2019 08:12:28 -0700 Subject: [PATCH 217/320] Review TC_SECPKI_AA_AUTHVAL_RCV_01_BV --- ttcn/Pki/LibItsPki_Functions.ttcn | 163 ++++++++++++++++++-- ttcn/Pki/LibItsPki_TestSystem.ttcn | 2 +- ttcn/Security/LibItsSecurity_Functions.ttcn | 2 +- 3 files changed, 156 insertions(+), 11 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 3c1d4574..bcd35220 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -65,17 +65,29 @@ module LibItsPki_Functions { group pkiConfigurationFunctions { - function f_cfMtcUp( - out ItsPkiItss p_itss, - out ItsPkiHttp p_pki - ) runs on ItsMtc { + function f_cfMtcUp01( + out ItsPkiItss p_itss, + out ItsPkiHttp p_pki + ) runs on ItsMtc { p_itss := ItsPkiItss.create("IUT") alive; p_pki := ItsPkiHttp.create("TS") alive; connect(self:syncPort, mtc:syncPort); connect(p_itss:syncPort, self:syncPort); connect(p_pki:syncPort, self:syncPort); - } + } // End of function f_cfMtcUp01 + + function f_cfMtcUp02( + out ItsPkiHttp p_itss, + out ItsPkiHttp p_ea + ) runs on ServerSyncComp { + p_itss := ItsPkiItss.create("ITS-S") alive; + p_ea := ItsPkiHttp.create("EA") alive; + + connect(self:syncPort, mtc:syncPort); + connect(p_itss:syncPort, self:syncPort); + connect(p_ea:syncPort, self:syncPort); + } // End of function f_cfMtcUp02 /** * @desc Setups default configuration @@ -128,6 +140,100 @@ module LibItsPki_Functions { } } // End of function f_cfHttpUp + /** + * @desc Setups default configuration + * @param p_certificate_id The certificate identifier the TA shall use in case of secured IUT + */ + function f_cfHttpUp_itss( + in charstring p_ea_certificate_id := "CERT_TS_A_EA", // TODO Use a constant + in charstring p_aa_certificate_id := "CERT_TS_A_AA" + ) runs on ItsPkiHttp /* TITAN TODO: system ItsPkiHttpSystem */ { + + if (PICS_MULTIPLE_END_POINT == false) { + map(self:httpPort, system:httpPort); + } else { + map(self:httpEcPort, system:httpEcPort); + } + + f_initialiseSecuredMode(p_ea_certificate_id, p_aa_certificate_id); // TODO To be removed??? + + // Setup EA certificate shared with PKI EA entity + f_readCertificate(p_ea_certificate_id, vc_eaCertificate); + f_readSigningKey(p_ea_certificate_id, vc_eaPrivateKey); // TODO To be removed + f_readEncryptingKey(p_ea_certificate_id, vc_eaPrivateEncKey); + f_getCertificateDigest(p_ea_certificate_id, vc_eaHashedId8); + f_getCertificateHash(p_ea_certificate_id, vc_eaWholeHash); + log("f_cfHttpUp_itss: vc_eaPrivateKey= ", vc_eaPrivateKey); + log("f_cfHttpUp_itss: vc_eaPrivateEncKey= ", vc_eaPrivateEncKey); + log("f_cfHttpUp_itss: vc_eaHashedId8= ", vc_eaHashedId8); + log("f_cfHttpUp_itss: vc_eaWholeHash= ", vc_eaWholeHash); + + // Setup AA certificate shared with PKI AA entity + f_readCertificate(p_aa_certificate_id, vc_aaCertificate); + f_readSigningKey(p_aa_certificate_id, vc_aaPrivateKey); // Required for AuthorizationValidation request + f_readEncryptingKey(p_aa_certificate_id, vc_aaPrivateEncKey); + f_getCertificateDigest(p_aa_certificate_id, vc_aaHashedId8); + f_getCertificateHash(p_aa_certificate_id, vc_aaWholeHash); + log("f_cfHttpUp_itss: vc_aaPrivateKey= ", vc_aaPrivateKey); + log("f_cfHttpUp_itss: vc_aaPrivateEncKey= ", vc_aaPrivateEncKey); + log("f_cfHttpUp_itss: vc_aaHashedId8= ", vc_aaHashedId8); + log("f_cfHttpUp_itss: vc_aaWholeHash= ", vc_aaWholeHash); + + if (PICS_MULTIPLE_END_POINT == false) { + activate(a_default_pki_http()); + } else { + activate(a_default_pki_http_ec()); + } + } // End of function f_cfHttpUp_itss + + /** + * @desc Setups default configuration + * @param p_certificate_id The certificate identifier the TA shall use in case of secured IUT + */ + function f_cfHttpUp_ea( + in charstring p_ea_certificate_id := "CERT_TS_A_EA", // TODO Use a constant + in charstring p_aa_certificate_id := "CERT_TS_A_AA" + ) runs on ItsPkiHttp /* TITAN TODO: system ItsPkiHttpSystem */ { + + if (PICS_MULTIPLE_END_POINT == false) { + map(self:httpPort, system:httpPort); + } else { + map(self:httpAtVPort, system:httpAtVPort); + map(self:httpAtPort, system:httpAtPort); + } + + f_initialiseSecuredMode(p_ea_certificate_id, p_aa_certificate_id); // TODO To be removed??? + + // Setup EA certificate shared with PKI EA entity + f_readCertificate(p_ea_certificate_id, vc_eaCertificate); + f_readSigningKey(p_ea_certificate_id, vc_eaPrivateKey); // TODO To be removed + f_readEncryptingKey(p_ea_certificate_id, vc_eaPrivateEncKey); + f_getCertificateDigest(p_ea_certificate_id, vc_eaHashedId8); + f_getCertificateHash(p_ea_certificate_id, vc_eaWholeHash); + log("f_cfHttpUp_ea: vc_eaPrivateKey= ", vc_eaPrivateKey); + log("f_cfHttpUp_ea: vc_eaPrivateEncKey= ", vc_eaPrivateEncKey); + log("f_cfHttpUp_ea: vc_eaHashedId8= ", vc_eaHashedId8); + log("f_cfHttpUp_ea: vc_eaWholeHash= ", vc_eaWholeHash); + + // Setup AA certificate shared with PKI AA entity + f_readCertificate(p_aa_certificate_id, vc_aaCertificate); + f_readSigningKey(p_aa_certificate_id, vc_aaPrivateKey); // Required for AuthorizationValidation request + f_readEncryptingKey(p_aa_certificate_id, vc_aaPrivateEncKey); + f_getCertificateDigest(p_aa_certificate_id, vc_aaHashedId8); + f_getCertificateHash(p_aa_certificate_id, vc_aaWholeHash); + log("f_cfHttpUp_ea: vc_aaPrivateKey= ", vc_aaPrivateKey); + log("f_cfHttpUp_ea: vc_aaPrivateEncKey= ", vc_aaPrivateEncKey); + log("f_cfHttpUp_ea: vc_aaHashedId8= ", vc_aaHashedId8); + log("f_cfHttpUp_ea: vc_aaWholeHash= ", vc_aaWholeHash); + + if (PICS_MULTIPLE_END_POINT == false) { + activate(a_default_pki_http()); + } else { + activate(a_default_pki_http_atv()); + activate(a_default_pki_http_at()); + } + } // End of function f_cfHttpUp_ea + function f_cfUp_itss( in charstring p_certificate_id := "CERT_TS_A_EA" // TODO Use a constant ) runs on ItsPkiItss /* TITAN TODO: system ItsPkiItssSystem */ { @@ -144,10 +250,10 @@ module LibItsPki_Functions { /** * @desc Deletes default configuration */ - function f_cfMtcDown( - inout ItsPkiItss p_itss, - inout ItsPkiHttp p_pki - ) runs on ItsMtc { + function f_cfMtcDown01( + inout ItsPkiItss p_itss, + inout ItsPkiHttp p_pki + ) runs on ItsMtc { disconnect(self:syncPort, mtc:syncPort); disconnect(p_itss:syncPort, self:syncPort); disconnect(p_pki:syncPort, self:syncPort); @@ -156,6 +262,18 @@ module LibItsPki_Functions { p_pki.done; } + function f_cfMtcDown02( + inout ItsPkiHttp p_itss, + inout ItsPkiHttp p_ea + ) runs on ServerSyncComp { + disconnect(self:syncPort, mtc:syncPort); + disconnect(p_itss:syncPort, self:syncPort); + disconnect(p_ea:syncPort, self:syncPort); + + p_itss.done; + p_ea.done; + } + /** * @desc Deletes default configuration */ @@ -171,6 +289,33 @@ module LibItsPki_Functions { f_uninitialiseSecuredMode(); } // End of function f_cfHttpDown + /** + * @desc Deletes default configuration + */ + function f_cfHttpDown_itss() runs on ItsPkiHttp /* TITAN TODO: system ItsPkiHttpSystem */ { + if (PICS_MULTIPLE_END_POINT == false) { + unmap(self:httpPort, system:httpPort); + } else { + unmap(self:httpEcPort, system:httpEcPort); + } + f_disconnect4SelfOrClientSync(); + f_uninitialiseSecuredMode(); + } // End of function f_cfHttpDown_itss + + /** + * @desc Deletes default configuration + */ + function f_cfHttpDown_ea() runs on ItsPkiHttp /* TITAN TODO: system ItsPkiHttpSystem */ { + if (PICS_MULTIPLE_END_POINT == false) { + unmap(self:httpPort, system:httpPort); + } else { + unmap(self:httpAtVPort, system:httpAtVPort); + unmap(self:httpAtPort, system:httpAtPort); + } + f_disconnect4SelfOrClientSync(); + f_uninitialiseSecuredMode(); + } // End of function f_cfHttpDown_ea + /** * @desc Deletes default configuration */ diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index 71a8a515..4f957877 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -82,7 +82,7 @@ module LibItsPki_TestSystem { var octetstring vc_aaPrivateEncKey; /** Test Adapter AA private key for encryption */ var HashedId8 vc_aaHashedId8; /** Test Adapter AA HashedId8 for decryption of IUT's response */ var octetstring vc_aaWholeHash; /** Test Adapter AA whole-hash for signature check */ - } // End of component ItsPki + } // End of component ItsPkiHttp /** * @desc Test component for ITS-S entity diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 189e6125..4b827708 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -1993,7 +1993,7 @@ module LibItsSecurity_Functions { log(">>> f_verifyGnSecuredMessageSignatureWithCertificate: p_certificate=", p_certificate); if (f_getCertificateHash(valueof(p_certificate_id), v_issuer) == false) { - log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate id: " & p_certificate_id); + log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate id: " & valueof(p_certificate_id)); return false; } if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { -- GitLab From 969b2095a7263b6f5f405650d2d985b92b587d47 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Mon, 4 Nov 2019 08:25:24 -0800 Subject: [PATCH 218/320] ITS CMS-7 Plugtest bug fixes --- ttcn/Pki/LibItsPki_Functions.ttcn | 141 +++++++------------- ttcn/Pki/LibItsPki_Pics.ttcn | 2 +- ttcn/Pki/LibItsPki_Pixits.ttcn | 4 + ttcn/Pki/LibItsPki_Templates.ttcn | 30 +++-- ttcn/Security/LibItsSecurity_Functions.ttcn | 36 ++++- 5 files changed, 102 insertions(+), 111 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 9d50b19b..de7706f2 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -152,7 +152,7 @@ module LibItsPki_Functions { if (PICS_MULTIPLE_END_POINT == false) { map(self:httpPort, system:httpPort); } else { - map(self:httpEcPort, system:httpEcPort); + map(self:httpAtPort, system:httpAtPort); } f_initialiseSecuredMode(p_ea_certificate_id, p_aa_certificate_id); // TODO To be removed??? @@ -182,7 +182,7 @@ module LibItsPki_Functions { if (PICS_MULTIPLE_END_POINT == false) { activate(a_default_pki_http()); } else { - activate(a_default_pki_http_ec()); + activate(a_default_pki_http_at()); } } // End of function f_cfHttpUp_itss @@ -199,7 +199,6 @@ module LibItsPki_Functions { map(self:httpPort, system:httpPort); } else { map(self:httpAtVPort, system:httpAtVPort); - map(self:httpAtPort, system:httpAtPort); } f_initialiseSecuredMode(p_ea_certificate_id, p_aa_certificate_id); // TODO To be removed??? @@ -296,7 +295,7 @@ module LibItsPki_Functions { if (PICS_MULTIPLE_END_POINT == false) { unmap(self:httpPort, system:httpPort); } else { - unmap(self:httpEcPort, system:httpEcPort); + unmap(self:httpAtPort, system:httpAtPort); } f_disconnect4SelfOrClientSync(); f_uninitialiseSecuredMode(); @@ -310,7 +309,6 @@ module LibItsPki_Functions { unmap(self:httpPort, system:httpPort); } else { unmap(self:httpAtVPort, system:httpAtVPort); - unmap(self:httpAtPort, system:httpAtPort); } f_disconnect4SelfOrClientSync(); f_uninitialiseSecuredMode(); @@ -1116,6 +1114,7 @@ module LibItsPki_Functions { in boolean p_alter_ea_id := false, in template (omit) Time32 p_start := omit, in template (omit) Duration p_duration := omit, + in template (omit) Time64 p_generation_time := omit, out octetstring p_private_key, out octetstring p_public_key_compressed, out integer p_compressed_key_mode, @@ -1151,7 +1150,7 @@ module LibItsPki_Functions { log("f_http_build_authorization_request_with_wrong_parameters: Altered eaId= ", v_ea_hashed_id8); v_ret_code := f_generate_inner_at_request(vc_aaCertificate, vc_aaHashedId8, vc_eaCertificate, vc_eaWholeHash/*salt*/, v_ea_hashed_id8, p_ec_certificate, p_ec_private_key, p_private_key, p_public_key_compressed, p_compressed_key_mode, p_private_enc_key, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_inner_at_request); } else { - v_ret_code := f_generate_inner_at_request_with_wrong_parameters(vc_aaCertificate, vc_aaHashedId8, vc_eaCertificate, vc_eaWholeHash/*salt*/, vc_eaHashedId8, p_ec_certificate, p_ec_private_key, p_alter_hmac, p_alter_signer_digest, p_start, p_duration, p_private_key, p_public_key_compressed, p_compressed_key_mode, p_private_enc_key, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_inner_at_request); + v_ret_code := f_generate_inner_at_request_with_wrong_parameters(vc_aaCertificate, vc_aaHashedId8, vc_eaCertificate, vc_eaWholeHash/*salt*/, vc_eaHashedId8, p_ec_certificate, p_ec_private_key, p_alter_hmac, p_alter_signer_digest, p_start, p_duration, p_generation_time, p_private_key, p_public_key_compressed, p_compressed_key_mode, p_private_enc_key, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_inner_at_request); } if (v_ret_code == false) { log("*** f_http_build_authorization_request_with_wrong_parameters: ERROR: Failed to generate AuthorizationValidationRequest ***"); @@ -1338,20 +1337,20 @@ module LibItsPki_Functions { } // End of function f_http_build_authorization_validation_request function f_http_build_invalid_authorization_validation_request( - in InnerAtRequest p_inner_at_request, - in octetstring p_public_key_compressed, - in integer p_compressed_key_mode, - in octetstring p_private_enc_key, - in octetstring p_public_compressed_enc_key, - in integer p_compressed_enc_key_mode, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce, - out octetstring p_salt, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, - out Oct32 p_request_hash - ) runs on ItsPkiHttp { + in InnerAtRequest p_inner_at_request, + in octetstring p_public_key_compressed, + in integer p_compressed_key_mode, + in octetstring p_private_enc_key, + in octetstring p_public_compressed_enc_key, + in integer p_compressed_enc_key_mode, + out Oct16 p_aes_sym_key, + out Oct16 p_encrypted_sym_key, + out Oct16 p_authentication_vector, + out Oct12 p_nonce, + out octetstring p_salt, + out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, + out Oct32 p_request_hash + ) runs on ItsPkiHttp { // Local variables var AuthorizationValidationRequest v_authorization_validation_request; var bitstring v_authorization_validation_request_msg; @@ -1387,7 +1386,7 @@ module LibItsPki_Functions { } // End of function f_http_build_invalid_authorization_validation_request function f_http_build_authorization_validation_response( - in InnerAtRequest p_inner_at_request, + in SharedAtRequest p_shared_at_request, in AuthorizationValidationResponseCode p_responseCode := ok, in Oct16 p_request_hash, in octetstring p_private_key := ''O, @@ -1404,7 +1403,7 @@ module LibItsPki_Functions { var EtsiTs103097Certificate v_at_certificate; var boolean p_result := false; - log(">>> f_http_build_authorization_validation_response: p_inner_at_request= ", p_inner_at_request); + log(">>> f_http_build_authorization_validation_response: p_shared_at_request= ", p_shared_at_request); log(">>> f_http_build_authorization_validation_response: p_responseCode= ", p_responseCode); log(">>> f_http_build_authorization_validation_response: p_request_hash= ", p_request_hash); log(">>> f_http_build_authorization_validation_response: p_private_key= ", p_private_key); @@ -1423,7 +1422,7 @@ module LibItsPki_Functions { } else { p_authorization_validation_response := valueof(m_authorizationValidationResponse_ok( p_request_hash, - p_inner_at_request.sharedAtRequest.requestedSubjectAttributes + p_shared_at_request.requestedSubjectAttributes ) ); } @@ -1919,16 +1918,16 @@ module LibItsPki_Functions { } p_inner_ec_request := valueof( m_innerEcRequest( - PICS_ITS_S_CANONICAL_ID, + p_canonical_id, m_publicKeys( v_public_verification_key ), m_certificateSubjectAttributes_id_name( - oct2char(p_canonical_id), + oct2char(PICS_ITS_S_CANONICAL_ID), p_appPermissions, // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs m_validityPeriod( p_start, - m_duration_in_hours(PX_GENERATED_CERTIFICATE_DURATION) + p_duration ), m_geographicRegion_identifiedRegion( { @@ -2181,7 +2180,7 @@ module LibItsPki_Functions { v_key_tag, // Calculated keyTag valueof( m_certificate_subject_attributes( // FIXME Review subjectPermissions - v_appPermissions,//p_ec_certificate.toBeSigned.appPermissions, + v_appPermissions, p_ec_certificate.toBeSigned.certRequestPermissions, { none_ := NULL },//p_ec_certificate.toBeSigned.id, p_ec_certificate.toBeSigned.validityPeriod, @@ -2426,6 +2425,7 @@ module LibItsPki_Functions { in boolean p_alter_signer_digest := false, in template (omit) Time32 p_start := omit, in template (omit) Duration p_duration := omit, + in template (omit) Time64 p_generation_time := omit, out octetstring p_private_key, out octetstring p_public_key_compressed, out integer p_compressed_key_mode, @@ -2461,10 +2461,10 @@ module LibItsPki_Functions { var Signature v_signature; var Time32 v_start; var Duration v_duration; - /*var SequenceOfPsidSsp v_appPermissions := { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs + var SequenceOfPsidSsp v_appPermissions := { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs valueof(m_appPermissions(c_its_aid_CAM, { bitmapSsp := PX_INNER_AT_CERTFICATE_BITMAP_SSP_CAM })), valueof(m_appPermissions(c_its_aid_DENM, { bitmapSsp := PX_INNER_AT_CERTFICATE_BITMAP_SSP_DENM })) - };*/ + }; // Generate verification keys for the certificate to be requested if (f_generate_key_pair(p_private_key, v_public_key_x, v_public_key_y, p_public_key_compressed, p_compressed_key_mode) == false) { @@ -2552,7 +2552,7 @@ module LibItsPki_Functions { v_key_tag, // Calculated keyTag valueof( m_certificate_subject_attributes( - p_ec_certificate.toBeSigned.appPermissions,//v_appPermissions, + v_appPermissions, p_ec_certificate.toBeSigned.certRequestPermissions, { none_ := NULL },//p_ec_certificate.toBeSigned.id, m_validityPeriod(v_start, v_duration), @@ -2566,13 +2566,23 @@ module LibItsPki_Functions { log("f_generate_inner_at_request_with_wrong_parameters: v_hash_shared_at_request= ", v_hash_shared_at_request); // Build the ETsiTs103097Data-SignedExternalPayload - v_tbs := m_toBeSignedData( - m_signedDataPayload_ext(v_hash_shared_at_request), // Payload containing extDataHash - m_headerInfo_inner_pki_request( // HeaderInfo - -, - (f_getCurrentTime()) * 1000) //us - ); - log("f_generate_inner_at_request_with_wrong_parameters: v_tbs= ", v_tbs); + if (ispresent(p_generation_time)) { + v_tbs := m_toBeSignedData( + m_signedDataPayload_ext(v_hash_shared_at_request), // Payload containing extDataHash + m_headerInfo_inner_pki_request( // HeaderInfo + -, + valueof(p_generation_time) * 1000) //us + ); + log("f_generate_inner_at_request_with_wrong_parameters: Altered generation time: v_tbs= ", v_tbs); + } else { + v_tbs := m_toBeSignedData( + m_signedDataPayload_ext(v_hash_shared_at_request), // Payload containing extDataHash + m_headerInfo_inner_pki_request( // HeaderInfo + -, + f_getCurrentTime() * 1000) //us + ); + log("f_generate_inner_at_request_with_wrong_parameters: v_tbs= ", v_tbs); + } // Signed ToBeSigned payload using the private key of EC certificate obtained from Enrolment request // In case of ITS-S privacy, v_signed_at_signature contained the data to be encrypted // TODO Simplify with f_signWithEcdsa @@ -3588,58 +3598,9 @@ module LibItsPki_Functions { // 4. Verifiy signature log("f_verify_pki_request_message: v_ieee1609dot2_signed_data.content.signedData.tbsData= ", v_ieee1609dot2_signed_data.content.signedData.tbsData); v_msg := bit2oct(encvalue(v_ieee1609dot2_signed_data.content.signedData.tbsData)); - if (p_issuer == ''O) { // ITS-S/OBU - var PublicVerificationKey v_public_verification_key; - - log("f_verify_pki_request_message: Use ITS-S technical keys"); - if (PX_VE_ALG == e_nist_p256) { - var EccP256CurvePoint v_ecc_p256_curve_point; - - if (PICS_ITS_S_SIGN_NISTP256_PUBLIC_KEY[0] == '02'O) { - v_ecc_p256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(substr(PICS_ITS_S_SIGN_NISTP256_PUBLIC_KEY, 1, 32))); - } else { - v_ecc_p256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(substr(PICS_ITS_S_SIGN_NISTP256_PUBLIC_KEY, 1, 32))); - } - v_public_verification_key := valueof( - m_publicVerificationKey_ecdsaNistP256( - v_ecc_p256_curve_point - ) - ); - } else if (PX_VE_ALG == e_brainpool_p256_r1) { - var EccP256CurvePoint v_ecc_p256_curve_point; - - if (PICS_ITS_S_SIGN_BRAINPOOLP256r1_PUBLIC_KEY[0] == '02'O) { - v_ecc_p256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(substr(PICS_ITS_S_SIGN_BRAINPOOLP256r1_PUBLIC_KEY, 1, 32))); - } else { - v_ecc_p256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(substr(PICS_ITS_S_SIGN_BRAINPOOLP256r1_PUBLIC_KEY, 1, 32))); - } - v_public_verification_key := valueof( - m_publicVerificationKey_ecdsaBrainpoolP256r1( - v_ecc_p256_curve_point - ) - ); - } else if (PX_VE_ALG == e_brainpool_p384_r1) { - var EccP384CurvePoint v_ecc_p384_curve_point; - - if (PICS_ITS_S_SIGN_BRAINPOOLP384r1_PUBLIC_KEY[0] == '02'O) { - v_ecc_p384_curve_point := valueof(m_eccP384CurvePoint_compressed_y_0(substr(PICS_ITS_S_SIGN_BRAINPOOLP384r1_PUBLIC_KEY, 1, 48))); - } else { - v_ecc_p384_curve_point := valueof(m_eccP384CurvePoint_compressed_y_1(substr(PICS_ITS_S_SIGN_BRAINPOOLP384r1_PUBLIC_KEY, 1, 48))); - } - v_public_verification_key := valueof( - m_publicVerificationKey_ecdsaBrainpoolP384r1( - v_ecc_p384_curve_point - ) - ); - } else { - return false; - } - log("f_verify_pki_request_message: v_public_verification_key= ", v_public_verification_key); - if (f_verifyEcdsa(v_msg, int2oct(0, 32), v_ieee1609dot2_signed_data.content.signedData.signature_, v_public_verification_key) == false) { - if (p_check_security == true) { - return false; - } - } + if (p_issuer == ''O) { + log("f_verify_pki_request_message: Invalid issuer value"); + return false; } else { if (f_getCertificateFromDigest(f_HashedId8FromSha256(p_issuer), v_certificate) == false) { if (p_check_security == true) { @@ -3801,7 +3762,6 @@ module LibItsPki_Functions { } // Check EC certificate signature - // TODO Who sign the EC certificate? if (f_verifyCertificateSignatureWithPublicKey(p_ec_certificate, p_ea_certificate.toBeSigned.verifyKeyIndicator.verificationKey) == false) { log("f_verify_ec_certificate: Signature not verified"); return false; @@ -3846,7 +3806,6 @@ module LibItsPki_Functions { } // Check EC certificate signature - // TODO Who sign the EC certificate? if (f_verifyCertificateSignatureWithPublicKey(p_at_certificate, p_aa_certificate.toBeSigned.verifyKeyIndicator.verificationKey) == false) { log("f_verify_at_certificate: Signature not verified"); return false; diff --git a/ttcn/Pki/LibItsPki_Pics.ttcn b/ttcn/Pki/LibItsPki_Pics.ttcn index ba017f2e..60349f20 100644 --- a/ttcn/Pki/LibItsPki_Pics.ttcn +++ b/ttcn/Pki/LibItsPki_Pics.ttcn @@ -199,6 +199,6 @@ module LibItsPki_Pics { /** * @desc Invalid Canonical ITSS-S identifier */ - modulepar octetstring PICS_INVALID_ITS_S_CANONICAL_ID := '0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A'O; + modulepar octetstring PICS_INVALID_ITS_S_CANONICAL_ID := 'BABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABA'O; } // End of module LibItsPki_Pics diff --git a/ttcn/Pki/LibItsPki_Pixits.ttcn b/ttcn/Pki/LibItsPki_Pixits.ttcn index 5e42170f..e710bd46 100644 --- a/ttcn/Pki/LibItsPki_Pixits.ttcn +++ b/ttcn/Pki/LibItsPki_Pixits.ttcn @@ -52,6 +52,10 @@ module LibItsPki_Pixits { modulepar octetstring PX_INNER_EC_CERTFICATE_INCORRECT_BITMAP_SSP_SCR := '01FF'O; + modulepar octetstring PX_INNER_EC_CERTFICATE_INCORRECT_BITMAP_SSP_SCR_WRONG_VERSION := '00C0'O; + + modulepar octetstring PX_INNER_EC_CERTFICATE_INCORRECT_BITMAP_SSP_SCR_WRONG_SSP_BIT := '0180'O; + modulepar octetstring PX_INNER_EC_CERTFICATE_BITMAP_SSP_CAM := '830001'O; modulepar octetstring PX_INNER_EC_CERTFICATE_BITMAP_SSP_DENM := '830001'O; diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn index 9e2f3312..004bd781 100644 --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ b/ttcn/Pki/LibItsPki_Templates.ttcn @@ -190,10 +190,16 @@ module LibItsPki_Templates { authorizationResponse := p_authorizationResponse } // End of template mw_authorizationResponse + template (present) EtsiTs102941DataContent mw_authorizationValidationRequest( + template (present) AuthorizationValidationRequest p_authorization_validation_request := ? + ) := { + authorizationValidationRequest := p_authorization_validation_request + } // End of template mw_authorizationValidationRequest + template (present) EtsiTs102941DataContent mw_authorizationValidationResponse( - template (present) AuthorizationValidationResponse p_authorization_alidation_response := ? + template (present) AuthorizationValidationResponse p_authorization_validation_response := ? ) := { - authorizationValidationResponse := p_authorization_alidation_response + authorizationValidationResponse := p_authorization_validation_response } // End of template mw_authorizationValidationResponse template (value) InnerEcRequest m_innerEcRequest( @@ -359,21 +365,21 @@ module LibItsPki_Templates { certificate := omit } // End of template mw_innerAtResponse_ko - template (value) AuthorizationValidationRequest m_authorizationValidationRequest( - in template (value) SharedAtRequest p_sharedAtRequest, - in template (value) EcSignature p_ecSignature - ) := { + template (value) AuthorizationValidationRequest m_authorization_validation_request( + in template (value) SharedAtRequest p_sharedAtRequest, + in template (value) EcSignature p_ecSignature + ) := { sharedAtRequest := p_sharedAtRequest, ecSignature := p_ecSignature - } // End of template m_authorizationValidationRequest + } // End of template m_authorization_validation_request - template (present) AuthorizationValidationRequest mw_authorizationValidationRequest( - template (present) SharedAtRequest p_sharedAtRequest := ?, - template (present) EcSignature p_ecSignature := ? - ) := { + template (present) AuthorizationValidationRequest mw_authorization_validation_request( + template (present) SharedAtRequest p_sharedAtRequest := ?, + template (present) EcSignature p_ecSignature := ? + ) := { sharedAtRequest := p_sharedAtRequest, ecSignature := p_ecSignature - } // End of template mw_authorizationValidationRequest + } // End of template mw_authorization_validation_request template (value) AuthorizationValidationResponse m_authorizationValidationResponse_ok( template (value) Oct16 p_requestHash, diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index f7438c27..17251d95 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -2012,19 +2012,31 @@ module LibItsSecurity_Functions { group sspPermissions { function f_verifySspPermissions( - in SequenceOfPsidSsp p_issuer_ssp_permissions, - in SequenceOfPsidSsp p_subordinate_ssp_permissions + in SequenceOfPsidSsp p_issuer_ssp_permissions, + in SequenceOfPsidSsp p_subordinate_ssp_permissions, + in boolean p_strict_checks := false ) return boolean { // Local variables var integer v_idx := 0; + log(">>> f_verifySspPermissions: p_issuer_ssp_permissions:", p_issuer_ssp_permissions); + log(">>> f_verifySspPermissions: p_subordinate_ssp_permissions: ", p_subordinate_ssp_permissions); + for (v_idx := 0; v_idx < lengthof(p_issuer_ssp_permissions); v_idx := v_idx + 1) { var PsidSsp v_issuerPsidSsp := p_issuer_ssp_permissions[v_idx]; var PsidSsp v_subordinatePsidSsp; var boolean v_found := false; var integer v_jdx := 0; + log("f_verifySspPermissions: v_issuerPsidSsp: ", v_issuerPsidSsp); // 1. Check permission from issuer is present for (v_jdx := 0; v_jdx < lengthof(p_subordinate_ssp_permissions); v_jdx := v_jdx + 1) { + log("f_verifySspPermissions: match=", match(v_issuerPsidSsp, m_appPermissions(p_subordinate_ssp_permissions[v_jdx].psid, p_subordinate_ssp_permissions[v_jdx].ssp))); + // 1. Check the version + if (p_subordinate_ssp_permissions[v_jdx].ssp.bitmapSsp[0] != '01'O) { + log("f_verifySspPermissions: Wrong SSP version control (1 is expected): ", p_subordinate_ssp_permissions[v_jdx].ssp.bitmapSsp[0]); + return false; + } + // 2. Check the version if (match(v_issuerPsidSsp, m_appPermissions(p_subordinate_ssp_permissions[v_jdx].psid, p_subordinate_ssp_permissions[v_jdx].ssp)) == true) { v_subordinatePsidSsp := p_subordinate_ssp_permissions[v_jdx]; v_found := true; @@ -2033,21 +2045,31 @@ module LibItsSecurity_Functions { } // End of 'for' statement if (v_found == false) { log("f_verifySspPermissions: Permission set not found: ", v_issuerPsidSsp) - return false; + if (p_strict_checks == true) { + return false; + } else { + return true; + } } // 2. Validate bits mask if (ispresent(v_issuerPsidSsp.ssp)) { if (ispresent(v_subordinatePsidSsp.ssp) == false) { log("f_verifySspPermissions: Ssp shall not be omitted: ", v_issuerPsidSsp) - return false; + if (p_strict_checks == true) { + return false; + } } if ((ischosen(v_issuerPsidSsp.ssp.bitmapSsp) == false) or (ischosen(v_subordinatePsidSsp.ssp.bitmapSsp) == false)) { - log("f_verifySspPermissions: Wrong variant : ", v_issuerPsidSsp.ssp, " / ", v_subordinatePsidSsp.ssp); - return false; + log("f_verifySspPermissions: Wrong variant : ", v_issuerPsidSsp, " / ", v_subordinatePsidSsp); + if (p_strict_checks == true) { + return false; + } } if (lengthof(v_issuerPsidSsp.ssp.bitmapSsp) < lengthof(v_subordinatePsidSsp.ssp.bitmapSsp)) { log("f_verifySspPermissions: Ssp not be compliant: ", v_issuerPsidSsp.ssp, " / ", v_subordinatePsidSsp.ssp); - return false; + if (p_strict_checks == true) { + return false; + } } else { var charstring v_issuerSsp := bit2str(oct2bit(v_issuerPsidSsp.ssp.bitmapSsp)); var charstring v_subordinateSsp := bit2str(oct2bit(v_subordinatePsidSsp.ssp.bitmapSsp)); -- GitLab From bb6317e2ebaa3fe42f2917f8e2a57a49719f15c9 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Mon, 11 Nov 2019 11:35:57 +0100 Subject: [PATCH 219/320] Add PATCH templates --- ttcn/Http/LibItsHttp_Templates.ttcn | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ttcn/Http/LibItsHttp_Templates.ttcn b/ttcn/Http/LibItsHttp_Templates.ttcn index 6e73acaf..626179e0 100644 --- a/ttcn/Http/LibItsHttp_Templates.ttcn +++ b/ttcn/Http/LibItsHttp_Templates.ttcn @@ -102,6 +102,22 @@ module LibItsHttp_Templates { method := "POST" } // End of template mw_http_request_post + template (omit) Request m_http_request_patch( + in charstring p_uri, + in template (value) HeaderLines p_headers, + in template (omit) HttpMessageBody p_body := omit + ) modifies m_http_request_get := { + method := "PATCH" + } // End of template m_http_request_patch + + template Request mw_http_request_patch( + template (present) charstring p_uri := ?, + template (present) HeaderLines p_headers := ?, + template HttpMessageBody p_body := * + ) modifies mw_http_request_get := { + method := "PATCH" + } // End of template mw_http_request_patch + template (omit) Request m_http_request_put( in charstring p_uri, in template (value) HeaderLines p_headers, -- GitLab From c591ac73cc122b084df72503274e124387c1e241 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Mon, 18 Nov 2019 13:30:19 +0100 Subject: [PATCH 220/320] Update after ETSI ITS CMS-7 --- ttcn/Pki/LibItsPki_Functions.ttcn | 142 +++++++++++++------- ttcn/Pki/LibItsPki_Pixits.ttcn | 8 +- ttcn/Pki/LibItsPki_Templates.ttcn | 11 +- ttcn/Pki/LibItsPki_TestSystem.ttcn | 2 + ttcn/Security/LibItsSecurity_Functions.ttcn | 50 +++++-- 5 files changed, 152 insertions(+), 61 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index de7706f2..2f039393 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -115,10 +115,12 @@ module LibItsPki_Functions { f_readEncryptingKey(p_ea_certificate_id, vc_eaPrivateEncKey); f_getCertificateDigest(p_ea_certificate_id, vc_eaHashedId8); f_getCertificateHash(p_ea_certificate_id, vc_eaWholeHash); + f_getCertificateHash256(p_ea_certificate_id, vc_eaWholeHash256); log("f_cfHttpUp: vc_eaPrivateKey= ", vc_eaPrivateKey); log("f_cfHttpUp: vc_eaPrivateEncKey= ", vc_eaPrivateEncKey); log("f_cfHttpUp: vc_eaHashedId8= ", vc_eaHashedId8); log("f_cfHttpUp: vc_eaWholeHash= ", vc_eaWholeHash); + log("f_cfHttpUp: vc_eaWholeHash256= ", vc_eaWholeHash256); // Setup AA certificate shared with PKI AA entity f_readCertificate(p_aa_certificate_id, vc_aaCertificate); @@ -126,10 +128,12 @@ module LibItsPki_Functions { f_readEncryptingKey(p_aa_certificate_id, vc_aaPrivateEncKey); f_getCertificateDigest(p_aa_certificate_id, vc_aaHashedId8); f_getCertificateHash(p_aa_certificate_id, vc_aaWholeHash); + f_getCertificateHash256(p_aa_certificate_id, vc_aaWholeHash256); log("f_cfHttpUp: vc_aaPrivateKey= ", vc_aaPrivateKey); log("f_cfHttpUp: vc_aaPrivateEncKey= ", vc_aaPrivateEncKey); log("f_cfHttpUp: vc_aaHashedId8= ", vc_aaHashedId8); log("f_cfHttpUp: vc_aaWholeHash= ", vc_aaWholeHash); + log("f_cfHttpUp: vc_aaWholeHash256= ", vc_aaWholeHash256); if (PICS_MULTIPLE_END_POINT == false) { activate(a_default_pki_http()); @@ -512,7 +516,11 @@ module LibItsPki_Functions { } else if (PX_VE_ALG == e_brainpool_p256_r1) { return f_signWithEcdsaBrainpoolp256WithSha256(p_toBeSignedSecuredMessage, p_certificateIssuer, p_privateKey); } else if (PX_VE_ALG == e_brainpool_p384_r1) { - return f_signWithEcdsaBrainpoolp384WithSha384(p_toBeSignedSecuredMessage, p_certificateIssuer, p_privateKey); + if (p_certificateIssuer == int2oct(0, 32)) { + return f_signWithEcdsaBrainpoolp384WithSha384(p_toBeSignedSecuredMessage, int2oct(0, 48), p_privateKey); + } else { + return f_signWithEcdsaBrainpoolp384WithSha384(p_toBeSignedSecuredMessage, p_certificateIssuer, p_privateKey); + } } return ''O; @@ -588,6 +596,8 @@ module LibItsPki_Functions { in HeaderLines p_headers, in template (value) HttpMessage p_http_message ) runs on ItsPkiHttp { + log(">>> f_http_send: ", p_http_message); + if (not(PICS_MULTIPLE_END_POINT)) { httpPort.send(p_http_message); } else { @@ -642,6 +652,10 @@ module LibItsPki_Functions { // Local variables var PublicVerificationKey v_verification_tag; var PublicEncryptionKey v_encryption_tag; + + log(">>> f_generate_key_tag: p_public_key_compressed=", p_public_key_compressed); + log(">>> f_generate_key_tag: p_public_compressed_enc_key=", p_public_compressed_enc_key); + if (PX_VE_ALG == e_nist_p256) { if (p_compressed_key_mode == 0) { @@ -669,13 +683,13 @@ module LibItsPki_Functions { p_encoded_tag := bit2oct(encvalue(v_verification_tag)); if (PX_INCLUDE_ENCRYPTION_KEYS) { v_encryption_tag.supportedSymmAlg := aes128Ccm; - if (PX_EC_ALG_FOR_AT == e_nist_p256) { + if (PX_EC_ALG_FOR_EC_SIGN == e_nist_p256) { if (p_compressed_enc_key_mode == 0) { v_encryption_tag.publicKey.eciesNistP256.compressed_y_0 := p_public_compressed_enc_key; } else { v_encryption_tag.publicKey.eciesNistP256.compressed_y_1 := p_public_compressed_enc_key; } - } else if (PX_EC_ALG_FOR_AT == e_brainpool_p256_r1) { + } else if (PX_EC_ALG_FOR_EC_SIGN == e_brainpool_p256_r1) { if (p_compressed_enc_key_mode == 0) { v_encryption_tag.publicKey.eciesBrainpoolP256r1.compressed_y_0 := p_public_compressed_enc_key; } else { @@ -740,7 +754,7 @@ module LibItsPki_Functions { } log("f_http_build_inner_ec_request: Public encryption key: ", v_public_enc_key); log("f_http_build_inner_ec_request: Public encryption key comp: ", v_compressed_enc_key_mode); - p_salt := vc_eaWholeHash; + p_salt := vc_eaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. if (PICS_SECPKI_REENROLMENT == false) { // This is the first enrolment, we used Factory keys v_result := f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } else { // We use last valid EC certificate @@ -807,7 +821,7 @@ module LibItsPki_Functions { } log("f_http_build_inner_ec_request_with_wrong_parameters: Public encryption key: ", v_public_enc_key); log("f_http_build_inner_ec_request_with_wrong_parameters: Public encryption key comp: ", v_compressed_enc_key_mode); - p_salt := vc_eaWholeHash; + p_salt := vc_eaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. if (PICS_SECPKI_REENROLMENT == false) { // This is the first enrolment, we used Factory keys v_result := f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } else { // We use last valid EC certificate @@ -872,7 +886,7 @@ module LibItsPki_Functions { } log("*** f_http_build_invalid_enrolment_request: Public encryption key: ", v_public_enc_key); log("*** f_http_build_invalid_enrolment_request: Public encryption key comp: ", v_compressed_enc_key_mode); - p_salt := vc_eaWholeHash; + p_salt := vc_eaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. if (PICS_SECPKI_REENROLMENT == false) { // This is the first enrolment, we used Factory keys v_ret_code := f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } else { // We use last valid EC certificate @@ -998,8 +1012,8 @@ module LibItsPki_Functions { var bitstring v_authorization_request_msg; // Generate the InnerAtRequest - if (f_generate_inner_at_request(vc_aaCertificate, vc_aaHashedId8, vc_eaCertificate, vc_eaWholeHash/*salt*/, vc_eaHashedId8, p_ec_certificate, p_ec_private_key, p_private_key, p_public_key_compressed, p_compressed_key_mode, p_private_enc_key, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_inner_at_request) == false) { - log("*** f_http_build_authorization_request: ERROR: Failed to generate AuthorizationValidationRequest ***"); + if (f_generate_inner_at_request(vc_aaCertificate, -, vc_aaHashedId8, vc_eaCertificate, vc_eaWholeHash/*salt*/, vc_eaHashedId8, p_ec_certificate, p_ec_private_key, p_private_key, p_public_key_compressed, p_compressed_key_mode, p_private_enc_key, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_inner_at_request) == false) { + log("*** f_http_build_authorization_request: ERROR: Failed to generate AuthorizationRequest ***"); f_selfOrClientSyncAndVerdict("error", e_error); return; } @@ -1016,7 +1030,7 @@ module LibItsPki_Functions { } log("*** f_http_build_authorization_request: Public encryption key: ", v_public_enc_key); log("*** f_http_build_authorization_request: Public encryption key comp: ", v_compressed_enc_key_mode); - p_salt := vc_aaWholeHash; + p_salt := vc_aaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. log("*** f_http_build_authorization_request: p_salt: ", p_salt); if (PICS_PKI_AUTH_POP) { if(f_build_pki_secured_request_message_signed_with_pop(p_private_key, valueof(m_signerIdentifier_self), vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), PX_EC_ALG_FOR_AT, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { @@ -1064,8 +1078,8 @@ module LibItsPki_Functions { var bitstring v_authorization_request_msg; // Generate the InnerAtRequest - if (f_generate_inner_at_request(vc_aaCertificate, vc_aaHashedId8, vc_eaCertificate, vc_eaWholeHash/*salt*/, vc_eaHashedId8, p_ec_certificate, p_ec_private_key, p_private_key, p_public_key_compressed, p_compressed_key_mode, p_private_enc_key, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_inner_at_request) == false) { - log("*** f_http_build_authorization_request_with_wrong_private_key: ERROR: Failed to generate AuthorizationValidationRequest ***"); + if (f_generate_inner_at_request(vc_aaCertificate, -, vc_aaHashedId8, vc_eaCertificate, vc_eaWholeHash/*salt*/, vc_eaHashedId8, p_ec_certificate, p_ec_private_key, p_private_key, p_public_key_compressed, p_compressed_key_mode, p_private_enc_key, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_inner_at_request) == false) { + log("*** f_http_build_authorization_request_with_wrong_private_key: ERROR: Failed to generate AuthorizationRequest ***"); f_selfOrClientSyncAndVerdict("error", e_error); return; } @@ -1085,7 +1099,7 @@ module LibItsPki_Functions { } log("*** f_http_build_authorization_request_with_wrong_private_key: Public encryption key: ", v_public_enc_key); log("*** f_http_build_authorization_request_with_wrong_private_key: Public encryption key comp: ", v_compressed_enc_key_mode); - p_salt := vc_aaWholeHash; + p_salt := vc_aaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. log("*** f_http_build_authorization_request_with_wrong_private_key: p_salt: ", p_salt); if (PICS_PKI_AUTH_POP) { if(f_build_pki_secured_request_message_signed_with_pop(p_private_key, valueof(m_signerIdentifier_self), vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), PX_EC_ALG_FOR_AT, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { @@ -1148,12 +1162,12 @@ module LibItsPki_Functions { v_ea_hashed_id8[0] := 'bb'O; v_ea_hashed_id8[1] := 'cc'O; log("f_http_build_authorization_request_with_wrong_parameters: Altered eaId= ", v_ea_hashed_id8); - v_ret_code := f_generate_inner_at_request(vc_aaCertificate, vc_aaHashedId8, vc_eaCertificate, vc_eaWholeHash/*salt*/, v_ea_hashed_id8, p_ec_certificate, p_ec_private_key, p_private_key, p_public_key_compressed, p_compressed_key_mode, p_private_enc_key, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_inner_at_request); + v_ret_code := f_generate_inner_at_request(vc_aaCertificate, -, vc_aaHashedId8, vc_eaCertificate, vc_eaWholeHash/*salt*/, v_ea_hashed_id8, p_ec_certificate, p_ec_private_key, p_private_key, p_public_key_compressed, p_compressed_key_mode, p_private_enc_key, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_inner_at_request); } else { - v_ret_code := f_generate_inner_at_request_with_wrong_parameters(vc_aaCertificate, vc_aaHashedId8, vc_eaCertificate, vc_eaWholeHash/*salt*/, vc_eaHashedId8, p_ec_certificate, p_ec_private_key, p_alter_hmac, p_alter_signer_digest, p_start, p_duration, p_generation_time, p_private_key, p_public_key_compressed, p_compressed_key_mode, p_private_enc_key, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_inner_at_request); + v_ret_code := f_generate_inner_at_request_with_wrong_parameters(vc_aaCertificate, -, vc_aaHashedId8, vc_eaCertificate, vc_eaWholeHash/*salt*/, vc_eaHashedId8, p_ec_certificate, p_ec_private_key, p_alter_hmac, p_alter_signer_digest, p_start, p_duration, p_generation_time, p_private_key, p_public_key_compressed, p_compressed_key_mode, p_private_enc_key, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_inner_at_request); } if (v_ret_code == false) { - log("*** f_http_build_authorization_request_with_wrong_parameters: ERROR: Failed to generate AuthorizationValidationRequest ***"); + log("*** f_http_build_authorization_request_with_wrong_parameters: ERROR: Failed to generate AuthorizationRequest ***"); f_selfOrClientSyncAndVerdict("error", e_error); return; } @@ -1170,7 +1184,7 @@ module LibItsPki_Functions { } log("*** f_http_build_authorization_request_with_wrong_parameters: Public encryption key: ", v_public_enc_key); log("*** f_http_build_authorization_request_with_wrong_parameters: Public encryption key comp: ", v_compressed_enc_key_mode); - p_salt := vc_aaWholeHash; + p_salt := vc_aaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. log("*** f_http_build_authorization_request_with_wrong_parameters: p_salt: ", p_salt); if (PICS_PKI_AUTH_POP) { if(f_build_pki_secured_request_message_signed_with_pop(p_private_key, valueof(m_signerIdentifier_self), vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), PX_EC_ALG_FOR_AT, p_alter_pop_signature, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { @@ -1325,7 +1339,7 @@ module LibItsPki_Functions { } log("f_http_build_authorization_validation_request: Public encryption key: ", v_public_enc_key); log("f_http_build_authorization_validation_request: Public encryption key comp: ", v_compressed_enc_key_mode); - p_salt := vc_eaWholeHash; + p_salt := vc_eaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. log("f_http_build_authorization_validation_request: vc_aaHashedId8: ", vc_aaHashedId8); log("f_http_build_authorization_validation_request: p_salt: ", p_salt); if(f_build_pki_secured_request_message_signed_with_pop(vc_aaPrivateKey, valueof(m_signerIdentifier_digest(vc_aaHashedId8)), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_validation_request(v_authorization_validation_request))), PX_EC_ALG_FOR_ATV, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { @@ -1374,7 +1388,7 @@ module LibItsPki_Functions { } log("f_http_build_invalid_authorization_validation_request: Public encryption key: ", v_public_enc_key); log("f_http_build_invalid_authorization_validation_request: Public encryption key comp: ", v_compressed_enc_key_mode); - p_salt := vc_eaWholeHash; + p_salt := vc_eaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. log("f_http_build_invalid_authorization_validation_request: vc_aaHashedId8: ", vc_aaHashedId8); log("f_http_build_invalid_authorization_validation_request: p_salt: ", p_salt); if(f_build_pki_secured_request_message_signed_with_pop(vc_aaPrivateKey, valueof(m_signerIdentifier_digest(vc_aaHashedId8)), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_validation_request(v_authorization_validation_request))), PX_EC_ALG_FOR_ATV, true, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { @@ -1826,8 +1840,8 @@ module LibItsPki_Functions { m_publicKeys( v_public_verification_key ), - m_certificateSubjectAttributes_id_name( - oct2char(PICS_ITS_S_CANONICAL_ID), + m_certificateSubjectAttributes_id_omit/*FIXME No name*/( + /*oct2char(PICS_ITS_S_CANONICAL_ID),*/ { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs valueof(m_appPermissions(c_its_aid_SCR, { bitmapSsp := PX_INNER_EC_CERTFICATE_BITMAP_SSP_SCR })) }, @@ -1849,7 +1863,7 @@ module LibItsPki_Functions { log("f_generate_inner_ec_request: This is a re-enrolment"); p_inner_ec_request.itsId := PX_EC_HASHED_ID8; } - log("f_generate_inner_ec_request: ", p_inner_ec_request); + log("<<< f_generate_inner_ec_request: ", p_inner_ec_request); return true; } // End of function f_generate_inner_ec_request @@ -1975,7 +1989,7 @@ module LibItsPki_Functions { ) ); // Signed the encoded InnerEcRequestSignedForPop - v_tbs_signed := f_signWithEcdsa(bit2oct(encvalue(v_tbs)), int2oct(0, 32), p_private_key); + v_tbs_signed := f_signWithEcdsa(bit2oct(encvalue(v_tbs)), int2oct(0, 32), p_private_key); // Finalyse signed InnerEcRequestSignedForPop if (PX_VE_ALG == e_nist_p256) { v_signature := valueof( @@ -2074,6 +2088,7 @@ module LibItsPki_Functions { function f_generate_inner_at_request( in Certificate p_aa_certificate, + in SecurityAlg p_enc_algo := PX_EC_ALG_FOR_EC_SIGN, in Oct8 p_aa_hashed_id8, in Certificate p_ea_certificate, in octetstring p_salt, @@ -2116,7 +2131,9 @@ module LibItsPki_Functions { valueof(m_appPermissions(c_its_aid_CAM, { bitmapSsp := PX_INNER_AT_CERTFICATE_BITMAP_SSP_CAM })), valueof(m_appPermissions(c_its_aid_DENM, { bitmapSsp := PX_INNER_AT_CERTFICATE_BITMAP_SSP_DENM })) }; - + + log(">>> f_generate_inner_at_request: p_enc_algo=", p_enc_algo); + // Generate verification keys for the certificate to be requested if (f_generate_key_pair(p_private_key, v_public_key_x, v_public_key_y, p_public_key_compressed, p_compressed_key_mode) == false) { log("f_generate_inner_at_request: Failed to generate verification key"); @@ -2127,7 +2144,7 @@ module LibItsPki_Functions { log ("f_generate_inner_at_request: AT verification public compressed mode: ", p_compressed_key_mode); // Generate encryption keys for the certificate to be requested if (PX_INCLUDE_ENCRYPTION_KEYS) { - if (f_generate_key_pair_for_encryption(PX_EC_ALG_FOR_AT, p_private_enc_key, v_public_enc_key_x, v_public_enc_key_y, p_public_compressed_enc_key, p_compressed_enc_key_mode) == false) { + if (f_generate_key_pair_for_encryption(p_enc_algo, p_private_enc_key, v_public_enc_key_x, v_public_enc_key_y, p_public_compressed_enc_key, p_compressed_enc_key_mode) == false) { log("f_generate_inner_at_request: Failed to generate encryption key"); return false; } else { @@ -2143,17 +2160,6 @@ module LibItsPki_Functions { p_compressed_enc_key_mode := -1; } - // Calculate the whole certificate SHA - v_enc_value := encvalue(p_ec_certificate); - if (ischosen(p_ec_certificate.issuer.sha256AndDigest)) { - v_ec_hash := f_hashWithSha256(bit2oct(v_enc_value)); - v_ec_hashed_id8 := f_HashedId8FromSha256(v_ec_hash); - } else { - v_ec_hash := f_hashWithSha384(bit2oct(v_enc_value)); - v_ec_hashed_id8 := f_HashedId8FromSha384(v_ec_hash); - } - log("f_generate_inner_at_request: v_ec_hash= ", v_ec_hash); - // Generate 32 octets length secret key v_hmac_key := f_hashWithSha256(int2oct((f_getCurrentTimeUtc() * 1000), 12)); log("f_generate_inner_at_request: v_hmac_key= ", v_hmac_key); @@ -2201,6 +2207,18 @@ module LibItsPki_Functions { (f_getCurrentTime()) * 1000) //us ); log("f_generate_inner_at_request: v_tbs= ", v_tbs); + + // Calculate the whole certificate SHA + v_enc_value := encvalue(p_ec_certificate); + if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1)) { + v_ec_hash := f_hashWithSha384(bit2oct(v_enc_value)); + v_ec_hashed_id8 := f_HashedId8FromSha384(v_ec_hash); + } else { + v_ec_hash := f_hashWithSha256(bit2oct(v_enc_value)); + v_ec_hashed_id8 := f_HashedId8FromSha256(v_ec_hash); + } + log("f_generate_inner_at_request: v_ec_hash= ", v_ec_hash); + // Signed ToBeSigned payload using the private key of EC certificate obtained from Enrolment request // In case of ITS-S privacy, v_signed_at_signature contained the data to be encrypted if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1)) { @@ -2259,6 +2277,7 @@ module LibItsPki_Functions { ) ); log("f_generate_inner_at_request: v_signed_at_signature= ", v_signed_at_signature); + log("f_generate_inner_at_request: p_ea_certificate= ", p_ea_certificate); if (PICS_ITS_S_WITH_PRIVACY) { // Build EtsiTs102097Data-Encrypted structure var octetstring v_public_enc_key; @@ -2274,7 +2293,7 @@ module LibItsPki_Functions { var EncryptedDataEncryptionKey v_encrypted_data_encryption_key; // Use EA certificate for the encryption - if (PX_EC_ALG_FOR_AT == e_nist_p256) { + if (p_enc_algo == e_nist_p256) { if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0)) { v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0; v_compressed_mode := 0; @@ -2298,7 +2317,7 @@ module LibItsPki_Functions { v_encrypted_sym_key, v_authentication_vector ))); - } else if (PX_EC_ALG_FOR_AT == e_brainpool_p256_r1) { + } else if (p_enc_algo == e_brainpool_p256_r1) { if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0)) { v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0; v_compressed_mode := 0; @@ -2386,7 +2405,7 @@ module LibItsPki_Functions { } else { v_enc_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_1(v_public_enc_key_x); } - if (PX_EC_ALG_FOR_AT == e_nist_p256) { + if (p_enc_algo == e_nist_p256) { v_public_encryption_key := valueof(m_publicEncryptionKey_eciesNistP256(v_enc_eccP256_curve_point)); } else { v_public_encryption_key := valueof(m_publicEncryptionKey_eciesBrainpoolP256r1(v_enc_eccP256_curve_point)); @@ -2415,6 +2434,7 @@ module LibItsPki_Functions { function f_generate_inner_at_request_with_wrong_parameters( in Certificate p_aa_certificate, + in SecurityAlg p_enc_algo := PX_EC_ALG_FOR_AT, in Oct8 p_aa_hashed_id8, in Certificate p_ea_certificate, in octetstring p_salt, @@ -2465,7 +2485,9 @@ module LibItsPki_Functions { valueof(m_appPermissions(c_its_aid_CAM, { bitmapSsp := PX_INNER_AT_CERTFICATE_BITMAP_SSP_CAM })), valueof(m_appPermissions(c_its_aid_DENM, { bitmapSsp := PX_INNER_AT_CERTFICATE_BITMAP_SSP_DENM })) }; - + + log("f_generate_inner_at_request_with_wrong_parameters: p_enc_algo=", p_enc_algo); + // Generate verification keys for the certificate to be requested if (f_generate_key_pair(p_private_key, v_public_key_x, v_public_key_y, p_public_key_compressed, p_compressed_key_mode) == false) { log("f_generate_inner_at_request_with_wrong_parameters: Failed to generate verification key"); @@ -2476,7 +2498,7 @@ module LibItsPki_Functions { log ("f_generate_inner_at_request_with_wrong_parameters: AT verification public compressed mode: ", p_compressed_key_mode); // Generate encryption keys for the certificate to be requested if (PX_INCLUDE_ENCRYPTION_KEYS) { - if (f_generate_key_pair_for_encryption(PX_EC_ALG_FOR_AT, p_private_enc_key, v_public_enc_key_x, v_public_enc_key_y, p_public_compressed_enc_key, p_compressed_enc_key_mode) == false) { + if (f_generate_key_pair_for_encryption(p_enc_algo, p_private_enc_key, v_public_enc_key_x, v_public_enc_key_y, p_public_compressed_enc_key, p_compressed_enc_key_mode) == false) { log("f_generate_inner_at_request_with_wrong_parameters: Failed to generate encryption key"); return false; } else { @@ -2657,7 +2679,7 @@ module LibItsPki_Functions { var EncryptedDataEncryptionKey v_encrypted_data_encryption_key; // Use EA certificate for the encryption - if (PX_EC_ALG_FOR_AT == e_nist_p256) { + if (p_enc_algo == e_nist_p256) { if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0)) { v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0; v_compressed_mode := 0; @@ -2681,7 +2703,7 @@ module LibItsPki_Functions { v_encrypted_sym_key, v_authentication_vector ))); - } else if (PX_EC_ALG_FOR_AT == e_brainpool_p256_r1) { + } else if (p_enc_algo == e_brainpool_p256_r1) { if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0)) { v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0; v_compressed_mode := 0; @@ -2767,7 +2789,7 @@ module LibItsPki_Functions { } else { v_enc_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_1(v_public_enc_key_x); } - if (PX_EC_ALG_FOR_AT == e_nist_p256) { + if (p_enc_algo == e_nist_p256) { v_public_encryption_key := valueof(m_publicEncryptionKey_eciesNistP256(v_enc_eccP256_curve_point)); } else { v_public_encryption_key := valueof(m_publicEncryptionKey_eciesBrainpoolP256r1(v_enc_eccP256_curve_point)); @@ -2967,7 +2989,7 @@ module LibItsPki_Functions { f_init_default_headers_list(-, "inner_ec_response", v_headers); - if (f_verify_pki_request_message(vc_eaPrivateEncKey, vc_eaWholeHash/*salt*/, vc_eaWholeHash, v_request.request.body.binary_body.ieee1609dot2_data, false, v_request_hash, v_etsi_ts_102941_data, v_aes_enc_key) == false) { // Cannot decrypt the message + if (f_verify_pki_request_message(vc_eaPrivateEncKey, vc_eaWholeHash/*salt*/, ''O, v_request.request.body.binary_body.ieee1609dot2_data, false, v_request_hash, v_etsi_ts_102941_data, v_aes_enc_key) == false) { // Cannot decrypt the message log("f_await_ec_request_send_response: Failed to verify PKI message ***"); // Send error message v_response := m_http_response(m_http_response_ko(m_http_message_body_binary(m_binary_body_ieee1609dot2_data(v_ieee1609dot2_signed_and_encrypted_data)), v_headers, 400, "Bad request")); // Initialize v_reponse with an error message @@ -3598,9 +3620,35 @@ module LibItsPki_Functions { // 4. Verifiy signature log("f_verify_pki_request_message: v_ieee1609dot2_signed_data.content.signedData.tbsData= ", v_ieee1609dot2_signed_data.content.signedData.tbsData); v_msg := bit2oct(encvalue(v_ieee1609dot2_signed_data.content.signedData.tbsData)); - if (p_issuer == ''O) { - log("f_verify_pki_request_message: Invalid issuer value"); - return false; + if (p_issuer == ''O) { // self + log("f_verify_pki_request_message: Issuer is self, check outer signature using IUT public key (PICS_ITS_S_SIGN_xxx_PUBLIC_KEY)"); + var PublicVerificationKey v_verification_key; + if (PX_VE_ALG == e_nist_p256) { + if (PICS_ITS_S_SIGN_NISTP256_PUBLIC_KEY[0] == '02'O) { + v_verification_key.ecdsaNistP256.compressed_y_0 := substr(PICS_ITS_S_SIGN_NISTP256_PUBLIC_KEY, 1, 32); + } else { + v_verification_key.ecdsaNistP256.compressed_y_1 := substr(PICS_ITS_S_SIGN_NISTP256_PUBLIC_KEY, 1, 32); + } + } else if (PX_VE_ALG == e_brainpool_p256_r1) { + if (PICS_ITS_S_SIGN_NISTP256_PUBLIC_KEY[0] == '02'O) { + v_verification_key.ecdsaNistP256.compressed_y_0 := substr(PICS_ITS_S_SIGN_BRAINPOOLP256r1_PUBLIC_KEY, 1, 32); + } else { + v_verification_key.ecdsaNistP256.compressed_y_1 := substr(PICS_ITS_S_SIGN_BRAINPOOLP256r1_PUBLIC_KEY, 1, 32); + } + } else if (PX_VE_ALG == e_brainpool_p384_r1) { + if (PICS_ITS_S_SIGN_NISTP256_PUBLIC_KEY[0] == '02'O) { + v_verification_key.ecdsaNistP256.compressed_y_0 := substr(PICS_ITS_S_SIGN_BRAINPOOLP384r1_PUBLIC_KEY, 1, 48); + } else { + v_verification_key.ecdsaNistP256.compressed_y_1 := substr(PICS_ITS_S_SIGN_BRAINPOOLP384r1_PUBLIC_KEY, 1, 48); + } + } + log("f_verify_pki_request_message: v_verification_key=", v_verification_key); + if (f_verifyEcdsa(v_msg, p_issuer, v_ieee1609dot2_signed_data.content.signedData.signature_, v_verification_key) == false) { + if (p_check_security == true) { + return false; + } + } + //return false; } else { if (f_getCertificateFromDigest(f_HashedId8FromSha256(p_issuer), v_certificate) == false) { if (p_check_security == true) { diff --git a/ttcn/Pki/LibItsPki_Pixits.ttcn b/ttcn/Pki/LibItsPki_Pixits.ttcn index e710bd46..12daf8ed 100644 --- a/ttcn/Pki/LibItsPki_Pixits.ttcn +++ b/ttcn/Pki/LibItsPki_Pixits.ttcn @@ -35,13 +35,17 @@ module LibItsPki_Pixits { */ modulepar SecurityAlg PX_EC_ALG_FOR_EC := e_nist_p256; // TODO Use RCA to determine encryption algorithm? /** - * @desc Indicate which encryption algorithem to be used for Authorization Request + * @desc Indicate which encryption algorithem to be used for Authorization Request (AA certificate of the IUT) */ modulepar SecurityAlg PX_EC_ALG_FOR_AT := e_nist_p256; /** - * @desc Indicate which encryption algorithem to be used for Authorization Validation Request + * @desc Indicate which encryption algorithem to be used for Authorization Validation Request (EA certificate of the IUT) */ modulepar SecurityAlg PX_EC_ALG_FOR_ATV := e_nist_p256; + /** + * @desc Indicate which encryption algorithem to be used for EcSignature (EA certificate of the IUT) + */ + modulepar SecurityAlg PX_EC_ALG_FOR_EC_SIGN := e_nist_p256; /** * @desc Indicate which verification algorithem to be used diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn index 004bd781..02686f6c 100644 --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ b/ttcn/Pki/LibItsPki_Templates.ttcn @@ -278,6 +278,15 @@ module LibItsPki_Templates { certIssuePermissions := omit } // End of template m_certificateSubjectAttributes_id_none + template (omit) CertificateSubjectAttributes m_certificateSubjectAttributes_id_omit( + in template (value) SequenceOfPsidSsp p_appPermissions, + in template (omit) ValidityPeriod p_validityPeriod := omit, + in template (omit) GeographicRegion p_region := omit, + in template (omit) SubjectAssurance p_assuranceLevel := omit + ) modifies m_certificateSubjectAttributes_id_none := { + id := omit + } // End of template m_certificateSubjectAttributes_id_omit + template (omit) CertificateSubjectAttributes m_certificateSubjectAttributes_id_name( in template (value) Hostname p_name, in template (value) SequenceOfPsidSsp p_appPermissions, @@ -482,7 +491,7 @@ module LibItsPki_Templates { template (present) SequenceOfPsidSsp p_appPermissions := ?, template CertificateId p_id := *, template (present) ValidityPeriod p_validityPeriod := ?, - template (present) SubjectAssurance p_assuranceLevel := ?, + template SubjectAssurance p_assuranceLevel := *, template GeographicRegion p_region := *, template SequenceOfPsidGroupPermissions p_certIssuePermissions := omit ) := { diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index 4f957877..fdd53f76 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -77,11 +77,13 @@ module LibItsPki_TestSystem { var octetstring vc_eaPrivateKey; /** Test Adapter EA private key for signature */ var octetstring vc_eaPrivateEncKey; /** Test Adapter EA private key for encryption */ var octetstring vc_eaWholeHash; /** Test Adapter EA whole-hash for signature check */ + var octetstring vc_eaWholeHash256; /** Test Adapter EA whole-hash using SHA 256 for encryption because of encryption key size ==32 */ var HashedId8 vc_eaHashedId8; /** Test Adapter EA HashedId8 for decryption of IUT's response */ var octetstring vc_aaPrivateKey; /** Test Adapter AA private key for signature */ var octetstring vc_aaPrivateEncKey; /** Test Adapter AA private key for encryption */ var HashedId8 vc_aaHashedId8; /** Test Adapter AA HashedId8 for decryption of IUT's response */ var octetstring vc_aaWholeHash; /** Test Adapter AA whole-hash for signature check */ + var octetstring vc_aaWholeHash256; /** Test Adapter EA whole-hash using SHA 256 for encryption because of encryption key size ==32 */ } // End of component ItsPkiHttp /** diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 17251d95..7b8cdbd3 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -107,6 +107,9 @@ module LibItsSecurity_Functions { in Oct48 p_certificateIssuer, in Oct48 p_privateKey ) return octetstring { + log(">>> f_signWithEcdsaBrainpoolp384WithSha384: ", p_toBeSignedSecuredMessage); + log(">>> f_signWithEcdsaBrainpoolp384WithSha384: ", p_certificateIssuer); + log(">>> f_signWithEcdsaBrainpoolp384WithSha384: ", p_privateKey); return fx_signWithEcdsaBrainpoolp384WithSha384( p_toBeSignedSecuredMessage, p_certificateIssuer, @@ -865,8 +868,8 @@ module LibItsSecurity_Functions { ); p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP384r1( m_ecdsaP384Signature( - m_eccP384CurvePoint_x_only(substr(v_signature, 0, 32)), - substr(v_signature, 32, 32) + m_eccP384CurvePoint_x_only(substr(v_signature, 0, 48)), + substr(v_signature, 48, 48) ) )); } // TODO To be continued @@ -904,7 +907,7 @@ module LibItsSecurity_Functions { var octetstring v_secPayload, v_signature; var template (value) ToBeSignedData v_toBeSignedData; var integer i, j, k, n; - var HeaderInfo v_headerFields := {}; + var HeaderInfo v_headerFields; var Ieee1609Dot2Content v_toBeSignedPayload; var Oct32 v_privateKey; var UInt8 v_trailerSize; @@ -1207,7 +1210,7 @@ module LibItsSecurity_Functions { // Local variables var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; - var HeaderInfo v_mandatoryHeaders := {}; + var HeaderInfo v_mandatoryHeaders; var HeaderInfo v_signerInfo; // Load certificates if required @@ -1282,7 +1285,7 @@ module LibItsSecurity_Functions { // Local variables var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; - var HeaderInfo v_mandatoryHeaders := {}; + var HeaderInfo v_mandatoryHeaders; var HeaderInfo v_signerInfo; // Load certificates if required @@ -1359,7 +1362,7 @@ module LibItsSecurity_Functions { // Local variables var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; - var HeaderInfo v_mandatoryHeaders := {}; + var HeaderInfo v_mandatoryHeaders; var HeaderInfo v_signerInfo; // Load certificates if required @@ -1429,7 +1432,7 @@ module LibItsSecurity_Functions { // Local variables var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; - var HeaderInfo v_mandatoryHeaders := {}; + var HeaderInfo v_mandatoryHeaders; var HeaderInfo v_signerInfo; // Load certificates if required @@ -1504,7 +1507,7 @@ module LibItsSecurity_Functions { // Local variables var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; - var HeaderInfo v_mandatoryHeaders := {}; + var HeaderInfo v_mandatoryHeaders; var HeaderInfo v_signerInfo; // Load certificates if required @@ -2044,7 +2047,7 @@ module LibItsSecurity_Functions { } } // End of 'for' statement if (v_found == false) { - log("f_verifySspPermissions: Permission set not found: ", v_issuerPsidSsp) + log("f_verifySspPermissions: Permission set not found: ", v_issuerPsidSsp); if (p_strict_checks == true) { return false; } else { @@ -2054,7 +2057,7 @@ module LibItsSecurity_Functions { // 2. Validate bits mask if (ispresent(v_issuerPsidSsp.ssp)) { if (ispresent(v_subordinatePsidSsp.ssp) == false) { - log("f_verifySspPermissions: Ssp shall not be omitted: ", v_issuerPsidSsp) + log("f_verifySspPermissions: Ssp shall not be omitted: ", v_issuerPsidSsp); if (p_strict_checks == true) { return false; } @@ -2277,6 +2280,23 @@ module LibItsSecurity_Functions { return true; } // End of function f_getCertificateHash + /** + * @desc Read the whole-hash of the certificate SHA 256 + * @param p_certificate_id the certificate identifier + * @param p_hash the whole-hash of the certificate using SHA 256 + * @return true on success, false otherwise + */ + function f_getCertificateHash256( + in charstring p_certificate_id, + out Oct32 p_hash + ) return boolean { + if (not fx_readCertificateHash256(p_certificate_id, p_hash)){ + log("f_getCertificateHash256: Failed to retrieve digest for ", p_certificate_id); + return false; + } + return true; + } // End of function f_getCertificateHash + function f_getCertificateFromDigest( in HashedId8 p_digest, out EtsiTs103097Certificate p_certificate @@ -2657,7 +2677,7 @@ module LibItsSecurity_Functions { * @return true on success, false otherwise */ external function fx_loadCertificates(in charstring p_rootDirectory, in charstring p_configId) return boolean; - external function fx_store_certificate(in charstring p_cert_id, in octetstring p_cert, in octetstring p_private_key, in octetstring p_public_key_x, in octetstring p_public_key_y, in octetstring p_public_key_compressed, in integer p_public_key_compressed_mode, in octetstring p_hash, in octetstring p_hashid8, in octetstring p_issuer, in template (omit) octetstring p_private_enc_key, in template (omit) octetstring p_public_enc_key_x, in template (omit) octetstring p_public_enc_key_y, in template (omit) octetstring p_public_enc_compressed_key, in template (omit) integer p_public_enc_key_compressed_mode) return boolean; + external function fx_store_certificate(in charstring p_cert_id, in octetstring p_cert, in octetstring p_private_key, in octetstring p_public_key_x, in octetstring p_public_key_y, in octetstring p_public_key_compressed, in integer p_public_key_compressed_mode, in octetstring p_hash, in octetstring p_hash_256, in octetstring p_hashid8, in octetstring p_issuer, in template (omit) octetstring p_private_enc_key, in template (omit) octetstring p_public_enc_key_x, in template (omit) octetstring p_public_enc_key_y, in template (omit) octetstring p_public_enc_compressed_key, in template (omit) integer p_public_enc_key_compressed_mode) return boolean; /** * @desc Unload from memory cache the certificates @@ -2689,6 +2709,14 @@ module LibItsSecurity_Functions { */ external function fx_readCertificateHash(in charstring p_certificate_id, out octetstring p_hash) return boolean; + /** + * @desc Read the whole-hash of the specified certificate using SHA 256 + * @param p_certificate_id the certificate identifier + * @param p_hash the whole-hash of the certificate + * @return true on success, false otherwise + */ + external function fx_readCertificateHash256(in charstring p_certificate_id, out Oct32 p_hash) return boolean; + external function fx_readCertificateFromDigest(in HashedId8 p_digest, out charstring p_certificate_id) return boolean; external function fx_readCertificateFromHashedId3(in HashedId3 p_digest, out charstring p_certificate_id) return boolean; -- GitLab From 9ccad87d3e34ec870bf80c5991bf73757f998340 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Fri, 22 Nov 2019 16:41:37 +0100 Subject: [PATCH 221/320] STF580: Add LTE-V2X support & SSPs changes --- ttcn/CAM/LibItsCam_Pics.ttcn | 17 ++++++++++++++++- ttcn/Http/LibItsHttp_TestSystem.ttcn | 11 +++++++---- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/ttcn/CAM/LibItsCam_Pics.ttcn b/ttcn/CAM/LibItsCam_Pics.ttcn index 5fa0770b..b41534db 100644 --- a/ttcn/CAM/LibItsCam_Pics.ttcn +++ b/ttcn/CAM/LibItsCam_Pics.ttcn @@ -112,5 +112,20 @@ module LibItsCam_Pics { modulepar boolean PICS_CAM_RECEPTION := true; } // end camPics - + + group radioComm { + + /** + * @desc Does radio communication use G5? + * @see ETSI TS 102 868-1 Table A.3 + */ + modulepar boolean PICS_G5_RADIO_COMM := true; + + /** + * @desc Does radio communication use LTE-V2X? + * @see ETSI TS 102 868-1 Table A.3 + */ + modulepar boolean PICS_CV2X_RADIO_COMM := false; + + } // End of group radioComm } // end LibItsCam_Pics diff --git a/ttcn/Http/LibItsHttp_TestSystem.ttcn b/ttcn/Http/LibItsHttp_TestSystem.ttcn index fcfd65dc..d6f5c524 100644 --- a/ttcn/Http/LibItsHttp_TestSystem.ttcn +++ b/ttcn/Http/LibItsHttp_TestSystem.ttcn @@ -14,9 +14,6 @@ module LibItsHttp_TestSystem { // LibCommon import from LibCommon_Sync all; import from LibCommon_Time all; - - // LibItsCommon - import from LibItsCommon_TestSystem all; // LibItsHttp import from LibItsHttp_TypesAndValues all; @@ -25,12 +22,18 @@ module LibItsHttp_TestSystem { inout HttpMessage; } - type component HttpComponent extends ItsBaseComponent { // FIXME To be rename into HttpTest + type component HttpComponent extends SelfSyncComp { // FIXME To be rename into HttpTest port HttpPort httpPort; + port HttpPort httpPort_notif; + timer tc_ac := PX_TAC; + timer tc_noac := PX_TNOAC; + timer tc_wait := PX_TWAIT; + } // End of component HttpComponent type component HttpTestAdapter { // FIXME To be rename into HttpTestSystem port HttpPort httpPort; + port HttpPort httpPort_notif; } // End of component TestAdapter } // End of module LibItsHttp_TestSystem -- GitLab From 9370686594ea622fa0aba7c74825ff341a5373aa Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Thu, 5 Mar 2020 08:32:22 +0100 Subject: [PATCH 222/320] mBug fixed --- ttcn/Pki/LibItsPki_Functions.ttcn | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index b591e293..40aa731c 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -3002,19 +3002,10 @@ module LibItsPki_Functions { v_response := m_http_response(m_http_response_ok(m_http_message_body_binary(m_binary_body_ieee1609dot2_data(v_ieee1609dot2_signed_and_encrypted_data)), v_headers)); } else { f_http_build_inner_ec_response(v_inner_ec_request, ok, v_request_hash, vc_eaPrivateKey, vc_eaWholeHash, v_aes_enc_key, p_inner_ec_response, v_ieee1609dot2_signed_and_encrypted_data); - v_response := m_http_response(m_http_response_ok(m_http_message_body_binary(m_binary_body_ieee1609dot2_data(v_ieee1609dot2_signed_and_encrypted_data)), v_headers)); + v_response := m_http_response(m_http_response_ok(m_http_message_body_binary(m_binary_body_ieee1609dot2_data(v_ieee1609dot2_signed_and_encrypted_data)), v_headers)); v_result := true; } - f_http_send( - v_headers, - m_http_request( - m_http_request_post( - PICS_HTTP_POST_URI_EC, - v_headers, - m_http_message_body_binary( - m_binary_body_ieee1609dot2_data( - v_ieee1609dot2_signed_and_encrypted_data - ))))); + f_http_send(v_headers, v_response); } } [] tc_ac.timeout { -- GitLab From afb30ae0801caaf3c3190e5eacdb31921f5b2631 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Thu, 12 Mar 2020 10:57:48 +0100 Subject: [PATCH 223/320] Enhance AtsRSUsSimulator --- ttcn/DENM/LibItsDenm_TypesAndValues.ttcn | 22 +++++++++---------- .../LibItsGeoNetworking_Templates.ttcn | 2 +- .../LibItsGeoNetworking_TypesAndValues.ttcn | 2 +- ttcn/Security/LibItsSecurity_Functions.ttcn | 3 ++- .../LibItsSecurity_TypesAndValues.ttcn | 5 ++++- 5 files changed, 19 insertions(+), 15 deletions(-) diff --git a/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn b/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn index 2dccd4e0..d94a2d32 100644 --- a/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn +++ b/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn @@ -84,18 +84,18 @@ module LibItsDenm_TypesAndValues { */ type union UtDenmResults { boolean utDenmInitializeResult, - UtDenmTriggerResult utDenmTriggerResult, - UtDenmUpdateResult utDenmUpdateResult, - boolean utDenmTerminationResult, - boolean utDenmChangePositionResult, - boolean utDenmChangePseudonymResult - } with { + UtDenmTriggerResult utDenmTriggerResult, + UtDenmUpdateResult utDenmUpdateResult, + boolean utDenmTerminationResult, + boolean utDenmChangePositionResult, + boolean utDenmChangePseudonymResult + } with { variant "" - } // End of type UtDenmResults - - /** - * @desc Upper Tester message to request triggering of an event at IUT - */ + } // End of type UtDenmResults + + /** + * @desc Upper Tester message to request triggering of an event at IUT + */ type record UtDenmTrigger { TimestampIts detectionTime, ValidityDuration validityDuration optional, diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn index 6da7130d..87b888f4 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn @@ -1655,7 +1655,7 @@ module LibItsGeoNetworking_Templates { /** * @desc Default send template for traffic class */ - template (value) TrafficClass m_trafficClass ( in SCF p_scf := e_scfEnable, in ChannelOffload p_ChOff := e_choffDisabled ) := { + template (value) TrafficClass m_trafficClass ( in SCF p_scf := e_scfEnabled, in ChannelOffload p_ChOff := e_choffDisabled ) := { scf := p_scf, channelOffload := p_ChOff, tcId := 0 diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn index 657c86b3..5ab7e35b 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn @@ -346,7 +346,7 @@ module LibItsGeoNetworking_TypesAndValues { type enumerated SCF { e_scfDisabled(0), - e_scfEnable (1) + e_scfEnabled (1) } with { variant "FIELDLENGTH(1)" //variant "1 bit" } diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index aacb9e77..60496abe 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -23,6 +23,7 @@ module LibItsSecurity_Functions { // LibItsCommon //import from LibItsCommon_Functions all; //import from LibItsCommon_TypesAndValues all; + import from LibItsCommon_Pixits all; // LibItsSecurity import from LibItsSecurity_TypesAndValues all; @@ -2177,7 +2178,7 @@ module LibItsSecurity_Functions { // Setup certificates memory cache if (fx_loadCertificates(PX_CERTIFICATE_POOL_PATH, p_configId) == true) { // Setup security component variables - if (f_readCertificate(cc_taCert_A, vc_atCertificate) == true) { + if (f_readCertificate(PX_CERT_FOR_TS, vc_atCertificate) == true) { var HashedId8 v_issuer; log("Issuer: ", vc_atCertificate.issuer); if (ischosen(vc_atCertificate.issuer.sha256AndDigest)) { diff --git a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn index e0d7424c..56be4847 100644 --- a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn +++ b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn @@ -14,6 +14,9 @@ module LibItsSecurity_TypesAndValues { // LibCommon import from LibCommon_BasicTypesAndValues all; import from LibCommon_DataStrings all; + + // LibItsCommon + import from LibItsCommon_Pixits all; // LibIts import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; @@ -21,7 +24,7 @@ module LibItsSecurity_TypesAndValues { import from EtsiTs103097Module language "ASN.1:1997" all; // Test Adapter certificates & private keys - Valid behavior - const charstring cc_taCert_A := "CERT_TS_A_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_A := PX_CERT_FOR_TS; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_A_AA := "CERT_TS_A_AA"; const charstring cc_taCert_A_EA := "CERT_TS_A_EA"; const charstring cc_taCert_A1 := "CERT_TS_A_A1_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ -- GitLab From 9ee2927d05591ca6f2fee4aff7b87605fe5e10f7 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Thu, 12 Mar 2020 15:49:05 +0100 Subject: [PATCH 224/320] Review TTCN-3 code --- ttcn/Common/LibItsCommon_Templates.ttcn | 22 +-- ttcn/DENM/LibItsDenm_Templates.ttcn | 10 +- .../LibItsGeoNetworking_Functions.ttcn | 47 +++-- .../LibItsGeoNetworking_Templates.ttcn | 172 +++++++++--------- ttcn/Http/LibItsHttp_TestSystem.ttcn | 3 +- ttcn/IVIM/LibItsIvim_Templates.ttcn | 31 ++-- .../LibItsMapemSpatem_Templates.ttcn | 14 +- ttcn/Security/LibItsSecurity_Functions.ttcn | 12 +- ttcn/Security/LibItsSecurity_Templates.ttcn | 14 +- 9 files changed, 158 insertions(+), 167 deletions(-) diff --git a/ttcn/Common/LibItsCommon_Templates.ttcn b/ttcn/Common/LibItsCommon_Templates.ttcn index 9fee09f7..e27ec943 100644 --- a/ttcn/Common/LibItsCommon_Templates.ttcn +++ b/ttcn/Common/LibItsCommon_Templates.ttcn @@ -18,8 +18,6 @@ module LibItsCommon_Templates { group taPrimitives { -//FIXME RGY the simple boolean result has been changed to a union -// template (value) AcSecResponse m_acSecResponseSuccess := true; template (value) AdapterControlResults m_acSecResponseSuccess := {acSecResponse:=true}; /** @@ -44,18 +42,16 @@ module LibItsCommon_Templates { } } // End of template m_acDisableSecurity -//FIXME RGY As discussed, port in type is changed to a top-level union type -// template AcGnssResponse m_acGnssResponseSuccess := true; template AdapterControlResults m_acGnssResponseSuccess := {acGnssResponse:=true}; -//FIXME RGY As discussed, port in type is changed to a top-level union type -// template AcGnssDistanceCovered m_acGnssDistanceCovered := true; - template AdapterControlResults m_acGnssDistanceCovered := {acGnssDistanceCovered:=true}; + template (value) AdapterControlResults m_acGnssDistanceCovered := { + acGnssDistanceCovered:=true + }; /** * @desc Testsystem will load GNSS scenario */ - template AcGnssPrimitive m_loadScenario(Scenario p_scenario) := { + template (value) AcGnssPrimitive m_loadScenario(Scenario p_scenario) := { loadScenario := { scenario := p_scenario } @@ -64,7 +60,7 @@ module LibItsCommon_Templates { /** * @desc Testsystem will start GNSS scenario */ - template AcGnssPrimitive m_startScenario := { + template (value) AcGnssPrimitive m_startScenario := { startScenario := { } } @@ -72,7 +68,7 @@ module LibItsCommon_Templates { /** * @desc Testsystem will stop GNSS scenario */ - template AcGnssPrimitive m_stopScenario := { + template (value) AcGnssPrimitive m_stopScenario := { stopScenario := { } } @@ -80,7 +76,7 @@ module LibItsCommon_Templates { /** * @desc Testsystem will request indication if distance was covered */ - template AcGnssPrimitive m_distanceToCover(float p_distance) := { + template (value) AcGnssPrimitive m_distanceToCover(float p_distance) := { distanceToCover := { distance := p_distance } @@ -89,7 +85,7 @@ module LibItsCommon_Templates { /** * @desc Testsystem will change the speed (delta value) */ - template AcGnssPrimitive m_changeScenarioSpeed(SpeedValue p_deltaSpeedValue) := { + template (value) AcGnssPrimitive m_changeScenarioSpeed(SpeedValue p_deltaSpeedValue) := { changeSpeed := { deltaSpeed := p_deltaSpeedValue } @@ -98,7 +94,7 @@ module LibItsCommon_Templates { /** * @desc Testsystem will change the heading (delta value) */ - template AcGnssPrimitive m_changeScenarioHeading(HeadingValue p_deltaHeadingValue) := { + template (value) AcGnssPrimitive m_changeScenarioHeading(HeadingValue p_deltaHeadingValue) := { changeHeading := { deltaHeading := p_deltaHeadingValue } diff --git a/ttcn/DENM/LibItsDenm_Templates.ttcn b/ttcn/DENM/LibItsDenm_Templates.ttcn index ebd39ee2..0898130e 100644 --- a/ttcn/DENM/LibItsDenm_Templates.ttcn +++ b/ttcn/DENM/LibItsDenm_Templates.ttcn @@ -314,7 +314,7 @@ module LibItsDenm_Templates { * @param p_protocolVersion The expected protocol version (Default: current DEN protocol version) * @param p_messageID The expected message id (Default: DEN message id) */ - template ItsPduHeader mw_itsPduHeader( + template (present) ItsPduHeader mw_itsPduHeader( template (present) StationID p_stationID := ?, template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_denm_ @@ -431,7 +431,7 @@ module LibItsDenm_Templates { * @param p_location The expected location Container (Default: any or omit) * @param p_alacarte The expected Alacarte Container (Default: any or omit) */ - template (present) DecentralizedEnvironmentalNotificationMessage mw_denm( + template DecentralizedEnvironmentalNotificationMessage mw_denm( template (present) ManagementContainer p_management := ?, template SituationContainer p_situation := *, template LocationContainer p_location := *, @@ -500,7 +500,7 @@ module LibItsDenm_Templates { * @param p_detectionTime The detection time (Default: current time) * @param p_referenceTime The reference time (Default: current time) */ - template (value) ManagementContainer m_denmMgmtConTermination ( + template (omit) ManagementContainer m_denmMgmtConTermination ( template (value) ActionID p_actionID, template (value) StationType p_stationType := f_getTsStationType(), template (value) ValidityDuration p_validityDuration := defaultValidity, @@ -522,7 +522,7 @@ module LibItsDenm_Templates { * @param p_detectionTime The detection time (Default: current time) * @param p_referenceTime The reference time (Default: current time) */ - template (present) ManagementContainer mw_denmMgmtConTermination ( + template ManagementContainer mw_denmMgmtConTermination ( template (present) ActionID p_actionID, template (present) StationType p_stationType := f_getIutStationType(), template (present) TimestampIts p_referenceTime := ?, @@ -541,7 +541,7 @@ module LibItsDenm_Templates { * @param p_validityDuration The expected validity duration (Default: any or omit) * @param p_transmissionInterval The expected transmission interval (Default: any or omit) */ - template (present) ManagementContainer mw_denmMgmtCon( + template ManagementContainer mw_denmMgmtCon( template (present) ActionID p_actionID, template (present) StationType p_stationType := f_getIutStationType(), template (present) TimestampIts p_referenceTime := ?, diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn index 5ed83ed8..9ceab881 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn @@ -161,7 +161,7 @@ module LibItsGeoNetworking_Functions { * NodeB being close to the area center */ //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf01Up(Scenario p_scenario := e_staticPosition) runs on ItsGeoNetworking /* TITAN TODO: system ItsGeoNetworkingSystem */ { + function f_cf01Up(Scenario p_scenario := e_staticPosition) runs on ItsGeoNetworking system ItsGeoNetworkingSystem { // Variables var PositionTable v_positionTable := {}; @@ -190,7 +190,7 @@ module LibItsGeoNetworking_Functions { } // end f_cf01Up //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf01Down() runs on ItsGeoNetworking /* TITAN TODO: system ItsGeoNetworkingSystem */ { + function f_cf01Down() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { f_uninitialiseSecuredMode(); @@ -217,7 +217,7 @@ module LibItsGeoNetworking_Functions { */ //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf02Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { + function f_cf02Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { // Variables var LongPosVector v_longPosVectorIut := valueof(m_dummyLongPosVector); @@ -286,7 +286,7 @@ module LibItsGeoNetworking_Functions { */ //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf02Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { + function f_cf02Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { // Local variables var integer i; @@ -318,7 +318,7 @@ module LibItsGeoNetworking_Functions { * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages */ //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf03Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { + function f_cf03Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { // Variables var LongPosVector v_longPosVectorIut := valueof(m_dummyLongPosVector); @@ -386,7 +386,7 @@ module LibItsGeoNetworking_Functions { */ //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf03Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { + function f_cf03Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { // Local variables var integer i; @@ -421,7 +421,7 @@ module LibItsGeoNetworking_Functions { */ //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf04Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { + function f_cf04Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { // Variables var LongPosVector v_longPosVectorIut := valueof(m_dummyLongPosVector); @@ -489,7 +489,7 @@ module LibItsGeoNetworking_Functions { */ //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf04Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */{ + function f_cf04Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { // Local variables var integer i; @@ -520,7 +520,7 @@ module LibItsGeoNetworking_Functions { */ //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf05Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { + function f_cf05Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { // Variables var LongPosVector v_longPosVectorIut := valueof(m_dummyLongPosVector); @@ -587,7 +587,7 @@ module LibItsGeoNetworking_Functions { */ //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf05Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { + function f_cf05Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { // Local variables var integer i; @@ -618,7 +618,7 @@ module LibItsGeoNetworking_Functions { * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages */ //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf06Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { + function f_cf06Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { // Variables var LongPosVector v_longPosVectorIut := valueof(m_dummyLongPosVector); @@ -685,7 +685,7 @@ module LibItsGeoNetworking_Functions { */ //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf06Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { + function f_cf06Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { // Local variables var integer i; @@ -716,7 +716,7 @@ module LibItsGeoNetworking_Functions { */ //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf07Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc /* TITAN TODO mtc ItsMtc system ItsGeoNetworkingSystem */{ + function f_cf07Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { // Variables var LongPosVector v_longPosVectorIut := valueof(m_dummyLongPosVector); @@ -782,7 +782,7 @@ module LibItsGeoNetworking_Functions { * @desc Deletes configuration cf06 */ //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf07Down() runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsGeoNetworkingSystem */ { + function f_cf07Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { // Local variables var integer i; @@ -978,9 +978,8 @@ module LibItsGeoNetworking_Functions { position := p_positionValue }; } - //FIXME RGY Titan doesn't support @deterministic yet - // function @deterministic f_fillTimestamp(inout LongPosVector v_vector) - function f_fillTimestamp(inout LongPosVector v_vector) + + function @deterministic f_fillTimestamp(in LongPosVector v_vector) return LongPosVector { if (v_vector.timestamp_ == 0) { v_vector.timestamp_ := f_computeGnTimestamp(); @@ -1339,7 +1338,7 @@ module LibItsGeoNetworking_Functions { /** * @desc Default handling cf01 de-initialisation. */ - altstep a_cf01Down() runs on ItsGeoNetworking { + altstep a_cf01Down() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { [] a_shutdown() { f_poDefault(); f_cf01Down(); @@ -1351,7 +1350,7 @@ module LibItsGeoNetworking_Functions { /** * @desc Default handling cf02 de-initialisation. */ - altstep a_cf02Down() runs on ItsMtc { + altstep a_cf02Down() runs on ItsMtc system ItsGeoNetworkingSystem { [] a_shutdown() { f_cf02Down(); log("*** a_cf02Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); @@ -1362,7 +1361,7 @@ module LibItsGeoNetworking_Functions { /** * @desc Default handling cf03 de-initialisation. */ - altstep a_cf03Down() runs on ItsMtc { + altstep a_cf03Down() runs on ItsMtc system ItsGeoNetworkingSystem { [] a_shutdown() { f_cf03Down(); log("*** a_cf03Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); @@ -1373,7 +1372,7 @@ module LibItsGeoNetworking_Functions { /** * @desc Default handling cf04 de-initialisation. */ - altstep a_cf04Down() runs on ItsMtc { + altstep a_cf04Down() runs on ItsMtc system ItsGeoNetworkingSystem { [] a_shutdown() { f_cf04Down(); log("*** a_cf04Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); @@ -1384,7 +1383,7 @@ module LibItsGeoNetworking_Functions { /** * @desc Default handling cf05 de-initialisation. */ - altstep a_cf05Down() runs on ItsMtc { + altstep a_cf05Down() runs on ItsMtc system ItsGeoNetworkingSystem { [] a_shutdown() { f_cf05Down(); log("*** a_cf05Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); @@ -1395,7 +1394,7 @@ module LibItsGeoNetworking_Functions { /** * @desc Default handling cf06 de-initialisation. */ - altstep a_cf06Down() runs on ItsMtc { + altstep a_cf06Down() runs on ItsMtc system ItsGeoNetworkingSystem { [] a_shutdown() { f_cf06Down(); log("*** a_cf06Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); @@ -1406,7 +1405,7 @@ module LibItsGeoNetworking_Functions { /** * @desc Default handling cf07 de-initialisation. */ - altstep a_cf07Down() runs on ItsMtc { + altstep a_cf07Down() runs on ItsMtc system ItsGeoNetworkingSystem { [] a_shutdown() { f_cf07Down(); log("*** a_cf07Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn index 87b888f4..eb665f31 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn @@ -74,8 +74,8 @@ module LibItsGeoNetworking_Templates { * @desc Receive template for GeoNetworking packet (GeonetworkingPort Primitive) * @param p_geoNwMsg GeoNetworking packet to be received */ - template GeoNetworkingInd mw_geoNwInd( - template (present) GeoNetworkingPdu p_geoNwMsg + template(present) GeoNetworkingInd mw_geoNwInd( + template (present) GeoNetworkingPdu p_geoNwMsg := ? ) := { msgIn := p_geoNwMsg, macDestinationAddress := ?, @@ -88,9 +88,9 @@ module LibItsGeoNetworking_Templates { * @param p_geoNwMsg GeoNetworking packet to be received * @param p_llDestinationAdress Link-layer destination address */ - template GeoNetworkingInd mw_geoNwInd_withLinkLayerDestination( - template (present) GeoNetworkingPdu p_geoNwMsg, - template (present) MacAddress p_llDestinationAdress + template (present) GeoNetworkingInd mw_geoNwInd_withLinkLayerDestination( + template (present) GeoNetworkingPdu p_geoNwMsg := ?, + template (present) MacAddress p_llDestinationAdress := ? ) modifies mw_geoNwInd := { macDestinationAddress := p_llDestinationAdress } @@ -396,8 +396,8 @@ module LibItsGeoNetworking_Templates { * @desc Testsystem will pass received to the TTCN-3 * @param p_beaconHeader The neighbor information */ - template AcGnPrimitive m_startPassBeaconing( - template (value) BeaconHeader p_beaconHeader + template (value) AcGnPrimitive m_startPassBeaconing( + in template (value) BeaconHeader p_beaconHeader ) := { startPassBeaconing := { beaconHeader := p_beaconHeader @@ -407,7 +407,7 @@ module LibItsGeoNetworking_Templates { /** * @desc Testsystem will stop passing beacon information to the TTCN-3 */ - template AcGnPrimitive m_stopPassBeaconing := { + template (value) AcGnPrimitive m_stopPassBeaconing := { stopPassBeaconing := { } } @@ -431,7 +431,7 @@ module LibItsGeoNetworking_Templates { * @desc Testsystem will stop beaconing for multiple neighbors * @param p_compName The neighbor */ - template AcGnPrimitive m_stopBeaconingMultipleNeighbour := { + template (value) AcGnPrimitive m_stopBeaconingMultipleNeighbour := { stopBeaconingMultipleNeighbour:= { } } @@ -441,7 +441,7 @@ module LibItsGeoNetworking_Templates { * found in received beacon information to the TTCN-3 * @param p_gnAddress The GN address included in the LongPosVector */ - template AcGnPrimitive m_getLongPosVector(GN_Address p_gnAddress) := { + template (value) AcGnPrimitive m_getLongPosVector(GN_Address p_gnAddress) := { getLongPosVector := { gnAddress := p_gnAddress } @@ -678,7 +678,7 @@ module LibItsGeoNetworking_Templates { * @param payload Expected GN payload */ template (present) GnNonSecuredPacket mw_geoNwAnyPacket_withPayload( - template (present) GnRawPayload p_payload + template (present) GnRawPayload p_payload := ? ) := { commonHeader := mw_commonHeader( ?, @@ -868,8 +868,8 @@ module LibItsGeoNetworking_Templates { * @param p_seqNumber Sequence number of GeoAnycast packet */ template (present) GnNonSecuredPacket mw_geoNwAnycastPacket( - in template (present) LongPosVector p_sourceLongPosVec, - in template (present) UInt16 p_seqNumber + template (present) LongPosVector p_sourceLongPosVec := ?, + template (present) UInt16 p_seqNumber := ? ) := { commonHeader := mw_commonHeader( PX_GN_UPPER_LAYER, @@ -889,9 +889,9 @@ module LibItsGeoNetworking_Templates { * @param p_anycastArea Destination GeoArea */ template (present) GnNonSecuredPacket mw_geoNwAnycastPacketWithArea( - in template (present) LongPosVector p_sourceLongPosVec, - in template (present) UInt16 p_seqNumber, - in template (present) GeoAnycastArea p_anycastArea + template (present) LongPosVector p_sourceLongPosVec := ?, + template (present) UInt16 p_seqNumber := ?, + template (present) GeoAnycastArea p_anycastArea := ? ) := { commonHeader := mw_commonHeader( PX_GN_UPPER_LAYER, @@ -1142,8 +1142,8 @@ module LibItsGeoNetworking_Templates { * @param p_mid Searched GN_Address MID */ template (present) GnNonSecuredPacket mw_geoNwLsRequestPacket( - in template (present) UInt16 p_seqNumber, - in template (present) GN_Address.mid p_mid + template (present) UInt16 p_seqNumber := ?, + template (present) GN_Address.mid p_mid := ? ) := { commonHeader := mw_commonHeader( e_any, @@ -1185,8 +1185,8 @@ module LibItsGeoNetworking_Templates { * @param p_destinationLongPosVec Short position vector of destination */ template (present) GnNonSecuredPacket mw_geoNwLsReplyPacket( - in template (present) LongPosVector p_sourceLongPosVec, - in template (present) ShortPosVector p_destinationLongPosVec + template (present) LongPosVector p_sourceLongPosVec := ?, + template (present) ShortPosVector p_destinationLongPosVec := ? ) := { commonHeader := mw_commonHeader( e_any, @@ -1578,9 +1578,9 @@ module LibItsGeoNetworking_Templates { * @param p_nextHeader Id of next header * @param p_headerTypeSubType Header's type and sub-type */ - template CommonHeader mw_commonHeader ( - in template (present) NextHeader p_nextHeader, - in template (present) HeaderTST p_headerTypeSubType + template (present) CommonHeader mw_commonHeader ( + template (present) NextHeader p_nextHeader := ?, + template (present) HeaderTST p_headerTypeSubType := ? ) := { nextHeader := p_nextHeader, reserved := ?, @@ -1597,9 +1597,9 @@ module LibItsGeoNetworking_Templates { * @param p_nextHeader Id of next header * @param p_headerTypeSubType Header's type and sub-type */ - template CommonHeader mw_commonHeader_noPayload ( - in template (present) NextHeader p_nextHeader, - in template (present) HeaderTST p_headerTypeSubType + template (present) CommonHeader mw_commonHeader_noPayload ( + in template (present) NextHeader p_nextHeader := ?, + in template (present) HeaderTST p_headerTypeSubType := ? ) modifies mw_commonHeader := { plLength := 0 } @@ -1611,10 +1611,10 @@ module LibItsGeoNetworking_Templates { * @param p_hopLimit Maximum number of hops * @see mw_commonHeader */ - template CommonHeader mw_commonHeaderWithHopLimit ( - in template (present) NextHeader p_nextHeader, - in template (present) HeaderTST p_headerTypeSubType, - in template (present) UInt8 p_hopLimit + template (present) CommonHeader mw_commonHeaderWithHopLimit ( + in template (present) NextHeader p_nextHeader := ?, + in template (present) HeaderTST p_headerTypeSubType := ?, + in template (present) UInt8 p_hopLimit := ? ) modifies mw_commonHeader := { maxHopLimit := p_hopLimit } @@ -1628,11 +1628,11 @@ module LibItsGeoNetworking_Templates { * @param p_flags Flags in the common header * @see mw_commonHeaderWithHopLimit */ - template CommonHeader mw_commonHeaderWithHopLimitAndFlags ( - in template (present) NextHeader p_nextHeader, - in template (present) HeaderTST p_headerTypeSubType, - in template (present) UInt8 p_hopLimit, - in template (present) Bit8 p_flags + template (present) CommonHeader mw_commonHeaderWithHopLimitAndFlags ( + in template (present) NextHeader p_nextHeader := ?, + in template (present) HeaderTST p_headerTypeSubType := ?, + in template (present) UInt8 p_hopLimit := ?, + in template (present) Bit8 p_flags := ? ) modifies mw_commonHeaderWithHopLimit := { flags := p_flags } @@ -1644,10 +1644,10 @@ module LibItsGeoNetworking_Templates { * @param p_headerTypeSubType Header's type and sub-type * @param p_trafficClass Packet's traffic class */ - template CommonHeader mw_commonHeaderWithTrafficClass ( - in template (present) NextHeader p_nextHeader, - in template (present) HeaderTST p_headerTypeSubType, - in template (present) TrafficClass p_trafficClass + template (present) CommonHeader mw_commonHeaderWithTrafficClass ( + in template (present) NextHeader p_nextHeader := ?, + in template (present) HeaderTST p_headerTypeSubType := ?, + in template (present) TrafficClass p_trafficClass := ? ) modifies mw_commonHeader := { trafficClass := p_trafficClass } @@ -1699,8 +1699,8 @@ module LibItsGeoNetworking_Templates { * @desc Receive template for long position vector with specific GN_Address * @param p_gnAddress GN_Address to be contained in the long position vector */ - template LongPosVector mw_longPosVectorAny( - in template (present) GN_Address p_gnAddress + template (present) LongPosVector mw_longPosVectorAny( + in template (present) GN_Address p_gnAddress := ? ) := { gnAddr := p_gnAddress, timestamp_ := ?, @@ -1715,8 +1715,8 @@ module LibItsGeoNetworking_Templates { * @desc Receive template for long position vector with strict position check * @param p_longPosVector The base long position vector */ - template LongPosVector mw_longPosVectorPosition( - in template (value) LongPosVector p_longPosVector + template (present) LongPosVector mw_longPosVectorPosition( + template (present) LongPosVector p_longPosVector := ? ) := { gnAddr := p_longPosVector.gnAddr, timestamp_ := ?, @@ -1732,8 +1732,8 @@ module LibItsGeoNetworking_Templates { * @desc Receive template for short position vector with strict position check * @param p_shortPosVector The base short position vector */ - template ShortPosVector mw_shortPosVectorPosition( - in template (value) ShortPosVector p_shortPosVector + template (present) ShortPosVector mw_shortPosVectorPosition( + template (present) ShortPosVector p_shortPosVector := ? ) := { gnAddr := p_shortPosVector.gnAddr, timestamp_ := ?, @@ -1745,8 +1745,8 @@ module LibItsGeoNetworking_Templates { * @desc Receive template for short position vector without position check * @param p_shortPosVector The base short position vector */ - template ShortPosVector mw_shortPosVectorPosition_anyPos( - in template (value) ShortPosVector p_shortPosVector + template (present) ShortPosVector mw_shortPosVectorPosition_anyPos( + template (present) ShortPosVector p_shortPosVector := ? ) modifies mw_shortPosVectorPosition := { latitude := ?, longitude := ? @@ -1803,9 +1803,9 @@ module LibItsGeoNetworking_Templates { * @param p_destinationShortPosVec Long position vector of destination * @param p_seqNumber Sequence number of GeoUnicast packet */ - template ExtendedHeader mw_geoUnicastHeader( - in template (present) ShortPosVector p_destinationShortPosVec, - in template (present) UInt16 p_seqNumber + template (present) ExtendedHeader mw_geoUnicastHeader( + template (present) ShortPosVector p_destinationShortPosVec := ?, + template (present) UInt16 p_seqNumber := ? ) := { geoUnicastHeader := { seqNumber := p_seqNumber, @@ -1822,10 +1822,10 @@ module LibItsGeoNetworking_Templates { * @param p_srcLongPosVec Long position vector of source * @see mw_geoUnicastHeader */ - template ExtendedHeader mw_geoUnicastHeaderWithSourcePv( - in template (present) ShortPosVector p_destinationShortPosVec, - in template (present) UInt16 p_seqNumber, - in template (present) LongPosVector p_srcLongPosVec + template (present) ExtendedHeader mw_geoUnicastHeaderWithSourcePv( + template (present) ShortPosVector p_destinationShortPosVec := ?, + template (present) UInt16 p_seqNumber := ?, + template (present) LongPosVector p_srcLongPosVec := ? ) modifies mw_geoUnicastHeader := { geoUnicastHeader := { srcPosVector := p_srcLongPosVec @@ -1886,9 +1886,9 @@ module LibItsGeoNetworking_Templates { * @param p_senderLongPosVec Long position vector of sender * @param p_seqNumber Sequence number of GeoBroadcast packet */ - template ExtendedHeader mw_geoBroadcastHeader( - in template (present) LongPosVector p_sourceLongPosVec, - in template (present) UInt16 p_seqNumber + template (present) ExtendedHeader mw_geoBroadcastHeader( + template (present) LongPosVector p_sourceLongPosVec := ?, + template (present) UInt16 p_seqNumber := ? ) := { geoBroadcastHeader := { seqNumber := p_seqNumber, @@ -1911,10 +1911,10 @@ module LibItsGeoNetworking_Templates { * @param p_broadcastArea Destination GeoArea * @see mw_geoBroadcastHeader */ - template ExtendedHeader mw_geoBroadcastHeaderWithArea ( - in template (present) LongPosVector p_sourceLongPosVec, - in template (present) UInt16 p_seqNumber, - in template (present) GeoBroadcastArea p_broadcastArea + template (present) ExtendedHeader mw_geoBroadcastHeaderWithArea ( + template (present) LongPosVector p_sourceLongPosVec := ?, + template (present) UInt16 p_seqNumber := ?, + template (present) GeoBroadcastArea p_broadcastArea := ? ) modifies mw_geoBroadcastHeader := { geoBroadcastHeader := { geoAreaPosLatitude := p_broadcastArea.geoBroadcastArea.geoAreaPosLatitude, @@ -1941,7 +1941,7 @@ module LibItsGeoNetworking_Templates { /** * @desc Receive template for GeoBroadcast header type */ - template HeaderTST mw_geoBroadcastHeaderType := { + template (present) HeaderTST mw_geoBroadcastHeaderType := { geoBroadcastHdr := { headerType := e_geoBroadcast, headerSubType := ? @@ -1953,8 +1953,8 @@ module LibItsGeoNetworking_Templates { * @param p_headerSubType Packet's subtype * @see mw_geoBroadcastHeaderType */ - template HeaderTST mw_geoBroadcastHeaderTypeWithSubType( - in template (present) HeaderSubTypeGeoBroadcast p_headerSubType + template (present) HeaderTST mw_geoBroadcastHeaderTypeWithSubType( + template (present) HeaderSubTypeGeoBroadcast p_headerSubType := ? ) modifies mw_geoBroadcastHeaderType := { geoBroadcastHdr := { headerSubType := p_headerSubType @@ -1995,9 +1995,9 @@ module LibItsGeoNetworking_Templates { * @param p_senderLongPosVec Long position vector of sender * @param p_seqNumber Sequence number of GeoAnycast packet */ - template ExtendedHeader mw_geoAnycastHeader( - in template (present) LongPosVector p_sourceLongPosVec, - in template (present) UInt16 p_seqNumber + template (present) ExtendedHeader mw_geoAnycastHeader( + template (present) LongPosVector p_sourceLongPosVec := ?, + template (present) UInt16 p_seqNumber := ? ) := { geoAnycastHeader := { seqNumber := p_seqNumber, @@ -2020,10 +2020,10 @@ module LibItsGeoNetworking_Templates { * @param p_anycastArea Destination GeoArea * @see mw_geoAnycastHeader */ - template ExtendedHeader mw_geoAnycastHeaderWithArea ( - in template (present) LongPosVector p_sourceLongPosVec, - in template (present) UInt16 p_seqNumber, - in template (present) GeoAnycastArea p_anycastArea + template (present) ExtendedHeader mw_geoAnycastHeaderWithArea ( + template (present) LongPosVector p_sourceLongPosVec := ?, + template (present) UInt16 p_seqNumber := ?, + template (present) GeoAnycastArea p_anycastArea := ? ) modifies mw_geoAnycastHeader := { geoAnycastHeader := { geoAreaPosLatitude := p_anycastArea.geoAnycastArea.geoAreaPosLatitude, @@ -2050,7 +2050,7 @@ module LibItsGeoNetworking_Templates { /** * @desc Receive template for GeoAnycast header type with any sub-type */ - template HeaderTST mw_geoAnycastHeaderType := { + template (present)HeaderTST mw_geoAnycastHeaderType := { geoAnycastHdr := { headerType := e_geoAnycast, headerSubType := ? @@ -2062,8 +2062,8 @@ module LibItsGeoNetworking_Templates { * @param p_headerSubType Packet's subtype * @see mw_geoAnycastHeaderType */ - template HeaderTST mw_geoAnycastHeaderTypeWithSubType( - in template (present) HeaderSubTypeGeoAnycast p_headerSubType + template (present) HeaderTST mw_geoAnycastHeaderTypeWithSubType( + template (present) HeaderSubTypeGeoAnycast p_headerSubType := ? ) modifies mw_geoAnycastHeaderType := { geoAnycastHdr := { headerSubType := p_headerSubType @@ -2098,9 +2098,9 @@ module LibItsGeoNetworking_Templates { * @param p_seqNumber Sequence number of LS Request packet * @param p_mid Searched GN_Address MID */ - template ExtendedHeader mw_lsRequestHeader( - in template (present) UInt16 p_seqNumber, - in template (present) GN_Address.mid p_mid + template (present) ExtendedHeader mw_lsRequestHeader( + in template (present) UInt16 p_seqNumber := ?, + in template (present) GN_Address.mid p_mid := ? ) := { lsRequestHeader := { seqNumber := p_seqNumber, @@ -2156,7 +2156,7 @@ module LibItsGeoNetworking_Templates { /** * @desc Receive template for any LS Reply header */ - template ExtendedHeader mw_lsReplyHeaderAny := { + template (present) ExtendedHeader mw_lsReplyHeaderAny := { lsReplyHeader := { seqNumber := ?, reserved := ?, @@ -2171,10 +2171,10 @@ module LibItsGeoNetworking_Templates { * @param p_destinationLongPosVec Short position vector of destination * @see mw_lsReplyHeaderAny */ - template ExtendedHeader mw_lsReplyHeader( - in template (present) LongPosVector p_sourceLongPosVec, - in template (present) ShortPosVector p_destinationLongPosVec) - modifies mw_lsReplyHeaderAny := { + template (present) ExtendedHeader mw_lsReplyHeader( + template (present) LongPosVector p_sourceLongPosVec := ?, + template (present) ShortPosVector p_destinationLongPosVec := ? + ) modifies mw_lsReplyHeaderAny := { lsReplyHeader := { srcPosVector := p_sourceLongPosVec, dstPosVector := p_destinationLongPosVec @@ -2212,8 +2212,8 @@ module LibItsGeoNetworking_Templates { * @desc Receive template for Beacon header * @param p_sourceLongPosVec Long position vector of source */ - template ExtendedHeader mw_beaconHeader( - in template (present) LongPosVector p_sourceLongPosVec + template (present) ExtendedHeader mw_beaconHeader( + template (present) LongPosVector p_sourceLongPosVec := ? ) := { beaconHeader := { srcPosVector := p_sourceLongPosVec @@ -2422,7 +2422,9 @@ module LibItsGeoNetworking_Templates { * @desc Receive template for GN_Address. Only M_ID field is discriminent * @param p_mid Expected GN Address MID */ - template GN_Address mw_gnAddressMid(in template (present) GN_Address.mid p_mid) := { + template (present) GN_Address mw_gnAddressMid( + template (present) GN_Address.mid p_mid := ? + ) := { typeOfAddress := ?, stationType := ?, stationCountryCode := ?, diff --git a/ttcn/Http/LibItsHttp_TestSystem.ttcn b/ttcn/Http/LibItsHttp_TestSystem.ttcn index d6f5c524..5ba52cb3 100644 --- a/ttcn/Http/LibItsHttp_TestSystem.ttcn +++ b/ttcn/Http/LibItsHttp_TestSystem.ttcn @@ -25,9 +25,10 @@ module LibItsHttp_TestSystem { type component HttpComponent extends SelfSyncComp { // FIXME To be rename into HttpTest port HttpPort httpPort; port HttpPort httpPort_notif; + // timers + timer tc_wait := PX_TWAIT; timer tc_ac := PX_TAC; timer tc_noac := PX_TNOAC; - timer tc_wait := PX_TWAIT; } // End of component HttpComponent diff --git a/ttcn/IVIM/LibItsIvim_Templates.ttcn b/ttcn/IVIM/LibItsIvim_Templates.ttcn index bbca477b..6691d425 100644 --- a/ttcn/IVIM/LibItsIvim_Templates.ttcn +++ b/ttcn/IVIM/LibItsIvim_Templates.ttcn @@ -54,7 +54,7 @@ module LibItsIvim_Templates { * @param p_iviMsg The expected IVI Message */ template (present) IvimInd mw_ivimInd( - template (present) IVIM p_iviMsg + template (present) IVIM p_iviMsg := ? ) := { msgIn := p_iviMsg, gnNextHeader := *, @@ -77,10 +77,8 @@ module LibItsIvim_Templates { * @param p_gnLifetime GN packet lifetime value (ms) * @param p_gnTrafficClass GN traffic class value */ -//FIXME RGY template should be (present), no omit is assigned to it as a whole; Titan currently requires that the modified templte has at least the same restirction as the base -// template IvimInd mw_ivimIndWithGnParameters ( - template(present) IvimInd mw_ivimIndWithGnParameters ( - template (present) IVIM p_iviMsg, + template IvimInd mw_ivimIndWithGnParameters( + template (present) IVIM p_iviMsg := ?, in template UInt8 p_gnNextHeader := *, in template UInt8 p_gnHeaderType := *, in template UInt8 p_gnHeaderSubtype := *, @@ -100,10 +98,8 @@ module LibItsIvim_Templates { * @param p_btpDestinationPort BTP destination port value * @param p_btpInfo BTP destination port info value (if BTP-B) or BTP source port value (if BTP-A) */ -//FIXME RGY template should be (present), no omit is assigned to it as a whole; Titan currently requires that the modified templte has at least the same restirction as the base -// template IvimInd mw_ivimIndWithBtpParameters ( - template(present) IvimInd mw_ivimIndWithBtpParameters ( - template (present) IVIM p_iviMsg, + template IvimInd mw_ivimIndWithBtpParameters( + template (present) IVIM p_iviMsg := ?, template UInt16 p_btpDestinationPort := *, template UInt16 p_btpInfo := * ) modifies mw_ivimInd := { @@ -117,9 +113,8 @@ module LibItsIvim_Templates { * @param p_ssp SSP security parameter * @param p_its_aid ITS-AID value */ -//FIXME RGY template should be (present), no omit is assigned to it as a whole; Titan currently requires that the modified templte has at least the same restirction as the base - template(present) IvimInd mw_ivimIndWithSecurityParameters ( - template (present) IVIM p_iviMsg, + template IvimInd mw_ivimIndWithSecurityParameters( + template (present) IVIM p_iviMsg := ?, template Bit256 p_ssp := *, template UInt32 p_its_aid := * ) modifies mw_ivimInd := { @@ -167,7 +162,7 @@ module LibItsIvim_Templates { * @param p_connectedIviStructures List of ConnectedIviStructure (Default: omit) * @param p_optional_ Optional field (Default: omit) */ - template (value) UtIvimUpdate m_utIvimUpdateEvent( + template (omit) UtIvimUpdate m_utIvimUpdateEvent( template (value) IviIdentificationNumber p_iviIdentificationNumber, template (omit) TimestampIts p_timeStamp := c_duration_2sec, template (omit) TimestampIts p_validFrom := omit, @@ -221,7 +216,7 @@ module LibItsIvim_Templates { * @param p_protocolVersion The expected protocol version (Default: current IVI protocol version) * @param p_messageID The expected message id (Default: IVI message id) */ - template ItsPduHeader mw_itsPduHeader( + template (present) ItsPduHeader mw_itsPduHeader( template (present) StationID p_stationID := ?, template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_ivim_ @@ -269,7 +264,7 @@ module LibItsIvim_Templates { * @param p_messageID The expected message id (Default: IVI message id) */ template (present) IVIM mw_ivimPdu( - template (present) IviStructure p_ivim, + template (present) IviStructure p_ivim := ?, template (present) StationID p_stationID := ?, template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_ivim_ @@ -300,7 +295,7 @@ module LibItsIvim_Templates { * @param p_mandatory The Management Container * @param p_optional_ A list of IVI Container (Default: omit) */ - template (present) IviStructure mw_ivimStructure( + template IviStructure mw_ivimStructure( template (present) IVIManagementContainer p_mandatory := ?, template IviStructure.optional_ p_optional_ := * ) := { @@ -315,7 +310,7 @@ module LibItsIvim_Templates { template (value) IviStructure m_ivimStructureCancellation( in template (value) IviIdentificationNumber p_iviIdentificationNumber ) := { - mandatory := valueof(m_iviManagementContainer(f_getProvider(), valueof(p_iviIdentificationNumber), LibItsIvim_ASN1_IVInamedNumbers.IviStatus_cancellation_)), + mandatory := valueof(m_iviManagementContainer(f_getProvider(), valueof(p_iviIdentificationNumber), IviStatus_cancellation_)), optional_ := omit } // End of template m_ivimStructureCancellation @@ -509,7 +504,7 @@ module LibItsIvim_Templates { zone := p_zone } // End of template m_glcPart - template (present) GlcPart mw_glcPart( + template GlcPart mw_glcPart( template (present) Zid p_zoneId := ?, template LanePosition p_laneNumber := *, template GlcPart.zoneExtension p_zoneExtension := *, diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn index 7ef6dc86..d1e43423 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn @@ -313,7 +313,7 @@ module LibItsMapemSpatem_Templates { * @param p_protocolVersion The expected protocol version (Default: current MAPEM SPATEM protocol version) * @param p_messageID The expected message id (Default: MAPEM id) */ - template ItsPduHeader mw_itsPduHeaderMapem( + template (present) ItsPduHeader mw_itsPduHeaderMapem( template (present) StationID p_stationID := ?, template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_mapem_ @@ -329,7 +329,7 @@ module LibItsMapemSpatem_Templates { * @param p_protocolVersion The expected protocol version (Default: current MAPEM SPATEM protocol version) * @param p_messageID The expected message id (Default: SPATEM id) */ - template ItsPduHeader mw_itsPduHeaderSpatem( + template (present) ItsPduHeader mw_itsPduHeaderSpatem( template (present) StationID p_stationID := ?, template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_spatem_ @@ -571,9 +571,7 @@ module LibItsMapemSpatem_Templates { /** * @desc Send template for SPAT Message */ -//FIXME RGY template should be (present), no omit is assigned to it as a whole; Titan currently requires that the modified templte has at least the same restirction as the base -// template (omit) SPAT m_spatem( - template (value) SPAT m_spatem( + template (omit) SPAT m_spatem( in template (value) IntersectionStateList p_intersections, in template (omit) DescriptiveName p_name := omit ) modifies m_defaultSpatem:= { @@ -585,12 +583,12 @@ module LibItsMapemSpatem_Templates { template (value) IntersectionStateList m_intersections := { m_intersection }; - template (value) IntersectionState m_intersection := { + template (omit) IntersectionState m_intersection := { name := omit, // Human readable name for intersection to be used only in debug mode id := m_intersectionReferenceID, // A globally unique value set, consisting of a regionID and // intersection ID assignment provides a unique mapping to the intersection MAP in question which provides complete location and approach/move/lane data revision := PX_INTERSECTIONSTATE_REVISION, - status := LibItsCommon_ASN1_ISDSRC_NamedNumbers.IntersectionStatusObject_manualControlIsEnabled_, + status := IntersectionStatusObject_manualControlIsEnabled_, // General status of the controller(s) moy := omit, // Minute of current UTC year used only with messages to be archived timeStamp := omit, // The mSec point in the current UTC minute that this message was constructed @@ -602,7 +600,7 @@ module LibItsMapemSpatem_Templates { template (value) MovementList m_movements := { m_movement }; - template (value) MovementState m_movement := { + template (omit) MovementState m_movement := { movementName := omit, signalGroup := PX_SIGNAL_GROUP_ID, state_time_speed := m_movementEventList, diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 60496abe..00a6287d 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -1211,7 +1211,7 @@ module LibItsSecurity_Functions { // Local variables var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; - var HeaderInfo v_mandatoryHeaders; + var HeaderInfo v_mandatoryHeaders := valueof(m_ieee1609Dot2_headerInfo(0)); var HeaderInfo v_signerInfo; // Load certificates if required @@ -1286,7 +1286,7 @@ module LibItsSecurity_Functions { // Local variables var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; - var HeaderInfo v_mandatoryHeaders; + var HeaderInfo v_mandatoryHeaders := valueof(m_ieee1609Dot2_headerInfo(0)); var HeaderInfo v_signerInfo; // Load certificates if required @@ -1363,7 +1363,7 @@ module LibItsSecurity_Functions { // Local variables var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; - var HeaderInfo v_mandatoryHeaders; + var HeaderInfo v_mandatoryHeaders := valueof(m_ieee1609Dot2_headerInfo(0)); var HeaderInfo v_signerInfo; // Load certificates if required @@ -1433,7 +1433,7 @@ module LibItsSecurity_Functions { // Local variables var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; - var HeaderInfo v_mandatoryHeaders; + var HeaderInfo v_mandatoryHeaders := valueof(m_ieee1609Dot2_headerInfo(0)); var HeaderInfo v_signerInfo; // Load certificates if required @@ -1508,7 +1508,7 @@ module LibItsSecurity_Functions { // Local variables var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; - var HeaderInfo v_mandatoryHeaders; + var HeaderInfo v_mandatoryHeaders := valueof(m_ieee1609Dot2_headerInfo(0)); var HeaderInfo v_signerInfo; // Load certificates if required @@ -1570,8 +1570,6 @@ module LibItsSecurity_Functions { in charstring p_certificateName ) runs on ItsSecurityBaseComponent return HashedId8 { // Local variables -// FIXME (DF) UNUSED -// var EtsiTs103097Certificate v_atCertificate; var HashedId8 v_hashedId8 := '0000000000000000'O; // Sanity check diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index 350e6765..8134e3b2 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -51,8 +51,6 @@ module LibItsSecurity_Templates { * @desc Its AID for Other * @see Draft ETSI TS 103 097 V1.3.1 Clause 7.3 Security profile for DENMs */ -//FIXME RGY definition type is changed to modulepar, as Titan doesn't support dynamic constants -// const IntX c_its_aid_Other := PX_OTHER_ITS_AID; template Psid c_its_aid_Other := PX_OTHER_ITS_AID; /** @@ -1015,12 +1013,16 @@ module LibItsSecurity_Templates { template (omit) HeaderInfo m_headerInfo_inner_pki_request( in template (value) Psid p_psid := c_its_aid_SCR, in template (value) Time64 p_generationTime - ) modifies m_headerInfo_gn := {}; + ) modifies m_ieee1609Dot2_headerInfo := { + generationTime := p_generationTime + }; template (omit) HeaderInfo m_headerInfo_inner_pki_response( in template (value) Psid p_psid := c_its_aid_SCR, in template (value) Time64 p_generationTime - ) modifies m_headerInfo_gn := {}; + ) modifies m_ieee1609Dot2_headerInfo := { + generationTime := p_generationTime + }; template (present) HeaderInfo mw_headerInfo_inner_pki_request( template (present) Psid p_psid := c_its_aid_SCR, @@ -1711,7 +1713,7 @@ module LibItsSecurity_Templates { ssp := p_ssp } // End of template m_appPermissions - template (present) PsidSsp mw_appPermissions( + template PsidSsp mw_appPermissions( template (present) Psid p_psid := ?, template ServiceSpecificPermissions p_ssp := * ) := { @@ -2074,7 +2076,7 @@ module LibItsSecurity_Templates { group utPrimitives { - template UtGnInitialize m_secGnInitialize( + template (value) UtGnInitialize m_secGnInitialize( in Oct8 p_hashedId8 ) := { hashedId8 := p_hashedId8 -- GitLab From 6e0111d02cdab632db6ac26074214f15b57e395b Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Fri, 13 Mar 2020 15:19:38 +0100 Subject: [PATCH 225/320] Add TC_RCA_CTLGEN_01_BV --- ttcn/Http/LibItsHttp_Pics.ttcn | 3 +- ttcn/Pki/LibItsPki_Functions.ttcn | 193 +++++++++++++++++- ttcn/Pki/LibItsPki_Pics.ttcn | 15 ++ ttcn/Pki/LibItsPki_Templates.ttcn | 70 ++++++- ttcn/Pki/LibItsPki_TestSystem.ttcn | 2 + ttcn/Security/LibItsSecurity_Functions.ttcn | 19 +- .../LibItsSecurity_TypesAndValues.ttcn | 8 +- 7 files changed, 295 insertions(+), 15 deletions(-) diff --git a/ttcn/Http/LibItsHttp_Pics.ttcn b/ttcn/Http/LibItsHttp_Pics.ttcn index 922a8bc7..b5f27bc8 100644 --- a/ttcn/Http/LibItsHttp_Pics.ttcn +++ b/ttcn/Http/LibItsHttp_Pics.ttcn @@ -18,7 +18,8 @@ module LibItsHttp_Pics { /** * @desc */ - modulepar charstring PICS_HEADER_CONTENT_TYPE := "application/x-its-request"; + modulepar charstring PICS_HEADER_CONTENT_TYPE := "application/x-its-request"; + modulepar charstring PICS_HEADER_CTL_CONTENT_TYPE := "application/x-its-crl"; /** * @desc Set to false in TOKEN header shall not be used diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 40aa731c..38c43ef3 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -26,6 +26,7 @@ module LibItsPki_Functions { import from EtsiTs102941TypesAuthorization language "ASN.1:1997" all; import from EtsiTs102941TypesAuthorizationValidation language "ASN.1:1997" all; import from EtsiTs102941MessagesCa language "ASN.1:1997" all; + import from EtsiTs102941TrustLists language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; import from ITS_Container language "ASN.1:1997" all; import from CAM_PDU_Descriptions language "ASN.1:1997" all; @@ -107,7 +108,7 @@ module LibItsPki_Functions { } f_connect4SelfOrClientSync(); - f_initialiseSecuredMode(p_ea_certificate_id, p_aa_certificate_id); // TODO To be removed??? + f_initialiseSecuredMode(p_ea_certificate_id, p_aa_certificate_id); // Setup EA certificate shared with PKI EA entity f_readCertificate(p_ea_certificate_id, vc_eaCertificate); @@ -144,6 +145,27 @@ module LibItsPki_Functions { } } // End of function f_cfHttpUp + /** + * @desc Setups default configuration + */ + function f_cfHttpUp_ca() runs on ItsPkiHttp /* TITAN TODO: system ItsPkiHttpSystem */ { + + if (PICS_MULTIPLE_END_POINT == false) { + map(self:httpPort, system:httpPort); + } else { + map(self:httpCaPort, system:httpCaPort); + } + f_connect4SelfOrClientSync(); + + f_initialiseSecuredMode(); + + if (PICS_MULTIPLE_END_POINT == false) { + activate(a_default_pki_http()); + } else { + activate(a_default_pki_http_ca()); + } + } // End of function f_cfHttpUp_ca + /** * @desc Setups default configuration * @param p_certificate_id The certificate identifier the TA shall use in case of secured IUT @@ -292,6 +314,19 @@ module LibItsPki_Functions { f_uninitialiseSecuredMode(); } // End of function f_cfHttpDown + /** + * @desc Deletes default configuration + */ + function f_cfHttpDown_ca() runs on ItsPkiHttp /* TITAN TODO: system ItsPkiHttpSystem */ { + if (PICS_MULTIPLE_END_POINT == false) { + unmap(self:httpPort, system:httpPort); + } else { + unmap(self:httpCaPort, system:httpCaPort); + } + f_disconnect4SelfOrClientSync(); + f_uninitialiseSecuredMode(); + } // End of function f_cfHttpDown_ca + /** * @desc Deletes default configuration */ @@ -636,6 +671,15 @@ module LibItsPki_Functions { p_http_message.response.header := p_headers; } httpAtPort.send(p_http_message); + } else if (v_content_text == { "ca_request" }) { + log("f_http_send: Send on CA end point"); + f_set_headers_list({ c_header_host }, { PICS_HEADER_HOST_CA }, p_headers); + if (ischosen(p_http_message.request)) { + p_http_message.request.header := p_headers; + } else { + p_http_message.response.header := p_headers; + } + httpCaPort.send(p_http_message); } else { log("f_http_send: Invalid header value: ", v_content_text); } @@ -2863,6 +2907,116 @@ module LibItsPki_Functions { } // End of group authorization_validation_xxx + group rca { + + function f_verify_rca_response_message( + in Ieee1609Dot2Data p_ieee1609dot2_signed_data, + in boolean p_check_security := true, + out ToBeSignedRcaCtl p_to_be_signed_rca_ctl + ) return boolean { + var bitstring v_etsi_ts_102941_data_msg; + var bitstring v_tbs; + var Certificate v_certificate; + var charstring v_certificate_id; + var Oct32 v_issuer; + var EtsiTs102941Data v_etsi_ts_102941_data; + + log(">>> f_verify_rca_response_message: p_ieee1609dot2_signed_data= ", p_ieee1609dot2_signed_data); + + // 1. Verify signature + log("f_verify_rca_response_message: p_ieee1609dot2_signed_data.content.signedData.tbsData= ", p_ieee1609dot2_signed_data.content.signedData.tbsData); + v_tbs := encvalue(p_ieee1609dot2_signed_data.content.signedData.tbsData); + if (f_getCertificateFromDigest(p_ieee1609dot2_signed_data.content.signedData.signer.digest, v_certificate, v_certificate_id) == false) { + if (p_check_security == true) { + return false; + } + } + f_getCertificateHash256(v_certificate_id, v_issuer); + if (f_verifyEcdsa(bit2oct(v_tbs), v_issuer, p_ieee1609dot2_signed_data.content.signedData.signature_, v_certificate.toBeSigned.verifyKeyIndicator.verificationKey) == false) { + if (p_check_security == true) { + return false; + } + } + v_etsi_ts_102941_data_msg := oct2bit(p_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); + if (decvalue(v_etsi_ts_102941_data_msg, v_etsi_ts_102941_data) != 0) { + log("f_verify_rca_response_message: Failed to decode EtsiTs102941Data"); + return false; + } else { + log("f_verify_rca_response_message: v_etsi_ts_102941_data= ", v_etsi_ts_102941_data); + log("f_verify_pki_response_message: RcaCertificateTrustListMessage matching= ", match(v_etsi_ts_102941_data, mw_etsiTs102941Data_to_be_signed_rca_ctl)); + if (match(v_etsi_ts_102941_data, mw_etsiTs102941Data_to_be_signed_rca_ctl) == false) { + log("f_verify_rca_response_message: Failed to decode certificateTrustListRca"); + return false; + } else { + p_to_be_signed_rca_ctl := v_etsi_ts_102941_data.content.certificateTrustListRca; + log("f_verify_rca_response_message: p_to_be_signed_rca_ctl= ", p_to_be_signed_rca_ctl); + } + } + + return true; + } + + function f_verify_full_ctl( + in ToBeSignedRcaCtl p_to_be_signed_rca_ctl + ) return boolean { + log(">>> f_verify_full_ctl: p_to_be_signed_rca_ctl= ", p_to_be_signed_rca_ctl); + + // 1. Check mandatory fields + log("f_verify_full_ctl matching= ", match(p_to_be_signed_rca_ctl, mw_to_be_signed_rca_full_ctl)); + if (match(p_to_be_signed_rca_ctl, mw_to_be_signed_rca_full_ctl) == false) { + return false; + } + + log("f_verify_full_ctl: ctlCommands length: ", lengthof(p_to_be_signed_rca_ctl.ctlCommands)); + for (var integer v_i := 0; v_i < lengthof(p_to_be_signed_rca_ctl.ctlCommands); v_i := v_i + 1) { + var CtlCommand v_ctl_command := p_to_be_signed_rca_ctl.ctlCommands[v_i]; + + if (ischosen(v_ctl_command.delete)) { + log("f_verify_full_ctl: ctlCommands shall not contains 'delete' variant"); + return false; + } else { + if (f_verify_ctl_entry(v_ctl_command.add) == false) { + log("f_verify_full_ctl: ctlCommands contains inavlid entries"); + return false; + } + } + } // End of 'for' statements + + return true; + } + + function f_verify_ctl_entry( + in CtlEntry p_ctl_entry + ) return boolean { + if (ischosen(p_ctl_entry.rca)) { + if (match(p_ctl_entry.rca, mw_root_ca_entry(mw_etsiTs103097Certificate)) == false) { + return false; + } + } else if (ischosen(p_ctl_entry.ea)) { + if (match(p_ctl_entry.ea, mw_ea_entry(mw_etsiTs103097Certificate)) == false) { + return false; + } + } else if (ischosen(p_ctl_entry.aa)) { + if (match(p_ctl_entry.aa, mw_aa_entry(mw_etsiTs103097Certificate)) == false) { + return false; + } + } else if (ischosen(p_ctl_entry.dc)) { + if (match(p_ctl_entry.dc, mw_dc_entry) == false) { + return false; + } + } else if (ischosen(p_ctl_entry.tlm)) { + if (match(p_ctl_entry.tlm, mw_tlm_entry(mw_etsiTs103097Certificate)) == false) { + return false; + } + } else { + return false; + } + + return true; + } + + } // End of group rca + group awaiting_messages { function f_await_http_inner_ec_request_response( @@ -3568,6 +3722,7 @@ module LibItsPki_Functions { var octetstring v_msg; var Ieee1609Dot2Data v_ieee1609dot2_signed_data; var Certificate v_certificate; + var charstring v_certificate_id; log(">>> f_verify_pki_request_message: p_private_enc_key= ", p_private_enc_key); log(">>> f_verify_pki_request_message: p_salt= ", p_salt); @@ -3641,7 +3796,7 @@ module LibItsPki_Functions { } //return false; } else { - if (f_getCertificateFromDigest(f_HashedId8FromSha256(p_issuer), v_certificate) == false) { + if (f_getCertificateFromDigest(f_HashedId8FromSha256(p_issuer), v_certificate, v_certificate_id) == false) { if (p_check_security == true) { return false; } @@ -3702,6 +3857,7 @@ module LibItsPki_Functions { var octetstring v_plain_message; var Ieee1609Dot2Data v_ieee1609dot2_signed_data; var Certificate v_certificate; + var charstring v_certificate_id; var bitstring v_etsi_ts_102941_data_msg; var bitstring v_tbs; var boolean v_ret; @@ -3732,7 +3888,7 @@ module LibItsPki_Functions { // 3. Check the signature log("f_verify_pki_response_message: v_ieee1609dot2_signed_data.content.signedData.tbsData= ", v_ieee1609dot2_signed_data.content.signedData.tbsData); v_tbs := encvalue(v_ieee1609dot2_signed_data.content.signedData.tbsData); - if (f_getCertificateFromDigest(v_ieee1609dot2_signed_data.content.signedData.signer.digest, v_certificate) == false) { + if (f_getCertificateFromDigest(v_ieee1609dot2_signed_data.content.signedData.signer.digest, v_certificate, v_certificate_id) == false) { if (p_check_security == true) { return false; } @@ -4029,6 +4185,37 @@ module LibItsPki_Functions { } } // End of altstep a_default_pki_http_at + altstep a_default_pki_http_ca() runs on ItsPkiHttp { + [PICS_MULTIPLE_END_POINT] httpCaPort.receive( + mw_http_response( + mw_http_response_ko + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": FAIL: Unexpected message received ***"); + f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); + } + [PICS_MULTIPLE_END_POINT] httpCaPort.receive(mw_http_request) { + tc_ac.stop; + log("*** a_default: ERROR: Unexpected HTTP Request received ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [PICS_MULTIPLE_END_POINT] httpCaPort.receive(mw_http_response) { + tc_ac.stop; + log("*** a_default: ERROR: Unexpected HTTP Response received ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [PICS_MULTIPLE_END_POINT] httpCaPort.receive { + tc_ac.stop; + log("*** a_default: ERROR: Unexpected HTTP message received ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] a_shutdown() { + log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } + } // End of altstep a_default_pki_http_ca + altstep a_await_ec_http_request_from_iut( template HttpMessage p_http_message, out HttpMessage p_response diff --git a/ttcn/Pki/LibItsPki_Pics.ttcn b/ttcn/Pki/LibItsPki_Pics.ttcn index 60349f20..6cdb7cba 100644 --- a/ttcn/Pki/LibItsPki_Pics.ttcn +++ b/ttcn/Pki/LibItsPki_Pics.ttcn @@ -15,6 +15,11 @@ module LibItsPki_Pics { */ modulepar boolean PICS_IUT_AA_ROLE := true; + /** + * @desc Does the IUT act as CA device? + */ + modulepar boolean PICS_IUT_CA_ROLE := true; + /** * @desc Does the IUT support enrolment? */ @@ -100,6 +105,11 @@ module LibItsPki_Pics { */ modulepar charstring PICS_HEADER_HOST_AT := "www.its.at.org"; + /** + * @desc End point for the CA + */ + modulepar charstring PICS_HEADER_HOST_CA := "www.its.ca.org"; + /** * @desc Certificate used by the Test System */ @@ -136,6 +146,11 @@ module LibItsPki_Pics { */ modulepar charstring PICS_HTTP_POST_URI_ATV := "/authorize_validate"; + /** + * @desc HTTP GET URI for Certificate Trusted List + */ + modulepar charstring PICS_HTTP_GET_URI_CTL := "/dc/getctl"; + /** * @desc Factory private key for verification Nist P256 */ diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn index 02686f6c..270118aa 100644 --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ b/ttcn/Pki/LibItsPki_Templates.ttcn @@ -29,9 +29,11 @@ module LibItsPki_Templates { import from EtsiTs102941TypesAuthorization language "ASN.1:1997" all; import from EtsiTs102941TypesAuthorizationValidation language "ASN.1:1997" all; import from EtsiTs102941MessagesCa language "ASN.1:1997" all; + import from EtsiTs102941TrustLists language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; // LibItsSecurity + import from LibItsSecurity_TypesAndValues all; import from LibItsSecurity_Templates all; // LibItsPki @@ -129,6 +131,15 @@ module LibItsPki_Templates { ) modifies mw_etsiTs103097Data_encrypted := { } // End of template mw_authorizationValidationResponseMessage + template (present) EtsiTs102941Data mw_etsiTs102941Data_to_be_signed_rca_ctl( + template (present) ToBeSignedRcaCtl p_to_be_signed_rca_ctl := ? + ) := { + version := PkiProtocolVersion, + content := { + certificateTrustListRca := p_to_be_signed_rca_ctl + } + } // End of template mw_etsiTs102941Data_to_be_signed_rca_ctl + template (value) AuthorizationRequestMessage m_authorizationRequestMessage( in template (value) EncryptedData p_encryptedData ) modifies m_etsiTs103097Data_encrypted := { @@ -518,5 +529,62 @@ module LibItsPki_Templates { appPermissions := p_appPermissions, certIssuePermissions := p_certIssuePermissions } // End of template mw_certificate_subject_attributes - + + template (present) ToBeSignedRcaCtl mw_to_be_signed_rca_full_ctl := { + version := 1, + nextUpdate := ?, + isFullCtl := true, + ctlSequence := ?, + ctlCommands := ? + } // End of template mw_to_be_signed_rca_ful_ctl + + template (present) ToBeSignedRcaCtl mw_to_be_signed_rca_delta_ctl := { + version := 1, + nextUpdate := ?, + isFullCtl := false, + ctlSequence := ?, + ctlCommands := ? + } // End of template mw_to_be_signed_rca_delta_ctl + + template (present) TlmEntry mw_tlm_entry( + template (present) EtsiTs103097Certificate p_selfSignedTLMCertificate := ?, + template (present) Url p_accessPoint := ? + ) := { + selfSignedTLMCertificate := p_selfSignedTLMCertificate, + linkTLMCertificate := *, + accessPoint := p_accessPoint + } // End of template mw_tlm_entry + + template (present) RootCaEntry mw_root_ca_entry( + template (present) EtsiTs103097Certificate p_selfsignedRootCa := ? + ) := { + selfsignedRootCa := p_selfsignedRootCa, + linkRootCaCertificate := * + } // End of template mw_root_ca_entry + + template (present) EaEntry mw_ea_entry( + template (present) EtsiTs103097Certificate p_eaCertificate := ?, + template (present) Url p_aaAccessPoint := ? + ) := { + eaCertificate := p_eaCertificate, + aaAccessPoint := p_aaAccessPoint, + itsAccessPoint := * + } // End of linkRootCaCertificate mw_ea_entry + + template (present) AaEntry mw_aa_entry( + template (present) EtsiTs103097Certificate p_aaCertificate := ?, + template (present) Url p_accessPoint := ? + ) := { + aaCertificate := p_aaCertificate, + accessPoint := p_accessPoint + } // End of template mw_aa_entry + + template (present) DcEntry mw_dc_entry( + template (present) Url p_url := ?, + template (present) HashedId8s p_cert := ? + ) := { + url := p_url, + cert := p_cert + } // End of template mw_dc_entry + } // End of module LibItsPki_Templates diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index fdd53f76..54acbf96 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -63,6 +63,7 @@ module LibItsPki_TestSystem { port HttpPort httpEcPort; /** Enrolment end point */ port HttpPort httpAtVPort; /** Authorization Validation end point */ port HttpPort httpAtPort; /** Authorization end point */ + port HttpPort httpCaPort; /** CA CTL/CRL end point */ } // End of component ItsPkiHttpSystem /** @@ -73,6 +74,7 @@ module LibItsPki_TestSystem { port HttpPort httpEcPort; /** Enrolment end point */ port HttpPort httpAtVPort; /** Authorization Validation end point */ port HttpPort httpAtPort; /** Authorization end point */ + port HttpPort httpCaPort; /** CA CTL/CRL end point */ var Certificate vc_eaCertificate; /** Test Adapter EA certificate */ var octetstring vc_eaPrivateKey; /** Test Adapter EA private key for signature */ var octetstring vc_eaPrivateEncKey; /** Test Adapter EA private key for encryption */ diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 00a6287d..499fbc5e 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -764,12 +764,13 @@ module LibItsSecurity_Functions { out EtsiTs103097Certificate p_aaCertificate, out EtsiTs103097Certificate p_atCertificate ) runs on ItsSecurityBaseComponent return boolean { + var charstring v_certificate_id; + //log(">>> f_prepareCertificates: ", p_certificateName); // Load certificates if required if ((lengthof(p_certificateName) > 0) and (valueof(p_certificateName) != cc_taCert_A)) { var HashedId8 v_digest; - var charstring v_cert; if (f_readCertificate(valueof(p_certificateName), p_atCertificate) == false){ log("f_prepareCertificates: Failed to read certificate ", p_certificateName); @@ -783,7 +784,7 @@ module LibItsSecurity_Functions { log("f_prepareCertificates: Invalid certificate issuer ", p_atCertificate.issuer); return false; } - if (f_getCertificateFromDigest(v_digest, p_aaCertificate) == false) { + if (f_getCertificateFromDigest(v_digest, p_aaCertificate, v_certificate_id) == false) { log("f_prepareCertificates: Failed to read certificate issuer ", v_digest); return false; } @@ -2173,6 +2174,8 @@ module LibItsSecurity_Functions { function f_loadCertificates( in charstring p_configId ) runs on ItsSecurityBaseComponent return boolean { + var charstring v_certificate_id; + // Setup certificates memory cache if (fx_loadCertificates(PX_CERTIFICATE_POOL_PATH, p_configId) == true) { // Setup security component variables @@ -2188,7 +2191,7 @@ module LibItsSecurity_Functions { return false; } log("Selected issuer: ", v_issuer); - if (f_getCertificateFromDigest(v_issuer, vc_aaCertificate)) { + if (f_getCertificateFromDigest(v_issuer, vc_aaCertificate, v_certificate_id)) { if (f_readSigningKey(cc_taCert_A, vc_signingPrivateKey) == true) { f_readEncryptingKey(cc_taCert_A, vc_encryptPrivateKey); return true; @@ -2298,15 +2301,15 @@ module LibItsSecurity_Functions { function f_getCertificateFromDigest( in HashedId8 p_digest, - out EtsiTs103097Certificate p_certificate + out EtsiTs103097Certificate p_certificate, + out charstring p_certificate_id ) return boolean { - var charstring v_certificate_id; - if (not(fx_readCertificateFromDigest(p_digest, v_certificate_id))) { + if (not(fx_readCertificateFromDigest(p_digest, p_certificate_id))) { log("f_getCertificateFromDigest: Failed to retrieve digest for ", p_digest); return false; } - if (not(f_readCertificate(v_certificate_id, p_certificate))) { - log("f_getCertificateFromDigest: Failed to retrieve digest for ", v_certificate_id); + if (not(f_readCertificate(p_certificate_id, p_certificate))) { + log("f_getCertificateFromDigest: Failed to retrieve digest for ", p_certificate_id); return false; } return true; diff --git a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn index 56be4847..e1e5bf22 100644 --- a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn +++ b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn @@ -22,7 +22,12 @@ module LibItsSecurity_TypesAndValues { import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; import from IEEE1609dot2 language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; - + + /** + * @desc Sequence of HashedId8 + */ + type record of HashedId8 HashedId8s; + // Test Adapter certificates & private keys - Valid behavior const charstring cc_taCert_A := PX_CERT_FOR_TS; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_A_AA := "CERT_TS_A_AA"; @@ -259,7 +264,6 @@ module LibItsSecurity_TypesAndValues { e_brainpool_384 } - group taConfiguration { /** -- GitLab From 956ea968e8a7b3701c6fbb1386c3aac2e98c4d46 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Mon, 16 Mar 2020 09:49:03 +0100 Subject: [PATCH 226/320] Add TC_RCA_CRLGEN_02_BV --- ttcn/BTP/LibItsBtp_Functions.ttcn | 7 +- ttcn/Http/LibItsHttp_Pics.ttcn | 3 +- ttcn/Pki/LibItsPki_Functions.ttcn | 103 ++++++++++++++++++++++++++---- ttcn/Pki/LibItsPki_Pics.ttcn | 5 ++ ttcn/Pki/LibItsPki_Templates.ttcn | 16 +++++ 5 files changed, 117 insertions(+), 17 deletions(-) diff --git a/ttcn/BTP/LibItsBtp_Functions.ttcn b/ttcn/BTP/LibItsBtp_Functions.ttcn index 47795723..7e909648 100644 --- a/ttcn/BTP/LibItsBtp_Functions.ttcn +++ b/ttcn/BTP/LibItsBtp_Functions.ttcn @@ -14,11 +14,8 @@ // LibCommon import from LibCommon_Sync all; -// import from LibCommon_Time all; -// import from LibCommon_VerdictControl all; // LibItsCommon -// import from LibItsCommon_Functions all; import from LibItsCommon_TypesAndValues all; // LibItsBtp @@ -94,7 +91,7 @@ /** * @desc Setups default configuration */ - function f_cfUp() runs on ItsBtp /* TITAN TODO: system ItsBtpSystem */ { + function f_cfUp() runs on ItsBtp system ItsBtpSystem { map(self:utPort, system:utPort); map(self:btpPort, system:btpPort); @@ -105,7 +102,7 @@ /** * @desc Deletes default configuration */ - function f_cfDown() runs on ItsBtp /* TITAN TODO: system ItsBtpSystem */ { + function f_cfDown() runs on ItsBtp system ItsBtpSystem { unmap(self:utPort, system:utPort); unmap(self:btpPort, system:btpPort); diff --git a/ttcn/Http/LibItsHttp_Pics.ttcn b/ttcn/Http/LibItsHttp_Pics.ttcn index b5f27bc8..c8d78153 100644 --- a/ttcn/Http/LibItsHttp_Pics.ttcn +++ b/ttcn/Http/LibItsHttp_Pics.ttcn @@ -19,7 +19,8 @@ module LibItsHttp_Pics { * @desc */ modulepar charstring PICS_HEADER_CONTENT_TYPE := "application/x-its-request"; - modulepar charstring PICS_HEADER_CTL_CONTENT_TYPE := "application/x-its-crl"; + modulepar charstring PICS_HEADER_CTL_CONTENT_TYPE := "application/x-its-ctl"; + modulepar charstring PICS_HEADER_CRL_CONTENT_TYPE := "application/x-its-crl"; /** * @desc Set to false in TOKEN header shall not be used diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 38c43ef3..bd8c9876 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -2909,11 +2909,11 @@ module LibItsPki_Functions { group rca { - function f_verify_rca_response_message( - in Ieee1609Dot2Data p_ieee1609dot2_signed_data, - in boolean p_check_security := true, - out ToBeSignedRcaCtl p_to_be_signed_rca_ctl - ) return boolean { + function f_verify_rca_ctl_response_message( + in Ieee1609Dot2Data p_ieee1609dot2_signed_data, + in boolean p_check_security := true, + out ToBeSignedRcaCtl p_to_be_signed_rca_ctl + ) return boolean { var bitstring v_etsi_ts_102941_data_msg; var bitstring v_tbs; var Certificate v_certificate; @@ -2921,10 +2921,10 @@ module LibItsPki_Functions { var Oct32 v_issuer; var EtsiTs102941Data v_etsi_ts_102941_data; - log(">>> f_verify_rca_response_message: p_ieee1609dot2_signed_data= ", p_ieee1609dot2_signed_data); + log(">>> f_verify_rca_ctl_response_message: p_ieee1609dot2_signed_data= ", p_ieee1609dot2_signed_data); // 1. Verify signature - log("f_verify_rca_response_message: p_ieee1609dot2_signed_data.content.signedData.tbsData= ", p_ieee1609dot2_signed_data.content.signedData.tbsData); + log("f_verify_rca_ctl_response_message: p_ieee1609dot2_signed_data.content.signedData.tbsData= ", p_ieee1609dot2_signed_data.content.signedData.tbsData); v_tbs := encvalue(p_ieee1609dot2_signed_data.content.signedData.tbsData); if (f_getCertificateFromDigest(p_ieee1609dot2_signed_data.content.signedData.signer.digest, v_certificate, v_certificate_id) == false) { if (p_check_security == true) { @@ -2939,17 +2939,77 @@ module LibItsPki_Functions { } v_etsi_ts_102941_data_msg := oct2bit(p_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); if (decvalue(v_etsi_ts_102941_data_msg, v_etsi_ts_102941_data) != 0) { - log("f_verify_rca_response_message: Failed to decode EtsiTs102941Data"); + log("f_verify_rca_ctl_response_message: Failed to decode EtsiTs102941Data"); return false; } else { - log("f_verify_rca_response_message: v_etsi_ts_102941_data= ", v_etsi_ts_102941_data); + log("f_verify_rca_ctl_response_message: v_etsi_ts_102941_data= ", v_etsi_ts_102941_data); log("f_verify_pki_response_message: RcaCertificateTrustListMessage matching= ", match(v_etsi_ts_102941_data, mw_etsiTs102941Data_to_be_signed_rca_ctl)); if (match(v_etsi_ts_102941_data, mw_etsiTs102941Data_to_be_signed_rca_ctl) == false) { - log("f_verify_rca_response_message: Failed to decode certificateTrustListRca"); + log("f_verify_rca_ctl_response_message: Failed to decode certificateTrustListRca"); return false; } else { p_to_be_signed_rca_ctl := v_etsi_ts_102941_data.content.certificateTrustListRca; - log("f_verify_rca_response_message: p_to_be_signed_rca_ctl= ", p_to_be_signed_rca_ctl); + log("f_verify_rca_ctl_response_message: p_to_be_signed_rca_ctl= ", p_to_be_signed_rca_ctl); + if (p_to_be_signed_rca_ctl.nextUpdate <= f_getCurrentTime() / 1000) { + log("f_verify_rca_ctl_response_message: Invalid nextUpdate value: compared values=", p_to_be_signed_rca_ctl.nextUpdate, "/", f_getCurrentTime() / 1000); + return false; + } + } + } + + return true; + } + + function f_verify_rca_crl_response_message( + in Ieee1609Dot2Data p_ieee1609dot2_signed_data, + in boolean p_check_security := true, + out ToBeSignedCrl p_to_be_signed_crl + ) return boolean { + var bitstring v_etsi_ts_102941_data_msg; + var bitstring v_tbs; + var Certificate v_certificate; + var charstring v_certificate_id; + var Oct32 v_issuer; + var EtsiTs102941Data v_etsi_ts_102941_data; + + log(">>> f_verify_rca_crl_response_message: p_ieee1609dot2_signed_data= ", p_ieee1609dot2_signed_data); + + // 1. Verify signature + log("f_verify_rca_crl_response_message: p_ieee1609dot2_signed_data.content.signedData.tbsData= ", p_ieee1609dot2_signed_data.content.signedData.tbsData); + v_tbs := encvalue(p_ieee1609dot2_signed_data.content.signedData.tbsData); + if (f_getCertificateFromDigest(p_ieee1609dot2_signed_data.content.signedData.signer.digest, v_certificate, v_certificate_id) == false) { + if (p_check_security == true) { + return false; + } + } + f_getCertificateHash256(v_certificate_id, v_issuer); + if (f_verifyEcdsa(bit2oct(v_tbs), v_issuer, p_ieee1609dot2_signed_data.content.signedData.signature_, v_certificate.toBeSigned.verifyKeyIndicator.verificationKey) == false) { + if (p_check_security == true) { + return false; + } + } + v_etsi_ts_102941_data_msg := oct2bit(p_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); + if (decvalue(v_etsi_ts_102941_data_msg, v_etsi_ts_102941_data) != 0) { + log("f_verify_rca_crl_response_message: Failed to decode EtsiTs102941Data"); + return false; + } else { + log("f_verify_rca_crl_response_message: v_etsi_ts_102941_data= ", v_etsi_ts_102941_data); + log("f_verify_pki_response_message: CertificateRevocationList matching= ", match(v_etsi_ts_102941_data, mw_etsiTs102941Data_to_be_signed_crl)); + if (match(v_etsi_ts_102941_data, mw_etsiTs102941Data_to_be_signed_crl) == false) { + log("f_verify_rca_crl_response_message: Failed to decode certificateRevocationList"); + return false; + } else { + var Time32 v_time := f_getCurrentTime() / 1000; + p_to_be_signed_crl := v_etsi_ts_102941_data.content.certificateRevocationList; + log("f_verify_rca_crl_response_message: p_to_be_signed_crl= ", p_to_be_signed_crl); + if (p_to_be_signed_crl.thisUpdate >= v_time) { + log("f_verify_rca_crl_response_message: Invalid thisUpdate value"); + return false; + } + if (p_to_be_signed_crl.nextUpdate <= v_time) { + log("f_verify_rca_crl_response_message: Invalid nextUpdate value"); + return false; + } } } @@ -2985,6 +3045,27 @@ module LibItsPki_Functions { return true; } + function f_verify_full_crl( + in ToBeSignedCrl p_to_be_signed_crl + ) return boolean { + log(">>> f_verify_full_crl: p_to_be_signed_crl= ", p_to_be_signed_crl); + + // 1. Check mandatory fields + log("f_verify_full_crl matching= ", match(p_to_be_signed_crl, mw_to_be_signed_crl)); + if (match(p_to_be_signed_crl, mw_to_be_signed_crl) == false) { + return false; + } + + log("f_verify_full_crl: entries length: ", lengthof(p_to_be_signed_crl.entries)); + for (var integer v_i := 0; v_i < lengthof(p_to_be_signed_crl.entries); v_i := v_i + 1) { + var CrlEntry v_crl_entry := p_to_be_signed_crl.entries[v_i]; + + log("f_verify_full_crl: crlEntry: v_crl_entry"); + } // End of 'for' statements + + return true; + } + function f_verify_ctl_entry( in CtlEntry p_ctl_entry ) return boolean { diff --git a/ttcn/Pki/LibItsPki_Pics.ttcn b/ttcn/Pki/LibItsPki_Pics.ttcn index 6cdb7cba..02091b83 100644 --- a/ttcn/Pki/LibItsPki_Pics.ttcn +++ b/ttcn/Pki/LibItsPki_Pics.ttcn @@ -150,6 +150,11 @@ module LibItsPki_Pics { * @desc HTTP GET URI for Certificate Trusted List */ modulepar charstring PICS_HTTP_GET_URI_CTL := "/dc/getctl"; + + /** + * @desc HTTP GET URI for Certificate Trusted List + */ + modulepar charstring PICS_HTTP_GET_URI_CRL := "/dc/getcrl"; /** * @desc Factory private key for verification Nist P256 diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn index 270118aa..80b77219 100644 --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ b/ttcn/Pki/LibItsPki_Templates.ttcn @@ -140,6 +140,15 @@ module LibItsPki_Templates { } } // End of template mw_etsiTs102941Data_to_be_signed_rca_ctl + template (present) EtsiTs102941Data mw_etsiTs102941Data_to_be_signed_crl( + template (present) ToBeSignedCrl p_to_be_signed_crl := ? + ) := { + version := PkiProtocolVersion, + content := { + certificateRevocationList := p_to_be_signed_crl + } + } // End of template mw_etsiTs102941Data_to_be_signed_crl + template (value) AuthorizationRequestMessage m_authorizationRequestMessage( in template (value) EncryptedData p_encryptedData ) modifies m_etsiTs103097Data_encrypted := { @@ -546,6 +555,13 @@ module LibItsPki_Templates { ctlCommands := ? } // End of template mw_to_be_signed_rca_delta_ctl + template (present) ToBeSignedCrl mw_to_be_signed_crl := { + version := 1, + thisUpdate := ?, + nextUpdate := ?, + entries := ? + } // End of template mw_to_be_signed_crl + template (present) TlmEntry mw_tlm_entry( template (present) EtsiTs103097Certificate p_selfSignedTLMCertificate := ?, template (present) Url p_accessPoint := ? -- GitLab From 3f7c134dc24afb3a4b8ae71dd04b75b116b8fda7 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Wed, 18 Mar 2020 07:36:31 +0100 Subject: [PATCH 227/320] Bug fixed in TTCN-3 function f_set_headers_list() --- ttcn/Http/LibItsHttp_Functions.ttcn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ttcn/Http/LibItsHttp_Functions.ttcn b/ttcn/Http/LibItsHttp_Functions.ttcn index 80242369..3898082d 100644 --- a/ttcn/Http/LibItsHttp_Functions.ttcn +++ b/ttcn/Http/LibItsHttp_Functions.ttcn @@ -89,11 +89,11 @@ module LibItsHttp_Functions { var integer v_jdx; for (v_jdx := 0; v_jdx < lengthof(p_headers); v_jdx := v_jdx + 1) { if (p_headers[v_jdx].header_name == p_headers_to_set[v_idx]) { - p_headers[v_jdx].header_value := p_headers_value; // NOTE Codec won't encode it + p_headers[v_jdx].header_value := p_headers_value[v_idx]; // NOTE Codec won't encode it break; } if (v_jdx == lengthof(p_headers)) { - p_headers[v_jdx].header_value := p_headers_value; + p_headers[v_jdx].header_value := p_headers_value[v_jdx]; } } // End of 'for' statement } // End of 'for' statement -- GitLab From 85cb2b6c78a91a7d1370036baa632d557c509ed4 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Thu, 19 Mar 2020 08:22:47 +0100 Subject: [PATCH 228/320] Bug fixed in TTCN-3 function f_set_headers_list() --- ttcn/Http/LibItsHttp_Functions.ttcn | 4 ++-- ttcn/Security/LibItsSecurity_Functions.ttcn | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ttcn/Http/LibItsHttp_Functions.ttcn b/ttcn/Http/LibItsHttp_Functions.ttcn index 3898082d..f2c5257a 100644 --- a/ttcn/Http/LibItsHttp_Functions.ttcn +++ b/ttcn/Http/LibItsHttp_Functions.ttcn @@ -89,11 +89,11 @@ module LibItsHttp_Functions { var integer v_jdx; for (v_jdx := 0; v_jdx < lengthof(p_headers); v_jdx := v_jdx + 1) { if (p_headers[v_jdx].header_name == p_headers_to_set[v_idx]) { - p_headers[v_jdx].header_value := p_headers_value[v_idx]; // NOTE Codec won't encode it + p_headers[v_jdx].header_value := { p_headers_value[v_idx] }; // NOTE Codec won't encode it break; } if (v_jdx == lengthof(p_headers)) { - p_headers[v_jdx].header_value := p_headers_value[v_jdx]; + p_headers[v_jdx].header_value := { p_headers_value[v_jdx] }; } } // End of 'for' statement } // End of 'for' statement diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 499fbc5e..d0229ef8 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -2275,6 +2275,8 @@ module LibItsSecurity_Functions { in charstring p_certificate_id, out octetstring p_hash ) return boolean { + log(">>> f_getCertificateHash: ", p_certificate_id); + if (not fx_readCertificateHash(p_certificate_id, p_hash)){ log("f_getCertificateHash: Failed to retrieve digest for ", p_certificate_id); return false; -- GitLab From 63ccaf6630a5e2f37f949f23cdeee2cfdbbe0f48 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Tue, 24 Mar 2020 08:40:50 +0100 Subject: [PATCH 229/320] Bug fixed in AtsPki --- ttcn/Pki/LibItsPki_Functions.ttcn | 118 ++++++++++++++++++++++++++++- ttcn/Pki/LibItsPki_Pics.ttcn | 15 ++++ ttcn/Pki/LibItsPki_Templates.ttcn | 44 +++++------ ttcn/Pki/LibItsPki_TestSystem.ttcn | 2 + 4 files changed, 156 insertions(+), 23 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index bd8c9876..5e9c6224 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -166,6 +166,27 @@ module LibItsPki_Functions { } } // End of function f_cfHttpUp_ca + /** + * @desc Setups default configuration + */ + function f_cfHttpUp_tlm() runs on ItsPkiHttp /* TITAN TODO: system ItsPkiHttpSystem */ { + + if (PICS_MULTIPLE_END_POINT == false) { + map(self:httpPort, system:httpPort); + } else { + map(self:httpTlmPort, system:httpTlmPort); + } + f_connect4SelfOrClientSync(); + + f_initialiseSecuredMode(); + + if (PICS_MULTIPLE_END_POINT == false) { + activate(a_default_pki_http()); + } else { + activate(a_default_pki_http_tlm()); + } + } // End of function f_cfHttpUp_tlm + /** * @desc Setups default configuration * @param p_certificate_id The certificate identifier the TA shall use in case of secured IUT @@ -327,6 +348,19 @@ module LibItsPki_Functions { f_uninitialiseSecuredMode(); } // End of function f_cfHttpDown_ca + /** + * @desc Deletes default configuration + */ + function f_cfHttpDown_tlm() runs on ItsPkiHttp /* TITAN TODO: system ItsPkiHttpSystem */ { + if (PICS_MULTIPLE_END_POINT == false) { + unmap(self:httpPort, system:httpPort); + } else { + unmap(self:httpTlmPort, system:httpTlmPort); + } + f_disconnect4SelfOrClientSync(); + f_uninitialiseSecuredMode(); + } // End of function f_cfHttpDown_tlm + /** * @desc Deletes default configuration */ @@ -680,6 +714,15 @@ module LibItsPki_Functions { p_http_message.response.header := p_headers; } httpCaPort.send(p_http_message); + } else if (v_content_text == { "tlm_request" }) { + log("f_http_send: Send on TLM end point"); + f_set_headers_list({ c_header_host }, { PICS_HEADER_HOST_TLM }, p_headers); + if (ischosen(p_http_message.request)) { + p_http_message.request.header := p_headers; + } else { + p_http_message.response.header := p_headers; + } + httpTlmPort.send(p_http_message); } else { log("f_http_send: Invalid header value: ", v_content_text); } @@ -3066,6 +3109,35 @@ module LibItsPki_Functions { return true; } + function f_verify_full_ectl( + in ToBeSignedRcaCtl p_to_be_signed_tlm_ectl + ) return boolean { + log(">>> f_verify_full_ectl: p_to_be_signed_tlm_ectl= ", p_to_be_signed_tlm_ectl); + + // 1. Check mandatory fields + log("f_verify_full_ectl matching= ", match(p_to_be_signed_tlm_ectl, mw_to_be_signed_rca_full_ctl)); + if (match(p_to_be_signed_tlm_ectl, mw_to_be_signed_rca_full_ctl) == false) { + return false; + } + + log("f_verify_full_ectl: ctlCommands length: ", lengthof(p_to_be_signed_tlm_ectl.ctlCommands)); + for (var integer v_i := 0; v_i < lengthof(p_to_be_signed_tlm_ectl.ctlCommands); v_i := v_i + 1) { + var CtlCommand v_ectl_command := p_to_be_signed_tlm_ectl.ctlCommands[v_i]; + + if (ischosen(v_ectl_command.delete)) { + log("f_verify_full_ectl: ctlCommands shall not contains 'delete' variant"); + return false; + } else { + if (f_verify_ectl_entry(v_ectl_command.add) == false) { + log("f_verify_full_ectl: ctlCommands contains inavlid entries"); + return false; + } + } + } // End of 'for' statements + + return true; + } + function f_verify_ctl_entry( in CtlEntry p_ctl_entry ) return boolean { @@ -3085,9 +3157,22 @@ module LibItsPki_Functions { if (match(p_ctl_entry.dc, mw_dc_entry) == false) { return false; } - } else if (ischosen(p_ctl_entry.tlm)) { + } else { + return false; + } + + return true; + } + + function f_verify_ectl_entry( + in CtlEntry p_ctl_entry + ) return boolean { + if (ischosen(p_ctl_entry.tlm)) { if (match(p_ctl_entry.tlm, mw_tlm_entry(mw_etsiTs103097Certificate)) == false) { return false; + } else { + // TODO Verify selsigned certificate + return false; } } else { return false; @@ -4297,6 +4382,37 @@ module LibItsPki_Functions { } } // End of altstep a_default_pki_http_ca + altstep a_default_pki_http_tlm() runs on ItsPkiHttp { + [PICS_MULTIPLE_END_POINT] httpTlmPort.receive( + mw_http_response( + mw_http_response_ko + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": FAIL: Unexpected message received ***"); + f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); + } + [PICS_MULTIPLE_END_POINT] httpTlmPort.receive(mw_http_request) { + tc_ac.stop; + log("*** a_default: ERROR: Unexpected HTTP Request received ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [PICS_MULTIPLE_END_POINT] httpTlmPort.receive(mw_http_response) { + tc_ac.stop; + log("*** a_default: ERROR: Unexpected HTTP Response received ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [PICS_MULTIPLE_END_POINT] httpTlmPort.receive { + tc_ac.stop; + log("*** a_default: ERROR: Unexpected HTTP message received ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] a_shutdown() { + log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } + } // End of altstep a_default_pki_http_tlm + altstep a_await_ec_http_request_from_iut( template HttpMessage p_http_message, out HttpMessage p_response diff --git a/ttcn/Pki/LibItsPki_Pics.ttcn b/ttcn/Pki/LibItsPki_Pics.ttcn index 02091b83..ce5f4df8 100644 --- a/ttcn/Pki/LibItsPki_Pics.ttcn +++ b/ttcn/Pki/LibItsPki_Pics.ttcn @@ -20,6 +20,11 @@ module LibItsPki_Pics { */ modulepar boolean PICS_IUT_CA_ROLE := true; + /** + * @desc Does the IUT act as TLM device? + */ + modulepar boolean PICS_IUT_TLM_ROLE := true; + /** * @desc Does the IUT support enrolment? */ @@ -110,6 +115,11 @@ module LibItsPki_Pics { */ modulepar charstring PICS_HEADER_HOST_CA := "www.its.ca.org"; + /** + * @desc End point for the TLM + */ + modulepar charstring PICS_HEADER_HOST_TLM := "www.its.tlm.org"; + /** * @desc Certificate used by the Test System */ @@ -156,6 +166,11 @@ module LibItsPki_Pics { */ modulepar charstring PICS_HTTP_GET_URI_CRL := "/dc/getcrl"; + /** + * @desc HTTP GET URI for Certificate Trusted List + */ + modulepar charstring PICS_HTTP_GET_URI_ECTL := "/tlm/getectl"; + /** * @desc Factory private key for verification Nist P256 */ diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn index 80b77219..41b13d41 100644 --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ b/ttcn/Pki/LibItsPki_Templates.ttcn @@ -111,12 +111,12 @@ module LibItsPki_Templates { } } // End of template m_etsiTs102941Data_authorization_validation_response - template (present) EnrolmentRequestMessage mw_enrolmentRequestMessage( + template (present) EtsiTs103097Data/*EnrolmentRequestMessage*/mw_enrolmentRequestMessage( template (present) EncryptedData p_encryptedData := ? ) modifies mw_etsiTs103097Data_encrypted := { } // End of template mw_enrolmentRequestMessage - template (present) EnrolmentResponseMessage mw_enrolmentResponseMessage( + template (present) EtsiTs103097Data/*EnrolmentResponseMessage*/mw_enrolmentResponseMessage( template (present) EncryptedData p_encryptedData := ? ) modifies mw_etsiTs103097Data_encrypted := { } // End of template mw_enrolmentResponseMessage @@ -131,6 +131,26 @@ module LibItsPki_Templates { ) modifies mw_etsiTs103097Data_encrypted := { } // End of template mw_authorizationValidationResponseMessage + template (value) EtsiTs103097Data/*AuthorizationRequestMessage*/ m_authorizationRequestMessage( + in template (value) EncryptedData p_encryptedData + ) modifies m_etsiTs103097Data_encrypted := { + } // End of template m_authorizationRequestMessage + + template (present) EtsiTs103097Data/*AuthorizationRequestMessage*/ mw_authorizationRequestMessage( + template (present) EncryptedData p_encryptedData := ? + ) modifies mw_etsiTs103097Data_encrypted := { + } // End of template mw_authorizationRequestMessage + + template (value) EtsiTs103097Data/*AuthorizationResponseMessage*/ m_authorizationResponseMessage( + in template (value) EncryptedData p_encryptedData + ) modifies m_etsiTs103097Data_encrypted := { + } // End of template m_authorizationResponseMessage + + template (present) EtsiTs103097Data/*AuthorizationResponseMessage*/ mw_authorizationResponseMessage( + template (present) EncryptedData p_encryptedData := ? + ) modifies mw_etsiTs103097Data_encrypted := { + } // End of template mw_authorizationResponseMessage + template (present) EtsiTs102941Data mw_etsiTs102941Data_to_be_signed_rca_ctl( template (present) ToBeSignedRcaCtl p_to_be_signed_rca_ctl := ? ) := { @@ -149,26 +169,6 @@ module LibItsPki_Templates { } } // End of template mw_etsiTs102941Data_to_be_signed_crl - template (value) AuthorizationRequestMessage m_authorizationRequestMessage( - in template (value) EncryptedData p_encryptedData - ) modifies m_etsiTs103097Data_encrypted := { - } // End of template m_authorizationRequestMessage - - template (present) AuthorizationRequestMessage mw_authorizationRequestMessage( - template (present) EncryptedData p_encryptedData := ? - ) modifies mw_etsiTs103097Data_encrypted := { - } // End of template mw_authorizationRequestMessage - - template (value) AuthorizationResponseMessage m_authorizationResponseMessage( - in template (value) EncryptedData p_encryptedData - ) modifies m_etsiTs103097Data_encrypted := { - } // End of template m_authorizationResponseMessage - - template (present) AuthorizationResponseMessage mw_authorizationResponseMessage( - template (present) EncryptedData p_encryptedData := ? - ) modifies mw_etsiTs103097Data_encrypted := { - } // End of template mw_authorizationResponseMessage - template (value) EtsiTs102941DataContent m_enrolmentRequest( in template (value) InnerEcRequestSignedForPop p_enrolmentRequest ) := { diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index 54acbf96..b3573d5f 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -64,6 +64,7 @@ module LibItsPki_TestSystem { port HttpPort httpAtVPort; /** Authorization Validation end point */ port HttpPort httpAtPort; /** Authorization end point */ port HttpPort httpCaPort; /** CA CTL/CRL end point */ + port HttpPort httpTlmPort; /** TLM ECTL end point */ } // End of component ItsPkiHttpSystem /** @@ -75,6 +76,7 @@ module LibItsPki_TestSystem { port HttpPort httpAtVPort; /** Authorization Validation end point */ port HttpPort httpAtPort; /** Authorization end point */ port HttpPort httpCaPort; /** CA CTL/CRL end point */ + port HttpPort httpTlmPort; /** TLM ECTL end point */ var Certificate vc_eaCertificate; /** Test Adapter EA certificate */ var octetstring vc_eaPrivateKey; /** Test Adapter EA private key for signature */ var octetstring vc_eaPrivateEncKey; /** Test Adapter EA private key for encryption */ -- GitLab From 9c7f6e8cc5a2c56359f7732412d9c0c4977d93fa Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 26 Mar 2020 11:20:34 +0100 Subject: [PATCH 230/320] Implement Enrolment/Authorization simulator --- ttcn/Pki/LibItsPki_Functions.ttcn | 47 ++++++++++----------- ttcn/Pki/LibItsPki_TestSystem.ttcn | 4 +- ttcn/Security/LibItsSecurity_Functions.ttcn | 12 +++--- 3 files changed, 31 insertions(+), 32 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 5e9c6224..d6ad876a 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -1047,9 +1047,9 @@ module LibItsPki_Functions { log("f_http_build_inner_ec_response: p_inner_ec_response= ", p_inner_ec_response); v_msg := bit2oct(encvalue(m_etsiTs102941Data_inner_ec_response(p_inner_ec_response))); v_nonce := substr(f_hashWithSha256(int2oct((f_getCurrentTimeUtc() * 1000), 16)), 0, 12); // Random value - // TODO Consider Sha384: m_signerIdentifier_digest(f_HashedId8FromSha384(p_digest)) + // TODO Consider Sha384: m_signerIdentifier_digest(f_hashedId8FromSha384(p_digest)) if (f_build_pki_secured_response_message(p_private_key, - valueof(m_signerIdentifier_digest(f_HashedId8FromSha256(p_digest))),// in SignerIdentifier p_signer_identifier, + valueof(m_signerIdentifier_digest(f_hashedId8FromSha256(p_digest))),// in SignerIdentifier p_signer_identifier, v_msg, p_aes_sym_key, v_nonce, @@ -1364,9 +1364,9 @@ module LibItsPki_Functions { log("f_http_build_authorization_response: p_inner_at_response= ", p_inner_at_response); v_msg := bit2oct(encvalue(m_etsiTs102941Data_inner_at_response(p_inner_at_response))); v_nonce := substr(f_hashWithSha256(int2oct((f_getCurrentTimeUtc() * 1000), 16)), 0, 12); // Random value - // TODO Consider Sha384: m_signerIdentifier_digest(f_HashedId8FromSha384(p_digest)) + // TODO Consider Sha384: m_signerIdentifier_digest(f_hashedId8FromSha384(p_digest)) if (f_build_pki_secured_response_message(p_private_key, - valueof(m_signerIdentifier_digest(f_HashedId8FromSha256(p_digest))),// in SignerIdentifier p_signer_identifier, + valueof(m_signerIdentifier_digest(f_hashedId8FromSha256(p_digest))),// in SignerIdentifier p_signer_identifier, v_msg, p_aes_sym_key, v_nonce, @@ -1532,9 +1532,9 @@ module LibItsPki_Functions { log("f_http_build_authorization_validation_response: p_authorization_validation_response= ", p_authorization_validation_response); v_msg := bit2oct(encvalue(p_authorization_validation_response)); v_nonce := substr(f_hashWithSha256(int2oct((f_getCurrentTimeUtc() * 1000), 16)), 0, 12); // Random value - // TODO Consider Sha384: m_signerIdentifier_digest(f_HashedId8FromSha384(p_digest)) + // TODO Consider Sha384: m_signerIdentifier_digest(f_hashedId8FromSha384(p_digest)) if (f_build_pki_secured_response_message(p_private_key, - valueof(m_signerIdentifier_digest(f_HashedId8FromSha256(p_digest))),// in SignerIdentifier p_signer_identifier, + valueof(m_signerIdentifier_digest(f_hashedId8FromSha256(p_digest))),// in SignerIdentifier p_signer_identifier, v_msg, p_aes_sym_key, v_nonce, @@ -1607,7 +1607,7 @@ module LibItsPki_Functions { return false; } v_cert := m_etsiTs103097Certificate( - m_issuerIdentifier_sha256AndDigest(f_HashedId8FromSha256(f_hashWithSha256('616263'O))), + m_issuerIdentifier_sha256AndDigest(f_hashedId8FromSha256(f_hashWithSha256('616263'O))), m_toBeSignedCertificate_at( v_appPermissions, m_verificationKeyIndicator_verificationKey( @@ -1668,7 +1668,7 @@ module LibItsPki_Functions { log(">>> f_generate_ec_certificate_for_inner_ec_response"); - v_issuer := valueof(m_issuerIdentifier_sha256AndDigest(f_HashedId8FromSha256(p_digest))); // TODO Check sha256/384 f_HashedId8FromSha384 + v_issuer := valueof(m_issuerIdentifier_sha256AndDigest(f_hashedId8FromSha256(p_digest))); // TODO Check sha256/384 f_hashedId8FromSha384 v_cert := valueof( m_etsiTs103097Certificate( v_issuer, @@ -1740,7 +1740,7 @@ module LibItsPki_Functions { var bitstring v_tbs; var octetstring v_sig; - v_issuer := valueof(m_issuerIdentifier_sha256AndDigest(f_HashedId8FromSha256(p_digest))); // TODO Check sha256/384 f_HashedId8FromSha384 + v_issuer := valueof(m_issuerIdentifier_sha256AndDigest(f_hashedId8FromSha256(p_digest))); // TODO Check sha256/384 f_hashedId8FromSha384 v_cert := valueof( m_etsiTs103097Certificate( v_issuer, @@ -1813,7 +1813,7 @@ module LibItsPki_Functions { log(">>> f_generate_at_certificate_for_authorization_response"); - v_issuer := valueof(m_issuerIdentifier_sha256AndDigest(f_HashedId8FromSha256(p_digest))); // TODO Check sha256/384 f_HashedId8FromSha384 + v_issuer := valueof(m_issuerIdentifier_sha256AndDigest(f_hashedId8FromSha256(p_digest))); // TODO Check sha256/384 f_hashedId8FromSha384 v_cert := valueof( m_etsiTs103097Certificate( v_issuer, @@ -1927,8 +1927,7 @@ module LibItsPki_Functions { m_publicKeys( v_public_verification_key ), - m_certificateSubjectAttributes_id_omit/*FIXME No name*/( - /*oct2char(PICS_ITS_S_CANONICAL_ID),*/ + m_certificateSubjectAttributes_id_none/*FIXME No name*/( { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs valueof(m_appPermissions(c_its_aid_SCR, { bitmapSsp := PX_INNER_EC_CERTFICATE_BITMAP_SSP_SCR })) }, @@ -2299,10 +2298,10 @@ module LibItsPki_Functions { v_enc_value := encvalue(p_ec_certificate); if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1)) { v_ec_hash := f_hashWithSha384(bit2oct(v_enc_value)); - v_ec_hashed_id8 := f_HashedId8FromSha384(v_ec_hash); + v_ec_hashed_id8 := f_hashedId8FromSha384(v_ec_hash); } else { v_ec_hash := f_hashWithSha256(bit2oct(v_enc_value)); - v_ec_hashed_id8 := f_HashedId8FromSha256(v_ec_hash); + v_ec_hashed_id8 := f_hashedId8FromSha256(v_ec_hash); } log("f_generate_inner_at_request: v_ec_hash= ", v_ec_hash); @@ -2605,10 +2604,10 @@ module LibItsPki_Functions { v_enc_value := encvalue(p_ec_certificate); if (ischosen(p_ec_certificate.issuer.sha256AndDigest)) { v_ec_hash := f_hashWithSha256(bit2oct(v_enc_value)); - v_ec_hashed_id8 := f_HashedId8FromSha256(v_ec_hash); + v_ec_hashed_id8 := f_hashedId8FromSha256(v_ec_hash); } else { v_ec_hash := f_hashWithSha384(bit2oct(v_enc_value)); - v_ec_hashed_id8 := f_HashedId8FromSha384(v_ec_hash); + v_ec_hashed_id8 := f_hashedId8FromSha384(v_ec_hash); } log("f_generate_inner_at_request_with_wrong_parameters: v_ec_hash= ", v_ec_hash); log("f_generate_inner_at_request_with_wrong_parameters: v_ec_hashed_id8= ", v_ec_hashed_id8); @@ -3207,7 +3206,7 @@ module LibItsPki_Functions { log(">>> f_await_http_inner_ec_request_response: p_strict_checks=", p_strict_checks); f_http_build_inner_ec_request(p_private_key, p_compressed_public_key, p_compressed_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, v_salt, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash); - v_aes_sym_key_hashed_id8 := f_HashedId8FromSha256(f_hashWithSha256('80'O & v_aes_sym_key)); // Used to macth the response + v_aes_sym_key_hashed_id8 := f_hashedId8FromSha256(f_hashWithSha256('80'O & v_aes_sym_key)); // Used to macth the response f_init_default_headers_list(-, "inner_ec_request", v_headers); f_http_send( v_headers, @@ -3482,7 +3481,7 @@ module LibItsPki_Functions { log("f_build_pki_secured_request_message_signed_with_pop: p_recipientId= ", p_recipientId); if (p_recipientId == int2oct(0, 8)) { log("f_build_pki_secured_request_message_signed_with_pop: f_hashWithSha256(v_encrypted_sym_key)= ", f_hashWithSha256(p_encrypted_sym_key)); - v_recipientId := f_HashedId8FromSha256(f_hashWithSha256(p_encrypted_sym_key)); + v_recipientId := f_hashedId8FromSha256(f_hashWithSha256(p_encrypted_sym_key)); } else { v_recipientId := p_recipientId; } @@ -3601,7 +3600,7 @@ module LibItsPki_Functions { log("f_build_pki_secured_request_message: p_recipientId= ", p_recipientId); if (p_recipientId == int2oct(0, 8)) { log("f_build_pki_secured_request_message: f_hashWithSha256(v_encrypted_sym_key)= ", f_hashWithSha256(p_encrypted_sym_key)); - v_recipientId := f_HashedId8FromSha256(f_hashWithSha256(p_encrypted_sym_key)); + v_recipientId := f_hashedId8FromSha256(f_hashWithSha256(p_encrypted_sym_key)); } else { v_recipientId := p_recipientId; } @@ -3712,7 +3711,7 @@ module LibItsPki_Functions { log("f_build_pki_secured_request_message_for_authorization: p_recipientId= ", p_recipientId); if (p_recipientId == int2oct(0, 8)) { log("f_build_pki_secured_request_message_for_authorization: f_hashWithSha256(v_encrypted_sym_key)= ", f_hashWithSha256(p_encrypted_sym_key)); - v_recipientId := f_HashedId8FromSha256(f_hashWithSha256(p_encrypted_sym_key)); + v_recipientId := f_hashedId8FromSha256(f_hashWithSha256(p_encrypted_sym_key)); } else { v_recipientId := p_recipientId; } @@ -3836,7 +3835,7 @@ module LibItsPki_Functions { // Encode EtsiTs103097Data-Signed data structure v_encoded_inner_ec_response := bit2oct(encvalue(v_ieee1609dot2_signed_data)); v_encrypted_inner_ec_response := fx_encrypt_aes_128_ccm_test(p_aes_sym_key, p_nonce, v_encoded_inner_ec_response); - v_recipientId := f_HashedId8FromSha256(f_hashWithSha256(p_aes_sym_key)); + v_recipientId := f_hashedId8FromSha256(f_hashWithSha256(p_aes_sym_key)); log("v_recipientId= ", v_recipientId); // Fill Certificate template with the public compressed keys (canonical form) p_ieee1609dot2_signed_and_encrypted_data := valueof( @@ -3962,7 +3961,7 @@ module LibItsPki_Functions { } //return false; } else { - if (f_getCertificateFromDigest(f_HashedId8FromSha256(p_issuer), v_certificate, v_certificate_id) == false) { + if (f_getCertificateFromDigest(f_hashedId8FromSha256(p_issuer), v_certificate, v_certificate_id) == false) { if (p_check_security == true) { return false; } @@ -4112,7 +4111,7 @@ module LibItsPki_Functions { v_encoded_cert := encvalue(p_ec_certificate); v_ec_cert_hash := f_hashWithSha256(bit2oct(v_encoded_cert)); log("f_verify_ec_certificate: ==> EC certificate Hash: ", v_ec_cert_hash); - v_ec_cert_hashed_id8 := f_HashedId8FromSha256(v_ec_cert_hash); + v_ec_cert_hashed_id8 := f_hashedId8FromSha256(v_ec_cert_hash); log("f_verify_ec_certificate: ==> EC certificate HashedId8: ", v_ec_cert_hashed_id8); // Check the signer @@ -4157,7 +4156,7 @@ module LibItsPki_Functions { // Calculate the HashedId8 of the whole certificate v_encoded_cert := encvalue(p_at_certificate); - v_at_cert_hashed_id8 := f_HashedId8FromSha256(f_hashWithSha256(bit2oct(v_encoded_cert))); + v_at_cert_hashed_id8 := f_hashedId8FromSha256(f_hashWithSha256(bit2oct(v_encoded_cert))); log("f_verify_at_certificate: EC certificate HashedId8: ", v_at_cert_hashed_id8); // Check the signer diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index b3573d5f..bf8f0f3b 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -81,13 +81,13 @@ module LibItsPki_TestSystem { var octetstring vc_eaPrivateKey; /** Test Adapter EA private key for signature */ var octetstring vc_eaPrivateEncKey; /** Test Adapter EA private key for encryption */ var octetstring vc_eaWholeHash; /** Test Adapter EA whole-hash for signature check */ - var octetstring vc_eaWholeHash256; /** Test Adapter EA whole-hash using SHA 256 for encryption because of encryption key size ==32 */ + var octetstring vc_eaWholeHash256; /** Test Adapter EA whole-hash using SHA 256 for encryption because of encryption key size == 32 */ var HashedId8 vc_eaHashedId8; /** Test Adapter EA HashedId8 for decryption of IUT's response */ var octetstring vc_aaPrivateKey; /** Test Adapter AA private key for signature */ var octetstring vc_aaPrivateEncKey; /** Test Adapter AA private key for encryption */ var HashedId8 vc_aaHashedId8; /** Test Adapter AA HashedId8 for decryption of IUT's response */ var octetstring vc_aaWholeHash; /** Test Adapter AA whole-hash for signature check */ - var octetstring vc_aaWholeHash256; /** Test Adapter EA whole-hash using SHA 256 for encryption because of encryption key size ==32 */ + var octetstring vc_aaWholeHash256; /** Test Adapter AA whole-hash using SHA 256 for encryption because of encryption key size == 32 */ } // End of component ItsPkiHttp /** diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index d0229ef8..e260025d 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -406,11 +406,11 @@ module LibItsSecurity_Functions { * @return The HashedId8 value * @verdict */ - function f_HashedId8FromSha256( + function f_hashedId8FromSha256( in Oct32 p_hash ) return HashedId8 { return substr(p_hash, lengthof(p_hash) - 8, 8); - } // End of function f_HashedId8FromSha256 + } // End of function f_hashedId8FromSha256 /** * @desc Compute the HashedId8 value from the hash value @@ -418,11 +418,11 @@ module LibItsSecurity_Functions { * @return The HashedId8 value * @verdict */ - function f_HashedId8FromSha384( + function f_hashedId8FromSha384( in Oct48 p_hash ) return HashedId8 { return substr(p_hash, lengthof(p_hash) - 8, 8); - } // End of function f_HashedId8FromSha384 + } // End of function f_hashedId8FromSha384 /** * @desc Compute the HashedId3 value from the HashedId8 value @@ -430,11 +430,11 @@ module LibItsSecurity_Functions { * @return The HashedId3 value * @verdict Unchanged */ - function f_HashedId3FromHashedId8( + function f_hashedId3FromHashedId8( in HashedId8 p_hashedId8 ) return HashedId3 { return substr(p_hashedId8, lengthof(p_hashedId8) - 3, 3); - } // End of function f_HashedId3FromHashedId8 + } // End of function f_hashedId3FromHashedId8 /** * @desc Verify the signature of the specified data -- GitLab From 4441b8674ddf47a379b095252c0e0d55c18bbf75 Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 27 Mar 2020 14:53:13 +0100 Subject: [PATCH 231/320] Unify STF525 TTCN-3 code --- ttcn/BTP/LibItsBtp_EncdecDeclarations.ttcn | 60 +- ttcn/BTP/LibItsBtp_Functions.ttcn | 4 +- ttcn/BTP/LibItsBtp_Pixits.ttcn | 4 +- ttcn/BTP/LibItsBtp_Templates.ttcn | 4 +- ttcn/BTP/LibItsBtp_TestSystem.ttcn | 4 +- ttcn/BTP/LibItsBtp_TypesAndValues.ttcn | 6 +- ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn | 80 +- ttcn/CAM/LibItsCam_Functions.ttcn | 169 +- ttcn/CAM/LibItsCam_Pics.ttcn | 4 +- ttcn/CAM/LibItsCam_Pixits.ttcn | 40 +- ttcn/CAM/LibItsCam_Templates.ttcn | 17 +- ttcn/CAM/LibItsCam_TestSystem.ttcn | 8 +- ...LibItsCommon_ASN1_ISDSRC_NamedNumbers.ttcn | 98 +- .../LibItsCommon_ASN1_NamedNumbers.ttcn | 600 +- ttcn/Common/LibItsCommon_Functions.ttcn | 9 +- ttcn/Common/LibItsCommon_Pixits.ttcn | 19 +- ttcn/Common/LibItsCommon_Templates.ttcn | 235 +- ttcn/Common/LibItsCommon_TestSystem.ttcn | 4 +- ttcn/Common/LibItsCommon_TypesAndValues.ttcn | 81 +- .../Common/LibItsExternal_TypesAndValues.ttcn | 4 +- ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn | 98 +- ttcn/DENM/LibItsDenm_Functions.ttcn | 109 +- ttcn/DENM/LibItsDenm_Pics.ttcn | 4 +- ttcn/DENM/LibItsDenm_Pixits.ttcn | 40 +- ttcn/DENM/LibItsDenm_Templates.ttcn | 11 +- ttcn/DENM/LibItsDenm_TestSystem.ttcn | 6 +- ttcn/DENM/LibItsDenm_TypesAndValues.ttcn | 6 +- ...ibItsGeoNetworking_EncdecDeclarations.ttcn | 94 +- .../LibItsGeoNetworking_Functions.ttcn | 5697 +++++++------- .../LibItsGeoNetworking_Pics.ttcn | 4 +- .../LibItsGeoNetworking_Pixits.ttcn | 6 +- .../LibItsGeoNetworking_Templates.ttcn | 214 +- .../LibItsGeoNetworking_TestSystem.ttcn | 9 +- .../LibItsGeoNetworking_TypesAndValues.ttcn | 2398 +++--- .../LibItsSecurity_EncdecDeclarations.ttcn | 116 +- ttcn/Security/LibItsSecurity_Functions.ttcn | 6649 ++++++++--------- ttcn/Security/LibItsSecurity_Pics.ttcn | 210 +- ttcn/Security/LibItsSecurity_Pixits.ttcn | 154 +- ttcn/Security/LibItsSecurity_Templates.ttcn | 4174 +++++------ ttcn/Security/LibItsSecurity_TestSystem.ttcn | 98 +- .../LibItsSecurity_TypesAndValues.ttcn | 608 +- 41 files changed, 11198 insertions(+), 10957 deletions(-) diff --git a/ttcn/BTP/LibItsBtp_EncdecDeclarations.ttcn b/ttcn/BTP/LibItsBtp_EncdecDeclarations.ttcn index 2bb5ff8e..e4f6332e 100644 --- a/ttcn/BTP/LibItsBtp_EncdecDeclarations.ttcn +++ b/ttcn/BTP/LibItsBtp_EncdecDeclarations.ttcn @@ -1,30 +1,30 @@ -module LibItsBtp_EncdecDeclarations { - - // LibItsBtp - import from LibItsBtp_TypesAndValues all; - import from LibItsBtp_TestSystem all; - - /* TODO RGy function not implemented! (decvalue() not used by test suite @29-06-2016) - external function fx_dec_BtpPayload (inout bitstring b, out BtpPayload p) return integer - with {extension "prototype(sliding) decode(LibItsBtp)"} - */ - - external function fx_enc_BtpReq (BtpReq p) return bitstring - with {extension "prototype(convert) encode(LibIts_Interface)"} - - external function fx_enc_BtpInd (BtpInd p) return bitstring - with {extension "prototype(convert) encode(LibIts_Interface)"} - - external function fx_dec_BtpInd (inout bitstring b, out BtpInd p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_dec_BtpReq (inout bitstring b, out BtpReq p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_enc_BtpPacket (BtpPacket p) return bitstring - with {extension "prototype(convert) encode(LibIts_Interface)"} - - external function fx_dec_BtpPacket (inout bitstring b, out BtpPacket p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - -} // End of module LibItsBtp_EncdecDeclarations +module LibItsBtp_EncdecDeclarations { + + // LibItsBtp + import from LibItsBtp_TypesAndValues all; + import from LibItsBtp_TestSystem all; + + /* TODO RGy function not implemented! (decvalue() not used by test suite @29-06-2016) + external function fx_dec_BtpPayload (inout bitstring b, out BtpPayload p) return integer + with {extension "prototype(sliding) decode(LibItsBtp)"} + */ + + external function fx_enc_BtpReq (BtpReq p) return bitstring + with {extension "prototype(convert) encode(LibIts_Interface)"} + + external function fx_enc_BtpInd (BtpInd p) return bitstring + with {extension "prototype(convert) encode(LibIts_Interface)"} + + external function fx_dec_BtpInd (inout bitstring b, out BtpInd p) return integer + with {extension "prototype(sliding) decode(LibIts_Interface)"} + + external function fx_dec_BtpReq (inout bitstring b, out BtpReq p) return integer + with {extension "prototype(sliding) decode(LibIts_Interface)"} + + external function fx_enc_BtpPacket (BtpPacket p) return bitstring + with {extension "prototype(convert) encode(LibIts_Interface)"} + + external function fx_dec_BtpPacket (inout bitstring b, out BtpPacket p) return integer + with {extension "prototype(sliding) decode(LibIts_Interface)"} + +} // End of module LibItsBtp_EncdecDeclarations diff --git a/ttcn/BTP/LibItsBtp_Functions.ttcn b/ttcn/BTP/LibItsBtp_Functions.ttcn index 7e909648..fab68591 100644 --- a/ttcn/BTP/LibItsBtp_Functions.ttcn +++ b/ttcn/BTP/LibItsBtp_Functions.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF405 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/BTP/LibItsBtp_Functions.ttcn $ + * $Id: LibItsBtp_Functions.ttcn 1318 2017-01-26 10:20:53Z filatov $ * @desc Module containing functions for basic Transport Protocol * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. diff --git a/ttcn/BTP/LibItsBtp_Pixits.ttcn b/ttcn/BTP/LibItsBtp_Pixits.ttcn index 41701eee..cd8dfc1c 100644 --- a/ttcn/BTP/LibItsBtp_Pixits.ttcn +++ b/ttcn/BTP/LibItsBtp_Pixits.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF405 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/BTP/LibItsBtp_Pixits.ttcn $ + * $Id: LibItsBtp_Pixits.ttcn 1318 2017-01-26 10:20:53Z filatov $ * @desc Basic Transport Protocol Templates * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. diff --git a/ttcn/BTP/LibItsBtp_Templates.ttcn b/ttcn/BTP/LibItsBtp_Templates.ttcn index 255d771b..fe930380 100644 --- a/ttcn/BTP/LibItsBtp_Templates.ttcn +++ b/ttcn/BTP/LibItsBtp_Templates.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF405 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/BTP/LibItsBtp_Templates.ttcn $ + * $Id: LibItsBtp_Templates.ttcn 1318 2017-01-26 10:20:53Z filatov $ * @desc Basic Transport Protocol Templates * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. diff --git a/ttcn/BTP/LibItsBtp_TestSystem.ttcn b/ttcn/BTP/LibItsBtp_TestSystem.ttcn index d3830515..39a3ca05 100644 --- a/ttcn/BTP/LibItsBtp_TestSystem.ttcn +++ b/ttcn/BTP/LibItsBtp_TestSystem.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF405 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/BTP/LibItsBtp_TestSystem.ttcn $ + * $Id: LibItsBtp_TestSystem.ttcn 1318 2017-01-26 10:20:53Z filatov $ * @desc Test System module for ITS BTP * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. diff --git a/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn b/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn index 088eed79..214e4e29 100644 --- a/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn +++ b/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF405 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn $ + * $Id: LibItsBtp_TypesAndValues.ttcn 1318 2017-01-26 10:20:53Z filatov $ * @desc Module containing types and values for Basic Transport Protocol * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. @@ -174,6 +174,6 @@ module LibItsBtp_TypesAndValues { } with { variant "" - encode "LibItsGeoNetworking" + encode "LibItsBtp" } diff --git a/ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn b/ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn index bba87da5..9d37043d 100644 --- a/ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn +++ b/ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn @@ -1,40 +1,40 @@ -module LibItsCam_EncdecDeclarations { - - // LibIts - import from CAM_PDU_Descriptions language "ASN.1:1997" all; - - // LibItsCam - import from LibItsCam_TypesAndValues all; - import from LibItsCam_TestSystem all; - - external function fx_enc_CamReq (CamReq p) return bitstring - with {extension "prototype(convert) encode(LibIts_Interface)"} - - external function fx_dec_CamReq (inout bitstring b, out CamReq p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_dec_CamInd (inout bitstring b, out CamInd p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_enc_CAM (CAM p) return bitstring - with {extension "prototype(convert) encode(PER)"} - - external function fx_dec_CAM (inout bitstring b, out CAM p) return integer - with {extension "prototype(sliding) decode(PER)"} - - external function fx_enc_UtCamInitialize (UtCamInitialize p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtCamChangePosition (UtCamChangePosition p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtCamTrigger (UtCamTrigger p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_dec_UtCamResults (inout bitstring b, out UtCamResults p) return integer - with {extension "prototype(sliding) decode(UpperTester)"} - - external function fx_dec_UtCamEventInd (inout bitstring b, out UtCamEventInd p) return integer - with {extension "prototype(sliding) decode(UpperTester)"} - -} // End of module LibItsCam_EncdecDeclarations +module LibItsCam_EncdecDeclarations { + + // LibIts + import from CAM_PDU_Descriptions language "ASN.1:1997" all; + + // LibItsCam + import from LibItsCam_TypesAndValues all; + import from LibItsCam_TestSystem all; + + external function fx_enc_CamReq (CamReq p) return bitstring + with {extension "prototype(convert) encode(LibIts_Interface)"} + + external function fx_dec_CamReq (inout bitstring b, out CamReq p) return integer + with {extension "prototype(sliding) decode(LibIts_Interface)"} + + external function fx_dec_CamInd (inout bitstring b, out CamInd p) return integer + with {extension "prototype(sliding) decode(LibIts_Interface)"} + + external function fx_enc_CAM (CAM p) return bitstring + with {extension "prototype(convert) encode(PER)"} + + external function fx_dec_CAM (inout bitstring b, out CAM p) return integer + with {extension "prototype(sliding) decode(PER)"} + + external function fx_enc_UtCamInitialize (UtCamInitialize p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + + external function fx_enc_UtCamChangePosition (UtCamChangePosition p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + + external function fx_enc_UtCamTrigger (UtCamTrigger p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + + external function fx_dec_UtCamResults (inout bitstring b, out UtCamResults p) return integer + with {extension "prototype(sliding) decode(UpperTester)"} + + external function fx_dec_UtCamEventInd (inout bitstring b, out UtCamEventInd p) return integer + with {extension "prototype(sliding) decode(UpperTester)"} + +} // End of module LibItsCam_EncdecDeclarations diff --git a/ttcn/CAM/LibItsCam_Functions.ttcn b/ttcn/CAM/LibItsCam_Functions.ttcn index 1ab3b4b6..c2a3ebf1 100644 --- a/ttcn/CAM/LibItsCam_Functions.ttcn +++ b/ttcn/CAM/LibItsCam_Functions.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/CAM/LibItsCam_Functions.ttcn $ + * $Id: LibItsCam_Functions.ttcn 1318 2017-01-26 10:20:53Z filatov $ * @desc Module containing common functions for ITS CAM * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. @@ -18,8 +18,6 @@ module LibItsCam_Functions { // LibIts import from ITS_Container language "ASN.1:1997" all; -// import from CAM_PDU_Descriptions language "ASN.1:1997" all; -// import from DENM_PDU_Descriptions language "ASN.1:1997" all; // LibItsCommon import from LibItsCommon_Pixits all; @@ -32,8 +30,7 @@ module LibItsCam_Functions { import from LibItsCam_Templates all; import from LibItsCam_TypesAndValues all; import from LibItsCam_Pics all; -// import from LibItsCam_Pixits all; -// import from LibItsCam_EncdecDeclarations all; + import from LibItsCam_Pixits all; group utFuntions { @@ -110,13 +107,11 @@ module LibItsCam_Functions { [] utPort.receive(UtCamResults: { utCamChangePositionResult := true}) { tc_wait.stop; } - [] utPort.receive(UtCamResults: { utCamChangePositionResult := false }) { + [] utPort.receive(UtCamResults: { utCamChangePositionResult := ? }) { tc_wait.stop; log("*** f_utChangePosition: INFO: IUT position change was not successful ***"); f_selfOrClientSyncAndVerdict("error", e_error); } - [] a_utDefault() { - } [] tc_wait.timeout { log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); f_selfOrClientSyncAndVerdict("error", e_timeout); @@ -136,12 +131,12 @@ module LibItsCam_Functions { * @desc Initialise secure mode if required */ function f_initialiseSecuredMode( - in charstring p_certificate_id := PX_CERT_FOR_TS + in charstring p_certificateId := PX_CERT_FOR_TS ) runs on ItsCam { if (PICS_IS_IUT_SECURED == true) { - if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificate_id))) { + if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificateId))) { log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); stop; } @@ -199,7 +194,7 @@ module LibItsCam_Functions { [] acPort.receive(m_acGnssResponseSuccess) { tc_ac.stop; } - [] acPort.receive { + [] acPort.receive(m_acGnssResponseError) { tc_ac.stop; log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); f_selfOrClientSyncAndVerdict("error", e_error); @@ -218,7 +213,7 @@ module LibItsCam_Functions { * * @param p_scenario The scenario to load. */ - function f_acLoadScenario(Scenario p_scenario) runs on ItsCam { + function f_acLoadScenario(in Scenario p_scenario) runs on ItsCam { if (PX_GNSS_SCENARIO_SUPPORT==true) { f_acTriggerGnssEvent(m_loadScenario(p_scenario)); @@ -253,12 +248,12 @@ module LibItsCam_Functions { if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { f_acTriggerGnssEvent(m_distanceToCover(p_distanceToCover)); - tc_ac.start; + tc_ac.start(PX_T_GNSS_AWAIT_DISTANCE_COVERED); alt { - [] acPort.receive(m_acGnssDistanceCovered) { + [] acPort.receive(m_acGnssDistanceCoveredSuccess) { tc_ac.stop; } - [] acPort.receive { + [] acPort.receive(m_acGnssDistanceCoveredError) { tc_ac.stop; log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); f_selfOrClientSyncAndVerdict("error", e_error); @@ -273,10 +268,57 @@ module LibItsCam_Functions { return v_ret; } // End of function f_acAwaitDistanceCovered + function f_acAwaitSpeed( + float p_speed, + SpeedTrend p_speedTrend := e_accelerate, + boolean p_stopCamPort := true, + boolean p_deactivateCamDefault := false + ) runs on ItsCam system ItsCamSystem return FncRetCode { + var FncRetCode v_ret := e_success; + + if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { + + if (p_stopCamPort) { + unmap(self:camPort, system:camPort); + } + + if (p_deactivateCamDefault) { + vc_camDefaultActive := false; + } + + f_acTriggerGnssEvent(m_awaitSpeed(p_speed, p_speedTrend)); + + tc_ac.start(PX_T_GNSS_AWAIT_SPEED_REACHED); + alt { + [] acPort.receive(m_acGnssSpeedReachedSuccess) { + tc_ac.stop; + } + [] acPort.receive(m_acGnssSpeedReachedError) { + tc_ac.stop; + log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] tc_ac.timeout { + log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for covered distance indication ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } + + if (p_stopCamPort) { + map(self:camPort, system:camPort); + } + + if (p_deactivateCamDefault) { + vc_camDefaultActive := true; + } + } + return v_ret; + } // End of function f_acAwaitSpeed + function f_acChangeSpeed(SpeedValue p_deltaSpeedValue) runs on ItsCam { if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { - f_acTriggerGnssEvent(m_changeScenarioSpeed(p_deltaSpeedValue)); +// f_acTriggerGnssEvent(m_changeScenarioSpeed(p_deltaSpeedValue)); } } // End of function f_acChangeSpeed @@ -287,17 +329,50 @@ module LibItsCam_Functions { } } // End of function f_acChangeHeading + function f_acAwaitTimeInRunningScenario( + integer p_time, + boolean p_stopOnCamMessage := true + ) runs on ItsCam return FncRetCode { + var FncRetCode v_ret := e_success; + + if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { + + f_acTriggerGnssEvent(m_timeInRunningScenario(p_time)); + + tc_ac.start(int2float(p_time)*1.1); + alt { + [p_stopOnCamMessage] camPort.check(receive(mw_camInd ( mw_camMsg_any ))) { + tc_ac.stop; + } + [] acPort.receive(m_acGnssTimeReachedSuccess) { + tc_ac.stop; + } + [] acPort.receive(m_acGnssTimeReachedError) { + tc_ac.stop; + log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] tc_ac.timeout { + log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for time reached indication ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } + + } + return v_ret; + } // end f_acAwaitTimeInRunningScenario + } // End of group adapterControl group camConfigurationFunctions { /** * @desc Setups default configuration - * @param p_certificate_id The certificate identifier the TA shall use in case of secured IUT + * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT */ function f_cfUp( - in charstring p_certificate_id := PX_CERT_FOR_TS - ) runs on ItsCam /* TITAN TODO: system ItsCamSystem */ { + in charstring p_certificateId := PX_CERT_FOR_TS + ) runs on ItsCam system ItsCamSystem { map(self:utPort, system:utPort); map(self:acPort, system:acPort); @@ -305,21 +380,23 @@ module LibItsCam_Functions { f_connect4SelfOrClientSync(); // Initialise secured mode - f_initialiseSecuredMode(p_certificate_id); + f_initialiseSecuredMode(p_certificateId); } // End of function f_cfUp /** * @desc Deletes default configuration */ - function f_cfDown() runs on ItsCam /* TITAN TODO: system ItsCamSystem */ { + function f_cfDown() runs on ItsCam system ItsCamSystem { // Initialise secured mode f_uninitialiseSecuredMode(); + unmap(self:camPort, system:camPort); + + f_acStopScenario(); unmap(self:utPort, system:utPort); unmap(self:acPort, system:acPort); - unmap(self:camPort, system:camPort); f_disconnect4SelfOrClientSync(); } // End of function f_cfDown @@ -333,15 +410,32 @@ module LibItsCam_Functions { */ altstep a_default() runs on ItsCam { - [] camPort.receive(mw_camInd ( mw_camMsg_any )){ + [vc_camDefaultActive] camPort.receive(mw_camInd ( mw_camMsg_any )){ log("*** a_default: INFO: CAM message received in default ***"); vc_camReceived := true; repeat; } - [] camPort.receive { + [vc_camDefaultActive] camPort.receive { log("*** a_default: ERROR: event received on CAM port in default ***"); f_selfOrClientSyncAndVerdict("error", e_error); } + [] acPort.receive(AdapterControlResults: { acGnssTimeReached := ? }) { + log("*** a_default: INFO: TimeReached event received on AC port in default ***"); + repeat; + } + [] acPort.receive(AdapterControlResults: { acGnssSpeedReached := ? }) { + log("*** a_default: INFO: SpeedReached event received on AC port in default ***"); + repeat; + } + [] acPort.receive(AdapterControlResults: { acGnssDistanceCovered := ? }) { + log("*** a_default: INFO: DistanceCovered event received on AC port in default ***"); + repeat; + } + [] acPort.receive { + tc_ac.stop; + log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } [] any timer.timeout { log("*** a_default: INCONC: a timer expired in default ***"); f_selfOrClientSyncAndVerdict("error", e_timeout); @@ -389,7 +483,8 @@ module LibItsCam_Functions { function f_prInitialState( in Scenario p_scenario := e_staticPosition, in boolean p_awaitInitialCAM := true, - in template (value) UtCamInitialize p_camInitialize := m_camInitialize + in template (value) UtCamInitialize p_camInitialize := m_camInitialize, + in boolean p_awaitTimeInRunningScenario := true ) runs on ItsCam { f_utInitializeIut(p_camInitialize); @@ -404,6 +499,9 @@ module LibItsCam_Functions { camPort.clear; f_acStartScenario(); + if (p_awaitTimeInRunningScenario) { + f_acAwaitTimeInRunningScenario(f_getTimeForGpsFix()); + } if (p_awaitInitialCAM) { tc_ac.start; @@ -429,10 +527,9 @@ module LibItsCam_Functions { * @desc The default postamble. */ function f_poDefault() runs on ItsCam { - f_acStopScenario(); } - } // End group postambles + } // End of group postambles group camPositionFunctions { @@ -460,7 +557,21 @@ module LibItsCam_Functions { return v_referencePosition; } - } // End group camPositionFunctions + /** + * @desc Compute distance between two points + * @param p_pointA First point + * @param p_pointB Second point + * @return Computed distance in meters + * @see fx_computeDistance + */ + function f_distance( + in ReferencePosition p_pointA, + in ReferencePosition p_pointB + ) return float { + return fx_computeDistance(p_pointA.latitude, p_pointA.longitude, p_pointB.latitude, p_pointB.longitude); + } + + } // end group camPositionFunctions group camAuxilaryFunctions { diff --git a/ttcn/CAM/LibItsCam_Pics.ttcn b/ttcn/CAM/LibItsCam_Pics.ttcn index b41534db..20235010 100644 --- a/ttcn/CAM/LibItsCam_Pics.ttcn +++ b/ttcn/CAM/LibItsCam_Pics.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/CAM/LibItsCam_Pics.ttcn $ + * $Id: LibItsCam_Pics.ttcn 1318 2017-01-26 10:20:53Z filatov $ * @desc CAM PICS * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. diff --git a/ttcn/CAM/LibItsCam_Pixits.ttcn b/ttcn/CAM/LibItsCam_Pixits.ttcn index 8e1dbc2d..59ccb581 100644 --- a/ttcn/CAM/LibItsCam_Pixits.ttcn +++ b/ttcn/CAM/LibItsCam_Pixits.ttcn @@ -1,21 +1,21 @@ -/** - * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $URL$ - * $Id$ - * @desc Module containing Pixits for CAM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsCam_Pixits { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibItsSecurity - import from LibItsSecurity_TypesAndValues all; - +/** + * @author ETSI / STF405 / STF449 / STF484 / STF517 + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/CAM/LibItsCam_Pixits.ttcn $ + * $Id: LibItsCam_Pixits.ttcn 1318 2017-01-26 10:20:53Z filatov $ + * @desc Module containing Pixits for CAM + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * + */ +module LibItsCam_Pixits { + + // LibCommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; + + // LibItsSecurity + import from LibItsSecurity_TypesAndValues all; + } // End of module LibItsSecurity_Pixits \ No newline at end of file diff --git a/ttcn/CAM/LibItsCam_Templates.ttcn b/ttcn/CAM/LibItsCam_Templates.ttcn index 1cdbc251..684832bf 100644 --- a/ttcn/CAM/LibItsCam_Templates.ttcn +++ b/ttcn/CAM/LibItsCam_Templates.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/CAM/LibItsCam_Templates.ttcn $ + * $Id: LibItsCam_Templates.ttcn 1318 2017-01-26 10:20:53Z filatov $ * @desc Module containing base template definitions for CAM * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. @@ -218,6 +218,19 @@ module LibItsCam_Templates { } } + /** + * @desc Reference position for given latitude and longitude. + */ + template (present) ReferencePosition mw_refPositionWithDelta( + in ReferencePosition p_origRefPos, + in integer p_jitter := 100 + ) := { + latitude := (p_origRefPos.latitude - p_jitter..p_origRefPos.latitude + p_jitter), + longitude := (p_origRefPos.longitude - p_jitter..p_origRefPos.longitude + p_jitter), + positionConfidenceEllipse := p_origRefPos.positionConfidenceEllipse, + altitude := p_origRefPos.altitude + } + } // end positionTemplates /** diff --git a/ttcn/CAM/LibItsCam_TestSystem.ttcn b/ttcn/CAM/LibItsCam_TestSystem.ttcn index 45560a23..6f02c224 100644 --- a/ttcn/CAM/LibItsCam_TestSystem.ttcn +++ b/ttcn/CAM/LibItsCam_TestSystem.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/CAM/LibItsCam_TestSystem.ttcn $ + * $Id: LibItsCam_TestSystem.ttcn 1318 2017-01-26 10:20:53Z filatov $ * @desc Test System module for ITS CAM * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. @@ -9,7 +9,7 @@ * All rights reserved. * */ -module LibItsCam_TestSystem { +module LibItsCam_TestSystem language "TTCN-3:2010 Real Time and Performance Testing" { // LibCommon // import from LibCommon_Time {modulepar all}; @@ -37,8 +37,6 @@ module LibItsCam_TestSystem { out AcGnssPrimitive, AcSecPrimitive; in -//FIXME RGY As discussed, list of boolean result responses is collected into a top-level union -// AcGnssResponse, AcGnssDistanceCovered, AcSecResponse; AdapterControlResults; } // end AdapterControlPort diff --git a/ttcn/Common/LibItsCommon_ASN1_ISDSRC_NamedNumbers.ttcn b/ttcn/Common/LibItsCommon_ASN1_ISDSRC_NamedNumbers.ttcn index 697688e1..1f9002b4 100644 --- a/ttcn/Common/LibItsCommon_ASN1_ISDSRC_NamedNumbers.ttcn +++ b/ttcn/Common/LibItsCommon_ASN1_ISDSRC_NamedNumbers.ttcn @@ -1,49 +1,49 @@ -//This module contains TTCN-3 values for ASN.1 named numbers, aligned with TTWorkbench name convention - -module LibItsCommon_ASN1_ISDSRC_NamedNumbers { - -import from DSRC language "ASN.1:1997" all; - - group IS_DSCR_constants { - group LaneParameter_constants { - const LaneAttributes_Barrier LaneAttributes_Barrier_median_RevocableLane_ := '0000000000000000'B; - - const LaneAttributes_Bike LaneAttributes_Bike_bikeRevocableLane_ := '0000000000000000'B; - - const LaneAttributes_Crosswalk LaneAttributes_Crosswalk_crosswalkRevocableLane_ := '0000000000000000'B; - - const LaneAttributes_Parking LaneAttributes_Parking_parkingRevocableLane_ := '0000000000000000'B; - - const LaneAttributes_Sidewalk LaneAttributes_Sidewalk_sidewalk_RevocableLane_ := '0000000000000000'B; - - const LaneAttributes_Striping LaneAttributes_Striping_stripeToConnectingLanesRevocableLane_ := '0000000000000000'B; - - const LaneAttributes_TrackedVehicle LaneAttributes_TrackedVehicle_spec_RevocableLane_ := '0000000000000000'B; - - const LaneAttributes_Vehicle LaneAttributes_Vehicle_isVehicleRevocableLane_ := '00000000'B; - - const LaneDirection LaneDirection_ingressPath_ := '00'B; - const LaneDirection LaneDirection_egressPath_ := '01'B; - - } //end LaneParameter_constants - - group Intersection_constants { - const IntersectionStatusObject IntersectionStatusObject_manualControlIsEnabled_ := '0000000000000000'B; - const IntersectionStatusObject IntersectionStatusObject_stopTimeIsActivated_ := '0000000000000001'B; - const IntersectionStatusObject IntersectionStatusObject_failureFlash_ := '0000000000000010'B; - const IntersectionStatusObject IntersectionStatusObject_preemptIsActive_ := '0000000000000011'B; - const IntersectionStatusObject IntersectionStatusObject_signalPriorityIsActive_ := '0000000000000100'B; - const IntersectionStatusObject IntersectionStatusObject_fixedTimeOperation_ := '0000000000000101'B; - const IntersectionStatusObject IntersectionStatusObject_trafficDependentOperation_ := '0000000000000110'B; - const IntersectionStatusObject IntersectionStatusObject_standbyOperation_ := '0000000000000111'B; - const IntersectionStatusObject IntersectionStatusObject_failureMode_ := '0000000000001000'B; - const IntersectionStatusObject IntersectionStatusObject_off_ := '0000000000001001'B; - const IntersectionStatusObject IntersectionStatusObject_recentMAPmessageUpdate_ := '0000000000001010'B; - const IntersectionStatusObject IntersectionStatusObject_recentChangeInMAPassignedLanesIDsUsed_ := '0000000000001011'B; - const IntersectionStatusObject IntersectionStatusObject_noValidMAPisAvailableAtThisTime_ := '0000000000001100'B; - const IntersectionStatusObject IntersectionStatusObject_noValidSPATisAvailableAtThisTime_ := '0000000000001101'B; - - } //end Intersection_constants - } // end IS_DSCR_constants - -} // End of module LibItsCommon_ASN1_ISDSRC_NamedNumbers +//This module contains TTCN-3 values for ASN.1 named numbers, aligned with TTWorkbench name convention + +module LibItsCommon_ASN1_ISDSRC_NamedNumbers { + +import from DSRC language "ASN.1:1997" all; + + group IS_DSCR_constants { + group LaneParameter_constants { + const LaneAttributes_Barrier LaneAttributes_Barrier_median_RevocableLane_ := '0000000000000000'B; + + const LaneAttributes_Bike LaneAttributes_Bike_bikeRevocableLane_ := '0000000000000000'B; + + const LaneAttributes_Crosswalk LaneAttributes_Crosswalk_crosswalkRevocableLane_ := '0000000000000000'B; + + const LaneAttributes_Parking LaneAttributes_Parking_parkingRevocableLane_ := '0000000000000000'B; + + const LaneAttributes_Sidewalk LaneAttributes_Sidewalk_sidewalk_RevocableLane_ := '0000000000000000'B; + + const LaneAttributes_Striping LaneAttributes_Striping_stripeToConnectingLanesRevocableLane_ := '0000000000000000'B; + + const LaneAttributes_TrackedVehicle LaneAttributes_TrackedVehicle_spec_RevocableLane_ := '0000000000000000'B; + + const LaneAttributes_Vehicle LaneAttributes_Vehicle_isVehicleRevocableLane_ := '00000000'B; + + const LaneDirection LaneDirection_ingressPath_ := '00'B; + const LaneDirection LaneDirection_egressPath_ := '01'B; + + } //end LaneParameter_constants + + group Intersection_constants { + const IntersectionStatusObject IntersectionStatusObject_manualControlIsEnabled_ := '0000000000000000'B; + const IntersectionStatusObject IntersectionStatusObject_stopTimeIsActivated_ := '0000000000000001'B; + const IntersectionStatusObject IntersectionStatusObject_failureFlash_ := '0000000000000010'B; + const IntersectionStatusObject IntersectionStatusObject_preemptIsActive_ := '0000000000000011'B; + const IntersectionStatusObject IntersectionStatusObject_signalPriorityIsActive_ := '0000000000000100'B; + const IntersectionStatusObject IntersectionStatusObject_fixedTimeOperation_ := '0000000000000101'B; + const IntersectionStatusObject IntersectionStatusObject_trafficDependentOperation_ := '0000000000000110'B; + const IntersectionStatusObject IntersectionStatusObject_standbyOperation_ := '0000000000000111'B; + const IntersectionStatusObject IntersectionStatusObject_failureMode_ := '0000000000001000'B; + const IntersectionStatusObject IntersectionStatusObject_off_ := '0000000000001001'B; + const IntersectionStatusObject IntersectionStatusObject_recentMAPmessageUpdate_ := '0000000000001010'B; + const IntersectionStatusObject IntersectionStatusObject_recentChangeInMAPassignedLanesIDsUsed_ := '0000000000001011'B; + const IntersectionStatusObject IntersectionStatusObject_noValidMAPisAvailableAtThisTime_ := '0000000000001100'B; + const IntersectionStatusObject IntersectionStatusObject_noValidSPATisAvailableAtThisTime_ := '0000000000001101'B; + + } //end Intersection_constants + } // end IS_DSCR_constants + +} // End of module LibItsCommon_ASN1_ISDSRC_NamedNumbers diff --git a/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn b/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn index 81ecb733..4b666de2 100644 --- a/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn +++ b/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn @@ -1,300 +1,300 @@ -//This module contains TTCN-3 values for ASN.1 named numbers, aligned with TTWorkbench name convention - -module LibItsCommon_ASN1_NamedNumbers { - - import from ITS_Container language "ASN.1:2008" all; - - import from IVI language "ASN.1:1997" { - type IviStatus - } - - group commonConstants { - - const AccelerationConfidence AccelerationConfidence_pointOneMeterPerSecSquared_ := 1; - const AccelerationConfidence AccelerationConfidence_outOfRange_ := 101; - const AccelerationConfidence AccelerationConfidence_unavailable_ := 102; - - const AccelerationControl AccelerationControl_brakePedalEngaged_ := '1000000'B; - const AccelerationControl AccelerationControl_gasPedalEngaged_ := '0100000'B; - const AccelerationControl AccelerationControl_emergencyBrakeEngaged_ := '0010000'B; - const AccelerationControl AccelerationControl_collisionWarningEngaged_ := '0001000'B; - const AccelerationControl AccelerationControl_accEngaged_ := '0000100'B; - const AccelerationControl AccelerationControl_cruiseControlEngaged_ := '0000010'B; - const AccelerationControl AccelerationControl_speedLimiterEngaged_ := '0000001'B; - - const AltitudeValue AltitudeValue_referenceEllipsoidSurface_ := 0; - const AltitudeValue AltitudeValue_oneCentimeter_ := 1; - const AltitudeValue AltitudeValue_unavailable_ := 800001; - - const CurvatureValue CurvatureValue_straight_ := 0; - const CurvatureValue CurvatureValue_reciprocalOf1MeterRadiusToRight_ := -1023; - const CurvatureValue CurvatureValue_reciprocalOf1MeterRadiusToLeft_ := 1023; - const CurvatureValue CurvatureValue_unavailable_ := 1023; - - const ExteriorLights ExteriorLights_lowBeamHeadlightsOn_ := '10000000'B; - const ExteriorLights ExteriorLights_highBeamHeadlightsOn_ := '01000000'B; - const ExteriorLights ExteriorLights_leftTurnSignalOn_ := '00100000'B; - const ExteriorLights ExteriorLights_rightTurnSignalOn_ := '00010000'B; - const ExteriorLights ExteriorLights_daytimeRunningLightsOn_ := '00001000'B; - const ExteriorLights ExteriorLights_reverseLightOn_ := '00000100'B; - const ExteriorLights ExteriorLights_fogLightOn_ := '00000010'B; - const ExteriorLights ExteriorLights_parkingLightsOn_ := '00000001'B; - - const HeadingConfidence HeadingConfidence_withinZeroPointOneDegree_ := 1; - - const HeadingValue HeadingValue_wgs84North_ := 0; - - const ItsPduHeader.protocolVersion ItsPduHeader_protocolVersion_currentVersion_ := 2; - const ItsPduHeader.messageID ItsPduHeader_messageID_denm_ := 1; - const ItsPduHeader.messageID ItsPduHeader_messageID_cam_ := 2; - const ItsPduHeader.messageID ItsPduHeader_messageID_poi_ := 3; - const ItsPduHeader.messageID ItsPduHeader_messageID_spatem_ := 4; - const ItsPduHeader.messageID ItsPduHeader_messageID_mapem_ := 5; - const ItsPduHeader.messageID ItsPduHeader_messageID_ivim_ := 6; - const ItsPduHeader.messageID ItsPduHeader_messageID_ev_rsr_ := 7; - const ItsPduHeader.messageID ItsPduHeader_messageID_tistpgtransaction_ := 8; - const ItsPduHeader.messageID ItsPduHeader_messageID_srem_ := 9; - const ItsPduHeader.messageID ItsPduHeader_messageID_ssem_ := 10; - const ItsPduHeader.messageID ItsPduHeader_messageID_evcsn_ := 11; - const ItsPduHeader.messageID ItsPduHeader_messageID_saem_ := 12; - const ItsPduHeader.messageID ItsPduHeader_messageID_rtcem_ := 13; - - const LongitudinalAccelerationValue LongitudinalAccelerationValue_unavailable_ := 161; - - const SemiAxisLength SemiAxisLength_oneCentimeter_ := 1; - const SemiAxisLength SemiAxisLength_outOfRange_ := 4094; - const SemiAxisLength SemiAxisLength_unavailable_ := 4095; - - const StationType StationType_unknown_ := 0; - const StationType StationType_pedestrian_ := 1; - const StationType StationType_cyclist_ := 2; - const StationType StationType_moped_ := 3; - const StationType StationType_motorcycle_ := 4; - const StationType StationType_passengerCar_ := 5; - const StationType StationType_bus_ := 6; - const StationType StationType_lightTruck_ := 7; - const StationType StationType_heavyTruck_ := 8; - const StationType StationType_trailer_ := 9; - const StationType StationType_specialVehicles_ := 10; - const StationType StationType_tram_ := 11; - const StationType StationType_roadSideUnit_ := 15; - - const YawRateValue YawRateValue_straight_ := 0; - - group causeCodes { - const CauseCodeType CauseCodeType_reserved_ := 0; - const CauseCodeType CauseCodeType_trafficCondition_ := 1; - const CauseCodeType CauseCodeType_accident_ := 2; - const CauseCodeType CauseCodeType_roadworks_ := 3; - const CauseCodeType CauseCodeType_adverseWeatherCondition_Adhesion_ := 6; - const CauseCodeType CauseCodeType_hazardousLocation_SurfaceCondition_ := 9; - const CauseCodeType CauseCodeType_hazardousLocation_ObstacleOnTheRoad_ := 10; - const CauseCodeType CauseCodeType_hazardousLocation_AnimalOnTheRoad_ := 11; - const CauseCodeType CauseCodeType_humanPresenceOnTheRoad_ := 12; - const CauseCodeType CauseCodeType_wrongWayDriving_ := 14; - const CauseCodeType CauseCodeType_rescueAndRecoveryWorkInProgress_ := 15; - const CauseCodeType CauseCodeType_adverseWeatherCondition_ExtremeWeatherCondition_ := 17; - const CauseCodeType CauseCodeType_adverseWeatherCondition_Visibility_ := 18; - const CauseCodeType CauseCodeType_adverseWeatherCondition_Precipitation_ := 19; - const CauseCodeType CauseCodeType_slowVehicle_ := 26; - const CauseCodeType CauseCodeType_dangerousEndOfQueue_ := 27; - const CauseCodeType CauseCodeType_vehicleBreakdown_ := 91; - const CauseCodeType CauseCodeType_postCrash_ := 92; - const CauseCodeType CauseCodeType_humanProblem_ := 93; - const CauseCodeType CauseCodeType_stationaryVehicle_ := 94; - const CauseCodeType CauseCodeType_emergencyVehicleApproaching_ := 95; - const CauseCodeType CauseCodeType_hazardousLocation_DangerousCurve_ := 96; - const CauseCodeType CauseCodeType_collisionRisk_ := 97; - const CauseCodeType CauseCodeType_signalViolation_ := 98; - const CauseCodeType CauseCodeType_dangerousSituation_ := 99; - - } // end group causeCodes - - group subCauseCodes { - - const SubCauseCodeType SubCauseCodeType_unavailable_ := 0; - - const TrafficConditionSubCauseCode TrafficConditionSubCauseCode_unavailable_ := 0; - const TrafficConditionSubCauseCode TrafficConditionSubCauseCode_increasedVolumeOfTraffic_ := 1; - const TrafficConditionSubCauseCode TrafficConditionSubCauseCode_trafficJamSlowlyIncreasing_ := 2; - const TrafficConditionSubCauseCode TrafficConditionSubCauseCode_trafficJamIncreasing_ := 3; - const TrafficConditionSubCauseCode TrafficConditionSubCauseCode_trafficJamStronglyIncreasing_ := 4; - const TrafficConditionSubCauseCode TrafficConditionSubCauseCode_trafficStationary_ := 5; - const TrafficConditionSubCauseCode TrafficConditionSubCauseCode_trafficJamSlightlyDecreasing_ := 6; - const TrafficConditionSubCauseCode TrafficConditionSubCauseCode_trafficJamDecreasing_ := 7; - const TrafficConditionSubCauseCode TrafficConditionSubCauseCode_trafficJamStronglyDecreasing_ := 8; - - const AccidentSubCauseCode AccidentSubCauseCode_unavailable_ := 0; - const AccidentSubCauseCode AccidentSubCauseCode_multiVehicleAccident_ := 1; - const AccidentSubCauseCode AccidentSubCauseCode_heavyAccident_ := 2; - const AccidentSubCauseCode AccidentSubCauseCode_accidentInvolvingLorry_ := 3; - const AccidentSubCauseCode AccidentSubCauseCode_accidentInvolvingBus_ := 4; - const AccidentSubCauseCode AccidentSubCauseCode_accidentInvolvingHazardousMaterials_ := 5; - const AccidentSubCauseCode AccidentSubCauseCode_accidentOnOppositeLane_ := 6; - const AccidentSubCauseCode AccidentSubCauseCode_unsecuredAccident_ := 7; - const AccidentSubCauseCode AccidentSubCauseCode_assistanceRequested_ := 8; - - const RoadworksSubCauseCode RoadworksSubCauseCode_unavailable_ := 0; - const RoadworksSubCauseCode RoadworksSubCauseCode_majorRoadworks_ := 1; - const RoadworksSubCauseCode RoadworksSubCauseCode_roadMarkingWork_ := 2; - const RoadworksSubCauseCode RoadworksSubCauseCode_slowMovingRoadMaintenance_ := 3; - const RoadworksSubCauseCode RoadworksSubCauseCode_shortTermStationaryRoadworks_ := 4; - const RoadworksSubCauseCode RoadworksSubCauseCode_streetCleaning_ := 5; - const RoadworksSubCauseCode RoadworksSubCauseCode_winterService_ := 6; - - const HumanPresenceOnTheRoadSubCauseCode HumanPresenceOnTheRoadSubCauseCode_unavailable_ := 0; - const HumanPresenceOnTheRoadSubCauseCode HumanPresenceOnTheRoadSubCauseCode_childrenOnRoadway_ := 1; - const HumanPresenceOnTheRoadSubCauseCode HumanPresenceOnTheRoadSubCauseCode_cyclistOnRoadway_ := 2; - const HumanPresenceOnTheRoadSubCauseCode HumanPresenceOnTheRoadSubCauseCode_motorcyclistOnRoadway_ := 3; - - const WrongWayDrivingSubCauseCode WrongWayDrivingSubCauseCode_unavailable_ := 0; - const WrongWayDrivingSubCauseCode WrongWayDrivingSubCauseCode_wrongLane_ := 1; - const WrongWayDrivingSubCauseCode WrongWayDrivingSubCauseCode_wrongDirection_ := 2; - - const AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode_unavailable_ := 0; - const AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode_strongWinds_ := 1; - const AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode_damagingHail_ := 2; - const AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode_hurricane_ := 3; - const AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode_thunderstorm_ := 4; - const AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode_tornado_ := 5; - const AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode_blizzard_ := 6; - - const AdverseWeatherCondition_AdhesionSubCauseCode AdverseWeatherCondition_AdhesionSubCauseCode_unavailable_ := 0; - const AdverseWeatherCondition_AdhesionSubCauseCode AdverseWeatherCondition_AdhesionSubCauseCode_heavyFrostOnRoad_ := 1; - const AdverseWeatherCondition_AdhesionSubCauseCode AdverseWeatherCondition_AdhesionSubCauseCode_fuelOnRoad_ := 2; - const AdverseWeatherCondition_AdhesionSubCauseCode AdverseWeatherCondition_AdhesionSubCauseCode_mudOnRoad_ := 3; - const AdverseWeatherCondition_AdhesionSubCauseCode AdverseWeatherCondition_AdhesionSubCauseCode_snowOnRoad_ := 4; - const AdverseWeatherCondition_AdhesionSubCauseCode AdverseWeatherCondition_AdhesionSubCauseCode_iceOnRoad_ := 5; - const AdverseWeatherCondition_AdhesionSubCauseCode AdverseWeatherCondition_AdhesionSubCauseCode_blackIceOnRoad_ := 6; - const AdverseWeatherCondition_AdhesionSubCauseCode AdverseWeatherCondition_AdhesionSubCauseCode_oilOnRoad_ := 7; - const AdverseWeatherCondition_AdhesionSubCauseCode AdverseWeatherCondition_AdhesionSubCauseCode_looseChippings_ := 8; - const AdverseWeatherCondition_AdhesionSubCauseCode AdverseWeatherCondition_AdhesionSubCauseCode_instantBlackIce_ := 9; - const AdverseWeatherCondition_AdhesionSubCauseCode AdverseWeatherCondition_AdhesionSubCauseCode_roadsSalted_ := 10; - - const AdverseWeatherCondition_VisibilitySubCauseCode AdverseWeatherCondition_VisibilitySubCauseCode_unavailable_ := 0; - const AdverseWeatherCondition_VisibilitySubCauseCode AdverseWeatherCondition_VisibilitySubCauseCode_fog_ := 1; - const AdverseWeatherCondition_VisibilitySubCauseCode AdverseWeatherCondition_VisibilitySubCauseCode_smoke_ := 2; - const AdverseWeatherCondition_VisibilitySubCauseCode AdverseWeatherCondition_VisibilitySubCauseCode_heavySnowfall_ := 3; - const AdverseWeatherCondition_VisibilitySubCauseCode AdverseWeatherCondition_VisibilitySubCauseCode_heavyRain_ := 4; - const AdverseWeatherCondition_VisibilitySubCauseCode AdverseWeatherCondition_VisibilitySubCauseCode_heavyHail_ := 5; - const AdverseWeatherCondition_VisibilitySubCauseCode AdverseWeatherCondition_VisibilitySubCauseCode_lowSunGlare_ := 6; - const AdverseWeatherCondition_VisibilitySubCauseCode AdverseWeatherCondition_VisibilitySubCauseCode_sandstorms_ := 7; - const AdverseWeatherCondition_VisibilitySubCauseCode AdverseWeatherCondition_VisibilitySubCauseCode_swarmsOfInsects_ := 8; - - const AdverseWeatherCondition_PrecipitationSubCauseCode AdverseWeatherCondition_PrecipitationSubCauseCode_unavailable_ := 0; - const AdverseWeatherCondition_PrecipitationSubCauseCode AdverseWeatherCondition_PrecipitationSubCauseCode_heavyRain_ := 1; - const AdverseWeatherCondition_PrecipitationSubCauseCode AdverseWeatherCondition_PrecipitationSubCauseCode_heavySnowfall_ := 2; - const AdverseWeatherCondition_PrecipitationSubCauseCode AdverseWeatherCondition_PrecipitationSubCauseCode_softHail_ := 3; - - const SlowVehicleSubCauseCode SlowVehicleSubCauseCode_unavailable_ := 0; - const SlowVehicleSubCauseCode SlowVehicleSubCauseCode_maintenanceVehicle_ := 1; - const SlowVehicleSubCauseCode SlowVehicleSubCauseCode_vehiclesSlowingToLookAtAccident_ := 2; - const SlowVehicleSubCauseCode SlowVehicleSubCauseCode_abnormalLoad_ := 3; - const SlowVehicleSubCauseCode SlowVehicleSubCauseCode_abnormalWideLoad_ := 4; - const SlowVehicleSubCauseCode SlowVehicleSubCauseCode_convoy_ := 5; - const SlowVehicleSubCauseCode SlowVehicleSubCauseCode_snowplough_ := 6; - const SlowVehicleSubCauseCode SlowVehicleSubCauseCode_deicing_ := 7; - const SlowVehicleSubCauseCode SlowVehicleSubCauseCode_saltingVehicles_ := 8; - - const StationaryVehicleSubCauseCode StationaryVehicleSubCauseCode_unavailable_ := 0; - const StationaryVehicleSubCauseCode StationaryVehicleSubCauseCode_humanProblem_ := 1; - const StationaryVehicleSubCauseCode StationaryVehicleSubCauseCode_vehicleBreakdown_ := 2; - const StationaryVehicleSubCauseCode StationaryVehicleSubCauseCode_postCrash_ := 3; - const StationaryVehicleSubCauseCode StationaryVehicleSubCauseCode_publicTransportStop_ := 4; - const StationaryVehicleSubCauseCode StationaryVehicleSubCauseCode_carryingDangerousGoods_ := 5; - - const HumanProblemSubCauseCode HumanProblemSubCauseCode_unavailable_ := 0; - const HumanProblemSubCauseCode HumanProblemSubCauseCode_glycemiaProblem_ := 1; - const HumanProblemSubCauseCode HumanProblemSubCauseCode_heartProblem_ := 2; - - const EmergencyVehicleApproachingSubCauseCode EmergencyVehicleApproachingSubCauseCode_unavailable_ := 0; - const EmergencyVehicleApproachingSubCauseCode EmergencyVehicleApproachingSubCauseCode_emergencyVehicleApproaching_ := 1; - const EmergencyVehicleApproachingSubCauseCode EmergencyVehicleApproachingSubCauseCode_prioritizedVehicleApproaching_ := 2; - - const HazardousLocation_DangerousCurveSubCauseCode HazardousLocation_DangerousCurveSubCauseCode_unavailable_ := 0; - const HazardousLocation_DangerousCurveSubCauseCode HazardousLocation_DangerousCurveSubCauseCode_dangerousLeftTurnCurve_ := 1; - const HazardousLocation_DangerousCurveSubCauseCode HazardousLocation_DangerousCurveSubCauseCode_dangerousRightTurnCurve_ := 2; - const HazardousLocation_DangerousCurveSubCauseCode HazardousLocation_DangerousCurveSubCauseCode_multipleCurvesStartingWithUnknownTurningDirection_ := 3; - const HazardousLocation_DangerousCurveSubCauseCode HazardousLocation_DangerousCurveSubCauseCode_multipleCurvesStartingWithLeftTurn_ := 4; - const HazardousLocation_DangerousCurveSubCauseCode HazardousLocation_DangerousCurveSubCauseCode_multipleCurvesStartingWithRightTurn_ := 5; - - const HazardousLocation_SurfaceConditionSubCauseCode HazardousLocation_SurfaceConditionSubCauseCode_unavailable_ := 0; - const HazardousLocation_SurfaceConditionSubCauseCode HazardousLocation_SurfaceConditionSubCauseCode_rockfalls_ := 1; - const HazardousLocation_SurfaceConditionSubCauseCode HazardousLocation_SurfaceConditionSubCauseCode_earthquakeDamage_ := 2; - const HazardousLocation_SurfaceConditionSubCauseCode HazardousLocation_SurfaceConditionSubCauseCode_sewerCollapse_ := 3; - const HazardousLocation_SurfaceConditionSubCauseCode HazardousLocation_SurfaceConditionSubCauseCode_subsidence_ := 4; - const HazardousLocation_SurfaceConditionSubCauseCode HazardousLocation_SurfaceConditionSubCauseCode_snowDrifts_ := 5; - const HazardousLocation_SurfaceConditionSubCauseCode HazardousLocation_SurfaceConditionSubCauseCode_stormDamage_ := 6; - const HazardousLocation_SurfaceConditionSubCauseCode HazardousLocation_SurfaceConditionSubCauseCode_burstPipe_ := 7; - const HazardousLocation_SurfaceConditionSubCauseCode HazardousLocation_SurfaceConditionSubCauseCode_volcanoEruption_ := 8; - const HazardousLocation_SurfaceConditionSubCauseCode HazardousLocation_SurfaceConditionSubCauseCode_fallingIce_ := 9; - - const HazardousLocation_ObstacleOnTheRoadSubCauseCode HazardousLocation_ObstacleOnTheRoadSubCauseCode_unavailable_ := 0; - const HazardousLocation_ObstacleOnTheRoadSubCauseCode HazardousLocation_ObstacleOnTheRoadSubCauseCode_shedLoad_ := 1; - const HazardousLocation_ObstacleOnTheRoadSubCauseCode HazardousLocation_ObstacleOnTheRoadSubCauseCode_partsOfVehicles_ := 2; - const HazardousLocation_ObstacleOnTheRoadSubCauseCode HazardousLocation_ObstacleOnTheRoadSubCauseCode_partsOfTyres_ := 3; - const HazardousLocation_ObstacleOnTheRoadSubCauseCode HazardousLocation_ObstacleOnTheRoadSubCauseCode_bigObjects_ := 4; - const HazardousLocation_ObstacleOnTheRoadSubCauseCode HazardousLocation_ObstacleOnTheRoadSubCauseCode_fallenTrees_ := 5; - const HazardousLocation_ObstacleOnTheRoadSubCauseCode HazardousLocation_ObstacleOnTheRoadSubCauseCode_hubCaps_ := 6; - const HazardousLocation_ObstacleOnTheRoadSubCauseCode HazardousLocation_ObstacleOnTheRoadSubCauseCode_waitingVehicles_ := 7; - - const HazardousLocation_AnimalOnTheRoadSubCauseCode HazardousLocation_AnimalOnTheRoadSubCauseCode_unavailable_ := 0; - const HazardousLocation_AnimalOnTheRoadSubCauseCode HazardousLocation_AnimalOnTheRoadSubCauseCode_wildAnimals_ := 1; - const HazardousLocation_AnimalOnTheRoadSubCauseCode HazardousLocation_AnimalOnTheRoadSubCauseCode_herdOfAnimals_ := 2; - const HazardousLocation_AnimalOnTheRoadSubCauseCode HazardousLocation_AnimalOnTheRoadSubCauseCode_smallAnimals_ := 3; - const HazardousLocation_AnimalOnTheRoadSubCauseCode HazardousLocation_AnimalOnTheRoadSubCauseCode_largeAnimals_ := 4; - - const CollisionRiskSubCauseCode CollisionRiskSubCauseCode_unavailable_ := 0; - const CollisionRiskSubCauseCode CollisionRiskSubCauseCode_longitudinalCollisionRisk_ := 1; - const CollisionRiskSubCauseCode CollisionRiskSubCauseCode_crossingCollisionRisk_ := 2; - const CollisionRiskSubCauseCode CollisionRiskSubCauseCode_lateralCollisionRisk_ := 3; - const CollisionRiskSubCauseCode CollisionRiskSubCauseCode_vulnerableRoadUser_ := 4; - - const SignalViolationSubCauseCode SignalViolationSubCauseCode_unavailable_ := 0; - const SignalViolationSubCauseCode SignalViolationSubCauseCode_stopSignViolation_ := 1; - const SignalViolationSubCauseCode SignalViolationSubCauseCode_trafficLightViolation_ := 2; - const SignalViolationSubCauseCode SignalViolationSubCauseCode_turningRegulationViolation_ := 3; - - const RescueAndRecoveryWorkInProgressSubCauseCode RescueAndRecoveryWorkInProgressSubCauseCode_unavailable_ := 0; - const RescueAndRecoveryWorkInProgressSubCauseCode RescueAndRecoveryWorkInProgressSubCauseCode_emergencyVehicles_ := 1; - const RescueAndRecoveryWorkInProgressSubCauseCode RescueAndRecoveryWorkInProgressSubCauseCode_rescueHelicopterLanding_ := 2; - const RescueAndRecoveryWorkInProgressSubCauseCode RescueAndRecoveryWorkInProgressSubCauseCode_policeActivityOngoing_ := 3; - const RescueAndRecoveryWorkInProgressSubCauseCode RescueAndRecoveryWorkInProgressSubCauseCode_medicalEmergencyOngoing_ := 4; - const RescueAndRecoveryWorkInProgressSubCauseCode RescueAndRecoveryWorkInProgressSubCauseCode_childAbductionInProgress_ := 5; - - const DangerousEndOfQueueSubCauseCode DangerousEndOfQueueSubCauseCode_unavailable_ := 0; - const DangerousEndOfQueueSubCauseCode DangerousEndOfQueueSubCauseCode_suddenEndOfQueue_ := 1; - const DangerousEndOfQueueSubCauseCode DangerousEndOfQueueSubCauseCode_queueOverHill_ := 2; - const DangerousEndOfQueueSubCauseCode DangerousEndOfQueueSubCauseCode_queueAroundBend_ := 3; - const DangerousEndOfQueueSubCauseCode DangerousEndOfQueueSubCauseCode_queueInTunnel_ := 4; - - const DangerousSituationSubCauseCode DangerousSituationSubCauseCode_unavailable_ := 0; - const DangerousSituationSubCauseCode DangerousSituationSubCauseCode_emergencyElectronicBrakeEngaged_ := 1; - const DangerousSituationSubCauseCode DangerousSituationSubCauseCode_preCrashSystemEngaged_ := 2; - const DangerousSituationSubCauseCode DangerousSituationSubCauseCode_espEngaged_ := 3; - const DangerousSituationSubCauseCode DangerousSituationSubCauseCode_absEngaged_ := 4; - const DangerousSituationSubCauseCode DangerousSituationSubCauseCode_aebEngaged_ := 5; - const DangerousSituationSubCauseCode DangerousSituationSubCauseCode_brakeWarningEngaged_ := 6; - const DangerousSituationSubCauseCode DangerousSituationSubCauseCode_collisionRiskWarningEngaged_ := 7; - - const VehicleBreakdownSubCauseCode VehicleBreakdownSubCauseCode_unavailable_ := 0; - const VehicleBreakdownSubCauseCode VehicleBreakdownSubCauseCode_lackOfFuel_ := 1; - const VehicleBreakdownSubCauseCode VehicleBreakdownSubCauseCode_lackOfBatteryPower_ := 2; - const VehicleBreakdownSubCauseCode VehicleBreakdownSubCauseCode_engineProblem_ := 3; - const VehicleBreakdownSubCauseCode VehicleBreakdownSubCauseCode_transmissionProblem_ := 4; - const VehicleBreakdownSubCauseCode VehicleBreakdownSubCauseCode_engineCoolingProblem_ := 5; - const VehicleBreakdownSubCauseCode VehicleBreakdownSubCauseCode_brakingSystemProblem_ := 6; - const VehicleBreakdownSubCauseCode VehicleBreakdownSubCauseCode_steeringProblem_ := 7; - const VehicleBreakdownSubCauseCode VehicleBreakdownSubCauseCode_tyrePuncture_ := 8; - - const PostCrashSubCauseCode PostCrashSubCauseCode_unavailable_ := 0; - const PostCrashSubCauseCode PostCrashSubCauseCode_accidentWithoutECallTriggered_ := 1; - const PostCrashSubCauseCode PostCrashSubCauseCode_accidentWithECallManuallyTriggered_ := 2; - const PostCrashSubCauseCode PostCrashSubCauseCode_accidentWithECallAutomaticallyTriggered_ := 3; - const PostCrashSubCauseCode PostCrashSubCauseCode_accidentWithECallTriggeredWithoutAccessToCellularNetwork_ := 4; - - } // End of group subCauseCodes - - } // End of group commonConstants - -} // End of module LibIts_ASN1_NamedNumbers +//This module contains TTCN-3 values for ASN.1 named numbers, aligned with TTWorkbench name convention + +module LibItsCommon_ASN1_NamedNumbers { + + import from ITS_Container language "ASN.1:2008" all; + + import from IVI language "ASN.1:1997" { + type IviStatus + } + + group commonConstants { + + const AccelerationConfidence AccelerationConfidence_pointOneMeterPerSecSquared_ := 1; + const AccelerationConfidence AccelerationConfidence_outOfRange_ := 101; + const AccelerationConfidence AccelerationConfidence_unavailable_ := 102; + + const AccelerationControl AccelerationControl_brakePedalEngaged_ := '1000000'B; + const AccelerationControl AccelerationControl_gasPedalEngaged_ := '0100000'B; + const AccelerationControl AccelerationControl_emergencyBrakeEngaged_ := '0010000'B; + const AccelerationControl AccelerationControl_collisionWarningEngaged_ := '0001000'B; + const AccelerationControl AccelerationControl_accEngaged_ := '0000100'B; + const AccelerationControl AccelerationControl_cruiseControlEngaged_ := '0000010'B; + const AccelerationControl AccelerationControl_speedLimiterEngaged_ := '0000001'B; + + const AltitudeValue AltitudeValue_referenceEllipsoidSurface_ := 0; + const AltitudeValue AltitudeValue_oneCentimeter_ := 1; + const AltitudeValue AltitudeValue_unavailable_ := 800001; + + const CurvatureValue CurvatureValue_straight_ := 0; + const CurvatureValue CurvatureValue_reciprocalOf1MeterRadiusToRight_ := -1023; + const CurvatureValue CurvatureValue_reciprocalOf1MeterRadiusToLeft_ := 1023; + const CurvatureValue CurvatureValue_unavailable_ := 1023; + + const ExteriorLights ExteriorLights_lowBeamHeadlightsOn_ := '10000000'B; + const ExteriorLights ExteriorLights_highBeamHeadlightsOn_ := '01000000'B; + const ExteriorLights ExteriorLights_leftTurnSignalOn_ := '00100000'B; + const ExteriorLights ExteriorLights_rightTurnSignalOn_ := '00010000'B; + const ExteriorLights ExteriorLights_daytimeRunningLightsOn_ := '00001000'B; + const ExteriorLights ExteriorLights_reverseLightOn_ := '00000100'B; + const ExteriorLights ExteriorLights_fogLightOn_ := '00000010'B; + const ExteriorLights ExteriorLights_parkingLightsOn_ := '00000001'B; + + const HeadingConfidence HeadingConfidence_withinZeroPointOneDegree_ := 1; + + const HeadingValue HeadingValue_wgs84North_ := 0; + + const ItsPduHeader.protocolVersion ItsPduHeader_protocolVersion_currentVersion_ := 2; + const ItsPduHeader.messageID ItsPduHeader_messageID_denm_ := 1; + const ItsPduHeader.messageID ItsPduHeader_messageID_cam_ := 2; + const ItsPduHeader.messageID ItsPduHeader_messageID_poi_ := 3; + const ItsPduHeader.messageID ItsPduHeader_messageID_spatem_ := 4; + const ItsPduHeader.messageID ItsPduHeader_messageID_mapem_ := 5; + const ItsPduHeader.messageID ItsPduHeader_messageID_ivim_ := 6; + const ItsPduHeader.messageID ItsPduHeader_messageID_ev_rsr_ := 7; + const ItsPduHeader.messageID ItsPduHeader_messageID_tistpgtransaction_ := 8; + const ItsPduHeader.messageID ItsPduHeader_messageID_srem_ := 9; + const ItsPduHeader.messageID ItsPduHeader_messageID_ssem_ := 10; + const ItsPduHeader.messageID ItsPduHeader_messageID_evcsn_ := 11; + const ItsPduHeader.messageID ItsPduHeader_messageID_saem_ := 12; + const ItsPduHeader.messageID ItsPduHeader_messageID_rtcem_ := 13; + + const LongitudinalAccelerationValue LongitudinalAccelerationValue_unavailable_ := 161; + + const SemiAxisLength SemiAxisLength_oneCentimeter_ := 1; + const SemiAxisLength SemiAxisLength_outOfRange_ := 4094; + const SemiAxisLength SemiAxisLength_unavailable_ := 4095; + + const StationType StationType_unknown_ := 0; + const StationType StationType_pedestrian_ := 1; + const StationType StationType_cyclist_ := 2; + const StationType StationType_moped_ := 3; + const StationType StationType_motorcycle_ := 4; + const StationType StationType_passengerCar_ := 5; + const StationType StationType_bus_ := 6; + const StationType StationType_lightTruck_ := 7; + const StationType StationType_heavyTruck_ := 8; + const StationType StationType_trailer_ := 9; + const StationType StationType_specialVehicles_ := 10; + const StationType StationType_tram_ := 11; + const StationType StationType_roadSideUnit_ := 15; + + const YawRateValue YawRateValue_straight_ := 0; + + group causeCodes { + const CauseCodeType CauseCodeType_reserved_ := 0; + const CauseCodeType CauseCodeType_trafficCondition_ := 1; + const CauseCodeType CauseCodeType_accident_ := 2; + const CauseCodeType CauseCodeType_roadworks_ := 3; + const CauseCodeType CauseCodeType_adverseWeatherCondition_Adhesion_ := 6; + const CauseCodeType CauseCodeType_hazardousLocation_SurfaceCondition_ := 9; + const CauseCodeType CauseCodeType_hazardousLocation_ObstacleOnTheRoad_ := 10; + const CauseCodeType CauseCodeType_hazardousLocation_AnimalOnTheRoad_ := 11; + const CauseCodeType CauseCodeType_humanPresenceOnTheRoad_ := 12; + const CauseCodeType CauseCodeType_wrongWayDriving_ := 14; + const CauseCodeType CauseCodeType_rescueAndRecoveryWorkInProgress_ := 15; + const CauseCodeType CauseCodeType_adverseWeatherCondition_ExtremeWeatherCondition_ := 17; + const CauseCodeType CauseCodeType_adverseWeatherCondition_Visibility_ := 18; + const CauseCodeType CauseCodeType_adverseWeatherCondition_Precipitation_ := 19; + const CauseCodeType CauseCodeType_slowVehicle_ := 26; + const CauseCodeType CauseCodeType_dangerousEndOfQueue_ := 27; + const CauseCodeType CauseCodeType_vehicleBreakdown_ := 91; + const CauseCodeType CauseCodeType_postCrash_ := 92; + const CauseCodeType CauseCodeType_humanProblem_ := 93; + const CauseCodeType CauseCodeType_stationaryVehicle_ := 94; + const CauseCodeType CauseCodeType_emergencyVehicleApproaching_ := 95; + const CauseCodeType CauseCodeType_hazardousLocation_DangerousCurve_ := 96; + const CauseCodeType CauseCodeType_collisionRisk_ := 97; + const CauseCodeType CauseCodeType_signalViolation_ := 98; + const CauseCodeType CauseCodeType_dangerousSituation_ := 99; + + } // end group causeCodes + + group subCauseCodes { + + const SubCauseCodeType SubCauseCodeType_unavailable_ := 0; + + const TrafficConditionSubCauseCode TrafficConditionSubCauseCode_unavailable_ := 0; + const TrafficConditionSubCauseCode TrafficConditionSubCauseCode_increasedVolumeOfTraffic_ := 1; + const TrafficConditionSubCauseCode TrafficConditionSubCauseCode_trafficJamSlowlyIncreasing_ := 2; + const TrafficConditionSubCauseCode TrafficConditionSubCauseCode_trafficJamIncreasing_ := 3; + const TrafficConditionSubCauseCode TrafficConditionSubCauseCode_trafficJamStronglyIncreasing_ := 4; + const TrafficConditionSubCauseCode TrafficConditionSubCauseCode_trafficStationary_ := 5; + const TrafficConditionSubCauseCode TrafficConditionSubCauseCode_trafficJamSlightlyDecreasing_ := 6; + const TrafficConditionSubCauseCode TrafficConditionSubCauseCode_trafficJamDecreasing_ := 7; + const TrafficConditionSubCauseCode TrafficConditionSubCauseCode_trafficJamStronglyDecreasing_ := 8; + + const AccidentSubCauseCode AccidentSubCauseCode_unavailable_ := 0; + const AccidentSubCauseCode AccidentSubCauseCode_multiVehicleAccident_ := 1; + const AccidentSubCauseCode AccidentSubCauseCode_heavyAccident_ := 2; + const AccidentSubCauseCode AccidentSubCauseCode_accidentInvolvingLorry_ := 3; + const AccidentSubCauseCode AccidentSubCauseCode_accidentInvolvingBus_ := 4; + const AccidentSubCauseCode AccidentSubCauseCode_accidentInvolvingHazardousMaterials_ := 5; + const AccidentSubCauseCode AccidentSubCauseCode_accidentOnOppositeLane_ := 6; + const AccidentSubCauseCode AccidentSubCauseCode_unsecuredAccident_ := 7; + const AccidentSubCauseCode AccidentSubCauseCode_assistanceRequested_ := 8; + + const RoadworksSubCauseCode RoadworksSubCauseCode_unavailable_ := 0; + const RoadworksSubCauseCode RoadworksSubCauseCode_majorRoadworks_ := 1; + const RoadworksSubCauseCode RoadworksSubCauseCode_roadMarkingWork_ := 2; + const RoadworksSubCauseCode RoadworksSubCauseCode_slowMovingRoadMaintenance_ := 3; + const RoadworksSubCauseCode RoadworksSubCauseCode_shortTermStationaryRoadworks_ := 4; + const RoadworksSubCauseCode RoadworksSubCauseCode_streetCleaning_ := 5; + const RoadworksSubCauseCode RoadworksSubCauseCode_winterService_ := 6; + + const HumanPresenceOnTheRoadSubCauseCode HumanPresenceOnTheRoadSubCauseCode_unavailable_ := 0; + const HumanPresenceOnTheRoadSubCauseCode HumanPresenceOnTheRoadSubCauseCode_childrenOnRoadway_ := 1; + const HumanPresenceOnTheRoadSubCauseCode HumanPresenceOnTheRoadSubCauseCode_cyclistOnRoadway_ := 2; + const HumanPresenceOnTheRoadSubCauseCode HumanPresenceOnTheRoadSubCauseCode_motorcyclistOnRoadway_ := 3; + + const WrongWayDrivingSubCauseCode WrongWayDrivingSubCauseCode_unavailable_ := 0; + const WrongWayDrivingSubCauseCode WrongWayDrivingSubCauseCode_wrongLane_ := 1; + const WrongWayDrivingSubCauseCode WrongWayDrivingSubCauseCode_wrongDirection_ := 2; + + const AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode_unavailable_ := 0; + const AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode_strongWinds_ := 1; + const AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode_damagingHail_ := 2; + const AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode_hurricane_ := 3; + const AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode_thunderstorm_ := 4; + const AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode_tornado_ := 5; + const AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode AdverseWeatherCondition_ExtremeWeatherConditionSubCauseCode_blizzard_ := 6; + + const AdverseWeatherCondition_AdhesionSubCauseCode AdverseWeatherCondition_AdhesionSubCauseCode_unavailable_ := 0; + const AdverseWeatherCondition_AdhesionSubCauseCode AdverseWeatherCondition_AdhesionSubCauseCode_heavyFrostOnRoad_ := 1; + const AdverseWeatherCondition_AdhesionSubCauseCode AdverseWeatherCondition_AdhesionSubCauseCode_fuelOnRoad_ := 2; + const AdverseWeatherCondition_AdhesionSubCauseCode AdverseWeatherCondition_AdhesionSubCauseCode_mudOnRoad_ := 3; + const AdverseWeatherCondition_AdhesionSubCauseCode AdverseWeatherCondition_AdhesionSubCauseCode_snowOnRoad_ := 4; + const AdverseWeatherCondition_AdhesionSubCauseCode AdverseWeatherCondition_AdhesionSubCauseCode_iceOnRoad_ := 5; + const AdverseWeatherCondition_AdhesionSubCauseCode AdverseWeatherCondition_AdhesionSubCauseCode_blackIceOnRoad_ := 6; + const AdverseWeatherCondition_AdhesionSubCauseCode AdverseWeatherCondition_AdhesionSubCauseCode_oilOnRoad_ := 7; + const AdverseWeatherCondition_AdhesionSubCauseCode AdverseWeatherCondition_AdhesionSubCauseCode_looseChippings_ := 8; + const AdverseWeatherCondition_AdhesionSubCauseCode AdverseWeatherCondition_AdhesionSubCauseCode_instantBlackIce_ := 9; + const AdverseWeatherCondition_AdhesionSubCauseCode AdverseWeatherCondition_AdhesionSubCauseCode_roadsSalted_ := 10; + + const AdverseWeatherCondition_VisibilitySubCauseCode AdverseWeatherCondition_VisibilitySubCauseCode_unavailable_ := 0; + const AdverseWeatherCondition_VisibilitySubCauseCode AdverseWeatherCondition_VisibilitySubCauseCode_fog_ := 1; + const AdverseWeatherCondition_VisibilitySubCauseCode AdverseWeatherCondition_VisibilitySubCauseCode_smoke_ := 2; + const AdverseWeatherCondition_VisibilitySubCauseCode AdverseWeatherCondition_VisibilitySubCauseCode_heavySnowfall_ := 3; + const AdverseWeatherCondition_VisibilitySubCauseCode AdverseWeatherCondition_VisibilitySubCauseCode_heavyRain_ := 4; + const AdverseWeatherCondition_VisibilitySubCauseCode AdverseWeatherCondition_VisibilitySubCauseCode_heavyHail_ := 5; + const AdverseWeatherCondition_VisibilitySubCauseCode AdverseWeatherCondition_VisibilitySubCauseCode_lowSunGlare_ := 6; + const AdverseWeatherCondition_VisibilitySubCauseCode AdverseWeatherCondition_VisibilitySubCauseCode_sandstorms_ := 7; + const AdverseWeatherCondition_VisibilitySubCauseCode AdverseWeatherCondition_VisibilitySubCauseCode_swarmsOfInsects_ := 8; + + const AdverseWeatherCondition_PrecipitationSubCauseCode AdverseWeatherCondition_PrecipitationSubCauseCode_unavailable_ := 0; + const AdverseWeatherCondition_PrecipitationSubCauseCode AdverseWeatherCondition_PrecipitationSubCauseCode_heavyRain_ := 1; + const AdverseWeatherCondition_PrecipitationSubCauseCode AdverseWeatherCondition_PrecipitationSubCauseCode_heavySnowfall_ := 2; + const AdverseWeatherCondition_PrecipitationSubCauseCode AdverseWeatherCondition_PrecipitationSubCauseCode_softHail_ := 3; + + const SlowVehicleSubCauseCode SlowVehicleSubCauseCode_unavailable_ := 0; + const SlowVehicleSubCauseCode SlowVehicleSubCauseCode_maintenanceVehicle_ := 1; + const SlowVehicleSubCauseCode SlowVehicleSubCauseCode_vehiclesSlowingToLookAtAccident_ := 2; + const SlowVehicleSubCauseCode SlowVehicleSubCauseCode_abnormalLoad_ := 3; + const SlowVehicleSubCauseCode SlowVehicleSubCauseCode_abnormalWideLoad_ := 4; + const SlowVehicleSubCauseCode SlowVehicleSubCauseCode_convoy_ := 5; + const SlowVehicleSubCauseCode SlowVehicleSubCauseCode_snowplough_ := 6; + const SlowVehicleSubCauseCode SlowVehicleSubCauseCode_deicing_ := 7; + const SlowVehicleSubCauseCode SlowVehicleSubCauseCode_saltingVehicles_ := 8; + + const StationaryVehicleSubCauseCode StationaryVehicleSubCauseCode_unavailable_ := 0; + const StationaryVehicleSubCauseCode StationaryVehicleSubCauseCode_humanProblem_ := 1; + const StationaryVehicleSubCauseCode StationaryVehicleSubCauseCode_vehicleBreakdown_ := 2; + const StationaryVehicleSubCauseCode StationaryVehicleSubCauseCode_postCrash_ := 3; + const StationaryVehicleSubCauseCode StationaryVehicleSubCauseCode_publicTransportStop_ := 4; + const StationaryVehicleSubCauseCode StationaryVehicleSubCauseCode_carryingDangerousGoods_ := 5; + + const HumanProblemSubCauseCode HumanProblemSubCauseCode_unavailable_ := 0; + const HumanProblemSubCauseCode HumanProblemSubCauseCode_glycemiaProblem_ := 1; + const HumanProblemSubCauseCode HumanProblemSubCauseCode_heartProblem_ := 2; + + const EmergencyVehicleApproachingSubCauseCode EmergencyVehicleApproachingSubCauseCode_unavailable_ := 0; + const EmergencyVehicleApproachingSubCauseCode EmergencyVehicleApproachingSubCauseCode_emergencyVehicleApproaching_ := 1; + const EmergencyVehicleApproachingSubCauseCode EmergencyVehicleApproachingSubCauseCode_prioritizedVehicleApproaching_ := 2; + + const HazardousLocation_DangerousCurveSubCauseCode HazardousLocation_DangerousCurveSubCauseCode_unavailable_ := 0; + const HazardousLocation_DangerousCurveSubCauseCode HazardousLocation_DangerousCurveSubCauseCode_dangerousLeftTurnCurve_ := 1; + const HazardousLocation_DangerousCurveSubCauseCode HazardousLocation_DangerousCurveSubCauseCode_dangerousRightTurnCurve_ := 2; + const HazardousLocation_DangerousCurveSubCauseCode HazardousLocation_DangerousCurveSubCauseCode_multipleCurvesStartingWithUnknownTurningDirection_ := 3; + const HazardousLocation_DangerousCurveSubCauseCode HazardousLocation_DangerousCurveSubCauseCode_multipleCurvesStartingWithLeftTurn_ := 4; + const HazardousLocation_DangerousCurveSubCauseCode HazardousLocation_DangerousCurveSubCauseCode_multipleCurvesStartingWithRightTurn_ := 5; + + const HazardousLocation_SurfaceConditionSubCauseCode HazardousLocation_SurfaceConditionSubCauseCode_unavailable_ := 0; + const HazardousLocation_SurfaceConditionSubCauseCode HazardousLocation_SurfaceConditionSubCauseCode_rockfalls_ := 1; + const HazardousLocation_SurfaceConditionSubCauseCode HazardousLocation_SurfaceConditionSubCauseCode_earthquakeDamage_ := 2; + const HazardousLocation_SurfaceConditionSubCauseCode HazardousLocation_SurfaceConditionSubCauseCode_sewerCollapse_ := 3; + const HazardousLocation_SurfaceConditionSubCauseCode HazardousLocation_SurfaceConditionSubCauseCode_subsidence_ := 4; + const HazardousLocation_SurfaceConditionSubCauseCode HazardousLocation_SurfaceConditionSubCauseCode_snowDrifts_ := 5; + const HazardousLocation_SurfaceConditionSubCauseCode HazardousLocation_SurfaceConditionSubCauseCode_stormDamage_ := 6; + const HazardousLocation_SurfaceConditionSubCauseCode HazardousLocation_SurfaceConditionSubCauseCode_burstPipe_ := 7; + const HazardousLocation_SurfaceConditionSubCauseCode HazardousLocation_SurfaceConditionSubCauseCode_volcanoEruption_ := 8; + const HazardousLocation_SurfaceConditionSubCauseCode HazardousLocation_SurfaceConditionSubCauseCode_fallingIce_ := 9; + + const HazardousLocation_ObstacleOnTheRoadSubCauseCode HazardousLocation_ObstacleOnTheRoadSubCauseCode_unavailable_ := 0; + const HazardousLocation_ObstacleOnTheRoadSubCauseCode HazardousLocation_ObstacleOnTheRoadSubCauseCode_shedLoad_ := 1; + const HazardousLocation_ObstacleOnTheRoadSubCauseCode HazardousLocation_ObstacleOnTheRoadSubCauseCode_partsOfVehicles_ := 2; + const HazardousLocation_ObstacleOnTheRoadSubCauseCode HazardousLocation_ObstacleOnTheRoadSubCauseCode_partsOfTyres_ := 3; + const HazardousLocation_ObstacleOnTheRoadSubCauseCode HazardousLocation_ObstacleOnTheRoadSubCauseCode_bigObjects_ := 4; + const HazardousLocation_ObstacleOnTheRoadSubCauseCode HazardousLocation_ObstacleOnTheRoadSubCauseCode_fallenTrees_ := 5; + const HazardousLocation_ObstacleOnTheRoadSubCauseCode HazardousLocation_ObstacleOnTheRoadSubCauseCode_hubCaps_ := 6; + const HazardousLocation_ObstacleOnTheRoadSubCauseCode HazardousLocation_ObstacleOnTheRoadSubCauseCode_waitingVehicles_ := 7; + + const HazardousLocation_AnimalOnTheRoadSubCauseCode HazardousLocation_AnimalOnTheRoadSubCauseCode_unavailable_ := 0; + const HazardousLocation_AnimalOnTheRoadSubCauseCode HazardousLocation_AnimalOnTheRoadSubCauseCode_wildAnimals_ := 1; + const HazardousLocation_AnimalOnTheRoadSubCauseCode HazardousLocation_AnimalOnTheRoadSubCauseCode_herdOfAnimals_ := 2; + const HazardousLocation_AnimalOnTheRoadSubCauseCode HazardousLocation_AnimalOnTheRoadSubCauseCode_smallAnimals_ := 3; + const HazardousLocation_AnimalOnTheRoadSubCauseCode HazardousLocation_AnimalOnTheRoadSubCauseCode_largeAnimals_ := 4; + + const CollisionRiskSubCauseCode CollisionRiskSubCauseCode_unavailable_ := 0; + const CollisionRiskSubCauseCode CollisionRiskSubCauseCode_longitudinalCollisionRisk_ := 1; + const CollisionRiskSubCauseCode CollisionRiskSubCauseCode_crossingCollisionRisk_ := 2; + const CollisionRiskSubCauseCode CollisionRiskSubCauseCode_lateralCollisionRisk_ := 3; + const CollisionRiskSubCauseCode CollisionRiskSubCauseCode_vulnerableRoadUser_ := 4; + + const SignalViolationSubCauseCode SignalViolationSubCauseCode_unavailable_ := 0; + const SignalViolationSubCauseCode SignalViolationSubCauseCode_stopSignViolation_ := 1; + const SignalViolationSubCauseCode SignalViolationSubCauseCode_trafficLightViolation_ := 2; + const SignalViolationSubCauseCode SignalViolationSubCauseCode_turningRegulationViolation_ := 3; + + const RescueAndRecoveryWorkInProgressSubCauseCode RescueAndRecoveryWorkInProgressSubCauseCode_unavailable_ := 0; + const RescueAndRecoveryWorkInProgressSubCauseCode RescueAndRecoveryWorkInProgressSubCauseCode_emergencyVehicles_ := 1; + const RescueAndRecoveryWorkInProgressSubCauseCode RescueAndRecoveryWorkInProgressSubCauseCode_rescueHelicopterLanding_ := 2; + const RescueAndRecoveryWorkInProgressSubCauseCode RescueAndRecoveryWorkInProgressSubCauseCode_policeActivityOngoing_ := 3; + const RescueAndRecoveryWorkInProgressSubCauseCode RescueAndRecoveryWorkInProgressSubCauseCode_medicalEmergencyOngoing_ := 4; + const RescueAndRecoveryWorkInProgressSubCauseCode RescueAndRecoveryWorkInProgressSubCauseCode_childAbductionInProgress_ := 5; + + const DangerousEndOfQueueSubCauseCode DangerousEndOfQueueSubCauseCode_unavailable_ := 0; + const DangerousEndOfQueueSubCauseCode DangerousEndOfQueueSubCauseCode_suddenEndOfQueue_ := 1; + const DangerousEndOfQueueSubCauseCode DangerousEndOfQueueSubCauseCode_queueOverHill_ := 2; + const DangerousEndOfQueueSubCauseCode DangerousEndOfQueueSubCauseCode_queueAroundBend_ := 3; + const DangerousEndOfQueueSubCauseCode DangerousEndOfQueueSubCauseCode_queueInTunnel_ := 4; + + const DangerousSituationSubCauseCode DangerousSituationSubCauseCode_unavailable_ := 0; + const DangerousSituationSubCauseCode DangerousSituationSubCauseCode_emergencyElectronicBrakeEngaged_ := 1; + const DangerousSituationSubCauseCode DangerousSituationSubCauseCode_preCrashSystemEngaged_ := 2; + const DangerousSituationSubCauseCode DangerousSituationSubCauseCode_espEngaged_ := 3; + const DangerousSituationSubCauseCode DangerousSituationSubCauseCode_absEngaged_ := 4; + const DangerousSituationSubCauseCode DangerousSituationSubCauseCode_aebEngaged_ := 5; + const DangerousSituationSubCauseCode DangerousSituationSubCauseCode_brakeWarningEngaged_ := 6; + const DangerousSituationSubCauseCode DangerousSituationSubCauseCode_collisionRiskWarningEngaged_ := 7; + + const VehicleBreakdownSubCauseCode VehicleBreakdownSubCauseCode_unavailable_ := 0; + const VehicleBreakdownSubCauseCode VehicleBreakdownSubCauseCode_lackOfFuel_ := 1; + const VehicleBreakdownSubCauseCode VehicleBreakdownSubCauseCode_lackOfBatteryPower_ := 2; + const VehicleBreakdownSubCauseCode VehicleBreakdownSubCauseCode_engineProblem_ := 3; + const VehicleBreakdownSubCauseCode VehicleBreakdownSubCauseCode_transmissionProblem_ := 4; + const VehicleBreakdownSubCauseCode VehicleBreakdownSubCauseCode_engineCoolingProblem_ := 5; + const VehicleBreakdownSubCauseCode VehicleBreakdownSubCauseCode_brakingSystemProblem_ := 6; + const VehicleBreakdownSubCauseCode VehicleBreakdownSubCauseCode_steeringProblem_ := 7; + const VehicleBreakdownSubCauseCode VehicleBreakdownSubCauseCode_tyrePuncture_ := 8; + + const PostCrashSubCauseCode PostCrashSubCauseCode_unavailable_ := 0; + const PostCrashSubCauseCode PostCrashSubCauseCode_accidentWithoutECallTriggered_ := 1; + const PostCrashSubCauseCode PostCrashSubCauseCode_accidentWithECallManuallyTriggered_ := 2; + const PostCrashSubCauseCode PostCrashSubCauseCode_accidentWithECallAutomaticallyTriggered_ := 3; + const PostCrashSubCauseCode PostCrashSubCauseCode_accidentWithECallTriggeredWithoutAccessToCellularNetwork_ := 4; + + } // End of group subCauseCodes + + } // End of group commonConstants + +} // End of module LibIts_ASN1_NamedNumbers diff --git a/ttcn/Common/LibItsCommon_Functions.ttcn b/ttcn/Common/LibItsCommon_Functions.ttcn index 8a51ee99..6b03eaeb 100644 --- a/ttcn/Common/LibItsCommon_Functions.ttcn +++ b/ttcn/Common/LibItsCommon_Functions.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Common/LibItsCommon_Functions.ttcn $ + * $Id: LibItsCommon_Functions.ttcn 1318 2017-01-26 10:20:53Z filatov $ * @desc Module containing common functions for ITS * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. @@ -231,6 +231,11 @@ module LibItsCommon_Functions { } // end f_getTsLongitude + function f_getTimeForGpsFix() return integer { + + return PX_TIME_FOR_GPS_FIX; + } + } // end itsFunctions group externalFunctions { diff --git a/ttcn/Common/LibItsCommon_Pixits.ttcn b/ttcn/Common/LibItsCommon_Pixits.ttcn index 964b38ac..9768708f 100644 --- a/ttcn/Common/LibItsCommon_Pixits.ttcn +++ b/ttcn/Common/LibItsCommon_Pixits.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Common/LibItsCommon_Pixits.ttcn $ + * $Id: LibItsCommon_Pixits.ttcn 1318 2017-01-26 10:20:53Z filatov $ * @desc Common PIXITS * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. @@ -55,6 +55,21 @@ module LibItsCommon_Pixits { */ modulepar boolean PX_GNSS_SCENARIO_SUPPORT := false; + /** + * @desc Time to guard awaiting the distance covered indication + */ + modulepar float PX_T_GNSS_AWAIT_DISTANCE_COVERED := 120.0; + + /** + * @desc Time to guard awaiting the speed reached indication + */ + modulepar float PX_T_GNSS_AWAIT_SPEED_REACHED := 120.0; + + /** + * @desc Estimated time till DUT gets GPSFix after GPS position data are provided (sec) + */ + modulepar integer PX_TIME_FOR_GPS_FIX := 60; + /** * @desc The certificate identifier the TA shall use in case of secured IUT. Default: CERT_IUT_A_AT * @remark If the IUT cannot use the test certificates, set this PIXIT to CERT_NONE diff --git a/ttcn/Common/LibItsCommon_Templates.ttcn b/ttcn/Common/LibItsCommon_Templates.ttcn index e27ec943..f0c5e5f5 100644 --- a/ttcn/Common/LibItsCommon_Templates.ttcn +++ b/ttcn/Common/LibItsCommon_Templates.ttcn @@ -1,105 +1,130 @@ -/** - * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $URL$ - * $Id$ - * @desc Module containing base template definitions for DENM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsCommon_Templates { - - import from ITS_Container language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - - group taPrimitives { - - template (value) AdapterControlResults m_acSecResponseSuccess := {acSecResponse:=true}; - - /** - * @desc Enable security support - */ - template (value) AcSecPrimitive m_acEnableSecurity( - in charstring p_certificate_id, - in boolean p_enforceSecurity := false - ) := { - acEnableSecurity := { - certificateId := p_certificate_id, - enforceSecurity := p_enforceSecurity - } - } // End of template m_acEnableSecurity - - /** - * @desc Disable security support - */ - template (value) AcSecPrimitive m_acDisableSecurity := { - acDisableSecurity := { - disable := true - } - } // End of template m_acDisableSecurity - - template AdapterControlResults m_acGnssResponseSuccess := {acGnssResponse:=true}; - - template (value) AdapterControlResults m_acGnssDistanceCovered := { - acGnssDistanceCovered:=true - }; - - /** - * @desc Testsystem will load GNSS scenario - */ - template (value) AcGnssPrimitive m_loadScenario(Scenario p_scenario) := { - loadScenario := { - scenario := p_scenario - } - } - - /** - * @desc Testsystem will start GNSS scenario - */ - template (value) AcGnssPrimitive m_startScenario := { - startScenario := { - } - } - - /** - * @desc Testsystem will stop GNSS scenario - */ - template (value) AcGnssPrimitive m_stopScenario := { - stopScenario := { - } - } - - /** - * @desc Testsystem will request indication if distance was covered - */ - template (value) AcGnssPrimitive m_distanceToCover(float p_distance) := { - distanceToCover := { - distance := p_distance - } - } - - /** - * @desc Testsystem will change the speed (delta value) - */ - template (value) AcGnssPrimitive m_changeScenarioSpeed(SpeedValue p_deltaSpeedValue) := { - changeSpeed := { - deltaSpeed := p_deltaSpeedValue - } - } - - /** - * @desc Testsystem will change the heading (delta value) - */ - template (value) AcGnssPrimitive m_changeScenarioHeading(HeadingValue p_deltaHeadingValue) := { - changeHeading := { - deltaHeading := p_deltaHeadingValue - } - } - - } // end taPrimitives - -} +/** + * @author ETSI / STF405 / STF449 / STF484 / STF517 + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Common/LibItsCommon_Templates.ttcn $ + * $Id: LibItsCommon_Templates.ttcn 1318 2017-01-26 10:20:53Z filatov $ + * @desc Module containing base template definitions for DENM + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * + */ +module LibItsCommon_Templates { + + import from ITS_Container language "ASN.1:1997" all; + + // LibItsCommon + import from LibItsCommon_TypesAndValues all; + + group taPrimitives { + + template (value) AdapterControlResults m_acSecResponseSuccess := {acSecResponse:=true}; + + /** + * @desc Enable security support + */ + template (value) AcSecPrimitive m_acEnableSecurity( + in charstring p_certificateId, + in boolean p_enforceSecurity := false + ) := { + acEnableSecurity := { + certificateId := p_certificateId, + enforceSecurity := p_enforceSecurity + } + } // End of template m_acEnableSecurity + + /** + * @desc Disable security support + */ + template (value) AcSecPrimitive m_acDisableSecurity := { + acDisableSecurity := { + disable := true + } + } // End of template m_acDisableSecurity + + template (value) AdapterControlResults m_acGnssResponseSuccess := { acGnssResponse := true } + template (value) AdapterControlResults m_acGnssResponseError := { acGnssResponse := false } + + template (value) AdapterControlResults m_acGnssDistanceCoveredSuccess := { acGnssDistanceCovered := true } + template (value) AdapterControlResults m_acGnssDistanceCoveredError := { acGnssDistanceCovered := false } + + template (value) AdapterControlResults m_acGnssSpeedReachedSuccess := { acGnssSpeedReached := true } + template (value) AdapterControlResults m_acGnssSpeedReachedError := { acGnssSpeedReached := false } + + template (value) AdapterControlResults m_acGnssTimeReachedSuccess := { acGnssTimeReached := true } + template (value) AdapterControlResults m_acGnssTimeReachedError := { acGnssTimeReached := true } + + /** + * @desc Testsystem will load GNSS scenario + */ + template (value) AcGnssPrimitive m_loadScenario(in Scenario p_scenario) := { + loadScenario := { + scenario := p_scenario + } + } + + /** + * @desc Testsystem will start GNSS scenario + */ + template (value) AcGnssPrimitive m_startScenario := { + startScenario := { + } + } + + /** + * @desc Testsystem will stop GNSS scenario + */ + template (value) AcGnssPrimitive m_stopScenario := { + stopScenario := { + } + } + + /** + * @desc Testsystem will request indication if distance was covered + */ + template (value) AcGnssPrimitive m_distanceToCover(float p_distance) := { + distanceToCover := { + distance := p_distance + } + } + + /** + * @desc Testsystem will request indication if speed is reached + */ + template AcGnssPrimitive m_awaitSpeed(float p_speed, SpeedTrend p_speedTrend) := { + speed := { + speed := p_speed, + speedTrend := p_speedTrend + } + } + + /** + * @desc Testsystem will change the speed (delta value) + */ + template (value) AcGnssPrimitive m_changeScenarioSpeed(SpeedValue p_deltaSpeedValue) := { + changeSpeed := { + deltaSpeed := p_deltaSpeedValue + } + } + + /** + * @desc Testsystem will change the heading (delta value) + */ + template (value) AcGnssPrimitive m_changeScenarioHeading(HeadingValue p_deltaHeadingValue) := { + changeHeading := { + deltaHeading := p_deltaHeadingValue + } + } + + /** + * @desc Testsystem will request indication if time (sec) was reached in running scenario + */ + template AcGnssPrimitive m_timeInRunningScenario(integer p_time) := { + timeInRunningScenario := { + time := p_time + } + } + + } // end taPrimitives + +} diff --git a/ttcn/Common/LibItsCommon_TestSystem.ttcn b/ttcn/Common/LibItsCommon_TestSystem.ttcn index d7c0e608..7a028d73 100644 --- a/ttcn/Common/LibItsCommon_TestSystem.ttcn +++ b/ttcn/Common/LibItsCommon_TestSystem.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Common/LibItsCommon_TestSystem.ttcn $ + * $Id: LibItsCommon_TestSystem.ttcn 1318 2017-01-26 10:20:53Z filatov $ * @desc Test System module for ITS * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. diff --git a/ttcn/Common/LibItsCommon_TypesAndValues.ttcn b/ttcn/Common/LibItsCommon_TypesAndValues.ttcn index 8f06347a..546bcb73 100644 --- a/ttcn/Common/LibItsCommon_TypesAndValues.ttcn +++ b/ttcn/Common/LibItsCommon_TypesAndValues.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Common/LibItsCommon_TypesAndValues.ttcn $ + * $Id: LibItsCommon_TypesAndValues.ttcn 1318 2017-01-26 10:20:53Z filatov $ * @desc Module containing common types and values for ITS Protocols * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. @@ -44,13 +44,6 @@ module LibItsCommon_TypesAndValues { boolean disable } // End of type AcDisableSecurity - /** - * @desc Primitive for receiving response from TA - */ -//FIXME RGY As discussed, type is changed to a type derived from AdapterControlResults -// type boolean AcSecResponse; - type AdapterControlResults.acSecResponse AcSecResponse; - /** * @desc TA primitives for GNSS * @member loadScenario - @@ -63,30 +56,48 @@ module LibItsCommon_TypesAndValues { AcStartScenario startScenario, AcStopScenario stopScenario, AcDistanceToCover distanceToCover, + AcSpeed speed, AcChangeSpeed changeSpeed, - AcChangeHeading changeHeading + AcChangeHeading changeHeading, + AcTimeInRunningScenario timeInRunningScenario } /** * @desc Primitive for receiving response from TA + * @member acGnssResponse Primitive for receiving response from TA + * @member acGnssDistanceCovered Primitive for receiving an indication if requested distance was covered from TA + * @member AcGnssSpeedReached Primitive for receiving an indication if speed was reached + * @member acGnssTimeReached Primitive for receiving an indication if requested time was reached from TA + * @member acSecResponse */ -//FIXME RGY As discussed, Commom adapter control results are collected to a top-level union type type union AdapterControlResults { boolean acGnssResponse, boolean acGnssDistanceCovered, + boolean acGnssSpeedReached, + boolean acGnssTimeReached, boolean acSecResponse } -//FIXME RGY As discussed, boolean results are replaced by related fields of the top-level reult union -// type boolean AcGnssResponse; + /** + * @desc Primitive for receiving response from TA + */ + type AdapterControlResults.acSecResponse AcSecResponse; + type AdapterControlResults.acGnssResponse AcGnssResponse; /** * @desc Primitive for receiving an indication if requested distance was covered from TA */ -//FIXME RGY As discussed, boolean results are replaced by related fields of the top-level reult union -// type boolean AcGnssDistanceCovered; type AdapterControlResults.acGnssDistanceCovered AcGnssDistanceCovered; + /** + * @desc Primitive for receiving an indication if speed was reached + */ + type AdapterControlResults.acGnssSpeedReached AcGnssSpeedReached; + + /** + * @desc Primitive for receiving an indication if requested time was reached from TA + */ + type AdapterControlResults.acGnssTimeReached AcGnssTimeReached; /** * @desc Primitive for loading a scenario @@ -98,8 +109,14 @@ module LibItsCommon_TypesAndValues { type enumerated Scenario { e_staticPosition(0), + e_dynamicPositionTwoAccelerationsLowSpeed(101), + e_dynamicPositionTwoAccelerations(102), + e_dynamicPositionChangeHeading(104), + e_dynamicPositionSixAccelerations(106), e_dynamicPosition200m(200), + e_dynamicPosition250m(250), e_dynamicPosition1000m(1000), + e_dynamicPosition1000m_45ms(1045), e_dynamicPosition1500m(1500) } @@ -122,6 +139,29 @@ module LibItsCommon_TypesAndValues { float distance } + /** + * @desc Defines the check for speed values. + * e_accelerate - speed value should be equal or above the speed value to check + * e_deaccelerate - speed value should be equal or below the speed value to check + * e_fix - speed value should be equal the speed value to check + */ + type enumerated SpeedTrend { + e_accelerate(0), + e_deaccelerate(1), + e_fix(2) + } + with { + variant "8 bits" + } + + /** + * @desc Primitive to inform when speed is reached + */ + type record AcSpeed{ + float speed, + SpeedTrend speedTrend + } + /** * @desc Primitive to change speed in current scenario */ @@ -136,6 +176,13 @@ module LibItsCommon_TypesAndValues { HeadingValue deltaHeading } + /** + * @desc Primitive to inform when given time in the running scenario was reached + */ + type record AcTimeInRunningScenario { + integer time + } + } // end acPrimitives with { encode "AdapterControl" @@ -150,8 +197,8 @@ module LibItsCommon_TypesAndValues { const integer c_its_aid_SPAT := 137; const integer c_its_aid_MAP := 138; const integer c_its_aid_IVI := 139; - const integer c_its_aid_TLC := 140; - const integer c_its_aid_GN := 141; + const integer c_its_aid_TLC := 140; + const integer c_its_aid_GN := 141; const integer c_its_aid_SCR := 623; // Secured Certificate Request, https://standards.ieee.org/products-services/regauth/psid/public.html } } diff --git a/ttcn/Common/LibItsExternal_TypesAndValues.ttcn b/ttcn/Common/LibItsExternal_TypesAndValues.ttcn index ae1654c1..9f8dbfac 100644 --- a/ttcn/Common/LibItsExternal_TypesAndValues.ttcn +++ b/ttcn/Common/LibItsExternal_TypesAndValues.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Common/LibItsExternal_TypesAndValues.ttcn $ + * $Id: LibItsExternal_TypesAndValues.ttcn 1318 2017-01-26 10:20:53Z filatov $ * @desc Module containing types and values for External protocols * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. diff --git a/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn b/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn index 1b737e81..8a4b903e 100644 --- a/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn +++ b/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn @@ -1,49 +1,49 @@ -module LibItsDenm_EncdecDeclarations { - - // LibIts - import from LibItsDenm_TypesAndValues all; - - // LibItsDenm - import from LibItsDenm_TestSystem all; - import from DENM_PDU_Descriptions language "ASN.1:1997" all; - - external function fx_enc_DenmReq (DenmReq p) return bitstring - with {extension "prototype(convert) encode(LibIts_Interface)"} - - external function fx_dec_DenmReq (inout bitstring b, out DenmReq p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_dec_DenmInd (inout bitstring b, out DenmInd p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_enc_DENM (DENM p) return bitstring - with {extension "prototype(convert) encode(PER)"} - - external function fx_dec_DENM (inout bitstring b, out DENM p) return integer - with {extension "prototype(sliding) decode(PER)"} - - external function fx_enc_UtDenmInitialize (UtDenmInitialize p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtDenmChangePosition (UtDenmChangePosition p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtDenmChangePseudonym (UtDenmChangePseudonym p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtDenmTrigger (UtDenmTrigger p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtDenmUpdate (UtDenmUpdate p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtDenmTermination (UtDenmTermination p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_dec_UtDenmResults (inout bitstring b, out UtDenmResults p) return integer - with {extension "prototype(sliding) decode(UpperTester)"} - - external function fx_dec_UtDenmEventInd (inout bitstring b, out UtDenmEventInd p) return integer - with {extension "prototype(sliding) decode(UpperTester)"} - -} // End of module LibItsDenm_EncdecDeclarations +module LibItsDenm_EncdecDeclarations { + + // LibIts + import from LibItsDenm_TypesAndValues all; + + // LibItsDenm + import from LibItsDenm_TestSystem all; + import from DENM_PDU_Descriptions language "ASN.1:1997" all; + + external function fx_enc_DenmReq (DenmReq p) return bitstring + with {extension "prototype(convert) encode(LibIts_Interface)"} + + external function fx_dec_DenmReq (inout bitstring b, out DenmReq p) return integer + with {extension "prototype(sliding) decode(LibIts_Interface)"} + + external function fx_dec_DenmInd (inout bitstring b, out DenmInd p) return integer + with {extension "prototype(sliding) decode(LibIts_Interface)"} + + external function fx_enc_DENM (DENM p) return bitstring + with {extension "prototype(convert) encode(PER)"} + + external function fx_dec_DENM (inout bitstring b, out DENM p) return integer + with {extension "prototype(sliding) decode(PER)"} + + external function fx_enc_UtDenmInitialize (UtDenmInitialize p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + + external function fx_enc_UtDenmChangePosition (UtDenmChangePosition p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + + external function fx_enc_UtDenmChangePseudonym (UtDenmChangePseudonym p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + + external function fx_enc_UtDenmTrigger (UtDenmTrigger p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + + external function fx_enc_UtDenmUpdate (UtDenmUpdate p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + + external function fx_enc_UtDenmTermination (UtDenmTermination p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + + external function fx_dec_UtDenmResults (inout bitstring b, out UtDenmResults p) return integer + with {extension "prototype(sliding) decode(UpperTester)"} + + external function fx_dec_UtDenmEventInd (inout bitstring b, out UtDenmEventInd p) return integer + with {extension "prototype(sliding) decode(UpperTester)"} + +} // End of module LibItsDenm_EncdecDeclarations diff --git a/ttcn/DENM/LibItsDenm_Functions.ttcn b/ttcn/DENM/LibItsDenm_Functions.ttcn index 8665cd9c..0ab20d49 100644 --- a/ttcn/DENM/LibItsDenm_Functions.ttcn +++ b/ttcn/DENM/LibItsDenm_Functions.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF449 / STF484 / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/DENM/LibItsDenm_Functions.ttcn $ + * $Id: LibItsDenm_Functions.ttcn,v 1.5 2018/05/31 15:57:07 dte Exp $ * @desc Module containing functions for DENM * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. @@ -104,18 +104,14 @@ module LibItsDenm_Functions { * @desc Triggers an event from the application layer * @param p_event The event to trigger. */ - function f_utTriggerEvent(template (value) UtDenmTrigger p_event) runs on ItsDenm return ActionID { + function f_utTriggerEvent(in template (value) UtDenmTrigger p_event) runs on ItsDenm return ActionID { var ActionID v_actionId; var UtDenmResults v_result; - - log(">>> f_utTriggerEvent: ", p_event); //deactivate denmPort default alts vc_denmDefaultActive := false; - log("f_utTriggerEvent: Send message"); utPort.send(p_event); - log("f_utTriggerEvent: Wait response"); tc_wait.start; alt { [] utPort.receive(UtDenmResults: { utDenmTriggerResult := ? }) -> value v_result { @@ -241,12 +237,12 @@ module LibItsDenm_Functions { * @desc Initialise secure mode if required */ function f_initialiseSecuredMode( - in charstring p_certificate_id := PX_CERT_FOR_TS + in charstring p_certificateId := PX_CERT_FOR_TS ) runs on ItsDenm { if (PICS_IS_IUT_SECURED == true) { - if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificate_id))) { + if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificateId))) { log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); stop; } @@ -360,12 +356,12 @@ module LibItsDenm_Functions { if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { f_acTriggerGnssEvent(m_distanceToCover(p_distanceToCover)); - tc_ac.start; + tc_ac.start(PX_T_GNSS_AWAIT_DISTANCE_COVERED); alt { - [] acPort.receive(m_acGnssDistanceCovered) { + [] acPort.receive(m_acGnssDistanceCoveredSuccess) { tc_ac.stop; } - [] acPort.receive { + [] acPort.receive(m_acGnssDistanceCoveredError) { tc_ac.stop; log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); f_selfOrClientSyncAndVerdict("error", e_error); @@ -380,17 +376,69 @@ module LibItsDenm_Functions { return v_ret; } // End of function f_acAwaitDistanceCovered + function f_acAwaitSpeed(float p_speed, SpeedTrend p_speedTrend := e_accelerate) runs on ItsDenm return FncRetCode { + var FncRetCode v_ret := e_success; + + if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { + f_acTriggerGnssEvent(m_awaitSpeed(p_speed, p_speedTrend)); + + tc_ac.start(PX_T_GNSS_AWAIT_SPEED_REACHED); + alt { + [] acPort.receive(m_acGnssSpeedReachedSuccess) { + tc_ac.stop; + } + [] acPort.receive(m_acGnssSpeedReachedError) { + tc_ac.stop; + log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] tc_ac.timeout { + log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for covered distance indication ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } + + } + return v_ret; + } // End of function f_acAwaitSpeed + + function f_acAwaitTimeInRunningScenario(integer p_time) runs on ItsDenm return FncRetCode { + var FncRetCode v_ret := e_success; + + if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { + f_acTriggerGnssEvent(m_timeInRunningScenario(p_time)); + + tc_ac.start(int2float(p_time)*1.1); + alt { + [] acPort.receive(m_acGnssTimeReachedSuccess) { + tc_ac.stop; + } + [] acPort.receive(m_acGnssTimeReachedError) { + tc_ac.stop; + log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] tc_ac.timeout { + log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for time reached indication ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } + + } + return v_ret; + } // end f_acAwaitTimeInRunningScenario + } // End of group adapterControl group denmConfigurationFunctions { /** * @desc Setups default configuration - * @param p_certificate_id The certificate identifier the TA shall use in case of secured IUT + * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT */ function f_cfUp( - in charstring p_certificate_id := PX_CERT_FOR_TS - ) runs on ItsDenm /* TITAN TODO: system ItsDenmSystem */ { + in charstring p_certificateId := PX_CERT_FOR_TS + ) runs on ItsDenm system ItsDenmSystem { map(self:acPort, system:acPort); map(self:utPort, system:utPort); @@ -398,14 +446,14 @@ module LibItsDenm_Functions { f_connect4SelfOrClientSync(); // Initialise secured mode - f_initialiseSecuredMode(p_certificate_id); + f_initialiseSecuredMode(p_certificateId); } // End of function f_cfUp /** * @desc Deletes default configuration */ - function f_cfDown() runs on ItsDenm /* TITAN TODO: system ItsDenmSystem */{ + function f_cfDown() runs on ItsDenm system ItsDenmSystem { // Initialise secured mode f_uninitialiseSecuredMode(); @@ -434,6 +482,23 @@ module LibItsDenm_Functions { log("*** " & testcasename() & ": ERROR: Received an unexpected message ***"); f_selfOrClientSyncAndVerdict("error", e_error); } + [] acPort.receive(AdapterControlResults: { acGnssTimeReached := ?}) { + log("*** a_default: INFO: event received on AC port in default ***"); + repeat; + } + [] acPort.receive(AdapterControlResults: { acGnssSpeedReached := ?}) { + log("*** a_default: INFO: event received on AC port in default ***"); + repeat; + } + [] acPort.receive(AdapterControlResults: { acGnssDistanceCovered := ?}) { + log("*** a_default: INFO: event received on AC port in default ***"); + repeat; + } + [] acPort.receive { + tc_ac.stop; + log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } [] tc_wait.timeout { log("*** " & testcasename() & ": INCONC: Timeout while awaiting reaction of the IUT prior to Upper Tester action ***"); f_selfOrClientSyncAndVerdict("error", e_timeout); @@ -484,7 +549,8 @@ module LibItsDenm_Functions { */ function f_prInitialState( in Scenario p_scenario := e_staticPosition, - in template (value) UtDenmInitialize p_denmInitialize := m_denmInitialize + in template (value) UtDenmInitialize p_denmInitialize := m_denmInitialize, + in boolean p_awaitTimeInRunningScenario := true ) runs on ItsDenm return FncRetCode { var FncRetCode v_ret := e_success; @@ -492,7 +558,10 @@ module LibItsDenm_Functions { f_acLoadScenario(valueof(p_scenario)); f_acStartScenario(); - + if (p_awaitTimeInRunningScenario) { + f_acAwaitTimeInRunningScenario(f_getTimeForGpsFix()); + } + f_prDefault(); return v_ret; @@ -554,8 +623,6 @@ module LibItsDenm_Functions { ) ); -//FIXME RGY Titan doesn't support dot notation after valueof at the moment -// return valueof(p_denm.management).actionID; return valueof(p_denm.management.actionID); } diff --git a/ttcn/DENM/LibItsDenm_Pics.ttcn b/ttcn/DENM/LibItsDenm_Pics.ttcn index c49f3d84..42ec0240 100644 --- a/ttcn/DENM/LibItsDenm_Pics.ttcn +++ b/ttcn/DENM/LibItsDenm_Pics.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF449 / STF484 / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/DENM/LibItsDenm_Pics.ttcn $ + * $Id: LibItsDenm_Pics.ttcn 1318 2017-01-26 10:20:53Z filatov $ * @desc DENM PICS * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. diff --git a/ttcn/DENM/LibItsDenm_Pixits.ttcn b/ttcn/DENM/LibItsDenm_Pixits.ttcn index 7ff09890..d9585adc 100644 --- a/ttcn/DENM/LibItsDenm_Pixits.ttcn +++ b/ttcn/DENM/LibItsDenm_Pixits.ttcn @@ -1,21 +1,21 @@ -/** - * @author ETSI / STF449 / STF484 / STF517 - * @version $URL$ - * $Id$ - * @desc Module containing Pixits for DENM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsDenm_Pixits { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibItsSecurity - import from LibItsSecurity_TypesAndValues all; - +/** + * @author ETSI / STF449 / STF484 / STF517 + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/DENM/LibItsDenm_Pixits.ttcn $ + * $Id: LibItsDenm_Pixits.ttcn 1318 2017-01-26 10:20:53Z filatov $ + * @desc Module containing Pixits for DENM + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * + */ +module LibItsDenm_Pixits { + + // LibCommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; + + // LibItsSecurity + import from LibItsSecurity_TypesAndValues all; + } // End of module LibItsDenm_Pixits \ No newline at end of file diff --git a/ttcn/DENM/LibItsDenm_Templates.ttcn b/ttcn/DENM/LibItsDenm_Templates.ttcn index 0898130e..993a6baf 100644 --- a/ttcn/DENM/LibItsDenm_Templates.ttcn +++ b/ttcn/DENM/LibItsDenm_Templates.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF449 / STF484 / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/DENM/LibItsDenm_Templates.ttcn $ + * $Id: LibItsDenm_Templates.ttcn 1318 2017-01-26 10:20:53Z filatov $ * @desc Module containing base template definitions for DENM * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. @@ -84,8 +84,6 @@ module LibItsDenm_Templates { * @param p_gnLifetime GN packet lifetime value (ms) * @param p_gnTrafficClass GN traffic class value */ -//FIXME RGY template restriction can be the same as its base template: used in receiving operations only, where single "omit" is not allowed -// template DenmInd mw_denmIndWithGnParameters ( template(present) DenmInd mw_denmIndWithGnParameters ( template (present) DENM p_denMsg, in template UInt8 p_gnNextHeader := *, @@ -107,7 +105,6 @@ module LibItsDenm_Templates { * @param p_ssp SSP security parameter * @param p_its_aid ITS-AID value */ -//FIXME RGY Titan currently requires the modifyied template to have the same restriction as the base template template (present) DenmInd mw_denmIndWithSecurityParameters( template (present) DENM p_denMsg, template Bit256 p_ssp := *, @@ -123,8 +120,6 @@ module LibItsDenm_Templates { * @param p_btpDestinationPort BTP destination port value * @param p_btpInfo BTP destination port info value (if BTP-B) or BTP source port value (if BTP-A) */ -//FIXME RGY template restriction can be the same as its base template: template is not used currently -// template DenmInd mw_denmIndWithBtpParameters ( template(present) DenmInd mw_denmIndWithBtpParameters ( template (present) DENM p_denMsg, in template UInt16 p_btpDestinationPort := *, @@ -712,8 +707,6 @@ module LibItsDenm_Templates { deltaLongitude := 0, deltaAltitude := 0 }, -//FIXME (DF) pathDeltaTime == 0 is not compatible with PathDeltaTime range definition -// pathDeltaTime := 0 pathDeltaTime := 1 } } diff --git a/ttcn/DENM/LibItsDenm_TestSystem.ttcn b/ttcn/DENM/LibItsDenm_TestSystem.ttcn index d8ff7c38..036800dd 100644 --- a/ttcn/DENM/LibItsDenm_TestSystem.ttcn +++ b/ttcn/DENM/LibItsDenm_TestSystem.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF449 / STF484 / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/DENM/LibItsDenm_TestSystem.ttcn $ + * $Id: LibItsDenm_TestSystem.ttcn 1318 2017-01-26 10:20:53Z filatov $ * @desc Test System module for ITS DENM * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. @@ -37,8 +37,6 @@ module LibItsDenm_TestSystem { out AcGnssPrimitive, AcSecPrimitive; in -//FIXME RGY!!! As discussed, list of booleans is changed by a top-level union type -// AcGnssResponse, AcGnssDistanceCovered, AcSecResponse; AdapterControlResults } // end AdapterControlPort diff --git a/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn b/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn index d94a2d32..eb570b54 100644 --- a/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn +++ b/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF449 / STF484 / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn $ + * $Id: LibItsDenm_TypesAndValues.ttcn 1318 2017-01-26 10:20:53Z filatov $ * @desc Module containing type and value definitions for DENM * */ @@ -55,7 +55,7 @@ module LibItsDenm_TypesAndValues { } // end group denmConstants - group certicicates { + group certificates { const charstring PX_CERT_IUT_DENM_01 := "CERT_IUT_DENM_BO_01_AT"; const charstring PX_CERT_IUT_DENM_02 := "CERT_IUT_DENM_BO_02_AT"; diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_EncdecDeclarations.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_EncdecDeclarations.ttcn index 2cabce69..6ade6909 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_EncdecDeclarations.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_EncdecDeclarations.ttcn @@ -1,47 +1,47 @@ -module LibItsGeoNetworking_EncdecDeclarations { - - import from LibItsGeoNetworking_TypesAndValues all; - import from LibItsGeoNetworking_TestSystem all; - - external function fx_enc_GeoNetworkingReq (GeoNetworkingReq p) return bitstring - with {extension "prototype(convert) encode(LibIts_Interface)"} - - external function fx_dec_GeoNetworkingReq (inout bitstring b, out GeoNetworkingReq p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_enc_GeoNetworkingInd (GeoNetworkingInd p) return bitstring - with {extension "prototype(convert) encode(LibIts_Interface)"} - - external function fx_dec_GeoNetworkingInd (inout bitstring b, out GeoNetworkingInd p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_enc_GeoNetworkingPdu (GeoNetworkingPdu p) return bitstring - with {extension "prototype(convert) encode(LibItsGeoNetworking)"} - - external function fx_dec_GeoNetworkingPdu (inout bitstring b, out GeoNetworkingPdu p) return integer - with {extension "prototype(sliding) decode(LibItsGeoNetworking)"} - - external function fx_enc_GnNonSecuredPacket (GnNonSecuredPacket p) return bitstring - with {extension "prototype(convert) encode(LibItsGeoNetworking)"} - - external function fx_dec_GnNonSecuredPacket (inout bitstring b, out GnNonSecuredPacket p) return integer - with {extension "prototype(sliding) decode(LibItsGeoNetworking)"} - - /* - external function fx_enc_GeoSecuredMessage (GeoNetworkingPacket.securedMsg p) return bitstring - with {extension "prototype(convert) encode(LibItsSecurity)"} - - external function fx_dec_GeoSecuredMessage (inout bitstring b, out GeoNetworkingPacket.securedMsg p) return integer - with {extension "prototype(sliding) decode(LibItsSecurity)"} - */ - - external function fx_enc_UtGnInitialize (UtGnInitialize p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtGnChangePosition (UtGnChangePosition p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtGnTrigger (UtGnTrigger p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - -} // End of module LibItsGeoNetworking_EncdecDeclarations +module LibItsGeoNetworking_EncdecDeclarations { + + import from LibItsGeoNetworking_TypesAndValues all; + import from LibItsGeoNetworking_TestSystem all; + + external function fx_enc_GeoNetworkingReq (GeoNetworkingReq p) return bitstring + with {extension "prototype(convert) encode(LibIts_Interface)"} + + external function fx_dec_GeoNetworkingReq (inout bitstring b, out GeoNetworkingReq p) return integer + with {extension "prototype(sliding) decode(LibIts_Interface)"} + + external function fx_enc_GeoNetworkingInd (GeoNetworkingInd p) return bitstring + with {extension "prototype(convert) encode(LibIts_Interface)"} + + external function fx_dec_GeoNetworkingInd (inout bitstring b, out GeoNetworkingInd p) return integer + with {extension "prototype(sliding) decode(LibIts_Interface)"} + + external function fx_enc_GeoNetworkingPdu (GeoNetworkingPdu p) return bitstring + with {extension "prototype(convert) encode(LibItsGeoNetworking)"} + + external function fx_dec_GeoNetworkingPdu (inout bitstring b, out GeoNetworkingPdu p) return integer + with {extension "prototype(sliding) decode(LibItsGeoNetworking)"} + + external function fx_enc_GnNonSecuredPacket (GnNonSecuredPacket p) return bitstring + with {extension "prototype(convert) encode(LibItsGeoNetworking)"} + + external function fx_dec_GnNonSecuredPacket (inout bitstring b, out GnNonSecuredPacket p) return integer + with {extension "prototype(sliding) decode(LibItsGeoNetworking)"} + + /* + external function fx_enc_GeoSecuredMessage (GeoNetworkingPacket.securedMsg p) return bitstring + with {extension "prototype(convert) encode(LibItsSecurity)"} + + external function fx_dec_GeoSecuredMessage (inout bitstring b, out GeoNetworkingPacket.securedMsg p) return integer + with {extension "prototype(sliding) decode(LibItsSecurity)"} + */ + + external function fx_enc_UtGnInitialize (UtGnInitialize p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + + external function fx_enc_UtGnChangePosition (UtGnChangePosition p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + + external function fx_enc_UtGnTrigger (UtGnTrigger p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + +} // End of module LibItsGeoNetworking_EncdecDeclarations diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn index 9ceab881..c7389292 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn @@ -1,2853 +1,2844 @@ -/** - * @author ETSI / STF405 / STF449 / STF484 / STF517 / STF525 - * @version $URL$ -* $Id$ - * @desc Module containing functions for GeoNetworking - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsGeoNetworking_Functions { - - // Libcommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - import from LibCommon_VerdictControl all; - import from LibCommon_Sync all; - import from LibCommon_Time all; - - // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - import from LibItsExternal_TypesAndValues all; - import from LibItsCommon_Templates all; - import from LibItsCommon_Functions all; - import from LibItsCommon_Pixits all; - // import from LibItsCommon_TestSystem 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_TypesAndValues all; - import from LibItsGeoNetworking_Templates all; - import from LibItsGeoNetworking_Pixits all; - import from LibItsGeoNetworking_Pics all; - // import from LibItsGeoNetworking_EncdecDeclarations all; - - group utFuntions { - - /** - * @desc Requests to bring the IUT in an initial state - * @param p_init The initialisation to trigger. - */ - function f_utInitializeIut(template (value) UtGnInitialize p_init) runs on ItsBaseGeoNetworking { - - //deactivate gnPort default alts - vc_gnDefaultActive := false; - - utPort.send(p_init); - tc_wait.start; - alt { - [] utPort.receive(UtGnResults: { utGnInitializeResult := true }) { - tc_wait.stop; - log("*** f_utInitializeIut: INFO: IUT initialized ***"); - } - [] utPort.receive { - tc_wait.stop; - log("*** f_utInitializeIut: INFO: IUT could not be initialized ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_wait.timeout { - log("*** f_utInitializeIut: INFO: IUT could not be initialized in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //activate gnPort default alts - vc_gnDefaultActive := true; - - } - - /** - * @desc Requests to change the position of the IUT - */ - function f_utChangePosition() runs on ItsBaseGeoNetworking { - - //deactivate gnPort default alts - vc_gnDefaultActive := false; - - utPort.send(m_changePosition); - tc_wait.start; - alt { - [] utPort.receive(UtGnResults: { utGnChangePositionResult := true} ) { - tc_wait.stop; - log("*** f_utChangePosition: INFO: IUT position changed ***"); - } - [] utPort.receive(UtGnResults: { utGnChangePositionResult := false }) { - tc_wait.stop; - log("*** f_utChangePosition: INFO: IUT position change was not successful ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] a_utDefault() { - } - [] tc_wait.timeout { - log("*** f_utChangePosition: INFO: IUT position not changed in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //activate gnPort default alts - vc_gnDefaultActive := true; - - } - - /** - * @desc Triggers event from the application layer - * @param p_event The event to trigger. - */ - function f_utTriggerEvent(template (value) UtGnTrigger p_event) runs on ItsBaseGeoNetworking return boolean { - - // Variables - var boolean v_return := true; - - //deactivate gnPort default alts - vc_gnDefaultActive := false; - - utPort.send(p_event); - tc_wait.start; - alt { - [] utPort.receive(UtGnResults: { utGnTriggerResult := true }) { - tc_wait.stop; - } - [] utPort.receive(UtGnResults: { utGnTriggerResult := false }) { - tc_wait.stop; - log("*** UtGnTriggerResult: INFO: UT trigger was not successful ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] a_utDefault() { - } - [] tc_wait.timeout { - v_return := false; - } - } - - //activate gnPort default alts - vc_gnDefaultActive := true; - - return v_return; - } - - } // End of group utFunctions - - group geoConfigurationFunctions { - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - two ITS nodes (nodeA, nodeB) - * - Area1 which only includes NodeB and IUT - * - Area2 which only includes NodeB - * NodeB being close to the area center - */ - //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf01Up(Scenario p_scenario := e_staticPosition) runs on ItsGeoNetworking system ItsGeoNetworkingSystem { - - // Variables - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - - // Map - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - map(self:geoNetworkingPort, system:geoNetworkingPort); - - // Connect - f_connect4SelfOrClientSync(); - activate(a_cf01Down()); - - // Initialise secured mode - f_initialiseSecuredMode(); - - //Initialze the IUT - f_initialState(p_scenario); - - // Positions & Areas - f_preparePositionsAndAreas(v_positionTable, v_areaTable); - - f_initialiseComponent(v_positionTable, v_areaTable, c_compNodeB); - - } // end f_cf01Up - - //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf01Down() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { - - f_uninitialiseSecuredMode(); - - // Unmap - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - unmap(self:geoNetworkingPort, system:geoNetworkingPort); - - // Disconnect - f_disconnect4SelfOrClientSync(); - - } // end f_cf01Down - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - one ITS node (NodeB) - * - one ITS node (NodeD) - * - Area1 which only includes NodeB, NodeD and IUT - * - Area2 which only includes NodeB and NodeD - * NodeB being close to the area center - * - * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages - */ - - //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf02Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Variables - var LongPosVector v_longPosVectorIut := valueof(m_dummyLongPosVector); - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - var ItsGeoNetworking v_component; - var integer i; - - // Select components - vc_componentTable := {{c_compNodeB, omit}, {c_compNodeD, omit}}; - - // Create components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; - } - - // Map & Connect - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - connect(self:syncPort, mtc:syncPort); - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - map(vc_componentTable[i].gnComponent:acPort, system:acPort); - map(vc_componentTable[i].gnComponent:utPort, system:utPort); - map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - - activate(a_cf02Down()); - - //Initialze the IUT - if(p_mainUtComponent == c_compMTC) { - // Initialise secured mode - f_initialiseSecuredMode(); - - // MTC intializes IUT - f_initialState(p_scenario); - } - else { - v_component := f_getComponent(p_mainUtComponent); - v_component.start(f_initialState(p_scenario)); - v_component.done; - } - - // Positions & Areas - vc_componentTable[0].gnComponent.start(f_getIutLongPosVector_1(v_longPosVectorIut)); // Get positions - vc_componentTable[0].gnComponent.done; - // TODO Check value of v_longPosVectorIut after the done, seems to be reseted to dummy value - f_preparePositionsAndAreas(v_positionTable, v_areaTable, v_longPosVectorIut); - - // Initialize components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); - } - } - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.done; - } - } - - } // end f_cf02Up - - /** - * @desc Deletes configuration cf02 - */ - - //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf02Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Local variables - var integer i; - - f_uninitialiseSecuredMode(); - - // Unmap & Disconnect - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); - unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); - unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - disconnect(self:syncPort, mtc:syncPort); - - } // end f_cf02Down - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - one ITS node (NodeA) - * - one ITS node in direction of NodeA (NodeB) - * - one ITS node not in direction of NodeA (NodeC) - * - Area1 which only includes NodeB and IUT - * - Area2 which only includes NodeB - * NodeB being close to the area center - * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages - */ - //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf03Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Variables - var LongPosVector v_longPosVectorIut := valueof(m_dummyLongPosVector); - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - var ItsGeoNetworking v_component; - var integer i; - - // Select components - vc_componentTable := {{c_compNodeB, omit}, {c_compNodeC, omit}}; - - // Create components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; - } - - // Map & Connect - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - connect(self:syncPort, mtc:syncPort); - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - map(vc_componentTable[i].gnComponent:acPort, system:acPort); - map(vc_componentTable[i].gnComponent:utPort, system:utPort); - map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - - activate(a_cf03Down()); - - //Initialze the IUT - if(p_mainUtComponent == c_compMTC) { - // Initialise secured mode - f_initialiseSecuredMode(); - - // MTC intializes IUT - f_initialState(p_scenario); - } - else { - v_component := f_getComponent(p_mainUtComponent); - v_component.start(f_initialState(p_scenario)); - v_component.done; - } - - // Positions & Areas - vc_componentTable[0].gnComponent.start(f_getIutLongPosVector_1(v_longPosVectorIut)); // Get positions - vc_componentTable[0].gnComponent.done; - f_preparePositionsAndAreas(v_positionTable, v_areaTable, v_longPosVectorIut); - - // Initialize components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); - } - } - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.done; - } - } - - } // end f_cf03Up - - /** - * @desc Deletes configuration cf03 - */ - - //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf03Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Local variables - var integer i; - - f_uninitialiseSecuredMode(); - - // Unmap & Disconnect - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); - unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); - unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - disconnect(self:syncPort, mtc:syncPort); - - } // end f_cf03Down - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - one ITS node (NodeA) - * - one ITS node in direction of NodeA and having - * shortest distance to NodeA (NodeB) - * - one ITS node in direction of NodeA (NodeD) - * - one ITS node not in direction of NodeA (NodeC) - * - Area1 which only includes NodeB, NodeD and IUT - * - Area2 which only includes NodeA, NodeB and NodeD - * NodeB being close to the area center - * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages - */ - - //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf04Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Variables - var LongPosVector v_longPosVectorIut := valueof(m_dummyLongPosVector); - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - var ItsGeoNetworking v_component; - var integer i; - - // Select components - vc_componentTable := {{c_compNodeB, omit}, {c_compNodeC, omit}, {c_compNodeD, omit}}; - - // Create components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; - } - - // Map & Connect - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - connect(self:syncPort, mtc:syncPort); - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - map(vc_componentTable[i].gnComponent:acPort, system:acPort); - map(vc_componentTable[i].gnComponent:utPort, system:utPort); - map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - - activate(a_cf04Down()); - - //Initialze the IUT - if(p_mainUtComponent == c_compMTC) { - // Initialise secured mode - f_initialiseSecuredMode(); - - // MTC intializes IUT - f_initialState(p_scenario); - } - else { - v_component := f_getComponent(p_mainUtComponent); - v_component.start(f_initialState(p_scenario)); - v_component.done; - } - - // Positions & Areas - vc_componentTable[0].gnComponent.start(f_getIutLongPosVector_1(v_longPosVectorIut)); // Get positions - vc_componentTable[0].gnComponent.done; - f_preparePositionsAndAreas(v_positionTable, v_areaTable, v_longPosVectorIut); - - // Initialize components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); - } - } - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.done; - } - } - - } // end f_cf04Up - - /** - * @desc Deletes configuration cf04 - */ - - //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf04Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Local variables - var integer i; - - f_uninitialiseSecuredMode(); - - // Unmap & Disconnect - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); - unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); - unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - disconnect(self:syncPort, mtc:syncPort); - - } // end f_cf04Down - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - one ITS node (NodeB) - * - one ITS node not in direction of NodeB and having - * longest distance to NodeB (NodeE) - * - Area1 which only includes NodeB, NodeD and IUT - * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages - */ - - //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf05Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Variables - var LongPosVector v_longPosVectorIut := valueof(m_dummyLongPosVector); - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - var ItsGeoNetworking v_component; - var integer i; - - // Select components - vc_componentTable := {{c_compNodeB, omit}, {c_compNodeE, omit}}; - - // Create components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; - } - - // Map & Connect - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - connect(self:syncPort, mtc:syncPort); - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - map(vc_componentTable[i].gnComponent:acPort, system:acPort); - map(vc_componentTable[i].gnComponent:utPort, system:utPort); - map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - - activate(a_cf05Down()); - - //Initialze the IUT - if(p_mainUtComponent == c_compMTC) { - // Initialise secured mode - f_initialiseSecuredMode(); - - // MTC intializes IUT - f_initialState(p_scenario); - } - else { - v_component := f_getComponent(p_mainUtComponent); - v_component.start(f_initialState(p_scenario)); - v_component.done; - } - - // Positions & Areas - vc_componentTable[0].gnComponent.start(f_getIutLongPosVector_1(v_longPosVectorIut)); // Get positions - vc_componentTable[0].gnComponent.done; - f_preparePositionsAndAreas(v_positionTable, v_areaTable, v_longPosVectorIut); - - // Initialize components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); - } - } - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.done; - } - } - } - - /** - * @desc Deletes configuration cf05 - */ - - //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf05Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Local variables - var integer i; - - f_uninitialiseSecuredMode(); - - // Unmap & Disconnect - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); - unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); - unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - disconnect(self:syncPort, mtc:syncPort); - - } // end f_cf05Down - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - one ITS node (NodeB) - * - one ITS node not in direction of NodeB and having - * shortest distance to NodeB (NodeF) - * - Area1 which only includes NodeB, NodeD and IUT - * - IUT not in sectorial area of NodeB-NodeF - * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages - */ - //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf06Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Variables - var LongPosVector v_longPosVectorIut := valueof(m_dummyLongPosVector); - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - var ItsGeoNetworking v_component; - var integer i; - - // Select components - vc_componentTable := {{c_compNodeB, omit}, {c_compNodeF, omit}}; - - // Create components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; - } - - // Map & Connect - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - connect(self:syncPort, mtc:syncPort); - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - map(vc_componentTable[i].gnComponent:acPort, system:acPort); - map(vc_componentTable[i].gnComponent:utPort, system:utPort); - map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - - activate(a_cf06Down()); - - //Initialze the IUT - if(p_mainUtComponent == c_compMTC) { - // Initialise secured mode - f_initialiseSecuredMode(); - - // MTC intializes IUT - f_initialState(p_scenario); - } - else { - v_component := f_getComponent(p_mainUtComponent); - v_component.start(f_initialState(p_scenario)); - v_component.done; - } - - // Positions & Areas - vc_componentTable[0].gnComponent.start(f_getIutLongPosVector_1(v_longPosVectorIut)); // Get positions - vc_componentTable[0].gnComponent.done; - f_preparePositionsAndAreas(v_positionTable, v_areaTable, v_longPosVectorIut); - - // Initialize components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); - } - } - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.done; - } - } - } - - /** - * @desc Deletes configuration cf06 - */ - - //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf06Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Local variables - var integer i; - - f_uninitialiseSecuredMode(); - - // Unmap & Disconnect - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); - unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); - unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - disconnect(self:syncPort, mtc:syncPort); - - } // end f_cf06Down - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - one ITS node (NodeB) - * - one ITS node in direction of NodeB and having - * shortest distance to NodeB (NodeD) - * - Area1 which only includes NodeB, NodeD and IUT - * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages - */ - - //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf07Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Variables - var LongPosVector v_longPosVectorIut := valueof(m_dummyLongPosVector); - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - var ItsGeoNetworking v_component; - var integer i; - - // Select components - vc_componentTable := {{c_compNodeB, omit}, {c_compNodeD, omit}}; - - // Create components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; - } - - // Map & Connect - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - connect(self:syncPort, mtc:syncPort); - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - map(vc_componentTable[i].gnComponent:acPort, system:acPort); - map(vc_componentTable[i].gnComponent:utPort, system:utPort); - map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - - activate(a_cf07Down()); - - //Initialze the IUT - if(p_mainUtComponent == c_compMTC) { - // Initialise secured mode - f_initialiseSecuredMode(); - - // MTC intializes IUT - f_initialState(p_scenario); - } - else { - v_component := f_getComponent(p_mainUtComponent); - v_component.start(f_initialState(p_scenario)); - v_component.done; - } - - // Positions & Areas - vc_componentTable[0].gnComponent.start(f_getIutLongPosVector_1(v_longPosVectorIut)); // Get positions - vc_componentTable[0].gnComponent.done; - f_preparePositionsAndAreas(v_positionTable, v_areaTable, v_longPosVectorIut); - - // Initialize components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); - } - } - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.done; - } - } - } - - /** - * @desc Deletes configuration cf06 - */ - //FIXME RGY Titan doesn't support mtc and system clauses yet - function f_cf07Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Local variables - var integer i; - - f_uninitialiseSecuredMode(); - - // Unmap & Disconnect - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); - unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); - unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - disconnect(self:syncPort, mtc:syncPort); - - } // end f_cf07Down - - /** - * @desc Behavior function for initializing component's variables and tables - * @param p_positionTable Table containing position vectors of all nodes - * @param p_areaTable Table containing all defined geoAreas - * @param p_componentName Name of the component - */ - function f_initialiseComponent( - in PositionTable p_positionTable, - in GeoAreaTable p_areaTable, - in charstring p_componentName) - runs on ItsGeoNetworking { - - vc_positionTable := p_positionTable; - vc_areaTable := p_areaTable; - vc_componentName := p_componentName; - - vc_localSeqNumber := f_getInitialSequenceNumber(); - vc_multipleMessagesCount := f_getMessageCount(); - - } // end f_initialiseComponent - - /** - * @desc Makes the simulated ITS node behave as a neighbour of IUT - */ - function f_startBeingNeighbour() runs on ItsGeoNetworking { - - vc_neighbourDefault := activate(a_neighbourDefault()); - f_acTriggerEvent(m_startBeaconing(m_beaconHeader(f_getPosition(vc_componentName)).beaconHeader)); - f_sleepIgnoreDef(PX_NEIGHBOUR_DISCOVERY_DELAY); - } // end f_startBeingNeighbour - - /** - * @desc Makes the simulated ITS node behave as not being a neighbour of IUT - */ - function f_stopBeingNeighbour() runs on ItsGeoNetworking { - - f_acTriggerEvent(m_stopBeaconing); - if (PICS_GN_SECURITY == true) { - deactivate(vc_neighbourDefault); - } - } // end f_stopBeingNeighbour - - /** - * @desc Initialise secure mode if required - */ - function f_initialiseSecuredMode() runs on ItsBaseGeoNetworking { - - // Local variables - - // Load certificates - if (PICS_GN_SECURITY == true) { - if( not f_loadCertificates(PX_IUT_SEC_CONFIG_NAME) ) { - log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); - stop; - } - - // Initialize vc_location - f_setGenerationLocation( - f_getTsLatitude(), - f_getTsLongitude() - ); - } else if (PICS_IS_IUT_SECURED == true) { - if(e_success != f_acEnableSecurity()){ - log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); - stop; - } - } - } // End of function f_initialiseSecuredMode() - - function f_uninitialiseSecuredMode() runs on ItsBaseGeoNetworking { - if ((PICS_GN_SECURITY == true) or (PICS_IS_IUT_SECURED == true)) { - f_acDisableSecurity(); - } - } // End of function f_uninitialiseSecuredMode() - - } // end geoConfigurationFunctions - - group componentFunctions { - /** - * @desc Get the component corresponding to a key - * @param p_componentName Name searched component - * @return ItsGeoNetworking - The searched position vector - */ - function f_getComponent( - in charstring p_componentName - ) runs on ItsMtc - return ItsGeoNetworking { - - var ItsGeoNetworking v_return := null; - var integer i := 0; - - for (i:=0; i value v_ind { - //store every upper tester indication received - vc_utInds[lengthof(vc_utInds)] := v_ind; - repeat; - } - [vc_utDefaultActive] utPort.receive { - log("*** " & testcasename() & ": INFO: Received unexpected UT message from IUT ***"); - repeat; - } - } - - /** - * @desc Default handling cf01 de-initialisation. - */ - altstep a_cf01Down() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { - [] a_shutdown() { - f_poDefault(); - f_cf01Down(); - log("*** a_cf01Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc Default handling cf02 de-initialisation. - */ - altstep a_cf02Down() runs on ItsMtc system ItsGeoNetworkingSystem { - [] a_shutdown() { - f_cf02Down(); - log("*** a_cf02Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc Default handling cf03 de-initialisation. - */ - altstep a_cf03Down() runs on ItsMtc system ItsGeoNetworkingSystem { - [] a_shutdown() { - f_cf03Down(); - log("*** a_cf03Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc Default handling cf04 de-initialisation. - */ - altstep a_cf04Down() runs on ItsMtc system ItsGeoNetworkingSystem { - [] a_shutdown() { - f_cf04Down(); - log("*** a_cf04Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc Default handling cf05 de-initialisation. - */ - altstep a_cf05Down() runs on ItsMtc system ItsGeoNetworkingSystem { - [] a_shutdown() { - f_cf05Down(); - log("*** a_cf05Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc Default handling cf06 de-initialisation. - */ - altstep a_cf06Down() runs on ItsMtc system ItsGeoNetworkingSystem { - [] a_shutdown() { - f_cf06Down(); - log("*** a_cf06Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc Default handling cf07 de-initialisation. - */ - altstep a_cf07Down() runs on ItsMtc system ItsGeoNetworkingSystem { - [] a_shutdown() { - f_cf07Down(); - log("*** a_cf07Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - group geoGeoUnicastAltsteps { - - /** - * @desc Receive GeoUnicast packet - * @param p_sourceLongPosVec Expected source position vector - * @param p_destinationShortPosVec Expected destination position vector - * @param p_seqNumber Expected sequence number - */ - altstep a_receiveGeoUnicast( - in template (present) ShortPosVector p_destinationShortPosVec, - in template (present) UInt16 p_seqNumber - ) runs on ItsGeoNetworking { - - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwUnicastPacket( - p_destinationShortPosVec, - p_seqNumber)))) { - } - } - - /** - * @desc Receive GeoUnicast packet for specific destination - * @param p_destinationShortPosVec Expected destination position vector - */ - altstep a_receiveGeoUnicastWithDestination(in template (present) ShortPosVector p_destinationShortPosVec) runs on ItsGeoNetworking { - - [vc_gnDefaultActive] a_receiveGeoUnicast(p_destinationShortPosVec, ?) {} - } - - /** - * @desc Receive any GeoUnicast packet - */ - altstep a_receiveAnyGeoUnicast() runs on ItsGeoNetworking { - - [vc_gnDefaultActive] a_receiveGeoUnicast(?, ?) {} - } - - } // end geoGeoUnicastAltsteps - - group geoGeoBroadcastAltsteps { - - /** - * @desc Receive GeoBroadcast packet - * @param p_srcLongPosVec Expected source position vector - * @param p_seqNumber Expected sequence number - */ - altstep a_receiveGeoBroadcast( - in template (present) LongPosVector p_srcLongPosVec, - in template (present) UInt16 p_seqNumber - ) runs on ItsGeoNetworking { - - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacket( - p_srcLongPosVec, - p_seqNumber - )))) { - } - } - - /** - * @desc Receive GeoBroadcast packet with specific Area and HopLimit - * @param p_srcLongPosVec Expected source position vector - * @param p_seqNumber Expected sequence number - * @param p_broadcastArea Expected geoBroadcastArea - * @param p_routerHopLimit Expected router hop limit - * @param p_maxHopLimit Expected max hop limit (Default: ?) - */ - altstep a_receiveGeoBroadcastWithAreaWithHopLimit( - in template (present) LongPosVector p_srcLongPosVec, - in template (present) UInt16 p_seqNumber, - in template (present) GeoBroadcastArea p_broadcastArea, - in template (present) UInt8 p_routerHopLimit, - in template (present) UInt8 p_maxHopLimit := ? - ) runs on ItsGeoNetworking { - - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithAreaAndHl( - p_srcLongPosVec, - p_seqNumber, - p_broadcastArea, - p_maxHopLimit - ), - -, - p_routerHopLimit - ))) { - } - } - - /** - * @desc Receive GeoBroadcast packet for specific Geobroadcast Area - * @param p_srcLongPosVec Expected source position vector - * @param p_seqNumber Expected sequence number - * @param p_broadcastArea Expected geoBroadcastArea - */ - altstep a_receiveGeoBroadcastWithArea( - in template (present) LongPosVector p_srcLongPosVec, - in template (present) UInt16 p_seqNumber, - in template (present) GeoBroadcastArea p_broadcastArea - ) runs on ItsGeoNetworking { - - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( - p_srcLongPosVec, - p_seqNumber, - p_broadcastArea - )))) { - } - } - - } // end geoGeoBroadcastAltsteps - - group geoGeoAnycastAltsteps { - - /** - * @desc Receive GeoAnycast packet - * @param p_srcLongPosVec Expected source position vector - * @param p_senderLongPosVec Expected sender position vector - * @param p_seqNumber Expected sequence number - */ - altstep a_receiveGeoAnycast( - in template (present) LongPosVector p_srcLongPosVec, - in template (present) LongPosVector p_senderLongPosVec, - in template (present) UInt16 p_seqNumber - ) runs on ItsGeoNetworking { - - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacket( - p_srcLongPosVec, - p_seqNumber - )))) { - } - } - - /** - * @desc Receive GeoAnycast packet with specific Area and HopLimit - * @param p_srcLongPosVec Expected source position vector - * @param p_senderLongPosVec Expected sender position vector - * @param p_seqNumber Expected sequence number - * @param p_anycastArea Expected geoAnycastArea - * @param p_hopLimit Expected hop limit - * @param p_maxHopLimit Expected max hop limit (Default: ?) - */ - altstep a_receiveGeoAnycastWithAreaWithHopLimit( - in template (present) LongPosVector p_srcLongPosVec, - in template (present) UInt16 p_seqNumber, - in template (present) GeoAnycastArea p_anycastArea, - in template (present) UInt8 p_hopLimit, - in template (present) UInt8 p_maxHopLimit := ? - ) runs on ItsGeoNetworking { - - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( - p_srcLongPosVec, - p_seqNumber, - p_anycastArea - ), - -, - p_hopLimit - ))) { - } - } - - /** - * @desc Receive GeoAnycast packet for specific GeoAnycast Area - * @param p_srcLongPosVec Expected source position vector - * @param p_seqNumber Expected sequence number - * @param p_anycastArea Expected geoAnycastArea - */ - altstep a_receiveGeoAnycastWithArea( - in template (present) LongPosVector p_srcLongPosVec, - in template (present) UInt16 p_seqNumber, - in template (present) GeoAnycastArea p_anycastArea - ) runs on ItsGeoNetworking { - - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( - p_srcLongPosVec, - p_seqNumber, - p_anycastArea - )))) { - } - } - - } // end geoGeoAnycastAltsteps - - group geoLocationServiceAltsteps { - - /** - * @desc Receive Location Service Request - * @param p_seqNumber Expected sequence number of the received LS Request - * @param p_mid GN address expected in received LS Request - * @param p_reqSrcPosVector Expected source position vector of the received LS Request - */ - altstep a_receiveLsRequest( - in template (present) UInt16 p_seqNumber, - in template (present) GN_Address.mid p_mid, - out LongPosVector p_reqSrcPosVector - ) runs on ItsGeoNetworking { - var GeoNetworkingInd v_msg; - - [vc_gnDefaultActive] geoNetworkingPort.receive( - mw_geoNwInd( - mw_geoNwPdu( - mw_geoNwLsRequestPacket( - p_seqNumber, - p_mid - ) - ) - ) - ) -> value v_msg { - p_reqSrcPosVector := valueof(v_msg.msgIn.gnPacket.packet.extendedHeader.lsRequestHeader.srcPosVector); - } - } - - /** - * @desc Receive any Location Service Request - */ - altstep a_receiveAnyLsRequest() runs on ItsGeoNetworking { - var LongPosVector v_reqSrcPosVector; - - [vc_gnDefaultActive] a_receiveLsRequest(?, ?, v_reqSrcPosVector) {} - } - - /** - * @desc Receive any Location Service Reply - */ - altstep a_receiveAnyLsReply() runs on ItsGeoNetworking { - [vc_gnDefaultActive] geoNetworkingPort.receive( mw_geoNwInd( mw_geoNwPdu( mw_geoNwLsReplyPacket(?, ?) ))) { - //ignore and repeat - repeat; - } - } - - /** - * @desc Receive Location Service Request and send Location Service Reply - * @param p_reqSeqNumber Expected sequence number of the received LS Request - * @param p_gnAddress GN address expected in received LS Request - * @param p_repSrcPosVector Source position vector of the sent LS Response - * @param p_repSenderPosVector Sender position vector of the sent LS Response - */ - altstep a_receiveLsRequestAndReply( - in template (present) UInt16 p_reqSeqNumber, - in template (value) GN_Address.mid p_mid, - in template (value) LongPosVector p_repSrcPosVector, - in template (value) LongPosVector p_repSenderPosVector - ) runs on ItsGeoNetworking { - var LongPosVector v_repDstPosVector; - - [vc_gnDefaultActive] a_receiveLsRequest(p_reqSeqNumber, p_mid, v_repDstPosVector) { - f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(m_geoNwPdu( - m_geoNwLsReplyPacket( - p_repSrcPosVector, - f_longPosVector2ShortPosVector(v_repDstPosVector), - vc_localSeqNumber - ))))); - } - } - - } // end geoLocationServiceAltsteps - - - } // end geoAltsteps - - group preambles { - - /** - * @desc The default preamble. - */ - function f_prDefault() runs on ItsGeoNetworking { - activate(a_default()); - activate(a_utDefault()); - } - - /** - * @desc Preamble for non-neighbour nodes - */ - function f_prNonNeighbour() runs on ItsGeoNetworking { - f_prDefault(); - } - - /** - * @desc Preamble for neighbour nodes - */ - function f_prNeighbour() runs on ItsGeoNetworking { - f_prDefault(); - f_startBeingNeighbour(); - } - - /** - * @desc Brings the IUT into an initial state. - * @remark Component variable vc_hashedId8ToBeUsed shall be set with the IUT certificate to be used - */ - function f_initialState(Scenario p_scenario := e_staticPosition) runs on ItsBaseGeoNetworking { - - if (PICS_GN_SECURITY) { - var Oct8 v_hashedId8ToBeUsed := f_setupIutCertificate(vc_hashedId8ToBeUsed); - if (oct2int(v_hashedId8ToBeUsed) == 0) { - v_hashedId8ToBeUsed := 'FFFFFFFFFFFFFFFF'O; // Reset to unknown value, the IUT will use its own certificates - } - f_utInitializeIut(m_secGnInitialize(v_hashedId8ToBeUsed)); - } // else, default behavior - else { - f_utInitializeIut(m_gnInitialize); - } - f_sleep(PX_NEIGHBOUR_DISCOVERY_DELAY); - - f_acLoadScenario(p_scenario); - f_acStartScenario(); - } - - /** - * @desc Receive and reply to LS Requests - * @param p_reqSeqNumber Expected sequence number of the received LS Request - * @param p_gnAddress GN address expected in received LS Request - * @param p_repSrcPosVector Source position vector of the sent LS Response - * @param p_repSenderPosVector Sender position vector of the sent LS Response - */ - function f_handleLocationService( - in template (present) UInt16 p_reqSeqNumber, - in template (value) GN_Address.mid p_mid, - in template (value) LongPosVector p_repSrcPosVector, - in template (value) LongPosVector p_repSenderPosVector - ) runs on ItsGeoNetworking { - - tc_ac.start; - alt { - [] a_receiveLsRequestAndReply(p_reqSeqNumber, p_mid, p_repSrcPosVector, p_repSenderPosVector) { - tc_ac.stop; - } - } - - } - - /** - * @desc Send LS request and receive LS Reply - * @param p_reqSrcPosVector Source position vector of the sent LS Request - * @param p_reqSeqNumber Sequence number of the sent LS Request - * @param p_gnAddress GN address for which the LS Request is sent - * @param p_repSrcPosVector Expected source position vector in received LS Response - * @return FncRetCode - */ - function f_processLocationService( - in template (value) LongPosVector p_reqSrcPosVector, - in template (value) UInt16 p_reqSeqNumber, - in template (value) GN_Address p_gnAddress, - out LongPosVector p_repSrcPosVector - ) runs on ItsGeoNetworking return FncRetCode { - var FncRetCode v_ret := e_error; - var GeoNetworkingInd v_msg; - - f_sendGeoNetMessage( - valueof( - m_geoNwReq_linkLayerBroadcast( - m_geoNwPdu( - m_geoNwLsRequestPacket( - p_reqSrcPosVector, - p_reqSeqNumber, - p_gnAddress - ) - ) - ) - ) - ); - - tc_ac.start; - alt { - [] geoNetworkingPort.receive( - mw_geoNwInd( - mw_geoNwPdu( - mw_geoNwLsReplyPacket( - ?, - mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(valueof(p_reqSrcPosVector))) - ) - ) - ) - ) -> value v_msg { - tc_ac.stop; - p_repSrcPosVector := valueof(v_msg.msgIn.gnPacket.packet.extendedHeader.lsReplyHeader.srcPosVector); - v_ret := e_success; - } - } - - return v_ret; - } - - } // end preambles - - group postambles { - - /** - * @desc The default postamble. - */ - function f_poDefault() runs on ItsGeoNetworking { - f_acStopScenario(); - } - - /** - * @desc Postamble for neighbour nodes - */ - function f_poNeighbour() runs on ItsGeoNetworking { - f_stopBeingNeighbour(); - f_poDefault(); - } - - } // end postambles - - group adapterControl { - - /** - * @desc Triggers event in the test system adaptation. - * @param p_event The event to trigger - * @return FncRetCode - */ - function f_acTriggerEvent(template (value) AcGnPrimitive p_event) runs on ItsBaseGeoNetworking return FncRetCode { - var FncRetCode v_ret := e_success; - - acPort.send(p_event); - - return v_ret; - } - - /** - * @desc Get the position vector corresponding to a specific GN address - * @param p_gnAddress GN address for which the search is performed - * @return LongPosVector - IUT's position - */ - function f_acGetLongPosVector(GN_Address p_gnAddress) runs on ItsBaseGeoNetworking return LongPosVector { - var AcGnResponse v_result; - - f_acTriggerEvent(m_getLongPosVector(p_gnAddress)); - tc_ac.start; - alt { - [] acPort.receive(mw_getLongPosVectorAny(p_gnAddress)) -> value v_result { - tc_ac.stop; - } - [] acPort.receive { - tc_ac.stop; - log("*** f_acGetLongPosVector: ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** f_acGetLongPosVector: ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - return v_result.getLongPosVector; - } - - /** - * @desc Triggers test adapter to send beacons for multiple neighbours - * @param p_numberOfNeighbour Number of neighbours to simulate - * @return FncRetCode - */ - function f_acStartBeaconingMultipleNeighbour(in integer p_numberOfNeighbour) runs on ItsGeoNetworking return FncRetCode { - - return f_acTriggerEvent(m_startBeaconingMultipleNeighbour(m_beaconHeader(f_getPosition(vc_componentName)).beaconHeader, p_numberOfNeighbour)); - - } - - /** - * @desc Triggers test adapter to enable security support - * @return FncRetCode - */ - function f_acEnableSecurity() runs on ItsBaseGeoNetworking return FncRetCode { - return f_acTriggerSecEvent(m_acEnableSecurity(PX_CERT_FOR_TS)); - } - - /** - * @desc Triggers test adapter to disable security support - * @return FncRetCode - */ - function f_acDisableSecurity() runs on ItsBaseGeoNetworking return FncRetCode { - - f_unloadCertificates(); - - return f_acTriggerSecEvent(m_acDisableSecurity); - - } - - /** - * @desc Triggers event in the test system adaptation. - * @param p_event The event to trigger - * @return FncRetCode - */ - function f_acTriggerSecEvent( - in template (value) AcSecPrimitive p_event - ) runs on ItsBaseGeoNetworking return FncRetCode { - var FncRetCode v_ret := e_success; - - acPort.send(p_event); - tc_ac.start; - alt { - [] acPort.receive(m_acSecResponseSuccess) { - tc_ac.stop; - } - [] acPort.receive { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - return v_ret; - } - - /** - * @desc Triggers event in the test system adaptation. - * @param p_event The event to trigger - * @return FncRetCode - */ - function f_acTriggerGnssEvent(template (value) AcGnssPrimitive p_event) runs on ItsBaseGeoNetworking return FncRetCode { - var FncRetCode v_ret := e_success; - - acPort.send(p_event); - tc_ac.start; - alt { - [] acPort.receive(m_acGnssResponseSuccess) { - tc_ac.stop; - } - [] acPort.receive { - tc_ac.stop; - log("*** f_acTriggerGnssEvent: ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** f_acTriggerGnssEvent: ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - return v_ret; - } - - /** - * @desc Loads the given scenario - * - * @param p_scenario The scenario to load. - */ - function f_acLoadScenario(Scenario p_scenario) runs on ItsBaseGeoNetworking { - - if (PX_GNSS_SCENARIO_SUPPORT==true) { - f_acTriggerGnssEvent(m_loadScenario(p_scenario)); - } - } // end f_acLoadScenario - - /** - * @desc Starts a loaded scenario - */ - function f_acStartScenario() runs on ItsBaseGeoNetworking { - - if (PX_GNSS_SCENARIO_SUPPORT==true) { - f_acTriggerGnssEvent(m_startScenario); - vc_scenarioStarted := true; - } - } // end f_acStartScenario - - /** - * @desc Stops a loaded scenario - */ - function f_acStopScenario() runs on ItsBaseGeoNetworking { - - if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { - f_acTriggerGnssEvent(m_stopScenario); - vc_scenarioStarted := false; - } - } // end f_acStopScenario - - } // end adapterControl - - group commonFunctions { - - /** - * @desc Gets the value of the lifetime in seconds. - * @param p_lifetime Lifetime to be converted - * @return Lifetime in seconds - */ - function f_getLifetimeValue(in Lifetime p_lifetime) runs on ItsGeoNetworking return float { - var float v_lifetime := 0.0; - - select (p_lifetime.ltBase) { - case (e_50ms) { - v_lifetime := int2float(p_lifetime.multiplier) * 0.5; - } - case (e_1s) { - v_lifetime := int2float(p_lifetime.multiplier) * 1.0; - } - case (e_10s) { - v_lifetime := int2float(p_lifetime.multiplier) * 10.0; - } - case (e_100s) { - v_lifetime := int2float(p_lifetime.multiplier) * 100.0; - } - } - - return v_lifetime; - } - - /** - * @desc Computes GN timestamp based on current time - * @return Unix-Epoch-Time mod 2^32 - */ - function f_computeGnTimestamp() return UInt32 { - - // Timestamp is 1s older than current time to avoid sending beacons coming from the future (time sync between nodes) - var UInt32 v_timestamp := fx_computeGnTimestamp() - 1000; - return v_timestamp; - } - - } // end commonFunctions - - group testerFunctions { - - /** - * @desc Gets the tester GN local address for a specific node - * @param p_node Simulated node - * @return GN address of simulated node - */ - function f_getTsGnLocalAddress(in charstring p_node) return GN_Address { - var GN_Address v_gnAddr := valueof(m_dummyGnAddr); - - select (p_node) { - case (c_compNodeA) { - v_gnAddr := PX_TS_NODE_A_LOCAL_GN_ADDR; - } - case (c_compNodeB) { - v_gnAddr := PX_TS_NODE_B_LOCAL_GN_ADDR; - } - case (c_compNodeC) { - v_gnAddr := PX_TS_NODE_C_LOCAL_GN_ADDR; - } - case (c_compNodeD) { - v_gnAddr := PX_TS_NODE_D_LOCAL_GN_ADDR; - } - case (c_compNodeE) { - v_gnAddr := PX_TS_NODE_E_LOCAL_GN_ADDR; - } - case (c_compNodeF) { - v_gnAddr := PX_TS_NODE_F_LOCAL_GN_ADDR; - } - case else { - log("*** f_getTsGnLocalAddress: INFO: Unknown component " & p_node & " ***"); - } - } - - return v_gnAddr; - } - - /** - * @desc Sends a GeoNetworking message and in case of an included sequence number in the message the - * local sequence number will be increased by one. - * @param p_geoNetReq The message to send. - */ - function f_sendGeoNetMessage(in template (value) GeoNetworkingReq p_geoNetReq) runs on ItsGeoNetworking { - geoNetworkingPort.send(p_geoNetReq); - if (not (ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.shbHeader) - or ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.beaconHeader))) { - f_setLocalSequenceNumber(); - } - } - - /** - * @desc Sends a GeoNetworking message with a payload and in case of an included sequence number in the message the - * local sequence number will be increased by one. - * @param p_geoNetReq The message to send. - * @param p_payload The payload to include. - */ - function f_sendGeoNetMessageWithPayload( - in template (value) GeoNetworkingReq p_geoNetReq, - in template (value) GnRawPayload p_payload - ) runs on ItsGeoNetworking { - p_geoNetReq.msgOut.gnPacket.packet.payload := p_payload; - geoNetworkingPort.send(p_geoNetReq); - if (not (ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.shbHeader) - or ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.beaconHeader))) { - f_setLocalSequenceNumber(); - } - } - - /** - * @desc Receive a GeoNetworking message with a payload and in case of an included sequence number in the message the - * local sequence number will be increased by one. - * @param p_geoNetInd The message to receive. - * @param p_payload The payload to include. - */ - function f_receiveGeoNetMessageWithPayload( - in template (present) GeoNetworkingInd p_geoNetInd, - in template (present) GnRawPayload p_payload - ) return template (present) GeoNetworkingInd { - var template (present) GeoNetworkingInd v_geoNetInd := p_geoNetInd; - - v_geoNetInd.msgIn.gnPacket.packet.payload := p_payload; - - return v_geoNetInd; - } - - /** - * @desc Sets the value of the sequence number for the next event. - */ - function f_setLocalSequenceNumber() runs on ItsGeoNetworking { - vc_localSeqNumber := (vc_localSeqNumber + 1) mod c_uInt16Max; - } - - /** - * @desc Creates an initial seqence number - * @return Time based initial sequence number (increasing with time) - */ - function f_getInitialSequenceNumber() return UInt16 { - - return (f_computeGnTimestamp() / 1000) mod c_uInt16Max; - } - - /** - * @desc Number of messages to be sent - * @return Number of messages to be sent - */ - function f_getMessageCount() return integer { - return PX_MESSAGE_COUNT; - } - - } // end testerFunctions - - group iutFunctions { - - /** - * @desc Gets the IUT GN local address - * @return IUT's GN_Address - * @see PICS_GN_LOCAL_GN_ADDR - */ - function f_getIutGnLocalAddress() return GN_Address { - - return PICS_GN_LOCAL_GN_ADDR; - } - - /** - * @desc Gets the IUT GN local address configuration method - * @return GnAddressConfigurationMethod - IUT's GN local address configuration method - * @see PICS_GN_LOCAL_ADDR_CONF_METHOD - */ - function f_getIutGnLocalAddressConfigurationMethod() return GnAddressConfigurationMethod { - return PICS_GN_LOCAL_ADDR_CONF_METHOD; - } - - /** - * @desc Gets the IUT MAc address - * @return MacAddress - IUT's MAc Address - * @see PICS_IUT_MAC_ADDRESS - */ - function f_getIutMacAddress() return MacAddress { - return PICS_IUT_MAC_ADDRESS; - } - - /** - * @desc Gets the GeoUnicast forwarding algorithm - * @return IUT's GeoUnicast forwarding algorithm - * @see PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM - */ - function f_getGeoUnicastForwardingAlgorithm() return GeoUnicastForwardingAlgorithm { - return PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM; - } - - /** - * @desc Gets the GeoBroadcast forwarding algorithm - * @return IUT's GeoBroadcast forwarding algorithm - * @see PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM - */ - function f_getGeoBroadcastForwardingAlgorithm() return GeoBroadcastForwardingAlgorithm { - return PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM; - } - - /** - * @desc Gets the IUT default hop limit - * @return IUT's default hop limit - * @see PICS_GN_DEFAULT_HOP_LIMIT - */ - function f_getDefaultHopLimit() return UInt8 { - return PICS_GN_DEFAULT_HOP_LIMIT; - } - - /** - * @desc Is the ITS-S mobile or stationary? - * @return Flags indicating whether the ITS-S is mobile or stationary. - * @see PICS_GN_IS_MOBILE - */ - function f_isMobile() return Bit8 { - if (PICS_GN_IS_MOBILE) { - return '10000000'B; - } - return '00000000'B; - } - - /** - * @desc Gets the LS retransmission timer.. Valid for NetRepInterval = default (cong. ctrl). - * @return LS retransmission timer in seconds - * @see PICS_GN_LOCATION_SERVICE_RETRANSMIT_TIMER - */ - function f_getLsRetransmitTimer() return float { - var float v_itsGnLocationServiceRetransmitTimer := int2float(PICS_GN_LOCATION_SERVICE_RETRANSMIT_TIMER/1000); - - return v_itsGnLocationServiceRetransmitTimer; - } - - /** - * @desc Gets the LS retransmission timer for NetRepInterval = medium (cong. ctrl). - * @return LS retransmission timer (medium) in seconds - * @see PX_GN_LOCATION_SERVICE_TIMER_MEDIUM - */ - function f_getLsRetransmitTimerMedium() return float { - var float v_itsGnLocationServiceRetransmitTimerMedium := int2float(PX_GN_LOCATION_SERVICE_TIMER_MEDIUM/1000); - - return v_itsGnLocationServiceRetransmitTimerMedium; - } - - /** - * @desc Gets the LS retransmission timer for NetRepInterval = maximum (cong. ctrl). - * @return LS retransmission timer (maximum) in seconds - * @see PX_GN_LOCATION_SERVICE_TIMER_MAXIMUM - */ - function f_getLsRetransmitTimerMaximum() return float { - var float v_itsGnLocationServiceRetransmitTimerMaximum := int2float(PX_GN_LOCATION_SERVICE_TIMER_MAXIMUM/1000); - - return v_itsGnLocationServiceRetransmitTimerMaximum; - } - - /** - * @desc Gets the App retransmission timer. Valid for AppRepInterval = default (cong. ctrl). - * @return App retransmission timer in seconds - * @see PX_GN_APPLICATION_RETRANSMIT_TIMER - */ - function f_getAppRetransmitTimer() return float { - var float v_itsGnLocationApplicationRetransmitTimer := int2float(PX_GN_APPLICATION_RETRANSMIT_TIMER/1000); - - return v_itsGnLocationApplicationRetransmitTimer; - } - - /** - * @desc Gets the App retransmission timer for AppRepInterval = medium (cong. ctrl). - * @return App retransmission timer (medium) in seconds - * @see PX_GN_APPLICATION_RETRANSMIT_TIMER_MEDIUM - */ - function f_getAppRetransmitTimerMedium() return float { - var float v_itsGnLocationApplicationRetransmitTimerMedium := int2float(PX_GN_APPLICATION_RETRANSMIT_TIMER_MEDIUM/1000); - - return v_itsGnLocationApplicationRetransmitTimerMedium; - } - - /** - * @desc Gets the App retransmission timer for AppRepInterval = maximum (cong. ctrl). - * @return App retransmission timer (maximum) in seconds - * @see PX_GN_APPLICATION_RETRANSMIT_TIMER_MAXIMUM - */ - function f_getAppRetransmitTimerMaximum() return float { - var float v_itsGnLocationApplicationRetransmitTimerMaximum := int2float(PX_GN_APPLICATION_RETRANSMIT_TIMER_MAXIMUM/1000); - - return v_itsGnLocationApplicationRetransmitTimerMaximum; - } - - /** - * @desc Gets the LS maximum retransmission number. - * @return LS maximum retransmission number - * @see PICS_GN_LOCATION_SERVICE_MAX_RETRANS - */ - function f_getLsMaxRetrans() return integer { - var integer v_itsGnLocationServiceMaxRetrans := PICS_GN_LOCATION_SERVICE_MAX_RETRANS; - - return v_itsGnLocationServiceMaxRetrans; - } - - /** - * @desc Gets the Application maximum retransmission number. - * @return Application maximum retransmission number - * @see PX_GN_APPLICATION_MAX_RETRANS - */ - function f_getAppMaxRetrans() return integer { - var integer v_itsGnApplicationMaxRetrans := PX_GN_APPLICATION_MAX_RETRANS; - - return v_itsGnApplicationMaxRetrans; - } - - /** - * @desc Gets the Location Service packet buffer size. - * @return Location Service packet buffer size in Kbytes - * @see PICS_GN_LOCATION_SERVICE_PACKET_BUFFER_SIZE - */ - function f_getLsPacketBufferSize() return integer { - var integer v_itsGnLocationServicePacketBufferSize := PICS_GN_LOCATION_SERVICE_PACKET_BUFFER_SIZE; - - return v_itsGnLocationServicePacketBufferSize; - } // end f_getLsPacketBufferSize - - /** - * @desc Gets the UC forwarding packet buffer size. - * @return UC forwarding packet buffer size in bytes - * @see PICS_GN_UC_FORWARDING_PACKET_BUFFER_SIZE - */ - function f_getUcForwardingPacketBufferSize() return integer { - var integer v_itsGnUcForwardingPacketBufferSize := PICS_GN_UC_FORWARDING_PACKET_BUFFER_SIZE; - - return v_itsGnUcForwardingPacketBufferSize * 1024; - } // end f_getUcForwardingPacketBufferSize - - /** - * @desc Gets the BC forwarding packet buffer size. - * @return BC forwarding packet buffer size in bytes - * @see PICS_GN_BC_FORWARDING_PACKET_BUFFER_SIZE - */ - function f_getBcForwardingPacketBufferSize() return integer { - var integer v_itsGnBcForwardingPacketBufferSize := PICS_GN_BC_FORWARDING_PACKET_BUFFER_SIZE; - - return v_itsGnBcForwardingPacketBufferSize * 1024; - } // end f_getBcForwardingPacketBufferSize - - /** - * @desc Gets the maximum lifetime of a packet. - * @return Maximum lifetime of a packet in seconds - * @see PICS_GN_MAX_PACKET_LIFETIME - */ - function f_getMaxPacketLifeTime() return float { - var float v_itsGnMaxPacketLifetime := int2float(PICS_GN_MAX_PACKET_LIFETIME); - - return v_itsGnMaxPacketLifetime; - } - - /** - * @desc Gets delta for timers. - * @return Delta for timers in seconds - * @see PX_T_DELTA - */ - function f_getDeltaTimer() return float { - var float v_deltaTimer := PX_T_DELTA; - - return v_deltaTimer; - } - - /** - * @desc Gets the beacon service retransmit timer. - * @return Beacon service retransmit timer - */ - function f_getBsRetransmitTimer() return float { - var float v_itsGnBeaconServiceRetransmitTimer; - - v_itsGnBeaconServiceRetransmitTimer := int2float( - (PICS_GN_BEACON_SERVICE_RETRANSMIT_TIMER/1000)); - - return v_itsGnBeaconServiceRetransmitTimer; - } - - /** - * @desc Gets the beacon service retransmit timer for NetBeaconInterval = medium (cong. ctrl). - * @return Beacon service retransmit timer (medium) - */ - function f_getBsRetransmitTimerMedium() return float { - var float v_itsGnBeaconServiceRetransmitTimerMedium; // timer value increased (medium) - - v_itsGnBeaconServiceRetransmitTimerMedium := int2float( - (PX_GN_BEACON_SERVICE_TIMER_MEDIUM+float2int((f_getBsMaxJitter() - 0.0 +1.0)*rnd()) + 0)/1000); - - return v_itsGnBeaconServiceRetransmitTimerMedium; - } - - /** - * @desc Gets the beacon service retransmit timer for NetBeaconInterval = maximum (cong. ctrl). - * @return Beacon service retransmit timer (maximum) - */ - function f_getBsRetransmitTimerMaximum() return float { - var float v_itsGnBeaconServiceRetransmitTimerMaximum; // timer value increased (maximum) - - v_itsGnBeaconServiceRetransmitTimerMaximum := int2float( - (PX_GN_BEACON_SERVICE_TIMER_MAXIMUM+float2int((f_getBsMaxJitter() - 0.0 +1.0)*rnd()) + 0)/1000); - - return v_itsGnBeaconServiceRetransmitTimerMaximum; - } - - /** - * @desc Gets the maximum beacon service jitter. - * @return Maximum beacon service jitter - */ - function f_getBsMaxJitter() return float { - var float v_itsGnBeaconServiceMaxJitter := int2float(PICS_GN_BEACON_SERVICE_MAX_JITTER)/1000.0; - - return v_itsGnBeaconServiceMaxJitter; - } - - /** - * @desc Gets the Lifetime of a Location Table Entry. - * @return Lifetime of a Location Table Entry in seconds - * @see PICS_GN_LIFETIME_LOC_TE - */ - function f_getLifetimeLocTableEntry() return float { - var float v_itsGnLifetimeLocTableEntry := int2float(PICS_GN_LIFETIME_LOC_TE); - - return v_itsGnLifetimeLocTableEntry; - } // end f_getLifetimeLocTableEntry - - /** - * @desc Gets the maximum communication range for CBF algorithm - * @return Maximum communication range for CBF algorithm in meters - * @see PICS_GN_DEFAULT_MAX_COMMUNICATION_RANGE - */ - function f_getCbfMaxCommunicationRange() return integer { - var integer v_maxCommunicationRange := PICS_GN_DEFAULT_MAX_COMMUNICATION_RANGE; - - return v_maxCommunicationRange; - } // end f_getCbfMaxCommunicationRange - - function f_getGeoUnicastCbfMaxTime() return integer { - var integer v_cbfMaxTime := PICS_GN_GEOUNICAST_CBF_MAX_TIME; - - return v_cbfMaxTime; - } // end f_getGeoUnicastCbfMaxTime - - function f_getGeoUnicastCbfMinTime() return integer { - var integer v_cbfMinTime := PICS_GN_GEOUNICAST_CBF_MIN_TIME; - - return v_cbfMinTime; - } // end f_getGeoUnicastCbfMinTime - - function f_getGeoBroadcastCbfMaxTime() return integer { - var integer v_cbfMaxTime := PICS_GN_GEOBROADCAST_CBF_MAX_TIME; - - return v_cbfMaxTime; - } // end f_getGeoBroadcastCbfMaxTime - - function f_getGeoBroadcastCbfMinTime() return integer { - var integer v_cbfMinTime := PICS_GN_GEOBROADCAST_CBF_MIN_TIME; - - return v_cbfMinTime; - } // end f_getGeoBroadcastCbfMinTime - - function f_getGnMaxAreaSize() return float { - var float v_maxAreaSize := PICS_GN_MAX_GEO_AREA_SIZE; - - return v_maxAreaSize; - } // end f_getGnMaxAreaSize - - function f_getAdvancedGbcForwardingMaxCounter() return integer { - var integer v_maxCounter := PICS_GN_ADVANCED_BC_FORWARDING_MAX_COUNTER; - - return v_maxCounter; - } - - /** - * @desc Set the number of neighbour in the Location Table. - * @see PX_MIN_NR_NEIGHBOUR - */ - function f_setNrNeighbourLocTableDefault() runs on ItsGeoNetworking { - var integer v_nrNeighbour := f_random (0, PX_MIN_NR_NEIGHBOUR); - - f_acStartBeaconingMultipleNeighbour(v_nrNeighbour); - - } // end f_setNrNeighbourLocTableDefault - - /** - * @desc Set the number of neighbour in the Location Table (medium). - * @see PX_MIN_NR_NEIGHBOUR - * @see PX_MAX_NR_NEIGHBOUR - */ - function f_setNrNeighbourLocTableMedium() runs on ItsGeoNetworking { - var integer v_nrNeighbour := f_random (PX_MIN_NR_NEIGHBOUR, PX_MAX_NR_NEIGHBOUR); - - f_acStartBeaconingMultipleNeighbour(v_nrNeighbour); - - } // end f_setNrNeighbourLocTableMedium - - /** - * @desc Set the number of neighbour in the Location Table (maximum). - * @see PX_MAX_NR_NEIGHBOUR - * @see PX_MIN_NR_NEIGHBOUR - */ - function f_setNrNeighbourLocTableMaximum() runs on ItsGeoNetworking { - var integer v_nrNeighbour := f_random (PX_MAX_NR_NEIGHBOUR, (2*PX_MIN_NR_NEIGHBOUR)); - - f_acStartBeaconingMultipleNeighbour(v_nrNeighbour); - - } // end f_setNrNeighbourLocTableMaximum - - } // end iutFunctions - - group posVectorFunctions { - - /** - * @desc Convert long position vector to short position vector - * @param p_longPosVector Long position vector to be converted - * @return Short position vector - */ - function f_longPosVector2ShortPosVector(in LongPosVector p_longPosVector) return ShortPosVector { - var ShortPosVector v_shortPosVector; - - v_shortPosVector := { - gnAddr := p_longPosVector.gnAddr, - timestamp_ := p_longPosVector.timestamp_, - latitude := p_longPosVector.latitude, - longitude := p_longPosVector.longitude - }; - - return v_shortPosVector; - } - - /** - * @desc Get IUT's long position vector - * @return IUT's long position vector - */ - function f_getIutLongPosVector() runs on ItsBaseGeoNetworking return LongPosVector { - return f_acGetLongPosVector(f_getIutGnLocalAddress()); - } - function f_getIutLongPosVector_1(inout LongPosVector p_longPosVectorIut) runs on ItsGeoNetworking { - p_longPosVectorIut := f_acGetLongPosVector(f_getIutGnLocalAddress()); - } - - /** - * @desc Get IUT's short position vector - * @return IUT's short position vector - */ - function f_getIutShortPosVector() runs on ItsGeoNetworking return ShortPosVector { - var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); - - if (not isbound(v_longPosVectorIut)) { - v_longPosVectorIut := f_getIutLongPosVector(); - } - return f_longPosVector2ShortPosVector(v_longPosVectorIut); - } - - /** - * @desc Compute a position using a reference position, a distance and an orientation - * @param p_iutLongPosVector Reference position - * @param p_distance Distance to the reference position (in meter) - * @param p_orientation direction of the computed position (0 to 359; 0 means North) - * @return LongPosVector - */ - function f_computePositionUsingDistance(in LongPosVector p_iutLongPosVector, in float p_distance, in integer p_orientation) - return LongPosVector { - var LongPosVector v_result := p_iutLongPosVector; - - log("*** f_computePositionUsingDistance: INFO: calling fx_computePositionUsingDistance() ***"); - fx_computePositionUsingDistance(p_iutLongPosVector.latitude, p_iutLongPosVector.longitude, p_distance, p_orientation, v_result.latitude, v_result.longitude); - - return v_result; - } - - } // end posVectorFunctions - - group externalFunctions { - - /** - * @desc External function to compute timestamp based on current time - * @return Unix-Epoch-Time mod 2^32 - */ - external function fx_computeGnTimestamp() return UInt32; - - } // End of group externalFunctions - - group security { - - /** - * @desc Waiting for the GN message with Security - * @param p_InSecMsg SecurityMessage template - * @param p_received returns received SecurityMessage - */ - altstep a_securedMessage ( - in template (present) EtsiTs103097Data p_InSecMsg, - out EtsiTs103097Data p_received - ) runs on ItsGeoNetworking { - var GeoNetworkingInd v_geoNw; - [] geoNetworkingPort.receive(mw_geoNwInd( - mw_geoNwSecPdu( - p_InSecMsg, - mw_geoNwAnyPacket_withPayload(?) - ))) -> value v_geoNw { - p_received := f_getSecuredMessage(v_geoNw.msgIn); - } - } // End of 'altstep' statement - - /** - * @desc Receive GN message with security containing certificate as a signer info - * @param p_cert returns the certificate used for sign received message - */ - altstep a_securedMessageWithCertificate( - out EtsiTs103097Data p_received - ) runs on ItsGeoNetworking { - - [] a_securedMessage ( - mw_etsiTs103097Data_signed( - mw_signedData( - -, - mw_toBeSignedData( - mw_signedDataPayload - ), - mw_signerIdentifier_certificate // containing certificate - ) - ), - p_received - ) { - // Nothing to do - } - } // End of altstep a_securedMessageWithCertificate - - /** - * @desc Receive GN message with security containing digest as a signer info - * @param p_cert returns the certificate used for sign received message - */ - altstep a_securedMessageWithDigest( - out EtsiTs103097Data p_received - ) runs on ItsGeoNetworking { - [] a_securedMessage ( - mw_etsiTs103097Data_signed( - mw_signedData( - -, - mw_toBeSignedData( - mw_signedDataPayload - ), - mw_signerIdentifier_digest // containing digest - ) - ), - p_received - ) { - // Nothing to do - } - } // End of altstep a_securedMessageWithDigest - - } // End of group altSteps - - group waitingHelpers { - - /** - * @desc Wait for GN message with security containing certificate as a signer info - * @return the certificate used for sign received message - */ - function f_waitForCertificate( - out EtsiTs103097Certificate p_cert - ) runs on ItsGeoNetworking return boolean { - var EtsiTs103097Data v_recv; - var boolean v_ret := false; - - alt { - [] a_securedMessageWithCertificate(v_recv) { - var SignerIdentifier v_signerIdentifier; - if (f_getMsgSignerIdentifier(v_recv, v_signerIdentifier) == true) { - if (ischosen(v_signerIdentifier.certificate)) { - p_cert := v_signerIdentifier.certificate[0]; - v_ret := true; - } - } - } - } // End of 'alt' statement - - return v_ret; - } // End of function f_waitForCertificate - - /** - * @desc Ask for the certificate chain and wait for GN message with security containing certificate chain as a signer info - * @return the certificate chain used for sign received message - */ - function f_askForCertificateChain (in template(value) octetstring p_CamPayload) - runs on ItsGeoNetworking - return boolean { - var EtsiTs103097Data v_recv; - var boolean v_ret := false; - - alt { - [] a_securedMessageWithCertificate(v_recv) { - var SignerIdentifier v_signerIdentifier; - if (f_getMsgSignerIdentifier(v_recv, v_signerIdentifier) == true) { // Get AT certificate - if(ischosen(v_signerIdentifier.digest)) { - f_sendCertificateRequest(v_signerIdentifier.digest, p_CamPayload); // Request issuer - if(tc_ac.running) { - tc_ac.stop; - tc_ac.start; - } - v_ret := true; - } - } - } - } - return v_ret; - } // End of function f_askForCertificateChain - - /** - * @desc Ask for the certificate chain and wait for GN message with security containing certificate chain as a signer info - * @return the certificate chain used for sign received message - */ - function f_askAndWaitForCertificateChain( - out SequenceOfCertificate p_chain, - in template(value) octetstring p_CamPayload - ) runs on ItsGeoNetworking return boolean { - // Local variables - var EtsiTs103097Data v_recv; - var SignerIdentifier v_signerIdentifier; - var boolean v_ret := false; - - f_askForCertificateChain(p_CamPayload); // Get AT certificate and request for the issuer - alt { - [] a_securedMessageWithCertificate(v_recv) { // Get AA certificate - tc_ac.stop; - - if (f_getMsgSignerIdentifier(v_recv, v_signerIdentifier) == true) { - p_chain := v_signerIdentifier.certificate; - } - } - } // End of 'alt' statement - - return v_ret; - } // End of function f_askAndWaitForCertificateChain - - /** - * @desc Send a CAM message with a certificate and wait the certificate chain request message - * @remark This function is used only for testing against another ATS - * @param p_certificate The certificate identifier - * @param p_CamPayload The CAM paylaod - * @return true on success, flase otherwise - */ - function f_sendCertificateAndWaitForCertificateChainRequest( - in charstring p_certificate, - in template(value) octetstring p_CamPayload - ) runs on ItsGeoNetworking return boolean { - // Local variables - var EtsiTs103097Data v_recv; - - f_sendCertificate(p_certificate, p_CamPayload); - /* FIXME To be reviewed alt { - [] a_securedMessage ( - mw_securedMessage( - superset( - mw_header_field_unrecognised_certificate - )), - v_recv - ) { - // Nothing to do - log("*** " & testcasename() & ": DEBUG: Receive certificate ***") - } - }*/ // End of 'alt' statement - - return true; - } // End of function f_sendCertificateAndWaitForCertificateChainRequest - - } // End of group waitingHelpers - - group CertRequests{ - - function f_sendCertificateRequest( - in template (value) HashedId8 p_digest, - in template (value) octetstring p_payload - ) runs on ItsGeoNetworking { - var GeoNetworkingReq v_gnReq; - var GnNonSecuredPacket v_gnNonSecuredPacket; - var template (value) ToBeSignedData v_toBeSignedData; - var template (value) EtsiTs103097Data v_securedMessage; - - // Build signed EtsiTs103097Data - v_gnNonSecuredPacket := valueof(m_geoNwShbPacket( - f_getPosition(c_compNodeC) // FIXME To be verified YANN - )); - // Add CAM payload - v_gnNonSecuredPacket.payload := valueof(p_payload); - - /* FIXME To be reviewed f_buildGnSecuredCam( - v_securedMessage, - m_payload_signed(bit2oct(encvalue(v_gnNonSecuredPacket))), - e_certificate, - { - m_header_field_unrecognised_certificate( - f_HashedId3FromHashedId8( - valueof(p_digest) - )) - }, - "" - ); - - // Build secured Gn packet - v_gnReq := valueof(m_geoNwReq_linkLayerBroadcast( - m_geoNwSecPdu( - v_gnNonSecuredPacket, - v_securedMessage - ) // End of template m_geoNwSecPdu - )); // End of template m_geoNwReq_linkLayerBroadcast - - // Send Message - f_sendGeoNetMessage(v_gnReq);*/ - - } // End of function f_sendCertificateRequest - - /** - * @desc Send a CAM message with a certificate - * @remark This function is used only for testing against another ATS - * @param p_certificate The certificate identifier - * @param p_CamPayload The CAM paylaod - * @return true on success, flase otherwise - * @see f_sendCertificateAndWaitForCertificateChainRequest - */ - function f_sendCertificate( - in charstring p_certificate, - in template (value) octetstring p_payload - ) runs on ItsGeoNetworking { - var GeoNetworkingReq v_gnReq; - var GnNonSecuredPacket v_gnNonSecuredPacket; - var template (value) ToBeSignedData v_toBeSignedData; - var template (value) EtsiTs103097Data v_securedMessage; - - // Build signed EtsiTs103097Data - /* FIXME To be reviewed v_gnNonSecuredPacket := valueof(m_geoNwShbPacket( - f_getPosition(c_compNodeC) // FIXME To be verified YANN - )); - // Add CAM payload - v_gnNonSecuredPacket.payload := valueof(p_payload); - - f_buildGnSecuredCam( - v_securedMessage, - m_payload_signed(bit2oct(encvalue(v_gnNonSecuredPacket))), - e_certificate, - -, - p_certificate - ); - - // Build secured Gn packet - v_gnReq := valueof(m_geoNwReq_linkLayerBroadcast( - m_geoNwSecPdu( - v_gnNonSecuredPacket, - v_securedMessage - ) // End of template m_geoNwSecPdu - )); // End of template m_geoNwReq_linkLayerBroadcast - - // Send Message - f_sendGeoNetMessage(v_gnReq);*/ - - } // End of function f_sendCertificate - - } // End of group CertRequests - - group messageGetters { - - /** - * @desc return EtsiTs103097Data field of GeoNetworking packet - * @param p_msg GeoNetworking packet - * @return the EtsiTs103097Data if any - */ - function f_getSecuredMessage(in GeoNetworkingPdu p_msg) - return EtsiTs103097Data { - return p_msg.gnPacket.securedMsg; - } - - } - -} // end LibItsGeoNetworking_Functions +/** + * @author ETSI / STF405 / STF449 / STF484 / STF517 + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn $ + * $Id: LibItsGeoNetworking_Functions.ttcn 1329 2017-02-21 14:48:18Z berge $ + * @desc Module containing functions for GeoNetworking + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * + */ +module LibItsGeoNetworking_Functions { + + // Libcommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; + import from LibCommon_VerdictControl all; + import from LibCommon_Sync all; + import from LibCommon_Time all; + + // LibIts + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + import from IEEE1609dot2 language "ASN.1:1997" all; + import from EtsiTs103097Module language "ASN.1:1997" all; + + // LibItsCommon + import from LibItsCommon_TypesAndValues all; + import from LibItsExternal_TypesAndValues all; + import from LibItsCommon_Templates all; + import from LibItsCommon_Functions all; + import from LibItsCommon_Pixits all; + // import from LibItsCommon_TestSystem 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_TypesAndValues all; + import from LibItsGeoNetworking_Templates all; + import from LibItsGeoNetworking_Pixits all; + import from LibItsGeoNetworking_Pics all; + + group utFuntions { + + /** + * @desc Requests to bring the IUT in an initial state + * @param p_init The initialisation to trigger. + */ + function f_utInitializeIut(template (value) UtGnInitialize p_init) runs on ItsBaseGeoNetworking { + + //deactivate gnPort default alts + vc_gnDefaultActive := false; + + utPort.send(p_init); + tc_wait.start; + alt { + [] utPort.receive(UtGnResults: { utGnInitializeResult := true }) { + tc_wait.stop; + log("*** f_utInitializeIut: INFO: IUT initialized ***"); + } + [] utPort.receive { + tc_wait.stop; + log("*** f_utInitializeIut: INFO: IUT could not be initialized ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] tc_wait.timeout { + log("*** f_utInitializeIut: INFO: IUT could not be initialized in time ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } + + //activate gnPort default alts + vc_gnDefaultActive := true; + + } + + /** + * @desc Requests to change the position of the IUT + */ + function f_utChangePosition() runs on ItsBaseGeoNetworking { + + //deactivate gnPort default alts + vc_gnDefaultActive := false; + + utPort.send(m_changePosition); + tc_wait.start; + alt { + [] utPort.receive(UtGnResults: { utGnChangePositionResult := true} ) { + tc_wait.stop; + log("*** f_utChangePosition: INFO: IUT position changed ***"); + } + [] utPort.receive(UtGnResults: { utGnChangePositionResult := false }) { + tc_wait.stop; + log("*** f_utChangePosition: INFO: IUT position change was not successful ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] a_utDefault() { + } + [] tc_wait.timeout { + log("*** f_utChangePosition: INFO: IUT position not changed in time ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } + + //activate gnPort default alts + vc_gnDefaultActive := true; + + } + + /** + * @desc Triggers event from the application layer + * @param p_event The event to trigger. + */ + function f_utTriggerEvent(template (value) UtGnTrigger p_event) runs on ItsBaseGeoNetworking return boolean { + + // Variables + var boolean v_return := true; + + //deactivate gnPort default alts + vc_gnDefaultActive := false; + + utPort.send(p_event); + tc_wait.start; + alt { + [] utPort.receive(UtGnResults: { utGnTriggerResult := true }) { + tc_wait.stop; + } + [] utPort.receive(UtGnResults: { utGnTriggerResult := false }) { + tc_wait.stop; + log("*** UtGnTriggerResult: INFO: UT trigger was not successful ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] a_utDefault() { + } + [] tc_wait.timeout { + v_return := false; + } + } + + //activate gnPort default alts + vc_gnDefaultActive := true; + + return v_return; + } + + } // End of group utFunctions + + group geoConfigurationFunctions { + + /** + * @desc This configuration features: + * - one ITS node (IUT) + * - two ITS nodes (nodeA, nodeB) + * - Area1 which only includes NodeB and IUT + * - Area2 which only includes NodeB + * NodeB being close to the area center + */ + function f_cf01Up(Scenario p_scenario := e_staticPosition) runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + // Variables + var PositionTable v_positionTable := {}; + var GeoAreaTable v_areaTable := {}; + + // Map + map(self:acPort, system:acPort); + map(self:utPort, system:utPort); + map(self:geoNetworkingPort, system:geoNetworkingPort); + + // Connect + f_connect4SelfOrClientSync(); + activate(a_cf01Down()); + + // Initialise secured mode + f_initialiseSecuredMode(); + + //Initialze the IUT + f_initialState(p_scenario); + + // Positions & Areas + f_preparePositionsAndAreas(v_positionTable, v_areaTable); + + f_initialiseComponent(v_positionTable, v_areaTable, c_compNodeB); + + } // end f_cf01Up + + function f_cf01Down() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { + + f_uninitialiseSecuredMode(); + + // Unmap + unmap(self:acPort, system:acPort); + unmap(self:utPort, system:utPort); + unmap(self:geoNetworkingPort, system:geoNetworkingPort); + + // Disconnect + f_disconnect4SelfOrClientSync(); + + } // end f_cf01Down + + /** + * @desc This configuration features: + * - one ITS node (IUT) + * - one ITS node (NodeB) + * - one ITS node (NodeD) + * - Area1 which only includes NodeB, NodeD and IUT + * - Area2 which only includes NodeB and NodeD + * NodeB being close to the area center + * + * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages + */ + function f_cf02Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + + // Variables + var PositionTable v_positionTable := {}; + var GeoAreaTable v_areaTable := {}; + var ItsGeoNetworking v_component; + var integer i; + + // Select components + vc_componentTable := {{c_compNodeB, omit}, {c_compNodeD, omit}}; + + // Create components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; + } + + // Map & Connect + map(self:acPort, system:acPort); + map(self:utPort, system:utPort); + connect(self:syncPort, mtc:syncPort); + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + map(vc_componentTable[i].gnComponent:acPort, system:acPort); + map(vc_componentTable[i].gnComponent:utPort, system:utPort); + map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + + activate(a_cf02Down()); + + //Initialze the IUT + if(p_mainUtComponent == c_compMTC) { + // Initialise secured mode + f_initialiseSecuredMode(); + + // MTC intializes IUT + f_initialState(p_scenario); + } + else { + v_component := f_getComponent(p_mainUtComponent); + v_component.start(f_initialState(p_scenario)); + v_component.done; + } + + // Positions & Areas + f_preparePositionsAndAreas(v_positionTable, v_areaTable); + + // Initialize components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); + } + } + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.done; + } + } + + } // end f_cf02Up + + /** + * @desc Deletes configuration cf02 + */ + function f_cf02Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + + // Local variables + var integer i; + + f_uninitialiseSecuredMode(); + + // Unmap & Disconnect + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); + unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); + unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + unmap(self:acPort, system:acPort); + unmap(self:utPort, system:utPort); + disconnect(self:syncPort, mtc:syncPort); + + } // end f_cf02Down + + /** + * @desc This configuration features: + * - one ITS node (IUT) + * - one ITS node (NodeA) + * - one ITS node in direction of NodeA (NodeB) + * - one ITS node not in direction of NodeA (NodeC) + * - Area1 which only includes NodeB and IUT + * - Area2 which only includes NodeB + * NodeB being close to the area center + * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages + */ + function f_cf03Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + + // Variables + var PositionTable v_positionTable := {}; + var GeoAreaTable v_areaTable := {}; + var ItsGeoNetworking v_component; + var integer i; + + // Select components + vc_componentTable := {{c_compNodeB, omit}, {c_compNodeC, omit}}; + + // Create components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; + } + + // Map & Connect + map(self:acPort, system:acPort); + map(self:utPort, system:utPort); + connect(self:syncPort, mtc:syncPort); + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + map(vc_componentTable[i].gnComponent:acPort, system:acPort); + map(vc_componentTable[i].gnComponent:utPort, system:utPort); + map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + + activate(a_cf03Down()); + + //Initialze the IUT + if(p_mainUtComponent == c_compMTC) { + // Initialise secured mode + f_initialiseSecuredMode(); + + // MTC intializes IUT + f_initialState(p_scenario); + } + else { + v_component := f_getComponent(p_mainUtComponent); + v_component.start(f_initialState(p_scenario)); + v_component.done; + } + + // Positions & Areas + f_preparePositionsAndAreas(v_positionTable, v_areaTable); + + // Initialize components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); + } + } + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.done; + } + } + + } // end f_cf03Up + + /** + * @desc Deletes configuration cf03 + */ + function f_cf03Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + + // Local variables + var integer i; + + f_uninitialiseSecuredMode(); + + // Unmap & Disconnect + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); + unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); + unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + unmap(self:acPort, system:acPort); + unmap(self:utPort, system:utPort); + disconnect(self:syncPort, mtc:syncPort); + + } // end f_cf03Down + + /** + * @desc This configuration features: + * - one ITS node (IUT) + * - one ITS node (NodeA) + * - one ITS node in direction of NodeA and having + * shortest distance to NodeA (NodeB) + * - one ITS node in direction of NodeA (NodeD) + * - one ITS node not in direction of NodeA (NodeC) + * - Area1 which only includes NodeB, NodeD and IUT + * - Area2 which only includes NodeA, NodeB and NodeD + * NodeB being close to the area center + * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages + */ + function f_cf04Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + + // Variables + var PositionTable v_positionTable := {}; + var GeoAreaTable v_areaTable := {}; + var ItsGeoNetworking v_component; + var integer i; + + // Select components + vc_componentTable := {{c_compNodeB, omit}, {c_compNodeC, omit}, {c_compNodeD, omit}}; + + // Create components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; + } + + // Map & Connect + map(self:acPort, system:acPort); + map(self:utPort, system:utPort); + connect(self:syncPort, mtc:syncPort); + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + map(vc_componentTable[i].gnComponent:acPort, system:acPort); + map(vc_componentTable[i].gnComponent:utPort, system:utPort); + map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + + activate(a_cf04Down()); + + //Initialze the IUT + if(p_mainUtComponent == c_compMTC) { + // Initialise secured mode + f_initialiseSecuredMode(); + + // MTC intializes IUT + f_initialState(p_scenario); + } + else { + v_component := f_getComponent(p_mainUtComponent); + v_component.start(f_initialState(p_scenario)); + v_component.done; + } + + // Positions & Areas + f_preparePositionsAndAreas(v_positionTable, v_areaTable); + + // Initialize components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); + } + } + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.done; + } + } + + } // end f_cf04Up + + /** + * @desc Deletes configuration cf04 + */ + function f_cf04Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + + // Local variables + var integer i; + + f_uninitialiseSecuredMode(); + + // Unmap & Disconnect + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); + unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); + unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + unmap(self:acPort, system:acPort); + unmap(self:utPort, system:utPort); + disconnect(self:syncPort, mtc:syncPort); + + } // end f_cf04Down + + /** + * @desc This configuration features: + * - one ITS node (IUT) + * - one ITS node (NodeB) + * - one ITS node not in direction of NodeB and having + * longest distance to NodeB (NodeE) + * - Area1 which only includes NodeB, NodeD and IUT + * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages + */ + function f_cf05Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + + // Variables + var PositionTable v_positionTable := {}; + var GeoAreaTable v_areaTable := {}; + var ItsGeoNetworking v_component; + var integer i; + + // Select components + vc_componentTable := {{c_compNodeB, omit}, {c_compNodeE, omit}}; + + // Create components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; + } + + // Map & Connect + map(self:acPort, system:acPort); + map(self:utPort, system:utPort); + connect(self:syncPort, mtc:syncPort); + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + map(vc_componentTable[i].gnComponent:acPort, system:acPort); + map(vc_componentTable[i].gnComponent:utPort, system:utPort); + map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + + activate(a_cf05Down()); + + //Initialze the IUT + if(p_mainUtComponent == c_compMTC) { + // Initialise secured mode + f_initialiseSecuredMode(); + + // MTC intializes IUT + f_initialState(p_scenario); + } + else { + v_component := f_getComponent(p_mainUtComponent); + v_component.start(f_initialState(p_scenario)); + v_component.done; + } + + // Positions & Areas + f_preparePositionsAndAreas(v_positionTable, v_areaTable); + + // Initialize components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); + } + } + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.done; + } + } + } + + /** + * @desc Deletes configuration cf05 + */ + function f_cf05Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + + // Local variables + var integer i; + + f_uninitialiseSecuredMode(); + + // Unmap & Disconnect + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); + unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); + unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + unmap(self:acPort, system:acPort); + unmap(self:utPort, system:utPort); + disconnect(self:syncPort, mtc:syncPort); + + } // end f_cf05Down + + /** + * @desc This configuration features: + * - one ITS node (IUT) + * - one ITS node (NodeB) + * - one ITS node not in direction of NodeB and having + * shortest distance to NodeB (NodeF) + * - Area1 which only includes NodeB, NodeD and IUT + * - IUT not in sectorial area of NodeB-NodeF + * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages + */ + function f_cf06Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + + // Variables + var PositionTable v_positionTable := {}; + var GeoAreaTable v_areaTable := {}; + var ItsGeoNetworking v_component; + var integer i; + + // Select components + vc_componentTable := {{c_compNodeB, omit}, {c_compNodeF, omit}}; + + // Create components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; + } + + // Map & Connect + map(self:acPort, system:acPort); + map(self:utPort, system:utPort); + connect(self:syncPort, mtc:syncPort); + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + map(vc_componentTable[i].gnComponent:acPort, system:acPort); + map(vc_componentTable[i].gnComponent:utPort, system:utPort); + map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + + activate(a_cf06Down()); + + //Initialze the IUT + if(p_mainUtComponent == c_compMTC) { + // Initialise secured mode + f_initialiseSecuredMode(); + + // MTC intializes IUT + f_initialState(p_scenario); + } + else { + v_component := f_getComponent(p_mainUtComponent); + v_component.start(f_initialState(p_scenario)); + v_component.done; + } + + // Positions & Areas + f_preparePositionsAndAreas(v_positionTable, v_areaTable); + + // Initialize components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); + } + } + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.done; + } + } + } + + /** + * @desc Deletes configuration cf06 + */ + function f_cf06Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + + // Local variables + var integer i; + + f_uninitialiseSecuredMode(); + + // Unmap & Disconnect + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); + unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); + unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + unmap(self:acPort, system:acPort); + unmap(self:utPort, system:utPort); + disconnect(self:syncPort, mtc:syncPort); + + } // end f_cf06Down + + /** + * @desc This configuration features: + * - one ITS node (IUT) + * - one ITS node (NodeB) + * - one ITS node in direction of NodeB and having + * shortest distance to NodeB (NodeD) + * - Area1 which only includes NodeB, NodeD and IUT + * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages + */ + function f_cf07Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + + // Variables + var PositionTable v_positionTable := {}; + var GeoAreaTable v_areaTable := {}; + var ItsGeoNetworking v_component; + var integer i; + + // Select components + vc_componentTable := {{c_compNodeB, omit}, {c_compNodeD, omit}}; + + // Create components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; + } + + // Map & Connect + map(self:acPort, system:acPort); + map(self:utPort, system:utPort); + connect(self:syncPort, mtc:syncPort); + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + map(vc_componentTable[i].gnComponent:acPort, system:acPort); + map(vc_componentTable[i].gnComponent:utPort, system:utPort); + map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + + activate(a_cf07Down()); + + //Initialze the IUT + if(p_mainUtComponent == c_compMTC) { + // Initialise secured mode + f_initialiseSecuredMode(); + + // MTC intializes IUT + f_initialState(p_scenario); + } + else { + v_component := f_getComponent(p_mainUtComponent); + v_component.start(f_initialState(p_scenario)); + v_component.done; + } + + // Positions & Areas + f_preparePositionsAndAreas(v_positionTable, v_areaTable); + + // Initialize components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); + } + } + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + if (isvalue(vc_componentTable[i].gnComponent)) { + vc_componentTable[i].gnComponent.done; + } + } + } + + /** + * @desc Deletes configuration cf06 + */ + function f_cf07Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { + + // Local variables + var integer i; + + f_uninitialiseSecuredMode(); + + // Unmap & Disconnect + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); + unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); + unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); + disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); + } + unmap(self:acPort, system:acPort); + unmap(self:utPort, system:utPort); + disconnect(self:syncPort, mtc:syncPort); + + } // end f_cf07Down + + /** + * @desc Behavior function for initializing component's variables and tables + * @param p_positionTable Table containing position vectors of all nodes + * @param p_areaTable Table containing all defined geoAreas + * @param p_componentName Name of the component + */ + function f_initialiseComponent( + in PositionTable p_positionTable, + in GeoAreaTable p_areaTable, + in charstring p_componentName) + runs on ItsGeoNetworking { + + vc_positionTable := p_positionTable; + vc_areaTable := p_areaTable; + vc_componentName := p_componentName; + + vc_localSeqNumber := f_getInitialSequenceNumber(); + vc_multipleMessagesCount := f_getMessageCount(); + + } // end f_initialiseComponent + + /** + * @desc Makes the simulated ITS node behave as a neighbour of IUT + */ + function f_startBeingNeighbour() runs on ItsGeoNetworking { + + vc_neighbourDefault := activate(a_neighbourDefault()); + f_acTriggerEvent(m_startBeaconing(m_beaconHeader(f_getPosition(vc_componentName)).beaconHeader)); + f_sleepIgnoreDef(PX_NEIGHBOUR_DISCOVERY_DELAY); + } // end f_startBeingNeighbour + + /** + * @desc Makes the simulated ITS node behave as not being a neighbour of IUT + */ + function f_stopBeingNeighbour() runs on ItsGeoNetworking { + + f_acTriggerEvent(m_stopBeaconing); + if (PICS_GN_SECURITY == true) { + deactivate(vc_neighbourDefault); + } + } // end f_stopBeingNeighbour + + /** + * @desc Initialise secure mode if required + */ + function f_initialiseSecuredMode() runs on ItsBaseGeoNetworking { + + // Local variables + + // Load certificates + if (PICS_GN_SECURITY == true) { + if( not f_loadCertificates(PX_IUT_SEC_CONFIG_NAME) ) { + log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); + stop; + } + + // Initialize vc_location + f_setGenerationLocation( + f_getTsLatitude(), + f_getTsLongitude() + ); + } else if (PICS_IS_IUT_SECURED == true) { + if(e_success != f_acEnableSecurity()){ + log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); + stop; + } + } + } // End of function f_initialiseSecuredMode() + + function f_uninitialiseSecuredMode() runs on ItsBaseGeoNetworking { + if ((PICS_GN_SECURITY == true) or (PICS_IS_IUT_SECURED == true)) { + f_acDisableSecurity(); + } + } // End of function f_uninitialiseSecuredMode() + + } // end geoConfigurationFunctions + + group componentFunctions { + /** + * @desc Get the component corresponding to a key + * @param p_componentName Name searched component + * @return ItsGeoNetworking - The searched position vector + */ + function f_getComponent( + in charstring p_componentName + ) runs on ItsMtc + return ItsGeoNetworking { + + var ItsGeoNetworking v_return := null; + var integer i := 0; + + for (i:=0; i value v_ind { + //store every upper tester indication received + vc_utInds[lengthof(vc_utInds)] := v_ind; + repeat; + } + [vc_utDefaultActive] utPort.receive { + log("*** " & testcasename() & ": INFO: Received unexpected UT message from IUT ***"); + repeat; + } + } + + /** + * @desc Default handling cf01 de-initialisation. + */ + altstep a_cf01Down() runs on ItsGeoNetworking { + [] a_shutdown() { + f_poDefault(); + f_cf01Down(); + log("*** a_cf01Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } + } + + /** + * @desc Default handling cf02 de-initialisation. + */ + altstep a_cf02Down() runs on ItsMtc { + [] a_shutdown() { + f_cf02Down(); + log("*** a_cf02Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } + } + + /** + * @desc Default handling cf03 de-initialisation. + */ + altstep a_cf03Down() runs on ItsMtc { + [] a_shutdown() { + f_cf03Down(); + log("*** a_cf03Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } + } + + /** + * @desc Default handling cf04 de-initialisation. + */ + altstep a_cf04Down() runs on ItsMtc { + [] a_shutdown() { + f_cf04Down(); + log("*** a_cf04Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } + } + + /** + * @desc Default handling cf05 de-initialisation. + */ + altstep a_cf05Down() runs on ItsMtc { + [] a_shutdown() { + f_cf05Down(); + log("*** a_cf05Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } + } + + /** + * @desc Default handling cf06 de-initialisation. + */ + altstep a_cf06Down() runs on ItsMtc { + [] a_shutdown() { + f_cf06Down(); + log("*** a_cf06Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } + } + + /** + * @desc Default handling cf07 de-initialisation. + */ + altstep a_cf07Down() runs on ItsMtc { + [] a_shutdown() { + f_cf07Down(); + log("*** a_cf07Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } + } + group geoGeoUnicastAltsteps { + + /** + * @desc Receive GeoUnicast packet + * @param p_sourceLongPosVec Expected source position vector + * @param p_destinationShortPosVec Expected destination position vector + * @param p_seqNumber Expected sequence number + */ + altstep a_receiveGeoUnicast( + in template (present) ShortPosVector p_destinationShortPosVec, + in template (present) UInt16 p_seqNumber + ) runs on ItsGeoNetworking { + + [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwUnicastPacket( + p_destinationShortPosVec, + p_seqNumber)))) { + } + } + + /** + * @desc Receive GeoUnicast packet for specific destination + * @param p_destinationShortPosVec Expected destination position vector + */ + altstep a_receiveGeoUnicastWithDestination(in template (present) ShortPosVector p_destinationShortPosVec) runs on ItsGeoNetworking { + + [vc_gnDefaultActive] a_receiveGeoUnicast(p_destinationShortPosVec, ?) {} + } + + /** + * @desc Receive any GeoUnicast packet + */ + altstep a_receiveAnyGeoUnicast() runs on ItsGeoNetworking { + + [vc_gnDefaultActive] a_receiveGeoUnicast(?, ?) {} + } + + } // end geoGeoUnicastAltsteps + + group geoGeoBroadcastAltsteps { + + /** + * @desc Receive GeoBroadcast packet + * @param p_srcLongPosVec Expected source position vector + * @param p_seqNumber Expected sequence number + */ + altstep a_receiveGeoBroadcast( + in template (present) LongPosVector p_srcLongPosVec, + in template (present) UInt16 p_seqNumber + ) runs on ItsGeoNetworking { + + [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacket( + p_srcLongPosVec, + p_seqNumber + )))) { + } + } + + /** + * @desc Receive GeoBroadcast packet with specific Area and HopLimit + * @param p_srcLongPosVec Expected source position vector + * @param p_seqNumber Expected sequence number + * @param p_broadcastArea Expected geoBroadcastArea + * @param p_routerHopLimit Expected router hop limit + * @param p_maxHopLimit Expected max hop limit (Default: ?) + */ + altstep a_receiveGeoBroadcastWithAreaWithHopLimit( + in template (present) LongPosVector p_srcLongPosVec, + in template (present) UInt16 p_seqNumber, + in template (present) GeoBroadcastArea p_broadcastArea, + in template (present) UInt8 p_routerHopLimit, + in template (present) UInt8 p_maxHopLimit := ? + ) runs on ItsGeoNetworking { + + [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithAreaAndHl( + p_srcLongPosVec, + p_seqNumber, + p_broadcastArea, + p_maxHopLimit + ), + -, + p_routerHopLimit + ))) { + } + } + + /** + * @desc Receive GeoBroadcast packet for specific Geobroadcast Area + * @param p_srcLongPosVec Expected source position vector + * @param p_seqNumber Expected sequence number + * @param p_broadcastArea Expected geoBroadcastArea + */ + altstep a_receiveGeoBroadcastWithArea( + in template (present) LongPosVector p_srcLongPosVec, + in template (present) UInt16 p_seqNumber, + in template (present) GeoBroadcastArea p_broadcastArea + ) runs on ItsGeoNetworking { + + [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( + p_srcLongPosVec, + p_seqNumber, + p_broadcastArea + )))) { + } + } + + } // end geoGeoBroadcastAltsteps + + group geoGeoAnycastAltsteps { + + /** + * @desc Receive GeoAnycast packet + * @param p_srcLongPosVec Expected source position vector + * @param p_senderLongPosVec Expected sender position vector + * @param p_seqNumber Expected sequence number + */ + altstep a_receiveGeoAnycast( + in template (present) LongPosVector p_srcLongPosVec, + in template (present) LongPosVector p_senderLongPosVec, + in template (present) UInt16 p_seqNumber + ) runs on ItsGeoNetworking { + + [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacket( + p_srcLongPosVec, + p_seqNumber + )))) { + } + } + + /** + * @desc Receive GeoAnycast packet with specific Area and HopLimit + * @param p_srcLongPosVec Expected source position vector + * @param p_senderLongPosVec Expected sender position vector + * @param p_seqNumber Expected sequence number + * @param p_anycastArea Expected geoAnycastArea + * @param p_hopLimit Expected hop limit + * @param p_maxHopLimit Expected max hop limit (Default: ?) + */ + altstep a_receiveGeoAnycastWithAreaWithHopLimit( + in template (present) LongPosVector p_srcLongPosVec, + in template (present) UInt16 p_seqNumber, + in template (present) GeoAnycastArea p_anycastArea, + in template (present) UInt8 p_hopLimit, + in template (present) UInt8 p_maxHopLimit := ? + ) runs on ItsGeoNetworking { + + [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( + p_srcLongPosVec, + p_seqNumber, + p_anycastArea + ), + -, + p_hopLimit + ))) { + } + } + + /** + * @desc Receive GeoAnycast packet for specific GeoAnycast Area + * @param p_srcLongPosVec Expected source position vector + * @param p_seqNumber Expected sequence number + * @param p_anycastArea Expected geoAnycastArea + */ + altstep a_receiveGeoAnycastWithArea( + in template (present) LongPosVector p_srcLongPosVec, + in template (present) UInt16 p_seqNumber, + in template (present) GeoAnycastArea p_anycastArea + ) runs on ItsGeoNetworking { + + [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( + p_srcLongPosVec, + p_seqNumber, + p_anycastArea + )))) { + } + } + + } // end geoGeoAnycastAltsteps + + group geoLocationServiceAltsteps { + + /** + * @desc Receive Location Service Request + * @param p_seqNumber Expected sequence number of the received LS Request + * @param p_mid GN address expected in received LS Request + * @param p_reqSrcPosVector Expected source position vector of the received LS Request + */ + altstep a_receiveLsRequest( + in template (present) UInt16 p_seqNumber, + in template (present) GN_Address.mid p_mid, + out LongPosVector p_reqSrcPosVector + ) runs on ItsGeoNetworking { + var GeoNetworkingInd v_msg; + + [vc_gnDefaultActive] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwLsRequestPacket( + p_seqNumber, + p_mid + ) + ) + ) + ) -> value v_msg { + p_reqSrcPosVector := valueof(v_msg.msgIn.gnPacket.packet.extendedHeader.lsRequestHeader.srcPosVector); + } + } + + /** + * @desc Receive any Location Service Request + */ + altstep a_receiveAnyLsRequest() runs on ItsGeoNetworking { + var LongPosVector v_reqSrcPosVector; + + [vc_gnDefaultActive] a_receiveLsRequest(?, ?, v_reqSrcPosVector) {} + } + + /** + * @desc Receive any Location Service Reply + */ + altstep a_receiveAnyLsReply() runs on ItsGeoNetworking { + [vc_gnDefaultActive] geoNetworkingPort.receive( mw_geoNwInd( mw_geoNwPdu( mw_geoNwLsReplyPacket(?, ?) ))) { + //ignore and repeat + repeat; + } + } + + /** + * @desc Receive Location Service Request and send Location Service Reply + * @param p_reqSeqNumber Expected sequence number of the received LS Request + * @param p_gnAddress GN address expected in received LS Request + * @param p_repSrcPosVector Source position vector of the sent LS Response + */ + altstep a_receiveLsRequestAndReply( + in template (present) UInt16 p_reqSeqNumber, + in template (value) GN_Address.mid p_mid, + in template (value) LongPosVector p_repSrcPosVector + ) runs on ItsGeoNetworking { + var LongPosVector v_repDstPosVector; + + [vc_gnDefaultActive] a_receiveLsRequest(p_reqSeqNumber, p_mid, v_repDstPosVector) { + f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(m_geoNwPdu( + m_geoNwLsReplyPacket( + p_repSrcPosVector, + f_longPosVector2ShortPosVector(v_repDstPosVector), + vc_localSeqNumber + ))))); + } + } + + } // end geoLocationServiceAltsteps + + + } // end geoAltsteps + + group preambles { + + /** + * @desc The default preamble. + */ + function f_prDefault() runs on ItsGeoNetworking { + activate(a_default()); + activate(a_utDefault()); + } + + /** + * @desc Preamble for non-neighbour nodes + */ + function f_prNonNeighbour() runs on ItsGeoNetworking { + f_prDefault(); + } + + /** + * @desc Preamble for neighbour nodes + */ + function f_prNeighbour() runs on ItsGeoNetworking { + f_prDefault(); + f_startBeingNeighbour(); + f_sleep(0.5); + } + + /** + * @desc Brings the IUT into an initial state. + * @remark Component variable vc_hashedId8ToBeUsed shall be set with the IUT certificate to be used + */ + function f_initialState(Scenario p_scenario := e_staticPosition) runs on ItsBaseGeoNetworking { + + if (PICS_GN_SECURITY) { + var Oct8 v_hashedId8ToBeUsed := f_setupIutCertificate(vc_hashedId8ToBeUsed); + if (oct2int(v_hashedId8ToBeUsed) == 0) { + v_hashedId8ToBeUsed := 'FFFFFFFFFFFFFFFF'O; // Reset to unknown value, the IUT will use its own certificates + } + f_utInitializeIut(m_secGnInitialize(v_hashedId8ToBeUsed)); + } // else, default behavior + else { + f_utInitializeIut(m_gnInitialize); + } + f_sleep(PX_NEIGHBOUR_DISCOVERY_DELAY); + + f_acLoadScenario(p_scenario); + f_acStartScenario(); + f_acAwaitTimeInRunningScenario(f_getTimeForGpsFix()); + } + + /** + * @desc Receive and reply to LS Requests + * @param p_reqSeqNumber Expected sequence number of the received LS Request + * @param p_gnAddress GN address expected in received LS Request + * @param p_repSrcPosVector Source position vector of the sent LS Response + * @param p_repSenderPosVector Sender position vector of the sent LS Response + */ + function f_handleLocationService( + in template (present) UInt16 p_reqSeqNumber, + in template (value) GN_Address.mid p_mid, + in template (value) LongPosVector p_repSrcPosVector, + in template (value) LongPosVector p_repSenderPosVector + ) runs on ItsGeoNetworking { + + tc_ac.start; + alt { + [] a_receiveLsRequestAndReply(p_reqSeqNumber, p_mid, p_repSrcPosVector) {//Spirent removed, p_repSenderPosVector) { + tc_ac.stop; + } + } + + } + + /** + * @desc Send LS request and receive LS Reply + * @param p_reqSrcPosVector Source position vector of the sent LS Request + * @param p_reqSeqNumber Sequence number of the sent LS Request + * @param p_gnAddress GN address for which the LS Request is sent + * @param p_repSrcPosVector Expected source position vector in received LS Response + * @return FncRetCode + */ + function f_processLocationService( + in template (value) LongPosVector p_reqSrcPosVector, + in template (value) UInt16 p_reqSeqNumber, + in template (value) GN_Address p_gnAddress, + out LongPosVector p_repSrcPosVector + ) runs on ItsGeoNetworking return FncRetCode { + var FncRetCode v_ret := e_error; + var GeoNetworkingInd v_msg; + + f_sendGeoNetMessage( + valueof( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwLsRequestPacket( + p_reqSrcPosVector, + p_reqSeqNumber, + p_gnAddress + ) + ) + ) + ) + ); + + tc_ac.start; + alt { + [] geoNetworkingPort.receive( + mw_geoNwInd( + mw_geoNwPdu( + mw_geoNwLsReplyPacket( + ?, + mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(valueof(p_reqSrcPosVector))) + ) + ) + ) + ) -> value v_msg { + tc_ac.stop; + p_repSrcPosVector := valueof(v_msg.msgIn.gnPacket.packet.extendedHeader.lsReplyHeader.srcPosVector); + v_ret := e_success; + } + } + + return v_ret; + } + + } // end preambles + + group postambles { + + /** + * @desc The default postamble. + */ + function f_poDefault() runs on ItsGeoNetworking { + f_acStopScenario(); + } + + /** + * @desc Postamble for neighbour nodes + */ + function f_poNeighbour() runs on ItsGeoNetworking { + f_stopBeingNeighbour(); + f_poDefault(); + } + + } // end postambles + + group adapterControl { + + /** + * @desc Triggers event in the test system adaptation. + * @param p_event The event to trigger + * @return FncRetCode + */ + function f_acTriggerEvent(template (value) AcGnPrimitive p_event) runs on ItsBaseGeoNetworking return FncRetCode { + var FncRetCode v_ret := e_success; + + acPort.send(p_event); + + return v_ret; + } + + /** + * @desc Get the position vector corresponding to a specific GN address + * @param p_gnAddress GN address for which the search is performed + * @return LongPosVector - IUT's position + */ + function f_acGetLongPosVector(GN_Address p_gnAddress) runs on ItsBaseGeoNetworking return LongPosVector { + var AcGnResponse v_result; + + f_acTriggerEvent(m_getLongPosVector(p_gnAddress)); + tc_ac.start; + alt { + [] acPort.receive(mw_getLongPosVectorAny(p_gnAddress)) -> value v_result { + tc_ac.stop; + } + [] acPort.receive { + tc_ac.stop; + log("*** f_acGetLongPosVector: ERROR: Received unexpected message ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] tc_ac.timeout { + log("*** f_acGetLongPosVector: ERROR: Timeout while waiting for adapter control event result ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } + + return v_result.getLongPosVector; + } + + /** + * @desc Triggers test adapter to send beacons for multiple neighbours + * @param p_numberOfNeighbour Number of neighbours to simulate + * @return FncRetCode + */ + function f_acStartBeaconingMultipleNeighbour(in integer p_numberOfNeighbour) runs on ItsGeoNetworking return FncRetCode { + + return f_acTriggerEvent(m_startBeaconingMultipleNeighbour(m_beaconHeader(f_getPosition(vc_componentName)).beaconHeader, p_numberOfNeighbour)); + + } + + /** + * @desc Triggers test adapter to enable security support + * @return FncRetCode + */ + function f_acEnableSecurity() runs on ItsBaseGeoNetworking return FncRetCode { + + // Local variables + + // Load certificates + if (PICS_GN_SECURITY) { + if( not f_loadCertificates(PX_IUT_SEC_CONFIG_NAME) ) { + return e_error; + } + + // Initialize vc_location + f_setGenerationLocation( + f_getTsLatitude(), + f_getTsLongitude() + ); + return f_acTriggerSecEvent(m_acEnableSecurity(cc_taCert_A)); + } + return f_acTriggerSecEvent(m_acEnableSecurity(PX_CERT_FOR_TS)); + } + + /** + * @desc Triggers test adapter to disable security support + * @return FncRetCode + */ + function f_acDisableSecurity() runs on ItsBaseGeoNetworking return FncRetCode { + + f_unloadCertificates(); + + return f_acTriggerSecEvent(m_acDisableSecurity); + + } + + /** + * @desc Triggers event in the test system adaptation. + * @param p_event The event to trigger + * @return FncRetCode + */ + function f_acTriggerSecEvent( + in template (value) AcSecPrimitive p_event + ) runs on ItsBaseGeoNetworking return FncRetCode { + var FncRetCode v_ret := e_success; + + acPort.send(p_event); + tc_ac.start; + alt { + [] acPort.receive(m_acSecResponseSuccess) { + tc_ac.stop; + } + [] acPort.receive { + tc_ac.stop; + log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] tc_ac.timeout { + log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for adapter control event result ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } + + return v_ret; + } + + /** + * @desc Triggers event in the test system adaptation. + * @param p_event The event to trigger + * @return FncRetCode + */ + function f_acTriggerGnssEvent(template (value) AcGnssPrimitive p_event) runs on ItsBaseGeoNetworking return FncRetCode { + var FncRetCode v_ret := e_success; + + acPort.send(p_event); + tc_ac.start; + alt { + [] acPort.receive(m_acGnssResponseSuccess) { + tc_ac.stop; + } + [] acPort.receive { + tc_ac.stop; + log("*** f_acTriggerGnssEvent: ERROR: Received unexpected message ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] tc_ac.timeout { + log("*** f_acTriggerGnssEvent: ERROR: Timeout while waiting for adapter control event result ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } + + return v_ret; + } + + /** + * @desc Loads the given scenario + * + * @param p_scenario The scenario to load. + */ + function f_acLoadScenario(Scenario p_scenario) runs on ItsBaseGeoNetworking { + + if (PX_GNSS_SCENARIO_SUPPORT==true) { + f_acTriggerGnssEvent(m_loadScenario(p_scenario)); + } + } // end f_acLoadScenario + + /** + * @desc Starts a loaded scenario + */ + function f_acStartScenario() runs on ItsBaseGeoNetworking { + + if (PX_GNSS_SCENARIO_SUPPORT==true) { + f_acTriggerGnssEvent(m_startScenario); + vc_scenarioStarted := true; + } + } // end f_acStartScenario + + /** + * @desc Stops a loaded scenario + */ + function f_acStopScenario() runs on ItsBaseGeoNetworking { + + if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { + f_acTriggerGnssEvent(m_stopScenario); + vc_scenarioStarted := false; + } + } // end f_acStopScenario + + function f_acAwaitTimeInRunningScenario(integer p_time) runs on ItsBaseGeoNetworking return FncRetCode { + var FncRetCode v_ret := e_success; + + if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { + f_acTriggerGnssEvent(m_timeInRunningScenario(p_time)); + + tc_ac.start(int2float(p_time)*1.1); + alt { + [] acPort.receive(m_acGnssTimeReachedSuccess) { + tc_ac.stop; + } + [] acPort.receive(m_acGnssTimeReachedError) { + tc_ac.stop; + log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] tc_ac.timeout { + log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for time reached indication ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } + + } + return v_ret; + } // end f_acAwaitTimeInRunningScenario + + } // end adapterControl + + group commonFunctions { + + /** + * @desc Gets the value of the lifetime in seconds. + * @param p_lifetime Lifetime to be converted + * @return Lifetime in seconds + */ + function f_getLifetimeValue(in Lifetime p_lifetime) runs on ItsGeoNetworking return float { + var float v_lifetime := 0.0; + + select (p_lifetime.ltBase) { + case (e_50ms) { + v_lifetime := int2float(p_lifetime.multiplier) * 0.5; + } + case (e_1s) { + v_lifetime := int2float(p_lifetime.multiplier) * 1.0; + } + case (e_10s) { + v_lifetime := int2float(p_lifetime.multiplier) * 10.0; + } + case (e_100s) { + v_lifetime := int2float(p_lifetime.multiplier) * 100.0; + } + } + + return v_lifetime; + } + + /** + * @desc Computes GN timestamp based on current time + * @return Unix-Epoch-Time mod 2^32 + */ + function f_computeGnTimestamp() return UInt32 { + + // Timestamp is 1s older than current time to avoid sending beacons coming from the future (time sync between nodes) + var UInt32 v_timestamp := fx_computeGnTimestamp() - 1000; + return v_timestamp; + } + + } // end commonFunctions + + group testerFunctions { + + /** + * @desc Gets the tester GN local address for a specific node + * @param p_node Simulated node + * @return GN address of simulated node + */ + function f_getTsGnLocalAddress(in charstring p_node) return GN_Address { + var GN_Address v_gnAddr := valueof(m_dummyGnAddr); + + select (p_node) { + case (c_compNodeA) { + v_gnAddr := PX_TS_NODE_A_LOCAL_GN_ADDR; + } + case (c_compNodeB) { + v_gnAddr := PX_TS_NODE_B_LOCAL_GN_ADDR; + } + case (c_compNodeC) { + v_gnAddr := PX_TS_NODE_C_LOCAL_GN_ADDR; + } + case (c_compNodeD) { + v_gnAddr := PX_TS_NODE_D_LOCAL_GN_ADDR; + } + case (c_compNodeE) { + v_gnAddr := PX_TS_NODE_E_LOCAL_GN_ADDR; + } + case (c_compNodeF) { + v_gnAddr := PX_TS_NODE_F_LOCAL_GN_ADDR; + } + case else { + log("*** f_getTsGnLocalAddress: INFO: Unknown component " & p_node & " ***"); + } + } + + return v_gnAddr; + } + + /** + * @desc Sends a GeoNetworking message and in case of an included sequence number in the message the + * local sequence number will be increased by one. + * @param p_geoNetReq The message to send. + */ + function f_sendGeoNetMessage(in template (value) GeoNetworkingReq p_geoNetReq) runs on ItsGeoNetworking { + geoNetworkingPort.send(p_geoNetReq); + if (not (ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.shbHeader) + or ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.beaconHeader))) { + f_setLocalSequenceNumber(); + } + } + + /** + * @desc Sends a GeoNetworking message with a payload and in case of an included sequence number in the message the + * local sequence number will be increased by one. + * @param p_geoNetReq The message to send. + * @param p_payload The payload to include. + */ + function f_sendGeoNetMessageWithPayload( + in template (value) GeoNetworkingReq p_geoNetReq, + in template (value) GnRawPayload p_payload + ) runs on ItsGeoNetworking { + p_geoNetReq.msgOut.gnPacket.packet.payload := p_payload; + geoNetworkingPort.send(p_geoNetReq); + if (not (ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.shbHeader) + or ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.beaconHeader))) { + f_setLocalSequenceNumber(); + } + } + + /** + * @desc Receive a GeoNetworking message with a payload and in case of an included sequence number in the message the + * local sequence number will be increased by one. + * @param p_geoNetInd The message to receive. + * @param p_payload The payload to include. + */ + function f_receiveGeoNetMessageWithPayload( + in template (present) GeoNetworkingInd p_geoNetInd, + in template (present) GnRawPayload p_payload + ) return template (present) GeoNetworkingInd { + var template (present) GeoNetworkingInd v_geoNetInd := p_geoNetInd; + + v_geoNetInd.msgIn.gnPacket.packet.payload := p_payload; + + return v_geoNetInd; + } + + /** + * @desc Sets the value of the sequence number for the next event. + */ + function f_setLocalSequenceNumber() runs on ItsGeoNetworking { + vc_localSeqNumber := (vc_localSeqNumber + 1) mod c_uInt16Max; + } + + /** + * @desc Creates an initial seqence number + * @return Time based initial sequence number (increasing with time) + */ + function f_getInitialSequenceNumber() return UInt16 { + + return (f_computeGnTimestamp() / 1000) mod c_uInt16Max; + } + + /** + * @desc Number of messages to be sent + * @return Number of messages to be sent + */ + function f_getMessageCount() return integer { + return PX_MESSAGE_COUNT; + } + + } // end testerFunctions + + group iutFunctions { + + /** + * @desc Gets the IUT GN local address + * @return IUT's GN_Address + * @see PICS_GN_LOCAL_GN_ADDR + */ + function f_getIutGnLocalAddress() return GN_Address { + + return PICS_GN_LOCAL_GN_ADDR; + } + + /** + * @desc Gets the IUT GN local address configuration method + * @return GnAddressConfigurationMethod - IUT's GN local address configuration method + * @see PICS_GN_LOCAL_ADDR_CONF_METHOD + */ + function f_getIutGnLocalAddressConfigurationMethod() return GnAddressConfigurationMethod { + return PICS_GN_LOCAL_ADDR_CONF_METHOD; + } + + /** + * @desc Gets the IUT MAc address + * @return MacAddress - IUT's MAc Address + * @see PICS_IUT_MAC_ADDRESS + */ + function f_getIutMacAddress() return MacAddress { + return PICS_IUT_MAC_ADDRESS; + } + + /** + * @desc Gets the GeoUnicast forwarding algorithm + * @return IUT's GeoUnicast forwarding algorithm + * @see PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM + */ + function f_getGeoUnicastForwardingAlgorithm() return GeoUnicastForwardingAlgorithm { + return PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM; + } + + /** + * @desc Gets the GeoBroadcast forwarding algorithm + * @return IUT's GeoBroadcast forwarding algorithm + * @see PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM + */ + function f_getGeoBroadcastForwardingAlgorithm() return GeoBroadcastForwardingAlgorithm { + return PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM; + } + + /** + * @desc Gets the IUT default hop limit + * @return IUT's default hop limit + * @see PICS_GN_DEFAULT_HOP_LIMIT + */ + function f_getDefaultHopLimit() return UInt8 { + return PICS_GN_DEFAULT_HOP_LIMIT; + } + + /** + * @desc Is the ITS-S mobile or stationary? + * @return Flags indicating whether the ITS-S is mobile or stationary. + * @see PICS_GN_IS_MOBILE + */ + function f_isMobile() return Bit8 { + if (PICS_GN_IS_MOBILE) { + return '10000000'B; + } + return '00000000'B; + } + + /** + * @desc Gets the LS retransmission timer.. Valid for NetRepInterval = default (cong. ctrl). + * @return LS retransmission timer in seconds + * @see PICS_GN_LOCATION_SERVICE_RETRANSMIT_TIMER + */ + function f_getLsRetransmitTimer() return float { + var float v_itsGnLocationServiceRetransmitTimer := int2float(PICS_GN_LOCATION_SERVICE_RETRANSMIT_TIMER/1000); + + return v_itsGnLocationServiceRetransmitTimer; + } + + /** + * @desc Gets the LS retransmission timer for NetRepInterval = medium (cong. ctrl). + * @return LS retransmission timer (medium) in seconds + * @see PX_GN_LOCATION_SERVICE_TIMER_MEDIUM + */ + function f_getLsRetransmitTimerMedium() return float { + var float v_itsGnLocationServiceRetransmitTimerMedium := int2float(PX_GN_LOCATION_SERVICE_TIMER_MEDIUM/1000); + + return v_itsGnLocationServiceRetransmitTimerMedium; + } + + /** + * @desc Gets the LS retransmission timer for NetRepInterval = maximum (cong. ctrl). + * @return LS retransmission timer (maximum) in seconds + * @see PX_GN_LOCATION_SERVICE_TIMER_MAXIMUM + */ + function f_getLsRetransmitTimerMaximum() return float { + var float v_itsGnLocationServiceRetransmitTimerMaximum := int2float(PX_GN_LOCATION_SERVICE_TIMER_MAXIMUM/1000); + + return v_itsGnLocationServiceRetransmitTimerMaximum; + } + + /** + * @desc Gets the App retransmission timer. Valid for AppRepInterval = default (cong. ctrl). + * @return App retransmission timer in seconds + * @see PX_GN_APPLICATION_RETRANSMIT_TIMER + */ + function f_getAppRetransmitTimer() return float { + var float v_itsGnLocationApplicationRetransmitTimer := int2float(PX_GN_APPLICATION_RETRANSMIT_TIMER/1000); + + return v_itsGnLocationApplicationRetransmitTimer; + } + + /** + * @desc Gets the App retransmission timer for AppRepInterval = medium (cong. ctrl). + * @return App retransmission timer (medium) in seconds + * @see PX_GN_APPLICATION_RETRANSMIT_TIMER_MEDIUM + */ + function f_getAppRetransmitTimerMedium() return float { + var float v_itsGnLocationApplicationRetransmitTimerMedium := int2float(PX_GN_APPLICATION_RETRANSMIT_TIMER_MEDIUM/1000); + + return v_itsGnLocationApplicationRetransmitTimerMedium; + } + + /** + * @desc Gets the App retransmission timer for AppRepInterval = maximum (cong. ctrl). + * @return App retransmission timer (maximum) in seconds + * @see PX_GN_APPLICATION_RETRANSMIT_TIMER_MAXIMUM + */ + function f_getAppRetransmitTimerMaximum() return float { + var float v_itsGnLocationApplicationRetransmitTimerMaximum := int2float(PX_GN_APPLICATION_RETRANSMIT_TIMER_MAXIMUM/1000); + + return v_itsGnLocationApplicationRetransmitTimerMaximum; + } + + /** + * @desc Gets the LS maximum retransmission number. + * @return LS maximum retransmission number + * @see PICS_GN_LOCATION_SERVICE_MAX_RETRANS + */ + function f_getLsMaxRetrans() return integer { + var integer v_itsGnLocationServiceMaxRetrans := PICS_GN_LOCATION_SERVICE_MAX_RETRANS; + + return v_itsGnLocationServiceMaxRetrans; + } + + /** + * @desc Gets the Application maximum retransmission number. + * @return Application maximum retransmission number + * @see PX_GN_APPLICATION_MAX_RETRANS + */ + function f_getAppMaxRetrans() return integer { + var integer v_itsGnApplicationMaxRetrans := PX_GN_APPLICATION_MAX_RETRANS; + + return v_itsGnApplicationMaxRetrans; + } + + /** + * @desc Gets the Location Service packet buffer size. + * @return Location Service packet buffer size in Kbytes + * @see PICS_GN_LOCATION_SERVICE_PACKET_BUFFER_SIZE + */ + function f_getLsPacketBufferSize() return integer { + var integer v_itsGnLocationServicePacketBufferSize := PICS_GN_LOCATION_SERVICE_PACKET_BUFFER_SIZE; + + return v_itsGnLocationServicePacketBufferSize; + } // end f_getLsPacketBufferSize + + /** + * @desc Gets the UC forwarding packet buffer size. + * @return UC forwarding packet buffer size in bytes + * @see PICS_GN_UC_FORWARDING_PACKET_BUFFER_SIZE + */ + function f_getUcForwardingPacketBufferSize() return integer { + var integer v_itsGnUcForwardingPacketBufferSize := PICS_GN_UC_FORWARDING_PACKET_BUFFER_SIZE; + + return v_itsGnUcForwardingPacketBufferSize * 1024; + } // end f_getUcForwardingPacketBufferSize + + /** + * @desc Gets the BC forwarding packet buffer size. + * @return BC forwarding packet buffer size in bytes + * @see PICS_GN_BC_FORWARDING_PACKET_BUFFER_SIZE + */ + function f_getBcForwardingPacketBufferSize() return integer { + var integer v_itsGnBcForwardingPacketBufferSize := PICS_GN_BC_FORWARDING_PACKET_BUFFER_SIZE; + + return v_itsGnBcForwardingPacketBufferSize * 1024; + } // end f_getBcForwardingPacketBufferSize + + /** + * @desc Gets the maximum lifetime of a packet. + * @return Maximum lifetime of a packet in seconds + * @see PICS_GN_MAX_PACKET_LIFETIME + */ + function f_getMaxPacketLifeTime() return float { + var float v_itsGnMaxPacketLifetime := int2float(PICS_GN_MAX_PACKET_LIFETIME); + + return v_itsGnMaxPacketLifetime; + } + + /** + * @desc Gets delta for timers. + * @return Delta for timers in seconds + * @see PX_T_DELTA + */ + function f_getDeltaTimer() return float { + var float v_deltaTimer := PX_T_DELTA; + + return v_deltaTimer; + } + + /** + * @desc Gets the beacon service retransmit timer. + * @return Beacon service retransmit timer + */ + function f_getBsRetransmitTimer() return float { + var float v_itsGnBeaconServiceRetransmitTimer; + + v_itsGnBeaconServiceRetransmitTimer := int2float( + (PICS_GN_BEACON_SERVICE_RETRANSMIT_TIMER/1000)); + + return v_itsGnBeaconServiceRetransmitTimer; + } + + /** + * @desc Gets the beacon service retransmit timer for NetBeaconInterval = medium (cong. ctrl). + * @return Beacon service retransmit timer (medium) + */ + function f_getBsRetransmitTimerMedium() return float { + var float v_itsGnBeaconServiceRetransmitTimerMedium; // timer value increased (medium) + + v_itsGnBeaconServiceRetransmitTimerMedium := int2float( + (PX_GN_BEACON_SERVICE_TIMER_MEDIUM+float2int((f_getBsMaxJitter() - 0.0 +1.0)*rnd()) + 0)/1000); + + return v_itsGnBeaconServiceRetransmitTimerMedium; + } + + /** + * @desc Gets the beacon service retransmit timer for NetBeaconInterval = maximum (cong. ctrl). + * @return Beacon service retransmit timer (maximum) + */ + function f_getBsRetransmitTimerMaximum() return float { + var float v_itsGnBeaconServiceRetransmitTimerMaximum; // timer value increased (maximum) + + v_itsGnBeaconServiceRetransmitTimerMaximum := int2float( + (PX_GN_BEACON_SERVICE_TIMER_MAXIMUM+float2int((f_getBsMaxJitter() - 0.0 +1.0)*rnd()) + 0)/1000); + + return v_itsGnBeaconServiceRetransmitTimerMaximum; + } + + /** + * @desc Gets the maximum beacon service jitter. + * @return Maximum beacon service jitter + */ + function f_getBsMaxJitter() return float { + var float v_itsGnBeaconServiceMaxJitter := int2float(PICS_GN_BEACON_SERVICE_MAX_JITTER)/1000.0; + + return v_itsGnBeaconServiceMaxJitter; + } + + /** + * @desc Gets the Lifetime of a Location Table Entry. + * @return Lifetime of a Location Table Entry in seconds + * @see PICS_GN_LIFETIME_LOC_TE + */ + function f_getLifetimeLocTableEntry() return float { + var float v_itsGnLifetimeLocTableEntry := int2float(PICS_GN_LIFETIME_LOC_TE); + + return v_itsGnLifetimeLocTableEntry; + } // end f_getLifetimeLocTableEntry + + /** + * @desc Gets the maximum communication range for CBF algorithm + * @return Maximum communication range for CBF algorithm in meters + * @see PICS_GN_DEFAULT_MAX_COMMUNICATION_RANGE + */ + function f_getCbfMaxCommunicationRange() return integer { + var integer v_maxCommunicationRange := PICS_GN_DEFAULT_MAX_COMMUNICATION_RANGE; + + return v_maxCommunicationRange; + } // end f_getCbfMaxCommunicationRange + + function f_getGeoUnicastCbfMaxTime() return integer { + var integer v_cbfMaxTime := PICS_GN_GEOUNICAST_CBF_MAX_TIME; + + return v_cbfMaxTime; + } // end f_getGeoUnicastCbfMaxTime + + function f_getGeoUnicastCbfMinTime() return integer { + var integer v_cbfMinTime := PICS_GN_GEOUNICAST_CBF_MIN_TIME; + + return v_cbfMinTime; + } // end f_getGeoUnicastCbfMinTime + + function f_getGeoBroadcastCbfMaxTime() return integer { + var integer v_cbfMaxTime := PICS_GN_GEOBROADCAST_CBF_MAX_TIME; + + return v_cbfMaxTime; + } // end f_getGeoBroadcastCbfMaxTime + + function f_getGeoBroadcastCbfMinTime() return integer { + var integer v_cbfMinTime := PICS_GN_GEOBROADCAST_CBF_MIN_TIME; + + return v_cbfMinTime; + } // end f_getGeoBroadcastCbfMinTime + + function f_getGnMaxAreaSize() return float { + var float v_maxAreaSize := PICS_GN_MAX_GEO_AREA_SIZE; + + return v_maxAreaSize; + } // end f_getGnMaxAreaSize + + function f_getAdvancedGbcForwardingMaxCounter() return integer { + var integer v_maxCounter := PICS_GN_ADVANCED_BC_FORWARDING_MAX_COUNTER; + + return v_maxCounter; + } + + /** + * @desc Set the number of neighbour in the Location Table. + * @see PX_MIN_NR_NEIGHBOUR + */ + function f_setNrNeighbourLocTableDefault() runs on ItsGeoNetworking { + var integer v_nrNeighbour := f_random (0, PX_MIN_NR_NEIGHBOUR); + + f_acStartBeaconingMultipleNeighbour(v_nrNeighbour); + + } // end f_setNrNeighbourLocTableDefault + + /** + * @desc Set the number of neighbour in the Location Table (medium). + * @see PX_MIN_NR_NEIGHBOUR + * @see PX_MAX_NR_NEIGHBOUR + */ + function f_setNrNeighbourLocTableMedium() runs on ItsGeoNetworking { + var integer v_nrNeighbour := f_random (PX_MIN_NR_NEIGHBOUR, PX_MAX_NR_NEIGHBOUR); + + f_acStartBeaconingMultipleNeighbour(v_nrNeighbour); + + } // end f_setNrNeighbourLocTableMedium + + /** + * @desc Set the number of neighbour in the Location Table (maximum). + * @see PX_MAX_NR_NEIGHBOUR + * @see PX_MIN_NR_NEIGHBOUR + */ + function f_setNrNeighbourLocTableMaximum() runs on ItsGeoNetworking { + var integer v_nrNeighbour := f_random (PX_MAX_NR_NEIGHBOUR, (2*PX_MIN_NR_NEIGHBOUR)); + + f_acStartBeaconingMultipleNeighbour(v_nrNeighbour); + + } // end f_setNrNeighbourLocTableMaximum + + } // end iutFunctions + + group posVectorFunctions { + + /** + * @desc Convert long position vector to short position vector + * @param p_longPosVector Long position vector to be converted + * @return Short position vector + */ + function f_longPosVector2ShortPosVector(in LongPosVector p_longPosVector) return ShortPosVector { + var ShortPosVector v_shortPosVector; + + v_shortPosVector := { + gnAddr := p_longPosVector.gnAddr, + timestamp_ := p_longPosVector.timestamp_, + latitude := p_longPosVector.latitude, + longitude := p_longPosVector.longitude + }; + + return v_shortPosVector; + } + + /** + * @desc Get IUT's long position vector + * @return IUT's long position vector + */ + function f_getIutLongPosVector() runs on ItsBaseGeoNetworking return LongPosVector { + return f_acGetLongPosVector(f_getIutGnLocalAddress()); + } + function f_getIutLongPosVector_1(inout LongPosVector p_longPosVectorIut) runs on ItsGeoNetworking { + p_longPosVectorIut := f_acGetLongPosVector(f_getIutGnLocalAddress()); + } + + /** + * @desc Get IUT's short position vector + * @return IUT's short position vector + */ + function f_getIutShortPosVector() runs on ItsGeoNetworking return ShortPosVector { + var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); + + if (not isbound(v_longPosVectorIut)) { + v_longPosVectorIut := f_getIutLongPosVector(); + } + return f_longPosVector2ShortPosVector(v_longPosVectorIut); + } + + /** + * @desc Compute a position using a reference position, a distance and an orientation + * @param p_iutLongPosVector Reference position + * @param p_distance Distance to the reference position (in meter) + * @param p_orientation direction of the computed position (0 to 359; 0 means North) + * @return LongPosVector + */ + function f_computePositionUsingDistance(in LongPosVector p_iutLongPosVector, in float p_distance, in integer p_orientation) + return LongPosVector { + var LongPosVector v_result := p_iutLongPosVector; + + log("*** f_computePositionUsingDistance: INFO: calling fx_computePositionUsingDistance() ***"); + fx_computePositionUsingDistance(p_iutLongPosVector.latitude, p_iutLongPosVector.longitude, p_distance, p_orientation, v_result.latitude, v_result.longitude); + + return v_result; + } + + } // end posVectorFunctions + + group externalFunctions { + + /** + * @desc External function to compute timestamp based on current time + * @return Unix-Epoch-Time mod 2^32 + */ + external function fx_computeGnTimestamp() return UInt32; + + } // End of group externalFunctions + + group security { + + /** + * @desc Waiting for the GN message with Security + * @param p_InSecMsg SecurityMessage template + * @param p_received returns received SecurityMessage + */ + altstep a_securedMessage ( + in template (present) EtsiTs103097Data p_InSecMsg, + out EtsiTs103097Data p_received + ) runs on ItsGeoNetworking { + var GeoNetworkingInd v_geoNw; + [] geoNetworkingPort.receive(mw_geoNwInd( + mw_geoNwSecPdu( + p_InSecMsg, + mw_geoNwAnyPacket_withPayload(?) + ))) -> value v_geoNw { + p_received := f_getSecuredMessage(v_geoNw.msgIn); + } + } // End of 'altstep' statement + + /** + * @desc Receive GN message with security containing certificate as a signer info + * @param p_cert returns the certificate used for sign received message + */ + altstep a_securedMessageWithCertificate( + out EtsiTs103097Data p_received + ) runs on ItsGeoNetworking { + + [] a_securedMessage ( + mw_etsiTs103097Data_signed( + mw_signedData( + -, + mw_toBeSignedData( + mw_signedDataPayload + ), + mw_signerIdentifier_certificate // containing certificate + ) + ), + p_received + ) { + // Nothing to do + } + } // End of altstep a_securedMessageWithCertificate + + /** + * @desc Receive GN message with security containing digest as a signer info + * @param p_cert returns the certificate used for sign received message + */ + altstep a_securedMessageWithDigest( + out EtsiTs103097Data p_received + ) runs on ItsGeoNetworking { + [] a_securedMessage ( + mw_etsiTs103097Data_signed( + mw_signedData( + -, + mw_toBeSignedData( + mw_signedDataPayload + ), + mw_signerIdentifier_digest // containing digest + ) + ), + p_received + ) { + // Nothing to do + } + } // End of altstep a_securedMessageWithDigest + + } // End of group altSteps + + group waitingHelpers { + + /** + * @desc Wait for GN message with security containing certificate as a signer info + * @return the certificate used for sign received message + */ + function f_waitForCertificate( + out EtsiTs103097Certificate p_cert + ) runs on ItsGeoNetworking return boolean { + var EtsiTs103097Data v_recv; + var boolean v_ret := false; + + alt { + [] a_securedMessageWithCertificate(v_recv) { + var SignerIdentifier v_signerIdentifier; + if (f_getMsgSignerIdentifier(v_recv, v_signerIdentifier) == true) { + if (ischosen(v_signerIdentifier.certificate)) { + p_cert := v_signerIdentifier.certificate[0]; + v_ret := true; + } + } + } + } // End of 'alt' statement + + return v_ret; + } // End of function f_waitForCertificate + + /** + * @desc Ask for the certificate chain and wait for GN message with security containing certificate chain as a signer info + * @return the certificate chain used for sign received message + */ + function f_askForCertificateChain (in template(value) octetstring p_CamPayload) + runs on ItsGeoNetworking + return boolean { + var EtsiTs103097Data v_recv; + var boolean v_ret := false; + + alt { + [] a_securedMessageWithCertificate(v_recv) { + var SignerIdentifier v_signerIdentifier; + if (f_getMsgSignerIdentifier(v_recv, v_signerIdentifier) == true) { // Get AT certificate + if(ischosen(v_signerIdentifier.digest)) { + f_sendCertificateRequest(v_signerIdentifier.digest, p_CamPayload); // Request issuer + if(tc_ac.running) { + tc_ac.stop; + tc_ac.start; + } + v_ret := true; + } + } + } + } + return v_ret; + } // End of function f_askForCertificateChain + + /** + * @desc Ask for the certificate chain and wait for GN message with security containing certificate chain as a signer info + * @return the certificate chain used for sign received message + */ + function f_askAndWaitForCertificateChain( + out SequenceOfCertificate p_chain, + in template(value) octetstring p_CamPayload + ) runs on ItsGeoNetworking return boolean { + // Local variables + var EtsiTs103097Data v_recv; + var SignerIdentifier v_signerIdentifier; + var boolean v_ret := false; + + f_askForCertificateChain(p_CamPayload); // Get AT certificate and request for the issuer + alt { + [] a_securedMessageWithCertificate(v_recv) { // Get AA certificate + tc_ac.stop; + + if (f_getMsgSignerIdentifier(v_recv, v_signerIdentifier) == true) { + p_chain := v_signerIdentifier.certificate; + } + } + } // End of 'alt' statement + + return v_ret; + } // End of function f_askAndWaitForCertificateChain + + /** + * @desc Send a CAM message with a certificate and wait the certificate chain request message + * @remark This function is used only for testing against another ATS + * @param p_certificate The certificate identifier + * @param p_CamPayload The CAM paylaod + * @return true on success, flase otherwise + */ + function f_sendCertificateAndWaitForCertificateChainRequest( + in charstring p_certificate, + in template(value) octetstring p_CamPayload + ) runs on ItsGeoNetworking return boolean { + // Local variables + var EtsiTs103097Data v_recv; + + f_sendCertificate(p_certificate, p_CamPayload); + /* FIXME To be reviewed alt { + [] a_securedMessage ( + mw_securedMessage( + superset( + mw_header_field_unrecognised_certificate + )), + v_recv + ) { + // Nothing to do + log("*** " & testcasename() & ": DEBUG: Receive certificate ***") + } + }*/ // End of 'alt' statement + + return true; + } // End of function f_sendCertificateAndWaitForCertificateChainRequest + + } // End of group waitingHelpers + + group CertRequests{ + + function f_sendCertificateRequest( + in template (value) HashedId8 p_digest, + in template (value) octetstring p_payload + ) runs on ItsGeoNetworking { + var GeoNetworkingReq v_gnReq; + var GnNonSecuredPacket v_gnNonSecuredPacket; + var template (value) ToBeSignedData v_toBeSignedData; + var template (value) EtsiTs103097Data v_securedMessage; + + // Build signed EtsiTs103097Data + v_gnNonSecuredPacket := valueof(m_geoNwShbPacket( + f_getPosition(c_compNodeC) // FIXME To be verified YANN + )); + // Add CAM payload + v_gnNonSecuredPacket.payload := valueof(p_payload); + + /* FIXME To be reviewed f_buildGnSecuredCam( + v_securedMessage, + m_payload_signed(bit2oct(encvalue(v_gnNonSecuredPacket))), + e_certificate, + { + m_header_field_unrecognised_certificate( + f_HashedId3FromHashedId8( + valueof(p_digest) + )) + }, + "" + ); + + // Build secured Gn packet + v_gnReq := valueof(m_geoNwReq_linkLayerBroadcast( + m_geoNwSecPdu( + v_gnNonSecuredPacket, + v_securedMessage + ) // End of template m_geoNwSecPdu + )); // End of template m_geoNwReq_linkLayerBroadcast + + // Send Message + f_sendGeoNetMessage(v_gnReq);*/ + + } // End of function f_sendCertificateRequest + + /** + * @desc Send a CAM message with a certificate + * @remark This function is used only for testing against another ATS + * @param p_certificate The certificate identifier + * @param p_CamPayload The CAM paylaod + * @return true on success, flase otherwise + * @see f_sendCertificateAndWaitForCertificateChainRequest + */ + function f_sendCertificate( + in charstring p_certificate, + in template (value) octetstring p_payload + ) runs on ItsGeoNetworking { + var GeoNetworkingReq v_gnReq; + var GnNonSecuredPacket v_gnNonSecuredPacket; + var template (value) ToBeSignedData v_toBeSignedData; + var template (value) EtsiTs103097Data v_securedMessage; + + // Build signed EtsiTs103097Data + /* FIXME To be reviewed v_gnNonSecuredPacket := valueof(m_geoNwShbPacket( + f_getPosition(c_compNodeC) // FIXME To be verified YANN + )); + // Add CAM payload + v_gnNonSecuredPacket.payload := valueof(p_payload); + + f_buildGnSecuredCam( + v_securedMessage, + m_payload_signed(bit2oct(encvalue(v_gnNonSecuredPacket))), + e_certificate, + -, + p_certificate + ); + + // Build secured Gn packet + v_gnReq := valueof(m_geoNwReq_linkLayerBroadcast( + m_geoNwSecPdu( + v_gnNonSecuredPacket, + v_securedMessage + ) // End of template m_geoNwSecPdu + )); // End of template m_geoNwReq_linkLayerBroadcast + + // Send Message + f_sendGeoNetMessage(v_gnReq);*/ + + } // End of function f_sendCertificate + + } // End of group CertRequests + + group messageGetters { + + /** + * @desc return EtsiTs103097Data field of GeoNetworking packet + * @param p_msg GeoNetworking packet + * @return the EtsiTs103097Data if any + */ + function f_getSecuredMessage(in GeoNetworkingPdu p_msg) + return EtsiTs103097Data { + return p_msg.gnPacket.securedMsg; + } + + } + +} // end LibItsGeoNetworking_Functions diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Pics.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Pics.ttcn index abb5fd2c..44d39750 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Pics.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Pics.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/GeoNetworking/LibItsGeoNetworking_Pics.ttcn $ + * $Id: LibItsGeoNetworking_Pics.ttcn,v 1.4 2018/05/31 15:57:10 dte Exp $ * @desc GeoNetworking PICS * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Pixits.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Pixits.ttcn index 67ce401d..b0e8d756 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Pixits.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Pixits.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/GeoNetworking/LibItsGeoNetworking_Pixits.ttcn $ + * $Id: LibItsGeoNetworking_Pixits.ttcn,v 1.4 2018/05/31 15:57:10 dte Exp $ * @desc GeoNetworking PICS * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. @@ -179,7 +179,7 @@ module LibItsGeoNetworking_Pixits { /** * @desc Is BTP header present in IUT's UT indication. Only applicable if PX_GN_UPPER_LAYER == e_btpA or e_btpB. - * @remark It may happen that IUT do not report BTP header in UT indications (dur to GN/BTP merge) + * @remark It may happen that IUT do not report BTP header in UT indications (due to GN/BTP merge) * @see ETSI TS 102 871-3 Table B.7 */ modulepar boolean PX_BTP_IN_UT_IND := true; diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn index eb665f31..39a94c33 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn $ + * $Id: LibItsGeoNetworking_Templates.ttcn,v 1.5 2018/05/31 15:57:10 dte Exp $ * @desc GeoNetworking Templates * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. @@ -47,9 +47,9 @@ module LibItsGeoNetworking_Templates { * @param p_geoNwMsg GeoNetworking packet to be sent * @param p_its_aid ITS-AID used in secured mode. Default: 0, means unused */ - template (omit) GeoNetworkingReq m_geoNwReq_linkLayerBroadcast( - in template (value) GeoNetworkingPdu p_geoNwMsg, - in template (value) UInt32 p_its_aid := 0 + template (value) GeoNetworkingReq m_geoNwReq_linkLayerBroadcast( + in template (value) GeoNetworkingPdu p_geoNwMsg, + in template (value) UInt32 p_its_aid := 0 ) := { msgOut := p_geoNwMsg, macDestinationAddress := c_llBroadcast, @@ -62,10 +62,10 @@ module LibItsGeoNetworking_Templates { * @param p_its_aid ITS-AID used in secured mode. Default: 0, means unused * @param p_llDestinationAdress Link-layer destination address */ - template (omit) GeoNetworkingReq m_geoNwReq_withLinkLayerDestination( - in template (value) GeoNetworkingPdu p_geoNwMsg, - in template (value) UInt32 p_its_aid := 0, - in template (value) MacAddress p_llDestinationAdress + template (value) GeoNetworkingReq m_geoNwReq_withLinkLayerDestination( + in template (value) GeoNetworkingPdu p_geoNwMsg, + in template (value) UInt32 p_its_aid := 0, + in template (value) MacAddress p_llDestinationAdress ) modifies m_geoNwReq_linkLayerBroadcast := { macDestinationAddress := p_llDestinationAdress } @@ -74,8 +74,8 @@ module LibItsGeoNetworking_Templates { * @desc Receive template for GeoNetworking packet (GeonetworkingPort Primitive) * @param p_geoNwMsg GeoNetworking packet to be received */ - template(present) GeoNetworkingInd mw_geoNwInd( - template (present) GeoNetworkingPdu p_geoNwMsg := ? + template(present) GeoNetworkingInd mw_geoNwInd( + template (present) GeoNetworkingPdu p_geoNwMsg := ? ) := { msgIn := p_geoNwMsg, macDestinationAddress := ?, @@ -486,9 +486,9 @@ module LibItsGeoNetworking_Templates { * @param p_hopLimit Router Hop limit of GeoNetworking message (Default: ?) */ template (present) GeoNetworkingPdu mw_geoNwPdu( - in template (present) GnNonSecuredPacket p_packet, - in template (present) Lifetime p_lifeTime := ?, - in template (present) UInt8 p_hopLimit := ? + template (present) GnNonSecuredPacket p_packet, + template (present) Lifetime p_lifeTime := ?, + template (present) UInt8 p_hopLimit := ? ) := { basicHeader := mw_basicHeader(p_lifeTime, p_hopLimit), gnPacket := { @@ -503,8 +503,8 @@ module LibItsGeoNetworking_Templates { * @param p_packet Clear-text version of the packet */ template (present) GeoNetworkingPdu mw_geoNwSecPdu( - in template (present) EtsiTs103097Data p_secMsg, - in template (present) GnNonSecuredPacket p_packet := ? + template (present) EtsiTs103097Data p_secMsg, + template (present) GnNonSecuredPacket p_packet := ? ) := { basicHeader := mw_securedBasicHeader(), gnPacket := { @@ -590,8 +590,8 @@ module LibItsGeoNetworking_Templates { * @param p_extHeader Extended header of GeoNetworking packet */ template (present) GeoNetworkingPacket mw_geoNwPacket( - in template (present) CommonHeader p_commonHeader, - in template (present) ExtendedHeader p_extHeader + template (present) CommonHeader p_commonHeader := ?, + template (present) ExtendedHeader p_extHeader := ? ) := { packet := { commonHeader := p_commonHeader, @@ -608,11 +608,9 @@ module LibItsGeoNetworking_Templates { * * @see mw_geoNwPacket */ -//FIXME RGY template restriction can be the same as its base template: template is not used currently -// template GeoNetworkingPacket mw_geoNwPduAnyPayload( template(present) GeoNetworkingPacket mw_geoNwPduAnyPayload( - in template (present) CommonHeader p_commonHeader, - in template (present) ExtendedHeader p_extHeader + template (present) CommonHeader p_commonHeader := ?, + template (present) ExtendedHeader p_extHeader := ? ) modifies mw_geoNwPacket := { packet := { payload := ? @@ -627,12 +625,10 @@ module LibItsGeoNetworking_Templates { * * @see mw_geoNwPacket */ -//FIXME RGY template restriction can be the same as its base template: template is not used currently -// template GeoNetworkingPacket mw_geoNwPduWithOctetstringPayload( template(present) GeoNetworkingPacket mw_geoNwPduWithOctetstringPayload( - in template (present) CommonHeader p_commonHeader, - in template (present) ExtendedHeader p_extHeader, - in template (present) octetstring p_payload + template (present) CommonHeader p_commonHeader := ?, + template (present) ExtendedHeader p_extHeader := ?, + template (present) octetstring p_payload := ? ) modifies mw_geoNwPacket := { packet := { payload := p_payload @@ -647,12 +643,10 @@ module LibItsGeoNetworking_Templates { * * @see mw_geoNwPacket */ -//FIXME RGY template restriction can be the same as its base template: used in TC_SEC_ITSS_SND_CAM_02_01_BV only, where is called with parameters -// template GeoNetworkingPacket mw_geoNwPduWithPayload( template(present) GeoNetworkingPacket mw_geoNwPduWithPayload( - in template (present) CommonHeader p_commonHeader := ?, - in template (present) ExtendedHeader p_extHeader := ?, - in template (present) GnRawPayload p_payload := ? + template (present) CommonHeader p_commonHeader := ?, + template (present) ExtendedHeader p_extHeader := ?, + template (present) GnRawPayload p_payload := ? ) modifies mw_geoNwPacket := { packet := { payload := p_payload @@ -757,8 +751,8 @@ module LibItsGeoNetworking_Templates { * @param p_seqNumber Sequence number of GeoUnicast packet */ template (present) GnNonSecuredPacket mw_geoNwUnicastPacket( - in template (present) ShortPosVector p_destinationShortPosVec, - in template (present) UInt16 p_seqNumber + template (present) ShortPosVector p_destinationShortPosVec, + template (present) UInt16 p_seqNumber ) := { commonHeader := mw_commonHeader( PX_GN_UPPER_LAYER, @@ -779,9 +773,9 @@ module LibItsGeoNetworking_Templates { * @see mw_geoNwUnicastPacket */ template (present) GnNonSecuredPacket mw_geoNwUnicastPacketWithHl( - in template (present) ShortPosVector p_destinationShortPosVec, - in template (present) UInt16 p_seqNumber, - in template (present) UInt8 p_hopLimit := ? + template (present) ShortPosVector p_destinationShortPosVec, + template (present) UInt16 p_seqNumber, + template (present) UInt8 p_hopLimit := ? ) modifies mw_geoNwUnicastPacket := { commonHeader := mw_commonHeaderWithHopLimit( PX_GN_UPPER_LAYER, @@ -802,9 +796,9 @@ module LibItsGeoNetworking_Templates { * @param p_srcLongPosVec Long position vector of source */ template (present) GnNonSecuredPacket mw_geoNwUnicastPacketWithSourcePv( - in template (present) ShortPosVector p_destinationShortPosVec, - in template (present) UInt16 p_seqNumber, - in template (present) LongPosVector p_srcLongPosVec + template (present) ShortPosVector p_destinationShortPosVec, + template (present) UInt16 p_seqNumber, + template (present) LongPosVector p_srcLongPosVec ) modifies mw_geoNwUnicastPacket := { extendedHeader := mw_geoUnicastHeaderWithSourcePv( p_destinationShortPosVec, @@ -820,9 +814,9 @@ module LibItsGeoNetworking_Templates { * @param p_nextHeader Id of next header */ template (present) GnNonSecuredPacket mw_geoNwUnicastPacketWithNextHeader( - in template (present) ShortPosVector p_destinationShortPosVec, - in template (present) UInt16 p_seqNumber, - in template (present) NextHeader p_nextHeader + template (present) ShortPosVector p_destinationShortPosVec, + template (present) UInt16 p_seqNumber, + template (present) NextHeader p_nextHeader ) modifies mw_geoNwUnicastPacket := { commonHeader := { nextHeader := p_nextHeader @@ -913,10 +907,10 @@ module LibItsGeoNetworking_Templates { * @param p_maxHopLimit Maximum number of hops (Default := ?) */ template (present) GnNonSecuredPacket mw_geoNwAnycastPacketWithAreaAndHl( - in template (present) LongPosVector p_sourceLongPosVec, - in template (present) UInt16 p_seqNumber, - in template (present) GeoAnycastArea p_anycastArea, - in template (present) UInt8 p_maxHopLimit := ? + template (present) LongPosVector p_sourceLongPosVec, + template (present) UInt16 p_seqNumber, + template (present) GeoAnycastArea p_anycastArea, + template (present) UInt8 p_maxHopLimit := ? ) modifies mw_geoNwAnycastPacketWithArea := { commonHeader := mw_commonHeaderWithHopLimit( PX_GN_UPPER_LAYER, @@ -933,10 +927,10 @@ module LibItsGeoNetworking_Templates { * @param p_nextHeader Id of next header */ template (present) GnNonSecuredPacket mw_geoNwAnycastPacketWithAreaWithNextHeader( - in template (present) LongPosVector p_sourceLongPosVec, - in template (present) UInt16 p_seqNumber, - in template (present) GeoAnycastArea p_anycastArea, - in template (present) NextHeader p_nextHeader + template (present) LongPosVector p_sourceLongPosVec, + template (present) UInt16 p_seqNumber, + template (present) GeoAnycastArea p_anycastArea, + template (present) NextHeader p_nextHeader ) modifies mw_geoNwAnycastPacketWithArea := { commonHeader := { nextHeader := p_nextHeader @@ -982,8 +976,8 @@ module LibItsGeoNetworking_Templates { * @param p_seqNumber Sequence number of GeoBroadcast packet */ template (present) GnNonSecuredPacket mw_geoNwBroadcastPacket( - in template (present) LongPosVector p_sourceLongPosVec := ?, - in template (present) UInt16 p_seqNumber := ? + template (present) LongPosVector p_sourceLongPosVec := ?, + template (present) UInt16 p_seqNumber := ? ) := { commonHeader := mw_commonHeader( PX_GN_UPPER_LAYER, @@ -1003,9 +997,9 @@ module LibItsGeoNetworking_Templates { * @param p_nextHeader Id of next header */ template (present) GnNonSecuredPacket mw_geoNwBroadcastPacketWithNextHeader( - in template (present) LongPosVector p_sourceLongPosVec, - in template (present) UInt16 p_seqNumber, - in template (present) NextHeader p_nextHeader + template (present) LongPosVector p_sourceLongPosVec, + template (present) UInt16 p_seqNumber, + template (present) NextHeader p_nextHeader ) modifies mw_geoNwBroadcastPacket := { commonHeader := mw_commonHeader( p_nextHeader, @@ -1021,10 +1015,10 @@ module LibItsGeoNetworking_Templates { * @param p_payload payload */ template (present) GnNonSecuredPacket mw_geoNwBroadcastPacketWithNextHeaderAndPayload( - in template (present) LongPosVector p_sourceLongPosVec, - in template (present) UInt16 p_seqNumber, - in template (present) NextHeader p_nextHeader, - in template (present) GnRawPayload p_payload + template (present) LongPosVector p_sourceLongPosVec, + template (present) UInt16 p_seqNumber, + template (present) NextHeader p_nextHeader, + template (present) GnRawPayload p_payload ) modifies mw_geoNwBroadcastPacketWithNextHeader := { payload := p_payload } @@ -1036,9 +1030,9 @@ module LibItsGeoNetworking_Templates { * @param p_broadcastArea Destination GeoArea */ template (present) GnNonSecuredPacket mw_geoNwBroadcastPacketWithArea( - in template (present) LongPosVector p_sourceLongPosVec, - in template (present) UInt16 p_seqNumber, - in template (present) GeoBroadcastArea p_broadcastArea + template (present) LongPosVector p_sourceLongPosVec, + template (present) UInt16 p_seqNumber, + template (present) GeoBroadcastArea p_broadcastArea ) modifies mw_geoNwBroadcastPacket := { commonHeader := mw_commonHeader( PX_GN_UPPER_LAYER, @@ -1059,10 +1053,10 @@ module LibItsGeoNetworking_Templates { * @param p_maxHopLimit Maximum number of hops (Default := ?) */ template (present) GnNonSecuredPacket mw_geoNwBroadcastPacketWithAreaAndHl( - in template (present) LongPosVector p_sourceLongPosVec, - in template (present) UInt16 p_seqNumber, - in template (present) GeoBroadcastArea p_broadcastArea, - in template (present) UInt8 p_maxHopLimit := ? + template (present) LongPosVector p_sourceLongPosVec, + template (present) UInt16 p_seqNumber, + template (present) GeoBroadcastArea p_broadcastArea, + template (present) UInt8 p_maxHopLimit := ? ) modifies mw_geoNwBroadcastPacketWithArea := { commonHeader := mw_commonHeaderWithHopLimit( PX_GN_UPPER_LAYER, @@ -1079,10 +1073,10 @@ module LibItsGeoNetworking_Templates { * @param p_flags Flags in the common header (Default: ?) */ template (present) GnNonSecuredPacket mw_geoNwBroadcastPacketWithHlAndFlags( - in template (present) LongPosVector p_sourceLongPosVec, - in template (present) UInt16 p_seqNumber := ?, - in template (present) UInt8 p_hopLimit := ?, - in template (present) Bit8 p_flags := ? + template (present) LongPosVector p_sourceLongPosVec, + template (present) UInt16 p_seqNumber := ?, + template (present) UInt8 p_hopLimit := ?, + template (present) Bit8 p_flags := ? ) modifies mw_geoNwBroadcastPacket := { commonHeader := mw_commonHeaderWithHopLimitAndFlags( PX_GN_UPPER_LAYER, @@ -1099,10 +1093,10 @@ module LibItsGeoNetworking_Templates { * @param p_broadcastArea Destination GeoArea */ template (present) GnNonSecuredPacket mw_geoNwBroadcastPacketWithAreaWithNextHeader( - in template (present) LongPosVector p_sourceLongPosVec, - in template (present) UInt16 p_seqNumber, - in template (present) GeoBroadcastArea p_broadcastArea, - in template (present) NextHeader p_nextHeader + template (present) LongPosVector p_sourceLongPosVec, + template (present) UInt16 p_seqNumber, + template (present) GeoBroadcastArea p_broadcastArea, + template (present) NextHeader p_nextHeader ) modifies mw_geoNwBroadcastPacketWithArea := { commonHeader := { nextHeader := p_nextHeader @@ -1228,8 +1222,8 @@ module LibItsGeoNetworking_Templates { * @param p_nextHeader Next header (Default: e_any) */ template (present) GnNonSecuredPacket mw_geoNwBeaconPacket( - in template (present) LongPosVector p_sourceLongPosVec := ?, - in template (present) NextHeader p_nextHeader := e_any + template (present) LongPosVector p_sourceLongPosVec := ?, + template (present) NextHeader p_nextHeader := e_any ) := { commonHeader := mw_commonHeader_noPayload( p_nextHeader, @@ -1268,8 +1262,8 @@ module LibItsGeoNetworking_Templates { * @param p_hopLimit Maximum number of hops (Default: ?) */ template (present) GnNonSecuredPacket mw_geoNwShbPacket( - in template (present) LongPosVector p_sourceLongPosVec := ?, - in template (present) UInt8 p_hopLimit := ? + template (present) LongPosVector p_sourceLongPosVec := ?, + template (present) UInt8 p_hopLimit := ? ) := { commonHeader := mw_commonHeaderWithHopLimit( PX_GN_UPPER_LAYER, @@ -1315,8 +1309,8 @@ module LibItsGeoNetworking_Templates { * @param p_sourceLongPosVec Long position vector of source (Default: ?) */ template (present) GnNonSecuredPacket mw_geoNwTsbPacket( - in template (present) UInt16 p_seqNumber := ?, - in template (present) LongPosVector p_sourceLongPosVec := ? + template (present) UInt16 p_seqNumber := ?, + template (present) LongPosVector p_sourceLongPosVec := ? ) := { commonHeader := mw_commonHeader( PX_GN_UPPER_LAYER, @@ -1333,9 +1327,9 @@ module LibItsGeoNetworking_Templates { * @param p_hopLimit The maximum number of hops (Default: ?) */ template (present) GnNonSecuredPacket mw_geoNwTsbPacketWithHl( - in template (present) UInt16 p_seqNumber := ?, - in template (present) LongPosVector p_sourceLongPosVec := ?, - in template (present) UInt8 p_hopLimit := ? + template (present) UInt16 p_seqNumber := ?, + template (present) LongPosVector p_sourceLongPosVec := ?, + template (present) UInt8 p_hopLimit := ? ) modifies mw_geoNwTsbPacket := { commonHeader := mw_commonHeaderWithHopLimit( PX_GN_UPPER_LAYER, @@ -1351,8 +1345,8 @@ module LibItsGeoNetworking_Templates { * @param p_nextHeader Id of next header */ template (present) GnNonSecuredPacket mw_geoNwTsbPacketWithNextHeader( - in template (present) UInt16 p_seqNumber := ?, - in template (present) LongPosVector p_sourceLongPosVec := ?, + template (present) UInt16 p_seqNumber := ?, + template (present) LongPosVector p_sourceLongPosVec := ?, in template (value) NextHeader p_nextHeader ) modifies mw_geoNwTsbPacket := { commonHeader := { @@ -1472,8 +1466,8 @@ module LibItsGeoNetworking_Templates { * @param p_hopLimit Router Hop limit of GeoNetworking message */ template (present) BasicHeader mw_basicHeader( - in template (present) Lifetime p_lifeTime := ?, - in template (present) UInt8 p_hopLimit := ? + template (present) Lifetime p_lifeTime := ?, + template (present) UInt8 p_hopLimit := ? ) := { version := c_geoNwProtocolVersion, nextHeader := ?, @@ -1509,8 +1503,8 @@ module LibItsGeoNetworking_Templates { * @param p_hopLimit Router Hop limit of GeoNetworking message */ template (present) BasicHeader mw_securedBasicHeader( - in template (present) Lifetime p_lifeTime := ?, - in template (present) UInt8 p_hopLimit := ? + template (present) Lifetime p_lifeTime := ?, + template (present) UInt8 p_hopLimit := ? ) := { version := c_geoNwProtocolVersion, nextHeader := e_securedPacket, @@ -1598,8 +1592,8 @@ module LibItsGeoNetworking_Templates { * @param p_headerTypeSubType Header's type and sub-type */ template (present) CommonHeader mw_commonHeader_noPayload ( - in template (present) NextHeader p_nextHeader := ?, - in template (present) HeaderTST p_headerTypeSubType := ? + template (present) NextHeader p_nextHeader := ?, + template (present) HeaderTST p_headerTypeSubType := ? ) modifies mw_commonHeader := { plLength := 0 } @@ -1612,9 +1606,9 @@ module LibItsGeoNetworking_Templates { * @see mw_commonHeader */ template (present) CommonHeader mw_commonHeaderWithHopLimit ( - in template (present) NextHeader p_nextHeader := ?, - in template (present) HeaderTST p_headerTypeSubType := ?, - in template (present) UInt8 p_hopLimit := ? + template (present) NextHeader p_nextHeader := ?, + template (present) HeaderTST p_headerTypeSubType := ?, + template (present) UInt8 p_hopLimit := ? ) modifies mw_commonHeader := { maxHopLimit := p_hopLimit } @@ -1629,10 +1623,10 @@ module LibItsGeoNetworking_Templates { * @see mw_commonHeaderWithHopLimit */ template (present) CommonHeader mw_commonHeaderWithHopLimitAndFlags ( - in template (present) NextHeader p_nextHeader := ?, - in template (present) HeaderTST p_headerTypeSubType := ?, - in template (present) UInt8 p_hopLimit := ?, - in template (present) Bit8 p_flags := ? + template (present) NextHeader p_nextHeader := ?, + template (present) HeaderTST p_headerTypeSubType := ?, + template (present) UInt8 p_hopLimit := ?, + template (present) Bit8 p_flags := ? ) modifies mw_commonHeaderWithHopLimit := { flags := p_flags } @@ -1645,9 +1639,9 @@ module LibItsGeoNetworking_Templates { * @param p_trafficClass Packet's traffic class */ template (present) CommonHeader mw_commonHeaderWithTrafficClass ( - in template (present) NextHeader p_nextHeader := ?, - in template (present) HeaderTST p_headerTypeSubType := ?, - in template (present) TrafficClass p_trafficClass := ? + template (present) NextHeader p_nextHeader := ?, + template (present) HeaderTST p_headerTypeSubType := ?, + template (present) TrafficClass p_trafficClass := ? ) modifies mw_commonHeader := { trafficClass := p_trafficClass } @@ -1686,8 +1680,8 @@ module LibItsGeoNetworking_Templates { * @param p_stationCountryCode Station's country code */ template GN_Address mw_gnAddress( - in template (present) StationType p_stationType, - in template (present) UInt10 p_stationCountryCode + template (present) StationType p_stationType, + template (present) UInt10 p_stationCountryCode ) := { typeOfAddress := ?, stationType := p_stationType, @@ -1700,7 +1694,7 @@ module LibItsGeoNetworking_Templates { * @param p_gnAddress GN_Address to be contained in the long position vector */ template (present) LongPosVector mw_longPosVectorAny( - in template (present) GN_Address p_gnAddress := ? + template (present) GN_Address p_gnAddress := ? ) := { gnAddr := p_gnAddress, timestamp_ := ?, @@ -2099,8 +2093,8 @@ module LibItsGeoNetworking_Templates { * @param p_mid Searched GN_Address MID */ template (present) ExtendedHeader mw_lsRequestHeader( - in template (present) UInt16 p_seqNumber := ?, - in template (present) GN_Address.mid p_mid := ? + template (present) UInt16 p_seqNumber := ?, + template (present) GN_Address.mid p_mid := ? ) := { lsRequestHeader := { seqNumber := p_seqNumber, @@ -2262,7 +2256,7 @@ module LibItsGeoNetworking_Templates { * @param p_sourceLongPosVec Long position vector of sender */ template (present) ExtendedHeader mw_shbHeader( - in template (present) LongPosVector p_sourceLongPosVec + template (present) LongPosVector p_sourceLongPosVec ) := { shbHeader := { srcPosVector:= p_sourceLongPosVec, @@ -2306,8 +2300,8 @@ module LibItsGeoNetworking_Templates { * @param p_sourceLongPosVec Long position vector of source */ template (present) ExtendedHeader mw_tsbHeader( - in template (present) UInt16 p_seqNumber, - in template (present) LongPosVector p_sourceLongPosVec + template (present) UInt16 p_seqNumber, + template (present) LongPosVector p_sourceLongPosVec ) := { tsbHeader := { seqNumber := p_seqNumber, diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn index 4790ada7..78142c92 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn $ + * $Id: LibItsGeoNetworking_TestSystem.ttcn 1318 2017-01-26 10:20:53Z filatov $ * @desc Test System module for ITS GeoNetworking * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. @@ -12,8 +12,6 @@ module LibItsGeoNetworking_TestSystem { // LibCommon -// import from LibCommon_Time {modulepar all}; -// import from LibCommon_Sync all; import from LibCommon_BasicTypesAndValues all; import from LibCommon_DataStrings all; @@ -39,9 +37,6 @@ module LibItsGeoNetworking_TestSystem { out AcGnPrimitive, AcGn6Primitive, AcGnssPrimitive, AcSecPrimitive; in - -//FIXME RGY As discussed, boolean results are replaced by a top-level union of results -// AcGnResponse, AcGn6Response, AcGnssResponse, AcGnssDistanceCovered, AcSecResponse; AcGnResponse, AcGn6Response, AdapterControlResults; } // end AdapterControlPort diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn index 5ab7e35b..330ff49e 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn @@ -1,1199 +1,1199 @@ -/** - * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $URL$ - * $Id$ - * @desc Module containing types and values for GeoNetworking Protocol - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsGeoNetworking_TypesAndValues { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from EtsiTs103097Module language "ASN.1:1997" all; - - group geoConfigurationValues { - - const charstring c_compIut := "IUT"; - const charstring c_compMTC := "MTC"; - const charstring c_compNodeA := "NodeA"; - const charstring c_compNodeB := "NodeB"; - const charstring c_compNodeC := "NodeC"; - const charstring c_compNodeD := "NodeD"; - const charstring c_compNodeE := "NodeE"; - const charstring c_compNodeF := "NodeF"; - - const charstring c_area1 := "AREA1"; - const charstring c_area2 := "AREA2"; - - const integer c_latitudeFactorNodeA := 10; - const integer c_latitudeFactorNodeB := 2; - const integer c_latitudeFactorNodeC := -6; - const integer c_latitudeFactorNodeD := 1; - const integer c_latitudeFactorNodeE := -1; - const integer c_latitudeFactorNodeF := 2; - const integer c_longitudeFactorNodeA := 0; - const integer c_longitudeFactorNodeB := 0; - const integer c_longitudeFactorNodeC := 0; - const integer c_longitudeFactorNodeD := 0; - const integer c_longitudeFactorNodeE := 0; - const integer c_longitudeFactorNodeF := -3; - } // end geoConfigurationValues - - group geoSyncMessages { - - const charstring c_msgSent := "Message sent"; - - } // end geoSyncMessages - - group geoTestingConstants { - - const UInt6 c_defaultLifetime := 10; // in seconds - const UInt16 c_lifetime := 1000 * c_defaultLifetime; // in seconds - - } // end geoTestingConstants - - group units { - - const float c_squareKm := 1000000.0; - - } // end units - - group geoConfigurationTypes { - - /** - * @desc Entry of position table - * @member key Reference key of the entry - * @member position Position vector stored in the entry - */ - type record PositionEntry { - charstring key, - LongPosVector position - } - - /** - * @desc Table containing node positions - */ - type record of PositionEntry PositionTable; - - /** - * @desc Parameters of a geometric area - * @member geoAreaPosLatitude Latitude of area's center - * @member geoAreaPosLongitude Longitude of area's center - * @member distanceA Distance A - * @member distanceB Distance B - * @member angle Angle - */ - type record Area { - Int32 geoAreaPosLatitude, - Int32 geoAreaPosLongitude, - UInt16 distanceA, - UInt16 distanceB, - UInt16 angle - } - - /** - * @desc Compact definition of GeoBroadcastArea - * @member geoBroadcastSubType Type of GeoBroadcastArea (=shape) - * @member geoBroadcastArea Parameters of the geometric area - */ - type record GeoBroadcastArea { - HeaderSubTypeGeoBroadcast geoBroadcastSubType, - Area geoBroadcastArea - } - - /** - * @desc Compact definition of GeoAnycastArea - * @member geoAnycastSubType Type of GeoAnycastArea (=shape) - * @member geoAnycastArea Parameters of the geometric area - */ - type record GeoAnycastArea { - HeaderSubTypeGeoAnycast geoAnycastSubType, - Area geoAnycastArea - } - - /** - * @desc Compact definition of a GeoArea (either GeoBroadcastArea or GeoAnycastArea) - * @member shape Shape of the GeoArea - * @member area Parameters of the geometric area - */ - type record GeoArea { - GeoShape shape, - Area area - } - - /** - * @desc Geometric shapes used to define GeoAreas - */ - type enumerated GeoShape { - e_geoCircle(0), - e_geoRect(1), - e_geoElip(2), - e_reserved - } - - /** - * @desc Entry of GeoArea table - * @member key Reference key of the entry - * @member geoArea GeoArea stored in the entry - */ - type record GeoAreaEntry { - charstring key, - GeoArea geoArea - } - - /** - * @desc Table containing geoArea definitions - */ - type record of GeoAreaEntry GeoAreaTable; - - } // end geoConfigurationTypes - - group geoNwValues { - - group geoNwHeaderConstants { - - const UInt4 c_geoNwProtocolVersion := 1; - - const UInt8 c_hopLimit1 := 1; - const UInt8 c_defaultHopLimit := 10; - - } // end geoNwHeaderConstants - - } // end geoNwValues - - group geoNetworkingPdus { - - /** - * @desc GeoNetworking Packet - * - * @see ETSI EN 302 636-4-1 chapter 8.2, 8.3, 8.4 - * - * @member basicHeader - * @member gnPacket - */ - type record GeoNetworkingPdu { - BasicHeader basicHeader, - GeoNetworkingPacket gnPacket - } - - type record GeoNetworkingPacket { - GnNonSecuredPacket packet, - EtsiTs103097Data securedMsg optional - } with { - encode (securedMsg) "LibItsSecurity" - } - - type octetstring GnRawPayload; - - type record GnNonSecuredPacket { - CommonHeader commonHeader, - ExtendedHeader extendedHeader optional, - GnRawPayload payload optional - } - } // end group geoNetworkingPdus - - group geoNetworkingHeader { - - group geoNetworkingBasicHeader { - - /** - * @desc Basic Header - * - *
    -       *  0               1               2               3
    -       *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
    -       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -       * |   V   |  NH   |    Reserved   |      LT       |      RHL      |
    -       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -       * 
    - * - * @see ETSI EN 302 636-4-1 chapter 8.6.1 - * - * @member version - * @member nextHeader - * @member reserved - * @member lifeTime - * @member routerHopLimit - */ - type record BasicHeader { - UInt4 version, - BasicNextHeader nextHeader, - UInt8 reserved, - Lifetime lifeTime, - UInt8 routerHopLimit - } with { - variant "FIELDORDER(msb)" - } - - type enumerated BasicNextHeader { - e_any(0), - e_commonHeader(1), - e_securedPacket(2), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } - - /** - * @desc Indicates the maximum tolerable time a packet can be buffered until it reaches its destination. - * @member multiplier - * @member ltBase - */ - type record Lifetime { - UInt6 multiplier, - LtBase ltBase - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc The base for the calculation of the lifetime. - */ - type enumerated LtBase { - e_50ms(0), - e_1s(1), - e_10s(2), - e_100s(3) - } with { - variant "FIELDLENGTH(2)" //variant "2 bit" - } - - } // end group geoNetworkingBasicHeader - - group geoNetworkingCommonHeader { - - /** - * @desc Common header for GeoNetworking - * - *
    -       *  0               1               2               3
    -       *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
    -       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -       * |  NH   |   R   |  HT   |  HST  |      TC       |     Flags     |
    -       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -       * |              PL               |     MHL       |    Reserved   |
    -       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -       * 
    - * - * @see ETSI EN 302 636-4-1 chapter 8.7.2 - * - * @member nextHeader - * @member reserved - * @member headerTST Header type + Header Sub Type - * @member trafficClass - * @member flags - * @member plLength - * @member maxHopLimit - * @member reserved2 - */ - type record CommonHeader { - NextHeader nextHeader, - UInt4 reserved, - HeaderTST headerTST, - TrafficClass trafficClass, - Bit8 flags, - UInt16 plLength, // The Codec shall set the length of the paylaod if present - UInt8 maxHopLimit, - UInt8 reserved2 - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the type of header immediately following the Common Header (4Bits). - */ - type enumerated NextHeader { - e_any(0), - e_btpA(1), - e_btpB(2), - e_ipv6(3), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } - - /** - * @desc TrafficClass - * - *
    -       *  0   1   2   3   4   5   6   7
    -       * +---+---+---+---+---+---+---+---+
    -       * |SCF|Ch.|         TC ID         |
    -       * |   |Off|                       |
    -       * +---+---+---+---+---+---+---+---+
    -       * 
    - * - * @see ETSI EN 302 636-4-1 chapter 8.7.5 - * - * @member scf - * @member channelOffload - * @member tcId - */ - type record TrafficClass { - SCF scf, - ChannelOffload channelOffload, - TcId tcId - } with { - variant "FIELDORDER(msb)" - } - - type enumerated SCF { - e_scfDisabled(0), - e_scfEnabled (1) - } with { - variant "FIELDLENGTH(1)" //variant "1 bit" - } - type enumerated ChannelOffload { - e_choffDisabled(0), - e_choffEnable (1) - } with { - variant "FIELDLENGTH(1)" //variant "1 bit" - } - type UInt6 TcId; - - } // end group geoNetworkingCommonHeader - - group geoNetworkingExtendedHeaders { - - /** - * @desc GeoNetworking ExtendedHeader - * - * @see ETSI EN 302 636-4-1 chapter 8.3 - * - * @member commonHeader - * @member gnExtHeader - */ - type union ExtendedHeader { - GeoUnicastHeader geoUnicastHeader, - TSBHeader tsbHeader, - SHBHeader shbHeader, - GeoBroadcastHeader geoBroadcastHeader, - GeoAnycastHeader geoAnycastHeader, - BeaconHeader beaconHeader, - LSRequestHeader lsRequestHeader, - LSReplyHeader lsReplyHeader, - AnyHeader saHeader, // FIXME Cannot find description, AnyHeader was used as default - AnyHeader saEosHeader, // FIXME Cannot find description, AnyHeader was used as default - AnyHeader anyHeader - } with { - variant "" - } - - /** - * @desc The unspecified ANY header. - * - * @member seqNumber - * @member reserved - */ - type record AnyHeader { - UInt16 seqNumber, - UInt16 reserved - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc The BEACON packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.6 - * - * @member commonHeader - */ - type record BeaconHeader { - LongPosVector srcPosVector - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc The GEOANYCAST packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.5 - * - * @member seqNumber - * @member reserved - * @member srcPosVector - * @member geoAreaPosLatitude - * @member geoAreaPosLongitude - * @member distanceA - * @member distanceB - * @member angle - * @member reserved - */ - type record GeoAnycastHeader { - UInt16 seqNumber, - UInt16 reserved, - LongPosVector srcPosVector, - Int32 geoAreaPosLatitude, - Int32 geoAreaPosLongitude, - UInt16 distanceA, - UInt16 distanceB, - UInt16 angle, - UInt16 reserved2 - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc The GEOBROADCAST packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.5 - * - * @member seqNumber - * @member reserved - * @member srcPosVector - * @member geoAreaPosLatitude - * @member geoAreaPosLongitude - * @member distanceA - * @member distanceB - * @member angle - * @member reserved - */ - type GeoAnycastHeader GeoBroadcastHeader; - - /** - * @desc The GEOUNICAST packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.2 - * - * @member seqNumber - * @member reserved - * @member srcPosVector - * @member dstPosVector - */ - type record GeoUnicastHeader { - UInt16 seqNumber, - UInt16 reserved, - LongPosVector srcPosVector, - ShortPosVector dstPosVector - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc The Location Service (LS) Reply packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.8 - * - * @member seqNumber - * @member reserved - * @member srcPosVector - * @member dstPosVector - */ - type record LSReplyHeader { - UInt16 seqNumber, - UInt16 reserved, - LongPosVector srcPosVector, - ShortPosVector dstPosVector - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc The Location Service (LS) Request packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.7 - * - * @member seqNumber - * @member reserved - * @member srcPosVector - * @member gnAddress - */ - type record LSRequestHeader { - UInt16 seqNumber, - UInt16 reserved, - LongPosVector srcPosVector, - GN_Address gnAddress - } with { - variant "FIELDORDER(msb)" - } - - /** - * The Single Hop Broadcast (SHB) packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.4 - * - * @member srcPosVector - * @member reserved - */ - type record SHBHeader { - LongPosVector srcPosVector, - UInt32 reserved - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc The Topologically-Scoped Broadcast (TSB) packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.3 - * - * @member seqNumber - * @member reserved - * @member srcPosVector - */ - type record TSBHeader { - UInt16 seqNumber, - UInt16 reserved, - LongPosVector srcPosVector - } with { - variant "FIELDORDER(msb)" - } - - group geoNetworkingHeadersSubtypes { - - /** - * @desc Identifies the header type and the header subtype for ANY. - * @member headerType - * @member reserved - */ - type record AnyHeaderType { - HeaderType headerType(e_any), - UInt4 headerSubType - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the header type and the header subtype for BEACON. - * @member headerType - * @member reserved - */ - type record BeaconHeaderType { - HeaderType headerType(e_beacon), - UInt4 headerSubType - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the header type and the header subtype for GEOANYCAST. - * @member headerType - * @member reserved - */ - type record GeoAnycastHeaderType { - HeaderType headerType(e_geoAnycast), - HeaderSubTypeGeoAnycast headerSubType - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the header type and the header subtype for GEOBROADCAST. - * @member headerType - * @member reserved - */ - type record GeoBroadcastHeaderType { - HeaderType headerType(e_geoBroadcast), - HeaderSubTypeGeoBroadcast headerSubType - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the header type and the header subtype for GEOUNICAST. - * @member headerType - * @member reserved - */ - type record GeoUnicastHeaderType { - HeaderType headerType(e_geoUnicast), - UInt4 headerSubType - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the header type and the header subtype for Location Service LS. - * @member headerType - * @member reserved - */ - type record LsHeaderType { - HeaderType headerType(e_locationService), - HeaderSubTypeLs headerSubType - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the header type and the header subtype for Service Announcement SA. - * @member headerType - * @member reserved - */ - type record SaHeaderType { - HeaderType headerType(e_serviceAnnouncement), - HeaderSubTypeSa headerSubType - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the header type and the header subtype for Topologically-Scoped Broadcast TSB. - * @member headerType - * @member headerSubType - */ - type record TsbHeaderType { - HeaderType headerType(e_topologicallyScopedBroadcast), - HeaderSubTypeTSB headerSubType - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the header subtype for GEOANYCAST. - */ - type enumerated HeaderSubTypeGeoAnycast { - e_geoAnycastCircle(0), - e_geoAnycastRect(1), - e_geoAnycastElip(2), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } - - /** - * @desc Identifies the header subtype for GEOBROADCAST. - */ - type enumerated HeaderSubTypeGeoBroadcast { - e_geoBroadcastCircle(0), - e_geoBroadcastRect(1), - e_geoBroadcastElip(2), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } - - /** - * @desc Identifies the header subtype for Topologically-scoped broadcast TSB. - */ - type enumerated HeaderSubTypeTSB { - e_singleHop(0), - e_multiHop(1), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } - - /** - * @desc Identifies the header subtype for Location Service LS. - */ - type enumerated HeaderSubTypeLs { - e_lsRequest(0), - e_lsReply(1), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } - - /** - * @desc Identifies the header subtype for Service Announcement SA. - */ - type enumerated HeaderSubTypeSa { - e_sa(0), - e_saEos(1), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } - - /** - * @desc Identifies the header type and the header subtype. - * @member anyHdr - * @member beaconHdr - * @member geoUnicastHdr - * @member geoAnycastHdr - * @member geoBroadcastHdr - * @member tsbHdr - * @member lsHdr - * @member saHdr - * @member reserved - */ - type union HeaderTST { - AnyHeaderType anyHdr, - BeaconHeaderType beaconHdr, - GeoUnicastHeaderType geoUnicastHdr, - GeoAnycastHeaderType geoAnycastHdr, - GeoBroadcastHeaderType geoBroadcastHdr, - TsbHeaderType tsbHdr, - LsHeaderType lsHdr, - SaHeaderType saHdr, - UInt8 reserved - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the type of the GeoAdhoc header type (4Bits). - */ - type enumerated HeaderType { - e_any(0), - e_beacon(1), - e_geoUnicast(2), - e_geoAnycast(3), - e_geoBroadcast(4), - e_topologicallyScopedBroadcast(5), - e_locationService(6), - e_serviceAnnouncement(7), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } - - /** - * @desc Long Position Vector - * - *
    -         *  0               1               2               3
    -         *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
    -         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         * |                           GN_ADDR                             |
    -         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         * |                             TST                               |
    -         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         * |                             Lat                               |
    -         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         * |                             Long                              |
    -         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         * |P|              S              |               H               |
    -         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         * 
    - * - * @see ETSI EN 302 636-4-1 chapter 8.5.2 - * - * @member gnAddr - * @member timestamp_ - * @member latitude - * @member longitude - * @member pai Position Accuracy Indicator - * @member speed - * @member heading - */ - type record LongPosVector { - GN_Address gnAddr, - UInt32 timestamp_, - Int32 latitude, - Int32 longitude, - Bit1 pai, - Int15 speed, - UInt16 heading - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Short Position Vector - * - *
    -         *  0               1               2               3
    -         *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
    -         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         * |                           GN_ADDR                             |
    -         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         * |                             TST                               |
    -         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         * |                             Lat                               |
    -         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         * |                             Long                              |
    -         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         * 
    - * - * @see ETSI EN 302 636-4-1 chapter 8.5.3 - * - * @member gnAddr - * @member timestamp - * @member latitude - * @member longitude - */ - type record ShortPosVector { - GN_Address gnAddr, - UInt32 timestamp_, - Int32 latitude, - Int32 longitude - } with { - variant "FIELDORDER(msb)" - } - - group geoNetworkingAddress { - /** - * @desc GeoNetworking address - * - *
    -           *  0               1               2               3
    -           *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
    -           * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -           * |M|  S_T    |       S_CC        |             M_ID              |
    -           * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -           * |                              M_ID                             |
    -           * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -           * 
    - * - * @see ETSI EN 302 636-4-1 chapter 6.2 - * - * @member typeOfAddress - * @member stationType - * @member mid - */ - type record GN_Address { - TypeOfAddress typeOfAddress, - StationType stationType, - UInt10 stationCountryCode, - Oct6 mid - } with { - variant "FIELDORDER(msb)" - } - - group geoNetworkingAddressSubtypes { - - /** - * @desc Identifies the ITS station (5Bits). - */ - type enumerated StationType { - e_unknown(0), - e_pedestrian(1), - e_cyclist(2), - e_moped(3), - e_motorcycle(4), - e_passengerCar(5), - e_bus(6), - e_lightTruck(7), - e_heavyTruck(8), - e_trailer(9), - e_specialVehicle(10), - e_tram(11), - e_roadSideUnit(15) - } with { - variant "FIELDLENGTH(5)" //variant "5 bit" - } - - /** - * @desc Distinguish between manually configured - * network address and the initial GeoNetwork address (1Bit). - */ - type enumerated TypeOfAddress { - e_manual(1), - e_initial(0) - } with { - variant "FIELDLENGTH(1)" //variant "1 bit" - } - - } // end group geoNetworkingAddressSubtypes - - } // end group geoNetworkingAddress - - } // end group geoNetworkingHeadersSubtypes - - } // end group geoNetworkingExtendedHeaders - - } // end group geoNetworkingHeader - - group geoNwPicsTypes { - - /** - * @desc The GeoUnicast forwarding algorithm. - */ - type enumerated GeoUnicastForwardingAlgorithm { - e_unspecified(0), - e_greedy(1), - e_cbf(2) - } - - /** - * @desc The GeoBroadcast forwarding algorithm. - */ - type enumerated GeoBroadcastForwardingAlgorithm { - e_unspecified(0), - e_simple(1), - e_cbf(2), - e_advanced(3) - } - - /** - * @desc GN address configuration method. - */ - type enumerated GnAddressConfigurationMethod { - e_auto(0), - e_managed(1), - e_anonymous(2) - } - - } // end geoNwPicsTypes - - group utPrimitives { - - /** - * @desc Upper Tester message to initialize IUT - * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use - */ - type record UtGnInitialize { - Oct8 hashedId8 - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester results message of the GeoNetworking IUT - * @member utGnInitialize - - * @member utGnTriggerResult - - * @member utAutoInteropTriggerResult - - * @member utGnChangePositionResult - - */ - type union UtGnResults { - boolean utGnInitializeResult, - boolean utGnTriggerResult, - boolean utAutoInteropTriggerResult, // FIXME Remove UtAutoInteropTrigger from GN component, create an AutoInterop component - boolean utGnChangePositionResult - } with { - variant "" - } // End of type UtGnResults - - /** - * @desc AutoInterop UpperTester trigger - * @member utRadioOnOff Set to true to power on the radio (on-link mode), false to power off the radio (off-link). - */ - type union UtAutoInteropTrigger { - boolean utRadioOnOff - } with { - variant "" - } // End of type UtAutoInteropTrigger - - /** - * @desc Upper Tester message to change the position of IUT. Values a relatives - */ - type record UtGnChangePosition { - Int32 latitude, - Int32 longitude, - Int32 elevation - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc UT primitives for GeoNetworking - * @member geoUnicast - - * @member geoBroadcast - - * @member geoAnycast - - * @member shb - - * @member tsb - - * @member changePosition - - * @member checkPacket - - */ - type union UtGnTrigger { - GenerateGeoUnicastMessage geoUnicast, - GenerateGeoBroadcastMessage geoBroadcast, - GenerateGeoAnycastMessage geoAnycast, - GenerateSHBMessage shb, - GenerateTSBMessage tsb - } with { - variant "" - } - - /** - * @desc UT primitive for IUT to send a GeoUnicast packet - * @member gnAddress Destination of the packet - * @member lifetime Lifetime of the packet - * @member trafficClass Traffic class of the packet - * @member payload GnRawPayload of the packet - */ - type record GenerateGeoUnicastMessage { - GN_Address gnAddress, - UInt16 lifetime, - TrafficClass trafficClass, - GnRawPayload payload - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc UT primitive for IUT to send a GeoBroadcast packet - * @member shape Shape of the area - * @member lifetime Lifetime of the packet - * @member trafficClass Traffic class of the packet - * @member area Destination GeoArea - * @member payload GnRawPayload of the packet - */ - type record GenerateGeoBroadcastMessage { - GeoShape shape, - UInt16 lifetime, - TrafficClass trafficClass, - UInt24 reserved, - Area area, - GnRawPayload payload - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc UT primitive for IUT to send a Geoanycast packet - */ - type GenerateGeoBroadcastMessage GenerateGeoAnycastMessage; - - /** - * @desc UT primitive for IUT to send a SHB packet - * @member trafficClass Traffic class of the packet - * @member payload GnRawPayload of the packet - */ - type record GenerateSHBMessage { - TrafficClass trafficClass, - GnRawPayload payload - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc UT primitive for IUT to send a SHB packet - * @member nbHops Number of Hops - * @member lifetime Lifetime of the packet - * @member trafficClass Traffic class of the packet - * @member payload GnRawPayload of the packet - */ - type record GenerateTSBMessage { - UInt8 nbHops, - UInt16 lifetime, - TrafficClass trafficClass, - GnRawPayload payload - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to check Upper Layer message transmission on GN IUT - */ - type record UtGnEventInd { - // GeoNetworkingPdu gnPdu - GnRawPayload rawPayload - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc List of Upper Tester messages to check Upper Layer message transmission on GN IUT - */ - type record of UtGnEventInd UtGnEventIndList; - - } // end utPrimitives - with { - encode "UpperTester"; - variant "" - } - - group acPrimitives { - - /** - * @desc TA primitives for GeoNetworking - * @member startBeaconing - - * @member stopBeaconing - - * @member startPassBeaconing - - * @member stopPassBeaconing - - * @member startBeaconingMultipleNeighbour - - * @member stopBeaconingMultipleNeighbour - - * @member getLongPosVector - - */ - type union AcGnPrimitive { - AcStartBeaconing startBeaconing, - AcStopBeaconing stopBeaconing, - AcStartPassBeaconing startPassBeaconing, - AcStopPassBeaconing stopPassBeaconing, - AcStartBeaconingMultipleNeighbour startBeaconingMultipleNeighbour, - AcStopBeaconingMultipleNeighbour stopBeaconingMultipleNeighbour, - AcGetLongPosVector getLongPosVector - } with { - variant "" - } - - /** - * @desc Primitive for receiveing response from TA - * @member getLongPosVector - */ - type union AcGnResponse { - LongPosVector getLongPosVector, - AcGnResponseFailure failure - } - with { - variant "" - encode(getLongPosVector) "LibItsGeoNetworking" - } - - type record AcGnResponseFailure { - boolean failure - } - - /** - * @desc Primitive for TA to start sending beacons for the test component - * @member beaconHeader Beacon template - */ - type record AcStartBeaconing { - GeoNetworkingPdu beaconPacket - } - with { - encode(beaconPacket) "LibItsGeoNetworking" - } - - /** - * @desc Primitive for TA to stop sending beacons for the test component - */ - type record AcStopBeaconing { - } - - /** - * @desc Primitive for TA to start enqueueing received beacons - * @member beaconHeader Filter - */ - type record AcStartPassBeaconing { - BeaconHeader beaconHeader - } - with { - encode(beaconHeader) "LibItsGeoNetworking" - }; - - /** - * @desc Primitive for TA to stop enqueueing received beacons - */ - type record AcStopPassBeaconing { - } - - /** - * @desc Primitive for TA to start sending beacons for multiple neighbours - * @member beaconHeader Beacon template - * @member numberOfNeighbour Number of neighbours to simulate - */ - type record AcStartBeaconingMultipleNeighbour { - GeoNetworkingPdu beaconPacket, - integer numberOfNeighbour - } - with { - encode(beaconPacket) "LibItsGeoNetworking" - }; - - /** - * @desc Primitive for TA to stop sending beacons for multiple neighbours - */ - type record AcStopBeaconingMultipleNeighbour { - } - - /** - * @desc Primitive for retrieving the position vector corresponding to a specific GN address - * @member gnAddress GN address to be searched - */ - type record AcGetLongPosVector { - GN_Address gnAddress - } - with { - encode(gnAddress) "LibItsGeoNetworking" - }; - - } // end acPrimitives - with { - variant "" - encode "AdapterControl" - } -} -with { - variant "" - encode "LibItsGeoNetworking" - } +/** + * @author ETSI / STF405 / STF449 / STF484 / STF517 + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn $ + * $Id: LibItsGeoNetworking_TypesAndValues.ttcn,v 1.5 2018/06/26 13:54:21 dte Exp $ + * @desc Module containing types and values for GeoNetworking Protocol + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * + */ +module LibItsGeoNetworking_TypesAndValues { + + // LibCommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; + + // LibIts + import from EtsiTs103097Module language "ASN.1:1997" all; + + group geoConfigurationValues { + + const charstring c_compIut := "IUT"; + const charstring c_compMTC := "MTC"; + const charstring c_compNodeA := "NodeA"; + const charstring c_compNodeB := "NodeB"; + const charstring c_compNodeC := "NodeC"; + const charstring c_compNodeD := "NodeD"; + const charstring c_compNodeE := "NodeE"; + const charstring c_compNodeF := "NodeF"; + + const charstring c_area1 := "AREA1"; + const charstring c_area2 := "AREA2"; + + const integer c_latitudeFactorNodeA := 10; + const integer c_latitudeFactorNodeB := 2; + const integer c_latitudeFactorNodeC := -6; + const integer c_latitudeFactorNodeD := 1; + const integer c_latitudeFactorNodeE := -1; + const integer c_latitudeFactorNodeF := 2; + const integer c_longitudeFactorNodeA := 0; + const integer c_longitudeFactorNodeB := 0; + const integer c_longitudeFactorNodeC := 0; + const integer c_longitudeFactorNodeD := 0; + const integer c_longitudeFactorNodeE := 0; + const integer c_longitudeFactorNodeF := -3; + } // end geoConfigurationValues + + group geoSyncMessages { + + const charstring c_msgSent := "Message sent"; + + } // end geoSyncMessages + + group geoTestingConstants { + + const UInt6 c_defaultLifetime := 10; // in seconds + const UInt16 c_lifetime := 1000 * c_defaultLifetime; // in seconds + + } // end geoTestingConstants + + group units { + + const float c_squareKm := 1000000.0; + + } // end units + + group geoConfigurationTypes { + + /** + * @desc Entry of position table + * @member key Reference key of the entry + * @member position Position vector stored in the entry + */ + type record PositionEntry { + charstring key, + LongPosVector position + } + + /** + * @desc Table containing node positions + */ + type record of PositionEntry PositionTable; + + /** + * @desc Parameters of a geometric area + * @member geoAreaPosLatitude Latitude of area's center + * @member geoAreaPosLongitude Longitude of area's center + * @member distanceA Distance A + * @member distanceB Distance B + * @member angle Angle + */ + type record Area { + Int32 geoAreaPosLatitude, + Int32 geoAreaPosLongitude, + UInt16 distanceA, + UInt16 distanceB, + UInt16 angle + } + + /** + * @desc Compact definition of GeoBroadcastArea + * @member geoBroadcastSubType Type of GeoBroadcastArea (=shape) + * @member geoBroadcastArea Parameters of the geometric area + */ + type record GeoBroadcastArea { + HeaderSubTypeGeoBroadcast geoBroadcastSubType, + Area geoBroadcastArea + } + + /** + * @desc Compact definition of GeoAnycastArea + * @member geoAnycastSubType Type of GeoAnycastArea (=shape) + * @member geoAnycastArea Parameters of the geometric area + */ + type record GeoAnycastArea { + HeaderSubTypeGeoAnycast geoAnycastSubType, + Area geoAnycastArea + } + + /** + * @desc Compact definition of a GeoArea (either GeoBroadcastArea or GeoAnycastArea) + * @member shape Shape of the GeoArea + * @member area Parameters of the geometric area + */ + type record GeoArea { + GeoShape shape, + Area area + } + + /** + * @desc Geometric shapes used to define GeoAreas + */ + type enumerated GeoShape { + e_geoCircle(0), + e_geoRect(1), + e_geoElip(2), + e_reserved + } + + /** + * @desc Entry of GeoArea table + * @member key Reference key of the entry + * @member geoArea GeoArea stored in the entry + */ + type record GeoAreaEntry { + charstring key, + GeoArea geoArea + } + + /** + * @desc Table containing geoArea definitions + */ + type record of GeoAreaEntry GeoAreaTable; + + } // end geoConfigurationTypes + + group geoNwValues { + + group geoNwHeaderConstants { + + const UInt4 c_geoNwProtocolVersion := 1; + + const UInt8 c_hopLimit1 := 1; + const UInt8 c_defaultHopLimit := 10; + + } // end geoNwHeaderConstants + + } // end geoNwValues + + group geoNetworkingPdus { + + /** + * @desc GeoNetworking Packet + * + * @see ETSI EN 302 636-4-1 chapter 8.2, 8.3, 8.4 + * + * @member basicHeader + * @member gnPacket + */ + type record GeoNetworkingPdu { + BasicHeader basicHeader, + GeoNetworkingPacket gnPacket + } + + type record GeoNetworkingPacket { + GnNonSecuredPacket packet, + EtsiTs103097Data securedMsg optional + } with { + encode (securedMsg) "LibItsSecurity" + } + + type octetstring GnRawPayload; + + type record GnNonSecuredPacket { + CommonHeader commonHeader, + ExtendedHeader extendedHeader optional, + GnRawPayload payload optional + } + } // end group geoNetworkingPdus + + group geoNetworkingHeader { + + group geoNetworkingBasicHeader { + + /** + * @desc Basic Header + * + *
    +       *  0               1               2               3
    +       *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
    +       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +       * |   V   |  NH   |    Reserved   |      LT       |      RHL      |
    +       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +       * 
    + * + * @see ETSI EN 302 636-4-1 chapter 8.6.1 + * + * @member version + * @member nextHeader + * @member reserved + * @member lifeTime + * @member routerHopLimit + */ + type record BasicHeader { + UInt4 version, + BasicNextHeader nextHeader, + UInt8 reserved, + Lifetime lifeTime, + UInt8 routerHopLimit + } with { + variant "FIELDORDER(msb)" + } + + type enumerated BasicNextHeader { + e_any(0), + e_commonHeader(1), + e_securedPacket(2), + e_reserved + } with { + variant "FIELDLENGTH(4)" + } + + /** + * @desc Indicates the maximum tolerable time a packet can be buffered until it reaches its destination. + * @member multiplier + * @member ltBase + */ + type record Lifetime { + UInt6 multiplier, + LtBase ltBase + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc The base for the calculation of the lifetime. + */ + type enumerated LtBase { + e_50ms(0), + e_1s(1), + e_10s(2), + e_100s(3) + } with { + variant "FIELDLENGTH(2)" + } + + } // end group geoNetworkingBasicHeader + + group geoNetworkingCommonHeader { + + /** + * @desc Common header for GeoNetworking + * + *
    +       *  0               1               2               3
    +       *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
    +       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +       * |  NH   |   R   |  HT   |  HST  |      TC       |     Flags     |
    +       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +       * |              PL               |     MHL       |    Reserved   |
    +       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +       * 
    + * + * @see ETSI EN 302 636-4-1 chapter 8.7.2 + * + * @member nextHeader + * @member reserved + * @member headerTST Header type + Header Sub Type + * @member trafficClass + * @member flags + * @member plLength + * @member maxHopLimit + * @member reserved2 + */ + type record CommonHeader { + NextHeader nextHeader, + UInt4 reserved, + HeaderTST headerTST, + TrafficClass trafficClass, + Bit8 flags, + UInt16 plLength, // The Codec shall set the length of the paylaod if present + UInt8 maxHopLimit, + UInt8 reserved2 + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Identifies the type of header immediately following the Common Header (4Bits). + */ + type enumerated NextHeader { + e_any(0), + e_btpA(1), + e_btpB(2), + e_ipv6(3), + e_reserved + } with { + variant "FIELDLENGTH(4)" //variant "4 bit" + } + + /** + * @desc TrafficClass + * + *
    +       *  0   1   2   3   4   5   6   7
    +       * +---+---+---+---+---+---+---+---+
    +       * |SCF|Ch.|         TC ID         |
    +       * |   |Off|                       |
    +       * +---+---+---+---+---+---+---+---+
    +       * 
    + * + * @see ETSI EN 302 636-4-1 chapter 8.7.5 + * + * @member scf + * @member channelOffload + * @member tcId + */ + type record TrafficClass { + SCF scf, + ChannelOffload channelOffload, + TcId tcId + } with { + variant "FIELDORDER(msb)" + } + + type enumerated SCF { + e_scfDisabled(0), + e_scfEnabled (1) + } with { + variant "FIELDLENGTH(1)" //variant "1 bit" + } + type enumerated ChannelOffload { + e_choffDisabled(0), + e_choffEnable (1) + } with { + variant "FIELDLENGTH(1)" //variant "1 bit" + } + type UInt6 TcId; + + } // end group geoNetworkingCommonHeader + + group geoNetworkingExtendedHeaders { + + /** + * @desc GeoNetworking ExtendedHeader + * + * @see ETSI EN 302 636-4-1 chapter 8.3 + * + * @member commonHeader + * @member gnExtHeader + */ + type union ExtendedHeader { + GeoUnicastHeader geoUnicastHeader, + TSBHeader tsbHeader, + SHBHeader shbHeader, + GeoBroadcastHeader geoBroadcastHeader, + GeoAnycastHeader geoAnycastHeader, + BeaconHeader beaconHeader, + LSRequestHeader lsRequestHeader, + LSReplyHeader lsReplyHeader, + AnyHeader saHeader, // FIXME Cannot find description, AnyHeader was used as default + AnyHeader saEosHeader, // FIXME Cannot find description, AnyHeader was used as default + AnyHeader anyHeader + } with { + variant "" + } + + /** + * @desc The unspecified ANY header. + * + * @member seqNumber + * @member reserved + */ + type record AnyHeader { + UInt16 seqNumber, + UInt16 reserved + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc The BEACON packet header. + * + * @see ETSI EN 302 636-4-1 chapter 8.8.6 + * + * @member commonHeader + */ + type record BeaconHeader { + LongPosVector srcPosVector + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc The GEOANYCAST packet header. + * + * @see ETSI EN 302 636-4-1 chapter 8.8.5 + * + * @member seqNumber + * @member reserved + * @member srcPosVector + * @member geoAreaPosLatitude + * @member geoAreaPosLongitude + * @member distanceA + * @member distanceB + * @member angle + * @member reserved + */ + type record GeoAnycastHeader { + UInt16 seqNumber, + UInt16 reserved, + LongPosVector srcPosVector, + Int32 geoAreaPosLatitude, + Int32 geoAreaPosLongitude, + UInt16 distanceA, + UInt16 distanceB, + UInt16 angle, + UInt16 reserved2 + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc The GEOBROADCAST packet header. + * + * @see ETSI EN 302 636-4-1 chapter 8.8.5 + * + * @member seqNumber + * @member reserved + * @member srcPosVector + * @member geoAreaPosLatitude + * @member geoAreaPosLongitude + * @member distanceA + * @member distanceB + * @member angle + * @member reserved + */ + type GeoAnycastHeader GeoBroadcastHeader; + + /** + * @desc The GEOUNICAST packet header. + * + * @see ETSI EN 302 636-4-1 chapter 8.8.2 + * + * @member seqNumber + * @member reserved + * @member srcPosVector + * @member dstPosVector + */ + type record GeoUnicastHeader { + UInt16 seqNumber, + UInt16 reserved, + LongPosVector srcPosVector, + ShortPosVector dstPosVector + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc The Location Service (LS) Reply packet header. + * + * @see ETSI EN 302 636-4-1 chapter 8.8.8 + * + * @member seqNumber + * @member reserved + * @member srcPosVector + * @member dstPosVector + */ + type record LSReplyHeader { + UInt16 seqNumber, + UInt16 reserved, + LongPosVector srcPosVector, + ShortPosVector dstPosVector + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc The Location Service (LS) Request packet header. + * + * @see ETSI EN 302 636-4-1 chapter 8.8.7 + * + * @member seqNumber + * @member reserved + * @member srcPosVector + * @member gnAddress + */ + type record LSRequestHeader { + UInt16 seqNumber, + UInt16 reserved, + LongPosVector srcPosVector, + GN_Address gnAddress + } with { + variant "FIELDORDER(msb)" + } + + /** + * The Single Hop Broadcast (SHB) packet header. + * + * @see ETSI EN 302 636-4-1 chapter 8.8.4 + * + * @member srcPosVector + * @member reserved + */ + type record SHBHeader { + LongPosVector srcPosVector, + UInt32 reserved + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc The Topologically-Scoped Broadcast (TSB) packet header. + * + * @see ETSI EN 302 636-4-1 chapter 8.8.3 + * + * @member seqNumber + * @member reserved + * @member srcPosVector + */ + type record TSBHeader { + UInt16 seqNumber, + UInt16 reserved, + LongPosVector srcPosVector + } with { + variant "FIELDORDER(msb)" + } + + group geoNetworkingHeadersSubtypes { + + /** + * @desc Identifies the header type and the header subtype for ANY. + * @member headerType + * @member reserved + */ + type record AnyHeaderType { + HeaderType headerType(e_any), + UInt4 headerSubType + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Identifies the header type and the header subtype for BEACON. + * @member headerType + * @member reserved + */ + type record BeaconHeaderType { + HeaderType headerType(e_beacon), + UInt4 headerSubType + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Identifies the header type and the header subtype for GEOANYCAST. + * @member headerType + * @member reserved + */ + type record GeoAnycastHeaderType { + HeaderType headerType(e_geoAnycast), + HeaderSubTypeGeoAnycast headerSubType + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Identifies the header type and the header subtype for GEOBROADCAST. + * @member headerType + * @member reserved + */ + type record GeoBroadcastHeaderType { + HeaderType headerType(e_geoBroadcast), + HeaderSubTypeGeoBroadcast headerSubType + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Identifies the header type and the header subtype for GEOUNICAST. + * @member headerType + * @member reserved + */ + type record GeoUnicastHeaderType { + HeaderType headerType(e_geoUnicast), + UInt4 headerSubType + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Identifies the header type and the header subtype for Location Service LS. + * @member headerType + * @member reserved + */ + type record LsHeaderType { + HeaderType headerType(e_locationService), + HeaderSubTypeLs headerSubType + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Identifies the header type and the header subtype for Service Announcement SA. + * @member headerType + * @member reserved + */ + type record SaHeaderType { + HeaderType headerType(e_serviceAnnouncement), + HeaderSubTypeSa headerSubType + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Identifies the header type and the header subtype for Topologically-Scoped Broadcast TSB. + * @member headerType + * @member headerSubType + */ + type record TsbHeaderType { + HeaderType headerType(e_topologicallyScopedBroadcast), + HeaderSubTypeTSB headerSubType + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Identifies the header subtype for GEOANYCAST. + */ + type enumerated HeaderSubTypeGeoAnycast { + e_geoAnycastCircle(0), + e_geoAnycastRect(1), + e_geoAnycastElip(2), + e_reserved + } with { + variant "FIELDLENGTH(4)" //variant "4 bit" + } + + /** + * @desc Identifies the header subtype for GEOBROADCAST. + */ + type enumerated HeaderSubTypeGeoBroadcast { + e_geoBroadcastCircle(0), + e_geoBroadcastRect(1), + e_geoBroadcastElip(2), + e_reserved + } with { + variant "FIELDLENGTH(4)" //variant "4 bit" + } + + /** + * @desc Identifies the header subtype for Topologically-scoped broadcast TSB. + */ + type enumerated HeaderSubTypeTSB { + e_singleHop(0), + e_multiHop(1), + e_reserved + } with { + variant "FIELDLENGTH(4)" //variant "4 bit" + } + + /** + * @desc Identifies the header subtype for Location Service LS. + */ + type enumerated HeaderSubTypeLs { + e_lsRequest(0), + e_lsReply(1), + e_reserved + } with { + variant "FIELDLENGTH(4)" //variant "4 bit" + } + + /** + * @desc Identifies the header subtype for Service Announcement SA. + */ + type enumerated HeaderSubTypeSa { + e_sa(0), + e_saEos(1), + e_reserved + } with { + variant "FIELDLENGTH(4)" //variant "4 bit" + } + + /** + * @desc Identifies the header type and the header subtype. + * @member anyHdr + * @member beaconHdr + * @member geoUnicastHdr + * @member geoAnycastHdr + * @member geoBroadcastHdr + * @member tsbHdr + * @member lsHdr + * @member saHdr + * @member reserved + */ + type union HeaderTST { + AnyHeaderType anyHdr, + BeaconHeaderType beaconHdr, + GeoUnicastHeaderType geoUnicastHdr, + GeoAnycastHeaderType geoAnycastHdr, + GeoBroadcastHeaderType geoBroadcastHdr, + TsbHeaderType tsbHdr, + LsHeaderType lsHdr, + SaHeaderType saHdr, + UInt8 reserved + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Identifies the type of the GeoAdhoc header type (4Bits). + */ + type enumerated HeaderType { + e_any(0), + e_beacon(1), + e_geoUnicast(2), + e_geoAnycast(3), + e_geoBroadcast(4), + e_topologicallyScopedBroadcast(5), + e_locationService(6), + e_serviceAnnouncement(7), + e_reserved + } with { + variant "FIELDLENGTH(4)" //variant "4 bit" + } + + /** + * @desc Long Position Vector + * + *
    +         *  0               1               2               3
    +         *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
    +         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +         * |                           GN_ADDR                             |
    +         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +         * |                             TST                               |
    +         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +         * |                             Lat                               |
    +         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +         * |                             Long                              |
    +         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +         * |P|              S              |               H               |
    +         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +         * 
    + * + * @see ETSI EN 302 636-4-1 chapter 8.5.2 + * + * @member gnAddr + * @member timestamp_ + * @member latitude + * @member longitude + * @member pai Position Accuracy Indicator + * @member speed + * @member heading + */ + type record LongPosVector { + GN_Address gnAddr, + UInt32 timestamp_, + Int32 latitude, + Int32 longitude, + Bit1 pai, + Int15 speed, + UInt16 heading + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Short Position Vector + * + *
    +         *  0               1               2               3
    +         *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
    +         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +         * |                           GN_ADDR                             |
    +         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +         * |                             TST                               |
    +         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +         * |                             Lat                               |
    +         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +         * |                             Long                              |
    +         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +         * 
    + * + * @see ETSI EN 302 636-4-1 chapter 8.5.3 + * + * @member gnAddr + * @member timestamp + * @member latitude + * @member longitude + */ + type record ShortPosVector { + GN_Address gnAddr, + UInt32 timestamp_, + Int32 latitude, + Int32 longitude + } with { + variant "FIELDORDER(msb)" + } + + group geoNetworkingAddress { + /** + * @desc GeoNetworking address + * + *
    +           *  0               1               2               3
    +           *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
    +           * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +           * |M|  S_T    |       S_CC        |             M_ID              |
    +           * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +           * |                              M_ID                             |
    +           * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +           * 
    + * + * @see ETSI EN 302 636-4-1 chapter 6.2 + * + * @member typeOfAddress + * @member stationType + * @member mid + */ + type record GN_Address { + TypeOfAddress typeOfAddress, + StationType stationType, + UInt10 stationCountryCode, + Oct6 mid + } with { + variant "FIELDORDER(msb)" + } + + group geoNetworkingAddressSubtypes { + + /** + * @desc Identifies the ITS station (5Bits). + */ + type enumerated StationType { + e_unknown(0), + e_pedestrian(1), + e_cyclist(2), + e_moped(3), + e_motorcycle(4), + e_passengerCar(5), + e_bus(6), + e_lightTruck(7), + e_heavyTruck(8), + e_trailer(9), + e_specialVehicle(10), + e_tram(11), + e_roadSideUnit(15) + } with { + variant "FIELDLENGTH(5)" //variant "5 bit" + } + + /** + * @desc Distinguish between manually configured + * network address and the initial GeoNetwork address (1Bit). + */ + type enumerated TypeOfAddress { + e_manual(1), + e_initial(0) + } with { + variant "FIELDLENGTH(1)" //variant "1 bit" + } + + } // end group geoNetworkingAddressSubtypes + + } // end group geoNetworkingAddress + + } // end group geoNetworkingHeadersSubtypes + + } // end group geoNetworkingExtendedHeaders + + } // end group geoNetworkingHeader + + group geoNwPicsTypes { + + /** + * @desc The GeoUnicast forwarding algorithm. + */ + type enumerated GeoUnicastForwardingAlgorithm { + e_unspecified(0), + e_greedy(1), + e_cbf(2) + } + + /** + * @desc The GeoBroadcast forwarding algorithm. + */ + type enumerated GeoBroadcastForwardingAlgorithm { + e_unspecified(0), + e_simple(1), + e_cbf(2), + e_advanced(3) + } + + /** + * @desc GN address configuration method. + */ + type enumerated GnAddressConfigurationMethod { + e_auto(0), + e_managed(1), + e_anonymous(2) + } + + } // end geoNwPicsTypes + + group utPrimitives { + + /** + * @desc Upper Tester message to initialize IUT + * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use + */ + type record UtGnInitialize { + Oct8 hashedId8 + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Upper Tester results message of the GeoNetworking IUT + * @member utGnInitialize - + * @member utGnTriggerResult - + * @member utAutoInteropTriggerResult - + * @member utGnChangePositionResult - + */ + type union UtGnResults { + boolean utGnInitializeResult, + boolean utGnTriggerResult, + boolean utAutoInteropTriggerResult, // FIXME Remove UtAutoInteropTrigger from GN component, create an AutoInterop component + boolean utGnChangePositionResult + } with { + variant "" + } // End of type UtGnResults + + /** + * @desc AutoInterop UpperTester trigger + * @member utRadioOnOff Set to true to power on the radio (on-link mode), false to power off the radio (off-link). + */ + type union UtAutoInteropTrigger { + boolean utRadioOnOff + } with { + variant "" + } // End of type UtAutoInteropTrigger + + /** + * @desc Upper Tester message to change the position of IUT. Values a relatives + */ + type record UtGnChangePosition { + Int32 latitude, + Int32 longitude, + Int32 elevation + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc UT primitives for GeoNetworking + * @member geoUnicast - + * @member geoBroadcast - + * @member geoAnycast - + * @member shb - + * @member tsb - + * @member changePosition - + * @member checkPacket - + */ + type union UtGnTrigger { + GenerateGeoUnicastMessage geoUnicast, + GenerateGeoBroadcastMessage geoBroadcast, + GenerateGeoAnycastMessage geoAnycast, + GenerateSHBMessage shb, + GenerateTSBMessage tsb + } with { + variant "" + } + + /** + * @desc UT primitive for IUT to send a GeoUnicast packet + * @member gnAddress Destination of the packet + * @member lifetime Lifetime of the packet + * @member trafficClass Traffic class of the packet + * @member payload GnRawPayload of the packet + */ + type record GenerateGeoUnicastMessage { + GN_Address gnAddress, + UInt16 lifetime, + TrafficClass trafficClass, + GnRawPayload payload + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc UT primitive for IUT to send a GeoBroadcast packet + * @member shape Shape of the area + * @member lifetime Lifetime of the packet + * @member trafficClass Traffic class of the packet + * @member area Destination GeoArea + * @member payload GnRawPayload of the packet + */ + type record GenerateGeoBroadcastMessage { + GeoShape shape, + UInt16 lifetime, + TrafficClass trafficClass, + UInt24 reserved, + Area area, + GnRawPayload payload + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc UT primitive for IUT to send a Geoanycast packet + */ + type GenerateGeoBroadcastMessage GenerateGeoAnycastMessage; + + /** + * @desc UT primitive for IUT to send a SHB packet + * @member trafficClass Traffic class of the packet + * @member payload GnRawPayload of the packet + */ + type record GenerateSHBMessage { + TrafficClass trafficClass, + GnRawPayload payload + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc UT primitive for IUT to send a SHB packet + * @member nbHops Number of Hops + * @member lifetime Lifetime of the packet + * @member trafficClass Traffic class of the packet + * @member payload GnRawPayload of the packet + */ + type record GenerateTSBMessage { + UInt8 nbHops, + UInt16 lifetime, + TrafficClass trafficClass, + GnRawPayload payload + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Upper Tester message to check Upper Layer message transmission on GN IUT + */ + type record UtGnEventInd { + // GeoNetworkingPdu gnPdu + GnRawPayload rawPayload + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc List of Upper Tester messages to check Upper Layer message transmission on GN IUT + */ + type record of UtGnEventInd UtGnEventIndList; + + } // end utPrimitives + with { + encode "UpperTester"; + variant "" + } + + group acPrimitives { + + /** + * @desc TA primitives for GeoNetworking + * @member startBeaconing - + * @member stopBeaconing - + * @member startPassBeaconing - + * @member stopPassBeaconing - + * @member startBeaconingMultipleNeighbour - + * @member stopBeaconingMultipleNeighbour - + * @member getLongPosVector - + */ + type union AcGnPrimitive { + AcStartBeaconing startBeaconing, + AcStopBeaconing stopBeaconing, + AcStartPassBeaconing startPassBeaconing, + AcStopPassBeaconing stopPassBeaconing, + AcStartBeaconingMultipleNeighbour startBeaconingMultipleNeighbour, + AcStopBeaconingMultipleNeighbour stopBeaconingMultipleNeighbour, + AcGetLongPosVector getLongPosVector + } with { + variant "" + } + + /** + * @desc Primitive for receiveing response from TA + * @member getLongPosVector + */ + type union AcGnResponse { + LongPosVector getLongPosVector, + AcGnResponseFailure failure + } + with { + variant "" + encode(getLongPosVector) "LibItsGeoNetworking" + } + + type record AcGnResponseFailure { + boolean failure + } + + /** + * @desc Primitive for TA to start sending beacons for the test component + * @member beaconHeader Beacon template + */ + type record AcStartBeaconing { + GeoNetworkingPdu beaconPacket + } + with { + encode(beaconPacket) "LibItsGeoNetworking" + } + + /** + * @desc Primitive for TA to stop sending beacons for the test component + */ + type record AcStopBeaconing { + } + + /** + * @desc Primitive for TA to start enqueueing received beacons + * @member beaconHeader Filter + */ + type record AcStartPassBeaconing { + BeaconHeader beaconHeader + } + with { + encode(beaconHeader) "LibItsGeoNetworking" + }; + + /** + * @desc Primitive for TA to stop enqueueing received beacons + */ + type record AcStopPassBeaconing { + } + + /** + * @desc Primitive for TA to start sending beacons for multiple neighbours + * @member beaconHeader Beacon template + * @member numberOfNeighbour Number of neighbours to simulate + */ + type record AcStartBeaconingMultipleNeighbour { + GeoNetworkingPdu beaconPacket, + integer numberOfNeighbour + } + with { + encode(beaconPacket) "LibItsGeoNetworking" + }; + + /** + * @desc Primitive for TA to stop sending beacons for multiple neighbours + */ + type record AcStopBeaconingMultipleNeighbour { + } + + /** + * @desc Primitive for retrieving the position vector corresponding to a specific GN address + * @member gnAddress GN address to be searched + */ + type record AcGetLongPosVector { + GN_Address gnAddress + } + with { + encode(gnAddress) "LibItsGeoNetworking" + }; + + } // end acPrimitives + with { + variant "" + encode "AdapterControl" + } +} +with { + variant "" + encode "LibItsGeoNetworking" + } diff --git a/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn b/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn index 7ddd482b..d48e56d0 100644 --- a/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn +++ b/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn @@ -1,58 +1,58 @@ -module LibItsSecurity_EncdecDeclarations { - - // LibIts - //import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; - //import from EtsiTs103097Module language "ASN.1:1997" all; - - import from LibItsSecurity_TypesAndValues all; - - /** - * @desc Encoding function for EtsiTs103097Certificate certificate - * @param p The certificate to encode - * @return The encode message in OER format - */ - external function fx_enc_CertificateBase(in IEEE1609dot2.CertificateBase p) return bitstring - with {extension "prototype(convert) encode(PER)"} - - external function fx_dec_CertificateBase(inout bitstring b, out IEEE1609dot2.CertificateBase p) return integer - with {extension "prototype(sliding) decode(PER)"} - - /** - * @desc Encoding function for IEEE1609dot2.ToBeSignedCertificate - * @param p The ToBeSign part of the certificate - * @return The encode message in OER format - */ - external function fx_enc_ToBeSignedCertificate(in IEEE1609dot2.ToBeSignedCertificate p) return bitstring - with {extension "prototype(convert) encode(PER)"} - - /** - * @desc Encoding function for IEEE1609dot2.Ieee1609Dot2Data - * @param p The Ieee1609Dot2Data part of the certificate - * @return The encode message in OER format - */ - external function fx_enc_Ieee1609Dot2Data(in IEEE1609dot2.Ieee1609Dot2Data p) return bitstring - with {extension "prototype(convert) encode(PER)"} - - external function fx_dec_Ieee1609Dot2Data(inout bitstring p_data, out IEEE1609dot2.Ieee1609Dot2Data p_ieee1609Dot2Data) return integer - with {extension "prototype(sliding) decode(PER)"} - - external function fx_enc_Ieee1609Dot2ToBeSignedData(in IEEE1609dot2.ToBeSignedData p) return bitstring - with {extension "prototype(convert) encode(PER)"} - - external function fx_dec_Ieee1609Dot2ToBeSignedData(inout bitstring p_data, out IEEE1609dot2.ToBeSignedData p_toBeSignedData) return integer - with {extension "prototype(sliding) decode(PER)"} - - external function fx_enc_SspCAM (LibItsSecurity_TypesAndValues.SspCAM p_ssp) return bitstring - with {extension "prototype(convert) encode(LibItsSecurity)"} - - external function fx_dec_SspCAM (inout bitstring p_data, out LibItsSecurity_TypesAndValues.SspCAM p_ssp) return integer - with {extension "prototype(sliding) decode(LibItsSecurity)"} - - external function fx_enc_SspDENM (LibItsSecurity_TypesAndValues.SspDENM p_ssp) return bitstring - with {extension "prototype(convert) encode(LibItsSecurity)"} - - external function fx_dec_SspDENM (inout bitstring p_data, out LibItsSecurity_TypesAndValues.SspDENM p_ssp) return integer - with {extension "prototype(sliding) decode(LibItsSecurity)"} - -} // End of module LibItsSecurity_EncdecDeclarations +module LibItsSecurity_EncdecDeclarations { + + // LibIts + //import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + import from IEEE1609dot2 language "ASN.1:1997" all; + //import from EtsiTs103097Module language "ASN.1:1997" all; + + import from LibItsSecurity_TypesAndValues all; + + /** + * @desc Encoding function for EtsiTs103097Certificate certificate + * @param p The certificate to encode + * @return The encode message in OER format + */ + external function fx_enc_CertificateBase(in IEEE1609dot2.CertificateBase p) return bitstring + with {extension "prototype(convert) encode(PER)"} + + external function fx_dec_CertificateBase(inout bitstring b, out IEEE1609dot2.CertificateBase p) return integer + with {extension "prototype(sliding) decode(PER)"} + + /** + * @desc Encoding function for IEEE1609dot2.ToBeSignedCertificate + * @param p The ToBeSign part of the certificate + * @return The encode message in OER format + */ + external function fx_enc_ToBeSignedCertificate(in IEEE1609dot2.ToBeSignedCertificate p) return bitstring + with {extension "prototype(convert) encode(PER)"} + + /** + * @desc Encoding function for IEEE1609dot2.Ieee1609Dot2Data + * @param p The Ieee1609Dot2Data part of the certificate + * @return The encode message in OER format + */ + external function fx_enc_Ieee1609Dot2Data(in IEEE1609dot2.Ieee1609Dot2Data p) return bitstring + with {extension "prototype(convert) encode(PER)"} + + external function fx_dec_Ieee1609Dot2Data(inout bitstring p_data, out IEEE1609dot2.Ieee1609Dot2Data p_ieee1609Dot2Data) return integer + with {extension "prototype(sliding) decode(PER)"} + + external function fx_enc_Ieee1609Dot2ToBeSignedData(in IEEE1609dot2.ToBeSignedData p) return bitstring + with {extension "prototype(convert) encode(PER)"} + + external function fx_dec_Ieee1609Dot2ToBeSignedData(inout bitstring p_data, out IEEE1609dot2.ToBeSignedData p_toBeSignedData) return integer + with {extension "prototype(sliding) decode(PER)"} + + external function fx_enc_SspCAM (LibItsSecurity_TypesAndValues.SspCAM p_ssp) return bitstring + with {extension "prototype(convert) encode(LibItsSecurity)"} + + external function fx_dec_SspCAM (inout bitstring p_data, out LibItsSecurity_TypesAndValues.SspCAM p_ssp) return integer + with {extension "prototype(sliding) decode(LibItsSecurity)"} + + external function fx_enc_SspDENM (LibItsSecurity_TypesAndValues.SspDENM p_ssp) return bitstring + with {extension "prototype(convert) encode(LibItsSecurity)"} + + external function fx_dec_SspDENM (inout bitstring p_data, out LibItsSecurity_TypesAndValues.SspDENM p_ssp) return integer + with {extension "prototype(sliding) decode(LibItsSecurity)"} + +} // End of module LibItsSecurity_EncdecDeclarations diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index e260025d..037fa901 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -1,3327 +1,3322 @@ -/** - * @author ETSI / STF481 / STF507 / STF517 / STF538 / STF545 - * @version $URL$ - * $Id$ - * @desc Module containing functions for Security Protocol - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsSecurity_Functions { - - // Libcommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; - - // LibItsCommon - //import from LibItsCommon_Functions all; - //import from LibItsCommon_TypesAndValues all; - import from LibItsCommon_Pixits all; - - // LibItsSecurity - import from LibItsSecurity_TypesAndValues all; - import from LibItsSecurity_Templates all; - import from LibItsSecurity_Pixits all; - import from LibItsSecurity_Pics all; - import from LibItsSecurity_TestSystem all; - - group helpersFunctions { - - /** - * @desc Produces a 256-bit (32-byte) hash value - * @param p_toBeHashedData Data to be used to calculate the hash value - * @return The hash value - */ - function f_hashWithSha256( - in octetstring p_toBeHashedData - ) return Oct32 { - return fx_hashWithSha256(p_toBeHashedData); - } // End of function f_hashWithSha256 - - /** - * @desc Produces a 384-bit (48-byte) hash value - * @param p_toBeHashedData Data to be used to calculate the hash value - * @return The hash value - */ - function f_hashWithSha384( - in octetstring p_toBeHashedData - ) return Oct48 { - return fx_hashWithSha384(p_toBeHashedData); - } // End of function f_hashWithSha256 - - /** - * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature based on standard IEEE 1609.2 - * @param p_toBeSignedSecuredMessage The data to be signed - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_privateKey The private key for signature - * @return The signature value - */ - function f_signWithEcdsaNistp256WithSha256( - in octetstring p_toBeSignedSecuredMessage, - in Oct32 p_certificateIssuer, - in Oct32 p_privateKey - ) return octetstring { - return fx_signWithEcdsaNistp256WithSha256( - p_toBeSignedSecuredMessage, - p_certificateIssuer, - p_privateKey - ); - - } // End of function f_signWithEcdsaNistp256WithSha256 - - /** - * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature based on standard IEEE 1609.2 - * @param p_toBeSignedSecuredMessage The data to be signed - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_privateKey The private key for signature - * @return The signature value - */ - function f_signWithEcdsaBrainpoolp256WithSha256( - in octetstring p_toBeSignedSecuredMessage, - in Oct32 p_certificateIssuer, - in Oct32 p_privateKey - ) return octetstring { - return fx_signWithEcdsaBrainpoolp256WithSha256( - p_toBeSignedSecuredMessage, - p_certificateIssuer, - p_privateKey - ); - - } // End of function f_signWithEcdsaBrainpoolp256WithSha256 - - /** - * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature based on standard IEEE 1609.2 - * @param p_toBeSignedSecuredMessage The data to be signed - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_privateKey The private key for signature - * @return The signature value - */ - function f_signWithEcdsaBrainpoolp384WithSha384( - in octetstring p_toBeSignedSecuredMessage, - in Oct48 p_certificateIssuer, - in Oct48 p_privateKey - ) return octetstring { - log(">>> f_signWithEcdsaBrainpoolp384WithSha384: ", p_toBeSignedSecuredMessage); - log(">>> f_signWithEcdsaBrainpoolp384WithSha384: ", p_certificateIssuer); - log(">>> f_signWithEcdsaBrainpoolp384WithSha384: ", p_privateKey); - return fx_signWithEcdsaBrainpoolp384WithSha384( - p_toBeSignedSecuredMessage, - p_certificateIssuer, - p_privateKey - ); - - } // End of function f_signWithEcdsaBrainpoolp384WithSha384 - - function f_decrypt( - in octetstring p_encryptPrivateKey, - in EtsiTs103097Data p_encrypedSecuredMessage, - in octetstring p_salt, - out EtsiTs103097Data p_decrypedSecuredMessage, - out octetstring p_aes_sym_enc_key - ) return boolean { - if (ischosen(p_encrypedSecuredMessage.content.encryptedData)) { - var PKRecipientInfo v_pKRecipientInfo; - var RecipientInfo v_recipientInfo := p_encrypedSecuredMessage.content.encryptedData.recipients[0]; - var octetstring v_decryptedSecuredMessage; - - // Check the private encryption key - if (not(isbound(p_encryptPrivateKey))) { - log("*** " & testcasename() & ":ERROR: Failed to load encryption private key ***"); - return false; - } - - if (ischosen(v_recipientInfo.certRecipInfo)) { - v_pKRecipientInfo := p_encrypedSecuredMessage.content.encryptedData.recipients[0].certRecipInfo; - // Read the certificate based on the recipientId - } else if (ischosen(v_recipientInfo.signedDataRecipInfo)) { - v_pKRecipientInfo := p_encrypedSecuredMessage.content.encryptedData.recipients[0].signedDataRecipInfo; - // Read the certificate based on the recipientId - } else { - log("*** " & testcasename() & ":ERROR: Unsupported RecipientInfo variant ***"); - return false; - } - - if (isbound(v_pKRecipientInfo)) { - if (ischosen(v_pKRecipientInfo.encKey.eciesNistP256)) { - var SymmetricCiphertext v_ciphertext := p_encrypedSecuredMessage.content.encryptedData.ciphertext; - if (ischosen(v_pKRecipientInfo.encKey.eciesNistP256.v.compressed_y_0)) { - v_decryptedSecuredMessage := f_decryptWithEciesNistp256WithSha256( - v_ciphertext.aes128ccm.ccmCiphertext, - p_encryptPrivateKey, - v_pKRecipientInfo.encKey.eciesNistP256.v.compressed_y_0, - 0, - v_pKRecipientInfo.encKey.eciesNistP256.c, - v_pKRecipientInfo.encKey.eciesNistP256.t, - v_ciphertext.aes128ccm.nonce, - p_salt, - p_aes_sym_enc_key - ); - } else if (ischosen(v_pKRecipientInfo.encKey.eciesNistP256.v.compressed_y_1)) { - v_decryptedSecuredMessage := f_decryptWithEciesNistp256WithSha256( - v_ciphertext.aes128ccm.ccmCiphertext, - p_encryptPrivateKey, - v_pKRecipientInfo.encKey.eciesNistP256.v.compressed_y_1, - 1, - v_pKRecipientInfo.encKey.eciesNistP256.c, - v_pKRecipientInfo.encKey.eciesNistP256.t, - v_ciphertext.aes128ccm.nonce, - p_salt, - p_aes_sym_enc_key - ); - } else { - log("*** " & testcasename() & ":ERROR: Non canonical ephemeral encryption keys ***"); - return false; - } - if (isbound(v_decryptedSecuredMessage)) { - var bitstring v_decode := oct2bit(v_decryptedSecuredMessage); - if (decvalue(v_decode, p_decrypedSecuredMessage) == 0) { - return true; - } else { - log("*** " & testcasename() & ":ERROR: Faild to decode secured message ***"); - } - } - } else if (ischosen(v_pKRecipientInfo.encKey.eciesBrainpoolP256r1)) { - var SymmetricCiphertext v_ciphertext := p_encrypedSecuredMessage.content.encryptedData.ciphertext; - if (ischosen(v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.compressed_y_0)) { - v_decryptedSecuredMessage := f_decryptWithEciesBrainpoolp256WithSha256( - v_ciphertext.aes128ccm.ccmCiphertext, - p_encryptPrivateKey, - v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.compressed_y_0, - 0, - v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.c, - v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.t, - v_ciphertext.aes128ccm.nonce, - p_salt, p_aes_sym_enc_key - ); - } else if (ischosen(v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.compressed_y_1)) { - v_decryptedSecuredMessage := f_decryptWithEciesBrainpoolp256WithSha256( - v_ciphertext.aes128ccm.ccmCiphertext, - p_encryptPrivateKey, - v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.compressed_y_1, - 1, - v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.c, - v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.t, - v_ciphertext.aes128ccm.nonce, - p_salt, - p_aes_sym_enc_key - ); - } else { - log("*** " & testcasename() & ":ERROR: Non canonical ephemeral encryption keys ***"); - return false; - } - } else { - log("*** " & testcasename() & ":ERROR: Non canonical ephemeral encryption keys ***"); - return false; - } - // TODO else, other variants shall be processed here if - } else { - log("*** " & testcasename() & ":ERROR: Invalid recipient info ***"); - return false; - } - if (isbound(v_decryptedSecuredMessage)) { - var bitstring v_decode := oct2bit(v_decryptedSecuredMessage); - if (decvalue(v_decode, p_decrypedSecuredMessage) == 0) { - return true; - } else { - log("*** " & testcasename() & ":ERROR: Faild to decode secured message ***"); - } - } - } else { - log("*** " & testcasename() & ":ERROR: Message not encrypted ***"); - } - - return false; - } // End of function f_decrypt - - /** - * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption using Nist-P256 algorithm - * @param p_toBeEncryptedSecuredMessage The data to be encrypted - * @param p_recipientsPublicKeyCompressed The Recipient's compressed public key - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key - * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key - * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption - * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption - * @see IEEE Std 1609.2-2017 Clause 5.3.5 Public key encryption algorithms: ECIES - * @see https://www.nominet.uk/researchblog/how-elliptic-curve-cryptography-encryption-works/ - * @see http://digital.csic.es/bitstream/10261/32671/1/V2-I2-P7-13.pdf - * @return The encrypted message - */ - function f_encryptWithEciesNistp256WithSha256( - in octetstring p_toBeEncryptedSecuredMessage, - in Oct32 p_recipientsPublicKeyCompressed, - in integer p_compressed_mode, - in octetstring p_salt, - out Oct32 p_publicEphemeralKeyCompressed, - out integer p_ephemeralKeyModeCompressed, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce, - in boolean p_use_hardcoded_values := false - ) return octetstring { - return fx_encryptWithEciesNistp256WithSha256( - p_toBeEncryptedSecuredMessage, - p_recipientsPublicKeyCompressed, - p_compressed_mode, - p_salt, - p_publicEphemeralKeyCompressed, - p_ephemeralKeyModeCompressed, - p_aes_sym_key, - p_encrypted_sym_key, - p_authentication_vector, - p_nonce, - p_use_hardcoded_values - ); - } // End of function f_encryptWithEciesNistp256WithSha256 - - /** - * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Nist-P256 algorithm - * @param p_encryptedSecuredMessage The data to be decrypted - * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key - * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key - * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption - * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption - * @return The decrypted message - * @see IEEE Std 1609.2-2017 Clause 5.3.5 Public key encryption algorithms: ECIES - * @see https://www.nominet.uk/researchblog/how-elliptic-curve-cryptography-encryption-works/ - * @see http://digital.csic.es/bitstream/10261/32671/1/V2-I2-P7-13.pdf - */ - function f_decryptWithEciesNistp256WithSha256( - in octetstring p_encryptedSecuredMessage, - in Oct32 p_privateEncKey, - in Oct32 p_publicEphemeralKeyCompressed, - in integer p_ephemeralKeyModeCompressed, - in Oct16 p_encrypted_sym_key, - in Oct16 p_authentication_vector, - in Oct12 p_nonce, - in Oct32 p_salt, - out Oct16 p_aes_sym_enc_key - ) return octetstring { - return fx_decryptWithEciesNistp256WithSha256( - p_encryptedSecuredMessage, - p_privateEncKey, - p_publicEphemeralKeyCompressed, - p_ephemeralKeyModeCompressed, - p_encrypted_sym_key, - p_authentication_vector, - p_nonce, - p_salt, - p_aes_sym_enc_key - ); - } // End of function f_decryptWithEcdsaNistp256WithSha256 - - /** - * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption using Brainpool-P256 algorithm - * @param p_toBeEncryptedSecuredMessage The data to be encrypted - * @param p_recipientsPublicKeyCompressed The Recipient's compressed public key - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key - * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key - * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption - * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption - * @return The encrypted message - * @see IEEE Std 1609.2-2017 Clause 5.3.5 Public key encryption algorithms: ECIES - * @see https://www.nominet.uk/researchblog/how-elliptic-curve-cryptography-encryption-works/ - * @see http://digital.csic.es/bitstream/10261/32671/1/V2-I2-P7-13.pdf - */ - function f_encryptWithEciesBrainpoolp256WithSha256( - in octetstring p_toBeEncryptedSecuredMessage, - in Oct32 p_recipientsPublicKeyCompressed, - in integer p_compressed_mode, - in octetstring p_salt, - out Oct32 p_publicEphemeralKeyCompressed, - out integer p_ephemeralKeyModeCompressed, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce, - in boolean p_use_hardcoded_values := false - ) return octetstring { - return fx_encryptWithEciesBrainpoolp256WithSha256( - p_toBeEncryptedSecuredMessage, - p_recipientsPublicKeyCompressed, - p_compressed_mode, - p_salt, - p_publicEphemeralKeyCompressed, - p_ephemeralKeyModeCompressed, - p_aes_sym_key, - p_encrypted_sym_key, - p_authentication_vector, - p_nonce, - p_use_hardcoded_values - ); - } // End of function f_encryptWithEciesBrainpoolp256WithSha256 - - /** - * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Brainpool-P256 algorithm - * @param p_encryptedSecuredMessage The data to be decrypted - * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key - * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key - * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption - * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption - * @return The decrypted message - * @see IEEE Std 1609.2-2017 Clause 5.3.5 Public key encryption algorithms: ECIES - * @see https://www.nominet.uk/researchblog/how-elliptic-curve-cryptography-encryption-works/ - * @see http://digital.csic.es/bitstream/10261/32671/1/V2-I2-P7-13.pdf - */ - function f_decryptWithEciesBrainpoolp256WithSha256( - in octetstring p_encryptedSecuredMessage, - in Oct32 p_privateEncKey, - in Oct32 p_publicEphemeralKeyCompressed, - in integer p_ephemeralKeyModeCompressed, - in Oct16 p_encrypted_sym_key, - in Oct16 p_authentication_vector, - in Oct12 p_nonce, - in Oct32 p_salt, - out Oct16 p_aes_sym_enc_key - ) return octetstring { - return fx_decryptWithEciesBrainpoolp256WithSha256( - p_encryptedSecuredMessage, - p_privateEncKey, - p_publicEphemeralKeyCompressed, - p_ephemeralKeyModeCompressed, - p_encrypted_sym_key, - p_authentication_vector, - p_nonce, - p_salt, - p_aes_sym_enc_key - ); - } // End of function f_decryptWithEcdsaBrainpoolp256WithSha256 - - /** - * @desc Compute the HashedId8 value from the hash value - * @param p_hash The hash value - * @return The HashedId8 value - * @verdict - */ - function f_hashedId8FromSha256( - in Oct32 p_hash - ) return HashedId8 { - return substr(p_hash, lengthof(p_hash) - 8, 8); - } // End of function f_hashedId8FromSha256 - - /** - * @desc Compute the HashedId8 value from the hash value - * @param p_hash The hash value - * @return The HashedId8 value - * @verdict - */ - function f_hashedId8FromSha384( - in Oct48 p_hash - ) return HashedId8 { - return substr(p_hash, lengthof(p_hash) - 8, 8); - } // End of function f_hashedId8FromSha384 - - /** - * @desc Compute the HashedId3 value from the HashedId8 value - * @param p_hashp_hashedId8 The HashedId8 value - * @return The HashedId3 value - * @verdict Unchanged - */ - function f_hashedId3FromHashedId8( - in HashedId8 p_hashedId8 - ) return HashedId3 { - return substr(p_hashedId8, lengthof(p_hashedId8) - 3, 3); - } // End of function f_hashedId3FromHashedId8 - - /** - * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_signature The signature - * @param p_ecdsaNistp256PublicKeyCompressed The compressed public key - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - function f_verifyWithEcdsaNistp256WithSha256( - in octetstring p_toBeVerifiedData, - in Oct32 p_certificateIssuer, - in Oct64 p_signature, - in Oct32 p_ecdsaNistp256PublicKeyCompressed, - in integer p_compressed_mode - ) return boolean { -// log("f_verifyWithEcdsaNistp256WithSha256: toBeVerifiedData", p_toBeVerifiedData); -// log("f_verifyWithEcdsaNistp256WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); -// log("f_verifyWithEcdsaNistp256WithSha256: signature", p_signature); -// log("f_verifyWithEcdsaNistp256WithSha256: ecdsaNistp256PublicKeyCompressed", p_ecdsaNistp256PublicKeyCompressed); - return fx_verifyWithEcdsaNistp256WithSha256( - p_toBeVerifiedData, - p_certificateIssuer, - p_signature, - p_ecdsaNistp256PublicKeyCompressed, - p_compressed_mode - ); - } // End of function f_verifyWithEcdsaNistp256WithSha256 - - /** - * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_signature The signature - * @param p_ecdsaNistp256PublicKeyX The public key (x coordinate) - * @param p_ecdsaNistp256PublicKeyY The public key (y coordinate) - * @return true on success, false otherwise - */ - function f_verifyWithEcdsaNistp256WithSha256_1( // TODO To be removed - in octetstring p_toBeVerifiedData, - in Oct32 p_certificateIssuer, - in Oct64 p_signature, - in Oct32 p_ecdsaNistp256PublicKeyX, - in Oct32 p_ecdsaNistp256PublicKeyY - ) return boolean { -// log("f_verifyWithEcdsaNistp256WithSha256: toBeVerifiedData", p_toBeVerifiedData); -// log("f_verifyWithEcdsaNistp256WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); -// log("f_verifyWithEcdsaNistp256WithSha256: signature", p_signature); -// log("f_verifyWithEcdsaNistp256WithSha256: ecdsaNistp256PublicKeyX", p_ecdsaNistp256PublicKeyX); -// log("f_verifyWithEcdsaNistp256WithSha256: ecdsaNistp256PublicKeyY", p_ecdsaNistp256PublicKeyY); - return fx_verifyWithEcdsaNistp256WithSha256_1( - p_toBeVerifiedData, - p_certificateIssuer, - p_signature, - p_ecdsaNistp256PublicKeyX, - p_ecdsaNistp256PublicKeyY); - } // End of function f_verifyWithEcdsaNistp256WithSha256_1 - - /** - * @Desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_signature The signature - * @param p_ecdsaBrainpoolp256PublicKeyCompressed The compressed public key - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - function f_verifyWithEcdsaBrainpoolp256WithSha256( - in octetstring p_toBeVerifiedData, - in Oct32 p_certificateIssuer, - in Oct64 p_signature, - in Oct32 p_ecdsaBrainpoolp256PublicKeyCompressed, - in integer p_compressed_mode - ) return boolean { -// log("f_verifyWithEcdsaBrainpoolp256WithSha256: toBeVerifiedData", p_toBeVerifiedData); -// log("f_verifyWithEcdsaBrainpoolp256WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); -// log("f_verifyWithEcdsaBrainpoolp256WithSha256: signature", p_signature); -// log("f_verifyWithEcdsaBrainpoolp256WithSha256: ecdsaBrainpoolp256PublicKeyCompressed", p_ecdsaBrainpoolp256PublicKeyCompressed); - return fx_verifyWithEcdsaBrainpoolp256WithSha256( - p_toBeVerifiedData, - p_certificateIssuer, - p_signature, - p_ecdsaBrainpoolp256PublicKeyCompressed, - p_compressed_mode - ); - } // End of function f_verifyWithEcdsaBrainpoolp256WithSha256 - - /** - * @Desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_signature The signature - * @param p_ecdsaBrainpoolp256PublicKeyX The public key (x coordinate) - * @param p_ecdsaBrainpoolp256PublicKeyY The public key (y coordinate) - * @return true on success, false otherwise - */ - function f_verifyWithEcdsaBrainpoolp256WithSha256_1( // TODO To be removed - in octetstring p_toBeVerifiedData, - in Oct32 p_certificateIssuer, - in Oct64 p_signature, - in Oct32 p_ecdsaBrainpoolp256PublicKeyX, - in Oct32 p_ecdsaBrainpoolp256PublicKeyY - ) return boolean { -// log("f_verifyWithEcdsaBrainpoolp256WithSha256: toBeVerifiedData", p_toBeVerifiedData); -// log("f_verifyWithEcdsaBrainpoolp256WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); -// log("f_verifyWithEcdsaBrainpoolp256WithSha256: signature", p_signature); -// log("f_verifyWithEcdsaBrainpoolp256WithSha256: ecdsaBrainpoolp256PublicKeyX", p_ecdsaBrainpoolp256PublicKeyX); -// log("f_verifyWithEcdsaBrainpoolp256WithSha256: ecdsaBrainpoolp256PublicKeyY", p_ecdsaBrainpoolp256PublicKeyY); - return fx_verifyWithEcdsaBrainpoolp256WithSha256_1( - p_toBeVerifiedData, - p_certificateIssuer, - p_signature, - p_ecdsaBrainpoolp256PublicKeyX, - p_ecdsaBrainpoolp256PublicKeyY); - } // End of function f_verifyWithEcdsaBrainpoolp256WithSha256_1 - - /** - * @Desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_signature The signature - * @param p_ecdsaBrainpoolp384PublicKeyX The public key (x coordinate) - * @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate) - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - function f_verifyWithEcdsaBrainpoolp384WithSha384( - in octetstring p_toBeVerifiedData, - in Oct48 p_certificateIssuer, - in Oct96 p_signature, - in Oct48 p_ecdsaBrainpoolp384PublicKeyCompressed, - in integer p_compressed_mode - ) return boolean { -// log("f_verifyWithEcdsaBrainpoolp384WithSha384: toBeVerifiedData", p_toBeVerifiedData); -// log("f_verifyWithEcdsaBrainpoolp384WithSha384: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); -// log("f_verifyWithEcdsaBrainpoolp384WithSha384: signature", p_signature); -// log("f_verifyWithEcdsaBrainpoolp384WithSha384: ecdsaBrainpoolp384PublicKeyCompressed", p_ecdsaBrainpoolp384PublicKeyCompressed); - return fx_verifyWithEcdsaBrainpoolp384WithSha384( - p_toBeVerifiedData, - p_certificateIssuer, - p_signature, - p_ecdsaBrainpoolp384PublicKeyCompressed, - p_compressed_mode - ); - } // End of function f_verifyWithEcdsaBrainpoolp384WithSha384 - - /** - * @Desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_signature The signature - * @param p_ecdsaBrainpoolp384PublicKeyX The public key (x coordinate) - * @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate) - * @return true on success, false otherwise - */ - function f_verifyWithEcdsaBrainpoolp384WithSha384_1( // TODO To be removed - in octetstring p_toBeVerifiedData, - in Oct48 p_certificateIssuer, - in Oct96 p_signature, - in Oct48 p_ecdsaBrainpoolp384PublicKeyX, - in Oct48 p_ecdsaBrainpoolp384PublicKeyY - ) return boolean { -// log("f_verifyWithEcdsaBrainpoolp384WithSha384: toBeVerifiedData", p_toBeVerifiedData); -// log("f_verifyWithEcdsaBrainpoolp384WithSha384: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); -// log("f_verifyWithEcdsaBrainpoolp384WithSha384: signature", p_signature); -// log("f_verifyWithEcdsaBrainpoolp384WithSha384: ecdsaBrainpoolp384PublicKeyX", p_ecdsaBrainpoolp384PublicKeyX); -// log("f_verifyWithEcdsaBrainpoolp384WithSha384: ecdsaBrainpoolp384PublicKeyY", p_ecdsaBrainpoolp384PublicKeyY); - return fx_verifyWithEcdsaBrainpoolp384WithSha384_1( - p_toBeVerifiedData, - p_certificateIssuer, - p_signature, - p_ecdsaBrainpoolp384PublicKeyX, - p_ecdsaBrainpoolp384PublicKeyY); - } // End of function f_verifyWithEcdsaBrainpoolp384WithSha384_1 - - /** - * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. - * This function should not be used by the ATS - * @param p_privateKey The new private key value - * @param p_publicKeyX The new public key value (x coordinate) - * @param p_publicKeyX The new public key value (y coordinate) - * @param p_publicKeyCompressed The compressed public keys - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - function f_generate_key_pair_nistp256( - out Oct32 p_privateKey, - out Oct32 p_publicKeyX, - out Oct32 p_publicKeyY, - out Oct32 p_publicKeyCompressed, - out integer p_compressed_mode - ) return boolean { - log(">>> f_generate_key_pair_nistp256"); - - if (PICS_SEC_FIXED_KEYS) { // Debug mode: Use fixed values - p_privateKey := '43481BC44C073C1432DB6EC4F0EF57062BEA08E4C19F811567325AD1FD1C6577'O; - p_publicKeyX := '0B5D74B033531C51D17B4F218DD4E39289AE4BF2EE3D7BAB7C07DAF0C14F0317'O; - p_publicKeyY := '5D49B139A9237832FDE24D77555878CE65D6C2284A1BDA4CE08ABDD4071E0255'O; - p_publicKeyCompressed := '0B5D74B033531C51D17B4F218DD4E39289AE4BF2EE3D7BAB7C07DAF0C14F0317'O; - p_compressed_mode := 1; - - return true; - } - return fx_generateKeyPair_nistp256(p_privateKey, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressed_mode); - } - - /** - * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. - * This function should not be used by the ATS - * @param p_privateKey The new private key value - * @param p_publicKeyX The new public key value (x coordinate) - * @param p_publicKeyX The new public key value (y coordinate) - * @param p_publicKeyCompressed The compressed public keys - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - function f_generate_key_pair_brainpoolp256( - out Oct32 p_privateKey, - out Oct32 p_publicKeyX, - out Oct32 p_publicKeyY, - out Oct32 p_publicKeyCompressed, - out integer p_compressed_mode - ) return boolean { - log(">>> f_generate_key_pair_brainpoolp256"); - return fx_generateKeyPair_brainpoolp256(p_privateKey, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressed_mode); - } - - /** - * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. - * This function should not be used by the ATS - * @param p_privateKey The new private key value - * @param p_publicKeyX The new public key value (x coordinate) - * @param p_publicKeyX The new public key value (y coordinate) - * @param p_publicKeyCompressed The compressed public keys - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - function f_generate_key_pair_brainpoolp384( - out Oct48 p_privateKey, - out Oct48 p_publicKeyX, - out Oct48 p_publicKeyY, - out Oct48 p_publicKeyCompressed, - out integer p_compressed_mode - ) return boolean { - return fx_generateKeyPair_brainpoolp384(p_privateKey, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressed_mode); - } - - /** - * @desc Calculate digest over the certificate - * @param p_cert The certificate - * @return the HashedId8 value - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.13 HashedId8 - */ - function f_calculateDigestFromCertificate( - in Certificate p_cert - ) return HashedId8 { - var octetstring v_hash; - - if (PICS_SEC_SHA256) { - v_hash := f_calculateDigestSha256FromCertificate(p_cert); - } if (PICS_SEC_SHA384) { - v_hash := f_calculateDigestSha384FromCertificate(p_cert); - } - - return substr(v_hash, lengthof(v_hash) - 8, 8); - } // End of function f_calculateDigestFromCertificate - - /** - * @desc Calculate digest over the certificate - * @param p_cert The certificate - * @return the HashedId8 value - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.13 HashedId8 - */ - function f_calculateDigestSha256FromCertificate( - in EtsiTs103097Certificate p_cert - ) return HashedId8 { - var octetstring v_toBeHashedData; - var octetstring v_hash; - - v_toBeHashedData := bit2oct(encvalue(p_cert)); - v_hash := f_hashWithSha256(v_toBeHashedData); - return substr(v_hash, lengthof(v_hash) - 8, 8); - } // End of function f_calculateDigestSha256FromCertificate - - function f_calculateDigestSha384FromCertificate( - in EtsiTs103097Certificate p_cert - ) return HashedId8 { - var octetstring v_toBeHashedData; - var octetstring v_hash; - - v_toBeHashedData := bit2oct(encvalue(p_cert)); - v_hash := f_hashWithSha384(v_toBeHashedData); - return substr(v_hash, lengthof(v_hash) - 8, 8); - } // End of function f_calculateDigestSha384FromCertificate - - function f_duration2time( - in Duration p_duration - ) return UInt16 { - if (ischosen(p_duration.seconds)) { - return p_duration.seconds; - } else if (ischosen(p_duration.minutes)) { - return p_duration.minutes; - } else if (ischosen(p_duration.hours)) { - return p_duration.hours; - } else if (ischosen(p_duration.sixtyHours)) { - return p_duration.sixtyHours; - } else if (ischosen(p_duration.years)) { - return p_duration.years; - } - - return 0; // Unrechable code - } // End of function f_duration2time - - group hostSignatureHelpers { - - /** - * @desc Initialize [out] certificates according to the specified certificate name - * @param p_certificateName The certificate name to be used - * @param p_aaCertificate The AA certificate [out] - * @param p_atCertificate The AT certificate [out] - * @return true on succes, false otherwise - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.13 HashedId8 - */ - function f_prepareCertificates( - in template (omit) charstring p_certificateName, - out EtsiTs103097Certificate p_aaCertificate, - out EtsiTs103097Certificate p_atCertificate - ) runs on ItsSecurityBaseComponent return boolean { - var charstring v_certificate_id; - - //log(">>> f_prepareCertificates: ", p_certificateName); - - // Load certificates if required - if ((lengthof(p_certificateName) > 0) and (valueof(p_certificateName) != cc_taCert_A)) { - var HashedId8 v_digest; - - if (f_readCertificate(valueof(p_certificateName), p_atCertificate) == false){ - log("f_prepareCertificates: Failed to read certificate ", p_certificateName); - return false; - } - if (ischosen(p_atCertificate.issuer.sha256AndDigest)) { - v_digest := p_atCertificate.issuer.sha256AndDigest; - } else if (ischosen(p_atCertificate.issuer.sha384AndDigest)) { - v_digest := p_atCertificate.issuer.sha384AndDigest; - } else { - log("f_prepareCertificates: Invalid certificate issuer ", p_atCertificate.issuer); - return false; - } - if (f_getCertificateFromDigest(v_digest, p_aaCertificate, v_certificate_id) == false) { - log("f_prepareCertificates: Failed to read certificate issuer ", v_digest); - return false; - } - } else { - p_atCertificate := vc_atCertificate; - p_aaCertificate := vc_aaCertificate; - } - // Store the certificate to build this message - vc_lastAtCertificateUsed := p_atCertificate; - - return true; - } // End of function f_prepareCertificates - - /** - * @desc This function build and sign the SecureMessage part covered by the signature process - * @param p_securedMessage The signed SecureMessage part - * @param p_payloadField Payloads to be included in the message - * @param p_mandatoryHeaders Mandatory headers for the selected profile - * @param p_headerInfo HeaderInfo to be inserted in the message - * @param p_securityProfile Selected security profile - * @return true on success, false otherwise - */ - function f_buildGnSecuredMessage( - inout EtsiTs103097Data p_securedMessage, - in charstring p_certificateName, - in ToBeSignedData p_payloadField - ) runs on ItsSecurityBaseComponent return boolean { - - // Local variables - var octetstring v_secPayload, v_signature; - var ToBeSignedData v_toBeSignedData; - var octetstring v_certificateIssuer; - var octetstring v_privateKey; - - log(">>> f_buildGnSecuredMessage: p_securedMessage=", p_securedMessage); - log(">>> f_buildGnSecuredMessage: p_payloadField=", p_payloadField); - - // Prepare payload to be signed - v_toBeSignedData := valueof(p_payloadField); - v_secPayload := bit2oct(encvalue(v_toBeSignedData)); - - // Signed payload - if (ispresent(p_certificateName) and (valueof(p_certificateName) != cc_taCert_A)) { - if(not f_readSigningKey(valueof(p_certificateName), v_privateKey)){ - return false; - } - } else { - if(not f_readSigningKey(cc_taCert_A, v_privateKey)){ - return false; - } - } - f_getCertificateHash(p_certificateName, v_certificateIssuer); - - if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature)) { - v_signature := f_signWithEcdsaNistp256WithSha256( - v_secPayload, - v_certificateIssuer, - v_privateKey - ); - p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only(substr(v_signature, 0, 32)), - substr(v_signature, 32, 32) - ) - )); - } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { - v_signature := f_signWithEcdsaBrainpoolp256WithSha256( - v_secPayload, - v_certificateIssuer, - v_privateKey - ); - p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP256r1( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only(substr(v_signature, 0, 32)), - substr(v_signature, 32, 32) - ) - )); - } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature)) { - v_signature := f_signWithEcdsaBrainpoolp384WithSha384( - v_secPayload, - v_certificateIssuer, - v_privateKey - ); - p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP384r1( - m_ecdsaP384Signature( - m_eccP384CurvePoint_x_only(substr(v_signature, 0, 48)), - substr(v_signature, 48, 48) - ) - )); - } // TODO To be continued - - log("<<< f_buildGnSecuredMessage: p_securedMessage=", p_securedMessage); - return true; - } // End of function f_buildGnSecuredMessage - - /** - * @desc This function build and sign the SecureMessage part covered by the signature process including wrong elements of protocols. It is used for BO test cases - * @param p_securedMessage The signed SecureMessage part - * @param p_certificateName The certificate name - * @param p_protocolVersion The protocol version to be set. Default: 2 - * @param p_trailerStatus The Traile behaviour: - *
  • 0 for no trailer
  • - *
  • 1 for invalid trailer
  • - *
  • 2 for duplicated trailer
  • - * @param p_payloadField Payloads to be included in the message - * @param p_mandatoryHeaders Mandatory headers for the selected profile - * @param p_headerInfo HeaderInfo to be inserted in the message - * @param p_securityProfile Selected security profile - * @return true on success, false otherwise - */ - function f_buildGnSecuredMessage_Bo( - inout EtsiTs103097Data p_securedMessage, - in template (value) charstring p_certificateName, - in UInt8 p_protocolVersion := c_protocol_version, - in integer p_trailerStatus := 0, - in template (value) ToBeSignedData p_payloadField, - in template (value) HeaderInfo p_mandatoryHeaders, - in template (omit) HeaderInfo p_headerInfo := omit - ) return boolean { - - // Local variables - var octetstring v_secPayload, v_signature; - var template (value) ToBeSignedData v_toBeSignedData; - var integer i, j, k, n; - var HeaderInfo v_headerFields; - var Ieee1609Dot2Content v_toBeSignedPayload; - var Oct32 v_privateKey; - var UInt8 v_trailerSize; - - // Prepare headers - if (not(ispresent(p_headerInfo))) { - v_headerFields := valueof(p_mandatoryHeaders); - } else {/* FIXME To be reviewed - // Merge p_headerInfo and v_mandatoryHeaders into v_headerFields - - i := 0; // index for p_headerInfo - j := 0; // index for v_mandatoryHeaders - k := 0; // index for v_headerFields - - // Special processing for signer_info - if (lengthof(valueof(p_headerInfo)) > 0 and valueof(p_headerInfo[i].type_) == e_signer_info) { - v_headerFields[k] := valueof(p_headerInfo[i]); - k := k + 1; - i := i + 1; - } - - for (j := j; j < lengthof(p_mandatoryHeaders); j := j + 1) { - // Search for mandatory header in p_HeaderFields - for (n := 0; n < lengthof(p_headerInfo); n := n + 1) { - if (valueof(p_headerInfo[n].type_) == valueof(p_mandatoryHeaders[j].type_)) { - // mandatory header already in p_HeaderFields - break; - } - } // End of 'for' statement - if (n >= lengthof(p_headerInfo)) { - if (valueof(p_mandatoryHeaders[j].type_) != e_signer_info) { - // Add headers from p_headerInfo having lower number than mandatory header - for (n := i; n < lengthof(p_headerInfo) and valueof(p_headerInfo[n].type_) < valueof(p_mandatoryHeaders[j].type_); n := n + 1) { - v_headerFields[k] := valueof(p_headerInfo[n]); - k := k + 1; - i := i + 1; - } - } - // Add mandatory header - v_headerFields[k] := valueof(p_mandatoryHeaders[j]); - k := k + 1; - } - } // End of 'for' statement - - // Add remaining headers from p_HeaderFields - for ( i := i; i < lengthof(p_headerInfo); i := i + 1) { - // Add headers from p_headerInfo having lower number than mandatory header - v_headerFields[k] := valueof(p_headerInfo[i]); - k := k + 1; - } // End of 'for' statement - */} - - // Prepare payload to be signed - /* FIXME To be reviewed v_toBeSignedPayload := valueof(p_payloadField); -// log("p_trailerStatus=", p_trailerStatus); - if (p_trailerStatus == 0) { - v_trailerSize := 0; - } else if (p_trailerStatus == 1) { - v_trailerSize := 67; - } else if (p_trailerStatus == 2) { - v_trailerSize := 2 * 67; - } else { - v_trailerSize := 67; - } - v_toBeSignedData := m_toBeSignedSecuredMessage_wrong_protocol( - v_headerFields, - v_toBeSignedPayload, - e_signature, - p_protocolVersion, - v_trailerSize - );*/ -// log("m_toBeSignedSecuredMessage_wrong_protocol=", v_toBeSignedData); - - /* FIXME To be reviewedv_secPayload := bit2oct(encvalue(v_toBeSignedData)); -// log("v_secPayload=", v_secPayload); - - // Signed payload - if (ispresent(p_certificateName) and (valueof(p_certificateName) != cc_taCert_A)) { - if(not f_readSigningKey(valueof(p_certificateName), v_privateKey)){ - return false; - } - } else { - if(not f_readSigningKey(cc_taCert_A, v_privateKey)){ - return false; - } - } - v_signature := f_signWithEcdsaNistp256WithSha256( - v_secPayload, - v_privateKey - );*/ -// log("v_signature=", v_signature); - -// log("p_trailerStatus=", p_trailerStatus); - /* FIXME To be reviewed if (p_trailerStatus == 0) { // No signature - p_securedMessage := m_securedMessage( - valueof(v_toBeSignedData.header_fields), - p_payloadField, - { } - ); - v_trailerSize := 0; - } else if (p_trailerStatus == 2) { // Duplicate signature - p_securedMessage := m_securedMessage( - valueof(v_toBeSignedData.header_fields), - p_payloadField, - { - m_trailer_field_signature( - m_signature( - m_ecdsaSignature( - m_eccPointecdsa_nistp256_with_sha256_y_coordinate_only( - substr(v_signature, 2, 32) - ), - substr(v_signature, 34, 32) - ) - ) - ), - m_trailer_field_signature( - m_signature( - m_ecdsaSignature( - m_eccPointecdsa_nistp256_with_sha256_y_coordinate_only( - substr(v_signature, 2, 32) - ), - substr(v_signature, 34, 32) - ) - ) - ) - } - ); - } else if (p_trailerStatus == 3) { // Signature with reserved algorthm - p_securedMessage := m_ieee1609Dot2Data_wrong_protocol( - p_protocolVersion, - valueof(v_toBeSignedData.header_fields), - p_payloadField, - { - m_trailer_field_signature( - m_unknownSignature( - v_signature - ) - ) - } - ); - } else { // Invalid signature - p_securedMessage := m_securedMessage( - valueof(v_toBeSignedData.header_fields), - p_payloadField, - { - m_trailer_field_signature( - m_signature( - m_ecdsaSignature( - m_eccPointecdsa_nistp256_with_sha256_y_coordinate_only( - substr(v_signature, 2, 32) - ), - substr(v_signature, 34, 32) - ) - ) - ) - } - ); - p_securedMessage.trailer_fields[0].trailerField.signature_.ecdsaNistP256Signature.sSig := not4b(valueof(p_securedMessage.trailer_fields[0].trailerField.signature_.ecdsaNistP256Signature.sSig)); - }*/ - - return false;/* FIXME To be reviewed true;*/ - } // End of function f_buildGnSecuredMessage_Bo - - /** - * @desc This function build and sign the SecureMessage part covered by the signature process - * @param p_securedMessage The signed SecureMessage part - * @param p_payloadField Payloads to be included in the message - * @param p_signerIdentifierType Add digest or AT certificate or certificate chain - * @param p_certificateName The certificate identifier to be used. Default: TA_CERT_A - * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerInfo - * @return true on success, false otherwise - * - * @see Draft ETSI TS 103 097 V1.1.14 Clause 7.1 Security profile for CAMs - */ - function f_buildGnSecuredCam( - inout EtsiTs103097Data p_securedMessage, - in ToBeSignedData p_payloadField, - in SignerIdentifier p_signerIdentifierType, - in charstring p_certificateName := ""/*, - in boolean p_addMissingHeaders := true*/ - ) runs on ItsSecurityBaseComponent return boolean { - // Local variables - var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; - - log(">>> f_buildGnSecuredCam: p_securedMessage= ", p_securedMessage); - log(">>> f_buildGnSecuredCam: p_payloadField= ", p_payloadField); - - // Load certificates if required - if (f_prepareCertificates(p_certificateName, v_aaCertificate, v_atCertificate) == false) { - return false; - } - //log("f_buildGnSecuredCam: v_atCertificate = ", v_atCertificate); - - // Fill the structure with default values, these values will be updated later - p_securedMessage := valueof(m_etsiTs103097Data_signed( - m_signedData( - sha256, - p_payloadField, - m_signerIdentifier_self, - m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only(int2oct(0, 32)), - int2oct(0, 32) - ) - ) - ) - )); - // Prepare mandatory headers - //log("f_buildGnSecuredCam: p_signerIdentifierType=", p_signerIdentifierType); - if (ischosen(p_signerIdentifierType.certificate)) { // Add the AT certificate - log("*** " & testcasename() & "f_buildGnSecuredCam: TODO ***"); - stop; - /* TODO - * v_signerInfo := valueof( - m_header_info_signer_info( - m_signerIdentifier_certificate( - v_atCertificate - ))); - } else if (valueof(p_signerIdentifierType) == e_certificate_chain) { // Add the AT certificate + AA EtsiTs103097Certificate - v_signerInfo := valueof( - m_header_info_signer_info( - m_signerIdentifier_certificates( - { - v_aaCertificate, - v_atCertificate - } - ) - ));*/ - } else if (ischosen(p_signerIdentifierType.digest)) { // Add the AT certificate digest - if (ischosen(v_atCertificate.issuer.sha256AndDigest)) { - p_securedMessage.content.signedData.hashId := sha256; - p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_digest( - f_calculateDigestSha256FromCertificate(v_atCertificate) - )); - } else if (ischosen(v_atCertificate.issuer.sha384AndDigest)) { - p_securedMessage.content.signedData.hashId := sha384; - p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_digest( - f_calculateDigestSha384FromCertificate(v_atCertificate) - )); - } - } else { - log("*** " & testcasename() & "f_buildGnSecuredCam: TODO ***"); - stop; - } - if (ispresent(v_atCertificate.signature_)) { - if (ischosen(v_atCertificate.signature_.ecdsaBrainpoolP256r1Signature)) { - p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP256r1( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only(int2oct(0, 32)), - int2oct(0, 32) - ) - )); - } else if (ischosen(v_atCertificate.signature_.ecdsaBrainpoolP384r1Signature)) { - p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP384r1( - m_ecdsaP384Signature( - m_eccP384CurvePoint_x_only(int2oct(0, 48)), - int2oct(0, 48) - ) - )); - } // else, m_signature_ecdsaNistP256 already chosen by default - } - //log("f_buildGnSecuredCam: p_securedMessage = ", p_securedMessage); - - return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField/*, v_mandatoryHeaders*/); - - } // End of function f_buildGnSecuredCam - - /** - * @desc This function build and sign the SecureMessage part covered by the signature process including wrong elements of protocols. It is used for BO test cases - * @param p_securedMessage The signed SecureMessage part - * @param p_protocolVersion The protocol version to be set. Default: 2 - * @param p_trailerStatus The Traile behaviour: - *
  • 0 for no trailer
  • - *
  • 1 for invalid trailer
  • - *
  • 2 for duplicated trailer
  • - * @param p_payloadField Payloads to be included in the message - * @param p_signerIdentifierType Add digest or AT certificate or certificate chain - * @param p_threeDLocation The 3D location - * @param p_headerInfo HeaderInfo to be inserted in the message - * @param p_certificateName The certificate identifier to be used. Default: TA_CERT_A - * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerInfo - * @param p_alterATCertificateSignature Set to true to alter the AT certificate signature - * @param p_alterAACertificateSignature Set to true to alter the AA certificate signature - * @return true on success, false otherwise - * - * @see Draft ETSI TS 103 097 V1.1.14 Clause 7.1 Security profile for CAMs - */ - function f_buildGnSecuredCam_Bo( - inout EtsiTs103097Data p_securedMessage, - in UInt8 p_protocolVersion := c_protocol_version, - in integer p_trailerStatus := 0, - in ToBeSignedData p_payloadField, - in SignerIdentifier p_signerIdentifierType, // FIXME To be reviewed - in template (omit) HeaderInfo p_headerInfo := omit, - in charstring p_certificateName := "", - in boolean p_addMissingHeaders := true, - in boolean p_alterATCertificateSignature := false, - in boolean p_alterAACertificateSignature := false - ) runs on ItsSecurityBaseComponent return boolean { - - // Local variables - var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; - var HeaderInfo v_mandatoryHeaders := valueof(m_ieee1609Dot2_headerInfo(0)); - var HeaderInfo v_signerInfo; - - // Load certificates if required - if (f_prepareCertificates(p_certificateName, v_aaCertificate, v_atCertificate) == false) { - return false; - } - - if (p_alterATCertificateSignature == true) { - v_atCertificate.signature_.ecdsaNistP256Signature.sSig := not4b(v_atCertificate.signature_.ecdsaNistP256Signature.sSig); - } - - if (p_alterAACertificateSignature == true) { - v_aaCertificate.signature_.ecdsaNistP256Signature.sSig := not4b(v_aaCertificate.signature_.ecdsaNistP256Signature.sSig); - } - - /* FIXME To be reviewed if (p_addMissingHeaders == true) { - // Prepare mandatory headers - if (valueof(p_signerIdentifierType) == e_certificate) { // Add the AT certificate - v_signerInfo := valueof( - m_header_info_signer_info( - m_signerIdentifier_certificate( - v_atCertificate - ))); - } else if (valueof(p_signerIdentifierType) == e_certificate_chain) { // Add the AT certificate + AA EtsiTs103097Certificate - v_signerInfo := valueof( - m_header_info_signer_info( - m_signerIdentifier_certificates( - { - v_aaCertificate, - v_atCertificate - } - ) - )); - } else if (valueof(p_signerIdentifierType) == e_certificate_digest_with_sha256) { // Add the AT certificate digest - v_signerInfo := valueof( - m_header_info_signer_info( - m_issuerIdentifier_sha256AndDigest( - f_calculateDigestFromCertificate(v_atCertificate) - ))); - } - v_mandatoryHeaders := { - v_signerInfo, - valueof(m_header_info_generation_time(1000 * f_getCurrentTime())), // In us - valueof(m_header_info_its_aid(c_its_aid_CAM)) - } - }*/ - - return f_buildGnSecuredMessage_Bo(p_securedMessage, p_certificateName, p_protocolVersion, p_trailerStatus, p_payloadField, v_mandatoryHeaders, p_headerInfo); - - } // End of function f_buildGnSecuredCam_Bo - - /** - * @desc This function build and sign the SecureMessage part covered by the signature process - * @param p_securedMessage The signed SecureMessage part - * @param p_payloadField Payloads to be included in the message - * @param p_signerIdentifierType Add digest or AT certificate or certificate chain - * @param p_threeDLocation The 3D location - * @param p_headerInfo HeaderInfo to be inserted in the message - * @param p_certificateName The certificate identifier to be used. Default: TA_CERT_A - * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerInfo - * @return true on success, false otherwise - */ - function f_buildGnSecuredDenm( - inout EtsiTs103097Data p_securedMessage, - in ToBeSignedData p_payloadField, - in SignerIdentifier p_signerIdentifierType, - in ThreeDLocation p_threeDLocation, - in template (omit) HeaderInfo p_headerInfo := omit, - in charstring p_certificateName := "", - in boolean p_addMissingHeaders := true - ) runs on ItsSecurityBaseComponent return boolean { - - // Local variables - var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; - var HeaderInfo v_mandatoryHeaders := valueof(m_ieee1609Dot2_headerInfo(0)); - var HeaderInfo v_signerInfo; - - // Load certificates if required - if (f_prepareCertificates(p_certificateName, v_aaCertificate, v_atCertificate) == false) { - return false; - } - - // Add additional headers if required - /* FIXME To be reviewed if (p_addMissingHeaders == true) { - // Prepare mandatory headers - if (valueof(p_signerIdentifierType) == e_certificate) { // Add the AT certificate - v_signerInfo := valueof( - m_header_info_signer_info( - m_signerIdentifier_certificate( - v_atCertificate - ))); - } else if (valueof(p_signerIdentifierType) == e_certificate_chain) { // Add the AT certificate + AA EtsiTs103097Certificate - v_signerInfo := valueof( - m_header_info_signer_info( - m_signerIdentifier_certificates( - { - v_aaCertificate, - v_atCertificate - } - ) - )); - } else if (valueof(p_signerIdentifierType) == e_certificate_digest_with_sha256) { // Add the AT certificate digest - v_signerInfo := valueof( - m_header_info_signer_info( - m_issuerIdentifier_sha256AndDigest( - v_atCertificate.cracaId - ))); - } - v_mandatoryHeaders := { - v_signerInfo, - valueof(m_header_info_generation_time(1000 * f_getCurrentTime())), // In us - valueof(m_header_info_generation_location(p_threeDLocation)), - valueof(m_header_info_its_aid(c_its_aid_DENM)) - } - }*/ - - // Build the secured message and return it - return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField/*, v_mandatoryHeaders*/); - - } // End of function f_buildGnSecuredDenm - - /** - * @desc This function build and sign the SecureMessage part covered by the signature process including wrong elements of protocols. It is used for BO test cases - * @param p_securedMessage The signed SecureMessage part - * @param p_protocolVersion The protocol version to be set. Default: 2 - * @param p_trailerStatus The Traile behaviour: - *
  • 0 for no trailer
  • - *
  • 1 for invalid trailer
  • - *
  • 2 for duplicated trailer
  • - * @param p_payloadField Payloads to be included in the message - * @param p_signerIdentifierType Add digest or AT certificate or certificate chain - * @param p_threeDLocation The 3D location - * @param p_headerInfo HeaderInfo to be inserted in the message - * @param p_certificateName The certificate identifier to be used. Default: TA_CERT_A - * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerInfo - * @return true on success, false otherwise - */ - function f_buildGnSecuredDenm_Bo( - inout EtsiTs103097Data p_securedMessage, - in UInt8 p_protocolVersion := c_protocol_version, - in integer p_trailerStatus := 0, - in ToBeSignedData p_payloadField, - in SignerIdentifier p_signerIdentifierType, // FIXME To be reviewed - in ThreeDLocation p_threeDLocation, - in template (omit) HeaderInfo p_headerInfo := omit, - in charstring p_certificateName := "", - in boolean p_addMissingHeaders := true - ) runs on ItsSecurityBaseComponent return boolean { - - // Local variables - var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; - var HeaderInfo v_mandatoryHeaders := valueof(m_ieee1609Dot2_headerInfo(0)); - var HeaderInfo v_signerInfo; - - // Load certificates if required - if (f_prepareCertificates(p_certificateName, v_aaCertificate, v_atCertificate) == false) { - return false; - } - - // Add additional headers if required - /* FIXME To be reviewed if (p_addMissingHeaders == true) { - // Prepare mandatory headers - if (valueof(p_signerIdentifierType) == e_certificate) { // Add the AT certificate - v_signerInfo := valueof( - m_header_info_signer_info( - m_signerIdentifier_certificate( - v_atCertificate - ))); - } else if (valueof(p_signerIdentifierType) == e_certificate_chain) { // Add the AT certificate + AA EtsiTs103097Certificate - v_signerInfo := valueof( - m_header_info_signer_info( - m_signerIdentifier_certificates( - { - v_aaCertificate, - v_atCertificate - } - ) - )); - } else if (valueof(p_signerIdentifierType) == e_certificate_digest_with_sha256) { // Add the AT certificate digest - v_signerInfo := valueof( - m_header_info_signer_info( - m_issuerIdentifier_sha256AndDigest( - v_atCertificate.cracaId - ))); - } - v_mandatoryHeaders := { - v_signerInfo, - valueof(m_header_info_generation_time(1000 * f_getCurrentTime())), // In us - valueof(m_header_info_generation_location(p_threeDLocation)), - valueof(m_header_info_its_aid(c_its_aid_DENM)) - } - }*/ - - // Build the secured message and return it - return f_buildGnSecuredMessage_Bo(p_securedMessage, p_certificateName, p_protocolVersion, p_trailerStatus, p_payloadField, v_mandatoryHeaders, p_headerInfo); - - } // End of function f_buildGnSecuredDenm_Bo - - /** - * @desc This function build and sign the SecureMessage part covered by the signature process - * @param p_securedMessage The signed SecureMessage part - * @param p_payloadField Payloads to be included in the message - * @param p_signerIdentifierType Add digest or AT certificate or certificate chain - * @param p_threeDLocation The 3D location - * @param p_headerInfo HeaderInfo to be inserted in the message - * @param p_certificateName The certificate identifier to be used. Default: TA_CERT_A - * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerInfo - * @return true on success, false otherwise - */ - function f_buildGnSecuredOtherMessage( - inout EtsiTs103097Data p_securedMessage, - in ToBeSignedData p_payloadField, - in SignerIdentifier p_signerIdentifierType, // FIXME To be reviewed - in ThreeDLocation p_threeDLocation, - in template (omit) HeaderInfo p_headerInfo := omit, - in charstring p_certificateName := "", - in boolean p_addMissingHeaders := true - ) runs on ItsSecurityBaseComponent return boolean { - - // Local variables - var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; - var HeaderInfo v_mandatoryHeaders := valueof(m_ieee1609Dot2_headerInfo(0)); - var HeaderInfo v_signerInfo; - - // Load certificates if required - if (f_prepareCertificates(p_certificateName, v_aaCertificate, v_atCertificate) == false) { - return false; - } - - // Add additional headers if required - /* FIXME To be reviewed if (p_addMissingHeaders == true) { - // Prepare mandatory headers - if (valueof(p_signerIdentifierType) == e_certificate) { // Add the AT certificate - v_signerInfo := valueof( - m_header_info_signer_info( - m_signerIdentifier_certificate( - v_atCertificate - ))); - } else if (valueof(p_signerIdentifierType) == e_certificate_chain) { // Add the AT certificate + AA EtsiTs103097Certificate - v_signerInfo := valueof( - m_header_info_signer_info( - m_signerIdentifier_certificates( - { - v_aaCertificate, - v_atCertificate - } - ) - )); - } else if (valueof(p_signerIdentifierType) == e_certificate_digest_with_sha256) { // Add the AT certificate digest - v_signerInfo := valueof( - m_header_info_signer_info( - m_issuerIdentifier_sha256AndDigest( - v_atCertificate.cracaId - ))); - } - v_mandatoryHeaders := { - v_signerInfo, - valueof(m_header_info_generation_time(1000 * f_getCurrentTime())), // In us - valueof(m_header_info_generation_location(p_threeDLocation)) - } - }*/ - - // Build the secured message and return it - return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField/*, v_mandatoryHeaders*/); - } // End of function f_buildGnSecuredOtherMessage - - /** - * @desc This function build and sign the SecureMessage part covered by the signature process including wrong elements of protocols. It is used for BO test cases - * @param p_securedMessage The signed SecureMessage part - * @param p_protocolVersion The protocol version to be set. Default: 2 - * @param p_trailerStatus The Traile behaviour: - *
  • 0 for no trailer
  • - *
  • 1 for invalid trailer
  • - *
  • 2 for duplicated trailer
  • - * @param p_payloadField Payloads to be included in the message - * @param p_signerIdentifierType Add digest or AT certificate or certificate chain - * @param p_threeDLocation The 3D location - * @param p_headerInfo HeaderInfo to be inserted in the message - * @param p_certificateName The certificate identifier to be used. Default: TA_CERT_A - * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerInfo - * @return true on success, false otherwise - */ - function f_buildGnSecuredOtherMessage_Bo( - inout EtsiTs103097Data p_securedMessage, - in UInt8 p_protocolVersion := c_protocol_version, - in integer p_trailerStatus := 0, - in ToBeSignedData p_payloadField, - in SignerIdentifier p_signerIdentifierType, // FIXME To be reviewed - in ThreeDLocation p_threeDLocation, - in template (omit) HeaderInfo p_headerInfo := omit, - in charstring p_certificateName := "", - in boolean p_addMissingHeaders := true - ) runs on ItsSecurityBaseComponent return boolean { - - // Local variables - var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; - var HeaderInfo v_mandatoryHeaders := valueof(m_ieee1609Dot2_headerInfo(0)); - var HeaderInfo v_signerInfo; - - // Load certificates if required - if (f_prepareCertificates(p_certificateName, v_aaCertificate, v_atCertificate) == false) { - return false; - } - - // Add additional headers if required - /* FIXME To be reviewed if (p_addMissingHeaders == true) { - // Prepare mandatory headers - if (valueof(p_signerIdentifierType) == e_certificate) { // Add the AT certificate - v_signerInfo := valueof( - m_header_info_signer_info( - m_signerIdentifier_certificate( - v_atCertificate - ))); - } else if (valueof(p_signerIdentifierType) == e_certificate_chain) { // Add the AT certificate + AA EtsiTs103097Certificate - v_signerInfo := valueof( - m_header_info_signer_info( - m_signerIdentifier_certificates( - { - v_aaCertificate, - v_atCertificate - } - ) - )); - } else if (valueof(p_signerIdentifierType) == e_certificate_digest_with_sha256) { // Add the AT certificate digest - v_signerInfo := valueof( - m_header_info_signer_info( - m_issuerIdentifier_sha256AndDigest( - v_atCertificate.cracaId - ))); - } - v_mandatoryHeaders := { - v_signerInfo, - valueof(m_header_info_generation_time(1000 * f_getCurrentTime())), // In us - valueof(m_header_info_generation_location(p_threeDLocation)) - } - }*/ - - // FIXME To be done - - // Build the secured message and return it - return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField/*, v_mandatoryHeaders*/); - } // End of function f_buildGnSecuredOtherMessage_Bo - - } // End of group hostSignatureHelpers - - group deviceSignatureHelpers { - - /** - * @desc Retrieve the HashedId8 to be sent to the IUT, based on the provided certificate identifier - * @param p_certificateName The certificate the IUT shall use - * @return The HashedId8 to be sent to the IUT in the UtInitialize command - * @verdict Unchanged - * @remark Component variable vc_hashedId8ToBeUsed shall be set with the IUT certificate to be used - */ - function f_setupIutCertificate( - in charstring p_certificateName - ) runs on ItsSecurityBaseComponent return HashedId8 { - // Local variables - var HashedId8 v_hashedId8 := '0000000000000000'O; - - // Sanity check - if (lengthof(p_certificateName) == 0) { - return v_hashedId8; - } - - // Load certificates - if(f_getCertificateDigest(p_certificateName, v_hashedId8) == false) { - v_hashedId8 := '0000000000000000'O; - } - - return v_hashedId8; - } // End of function f_setupIutCertificate - - /** - * @desc Verify the signature of the provided certificate - * @param p_certificateToBeVerified EtsiTs103097Certificate to be verified - * @param p_publicKey Public key to verify the certificate signature - * @return true on success, false otherwise - * @verdict - */ - function f_verifyCertificateSignatureWithPublicKey( - in template (value) EtsiTs103097Certificate p_certificateToBeVerified, - in template (value) PublicVerificationKey p_publicVerificationKey - ) return boolean { - var ToBeSignedCertificate v_toBeSignedCertificate; - var octetstring v_enc_msg; - var octetstring v_signature; - var octetstring v_issuer; - - log(">>> f_verifyCertificateSignatureWithPublicKey: p_certificateToBeVerified=", p_certificateToBeVerified); - log(">>> f_verifyCertificateSignatureWithPublicKey: p_publicVerificationKey=", p_publicVerificationKey); - - // Create ToBeSignedCertificate payload to be signed - v_toBeSignedCertificate := valueof(p_certificateToBeVerified.toBeSigned); - log("f_verifyCertificateSignatureWithPublicKey: v_toBeSignedCertificate=", v_toBeSignedCertificate); - - v_enc_msg := bit2oct(encvalue(v_toBeSignedCertificate)); - log("f_verifyCertificateSignatureWithPublicKey: v_enc_msg=", v_enc_msg); - - // Verify payload - if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1)) { - if (ischosen(p_certificateToBeVerified.issuer.self_)) { - v_issuer := int2oct(0, 32); - } else { - var charstring v_certificate; - - if (fx_readCertificateFromDigest(valueof(p_certificateToBeVerified.issuer.sha256AndDigest), v_certificate) == false) { - log("f_verifyCertificateSignatureWithPublicKey: Invalid issuer: ", p_certificateToBeVerified.issuer.sha256AndDigest); - return false; - } - if (f_getCertificateHash(v_certificate, v_issuer) == false) { - log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate: " & v_certificate); - return false; - } - } - v_signature := valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only) & valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP256r1Signature.sSig); - log("f_verifyCertificateSignatureWithPublicKey: v_signedData=", v_signature); - if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1.uncompressedP256)) { - return f_verifyWithEcdsaBrainpoolp256WithSha256_1( - v_enc_msg, - v_issuer, - v_signature, - valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.uncompressedP256.x), - valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.uncompressedP256.y) - ); - } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1.compressed_y_0)) { - return f_verifyWithEcdsaBrainpoolp256WithSha256( - v_enc_msg, - v_issuer, - v_signature, - valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.compressed_y_0), - 0 // Latest bit of the Y-coordinate is 0 - ); - } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1.compressed_y_1)) { - return f_verifyWithEcdsaBrainpoolp256WithSha256( - v_enc_msg, - v_issuer, - v_signature, - valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.compressed_y_1), - 1 // Latest bit of the Y-coordinate is 1 - ); - } else { - log("f_verifyCertificateSignatureWithPublicKey: Unknown PublicVerificationKey value"); - return false; - } - } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1)) { - if (ischosen(p_certificateToBeVerified.issuer.self_)) { - v_issuer := int2oct(0, 48); - } else { - var charstring v_certificate; - - if (fx_readCertificateFromDigest(valueof(p_certificateToBeVerified.issuer.sha384AndDigest), v_certificate) == false) { - log("f_verifyCertificateSignatureWithPublicKey: Invalid issuer: ", p_certificateToBeVerified.issuer.sha384AndDigest); - return false; - } - if (f_getCertificateHash(v_certificate, v_issuer) == false) { - log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate: " & v_certificate); - return false; - } - } - v_signature := valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only) & valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP384r1Signature.sSig); - log("f_verifyCertificateSignatureWithPublicKey: v_signedData=", v_signature); - if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1.uncompressedP384)) { - return f_verifyWithEcdsaBrainpoolp384WithSha384_1( - v_enc_msg, - v_issuer, - v_signature, - valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.uncompressedP384.x), - valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.uncompressedP384.y) - ); - } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1.compressed_y_0)) { - return f_verifyWithEcdsaBrainpoolp384WithSha384( - v_enc_msg, - v_issuer, - v_signature, - valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.compressed_y_0), - 0 // Latest bit of the Y-coordinate is 0 - ); - } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1.compressed_y_1)) { - return f_verifyWithEcdsaBrainpoolp384WithSha384( - v_enc_msg, - v_issuer, - v_signature, - valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.compressed_y_1), - 1 // Latest bit of the Y-coordinate is 1 - ); - } else { - log("f_verifyCertificateSignatureWithPublicKey: Unknown PublicVerificationKey value"); - return false; - } - } else if (ischosen(p_publicVerificationKey.ecdsaNistP256)) { - if (ischosen(p_certificateToBeVerified.issuer.self_)) { - v_issuer := int2oct(0, 32); - } else { - var charstring v_certificate; - - if (fx_readCertificateFromDigest(valueof(p_certificateToBeVerified.issuer.sha256AndDigest), v_certificate) == false) { - log("f_verifyCertificateSignatureWithPublicKey: Invalid issuer: ", p_certificateToBeVerified.issuer.sha256AndDigest); - return false; - } - if (f_getCertificateHash(v_certificate, v_issuer) == false) { - log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate: " & v_certificate); - return false; - } - } - v_signature := valueof(p_certificateToBeVerified.signature_.ecdsaNistP256Signature.rSig.x_only) & valueof(p_certificateToBeVerified.signature_.ecdsaNistP256Signature.sSig); - log("f_verifyCertificateSignatureWithPublicKey: v_signedData=", v_signature); - if (ischosen(p_publicVerificationKey.ecdsaNistP256.uncompressedP256)) { - return f_verifyWithEcdsaNistp256WithSha256_1( - v_enc_msg, - v_issuer, - v_signature, - valueof(p_publicVerificationKey.ecdsaNistP256.uncompressedP256.x), - valueof(p_publicVerificationKey.ecdsaNistP256.uncompressedP256.y) - ); - } else if (ischosen(p_publicVerificationKey.ecdsaNistP256.compressed_y_0)) { - return f_verifyWithEcdsaNistp256WithSha256( - v_enc_msg, - v_issuer, - v_signature, - valueof(p_publicVerificationKey.ecdsaNistP256.compressed_y_0), - 0 // Latest bit of the Y-coordinate is 0 - ); - } else if (ischosen(p_publicVerificationKey.ecdsaNistP256.compressed_y_1)) { - return f_verifyWithEcdsaNistp256WithSha256( - v_enc_msg, - v_issuer, - v_signature, - valueof(p_publicVerificationKey.ecdsaNistP256.compressed_y_1), - 1 // Latest bit of the Y-coordinate is 1 - ); - } else { - log("f_verifyCertificateSignatureWithPublicKey: Unknown PublicVerificationKey value"); - return false; - } - } - - return false; - } // End of finction f_verifyCertificateSignatureWithPublicKey - - /** - * @desc Verify the signature of the provided secured message - * @param p_certificateToBeVerified EtsiTs103097Certificate to be verified - * @param p_issuingCertificate Issuing certificate - * @return true on success, false otherwise - * @verdict - */ - function f_verifyCertificateSignatureWithIssuingCertificate( - in template (value) EtsiTs103097Certificate p_certificateToBeVerified, - in template (value) EtsiTs103097Certificate p_issuingCertificate - ) return boolean { - - // Sanity checks - if (not(ischosen(p_issuingCertificate.toBeSigned.verifyKeyIndicator.verificationKey))) { - return false; - } - return f_verifyCertificateSignatureWithPublicKey( - p_certificateToBeVerified, - p_issuingCertificate.toBeSigned.verifyKeyIndicator.verificationKey - ); - } // End of function f_verifyCertificateSignatureWithIssuingCertificate - - /** - * @desc Verify the signature of the provided secured message for ECDSA Nist-P256 algorithm - * @param p_securedMessage The message to be verified - * @param p_publicKey The ECDSA public key to verify a signature - * @param p_certificate EtsiTs103097Certificate to be used to verify the message - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_verifyGnSecuredMessageSignature_ecdsaNistP256( - in template (value) Ieee1609Dot2Data p_securedMessage, - in template (value) Oct32 p_certificateIssuer, - in template (value) EccP256CurvePoint p_publicKey - ) return boolean { - - // Local variables - var octetstring v_secPayload; - var octetstring v_signedData; - var boolean v_result := false; - var template (value) ToBeSignedData v_toBeSignedData; - - log(">>> f_verifyGnSecuredMessageSignature_ecdsaNistP256: p_securedMessage= ", p_securedMessage); - log(">>> f_verifyGnSecuredMessageSignature_ecdsaNistP256: p_certificateIssuer= ", p_certificateIssuer); - log(">>> f_verifyGnSecuredMessageSignature_ecdsaNistP256: p_publicKey= ", p_publicKey); - - // Create Ieee1609Dot2Data payload to be signed - v_toBeSignedData := valueof(p_securedMessage.content.signedData.tbsData); - log("f_verifyGnSecuredMessageSignature_ecdsaNistP256: v_toBeSignedData=", p_securedMessage.content.signedData.tbsData); - - v_secPayload := bit2oct(encvalue(v_toBeSignedData)); - log("f_verifyGnSecuredMessageSignature_ecdsaNistP256: v_secPayload=", v_secPayload); - - // Verify payload - - // TODO Check in standard if x-only only - if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig.x_only)) { - v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig.x_only) & valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig); - } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig.compressed_y_0)) { - v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig.compressed_y_0) & valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig); - } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig.compressed_y_1)) { - v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig.compressed_y_1) & valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig); - } - log("f_verifyGnSecuredMessageSignature_ecdsaNistP256: v_signedData=", v_signedData); - if (ischosen(p_publicKey.uncompressedP256)) { - v_result := f_verifyWithEcdsaNistp256WithSha256_1( - v_secPayload, - valueof(p_certificateIssuer), - v_signedData, - valueof(p_publicKey.uncompressedP256.x), - valueof(p_publicKey.uncompressedP256.y) - ); - } else if (ischosen(p_publicKey.compressed_y_0)) { - v_result := f_verifyWithEcdsaNistp256WithSha256( - v_secPayload, - valueof(p_certificateIssuer), - v_signedData, - valueof(p_publicKey.compressed_y_0), - 0 - ); - } else if (ischosen(p_publicKey.compressed_y_1)) { - v_result := f_verifyWithEcdsaNistp256WithSha256( - v_secPayload, - valueof(p_certificateIssuer), - v_signedData, - valueof(p_publicKey.compressed_y_1), - 1 - ); - } - - log("f_verifyGnSecuredMessageSignature_ecdsaNistP256: v_result=", v_result); - return v_result; - } // End of function f_verifyGnSecuredMessageSignature_ecdsaNistP256 - - /** - * @desc Verify the signature of the provided secured message for ECDSA Brainpool-P256 algorithm - * @param p_securedMessage The message to be verified - * @param p_publicKey The ECDSA public key to verify a signature - * @param p_certificate EtsiTs103097Certificate to be used to verify the message - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1( - in template (value) Ieee1609Dot2Data p_securedMessage, - in template (value) Oct32 p_certificateIssuer, - in template (value) EccP256CurvePoint p_publicKey - ) return boolean { - - // Local variables - var octetstring v_secPayload; - var octetstring v_signedData; - var boolean v_result := false; - var template (value) ToBeSignedData v_toBeSignedData; - - log(">>> f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: p_securedMessage= ", p_securedMessage); - log(">>> f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: p_certificateIssuer= ", p_certificateIssuer); - log(">>> f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: p_publicKey= ", p_publicKey); - - // Create Ieee1609Dot2Data payload to be signed - v_toBeSignedData := valueof(p_securedMessage.content.signedData.tbsData); - log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: v_toBeSignedData=", p_securedMessage.content.signedData.tbsData); - - v_secPayload := bit2oct(encvalue(v_toBeSignedData)); - log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: v_secPayload=", v_secPayload); - - // Verify payload - v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only) & valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig); - log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: v_signedData=", v_signedData); - if (ischosen(p_publicKey.uncompressedP256)) { - v_result := f_verifyWithEcdsaBrainpoolp256WithSha256_1( - v_secPayload, - valueof(p_certificateIssuer), - v_signedData, - valueof(p_publicKey.uncompressedP256.x), - valueof(p_publicKey.uncompressedP256.y) - ); - } else if (ischosen(p_publicKey.compressed_y_0)) { - v_result := f_verifyWithEcdsaBrainpoolp256WithSha256( - v_secPayload, - valueof(p_certificateIssuer), - v_signedData, - valueof(p_publicKey.compressed_y_0), - 0 - ); - } else if (ischosen(p_publicKey.compressed_y_1)) { - v_result := f_verifyWithEcdsaBrainpoolp256WithSha256( - v_secPayload, - valueof(p_certificateIssuer), - v_signedData, - valueof(p_publicKey.compressed_y_1), - 1 - ); - } - - log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: v_result=", v_result); - return v_result; - } // End of function f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1 - - /** - * @desc Verify the signature of the provided secured message for ECDSA Brainpool-P384 algorithm - * @param p_securedMessage The message to be verified - * @param p_publicKey The ECDSA public key to verify a signature - * @param p_certificate EtsiTs103097Certificate to be used to verify the message - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1( - in template (value) Ieee1609Dot2Data p_securedMessage, - in template (value) Oct48 p_certificateIssuer, - in template (value) EccP384CurvePoint p_publicKey - ) return boolean { - - // Local variables - var octetstring v_secPayload; - var octetstring v_signedData; - var boolean v_result := false; - var template (value) ToBeSignedData v_toBeSignedData; - - log(">>> f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: p_securedMessage= ", p_securedMessage); - log(">>> f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: p_certificateIssuer= ", p_certificateIssuer); - log(">>> f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: p_publicKey= ", p_publicKey); - - // Create Ieee1609Dot2Data payload to be signed - v_toBeSignedData := valueof(p_securedMessage.content.signedData.tbsData); - log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: v_toBeSignedData=", p_securedMessage.content.signedData.tbsData); - - v_secPayload := bit2oct(encvalue(v_toBeSignedData)); - log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: v_secPayload=", v_secPayload); - - // Verify payload - v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only) & valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig); - log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: v_signedData=", v_signedData); - if (ischosen(p_publicKey.uncompressedP384)) { - v_result := f_verifyWithEcdsaBrainpoolp384WithSha384_1( - v_secPayload, - valueof(p_certificateIssuer), - v_signedData, - valueof(p_publicKey.uncompressedP384.x), - valueof(p_publicKey.uncompressedP384.y) - ); - } else if (ischosen(p_publicKey.compressed_y_0)) { - v_result := f_verifyWithEcdsaBrainpoolp384WithSha384( - v_secPayload, - valueof(p_certificateIssuer), - v_signedData, - valueof(p_publicKey.compressed_y_0), - 0 - ); - } else if (ischosen(p_publicKey.compressed_y_1)) { - v_result := f_verifyWithEcdsaBrainpoolp384WithSha384( - v_secPayload, - valueof(p_certificateIssuer), - v_signedData, - valueof(p_publicKey.compressed_y_1), - 1 - ); - } - - log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: v_result=", v_result); - return v_result; - } // End of function f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1 - - /** - * @desc Verify the signature of the provided secured message - * @param p_securedMessage - * @param p_certificate EtsiTs103097Certificate to be used to verify the message - * @return true on success, false otherwise - * @verdict - */ - function f_verifyGnSecuredMessageSignatureWithCertificate( - in template (value) Ieee1609Dot2Data p_securedMessage, - in template (value) charstring p_certificate_id, - in template (value) EtsiTs103097Certificate p_certificate - - ) return boolean { - var octetstring v_issuer; - var EtsiTs103097Certificate v_certificate; - - log(">>> f_verifyGnSecuredMessageSignatureWithCertificate: p_securedMessage=", p_securedMessage); - log(">>> f_verifyGnSecuredMessageSignatureWithCertificate: p_certificate_id=", p_certificate_id); - log(">>> f_verifyGnSecuredMessageSignatureWithCertificate: p_certificate=", p_certificate); - - if (f_getCertificateHash(valueof(p_certificate_id), v_issuer) == false) { - log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate id: " & valueof(p_certificate_id)); - return false; - } - if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { - return f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1(p_securedMessage, v_issuer, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1); - } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature)) { - return f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1(p_securedMessage, v_issuer, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1); - } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature)) { - return f_verifyGnSecuredMessageSignature_ecdsaNistP256(p_securedMessage, v_issuer, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256); - } - - return false; - } // End of function f_verifyGnSecuredOtherMessageWithDeviceCertificate - - } // End of group deviceSignatureHelpers - - group sspPermissions { - - function f_verifySspPermissions( - in SequenceOfPsidSsp p_issuer_ssp_permissions, - in SequenceOfPsidSsp p_subordinate_ssp_permissions, - in boolean p_strict_checks := false - ) return boolean { - // Local variables - var integer v_idx := 0; - - log(">>> f_verifySspPermissions: p_issuer_ssp_permissions:", p_issuer_ssp_permissions); - log(">>> f_verifySspPermissions: p_subordinate_ssp_permissions: ", p_subordinate_ssp_permissions); - - for (v_idx := 0; v_idx < lengthof(p_issuer_ssp_permissions); v_idx := v_idx + 1) { - var PsidSsp v_issuerPsidSsp := p_issuer_ssp_permissions[v_idx]; - var PsidSsp v_subordinatePsidSsp; - var boolean v_found := false; - var integer v_jdx := 0; - log("f_verifySspPermissions: v_issuerPsidSsp: ", v_issuerPsidSsp); - // 1. Check permission from issuer is present - for (v_jdx := 0; v_jdx < lengthof(p_subordinate_ssp_permissions); v_jdx := v_jdx + 1) { - log("f_verifySspPermissions: match=", match(v_issuerPsidSsp, m_appPermissions(p_subordinate_ssp_permissions[v_jdx].psid, p_subordinate_ssp_permissions[v_jdx].ssp))); - // 1. Check the version - if (p_subordinate_ssp_permissions[v_jdx].ssp.bitmapSsp[0] != '01'O) { - log("f_verifySspPermissions: Wrong SSP version control (1 is expected): ", p_subordinate_ssp_permissions[v_jdx].ssp.bitmapSsp[0]); - return false; - } - // 2. Check the version - if (match(v_issuerPsidSsp, m_appPermissions(p_subordinate_ssp_permissions[v_jdx].psid, p_subordinate_ssp_permissions[v_jdx].ssp)) == true) { - v_subordinatePsidSsp := p_subordinate_ssp_permissions[v_jdx]; - v_found := true; - break; - } - } // End of 'for' statement - if (v_found == false) { - log("f_verifySspPermissions: Permission set not found: ", v_issuerPsidSsp); - if (p_strict_checks == true) { - return false; - } else { - return true; - } - } - // 2. Validate bits mask - if (ispresent(v_issuerPsidSsp.ssp)) { - if (ispresent(v_subordinatePsidSsp.ssp) == false) { - log("f_verifySspPermissions: Ssp shall not be omitted: ", v_issuerPsidSsp); - if (p_strict_checks == true) { - return false; - } - } - if ((ischosen(v_issuerPsidSsp.ssp.bitmapSsp) == false) or (ischosen(v_subordinatePsidSsp.ssp.bitmapSsp) == false)) { - log("f_verifySspPermissions: Wrong variant : ", v_issuerPsidSsp, " / ", v_subordinatePsidSsp); - if (p_strict_checks == true) { - return false; - } - } - if (lengthof(v_issuerPsidSsp.ssp.bitmapSsp) < lengthof(v_subordinatePsidSsp.ssp.bitmapSsp)) { - log("f_verifySspPermissions: Ssp not be compliant: ", v_issuerPsidSsp.ssp, " / ", v_subordinatePsidSsp.ssp); - if (p_strict_checks == true) { - return false; - } - } else { - var charstring v_issuerSsp := bit2str(oct2bit(v_issuerPsidSsp.ssp.bitmapSsp)); - var charstring v_subordinateSsp := bit2str(oct2bit(v_subordinatePsidSsp.ssp.bitmapSsp)); - - for (var integer i := 0; i < lengthof(v_issuerSsp); i := i + 1) { - if (v_issuerSsp[i] == "1") { // TODO How to check Permission using SspBitmask/SspValue - if (v_subordinateSsp[i] != "1") { - log("f_verifySspPermissions: Ssp bitmask mismatch at index: ", i); - return false; - } - } // else, no restriction, subordinate certificate can have any value. - } // End of 'for' statement - } - } - } // End of 'for' statement - - return true; - } // End of function f_verifySspPermissions - - } // End of group sspPermissions - - group messageGetters { - - /** - * @desc return Ieee1609Dot2Data header field of given type or null if none - * @param p_msg the Ieee1609Dot2Data - * @param p_type header field type - * @return HeaderInfo of given type if any or null - */ - function f_getMsgHeaderInfo( - in template(omit) Ieee1609Dot2Data p_securedMessage, - out HeaderInfo p_return - ) return boolean { - var integer v_length; - var Ieee1609Dot2Data v_securedMessage; - - if (not isvalue(p_securedMessage)) { - testcase.stop(__SCOPE__ & " can not handle omitted secured message values"); - } - v_securedMessage := valueof(p_securedMessage); - if (ischosen(v_securedMessage.content.signedData)) { - p_return := v_securedMessage.content.signedData.tbsData.headerInfo; - return true; - } - - log("f_getMsgHeaderField: return false"); - return false; - } - - /** - * @desc return SignerIdentifier Ieee1609Dot2Data field - */ - function f_getMsgSignerIdentifier ( - in template(omit) Ieee1609Dot2Data p_securedMessage, - out SignerIdentifier p_signerIdentifier - ) return boolean { - if (not isvalue(p_securedMessage)) { - testcase.stop(__SCOPE__ & " can not handle omitted secured message values"); - } - - if (ischosen(p_securedMessage.content.signedData)) { - p_signerIdentifier := valueof(p_securedMessage.content.signedData.signer); - return true; - } - - log("f_getMsgSignerIdentifier: return false"); - return false; - } - - } // End of group messageGetters - - group certificateGetters { - - /** - * @desc Set the generation location as defined in Draft ETSI TS 103 097 V1.1.14 Clause 7.2 Security profile for DENMs - * @param p_latitude The latitude value of the ITS-S position - * @param p_longitude The longitude value of the ITS-S position - * @param p_elevation The elevation value of the ITS-S position - * @verdict Unchanged - */ - function f_setGenerationLocation( - in SecLatitude p_latitude, - in SecLongitude p_longitude, - in SecElevation p_elevation := 0 - ) runs on ItsSecurityBaseComponent { - vc_location := { - p_latitude, - p_longitude, - p_elevation - } - } // End of function f_setGenerationLocation - - /** - * @desc Load in memory cache the certificates available - * @param p_configId A configuration identifier - * @remark This method SHALL be call before any usage of certificates - * @return true on success, false otherwise - */ - function f_loadCertificates( - in charstring p_configId - ) runs on ItsSecurityBaseComponent return boolean { - var charstring v_certificate_id; - - // Setup certificates memory cache - if (fx_loadCertificates(PX_CERTIFICATE_POOL_PATH, p_configId) == true) { - // Setup security component variables - if (f_readCertificate(PX_CERT_FOR_TS, vc_atCertificate) == true) { - var HashedId8 v_issuer; - log("Issuer: ", vc_atCertificate.issuer); - if (ischosen(vc_atCertificate.issuer.sha256AndDigest)) { - v_issuer := vc_atCertificate.issuer.sha256AndDigest; - } else if (ischosen(vc_atCertificate.issuer.sha384AndDigest)) { - v_issuer := vc_atCertificate.issuer.sha384AndDigest; - } else { - log("AT certificate cannot be issued by CA"); - return false; - } - log("Selected issuer: ", v_issuer); - if (f_getCertificateFromDigest(v_issuer, vc_aaCertificate, v_certificate_id)) { - if (f_readSigningKey(cc_taCert_A, vc_signingPrivateKey) == true) { - f_readEncryptingKey(cc_taCert_A, vc_encryptPrivateKey); - return true; - } - log("f_loadCertificates: Failed to load signing key for ", cc_taCert_A); - } else { - log("f_loadCertificates: Failed to load AA certificate for ", cc_taCert_A); - } - } else { - log("f_loadCertificates: Failed to load AT certificate for ", cc_taCert_A); - } - } else { - log("f_loadCertificates: Failed to load certificates from ", PX_CERTIFICATE_POOL_PATH); - } - return false; - } // End of function f_loadCertificates - - /** - * @desc Unload from memory cache the certificates available - * @return true on success, false otherwise - */ - function f_unloadCertificates() runs on ItsSecurityBaseComponent return boolean { - // Reset security component variables - vc_signingPrivateKey := ''O; - vc_encryptPrivateKey := ''O; - // Clear certificates memory cache - return fx_unloadCertificates(); - } // End of function f_unloadCertificates - - /** - * @desc Read the specified certificate - * @param p_certificate_id the certificate identifier - * @param p_certificate the expected certificate - * @return true on success, false otherwise - */ - function f_readCertificate( - in charstring p_certificate_id, - out EtsiTs103097Certificate p_certificate - ) return boolean { - var octetstring v_certificate; - - if (fx_readCertificate(p_certificate_id, v_certificate) == true) { - var bitstring v_oct2bit; - var integer v_result; - - v_oct2bit := oct2bit(v_certificate); - v_result := decvalue(v_oct2bit, p_certificate); - if (v_result == 0) { - return true; - } - } - - log("f_readCertificate: Failed to retrieve ", p_certificate_id); - return false; - } // End of function f_readCertificate - - /** - * @desc Read the specified certificate - * @param p_certificate_id the certificate identifier - * @param p_digest the digest of the certificate - * @return true on success, false otherwise - */ - function f_getCertificateDigest( - in charstring p_certificate_id, - out HashedId8 p_digest - ) return boolean { - if (not fx_readCertificateDigest(p_certificate_id, p_digest)){ - log("f_getCertificateDigest: Failed to retrieve digest for ", p_certificate_id); - return false; - } - return true; - } // End of function f_getCertificateDigest - - /** - * @desc Read the whole-hash of the certificate - * @param p_certificate_id the certificate identifier - * @param p_hash the whole-hash of the certificate - * @return true on success, false otherwise - */ - function f_getCertificateHash( - in charstring p_certificate_id, - out octetstring p_hash - ) return boolean { - log(">>> f_getCertificateHash: ", p_certificate_id); - - if (not fx_readCertificateHash(p_certificate_id, p_hash)){ - log("f_getCertificateHash: Failed to retrieve digest for ", p_certificate_id); - return false; - } - return true; - } // End of function f_getCertificateHash - - /** - * @desc Read the whole-hash of the certificate SHA 256 - * @param p_certificate_id the certificate identifier - * @param p_hash the whole-hash of the certificate using SHA 256 - * @return true on success, false otherwise - */ - function f_getCertificateHash256( - in charstring p_certificate_id, - out Oct32 p_hash - ) return boolean { - if (not fx_readCertificateHash256(p_certificate_id, p_hash)){ - log("f_getCertificateHash256: Failed to retrieve digest for ", p_certificate_id); - return false; - } - return true; - } // End of function f_getCertificateHash - - function f_getCertificateFromDigest( - in HashedId8 p_digest, - out EtsiTs103097Certificate p_certificate, - out charstring p_certificate_id - ) return boolean { - if (not(fx_readCertificateFromDigest(p_digest, p_certificate_id))) { - log("f_getCertificateFromDigest: Failed to retrieve digest for ", p_digest); - return false; - } - if (not(f_readCertificate(p_certificate_id, p_certificate))) { - log("f_getCertificateFromDigest: Failed to retrieve digest for ", p_certificate_id); - return false; - } - return true; - } // End of function f_getCertificateFromDigest - - function f_getCertificateFromHashedId3( - in HashedId3 p_digest, - out EtsiTs103097Certificate p_certificate - ) return boolean { - var charstring v_certificate_id; - if (not(fx_readCertificateFromHashedId3(p_digest, v_certificate_id))) { - log("f_getCertificateFromHashedId3: Failed to retrieve digest for ", p_digest); - return false; - } - if (not(f_readCertificate(v_certificate_id, p_certificate))) { - log("f_getCertificateFromHashedId3: Failed to retrieve digest for ", v_certificate_id); - return false; - } - return true; - } // End of function f_getCertificateFromHashedId3 - - /** - * @desc Read the signing private key for the specified certificate - * @param p_keysId the keys identifier - * @param p_signingPrivateKey the signing private key - * @return true on success, false otherwise - */ - function f_readSigningKey( - in charstring p_keysId, - out Oct32 p_signingPrivateKey - ) return boolean { - return fx_readSigningKey(p_keysId, p_signingPrivateKey); - } // End of function f_readSigningKey - - /** - * @desc Read the encrypting private keys for the specified certificate - * @param p_keysId the keys identifier - * @param p_encryptPrivateKey the encrypt private key - * @return true on success, false otherwise - */ - function f_readEncryptingKey( - in charstring p_keysId, - out Oct32 p_encryptPrivateKey - ) return boolean { - return fx_readEncryptingKey(p_keysId, p_encryptPrivateKey); - } // End of function f_readEncryptingKey - - function f_getCertificateValidityRestriction( - in template (value) EtsiTs103097Certificate p_cert, - out template (value) ValidityPeriod p_validityPeriod, - out template (omit) GeographicRegion p_geographicRegion - ) return boolean { - p_validityPeriod := valueof(p_cert.toBeSigned.validityPeriod); - if (ispresent(p_cert.toBeSigned.region)) { - p_geographicRegion := valueof(p_cert.toBeSigned.region); - } else { - p_geographicRegion := omit; - } - return true; - } // End of function f_getCertificateValidityRestriction - - }// End of group certificateGetters - - group certificatesCaching { - - function f_createCertificatesCaching( - in SequenceOfCertificate p_certificates, - out CertificatesCaching p_certificatesCaching - ) return boolean { - p_certificatesCaching := { }; - for (var integer v_counter := 0; v_counter < lengthof(p_certificates); v_counter := v_counter + 1) { - var CertificatesCachingItem v_item; - v_item.certificate := p_certificates[v_counter]; - v_item.hashedId8 := f_calculateDigestSha256FromCertificate(v_item.certificate); - p_certificatesCaching[v_counter] := v_item; - } // End of 'for' statement - - return true; - } - - function f_getCertificateFromCaching( - in CertificatesCaching p_certificatesCaching, - in HashedId8 p_hashedId8, - out EtsiTs103097Certificate p_certificate - ) return boolean { - for (var integer v_counter := 0; v_counter < lengthof(p_certificatesCaching); v_counter := v_counter + 1) { - if (match(p_certificatesCaching[v_counter].hashedId8, p_hashedId8) == true) { - p_certificate := p_certificatesCaching[v_counter].certificate; - return true; - } - } // End of 'for' statement - - return false; - } - - function f_getCertificatesCachingItem( - in CertificatesCaching p_certificatesCaching, - in UInt8 p_index, - out EtsiTs103097Certificate p_certificate - ) return boolean { - if (lengthof(p_certificatesCaching) < p_index) { - p_certificate := p_certificatesCaching[p_index].certificate; - return true; - } - - return false; - } - - function f_getCertificatesCachingItemSize( - in CertificatesCaching p_certificatesCaching - ) return UInt8 { - return lengthof(p_certificatesCaching); - } - - }// End of group certificatesCaching - - - } // End of group helpersFunctions - - group externalFunctions { - - group signing { - - /** - * @desc Produces a 256-bit (32-byte) hash value - * @param p_toBeHashedData Data to be used to calculate the hash value - * @return The hash value - */ - external function fx_hashWithSha256(in octetstring p_toBeHashedData) return Oct32; - - /** - * @desc Produces a 384-bit (48-byte) hash value - * @param p_toBeHashedData Data to be used to calculate the hash value - * @return The hash value - */ - external function fx_hashWithSha384(in octetstring p_toBeHashedData) return Oct48; - - external function fx_hmac_sha256(in octetstring p_k, in octetstring p_m) return octetstring; - /** - * @desc This function validates AES128 CCM encryption based on IEEE Std 1609.2-20XX Annex D.6.1 AES-CCM-128 - * @param[in] The symmetric AES 128 encryption key - * @param[in] The initial vector (aka nonce) - * @param[in] The raw payload - * @return The encrypted payload - */ - external function fx_encrypt_aes_128_ccm_test(in octetstring p_k, in octetstring p_n, in octetstring p_pt) return octetstring; - - /** - * @desc TThis function validates AES128 CCM encryption based on AES-GCM-256 - * @param[in] The symmetric AES 128 encryption key - * @param[in] The initial vector (aka nonce) - * @param[in] The raw payload - * @return The encrypted payload - */ - external function fx_encrypt_aes_128_gcm_test(in octetstring p_k, in octetstring p_n, in octetstring p_pt) return octetstring; - - /** - * @desc This function validates AES128 CCM decryption based on IEEE Std 1609.2-20XX Annex D.6.1 AES-CCM-128 - * @param[in] The symmetric AES 128 encryption key - * @param[in] The initial vector (aka nonce) - * @param[in] The cyphered payload - * @return The raw payload - */ - external function fx_decrypt_aes_128_ccm_test(in octetstring p_k, in octetstring p_n, in octetstring p_pt) return octetstring; - - /** - * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption using Nist-P256 algorithm - * @param p_toBeEncryptedSecuredMessage The data to be encrypted - * @param p_recipientsPublicKeyCompressed The Recipient's compressed public key - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key - * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key - * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption - * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption - * @return The encrypted message - */ - external function fx_encryptWithEciesNistp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyCompressed, in integer p_compressed_mode, in octetstring p_salt, out Oct32 p_publicEphemeralKeyCompressed, out integer p_ephemeralKeyModeCompressed, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce, in boolean p_use_hardcoded_values := false) return octetstring; - - external function fx_test_encryptWithEciesNistp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_privateEphemeralKey, in Oct32 p_recipientPublicKeyX, in Oct32 p_recipientPublicKeyY, in octetstring p_salt, out Oct32 p_publicEphemeralKeyX, out Oct32 p_publicEphemeralKeyY, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; - - /** - * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Nist-P256 algorithm - * @param p_encryptedSecuredMessage The data to be decrypted - * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key - * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key - * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption - * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption - * @return The decrypted message - */ - external function fx_decryptWithEciesNistp256WithSha256(in octetstring p_encryptedSecuredMessage, in Oct32 p_privateEncKey, in Oct32 p_publicEphemeralKeyCompressed, in integer p_ephemeralKeyModeCompressed, in Oct16 p_encrypted_sym_key, in Oct16 p_authentication_vector, in Oct12 p_nonce, in Oct32 p_salt, out Oct16 p_aes_sym_enc_key) return octetstring; - - /** - * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption using Brainpool-P256 algorithm - * @param p_toBeEncryptedSecuredMessage The data to be encrypted - * @param p_recipientsPublicKeyCompressed The Recipient's compressed public key - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key - * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key - * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption - * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption - * @return The encrypted message - */ - external function fx_encryptWithEciesBrainpoolp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyCompressed, in integer p_compressed_mode, in octetstring p_salt, out Oct32 p_publicEphemeralKeyCompressed, out integer p_ephemeralKeyModeCompressed, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce, in boolean p_use_hardcoded_values := false) return octetstring; - - external function fx_test_encryptWithEciesBrainpoolp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_privateEphemeralKey, in Oct32 p_recipientPublicKeyX, in Oct32 p_recipientPublicKeyY, in octetstring p_salt, out Oct32 p_publicEphemeralKeyX, out Oct32 p_publicEphemeralKeyY, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; - - /** - * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Brainpool-P256 algorithm - * @param p_encryptedSecuredMessage The data to be decrypted - * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key - * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key - * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption - * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption - * @return The decrypted message - */ - external function fx_decryptWithEciesBrainpoolp256WithSha256(in octetstring p_encryptedSecuredMessage, in Oct32 p_privateEncKey, in Oct32 p_publicEphemeralKeyCompressed, in integer p_ephemeralKeyModeCompressed, in Oct16 p_encrypted_sym_key, in Oct16 p_authentication_vector, in Oct12 p_nonce, in Oct32 p_salt, out Oct16 p_aes_sym_enc_key) return octetstring; - - /** - * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature - * @param p_toBeSignedSecuredMessage The data to be signed - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_privateKey The private key - * @return The signature value - */ - external function fx_signWithEcdsaNistp256WithSha256(in octetstring p_toBeSignedSecuredMessage, in Oct32 p_certificateIssuer, in Oct32 p_privateKey) return octetstring; - - external function fx_test_signWithEcdsaNistp256WithSha256(in octetstring p_toBeSignedSecuredMessage, in Oct32 p_privateKey) return octetstring; - - /** - * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature - * @param p_toBeSignedSecuredMessage The data to be signed - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_privateKey The private key for signature - * @return The signature value - */ - external function fx_signWithEcdsaBrainpoolp256WithSha256(in octetstring p_toBeSignedSecuredMessage, in Oct32 p_certificateIssuer, in Oct32 p_privateKey) return octetstring; - - /** - * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_privateKey The private key for signature - * @return The signature value - */ - external function fx_signWithEcdsaBrainpoolp384WithSha384(in octetstring p_toBeSignedSecuredMessage, in Oct48 p_certificateIssuer, in Oct48 p_privateKey) return octetstring; - - /** - * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_signature The signature - * @param p_ecdsaNistp256PublicKeyCompressed The compressed public key - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - external function fx_verifyWithEcdsaNistp256WithSha256(in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyCompressed, in integer p_compressed_mode) return boolean; - - external function fx_test_verifyWithEcdsaNistp256WithSha256(in octetstring p_toBeVerifiedData, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyCompressed, in integer p_compressed_mode) return boolean; - - /** - * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_signature The signature - * @param p_ecdsaNistp256PublicKeyX The public key (x coordinate) - * @param p_ecdsaNistp256PublicKeyY The public key (y coordinate) - * @return true on success, false otherwise - */ - external function fx_verifyWithEcdsaNistp256WithSha256_1(in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in Oct64 p_signature, in Oct32 p_ecdsaNistp256PublicKeyX, in Oct32 p_ecdsaNistp256PublicKeyY) return boolean; - - /** - * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_signature The signature - * @param p_ecdsaBrainpoolp256PublicKeyCompressed The compressed public key - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - external function fx_verifyWithEcdsaBrainpoolp256WithSha256(in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in Oct64 p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyCompressed, in integer p_compressed_mode) return boolean; - - /** - * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The certificate issuer - * @param p_signature The signature - * @param p_ecdsaBrainpoolp256PublicKeyX The public key (x coordinate) - * @param p_ecdsaBrainpoolp256PublicKeyY The public key (y coordinate) - * @return true on success, false otherwise - */ - external function fx_verifyWithEcdsaBrainpoolp256WithSha256_1(in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in Oct64 p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyX, in Oct32 p_ecdsaBrainpoolp256PublicKeyY) return boolean; - - /** - * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The certificate issuer - * @param p_signature The signature - * @param p_ecdsaBrainpoolp384PublicKeyCompressed The compressed public key - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - external function fx_verifyWithEcdsaBrainpoolp384WithSha384(in octetstring p_toBeVerifiedData, in Oct48 p_certificateIssuer, in Oct96 p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyCompressed, in integer p_compressed_mode) return boolean; - - /** - * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The hash of the canonical certificate issuer - * @param p_signature The signature - * @param p_ecdsaBrainpoolp384PublicKeyX The public key (x coordinate) - * @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate) - * @return true on success, false otherwise - */ - external function fx_verifyWithEcdsaBrainpoolp384WithSha384_1(in octetstring p_toBeVerifiedData, in Oct48 p_certificateIssuer, in Oct96 p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyX, in Oct48 p_ecdsaBrainpoolp384PublicKeyY) return boolean; - - /** - * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. - * This function should not be used by the ATS - * @param p_privateKey The new private key value - * @param p_publicKeyX The new public key value (x coordinate) - * @param p_publicKeyX The new public key value (y coordinate) - * @param p_publicKeyCompressed The compressed public keys - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - external function fx_generateKeyPair_nistp256(out Oct32 p_privateKey, out Oct32 p_publicKeyX, out Oct32 p_publicKeyY, out Oct32 p_publicKeyCompressed, out integer p_compressed_mode) return boolean; - - /** - * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. - * This function should not be used by the ATS - * @param p_privateKey The new private key value - * @param p_publicKeyX The new public key value (x coordinate) - * @param p_publicKeyX The new public key value (y coordinate) - * @param p_publicKeyCompressed The compressed public keys - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - external function fx_generateKeyPair_brainpoolp256(out Oct32 p_privateKey, out Oct32 p_publicKeyX, out Oct32 p_publicKeyY, out Oct32 p_publicKeyCompressed, out integer p_compressed_mode) return boolean; - - /** - * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. - * This function should not be used by the ATS - * @param p_privateKey The new private key value - * @param p_publicKeyX The new public key value (x coordinate) - * @param p_publicKeyX The new public key value (y coordinate) - * @param p_publicKeyCompressed The compressed public keys - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - external function fx_generateKeyPair_brainpoolp384(out Oct48 p_privateKey, out Oct48 p_publicKeyX, out Oct48 p_publicKeyY, out Oct48 p_publicKeyCompressed, out integer p_compressed_mode) return boolean; - - } // End of group signing - - group encryption { - - } // End of group encryption - - group certificatesLoader { - - /** - * @desc Load in memory cache the certificates available in the specified directory - * @param p_rootDirectory Root directory to access to the certificates identified by the certificate ID - * @param p_configId A configuration identifier - * @remark This method SHALL be call before any usage of certificates - * @return true on success, false otherwise - */ - external function fx_loadCertificates(in charstring p_rootDirectory, in charstring p_configId) return boolean; - external function fx_store_certificate(in charstring p_cert_id, in octetstring p_cert, in octetstring p_private_key, in octetstring p_public_key_x, in octetstring p_public_key_y, in octetstring p_public_key_compressed, in integer p_public_key_compressed_mode, in octetstring p_hash, in octetstring p_hash_256, in octetstring p_hashid8, in octetstring p_issuer, in template (omit) octetstring p_private_enc_key, in template (omit) octetstring p_public_enc_key_x, in template (omit) octetstring p_public_enc_key_y, in template (omit) octetstring p_public_enc_compressed_key, in template (omit) integer p_public_enc_key_compressed_mode) return boolean; - - /** - * @desc Unload from memory cache the certificates - * @return true on success, false otherwise - */ - external function fx_unloadCertificates() return boolean; - - /** - * @desc Read the specified certificate - * @param p_certificate_id the certificate identifier - * @param p_certificate the expected certificate - * @return true on success, false otherwise - */ - external function fx_readCertificate(in charstring p_certificate_id, out octetstring p_certificate) return boolean; - - /** - * @desc Read the specified certificate digest - * @param p_certificate_id the certificate identifier - * @param p_digest the expected certificate - * @return true on success, false otherwise - */ - external function fx_readCertificateDigest(in charstring p_certificate_id, out HashedId8 p_digest) return boolean; - - /** - * @desc Read the whole-hash of the specified certificate - * @param p_certificate_id the certificate identifier - * @param p_hash the whole-hash of the certificate - * @return true on success, false otherwise - */ - external function fx_readCertificateHash(in charstring p_certificate_id, out octetstring p_hash) return boolean; - - /** - * @desc Read the whole-hash of the specified certificate using SHA 256 - * @param p_certificate_id the certificate identifier - * @param p_hash the whole-hash of the certificate - * @return true on success, false otherwise - */ - external function fx_readCertificateHash256(in charstring p_certificate_id, out Oct32 p_hash) return boolean; - - external function fx_readCertificateFromDigest(in HashedId8 p_digest, out charstring p_certificate_id) return boolean; - - external function fx_readCertificateFromHashedId3(in HashedId3 p_digest, out charstring p_certificate_id) return boolean; - - /** - * @desc Read the private keys for the specified certificate - * @param p_keysId the keys identifier - * @param p_signingPrivateKey the signing private key - * @return true on success, false otherwise - */ - - external function fx_readSigningKey(in charstring p_keysId, out Oct32 p_signingPrivateKey) return boolean; - - /** - * @desc Read the private keys for the specified certificate - * @param p_keysId the keys identifier - * @param p_encryptPrivateKey the encrypt private key - * @return true on success, false otherwise - */ - - external function fx_readEncryptingKey(in charstring p_keysId, out Oct32 p_encryptingPrivateKey) return boolean; - - } // End of group certificatesLoader - - group geodesic { - - /** - * @desc Check that given polygon doesn't have neither self-intersections nor holes. - * @param p_region Polygonal Region - * @return true on success, false otherwise - * @verdict Unchanged - */ - external function fx_isValidPolygonalRegion(in PolygonalRegion p_region) return boolean; - - /** - * @desc Check if a polygonal region is inside another one - * @param p_parent The main polygonal region - * @param p_region The polygonal region to be included - * @return true on success, false otherwise - * @verdict Unchanged - */ - external function fx_isPolygonalRegionInside(in PolygonalRegion p_parent, in PolygonalRegion p_region) return boolean; - - /** - * @desc Check that the location is inside a circular region - * @param p_region The circular region to consider - * @param p_location The device location - * @return true on success, false otherwise - * @verdict Unchanged - */ - external function fx_isLocationInsideCircularRegion(in CircularRegion p_region, in ThreeDLocation p_location) return boolean; - - /** - * @desc Check that the location is inside a rectangular region - * @param p_region The rectangular region to consider - * @param p_location The device location - * @return true on success, false otherwise - * @verdict Unchanged - */ - external function fx_isLocationInsideRectangularRegion(in SequenceOfRectangularRegion p_region, in ThreeDLocation p_location) return boolean; - - /** - * @desc Check that the location is inside a polygonal region - * @param p_region The polygonal region to consider - * @param p_location The device location - * @return true on success, false otherwise - * @verdict Unchanged - */ - external function fx_isLocationInsidePolygonalRegion(in PolygonalRegion p_region, in ThreeDLocation p_location) return boolean; - - /** - * @desc Check if the location is inside an identified region - * @param p_region The identified region to consider - * @param p_location The device location - * @return true on success, false otherwise - * @verdict Unchanged - */ - external function fx_isLocationInsideIdentifiedRegion(in IdentifiedRegion p_region, in ThreeDLocation p_location) return boolean; - - /** - * @desc Check if the location is inside an undefined region - * @param p_region The identified region to consider - * @param p_location The device location - * @return true on success, false otherwise - * @verdict Unchanged - */ - external function fx_isLocationInsideOtherRegion(in octetstring p_region, in ThreeDLocation p_location) return boolean; - - /** - * @desc Check that p_circular_region_1 circular region is included into p_circular_region_2 circular region - * @param p_circular_region_1 Circular region 1 - * @param p_circular_region_2 Circular region 2 - * - * @return true on success, false otherwise - */ - external function fx_areCirclesInside(in CircularRegion p_circular_region_1, in CircularRegion p_circular_region_2) return boolean; - - /** - * @desc Check that p_rectanglar_region_1 rectangular region is included into p_rectanglar_region_2 rectangular region - * @param p_rectanglar_region_1 Rectangular region 1 - * @param p_rectanglar_region_2 Rectangular region 2 - * - * @return true on success, false otherwise - */ - external function fx_areRectanglesInside(in SequenceOfRectangularRegion p_rectanglar_region_1, in SequenceOfRectangularRegion p_rectanglar_region_2) return boolean; - - /** - * @desc Check that p_polygonal_region_1 polygonal region is included into p_polygonal_region_2 polygonal region - * @param p_polygonal_region_1 Polygonal region 1 - * @param p_polygonal_region_2 Polygonal region 2 - * - * @return true on success, false otherwise - */ - external function fx_arePolygonsInside(in PolygonalRegion p_polygonal_region_1, in PolygonalRegion p_polygonal_region_2) return boolean; - - /** - * @desc Convert a spacial coordinate from DMS to Dms - * @param p_degrees The degrees (D) - * @param p_minutes The minutes (M) - * @param p_seconds The seconds (S) - * @param p_latlon The latitude/longitude: (N|S|E|W) - * @return The decimal coordinate on success, 0.0, otherwise - * @verdict Unchanged - */ - external function fx_dms2dd(in Int p_degrees, in Int p_minutes, in float p_seconds, in Oct1 p_latlon) return float; - - } // End of group geodesic - - } // End of group externalFunctions - - group geometryFunctions { - - function f_checkRegionValidityRestiction( - in EtsiTs103097Certificate p_cert, - in EtsiTs103097Certificate p_cert_issuer - ) return boolean { - var ValidityPeriod v_cert_region, v_cert_issuer_region; - var boolean v_cert_issuer_region_result; - - /* FIXME To be reviewed v_cert_issuer_region_result := f_getCertificateValidityRestriction(p_cert_issuer, e_region, v_cert_issuer_region); - if (f_getCertificateValidityRestriction(p_cert, e_region, v_cert_region) == false) { - if (v_cert_issuer_region_result == true) { - if (v_cert_issuer_region.validity.region.region_type != e_none) { - return false; - } - } - } else if ( - (v_cert_issuer_region_result == true) and - (v_cert_issuer_region.validity.region.region_type != e_none) - ) { - if (v_cert_region.validity.region.region_type == e_circle) { - if (v_cert_issuer_region.validity.region.region_type == e_circle) { - // Check v_cert_region 'circle' is inside v_cert_issuer_region 'circle' - if (f_areCirclesInside(v_cert_region.validity.region.region.circular_region, v_cert_issuer_region.validity.region.region.circular_region) == false) { - log("*** " & testcasename() & ": FAIL: Issuer and issuing certificates circle area does not match ***"); - return false; - } - } - } else if (v_cert_region.validity.region.region_type == e_rectangle) { - if (v_cert_issuer_region.validity.region.region_type == e_rectangle) { - // Check v_cert_region 'rectangle' is inside v_cert_issuer_region 'rectangle' - if (f_areRectanglesInside(v_cert_region.validity.region.region.rectangular_region, v_cert_issuer_region.validity.region.region.rectangular_region) == false) { - log("*** " & testcasename() & ": FAIL: Issuer and issuing certificates rectangle area does not match ***"); - return false; - } - } - } else if (v_cert_region.validity.region.region_type == e_polygon) { - if (v_cert_issuer_region.validity.region.region_type == e_polygon) { - // Check v_cert_region 'polygon' is inside v_cert_issuer_region 'polygon' - if (f_arePolygonsInside(v_cert_region.validity.region.region.polygonal_region, v_cert_issuer_region.validity.region.region.polygonal_region) == false) { - log("*** " & testcasename() & ": FAIL: Issuer and issuing certificates polygon area does not match ***"); - return false; - } - } - } else if (v_cert_region.validity.region.region_type == e_id) { - // Check id_region - if (not match (v_cert_region.validity.region, mw_geographicRegion_identified(mw_identifiedRegion_iso3166_any))) { - log("*** " & testcasename() & ": FAIL: Identified region is not conformed to ISO 3166-1 ***"); - return false; - } - if (not match (v_cert_region.validity.region, mw_geographicRegion_identified(mw_identifiedRegion_un_stats_any))) { - log("*** " & testcasename() & ": FAIL: Identified region is not conformed to United Nations Statistics Division ***"); - return false; - } - // Check region_dictionary - if (not match (v_cert_region.validity.region.region.id_region.region_dictionary, v_cert_issuer_region.validity.region.region.id_region.region_dictionary)) { - log("*** " & testcasename() & ": FAIL: Issuer and issuing 'region_dictionary' field does not match ***"); - return false; - } - // Check region_identifier - if (not match (v_cert_region.validity.region.region.id_region.region_identifier, v_cert_issuer_region.validity.region.region.id_region.region_identifier)) { - log("*** " & testcasename() & ": FAIL: Issuer and issuing 'region_identifier' field does not match ***"); - return false; - } - // Check local_region - if ( - (not match (v_cert_issuer_region.validity.region.region.id_region.local_region, v_cert_region.validity.region.region.id_region.local_region)) or - (not match (v_cert_issuer_region.validity.region.region.id_region.local_region, 0)) - ) { - log("*** " & testcasename() & ": FAIL: Issuer and issuing 'local_region' field does not match ***"); - return false; - } - } - }*/ - - return true; - } // End of function f_checkRegionValidityRestiction - - /** - * @desc Check that p_circular_region_1 circular region is included into p_circular_region_2 circular region - * @param p_circular_region_1 Circular region 1 - * @param p_circular_region_2 Circular region 2 - * - * @return true on success, false otherwise - */ - function f_areCirclesInside( - in CircularRegion p_circular_region_1, - in CircularRegion p_circular_region_2 - ) return boolean { - return fx_areCirclesInside(p_circular_region_1, p_circular_region_2); - } - - /** - * @desc Check that p_rectanglar_region_1 rectangular region is included into p_rectanglar_region_2 rectangular region - * @param p_rectanglar_region_1 Rectangular region 1 - * @param p_rectanglar_region_2 Rectangular region 2 - * - * @return true on success, false otherwise - */ - function f_areRectanglesInside( - in SequenceOfRectangularRegion p_rectanglar_region_1, - in SequenceOfRectangularRegion p_rectanglar_region_2 - ) return boolean { - return fx_areRectanglesInside(p_rectanglar_region_1, p_rectanglar_region_2); - } - - /** - * @desc Check that p_polygonal_region_1 polygonal region is included into p_polygonal_region_2 polygonal region - * @param p_polygonal_region_1 Polygonal region 1 - * @param p_polygonal_region_2 Polygonal region 2 - * - * @return true on success, false otherwise - */ - function f_arePolygonsInside( - in PolygonalRegion p_polygonal_region_1, - in PolygonalRegion p_polygonal_region_2 - ) return boolean { - return fx_arePolygonsInside(p_polygonal_region_1, p_polygonal_region_2); - } - - /** - * @desc Check that given location is valid - * @param p_location location to be checked - * @return true on success, false otherwise - */ - function f_isValidTwoDLocation( - in template (value) TwoDLocation p_location - ) return boolean { - return -//FIXME RGY Titan doesn't support dot notation after valueof at the moment -// (valueof(p_location).longitude != c_maxLongitude + 1) and -// (valueof(p_location).latitude != c_maxLatitude + 1); - (valueof(p_location.longitude) != c_maxLongitude + 1) and - (valueof(p_location.latitude) != c_maxLatitude + 1); - } // End of function f_isValidTwoDLocation - - /** - * @desc Check that two given rectanlular regions are intersected - * Note: Regions must be normalized(northWest.latitude >= southEast.latitude) - * @param p_r1 Region 1 - * @param p_r2 Region 2 - * - * @return true on success, false otherwise - */ - function f_isRectangularRegionsIntersected( - in template (value) RectangularRegion p_r1, - in template (value) RectangularRegion p_r2 - ) return boolean { - return not ( -//FIXME RGY Titan doesn't support dot notation after valueof at the moment -// valueof(p_r2).northWest.longitude > valueof(p_r1).southEast.longitude or -// valueof(p_r2).southEast.longitude < valueof(p_r1).northWest.longitude or -// valueof(p_r2).southEast.latitude > valueof(p_r1).northWest.latitude or -// valueof(p_r2).northWest.latitude < valueof(p_r1).southEast.latitude - valueof(p_r2.northWest.longitude) > valueof(p_r1.southEast.longitude) or - valueof(p_r2.southEast.longitude) < valueof(p_r1.northWest.longitude) or - valueof(p_r2.southEast.latitude) > valueof(p_r1.northWest.latitude) or - valueof(p_r2.northWest.latitude) < valueof(p_r1.southEast.latitude) - ); - } // End of function f_isRectangularRegionsIntersected - - function f_isContinuousRectangularRegions( - in template (value) SequenceOfRectangularRegion p_region - ) return boolean { - var integer v_i, v_j; - var boolean v_found; - - for (v_i := 0; v_i < lengthof(p_region); v_i := v_i + 1) { - var PolygonalRegion v_region_base; - f_convertRectangularRegionIntoPolygonalRegion(valueof(p_region[v_i]), v_region_base); - v_found := false; - for (v_j := 0; v_j < lengthof(p_region); v_j := v_j + 1) { - if (v_j != v_i) { - var PolygonalRegion v_region; - f_convertRectangularRegionIntoPolygonalRegion(valueof(p_region[v_j]), v_region); - if (f_isPolygonalRegionInside(v_region, v_region_base) == true) { - v_found := true; - } - } - } // End of 'for' statement - if (v_found == false) { - return false; - } - } // End of 'for' statement - - return true; - } // End of function f_isContinuousRectangularRegions - - /** - * @desc Check if a polygonal region is inside another one - * @param p_parent The main polygonal region - * @param p_region The polygonal region to be included - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_isRectangularRegionsInside( - in template (value) SequenceOfRectangularRegion p_parent, - in template (value) SequenceOfRectangularRegion p_region - ) return boolean { - var integer v_i, v_j; - - for (v_i := 0; v_i < lengthof(p_parent); v_i := v_i + 1) { - var PolygonalRegion v_region_parent, v_region; - f_convertRectangularRegionIntoPolygonalRegion(valueof(p_parent[v_i]), v_region_parent); - for (v_j := 0; v_j < lengthof(p_parent); v_j := v_j + 1) { - f_convertRectangularRegionIntoPolygonalRegion(valueof(p_region[v_j]), v_region); - if (f_isPolygonalRegionInside(v_region, v_region_parent) == true) { - return true; - } - } // End of 'for' statement - } // End of 'for' statement - - return false; - } // End of function f_isRectangularRegionsInside - - /** - * @desc Convert a rectangular region into a polygonal region - * @param p_region The rectangular regions to convert - * @return - * @verdict - */ - function f_convertRectangularRegionIntoPolygonalRegion( - in template (value) RectangularRegion p_rectangular_region, - out PolygonalRegion p_region - ) return boolean { - - // Convert rectangular regions to polygons and check polygons - p_region[0] := valueof(p_rectangular_region.northWest); - p_region[1] := { - valueof(p_rectangular_region.northWest.latitude) + valueof(p_rectangular_region.southEast.latitude), - valueof(p_rectangular_region.northWest.longitude) - }; - p_region[2] := valueof(p_rectangular_region.southEast); - p_region[3] := { - valueof(p_rectangular_region.northWest.latitude), - valueof(p_rectangular_region.northWest.longitude) + valueof(p_rectangular_region.southEast.longitude) - }; - log("f_convertRectangularRegionIntoPolygonalRegion: DEBUG: Northwest location is invalid in rect ", p_region); - - return true; - } // End of function - - /** - * @desc Check that given polygon doesn't have neither self-intersections nor holes. - * @param p_region Polygonal Region - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_isValidPolygonalRegion( - in template (value) PolygonalRegion p_region - ) return boolean { - // Sanity check - if (not isbound(p_region) or (lengthof(p_region) == 0)) { - return false; - } - - return fx_isValidPolygonalRegion(valueof(p_region)); - } // End of function f_isValidPolygonalRegion - - /** - * @desc Check if a polygonal region is inside another one - * @param p_parent The main polygonal region - * @param p_region The polygonal region to be included - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_isPolygonalRegionInside( - in template (value) PolygonalRegion p_parent, - in template (value) PolygonalRegion p_region - ) return boolean { - // Sanity check - if (not isbound(p_parent) or not isbound(p_region) or (lengthof(p_parent) == 0) or (lengthof(p_region) == 0)) { - return false; - } - - return fx_isPolygonalRegionInside(valueof(p_parent), valueof(p_region)); - } // End of function f_isPolygonalRegionInside - - /** - * @desc - */ - function f_isIdentifiedRegionInside( - in template (value) UInt16 p_parent, - in template (value) UInt16 p_region - ) return boolean { - return valueof(p_parent) == valueof(p_region); - } // End of function f_isIdentifiedRegionInside - - /** - * @desc Check that the location is inside a region - * @param p_region The region to consider - * @param p_location The device location - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_isLocationInsideRegion( - in template (value) GeographicRegion p_region, - in template (value) ThreeDLocation p_location - ) return boolean { - var boolean v_ret := false; - - if (ischosen(p_region.circularRegion)) { - v_ret := f_isLocationInsideCircularRegion(valueof(p_region.circularRegion), p_location); - } else if (ischosen(p_region.rectangularRegion)) { - v_ret := f_isLocationInsideRectangularRegion(valueof(p_region.rectangularRegion), p_location); - } else if (ischosen(p_region.polygonalRegion)) { - v_ret := f_isLocationInsidePolygonalRegion(valueof(p_region.polygonalRegion), p_location); - } else if (ischosen(p_region.identifiedRegion)) { - for (var integer v_i := 0; v_i < lengthof(p_region.identifiedRegion); v_i := v_i + 1) { - if (f_isLocationInsideIdentifiedRegion(valueof(p_region.identifiedRegion[v_i]), p_location) == true) { - v_ret := true; - break; - } - } // End of 'for' statement - } - - return v_ret; - } // End of function f_isLocationInsideRegion - - /** - * @desc Check that the location is inside a circular region - * @param p_region The circular region to consider - * @param p_location The device location - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_isLocationInsideCircularRegion( - in template (value) CircularRegion p_region, - in template (value) ThreeDLocation p_location - ) return boolean { - // Sanity check - if (not isbound(p_region) or not isbound(p_location)) { - return false; - } - - return fx_isLocationInsideCircularRegion(valueof(p_region), valueof(p_location)); - } // End of function f_isLocationInsideCircularRegion - - /** - * @desc Check that the location is inside a rectangular region - * @param p_region The rectangular region to consider - * @param p_location The device location - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_isLocationInsideRectangularRegion( - in template (value) SequenceOfRectangularRegion p_region, - in template (value) ThreeDLocation p_location - ) return boolean { - // Sanity check - if (not isbound(p_region) or not isbound(p_location) or (lengthof(p_region) == 0)) { - return false; - } -// log("f_isLocationInsideRectangularRegion: p_polygonalArea: ", p_region); -// log("f_isLocationInsideRectangularRegion: p_location: ", p_location); - - return fx_isLocationInsideRectangularRegion(valueof(p_region), valueof(p_location)); - } // End of function f_isLocationInsideRectangularRegion - - /** - * @desc Check that the location is inside a polygonal region - * @param p_region The polygonal region to consider - * @param p_location The device location - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_isLocationInsidePolygonalRegion( - in template (value) PolygonalRegion p_region, - in template (value) ThreeDLocation p_location - ) return boolean { - // Sanity check - if (not isbound(p_region) or not isbound(p_location) or (lengthof(p_region) == 0)) { - return false; - } -// log("f_isLocationInsidePolygonalRegion: p_polygonalArea: ", p_region, " - ", valueof(p_region)); -// log("f_isLocationInsidePolygonalRegion: p_location: ", p_location, " - ", valueof(p_location)); - - return fx_isLocationInsidePolygonalRegion(valueof(p_region), valueof(p_location)); - } // End of function f_isLocationInsidePolygonalRegion - - /** - * @desc Check if the location is inside an identified region - * @param p_region The identified region to consider - * @param p_location The device location - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_isLocationInsideIdentifiedRegion( - in template (value) IdentifiedRegion p_region, - in template (value) ThreeDLocation p_location - ) return boolean { - // Sanity check - if (not isbound(p_region) or not isbound(p_location)) { - return false; - } - - return fx_isLocationInsideIdentifiedRegion(valueof(p_region), valueof(p_location)); - } // End of function f_isLocationInsideIdentifiedRegion - - /** - * @desc Check if the location is inside an undefined region - * @param p_region The identified region to consider - * @param p_location The device location - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_isLocationInsideOtherRegion( - in template (value) octetstring p_region, - in template (value) ThreeDLocation p_location - ) return boolean { - // Sanity check - if (valueof(p_region) == ''O) { - return false; - } - - return fx_isLocationInsideOtherRegion(valueof(p_region), valueof(p_location)); - } // End of function f_isLocationInsideOtherRegion - - /** - * @desc Convert a spacial coordinate from DMS to Dms - * @param p_degrees The degrees (D) - * @param p_minutes The minutes (M) - * @param p_seconds The seconds (S) - * @param p_latlon The latitude/longitude: (N|S|E|W) - * @return The decimal coordinate on success, 0.0, otherwise - * @verdict Unchanged - */ - function f_dms2dd( - in integer p_degrees, - in integer p_minutes, - in float p_seconds, - in charstring p_latlon - ) return float { - var Oct1 v_latlon; - - // Sanity checks - if (lengthof(p_latlon) != 1) { - return 0.0; - } else if ((p_latlon != "N") and (p_latlon != "S") and (p_latlon != "E") and (p_latlon != "W")) { - return 0.0; - } - v_latlon := char2oct(p_latlon); - - return fx_dms2dd(p_degrees, p_minutes, p_seconds, v_latlon); - } // End of function f_dms2dd - - /** - * @desc Convert the latitude from float to int - * @param p_latitude The latitude to be converted. Significand length shall be 7 digits length - * @return The converted latitude - * @verdict Unchanged - */ - function f_ddlat2int( - in float p_latitude - ) return SecLatitude { - return float2int(p_latitude * 10000000.0); // Significand length shall be 7 digits length - } - - /** - * @desc Convert the longitude from float to int - * @param p_longitude The longitude to be converted. Significand length shall be 6 digits length - * @return The converted longitude - * @verdict Unchanged - */ - function f_ddlon2int( - in float p_longitude - ) return SecLongitude { - return float2int(p_longitude * 1000000.0); // Significand length shall be 6 digits length - } - - } // End of group geometryFunctions - -} // End of module LibItsSecurity_Functions - +/** + * @author ETSI / STF481 / STF507 / STF517 / STF538 / STF545 + * @version $Url$ + * $Id$ + * @desc Module containing functions for Security Protocol + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * + */ +module LibItsSecurity_Functions { + + // Libcommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; + + // LibIts + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + import from IEEE1609dot2 language "ASN.1:1997" all; + import from EtsiTs103097Module language "ASN.1:1997" all; + + // LibItsCommon + //import from LibItsCommon_Functions all; + //import from LibItsCommon_TypesAndValues all; + import from LibItsCommon_Pixits all; + + // LibItsSecurity + import from LibItsSecurity_TypesAndValues all; + import from LibItsSecurity_Templates all; + import from LibItsSecurity_Pixits all; + import from LibItsSecurity_Pics all; + import from LibItsSecurity_TestSystem all; + + group helpersFunctions { + + /** + * @desc Produces a 256-bit (32-byte) hash value + * @param p_toBeHashedData Data to be used to calculate the hash value + * @return The hash value + */ + function f_hashWithSha256( + in octetstring p_toBeHashedData + ) return Oct32 { + return fx_hashWithSha256(p_toBeHashedData); + } // End of function f_hashWithSha256 + + /** + * @desc Produces a 384-bit (48-byte) hash value + * @param p_toBeHashedData Data to be used to calculate the hash value + * @return The hash value + */ + function f_hashWithSha384( + in octetstring p_toBeHashedData + ) return Oct48 { + return fx_hashWithSha384(p_toBeHashedData); + } // End of function f_hashWithSha256 + + /** + * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature based on standard IEEE 1609.2 + * @param p_toBeSignedSecuredMessage The data to be signed + * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate + * @param p_privateKey The private key for signature + * @return The signature value + */ + function f_signWithEcdsaNistp256WithSha256( + in octetstring p_toBeSignedSecuredMessage, + in Oct32 p_certificateIssuer, + in Oct32 p_privateKey + ) return octetstring { + log(">>> f_signWithEcdsaNistp256WithSha256: p_toBeSignedSecuredMessage= ", p_toBeSignedSecuredMessage); + log(">>> f_signWithEcdsaNistp256WithSha256: p_certificateIssuer= ", p_certificateIssuer); + log(">>> f_signWithEcdsaNistp256WithSha256: p_privateKey= ", p_privateKey); + + return fx_signWithEcdsaNistp256WithSha256( + p_toBeSignedSecuredMessage, + p_certificateIssuer, + p_privateKey + ); + + } // End of function f_signWithEcdsaNistp256WithSha256 + + /** + * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature based on standard IEEE 1609.2 + * @param p_toBeSignedSecuredMessage The data to be signed + * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate + * @param p_privateKey The private key for signature + * @return The signature value + */ + function f_signWithEcdsaBrainpoolp256WithSha256( + in octetstring p_toBeSignedSecuredMessage, + in Oct32 p_certificateIssuer, + in Oct32 p_privateKey + ) return octetstring { + return fx_signWithEcdsaBrainpoolp256WithSha256( + p_toBeSignedSecuredMessage, + p_certificateIssuer, + p_privateKey + ); + + } // End of function f_signWithEcdsaBrainpoolp256WithSha256 + + /** + * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature based on standard IEEE 1609.2 + * @param p_toBeSignedSecuredMessage The data to be signed + * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate + * @param p_privateKey The private key for signature + * @return The signature value + */ + function f_signWithEcdsaBrainpoolp384WithSha384( + in octetstring p_toBeSignedSecuredMessage, + in Oct48 p_certificateIssuer, + in Oct48 p_privateKey + ) return octetstring { + log(">>> f_signWithEcdsaBrainpoolp384WithSha384: ", p_toBeSignedSecuredMessage); + log(">>> f_signWithEcdsaBrainpoolp384WithSha384: ", p_certificateIssuer); + log(">>> f_signWithEcdsaBrainpoolp384WithSha384: ", p_privateKey); + return fx_signWithEcdsaBrainpoolp384WithSha384( + p_toBeSignedSecuredMessage, + p_certificateIssuer, + p_privateKey + ); + + } // End of function f_signWithEcdsaBrainpoolp384WithSha384 + + function f_decrypt( + in octetstring p_encryptPrivateKey, + in EtsiTs103097Data p_encrypedSecuredMessage, + in octetstring p_salt, + out EtsiTs103097Data p_decrypedSecuredMessage, + out octetstring p_aes_sym_enc_key + ) return boolean { + if (ischosen(p_encrypedSecuredMessage.content.encryptedData)) { + var PKRecipientInfo v_pKRecipientInfo; + var RecipientInfo v_recipientInfo := p_encrypedSecuredMessage.content.encryptedData.recipients[0]; + var octetstring v_decryptedSecuredMessage; + + log(">>> f_decrypt: p_encryptPrivateKey=", p_encryptPrivateKey); + log(">>> f_decrypt: p_encrypedSecuredMessage=", p_encrypedSecuredMessage); + log(">>> f_decrypt: p_salt=", p_salt); + + // Check the private encryption key + if (not(isbound(p_encryptPrivateKey))) { + log("*** " & testcasename() & ":ERROR: Failed to load encryption private key ***"); + return false; + } + + if (ischosen(v_recipientInfo.certRecipInfo)) { + v_pKRecipientInfo := p_encrypedSecuredMessage.content.encryptedData.recipients[0].certRecipInfo; + // Read the certificate based on the recipientId + } else if (ischosen(v_recipientInfo.signedDataRecipInfo)) { + v_pKRecipientInfo := p_encrypedSecuredMessage.content.encryptedData.recipients[0].signedDataRecipInfo; + // Read the certificate based on the recipientId + } else { + log("*** " & testcasename() & ":ERROR: Unsupported RecipientInfo variant ***"); + return false; + } + + log("f_decrypt: v_pKRecipientInfo=", v_pKRecipientInfo); + if (isbound(v_pKRecipientInfo)) { + if (ischosen(v_pKRecipientInfo.encKey.eciesNistP256)) { + var SymmetricCiphertext v_ciphertext := p_encrypedSecuredMessage.content.encryptedData.ciphertext; + + log("f_decrypt: v_ciphertext=", v_ciphertext); + if (ischosen(v_pKRecipientInfo.encKey.eciesNistP256.v.compressed_y_0)) { + v_decryptedSecuredMessage := f_decryptWithEciesNistp256WithSha256( + v_ciphertext.aes128ccm.ccmCiphertext, + p_encryptPrivateKey, + v_pKRecipientInfo.encKey.eciesNistP256.v.compressed_y_0, + 0, + v_pKRecipientInfo.encKey.eciesNistP256.c, + v_pKRecipientInfo.encKey.eciesNistP256.t, + v_ciphertext.aes128ccm.nonce, + p_salt, + p_aes_sym_enc_key + ); + } else if (ischosen(v_pKRecipientInfo.encKey.eciesNistP256.v.compressed_y_1)) { + v_decryptedSecuredMessage := f_decryptWithEciesNistp256WithSha256( + v_ciphertext.aes128ccm.ccmCiphertext, + p_encryptPrivateKey, + v_pKRecipientInfo.encKey.eciesNistP256.v.compressed_y_1, + 1, + v_pKRecipientInfo.encKey.eciesNistP256.c, + v_pKRecipientInfo.encKey.eciesNistP256.t, + v_ciphertext.aes128ccm.nonce, + p_salt, + p_aes_sym_enc_key + ); + } else { + log("*** " & testcasename() & ":ERROR: Non canonical ephemeral encryption keys ***"); + return false; + } + if (isbound(v_decryptedSecuredMessage)) { + var bitstring v_decode := oct2bit(v_decryptedSecuredMessage); + if (decvalue(v_decode, p_decrypedSecuredMessage) == 0) { + return true; + } else { + log("*** " & testcasename() & ":ERROR: Faild to decode secured message ***"); + } + } + } else if (ischosen(v_pKRecipientInfo.encKey.eciesBrainpoolP256r1)) { + var SymmetricCiphertext v_ciphertext := p_encrypedSecuredMessage.content.encryptedData.ciphertext; + if (ischosen(v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.compressed_y_0)) { + v_decryptedSecuredMessage := f_decryptWithEciesBrainpoolp256WithSha256( + v_ciphertext.aes128ccm.ccmCiphertext, + p_encryptPrivateKey, + v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.compressed_y_0, + 0, + v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.c, + v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.t, + v_ciphertext.aes128ccm.nonce, + p_salt, p_aes_sym_enc_key + ); + } else if (ischosen(v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.compressed_y_1)) { + v_decryptedSecuredMessage := f_decryptWithEciesBrainpoolp256WithSha256( + v_ciphertext.aes128ccm.ccmCiphertext, + p_encryptPrivateKey, + v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.compressed_y_1, + 1, + v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.c, + v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.t, + v_ciphertext.aes128ccm.nonce, + p_salt, + p_aes_sym_enc_key + ); + } else { + log("*** " & testcasename() & ":ERROR: Non canonical ephemeral encryption keys ***"); + return false; + } + } else { + log("*** " & testcasename() & ":ERROR: Non canonical ephemeral encryption keys ***"); + return false; + } + // TODO else, other variants shall be processed here if + } else { + log("*** " & testcasename() & ":ERROR: Invalid recipient info ***"); + return false; + } + if (isbound(v_decryptedSecuredMessage)) { + var bitstring v_decode := oct2bit(v_decryptedSecuredMessage); + if (decvalue(v_decode, p_decrypedSecuredMessage) == 0) { + return true; + } else { + log("*** " & testcasename() & ":ERROR: Faild to decode secured message ***"); + } + } + } else { + log("*** " & testcasename() & ":ERROR: Message not encrypted ***"); + } + + return false; + } // End of function f_decrypt + + /** + * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption using Nist-P256 algorithm + * @param p_toBeEncryptedSecuredMessage The data to be encrypted + * @param p_recipientsPublicKeyCompressed The Recipient's compressed public key + * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key + * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key + * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption + * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption + * @see IEEE Std 1609.2-2017 Clause 5.3.5 Public key encryption algorithms: ECIES + * @see https://www.nominet.uk/researchblog/how-elliptic-curve-cryptography-encryption-works/ + * @see http://digital.csic.es/bitstream/10261/32671/1/V2-I2-P7-13.pdf + * @return The encrypted message + */ + function f_encryptWithEciesNistp256WithSha256( + in octetstring p_toBeEncryptedSecuredMessage, + in Oct32 p_recipientsPublicKeyCompressed, + in integer p_compressed_mode, + in octetstring p_salt, + out Oct32 p_publicEphemeralKeyCompressed, + out integer p_ephemeralKeyModeCompressed, + out Oct16 p_aes_sym_key, + out Oct16 p_encrypted_sym_key, + out Oct16 p_authentication_vector, + out Oct12 p_nonce + ) return octetstring { + return fx_encryptWithEciesNistp256WithSha256( + p_toBeEncryptedSecuredMessage, + p_recipientsPublicKeyCompressed, + p_compressed_mode, + p_salt, + p_publicEphemeralKeyCompressed, + p_ephemeralKeyModeCompressed, + p_aes_sym_key, + p_encrypted_sym_key, + p_authentication_vector, + p_nonce + ); + } // End of function f_encryptWithEciesNistp256WithSha256 + + /** + * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Nist-P256 algorithm + * @param p_encryptedSecuredMessage The data to be decrypted + * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key + * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key + * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption + * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption + * @return The decrypted message + * @see IEEE Std 1609.2-2017 Clause 5.3.5 Public key encryption algorithms: ECIES + * @see https://www.nominet.uk/researchblog/how-elliptic-curve-cryptography-encryption-works/ + * @see http://digital.csic.es/bitstream/10261/32671/1/V2-I2-P7-13.pdf + */ + function f_decryptWithEciesNistp256WithSha256( + in octetstring p_encryptedSecuredMessage, + in Oct32 p_privateEncKey, + in Oct32 p_publicEphemeralKeyCompressed, + in integer p_ephemeralKeyModeCompressed, + in Oct16 p_encrypted_sym_key, + in Oct16 p_authentication_vector, + in Oct12 p_nonce, + in Oct32 p_salt, + out Oct16 p_aes_sym_enc_key + ) return octetstring { + return fx_decryptWithEciesNistp256WithSha256( + p_encryptedSecuredMessage, + p_privateEncKey, + p_publicEphemeralKeyCompressed, + p_ephemeralKeyModeCompressed, + p_encrypted_sym_key, + p_authentication_vector, + p_nonce, + p_salt, + p_aes_sym_enc_key + ); + } // End of function f_decryptWithEcdsaNistp256WithSha256 + + /** + * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption using Brainpool-P256 algorithm + * @param p_toBeEncryptedSecuredMessage The data to be encrypted + * @param p_recipientsPublicKeyCompressed The Recipient's compressed public key + * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key + * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key + * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption + * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption + * @return The encrypted message + * @see IEEE Std 1609.2-2017 Clause 5.3.5 Public key encryption algorithms: ECIES + * @see https://www.nominet.uk/researchblog/how-elliptic-curve-cryptography-encryption-works/ + * @see http://digital.csic.es/bitstream/10261/32671/1/V2-I2-P7-13.pdf + */ + function f_encryptWithEciesBrainpoolp256WithSha256( + in octetstring p_toBeEncryptedSecuredMessage, + in Oct32 p_recipientsPublicKeyCompressed, + in integer p_compressed_mode, + in octetstring p_salt, + out Oct32 p_publicEphemeralKeyCompressed, + out integer p_ephemeralKeyModeCompressed, + out Oct16 p_aes_sym_key, + out Oct16 p_encrypted_sym_key, + out Oct16 p_authentication_vector, + out Oct12 p_nonce + ) return octetstring { + return fx_encryptWithEciesBrainpoolp256WithSha256( + p_toBeEncryptedSecuredMessage, + p_recipientsPublicKeyCompressed, + p_compressed_mode, + p_salt, + p_publicEphemeralKeyCompressed, + p_ephemeralKeyModeCompressed, + p_aes_sym_key, + p_encrypted_sym_key, + p_authentication_vector, + p_nonce + ); + } // End of function f_encryptWithEciesBrainpoolp256WithSha256 + + /** + * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Brainpool-P256 algorithm + * @param p_encryptedSecuredMessage The data to be decrypted + * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key + * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key + * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption + * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption + * @return The decrypted message + * @see IEEE Std 1609.2-2017 Clause 5.3.5 Public key encryption algorithms: ECIES + * @see https://www.nominet.uk/researchblog/how-elliptic-curve-cryptography-encryption-works/ + * @see http://digital.csic.es/bitstream/10261/32671/1/V2-I2-P7-13.pdf + */ + function f_decryptWithEciesBrainpoolp256WithSha256( + in octetstring p_encryptedSecuredMessage, + in Oct32 p_privateEncKey, + in Oct32 p_publicEphemeralKeyCompressed, + in integer p_ephemeralKeyModeCompressed, + in Oct16 p_encrypted_sym_key, + in Oct16 p_authentication_vector, + in Oct12 p_nonce, + in Oct32 p_salt, + out Oct16 p_aes_sym_enc_key + ) return octetstring { + return fx_decryptWithEciesBrainpoolp256WithSha256( + p_encryptedSecuredMessage, + p_privateEncKey, + p_publicEphemeralKeyCompressed, + p_ephemeralKeyModeCompressed, + p_encrypted_sym_key, + p_authentication_vector, + p_nonce, + p_salt, + p_aes_sym_enc_key + ); + } // End of function f_decryptWithEcdsaBrainpoolp256WithSha256 + + /** + * @desc Compute the HashedId8 value from the hash value + * @param p_hash The hash value + * @return The HashedId8 value + * @verdict + */ + function f_hashedId8FromSha256( + in Oct32 p_hash + ) return HashedId8 { + return substr(p_hash, lengthof(p_hash) - 8, 8); + } // End of function f_hashedId8FromSha256 + + /** + * @desc Compute the HashedId8 value from the hash value + * @param p_hash The hash value + * @return The HashedId8 value + * @verdict + */ + function f_hashedId8FromSha384( + in Oct48 p_hash + ) return HashedId8 { + return substr(p_hash, lengthof(p_hash) - 8, 8); + } // End of function f_hashedId8FromSha384 + + /** + * @desc Compute the HashedId3 value from the HashedId8 value + * @param p_hashp_hashedId8 The HashedId8 value + * @return The HashedId3 value + * @verdict Unchanged + */ + function f_hashedId3FromHashedId8( + in HashedId8 p_hashedId8 + ) return HashedId3 { + return substr(p_hashedId8, lengthof(p_hashedId8) - 3, 3); + } // End of function f_hashedId3FromHashedId8 + + /** + * @desc Verify the signature of the specified data + * @param p_toBeVerifiedData The data to be verified + * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate + * @param p_signature The signature + * @param p_ecdsaNistp256PublicKeyCompressed The compressed public key + * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @return true on success, false otherwise + */ + function f_verifyWithEcdsaNistp256WithSha256( + in octetstring p_toBeVerifiedData, + in Oct32 p_certificateIssuer, + in Oct64 p_signature, + in Oct32 p_ecdsaNistp256PublicKeyCompressed, + in integer p_compressed_mode + ) return boolean { +// log("f_verifyWithEcdsaNistp256WithSha256: toBeVerifiedData", p_toBeVerifiedData); +// log("f_verifyWithEcdsaNistp256WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); +// log("f_verifyWithEcdsaNistp256WithSha256: signature", p_signature); +// log("f_verifyWithEcdsaNistp256WithSha256: ecdsaNistp256PublicKeyCompressed", p_ecdsaNistp256PublicKeyCompressed); + return fx_verifyWithEcdsaNistp256WithSha256( + p_toBeVerifiedData, + p_certificateIssuer, + p_signature, + p_ecdsaNistp256PublicKeyCompressed, + p_compressed_mode + ); + } // End of function f_verifyWithEcdsaNistp256WithSha256 + + /** + * @desc Verify the signature of the specified data + * @param p_toBeVerifiedData The data to be verified + * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate + * @param p_signature The signature + * @param p_ecdsaNistp256PublicKeyX The public key (x coordinate) + * @param p_ecdsaNistp256PublicKeyY The public key (y coordinate) + * @return true on success, false otherwise + */ + function f_verifyWithEcdsaNistp256WithSha256_1( // TODO To be removed + in octetstring p_toBeVerifiedData, + in Oct32 p_certificateIssuer, + in Oct64 p_signature, + in Oct32 p_ecdsaNistp256PublicKeyX, + in Oct32 p_ecdsaNistp256PublicKeyY + ) return boolean { +// log("f_verifyWithEcdsaNistp256WithSha256: toBeVerifiedData", p_toBeVerifiedData); +// log("f_verifyWithEcdsaNistp256WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); +// log("f_verifyWithEcdsaNistp256WithSha256: signature", p_signature); +// log("f_verifyWithEcdsaNistp256WithSha256: ecdsaNistp256PublicKeyX", p_ecdsaNistp256PublicKeyX); +// log("f_verifyWithEcdsaNistp256WithSha256: ecdsaNistp256PublicKeyY", p_ecdsaNistp256PublicKeyY); + return fx_verifyWithEcdsaNistp256WithSha256_1( + p_toBeVerifiedData, + p_certificateIssuer, + p_signature, + p_ecdsaNistp256PublicKeyX, + p_ecdsaNistp256PublicKeyY); + } // End of function f_verifyWithEcdsaNistp256WithSha256_1 + + /** + * @Desc Verify the signature of the specified data + * @param p_toBeVerifiedData The data to be verified + * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate + * @param p_signature The signature + * @param p_ecdsaBrainpoolp256PublicKeyCompressed The compressed public key + * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @return true on success, false otherwise + */ + function f_verifyWithEcdsaBrainpoolp256WithSha256( + in octetstring p_toBeVerifiedData, + in Oct32 p_certificateIssuer, + in Oct64 p_signature, + in Oct32 p_ecdsaBrainpoolp256PublicKeyCompressed, + in integer p_compressed_mode + ) return boolean { + log("f_verifyWithEcdsaBrainpoolp256WithSha256: toBeVerifiedData", p_toBeVerifiedData); + log("f_verifyWithEcdsaBrainpoolp256WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); + log("f_verifyWithEcdsaBrainpoolp256WithSha256: signature", p_signature); + log("f_verifyWithEcdsaBrainpoolp256WithSha256: ecdsaBrainpoolp256PublicKeyCompressed", p_ecdsaBrainpoolp256PublicKeyCompressed); + return fx_verifyWithEcdsaBrainpoolp256WithSha256( + p_toBeVerifiedData, + p_certificateIssuer, + p_signature, + p_ecdsaBrainpoolp256PublicKeyCompressed, + p_compressed_mode + ); + } // End of function f_verifyWithEcdsaBrainpoolp256WithSha256 + + /** + * @Desc Verify the signature of the specified data + * @param p_toBeVerifiedData The data to be verified + * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate + * @param p_signature The signature + * @param p_ecdsaBrainpoolp256PublicKeyX The public key (x coordinate) + * @param p_ecdsaBrainpoolp256PublicKeyY The public key (y coordinate) + * @return true on success, false otherwise + */ + function f_verifyWithEcdsaBrainpoolp256WithSha256_1( // TODO To be removed + in octetstring p_toBeVerifiedData, + in Oct32 p_certificateIssuer, + in Oct64 p_signature, + in Oct32 p_ecdsaBrainpoolp256PublicKeyX, + in Oct32 p_ecdsaBrainpoolp256PublicKeyY + ) return boolean { +// log("f_verifyWithEcdsaBrainpoolp256WithSha256: toBeVerifiedData", p_toBeVerifiedData); +// log("f_verifyWithEcdsaBrainpoolp256WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); +// log("f_verifyWithEcdsaBrainpoolp256WithSha256: signature", p_signature); +// log("f_verifyWithEcdsaBrainpoolp256WithSha256: ecdsaBrainpoolp256PublicKeyX", p_ecdsaBrainpoolp256PublicKeyX); +// log("f_verifyWithEcdsaBrainpoolp256WithSha256: ecdsaBrainpoolp256PublicKeyY", p_ecdsaBrainpoolp256PublicKeyY); + return fx_verifyWithEcdsaBrainpoolp256WithSha256_1( + p_toBeVerifiedData, + p_certificateIssuer, + p_signature, + p_ecdsaBrainpoolp256PublicKeyX, + p_ecdsaBrainpoolp256PublicKeyY); + } // End of function f_verifyWithEcdsaBrainpoolp256WithSha256_1 + + /** + * @Desc Verify the signature of the specified data + * @param p_toBeVerifiedData The data to be verified + * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate + * @param p_signature The signature + * @param p_ecdsaBrainpoolp384PublicKeyX The public key (x coordinate) + * @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate) + * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @return true on success, false otherwise + */ + function f_verifyWithEcdsaBrainpoolp384WithSha384( + in octetstring p_toBeVerifiedData, + in Oct48 p_certificateIssuer, + in Oct96 p_signature, + in Oct48 p_ecdsaBrainpoolp384PublicKeyCompressed, + in integer p_compressed_mode + ) return boolean { +// log("f_verifyWithEcdsaBrainpoolp384WithSha384: toBeVerifiedData", p_toBeVerifiedData); +// log("f_verifyWithEcdsaBrainpoolp384WithSha384: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); +// log("f_verifyWithEcdsaBrainpoolp384WithSha384: signature", p_signature); +// log("f_verifyWithEcdsaBrainpoolp384WithSha384: ecdsaBrainpoolp384PublicKeyCompressed", p_ecdsaBrainpoolp384PublicKeyCompressed); + return fx_verifyWithEcdsaBrainpoolp384WithSha384( + p_toBeVerifiedData, + p_certificateIssuer, + p_signature, + p_ecdsaBrainpoolp384PublicKeyCompressed, + p_compressed_mode + ); + } // End of function f_verifyWithEcdsaBrainpoolp384WithSha384 + + /** + * @Desc Verify the signature of the specified data + * @param p_toBeVerifiedData The data to be verified + * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate + * @param p_signature The signature + * @param p_ecdsaBrainpoolp384PublicKeyX The public key (x coordinate) + * @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate) + * @return true on success, false otherwise + */ + function f_verifyWithEcdsaBrainpoolp384WithSha384_1( // TODO To be removed + in octetstring p_toBeVerifiedData, + in Oct48 p_certificateIssuer, + in Oct96 p_signature, + in Oct48 p_ecdsaBrainpoolp384PublicKeyX, + in Oct48 p_ecdsaBrainpoolp384PublicKeyY + ) return boolean { +// log("f_verifyWithEcdsaBrainpoolp384WithSha384: toBeVerifiedData", p_toBeVerifiedData); +// log("f_verifyWithEcdsaBrainpoolp384WithSha384: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); +// log("f_verifyWithEcdsaBrainpoolp384WithSha384: signature", p_signature); +// log("f_verifyWithEcdsaBrainpoolp384WithSha384: ecdsaBrainpoolp384PublicKeyX", p_ecdsaBrainpoolp384PublicKeyX); +// log("f_verifyWithEcdsaBrainpoolp384WithSha384: ecdsaBrainpoolp384PublicKeyY", p_ecdsaBrainpoolp384PublicKeyY); + return fx_verifyWithEcdsaBrainpoolp384WithSha384_1( + p_toBeVerifiedData, + p_certificateIssuer, + p_signature, + p_ecdsaBrainpoolp384PublicKeyX, + p_ecdsaBrainpoolp384PublicKeyY); + } // End of function f_verifyWithEcdsaBrainpoolp384WithSha384_1 + + /** + * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. + * This function should not be used by the ATS + * @param p_privateKey The new private key value + * @param p_publicKeyX The new public key value (x coordinate) + * @param p_publicKeyX The new public key value (y coordinate) + * @param p_publicKeyCompressed The compressed public keys + * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @return true on success, false otherwise + */ + function f_generate_key_pair_nistp256( + out Oct32 p_privateKey, + out Oct32 p_publicKeyX, + out Oct32 p_publicKeyY, + out Oct32 p_publicKeyCompressed, + out integer p_compressed_mode + ) return boolean { + log(">>> f_generate_key_pair_nistp256"); + return fx_generateKeyPair_nistp256(p_privateKey, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressed_mode); + } + + /** + * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. + * This function should not be used by the ATS + * @param p_privateKey The new private key value + * @param p_publicKeyX The new public key value (x coordinate) + * @param p_publicKeyX The new public key value (y coordinate) + * @param p_publicKeyCompressed The compressed public keys + * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @return true on success, false otherwise + */ + function f_generate_key_pair_brainpoolp256r1( + out Oct32 p_privateKey, + out Oct32 p_publicKeyX, + out Oct32 p_publicKeyY, + out Oct32 p_publicKeyCompressed, + out integer p_compressed_mode + ) return boolean { + log(">>> f_generate_key_pair_brainpoolp256r1"); + return fx_generateKeyPair_brainpoolp256r1(p_privateKey, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressed_mode); + } + + /** + * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. + * This function should not be used by the ATS + * @param p_privateKey The new private key value + * @param p_publicKeyX The new public key value (x coordinate) + * @param p_publicKeyX The new public key value (y coordinate) + * @param p_publicKeyCompressed The compressed public keys + * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @return true on success, false otherwise + */ + function f_generate_key_pair_brainpoolp384r1( + out Oct48 p_privateKey, + out Oct48 p_publicKeyX, + out Oct48 p_publicKeyY, + out Oct48 p_publicKeyCompressed, + out integer p_compressed_mode + ) return boolean { + return fx_generateKeyPair_brainpoolp384r1(p_privateKey, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressed_mode); + } + + /** + * @desc Calculate digest over the certificate + * @param p_cert The certificate + * @return the HashedId8 value + * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.13 HashedId8 + */ + function f_calculateDigestFromCertificate( + in Certificate p_cert + ) return HashedId8 { + var octetstring v_hash; + + if (PICS_SEC_SHA256) { + v_hash := f_calculateDigestSha256FromCertificate(p_cert); + } if (PICS_SEC_SHA384) { + v_hash := f_calculateDigestSha384FromCertificate(p_cert); + } + + return substr(v_hash, lengthof(v_hash) - 8, 8); + } // End of function f_calculateDigestFromCertificate + + /** + * @desc Calculate digest over the certificate + * @param p_cert The certificate + * @return the HashedId8 value + * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.13 HashedId8 + */ + function f_calculateDigestSha256FromCertificate( + in EtsiTs103097Certificate p_cert + ) return HashedId8 { + var octetstring v_toBeHashedData; + var octetstring v_hash; + + v_toBeHashedData := bit2oct(encvalue(p_cert)); + v_hash := f_hashWithSha256(v_toBeHashedData); + return substr(v_hash, lengthof(v_hash) - 8, 8); + } // End of function f_calculateDigestSha256FromCertificate + + function f_calculateDigestSha384FromCertificate( + in EtsiTs103097Certificate p_cert + ) return HashedId8 { + var octetstring v_toBeHashedData; + var octetstring v_hash; + + v_toBeHashedData := bit2oct(encvalue(p_cert)); + v_hash := f_hashWithSha384(v_toBeHashedData); + return substr(v_hash, lengthof(v_hash) - 8, 8); + } // End of function f_calculateDigestSha384FromCertificate + + function f_duration2time( + in Duration p_duration + ) return UInt16 { + if (ischosen(p_duration.seconds)) { + return p_duration.seconds; + } else if (ischosen(p_duration.minutes)) { + return p_duration.minutes; + } else if (ischosen(p_duration.hours)) { + return p_duration.hours; + } else if (ischosen(p_duration.sixtyHours)) { + return p_duration.sixtyHours; + } else if (ischosen(p_duration.years)) { + return p_duration.years; + } + + return 0; // Unrechable code + } // End of function f_duration2time + + group hostSignatureHelpers { + + /** + * @desc Initialize [out] certificates according to the specified certificate name + * @param p_certificateName The certificate name to be used + * @param p_aaCertificate The AA certificate [out] + * @param p_atCertificate The AT certificate [out] + * @return true on succes, false otherwise + * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.13 HashedId8 + */ + function f_prepareCertificates( + in template (omit) charstring p_certificateName, + out EtsiTs103097Certificate p_aaCertificate, + out EtsiTs103097Certificate p_atCertificate + ) runs on ItsSecurityBaseComponent return boolean { + //log(">>> f_prepareCertificates: ", p_certificateName); + + // Load certificates if required + if ((lengthof(p_certificateName) > 0) and (valueof(p_certificateName) != cc_taCert_A)) { + var HashedId8 v_digest; + var charstring v_cert; + + if (f_readCertificate(valueof(p_certificateName), p_atCertificate) == false){ + log("f_prepareCertificates: Failed to read certificate ", p_certificateName); + return false; + } + if (ischosen(p_atCertificate.issuer.sha256AndDigest)) { + v_digest := p_atCertificate.issuer.sha256AndDigest; + } else if (ischosen(p_atCertificate.issuer.sha384AndDigest)) { + v_digest := p_atCertificate.issuer.sha384AndDigest; + } else { + log("f_prepareCertificates: Invalid certificate issuer ", p_atCertificate.issuer); + return false; + } + if (f_getCertificateFromDigest(v_digest, p_aaCertificate, v_cert) == false) { + log("f_prepareCertificates: Failed to read certificate issuer ", v_digest); + return false; + } + } else { + p_atCertificate := vc_atCertificate; + p_aaCertificate := vc_aaCertificate; + } + // Store the certificate to build this message + vc_lastAtCertificateUsed := p_atCertificate; + + return true; + } // End of function f_prepareCertificates + + /** + * @desc This function build and sign the SecureMessage part covered by the signature process + * @param p_securedMessage The signed SecureMessage part + * @param p_payloadField Payloads to be included in the message + * @param p_mandatoryHeaders Mandatory headers for the selected profile + * @param p_headerInfo HeaderInfo to be inserted in the message + * @param p_securityProfile Selected security profile + * @return true on success, false otherwise + */ + function f_buildGnSecuredMessage( + inout EtsiTs103097Data p_securedMessage, + in charstring p_certificateName, + in ToBeSignedData p_payloadField + ) runs on ItsSecurityBaseComponent return boolean { + + // Local variables + var octetstring v_secPayload, v_signature; + var ToBeSignedData v_toBeSignedData; + var octetstring v_certificateIssuer; + var octetstring v_privateKey; + + log(">>> f_buildGnSecuredMessage: p_securedMessage=", p_securedMessage); + log(">>> f_buildGnSecuredMessage: p_payloadField=", p_payloadField); + + // Prepare payload to be signed + v_toBeSignedData := valueof(p_payloadField); + v_secPayload := bit2oct(encvalue(v_toBeSignedData)); + log("f_buildGnSecuredMessage: v_secPayload=", v_secPayload); + + // Signed payload + if (ispresent(p_certificateName) and (valueof(p_certificateName) != cc_taCert_A)) { + if(not f_readSigningKey(valueof(p_certificateName), v_privateKey)){ + return false; + } + } else { + if(not f_readSigningKey(cc_taCert_A, v_privateKey)){ + return false; + } + } +// log("f_buildGnSecuredMessage: v_privateKey=", v_privateKey); + f_getCertificateHash(p_certificateName, v_certificateIssuer); + + if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature)) { + v_signature := f_signWithEcdsaNistp256WithSha256( + v_secPayload, + v_certificateIssuer, + v_privateKey + ); + p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaNistP256( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only(substr(v_signature, 0, 32)), + substr(v_signature, 32, 32) + ) + )); + } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { + v_signature := f_signWithEcdsaBrainpoolp256WithSha256( + v_secPayload, + v_certificateIssuer, + v_privateKey + ); + p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP256r1( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only(substr(v_signature, 0, 32)), + substr(v_signature, 32, 32) + ) + )); + } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature)) { + v_signature := f_signWithEcdsaBrainpoolp384WithSha384( + v_secPayload, + v_certificateIssuer, + v_privateKey + ); + p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP384r1( + m_ecdsaP384Signature( + m_eccP384CurvePoint_x_only(substr(v_signature, 0, 48)), + substr(v_signature, 48, 48) + ) + )); + } // TODO To be continued + +// log("<<< f_buildGnSecuredMessage: p_securedMessage=", p_securedMessage); + return true; + } // End of function f_buildGnSecuredMessage + + /** + * @desc This function build and sign the SecureMessage part covered by the signature process including wrong elements of protocols. It is used for BO test cases + * @param p_securedMessage The signed SecureMessage part + * @param p_certificateName The certificate name + * @param p_protocolVersion The protocol version to be set. Default: 2 + * @param p_trailerStatus The Traile behaviour: + *
  • 0 for no trailer
  • + *
  • 1 for invalid trailer
  • + *
  • 2 for duplicated trailer
  • + * @param p_payloadField Payloads to be included in the message + * @param p_mandatoryHeaders Mandatory headers for the selected profile + * @param p_headerInfo HeaderInfo to be inserted in the message + * @param p_securityProfile Selected security profile + * @return true on success, false otherwise + */ + function f_buildGnSecuredMessage_Bo( + inout EtsiTs103097Data p_securedMessage, + in template (value) charstring p_certificateName, + in UInt8 p_protocolVersion := c_protocol_version, + in integer p_trailerStatus := 0, + in template (value) ToBeSignedData p_payloadField, + in template (value) HeaderInfo p_mandatoryHeaders, + in template (omit) HeaderInfo p_headerInfo := omit + ) return boolean { + + // Local variables + var octetstring v_secPayload, v_signature; + var template (value) ToBeSignedData v_toBeSignedData; + var integer i, j, k, n; + var HeaderInfo v_headerFields; + var Ieee1609Dot2Content v_toBeSignedPayload; + var Oct32 v_privateKey; + var UInt8 v_trailerSize; + + // Prepare headers + if (not(ispresent(p_headerInfo))) { + v_headerFields := valueof(p_mandatoryHeaders); + } else {/* FIXME To be reviewed + // Merge p_headerInfo and v_mandatoryHeaders into v_headerFields + + i := 0; // index for p_headerInfo + j := 0; // index for v_mandatoryHeaders + k := 0; // index for v_headerFields + + // Special processing for signer_info + if (lengthof(valueof(p_headerInfo)) > 0 and valueof(p_headerInfo[i].type_) == e_signer_info) { + v_headerFields[k] := valueof(p_headerInfo[i]); + k := k + 1; + i := i + 1; + } + + for (j := j; j < lengthof(p_mandatoryHeaders); j := j + 1) { + // Search for mandatory header in p_HeaderFields + for (n := 0; n < lengthof(p_headerInfo); n := n + 1) { + if (valueof(p_headerInfo[n].type_) == valueof(p_mandatoryHeaders[j].type_)) { + // mandatory header already in p_HeaderFields + break; + } + } // End of 'for' statement + if (n >= lengthof(p_headerInfo)) { + if (valueof(p_mandatoryHeaders[j].type_) != e_signer_info) { + // Add headers from p_headerInfo having lower number than mandatory header + for (n := i; n < lengthof(p_headerInfo) and valueof(p_headerInfo[n].type_) < valueof(p_mandatoryHeaders[j].type_); n := n + 1) { + v_headerFields[k] := valueof(p_headerInfo[n]); + k := k + 1; + i := i + 1; + } + } + // Add mandatory header + v_headerFields[k] := valueof(p_mandatoryHeaders[j]); + k := k + 1; + } + } // End of 'for' statement + + // Add remaining headers from p_HeaderFields + for ( i := i; i < lengthof(p_headerInfo); i := i + 1) { + // Add headers from p_headerInfo having lower number than mandatory header + v_headerFields[k] := valueof(p_headerInfo[i]); + k := k + 1; + } // End of 'for' statement + */} + + // Prepare payload to be signed + /* FIXME To be reviewed v_toBeSignedPayload := valueof(p_payloadField); +// log("p_trailerStatus=", p_trailerStatus); + if (p_trailerStatus == 0) { + v_trailerSize := 0; + } else if (p_trailerStatus == 1) { + v_trailerSize := 67; + } else if (p_trailerStatus == 2) { + v_trailerSize := 2 * 67; + } else { + v_trailerSize := 67; + } + v_toBeSignedData := m_toBeSignedSecuredMessage_wrong_protocol( + v_headerFields, + v_toBeSignedPayload, + e_signature, + p_protocolVersion, + v_trailerSize + );*/ +// log("m_toBeSignedSecuredMessage_wrong_protocol=", v_toBeSignedData); + + /* FIXME To be reviewedv_secPayload := bit2oct(encvalue(v_toBeSignedData)); +// log("v_secPayload=", v_secPayload); + + // Signed payload + if (ispresent(p_certificateName) and (valueof(p_certificateName) != cc_taCert_A)) { + if(not f_readSigningKey(valueof(p_certificateName), v_privateKey)){ + return false; + } + } else { + if(not f_readSigningKey(cc_taCert_A, v_privateKey)){ + return false; + } + } + v_signature := f_signWithEcdsaNistp256WithSha256( + v_secPayload, + v_privateKey + );*/ +// log("v_signature=", v_signature); + +// log("p_trailerStatus=", p_trailerStatus); + /* FIXME To be reviewed if (p_trailerStatus == 0) { // No signature + p_securedMessage := m_securedMessage( + valueof(v_toBeSignedData.header_fields), + p_payloadField, + { } + ); + v_trailerSize := 0; + } else if (p_trailerStatus == 2) { // Duplicate signature + p_securedMessage := m_securedMessage( + valueof(v_toBeSignedData.header_fields), + p_payloadField, + { + m_trailer_field_signature( + m_signature( + m_ecdsaSignature( + m_eccPointecdsa_nistp256_with_sha256_y_coordinate_only( + substr(v_signature, 2, 32) + ), + substr(v_signature, 34, 32) + ) + ) + ), + m_trailer_field_signature( + m_signature( + m_ecdsaSignature( + m_eccPointecdsa_nistp256_with_sha256_y_coordinate_only( + substr(v_signature, 2, 32) + ), + substr(v_signature, 34, 32) + ) + ) + ) + } + ); + } else if (p_trailerStatus == 3) { // Signature with reserved algorthm + p_securedMessage := m_ieee1609Dot2Data_wrong_protocol( + p_protocolVersion, + valueof(v_toBeSignedData.header_fields), + p_payloadField, + { + m_trailer_field_signature( + m_unknownSignature( + v_signature + ) + ) + } + ); + } else { // Invalid signature + p_securedMessage := m_securedMessage( + valueof(v_toBeSignedData.header_fields), + p_payloadField, + { + m_trailer_field_signature( + m_signature( + m_ecdsaSignature( + m_eccPointecdsa_nistp256_with_sha256_y_coordinate_only( + substr(v_signature, 2, 32) + ), + substr(v_signature, 34, 32) + ) + ) + ) + } + ); + p_securedMessage.trailer_fields[0].trailerField.signature_.ecdsaNistP256Signature.sSig := not4b(valueof(p_securedMessage.trailer_fields[0].trailerField.signature_.ecdsaNistP256Signature.sSig)); + }*/ + + return false;/* FIXME To be reviewed true;*/ + } // End of function f_buildGnSecuredMessage_Bo + + /** + * @desc This function build and sign the SecureMessage part covered by the signature process + * @param p_securedMessage The signed SecureMessage part + * @param p_payloadField Payloads to be included in the message + * @param p_signerIdentifierType Add digest or AT certificate or certificate chain + * @param p_certificateName The certificate identifier to be used. Default: TA_CERT_A + * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerInfo + * @return true on success, false otherwise + * + * @see Draft ETSI TS 103 097 V1.1.14 Clause 7.1 Security profile for CAMs + */ + function f_buildGnSecuredCam( + out EtsiTs103097Data p_securedMessage, + in ToBeSignedData p_payloadField, + in SignerIdentifier p_signerIdentifierType, + in charstring p_certificateName := ""/*, + in boolean p_addMissingHeaders := true*/ + ) runs on ItsSecurityBaseComponent return boolean { + // Local variables + var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; + + log(">>> f_buildGnSecuredCam: p_securedMessage= ", p_securedMessage); + log(">>> f_buildGnSecuredCam: p_payloadField= ", p_payloadField); + + // Load certificates if required + if (f_prepareCertificates(p_certificateName, v_aaCertificate, v_atCertificate) == false) { + return false; + } + //log("f_buildGnSecuredCam: v_atCertificate = ", v_atCertificate); + + // Fill the structure with default values, these values will be updated later + p_securedMessage := valueof(m_etsiTs103097Data_signed( + m_signedData( + sha256, + p_payloadField, + m_signerIdentifier_self, + m_signature_ecdsaNistP256( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only(int2oct(0, 32)), + int2oct(0, 32) + ) + ) + ) + )); + // Prepare mandatory headers + //log("f_buildGnSecuredCam: p_signerIdentifierType=", p_signerIdentifierType); + if (ischosen(p_signerIdentifierType.certificate)) { // Add the AT certificate + log("*** " & testcasename() & "f_buildGnSecuredCam: TODO ***"); + stop; + /* TODO + * v_signerInfo := valueof( + m_header_info_signer_info( + m_signerIdentifier_certificate( + v_atCertificate + ))); + } else if (valueof(p_signerIdentifierType) == e_certificate_chain) { // Add the AT certificate + AA EtsiTs103097Certificate + v_signerInfo := valueof( + m_header_info_signer_info( + m_signerIdentifier_certificates( + { + v_aaCertificate, + v_atCertificate + } + ) + ));*/ + } else if (ischosen(p_signerIdentifierType.digest)) { // Add the AT certificate digest + if (ischosen(v_atCertificate.issuer.sha256AndDigest)) { + p_securedMessage.content.signedData.hashId := sha256; + p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_digest( + f_calculateDigestSha256FromCertificate(v_atCertificate) + )); + } else if (ischosen(v_atCertificate.issuer.sha384AndDigest)) { + p_securedMessage.content.signedData.hashId := sha384; + p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_digest( + f_calculateDigestSha384FromCertificate(v_atCertificate) + )); + } + } else { + log("*** " & testcasename() & "f_buildGnSecuredCam: TODO ***"); + stop; + } + if (ispresent(v_atCertificate.signature_)) { + if (ischosen(v_atCertificate.signature_.ecdsaBrainpoolP256r1Signature)) { + p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP256r1( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only(int2oct(0, 32)), + int2oct(0, 32) + ) + )); + } else if (ischosen(v_atCertificate.signature_.ecdsaBrainpoolP384r1Signature)) { + p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP384r1( + m_ecdsaP384Signature( + m_eccP384CurvePoint_x_only(int2oct(0, 48)), + int2oct(0, 48) + ) + )); + } // else, m_signature_ecdsaNistP256 already chosen by default + } + //log("f_buildGnSecuredCam: p_securedMessage = ", p_securedMessage); + + return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField/*, v_mandatoryHeaders*/); + + } // End of function f_buildGnSecuredCam + + /** + * @desc This function build and sign the SecureMessage part covered by the signature process including wrong elements of protocols. It is used for BO test cases + * @param p_securedMessage The signed SecureMessage part + * @param p_protocolVersion The protocol version to be set. Default: 2 + * @param p_trailerStatus The Traile behaviour: + *
  • 0 for no trailer
  • + *
  • 1 for invalid trailer
  • + *
  • 2 for duplicated trailer
  • + * @param p_payloadField Payloads to be included in the message + * @param p_signerIdentifierType Add digest or AT certificate or certificate chain + * @param p_threeDLocation The 3D location + * @param p_headerInfo HeaderInfo to be inserted in the message + * @param p_certificateName The certificate identifier to be used. Default: TA_CERT_A + * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerInfo + * @param p_alterATCertificateSignature Set to true to alter the AT certificate signature + * @param p_alterAACertificateSignature Set to true to alter the AA certificate signature + * @return true on success, false otherwise + * + * @see Draft ETSI TS 103 097 V1.1.14 Clause 7.1 Security profile for CAMs + */ + function f_buildGnSecuredCam_Bo( + inout EtsiTs103097Data p_securedMessage, + in UInt8 p_protocolVersion := c_protocol_version, + in integer p_trailerStatus := 0, + in ToBeSignedData p_payloadField, + in SignerIdentifier p_signerIdentifierType, // FIXME To be reviewed + in template (omit) HeaderInfo p_headerInfo := omit, + in charstring p_certificateName := "", + in boolean p_addMissingHeaders := true, + in boolean p_alterATCertificateSignature := false, + in boolean p_alterAACertificateSignature := false + ) runs on ItsSecurityBaseComponent return boolean { + + // Local variables + var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; + var HeaderInfo v_mandatoryHeaders := valueof(m_ieee1609Dot2_headerInfo(0)); + var HeaderInfo v_signerInfo; + + // Load certificates if required + if (f_prepareCertificates(p_certificateName, v_aaCertificate, v_atCertificate) == false) { + return false; + } + + if (p_alterATCertificateSignature == true) { + v_atCertificate.signature_.ecdsaNistP256Signature.sSig := not4b(v_atCertificate.signature_.ecdsaNistP256Signature.sSig); + } + + if (p_alterAACertificateSignature == true) { + v_aaCertificate.signature_.ecdsaNistP256Signature.sSig := not4b(v_aaCertificate.signature_.ecdsaNistP256Signature.sSig); + } + + /* FIXME To be reviewed if (p_addMissingHeaders == true) { + // Prepare mandatory headers + if (valueof(p_signerIdentifierType) == e_certificate) { // Add the AT certificate + v_signerInfo := valueof( + m_header_info_signer_info( + m_signerIdentifier_certificate( + v_atCertificate + ))); + } else if (valueof(p_signerIdentifierType) == e_certificate_chain) { // Add the AT certificate + AA EtsiTs103097Certificate + v_signerInfo := valueof( + m_header_info_signer_info( + m_signerIdentifier_certificates( + { + v_aaCertificate, + v_atCertificate + } + ) + )); + } else if (valueof(p_signerIdentifierType) == e_certificate_digest_with_sha256) { // Add the AT certificate digest + v_signerInfo := valueof( + m_header_info_signer_info( + m_issuerIdentifier_sha256AndDigest( + f_calculateDigestFromCertificate(v_atCertificate) + ))); + } + v_mandatoryHeaders := { + v_signerInfo, + valueof(m_header_info_generation_time(1000 * f_getCurrentTime())), // In us + valueof(m_header_info_its_aid(c_its_aid_CAM)) + } + }*/ + + return f_buildGnSecuredMessage_Bo(p_securedMessage, p_certificateName, p_protocolVersion, p_trailerStatus, p_payloadField, v_mandatoryHeaders, p_headerInfo); + + } // End of function f_buildGnSecuredCam_Bo + + /** + * @desc This function build and sign the SecureMessage part covered by the signature process + * @param p_securedMessage The signed SecureMessage part + * @param p_payloadField Payloads to be included in the message + * @param p_signerIdentifierType Add digest or AT certificate or certificate chain + * @param p_threeDLocation The 3D location + * @param p_headerInfo HeaderInfo to be inserted in the message + * @param p_certificateName The certificate identifier to be used. Default: TA_CERT_A + * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerInfo + * @return true on success, false otherwise + */ + function f_buildGnSecuredDenm( + inout EtsiTs103097Data p_securedMessage, + in ToBeSignedData p_payloadField, + in SignerIdentifier p_signerIdentifierType, + in ThreeDLocation p_threeDLocation, + in template (omit) HeaderInfo p_headerInfo := omit, + in charstring p_certificateName := "", + in boolean p_addMissingHeaders := true + ) runs on ItsSecurityBaseComponent return boolean { + + // Local variables + var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; + var HeaderInfo v_mandatoryHeaders := valueof(m_ieee1609Dot2_headerInfo(0)); + var HeaderInfo v_signerInfo; + + // Load certificates if required + if (f_prepareCertificates(p_certificateName, v_aaCertificate, v_atCertificate) == false) { + return false; + } + + // Add additional headers if required + /* FIXME To be reviewed if (p_addMissingHeaders == true) { + // Prepare mandatory headers + if (valueof(p_signerIdentifierType) == e_certificate) { // Add the AT certificate + v_signerInfo := valueof( + m_header_info_signer_info( + m_signerIdentifier_certificate( + v_atCertificate + ))); + } else if (valueof(p_signerIdentifierType) == e_certificate_chain) { // Add the AT certificate + AA EtsiTs103097Certificate + v_signerInfo := valueof( + m_header_info_signer_info( + m_signerIdentifier_certificates( + { + v_aaCertificate, + v_atCertificate + } + ) + )); + } else if (valueof(p_signerIdentifierType) == e_certificate_digest_with_sha256) { // Add the AT certificate digest + v_signerInfo := valueof( + m_header_info_signer_info( + m_issuerIdentifier_sha256AndDigest( + v_atCertificate.cracaId + ))); + } + v_mandatoryHeaders := { + v_signerInfo, + valueof(m_header_info_generation_time(1000 * f_getCurrentTime())), // In us + valueof(m_header_info_generation_location(p_threeDLocation)), + valueof(m_header_info_its_aid(c_its_aid_DENM)) + } + }*/ + + // Build the secured message and return it + return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField/*, v_mandatoryHeaders*/); + + } // End of function f_buildGnSecuredDenm + + /** + * @desc This function build and sign the SecureMessage part covered by the signature process including wrong elements of protocols. It is used for BO test cases + * @param p_securedMessage The signed SecureMessage part + * @param p_protocolVersion The protocol version to be set. Default: 2 + * @param p_trailerStatus The Traile behaviour: + *
  • 0 for no trailer
  • + *
  • 1 for invalid trailer
  • + *
  • 2 for duplicated trailer
  • + * @param p_payloadField Payloads to be included in the message + * @param p_signerIdentifierType Add digest or AT certificate or certificate chain + * @param p_threeDLocation The 3D location + * @param p_headerInfo HeaderInfo to be inserted in the message + * @param p_certificateName The certificate identifier to be used. Default: TA_CERT_A + * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerInfo + * @return true on success, false otherwise + */ + function f_buildGnSecuredDenm_Bo( + inout EtsiTs103097Data p_securedMessage, + in UInt8 p_protocolVersion := c_protocol_version, + in integer p_trailerStatus := 0, + in ToBeSignedData p_payloadField, + in SignerIdentifier p_signerIdentifierType, // FIXME To be reviewed + in ThreeDLocation p_threeDLocation, + in template (omit) HeaderInfo p_headerInfo := omit, + in charstring p_certificateName := "", + in boolean p_addMissingHeaders := true + ) runs on ItsSecurityBaseComponent return boolean { + + // Local variables + var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; + var HeaderInfo v_mandatoryHeaders := valueof(m_ieee1609Dot2_headerInfo(0)); + var HeaderInfo v_signerInfo; + + // Load certificates if required + if (f_prepareCertificates(p_certificateName, v_aaCertificate, v_atCertificate) == false) { + return false; + } + + // Add additional headers if required + /* FIXME To be reviewed if (p_addMissingHeaders == true) { + // Prepare mandatory headers + if (valueof(p_signerIdentifierType) == e_certificate) { // Add the AT certificate + v_signerInfo := valueof( + m_header_info_signer_info( + m_signerIdentifier_certificate( + v_atCertificate + ))); + } else if (valueof(p_signerIdentifierType) == e_certificate_chain) { // Add the AT certificate + AA EtsiTs103097Certificate + v_signerInfo := valueof( + m_header_info_signer_info( + m_signerIdentifier_certificates( + { + v_aaCertificate, + v_atCertificate + } + ) + )); + } else if (valueof(p_signerIdentifierType) == e_certificate_digest_with_sha256) { // Add the AT certificate digest + v_signerInfo := valueof( + m_header_info_signer_info( + m_issuerIdentifier_sha256AndDigest( + v_atCertificate.cracaId + ))); + } + v_mandatoryHeaders := { + v_signerInfo, + valueof(m_header_info_generation_time(1000 * f_getCurrentTime())), // In us + valueof(m_header_info_generation_location(p_threeDLocation)), + valueof(m_header_info_its_aid(c_its_aid_DENM)) + } + }*/ + + // Build the secured message and return it + return f_buildGnSecuredMessage_Bo(p_securedMessage, p_certificateName, p_protocolVersion, p_trailerStatus, p_payloadField, v_mandatoryHeaders, p_headerInfo); + + } // End of function f_buildGnSecuredDenm_Bo + + /** + * @desc This function build and sign the SecureMessage part covered by the signature process + * @param p_securedMessage The signed SecureMessage part + * @param p_payloadField Payloads to be included in the message + * @param p_signerIdentifierType Add digest or AT certificate or certificate chain + * @param p_threeDLocation The 3D location + * @param p_headerInfo HeaderInfo to be inserted in the message + * @param p_certificateName The certificate identifier to be used. Default: TA_CERT_A + * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerInfo + * @return true on success, false otherwise + */ + function f_buildGnSecuredOtherMessage( + inout EtsiTs103097Data p_securedMessage, + in ToBeSignedData p_payloadField, + in SignerIdentifier p_signerIdentifierType, // FIXME To be reviewed + in ThreeDLocation p_threeDLocation, + in template (omit) HeaderInfo p_headerInfo := omit, + in charstring p_certificateName := "", + in boolean p_addMissingHeaders := true + ) runs on ItsSecurityBaseComponent return boolean { + + // Local variables + var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; + var HeaderInfo v_mandatoryHeaders := valueof(m_ieee1609Dot2_headerInfo(0)); + var HeaderInfo v_signerInfo; + + // Load certificates if required + if (f_prepareCertificates(p_certificateName, v_aaCertificate, v_atCertificate) == false) { + return false; + } + + // Add additional headers if required + /* FIXME To be reviewed if (p_addMissingHeaders == true) { + // Prepare mandatory headers + if (valueof(p_signerIdentifierType) == e_certificate) { // Add the AT certificate + v_signerInfo := valueof( + m_header_info_signer_info( + m_signerIdentifier_certificate( + v_atCertificate + ))); + } else if (valueof(p_signerIdentifierType) == e_certificate_chain) { // Add the AT certificate + AA EtsiTs103097Certificate + v_signerInfo := valueof( + m_header_info_signer_info( + m_signerIdentifier_certificates( + { + v_aaCertificate, + v_atCertificate + } + ) + )); + } else if (valueof(p_signerIdentifierType) == e_certificate_digest_with_sha256) { // Add the AT certificate digest + v_signerInfo := valueof( + m_header_info_signer_info( + m_issuerIdentifier_sha256AndDigest( + v_atCertificate.cracaId + ))); + } + v_mandatoryHeaders := { + v_signerInfo, + valueof(m_header_info_generation_time(1000 * f_getCurrentTime())), // In us + valueof(m_header_info_generation_location(p_threeDLocation)) + } + }*/ + + // Build the secured message and return it + return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField/*, v_mandatoryHeaders*/); + } // End of function f_buildGnSecuredOtherMessage + + /** + * @desc This function build and sign the SecureMessage part covered by the signature process including wrong elements of protocols. It is used for BO test cases + * @param p_securedMessage The signed SecureMessage part + * @param p_protocolVersion The protocol version to be set. Default: 2 + * @param p_trailerStatus The Traile behaviour: + *
  • 0 for no trailer
  • + *
  • 1 for invalid trailer
  • + *
  • 2 for duplicated trailer
  • + * @param p_payloadField Payloads to be included in the message + * @param p_signerIdentifierType Add digest or AT certificate or certificate chain + * @param p_threeDLocation The 3D location + * @param p_headerInfo HeaderInfo to be inserted in the message + * @param p_certificateName The certificate identifier to be used. Default: TA_CERT_A + * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerInfo + * @return true on success, false otherwise + */ + function f_buildGnSecuredOtherMessage_Bo( + inout EtsiTs103097Data p_securedMessage, + in UInt8 p_protocolVersion := c_protocol_version, + in integer p_trailerStatus := 0, + in ToBeSignedData p_payloadField, + in SignerIdentifier p_signerIdentifierType, // FIXME To be reviewed + in ThreeDLocation p_threeDLocation, + in template (omit) HeaderInfo p_headerInfo := omit, + in charstring p_certificateName := "", + in boolean p_addMissingHeaders := true + ) runs on ItsSecurityBaseComponent return boolean { + + // Local variables + var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; + var HeaderInfo v_mandatoryHeaders := valueof(m_ieee1609Dot2_headerInfo(0)); + var HeaderInfo v_signerInfo; + + // Load certificates if required + if (f_prepareCertificates(p_certificateName, v_aaCertificate, v_atCertificate) == false) { + return false; + } + + // Add additional headers if required + /* FIXME To be reviewed if (p_addMissingHeaders == true) { + // Prepare mandatory headers + if (valueof(p_signerIdentifierType) == e_certificate) { // Add the AT certificate + v_signerInfo := valueof( + m_header_info_signer_info( + m_signerIdentifier_certificate( + v_atCertificate + ))); + } else if (valueof(p_signerIdentifierType) == e_certificate_chain) { // Add the AT certificate + AA EtsiTs103097Certificate + v_signerInfo := valueof( + m_header_info_signer_info( + m_signerIdentifier_certificates( + { + v_aaCertificate, + v_atCertificate + } + ) + )); + } else if (valueof(p_signerIdentifierType) == e_certificate_digest_with_sha256) { // Add the AT certificate digest + v_signerInfo := valueof( + m_header_info_signer_info( + m_issuerIdentifier_sha256AndDigest( + v_atCertificate.cracaId + ))); + } + v_mandatoryHeaders := { + v_signerInfo, + valueof(m_header_info_generation_time(1000 * f_getCurrentTime())), // In us + valueof(m_header_info_generation_location(p_threeDLocation)) + } + }*/ + + // FIXME To be done + + // Build the secured message and return it + return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField/*, v_mandatoryHeaders*/); + } // End of function f_buildGnSecuredOtherMessage_Bo + + } // End of group hostSignatureHelpers + + group deviceSignatureHelpers { + + /** + * @desc Retrieve the HashedId8 to be sent to the IUT, based on the provided certificate identifier + * @param p_certificateName The certificate the IUT shall use + * @return The HashedId8 to be sent to the IUT in the UtInitialize command + * @verdict Unchanged + * @remark Component variable vc_hashedId8ToBeUsed shall be set with the IUT certificate to be used + */ + function f_setupIutCertificate( + in charstring p_certificateName + ) runs on ItsSecurityBaseComponent return HashedId8 { + // Local variables + var HashedId8 v_hashedId8 := '0000000000000000'O; + + // Sanity check + if (lengthof(p_certificateName) == 0) { + return v_hashedId8; + } + + // Load certificates + if(f_getCertificateDigest(p_certificateName, v_hashedId8) == false) { + v_hashedId8 := '0000000000000000'O; + } + + return v_hashedId8; + } // End of function f_setupIutCertificate + + /** + * @desc Verify the signature of the provided certificate + * @param p_certificateToBeVerified EtsiTs103097Certificate to be verified + * @param p_publicKey Public key to verify the certificate signature + * @return true on success, false otherwise + * @verdict + */ + function f_verifyCertificateSignatureWithPublicKey( + in template (value) EtsiTs103097Certificate p_certificateToBeVerified, + in template (value) PublicVerificationKey p_publicVerificationKey + ) return boolean { + var ToBeSignedCertificate v_toBeSignedCertificate; + var octetstring v_enc_msg; + var octetstring v_signature; + var octetstring v_issuer; + + log(">>> f_verifyCertificateSignatureWithPublicKey: p_certificateToBeVerified=", p_certificateToBeVerified); + log(">>> f_verifyCertificateSignatureWithPublicKey: p_publicVerificationKey=", p_publicVerificationKey); + + // Create ToBeSignedCertificate payload to be signed + v_toBeSignedCertificate := valueof(p_certificateToBeVerified.toBeSigned); + log("f_verifyCertificateSignatureWithPublicKey: v_toBeSignedCertificate=", v_toBeSignedCertificate); + + v_enc_msg := bit2oct(encvalue(v_toBeSignedCertificate)); + log("f_verifyCertificateSignatureWithPublicKey: v_enc_msg=", v_enc_msg); + + // Verify payload + if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1)) { + if (ischosen(p_certificateToBeVerified.issuer.self_)) { + v_issuer := int2oct(0, 32); + } else { + var charstring v_certificate; + + if (fx_readCertificateFromDigest(valueof(p_certificateToBeVerified.issuer.sha256AndDigest), v_certificate) == false) { + log("f_verifyCertificateSignatureWithPublicKey: Invalid issuer: ", p_certificateToBeVerified.issuer.sha256AndDigest); + return false; + } + if (f_getCertificateHash(v_certificate, v_issuer) == false) { + log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate: " & v_certificate); + return false; + } + } + v_signature := valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only) & valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP256r1Signature.sSig); + log("f_verifyCertificateSignatureWithPublicKey: v_signedData=", v_signature); + if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1.uncompressedP256)) { + return f_verifyWithEcdsaBrainpoolp256WithSha256_1( + v_enc_msg, + v_issuer, + v_signature, + valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.uncompressedP256.x), + valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.uncompressedP256.y) + ); + } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1.compressed_y_0)) { + return f_verifyWithEcdsaBrainpoolp256WithSha256( + v_enc_msg, + v_issuer, + v_signature, + valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.compressed_y_0), + 0 // Latest bit of the Y-coordinate is 0 + ); + } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1.compressed_y_1)) { + return f_verifyWithEcdsaBrainpoolp256WithSha256( + v_enc_msg, + v_issuer, + v_signature, + valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.compressed_y_1), + 1 // Latest bit of the Y-coordinate is 1 + ); + } else { + log("f_verifyCertificateSignatureWithPublicKey: Unknown PublicVerificationKey value"); + return false; + } + } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1)) { + if (ischosen(p_certificateToBeVerified.issuer.self_)) { + v_issuer := int2oct(0, 48); + } else { + var charstring v_certificate; + + if (fx_readCertificateFromDigest(valueof(p_certificateToBeVerified.issuer.sha384AndDigest), v_certificate) == false) { + log("f_verifyCertificateSignatureWithPublicKey: Invalid issuer: ", p_certificateToBeVerified.issuer.sha384AndDigest); + return false; + } + if (f_getCertificateHash(v_certificate, v_issuer) == false) { + log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate: " & v_certificate); + return false; + } + } + v_signature := valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only) & valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP384r1Signature.sSig); + log("f_verifyCertificateSignatureWithPublicKey: v_signedData=", v_signature); + if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1.uncompressedP384)) { + return f_verifyWithEcdsaBrainpoolp384WithSha384_1( + v_enc_msg, + v_issuer, + v_signature, + valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.uncompressedP384.x), + valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.uncompressedP384.y) + ); + } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1.compressed_y_0)) { + return f_verifyWithEcdsaBrainpoolp384WithSha384( + v_enc_msg, + v_issuer, + v_signature, + valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.compressed_y_0), + 0 // Latest bit of the Y-coordinate is 0 + ); + } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1.compressed_y_1)) { + return f_verifyWithEcdsaBrainpoolp384WithSha384( + v_enc_msg, + v_issuer, + v_signature, + valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.compressed_y_1), + 1 // Latest bit of the Y-coordinate is 1 + ); + } else { + log("f_verifyCertificateSignatureWithPublicKey: Unknown PublicVerificationKey value"); + return false; + } + } else if (ischosen(p_publicVerificationKey.ecdsaNistP256)) { + if (ischosen(p_certificateToBeVerified.issuer.self_)) { + v_issuer := int2oct(0, 32); + } else { + var charstring v_certificate; + + if (fx_readCertificateFromDigest(valueof(p_certificateToBeVerified.issuer.sha256AndDigest), v_certificate) == false) { + log("f_verifyCertificateSignatureWithPublicKey: Invalid issuer: ", p_certificateToBeVerified.issuer.sha256AndDigest); + return false; + } + if (f_getCertificateHash(v_certificate, v_issuer) == false) { + log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate: " & v_certificate); + return false; + } + } + v_signature := valueof(p_certificateToBeVerified.signature_.ecdsaNistP256Signature.rSig.x_only) & valueof(p_certificateToBeVerified.signature_.ecdsaNistP256Signature.sSig); + log("f_verifyCertificateSignatureWithPublicKey: v_signedData=", v_signature); + if (ischosen(p_publicVerificationKey.ecdsaNistP256.uncompressedP256)) { + return f_verifyWithEcdsaNistp256WithSha256_1( + v_enc_msg, + v_issuer, + v_signature, + valueof(p_publicVerificationKey.ecdsaNistP256.uncompressedP256.x), + valueof(p_publicVerificationKey.ecdsaNistP256.uncompressedP256.y) + ); + } else if (ischosen(p_publicVerificationKey.ecdsaNistP256.compressed_y_0)) { + return f_verifyWithEcdsaNistp256WithSha256( + v_enc_msg, + v_issuer, + v_signature, + valueof(p_publicVerificationKey.ecdsaNistP256.compressed_y_0), + 0 // Latest bit of the Y-coordinate is 0 + ); + } else if (ischosen(p_publicVerificationKey.ecdsaNistP256.compressed_y_1)) { + return f_verifyWithEcdsaNistp256WithSha256( + v_enc_msg, + v_issuer, + v_signature, + valueof(p_publicVerificationKey.ecdsaNistP256.compressed_y_1), + 1 // Latest bit of the Y-coordinate is 1 + ); + } else { + log("f_verifyCertificateSignatureWithPublicKey: Unknown PublicVerificationKey value"); + return false; + } + } + + return false; + } // End of finction f_verifyCertificateSignatureWithPublicKey + + /** + * @desc Verify the signature of the provided secured message + * @param p_certificateToBeVerified EtsiTs103097Certificate to be verified + * @param p_issuingCertificate Issuing certificate + * @return true on success, false otherwise + * @verdict + */ + function f_verifyCertificateSignatureWithIssuingCertificate( + in template (value) EtsiTs103097Certificate p_certificateToBeVerified, + in template (value) EtsiTs103097Certificate p_issuingCertificate + ) return boolean { + + // Sanity checks + if (not(ischosen(p_issuingCertificate.toBeSigned.verifyKeyIndicator.verificationKey))) { + return false; + } + return f_verifyCertificateSignatureWithPublicKey( + p_certificateToBeVerified, + p_issuingCertificate.toBeSigned.verifyKeyIndicator.verificationKey + ); + } // End of function f_verifyCertificateSignatureWithIssuingCertificate + + /** + * @desc Verify the signature of the provided secured message for ECDSA Nist-P256 algorithm + * @param p_securedMessage The message to be verified + * @param p_publicKey The ECDSA public key to verify a signature + * @param p_certificate EtsiTs103097Certificate to be used to verify the message + * @return true on success, false otherwise + * @verdict Unchanged + */ + function f_verifyGnSecuredMessageSignature_ecdsaNistP256( + in template (value) Ieee1609Dot2Data p_securedMessage, + in template (value) Oct32 p_certificateIssuer, + in template (value) EccP256CurvePoint p_publicKey + ) return boolean { + + // Local variables + var octetstring v_secPayload; + var octetstring v_signedData; + var boolean v_result := false; + var template (value) ToBeSignedData v_toBeSignedData; + + log(">>> f_verifyGnSecuredMessageSignature_ecdsaNistP256: p_securedMessage= ", p_securedMessage); + log(">>> f_verifyGnSecuredMessageSignature_ecdsaNistP256: p_certificateIssuer= ", p_certificateIssuer); + log(">>> f_verifyGnSecuredMessageSignature_ecdsaNistP256: p_publicKey= ", p_publicKey); + + // Create Ieee1609Dot2Data payload to be signed + v_toBeSignedData := valueof(p_securedMessage.content.signedData.tbsData); + log("f_verifyGnSecuredMessageSignature_ecdsaNistP256: v_toBeSignedData=", p_securedMessage.content.signedData.tbsData); + + v_secPayload := bit2oct(encvalue(v_toBeSignedData)); + log("f_verifyGnSecuredMessageSignature_ecdsaNistP256: v_secPayload=", v_secPayload); + + // Verify payload + + // TODO Check in standard if x-only only + if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig.x_only)) { + v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig.x_only) & valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig); + } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig.compressed_y_0)) { + v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig.compressed_y_0) & valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig); + } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig.compressed_y_1)) { + v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig.compressed_y_1) & valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig); + } + log("f_verifyGnSecuredMessageSignature_ecdsaNistP256: v_signedData=", v_signedData); + if (ischosen(p_publicKey.uncompressedP256)) { + v_result := f_verifyWithEcdsaNistp256WithSha256_1( + v_secPayload, + valueof(p_certificateIssuer), + v_signedData, + valueof(p_publicKey.uncompressedP256.x), + valueof(p_publicKey.uncompressedP256.y) + ); + } else if (ischosen(p_publicKey.compressed_y_0)) { + v_result := f_verifyWithEcdsaNistp256WithSha256( + v_secPayload, + valueof(p_certificateIssuer), + v_signedData, + valueof(p_publicKey.compressed_y_0), + 0 + ); + } else if (ischosen(p_publicKey.compressed_y_1)) { + v_result := f_verifyWithEcdsaNistp256WithSha256( + v_secPayload, + valueof(p_certificateIssuer), + v_signedData, + valueof(p_publicKey.compressed_y_1), + 1 + ); + } + + log("f_verifyGnSecuredMessageSignature_ecdsaNistP256: v_result=", v_result); + return v_result; + } // End of function f_verifyGnSecuredMessageSignature_ecdsaNistP256 + + /** + * @desc Verify the signature of the provided secured message for ECDSA Brainpool-P256 algorithm + * @param p_securedMessage The message to be verified + * @param p_publicKey The ECDSA public key to verify a signature + * @param p_certificate EtsiTs103097Certificate to be used to verify the message + * @return true on success, false otherwise + * @verdict Unchanged + */ + function f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1( + in template (value) Ieee1609Dot2Data p_securedMessage, + in template (value) Oct32 p_certificateIssuer, + in template (value) EccP256CurvePoint p_publicKey + ) return boolean { + + // Local variables + var octetstring v_secPayload; + var octetstring v_signedData; + var boolean v_result := false; + var template (value) ToBeSignedData v_toBeSignedData; + + log(">>> f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: p_securedMessage= ", p_securedMessage); + log(">>> f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: p_certificateIssuer= ", p_certificateIssuer); + log(">>> f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: p_publicKey= ", p_publicKey); + + // Create Ieee1609Dot2Data payload to be signed + v_toBeSignedData := valueof(p_securedMessage.content.signedData.tbsData); + log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: v_toBeSignedData=", p_securedMessage.content.signedData.tbsData); + + v_secPayload := bit2oct(encvalue(v_toBeSignedData)); + log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: v_secPayload=", v_secPayload); + + // Verify payload + v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only) & valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig); + log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: v_signedData=", v_signedData); + if (ischosen(p_publicKey.uncompressedP256)) { + v_result := f_verifyWithEcdsaBrainpoolp256WithSha256_1( + v_secPayload, + valueof(p_certificateIssuer), + v_signedData, + valueof(p_publicKey.uncompressedP256.x), + valueof(p_publicKey.uncompressedP256.y) + ); + } else if (ischosen(p_publicKey.compressed_y_0)) { + v_result := f_verifyWithEcdsaBrainpoolp256WithSha256( + v_secPayload, + valueof(p_certificateIssuer), + v_signedData, + valueof(p_publicKey.compressed_y_0), + 0 + ); + } else if (ischosen(p_publicKey.compressed_y_1)) { + v_result := f_verifyWithEcdsaBrainpoolp256WithSha256( + v_secPayload, + valueof(p_certificateIssuer), + v_signedData, + valueof(p_publicKey.compressed_y_1), + 1 + ); + } + + log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: v_result=", v_result); + return v_result; + } // End of function f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1 + + /** + * @desc Verify the signature of the provided secured message for ECDSA Brainpool-P384 algorithm + * @param p_securedMessage The message to be verified + * @param p_publicKey The ECDSA public key to verify a signature + * @param p_certificate EtsiTs103097Certificate to be used to verify the message + * @return true on success, false otherwise + * @verdict Unchanged + */ + function f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1( + in template (value) Ieee1609Dot2Data p_securedMessage, + in template (value) Oct48 p_certificateIssuer, + in template (value) EccP384CurvePoint p_publicKey + ) return boolean { + + // Local variables + var octetstring v_secPayload; + var octetstring v_signedData; + var boolean v_result := false; + var template (value) ToBeSignedData v_toBeSignedData; + + log(">>> f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: p_securedMessage= ", p_securedMessage); + log(">>> f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: p_certificateIssuer= ", p_certificateIssuer); + log(">>> f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: p_publicKey= ", p_publicKey); + + // Create Ieee1609Dot2Data payload to be signed + v_toBeSignedData := valueof(p_securedMessage.content.signedData.tbsData); + log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: v_toBeSignedData=", p_securedMessage.content.signedData.tbsData); + + v_secPayload := bit2oct(encvalue(v_toBeSignedData)); + log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: v_secPayload=", v_secPayload); + + // Verify payload + v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only) & valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig); + log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: v_signedData=", v_signedData); + if (ischosen(p_publicKey.uncompressedP384)) { + v_result := f_verifyWithEcdsaBrainpoolp384WithSha384_1( + v_secPayload, + valueof(p_certificateIssuer), + v_signedData, + valueof(p_publicKey.uncompressedP384.x), + valueof(p_publicKey.uncompressedP384.y) + ); + } else if (ischosen(p_publicKey.compressed_y_0)) { + v_result := f_verifyWithEcdsaBrainpoolp384WithSha384( + v_secPayload, + valueof(p_certificateIssuer), + v_signedData, + valueof(p_publicKey.compressed_y_0), + 0 + ); + } else if (ischosen(p_publicKey.compressed_y_1)) { + v_result := f_verifyWithEcdsaBrainpoolp384WithSha384( + v_secPayload, + valueof(p_certificateIssuer), + v_signedData, + valueof(p_publicKey.compressed_y_1), + 1 + ); + } + + log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: v_result=", v_result); + return v_result; + } // End of function f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1 + + /** + * @desc Verify the signature of the provided secured message + * @param p_securedMessage + * @param p_certificate EtsiTs103097Certificate to be used to verify the message + * @return true on success, false otherwise + * @verdict + */ + function f_verifyGnSecuredMessageSignatureWithCertificate( + in template (value) Ieee1609Dot2Data p_securedMessage, + in template (value) charstring p_certificate_id, + in template (value) EtsiTs103097Certificate p_certificate + + ) return boolean { + var octetstring v_issuer; + var EtsiTs103097Certificate v_certificate; + + log(">>> f_verifyGnSecuredMessageSignatureWithCertificate: p_securedMessage=", p_securedMessage); + log(">>> f_verifyGnSecuredMessageSignatureWithCertificate: p_certificate_id=", p_certificate_id); + log(">>> f_verifyGnSecuredMessageSignatureWithCertificate: p_certificate=", p_certificate); + + if (f_getCertificateHash(valueof(p_certificate_id), v_issuer) == false) { + log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate id: " & valueof(p_certificate_id)); + return false; + } + if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { + return f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1(p_securedMessage, v_issuer, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1); + } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature)) { + return f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1(p_securedMessage, v_issuer, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1); + } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature)) { + return f_verifyGnSecuredMessageSignature_ecdsaNistP256(p_securedMessage, v_issuer, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256); + } + + return false; + } // End of function f_verifyGnSecuredOtherMessageWithDeviceCertificate + + } // End of group deviceSignatureHelpers + + group sspPermissions { + + function f_verifySspPermissions( + in SequenceOfPsidSsp p_issuer_ssp_permissions, + in SequenceOfPsidSsp p_subordinate_ssp_permissions, + in boolean p_strict_checks := false + ) return boolean { + // Local variables + var integer v_idx := 0; + + log(">>> f_verifySspPermissions: p_issuer_ssp_permissions:", p_issuer_ssp_permissions); + log(">>> f_verifySspPermissions: p_subordinate_ssp_permissions: ", p_subordinate_ssp_permissions); + + for (v_idx := 0; v_idx < lengthof(p_issuer_ssp_permissions); v_idx := v_idx + 1) { + var PsidSsp v_issuerPsidSsp := p_issuer_ssp_permissions[v_idx]; + var PsidSsp v_subordinatePsidSsp; + var boolean v_found := false; + var integer v_jdx := 0; + log("f_verifySspPermissions: v_issuerPsidSsp: ", v_issuerPsidSsp); + // 1. Check permission from issuer is present + for (v_jdx := 0; v_jdx < lengthof(p_subordinate_ssp_permissions); v_jdx := v_jdx + 1) { + log("f_verifySspPermissions: match=", match(v_issuerPsidSsp, m_appPermissions(p_subordinate_ssp_permissions[v_jdx].psid, p_subordinate_ssp_permissions[v_jdx].ssp))); + // 1. Check the version + if (p_subordinate_ssp_permissions[v_jdx].ssp.bitmapSsp[0] != '01'O) { + log("f_verifySspPermissions: Wrong SSP version control (1 is expected): ", p_subordinate_ssp_permissions[v_jdx].ssp.bitmapSsp[0]); + return false; + } + // 2. Check the version + if (match(v_issuerPsidSsp, m_appPermissions(p_subordinate_ssp_permissions[v_jdx].psid, p_subordinate_ssp_permissions[v_jdx].ssp)) == true) { + v_subordinatePsidSsp := p_subordinate_ssp_permissions[v_jdx]; + v_found := true; + break; + } + } // End of 'for' statement + if (v_found == false) { + log("f_verifySspPermissions: Permission set not found: ", v_issuerPsidSsp); + if (p_strict_checks == true) { + return false; + } else { + return true; + } + } + // 2. Validate bits mask + if (ispresent(v_issuerPsidSsp.ssp)) { + if (ispresent(v_subordinatePsidSsp.ssp) == false) { + log("f_verifySspPermissions: Ssp shall not be omitted: ", v_issuerPsidSsp); + if (p_strict_checks == true) { + return false; + } + } + if ((ischosen(v_issuerPsidSsp.ssp.bitmapSsp) == false) or (ischosen(v_subordinatePsidSsp.ssp.bitmapSsp) == false)) { + log("f_verifySspPermissions: Wrong variant : ", v_issuerPsidSsp, " / ", v_subordinatePsidSsp); + if (p_strict_checks == true) { + return false; + } + } + if (lengthof(v_issuerPsidSsp.ssp.bitmapSsp) < lengthof(v_subordinatePsidSsp.ssp.bitmapSsp)) { + log("f_verifySspPermissions: Ssp not be compliant: ", v_issuerPsidSsp.ssp, " / ", v_subordinatePsidSsp.ssp); + if (p_strict_checks == true) { + return false; + } + } else { + var charstring v_issuerSsp := bit2str(oct2bit(v_issuerPsidSsp.ssp.bitmapSsp)); + var charstring v_subordinateSsp := bit2str(oct2bit(v_subordinatePsidSsp.ssp.bitmapSsp)); + + for (var integer i := 0; i < lengthof(v_issuerSsp); i := i + 1) { + if (v_issuerSsp[i] == "1") { // TODO How to check Permission using SspBitmask/SspValue + if (v_subordinateSsp[i] != "1") { + log("f_verifySspPermissions: Ssp bitmask mismatch at index: ", i); + return false; + } + } // else, no restriction, subordinate certificate can have any value. + } // End of 'for' statement + } + } + } // End of 'for' statement + + return true; + } // End of function f_verifySspPermissions + + } // End of group sspPermissions + + group messageGetters { + + /** + * @desc return Ieee1609Dot2Data header field of given type or null if none + * @param p_msg the Ieee1609Dot2Data + * @param p_type header field type + * @return HeaderInfo of given type if any or null + */ + function f_getMsgHeaderInfo( + in template(omit) Ieee1609Dot2Data p_securedMessage, + out HeaderInfo p_return + ) return boolean { + var integer v_length; + var Ieee1609Dot2Data v_securedMessage; + + if (not isvalue(p_securedMessage)) { + testcase.stop(__SCOPE__ & " can not handle omitted secured message values"); + } + v_securedMessage := valueof(p_securedMessage); + if (ischosen(v_securedMessage.content.signedData)) { + p_return := v_securedMessage.content.signedData.tbsData.headerInfo; + return true; + } + + log("f_getMsgHeaderField: return false"); + return false; + } + + /** + * @desc return SignerIdentifier Ieee1609Dot2Data field + */ + function f_getMsgSignerIdentifier ( + in template(omit) Ieee1609Dot2Data p_securedMessage, + out SignerIdentifier p_signerIdentifier + ) return boolean { + if (not isvalue(p_securedMessage)) { + testcase.stop(__SCOPE__ & " can not handle omitted secured message values"); + } + + if (ischosen(p_securedMessage.content.signedData)) { + p_signerIdentifier := valueof(p_securedMessage.content.signedData.signer); + return true; + } + + log("f_getMsgSignerIdentifier: return false"); + return false; + } + + } // End of group messageGetters + + group certificateGetters { + + /** + * @desc Set the generation location as defined in Draft ETSI TS 103 097 V1.1.14 Clause 7.2 Security profile for DENMs + * @param p_latitude The latitude value of the ITS-S position + * @param p_longitude The longitude value of the ITS-S position + * @param p_elevation The elevation value of the ITS-S position + * @verdict Unchanged + */ + function f_setGenerationLocation( + in SecLatitude p_latitude, + in SecLongitude p_longitude, + in SecElevation p_elevation := 0 + ) runs on ItsSecurityBaseComponent { + vc_location := { + p_latitude, + p_longitude, + p_elevation + } + } // End of function f_setGenerationLocation + + /** + * @desc Load in memory cache the certificates available + * @param p_configId A configuration identifier + * @remark This method SHALL be call before any usage of certificates + * @return true on success, false otherwise + */ + function f_loadCertificates( + in charstring p_configId + ) runs on ItsSecurityBaseComponent return boolean { + var charstring v_certificate_id; + + // Setup certificates memory cache + if (fx_loadCertificates(PX_CERTIFICATE_POOL_PATH, p_configId) == true) { + // Setup security component variables + if (f_readCertificate(PX_CERT_FOR_TS, vc_atCertificate) == true) { + var HashedId8 v_issuer; +// log("Issuer: ", vc_atCertificate.issuer); + if (ischosen(vc_atCertificate.issuer.sha256AndDigest)) { + v_issuer := vc_atCertificate.issuer.sha256AndDigest; + } else if (ischosen(vc_atCertificate.issuer.sha384AndDigest)) { + v_issuer := vc_atCertificate.issuer.sha384AndDigest; + } else { + log("AT certificate cannot be issued by CA"); + return false; + } + log("Selected issuer: ", v_issuer); + if (f_getCertificateFromDigest(v_issuer, vc_aaCertificate, v_certificate_id)) { + if (f_readSigningKey(cc_taCert_A, vc_signingPrivateKey) == true) { + f_readEncryptingKey(cc_taCert_A, vc_encryptPrivateKey); + return true; + } + log("f_loadCertificates: Failed to load signing key for ", cc_taCert_A); + } else { + log("f_loadCertificates: Failed to load AA certificate for ", cc_taCert_A); + } + } else { + log("f_loadCertificates: Failed to load AT certificate for ", cc_taCert_A); + } + } else { + log("f_loadCertificates: Failed to load certificates from ", PX_CERTIFICATE_POOL_PATH); + } + return false; + } // End of function f_loadCertificates + + /** + * @desc Unload from memory cache the certificates available + * @return true on success, false otherwise + */ + function f_unloadCertificates() runs on ItsSecurityBaseComponent return boolean { + // Reset security component variables + vc_signingPrivateKey := ''O; + vc_encryptPrivateKey := ''O; + // Clear certificates memory cache + return fx_unloadCertificates(); + } // End of function f_unloadCertificates + + /** + * @desc Read the specified certificate + * @param p_certificate_id the certificate identifier + * @param p_certificate the expected certificate + * @return true on success, false otherwise + */ + function f_readCertificate( + in charstring p_certificate_id, + out EtsiTs103097Certificate p_certificate + ) return boolean { + var octetstring v_certificate; + + if (fx_readCertificate(p_certificate_id, v_certificate) == true) { + var bitstring v_oct2bit; + var integer v_result; + + v_oct2bit := oct2bit(v_certificate); + v_result := decvalue(v_oct2bit, p_certificate); + if (v_result == 0) { + return true; + } + } + + log("f_readCertificate: Failed to retrieve ", p_certificate_id); + return false; + } // End of function f_readCertificate + + /** + * @desc Read the specified certificate + * @param p_certificate_id the certificate identifier + * @param p_digest the digest of the certificate + * @return true on success, false otherwise + */ + function f_getCertificateDigest( + in charstring p_certificate_id, + out HashedId8 p_digest + ) return boolean { + if (not fx_readCertificateDigest(p_certificate_id, p_digest)){ + log("f_getCertificateDigest: Failed to retrieve digest for ", p_certificate_id); + return false; + } + return true; + } // End of function f_getCertificateDigest + + /** + * @desc Read the whole-hash of the certificate + * @param p_certificate_id the certificate identifier + * @param p_hash the whole-hash of the certificate + * @return true on success, false otherwise + */ + function f_getCertificateHash( + in charstring p_certificate_id, + out octetstring p_hash + ) return boolean { + log(">>> f_getCertificateHash: ", p_certificate_id); + + if (not fx_readCertificateHash(p_certificate_id, p_hash)){ + log("f_getCertificateHash: Failed to retrieve digest for ", p_certificate_id); + return false; + } + return true; + } // End of function f_getCertificateHash + + /** + * @desc Read the whole-hash of the certificate SHA 256 + * @param p_certificate_id the certificate identifier + * @param p_hash the whole-hash of the certificate using SHA 256 + * @return true on success, false otherwise + */ + function f_getCertificateHash256( + in charstring p_certificate_id, + out Oct32 p_hash + ) return boolean { + if (not fx_readCertificateHash256(p_certificate_id, p_hash)){ + log("f_getCertificateHash256: Failed to retrieve digest for ", p_certificate_id); + return false; + } + return true; + } // End of function f_getCertificateHash256 + + function f_getCertificateFromDigest( + in HashedId8 p_digest, + out EtsiTs103097Certificate p_certificate, + out charstring p_certificate_id + ) return boolean { + if (not(fx_readCertificateFromDigest(p_digest, p_certificate_id))) { + log("f_getCertificateFromDigest: Failed to retrieve digest for ", p_digest); + return false; + } + if (not(f_readCertificate(p_certificate_id, p_certificate))) { + log("f_getCertificateFromDigest: Failed to retrieve digest for ", p_certificate_id); + return false; + } + return true; + } // End of function f_getCertificateFromDigest + + function f_getCertificateFromHashedId3( + in HashedId3 p_digest, + out EtsiTs103097Certificate p_certificate + ) return boolean { + var charstring v_certificate_id; + if (not(fx_readCertificateFromHashedId3(p_digest, v_certificate_id))) { + log("f_getCertificateFromHashedId3: Failed to retrieve digest for ", p_digest); + return false; + } + if (not(f_readCertificate(v_certificate_id, p_certificate))) { + log("f_getCertificateFromHashedId3: Failed to retrieve digest for ", v_certificate_id); + return false; + } + return true; + } // End of function f_getCertificateFromHashedId3 + + /** + * @desc Read the signing private key for the specified certificate + * @param p_keysId the keys identifier + * @param p_signingPrivateKey the signing private key + * @return true on success, false otherwise + */ + function f_readSigningKey( + in charstring p_keysId, + out Oct32 p_signingPrivateKey + ) return boolean { + return fx_readSigningKey(p_keysId, p_signingPrivateKey); + } // End of function f_readSigningKey + + /** + * @desc Read the encrypting private keys for the specified certificate + * @param p_keysId the keys identifier + * @param p_encryptPrivateKey the encrypt private key + * @return true on success, false otherwise + */ + function f_readEncryptingKey( + in charstring p_keysId, + out Oct32 p_encryptPrivateKey + ) return boolean { + return fx_readEncryptingKey(p_keysId, p_encryptPrivateKey); + } // End of function f_readEncryptingKey + + function f_getCertificateValidityRestriction( + in template (value) EtsiTs103097Certificate p_cert, + out template (value) ValidityPeriod p_validityPeriod, + out template (omit) GeographicRegion p_geographicRegion + ) return boolean { + p_validityPeriod := valueof(p_cert.toBeSigned.validityPeriod); + if (ispresent(p_cert.toBeSigned.region)) { + p_geographicRegion := valueof(p_cert.toBeSigned.region); + } else { + p_geographicRegion := omit; + } + return true; + } // End of function f_getCertificateValidityRestriction + + }// End of group certificateGetters + + group certificatesCaching { + + function f_createCertificatesCaching( + in SequenceOfCertificate p_certificates, + out CertificatesCaching p_certificatesCaching + ) return boolean { + p_certificatesCaching := { }; + for (var integer v_counter := 0; v_counter < lengthof(p_certificates); v_counter := v_counter + 1) { + var CertificatesCachingItem v_item; + v_item.certificate := p_certificates[v_counter]; + v_item.hashedId8 := f_calculateDigestSha256FromCertificate(v_item.certificate); + p_certificatesCaching[v_counter] := v_item; + } // End of 'for' statement + + return true; + } + + function f_getCertificateFromCaching( + in CertificatesCaching p_certificatesCaching, + in HashedId8 p_hashedId8, + out EtsiTs103097Certificate p_certificate + ) return boolean { + for (var integer v_counter := 0; v_counter < lengthof(p_certificatesCaching); v_counter := v_counter + 1) { + if (match(p_certificatesCaching[v_counter].hashedId8, p_hashedId8) == true) { + p_certificate := p_certificatesCaching[v_counter].certificate; + return true; + } + } // End of 'for' statement + + return false; + } + + function f_getCertificatesCachingItem( + in CertificatesCaching p_certificatesCaching, + in UInt8 p_index, + out EtsiTs103097Certificate p_certificate + ) return boolean { + if (lengthof(p_certificatesCaching) < p_index) { + p_certificate := p_certificatesCaching[p_index].certificate; + return true; + } + + return false; + } + + function f_getCertificatesCachingItemSize( + in CertificatesCaching p_certificatesCaching + ) return UInt8 { + return lengthof(p_certificatesCaching); + } + + }// End of group certificatesCaching + + + } // End of group helpersFunctions + + group externalFunctions { + + group signing { + + /** + * @desc Produces a 256-bit (32-byte) hash value + * @param p_toBeHashedData Data to be used to calculate the hash value + * @return The hash value + */ + external function fx_hashWithSha256(in octetstring p_toBeHashedData) return Oct32; + + /** + * @desc Produces a 384-bit (48-byte) hash value + * @param p_toBeHashedData Data to be used to calculate the hash value + * @return The hash value + */ + external function fx_hashWithSha384(in octetstring p_toBeHashedData) return Oct48; + + /** + * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature + * @param p_toBeSignedSecuredMessage The data to be signed + * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate + * @param p_privateKey The private key + * @return The signature value + */ + external function fx_signWithEcdsaNistp256WithSha256(in octetstring p_toBeSignedSecuredMessage, in Oct32 p_certificateIssuer, in Oct32 p_privateKey) return octetstring; + + /** + * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature + * @param p_toBeSignedSecuredMessage The data to be signed + * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate + * @param p_privateKey The private key for signature + * @return The signature value + */ + external function fx_signWithEcdsaBrainpoolp256WithSha256(in octetstring p_toBeSignedSecuredMessage, in Oct32 p_certificateIssuer, in Oct32 p_privateKey) return octetstring; + + /** + * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature + * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate + * @param p_privateKey The private key for signature + * @return The signature value + */ + external function fx_signWithEcdsaBrainpoolp384WithSha384(in octetstring p_toBeSignedSecuredMessage, in Oct48 p_certificateIssuer, in Oct48 p_privateKey) return octetstring; + + /** + * @desc Verify the signature of the specified data + * @param p_toBeVerifiedData The data to be verified + * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate + * @param p_signature The signature + * @param p_ecdsaNistp256PublicKeyCompressed The compressed public key + * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @return true on success, false otherwise + */ + external function fx_verifyWithEcdsaNistp256WithSha256(in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyCompressed, in integer p_compressed_mode) return boolean; + + /** + * @desc Verify the signature of the specified data + * @param p_toBeVerifiedData The data to be verified + * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate + * @param p_signature The signature + * @param p_ecdsaNistp256PublicKeyX The public key (x coordinate) + * @param p_ecdsaNistp256PublicKeyY The public key (y coordinate) + * @return true on success, false otherwise + */ + external function fx_verifyWithEcdsaNistp256WithSha256_1(in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in Oct64 p_signature, in Oct32 p_ecdsaNistp256PublicKeyX, in Oct32 p_ecdsaNistp256PublicKeyY) return boolean; + + /** + * @desc Verify the signature of the specified data + * @param p_toBeVerifiedData The data to be verified + * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate + * @param p_signature The signature + * @param p_ecdsaBrainpoolp256PublicKeyCompressed The compressed public key + * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @return true on success, false otherwise + */ + external function fx_verifyWithEcdsaBrainpoolp256WithSha256(in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in Oct64 p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyCompressed, in integer p_compressed_mode) return boolean; + + /** + * @desc Verify the signature of the specified data + * @param p_toBeVerifiedData The data to be verified + * @param p_certificateIssuer The certificate issuer + * @param p_signature The signature + * @param p_ecdsaBrainpoolp256PublicKeyX The public key (x coordinate) + * @param p_ecdsaBrainpoolp256PublicKeyY The public key (y coordinate) + * @return true on success, false otherwise + */ + external function fx_verifyWithEcdsaBrainpoolp256WithSha256_1(in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in Oct64 p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyX, in Oct32 p_ecdsaBrainpoolp256PublicKeyY) return boolean; + + /** + * @desc Verify the signature of the specified data + * @param p_toBeVerifiedData The data to be verified + * @param p_certificateIssuer The certificate issuer + * @param p_signature The signature + * @param p_ecdsaBrainpoolp384PublicKeyCompressed The compressed public key + * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @return true on success, false otherwise + */ + external function fx_verifyWithEcdsaBrainpoolp384WithSha384(in octetstring p_toBeVerifiedData, in Oct48 p_certificateIssuer, in Oct96 p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyCompressed, in integer p_compressed_mode) return boolean; + + /** + * @desc Verify the signature of the specified data + * @param p_toBeVerifiedData The data to be verified + * @param p_certificateIssuer The hash of the canonical certificate issuer + * @param p_signature The signature + * @param p_ecdsaBrainpoolp384PublicKeyX The public key (x coordinate) + * @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate) + * @return true on success, false otherwise + */ + external function fx_verifyWithEcdsaBrainpoolp384WithSha384_1(in octetstring p_toBeVerifiedData, in Oct48 p_certificateIssuer, in Oct96 p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyX, in Oct48 p_ecdsaBrainpoolp384PublicKeyY) return boolean; + + /** + * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. + * This function should not be used by the ATS + * @param p_privateKey The new private key value + * @param p_publicKeyX The new public key value (x coordinate) + * @param p_publicKeyX The new public key value (y coordinate) + * @param p_publicKeyCompressed The compressed public keys + * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @return true on success, false otherwise + */ + external function fx_generateKeyPair_nistp256(out Oct32 p_privateKey, out Oct32 p_publicKeyX, out Oct32 p_publicKeyY, out Oct32 p_publicKeyCompressed, out integer p_compressed_mode) return boolean; + + /** + * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. + * This function should not be used by the ATS + * @param p_privateKey The new private key value + * @param p_publicKeyX The new public key value (x coordinate) + * @param p_publicKeyX The new public key value (y coordinate) + * @param p_publicKeyCompressed The compressed public keys + * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @return true on success, false otherwise + */ + external function fx_generateKeyPair_brainpoolp256r1(out Oct32 p_privateKey, out Oct32 p_publicKeyX, out Oct32 p_publicKeyY, out Oct32 p_publicKeyCompressed, out integer p_compressed_mode) return boolean; + + /** + * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. + * This function should not be used by the ATS + * @param p_privateKey The new private key value + * @param p_publicKeyX The new public key value (x coordinate) + * @param p_publicKeyX The new public key value (y coordinate) + * @param p_publicKeyCompressed The compressed public keys + * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @return true on success, false otherwise + */ + external function fx_generateKeyPair_brainpoolp384r1(out Oct48 p_privateKey, out Oct48 p_publicKeyX, out Oct48 p_publicKeyY, out Oct48 p_publicKeyCompressed, out integer p_compressed_mode) return boolean; + + } // End of group signing + + group encryption { + + external function fx_hmac_sha256(in octetstring p_k, in octetstring p_m) return octetstring; + + /** + * @desc This function validates AES128 CCM encryption based on IEEE Std 1609.2-20XX Annex D.6.1 AES-CCM-128 + * @param[in] The symmetric AES 128 encryption key + * @param[in] The initial vector (aka nonce) + * @param[in] The raw payload + * @return The encrypted payload + */ + external function fx_encrypt_aes_128_ccm_test(in octetstring p_k, in octetstring p_n, in octetstring p_pt) return octetstring; + + /** + * @desc TThis function validates AES128 CCM encryption based on AES-GCM-256 + * @param[in] The symmetric AES 128 encryption key + * @param[in] The initial vector (aka nonce) + * @param[in] The raw payload + * @return The encrypted payload + */ + external function fx_encrypt_aes_128_gcm_test(in octetstring p_k, in octetstring p_n, in octetstring p_pt) return octetstring; + + /** + * @desc This function validates AES128 CCM decryption based on IEEE Std 1609.2-20XX Annex D.6.1 AES-CCM-128 + * @param[in] The symmetric AES 128 encryption key + * @param[in] The initial vector (aka nonce) + * @param[in] The cyphered payload + * @return The raw payload + */ + external function fx_decrypt_aes_128_ccm_test(in octetstring p_k, in octetstring p_n, in octetstring p_pt) return octetstring; + + /** + * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption using Nist-P256 algorithm + * @param p_toBeEncryptedSecuredMessage The data to be encrypted + * @param p_recipientsPublicKeyCompressed The Recipient's compressed public key + * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key + * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key + * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption + * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption + * @return The encrypted message + */ + external function fx_encryptWithEciesNistp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyCompressed, in integer p_compressed_mode, in octetstring p_salt, out Oct32 p_publicEphemeralKeyCompressed, out integer p_ephemeralKeyModeCompressed, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; + + external function fx_test_encryptWithEciesNistp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_privateEphemeralKey, in Oct32 p_recipientPublicKeyX, in Oct32 p_recipientPublicKeyY, in octetstring p_salt, out Oct32 p_publicEphemeralKeyX, out Oct32 p_publicEphemeralKeyY, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; + + /** + * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Nist-P256 algorithm + * @param p_encryptedSecuredMessage The data to be decrypted + * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key + * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key + * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption + * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption + * @return The decrypted message + */ + external function fx_decryptWithEciesNistp256WithSha256(in octetstring p_encryptedSecuredMessage, in Oct32 p_privateEncKey, in Oct32 p_publicEphemeralKeyCompressed, in integer p_ephemeralKeyModeCompressed, in Oct16 p_encrypted_sym_key, in Oct16 p_authentication_vector, in Oct12 p_nonce, in Oct32 p_salt, out Oct16 p_aes_sym_enc_key) return octetstring; + + /** + * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption using Brainpool-P256 algorithm + * @param p_toBeEncryptedSecuredMessage The data to be encrypted + * @param p_recipientsPublicKeyCompressed The Recipient's compressed public key + * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key + * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key + * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption + * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption + * @return The encrypted message + */ + external function fx_encryptWithEciesBrainpoolp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyCompressed, in integer p_compressed_mode, in octetstring p_salt, out Oct32 p_publicEphemeralKeyCompressed, out integer p_ephemeralKeyModeCompressed, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; + + external function fx_test_encryptWithEciesBrainpoolp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_privateEphemeralKey, in Oct32 p_recipientPublicKeyX, in Oct32 p_recipientPublicKeyY, in octetstring p_salt, out Oct32 p_publicEphemeralKeyX, out Oct32 p_publicEphemeralKeyY, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; + + /** + * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Brainpool-P256 algorithm + * @param p_encryptedSecuredMessage The data to be decrypted + * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key + * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise + * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key + * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption + * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption + * @return The decrypted message + */ + external function fx_decryptWithEciesBrainpoolp256WithSha256(in octetstring p_encryptedSecuredMessage, in Oct32 p_privateEncKey, in Oct32 p_publicEphemeralKeyCompressed, in integer p_ephemeralKeyModeCompressed, in Oct16 p_encrypted_sym_key, in Oct16 p_authentication_vector, in Oct12 p_nonce, in Oct32 p_salt, out Oct16 p_aes_sym_enc_key) return octetstring; + + } // End of group encryption + + group certificatesLoader { + + /** + * @desc Load in memory cache the certificates available in the specified directory + * @param p_rootDirectory Root directory to access to the certificates identified by the certificate ID + * @param p_configId A configuration identifier + * @remark This method SHALL be call before any usage of certificates + * @return true on success, false otherwise + */ + external function fx_loadCertificates(in charstring p_rootDirectory, in charstring p_configId) return boolean; + external function fx_store_certificate(in charstring p_cert_id, in octetstring p_cert, in octetstring p_private_key, in octetstring p_public_key_x, in octetstring p_public_key_y, in octetstring p_public_key_compressed, in integer p_public_key_compressed_mode, in octetstring p_hash, in octetstring p_hash_256, in octetstring p_hashid8, in octetstring p_issuer, in template (omit) octetstring p_private_enc_key, in template (omit) octetstring p_public_enc_key_x, in template (omit) octetstring p_public_enc_key_y, in template (omit) octetstring p_public_enc_compressed_key, in template (omit) integer p_public_enc_key_compressed_mode) return boolean; + + /** + * @desc Unload from memory cache the certificates + * @return true on success, false otherwise + */ + external function fx_unloadCertificates() return boolean; + + /** + * @desc Read the specified certificate + * @param p_certificate_id the certificate identifier + * @param p_certificate the expected certificate + * @return true on success, false otherwise + */ + external function fx_readCertificate(in charstring p_certificate_id, out octetstring p_certificate) return boolean; + + /** + * @desc Read the specified certificate digest + * @param p_certificate_id the certificate identifier + * @param p_digest the expected certificate + * @return true on success, false otherwise + */ + external function fx_readCertificateDigest(in charstring p_certificate_id, out HashedId8 p_digest) return boolean; + + /** + * @desc Read the whole-hash of the specified certificate + * @param p_certificate_id the certificate identifier + * @param p_hash the whole-hash of the certificate + * @return true on success, false otherwise + */ + external function fx_readCertificateHash(in charstring p_certificate_id, out octetstring p_hash) return boolean; + + /** + * @desc Read the whole-hash of the specified certificate using SHA 256 + * @param p_certificate_id the certificate identifier + * @param p_hash the whole-hash of the certificate + * @return true on success, false otherwise + */ + external function fx_readCertificateHash256(in charstring p_certificate_id, out Oct32 p_hash) return boolean; + + external function fx_readCertificateFromDigest(in HashedId8 p_digest, out charstring p_certificate_id) return boolean; + + external function fx_readCertificateFromHashedId3(in HashedId3 p_digest, out charstring p_certificate_id) return boolean; + + /** + * @desc Read the private keys for the specified certificate + * @param p_keysId the keys identifier + * @param p_signingPrivateKey the signing private key + * @return true on success, false otherwise + */ + + external function fx_readSigningKey(in charstring p_keysId, out Oct32 p_signingPrivateKey) return boolean; + + /** + * @desc Read the private keys for the specified certificate + * @param p_keysId the keys identifier + * @param p_encryptPrivateKey the encrypt private key + * @return true on success, false otherwise + */ + + external function fx_readEncryptingKey(in charstring p_keysId, out Oct32 p_encryptingPrivateKey) return boolean; + + } // End of group certificatesLoader + + group geodesic { + + /** + * @desc Check that given polygon doesn't have neither self-intersections nor holes. + * @param p_region Polygonal Region + * @return true on success, false otherwise + * @verdict Unchanged + */ + external function fx_isValidPolygonalRegion(in PolygonalRegion p_region) return boolean; + + /** + * @desc Check if a polygonal region is inside another one + * @param p_parent The main polygonal region + * @param p_region The polygonal region to be included + * @return true on success, false otherwise + * @verdict Unchanged + */ + external function fx_isPolygonalRegionInside(in PolygonalRegion p_parent, in PolygonalRegion p_region) return boolean; + + /** + * @desc Check that the location is inside a circular region + * @param p_region The circular region to consider + * @param p_location The device location + * @return true on success, false otherwise + * @verdict Unchanged + */ + external function fx_isLocationInsideCircularRegion(in CircularRegion p_region, in ThreeDLocation p_location) return boolean; + + /** + * @desc Check that the location is inside a rectangular region + * @param p_region The rectangular region to consider + * @param p_location The device location + * @return true on success, false otherwise + * @verdict Unchanged + */ + external function fx_isLocationInsideRectangularRegion(in SequenceOfRectangularRegion p_region, in ThreeDLocation p_location) return boolean; + + /** + * @desc Check that the location is inside a polygonal region + * @param p_region The polygonal region to consider + * @param p_location The device location + * @return true on success, false otherwise + * @verdict Unchanged + */ + external function fx_isLocationInsidePolygonalRegion(in PolygonalRegion p_region, in ThreeDLocation p_location) return boolean; + + /** + * @desc Check if the location is inside an identified region + * @param p_region The identified region to consider + * @param p_location The device location + * @return true on success, false otherwise + * @verdict Unchanged + */ + external function fx_isLocationInsideIdentifiedRegion(in IdentifiedRegion p_region, in ThreeDLocation p_location) return boolean; + + /** + * @desc Check if the location is inside an undefined region + * @param p_region The identified region to consider + * @param p_location The device location + * @return true on success, false otherwise + * @verdict Unchanged + */ + external function fx_isLocationInsideOtherRegion(in octetstring p_region, in ThreeDLocation p_location) return boolean; + + /** + * @desc Check that p_circular_region_1 circular region is included into p_circular_region_2 circular region + * @param p_circular_region_1 Circular region 1 + * @param p_circular_region_2 Circular region 2 + * + * @return true on success, false otherwise + */ + external function fx_areCirclesInside(in CircularRegion p_circular_region_1, in CircularRegion p_circular_region_2) return boolean; + + /** + * @desc Check that p_rectanglar_region_1 rectangular region is included into p_rectanglar_region_2 rectangular region + * @param p_rectanglar_region_1 Rectangular region 1 + * @param p_rectanglar_region_2 Rectangular region 2 + * + * @return true on success, false otherwise + */ + external function fx_areRectanglesInside(in SequenceOfRectangularRegion p_rectanglar_region_1, in SequenceOfRectangularRegion p_rectanglar_region_2) return boolean; + + /** + * @desc Check that p_polygonal_region_1 polygonal region is included into p_polygonal_region_2 polygonal region + * @param p_polygonal_region_1 Polygonal region 1 + * @param p_polygonal_region_2 Polygonal region 2 + * + * @return true on success, false otherwise + */ + external function fx_arePolygonsInside(in PolygonalRegion p_polygonal_region_1, in PolygonalRegion p_polygonal_region_2) return boolean; + + /** + * @desc Convert a spacial coordinate from DMS to Dms + * @param p_degrees The degrees (D) + * @param p_minutes The minutes (M) + * @param p_seconds The seconds (S) + * @param p_latlon The latitude/longitude: (N|S|E|W) + * @return The decimal coordinate on success, 0.0, otherwise + * @verdict Unchanged + */ + external function fx_dms2dd(in Int p_degrees, in Int p_minutes, in float p_seconds, in Oct1 p_latlon) return float; + + } // End of group geodesic + + } // End of group externalFunctions + + group geometryFunctions { + + function f_checkRegionValidityRestiction( + in EtsiTs103097Certificate p_cert, + in EtsiTs103097Certificate p_cert_issuer + ) return boolean { + var ValidityPeriod v_cert_region, v_cert_issuer_region; + var boolean v_cert_issuer_region_result; + + /* FIXME To be reviewed v_cert_issuer_region_result := f_getCertificateValidityRestriction(p_cert_issuer, e_region, v_cert_issuer_region); + if (f_getCertificateValidityRestriction(p_cert, e_region, v_cert_region) == false) { + if (v_cert_issuer_region_result == true) { + if (v_cert_issuer_region.validity.region.region_type != e_none) { + return false; + } + } + } else if ( + (v_cert_issuer_region_result == true) and + (v_cert_issuer_region.validity.region.region_type != e_none) + ) { + if (v_cert_region.validity.region.region_type == e_circle) { + if (v_cert_issuer_region.validity.region.region_type == e_circle) { + // Check v_cert_region 'circle' is inside v_cert_issuer_region 'circle' + if (f_areCirclesInside(v_cert_region.validity.region.region.circular_region, v_cert_issuer_region.validity.region.region.circular_region) == false) { + log("*** " & testcasename() & ": FAIL: Issuer and issuing certificates circle area does not match ***"); + return false; + } + } + } else if (v_cert_region.validity.region.region_type == e_rectangle) { + if (v_cert_issuer_region.validity.region.region_type == e_rectangle) { + // Check v_cert_region 'rectangle' is inside v_cert_issuer_region 'rectangle' + if (f_areRectanglesInside(v_cert_region.validity.region.region.rectangular_region, v_cert_issuer_region.validity.region.region.rectangular_region) == false) { + log("*** " & testcasename() & ": FAIL: Issuer and issuing certificates rectangle area does not match ***"); + return false; + } + } + } else if (v_cert_region.validity.region.region_type == e_polygon) { + if (v_cert_issuer_region.validity.region.region_type == e_polygon) { + // Check v_cert_region 'polygon' is inside v_cert_issuer_region 'polygon' + if (f_arePolygonsInside(v_cert_region.validity.region.region.polygonal_region, v_cert_issuer_region.validity.region.region.polygonal_region) == false) { + log("*** " & testcasename() & ": FAIL: Issuer and issuing certificates polygon area does not match ***"); + return false; + } + } + } else if (v_cert_region.validity.region.region_type == e_id) { + // Check id_region + if (not match (v_cert_region.validity.region, mw_geographicRegion_identified(mw_identifiedRegion_iso3166_any))) { + log("*** " & testcasename() & ": FAIL: Identified region is not conformed to ISO 3166-1 ***"); + return false; + } + if (not match (v_cert_region.validity.region, mw_geographicRegion_identified(mw_identifiedRegion_un_stats_any))) { + log("*** " & testcasename() & ": FAIL: Identified region is not conformed to United Nations Statistics Division ***"); + return false; + } + // Check region_dictionary + if (not match (v_cert_region.validity.region.region.id_region.region_dictionary, v_cert_issuer_region.validity.region.region.id_region.region_dictionary)) { + log("*** " & testcasename() & ": FAIL: Issuer and issuing 'region_dictionary' field does not match ***"); + return false; + } + // Check region_identifier + if (not match (v_cert_region.validity.region.region.id_region.region_identifier, v_cert_issuer_region.validity.region.region.id_region.region_identifier)) { + log("*** " & testcasename() & ": FAIL: Issuer and issuing 'region_identifier' field does not match ***"); + return false; + } + // Check local_region + if ( + (not match (v_cert_issuer_region.validity.region.region.id_region.local_region, v_cert_region.validity.region.region.id_region.local_region)) or + (not match (v_cert_issuer_region.validity.region.region.id_region.local_region, 0)) + ) { + log("*** " & testcasename() & ": FAIL: Issuer and issuing 'local_region' field does not match ***"); + return false; + } + } + }*/ + + return true; + } // End of function f_checkRegionValidityRestiction + + /** + * @desc Check that p_circular_region_1 circular region is included into p_circular_region_2 circular region + * @param p_circular_region_1 Circular region 1 + * @param p_circular_region_2 Circular region 2 + * + * @return true on success, false otherwise + */ + function f_areCirclesInside( + in CircularRegion p_circular_region_1, + in CircularRegion p_circular_region_2 + ) return boolean { + return fx_areCirclesInside(p_circular_region_1, p_circular_region_2); + } + + /** + * @desc Check that p_rectanglar_region_1 rectangular region is included into p_rectanglar_region_2 rectangular region + * @param p_rectanglar_region_1 Rectangular region 1 + * @param p_rectanglar_region_2 Rectangular region 2 + * + * @return true on success, false otherwise + */ + function f_areRectanglesInside( + in SequenceOfRectangularRegion p_rectanglar_region_1, + in SequenceOfRectangularRegion p_rectanglar_region_2 + ) return boolean { + return fx_areRectanglesInside(p_rectanglar_region_1, p_rectanglar_region_2); + } + + /** + * @desc Check that p_polygonal_region_1 polygonal region is included into p_polygonal_region_2 polygonal region + * @param p_polygonal_region_1 Polygonal region 1 + * @param p_polygonal_region_2 Polygonal region 2 + * + * @return true on success, false otherwise + */ + function f_arePolygonsInside( + in PolygonalRegion p_polygonal_region_1, + in PolygonalRegion p_polygonal_region_2 + ) return boolean { + return fx_arePolygonsInside(p_polygonal_region_1, p_polygonal_region_2); + } + + /** + * @desc Check that given location is valid + * @param p_location location to be checked + * @return true on success, false otherwise + */ + function f_isValidTwoDLocation( + in template (value) TwoDLocation p_location + ) return boolean { + return +//FIXME RGY Titan doesn't support dot notation after valueof at the moment +// (valueof(p_location).longitude != c_maxLongitude + 1) and +// (valueof(p_location).latitude != c_maxLatitude + 1); + (valueof(p_location.longitude) != c_maxLongitude + 1) and + (valueof(p_location.latitude) != c_maxLatitude + 1); + } // End of function f_isValidTwoDLocation + + /** + * @desc Check that two given rectanlular regions are intersected + * Note: Regions must be normalized(northWest.latitude >= southEast.latitude) + * @param p_r1 Region 1 + * @param p_r2 Region 2 + * + * @return true on success, false otherwise + */ + function f_isRectangularRegionsIntersected( + in template (value) RectangularRegion p_r1, + in template (value) RectangularRegion p_r2 + ) return boolean { + return not ( +//FIXME RGY Titan doesn't support dot notation after valueof at the moment +// valueof(p_r2).northWest.longitude > valueof(p_r1).southEast.longitude or +// valueof(p_r2).southEast.longitude < valueof(p_r1).northWest.longitude or +// valueof(p_r2).southEast.latitude > valueof(p_r1).northWest.latitude or +// valueof(p_r2).northWest.latitude < valueof(p_r1).southEast.latitude + valueof(p_r2.northWest.longitude) > valueof(p_r1.southEast.longitude) or + valueof(p_r2.southEast.longitude) < valueof(p_r1.northWest.longitude) or + valueof(p_r2.southEast.latitude) > valueof(p_r1.northWest.latitude) or + valueof(p_r2.northWest.latitude) < valueof(p_r1.southEast.latitude) + ); + } // End of function f_isRectangularRegionsIntersected + + function f_isContinuousRectangularRegions( + in template (value) SequenceOfRectangularRegion p_region + ) return boolean { + var integer v_i, v_j; + var boolean v_found; + + for (v_i := 0; v_i < lengthof(p_region); v_i := v_i + 1) { + var PolygonalRegion v_region_base; + f_convertRectangularRegionIntoPolygonalRegion(valueof(p_region[v_i]), v_region_base); + v_found := false; + for (v_j := 0; v_j < lengthof(p_region); v_j := v_j + 1) { + if (v_j != v_i) { + var PolygonalRegion v_region; + f_convertRectangularRegionIntoPolygonalRegion(valueof(p_region[v_j]), v_region); + if (f_isPolygonalRegionInside(v_region, v_region_base) == true) { + v_found := true; + } + } + } // End of 'for' statement + if (v_found == false) { + return false; + } + } // End of 'for' statement + + return true; + } // End of function f_isContinuousRectangularRegions + + /** + * @desc Check if a polygonal region is inside another one + * @param p_parent The main polygonal region + * @param p_region The polygonal region to be included + * @return true on success, false otherwise + * @verdict Unchanged + */ + function f_isRectangularRegionsInside( + in template (value) SequenceOfRectangularRegion p_parent, + in template (value) SequenceOfRectangularRegion p_region + ) return boolean { + var integer v_i, v_j; + + for (v_i := 0; v_i < lengthof(p_parent); v_i := v_i + 1) { + var PolygonalRegion v_region_parent, v_region; + f_convertRectangularRegionIntoPolygonalRegion(valueof(p_parent[v_i]), v_region_parent); + for (v_j := 0; v_j < lengthof(p_parent); v_j := v_j + 1) { + f_convertRectangularRegionIntoPolygonalRegion(valueof(p_region[v_j]), v_region); + if (f_isPolygonalRegionInside(v_region, v_region_parent) == true) { + return true; + } + } // End of 'for' statement + } // End of 'for' statement + + return false; + } // End of function f_isRectangularRegionsInside + + /** + * @desc Convert a rectangular region into a polygonal region + * @param p_region The rectangular regions to convert + * @return + * @verdict + */ + function f_convertRectangularRegionIntoPolygonalRegion( + in template (value) RectangularRegion p_rectangular_region, + out PolygonalRegion p_region + ) return boolean { + + // Convert rectangular regions to polygons and check polygons + p_region[0] := valueof(p_rectangular_region.northWest); + p_region[1] := { + valueof(p_rectangular_region.northWest.latitude) + valueof(p_rectangular_region.southEast.latitude), + valueof(p_rectangular_region.northWest.longitude) + }; + p_region[2] := valueof(p_rectangular_region.southEast); + p_region[3] := { + valueof(p_rectangular_region.northWest.latitude), + valueof(p_rectangular_region.northWest.longitude) + valueof(p_rectangular_region.southEast.longitude) + }; + log("f_convertRectangularRegionIntoPolygonalRegion: DEBUG: Northwest location is invalid in rect ", p_region); + + return true; + } // End of function + + /** + * @desc Check that given polygon doesn't have neither self-intersections nor holes. + * @param p_region Polygonal Region + * @return true on success, false otherwise + * @verdict Unchanged + */ + function f_isValidPolygonalRegion( + in template (value) PolygonalRegion p_region + ) return boolean { + // Sanity check + if (not isbound(p_region) or (lengthof(p_region) == 0)) { + return false; + } + + return fx_isValidPolygonalRegion(valueof(p_region)); + } // End of function f_isValidPolygonalRegion + + /** + * @desc Check if a polygonal region is inside another one + * @param p_parent The main polygonal region + * @param p_region The polygonal region to be included + * @return true on success, false otherwise + * @verdict Unchanged + */ + function f_isPolygonalRegionInside( + in template (value) PolygonalRegion p_parent, + in template (value) PolygonalRegion p_region + ) return boolean { + // Sanity check + if (not isbound(p_parent) or not isbound(p_region) or (lengthof(p_parent) == 0) or (lengthof(p_region) == 0)) { + return false; + } + + return fx_isPolygonalRegionInside(valueof(p_parent), valueof(p_region)); + } // End of function f_isPolygonalRegionInside + + /** + * @desc + */ + function f_isIdentifiedRegionInside( + in template (value) UInt16 p_parent, + in template (value) UInt16 p_region + ) return boolean { + return valueof(p_parent) == valueof(p_region); + } // End of function f_isIdentifiedRegionInside + + /** + * @desc Check that the location is inside a region + * @param p_region The region to consider + * @param p_location The device location + * @return true on success, false otherwise + * @verdict Unchanged + */ + function f_isLocationInsideRegion( + in template (value) GeographicRegion p_region, + in template (value) ThreeDLocation p_location + ) return boolean { + var boolean v_ret := false; + + if (ischosen(p_region.circularRegion)) { + v_ret := f_isLocationInsideCircularRegion(valueof(p_region.circularRegion), p_location); + } else if (ischosen(p_region.rectangularRegion)) { + v_ret := f_isLocationInsideRectangularRegion(valueof(p_region.rectangularRegion), p_location); + } else if (ischosen(p_region.polygonalRegion)) { + v_ret := f_isLocationInsidePolygonalRegion(valueof(p_region.polygonalRegion), p_location); + } else if (ischosen(p_region.identifiedRegion)) { + for (var integer v_i := 0; v_i < lengthof(p_region.identifiedRegion); v_i := v_i + 1) { + if (f_isLocationInsideIdentifiedRegion(valueof(p_region.identifiedRegion[v_i]), p_location) == true) { + v_ret := true; + break; + } + } // End of 'for' statement + } + + return v_ret; + } // End of function f_isLocationInsideRegion + + /** + * @desc Check that the location is inside a circular region + * @param p_region The circular region to consider + * @param p_location The device location + * @return true on success, false otherwise + * @verdict Unchanged + */ + function f_isLocationInsideCircularRegion( + in template (value) CircularRegion p_region, + in template (value) ThreeDLocation p_location + ) return boolean { + // Sanity check + if (not isbound(p_region) or not isbound(p_location)) { + return false; + } + + return fx_isLocationInsideCircularRegion(valueof(p_region), valueof(p_location)); + } // End of function f_isLocationInsideCircularRegion + + /** + * @desc Check that the location is inside a rectangular region + * @param p_region The rectangular region to consider + * @param p_location The device location + * @return true on success, false otherwise + * @verdict Unchanged + */ + function f_isLocationInsideRectangularRegion( + in template (value) SequenceOfRectangularRegion p_region, + in template (value) ThreeDLocation p_location + ) return boolean { + // Sanity check + if (not isbound(p_region) or not isbound(p_location) or (lengthof(p_region) == 0)) { + return false; + } +// log("f_isLocationInsideRectangularRegion: p_polygonalArea: ", p_region); +// log("f_isLocationInsideRectangularRegion: p_location: ", p_location); + + return fx_isLocationInsideRectangularRegion(valueof(p_region), valueof(p_location)); + } // End of function f_isLocationInsideRectangularRegion + + /** + * @desc Check that the location is inside a polygonal region + * @param p_region The polygonal region to consider + * @param p_location The device location + * @return true on success, false otherwise + * @verdict Unchanged + */ + function f_isLocationInsidePolygonalRegion( + in template (value) PolygonalRegion p_region, + in template (value) ThreeDLocation p_location + ) return boolean { + // Sanity check + if (not isbound(p_region) or not isbound(p_location) or (lengthof(p_region) == 0)) { + return false; + } +// log("f_isLocationInsidePolygonalRegion: p_polygonalArea: ", p_region, " - ", valueof(p_region)); +// log("f_isLocationInsidePolygonalRegion: p_location: ", p_location, " - ", valueof(p_location)); + + return fx_isLocationInsidePolygonalRegion(valueof(p_region), valueof(p_location)); + } // End of function f_isLocationInsidePolygonalRegion + + /** + * @desc Check if the location is inside an identified region + * @param p_region The identified region to consider + * @param p_location The device location + * @return true on success, false otherwise + * @verdict Unchanged + */ + function f_isLocationInsideIdentifiedRegion( + in template (value) IdentifiedRegion p_region, + in template (value) ThreeDLocation p_location + ) return boolean { + // Sanity check + if (not isbound(p_region) or not isbound(p_location)) { + return false; + } + + return fx_isLocationInsideIdentifiedRegion(valueof(p_region), valueof(p_location)); + } // End of function f_isLocationInsideIdentifiedRegion + + /** + * @desc Check if the location is inside an undefined region + * @param p_region The identified region to consider + * @param p_location The device location + * @return true on success, false otherwise + * @verdict Unchanged + */ + function f_isLocationInsideOtherRegion( + in template (value) octetstring p_region, + in template (value) ThreeDLocation p_location + ) return boolean { + // Sanity check + if (valueof(p_region) == ''O) { + return false; + } + + return fx_isLocationInsideOtherRegion(valueof(p_region), valueof(p_location)); + } // End of function f_isLocationInsideOtherRegion + + /** + * @desc Convert a spacial coordinate from DMS to Dms + * @param p_degrees The degrees (D) + * @param p_minutes The minutes (M) + * @param p_seconds The seconds (S) + * @param p_latlon The latitude/longitude: (N|S|E|W) + * @return The decimal coordinate on success, 0.0, otherwise + * @verdict Unchanged + */ + function f_dms2dd( + in integer p_degrees, + in integer p_minutes, + in float p_seconds, + in charstring p_latlon + ) return float { + var Oct1 v_latlon; + + // Sanity checks + if (lengthof(p_latlon) != 1) { + return 0.0; + } else if ((p_latlon != "N") and (p_latlon != "S") and (p_latlon != "E") and (p_latlon != "W")) { + return 0.0; + } + v_latlon := char2oct(p_latlon); + + return fx_dms2dd(p_degrees, p_minutes, p_seconds, v_latlon); + } // End of function f_dms2dd + + /** + * @desc Convert the latitude from float to int + * @param p_latitude The latitude to be converted. Significand length shall be 7 digits length + * @return The converted latitude + * @verdict Unchanged + */ + function f_ddlat2int( + in float p_latitude + ) return SecLatitude { + return float2int(p_latitude * 10000000.0); // Significand length shall be 7 digits length + } + + /** + * @desc Convert the longitude from float to int + * @param p_longitude The longitude to be converted. Significand length shall be 6 digits length + * @return The converted longitude + * @verdict Unchanged + */ + function f_ddlon2int( + in float p_longitude + ) return SecLongitude { + return float2int(p_longitude * 1000000.0); // Significand length shall be 6 digits length + } + + } // End of group geometryFunctions + +} // End of module LibItsSecurity_Functions + diff --git a/ttcn/Security/LibItsSecurity_Pics.ttcn b/ttcn/Security/LibItsSecurity_Pics.ttcn index d22e1ff9..b14b5709 100644 --- a/ttcn/Security/LibItsSecurity_Pics.ttcn +++ b/ttcn/Security/LibItsSecurity_Pics.ttcn @@ -1,108 +1,102 @@ -/** - * @author ETSI / STF481 / STF507 / STF517 / STF538 - * @version $URL$ - * $Id$ - * @desc Module containing Pics for Security Protocol - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsSecurity_Pics { - - // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; - - // LibItsSecurity - import from LibItsSecurity_TypesAndValues all; - - /** - * Does the IUT support SHA-256 digest - */ - modulepar boolean PICS_SEC_SHA256 := true; - - /** - * Does the IUT support SHA-384 digest - */ - modulepar boolean PICS_SEC_SHA384 := false; - - /** - * Does the IUT support NIST P256 algorithm - */ - modulepar boolean PICS_SEC_NIST_P256 := true; - - /** - * Does the IUT support Brainpool P256r1 algorithm - */ - modulepar boolean PICS_SEC_BRAINPOOL_P256R1 := true; - - /** - * Does the IUT support Brainpool P384r1 algorithm - */ - modulepar boolean PICS_SEC_BRAINPOOL_P384R1 := false; - - /** - * Is the IUT able to distribute AT certificates - */ - modulepar boolean PICS_SEC_P2P_AT_DISTRIBUTION := true; - - /** - * Is the IUT able to distribute AA certificates - */ - modulepar boolean PICS_SEC_P2P_AA_DISTRIBUTION := true; - - /** - * Is the IUT support certificates pushing - */ - modulepar boolean PICS_SEC_CERTIFICATE_SELECTION := true; - - /** - * Is the IUT support circular region geographical restriction - */ - modulepar boolean PICS_SEC_CIRCULAR_REGION := true; - - /** - * Does the IUT support rectangular region geographical restriction - */ - modulepar boolean PICS_SEC_RECTANGULAR_REGION := true; - - /** - * Does the IUT support polygonal region geographical restriction - */ - modulepar boolean PICS_SEC_POLYGONAL_REGION := true; - - /** - * Is the IUT support identified region geographical restriction - */ - modulepar boolean PICS_SEC_IDENTIFIED_REGION := true; - - /** - * Does the IUT support identified region/UN geographical restriction - */ - //TODO Remove modulepar boolean PICS_SEC_UN_STATS_REGION_DICTIONARY := true; - - /** - * Does the IUT support identified region/ISO31661 geographical restriction - */ - //TODO Remove modulepar boolean PICS_ISO31661_REGION_DICTIONARY := true; - - /** - * Does the IUT support ITS-AID for Generic profile? - */ - modulepar boolean PICS_SEC_ITS_AID_OTHER := true; - - /** - * Does the IUT support encryption data? - */ - modulepar boolean PICS_SEC_ENCRYPTION_SUPPORT := true; - - /** - * @desc Generate fixed private/public keys. - Used for debug only - */ - modulepar boolean PICS_SEC_FIXED_KEYS := false; - -} // End of module LibItsSecurity_Pics +/** + * @author ETSI / STF481 / STF507 / STF517 + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Security/LibItsSecurity_Pics.ttcn3 $ + * $Id: LibItsSecurity_Pics.ttcn3 1318 2017-01-26 10:20:53Z filatov $ + * @desc Module containing Pics for Security Protocol + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * + */ +module LibItsSecurity_Pics { + + // LibIts + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + import from IEEE1609dot2 language "ASN.1:1997" all; + import from EtsiTs103097Module language "ASN.1:1997" all; + + // LibItsSecurity + import from LibItsSecurity_TypesAndValues all; + + /** + * Does the IUT support SHA-256 digest + */ + modulepar boolean PICS_SEC_SHA256 := true; + + /** + * Does the IUT support SHA-384 digest + */ + modulepar boolean PICS_SEC_SHA384 := false; + + /** + * Does the IUT support NIST P256 algorithm + */ + modulepar boolean PICS_SEC_NIST_P256 := true; + + /** + * Does the IUT support Brainpool P256r1 algorithm + */ + modulepar boolean PICS_SEC_BRAINPOOL_P256R1 := true; + + /** + * Does the IUT support Brainpool P384r1 algorithm + */ + modulepar boolean PICS_SEC_BRAINPOOL_P384R1 := false; + + /** + * Is the IUT able to distribute AT certificates + */ + modulepar boolean PICS_SEC_P2P_AT_DISTRIBUTION := true; + + /** + * Is the IUT able to distribute AA certificates + */ + modulepar boolean PICS_SEC_P2P_AA_DISTRIBUTION := true; + + /** + * Is the IUT support certificates pushing + */ + modulepar boolean PICS_SEC_CERTIFICATE_SELECTION := true; + + /** + * Is the IUT support circular region geographical restriction + */ + modulepar boolean PICS_SEC_CIRCULAR_REGION := true; + + /** + * Does the IUT support rectangular region geographical restriction + */ + modulepar boolean PICS_SEC_RECTANGULAR_REGION := true; + + /** + * Does the IUT support polygonal region geographical restriction + */ + modulepar boolean PICS_SEC_POLYGONAL_REGION := true; + + /** + * Is the IUT support identified region geographical restriction + */ + modulepar boolean PICS_SEC_IDENTIFIED_REGION := true; + + /** + * Does the IUT support identified region/UN geographical restriction + */ + //TODO Remove modulepar boolean PICS_SEC_UN_STATS_REGION_DICTIONARY := true; + + /** + * Does the IUT support identified region/ISO31661 geographical restriction + */ + //TODO Remove modulepar boolean PICS_ISO31661_REGION_DICTIONARY := true; + + /** + * Does the IUT support ITS-AID for Generic profile? + */ + modulepar boolean PICS_SEC_ITS_AID_OTHER := true; + + /** + * Does the IUT support encryption data? + */ + modulepar boolean PICS_SEC_ENCRYPTION_SUPPORT := true; + +} // End of module LibItsSecurity_Pics diff --git a/ttcn/Security/LibItsSecurity_Pixits.ttcn b/ttcn/Security/LibItsSecurity_Pixits.ttcn index e7a73bcc..93ba77b7 100644 --- a/ttcn/Security/LibItsSecurity_Pixits.ttcn +++ b/ttcn/Security/LibItsSecurity_Pixits.ttcn @@ -1,77 +1,77 @@ -/** - * @author ETSI / STF481 / STF507 / STF517 / STF538 - * @version $URL$ - * $Id$ - * @desc Module containing Pixits for Security Protocol - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsSecurity_Pixits { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; - - /** - * @desc Root path to access certificate stored in files, identified by certficate ID - */ - modulepar charstring PX_CERTIFICATE_POOL_PATH := "data/certificates"; - - /** - * @desc Configuration sub-directory to access certificate stored in files - */ - modulepar charstring PX_IUT_SEC_CONFIG_NAME := ""; - - /** - * @desc The certficate the IUT should use. Default: CERT_IUT_A_AT - * @remark If the IUT cannot use the test certificates, set this PIXIT to CERT_NONE - */ - modulepar charstring PX_IUT_DEFAULT_CERTIFICATE := "CERT_IUT_A_AT"; - - /** - * @desc ITS-AID value for other profile. Default: 38 - */ - modulepar Psid PX_OTHER_ITS_AID := 141; // Assign to GN-MGMT, Other than CA, DEN, MAP, SPAT, IVI, SRE, SSE & GN-MGMT: 38 - - /** - * @desc Invalid protocol version. Default: 2 - */ - modulepar UInt8 PX_WRONG_PROTOCOL_VERSION := 2; - - /** - * @desc Invalid WGS longitude - */ - modulepar SecLongitude PX_WGSLONGITUDE := 0; - - /** - * @desc Invalid WGS latitude. Default: 1 - */ - modulepar SecLatitude PX_WGSLATITUDE := 0; - - /** - * @desc Invalid digest. Default: 1 - */ - modulepar HashedId8 PX_OTHER_CERT_DIGEST := '0000000000000000'O; - - /** - * @desc AES-128-CCM nonce public key - */ - modulepar Oct12 PX_ENCRYPTIONPARAMETERS_AES_128_CCM_NONCE := 'C0FFEEDECAC0FFEEDECA0000'O; - - modulepar CountryOnly PX_GENERATED_CERTIFICATE_REGION_COUNTRY_1 := 250; - - modulepar CountryOnly PX_GENERATED_CERTIFICATE_REGION_COUNTRY_2 := 380; - - modulepar Int16 PX_GENERATED_CERTIFICATE_DURATION := 120; - - modulepar SubjectAssurance PX_GENERATED_CERTIFICATE_SUBJECT_ASSURENCE_LEVEL := '00'O; - -} // End of module LibItsSecurity_Pixits +/** + * @author ETSI / STF481 / STF507 / STF517 / STF538 + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Security/LibItsSecurity_Pixits.ttcn3 $ + * $Id: LibItsSecurity_Pixits.ttcn3 1318 2017-01-26 10:20:53Z filatov $ + * @desc Module containing Pixits for Security Protocol + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * + */ +module LibItsSecurity_Pixits { + + // LibCommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; + + // LibIts + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + import from IEEE1609dot2 language "ASN.1:1997" all; + import from EtsiTs103097Module language "ASN.1:1997" all; + + /** + * @desc Root path to access certificate stored in files, identified by certficate ID + */ + modulepar charstring PX_CERTIFICATE_POOL_PATH := "data/v3/certificates"; + + /** + * @desc Configuration sub-directory to access certificate stored in files + */ + modulepar charstring PX_IUT_SEC_CONFIG_NAME := ""; + + /** + * @desc The certficate the IUT should use. Default: CERT_IUT_A_AT + * @remark If the IUT cannot use the test certificates, set this PIXIT to CERT_NONE + */ + modulepar charstring PX_IUT_DEFAULT_CERTIFICATE := "CERT_IUT_A_AT"; + + /** + * @desc ITS-AID value for other profile. Default: 38 + */ + modulepar Psid PX_OTHER_ITS_AID := 141; // Assign to GN-MGMT, Other than CA, DEN, MAP, SPAT, IVI, SRE, SSE & GN-MGMT: 38 + + /** + * @desc Invalid protocol version. Default: 2 + */ + modulepar UInt8 PX_WRONG_PROTOCOL_VERSION := 2; + + /** + * @desc Invalid WGS longitude + */ + modulepar SecLongitude PX_WGSLONGITUDE := 0; + + /** + * @desc Invalid WGS latitude. Default: 1 + */ + modulepar SecLatitude PX_WGSLATITUDE := 0; + + /** + * @desc Invalid digest. Default: 1 + */ + modulepar HashedId8 PX_OTHER_CERT_DIGEST := '0000000000000000'O; + + /** + * @desc AES-128-CCM nonce public key + */ + modulepar Oct12 PX_ENCRYPTIONPARAMETERS_AES_128_CCM_NONCE := 'C0FFEEDECAC0FFEEDECA0000'O; + + modulepar CountryOnly PX_GENERATED_CERTIFICATE_REGION_COUNTRY_1 := 250; + + modulepar CountryOnly PX_GENERATED_CERTIFICATE_REGION_COUNTRY_2 := 380; + + modulepar Int16 PX_GENERATED_CERTIFICATE_DURATION := 120; + + modulepar SubjectAssurance PX_GENERATED_CERTIFICATE_SUBJECT_ASSURENCE_LEVEL := '00'O; + +} // End of module LibItsSecurity_Pixits diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index 8134e3b2..82bbc0fa 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -1,2087 +1,2087 @@ -/** - * @author ETSI / STF481 / STF507 / STF517 / STF538 / STF545 - * @version $URL$ - * $Id$ - * @desc Module containing templates for Security Protocol - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsSecurity_Templates { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - - // LibItsGeoNetworking - import from LibItsGeoNetworking_TypesAndValues all; - - // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; - - // LibItsSecurity - import from LibItsSecurity_TypesAndValues all; - import from LibItsSecurity_Pixits all; - - /** - * @desc Constants declaration - */ - group constants { - - /** - * @desc Protocol version - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.1 Ieee1609Dot2Data - */ - const UInt8 c_protocol_version := 3; - - /** - * @desc Certificate version - * @see Draft ETSI TS 103 097 V1.3.1 Clause 6.1 Certificate - */ - const UInt8 c_certificate_version := 3; - - /** - * @desc Its AID for Other - * @see Draft ETSI TS 103 097 V1.3.1 Clause 7.3 Security profile for DENMs - */ - template Psid c_its_aid_Other := PX_OTHER_ITS_AID; - - /** - * @desc Minimal value of Longitude - */ - const SecLongitude c_minLongitude := -1799999999; // TODO Use constant from IEEE1609dot2BaseTypes - - /** - * @desc Maximal value of Longitude - */ - const SecLongitude c_maxLongitude := 1800000000; // TODO Use constant from IEEE1609dot2BaseTypes - - /** - * @desc Minimal value of Latitude - */ - const SecLatitude c_minLatitude := -900000000; // TODO Use constant from IEEE1609dot2BaseTypes - - /** - * @desc Maximal value of Latitude - */ - const SecLatitude c_maxLatitude := 900000000; // TODO Use constant from IEEE1609dot2BaseTypes - - /** - * @desc List of ISO-3166 country codes - */ - const SequenceOfUint16 c_iso3166Codes := { - 4, 8, 10, 12, 16, 20, 24, 28, 31, 32, 36, 40, 44, 48, 50, 51, 52, 56, - 60, 64, 68, 70, 72, 74, 76, 84, 86, 90, 92, 96, 100, 104, 108, 112, 116, 120, - 124, 132, 136, 140, 144, 148, 152, 156, 158, 162, 166, 170, 174, 175, 178, 180, 184, 188, - 191, 192, 196, 203, 204, 208, 212, 214, 218, 222, 226, 231, 232, 233, 234, 238, 239, 242, - 246, 248, 250, 254, 258, 260, 262, 266, 268, 270, 275, 276, 288, 292, 296, 300, 304, 308, - 312, 316, 320, 324, 328, 332, 334, 336, 340, 344, 348, 352, 356, 360, 364, 368, 372, 376, - 380, 384, 388, 392, 398, 400, 404, 408, 410, 414, 417, 418, 422, 426, 428, 430, 434, 438, - 440, 442, 446, 450, 454, 458, 462, 466, 470, 474, 478, 480, 484, 492, 496, 498, 499, 500, - 504, 508, 512, 516, 520, 524, 528, 531, 533, 534, 535, 540, 548, 554, 558, 562, 566, 570, - 574, 578, 580, 581, 583, 584, 585, 586, 591, 598, 600, 604, 608, 612, 616, 620, 624, 626, - 630, 634, 638, 642, 643, 646, 652, 654, 659, 660, 662, 663, 666, 670, 674, 678, 682, 686, - 688, 690, 694, 702, 703, 704, 705, 706, 710, 716, 724, 728, 729, 732, 740, 744, 748, 752, - 756, 760, 762, 764, 768, 772, 776, 780, 784, 788, 792, 795, 796, 798, 800, 804, 807, 810, - 818, 826, 831, 832, 833, 834, 840, 850, 854, 858, 860, 862, 876, 882, 887, 894 - }; - - /** - * @desc List of United Nations Statistics Division country codes - */ - const SequenceOfUint16 c_unStatsAdditionalCodes := { - 1, 2, 5, 9, 11, 13, 14, 15, 17, 18, 19, 21, 29, 30, 34, 35, 39, 53, - 54, 57, 61, 142, 143, 145, 150, 151, 154, 155, 199, 419, 432, 680, 722, 830 - }; - - } // End of group constants - - /** - * @desc Dummy send/receive templates for security headers - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4 Basic format elements - */ - group dummyBasicFormatElements { - - /** - * @desc Dummy receive templates for security headers - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2 Specification of basic format elements - */ - group dummyBasicFormatElementsRecv { - - /** - * @desc Dummy receive template for TwoDLocation - * @param p_latitude Latitude range from 900 000 000 to +900 000 000 - * @param p_longitude Longitude range from 1 800 000 000 to +1 800 000 000 - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.19 TwoDLocation - */ - template (present) TwoDLocation mw_twoDLocation_dummy := { - latitude := ?, - longitude := ? - } // End of template mw_twoDLocation_dummy - - /** - * @desc Dummy send template for ThreeDLocation - * @param p_latitude Latitude range from 900 000 000 to +900 000 000 - * @param p_longitude Longitude range from 1 800 000 000 to +1 800 000 000 - * @param p_elevation Elevation relative to the WGS-84 ellipsoid in decimetres - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.20 ThreeDLocation - */ - template (present) ThreeDLocation mw_threeDLocation_dummy := { - latitude := ?, - longitude := ?, - elevation := ? - } // End of template mw_threeDLocation_dummy - - } // End of group dummyBasicFormatElementsRecv - - } // End of group dummyBasicFormatElements - - /** - * @desc Send/receive templates for security headers - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4 Basic format elements - */ - group basicFormatElements { - - /** - * @desc Send templates for security headers - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2 Specification of basic format elements - */ - group basicFormatElementsSend { - - /** - * @desc Send templates for Signature description - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.9 Signature - * @see Draft ETSI TS 103 097 V1.3.1 Table 2: Derivation of field sizes depending on the used algorithm - */ - group signatures { - - /** - * @desc Send template for signatures based on ECDSA algorithm - * @member p_ecdsaSignature The ECDSA based signature - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.9 Signature - */ - template (value) Signature m_signature( - in template (value) EcdsaP256Signature p_ecdsaSignature - ):= { - ecdsaNistP256Signature := p_ecdsaSignature - } // End of template m_signature_ecdsa - - /** - * @desc Send template for ECDSA based signature - * @member p_r The coordinate of the elliptic curve point resulting from multiplying the generator element by the ephemeral private key - * @member p_s The signature - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.10 EcdsaP256Signature - */ - template (value) EcdsaP256Signature m_ecdsaSignature( - in template (value) EccP256CurvePoint p_rSig, - in template (value) octetstring p_sSig - ) := { - rSig := p_rSig, - sSig := p_sSig - } // End of template m_ecdsaSignature - - } // End of group signatures - - group signerInfos { - - /** - * @desc Send template for self signed message - */ - template (value) SignerIdentifier m_signerIdentifier_self := { - self_ := NULL - } // End of template m_signerIdentifier_self - - /** - * @desc Send template for certificate signed message - */ - template (value) SignerIdentifier m_signerIdentifier_certificate( - in template (value) Certificate p_certificate // TODO Use SingleEtsiTs103097Certificate - ) := { - certificate := { p_certificate } // Only one - } // End of template m_signerIdentifier_certificate - - /** - * @desc Send template for digest signed message - */ - template (value) SignerIdentifier m_signerIdentifier_digest( - in template (value) HashedId8 p_digest := '0000000000000000'O - ) := { - digest := p_digest - } // End of template m_signerIdentifier_digest - - /** - * @desc Send template for certificate signed message - */ - template (value) SignerIdentifier m_signerIdentifier_certificates( - in template (value) SequenceOfCertificate p_certificates := {} - ) := { - certificate := p_certificates - } // End of template m_signerIdentifier_certificates - - } // End of group signerInfos - - /** - * @desc Send template for TwoDLocation - * @param p_latitude Latitude range from 900 000 000 to +900 000 000 - * @param p_longitude Longitude range from 1 800 000 000 to +1 800 000 000 - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.19 TwoDLocation - */ - template (value) TwoDLocation m_twoDLocation( - in template (value) SecLatitude p_latitude, - in template (value) SecLongitude p_longitude - ) := { - latitude := p_latitude, - longitude := p_longitude - } // End of template m_twoDLocation - - /** - * @desc Send template for ThreeDLocation - * @param p_latitude Latitude range from 900 000 000 to +900 000 000 - * @param p_longitude Longitude range from 1 800 000 000 to +1 800 000 000 - * @param p_elevation Elevation relative to the WGS-84 ellipsoid in decimetres - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.20 ThreeDLocation - */ - template (value) ThreeDLocation m_threeDLocation( - in template (value) SecLatitude p_latitude, - in template (value) SecLongitude p_longitude, - in template (value) SecElevation p_elevation - ) := { - latitude := p_latitude, - longitude := p_longitude, - elevation := p_elevation - } // End of template m_threeDLocation - - /** - * @desc Send template circular geographic region - * @param p_center Circle center - * @param p_radius Circle radius - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion - */ - template (value) GeographicRegion m_geographicRegion_circle( - in template (value) TwoDLocation p_center, - in template (value) UInt16 p_radius - ) := { - circularRegion := { - center := p_center, - radius := p_radius - } - } // End of template m_geographicRegion_circle - - /** - * @desc Send template rectangular geographic region - * @param p_northwest Upper left corner - * @param p_southeast Lower rigth corner - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion - */ - template (value) GeographicRegion m_geographicRegion_rectangular( - in template (value) TwoDLocation p_northwest, - in template (value) TwoDLocation p_southeast - ) := { - rectangularRegion := { - { - northWest := p_northwest, - southEast := p_southeast - } - } - } // End of template m_geographicRegion_rectangular - - /** - * @desc Send template polygonial geographic region - * @param p_polygonal_region Polygonial region description - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion - */ - template (value) GeographicRegion m_geographicRegion_polygonial( - in template (value) PolygonalRegion p_polygonal_region - ) := { - polygonalRegion := p_polygonal_region - } // End of template m_geographicRegion_polygonial - - /** - * @desc Send template for geographic identified region - * @param p_identifiedRegion Indentified region - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion - */ - template (value) GeographicRegion m_geographicRegion_identifiedRegion( - in template (value) SequenceOfIdentifiedRegion p_identifiedRegions - ) := { - identifiedRegion := p_identifiedRegions - } // End of template m_geographicRegion_identifiedRegion - - template (value) IdentifiedRegion m_identifiedRegion_country_only( - in template (value) CountryOnly p_countryOnly - ) := { - countryOnly := p_countryOnly - } // End of template m_identifiedRegion_country_only - - template (value) IdentifiedRegion m_identifiedRegion_country_and_region( - in template (value) CountryOnly p_countryOnly, - in template (value) SequenceOfUint8 p_regions - ) := { - countryAndRegions := { - countryOnly := p_countryOnly, - regions := p_regions - } - } // End of template m_identifiedRegion_country_and_region - - } // End of group basicFormatElementsSend - - /** - * @desc Receive templates for security headers - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2 Specification of basic format elements - */ - group basicFormatElementsRecv { - - group signerIdentifiers { - - /** - * @desc Recv template for message signed with digest - */ - template (present) SignerIdentifier mw_signerIdentifier_digest( - in template (present) HashedId8 p_digest := ? - ) := { - digest := p_digest - } // End of template mw_signerIdentifier_digest - - template (present) SignerIdentifier mw_signerIdentifier_certificate( - in template (present) EtsiTs103097Certificate p_certificate := ? - ) := { - certificate := { p_certificate } - } // End of template m_signerIdentifier_certificate - - template (present) SignerIdentifier mw_signerIdentifier_certificates( - in template (present) SequenceOfCertificate p_certificates := ? - ) := { - certificate := p_certificates - } // End of template mw_signerIdentifier_certificates - - } // End of group signerIdentifiers - - /** - * @desc Receive templates for Signature description - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.9 Signature - * @see Draft ETSI TS 103 097 V1.3.1 Table 2: Derivation of field sizes depending on the used algorithm - */ - group signatures { - - /** - * @desc Receive template for signatures based on ECDSA algorithm - * @member p_ecdsaSignature The ECDSA based signature - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.9 Signature - */ - template (present) Signature mw_signature( - in template (present) EcdsaP256Signature p_ecdsaSignature := ? - ):= { - ecdsaNistP256Signature := p_ecdsaSignature - } // End of template mw_signature - - /** - * @desc Receive template for ECDSA based signature - * @member p_r The coordinate of the elliptic curve point resulting from multiplying the generator element by the ephemeral private key - * @member p_s The signature - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.10 EcdsaP256Signature - */ - template (present) EcdsaP256Signature mw_ecdsaSignature( - in template (present) EccP256CurvePoint p_rSig := ?, - in template (present) octetstring p_sSig := ? - ) := { - rSig := p_rSig, - sSig := p_sSig - } // End of template mw_ecdsaSignature - - } // End of group signatures - - /** - * @desc Receive template for TwoDLocation - * @param p_latitude Latitude range from 900 000 000 to +900 000 000 - * @param p_longitude Longitude range from 1 800 000 000 to +1 800 000 000 - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.19 TwoDLocation - */ - template (present) TwoDLocation mw_twoDLocation( - in template (present) SecLatitude p_latitude, - in template (present) SecLongitude p_longitude - ) := { - latitude := p_latitude, - longitude := p_longitude - } // End of template mw_twoDLocation - - /** - * @desc Receive template for ThreeDLocation - * @param p_latitude Latitude range from 900 000 000 to +900 000 000 - * @param p_longitude Longitude range from 1 800 000 000 to +1 800 000 000 - * @param p_elevation Elevation relative to the WGS-84 ellipsoid in decimetres - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.20 ThreeDLocation - */ - template (present) ThreeDLocation mw_threeDLocation( - in template (present) SecLatitude p_latitude, - in template (present) SecLongitude p_longitude, - in template (present) SecElevation p_elevation - ) := { - latitude := p_latitude, - longitude := p_longitude, - elevation := p_elevation - } // End of template mw_threeDLocation - - /** - * @desc Receive template circular geographic region - * @param p_center Circle center - * @param p_radius Circle radius - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion - */ - template (present) GeographicRegion mw_geographicRegion_circle( - in template (present) TwoDLocation p_center := ?, - in template (present) UInt16 p_radius := ? - ) := { - circularRegion := { - center := p_center, - radius := p_radius - } - } // End of template mw_geographicRegion_circle - - /** - * @desc Basic receive template rectangular geographic region - * @param p_northwest Upper left corner - * @param p_southeast Lower rigth corner - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion - */ - template (present) GeographicRegion mw_geographicRegion_rectangular := { - rectangularRegion := ? - } // End of template mw_geographicRegion_rectangular - - /** - * @desc Receive template polygonial geographic region - * @param p_polygonal_region Polygonial region description - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion - */ - template (present) GeographicRegion mw_geographicRegion_polygonal( - in template (present) PolygonalRegion p_polygonal_region := ? - ) := { - polygonalRegion := p_polygonal_region - } // End of template mw_geographicRegion_polygonial - - /** - * @desc Receive template for geographic identified region - * @param p_identifiedRegion Indentified region - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion - */ - template (present) GeographicRegion mw_geographicRegion_identified( - in template (present) SequenceOfIdentifiedRegion p_identifiedRegion := ? - ) := { - identifiedRegion := p_identifiedRegion - } // End of template mw_geographicRegion_identifiedRegion - - template (present) IdentifiedRegion mw_identifiedRegion_country_only - := { - countryOnly := ?// FIXME ((all from c_iso3166Codes), (all from c_unStatsAdditionalCodes)) - } - - template (present) IdentifiedRegion mw_identifiedRegion_country_and_region := { - countryAndRegions := { - countryOnly := ?, // FIXME ((all from c_iso3166Codes), (all from c_unStatsAdditionalCodes)), - regions := ? - } - } - - } // End of group basicFormatElementsRecv - - } // End of group dummyBasicFormatElements - - /** - * @desc Send templates for security headers - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.1 EtsiTs103097Data - */ - group etsiTs103097Data { - - /** - * @desc Generic send template for EtsiTs103097Data message - */ - template (value) EtsiTs103097Data m_etsiTs103097Data( - in template (value) Ieee1609Dot2Content p_content - ) := { - protocolVersion := c_protocol_version, - content := p_content - } // End of template m_etsiTs103097Data - - /** - * @desc Generic receive template for EtsiTs103097Data message - */ - template (present) EtsiTs103097Data mw_etsiTs103097Data( - template (present) Ieee1609Dot2Content p_content := ? - ) := { - protocolVersion := c_protocol_version, - content := p_content - } // End of template mw_etsiTs103097Data - - template (value) EtsiTs103097Data m_etsiTs103097Data_unsecured( - in template (value) Opaque p_unsecuredData - ) := { - protocolVersion := c_protocol_version, - content := { unsecuredData := p_unsecuredData } - } // End of template m_secured_data_unsecured - - template (value) EtsiTs103097Data m_etsiTs103097Data_signed( - in template (value) SignedData p_signedData - ) := { - protocolVersion := c_protocol_version, - content := { signedData := p_signedData } - } // End of template m_secured_data_signed - - template (present) EtsiTs103097Data mw_etsiTs103097Data_signed( - template (present) SignedData p_signedData := ? - ) := { - protocolVersion := c_protocol_version, - content := { signedData := p_signedData } - } // End of template mw_secured_data_signed - - template (value) EtsiTs103097Data m_etsiTs103097Data_encrypted( - in template (value) EncryptedData p_encryptedData - ) := { - protocolVersion := c_protocol_version, - content := { encryptedData := p_encryptedData } - } // End of template m_etsiTs103097Data_encrypted - - template (present) EtsiTs103097Data mw_etsiTs103097Data_encrypted( - template (present) EncryptedData p_encryptedData := ? - ) := { - protocolVersion := c_protocol_version, - content := { encryptedData := p_encryptedData } - } // End of template mw_etsiTs103097Data_encrypted - - /** - * @desc Generic send template for EtsiTs103097Data message - */ - template (value) EtsiTs103097Data m_etsiTs103097Data_wrong_protocol( - in template (value) UInt8 p_protocol_version, - in template (value) Ieee1609Dot2Content p_content - ) := { - protocolVersion := c_protocol_version, - content := p_content - } // End of template m_etsiTs103097Data_wrong_protocol - - } // End of group etsiTs103097Data - - /** - * @desc Send templates for ToBeSignedData header - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 SignedData - */ - group signedData { - - template (value) SignedData m_signedData( - in template (value) HashAlgorithm p_hashId, - in template (value) ToBeSignedData p_tbsData, - in template (value) SignerIdentifier p_signer, - in template (value) Signature p_signature_ - ) := { - hashId := p_hashId, - tbsData := p_tbsData, - signer := p_signer, - signature_ := p_signature_ - } // End of template m_signedData - - template (present) SignedData mw_signedData( - template (present) HashAlgorithm p_hashId := ?, - template (present) ToBeSignedData p_tbsData := ?, - template (present) SignerIdentifier p_signer := ?, - template (present) Signature p_signature_ := ? - ) := { - hashId := p_hashId, - tbsData := p_tbsData, - signer := p_signer, - signature_ := p_signature_ - } // End of template mw_signedData - - template (value) ToBeSignedData m_toBeSignedData( - in template (value) SignedDataPayload p_payload, - in template (value) HeaderInfo p_headerInfo - ) := { - payload := p_payload, - headerInfo := p_headerInfo - } // End of template m_toBeSignedData - - template (present) ToBeSignedData mw_toBeSignedData( - template (present) SignedDataPayload p_payload := ?, - template (present) HeaderInfo p_headerInfo := ? - ) := { - payload := p_payload, - headerInfo := p_headerInfo - } // End of template mw_toBeSignedData - - template (value) SignedDataPayload m_signedDataPayload( - in template (value) Ieee1609Dot2Data p_data - ) := { - data := p_data, - extDataHash := omit - } // End of template m_signedDataPayload - - template (present) SignedDataPayload mw_signedDataPayload( - template (present) Ieee1609Dot2Data p_data := ? - ) := { - data := p_data, - extDataHash := * - } // End of template mw_signedDataPayload - - template (value) SignedDataPayload m_signedDataPayload_ext( - in template (value) Oct32 p_extDataHash - ) := { - data := omit, - extDataHash := { sha256HashedData := p_extDataHash } - } // End of template m_signedDataPayload_ext - - } // End of group signedData - - /** - * @desc Send templates for ToBeSignedData header - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.3 EncryptedData - */ - group encryptedData { - - template (value) EncryptedData m_encryptedData( - in template (value) SequenceOfRecipientInfo p_recipients, - in template (value) SymmetricCiphertext p_ciphertex - ) := { - recipients := p_recipients, - ciphertext := p_ciphertex - } // End of template m_encryptedData - - template (present) EncryptedData mw_encryptedData( - template (present) SequenceOfRecipientInfo p_recipients := ?, - template (present) SymmetricCiphertext p_ciphertex := ? - ) := { - recipients := p_recipients, - ciphertext := p_ciphertex - } // End of template mw_encryptedData - - template (value) RecipientInfo m_recipientInfo_pskRecipInfo( - in template (value) PreSharedKeyRecipientInfo p_pskRecipInfo - ) := { - pskRecipInfo := p_pskRecipInfo - } // End of template m_recipientInfo_pskRecipInfo - - template (present) RecipientInfo mw_recipientInfo_pskRecipInfo( - template (present) PreSharedKeyRecipientInfo p_pskRecipInfo := ? - ) := { - pskRecipInfo := p_pskRecipInfo - } // End of template mw_recipientInfo_pskRecipInfo - - template (value) RecipientInfo m_recipientInfo_symmRecipInfo( - in template (value) SymmRecipientInfo p_symmRecipInfo - ) := { - symmRecipInfo := p_symmRecipInfo - } // End of template m_recipientInfo_symmRecipInfo - - template (value) RecipientInfo m_recipientInfo_certRecipInfo( - in template (value) PKRecipientInfo p_certRecipInfo - ) := { - certRecipInfo := p_certRecipInfo - } // End of template m_recipientInfo_certRecipInfo - - template (present) RecipientInfo mw_recipientInfo_certRecipInfo( - template (present) PKRecipientInfo p_certRecipInfo := ? - ) := { - certRecipInfo := p_certRecipInfo - } // End of template mw_recipientInfo_certRecipInfo - - template (value) RecipientInfo m_recipientInfo_signedDataRecipInfo( - in template (value) PKRecipientInfo p_signedDataRecipInfo - ) := { - signedDataRecipInfo := p_signedDataRecipInfo - } // End of template m_recipientInfo_signedDataRecipInfo - - template (value) RecipientInfo m_recipientInfo_rekRecipInfo( - in template (value) PKRecipientInfo p_rekRecipInfo - ) := { - rekRecipInfo := p_rekRecipInfo - } // End of template m_recipientInfo_rekRecipInfo - - template (value) PKRecipientInfo m_pKRecipientInfo( - in template (value) HashedId8 p_recipientId, - in template (value) EncryptedDataEncryptionKey p_encKey - ) := { - recipientId := p_recipientId, - encKey := p_encKey - } // End of template m_pKRecipientInfo - - template (present) PKRecipientInfo mw_pKRecipientInfo( - template (present) HashedId8 p_recipientId := ?, - template (present) EncryptedDataEncryptionKey p_encKey := ? - ) := { - recipientId := p_recipientId, - encKey := p_encKey - } // End of template mw_pKRecipientInfo - - template (value) EciesP256EncryptedKey m_evciesP256EncryptedKey( - in template (value) EccP256CurvePoint p_v, - in template (value) Oct16 p_c, - in template (value) Oct16 p_t - ) :={ - v := p_v, - c := p_c, - t := p_t - } // End of template m_evciesP256EncryptedKey - - template (present) EciesP256EncryptedKey mw_evciesP256EncryptedKey( - template (present) EccP256CurvePoint p_v := ?, - template (present) Oct16 p_c := ?, - template (present) Oct16 p_t := ? - ) :={ - v := p_v, - c := p_c, - t := p_t - } // End of template mw_evciesP256EncryptedKey - - template (value) EncryptedDataEncryptionKey m_encryptedDataEncryptionKey_eciesNistP256( - in template (value) EciesP256EncryptedKey p_eciesNistP256 - ) := { - eciesNistP256 := p_eciesNistP256 - } // End of template m_encryptedDataEncryptionKey_eciesNistP256 - - template (present) EncryptedDataEncryptionKey mw_encryptedDataEncryptionKey_eciesNistP256( - template (present) EciesP256EncryptedKey p_eciesNistP256 := ? - ) := { - eciesNistP256 := p_eciesNistP256 - } // End of template mw_encryptedDataEncryptionKey_eciesNistP256 - - template (value) EncryptedDataEncryptionKey m_encryptedDataEncryptionKey_eciesBrainpoolP256r1( - in template (value) EciesP256EncryptedKey p_eciesBrainpoolP256r1 - ) := { - eciesBrainpoolP256r1 := p_eciesBrainpoolP256r1 - } // End of template m_encryptedDataEncryptionKey_eciesBrainpoolP256r1 - - template (present) EncryptedDataEncryptionKey mw_encryptedDataEncryptionKey_eciesBrainpoolP256r1( - template (present) EciesP256EncryptedKey p_eciesBrainpoolP256r1 := ? - ) := { - eciesBrainpoolP256r1 := p_eciesBrainpoolP256r1 - } // End of template mw_encryptedDataEncryptionKey_eciesBrainpoolP256r1 - - template (value) SymmetricCiphertext m_SymmetricCiphertext_aes128ccm( - in template (value) AesCcmCiphertext p_aes128ccm - ) := { - aes128ccm := p_aes128ccm - } // End of template m_SymmetricCiphertext_aes128ccm - - template (present) SymmetricCiphertext mw_SymmetricCiphertext_aes128ccm( - template (present) AesCcmCiphertext p_aes128ccm := ? - ) := { - aes128ccm := p_aes128ccm - } // End of template mw_SymmetricCiphertext_aes128ccm - - template (value) AesCcmCiphertext m_aesCcmCiphertext( - in template (value) Oct12 p_nonce, - in template (value) Opaque p_ccmCiphertext - ) := { - nonce := p_nonce, - ccmCiphertext := p_ccmCiphertext - } // End of template m_aesCcmCiphertext - - template (present) AesCcmCiphertext mw_aesCcmCiphertext( - template (present) Oct12 p_nonce := ?, - template (present) Opaque p_ccmCiphertext := ? - ) := { - nonce := p_nonce, - ccmCiphertext := p_ccmCiphertext - } // End of template mw_aesCcmCiphertext - - } // End of group encryptedData - - /** - * @desc Send/Receive templates for Payload - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload - */ - group ieee1609Dot2Data { - - /** - * @desc Send template for Ieee1609Dot2Data - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload - */ - template (value) Ieee1609Dot2Data m_ieee1609Dot2Data( - in template (value) Ieee1609Dot2Content p_content - ) := { - protocolVersion := c_protocol_version, - content := p_content - } // End of template m_ieee1609Dot2Data - - /** - * @desc Receive template for Ieee1609Dot2Data - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload - */ - template (present) Ieee1609Dot2Data mw_ieee1609Dot2Data( - template (present) Ieee1609Dot2Content p_content := ? - ) := { - protocolVersion := c_protocol_version, - content := p_content - } // End of template mw_ieee1609Dot2Data - - /** - * @desc Send template for 'unsecured' Payload - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload - */ - template (value) Ieee1609Dot2Content m_ieee1609Dot2Data_unsecured( - in template (value) Opaque p_unsecuredData - ) := { - unsecuredData := p_unsecuredData - } // End of template m_ieee1609Dot2Data_unsecured - - /** - * @desc Receive template for 'unsecured' Payload - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload - */ - template (present) Ieee1609Dot2Content mw_ieee1609Dot2Data_unsecured( - template (present) Opaque p_unsecuredData := ? - ) := { - unsecuredData := p_unsecuredData - } // End of template mw_ieee1609Dot2Data_unsecured - - /** - * @desc Send template for 'signed' Payload - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload - */ - template (value) Ieee1609Dot2Content m_ieee1609Dot2Data_signed( - in template (value) SignedData p_signedData - ) := { - signedData := p_signedData - } // End of template m_ieee1609Dot2Data_signed - - /** - * @desc Send template for 'signed' Payload - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload - */ - template (present) Ieee1609Dot2Content mw_ieee1609Dot2Data_signed( - template (present) SignedData p_signedData := ? - ) := { - signedData := p_signedData - } // End of template mw_ieee1609Dot2Data_signed - - } // End of group ieee1609Dot2Data - - /** - * @desc Send/Receive templates for HeaderInfo - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.4 HeaderInfo - */ - group headerFields { - - /** - * @desc Basic send HeaderInfo template with ETSI ITS restrction - */ - template (omit) HeaderInfo m_ieee1609Dot2_headerInfo( - in template (value) Psid p_psid - ) := { - psid := p_psid, - generationTime := omit, - expiryTime := omit, - generationLocation := omit, - p2pcdLearningRequest := omit, - missingCrlIdentifier := omit, - encryptionKey := omit, - inlineP2pcdRequest := omit, - requestedCertificate := omit - } // End of template m_ieee1609Dot2_headerInfo - - /** - * @desc Basic receive HeaderInfo template with ETSI ITS restrction - */ - template (present) HeaderInfo mw_ieee1609Dot2_headerInfo( - template (present) Psid p_psid := ? - ) := { - psid := p_psid, - generationTime := *, - expiryTime := *, - generationLocation := *, - p2pcdLearningRequest := omit, - missingCrlIdentifier := omit, - encryptionKey := omit, - inlineP2pcdRequest := omit, - requestedCertificate := omit - } // End of template mw_ieee1609Dot2_headerInfo - - /** - * @desc Basic receive HeaderInfo template with ETSI ITS restrction - */ - template (present) HeaderInfo mw_ieee1609Dot2_headerInfo_request_certificate( - template (present) Psid p_psid := ?, - template (present) Certificate p_requestedCertificate := ? - ) modifies mw_ieee1609Dot2_headerInfo := { - psid := p_psid, - generationTime := *, - expiryTime := *, - generationLocation := *, - p2pcdLearningRequest := omit, - missingCrlIdentifier := omit, - encryptionKey := omit, - inlineP2pcdRequest := omit, - requestedCertificate := p_requestedCertificate - } // End of template mw_ieee1609Dot2_headerInfo - - /** - * @desc CAM specific send HeaderInfo template with ETSI ITS restrction - * - * @see Clause 7.1.1 Security profile for CAMs - */ - template (omit) HeaderInfo m_headerInfo_cam( - in template (value) Psid p_psid := c_its_aid_CAM, - in template (value) Time64 p_generationTime, - in template (omit) Time64 p_expiryTime := omit, - in template (omit) SequenceOfHashedId3 p_inlineP2pcdRequest := omit - ) modifies m_ieee1609Dot2_headerInfo := { - generationTime := p_generationTime, - expiryTime := p_expiryTime, - generationLocation := omit, - inlineP2pcdRequest := p_inlineP2pcdRequest - } // End of template m_headerInfo_cam - - /** - * @desc CAM specific receive HeaderInfo template with ETSI ITS restrction - * - * Clause 7.1.1 Security profile for CAMs - */ - template (present) HeaderInfo mw_headerInfo_cam( - template (present) Psid p_psid := c_its_aid_CAM, - template (present) Time64 p_generationTime := ?, - template SequenceOfHashedId3 p_inlineP2pcdRequest := omit, - template Certificate p_requestedCertificate := omit - ) modifies mw_ieee1609Dot2_headerInfo := { - psid := c_its_aid_CAM, - generationTime := p_generationTime, - expiryTime := omit, - generationLocation := omit, - inlineP2pcdRequest := p_inlineP2pcdRequest, - requestedCertificate := p_requestedCertificate - } // End of template mw_headerInfo_cam - - /** - * - * Clause 7.1.2 Security profile for DENMs - */ - template (omit) HeaderInfo m_headerInfo_denm( - in template (value) Psid p_psid := c_its_aid_DENM, - in template (value) Time64 p_generationTime, - in template (value) ThreeDLocation p_generationLocation, - in template (omit) Time64 p_expiryTime := omit - ) modifies m_ieee1609Dot2_headerInfo := { - generationTime := p_generationTime, - expiryTime := p_expiryTime, - generationLocation := p_generationLocation - } // End of template m_headerInfo_denm - - /** - * - * Clause 7.1.2 Security profile for DENMs - */ - template (present) HeaderInfo mw_headerInfo_denm( - template (present) Psid p_psid := c_its_aid_DENM, - template (present) Time64 p_generationTime := ?, - template (present) ThreeDLocation p_generationLocation := ?, - template Time64 p_expiryTime := omit - ) modifies mw_ieee1609Dot2_headerInfo := { - generationTime := p_generationTime, - expiryTime := p_expiryTime, - generationLocation := p_generationLocation - } // End of template mw_headerInfo_denm - - /** - * - * Clause 7.1.3 Generic security profile for other signed messages - */ - template (omit) HeaderInfo m_headerInfo_gn( - in template (value) Psid p_psid := c_its_aid_GN, - in template (value) Time64 p_generationTime - ) modifies m_ieee1609Dot2_headerInfo := { - generationTime := p_generationTime - } // End of template m_headerInfo_gn - - /** - * - * Clause 7.1.3 Generic security profile for other signed messages - */ - template (present) HeaderInfo mw_headerInfo_gn( - template (present) Psid p_psid := c_its_aid_GN, - template (present) Time64 p_generationTime := ? - ) modifies mw_ieee1609Dot2_headerInfo := { - generationTime := p_generationTime, - expiryTime := *, - generationLocation := *, - encryptionKey := *, - inlineP2pcdRequest := *, - requestedCertificate := * - } // End of template mw_headerInfo_gn - - template (omit) HeaderInfo m_headerInfo_inner_pki_request( - in template (value) Psid p_psid := c_its_aid_SCR, - in template (value) Time64 p_generationTime - ) modifies m_ieee1609Dot2_headerInfo := { - generationTime := p_generationTime - }; - - template (omit) HeaderInfo m_headerInfo_inner_pki_response( - in template (value) Psid p_psid := c_its_aid_SCR, - in template (value) Time64 p_generationTime - ) modifies m_ieee1609Dot2_headerInfo := { - generationTime := p_generationTime - }; - - template (present) HeaderInfo mw_headerInfo_inner_pki_request( - template (present) Psid p_psid := c_its_aid_SCR, - template (present) Time64 p_generationTime := ? - ) modifies mw_headerInfo_gn := {}; - - template HeaderInfo mw_headerInfo_inner_pki_response( - template (present) Psid p_psid := c_its_aid_SCR, - template Time64 p_generationTime := * - ) modifies mw_ieee1609Dot2_headerInfo := { - generationTime := p_generationTime, - expiryTime := omit, - generationLocation := omit - } - - } // End of group headerFields - - group signatures { - - template (value) Signature m_signature_ecdsaNistP256( - in template (value) EcdsaP256Signature p_ecdsaNistP256Signature - ) := { - ecdsaNistP256Signature := p_ecdsaNistP256Signature - } // End of template m_signature_ecdsaNistP256 - - template (present) Signature mw_signature_ecdsaNistP256( - template (present) EcdsaP256Signature p_ecdsaNistP256Signature := ? - ) := { - ecdsaNistP256Signature := p_ecdsaNistP256Signature - } // End of template mw_signature_ecdsaNistP256 - - template (value) Signature m_signature_ecdsaBrainpoolP256r1( - in template (value) EcdsaP256Signature p_ecdsaBrainpoolP256r1Signature - ) := { - ecdsaBrainpoolP256r1Signature := p_ecdsaBrainpoolP256r1Signature - } // End of template m_signature_ecdsaBrainpoolP256r1 - - template (present) Signature mw_signature_ecdsaBrainpoolP256r1( - template (present) EcdsaP256Signature p_ecdsaBrainpoolP256r1Signature := ? - ) := { - ecdsaBrainpoolP256r1Signature := p_ecdsaBrainpoolP256r1Signature - } // End of template m_signature_ecdsaBrainpoolP256r1 - - template (value) Signature m_signature_ecdsaBrainpoolP384r1( - in template (value) EcdsaP384Signature p_ecdsaBrainpoolP384r1Signature - ) := { - ecdsaBrainpoolP384r1Signature := p_ecdsaBrainpoolP384r1Signature - } // End of template m_signature_ecdsaBrainpoolP384r1 - - template (present) Signature mw_signature_ecdsaBrainpoolP384r1( - template (present) EcdsaP384Signature p_ecdsaBrainpoolP384r1Signature := ? - ) := { - ecdsaBrainpoolP384r1Signature := p_ecdsaBrainpoolP384r1Signature - } // End of template mw_signature_ecdsaBrainpoolP384r1 - - template (value) EcdsaP256Signature m_ecdsaP256Signature( - in template (value) EccP256CurvePoint p_rSig, - in template (value) Oct32 p_sSig - ) := { - rSig := p_rSig, - sSig := p_sSig - } // End of template m_ecdsaP256Signature - - template (present) EcdsaP256Signature mw_ecdsaP256Signature( - template (present) EccP256CurvePoint p_rSig := ?, - template (present) Oct32 p_sSig := ? - ) := { - rSig := p_rSig, - sSig := p_sSig - } // End of template mw_ecdsaP256Signature - - template (value) EcdsaP384Signature m_ecdsaP384Signature( - in template (value) EccP384CurvePoint p_rSig, - in template (value) Oct48 p_sSig - ) := { - rSig := p_rSig, - sSig := p_sSig - } // End of template m_ecdsaP384Signature - - template (present) EcdsaP384Signature mw_ecdsaP384Signature( - template (present) EccP384CurvePoint p_rSig := ?, - template (present) Oct48 p_sSig := ? - ) := { - rSig := p_rSig, - sSig := p_sSig - } // End of template mw_ecdsaP384Signature - - template (value) EccP256CurvePoint m_eccP256CurvePoint_x_only( - in template (value) Oct32 p_x_only - ) := { - x_only := p_x_only - } // End of template m_eccP256CurvePoint_x_only - - template (present) EccP256CurvePoint mw_eccP256CurvePoint_x_only( - template (present) Oct32 p_x_only := ? - ) := { - x_only := p_x_only - } // End of template mw_eccP256CurvePoint_x_only - - template (value) EccP256CurvePoint m_eccP256CurvePoint_compressed_y_0( - in template (value) Oct32 p_compressed_y_0 - ) := { - compressed_y_0 := p_compressed_y_0 - } // End of template m_eccP256CurvePoint_compressed_y_0 - - template (present) EccP256CurvePoint mw_eccP256CurvePoint_compressed_y_0( - template (present) Oct32 p_compressed_y_0 := ? - ) := { - compressed_y_0 := p_compressed_y_0 - } // End of template mw_eccP256CurvePoint_compressed_y_0 - - template (value) EccP256CurvePoint m_eccP256CurvePoint_compressed_y_1( - in template (value) Oct32 p_compressed_y_1 - ) := { - compressed_y_1 := p_compressed_y_1 - } // End of template m_eccP256CurvePoint_compressed_y_1 - - template (present) EccP256CurvePoint mw_eccP256CurvePoint_compressed_y_1( - template (present) Oct32 p_compressed_y_1 := ? - ) := { - compressed_y_1 := p_compressed_y_1 - } // End of template mw_eccP256CurvePoint_compressed_y_1 - - template (value) EccP256CurvePoint m_eccP256CurvePoint_uncompressed( - in template (value) Oct32 p_x, - in template (value) Oct32 p_y - ) := { - uncompressedP256 := { - x := p_x, - y := p_y - } - } // End of template m_eccP256CurvePoint_uncompressed - - template (present) EccP256CurvePoint mw_eccP256CurvePoint_uncompressed( - template (present) Oct32 p_x := ?, - template (present) Oct32 p_y := ? - ) := { - uncompressedP256 := { - x := p_x, - y := p_y - } - } // End of template mw_eccP256CurvePoint_uncompressed - - template (value) EccP384CurvePoint m_eccP384CurvePoint_x_only( - in template (value) Oct48 p_x_only - ) := { - x_only := p_x_only - } // End of template m_eccP384CurvePoint_x_only - - template (present) EccP384CurvePoint mw_eccP384CurvePoint_x_only( - template (present) Oct48 p_x_only := ? - ) := { - x_only := p_x_only - } // End of template mw_eccP384CurvePoint_x_only - - template (value) EccP384CurvePoint m_eccP384CurvePoint_compressed_y_0( - in template (value) Oct48 p_compressed_y_0 - ) := { - compressed_y_0 := p_compressed_y_0 - } // End of template m_eccP384CurvePoint_compressed_y_0 - - template (present) EccP384CurvePoint mw_eccP384CurvePoint_compressed_y_0( - template (present) Oct48 p_compressed_y_0 := ? - ) := { - compressed_y_0 := p_compressed_y_0 - } // End of template mw_eccP384CurvePoint_compressed_y_0 - - template (value) EccP384CurvePoint m_eccP384CurvePoint_compressed_y_1( - in template (value) Oct48 p_compressed_y_1 - ) := { - compressed_y_1 := p_compressed_y_1 - } // End of template m_eccP384CurvePoint_compressed_y_1 - - template (present) EccP384CurvePoint mw_eccP384CurvePoint_compressed_y_1( - template (present) Oct48 p_compressed_y_1 := ? - ) := { - compressed_y_1 := p_compressed_y_1 - } // End of template mw_eccP384CurvePoint_compressed_y_1 - - template (value) EccP384CurvePoint m_eccP384CurvePoint_uncompressed( - in template (value) Oct48 p_x, - in template (value) Oct48 p_y - ) := { - uncompressedP384 := { - x := p_x, - y := p_y - } - } // End of template m_eccP384CurvePoint_uncompressed - - template (present) EccP384CurvePoint mw_eccP384CurvePoint_uncompressed( - template (present) Oct48 p_x := ?, - template (present) Oct48 p_y := ? - ) := { - uncompressedP384 := { - x := p_x, - y := p_y - } - } // End of template mw_eccP384CurvePoint_uncompressed - - } // End of group signatures - - /** - * @desc Dummy send/receive templates for certificates - * @see Draft ETSI TS 103 097 V1.3.1 Clause 6 Specification of certificate format - */ - group certificates { - - /** - * @desc Send certificate template of type explicit (signature is included) - * @member p_signer_info Signer information - * @member p_subject_info The subject information - * @member p_subject_attributes List of subject attribute - * @member p_validity_restrictions List of validity restriction - * @member p_signature The signature - * @see Draft ETSI TS 103 097 V1.3.1 Clause 6.1 Certificate - */ - template (omit) EtsiTs103097Certificate m_etsiTs103097Certificate( - in template (value) IssuerIdentifier p_issuer, - in template (value) ToBeSignedCertificate p_toBeSigned, - in template (omit) Signature p_signature_ := omit - ) := { - version := c_certificate_version, - type_ := explicit, - issuer := p_issuer, - toBeSigned := p_toBeSigned, - signature_ := p_signature_ - } // End of template m_etsiTs103097Certificate - - /** - * @desc Send certificate template of type explicit (signature is included) - * @member p_signer_info Signer information - * @member p_subject_info The subject information - * @member p_subject_attributes List of subject attribute - * @member p_validity_restrictions List of validity restriction - * @member p_signature The signature - * @see Draft ETSI TS 103 097 V1.3.1 Clause 6.1 Certificate - */ - template (present) EtsiTs103097Certificate mw_etsiTs103097Certificate( - template (present) IssuerIdentifier p_issuer := ?, - template (present) ToBeSignedCertificate p_toBeSigned := ?, - template (present) Signature p_signature_ := ? - ) := { - version := c_certificate_version, - type_ := explicit, - issuer := p_issuer, - toBeSigned := p_toBeSigned, - signature_ := p_signature_ - } // End of template mw_etsiTs103097Certificate - - } // End of group certificates - - group issuerIdentifier { - - template (value) IssuerIdentifier m_issuerIdentifier_self( - in template (value) HashAlgorithm p_self := sha256 - ) := { - self_ := p_self - } // End of template m_issuerIdentifier_self - - template (present) IssuerIdentifier mw_issuerIdentifier_self( - template (present) HashAlgorithm p_self := ? - ) := { - self_ := p_self - } // End of template mw_issuerIdentifier_self - - template (value) IssuerIdentifier m_issuerIdentifier_sha256AndDigest( // FIXME Add opque field for unknown issuer? - in template (value) HashedId8 p_sha256AndDigest - ) := { - sha256AndDigest := p_sha256AndDigest - } // End of template m_issuerIdentifier_sha256AndDigest - - template (present) IssuerIdentifier mw_issuerIdentifier_sha256AndDigest( // FIXME Add opque field for unknown issuer? - template (present) HashedId8 p_sha256AndDigest := ? - ) := { - sha256AndDigest := p_sha256AndDigest - } // End of template mw_issuerIdentifier_sha256AndDigest - - template (value) IssuerIdentifier m_issuerIdentifier_sha384AndDigest( - in template (value) HashedId8 p_sha384AndDigest - ) := { - sha384AndDigest := p_sha384AndDigest - } // End of template m_issuerIdentifier_sha384AndDigest - - template (present) IssuerIdentifier mw_issuerIdentifier_sha384AndDigest( - template (present) HashedId8 p_sha384AndDigest := ? - ) := { - sha384AndDigest := p_sha384AndDigest - } // End of template mw_issuerIdentifier_sha384AndDigest - - } // End of group issuerIdentifier - - group toBeSignedCertificate { - - /** - * @desc Send template for ToBeSignedCertificate with CA restrictions - * @see ETSI TS 103 097 V1.3.1 Clause 7.2.3 Root CA certificate - */ - template (omit) ToBeSignedCertificate m_toBeSignedCertificate_ca( - in template (value) CertificateId p_id, - in template (value) SequenceOfPsidSsp p_appPermissions, - in template (value) SequenceOfPsidGroupPermissions p_certIssuePermissions, - in template (value) VerificationKeyIndicator p_verifyKeyIndicator, - in template (omit) ValidityPeriod p_validityPeriod := omit, - in template (omit) GeographicRegion p_region := omit, - in template (omit) SubjectAssurance p_assuranceLevel := omit, - in template (omit) PublicEncryptionKey p_encryptionKey := omit - ) := { - id := p_id, - cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 - crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := p_certIssuePermissions, // ETSI TS 103 097 V1.3.1 Clause 7.2.3 Root CA certificates Bullet 4 - certRequestPermissions := omit, - canRequestRollover := omit, - encryptionKey := p_encryptionKey, - verifyKeyIndicator := p_verifyKeyIndicator - } // End of template m_toBeSignedCertificate_ca - - /** - * @desc Receive template for ToBeSignedCertificate with CA restrictions - * @see ETSI TS 103 097 V1.3.1 Clause 7.2.3 Root CA certificate - */ - template ToBeSignedCertificate mw_toBeSignedCertificate_ca( - template (present) CertificateId p_id := ?, - template (present) SequenceOfPsidSsp p_appPermissions := ?, - template (present) SequenceOfPsidGroupPermissions p_certIssuePermissions := ?, - template (present) SequenceOfPsidGroupPermissions p_certRequestPermissions := ?, - template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, - template (present) ValidityPeriod p_validityPeriod := ?, - template GeographicRegion p_region := *, - template SubjectAssurance p_assuranceLevel := *, - template PublicEncryptionKey p_encryptionKey := * - ) := { - id := p_id, - cracaId := '000000'O, - crlSeries := 0, - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := omit, - certIssuePermissions := p_certIssuePermissions, - certRequestPermissions := p_certRequestPermissions, - canRequestRollover := omit, - encryptionKey := p_encryptionKey, - verifyKeyIndicator := p_verifyKeyIndicator - } // End of template mw_toBeSignedCertificate - - /** - * @desc Send template for ToBeSignedCertificate with Enrolment credential restrictions - * @see ETSI TS 103 097 V1.3.1 Clause 7.2.2 Enrolment credential - */ - template (omit) ToBeSignedCertificate m_toBeSignedCertificate_ea( - in template (value) CertificateId p_id, - in template (value) SequenceOfPsidSsp p_appPermissions, - in template (value) VerificationKeyIndicator p_verifyKeyIndicator, - in template (value) ValidityPeriod p_validityPeriod, - in template (omit) GeographicRegion p_region := omit, - in template (omit) SubjectAssurance p_assuranceLevel := omit, - in template (omit) PublicEncryptionKey p_encryptionKey := omit - ) := { - id := p_id, - cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 - crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := omit, - certRequestPermissions := omit, - canRequestRollover := omit, - encryptionKey := p_encryptionKey, - verifyKeyIndicator := p_verifyKeyIndicator - } // End of template m_toBeSignedCertificate_ea - - /** - * @desc Send template for ToBeSignedCertificate with Enrolment credential restrictions - * @see ETSI TS 103 097 V1.3.1 Clause 7.2.2 Enrolment credential - */ - template ToBeSignedCertificate mw_toBeSignedCertificate_ea( - template (present) CertificateId p_id := ?, - template (present) SequenceOfPsidSsp p_appPermissions := ?, - template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, - template (present) ValidityPeriod p_validityPeriod := ?, - template GeographicRegion p_region := *, - template SubjectAssurance p_assuranceLevel := *, - template PublicEncryptionKey p_encryptionKey := * - ) := { - id := p_id, - cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 - crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := omit, - certRequestPermissions := omit, - canRequestRollover := omit, - encryptionKey := p_encryptionKey, - verifyKeyIndicator := p_verifyKeyIndicator - } // End of template mw_toBeSignedCertificate_ea - - template (omit) ToBeSignedCertificate m_toBeSignedCertificate_ec( - in template (value) CertificateId p_id, - in template (value) SequenceOfPsidSsp p_appPermissions, - in template (value) VerificationKeyIndicator p_verifyKeyIndicator, - in template (value) ValidityPeriod p_validityPeriod, - in template (omit) GeographicRegion p_region := omit, - in template (omit) SubjectAssurance p_assuranceLevel := omit, - in template (omit) PublicEncryptionKey p_encryptionKey := omit - ) := { - id := p_id, - cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 - crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := omit, - certRequestPermissions := omit, - canRequestRollover := omit, - encryptionKey := p_encryptionKey, - verifyKeyIndicator := p_verifyKeyIndicator - } // End of template m_toBeSignedCertificate_ec - - /** - * @desc Send template for ToBeSignedCertificate with Enrolment credential restrictions - * @see ETSI TS 103 097 V1.3.1 Clause 7.2.2 Enrolment credential - */ - template ToBeSignedCertificate mw_toBeSignedCertificate_ec( - template (present) CertificateId p_id := ?, - template (present) SequenceOfPsidSsp p_appPermissions := ?, - template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, - template (present) ValidityPeriod p_validityPeriod := ?, - template GeographicRegion p_region := *, - template SubjectAssurance p_assuranceLevel := *, - template PublicEncryptionKey p_encryptionKey := * - ) := { - id := p_id, - cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 - crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := omit, - certRequestPermissions := omit, - canRequestRollover := omit, - encryptionKey := p_encryptionKey, - verifyKeyIndicator := p_verifyKeyIndicator - } // End of template mw_toBeSignedCertificate_ec - - /** - * @desc Send template for ToBeSignedCertificate with Authorization authority restrictions - * @see ETSI TS 103 097 V1.3.1 Clause 7.2.4 Subordinate certification authority certificates - */ - template (omit) ToBeSignedCertificate m_toBeSignedCertificate_aa( - in template (value) CertificateId p_id, - in template (value) SequenceOfPsidSsp p_appPermissions, - in template (value) VerificationKeyIndicator p_verifyKeyIndicator, - in template (value) ValidityPeriod p_validityPeriod, - in template (omit) GeographicRegion p_region := omit, - in template (omit) SubjectAssurance p_assuranceLevel := omit, - in template (omit) PublicEncryptionKey p_encryptionKey := omit - ) := { - id := p_id, - cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 - crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := omit, - certRequestPermissions := omit, - canRequestRollover := omit, - encryptionKey := p_encryptionKey, - verifyKeyIndicator := p_verifyKeyIndicator - } // End of template m_toBeSignedCertificate_aa - - /** - * @desc Send template for ToBeSignedCertificate with Authorization authority restrictions - * @see ETSI TS 103 097 V1.3.1 Clause 7.2.4 Subordinate certification authority certificates - */ - template ToBeSignedCertificate mw_toBeSignedCertificate_aa( - template (present) CertificateId p_id := ?, - template (present) SequenceOfPsidSsp p_appPermissions := ?, - template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, - template (present) ValidityPeriod p_validityPeriod := ?, - template GeographicRegion p_region := *, - template SubjectAssurance p_assuranceLevel := *, - template PublicEncryptionKey p_encryptionKey := * - ) := { - id := p_id, - cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 - crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := omit, - certRequestPermissions := omit, - canRequestRollover := omit, - encryptionKey := p_encryptionKey, - verifyKeyIndicator := p_verifyKeyIndicator - } // End of template mw_toBeSignedCertificate_aa - - template (present) CertificateId mw_certificateId_name( - template (present) charstring p_name := ? - ) := { - name := p_name - } // End of template mw_certificateId_name - - template CertificateId mw_certificateId_none := { - none_ := NULL - } // End of template mw_certificateId_none - - /** - * @desc Send template for ToBeSignedCertificate with AT restrictions - * @see ETSI TS 103 097 V1.3.1 Clause 7.2.1 Authorization tickets - */ - template (omit) ToBeSignedCertificate m_toBeSignedCertificate_at( - in template (value) SequenceOfPsidSsp p_appPermissions, - in template (value) VerificationKeyIndicator p_verifyKeyIndicator, - in template (omit) ValidityPeriod p_validityPeriod := omit, - in template (omit) GeographicRegion p_region := omit, - in template (omit) SubjectAssurance p_assuranceLevel := omit, - in template (omit) PublicEncryptionKey p_encryptionKey := omit - ) := { - id := { none_ := NULL }, - cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 - crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := omit, - certRequestPermissions := omit, - canRequestRollover := omit, - encryptionKey := p_encryptionKey, - verifyKeyIndicator := p_verifyKeyIndicator - } // End of template m_toBeSignedCertificate_at - - /** - * @desc Send template for ToBeSignedCertificate with AT restrictions - * @see ETSI TS 103 097 V1.3.1 Clause 7.2.1 Authorization tickets - */ - template ToBeSignedCertificate mw_toBeSignedCertificate_at( - template (present) SequenceOfPsidSsp p_appPermissions := ?, - template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, - template (present) ValidityPeriod p_validityPeriod := ?, - template GeographicRegion p_region := *, - template SubjectAssurance p_assuranceLevel := *, - template PublicEncryptionKey p_encryptionKey := * - ) := { - id := { none_ := NULL }, - cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 - crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := omit, - certRequestPermissions := omit, - canRequestRollover := omit, - encryptionKey := p_encryptionKey, - verifyKeyIndicator := p_verifyKeyIndicator - } // End of template mw_toBeSignedCertificate_at - - } // End of group toBeSignedCertificate - - group verificationKeys { - - template (value) VerificationKeyIndicator m_verificationKeyIndicator_verificationKey( - in template (value) PublicVerificationKey p_verificationKey - ) := { - verificationKey := p_verificationKey - } // End of template m_verificationKeyIndicator_verificationKey - - template (present) VerificationKeyIndicator mw_verificationKeyIndicator_verificationKey( - template (present) PublicVerificationKey p_verificationKey := ? - ) := { - verificationKey := p_verificationKey - } // End of template mw_verificationKeyIndicator_verificationKey - - template (value) VerificationKeyIndicator m_verificationKeyIndicator_reconstructionValue( - in template (value) EccP256CurvePoint p_reconstructionValue - ) := { - reconstructionValue := p_reconstructionValue - } // End of template m_verificationKeyIndicator_reconstructionValue - - template (present) VerificationKeyIndicator mw_verificationKeyIndicator_reconstructionValue( - template (present) EccP256CurvePoint p_reconstructionValue := ? - ) := { - reconstructionValue := p_reconstructionValue - } // End of template mw_verificationKeyIndicator_reconstructionValue - - template (value) PublicVerificationKey m_publicVerificationKey_ecdsaNistP256( - in template (value) EccP256CurvePoint p_ecdsaNistP256 - ) := { - ecdsaNistP256 := p_ecdsaNistP256 - } // End of template m_publicVerificationKey_ecdsaNistP256 - - template (present) PublicVerificationKey mw_publicVerificationKey_ecdsaNistP256( - template (present) EccP256CurvePoint p_ecdsaNistP256 := ? - ) := { - ecdsaNistP256 := p_ecdsaNistP256 - } // End of template mw_publicVerificationKey_ecdsaNistP256 - - template (value) PublicVerificationKey m_publicVerificationKey_ecdsaBrainpoolP256r1( - in template (value) EccP256CurvePoint p_ecdsaBrainpoolP256r1 - ) := { - ecdsaBrainpoolP256r1 := p_ecdsaBrainpoolP256r1 - } // End of template m_publicVerificationKey_ecdsaBrainpoolP256r1 - - template (present) PublicVerificationKey mw_publicVerificationKey_ecdsaBrainpoolP256r1( - template (present) EccP256CurvePoint p_ecdsaBrainpoolP256r1 := ? - ) := { - ecdsaBrainpoolP256r1 := p_ecdsaBrainpoolP256r1 - } // End of template mw_publicVerificationKey_ecdsaBrainpoolP256r1 - - template (value) PublicVerificationKey m_publicVerificationKey_ecdsaBrainpoolP384r1( - in template (value) EccP384CurvePoint p_ecdsaBrainpoolP384r1 - ) := { - ecdsaBrainpoolP384r1 := p_ecdsaBrainpoolP384r1 - } // End of template m_publicVerificationKey_ecdsaBrainpoolP384r1 - - template (present) PublicVerificationKey mw_publicVerificationKey_ecdsaBrainpoolP384r1( - template (present) EccP384CurvePoint p_ecdsaBrainpoolP384r1 := ? - ) := { - ecdsaBrainpoolP384r1 := p_ecdsaBrainpoolP384r1 - } // End of template mw_publicVerificationKey_ecdsaBrainpoolP384r1 - - } // End of group verificationKeys - - group encryptionKey { - - template (value) PublicEncryptionKey m_encryptionKey( - in template (value) SymmAlgorithm p_supportedSymmAlg := aes128Ccm, - in template (value) BasePublicEncryptionKey p_publicKey - ) := { - supportedSymmAlg := p_supportedSymmAlg, - publicKey := p_publicKey - } // End of template m_encryptionKey - - template (present) PublicEncryptionKey mw_encryptionKey( - template (present) SymmAlgorithm p_supportedSymmAlg := aes128Ccm, - template (present) BasePublicEncryptionKey p_publicKey := ? - ) := { - supportedSymmAlg := p_supportedSymmAlg, - publicKey := p_publicKey - } // End of template mw_encryptionKey - - template (value) BasePublicEncryptionKey m_publicEncryptionKey_eciesNistP256( - in template (value) EccP256CurvePoint p_eciesNistP256 - ) := { - eciesNistP256 := p_eciesNistP256 - } // End of template m_publicEncryptionKey_eciesNistP256 - - template (present) BasePublicEncryptionKey mw_publicEncryptionKey_eciesNistP256( - template (present) EccP256CurvePoint p_eciesNistP256 := ? - ) := { - eciesNistP256 := p_eciesNistP256 - } // End of template mw_publicEncryptionKey_eciesNistP256 - - template (value) BasePublicEncryptionKey m_publicEncryptionKey_eciesBrainpoolP256r1( - in template (value) EccP256CurvePoint p_eciesBrainpoolP256r1 - ) := { - eciesBrainpoolP256r1 := p_eciesBrainpoolP256r1 - } // End of template m_publicEncryptionKey_eciesBrainpoolP256r1 - - template (present) BasePublicEncryptionKey mw_publicEncryptionKey_eciesBrainpoolP256r1( - template (present) EccP256CurvePoint p_eciesBrainpoolP256r1 := ? - ) := { - eciesBrainpoolP256r1 := p_eciesBrainpoolP256r1 - } // End of template mw_publicEncryptionKey_eciesBrainpoolP256r1 - - } // End of group encryptionKey - - group appPermissions { - - template (omit) PsidSsp m_appPermissions( - in template (value) Psid p_psid, - in template (omit) ServiceSpecificPermissions p_ssp := omit - ) := { - psid := p_psid, - ssp := p_ssp - } // End of template m_appPermissions - - template PsidSsp mw_appPermissions( - template (present) Psid p_psid := ?, - template ServiceSpecificPermissions p_ssp := * - ) := { - psid := p_psid, - ssp := p_ssp - } // End of template mw_appPermissions - - template (value) PsidSspRange m_psidSspRange( - in Psid p_psid, - in template (value) SspRange p_sspRange := m_SspRange_all - ) := { - psid := p_psid, - sspRange := p_sspRange - } // End of template m_psidSspRange - - template (value) SspRange m_SspRange_all := { - all_ := NULL - } // End of template m_SspRange_all - - template (value) SspRange m_SspRange_opaque( - in template (value) SequenceOfOctetString p_opaque - ) := { - opaque := p_opaque - } // End of template m_SspRange_opaque - - template (value) SspRange m_SspRange_bitmapSspRange( - in template (value) BitmapSspRange p_bitmapSspRange - ) := { - bitmapSspRange := p_bitmapSspRange - } // End of template m_SspRange_bitmapSspRange - - template (value) PsidGroupPermissions m_psidGroupPermissions( - in template (value) SubjectPermissions p_subjectPermissions, - in integer p_minChainLength := 1, - in integer p_chainLengthRange := 0, - in EndEntityType p_eeType := oct2bit('00'O) - ) := { - subjectPermissions := p_subjectPermissions, - minChainLength := p_minChainLength, - chainLengthRange := p_chainLengthRange, - eeType := p_eeType - } // End of template m_psidGroupPermissions - - template (present) PsidGroupPermissions mw_psidGroupPermissions( - template (present) SubjectPermissions p_subjectPermissions := ?, - integer p_minChainLength := 1, - integer p_chainLengthRange := 0, - template (present) EndEntityType p_eeType := ? - ) := { - subjectPermissions := p_subjectPermissions, - minChainLength := p_minChainLength, - chainLengthRange := p_chainLengthRange, - eeType := p_eeType - } // End of template mw_psidGroupPermissions - - template (value) SubjectPermissions m_subjectPermissions_explicit( - in template (value) SequenceOfPsidSspRange p_certIssuePermissions - ) := { - explicit := p_certIssuePermissions - } // End of template m_subjectPermissions_explicit - - template (present) SubjectPermissions mw_subjectPermissions_explicit( - template (present) SequenceOfPsidSspRange p_certIssuePermissions := ? - ) := { - explicit := p_certIssuePermissions - } // End of template mw_subjectPermissions_explicit - - template (value) SubjectPermissions m_subjectPermissions_all := { - all_ := NULL - } // End of template m_subjectPermissions_all - - } // End of group appPermissions - - - group validityRestriction { - - template (value) ValidityPeriod m_validityPeriod( - in template (value) Time32 p_start_, - in template (value) Duration p_duration - ) := { - start_ := p_start_, - duration := p_duration - } // End of template m_validityPeriod - - template (present) ValidityPeriod mw_validityPeriod( - template (present) Time32 p_start_ := ?, - template (present) Duration p_duration := ? - ) := { - start_ := p_start_, - duration := p_duration - } // End of template mw_validityPeriod - - /** - * @desc Send template for Duration (in seconds) - * @param p_duration The duration value - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.18 Duration - */ - template (value) Duration m_duration_in_seconds( - in template (value) Int16 p_duration - ) := { - seconds := p_duration - } // End of template m_duration_in_seconds - - /** - * @desc Send template for Duration (in hours) - * @param p_duration The duration value - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.18 Duration - */ - template (value) Duration m_duration_in_hours( - in template (value) Int16 p_duration - ) := { - hours := p_duration - } // End of template m_duration_in_hours - - /** - * @desc Receive template for Duration (in seconds) - * @param p_duration The duration value - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.18 Duration - */ - template (present) Duration mw_duration_in_seconds( - template (present) Int16 p_duration := ? - ) := { - seconds := p_duration - } // End of template mw_duration_in_seconds - - template (value) Duration m_duration_years( - in template (value) Uint16 p_years - ) := { - years := p_years - } // End of template m_duration_years - - template (present) Duration mw_duration_years( - template (present) Uint16 p_years := ? - ) := { - years := p_years - } // End of template mw_duration_years - - } // End of group validityRestriction - - group ssp { - - group sspCam { - - group sspCamSend { - - template (value) SspCAM m_sspCAMContainer_sign_all := { - cenDsrcTollingZone := '1'B, - publicTransport := '1'B, - specialTransport := '1'B, - dangerousGoods := '1'B, - roadwork := '1'B, - rescue := '1'B, - emergency := '1'B, - safetyCar := '1'B, - closedLanes := '1'B, - requestForRightOfWay := '1'B, - requestForFreeCrossingAtATrafficLight := '1'B, - noPassing := '1'B, - noPassingForTrucks := '1'B, - speedLimit := '1'B, - reserved := '000000000000000000'B - } // End of template m_sspCAMContainer_sign_all - - template (value) SspCAM m_sspCAMContainer_vehicle - modifies m_sspCAMContainer_sign_all := { - cenDsrcTollingZone := '0'B, - closedLanes := '0'B, - noPassing := '0'B, - noPassingForTrucks := '0'B, - speedLimit := '0'B - } // End of template m_sspCAMContainer_vehicle - - template (value) ServiceSpecificPermissions m_sspCAM( - in template (value) BitmapSsp p_bitmapSsp - ) := { - bitmapSsp := p_bitmapSsp - } // End of template m_sspCAM - - } // End of group sspCamSend - - group sspCamRecv { - - template (present) SspCAM mw_sspCAMContainer_dummy := { - cenDsrcTollingZone := ?, - publicTransport := ?, - specialTransport := ?, - dangerousGoods := ?, - roadwork := ?, - rescue := ?, - emergency := ?, - safetyCar := ?, - closedLanes := ?, - requestForRightOfWay := ?, - requestForFreeCrossingAtATrafficLight := ?, - noPassing := ?, - noPassingForTrucks := ?, - speedLimit := ?, - reserved := '000000000000000000'B - } // End of template mw_sspCAMContainer_dummy - - template (present) ServiceSpecificPermissions mw_sspCAM_dummy := { - bitmapSsp := ? - } // End of template mw_sspCAM_dummy - - } // End of group sspCamRecv - - } // End of group sspCam - - group sspDenm { - - group sspDenmSend { - - template (value) SspDENM m_sspDENMContainer_sign_all := { - trafficCondition := '1'B, - accident := '1'B, - roadworks := '1'B, - adverseWeatherCondition_Adhesion := '1'B, - hazardousLocation_SurfaceCondition := '1'B, - hazardousLocation_ObstacleOnTheRoad := '1'B, - hazardousLocation_AnimalOnTheRoad := '1'B, - humanPresenceOnTheRoad := '1'B, - wrongWayDriving := '1'B, - rescueAndRecoveryWorkInProgress := '1'B, - adverseWeatherCondition_ExtremeWeatherCondition := '1'B, - adverseWeatherCondition_Visibility := '1'B, - adverseWeatherCondition_Precipitation := '1'B, - slowVehicle := '1'B, - dangerousEndOfQueue := '1'B, - vehicleBreakdown := '1'B, - postCrash := '1'B, - humanProblem := '1'B, - stationaryVehicle := '1'B, - emergencyVehicleApproaching := '1'B, - hazardousLocation_DangerousCurve := '1'B, - collisionRisk := '1'B, - signalViolation := '1'B, - dangerousSituation := '1'B, - reserved := '00000000'B - } // End of template m_sspDENMContainer_sign_all - - template (value) SspDENM m_sspDENMContainer_vehicle - modifies m_sspDENMContainer_sign_all:= { - trafficCondition := '0'B, - accident := '0'B, - roadworks := '0'B, - adverseWeatherCondition_Adhesion := '0'B, - hazardousLocation_SurfaceCondition := '0'B, - hazardousLocation_ObstacleOnTheRoad := '0'B, - hazardousLocation_AnimalOnTheRoad := '0'B, - slowVehicle := '0'B, - dangerousEndOfQueue := '0'B, - vehicleBreakdown := '0'B, - stationaryVehicle := '0'B - } // End of template m_sspDENMContainer_sign_all - - template (value) SspDENM m_sspDENMContainer_roadSideUnit - modifies m_sspDENMContainer_sign_all:= { - trafficCondition := '0'B, - accident := '0'B, - roadworks := '0'B, - adverseWeatherCondition_Adhesion := '0'B, - hazardousLocation_SurfaceCondition := '0'B, - hazardousLocation_ObstacleOnTheRoad := '0'B, - hazardousLocation_AnimalOnTheRoad := '0'B, - humanPresenceOnTheRoad := '0'B, - wrongWayDriving := '0'B, - rescueAndRecoveryWorkInProgress := '0'B, - adverseWeatherCondition_ExtremeWeatherCondition := '0'B, - adverseWeatherCondition_Visibility := '0'B, - adverseWeatherCondition_Precipitation := '0'B, - postCrash := '0'B, - humanProblem := '0'B, - stationaryVehicle := '0'B, - hazardousLocation_DangerousCurve := '0'B, - collisionRisk := '0'B, - dangerousSituation := '0'B - } // End of template m_sspDENMContainer_roadSideUnit - - template (value) ServiceSpecificPermissions m_sspDENM( - in template (value) BitmapSsp p_bitmapSsp - ) := { - bitmapSsp := p_bitmapSsp - } // End of template m_sspDENM - - } // End of group sspDenmSend - - group sspDenmRecv { - - template (present) SspDENM mw_sspDENMContainer_dummy := { - trafficCondition := ?, - accident := ?, - roadworks := ?, - adverseWeatherCondition_Adhesion := ?, - hazardousLocation_SurfaceCondition := ?, - hazardousLocation_ObstacleOnTheRoad := ?, - hazardousLocation_AnimalOnTheRoad := ?, - humanPresenceOnTheRoad := ?, - wrongWayDriving := ?, - rescueAndRecoveryWorkInProgress := ?, - adverseWeatherCondition_ExtremeWeatherCondition := ?, - adverseWeatherCondition_Visibility := ?, - adverseWeatherCondition_Precipitation := ?, - slowVehicle := ?, - dangerousEndOfQueue := ?, - vehicleBreakdown := ?, - postCrash := ?, - humanProblem := ?, - stationaryVehicle := ?, - emergencyVehicleApproaching := ?, - hazardousLocation_DangerousCurve := ?, - collisionRisk := ?, - signalViolation := ?, - dangerousSituation := ?, - reserved := '00000000'B - } // End of template mw_sspDENMContainer_dummy - - template (present) SspDENM mw_sspDENMContainer_vehicle - modifies mw_sspDENMContainer_dummy := { - trafficCondition := '0'B, - accident := '0'B, - roadworks := '0'B, - adverseWeatherCondition_Adhesion := '0'B, - hazardousLocation_SurfaceCondition := '0'B, - hazardousLocation_ObstacleOnTheRoad := '0'B, - hazardousLocation_AnimalOnTheRoad := '0'B, - slowVehicle := '0'B, - dangerousEndOfQueue := '0'B, - vehicleBreakdown := '0'B, - stationaryVehicle := '0'B - } // End of template mw_sspDENMContainer_vehicle - - template (present) SspDENM mw_sspDENMContainer_roadSideUnit - modifies mw_sspDENMContainer_dummy := { - trafficCondition := '0'B, - accident := '0'B, - roadworks := '0'B, - adverseWeatherCondition_Adhesion := '0'B, - hazardousLocation_SurfaceCondition := '0'B, - hazardousLocation_ObstacleOnTheRoad := '0'B, - hazardousLocation_AnimalOnTheRoad := '0'B, - humanPresenceOnTheRoad := '0'B, - wrongWayDriving := '0'B, - rescueAndRecoveryWorkInProgress := '0'B, - adverseWeatherCondition_ExtremeWeatherCondition := '0'B, - adverseWeatherCondition_Visibility := '0'B, - adverseWeatherCondition_Precipitation := '0'B, - postCrash := '0'B, - humanProblem := '0'B, - stationaryVehicle := '0'B, - hazardousLocation_DangerousCurve := '0'B, - collisionRisk := '0'B, - dangerousSituation := '0'B - } // End of template m_sspDENMContainer_roadSideUnit - - } // End of group sspDenmRecv - - } // End of group sspDenm - - } // End of group ssp - - group utPrimitives { - - template (value) UtGnInitialize m_secGnInitialize( - in Oct8 p_hashedId8 - ) := { - hashedId8 := p_hashedId8 - } // End of template m_secGnInitialize - - } // End of group utPrimitives - -} // End of module LibItsSecurity_Templates +/** + * @author ETSI / STF481 / STF507 / STF517 / STF538 / STF545 + * @version $Url$ + * $Id$ + * @desc Module containing templates for Security Protocol + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * + */ +module LibItsSecurity_Templates { + + // LibCommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; + + // LibItsCommon + import from LibItsCommon_TypesAndValues all; + + // LibItsGeoNetworking + import from LibItsGeoNetworking_TypesAndValues all; + + // LibIts + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + import from IEEE1609dot2 language "ASN.1:1997" all; + import from EtsiTs103097Module language "ASN.1:1997" all; + + // LibItsSecurity + import from LibItsSecurity_TypesAndValues all; + import from LibItsSecurity_Pixits all; + + /** + * @desc Constants declaration + */ + group constants { + + /** + * @desc Protocol version + * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.1 Ieee1609Dot2Data + */ + const UInt8 c_protocol_version := 3; + + /** + * @desc Certificate version + * @see Draft ETSI TS 103 097 V1.3.1 Clause 6.1 Certificate + */ + const UInt8 c_certificate_version := 3; + + /** + * @desc Its AID for Other + * @see Draft ETSI TS 103 097 V1.3.1 Clause 7.3 Security profile for DENMs + */ + template Psid c_its_aid_Other := PX_OTHER_ITS_AID; + + /** + * @desc Minimal value of Longitude + */ + const SecLongitude c_minLongitude := -1799999999; // TODO Use constant from IEEE1609dot2BaseTypes + + /** + * @desc Maximal value of Longitude + */ + const SecLongitude c_maxLongitude := 1800000000; // TODO Use constant from IEEE1609dot2BaseTypes + + /** + * @desc Minimal value of Latitude + */ + const SecLatitude c_minLatitude := -900000000; // TODO Use constant from IEEE1609dot2BaseTypes + + /** + * @desc Maximal value of Latitude + */ + const SecLatitude c_maxLatitude := 900000000; // TODO Use constant from IEEE1609dot2BaseTypes + + /** + * @desc List of ISO-3166 country codes + */ + const SequenceOfUint16 c_iso3166Codes := { + 4, 8, 10, 12, 16, 20, 24, 28, 31, 32, 36, 40, 44, 48, 50, 51, 52, 56, + 60, 64, 68, 70, 72, 74, 76, 84, 86, 90, 92, 96, 100, 104, 108, 112, 116, 120, + 124, 132, 136, 140, 144, 148, 152, 156, 158, 162, 166, 170, 174, 175, 178, 180, 184, 188, + 191, 192, 196, 203, 204, 208, 212, 214, 218, 222, 226, 231, 232, 233, 234, 238, 239, 242, + 246, 248, 250, 254, 258, 260, 262, 266, 268, 270, 275, 276, 288, 292, 296, 300, 304, 308, + 312, 316, 320, 324, 328, 332, 334, 336, 340, 344, 348, 352, 356, 360, 364, 368, 372, 376, + 380, 384, 388, 392, 398, 400, 404, 408, 410, 414, 417, 418, 422, 426, 428, 430, 434, 438, + 440, 442, 446, 450, 454, 458, 462, 466, 470, 474, 478, 480, 484, 492, 496, 498, 499, 500, + 504, 508, 512, 516, 520, 524, 528, 531, 533, 534, 535, 540, 548, 554, 558, 562, 566, 570, + 574, 578, 580, 581, 583, 584, 585, 586, 591, 598, 600, 604, 608, 612, 616, 620, 624, 626, + 630, 634, 638, 642, 643, 646, 652, 654, 659, 660, 662, 663, 666, 670, 674, 678, 682, 686, + 688, 690, 694, 702, 703, 704, 705, 706, 710, 716, 724, 728, 729, 732, 740, 744, 748, 752, + 756, 760, 762, 764, 768, 772, 776, 780, 784, 788, 792, 795, 796, 798, 800, 804, 807, 810, + 818, 826, 831, 832, 833, 834, 840, 850, 854, 858, 860, 862, 876, 882, 887, 894 + }; + + /** + * @desc List of United Nations Statistics Division country codes + */ + const SequenceOfUint16 c_unStatsAdditionalCodes := { + 1, 2, 5, 9, 11, 13, 14, 15, 17, 18, 19, 21, 29, 30, 34, 35, 39, 53, + 54, 57, 61, 142, 143, 145, 150, 151, 154, 155, 199, 419, 432, 680, 722, 830 + }; + + } // End of group constants + + /** + * @desc Dummy send/receive templates for security headers + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4 Basic format elements + */ + group dummyBasicFormatElements { + + /** + * @desc Dummy receive templates for security headers + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2 Specification of basic format elements + */ + group dummyBasicFormatElementsRecv { + + /** + * @desc Dummy receive template for TwoDLocation + * @param p_latitude Latitude range from 900 000 000 to +900 000 000 + * @param p_longitude Longitude range from 1 800 000 000 to +1 800 000 000 + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.19 TwoDLocation + */ + template (present) TwoDLocation mw_twoDLocation_dummy := { + latitude := ?, + longitude := ? + } // End of template mw_twoDLocation_dummy + + /** + * @desc Dummy send template for ThreeDLocation + * @param p_latitude Latitude range from 900 000 000 to +900 000 000 + * @param p_longitude Longitude range from 1 800 000 000 to +1 800 000 000 + * @param p_elevation Elevation relative to the WGS-84 ellipsoid in decimetres + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.20 ThreeDLocation + */ + template (present) ThreeDLocation mw_threeDLocation_dummy := { + latitude := ?, + longitude := ?, + elevation := ? + } // End of template mw_threeDLocation_dummy + + } // End of group dummyBasicFormatElementsRecv + + } // End of group dummyBasicFormatElements + + /** + * @desc Send/receive templates for security headers + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4 Basic format elements + */ + group basicFormatElements { + + /** + * @desc Send templates for security headers + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2 Specification of basic format elements + */ + group basicFormatElementsSend { + + /** + * @desc Send templates for Signature description + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.9 Signature + * @see Draft ETSI TS 103 097 V1.3.1 Table 2: Derivation of field sizes depending on the used algorithm + */ + group signatures { + + /** + * @desc Send template for signatures based on ECDSA algorithm + * @member p_ecdsaSignature The ECDSA based signature + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.9 Signature + */ + template (value) Signature m_signature( + in template (value) EcdsaP256Signature p_ecdsaSignature + ):= { + ecdsaNistP256Signature := p_ecdsaSignature + } // End of template m_signature_ecdsa + + /** + * @desc Send template for ECDSA based signature + * @member p_r The coordinate of the elliptic curve point resulting from multiplying the generator element by the ephemeral private key + * @member p_s The signature + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.10 EcdsaP256Signature + */ + template (value) EcdsaP256Signature m_ecdsaSignature( + in template (value) EccP256CurvePoint p_rSig, + in template (value) octetstring p_sSig + ) := { + rSig := p_rSig, + sSig := p_sSig + } // End of template m_ecdsaSignature + + } // End of group signatures + + group signerInfos { + + /** + * @desc Send template for self signed message + */ + template (value) SignerIdentifier m_signerIdentifier_self := { + self_ := NULL + } // End of template m_signerIdentifier_self + + /** + * @desc Send template for certificate signed message + */ + template (value) SignerIdentifier m_signerIdentifier_certificate( + in template (value) Certificate p_certificate // TODO Use SingleEtsiTs103097Certificate + ) := { + certificate := { p_certificate } // Only one + } // End of template m_signerIdentifier_certificate + + /** + * @desc Send template for digest signed message + */ + template (value) SignerIdentifier m_signerIdentifier_digest( + in template (value) HashedId8 p_digest := '0000000000000000'O + ) := { + digest := p_digest + } // End of template m_signerIdentifier_digest + + /** + * @desc Send template for certificate signed message + */ + template (value) SignerIdentifier m_signerIdentifier_certificates( + in template (value) SequenceOfCertificate p_certificates := {} + ) := { + certificate := p_certificates + } // End of template m_signerIdentifier_certificates + + } // End of group signerInfos + + /** + * @desc Send template for TwoDLocation + * @param p_latitude Latitude range from 900 000 000 to +900 000 000 + * @param p_longitude Longitude range from 1 800 000 000 to +1 800 000 000 + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.19 TwoDLocation + */ + template (value) TwoDLocation m_twoDLocation( + in template (value) SecLatitude p_latitude, + in template (value) SecLongitude p_longitude + ) := { + latitude := p_latitude, + longitude := p_longitude + } // End of template m_twoDLocation + + /** + * @desc Send template for ThreeDLocation + * @param p_latitude Latitude range from 900 000 000 to +900 000 000 + * @param p_longitude Longitude range from 1 800 000 000 to +1 800 000 000 + * @param p_elevation Elevation relative to the WGS-84 ellipsoid in decimetres + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.20 ThreeDLocation + */ + template (value) ThreeDLocation m_threeDLocation( + in template (value) SecLatitude p_latitude, + in template (value) SecLongitude p_longitude, + in template (value) SecElevation p_elevation + ) := { + latitude := p_latitude, + longitude := p_longitude, + elevation := p_elevation + } // End of template m_threeDLocation + + /** + * @desc Send template circular geographic region + * @param p_center Circle center + * @param p_radius Circle radius + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion + */ + template (value) GeographicRegion m_geographicRegion_circle( + in template (value) TwoDLocation p_center, + in template (value) UInt16 p_radius + ) := { + circularRegion := { + center := p_center, + radius := p_radius + } + } // End of template m_geographicRegion_circle + + /** + * @desc Send template rectangular geographic region + * @param p_northwest Upper left corner + * @param p_southeast Lower rigth corner + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion + */ + template (value) GeographicRegion m_geographicRegion_rectangular( + in template (value) TwoDLocation p_northwest, + in template (value) TwoDLocation p_southeast + ) := { + rectangularRegion := { + { + northWest := p_northwest, + southEast := p_southeast + } + } + } // End of template m_geographicRegion_rectangular + + /** + * @desc Send template polygonial geographic region + * @param p_polygonal_region Polygonial region description + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion + */ + template (value) GeographicRegion m_geographicRegion_polygonial( + in template (value) PolygonalRegion p_polygonal_region + ) := { + polygonalRegion := p_polygonal_region + } // End of template m_geographicRegion_polygonial + + /** + * @desc Send template for geographic identified region + * @param p_identifiedRegion Indentified region + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion + */ + template (value) GeographicRegion m_geographicRegion_identifiedRegion( + in template (value) SequenceOfIdentifiedRegion p_identifiedRegions + ) := { + identifiedRegion := p_identifiedRegions + } // End of template m_geographicRegion_identifiedRegion + + template (value) IdentifiedRegion m_identifiedRegion_country_only( + in template (value) CountryOnly p_countryOnly + ) := { + countryOnly := p_countryOnly + } // End of template m_identifiedRegion_country_only + + template (value) IdentifiedRegion m_identifiedRegion_country_and_region( + in template (value) CountryOnly p_countryOnly, + in template (value) SequenceOfUint8 p_regions + ) := { + countryAndRegions := { + countryOnly := p_countryOnly, + regions := p_regions + } + } // End of template m_identifiedRegion_country_and_region + + } // End of group basicFormatElementsSend + + /** + * @desc Receive templates for security headers + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2 Specification of basic format elements + */ + group basicFormatElementsRecv { + + group signerIdentifiers { + + /** + * @desc Recv template for message signed with digest + */ + template (present) SignerIdentifier mw_signerIdentifier_digest( + in template (present) HashedId8 p_digest := ? + ) := { + digest := p_digest + } // End of template mw_signerIdentifier_digest + + template (present) SignerIdentifier mw_signerIdentifier_certificate( + in template (present) EtsiTs103097Certificate p_certificate := ? + ) := { + certificate := { p_certificate } + } // End of template m_signerIdentifier_certificate + + template (present) SignerIdentifier mw_signerIdentifier_certificates( + in template (present) SequenceOfCertificate p_certificates := ? + ) := { + certificate := p_certificates + } // End of template mw_signerIdentifier_certificates + + } // End of group signerIdentifiers + + /** + * @desc Receive templates for Signature description + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.9 Signature + * @see Draft ETSI TS 103 097 V1.3.1 Table 2: Derivation of field sizes depending on the used algorithm + */ + group signatures { + + /** + * @desc Receive template for signatures based on ECDSA algorithm + * @member p_ecdsaSignature The ECDSA based signature + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.9 Signature + */ + template (present) Signature mw_signature( + in template (present) EcdsaP256Signature p_ecdsaSignature := ? + ):= { + ecdsaNistP256Signature := p_ecdsaSignature + } // End of template mw_signature + + /** + * @desc Receive template for ECDSA based signature + * @member p_r The coordinate of the elliptic curve point resulting from multiplying the generator element by the ephemeral private key + * @member p_s The signature + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.10 EcdsaP256Signature + */ + template (present) EcdsaP256Signature mw_ecdsaSignature( + in template (present) EccP256CurvePoint p_rSig := ?, + in template (present) octetstring p_sSig := ? + ) := { + rSig := p_rSig, + sSig := p_sSig + } // End of template mw_ecdsaSignature + + } // End of group signatures + + /** + * @desc Receive template for TwoDLocation + * @param p_latitude Latitude range from 900 000 000 to +900 000 000 + * @param p_longitude Longitude range from 1 800 000 000 to +1 800 000 000 + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.19 TwoDLocation + */ + template (present) TwoDLocation mw_twoDLocation( + in template (present) SecLatitude p_latitude, + in template (present) SecLongitude p_longitude + ) := { + latitude := p_latitude, + longitude := p_longitude + } // End of template mw_twoDLocation + + /** + * @desc Receive template for ThreeDLocation + * @param p_latitude Latitude range from 900 000 000 to +900 000 000 + * @param p_longitude Longitude range from 1 800 000 000 to +1 800 000 000 + * @param p_elevation Elevation relative to the WGS-84 ellipsoid in decimetres + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.20 ThreeDLocation + */ + template (present) ThreeDLocation mw_threeDLocation( + in template (present) SecLatitude p_latitude, + in template (present) SecLongitude p_longitude, + in template (present) SecElevation p_elevation + ) := { + latitude := p_latitude, + longitude := p_longitude, + elevation := p_elevation + } // End of template mw_threeDLocation + + /** + * @desc Receive template circular geographic region + * @param p_center Circle center + * @param p_radius Circle radius + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion + */ + template (present) GeographicRegion mw_geographicRegion_circle( + in template (present) TwoDLocation p_center := ?, + in template (present) UInt16 p_radius := ? + ) := { + circularRegion := { + center := p_center, + radius := p_radius + } + } // End of template mw_geographicRegion_circle + + /** + * @desc Basic receive template rectangular geographic region + * @param p_northwest Upper left corner + * @param p_southeast Lower rigth corner + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion + */ + template (present) GeographicRegion mw_geographicRegion_rectangular := { + rectangularRegion := ? + } // End of template mw_geographicRegion_rectangular + + /** + * @desc Receive template polygonial geographic region + * @param p_polygonal_region Polygonial region description + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion + */ + template (present) GeographicRegion mw_geographicRegion_polygonal( + in template (present) PolygonalRegion p_polygonal_region := ? + ) := { + polygonalRegion := p_polygonal_region + } // End of template mw_geographicRegion_polygonial + + /** + * @desc Receive template for geographic identified region + * @param p_identifiedRegion Indentified region + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion + */ + template (present) GeographicRegion mw_geographicRegion_identified( + in template (present) SequenceOfIdentifiedRegion p_identifiedRegion := ? + ) := { + identifiedRegion := p_identifiedRegion + } // End of template mw_geographicRegion_identifiedRegion + + template (present) IdentifiedRegion mw_identifiedRegion_country_only + := { + countryOnly := ?// FIXME ((all from c_iso3166Codes), (all from c_unStatsAdditionalCodes)) + } + + template (present) IdentifiedRegion mw_identifiedRegion_country_and_region := { + countryAndRegions := { + countryOnly := ?, // FIXME ((all from c_iso3166Codes), (all from c_unStatsAdditionalCodes)), + regions := ? + } + } + + } // End of group basicFormatElementsRecv + + } // End of group dummyBasicFormatElements + + /** + * @desc Send templates for security headers + * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.1 EtsiTs103097Data + */ + group etsiTs103097Data { + + /** + * @desc Generic send template for EtsiTs103097Data message + */ + template (value) EtsiTs103097Data m_etsiTs103097Data( + in template (value) Ieee1609Dot2Content p_content + ) := { + protocolVersion := c_protocol_version, + content := p_content + } // End of template m_etsiTs103097Data + + /** + * @desc Generic receive template for EtsiTs103097Data message + */ + template (present) EtsiTs103097Data mw_etsiTs103097Data( + template (present) Ieee1609Dot2Content p_content := ? + ) := { + protocolVersion := c_protocol_version, + content := p_content + } // End of template mw_etsiTs103097Data + + template (value) EtsiTs103097Data m_etsiTs103097Data_unsecured( + in template (value) Opaque p_unsecuredData + ) := { + protocolVersion := c_protocol_version, + content := { unsecuredData := p_unsecuredData } + } // End of template m_secured_data_unsecured + + template (value) EtsiTs103097Data m_etsiTs103097Data_signed( + in template (value) SignedData p_signedData + ) := { + protocolVersion := c_protocol_version, + content := { signedData := p_signedData } + } // End of template m_secured_data_signed + + template (present) EtsiTs103097Data mw_etsiTs103097Data_signed( + template (present) SignedData p_signedData := ? + ) := { + protocolVersion := c_protocol_version, + content := { signedData := p_signedData } + } // End of template mw_secured_data_signed + + template (value) EtsiTs103097Data m_etsiTs103097Data_encrypted( + in template (value) EncryptedData p_encryptedData + ) := { + protocolVersion := c_protocol_version, + content := { encryptedData := p_encryptedData } + } // End of template m_etsiTs103097Data_encrypted + + template (present) EtsiTs103097Data mw_etsiTs103097Data_encrypted( + template (present) EncryptedData p_encryptedData := ? + ) := { + protocolVersion := c_protocol_version, + content := { encryptedData := p_encryptedData } + } // End of template mw_etsiTs103097Data_encrypted + + /** + * @desc Generic send template for EtsiTs103097Data message + */ + template (value) EtsiTs103097Data m_etsiTs103097Data_wrong_protocol( + in template (value) UInt8 p_protocol_version, + in template (value) Ieee1609Dot2Content p_content + ) := { + protocolVersion := c_protocol_version, + content := p_content + } // End of template m_etsiTs103097Data_wrong_protocol + + } // End of group etsiTs103097Data + + /** + * @desc Send templates for ToBeSignedData header + * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 SignedData + */ + group signedData { + + template (value) SignedData m_signedData( + in template (value) HashAlgorithm p_hashId, + in template (value) ToBeSignedData p_tbsData, + in template (value) SignerIdentifier p_signer, + in template (value) Signature p_signature_ + ) := { + hashId := p_hashId, + tbsData := p_tbsData, + signer := p_signer, + signature_ := p_signature_ + } // End of template m_signedData + + template (present) SignedData mw_signedData( + template (present) HashAlgorithm p_hashId := ?, + template (present) ToBeSignedData p_tbsData := ?, + template (present) SignerIdentifier p_signer := ?, + template (present) Signature p_signature_ := ? + ) := { + hashId := p_hashId, + tbsData := p_tbsData, + signer := p_signer, + signature_ := p_signature_ + } // End of template mw_signedData + + template (value) ToBeSignedData m_toBeSignedData( + in template (value) SignedDataPayload p_payload, + in template (value) HeaderInfo p_headerInfo + ) := { + payload := p_payload, + headerInfo := p_headerInfo + } // End of template m_toBeSignedData + + template (present) ToBeSignedData mw_toBeSignedData( + template (present) SignedDataPayload p_payload := ?, + template (present) HeaderInfo p_headerInfo := ? + ) := { + payload := p_payload, + headerInfo := p_headerInfo + } // End of template mw_toBeSignedData + + template (value) SignedDataPayload m_signedDataPayload( + in template (value) Ieee1609Dot2Data p_data + ) := { + data := p_data, + extDataHash := omit + } // End of template m_signedDataPayload + + template (present) SignedDataPayload mw_signedDataPayload( + template (present) Ieee1609Dot2Data p_data := ? + ) := { + data := p_data, + extDataHash := * + } // End of template mw_signedDataPayload + + template (value) SignedDataPayload m_signedDataPayload_ext( + in template (value) Oct32 p_extDataHash + ) := { + data := omit, + extDataHash := { sha256HashedData := p_extDataHash } + } // End of template m_signedDataPayload_ext + + } // End of group signedData + + /** + * @desc Send templates for ToBeSignedData header + * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.3 EncryptedData + */ + group encryptedData { + + template (value) EncryptedData m_encryptedData( + in template (value) SequenceOfRecipientInfo p_recipients, + in template (value) SymmetricCiphertext p_ciphertex + ) := { + recipients := p_recipients, + ciphertext := p_ciphertex + } // End of template m_encryptedData + + template (present) EncryptedData mw_encryptedData( + template (present) SequenceOfRecipientInfo p_recipients := ?, + template (present) SymmetricCiphertext p_ciphertex := ? + ) := { + recipients := p_recipients, + ciphertext := p_ciphertex + } // End of template mw_encryptedData + + template (value) RecipientInfo m_recipientInfo_pskRecipInfo( + in template (value) PreSharedKeyRecipientInfo p_pskRecipInfo + ) := { + pskRecipInfo := p_pskRecipInfo + } // End of template m_recipientInfo_pskRecipInfo + + template (present) RecipientInfo mw_recipientInfo_pskRecipInfo( + template (present) PreSharedKeyRecipientInfo p_pskRecipInfo := ? + ) := { + pskRecipInfo := p_pskRecipInfo + } // End of template mw_recipientInfo_pskRecipInfo + + template (value) RecipientInfo m_recipientInfo_symmRecipInfo( + in template (value) SymmRecipientInfo p_symmRecipInfo + ) := { + symmRecipInfo := p_symmRecipInfo + } // End of template m_recipientInfo_symmRecipInfo + + template (value) RecipientInfo m_recipientInfo_certRecipInfo( + in template (value) PKRecipientInfo p_certRecipInfo + ) := { + certRecipInfo := p_certRecipInfo + } // End of template m_recipientInfo_certRecipInfo + + template (present) RecipientInfo mw_recipientInfo_certRecipInfo( + template (present) PKRecipientInfo p_certRecipInfo := ? + ) := { + certRecipInfo := p_certRecipInfo + } // End of template mw_recipientInfo_certRecipInfo + + template (value) RecipientInfo m_recipientInfo_signedDataRecipInfo( + in template (value) PKRecipientInfo p_signedDataRecipInfo + ) := { + signedDataRecipInfo := p_signedDataRecipInfo + } // End of template m_recipientInfo_signedDataRecipInfo + + template (value) RecipientInfo m_recipientInfo_rekRecipInfo( + in template (value) PKRecipientInfo p_rekRecipInfo + ) := { + rekRecipInfo := p_rekRecipInfo + } // End of template m_recipientInfo_rekRecipInfo + + template (value) PKRecipientInfo m_pKRecipientInfo( + in template (value) HashedId8 p_recipientId, + in template (value) EncryptedDataEncryptionKey p_encKey + ) := { + recipientId := p_recipientId, + encKey := p_encKey + } // End of template m_pKRecipientInfo + + template (present) PKRecipientInfo mw_pKRecipientInfo( + template (present) HashedId8 p_recipientId := ?, + template (present) EncryptedDataEncryptionKey p_encKey := ? + ) := { + recipientId := p_recipientId, + encKey := p_encKey + } // End of template mw_pKRecipientInfo + + template (value) EciesP256EncryptedKey m_evciesP256EncryptedKey( + in template (value) EccP256CurvePoint p_v, + in template (value) Oct16 p_c, + in template (value) Oct16 p_t + ) :={ + v := p_v, + c := p_c, + t := p_t + } // End of template m_evciesP256EncryptedKey + + template (present) EciesP256EncryptedKey mw_evciesP256EncryptedKey( + template (present) EccP256CurvePoint p_v := ?, + template (present) Oct16 p_c := ?, + template (present) Oct16 p_t := ? + ) :={ + v := p_v, + c := p_c, + t := p_t + } // End of template mw_evciesP256EncryptedKey + + template (value) EncryptedDataEncryptionKey m_encryptedDataEncryptionKey_eciesNistP256( + in template (value) EciesP256EncryptedKey p_eciesNistP256 + ) := { + eciesNistP256 := p_eciesNistP256 + } // End of template m_encryptedDataEncryptionKey_eciesNistP256 + + template (present) EncryptedDataEncryptionKey mw_encryptedDataEncryptionKey_eciesNistP256( + template (present) EciesP256EncryptedKey p_eciesNistP256 := ? + ) := { + eciesNistP256 := p_eciesNistP256 + } // End of template mw_encryptedDataEncryptionKey_eciesNistP256 + + template (value) EncryptedDataEncryptionKey m_encryptedDataEncryptionKey_eciesBrainpoolP256r1( + in template (value) EciesP256EncryptedKey p_eciesBrainpoolP256r1 + ) := { + eciesBrainpoolP256r1 := p_eciesBrainpoolP256r1 + } // End of template m_encryptedDataEncryptionKey_eciesBrainpoolP256r1 + + template (present) EncryptedDataEncryptionKey mw_encryptedDataEncryptionKey_eciesBrainpoolP256r1( + template (present) EciesP256EncryptedKey p_eciesBrainpoolP256r1 := ? + ) := { + eciesBrainpoolP256r1 := p_eciesBrainpoolP256r1 + } // End of template mw_encryptedDataEncryptionKey_eciesBrainpoolP256r1 + + template (value) SymmetricCiphertext m_SymmetricCiphertext_aes128ccm( + in template (value) AesCcmCiphertext p_aes128ccm + ) := { + aes128ccm := p_aes128ccm + } // End of template m_SymmetricCiphertext_aes128ccm + + template (present) SymmetricCiphertext mw_SymmetricCiphertext_aes128ccm( + template (present) AesCcmCiphertext p_aes128ccm := ? + ) := { + aes128ccm := p_aes128ccm + } // End of template mw_SymmetricCiphertext_aes128ccm + + template (value) AesCcmCiphertext m_aesCcmCiphertext( + in template (value) Oct12 p_nonce, + in template (value) Opaque p_ccmCiphertext + ) := { + nonce := p_nonce, + ccmCiphertext := p_ccmCiphertext + } // End of template m_aesCcmCiphertext + + template (present) AesCcmCiphertext mw_aesCcmCiphertext( + template (present) Oct12 p_nonce := ?, + template (present) Opaque p_ccmCiphertext := ? + ) := { + nonce := p_nonce, + ccmCiphertext := p_ccmCiphertext + } // End of template mw_aesCcmCiphertext + + } // End of group encryptedData + + /** + * @desc Send/Receive templates for Payload + * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload + */ + group ieee1609Dot2Data { + + /** + * @desc Send template for Ieee1609Dot2Data + * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload + */ + template (value) Ieee1609Dot2Data m_ieee1609Dot2Data( + in template (value) Ieee1609Dot2Content p_content + ) := { + protocolVersion := c_protocol_version, + content := p_content + } // End of template m_ieee1609Dot2Data + + /** + * @desc Receive template for Ieee1609Dot2Data + * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload + */ + template (present) Ieee1609Dot2Data mw_ieee1609Dot2Data( + template (present) Ieee1609Dot2Content p_content := ? + ) := { + protocolVersion := c_protocol_version, + content := p_content + } // End of template mw_ieee1609Dot2Data + + /** + * @desc Send template for 'unsecured' Payload + * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload + */ + template (value) Ieee1609Dot2Content m_ieee1609Dot2Data_unsecured( + in template (value) Opaque p_unsecuredData + ) := { + unsecuredData := p_unsecuredData + } // End of template m_ieee1609Dot2Data_unsecured + + /** + * @desc Receive template for 'unsecured' Payload + * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload + */ + template (present) Ieee1609Dot2Content mw_ieee1609Dot2Data_unsecured( + template (present) Opaque p_unsecuredData := ? + ) := { + unsecuredData := p_unsecuredData + } // End of template mw_ieee1609Dot2Data_unsecured + + /** + * @desc Send template for 'signed' Payload + * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload + */ + template (value) Ieee1609Dot2Content m_ieee1609Dot2Data_signed( + in template (value) SignedData p_signedData + ) := { + signedData := p_signedData + } // End of template m_ieee1609Dot2Data_signed + + /** + * @desc Send template for 'signed' Payload + * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload + */ + template (present) Ieee1609Dot2Content mw_ieee1609Dot2Data_signed( + template (present) SignedData p_signedData := ? + ) := { + signedData := p_signedData + } // End of template mw_ieee1609Dot2Data_signed + + } // End of group ieee1609Dot2Data + + /** + * @desc Send/Receive templates for HeaderInfo + * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.4 HeaderInfo + */ + group headerFields { + + /** + * @desc Basic send HeaderInfo template with ETSI ITS restrction + */ + template (omit) HeaderInfo m_ieee1609Dot2_headerInfo( + in template (value) Psid p_psid + ) := { + psid := p_psid, + generationTime := omit, + expiryTime := omit, + generationLocation := omit, + p2pcdLearningRequest := omit, + missingCrlIdentifier := omit, + encryptionKey := omit, + inlineP2pcdRequest := omit, + requestedCertificate := omit + } // End of template m_ieee1609Dot2_headerInfo + + /** + * @desc Basic receive HeaderInfo template with ETSI ITS restrction + */ + template (present) HeaderInfo mw_ieee1609Dot2_headerInfo( + template (present) Psid p_psid := ? + ) := { + psid := p_psid, + generationTime := *, + expiryTime := *, + generationLocation := *, + p2pcdLearningRequest := omit, + missingCrlIdentifier := omit, + encryptionKey := omit, + inlineP2pcdRequest := omit, + requestedCertificate := omit + } // End of template mw_ieee1609Dot2_headerInfo + + /** + * @desc Basic receive HeaderInfo template with ETSI ITS restrction + */ + template (present) HeaderInfo mw_ieee1609Dot2_headerInfo_request_certificate( + template (present) Psid p_psid := ?, + template (present) Certificate p_requestedCertificate := ? + ) modifies mw_ieee1609Dot2_headerInfo := { + psid := p_psid, + generationTime := *, + expiryTime := *, + generationLocation := *, + p2pcdLearningRequest := omit, + missingCrlIdentifier := omit, + encryptionKey := omit, + inlineP2pcdRequest := omit, + requestedCertificate := p_requestedCertificate + } // End of template mw_ieee1609Dot2_headerInfo + + /** + * @desc CAM specific send HeaderInfo template with ETSI ITS restrction + * + * @see Clause 7.1.1 Security profile for CAMs + */ + template (omit) HeaderInfo m_headerInfo_cam( + in template (value) Psid p_psid := c_its_aid_CAM, + in template (value) Time64 p_generationTime, + in template (omit) Time64 p_expiryTime := omit, + in template (omit) SequenceOfHashedId3 p_inlineP2pcdRequest := omit + ) modifies m_ieee1609Dot2_headerInfo := { + generationTime := p_generationTime, + expiryTime := p_expiryTime, + generationLocation := omit, + inlineP2pcdRequest := p_inlineP2pcdRequest + } // End of template m_headerInfo_cam + + /** + * @desc CAM specific receive HeaderInfo template with ETSI ITS restrction + * + * Clause 7.1.1 Security profile for CAMs + */ + template (present) HeaderInfo mw_headerInfo_cam( + template (present) Psid p_psid := c_its_aid_CAM, + template (present) Time64 p_generationTime := ?, + template SequenceOfHashedId3 p_inlineP2pcdRequest := omit, + template Certificate p_requestedCertificate := omit + ) modifies mw_ieee1609Dot2_headerInfo := { + psid := c_its_aid_CAM, + generationTime := p_generationTime, + expiryTime := omit, + generationLocation := omit, + inlineP2pcdRequest := p_inlineP2pcdRequest, + requestedCertificate := p_requestedCertificate + } // End of template mw_headerInfo_cam + + /** + * + * Clause 7.1.2 Security profile for DENMs + */ + template (omit) HeaderInfo m_headerInfo_denm( + in template (value) Psid p_psid := c_its_aid_DENM, + in template (value) Time64 p_generationTime, + in template (value) ThreeDLocation p_generationLocation, + in template (omit) Time64 p_expiryTime := omit + ) modifies m_ieee1609Dot2_headerInfo := { + generationTime := p_generationTime, + expiryTime := p_expiryTime, + generationLocation := p_generationLocation + } // End of template m_headerInfo_denm + + /** + * + * Clause 7.1.2 Security profile for DENMs + */ + template (present) HeaderInfo mw_headerInfo_denm( + template (present) Psid p_psid := c_its_aid_DENM, + template (present) Time64 p_generationTime := ?, + template (present) ThreeDLocation p_generationLocation := ?, + template Time64 p_expiryTime := omit + ) modifies mw_ieee1609Dot2_headerInfo := { + generationTime := p_generationTime, + expiryTime := p_expiryTime, + generationLocation := p_generationLocation + } // End of template mw_headerInfo_denm + + /** + * + * Clause 7.1.3 Generic security profile for other signed messages + */ + template (omit) HeaderInfo m_headerInfo_gn( + in template (value) Psid p_psid := c_its_aid_GN, + in template (value) Time64 p_generationTime + ) modifies m_ieee1609Dot2_headerInfo := { + generationTime := p_generationTime + } // End of template m_headerInfo_gn + + /** + * + * Clause 7.1.3 Generic security profile for other signed messages + */ + template (present) HeaderInfo mw_headerInfo_gn( + template (present) Psid p_psid := c_its_aid_GN, + template (present) Time64 p_generationTime := ? + ) modifies mw_ieee1609Dot2_headerInfo := { + generationTime := p_generationTime, + expiryTime := *, + generationLocation := *, + encryptionKey := *, + inlineP2pcdRequest := *, + requestedCertificate := * + } // End of template mw_headerInfo_gn + + template (omit) HeaderInfo m_headerInfo_inner_pki_request( + in template (value) Psid p_psid := c_its_aid_SCR, + in template (value) Time64 p_generationTime + ) modifies m_ieee1609Dot2_headerInfo := { + generationTime := p_generationTime + }; + + template (omit) HeaderInfo m_headerInfo_inner_pki_response( + in template (value) Psid p_psid := c_its_aid_SCR, + in template (value) Time64 p_generationTime + ) modifies m_ieee1609Dot2_headerInfo := { + generationTime := p_generationTime + }; + + template (present) HeaderInfo mw_headerInfo_inner_pki_request( + template (present) Psid p_psid := c_its_aid_SCR, + template (present) Time64 p_generationTime := ? + ) modifies mw_headerInfo_gn := {}; + + template HeaderInfo mw_headerInfo_inner_pki_response( + template (present) Psid p_psid := c_its_aid_SCR, + template Time64 p_generationTime := * + ) modifies mw_ieee1609Dot2_headerInfo := { + generationTime := p_generationTime, + expiryTime := omit, + generationLocation := omit + } + + } // End of group headerFields + + group signatures { + + template (value) Signature m_signature_ecdsaNistP256( + in template (value) EcdsaP256Signature p_ecdsaNistP256Signature + ) := { + ecdsaNistP256Signature := p_ecdsaNistP256Signature + } // End of template m_signature_ecdsaNistP256 + + template (present) Signature mw_signature_ecdsaNistP256( + template (present) EcdsaP256Signature p_ecdsaNistP256Signature := ? + ) := { + ecdsaNistP256Signature := p_ecdsaNistP256Signature + } // End of template mw_signature_ecdsaNistP256 + + template (value) Signature m_signature_ecdsaBrainpoolP256r1( + in template (value) EcdsaP256Signature p_ecdsaBrainpoolP256r1Signature + ) := { + ecdsaBrainpoolP256r1Signature := p_ecdsaBrainpoolP256r1Signature + } // End of template m_signature_ecdsaBrainpoolP256r1 + + template (present) Signature mw_signature_ecdsaBrainpoolP256r1( + template (present) EcdsaP256Signature p_ecdsaBrainpoolP256r1Signature := ? + ) := { + ecdsaBrainpoolP256r1Signature := p_ecdsaBrainpoolP256r1Signature + } // End of template m_signature_ecdsaBrainpoolP256r1 + + template (value) Signature m_signature_ecdsaBrainpoolP384r1( + in template (value) EcdsaP384Signature p_ecdsaBrainpoolP384r1Signature + ) := { + ecdsaBrainpoolP384r1Signature := p_ecdsaBrainpoolP384r1Signature + } // End of template m_signature_ecdsaBrainpoolP384r1 + + template (present) Signature mw_signature_ecdsaBrainpoolP384r1( + template (present) EcdsaP384Signature p_ecdsaBrainpoolP384r1Signature := ? + ) := { + ecdsaBrainpoolP384r1Signature := p_ecdsaBrainpoolP384r1Signature + } // End of template mw_signature_ecdsaBrainpoolP384r1 + + template (value) EcdsaP256Signature m_ecdsaP256Signature( + in template (value) EccP256CurvePoint p_rSig, + in template (value) Oct32 p_sSig + ) := { + rSig := p_rSig, + sSig := p_sSig + } // End of template m_ecdsaP256Signature + + template (present) EcdsaP256Signature mw_ecdsaP256Signature( + template (present) EccP256CurvePoint p_rSig := ?, + template (present) Oct32 p_sSig := ? + ) := { + rSig := p_rSig, + sSig := p_sSig + } // End of template mw_ecdsaP256Signature + + template (value) EcdsaP384Signature m_ecdsaP384Signature( + in template (value) EccP384CurvePoint p_rSig, + in template (value) Oct48 p_sSig + ) := { + rSig := p_rSig, + sSig := p_sSig + } // End of template m_ecdsaP384Signature + + template (present) EcdsaP384Signature mw_ecdsaP384Signature( + template (present) EccP384CurvePoint p_rSig := ?, + template (present) Oct48 p_sSig := ? + ) := { + rSig := p_rSig, + sSig := p_sSig + } // End of template mw_ecdsaP384Signature + + template (value) EccP256CurvePoint m_eccP256CurvePoint_x_only( + in template (value) Oct32 p_x_only + ) := { + x_only := p_x_only + } // End of template m_eccP256CurvePoint_x_only + + template (present) EccP256CurvePoint mw_eccP256CurvePoint_x_only( + template (present) Oct32 p_x_only := ? + ) := { + x_only := p_x_only + } // End of template mw_eccP256CurvePoint_x_only + + template (value) EccP256CurvePoint m_eccP256CurvePoint_compressed_y_0( + in template (value) Oct32 p_compressed_y_0 + ) := { + compressed_y_0 := p_compressed_y_0 + } // End of template m_eccP256CurvePoint_compressed_y_0 + + template (present) EccP256CurvePoint mw_eccP256CurvePoint_compressed_y_0( + template (present) Oct32 p_compressed_y_0 := ? + ) := { + compressed_y_0 := p_compressed_y_0 + } // End of template mw_eccP256CurvePoint_compressed_y_0 + + template (value) EccP256CurvePoint m_eccP256CurvePoint_compressed_y_1( + in template (value) Oct32 p_compressed_y_1 + ) := { + compressed_y_1 := p_compressed_y_1 + } // End of template m_eccP256CurvePoint_compressed_y_1 + + template (present) EccP256CurvePoint mw_eccP256CurvePoint_compressed_y_1( + template (present) Oct32 p_compressed_y_1 := ? + ) := { + compressed_y_1 := p_compressed_y_1 + } // End of template mw_eccP256CurvePoint_compressed_y_1 + + template (value) EccP256CurvePoint m_eccP256CurvePoint_uncompressed( + in template (value) Oct32 p_x, + in template (value) Oct32 p_y + ) := { + uncompressedP256 := { + x := p_x, + y := p_y + } + } // End of template m_eccP256CurvePoint_uncompressed + + template (present) EccP256CurvePoint mw_eccP256CurvePoint_uncompressed( + template (present) Oct32 p_x := ?, + template (present) Oct32 p_y := ? + ) := { + uncompressedP256 := { + x := p_x, + y := p_y + } + } // End of template mw_eccP256CurvePoint_uncompressed + + template (value) EccP384CurvePoint m_eccP384CurvePoint_x_only( + in template (value) Oct48 p_x_only + ) := { + x_only := p_x_only + } // End of template m_eccP384CurvePoint_x_only + + template (present) EccP384CurvePoint mw_eccP384CurvePoint_x_only( + template (present) Oct48 p_x_only := ? + ) := { + x_only := p_x_only + } // End of template mw_eccP384CurvePoint_x_only + + template (value) EccP384CurvePoint m_eccP384CurvePoint_compressed_y_0( + in template (value) Oct48 p_compressed_y_0 + ) := { + compressed_y_0 := p_compressed_y_0 + } // End of template m_eccP384CurvePoint_compressed_y_0 + + template (present) EccP384CurvePoint mw_eccP384CurvePoint_compressed_y_0( + template (present) Oct48 p_compressed_y_0 := ? + ) := { + compressed_y_0 := p_compressed_y_0 + } // End of template mw_eccP384CurvePoint_compressed_y_0 + + template (value) EccP384CurvePoint m_eccP384CurvePoint_compressed_y_1( + in template (value) Oct48 p_compressed_y_1 + ) := { + compressed_y_1 := p_compressed_y_1 + } // End of template m_eccP384CurvePoint_compressed_y_1 + + template (present) EccP384CurvePoint mw_eccP384CurvePoint_compressed_y_1( + template (present) Oct48 p_compressed_y_1 := ? + ) := { + compressed_y_1 := p_compressed_y_1 + } // End of template mw_eccP384CurvePoint_compressed_y_1 + + template (value) EccP384CurvePoint m_eccP384CurvePoint_uncompressed( + in template (value) Oct48 p_x, + in template (value) Oct48 p_y + ) := { + uncompressedP384 := { + x := p_x, + y := p_y + } + } // End of template m_eccP384CurvePoint_uncompressed + + template (present) EccP384CurvePoint mw_eccP384CurvePoint_uncompressed( + template (present) Oct48 p_x := ?, + template (present) Oct48 p_y := ? + ) := { + uncompressedP384 := { + x := p_x, + y := p_y + } + } // End of template mw_eccP384CurvePoint_uncompressed + + } // End of group signatures + + /** + * @desc Dummy send/receive templates for certificates + * @see Draft ETSI TS 103 097 V1.3.1 Clause 6 Specification of certificate format + */ + group certificates { + + /** + * @desc Send certificate template of type explicit (signature is included) + * @member p_signer_info Signer information + * @member p_subject_info The subject information + * @member p_subject_attributes List of subject attribute + * @member p_validity_restrictions List of validity restriction + * @member p_signature The signature + * @see Draft ETSI TS 103 097 V1.3.1 Clause 6.1 Certificate + */ + template (omit) EtsiTs103097Certificate m_etsiTs103097Certificate( + in template (value) IssuerIdentifier p_issuer, + in template (value) ToBeSignedCertificate p_toBeSigned, + in template (omit) Signature p_signature_ := omit + ) := { + version := c_certificate_version, + type_ := explicit, + issuer := p_issuer, + toBeSigned := p_toBeSigned, + signature_ := p_signature_ + } // End of template m_etsiTs103097Certificate + + /** + * @desc Send certificate template of type explicit (signature is included) + * @member p_signer_info Signer information + * @member p_subject_info The subject information + * @member p_subject_attributes List of subject attribute + * @member p_validity_restrictions List of validity restriction + * @member p_signature The signature + * @see Draft ETSI TS 103 097 V1.3.1 Clause 6.1 Certificate + */ + template (present) EtsiTs103097Certificate mw_etsiTs103097Certificate( + template (present) IssuerIdentifier p_issuer := ?, + template (present) ToBeSignedCertificate p_toBeSigned := ?, + template (present) Signature p_signature_ := ? + ) := { + version := c_certificate_version, + type_ := explicit, + issuer := p_issuer, + toBeSigned := p_toBeSigned, + signature_ := p_signature_ + } // End of template mw_etsiTs103097Certificate + + } // End of group certificates + + group issuerIdentifier { + + template (value) IssuerIdentifier m_issuerIdentifier_self( + in template (value) HashAlgorithm p_self := sha256 + ) := { + self_ := p_self + } // End of template m_issuerIdentifier_self + + template (present) IssuerIdentifier mw_issuerIdentifier_self( + template (present) HashAlgorithm p_self := ? + ) := { + self_ := p_self + } // End of template mw_issuerIdentifier_self + + template (value) IssuerIdentifier m_issuerIdentifier_sha256AndDigest( // FIXME Add opque field for unknown issuer? + in template (value) HashedId8 p_sha256AndDigest + ) := { + sha256AndDigest := p_sha256AndDigest + } // End of template m_issuerIdentifier_sha256AndDigest + + template (present) IssuerIdentifier mw_issuerIdentifier_sha256AndDigest( // FIXME Add opque field for unknown issuer? + template (present) HashedId8 p_sha256AndDigest := ? + ) := { + sha256AndDigest := p_sha256AndDigest + } // End of template mw_issuerIdentifier_sha256AndDigest + + template (value) IssuerIdentifier m_issuerIdentifier_sha384AndDigest( + in template (value) HashedId8 p_sha384AndDigest + ) := { + sha384AndDigest := p_sha384AndDigest + } // End of template m_issuerIdentifier_sha384AndDigest + + template (present) IssuerIdentifier mw_issuerIdentifier_sha384AndDigest( + template (present) HashedId8 p_sha384AndDigest := ? + ) := { + sha384AndDigest := p_sha384AndDigest + } // End of template mw_issuerIdentifier_sha384AndDigest + + } // End of group issuerIdentifier + + group toBeSignedCertificate { + + /** + * @desc Send template for ToBeSignedCertificate with CA restrictions + * @see ETSI TS 103 097 V1.3.1 Clause 7.2.3 Root CA certificate + */ + template (omit) ToBeSignedCertificate m_toBeSignedCertificate_ca( + in template (value) CertificateId p_id, + in template (value) SequenceOfPsidSsp p_appPermissions, + in template (value) SequenceOfPsidGroupPermissions p_certIssuePermissions, + in template (value) VerificationKeyIndicator p_verifyKeyIndicator, + in template (omit) ValidityPeriod p_validityPeriod := omit, + in template (omit) GeographicRegion p_region := omit, + in template (omit) SubjectAssurance p_assuranceLevel := omit, + in template (omit) PublicEncryptionKey p_encryptionKey := omit + ) := { + id := p_id, + cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 + crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 + validityPeriod := p_validityPeriod, + region := p_region, + assuranceLevel := p_assuranceLevel, + appPermissions := p_appPermissions, + certIssuePermissions := p_certIssuePermissions, // ETSI TS 103 097 V1.3.1 Clause 7.2.3 Root CA certificates Bullet 4 + certRequestPermissions := omit, + canRequestRollover := omit, + encryptionKey := p_encryptionKey, + verifyKeyIndicator := p_verifyKeyIndicator + } // End of template m_toBeSignedCertificate_ca + + /** + * @desc Receive template for ToBeSignedCertificate with CA restrictions + * @see ETSI TS 103 097 V1.3.1 Clause 7.2.3 Root CA certificate + */ + template ToBeSignedCertificate mw_toBeSignedCertificate_ca( + template (present) CertificateId p_id := ?, + template (present) SequenceOfPsidSsp p_appPermissions := ?, + template (present) SequenceOfPsidGroupPermissions p_certIssuePermissions := ?, + template (present) SequenceOfPsidGroupPermissions p_certRequestPermissions := ?, + template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, + template (present) ValidityPeriod p_validityPeriod := ?, + template GeographicRegion p_region := *, + template SubjectAssurance p_assuranceLevel := *, + template PublicEncryptionKey p_encryptionKey := * + ) := { + id := p_id, + cracaId := '000000'O, + crlSeries := 0, + validityPeriod := p_validityPeriod, + region := p_region, + assuranceLevel := p_assuranceLevel, + appPermissions := omit, + certIssuePermissions := p_certIssuePermissions, + certRequestPermissions := p_certRequestPermissions, + canRequestRollover := omit, + encryptionKey := p_encryptionKey, + verifyKeyIndicator := p_verifyKeyIndicator + } // End of template mw_toBeSignedCertificate + + /** + * @desc Send template for ToBeSignedCertificate with Enrolment credential restrictions + * @see ETSI TS 103 097 V1.3.1 Clause 7.2.2 Enrolment credential + */ + template (omit) ToBeSignedCertificate m_toBeSignedCertificate_ea( + in template (value) CertificateId p_id, + in template (value) SequenceOfPsidSsp p_appPermissions, + in template (value) VerificationKeyIndicator p_verifyKeyIndicator, + in template (value) ValidityPeriod p_validityPeriod, + in template (omit) GeographicRegion p_region := omit, + in template (omit) SubjectAssurance p_assuranceLevel := omit, + in template (omit) PublicEncryptionKey p_encryptionKey := omit + ) := { + id := p_id, + cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 + crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 + validityPeriod := p_validityPeriod, + region := p_region, + assuranceLevel := p_assuranceLevel, + appPermissions := p_appPermissions, + certIssuePermissions := omit, + certRequestPermissions := omit, + canRequestRollover := omit, + encryptionKey := p_encryptionKey, + verifyKeyIndicator := p_verifyKeyIndicator + } // End of template m_toBeSignedCertificate_ea + + /** + * @desc Send template for ToBeSignedCertificate with Enrolment credential restrictions + * @see ETSI TS 103 097 V1.3.1 Clause 7.2.2 Enrolment credential + */ + template ToBeSignedCertificate mw_toBeSignedCertificate_ea( + template (present) CertificateId p_id := ?, + template (present) SequenceOfPsidSsp p_appPermissions := ?, + template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, + template (present) ValidityPeriod p_validityPeriod := ?, + template GeographicRegion p_region := *, + template SubjectAssurance p_assuranceLevel := *, + template PublicEncryptionKey p_encryptionKey := * + ) := { + id := p_id, + cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 + crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 + validityPeriod := p_validityPeriod, + region := p_region, + assuranceLevel := p_assuranceLevel, + appPermissions := p_appPermissions, + certIssuePermissions := omit, + certRequestPermissions := omit, + canRequestRollover := omit, + encryptionKey := p_encryptionKey, + verifyKeyIndicator := p_verifyKeyIndicator + } // End of template mw_toBeSignedCertificate_ea + + template (omit) ToBeSignedCertificate m_toBeSignedCertificate_ec( + in template (value) CertificateId p_id, + in template (value) SequenceOfPsidSsp p_appPermissions, + in template (value) VerificationKeyIndicator p_verifyKeyIndicator, + in template (value) ValidityPeriod p_validityPeriod, + in template (omit) GeographicRegion p_region := omit, + in template (omit) SubjectAssurance p_assuranceLevel := omit, + in template (omit) PublicEncryptionKey p_encryptionKey := omit + ) := { + id := p_id, + cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 + crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 + validityPeriod := p_validityPeriod, + region := p_region, + assuranceLevel := p_assuranceLevel, + appPermissions := p_appPermissions, + certIssuePermissions := omit, + certRequestPermissions := omit, + canRequestRollover := omit, + encryptionKey := p_encryptionKey, + verifyKeyIndicator := p_verifyKeyIndicator + } // End of template m_toBeSignedCertificate_ec + + /** + * @desc Send template for ToBeSignedCertificate with Enrolment credential restrictions + * @see ETSI TS 103 097 V1.3.1 Clause 7.2.2 Enrolment credential + */ + template ToBeSignedCertificate mw_toBeSignedCertificate_ec( + template (present) CertificateId p_id := ?, + template (present) SequenceOfPsidSsp p_appPermissions := ?, + template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, + template (present) ValidityPeriod p_validityPeriod := ?, + template GeographicRegion p_region := *, + template SubjectAssurance p_assuranceLevel := *, + template PublicEncryptionKey p_encryptionKey := * + ) := { + id := p_id, + cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 + crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 + validityPeriod := p_validityPeriod, + region := p_region, + assuranceLevel := p_assuranceLevel, + appPermissions := p_appPermissions, + certIssuePermissions := omit, + certRequestPermissions := omit, + canRequestRollover := omit, + encryptionKey := p_encryptionKey, + verifyKeyIndicator := p_verifyKeyIndicator + } // End of template mw_toBeSignedCertificate_ec + + /** + * @desc Send template for ToBeSignedCertificate with Authorization authority restrictions + * @see ETSI TS 103 097 V1.3.1 Clause 7.2.4 Subordinate certification authority certificates + */ + template (omit) ToBeSignedCertificate m_toBeSignedCertificate_aa( + in template (value) CertificateId p_id, + in template (value) SequenceOfPsidSsp p_appPermissions, + in template (value) VerificationKeyIndicator p_verifyKeyIndicator, + in template (value) ValidityPeriod p_validityPeriod, + in template (omit) GeographicRegion p_region := omit, + in template (omit) SubjectAssurance p_assuranceLevel := omit, + in template (omit) PublicEncryptionKey p_encryptionKey := omit + ) := { + id := p_id, + cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 + crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 + validityPeriod := p_validityPeriod, + region := p_region, + assuranceLevel := p_assuranceLevel, + appPermissions := p_appPermissions, + certIssuePermissions := omit, + certRequestPermissions := omit, + canRequestRollover := omit, + encryptionKey := p_encryptionKey, + verifyKeyIndicator := p_verifyKeyIndicator + } // End of template m_toBeSignedCertificate_aa + + /** + * @desc Send template for ToBeSignedCertificate with Authorization authority restrictions + * @see ETSI TS 103 097 V1.3.1 Clause 7.2.4 Subordinate certification authority certificates + */ + template ToBeSignedCertificate mw_toBeSignedCertificate_aa( + template (present) CertificateId p_id := ?, + template (present) SequenceOfPsidSsp p_appPermissions := ?, + template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, + template (present) ValidityPeriod p_validityPeriod := ?, + template GeographicRegion p_region := *, + template SubjectAssurance p_assuranceLevel := *, + template PublicEncryptionKey p_encryptionKey := * + ) := { + id := p_id, + cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 + crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 + validityPeriod := p_validityPeriod, + region := p_region, + assuranceLevel := p_assuranceLevel, + appPermissions := p_appPermissions, + certIssuePermissions := omit, + certRequestPermissions := omit, + canRequestRollover := omit, + encryptionKey := p_encryptionKey, + verifyKeyIndicator := p_verifyKeyIndicator + } // End of template mw_toBeSignedCertificate_aa + + template (present) CertificateId mw_certificateId_name( + template (present) charstring p_name := ? + ) := { + name := p_name + } // End of template mw_certificateId_name + + template CertificateId mw_certificateId_none := { + none_ := NULL + } // End of template mw_certificateId_none + + /** + * @desc Send template for ToBeSignedCertificate with AT restrictions + * @see ETSI TS 103 097 V1.3.1 Clause 7.2.1 Authorization tickets + */ + template (omit) ToBeSignedCertificate m_toBeSignedCertificate_at( + in template (value) SequenceOfPsidSsp p_appPermissions, + in template (value) VerificationKeyIndicator p_verifyKeyIndicator, + in template (omit) ValidityPeriod p_validityPeriod := omit, + in template (omit) GeographicRegion p_region := omit, + in template (omit) SubjectAssurance p_assuranceLevel := omit, + in template (omit) PublicEncryptionKey p_encryptionKey := omit + ) := { + id := { none_ := NULL }, + cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 + crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 + validityPeriod := p_validityPeriod, + region := p_region, + assuranceLevel := p_assuranceLevel, + appPermissions := p_appPermissions, + certIssuePermissions := omit, + certRequestPermissions := omit, + canRequestRollover := omit, + encryptionKey := p_encryptionKey, + verifyKeyIndicator := p_verifyKeyIndicator + } // End of template m_toBeSignedCertificate_at + + /** + * @desc Send template for ToBeSignedCertificate with AT restrictions + * @see ETSI TS 103 097 V1.3.1 Clause 7.2.1 Authorization tickets + */ + template ToBeSignedCertificate mw_toBeSignedCertificate_at( + template (present) SequenceOfPsidSsp p_appPermissions := ?, + template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, + template (present) ValidityPeriod p_validityPeriod := ?, + template GeographicRegion p_region := *, + template SubjectAssurance p_assuranceLevel := *, + template PublicEncryptionKey p_encryptionKey := * + ) := { + id := { none_ := NULL }, + cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 + crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 + validityPeriod := p_validityPeriod, + region := p_region, + assuranceLevel := p_assuranceLevel, + appPermissions := p_appPermissions, + certIssuePermissions := omit, + certRequestPermissions := omit, + canRequestRollover := omit, + encryptionKey := p_encryptionKey, + verifyKeyIndicator := p_verifyKeyIndicator + } // End of template mw_toBeSignedCertificate_at + + } // End of group toBeSignedCertificate + + group verificationKeys { + + template (value) VerificationKeyIndicator m_verificationKeyIndicator_verificationKey( + in template (value) PublicVerificationKey p_verificationKey + ) := { + verificationKey := p_verificationKey + } // End of template m_verificationKeyIndicator_verificationKey + + template (present) VerificationKeyIndicator mw_verificationKeyIndicator_verificationKey( + template (present) PublicVerificationKey p_verificationKey := ? + ) := { + verificationKey := p_verificationKey + } // End of template mw_verificationKeyIndicator_verificationKey + + template (value) VerificationKeyIndicator m_verificationKeyIndicator_reconstructionValue( + in template (value) EccP256CurvePoint p_reconstructionValue + ) := { + reconstructionValue := p_reconstructionValue + } // End of template m_verificationKeyIndicator_reconstructionValue + + template (present) VerificationKeyIndicator mw_verificationKeyIndicator_reconstructionValue( + template (present) EccP256CurvePoint p_reconstructionValue := ? + ) := { + reconstructionValue := p_reconstructionValue + } // End of template mw_verificationKeyIndicator_reconstructionValue + + template (value) PublicVerificationKey m_publicVerificationKey_ecdsaNistP256( + in template (value) EccP256CurvePoint p_ecdsaNistP256 + ) := { + ecdsaNistP256 := p_ecdsaNistP256 + } // End of template m_publicVerificationKey_ecdsaNistP256 + + template (present) PublicVerificationKey mw_publicVerificationKey_ecdsaNistP256( + template (present) EccP256CurvePoint p_ecdsaNistP256 := ? + ) := { + ecdsaNistP256 := p_ecdsaNistP256 + } // End of template mw_publicVerificationKey_ecdsaNistP256 + + template (value) PublicVerificationKey m_publicVerificationKey_ecdsaBrainpoolP256r1( + in template (value) EccP256CurvePoint p_ecdsaBrainpoolP256r1 + ) := { + ecdsaBrainpoolP256r1 := p_ecdsaBrainpoolP256r1 + } // End of template m_publicVerificationKey_ecdsaBrainpoolP256r1 + + template (present) PublicVerificationKey mw_publicVerificationKey_ecdsaBrainpoolP256r1( + template (present) EccP256CurvePoint p_ecdsaBrainpoolP256r1 := ? + ) := { + ecdsaBrainpoolP256r1 := p_ecdsaBrainpoolP256r1 + } // End of template mw_publicVerificationKey_ecdsaBrainpoolP256r1 + + template (value) PublicVerificationKey m_publicVerificationKey_ecdsaBrainpoolP384r1( + in template (value) EccP384CurvePoint p_ecdsaBrainpoolP384r1 + ) := { + ecdsaBrainpoolP384r1 := p_ecdsaBrainpoolP384r1 + } // End of template m_publicVerificationKey_ecdsaBrainpoolP384r1 + + template (present) PublicVerificationKey mw_publicVerificationKey_ecdsaBrainpoolP384r1( + template (present) EccP384CurvePoint p_ecdsaBrainpoolP384r1 := ? + ) := { + ecdsaBrainpoolP384r1 := p_ecdsaBrainpoolP384r1 + } // End of template mw_publicVerificationKey_ecdsaBrainpoolP384r1 + + } // End of group verificationKeys + + group encryptionKey { + + template (value) PublicEncryptionKey m_encryptionKey( + in template (value) SymmAlgorithm p_supportedSymmAlg := aes128Ccm, + in template (value) BasePublicEncryptionKey p_publicKey + ) := { + supportedSymmAlg := p_supportedSymmAlg, + publicKey := p_publicKey + } // End of template m_encryptionKey + + template (present) PublicEncryptionKey mw_encryptionKey( + template (present) SymmAlgorithm p_supportedSymmAlg := aes128Ccm, + template (present) BasePublicEncryptionKey p_publicKey := ? + ) := { + supportedSymmAlg := p_supportedSymmAlg, + publicKey := p_publicKey + } // End of template mw_encryptionKey + + template (value) BasePublicEncryptionKey m_publicEncryptionKey_eciesNistP256( + in template (value) EccP256CurvePoint p_eciesNistP256 + ) := { + eciesNistP256 := p_eciesNistP256 + } // End of template m_publicEncryptionKey_eciesNistP256 + + template (present) BasePublicEncryptionKey mw_publicEncryptionKey_eciesNistP256( + template (present) EccP256CurvePoint p_eciesNistP256 := ? + ) := { + eciesNistP256 := p_eciesNistP256 + } // End of template mw_publicEncryptionKey_eciesNistP256 + + template (value) BasePublicEncryptionKey m_publicEncryptionKey_eciesBrainpoolP256r1( + in template (value) EccP256CurvePoint p_eciesBrainpoolP256r1 + ) := { + eciesBrainpoolP256r1 := p_eciesBrainpoolP256r1 + } // End of template m_publicEncryptionKey_eciesBrainpoolP256r1 + + template (present) BasePublicEncryptionKey mw_publicEncryptionKey_eciesBrainpoolP256r1( + template (present) EccP256CurvePoint p_eciesBrainpoolP256r1 := ? + ) := { + eciesBrainpoolP256r1 := p_eciesBrainpoolP256r1 + } // End of template mw_publicEncryptionKey_eciesBrainpoolP256r1 + + } // End of group encryptionKey + + group appPermissions { + + template (omit) PsidSsp m_appPermissions( + in template (value) Psid p_psid, + in template (omit) ServiceSpecificPermissions p_ssp := omit + ) := { + psid := p_psid, + ssp := p_ssp + } // End of template m_appPermissions + + template PsidSsp mw_appPermissions( + template (present) Psid p_psid := ?, + template ServiceSpecificPermissions p_ssp := * + ) := { + psid := p_psid, + ssp := p_ssp + } // End of template mw_appPermissions + + template (value) PsidSspRange m_psidSspRange( + in Psid p_psid, + in template (value) SspRange p_sspRange := m_SspRange_all + ) := { + psid := p_psid, + sspRange := p_sspRange + } // End of template m_psidSspRange + + template (value) SspRange m_SspRange_all := { + all_ := NULL + } // End of template m_SspRange_all + + template (value) SspRange m_SspRange_opaque( + in template (value) SequenceOfOctetString p_opaque + ) := { + opaque := p_opaque + } // End of template m_SspRange_opaque + + template (value) SspRange m_SspRange_bitmapSspRange( + in template (value) BitmapSspRange p_bitmapSspRange + ) := { + bitmapSspRange := p_bitmapSspRange + } // End of template m_SspRange_bitmapSspRange + + template (value) PsidGroupPermissions m_psidGroupPermissions( + in template (value) SubjectPermissions p_subjectPermissions, + in integer p_minChainLength := 1, + in integer p_chainLengthRange := 0, + in EndEntityType p_eeType := oct2bit('00'O) + ) := { + subjectPermissions := p_subjectPermissions, + minChainLength := p_minChainLength, + chainLengthRange := p_chainLengthRange, + eeType := p_eeType + } // End of template m_psidGroupPermissions + + template (present) PsidGroupPermissions mw_psidGroupPermissions( + template (present) SubjectPermissions p_subjectPermissions := ?, + integer p_minChainLength := 1, + integer p_chainLengthRange := 0, + template (present) EndEntityType p_eeType := ? + ) := { + subjectPermissions := p_subjectPermissions, + minChainLength := p_minChainLength, + chainLengthRange := p_chainLengthRange, + eeType := p_eeType + } // End of template mw_psidGroupPermissions + + template (value) SubjectPermissions m_subjectPermissions_explicit( + in template (value) SequenceOfPsidSspRange p_certIssuePermissions + ) := { + explicit := p_certIssuePermissions + } // End of template m_subjectPermissions_explicit + + template (present) SubjectPermissions mw_subjectPermissions_explicit( + template (present) SequenceOfPsidSspRange p_certIssuePermissions := ? + ) := { + explicit := p_certIssuePermissions + } // End of template mw_subjectPermissions_explicit + + template (value) SubjectPermissions m_subjectPermissions_all := { + all_ := NULL + } // End of template m_subjectPermissions_all + + } // End of group appPermissions + + + group validityRestriction { + + template (value) ValidityPeriod m_validityPeriod( + in template (value) Time32 p_start_, + in template (value) Duration p_duration + ) := { + start_ := p_start_, + duration := p_duration + } // End of template m_validityPeriod + + template (present) ValidityPeriod mw_validityPeriod( + template (present) Time32 p_start_ := ?, + template (present) Duration p_duration := ? + ) := { + start_ := p_start_, + duration := p_duration + } // End of template mw_validityPeriod + + /** + * @desc Send template for Duration (in seconds) + * @param p_duration The duration value + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.18 Duration + */ + template (value) Duration m_duration_in_seconds( + in template (value) Int16 p_duration + ) := { + seconds := p_duration + } // End of template m_duration_in_seconds + + /** + * @desc Send template for Duration (in hours) + * @param p_duration The duration value + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.18 Duration + */ + template (value) Duration m_duration_in_hours( + in template (value) Int16 p_duration + ) := { + hours := p_duration + } // End of template m_duration_in_hours + + /** + * @desc Receive template for Duration (in seconds) + * @param p_duration The duration value + * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.18 Duration + */ + template (present) Duration mw_duration_in_seconds( + template (present) Int16 p_duration := ? + ) := { + seconds := p_duration + } // End of template mw_duration_in_seconds + + template (value) Duration m_duration_years( + in template (value) Uint16 p_years + ) := { + years := p_years + } // End of template m_duration_years + + template (present) Duration mw_duration_years( + template (present) Uint16 p_years := ? + ) := { + years := p_years + } // End of template mw_duration_years + + } // End of group validityRestriction + + group ssp { + + group sspCam { + + group sspCamSend { + + template (value) SspCAM m_sspCAMContainer_sign_all := { + cenDsrcTollingZone := '1'B, + publicTransport := '1'B, + specialTransport := '1'B, + dangerousGoods := '1'B, + roadwork := '1'B, + rescue := '1'B, + emergency := '1'B, + safetyCar := '1'B, + closedLanes := '1'B, + requestForRightOfWay := '1'B, + requestForFreeCrossingAtATrafficLight := '1'B, + noPassing := '1'B, + noPassingForTrucks := '1'B, + speedLimit := '1'B, + reserved := '000000000000000000'B + } // End of template m_sspCAMContainer_sign_all + + template (value) SspCAM m_sspCAMContainer_vehicle + modifies m_sspCAMContainer_sign_all := { + cenDsrcTollingZone := '0'B, + closedLanes := '0'B, + noPassing := '0'B, + noPassingForTrucks := '0'B, + speedLimit := '0'B + } // End of template m_sspCAMContainer_vehicle + + template (value) ServiceSpecificPermissions m_sspCAM( + in template (value) BitmapSsp p_bitmapSsp + ) := { + bitmapSsp := p_bitmapSsp + } // End of template m_sspCAM + + } // End of group sspCamSend + + group sspCamRecv { + + template (present) SspCAM mw_sspCAMContainer_dummy := { + cenDsrcTollingZone := ?, + publicTransport := ?, + specialTransport := ?, + dangerousGoods := ?, + roadwork := ?, + rescue := ?, + emergency := ?, + safetyCar := ?, + closedLanes := ?, + requestForRightOfWay := ?, + requestForFreeCrossingAtATrafficLight := ?, + noPassing := ?, + noPassingForTrucks := ?, + speedLimit := ?, + reserved := '000000000000000000'B + } // End of template mw_sspCAMContainer_dummy + + template (present) ServiceSpecificPermissions mw_sspCAM_dummy := { + bitmapSsp := ? + } // End of template mw_sspCAM_dummy + + } // End of group sspCamRecv + + } // End of group sspCam + + group sspDenm { + + group sspDenmSend { + + template (value) SspDENM m_sspDENMContainer_sign_all := { + trafficCondition := '1'B, + accident := '1'B, + roadworks := '1'B, + adverseWeatherCondition_Adhesion := '1'B, + hazardousLocation_SurfaceCondition := '1'B, + hazardousLocation_ObstacleOnTheRoad := '1'B, + hazardousLocation_AnimalOnTheRoad := '1'B, + humanPresenceOnTheRoad := '1'B, + wrongWayDriving := '1'B, + rescueAndRecoveryWorkInProgress := '1'B, + adverseWeatherCondition_ExtremeWeatherCondition := '1'B, + adverseWeatherCondition_Visibility := '1'B, + adverseWeatherCondition_Precipitation := '1'B, + slowVehicle := '1'B, + dangerousEndOfQueue := '1'B, + vehicleBreakdown := '1'B, + postCrash := '1'B, + humanProblem := '1'B, + stationaryVehicle := '1'B, + emergencyVehicleApproaching := '1'B, + hazardousLocation_DangerousCurve := '1'B, + collisionRisk := '1'B, + signalViolation := '1'B, + dangerousSituation := '1'B, + reserved := '00000000'B + } // End of template m_sspDENMContainer_sign_all + + template (value) SspDENM m_sspDENMContainer_vehicle + modifies m_sspDENMContainer_sign_all:= { + trafficCondition := '0'B, + accident := '0'B, + roadworks := '0'B, + adverseWeatherCondition_Adhesion := '0'B, + hazardousLocation_SurfaceCondition := '0'B, + hazardousLocation_ObstacleOnTheRoad := '0'B, + hazardousLocation_AnimalOnTheRoad := '0'B, + slowVehicle := '0'B, + dangerousEndOfQueue := '0'B, + vehicleBreakdown := '0'B, + stationaryVehicle := '0'B + } // End of template m_sspDENMContainer_sign_all + + template (value) SspDENM m_sspDENMContainer_roadSideUnit + modifies m_sspDENMContainer_sign_all:= { + trafficCondition := '0'B, + accident := '0'B, + roadworks := '0'B, + adverseWeatherCondition_Adhesion := '0'B, + hazardousLocation_SurfaceCondition := '0'B, + hazardousLocation_ObstacleOnTheRoad := '0'B, + hazardousLocation_AnimalOnTheRoad := '0'B, + humanPresenceOnTheRoad := '0'B, + wrongWayDriving := '0'B, + rescueAndRecoveryWorkInProgress := '0'B, + adverseWeatherCondition_ExtremeWeatherCondition := '0'B, + adverseWeatherCondition_Visibility := '0'B, + adverseWeatherCondition_Precipitation := '0'B, + postCrash := '0'B, + humanProblem := '0'B, + stationaryVehicle := '0'B, + hazardousLocation_DangerousCurve := '0'B, + collisionRisk := '0'B, + dangerousSituation := '0'B + } // End of template m_sspDENMContainer_roadSideUnit + + template (value) ServiceSpecificPermissions m_sspDENM( + in template (value) BitmapSsp p_bitmapSsp + ) := { + bitmapSsp := p_bitmapSsp + } // End of template m_sspDENM + + } // End of group sspDenmSend + + group sspDenmRecv { + + template (present) SspDENM mw_sspDENMContainer_dummy := { + trafficCondition := ?, + accident := ?, + roadworks := ?, + adverseWeatherCondition_Adhesion := ?, + hazardousLocation_SurfaceCondition := ?, + hazardousLocation_ObstacleOnTheRoad := ?, + hazardousLocation_AnimalOnTheRoad := ?, + humanPresenceOnTheRoad := ?, + wrongWayDriving := ?, + rescueAndRecoveryWorkInProgress := ?, + adverseWeatherCondition_ExtremeWeatherCondition := ?, + adverseWeatherCondition_Visibility := ?, + adverseWeatherCondition_Precipitation := ?, + slowVehicle := ?, + dangerousEndOfQueue := ?, + vehicleBreakdown := ?, + postCrash := ?, + humanProblem := ?, + stationaryVehicle := ?, + emergencyVehicleApproaching := ?, + hazardousLocation_DangerousCurve := ?, + collisionRisk := ?, + signalViolation := ?, + dangerousSituation := ?, + reserved := '00000000'B + } // End of template mw_sspDENMContainer_dummy + + template (present) SspDENM mw_sspDENMContainer_vehicle + modifies mw_sspDENMContainer_dummy := { + trafficCondition := '0'B, + accident := '0'B, + roadworks := '0'B, + adverseWeatherCondition_Adhesion := '0'B, + hazardousLocation_SurfaceCondition := '0'B, + hazardousLocation_ObstacleOnTheRoad := '0'B, + hazardousLocation_AnimalOnTheRoad := '0'B, + slowVehicle := '0'B, + dangerousEndOfQueue := '0'B, + vehicleBreakdown := '0'B, + stationaryVehicle := '0'B + } // End of template mw_sspDENMContainer_vehicle + + template (present) SspDENM mw_sspDENMContainer_roadSideUnit + modifies mw_sspDENMContainer_dummy := { + trafficCondition := '0'B, + accident := '0'B, + roadworks := '0'B, + adverseWeatherCondition_Adhesion := '0'B, + hazardousLocation_SurfaceCondition := '0'B, + hazardousLocation_ObstacleOnTheRoad := '0'B, + hazardousLocation_AnimalOnTheRoad := '0'B, + humanPresenceOnTheRoad := '0'B, + wrongWayDriving := '0'B, + rescueAndRecoveryWorkInProgress := '0'B, + adverseWeatherCondition_ExtremeWeatherCondition := '0'B, + adverseWeatherCondition_Visibility := '0'B, + adverseWeatherCondition_Precipitation := '0'B, + postCrash := '0'B, + humanProblem := '0'B, + stationaryVehicle := '0'B, + hazardousLocation_DangerousCurve := '0'B, + collisionRisk := '0'B, + dangerousSituation := '0'B + } // End of template m_sspDENMContainer_roadSideUnit + + } // End of group sspDenmRecv + + } // End of group sspDenm + + } // End of group ssp + + group utPrimitives { + + template (value) UtGnInitialize m_secGnInitialize( + in Oct8 p_hashedId8 + ) := { + hashedId8 := p_hashedId8 + } // End of template m_secGnInitialize + + } // End of group utPrimitives + +} // End of module LibItsSecurity_Templates diff --git a/ttcn/Security/LibItsSecurity_TestSystem.ttcn b/ttcn/Security/LibItsSecurity_TestSystem.ttcn index db5ac95c..3f6b75cb 100644 --- a/ttcn/Security/LibItsSecurity_TestSystem.ttcn +++ b/ttcn/Security/LibItsSecurity_TestSystem.ttcn @@ -1,50 +1,50 @@ -/** - * @author ETSI / STF481 / STF507 / STF517 / STF538 - * @version $URL$ - * $Id$ - * @desc Test System module for Security Protocol - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsSecurity_TestSystem { - - // LibCommon - import from LibCommon_DataStrings all; - - // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; - - // LibItsSecurity - import from LibItsSecurity_TypesAndValues all; - import from LibItsSecurity_Pixits all; - - group componentDefinitions { - - /** - * @desc ITS Security Component - */ - type component ItsSecurityBaseComponent { - - // Certificates - var Certificate vc_aaCertificate; /** Test Adapter AA certificate */ - var Certificate vc_atCertificate; /** Test Adapter AT certificate */ - var Certificate vc_lastAtCertificateUsed; /** Last Test Adapter certificate used in 'f_buildGnSecuredXXX' functions */ - var charstring vc_hashedId8ToBeUsed := PX_IUT_DEFAULT_CERTIFICATE; /** Digest value of the AT certificate to be used by the IUT. Default: CERT_IUT_A_AT */ - - // Private keys - var octetstring vc_signingPrivateKey; - var octetstring vc_encryptPrivateKey; - - // Generation position. See Draft ETSI TS 103 097 V1.1.14 Clause 7.2 Security profiles for DENMs - var ThreeDLocation vc_location; - - } // End of ItsSecurityBaseComponent - - } // End of group componentDefinitions - +/** + * @author ETSI / STF481 / STF507 / STF517 / STF538 + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Security/LibItsSecurity_TestSystem.ttcn3 $ + * $Id: LibItsSecurity_TestSystem.ttcn3 1318 2017-01-26 10:20:53Z filatov $ + * @desc Test System module for Security Protocol + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * + */ +module LibItsSecurity_TestSystem { + + // LibCommon + import from LibCommon_DataStrings all; + + // LibIts + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + import from IEEE1609dot2 language "ASN.1:1997" all; + import from EtsiTs103097Module language "ASN.1:1997" all; + + // LibItsSecurity + import from LibItsSecurity_TypesAndValues all; + import from LibItsSecurity_Pixits all; + + group componentDefinitions { + + /** + * @desc ITS Security Component + */ + type component ItsSecurityBaseComponent { + + // Certificates + var Certificate vc_aaCertificate; /** Test Adapter AA certificate */ + var Certificate vc_atCertificate; /** Test Adapter AT certificate */ + var Certificate vc_lastAtCertificateUsed; /** Last Test Adapter certificate used in 'f_buildGnSecuredXXX' functions */ + var charstring vc_hashedId8ToBeUsed := PX_IUT_DEFAULT_CERTIFICATE; /** Digest value of the AT certificate to be used by the IUT. Default: CERT_IUT_A_AT */ + + // Private keys + var octetstring vc_signingPrivateKey; + var octetstring vc_encryptPrivateKey; + + // Generation position. See Draft ETSI TS 103 097 V1.1.14 Clause 7.2 Security profiles for DENMs + var ThreeDLocation vc_location; + + } // End of ItsSecurityBaseComponent + + } // End of group componentDefinitions + } // End of module LibItsSecurity_TestSystem \ No newline at end of file diff --git a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn index e1e5bf22..3c33b6ec 100644 --- a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn +++ b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn @@ -1,304 +1,304 @@ -/** - * @author ETSI / STF481 / STF507 / STF517 - * @version $URL$ - * $Id$ - * @desc Module containing types and values for Security Protocol - * @see Draft ETSI TS 103 097 V1.1.14 - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - */ -module LibItsSecurity_TypesAndValues { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibItsCommon - import from LibItsCommon_Pixits all; - - // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; - - /** - * @desc Sequence of HashedId8 - */ - type record of HashedId8 HashedId8s; - - // Test Adapter certificates & private keys - Valid behavior - const charstring cc_taCert_A := PX_CERT_FOR_TS; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_A_AA := "CERT_TS_A_AA"; - const charstring cc_taCert_A_EA := "CERT_TS_A_EA"; - const charstring cc_taCert_A1 := "CERT_TS_A_A1_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_A2 := "CERT_TS_A_A2_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_A3 := "CERT_TS_A_A3_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_B := "CERT_TS_B_AT"; /** Default certificate, with circular region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_B1 := "CERT_TS_B_1_AT"; - const charstring cc_taCert_B_AA := "CERT_TS_B_1_AA"; - const charstring cc_taCert_C := "CERT_TS_C_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_C1 := "CERT_TS_C1_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_CA1 := "CERT_TS_CA1_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_D := "CERT_TS_D_AT"; /** Certificate with a polygonal region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_E := "CERT_TS_E_AT"; /** Certificate with a region identifier, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_F := "CERT_TS_F_AT"; /** Certificate that can be used as an unknown certificate for IUT. */ - const charstring cc_taCert_G := "CERT_TS_G_AT"; /** to be defined */ - const charstring cc_taCert_EC := "CERT_TS_A_EC"; /** Certificate with a subject type indicating 'enrolment_credentials', to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_AA := "CERT_TS_A_AA"; /** Certificate with a subject type indicating 'authorisation_authority', to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_EA := "CERT_TS_A_EA"; /** Certificate with a subject type indicating 'enrolment_authority', to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_CA := "CERT_TS_A_CA"; /** Certificate with a subject type indicating 'root_ca', to be used when secured messages are sent from TA to IUT */ - // Test Adapter certificates & private keys - Inoportune behavior - const charstring cc_taCert_B_BO := "CERT_TS_B_BO_AT"; /** Certificate with a circular region, the IUT position is outside of the region */ - const charstring cc_taCert_C_BO := "CERT_TS_C_BO_AT"; /** Certificate with a rectangular region, the IUT position is outside of the region */ - const charstring cc_taCert_D_BO := "CERT_TS_D_BO_AT"; /** Certificate with a polygonal region, the IUT position is outside of the region */ - const charstring cc_taCert_E_BO := "CERT_TS_E_BO_AT"; /** Certificate with a region identifier, the IUT position is outside of the region */ - const charstring cc_taCert0101_BO := "CERT_TS_01_01_BO_AT"; /** Check that IUT discards the AT certificate with version 3 */ - const charstring cc_taCert0102_BO := "CERT_TS_01_02_BO_AT"; /** Check that IUT discards the AT certificate with version 1 */ - const charstring cc_taCert0103_BO := "CERT_TS_01_03_BO_AT"; /** Check that IUT discards the AA certificate with version 3 */ - const charstring cc_taCert0104_BO := "CERT_TS_01_04_BO_AT"; /** Check that IUT discards the AA certificate with version 1 */ - const charstring cc_taCert0201_BO := "CERT_TS_02_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization ticket certificate contains the subject type 'enrolment_credential' */ - const charstring cc_taCert0202_BO := "CERT_TS_02_02_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization authority certificate contains the subject type 'enrolment_credential' */ - const charstring cc_taCert0203_BO := "CERT_TS_02_03_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization ticket certificate contains the subject type 'enrolment_authority' */ - const charstring cc_taCert0204_BO := "CERT_TS_02_04_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization authority certificate contains the subject type 'enrolment_authority' */ - const charstring cc_taCert0301_BO := "CERT_TS_03_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization ticket certificate contains the subject type 'authorization_ticket' */ - const charstring cc_taCert0302_BO := "CERT_TS_03_02_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization authority certificate contains the subject type 'authorization_ticket' */ - const charstring cc_taCert0601_BO := "CERT_TS_06_01_BO_AT"; /** Check that IUT discards a SecuredMessage containing generation_time before the message signing certificate validity period */ - const charstring cc_taCert0602_BO := "CERT_TS_06_02_BO_AT"; /** Check that IUT discards a SecuredMessage containing generation_time after the message signing certificate validity period */ - const charstring cc_taCert0401_BO := "CERT_TS_04_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the AA certificate contains the subject type 'authorization_authority' */ - const charstring cc_taCertMsg1301_BO := "CERT_TS_MSG_13_01_BO_AT"; /** Check that IUT discards secured CAM signed with the not yet valid certificate */ - const charstring cc_taCertMsg1302_BO := "CERT_TS_MSG_13_02_BO_AT"; /** Check that IUT discards secured CAM signed with the expired certificate */ - const charstring cc_taCertMsg1303_BO := "CERT_TS_MSG_13_03_BO_AT"; /** Check that IUT discards secured CAM when IUT location is outside the circular validity restriction of the signing certificatee */ - const charstring cc_taCertMsg1304_BO := "CERT_TS_MSG_13_04_BO_AT"; /** Check that IUT discards secured CAM when IUT location is outside the rectangular validity restriction of the signing certificate */ - const charstring cc_taCertMsg1305_BO := "CERT_TS_MSG_13_05_BO_AT"; /** Check that IUT discards secured CAM when IUT location is outside the polygonal validity restriction of the signing certificate */ - const charstring cc_taCertMsg1306_BO := "CERT_TS_MSG_13_06_BO_AT"; /** Check that IUT discards secured CAM when IUT location is outside the identified validity restriction of the signing certificate */ - const charstring cc_taCert0601_BV := "CERT_TS_06_01_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the same circular region validity restriction as its issuing certificate */ - const charstring cc_taCert0602_BV := "CERT_TS_06_02_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the circular region validity restriction of its issuing certificate */ - const charstring cc_taCert0603_BV := "CERT_TS_06_03_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the rectangular region validity restriction of its issuing certificate */ - const charstring cc_taCert0604_BV := "CERT_TS_06_04_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0605_BV := "CERT_TS_06_05_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the identified region validity restriction of its issuing certificate */ - const charstring cc_taCert0606_BO := "CERT_TS_06_06_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message does not contain the region validity restriction but its issuing certificate contains the circular region validity restriction */ - const charstring cc_taCert0607_BO := "CERT_TS_06_07_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains circular region validity restriction which is outside of the circular region validity restriction of its issuing certificate */ - const charstring cc_taCert0608_BO := "CERT_TS_06_08_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains circular region validity restriction which is not fully covered by the the circular region validity restriction of its issuing certificate */ - const charstring cc_taCert0701_BV := "CERT_TS_07_01_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the same rectangular region validity restriction as its issuing certificate */ - const charstring cc_taCert0702_BV := "CERT_TS_07_02_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the rectangular region validity restriction which is fully inside in the circular region validity restriction of its issuing certificate */ - const charstring cc_taCert0703_BV := "CERT_TS_07_03_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the validity restriction with rectangular region which is fully inside in the rectangular region validity restriction of its issuing certificate */ - const charstring cc_taCert0704_BV := "CERT_TS_07_04_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the rectangular region validity restriction which is fully inside in the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0705_BV := "CERT_TS_07_05_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the rectangular region validity restriction which is fully inside in the identified region validity restriction of its issuing certificate */ - const charstring cc_taCert0706_BO := "CERT_TS_07_06_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message does not contain the region validity restriction but its issuing certificate contains the rectangular region validity restriction */ - const charstring cc_taCert0707_BO := "CERT_TS_07_07_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains rectangular region validity restriction which is outside of the rectangular region validity restriction of its issuing certificate */ - const charstring cc_taCert0708_BO := "CERT_TS_07_08_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains rectangular region validity restriction which is not fully covered by the the rectangular region validity restriction of its issuing certificate */ - const charstring cc_taCert0801_BV := "CERT_TS_08_01_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the same polygonal region validity restriction as its issuing certificate */ - const charstring cc_taCert0802_BV := "CERT_TS_08_02_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the circular region validity restriction of its issuing certificate */ - const charstring cc_taCert0803_BV := "CERT_TS_08_03_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the rectangular region validity restriction of its issuing certificate */ - const charstring cc_taCert0804_BV := "CERT_TS_08_04_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0805_BV := "CERT_TS_08_05_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the identified region validity restriction of its issuing certificate */ - const charstring cc_taCert0806_BO := "CERT_TS_08_06_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message does not contain the region validity restriction but its issuing certificate contains the polygonal region validity restriction */ - const charstring cc_taCert0807_BO := "CERT_TS_08_07_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains polygonal region validity restriction which is outside of the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0808_BO := "CERT_TS_08_08_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains polygonal region validity restriction which is outside of the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0809_BO := "CERT_TS_08_09_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains polygonal region validity restriction which is not fully covered by the the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0901_BV := "CERT_TS_09_01_BV_AT"; /** Check that the IUT accepts a message when its signing certificate contains the identified region validity restriction with the same identified region as the issuing certificate and without local area definition */ - const charstring cc_taCert0902_BV := "CERT_TS_09_02_BV_AT"; /** Check that the IUT accepts a message when its signing certificate contains the identified region validity restriction with the same identified region as the issuing certificate and with local area definition */ - const charstring cc_taCert0903_BV := "CERT_TS_09_03_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the circular region validity restriction of its issuing certificate */ - const charstring cc_taCert0904_BV := "CERT_TS_09_04_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the rectangular region validity restriction of its issuing certificate */ - const charstring cc_taCert0905_BV := "CERT_TS_09_05_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0906_BV := "CERT_TS_09_06_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of the message contains the identified region validity restriction with the identified region which is fully covered by the identified region of the validity restriction of its issuing certificate */ - const charstring cc_taCert0907_BO := "CERT_TS_09_07_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message does not contain the region validity restriction but its issuing certificate contains the identified region validity restriction */ - const charstring cc_taCert0908_BO := "CERT_TS_09_08_BO_AT"; /** Check that the IUT discards a message when the signing certificate and its issuing certificate are both containing the identified region validity restrictions with the same region id but different local regions */ - const charstring cc_taCert0909_BO := "CERT_TS_09_09_BO_AT"; /** Check that the IUT discards a message when the identified region of the validity restriction of its signing certificate is different and not fully covered by the one in the issuing certificate */ - const charstring cc_taCert0910_BO := "CERT_TS_09_10_BO_AT"; /** Check that the IUT discards a message when the identified region validity restriction of its signing certificate contains unknown area code */ - const charstring cc_taCert0911_BO := "CERT_TS_09_11_BO_AT"; /** Check that the IUT discards a message when the identified region validity restriction of its signing certificate contains invalid area code */ - const charstring cc_taCert1001_BO := "CERT_TS_10_01_BO_AT"; /** Check that the IUT discards a message when its signing certificate does not contain the time validity restriction */ - const charstring cc_taCert1002_BO := "CERT_TS_10_02_BO_AT"; /** Check that the IUT discards a message when the issuing certificate of the message signing certificate does not contain the time validity restriction */ - const charstring cc_taCert1003_BO := "CERT_TS_10_03_BO_AT"; /** Check that the IUT discards a message when its signing certificate contains 'time_end' validity restriction */ - const charstring cc_taCert1004_BO := "CERT_TS_10_03_BO_AT"; /** Check that the IUT discards a message when its signing certificate contains 'time_start_and_duration' validity restriction */ - const charstring cc_taCert1005_BO := "CERT_TS_10_03_BO_AT"; /** Check that the IUT discards a message when the issuing certificate of the message signing certificate contains 'time_end' validity restriction */ - const charstring cc_taCert1006_BO := "CERT_TS_10_03_BO_AT"; /** Check that the IUT discards a message when its signing certificate contains 'time_start_and_duration' validity restriction */ - const charstring cc_taCert1101_BO := "CERT_TS_11_01_BO_AT"; /** Check that the IUT discards a message when the validity period of the signing certificate ends after the validity period of its issuing certificate */ - const charstring cc_taCert1102_BO := "CERT_TS_11_02_BO_AT"; /** Check that the IUT discards a message when the validity period of its signing certificate starts before the validity period of the issuing certificate */ - const charstring cc_taCert1103_BO := "CERT_TS_11_03_BO_AT"; /** Check that the IUT discards a message when the issuing certificate of signing certificate is expired but the signing certificate is not expired yet */ - const charstring cc_taCert1104_BO := "CERT_TS_11_04_BO_AT"; /** Check that the IUT discards a message when the validity period of the signing certificate is after the validity period of its issuing certificate */ - const charstring cc_taCert1201_BO := "CERT_TS_12_01_BO_AT"; /** Check that the IUT discards a message when its signing certificate does not contain the SSP-AID subject attribute */ - const charstring cc_taCert1202_BO := "CERT_TS_12_02_BO_AT"; /** Check that the IUT discards a Secured CAM when its signing certificate does not contain a record with AID_CAM in the its_aid_ssp_list subject attribute */ - const charstring cc_taCert1203_BO := "CERT_TS_12_03_BO_AT"; /** Check that the IUT discards a Secured DENM when its signing certificate does not contain a record with AID_DENM in the its_aid_ssp_list subject attribute */ - const charstring cc_taCert1204_BO := "CERT_TS_12_04_BO_AT"; /** Check that the IUT discards a Secured CAM when its signing certificate contains two records with AID_CAM in the its_aid_ssp_list subject attribute */ - const charstring cc_taCert1301_BO := "CERT_TS_13_01_BO_AT"; /** Check that the IUT discards a message when the signing AT certificate contains a CAM AID-SSP record whereas the issuing AA certificate does not contain the record with AID_CAM */ - const charstring cc_taCert1302_BO := "CERT_TS_13_02_BO_AT"; /** Check that the IUT discards a message when the signing AT certificate contains a DENM AID-SSP record whereas the issuing AA certificate does not contain the AID record with AID_DENM */ - const charstring cc_taCert1303_BO := "CERT_TS_13_03_BO_AT"; /** Check that IUT discards a SecuredMessage if the AA certificate does not contain a subject_attribute of type its_aid_list */ - const charstring cc_taCert1401_BO := "CERT_TS_14_01_BO_AT"; /** Check that IUT discards the AT certificate with signer info of type 'certificate' */ - const charstring cc_taCert1402_BO := "CERT_TS_14_02_BO_AT"; /** Check that IUT discards the AT certificate with signer info of type 'certificate_chain' */ - const charstring cc_taCert1403_BO := "CERT_TS_14_03_BO_AT"; /** Check that IUT discards the AT certificate with signer info of type 'certificate_digest_with_other_algorithm' */ - const charstring cc_taCert1501_BO := "CERT_TS_15_01_BO_AT"; /** Check that IUT discards the AA certificate with signer info of type 'certificate' */ - const charstring cc_taCert1502_BO := "CERT_TS_15_02_BO_AT"; /** Check that IUT discards the AA certificate with signer info of type 'certificate_chain' */ - const charstring cc_taCert1503_BO := "CERT_TS_15_03_BO_AT"; /** Check that IUT discards the AA certificate with signer info of type 'certificate_digest_with_other_algorithm' */ - const charstring cc_taCert1601_BO := "CERT_TS_16_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject_name of the AT certificate is not an empty name field */ - const charstring cc_taCert1701_BO := "CERT_TS_17_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject attribute of type assurance_level is missing in the AT certificate */ - const charstring cc_taCert1702_BO := "CERT_TS_17_02_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject attribute of type assurance_level is missing in the AA certificate */ - const charstring cc_taCert1703_BO := "CERT_TS_17_03_BO_AT"; /** Check that IUT discards a SecuredMessage if the assurance level of issuing certificate is less then assurance level of subordinate certificate */ - const charstring cc_taCert1704_BO := "CERT_TS_17_04_BO_AT"; /** Check that IUT discards a SecuredMessage if the assurance level of issuing certificate is equal to the assurance level of the subordinate certificate but the confidence of subject assurance of issuing certificate is less then the confidence of the subordinate certificate */ - const charstring cc_taCert1801_BO := "CERT_TS_18_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject attribute of type verification_key is missing in the AT certificate */ - const charstring cc_taCert1802_BO := "CERT_TS_18_02_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject attribute of type verification_key is missing in the AA certificate */ - const charstring cc_taCert1901_BO := "CERT_TS_19_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the reserved region type has been used in region validity restriction of the AT certificate */ - - // IUT certificates & private keys - const charstring cc_taCert_CA2 := "CERT_IUT_CA2_AT"; - const charstring cc_taCert_CA3 := "CERT_IUT_CA3_AT"; - const charstring cc_taCert_CC_AA := "CERT_IUT_CC_AA"; - const charstring cc_iutCert_A := "CERT_IUT_A_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_A_AA := "CERT_IUT_A_AA"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_B := "CERT_IUT_B_AT"; /** Default certificate, with circular region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_C := "CERT_IUT_C_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_D := "CERT_IUT_D_AT"; /** Certificate with a polygonal region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_E := "CERT_IUT_E_AT"; /** Certificate with a region identifier, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_F := "CERT_IUT_F_AT"; /** Certificate with a subject type indicating 'enrolment_credentials', to be used when secured messages are sent from TA to IUT */ - - /** - * @desc Specification of basic format elements - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2 - */ - group basicFormatElements { - - /** - * @desc Service specific permissions definition for CAM - * @see ETSI EN 302 637-2 V1.3.2 (2014-11) Clause 6.2.2.2 Service Specific Permissions (SSP) - */ - type record SspCAM { - Bit1 cenDsrcTollingZone, - Bit1 publicTransport, - Bit1 specialTransport, - Bit1 dangerousGoods, - Bit1 roadwork, - Bit1 rescue, - Bit1 emergency, - Bit1 safetyCar, - Bit1 closedLanes, - Bit1 requestForRightOfWay, - Bit1 requestForFreeCrossingAtATrafficLight, - Bit1 noPassing, - Bit1 noPassingForTrucks, - Bit1 speedLimit, - Bit18 reserved - } with { - variant "FIELDORDER(msb)" - } // End of type SspCAM - - /** - * @desc Service specific permissions definition for DENM - * @member trafficCondition - * @member accident - * @member roadworks - * @member adverseWeatherCondition_Adhesion - * @member hazardousLocation_SurfaceCondition - * @member hazardousLocation_ObstacleOnTheRoad - * @member hazardousLocation_AnimalOnTheRoad - * @member humanPresenceOnTheRoad - * @member wrongWayDriving - * @member rescueAndRecoveryWorkInProgress - * @member adverseWeatherCondition_ExtremeWeatherCondition - * @member adverseWeatherCondition_Visibility - * @member adverseWeatherCondition_Precipitation - * @member slowVehicle - * @member dangerousEndOfQueue - * @member vehicleBreakdown - * @member postCrash - * @member humanProblem - * @member stationaryVehicle - * @member emergencyVehicleApproaching - * @member hazardousLocation_DangerousCurve - * @member collisionRisk - * @member signalViolation - * @member dangerousSituation - * @member reserved Reserved for Future Usage - * @see Draft ETSI EN 302 637-3 V1.2.10 Clause 6.2.2.2 Service Specific Permissions (SSP) - */ - type record SspDENM { - Bit1 trafficCondition, - Bit1 accident, - Bit1 roadworks, - Bit1 adverseWeatherCondition_Adhesion, - Bit1 hazardousLocation_SurfaceCondition, - Bit1 hazardousLocation_ObstacleOnTheRoad, - Bit1 hazardousLocation_AnimalOnTheRoad, - Bit1 humanPresenceOnTheRoad, - Bit1 wrongWayDriving, - Bit1 rescueAndRecoveryWorkInProgress, - Bit1 adverseWeatherCondition_ExtremeWeatherCondition, - Bit1 adverseWeatherCondition_Visibility, - Bit1 adverseWeatherCondition_Precipitation, - Bit1 slowVehicle, - Bit1 dangerousEndOfQueue, - Bit1 vehicleBreakdown, - Bit1 postCrash, - Bit1 humanProblem, - Bit1 stationaryVehicle, - Bit1 emergencyVehicleApproaching, - Bit1 hazardousLocation_DangerousCurve, - Bit1 collisionRisk, - Bit1 signalViolation, - Bit1 dangerousSituation, - Bit8 reserved - } with { - variant "FIELDORDER(msb)" - } // End of type SspDENM - - } // End of group certificateSpecification - - /** - * @desc Send/receive templates for profiles for certificates - * @see Draft ETSI TS 103 097 V1.1.14 Clause 7.4 Profiles for certificate - */ - group profileCertificates { - - type record CertificatesCachingItem { - HashedId8 hashedId8, - EtsiTs103097Certificate certificate - } - type record of CertificatesCachingItem CertificatesCaching; - - } // End of group profileCertificates - - type enumerated SignAlgorithm { - e_nistp_256, - e_brainpool_256, - e_brainpool_384 - } - - group taConfiguration { - - /** - * @desc Describes the Test Adapter security configuration - * @member signingPrivateKey Signing private keys generated by the PKI Infrastructire tool (CertChainGenerator\src\org\etsi\stf440\pki\MainApp.java) - * @member encryptPrivateKey Encryption private keys generated by the PKI Infrastructire tool (CertChainGenerator\src\org\etsi\stf440\pki\MainApp.java) - * @member caCertificate Certificates Authorization certificate generated by the PKI Infrastructire tool - * @member aaCertificate Enrolment Credential certificate generated by the PKI Infrastructire tool - * @member atCertificate Authorization Tickate certificate generated by the PKI Infrastructire tool - * @member location 3D location associated to each configuration - */ - /*type record TaConfig { - Oct32 signingPrivateKey, - Oct32 encryptPrivateKey, - EtsiTs103097Certificate caCertificate, - EtsiTs103097Certificate aaCertificate, - EtsiTs103097Certificate atCertificate, - ThreeDLocation location - }*/ // End of type TaConfig - - /** - * @desc Describes the Test Adapter security configurations - */ - //type set of TaConfig TaConfigs; - - } // End of group taConfiguration - - group utPrimitives { - - } - with { - encode "UpperTester" - } // End of group utPrimitives - -} with { - variant "" - encode "LibItsSecurity" -} // End of module LibItsSecurity_TypesAndValues +/** + * @author ETSI / STF481 / STF507 / STF517 + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn3 $ + * $Id: LibItsSecurity_TypesAndValues.ttcn3 1318 2017-01-26 10:20:53Z filatov $ + * @desc Module containing types and values for Security Protocol + * @see Draft ETSI TS 103 097 V1.1.14 + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + */ +module LibItsSecurity_TypesAndValues { + + // LibCommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; + + // LibItsCommon + import from LibItsCommon_Pixits all; + + // LibIts + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + import from IEEE1609dot2 language "ASN.1:1997" all; + import from EtsiTs103097Module language "ASN.1:1997" all; + + /** + * @desc Sequence of HashedId8 + */ + type record of HashedId8 HashedId8s; + + // Test Adapter certificates & private keys - Valid behavior + const charstring cc_taCert_A := PX_CERT_FOR_TS; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_A_AA := "CERT_TS_A_AA"; + const charstring cc_taCert_A_EA := "CERT_TS_A_EA"; + const charstring cc_taCert_A1 := "CERT_TS_A_A1_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_A2 := "CERT_TS_A_A2_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_A3 := "CERT_TS_A_A3_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_B := "CERT_TS_B_AT"; /** Default certificate, with circular region, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_B1 := "CERT_TS_B_1_AT"; + const charstring cc_taCert_B_AA := "CERT_TS_B_1_AA"; + const charstring cc_taCert_C := "CERT_TS_C_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_C1 := "CERT_TS_C1_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_CA1 := "CERT_TS_CA1_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_D := "CERT_TS_D_AT"; /** Certificate with a polygonal region, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_E := "CERT_TS_E_AT"; /** Certificate with a region identifier, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_F := "CERT_TS_F_AT"; /** Certificate that can be used as an unknown certificate for IUT. */ + const charstring cc_taCert_G := "CERT_TS_G_AT"; /** to be defined */ + const charstring cc_taCert_EC := "CERT_TS_A_EC"; /** Certificate with a subject type indicating 'enrolment_credentials', to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_AA := "CERT_TS_A_AA"; /** Certificate with a subject type indicating 'authorisation_authority', to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_EA := "CERT_TS_A_EA"; /** Certificate with a subject type indicating 'enrolment_authority', to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_CA := "CERT_TS_A_CA"; /** Certificate with a subject type indicating 'root_ca', to be used when secured messages are sent from TA to IUT */ + // Test Adapter certificates & private keys - Inoportune behavior + const charstring cc_taCert_B_BO := "CERT_TS_B_BO_AT"; /** Certificate with a circular region, the IUT position is outside of the region */ + const charstring cc_taCert_C_BO := "CERT_TS_C_BO_AT"; /** Certificate with a rectangular region, the IUT position is outside of the region */ + const charstring cc_taCert_D_BO := "CERT_TS_D_BO_AT"; /** Certificate with a polygonal region, the IUT position is outside of the region */ + const charstring cc_taCert_E_BO := "CERT_TS_E_BO_AT"; /** Certificate with a region identifier, the IUT position is outside of the region */ + const charstring cc_taCert0101_BO := "CERT_TS_01_01_BO_AT"; /** Check that IUT discards the AT certificate with version 3 */ + const charstring cc_taCert0102_BO := "CERT_TS_01_02_BO_AT"; /** Check that IUT discards the AT certificate with version 1 */ + const charstring cc_taCert0103_BO := "CERT_TS_01_03_BO_AT"; /** Check that IUT discards the AA certificate with version 3 */ + const charstring cc_taCert0104_BO := "CERT_TS_01_04_BO_AT"; /** Check that IUT discards the AA certificate with version 1 */ + const charstring cc_taCert0201_BO := "CERT_TS_02_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization ticket certificate contains the subject type 'enrolment_credential' */ + const charstring cc_taCert0202_BO := "CERT_TS_02_02_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization authority certificate contains the subject type 'enrolment_credential' */ + const charstring cc_taCert0203_BO := "CERT_TS_02_03_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization ticket certificate contains the subject type 'enrolment_authority' */ + const charstring cc_taCert0204_BO := "CERT_TS_02_04_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization authority certificate contains the subject type 'enrolment_authority' */ + const charstring cc_taCert0301_BO := "CERT_TS_03_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization ticket certificate contains the subject type 'authorization_ticket' */ + const charstring cc_taCert0302_BO := "CERT_TS_03_02_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization authority certificate contains the subject type 'authorization_ticket' */ + const charstring cc_taCert0601_BO := "CERT_TS_06_01_BO_AT"; /** Check that IUT discards a SecuredMessage containing generation_time before the message signing certificate validity period */ + const charstring cc_taCert0602_BO := "CERT_TS_06_02_BO_AT"; /** Check that IUT discards a SecuredMessage containing generation_time after the message signing certificate validity period */ + const charstring cc_taCert0401_BO := "CERT_TS_04_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the AA certificate contains the subject type 'authorization_authority' */ + const charstring cc_taCertMsg1301_BO := "CERT_TS_MSG_13_01_BO_AT"; /** Check that IUT discards secured CAM signed with the not yet valid certificate */ + const charstring cc_taCertMsg1302_BO := "CERT_TS_MSG_13_02_BO_AT"; /** Check that IUT discards secured CAM signed with the expired certificate */ + const charstring cc_taCertMsg1303_BO := "CERT_TS_MSG_13_03_BO_AT"; /** Check that IUT discards secured CAM when IUT location is outside the circular validity restriction of the signing certificatee */ + const charstring cc_taCertMsg1304_BO := "CERT_TS_MSG_13_04_BO_AT"; /** Check that IUT discards secured CAM when IUT location is outside the rectangular validity restriction of the signing certificate */ + const charstring cc_taCertMsg1305_BO := "CERT_TS_MSG_13_05_BO_AT"; /** Check that IUT discards secured CAM when IUT location is outside the polygonal validity restriction of the signing certificate */ + const charstring cc_taCertMsg1306_BO := "CERT_TS_MSG_13_06_BO_AT"; /** Check that IUT discards secured CAM when IUT location is outside the identified validity restriction of the signing certificate */ + const charstring cc_taCert0601_BV := "CERT_TS_06_01_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the same circular region validity restriction as its issuing certificate */ + const charstring cc_taCert0602_BV := "CERT_TS_06_02_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the circular region validity restriction of its issuing certificate */ + const charstring cc_taCert0603_BV := "CERT_TS_06_03_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the rectangular region validity restriction of its issuing certificate */ + const charstring cc_taCert0604_BV := "CERT_TS_06_04_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the polygonal region validity restriction of its issuing certificate */ + const charstring cc_taCert0605_BV := "CERT_TS_06_05_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the identified region validity restriction of its issuing certificate */ + const charstring cc_taCert0606_BO := "CERT_TS_06_06_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message does not contain the region validity restriction but its issuing certificate contains the circular region validity restriction */ + const charstring cc_taCert0607_BO := "CERT_TS_06_07_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains circular region validity restriction which is outside of the circular region validity restriction of its issuing certificate */ + const charstring cc_taCert0608_BO := "CERT_TS_06_08_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains circular region validity restriction which is not fully covered by the the circular region validity restriction of its issuing certificate */ + const charstring cc_taCert0701_BV := "CERT_TS_07_01_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the same rectangular region validity restriction as its issuing certificate */ + const charstring cc_taCert0702_BV := "CERT_TS_07_02_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the rectangular region validity restriction which is fully inside in the circular region validity restriction of its issuing certificate */ + const charstring cc_taCert0703_BV := "CERT_TS_07_03_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the validity restriction with rectangular region which is fully inside in the rectangular region validity restriction of its issuing certificate */ + const charstring cc_taCert0704_BV := "CERT_TS_07_04_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the rectangular region validity restriction which is fully inside in the polygonal region validity restriction of its issuing certificate */ + const charstring cc_taCert0705_BV := "CERT_TS_07_05_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the rectangular region validity restriction which is fully inside in the identified region validity restriction of its issuing certificate */ + const charstring cc_taCert0706_BO := "CERT_TS_07_06_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message does not contain the region validity restriction but its issuing certificate contains the rectangular region validity restriction */ + const charstring cc_taCert0707_BO := "CERT_TS_07_07_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains rectangular region validity restriction which is outside of the rectangular region validity restriction of its issuing certificate */ + const charstring cc_taCert0708_BO := "CERT_TS_07_08_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains rectangular region validity restriction which is not fully covered by the the rectangular region validity restriction of its issuing certificate */ + const charstring cc_taCert0801_BV := "CERT_TS_08_01_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the same polygonal region validity restriction as its issuing certificate */ + const charstring cc_taCert0802_BV := "CERT_TS_08_02_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the circular region validity restriction of its issuing certificate */ + const charstring cc_taCert0803_BV := "CERT_TS_08_03_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the rectangular region validity restriction of its issuing certificate */ + const charstring cc_taCert0804_BV := "CERT_TS_08_04_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the polygonal region validity restriction of its issuing certificate */ + const charstring cc_taCert0805_BV := "CERT_TS_08_05_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the identified region validity restriction of its issuing certificate */ + const charstring cc_taCert0806_BO := "CERT_TS_08_06_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message does not contain the region validity restriction but its issuing certificate contains the polygonal region validity restriction */ + const charstring cc_taCert0807_BO := "CERT_TS_08_07_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains polygonal region validity restriction which is outside of the polygonal region validity restriction of its issuing certificate */ + const charstring cc_taCert0808_BO := "CERT_TS_08_08_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains polygonal region validity restriction which is outside of the polygonal region validity restriction of its issuing certificate */ + const charstring cc_taCert0809_BO := "CERT_TS_08_09_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains polygonal region validity restriction which is not fully covered by the the polygonal region validity restriction of its issuing certificate */ + const charstring cc_taCert0901_BV := "CERT_TS_09_01_BV_AT"; /** Check that the IUT accepts a message when its signing certificate contains the identified region validity restriction with the same identified region as the issuing certificate and without local area definition */ + const charstring cc_taCert0902_BV := "CERT_TS_09_02_BV_AT"; /** Check that the IUT accepts a message when its signing certificate contains the identified region validity restriction with the same identified region as the issuing certificate and with local area definition */ + const charstring cc_taCert0903_BV := "CERT_TS_09_03_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the circular region validity restriction of its issuing certificate */ + const charstring cc_taCert0904_BV := "CERT_TS_09_04_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the rectangular region validity restriction of its issuing certificate */ + const charstring cc_taCert0905_BV := "CERT_TS_09_05_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the polygonal region validity restriction of its issuing certificate */ + const charstring cc_taCert0906_BV := "CERT_TS_09_06_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of the message contains the identified region validity restriction with the identified region which is fully covered by the identified region of the validity restriction of its issuing certificate */ + const charstring cc_taCert0907_BO := "CERT_TS_09_07_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message does not contain the region validity restriction but its issuing certificate contains the identified region validity restriction */ + const charstring cc_taCert0908_BO := "CERT_TS_09_08_BO_AT"; /** Check that the IUT discards a message when the signing certificate and its issuing certificate are both containing the identified region validity restrictions with the same region id but different local regions */ + const charstring cc_taCert0909_BO := "CERT_TS_09_09_BO_AT"; /** Check that the IUT discards a message when the identified region of the validity restriction of its signing certificate is different and not fully covered by the one in the issuing certificate */ + const charstring cc_taCert0910_BO := "CERT_TS_09_10_BO_AT"; /** Check that the IUT discards a message when the identified region validity restriction of its signing certificate contains unknown area code */ + const charstring cc_taCert0911_BO := "CERT_TS_09_11_BO_AT"; /** Check that the IUT discards a message when the identified region validity restriction of its signing certificate contains invalid area code */ + const charstring cc_taCert1001_BO := "CERT_TS_10_01_BO_AT"; /** Check that the IUT discards a message when its signing certificate does not contain the time validity restriction */ + const charstring cc_taCert1002_BO := "CERT_TS_10_02_BO_AT"; /** Check that the IUT discards a message when the issuing certificate of the message signing certificate does not contain the time validity restriction */ + const charstring cc_taCert1003_BO := "CERT_TS_10_03_BO_AT"; /** Check that the IUT discards a message when its signing certificate contains 'time_end' validity restriction */ + const charstring cc_taCert1004_BO := "CERT_TS_10_03_BO_AT"; /** Check that the IUT discards a message when its signing certificate contains 'time_start_and_duration' validity restriction */ + const charstring cc_taCert1005_BO := "CERT_TS_10_03_BO_AT"; /** Check that the IUT discards a message when the issuing certificate of the message signing certificate contains 'time_end' validity restriction */ + const charstring cc_taCert1006_BO := "CERT_TS_10_03_BO_AT"; /** Check that the IUT discards a message when its signing certificate contains 'time_start_and_duration' validity restriction */ + const charstring cc_taCert1101_BO := "CERT_TS_11_01_BO_AT"; /** Check that the IUT discards a message when the validity period of the signing certificate ends after the validity period of its issuing certificate */ + const charstring cc_taCert1102_BO := "CERT_TS_11_02_BO_AT"; /** Check that the IUT discards a message when the validity period of its signing certificate starts before the validity period of the issuing certificate */ + const charstring cc_taCert1103_BO := "CERT_TS_11_03_BO_AT"; /** Check that the IUT discards a message when the issuing certificate of signing certificate is expired but the signing certificate is not expired yet */ + const charstring cc_taCert1104_BO := "CERT_TS_11_04_BO_AT"; /** Check that the IUT discards a message when the validity period of the signing certificate is after the validity period of its issuing certificate */ + const charstring cc_taCert1201_BO := "CERT_TS_12_01_BO_AT"; /** Check that the IUT discards a message when its signing certificate does not contain the SSP-AID subject attribute */ + const charstring cc_taCert1202_BO := "CERT_TS_12_02_BO_AT"; /** Check that the IUT discards a Secured CAM when its signing certificate does not contain a record with AID_CAM in the its_aid_ssp_list subject attribute */ + const charstring cc_taCert1203_BO := "CERT_TS_12_03_BO_AT"; /** Check that the IUT discards a Secured DENM when its signing certificate does not contain a record with AID_DENM in the its_aid_ssp_list subject attribute */ + const charstring cc_taCert1204_BO := "CERT_TS_12_04_BO_AT"; /** Check that the IUT discards a Secured CAM when its signing certificate contains two records with AID_CAM in the its_aid_ssp_list subject attribute */ + const charstring cc_taCert1301_BO := "CERT_TS_13_01_BO_AT"; /** Check that the IUT discards a message when the signing AT certificate contains a CAM AID-SSP record whereas the issuing AA certificate does not contain the record with AID_CAM */ + const charstring cc_taCert1302_BO := "CERT_TS_13_02_BO_AT"; /** Check that the IUT discards a message when the signing AT certificate contains a DENM AID-SSP record whereas the issuing AA certificate does not contain the AID record with AID_DENM */ + const charstring cc_taCert1303_BO := "CERT_TS_13_03_BO_AT"; /** Check that IUT discards a SecuredMessage if the AA certificate does not contain a subject_attribute of type its_aid_list */ + const charstring cc_taCert1401_BO := "CERT_TS_14_01_BO_AT"; /** Check that IUT discards the AT certificate with signer info of type 'certificate' */ + const charstring cc_taCert1402_BO := "CERT_TS_14_02_BO_AT"; /** Check that IUT discards the AT certificate with signer info of type 'certificate_chain' */ + const charstring cc_taCert1403_BO := "CERT_TS_14_03_BO_AT"; /** Check that IUT discards the AT certificate with signer info of type 'certificate_digest_with_other_algorithm' */ + const charstring cc_taCert1501_BO := "CERT_TS_15_01_BO_AT"; /** Check that IUT discards the AA certificate with signer info of type 'certificate' */ + const charstring cc_taCert1502_BO := "CERT_TS_15_02_BO_AT"; /** Check that IUT discards the AA certificate with signer info of type 'certificate_chain' */ + const charstring cc_taCert1503_BO := "CERT_TS_15_03_BO_AT"; /** Check that IUT discards the AA certificate with signer info of type 'certificate_digest_with_other_algorithm' */ + const charstring cc_taCert1601_BO := "CERT_TS_16_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject_name of the AT certificate is not an empty name field */ + const charstring cc_taCert1701_BO := "CERT_TS_17_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject attribute of type assurance_level is missing in the AT certificate */ + const charstring cc_taCert1702_BO := "CERT_TS_17_02_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject attribute of type assurance_level is missing in the AA certificate */ + const charstring cc_taCert1703_BO := "CERT_TS_17_03_BO_AT"; /** Check that IUT discards a SecuredMessage if the assurance level of issuing certificate is less then assurance level of subordinate certificate */ + const charstring cc_taCert1704_BO := "CERT_TS_17_04_BO_AT"; /** Check that IUT discards a SecuredMessage if the assurance level of issuing certificate is equal to the assurance level of the subordinate certificate but the confidence of subject assurance of issuing certificate is less then the confidence of the subordinate certificate */ + const charstring cc_taCert1801_BO := "CERT_TS_18_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject attribute of type verification_key is missing in the AT certificate */ + const charstring cc_taCert1802_BO := "CERT_TS_18_02_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject attribute of type verification_key is missing in the AA certificate */ + const charstring cc_taCert1901_BO := "CERT_TS_19_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the reserved region type has been used in region validity restriction of the AT certificate */ + + // IUT certificates & private keys + const charstring cc_taCert_CA2 := "CERT_IUT_CA2_AT"; + const charstring cc_taCert_CA3 := "CERT_IUT_CA3_AT"; + const charstring cc_taCert_CC_AA := "CERT_IUT_CC_AA"; + const charstring cc_iutCert_A := "CERT_IUT_A_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ + const charstring cc_iutCert_A_AA := "CERT_IUT_A_AA"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ + const charstring cc_iutCert_B := "CERT_IUT_B_AT"; /** Default certificate, with circular region, to be used when secured messages are sent from TA to IUT */ + const charstring cc_iutCert_C := "CERT_IUT_C_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ + const charstring cc_iutCert_D := "CERT_IUT_D_AT"; /** Certificate with a polygonal region, to be used when secured messages are sent from TA to IUT */ + const charstring cc_iutCert_E := "CERT_IUT_E_AT"; /** Certificate with a region identifier, to be used when secured messages are sent from TA to IUT */ + const charstring cc_iutCert_F := "CERT_IUT_F_AT"; /** Certificate with a subject type indicating 'enrolment_credentials', to be used when secured messages are sent from TA to IUT */ + + /** + * @desc Specification of basic format elements + * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2 + */ + group basicFormatElements { + + /** + * @desc Service specific permissions definition for CAM + * @see ETSI EN 302 637-2 V1.3.2 (2014-11) Clause 6.2.2.2 Service Specific Permissions (SSP) + */ + type record SspCAM { + Bit1 cenDsrcTollingZone, + Bit1 publicTransport, + Bit1 specialTransport, + Bit1 dangerousGoods, + Bit1 roadwork, + Bit1 rescue, + Bit1 emergency, + Bit1 safetyCar, + Bit1 closedLanes, + Bit1 requestForRightOfWay, + Bit1 requestForFreeCrossingAtATrafficLight, + Bit1 noPassing, + Bit1 noPassingForTrucks, + Bit1 speedLimit, + Bit18 reserved + } with { + variant "FIELDORDER(msb)" + } // End of type SspCAM + + /** + * @desc Service specific permissions definition for DENM + * @member trafficCondition + * @member accident + * @member roadworks + * @member adverseWeatherCondition_Adhesion + * @member hazardousLocation_SurfaceCondition + * @member hazardousLocation_ObstacleOnTheRoad + * @member hazardousLocation_AnimalOnTheRoad + * @member humanPresenceOnTheRoad + * @member wrongWayDriving + * @member rescueAndRecoveryWorkInProgress + * @member adverseWeatherCondition_ExtremeWeatherCondition + * @member adverseWeatherCondition_Visibility + * @member adverseWeatherCondition_Precipitation + * @member slowVehicle + * @member dangerousEndOfQueue + * @member vehicleBreakdown + * @member postCrash + * @member humanProblem + * @member stationaryVehicle + * @member emergencyVehicleApproaching + * @member hazardousLocation_DangerousCurve + * @member collisionRisk + * @member signalViolation + * @member dangerousSituation + * @member reserved Reserved for Future Usage + * @see Draft ETSI EN 302 637-3 V1.2.10 Clause 6.2.2.2 Service Specific Permissions (SSP) + */ + type record SspDENM { + Bit1 trafficCondition, + Bit1 accident, + Bit1 roadworks, + Bit1 adverseWeatherCondition_Adhesion, + Bit1 hazardousLocation_SurfaceCondition, + Bit1 hazardousLocation_ObstacleOnTheRoad, + Bit1 hazardousLocation_AnimalOnTheRoad, + Bit1 humanPresenceOnTheRoad, + Bit1 wrongWayDriving, + Bit1 rescueAndRecoveryWorkInProgress, + Bit1 adverseWeatherCondition_ExtremeWeatherCondition, + Bit1 adverseWeatherCondition_Visibility, + Bit1 adverseWeatherCondition_Precipitation, + Bit1 slowVehicle, + Bit1 dangerousEndOfQueue, + Bit1 vehicleBreakdown, + Bit1 postCrash, + Bit1 humanProblem, + Bit1 stationaryVehicle, + Bit1 emergencyVehicleApproaching, + Bit1 hazardousLocation_DangerousCurve, + Bit1 collisionRisk, + Bit1 signalViolation, + Bit1 dangerousSituation, + Bit8 reserved + } with { + variant "FIELDORDER(msb)" + } // End of type SspDENM + + } // End of group certificateSpecification + + /** + * @desc Send/receive templates for profiles for certificates + * @see Draft ETSI TS 103 097 V1.1.14 Clause 7.4 Profiles for certificate + */ + group profileCertificates { + + type record CertificatesCachingItem { + HashedId8 hashedId8, + EtsiTs103097Certificate certificate + } + type record of CertificatesCachingItem CertificatesCaching; + + } // End of group profileCertificates + + type enumerated SignAlgorithm { + e_nistp_256, + e_brainpool_256, + e_brainpool_384 + } + + group taConfiguration { + + /** + * @desc Describes the Test Adapter security configuration + * @member signingPrivateKey Signing private keys generated by the PKI Infrastructire tool (CertChainGenerator\src\org\etsi\stf440\pki\MainApp.java) + * @member encryptPrivateKey Encryption private keys generated by the PKI Infrastructire tool (CertChainGenerator\src\org\etsi\stf440\pki\MainApp.java) + * @member caCertificate Certificates Authorization certificate generated by the PKI Infrastructire tool + * @member aaCertificate Enrolment Credential certificate generated by the PKI Infrastructire tool + * @member atCertificate Authorization Tickate certificate generated by the PKI Infrastructire tool + * @member location 3D location associated to each configuration + */ + /*type record TaConfig { + Oct32 signingPrivateKey, + Oct32 encryptPrivateKey, + EtsiTs103097Certificate caCertificate, + EtsiTs103097Certificate aaCertificate, + EtsiTs103097Certificate atCertificate, + ThreeDLocation location + }*/ // End of type TaConfig + + /** + * @desc Describes the Test Adapter security configurations + */ + //type set of TaConfig TaConfigs; + + } // End of group taConfiguration + + group utPrimitives { + + } + with { + encode "UpperTester" + } // End of group utPrimitives + +} with { + variant "" + encode "LibItsSecurity" +} // End of module LibItsSecurity_TypesAndValues -- GitLab From 0be31c6d5681f0000224ebc0474190d1f4e5e38f Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 27 Mar 2020 16:36:13 +0100 Subject: [PATCH 232/320] Unify STF525 TTCN-3 code --- ttcn/BTP/LibItsBtp_TypesAndValues.ttcn | 68 ++++--- ttcn/CAM/LibItsCam_Functions.ttcn | 1 - ttcn/CAM/LibItsCam_TypesAndValues.ttcn | 8 +- ttcn/Common/LibItsCommon_TypesAndValues.ttcn | 13 +- ttcn/DENM/LibItsDenm_Functions.ttcn | 2 +- ttcn/DENM/LibItsDenm_Templates.ttcn | 2 - ttcn/DENM/LibItsDenm_TypesAndValues.ttcn | 22 +-- .../LibItsGeoNetworking_TestSystem.ttcn | 16 -- .../LibItsGeoNetworking_TypesAndValues.ttcn | 1 - ttcn/IVIM/LibItsIvim_Functions.ttcn | 62 +++--- ttcn/IVIM/LibItsIvim_Pics.ttcn | 4 +- ttcn/IVIM/LibItsIvim_Pixits.ttcn | 4 +- ttcn/IVIM/LibItsIvim_Templates.ttcn | 18 +- ttcn/IVIM/LibItsIvim_TestSystem.ttcn | 4 +- ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn | 27 +-- ...LibItsIpv6OverGeoNetworking_Functions.ttcn | 40 ++-- .../LibItsIpv6OverGeoNetworking_Pics.ttcn | 4 +- .../LibItsIpv6OverGeoNetworking_Pixits.ttcn | 4 +- ...LibItsIpv6OverGeoNetworking_Templates.ttcn | 22 +-- ...ibItsIpv6OverGeoNetworking_TestSystem.ttcn | 4 +- ...sIpv6OverGeoNetworking_TypesAndValues.ttcn | 8 +- .../LibItsMapemSpatem_Functions.ttcn | 42 ++-- ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn | 4 +- .../MapemSpatem/LibItsMapemSpatem_Pixits.ttcn | 4 +- .../LibItsMapemSpatem_Templates.ttcn | 32 ++- .../LibItsMapemSpatem_TestSystem.ttcn | 6 +- ttcn/Pki/LibItsPki_Functions.ttcn | 185 ++++++++---------- ttcn/Pki/LibItsPki_Templates.ttcn | 2 +- ttcn/Pki/LibItsPki_TestSystem.ttcn | 7 +- ttcn/Pki/LibItsPki_TypesAndValues.ttcn | 2 +- ttcn/SremSsem/LibItsSremSsem_Functions.ttcn | 44 +++-- ttcn/SremSsem/LibItsSremSsem_Pics.ttcn | 4 +- ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn | 4 +- ttcn/SremSsem/LibItsSremSsem_Templates.ttcn | 22 +-- ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn | 6 +- .../LibItsSremSsem_TypesAndValues.ttcn | 124 ++++++------ 36 files changed, 385 insertions(+), 437 deletions(-) diff --git a/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn b/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn index 214e4e29..808ce62a 100644 --- a/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn +++ b/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn @@ -31,7 +31,6 @@ module LibItsBtp_TypesAndValues { } with { variant "FIELDORDER(msb)" - encode "LibIts_Interface" } } // end btpPdus @@ -46,10 +45,10 @@ module LibItsBtp_TypesAndValues { */ type union BtpHeader { BtpAHeader btpAHeader, - BtpBHeader btpBHeader - } with { + BtpBHeader btpBHeader + } with { variant "FIELDORDER(msb)" - } + } /** @@ -61,10 +60,9 @@ module LibItsBtp_TypesAndValues { type record BtpAHeader { BtpPortId destinationPort, BtpPortId sourcePort - } with { + } with { variant "FIELDORDER(msb)" - } - + } /** * @desc BTP-B Header @@ -75,9 +73,9 @@ module LibItsBtp_TypesAndValues { type record BtpBHeader { BtpPortId destinationPort, BtpPortInfo destinationPortInfo - } with { + } with { variant "FIELDORDER(msb)" - } + } /** @@ -95,17 +93,17 @@ module LibItsBtp_TypesAndValues { } // end btpHeaders group utPrimitives { - + group utCommonPrimitives { - + /** * @desc Upper Tester message to initialize IUT * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use */ type record UtBtpInitialize { - Oct8 hashedId8 + Oct8 hashedId8 } with { - variant "FIELDORDER(msb)" + variant "FIELDORDER(msb)" } /** @@ -114,10 +112,10 @@ module LibItsBtp_TypesAndValues { * @member utBtpTriggerResult - */ type union UtBtpResults { - boolean utBtpInitializeResult, - boolean utBtpTriggerResult + boolean utBtpInitializeResult, + boolean utBtpTriggerResult } with { - variant "" + variant "" } /** @@ -126,46 +124,46 @@ module LibItsBtp_TypesAndValues { * @member btpB - */ type union UtBtpTrigger { - GenerateBtpA btpA, - GenerateBtpB btpB + GenerateBtpA btpA, + GenerateBtpB btpB } with { - variant "" - } - + variant "" + } + /** * @desc Upper Tester message to request triggering of an BTPA message at IUT */ type record GenerateBtpA { - BtpAHeader btpAHeader + BtpAHeader btpAHeader } with { - variant "FIELDORDER(msb)" - } - + variant "FIELDORDER(msb)" + } + /** * @desc Upper Tester message to request triggering of an BTPB message at IUT */ type record GenerateBtpB { - BtpBHeader btpBHeader + BtpBHeader btpBHeader } with { - variant "FIELDORDER(msb)" - } - + variant "FIELDORDER(msb)" + } + /** * @desc Upper Tester message to check event/status on BTP IUT */ type record UtBtpEventInd { - BtpRawPayload rawPayload + BtpRawPayload rawPayload } with { - variant "FIELDORDER(msb)" - } - + variant "FIELDORDER(msb)" + } + /** * @desc List of Upper Tester messages to check event/status on CAM IUT */ type record of UtBtpEventInd UtBtpEventIndList; + } - - + } // end utPrimitives with { variant "" diff --git a/ttcn/CAM/LibItsCam_Functions.ttcn b/ttcn/CAM/LibItsCam_Functions.ttcn index c2a3ebf1..204b0356 100644 --- a/ttcn/CAM/LibItsCam_Functions.ttcn +++ b/ttcn/CAM/LibItsCam_Functions.ttcn @@ -109,7 +109,6 @@ module LibItsCam_Functions { } [] utPort.receive(UtCamResults: { utCamChangePositionResult := ? }) { tc_wait.stop; - log("*** f_utChangePosition: INFO: IUT position change was not successful ***"); f_selfOrClientSyncAndVerdict("error", e_error); } [] tc_wait.timeout { diff --git a/ttcn/CAM/LibItsCam_TypesAndValues.ttcn b/ttcn/CAM/LibItsCam_TypesAndValues.ttcn index e6e077b5..b33dbb9a 100644 --- a/ttcn/CAM/LibItsCam_TypesAndValues.ttcn +++ b/ttcn/CAM/LibItsCam_TypesAndValues.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/CAM/LibItsCam_TypesAndValues.ttcn $ + * $Id: LibItsCam_TypesAndValues.ttcn 1318 2017-01-26 10:20:53Z filatov $ * @desc Module containing types and values for CAM Protocol * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. @@ -165,9 +165,9 @@ module LibItsCam_TypesAndValues { */ type record UtCamEventInd { CAM camMsg // TODO Rename into caMsg to be compliant with UtDenmEventInd - } with { + } with { encode (camMsg) "LibItsCam_asn1" - } + } /** * @desc List of Upper Tester messages to check event/status on CAM IUT diff --git a/ttcn/Common/LibItsCommon_TypesAndValues.ttcn b/ttcn/Common/LibItsCommon_TypesAndValues.ttcn index 546bcb73..86c570d4 100644 --- a/ttcn/Common/LibItsCommon_TypesAndValues.ttcn +++ b/ttcn/Common/LibItsCommon_TypesAndValues.ttcn @@ -45,6 +45,7 @@ module LibItsCommon_TypesAndValues { } // End of type AcDisableSecurity /** + * @desc Primitive for receiving response from TA * @desc TA primitives for GNSS * @member loadScenario - * @member startScenario - @@ -192,14 +193,14 @@ module LibItsCommon_TypesAndValues { * @see ETSI TS 102 965 Intelligent Transport Systems (ITS); Application Object Identifier (ITS-AID); Registration list ETSI ITS registration list */ group securityConstants { - const integer c_its_aid_CAM := 36; - const integer c_its_aid_DENM := 37; - const integer c_its_aid_SPAT := 137; - const integer c_its_aid_MAP := 138; - const integer c_its_aid_IVI := 139; + const integer c_its_aid_CAM := 36; + const integer c_its_aid_DENM := 37; + const integer c_its_aid_SPAT := 137; + const integer c_its_aid_MAP := 138; + const integer c_its_aid_IVI := 139; const integer c_its_aid_TLC := 140; const integer c_its_aid_GN := 141; - const integer c_its_aid_SCR := 623; // Secured Certificate Request, https://standards.ieee.org/products-services/regauth/psid/public.html + const integer c_its_aid_SCR := 623; // Secured Certificate Request, https://standards.ieee.org/products-services/regauth/psid/public.html } } with { diff --git a/ttcn/DENM/LibItsDenm_Functions.ttcn b/ttcn/DENM/LibItsDenm_Functions.ttcn index 0ab20d49..bf04d058 100644 --- a/ttcn/DENM/LibItsDenm_Functions.ttcn +++ b/ttcn/DENM/LibItsDenm_Functions.ttcn @@ -83,7 +83,7 @@ module LibItsDenm_Functions { } [] utPort.receive(UtDenmResults: { utDenmChangePseudonymResult := false}) { tc_wait.stop; - log("*** " & testcasename() & ": INFO: IUT pseudonym changed ***"); + log("*** " & testcasename() & ": INFO: IUT pseudonym unchanged ***"); f_selfOrClientSyncAndVerdict("error", e_error); } [] a_utDefault() { diff --git a/ttcn/DENM/LibItsDenm_Templates.ttcn b/ttcn/DENM/LibItsDenm_Templates.ttcn index 993a6baf..9e591264 100644 --- a/ttcn/DENM/LibItsDenm_Templates.ttcn +++ b/ttcn/DENM/LibItsDenm_Templates.ttcn @@ -578,8 +578,6 @@ module LibItsDenm_Templates { eventPosition := ?, relevanceDistance := *, relevanceTrafficDirection := *, -//FIXME (DF) validityDuration is set as mandatory, '*' can not be assigned to it -// validityDuration := *, // It seems that a default value can be omitted (asn1studio) validityDuration := ?, // It seems that a default value can be omitted (asn1studio) transmissionInterval := *, stationType := ? diff --git a/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn b/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn index eb570b54..e083fe27 100644 --- a/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn +++ b/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn @@ -106,9 +106,9 @@ module LibItsDenm_TypesAndValues { TransmissionInterval transmissionInterval optional, TransmissionInterval repetitionInterval optional, AlacarteContainer alacarte optional - } with { + } with { variant "FIELDORDER(msb)" - } + } /** * @desc Upper Tester result message of request of triggering of an event at IUT @@ -116,9 +116,9 @@ module LibItsDenm_TypesAndValues { type record UtDenmTriggerResult { boolean result, ActionID actionId - } with { + } with { variant "FIELDORDER(msb)" - } + } /** * @desc Upper Tester message to update an event at IUT @@ -134,9 +134,9 @@ module LibItsDenm_TypesAndValues { TransmissionInterval transmissionInterval optional, TransmissionInterval repetitionInterval optional, AlacarteContainer alacarte optional - } with { + } with { variant "FIELDORDER(msb)" - } + } /** * @desc Upper Tester result message of an update request of an event on DENM IUT @@ -144,18 +144,18 @@ module LibItsDenm_TypesAndValues { type record UtDenmUpdateResult { boolean result, ActionID actionId - } with { + } with { variant "FIELDORDER(msb)" - } + } /** * @desc Upper Tester message to request the termination of an event at IUT */ type record UtDenmTermination { ActionID actionId - } with { + } with { variant "FIELDORDER(msb)" - } + } /** * @desc Upper Tester message to change the position of IUT. Values a relatives @@ -175,7 +175,7 @@ module LibItsDenm_TypesAndValues { // empty on purpose } with { variant "FIELDORDER(msb)" - } + } /** * @desc Upper Tester message to check event/status on DENM IUT diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn index 78142c92..5f0d22bd 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn @@ -77,24 +77,8 @@ module LibItsGeoNetworking_TestSystem { /** * @desc ITS Main Test Component */ -//FIXME RGY ItsMtc can extend ItsBaseGeoNetworking instead of ItsSecurityBaseComponent, as it contains -// everything defined here but vc_componentTable and already extends ItsSecurityBaseComponent -// also, ItsBaseMtc already extends ServerSyncComp -// type component ItsMtc extends ItsBaseMtc, ServerSyncComp, ItsSecurityBaseComponent { // TODO Extend ItsBaseMtc with ItsSecurityBaseComponent? { type component ItsMtc extends ItsBaseMtc, ItsBaseGeoNetworking { -/*FIXME RGY all these objects are inherited from ItsBaseGeoNetworking, they shall not be defined again: see $6.2.10.2 - port UpperTesterPort utPort; - port AdapterControlPort acPort; -*/ var ComponentTable vc_componentTable := {}; -/* - // UT indications - var UtGnEventIndList vc_utInds := {}; - - var boolean vc_utDefaultActive := true; - var boolean vc_acDefaultActive := true; - var boolean vc_gnDefaultActive := true; -*/ } // end ItsMtc /** diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn index 330ff49e..fe076b85 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn @@ -1065,7 +1065,6 @@ module LibItsGeoNetworking_TypesAndValues { * @desc Upper Tester message to check Upper Layer message transmission on GN IUT */ type record UtGnEventInd { - // GeoNetworkingPdu gnPdu GnRawPayload rawPayload } with { variant "FIELDORDER(msb)" diff --git a/ttcn/IVIM/LibItsIvim_Functions.ttcn b/ttcn/IVIM/LibItsIvim_Functions.ttcn index 5ce007a5..e236b5eb 100644 --- a/ttcn/IVIM/LibItsIvim_Functions.ttcn +++ b/ttcn/IVIM/LibItsIvim_Functions.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/IVIM/LibItsIvim_Functions.ttcn $ + * $Id: LibItsIvim_Functions.ttcn,v 1.2 2018/05/31 15:57:12 dte Exp $ * @desc Module containing functions for IVIM * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. @@ -44,6 +44,9 @@ module LibItsIvim_Functions { */ function f_utInitializeIut(template (value) UtIvimInitialize p_init) runs on ItsIvim { + //deactivate ivimPort default alts + vc_ivimDefaultActive := false; + utPort.send(p_init); tc_wait.start; alt { @@ -58,11 +61,10 @@ module LibItsIvim_Functions { log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); f_selfOrClientSyncAndVerdict("error", e_timeout); } - [else] { // Shortcut defaults -// //f_sleep(0.050); // 50 ms - repeat; - } } + + //deactivate ivimPort default alts + vc_ivimDefaultActive := true; } /** @@ -75,6 +77,9 @@ module LibItsIvim_Functions { var IviIdentificationNumber v_iviIdentificationNumber; var UtIvimResults v_result; + //deactivate ivimPort default alts + vc_ivimDefaultActive := false; + utPort.send(p_event); tc_wait.start; alt { @@ -92,12 +97,11 @@ module LibItsIvim_Functions { log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); f_selfOrClientSyncAndVerdict("error", e_timeout); } - [else] { // Shortcut defaults -// //f_sleep(0.050); // 50 ms - repeat; - } } + //deactivate ivimPort default alts + vc_ivimDefaultActive := true; + return v_iviIdentificationNumber; } @@ -111,6 +115,9 @@ module LibItsIvim_Functions { var IviIdentificationNumber v_iviIdentificationNumber; var UtIvimResults v_result; + //deactivate ivimPort default alts + vc_ivimDefaultActive := false; + utPort.send(p_event); tc_wait.start; alt { @@ -128,12 +135,11 @@ module LibItsIvim_Functions { log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); f_selfOrClientSyncAndVerdict("error", e_timeout); } - [else] { // Shortcut defaults -// //f_sleep(0.050); // 50 ms - repeat; - } } + //activate ivimPort default alts + vc_ivimDefaultActive := true; + return v_iviIdentificationNumber; } @@ -143,6 +149,9 @@ module LibItsIvim_Functions { */ function f_utTerminateEvent(template (value) UtIvimTermination p_event) runs on ItsIvim { + //deactivate ivimPort default alts + vc_ivimDefaultActive := false; + utPort.send(p_event); tc_wait.start; alt { @@ -156,11 +165,10 @@ module LibItsIvim_Functions { [] a_utDefault() { //empty on purpose } - [else] { // Shortcut defaults -// //f_sleep(0.050); // 50 ms - repeat; - } } + + //deactivate ivimPort default alts + vc_ivimDefaultActive := true; } } // End of group utFunctions @@ -171,12 +179,12 @@ module LibItsIvim_Functions { * @desc Initialise secure mode if required */ function f_initialiseSecuredMode( - in charstring p_certificate_id := PX_CERT_FOR_TS + in charstring p_certificateId := PX_CERT_FOR_TS ) runs on ItsIvim { if (PICS_IS_IUT_SECURED == true) { - if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificate_id))) { + if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificateId))) { log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); stop; } @@ -226,11 +234,11 @@ module LibItsIvim_Functions { /** * @desc Setups default configuration - * @param p_certificate_id The certificate identifier the TA shall use in case of secured IUT + * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT */ function f_cfUp( - in charstring p_certificate_id := PX_CERT_FOR_TS - ) runs on ItsIvim /* TITAN TODO: system ItsIvimSystem */{ + in charstring p_certificateId := PX_CERT_FOR_TS + ) runs on ItsIvim system ItsIvimSystem { map(self:acPort, system:acPort); map(self:utPort, system:utPort); @@ -238,14 +246,14 @@ module LibItsIvim_Functions { f_connect4SelfOrClientSync(); // Initialise secured mode - f_initialiseSecuredMode(p_certificate_id); + f_initialiseSecuredMode(p_certificateId); } // End of function f_cfUp /** * @desc Deletes default configuration */ - function f_cfDown() runs on ItsIvim /* TITAN TODO: system ItsIvimSystem */{ + function f_cfDown() runs on ItsIvim system ItsIvimSystem { // Initialise secured mode f_uninitialiseSecuredMode(); @@ -265,7 +273,7 @@ module LibItsIvim_Functions { * @desc The base default. */ altstep a_default() runs on ItsIvim { - [] ivimPort.receive( + [vc_ivimDefaultActive] ivimPort.receive( mw_ivimInd( mw_ivimPdu( mw_ivimStructure @@ -274,7 +282,7 @@ module LibItsIvim_Functions { vc_ivimReceived := true; repeat; } - [] ivimPort.receive { + [vc_ivimDefaultActive] ivimPort.receive { log("*** " & testcasename() & ": ERROR: Received an unexpected message ***"); f_selfOrClientSyncAndVerdict("error", e_error); } diff --git a/ttcn/IVIM/LibItsIvim_Pics.ttcn b/ttcn/IVIM/LibItsIvim_Pics.ttcn index e5e806c3..c0f0c0b9 100644 --- a/ttcn/IVIM/LibItsIvim_Pics.ttcn +++ b/ttcn/IVIM/LibItsIvim_Pics.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/IVIM/LibItsIvim_Pics.ttcn $ + * $Id: LibItsIvim_Pics.ttcn 1312 2016-12-14 09:21:45Z garciay $ * @desc IVIM PICS * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. diff --git a/ttcn/IVIM/LibItsIvim_Pixits.ttcn b/ttcn/IVIM/LibItsIvim_Pixits.ttcn index dc22623a..38e4a173 100644 --- a/ttcn/IVIM/LibItsIvim_Pixits.ttcn +++ b/ttcn/IVIM/LibItsIvim_Pixits.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/IVIM/LibItsIvim_Pixits.ttcn $ + * $Id: LibItsIvim_Pixits.ttcn 1315 2016-12-15 13:25:41Z garciay $ * @desc IVIM PIXITS * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. diff --git a/ttcn/IVIM/LibItsIvim_Templates.ttcn b/ttcn/IVIM/LibItsIvim_Templates.ttcn index 6691d425..07caf115 100644 --- a/ttcn/IVIM/LibItsIvim_Templates.ttcn +++ b/ttcn/IVIM/LibItsIvim_Templates.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/IVIM/LibItsIvim_Templates.ttcn $ + * $Id: LibItsIvim_Templates.ttcn 1316 2017-01-03 09:03:43Z garciay $ * @desc Module containing base template definitions for IVIM * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. @@ -171,9 +171,9 @@ module LibItsIvim_Templates { template (omit) IviStructure.optional_ p_optional_ := omit ) := { iviIdentificationNumber := p_iviIdentificationNumber, - timeStamp := p_timeStamp, validFrom := p_validFrom, validTo := p_validTo, + timeStamp := p_timeStamp, connectedIviStructures := p_connectedIviStructures, optional_ := p_optional_ } // End of template m_utIvimUpdateEvent @@ -295,7 +295,7 @@ module LibItsIvim_Templates { * @param p_mandatory The Management Container * @param p_optional_ A list of IVI Container (Default: omit) */ - template IviStructure mw_ivimStructure( + template (present) IviStructure mw_ivimStructure( template (present) IVIManagementContainer p_mandatory := ?, template IviStructure.optional_ p_optional_ := * ) := { @@ -505,11 +505,11 @@ module LibItsIvim_Templates { } // End of template m_glcPart template GlcPart mw_glcPart( - template (present) Zid p_zoneId := ?, - template LanePosition p_laneNumber := *, - template GlcPart.zoneExtension p_zoneExtension := *, - template HeadingValue p_zoneHeading := *, - template Zone p_zone := * + template (present) Zid p_zoneId := ?, + template LanePosition p_laneNumber := *, + template GlcPart.zoneExtension p_zoneExtension := *, + template HeadingValue p_zoneHeading := *, + template Zone p_zone := * ) := { zoneId := p_zoneId, laneNumber := p_laneNumber, diff --git a/ttcn/IVIM/LibItsIvim_TestSystem.ttcn b/ttcn/IVIM/LibItsIvim_TestSystem.ttcn index c07a815f..e675f6c5 100644 --- a/ttcn/IVIM/LibItsIvim_TestSystem.ttcn +++ b/ttcn/IVIM/LibItsIvim_TestSystem.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/IVIM/LibItsIvim_TestSystem.ttcn $ + * $Id: LibItsIvim_TestSystem.ttcn,v 1.2 2018/05/31 15:57:12 dte Exp $ * @desc Test System module for ITS IVIM * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. diff --git a/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn b/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn index 7f627f29..e87fe0be 100644 --- a/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn +++ b/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn $ + * $Id: LibItsIvim_TypesAndValues.ttcn,v 1.4 2019/01/02 14:14:11 dte Exp $ * @desc Module containing type and value definitions for IVIM * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. @@ -39,6 +39,7 @@ module LibItsIvim_TypesAndValues { const TimestampIts c_duration_4sec := 4; const TimestampIts c_duration_6sec := 6; + type record of float Times; } // End ofgroup ivimConstants group otherTypes { @@ -93,9 +94,9 @@ module LibItsIvim_TypesAndValues { TimestampIts repetitionInterval optional/*, IVIManagementContainer.connectedIviStructures connectedIviStructures optional, IviStructure.optional_ optional_ optional*/ - } with { + } with { variant "FIELDORDER(msb)" - } + } /** * @desc Upper Tester result message of request of triggering of an event at IUT @@ -103,23 +104,23 @@ module LibItsIvim_TypesAndValues { type record UtIvimTriggerResult { boolean result, IviIdentificationNumber iviIdentificationNumber - } with { + } with { variant "FIELDORDER(msb)" - } + } /** * @desc Upper Tester message to update an event at IUT */ type record UtIvimUpdate { IviIdentificationNumber iviIdentificationNumber, - TimestampIts timeStamp optional, TimestampIts validFrom optional, TimestampIts validTo optional, + TimestampIts timeStamp optional, IVIManagementContainer.connectedIviStructures connectedIviStructures optional, IviStructure.optional_ optional_ optional - } with { + } with { variant "FIELDORDER(msb)" - } + } /** * @desc Upper Tester result message of an update request of an event on Ivim IUT @@ -127,18 +128,18 @@ module LibItsIvim_TypesAndValues { type record UtIvimUpdateResult { boolean result, IviIdentificationNumber iviIdentificationNumber - } with { + } with { variant "FIELDORDER(msb)" - } + } /** * @desc Upper Tester message to request the termination of an event at IUT */ type record UtIvimTermination { IviIdentificationNumber iviIdentificationNumber - } with { + } with { variant "FIELDORDER(msb)" - } + } /** * @desc Upper Tester result message of termination of an event on Ivim IUT diff --git a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Functions.ttcn b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Functions.ttcn index f8c1cc39..5a52ae09 100644 --- a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Functions.ttcn +++ b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Functions.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF405 / STF449 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Functions.ttcn $ + * $Id: LibItsIpv6OverGeoNetworking_Functions.ttcn 1318 2017-01-26 10:20:53Z filatov $ * @desc Module containing functions for Ipv6OverGeoNetworking * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. @@ -38,7 +38,7 @@ module LibItsIpv6OverGeoNetworking_Functions { * - two ITS nodes (nodeA, nodeB) * - three GVLs */ - function f_cf01UpGn6() runs on ItsIpv6OverGeoNetworking /* TITAN TODO: system ItsIpv6OverGeoNetworkingSystem */ { + function f_cf01UpGn6() runs on ItsIpv6OverGeoNetworking system ItsIpv6OverGeoNetworkingSystem { // Variables var float v_distance; @@ -73,7 +73,7 @@ module LibItsIpv6OverGeoNetworking_Functions { /** * @desc Deletes configuration cf01Gn6 */ - function f_cf01DownGn6() runs on ItsIpv6OverGeoNetworking /* TITAN TODO: system ItsIpv6OverGeoNetworkingSystem */ { + function f_cf01DownGn6() runs on ItsIpv6OverGeoNetworking system ItsIpv6OverGeoNetworkingSystem { // Map unmap(self:ipv6OverGeoNetworkingPort, system:ipv6OverGeoNetworkingPort); @@ -99,7 +99,7 @@ module LibItsIpv6OverGeoNetworking_Functions { ?, ?, e_ipv6, - ? + ?// FIXME Check that we have an IPv6Payload mw_octetstringPayload ) ) ) @@ -282,31 +282,18 @@ module LibItsIpv6OverGeoNetworking_Functions { in charstring p_compName, in UInt32 p_validLifetime := c_validLifetime30s ) runs on ItsIpv6OverGeoNetworking { - + var bitstring v_ipv6Payload; var AddressTableEntry v_nodeAddresses := f_getAddresses(p_compName); var LongPosVector v_nodeLongPosVector := f_getPosition(p_compName); - f_sendGeoNetMessageWithPayload( - valueof( - m_geoNwReq_linkLayerBroadcast( - m_geoNwPdu( - m_geoNwBroadcastPacket( - v_nodeLongPosVector, - vc_localSeqNumber, - f_getGeoBroadcastArea(valueof(p_gvl.area)) - ) - ) - ) - ), - bit2oct( - encvalue( + v_ipv6Payload := encvalue( m_ipv6Packet( v_nodeAddresses.lla, c_allNodesMca, c_icmpHdr, m_rtAdvWithOptions( m_rtAdvOpt_prefixOpt( - valueof(p_gvl.prefixLength), + p_gvl.prefixLength, c_lFlag1, c_aFlag1, p_validLifetime, @@ -315,8 +302,19 @@ module LibItsIpv6OverGeoNetworking_Functions { ) ) ) + ); + + f_sendGeoNetMessageWithPayload( + m_geoNwReq_linkLayerBroadcast( + m_geoNwPdu( + m_geoNwBroadcastPacket( + v_nodeLongPosVector, + vc_localSeqNumber, + f_getGeoBroadcastArea(valueof(p_gvl.area)) ) ) + ), + bit2oct(v_ipv6Payload) ); } diff --git a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Pics.ttcn b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Pics.ttcn index aac28120..5d5efdc3 100644 --- a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Pics.ttcn +++ b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Pics.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF405 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Pics.ttcn $ + * $Id: LibItsIpv6OverGeoNetworking_Pics.ttcn 1318 2017-01-26 10:20:53Z filatov $ * @desc IPv6 Over GeoNetworking PICS * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. diff --git a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Pixits.ttcn b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Pixits.ttcn index 313fb0fe..68e016f6 100644 --- a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Pixits.ttcn +++ b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Pixits.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF405 /STF449 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Pixits.ttcn $ + * $Id: LibItsIpv6OverGeoNetworking_Pixits.ttcn 1318 2017-01-26 10:20:53Z filatov $ * @desc Module parameters for IPv6 over GeoNetworking Protocol * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. diff --git a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Templates.ttcn b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Templates.ttcn index da581a7a..70fae63a 100644 --- a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Templates.ttcn +++ b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Templates.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF405 / STF449 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Templates.ttcn $ + * $Id: LibItsIpv6OverGeoNetworking_Templates.ttcn 1318 2017-01-26 10:20:53Z filatov $ * @desc IPv6 over GeoNetworking Protocol Templates * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. @@ -65,24 +65,6 @@ module LibItsIpv6OverGeoNetworking_Templates { group ipv6 { -// /** -// * @desc Send template for GN6 payload of type IPv6 -// * @param p_ipv6Packet IPv6 packet to be used as GN6 payload -// */ -// template (value) Payload m_ipv6Payload(in template (value) Ipv6Packet p_ipv6Packet) := { -// decodedPayload := {ipv6Packet := p_ipv6Packet}, -// rawPayload := ''O -// } -// -// /** -// * @desc Receive template for GN6 payload of type IPv6 -// * @param p_ipv6Packet Expected IPv6 packet to be received as GN6 payload -// */ -// template (present) Payload mw_ipv6Payload(in template (present) Ipv6Packet p_ipv6Packet) := { -// decodedPayload := {ipv6Packet := p_ipv6Packet}, -// rawPayload := ? -// } - /** * @desc Send template for IPv6 packet * @param p_srcAddr IPv6 source address diff --git a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TestSystem.ttcn b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TestSystem.ttcn index b4797b0e..88b6998b 100644 --- a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TestSystem.ttcn +++ b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TestSystem.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF405 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TestSystem.ttcn $ + * $Id: LibItsIpv6OverGeoNetworking_TestSystem.ttcn 1318 2017-01-26 10:20:53Z filatov $ * @desc Test System module for ITS Ipv6OverGeoNetworking * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. diff --git a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TypesAndValues.ttcn b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TypesAndValues.ttcn index 81561cd1..1d22a895 100644 --- a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TypesAndValues.ttcn +++ b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TypesAndValues.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF405 / STF449 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TypesAndValues.ttcn $ + * $Id: LibItsIpv6OverGeoNetworking_TypesAndValues.ttcn 1318 2017-01-26 10:20:53Z filatov $ * @desc Types and values for IPv6 over GeoNetworking Protocol * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. @@ -100,8 +100,8 @@ module LibItsIpv6OverGeoNetworking_TypesAndValues { ExtensionHeaderList extHdrList optional, Ipv6Payload ipv6Payload optional } with { - variant "FIELDORDER(msb)" - } + variant "FIELDORDER(msb)" + } /** * @desc Derived from RFC 2460 Section 3 diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn index 5db1144e..26ab01c2 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF484 / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn $ + * $Id: LibItsMapemSpatem_Functions.ttcn,v 1.2 2018/05/31 15:57:09 dte Exp $ * @desc Module containing common functions for ITS MAPEM SPATEM * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. @@ -41,6 +41,9 @@ module LibItsMapemSpatem_Functions { */ function f_utInitializeIut(template (value) UtMapemSpatemInitialize p_init) runs on ItsMapemSpatem { + //deactivate mapemSpatemPort default alts + vc_mapemSpatemDefaultActive := false; + utPort.send(p_init); tc_wait.start; alt { @@ -52,11 +55,10 @@ module LibItsMapemSpatem_Functions { log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); f_selfOrClientSyncAndVerdict("error", e_timeout); } - [else] { // Shortcut defaults - //f_sleep(0.050); // 50 ms - repeat; - } } + + //deactivate mapemSpatemPort default alts + vc_mapemSpatemDefaultActive := true; } /** @@ -67,6 +69,9 @@ module LibItsMapemSpatem_Functions { in template (value) UtMapemSpatemTrigger p_event ) runs on ItsMapemSpatem { + //deactivate mapemSpatemPort default alts + vc_mapemSpatemDefaultActive := false; + utPort.send ( p_event ); tc_wait.start; alt { @@ -81,12 +86,11 @@ module LibItsMapemSpatem_Functions { log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); f_selfOrClientSyncAndVerdict("error", e_timeout); } - [else] { // Shortcut defaults - //f_sleep(0.050); // 50 ms - repeat; - } } + //deactivate mapemSpatemPort default alts + vc_mapemSpatemDefaultActive := true; + return; } } // End of group utFuntions @@ -97,12 +101,12 @@ module LibItsMapemSpatem_Functions { * @desc Initialise secure mode if required */ function f_initialiseSecuredMode( - in charstring p_certificate_id := PX_CERT_FOR_TS + in charstring p_certificateId := PX_CERT_FOR_TS ) runs on ItsMapemSpatem { if (PICS_IS_IUT_SECURED == true) { - if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificate_id))) { + if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificateId))) { log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); stop; } @@ -166,17 +170,17 @@ module LibItsMapemSpatem_Functions { * @desc The base default. */ altstep a_default() runs on ItsMapemSpatem { - [] mapemSpatemPort.receive(mw_mapemInd(mw_mapemPdu(mw_defaultMapem))) { + [vc_mapemSpatemDefaultActive] mapemSpatemPort.receive(mw_mapemInd(mw_mapemPdu(mw_defaultMapem))) { log("*** " & testcasename() & ": INFO: MAPEM received in default ***"); vc_mapemReceived := true; repeat; } - [] mapemSpatemPort.receive(mw_spatemInd(mw_spatemPdu(mw_defaultSpatem))) { + [vc_mapemSpatemDefaultActive] mapemSpatemPort.receive(mw_spatemInd(mw_spatemPdu(mw_defaultSpatem))) { log("*** " & testcasename() & ": INFO: MAPEM received in default ***"); vc_spatemReceived := true; repeat; } - [] mapemSpatemPort.receive { + [vc_mapemSpatemDefaultActive] mapemSpatemPort.receive { log("*** " & testcasename() & ": ERROR: Received an unexpected message ***"); f_selfOrClientSyncAndVerdict("error", e_error); } @@ -220,11 +224,11 @@ module LibItsMapemSpatem_Functions { /** * @desc Setups default configuration - * @param p_certificate_id The certificate identifier the TA shall use in case of secured IUT + * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT */ function f_cfUp( - in charstring p_certificate_id := PX_CERT_FOR_TS - ) runs on ItsMapemSpatem /* TITAN TODO: system ItsMapemSpatemSystem */ { + in charstring p_certificateId := PX_CERT_FOR_TS + ) runs on ItsMapemSpatem system ItsMapemSpatemSystem { map(self:acPort, system:acPort); map(self:utPort, system:utPort); @@ -235,7 +239,7 @@ module LibItsMapemSpatem_Functions { activate(a_cf01Down()); // Initialise secured mode - f_initialiseSecuredMode(p_certificate_id); + f_initialiseSecuredMode(p_certificateId); } // End of f_cfUp diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn index faf91541..2d8b9640 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn $ + * $Id: LibItsMapemSpatem_Pics.ttcn 1312 2016-12-14 09:21:45Z garciay $ * @desc MAPEM SPATEM PICS * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Pixits.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Pixits.ttcn index efd40711..a28bd440 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Pixits.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Pixits.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF484 / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/MapemSpatem/LibItsMapemSpatem_Pixits.ttcn $ + * $Id: LibItsMapemSpatem_Pixits.ttcn 1315 2016-12-15 13:25:41Z garciay $ * @desc MAPEM SPATEM PIXIT * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn index d1e43423..801c8635 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF484 / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn $ + * $Id: LibItsMapemSpatem_Templates.ttcn 1317 2017-01-26 07:05:19Z garciay $ * @desc Module containing base template definitions for MAPEM SPATEM * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. @@ -94,12 +94,10 @@ module LibItsMapemSpatem_Templates { * @param p_btpDestinationPort BTP destination port value * @param p_btpInfo BTP destination port info value (if BTP-B) or BTP source port value (if BTP-A) */ -//FIXME RGY template should be (present), no omit is assigned to it as a whole; Titan currently requires that the modified templte has at least the same restirction as the base -// template MapemInd mw_mapemIndWithBtpParameters( - template(present) MapemInd mw_mapemIndWithBtpParameters( - template (present) MAPEM p_mapemMsg, - in template UInt16 p_btpDestinationPort := *, - in template UInt16 p_btpInfo := * + template (present) MapemInd mw_mapemIndWithBtpParameters( + template (present) MAPEM p_mapemMsg, + template UInt16 p_btpDestinationPort := *, + template UInt16 p_btpInfo := * ) modifies mw_mapemInd := { btpDestinationPort := p_btpDestinationPort, btpInfo := p_btpInfo @@ -179,12 +177,10 @@ module LibItsMapemSpatem_Templates { * @param p_btpDestinationPort BTP destination port value * @param p_btpInfo BTP destination port info value (if BTP-B) or BTP source port value (if BTP-A) */ -//FIXME RGY template should be (present), no omit is assigned to it as a whole; Titan currently requires that the modified templte has at least the same restirction as the base -// template SpatemInd mw_spatemIndWithBtpParameters( - template(present) SpatemInd mw_spatemIndWithBtpParameters( - template (present) SPATEM p_spatemMsg, - template UInt16 p_btpDestinationPort := *, - template UInt16 p_btpInfo := * + template (present) SpatemInd mw_spatemIndWithBtpParameters( + template (present) SPATEM p_spatemMsg, + template UInt16 p_btpDestinationPort := *, + template UInt16 p_btpInfo := * ) modifies mw_spatemInd := { btpDestinationPort := p_btpDestinationPort, btpInfo := p_btpInfo @@ -392,12 +388,10 @@ module LibItsMapemSpatem_Templates { /** * @desc Receive template for MAPEM Message */ -//FIXME RGY template should be (present), no omit is assigned to it as a whole; Titan currently requires that the modified templte has at least the same restirction as the base -// template (omit) MapData m_mapem( template (value) MapData m_mapem( - in template (value) MsgCount p_msgIssueRevision, - in template (omit) IntersectionGeometryList p_intersectionGeometryList := omit, - in template (omit) RoadSegmentList p_roadSegments := omit + in template (value) MsgCount p_msgIssueRevision, + in template (omit) IntersectionGeometryList p_intersectionGeometryList := omit, + in template (omit) RoadSegmentList p_roadSegments := omit ) modifies m_defaultMapem := { msgIssueRevision := p_msgIssueRevision, intersections := p_intersectionGeometryList, diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_TestSystem.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_TestSystem.ttcn index 266985c8..a93e7e5a 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_TestSystem.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_TestSystem.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF484 / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/MapemSpatem/LibItsMapemSpatem_TestSystem.ttcn $ + * $Id: LibItsMapemSpatem_TestSystem.ttcn,v 1.2 2018/05/31 15:57:10 dte Exp $ * @desc Test System module for ITS MAPEM SPATEM * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. @@ -96,6 +96,8 @@ module LibItsMapemSpatem_TestSystem { //global variables var boolean vc_mapemReceived := false; var boolean vc_spatemReceived := false; + + var boolean vc_mapemSpatemDefaultActive := true; } // End of component ItsMapemSpatem group ApplPrimitives { diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index d6ad876a..291ca62e 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -1,6 +1,6 @@ /** * @author ETSI / STF544 - * @version $URL$ + * @version $Url$ * $Id$ * @desc Module containing functions for ITS PKI ATS * @copyright ETSI Copyright Notification @@ -70,8 +70,8 @@ module LibItsPki_Functions { out ItsPkiItss p_itss, out ItsPkiHttp p_pki ) runs on ItsMtc { - p_itss := ItsPkiItss.create("IUT") alive; - p_pki := ItsPkiHttp.create("TS") alive; + p_itss := ItsPkiItss.create("ITSS") alive; + p_pki := ItsPkiHttp.create("PKI") alive; connect(self:syncPort, mtc:syncPort); connect(p_itss:syncPort, self:syncPort); @@ -97,7 +97,7 @@ module LibItsPki_Functions { function f_cfHttpUp( in charstring p_ea_certificate_id := "CERT_TS_A_EA", // TODO Use a constant in charstring p_aa_certificate_id := "CERT_TS_A_AA" - ) runs on ItsPkiHttp /* TITAN TODO: system ItsPkiHttpSystem */ { + ) runs on ItsPkiHttp system ItsPkiHttpSystem { if (PICS_MULTIPLE_END_POINT == false) { map(self:httpPort, system:httpPort); @@ -148,7 +148,7 @@ module LibItsPki_Functions { /** * @desc Setups default configuration */ - function f_cfHttpUp_ca() runs on ItsPkiHttp /* TITAN TODO: system ItsPkiHttpSystem */ { + function f_cfHttpUp_ca() runs on ItsPkiHttp system ItsPkiHttpSystem { if (PICS_MULTIPLE_END_POINT == false) { map(self:httpPort, system:httpPort); @@ -169,7 +169,7 @@ module LibItsPki_Functions { /** * @desc Setups default configuration */ - function f_cfHttpUp_tlm() runs on ItsPkiHttp /* TITAN TODO: system ItsPkiHttpSystem */ { + function f_cfHttpUp_tlm() runs on ItsPkiHttp system ItsPkiHttpSystem { if (PICS_MULTIPLE_END_POINT == false) { map(self:httpPort, system:httpPort); @@ -194,7 +194,7 @@ module LibItsPki_Functions { function f_cfHttpUp_itss( in charstring p_ea_certificate_id := "CERT_TS_A_EA", // TODO Use a constant in charstring p_aa_certificate_id := "CERT_TS_A_AA" - ) runs on ItsPkiHttp /* TITAN TODO: system ItsPkiHttpSystem */ { + ) runs on ItsPkiHttp system ItsPkiHttpSystem { if (PICS_MULTIPLE_END_POINT == false) { map(self:httpPort, system:httpPort); @@ -240,7 +240,7 @@ module LibItsPki_Functions { function f_cfHttpUp_ea( in charstring p_ea_certificate_id := "CERT_TS_A_EA", // TODO Use a constant in charstring p_aa_certificate_id := "CERT_TS_A_AA" - ) runs on ItsPkiHttp /* TITAN TODO: system ItsPkiHttpSystem */ { + ) runs on ItsPkiHttp system ItsPkiHttpSystem { if (PICS_MULTIPLE_END_POINT == false) { map(self:httpPort, system:httpPort); @@ -282,7 +282,7 @@ module LibItsPki_Functions { function f_cfUp_itss( in charstring p_certificate_id := "CERT_TS_A_EA" // TODO Use a constant - ) runs on ItsPkiItss /* TITAN TODO: system ItsPkiItssSystem */ { + ) runs on ItsPkiItss system ItsPkiItssSystem { map(self:geoNetworkingPort, system:geoNetworkingPort); map(self:utPort, system:utPort); @@ -323,7 +323,7 @@ module LibItsPki_Functions { /** * @desc Deletes default configuration */ - function f_cfHttpDown() runs on ItsPkiHttp /* TITAN TODO: system ItsPkiHttpSystem */ { + function f_cfHttpDown() runs on ItsPkiHttp { if (PICS_MULTIPLE_END_POINT == false) { unmap(self:httpPort, system:httpPort); } else { @@ -338,7 +338,7 @@ module LibItsPki_Functions { /** * @desc Deletes default configuration */ - function f_cfHttpDown_ca() runs on ItsPkiHttp /* TITAN TODO: system ItsPkiHttpSystem */ { + function f_cfHttpDown_ca() runs on ItsPkiHttp { if (PICS_MULTIPLE_END_POINT == false) { unmap(self:httpPort, system:httpPort); } else { @@ -351,7 +351,7 @@ module LibItsPki_Functions { /** * @desc Deletes default configuration */ - function f_cfHttpDown_tlm() runs on ItsPkiHttp /* TITAN TODO: system ItsPkiHttpSystem */ { + function f_cfHttpDown_tlm() runs on ItsPkiHttp { if (PICS_MULTIPLE_END_POINT == false) { unmap(self:httpPort, system:httpPort); } else { @@ -364,7 +364,7 @@ module LibItsPki_Functions { /** * @desc Deletes default configuration */ - function f_cfHttpDown_itss() runs on ItsPkiHttp /* TITAN TODO: system ItsPkiHttpSystem */ { + function f_cfHttpDown_itss() runs on ItsPkiHttp { if (PICS_MULTIPLE_END_POINT == false) { unmap(self:httpPort, system:httpPort); } else { @@ -377,7 +377,7 @@ module LibItsPki_Functions { /** * @desc Deletes default configuration */ - function f_cfHttpDown_ea() runs on ItsPkiHttp /* TITAN TODO: system ItsPkiHttpSystem */ { + function f_cfHttpDown_ea() runs on ItsPkiHttp { if (PICS_MULTIPLE_END_POINT == false) { unmap(self:httpPort, system:httpPort); } else { @@ -390,7 +390,7 @@ module LibItsPki_Functions { /** * @desc Deletes default configuration */ - function f_cfDown_itss() runs on ItsPkiItss /* TITAN TODO: system ItsPkiItssSystem */ { + function f_cfDown_itss() runs on ItsPkiItss system ItsPkiItssSystem { unmap(self:geoNetworkingPort, system:geoNetworkingPort); unmap(self:utPort, system:utPort); //unmap(self:acPort, system:acPort); @@ -541,17 +541,20 @@ module LibItsPki_Functions { out octetstring p_public_key_compressed, out integer p_compressed_mode ) return boolean { + log(">>> f_generate_key_pair: PX_VE_ALG=", PX_VE_ALG); + if (PX_VE_ALG == e_nist_p256) { f_generate_key_pair_nistp256(p_private_key, p_public_key_x, p_public_key_y, p_public_key_compressed, p_compressed_mode); } else if (PX_VE_ALG == e_brainpool_p256_r1) { - f_generate_key_pair_brainpoolp256(p_private_key, p_public_key_x, p_public_key_y, p_public_key_compressed, p_compressed_mode); + f_generate_key_pair_brainpoolp256r1(p_private_key, p_public_key_x, p_public_key_y, p_public_key_compressed, p_compressed_mode); } else if (PX_VE_ALG == e_brainpool_p384_r1) { - f_generate_key_pair_brainpoolp384(p_private_key, p_public_key_x, p_public_key_y, p_public_key_compressed, p_compressed_mode); + f_generate_key_pair_brainpoolp384r1(p_private_key, p_public_key_x, p_public_key_y, p_public_key_compressed, p_compressed_mode); } else { // error return false; } + log("<<< f_generate_key_pair: p_compressed_mode=", p_compressed_mode); return true; } @@ -566,7 +569,7 @@ module LibItsPki_Functions { if (p_algorithm == e_nist_p256) { f_generate_key_pair_nistp256(p_private_key, p_public_key_x, p_public_key_y, p_public_key_compressed, p_compressed_mode); } else if (p_algorithm == e_brainpool_p256_r1) { - f_generate_key_pair_brainpoolp256(p_private_key, p_public_key_x, p_public_key_y, p_public_key_compressed, p_compressed_mode); + f_generate_key_pair_brainpoolp256r1(p_private_key, p_public_key_x, p_public_key_y, p_public_key_compressed, p_compressed_mode); } else { // error return false; @@ -580,6 +583,11 @@ module LibItsPki_Functions { in octetstring p_certificateIssuer, in octetstring p_privateKey ) return octetstring { + log(">>> f_verifyEcdsa: p_toBeSignedSecuredMessage= ", p_toBeSignedSecuredMessage); + log(">>> f_verifyEcdsa: p_certificateIssuer= ", p_certificateIssuer); + log(">>> f_verifyEcdsa: p_privateKey= ", p_privateKey); + log(">>> f_verifyEcdsa: PX_VE_ALG= ", PX_VE_ALG); + if (PX_VE_ALG == e_nist_p256) { return f_signWithEcdsaNistp256WithSha256(p_toBeSignedSecuredMessage, p_certificateIssuer, p_privateKey); } else if (PX_VE_ALG == e_brainpool_p256_r1) { @@ -835,20 +843,16 @@ module LibItsPki_Functions { log("*** f_http_build_inner_ec_request: ERROR: Non canonical EA certificate ***"); f_selfOrClientSyncAndVerdict("error", e_error); } - if (PICS_SEC_FIXED_KEYS) { // Debug mode: Use fixed values - v_public_enc_key := 'DD4F6B0DF57C6E3BD0E32B565CACA1D858CEB08A5C2BBAB2C23E203C6DE697FF'O; - v_compressed_enc_key_mode := 0; - } log("f_http_build_inner_ec_request: Public encryption key: ", v_public_enc_key); log("f_http_build_inner_ec_request: Public encryption key comp: ", v_compressed_enc_key_mode); p_salt := vc_eaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. if (PICS_SECPKI_REENROLMENT == false) { // This is the first enrolment, we used Factory keys - v_result := f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); + v_result := f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } else { // We use last valid EC certificate // TODO Retrieve EC certificate from the first enrolment instead of PX log("f_http_build_inner_ec_request: v_ec_private_key: ", PX_EC_PRIVATE_KEY); log("f_http_build_inner_ec_request: v_ec_hashed_id8: ", PX_EC_HASHED_ID8); - v_result := f_build_pki_secured_request_message_signed_with_pop(PX_EC_PRIVATE_KEY, valueof(m_signerIdentifier_digest(PX_EC_HASHED_ID8)), PX_EC_HASHED_ID8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); + v_result := f_build_pki_secured_request_message_signed_with_pop(PX_EC_PRIVATE_KEY, valueof(m_signerIdentifier_digest(PX_EC_HASHED_ID8)), PX_EC_HASHED_ID8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } if (v_result == false) { log("*** f_http_build_inner_ec_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); @@ -895,27 +899,23 @@ module LibItsPki_Functions { log("*** f_http_build_inner_ec_request_with_wrong_parameters: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); f_selfOrClientSyncAndVerdict("error", e_error); } - log("f_http_build_enrolment_request: v_inner_ec_request_signed_for_pop= ", v_inner_ec_request_signed_for_pop); + log("f_http_build_inner_ec_request_with_wrong_parameters: v_inner_ec_request_signed_for_pop= ", v_inner_ec_request_signed_for_pop); // Secure InnerEcRequestSignedForPoP message if (f_extract_enc_key(vc_eaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { log("*** f_http_build_inner_ec_request_with_wrong_parameters: ERROR: Non canonical EA certificate ***"); f_selfOrClientSyncAndVerdict("error", e_error); } - if (PICS_SEC_FIXED_KEYS) { // Debug mode: Use fixed values - v_public_enc_key := 'DD4F6B0DF57C6E3BD0E32B565CACA1D858CEB08A5C2BBAB2C23E203C6DE697FF'O; - v_compressed_enc_key_mode := 0; - } log("f_http_build_inner_ec_request_with_wrong_parameters: Public encryption key: ", v_public_enc_key); log("f_http_build_inner_ec_request_with_wrong_parameters: Public encryption key comp: ", v_compressed_enc_key_mode); p_salt := vc_eaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. if (PICS_SECPKI_REENROLMENT == false) { // This is the first enrolment, we used Factory keys - v_result := f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); + v_result := f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } else { // We use last valid EC certificate // TODO Retrieve EC certificate from the first enrolment instead of PX log("f_http_build_inner_ec_request_with_wrong_parameters: v_ec_private_key: ", PX_EC_PRIVATE_KEY); log("f_http_build_inner_ec_request_with_wrong_parameters: v_ec_hashed_id8: ", PX_EC_HASHED_ID8); - v_result := f_build_pki_secured_request_message_signed_with_pop(PX_EC_PRIVATE_KEY, valueof(m_signerIdentifier_digest(PX_EC_HASHED_ID8)), PX_EC_HASHED_ID8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); + v_result := f_build_pki_secured_request_message_signed_with_pop(PX_EC_PRIVATE_KEY, valueof(m_signerIdentifier_digest(PX_EC_HASHED_ID8)), PX_EC_HASHED_ID8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } if (v_result == false) { log("*** f_http_build_inner_ec_request_with_wrong_parameters: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); @@ -975,12 +975,12 @@ module LibItsPki_Functions { log("*** f_http_build_invalid_enrolment_request: Public encryption key comp: ", v_compressed_enc_key_mode); p_salt := vc_eaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. if (PICS_SECPKI_REENROLMENT == false) { // This is the first enrolment, we used Factory keys - v_ret_code := f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); + v_ret_code := f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } else { // We use last valid EC certificate // TODO Retrieve EC certificate from the first enrolment instead of PX log("f_http_build_inner_ec_request: v_ec_private_key: ", PX_EC_PRIVATE_KEY); log("f_http_build_inner_ec_request: v_ec_hashed_id8: ", PX_EC_HASHED_ID8); - v_ret_code := f_build_pki_secured_request_message_signed_with_pop(PX_EC_PRIVATE_KEY, valueof(m_signerIdentifier_digest(PX_EC_HASHED_ID8)), PX_EC_HASHED_ID8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); + v_ret_code := f_build_pki_secured_request_message_signed_with_pop(PX_EC_PRIVATE_KEY, valueof(m_signerIdentifier_digest(PX_EC_HASHED_ID8)), PX_EC_HASHED_ID8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } if (v_ret_code == false) { log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); @@ -990,7 +990,7 @@ module LibItsPki_Functions { } // End of function f_http_build_invalid_enrolment_request function f_http_build_inner_ec_response( - in InnerEcRequest p_inner_ec_request, + in template (omit) InnerEcRequest p_inner_ec_request := omit, in EnrolmentResponseCode p_responseCode := ok, in Oct16 p_request_hash, in octetstring p_private_key := ''O, @@ -1111,10 +1111,6 @@ module LibItsPki_Functions { log("*** f_http_build_authorization_request: ERROR: Non canonical AA certificate ***"); f_selfOrClientSyncAndVerdict("error", e_error); } - if (PICS_SEC_FIXED_KEYS) { // Debug mode: Use fixed values - v_public_enc_key := 'DD4F6B0DF57C6E3BD0E32B565CACA1D858CEB08A5C2BBAB2C23E203C6DE697FF'O; - v_compressed_enc_key_mode := 0; - } log("*** f_http_build_authorization_request: Public encryption key: ", v_public_enc_key); log("*** f_http_build_authorization_request: Public encryption key comp: ", v_compressed_enc_key_mode); p_salt := vc_aaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. @@ -1180,10 +1176,6 @@ module LibItsPki_Functions { log("*** f_http_build_authorization_request_with_wrong_private_key: ERROR: Non canonical EA certificate ***"); f_selfOrClientSyncAndVerdict("error", e_error); } - if (PICS_SEC_FIXED_KEYS) { // Debug mode: Use fixed values - v_public_enc_key := 'DD4F6B0DF57C6E3BD0E32B565CACA1D858CEB08A5C2BBAB2C23E203C6DE697FF'O; - v_compressed_enc_key_mode := 0; - } log("*** f_http_build_authorization_request_with_wrong_private_key: Public encryption key: ", v_public_enc_key); log("*** f_http_build_authorization_request_with_wrong_private_key: Public encryption key comp: ", v_compressed_enc_key_mode); p_salt := vc_aaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. @@ -1265,10 +1257,6 @@ module LibItsPki_Functions { log("*** f_http_build_authorization_request_with_wrong_parameters: ERROR: Non canonical AA certificate ***"); f_selfOrClientSyncAndVerdict("error", e_error); } - if (PICS_SEC_FIXED_KEYS) { // Debug mode: Use fixed values - v_public_enc_key := 'DD4F6B0DF57C6E3BD0E32B565CACA1D858CEB08A5C2BBAB2C23E203C6DE697FF'O; - v_compressed_enc_key_mode := 0; - } log("*** f_http_build_authorization_request_with_wrong_parameters: Public encryption key: ", v_public_enc_key); log("*** f_http_build_authorization_request_with_wrong_parameters: Public encryption key comp: ", v_compressed_enc_key_mode); p_salt := vc_aaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. @@ -1307,7 +1295,7 @@ module LibItsPki_Functions { } // End of function f_http_build_authorization_request_with_wrong_parameters function f_http_build_authorization_response( - in InnerAtRequest p_inner_at_request, + in template (omit) InnerAtRequest p_inner_at_request := omit, in AuthorizationResponseCode p_responseCode := ok, in Oct16 p_request_hash, in octetstring p_private_key := ''O, @@ -1342,7 +1330,7 @@ module LibItsPki_Functions { p_result := true; } else { // Generate the certificate - if (f_generate_at_certificate_for_inner_at_response(p_inner_at_request, p_private_key, p_digest, v_at_certificate) == false) { + if (f_generate_at_certificate_for_inner_at_response(valueof(p_inner_at_request), p_private_key, p_digest, v_at_certificate) == false) { log("f_http_build_authorization_response: Failed to generate the certificate"); p_inner_at_response := valueof( m_innerAtResponse_ko( @@ -1420,10 +1408,6 @@ module LibItsPki_Functions { log("f_http_build_authorization_validation_request: Non canonical EA certificate"); f_selfOrClientSyncAndVerdict("error", e_error); } - if (PICS_SEC_FIXED_KEYS) { // Debug mode: Use fixed values - v_public_enc_key := 'DD4F6B0DF57C6E3BD0E32B565CACA1D858CEB08A5C2BBAB2C23E203C6DE697FF'O; - v_compressed_enc_key_mode := 0; - } log("f_http_build_authorization_validation_request: Public encryption key: ", v_public_enc_key); log("f_http_build_authorization_validation_request: Public encryption key comp: ", v_compressed_enc_key_mode); p_salt := vc_eaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. @@ -1469,10 +1453,6 @@ module LibItsPki_Functions { log("f_http_build_invalid_authorization_validation_request: Non canonical EA certificate"); f_selfOrClientSyncAndVerdict("error", e_error); } - if (PICS_SEC_FIXED_KEYS) { // Debug mode: Use fixed values - v_public_enc_key := 'DD4F6B0DF57C6E3BD0E32B565CACA1D858CEB08A5C2BBAB2C23E203C6DE697FF'O; - v_compressed_enc_key_mode := 0; - } log("f_http_build_invalid_authorization_validation_request: Public encryption key: ", v_public_enc_key); log("f_http_build_invalid_authorization_validation_request: Public encryption key comp: ", v_compressed_enc_key_mode); p_salt := vc_eaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. @@ -1580,6 +1560,8 @@ module LibItsPki_Functions { var PublicVerificationKey v_public_verification_key; log(">>> f_generate_ec_certificate"); + log("f_generate_ec_certificate: PX_EC_ALG_FOR_EC=", PX_EC_ALG_FOR_EC); + log("f_generate_ec_certificate: PX_VE_ALG=", PX_VE_ALG); // Generate verification keys for the certificate if (f_generate_key_pair(p_private_key, v_public_key_x, v_public_key_y, p_public_key_compressed, p_compressed_mode) == false) { @@ -1666,7 +1648,8 @@ module LibItsPki_Functions { var bitstring v_tbs; var octetstring v_sig; - log(">>> f_generate_ec_certificate_for_inner_ec_response"); + log(">>> f_generate_ec_certificate_for_inner_ec_response: p_inner_ec_request", p_inner_ec_request); + log(">>> f_generate_ec_certificate_for_inner_ec_response: p_digest", p_digest); v_issuer := valueof(m_issuerIdentifier_sha256AndDigest(f_hashedId8FromSha256(p_digest))); // TODO Check sha256/384 f_hashedId8FromSha384 v_cert := valueof( @@ -1760,6 +1743,7 @@ module LibItsPki_Functions { v_tbs := encvalue(v_cert.toBeSigned); // Sign the certificate v_sig := f_signWithEcdsa(bit2oct(v_tbs), p_digest, p_private_key); + log("f_generate_at_certificate_for_inner_at_response: PX_VE_ALG=", PX_VE_ALG); if (PX_VE_ALG == e_nist_p256) { v_cert.signature_ := valueof( m_signature_ecdsaNistP256( @@ -1890,6 +1874,8 @@ module LibItsPki_Functions { var PublicVerificationKey v_public_verification_key; log (">>> f_generate_inner_ec_request"); + log("f_generate_inner_ec_request: PX_VE_ALG=", PX_VE_ALG); + // Generate keys for the certificate to be requested if (f_generate_key_pair(p_private_key, v_public_key_x, v_public_key_y, p_public_key_compressed, p_compressed_mode) == false) { log ("f_generate_inner_ec_request: failed to generate keys"); @@ -1927,7 +1913,8 @@ module LibItsPki_Functions { m_publicKeys( v_public_verification_key ), - m_certificateSubjectAttributes_id_none/*FIXME No name*/( + m_certificateSubjectAttributes_id_omit/*FIXME No name*/( + /*oct2char(PICS_ITS_S_CANONICAL_ID),*/ { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs valueof(m_appPermissions(c_its_aid_SCR, { bitmapSsp := PX_INNER_EC_CERTFICATE_BITMAP_SSP_SCR })) }, @@ -1991,6 +1978,7 @@ module LibItsPki_Functions { } } // Build the Proof of Possession InnerEcRequest + log("f_generate_inner_ec_request_with_wrong_parameters: PX_VE_ALG=", PX_VE_ALG); if (PX_VE_ALG == e_nist_p256) { var EccP256CurvePoint v_eccP256_curve_point; if (v_compressed_mode == 0) { @@ -2061,6 +2049,7 @@ module LibItsPki_Functions { var Signature v_signature; // Encode it + log("f_generate_inner_ec_request_signed_for_pop: encode ", p_inner_ec_request); v_encoded_inner_ec_request := bit2oct(encvalue(p_inner_ec_request)); // Signed the encoded InnerEcRequestSignedForPop v_tbs := m_toBeSignedData( @@ -2075,7 +2064,9 @@ module LibItsPki_Functions { ) ); // Signed the encoded InnerEcRequestSignedForPop - v_tbs_signed := f_signWithEcdsa(bit2oct(encvalue(v_tbs)), int2oct(0, 32), p_private_key); + log("f_generate_inner_ec_request_signed_for_pop: tbs= ", v_tbs); + log("f_generate_inner_ec_request_signed_for_pop: tbs= ", bit2oct(encvalue(v_tbs, "", "LibItsSecurity_asn1"))); + v_tbs_signed := f_signWithEcdsa(bit2oct(encvalue(v_tbs)), int2oct(0, 32), p_private_key); // Finalyse signed InnerEcRequestSignedForPop if (PX_VE_ALG == e_nist_p256) { v_signature := valueof( @@ -2390,7 +2381,7 @@ module LibItsPki_Functions { log("f_generate_inner_at_request: Wrong NistP256 encryption variant"); return false; } - v_enc_signed_ec_signature := f_encryptWithEciesNistp256WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); + v_enc_signed_ec_signature := f_encryptWithEciesNistp256WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce); if (v_public_compressed_ephemeral_mode == 0) { v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); } else { @@ -2414,7 +2405,7 @@ module LibItsPki_Functions { log("f_generate_inner_at_request: Wrong BrainpoolP256r1 encryption variant"); return false; } - v_enc_signed_ec_signature := f_encryptWithEciesBrainpoolp256WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); + v_enc_signed_ec_signature := f_encryptWithEciesBrainpoolp256WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce); if (v_public_compressed_ephemeral_mode == 0) { v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); } else { @@ -2776,7 +2767,7 @@ module LibItsPki_Functions { log("f_generate_inner_at_request_with_wrong_parameters: Wrong NistP256 encryption variant"); return false; } - v_enc_signed_ec_signature := f_encryptWithEciesNistp256WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); + v_enc_signed_ec_signature := f_encryptWithEciesNistp256WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce); if (v_public_compressed_ephemeral_mode == 0) { v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); } else { @@ -2800,7 +2791,7 @@ module LibItsPki_Functions { log("f_generate_inner_at_request_with_wrong_parameters: Wrong BrainpoolP256r1 encryption variant"); return false; } - v_enc_signed_ec_signature := f_encryptWithEciesBrainpoolp256WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, PICS_SEC_FIXED_KEYS); + v_enc_signed_ec_signature := f_encryptWithEciesBrainpoolp256WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce); if (v_public_compressed_ephemeral_mode == 0) { v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); } else { @@ -2904,24 +2895,21 @@ module LibItsPki_Functions { function f_verify_inner_at_request_signed_for_pop( in EtsiTs102941Data p_etsi_ts_102941_data, + in EtsiTs103097Certificate p_ec_certificate, out InnerAtRequest p_inner_at_request ) return boolean { var bitstring v_msg_bit; - log(">>> f_verify_inner_at_request_signed_for_pop: ", p_etsi_ts_102941_data); + log(">>> f_verify_inner_at_request_signed_for_pop: p_etsi_ts_102941_data=", p_etsi_ts_102941_data); + log(">>> f_verify_inner_at_request_signed_for_pop: p_ec_certificate=", p_ec_certificate); - // 1. Decode content - v_msg_bit := oct2bit(p_etsi_ts_102941_data.content.enrolmentRequest.content.signedData.tbsData.payload.data.content.unsecuredData); - if (decvalue(v_msg_bit, p_inner_at_request) != 0) { - log("f_verify_inner_at_request_signed_for_pop: Failed to decode InnerEcRequest"); - return false; - } else { - log("f_verify_inner_at_request_signed_for_pop: v_inner_at_request= ", p_inner_at_request); + // 1. Extract content + p_inner_at_request := p_etsi_ts_102941_data.content.authorizationRequest; // 2. Verify the InnerEcRequestSignedForPop signature // TODO - } + log("<<< f_verify_inner_at_request_signed_for_pop: ", p_inner_at_request); return true; } // End of function f_verify_inner_at_request_signed_for_pop @@ -3171,7 +3159,6 @@ module LibItsPki_Functions { return false; } else { // TODO Verify selsigned certificate - return false; } } else { return false; @@ -3386,6 +3373,7 @@ module LibItsPki_Functions { log(">>> f_build_pki_secured_request_message_signed_with_pop: p_signer_identifier= ", p_signer_identifier); log(">>> f_build_pki_secured_request_message_signed_with_pop: p_recipientId= ", p_recipientId); log(">>> f_build_pki_secured_request_message_signed_with_pop: p_public_key_compressed= ", p_public_key_compressed); + log(">>> f_build_pki_secured_request_message_signed_with_pop: p_compressed_mode= ", p_compressed_mode); log(">>> f_build_pki_secured_request_message_signed_with_pop: p_salt= ", p_salt); log(">>> f_build_pki_secured_request_message_signed_with_pop: p_pki_message= ", p_pki_message); log(">>> f_build_pki_secured_request_message_signed_with_pop: p_enc_algorithm= ", p_enc_algorithm); @@ -3398,7 +3386,7 @@ module LibItsPki_Functions { ), m_headerInfo_inner_pki_request(-, (f_getCurrentTime() * 1000)/*us*/) ); - log("f_build_pki_secured_request_message_signed_with_pop: signer: ", p_signer_identifier); + log("f_build_pki_secured_request_message_signed_with_pop: v_tbs: ", v_tbs); if (ischosen(p_signer_identifier.self_)) { v_tbs_signed := f_signWithEcdsa(bit2oct(encvalue(v_tbs)), int2oct(0, 32), p_private_key); } else { @@ -3416,6 +3404,7 @@ module LibItsPki_Functions { log("f_build_pki_secured_request_message_signed_with_pop: Altered signature= ", v_tbs_signed); } // Add the signature and create EtsiTs103097Data-Signed data structure + log("f_build_pki_secured_request_message_signed_with_pop: PX_VE_ALG=", PX_VE_ALG); if (PX_VE_ALG == e_nist_p256) { v_signature := valueof( m_signature_ecdsaNistP256( @@ -3461,15 +3450,13 @@ module LibItsPki_Functions { ); // Encode EtsiTs103097Data-Signed data structure v_encoded_request := bit2oct(encvalue(v_ieee1609dot2_signed_data)); + log("f_build_pki_secured_request_message_signed_with_pop: v_encoded_request= ", v_encoded_request); // Encrypt encode EtsiTs103097Data-Signed data structure - if (PICS_SEC_FIXED_KEYS) { - p_salt := '77C0637C3558B3238FDE1EEC376DA080BE4076FB8491CA0F8C19FD34DF298CEB'O; - } if (p_enc_algorithm == e_nist_p256) { - v_encrypted_request := f_encryptWithEciesNistp256WithSha256(v_encoded_request, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, PICS_SEC_FIXED_KEYS); + v_encrypted_request := f_encryptWithEciesNistp256WithSha256(v_encoded_request, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); } else if (p_enc_algorithm == e_brainpool_p256_r1) { - v_encrypted_request := f_encryptWithEciesBrainpoolp256WithSha256(v_encoded_request, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, PICS_SEC_FIXED_KEYS); + v_encrypted_request := f_encryptWithEciesBrainpoolp256WithSha256(v_encoded_request, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); } else { log("f_build_pki_secured_request_message_signed_with_pop: Wrong encryption variant"); return false; @@ -3535,11 +3522,7 @@ module LibItsPki_Functions { // The 'p_request_hash' shall be the SHA256 digest of the OER representation of the topmost EtsiTs103097Data-Encoded structure v_enc_value := encvalue(p_ieee1609dot2_signed_and_encrypted_data); - if (PICS_SEC_FIXED_KEYS) { - p_request_hash := '10ED97A2F2933DD3AC55F47022D125E18F5E1AA024613E616A75BA4979EFE318'O; - } else { - p_request_hash := f_hashWithSha256(bit2oct(v_enc_value)); - } + p_request_hash := f_hashWithSha256(bit2oct(v_enc_value)); log("f_build_pki_secured_request_message_signed_with_pop: p_request_hash= ", p_request_hash); log("<<< f_build_pki_secured_request_message_signed_with_pop: ", p_pki_message); @@ -3582,13 +3565,10 @@ module LibItsPki_Functions { log(">>> f_build_pki_secured_request_message"); // Encrypt encode EtsiTs103097Data-Signed data structure - if (PICS_SEC_FIXED_KEYS) { - p_salt := '77C0637C3558B3238FDE1EEC376DA080BE4076FB8491CA0F8C19FD34DF298CEB'O; - } if (p_enc_algorithm == e_nist_p256) { - v_encrypted_request := f_encryptWithEciesNistp256WithSha256(p_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, PICS_SEC_FIXED_KEYS); + v_encrypted_request := f_encryptWithEciesNistp256WithSha256(p_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); } else if (p_enc_algorithm == e_brainpool_p256_r1) { - v_encrypted_request := f_encryptWithEciesBrainpoolp256WithSha256(p_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, PICS_SEC_FIXED_KEYS); + v_encrypted_request := f_encryptWithEciesBrainpoolp256WithSha256(p_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); } else { log("f_build_pki_secured_request_message: Wrong encryption variant"); return false; @@ -3650,11 +3630,7 @@ module LibItsPki_Functions { // The 'p_request_hash' shall be the SHA256 digest of the OER representation of the topmost EtsiTs103097Data-Encoded structure v_enc_value := encvalue(p_ieee1609dot2_signed_and_encrypted_data); - if (PICS_SEC_FIXED_KEYS) { - p_request_hash := '10ED97A2F2933DD3AC55F47022D125E18F5E1AA024613E616A75BA4979EFE318'O; - } else { - p_request_hash := f_hashWithSha256(bit2oct(v_enc_value)); - } + p_request_hash := f_hashWithSha256(bit2oct(v_enc_value)); log("f_build_pki_secured_request_message: p_request_hash= ", p_request_hash); log("<<< f_build_pki_secured_request_message: ", p_ieee1609dot2_signed_and_encrypted_data); @@ -3693,13 +3669,10 @@ module LibItsPki_Functions { v_pki_message := bit2oct(encvalue(v_unsecured_data)); // Encrypt encode EtsiTs103097Data-Signed data structure - if (PICS_SEC_FIXED_KEYS) { - p_salt := '77C0637C3558B3238FDE1EEC376DA080BE4076FB8491CA0F8C19FD34DF298CEB'O; - } if (p_enc_algorithm == e_nist_p256) { - v_encrypted_request := f_encryptWithEciesNistp256WithSha256(v_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, PICS_SEC_FIXED_KEYS); + v_encrypted_request := f_encryptWithEciesNistp256WithSha256(v_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); } else if (p_enc_algorithm == e_brainpool_p256_r1) { - v_encrypted_request := f_encryptWithEciesBrainpoolp256WithSha256(v_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, PICS_SEC_FIXED_KEYS); + v_encrypted_request := f_encryptWithEciesBrainpoolp256WithSha256(v_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); } else { log("f_build_pki_secured_request_message_for_authorization: Wrong encryption variant"); return false; @@ -3761,11 +3734,7 @@ module LibItsPki_Functions { // The 'p_request_hash' shall be the SHA256 digest of the OER representation of the topmost EtsiTs103097Data-Encoded structure v_enc_value := encvalue(p_ieee1609dot2_signed_and_encrypted_data); - if (PICS_SEC_FIXED_KEYS) { - p_request_hash := '10ED97A2F2933DD3AC55F47022D125E18F5E1AA024613E616A75BA4979EFE318'O; - } else { - p_request_hash := f_hashWithSha256(bit2oct(v_enc_value)); - } + p_request_hash := f_hashWithSha256(bit2oct(v_enc_value)); log("f_build_pki_secured_request_message_for_authorization: p_request_hash= ", p_request_hash); log("<<< f_build_pki_secured_request_message_for_authorization: ", p_ieee1609dot2_signed_and_encrypted_data); @@ -3811,7 +3780,7 @@ module LibItsPki_Functions { v_tbs_signed := f_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), int2oct(0, 32), p_private_key); } else { var charstring v_certificate_id; - var octetstring v_hash; + var Oct32 v_hash; fx_readCertificateFromDigest(p_signer_identifier.digest, v_certificate_id); // TODO Add a wrapper function f_getCertificateHash(v_certificate_id, v_hash); v_tbs_signed := f_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), v_hash, p_private_key); @@ -3892,6 +3861,7 @@ module LibItsPki_Functions { log(">>> f_verify_pki_request_message: p_private_enc_key= ", p_private_enc_key); log(">>> f_verify_pki_request_message: p_salt= ", p_salt); log(">>> f_verify_pki_request_message: p_issuer= ", p_issuer); + log(">>> f_verify_pki_request_message: p_ieee1609dot2_encrypted_and_signed_data= ", p_ieee1609dot2_encrypted_and_signed_data); // 1. Calculate the request Hash v_msg := bit2oct(encvalue(p_ieee1609dot2_encrypted_and_signed_data)); @@ -3931,9 +3901,12 @@ module LibItsPki_Functions { // 4. Verifiy signature log("f_verify_pki_request_message: v_ieee1609dot2_signed_data.content.signedData.tbsData= ", v_ieee1609dot2_signed_data.content.signedData.tbsData); v_msg := bit2oct(encvalue(v_ieee1609dot2_signed_data.content.signedData.tbsData)); + log("f_verify_pki_request_message: v_msg= ", v_msg); if (p_issuer == ''O) { // self log("f_verify_pki_request_message: Issuer is self, check outer signature using IUT public key (PICS_ITS_S_SIGN_xxx_PUBLIC_KEY)"); var PublicVerificationKey v_verification_key; + + log("f_verify_pki_request_message: PX_VE_ALG=", PX_VE_ALG); if (PX_VE_ALG == e_nist_p256) { if (PICS_ITS_S_SIGN_NISTP256_PUBLIC_KEY[0] == '02'O) { v_verification_key.ecdsaNistP256.compressed_y_0 := substr(PICS_ITS_S_SIGN_NISTP256_PUBLIC_KEY, 1, 32); @@ -3954,7 +3927,7 @@ module LibItsPki_Functions { } } log("f_verify_pki_request_message: v_verification_key=", v_verification_key); - if (f_verifyEcdsa(v_msg, p_issuer, v_ieee1609dot2_signed_data.content.signedData.signature_, v_verification_key) == false) { + if (f_verifyEcdsa(v_msg, int2oct(0, 32), v_ieee1609dot2_signed_data.content.signedData.signature_, v_verification_key) == false) { if (p_check_security == true) { return false; } diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn index 41b13d41..5869bcb1 100644 --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ b/ttcn/Pki/LibItsPki_Templates.ttcn @@ -1,6 +1,6 @@ /** * @author ETSI / STF545 - * @version $URL$ + * @version $Url$ * $Id$ * @desc Module containing templates for IT PKI Protocol * @copyright ETSI Copyright Notification diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index bf8f0f3b..d1c0f699 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -1,6 +1,6 @@ /** * @author ETSI / STF545 - * @version $URL$ + * @version $Url$ * $Id$ * @desc Test System module for ITS PKI * @copyright ETSI Copyright Notification @@ -67,6 +67,11 @@ module LibItsPki_TestSystem { port HttpPort httpTlmPort; /** TLM ECTL end point */ } // End of component ItsPkiHttpSystem + type component ItsPkiItssSystem extends ItsPkiHttpSystem { + port UpperTesterPkiPort utPort; + port GeoNetworkingPort geoNetworkingPort; + } // End of component ItsPkiItssSystem + /** * @desc Test component for PKI entities execpt ITS-S */ diff --git a/ttcn/Pki/LibItsPki_TypesAndValues.ttcn b/ttcn/Pki/LibItsPki_TypesAndValues.ttcn index e09985cf..6e634fc6 100644 --- a/ttcn/Pki/LibItsPki_TypesAndValues.ttcn +++ b/ttcn/Pki/LibItsPki_TypesAndValues.ttcn @@ -1,6 +1,6 @@ /** * @author ETSI / STF545 - * @version $URL$ + * @version $Url$ * $Id$ * @desc Module containing templates for IT PKI Protocol * @copyright ETSI Copyright Notification diff --git a/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn b/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn index 96d5e5af..7a007672 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn $ + * $Id: LibItsSremSsem_Functions.ttcn,v 1.2 2018/05/31 15:57:11 dte Exp $ * @desc Module containing common functions for ITS SREMM SSEM * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. @@ -41,6 +41,9 @@ module LibItsSremSsem_Functions { */ function f_utInitializeIut(template (value) UtSremInitialize p_init) runs on ItsSremSsem { + //deactivate sremSsemPort default alts + vc_sremSsemDefaultActive := false; + utPort.send(p_init); tc_wait.start; alt { @@ -52,11 +55,10 @@ module LibItsSremSsem_Functions { log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); f_selfOrClientSyncAndVerdict("error", e_timeout); } - [else] { // Shortcut defaults - //f_sleep(0.050); // 50 ms - repeat; - } } + + //deactivate sremSsemPort default alts + vc_sremSsemDefaultActive := true; } /** @@ -67,6 +69,9 @@ module LibItsSremSsem_Functions { in template (value) UtSremTrigger p_event ) runs on ItsSremSsem { + //deactivate sremSsemPort default alts + vc_sremSsemDefaultActive := false; + utPort.send ( p_event ); tc_wait.start; alt { @@ -112,12 +117,11 @@ module LibItsSremSsem_Functions { log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); f_selfOrClientSyncAndVerdict("error", e_timeout); } - [else] { // Shortcut defaults - //f_sleep(0.050); // 50 ms - repeat; - } } + //activate sremSsemPort default alts + vc_sremSsemDefaultActive := true; + return; } @@ -129,12 +133,12 @@ module LibItsSremSsem_Functions { * @desc Initialise secure mode if required */ function f_initialiseSecuredMode( - in charstring p_certificate_id := PX_CERT_FOR_TS + in charstring p_certificateId := PX_CERT_FOR_TS ) runs on ItsSremSsem { if (PICS_IS_IUT_SECURED == true) { - if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificate_id))) { + if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificateId))) { log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); stop; } @@ -198,17 +202,17 @@ module LibItsSremSsem_Functions { * @desc The base default. */ altstep a_default() runs on ItsSremSsem { - [] sremSsemPort.receive(mw_sremInd(mw_sremPdu(mw_defaultSrem))) { + [vc_sremSsemDefaultActive] sremSsemPort.receive(mw_sremInd(mw_sremPdu(mw_defaultSrem))) { log("*** " & testcasename() & ": INFO: SREMM received in default ***"); vc_sremReceived := true; repeat; } - [] sremSsemPort.receive(mw_ssemInd(mw_ssemPdu(mw_defaultSsem))) { + [vc_sremSsemDefaultActive] sremSsemPort.receive(mw_ssemInd(mw_ssemPdu(mw_defaultSsem))) { log("*** " & testcasename() & ": INFO: SREMM received in default ***"); vc_ssemReceived := true; repeat; } - [] sremSsemPort.receive { + [vc_sremSsemDefaultActive] sremSsemPort.receive { log("*** " & testcasename() & ": ERROR: Received an unexpected message ***"); f_selfOrClientSyncAndVerdict("error", e_error); } @@ -252,11 +256,11 @@ module LibItsSremSsem_Functions { /** * @desc Setups default configuration - * @param p_certificate_id The certificate identifier the TA shall use in case of secured IUT + * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT */ function f_cfUp( - in charstring p_certificate_id := PX_CERT_FOR_TS - ) runs on ItsSremSsem /* TITAN TODO: system ItsSremSsemSystem */ { + in charstring p_certificateId := PX_CERT_FOR_TS + ) runs on ItsSremSsem system ItsSremSsemSystem { map(self:acPort, system:acPort); map(self:utPort, system:utPort); @@ -267,7 +271,7 @@ module LibItsSremSsem_Functions { activate(a_cf01Down()); // Initialise secured mode - f_initialiseSecuredMode(p_certificate_id); + f_initialiseSecuredMode(p_certificateId); //Initialze the IUT f_prInitialState(); @@ -277,7 +281,7 @@ module LibItsSremSsem_Functions { /** * @desc Deletes default configuration */ - function f_cfDown() runs on ItsSremSsem /* TITAN TODO: system ItsSremSsemSystem */ { + function f_cfDown() runs on ItsSremSsem system ItsSremSsemSystem { // Initialise secured mode f_uninitialiseSecuredMode(); diff --git a/ttcn/SremSsem/LibItsSremSsem_Pics.ttcn b/ttcn/SremSsem/LibItsSremSsem_Pics.ttcn index fe53f6e4..8d9e91e0 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Pics.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Pics.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/SremSsem/LibItsSremSsem_Pics.ttcn $ + * $Id: LibItsSremSsem_Pics.ttcn 1312 2016-12-14 09:21:45Z garciay $ * @desc SREM SSEM PICS * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. diff --git a/ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn b/ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn index ea68b865..00f03ddf 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn $ + * $Id: LibItsSremSsem_Pixits.ttcn 1315 2016-12-15 13:25:41Z garciay $ * @desc MAPEM SPATEM PIXIT * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. diff --git a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn index 72e3d5f9..c32c4e69 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn $ + * $Id: LibItsSremSsem_Templates.ttcn 1312 2016-12-14 09:21:45Z garciay $ * @desc Module containing base template definitions for SREM SSEM * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. @@ -93,12 +93,10 @@ module LibItsSremSsem_Templates { * @param p_btpDestinationPort BTP destination port value * @param p_btpInfo BTP destination port info value (if BTP-B) or BTP source port value (if BTP-A) */ -//FIXME RGY template should be (present), no omit is assigned to it as a whole; Titan currently requires that the modified templte has at least the same restirction as the base -// template SremInd mw_sremIndWithBtpParameters( - template(present) SremInd mw_sremIndWithBtpParameters( - template (present) SREM p_sremMsg, - in template UInt16 p_btpDestinationPort := *, - in template UInt16 p_btpInfo := * + template (present) SremInd mw_sremIndWithBtpParameters( + template (present) SREM p_sremMsg, + template UInt16 p_btpDestinationPort := *, + template UInt16 p_btpInfo := * ) modifies mw_sremInd := { btpDestinationPort := p_btpDestinationPort, btpInfo := p_btpInfo @@ -178,12 +176,10 @@ module LibItsSremSsem_Templates { * @param p_btpDestinationPort BTP destination port value * @param p_btpInfo BTP destination port info value (if BTP-B) or BTP source port value (if BTP-A) */ -//FIXME RGY template should be (present), no omit is assigned to it as a whole; Titan currently requires that the modified templte has at least the same restirction as the base -// template SsemInd mw_ssemIndWithBtpParameters( template(present) SsemInd mw_ssemIndWithBtpParameters( - template (present) SSEM p_ssemMsg, - template UInt16 p_btpDestinationPort := *, - template UInt16 p_btpInfo := * + template (present) SSEM p_ssemMsg, + template UInt16 p_btpDestinationPort := *, + template UInt16 p_btpInfo := * ) modifies mw_ssemInd := { btpDestinationPort := p_btpDestinationPort, btpInfo := p_btpInfo diff --git a/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn b/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn index c9a512f9..829fd72e 100644 --- a/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn $ + * $Id: LibItsSremSsem_TestSystem.ttcn,v 1.2 2018/05/31 15:57:11 dte Exp $ * @desc Test System module for ITS SREM SSEM * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. @@ -96,6 +96,8 @@ module LibItsSremSsem_TestSystem { //global variables var boolean vc_sremReceived := false; var boolean vc_ssemReceived := false; + + var boolean vc_sremSsemDefaultActive := true; } // End of component ItsSremSsem group ApplPrimitives { diff --git a/ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn b/ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn index 362d12c4..e2439758 100644 --- a/ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn $ + * $Id: LibItsSremSsem_TypesAndValues.ttcn 1307 2016-12-13 07:51:14Z garciay $ * @desc Module containing types and values for SREM SSEM * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. @@ -36,9 +36,9 @@ module LibItsSremSsem_TypesAndValues { */ type record UtSremInitialize { Oct8 hashedId8 - } with { + } with { variant "FIELDORDER(msb)" - } + } /** * @desc Upper Tester results message of the Srem/Ssem IUT @@ -47,72 +47,72 @@ module LibItsSremSsem_TypesAndValues { * @member utAutoInteropTriggerResult - * @member utSremChangePositionResult - */ - type union UtSremResults { - boolean utSremInitializeResult, + type union UtSremResults { + boolean utSremInitializeResult, boolean utSremTriggerResult, boolean utSremUpdateResult } with { - variant "" + variant "" } // End of type UtSremResults - - /** - * @desc Upper Tester message to request triggering of an event at IUT - */ - type record UtSremTrigger { - BasicVehicleRole basicVehicleRole, - RequestImportanceLevel requestImportanceLevel - } with { - variant "FIELDORDER(msb)" - } - - type record of UtSremTrigger UtSremTriggerList; - - /** - * @desc Upper Tester message to request updating of an event at IUT - */ - type record UtSremUpdate { - RequestID requestID, - BasicVehicleRole basicVehicleRole, - RequestImportanceLevel requestImportanceLevel - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to check event/status at IUT - */ - type record UtSremEventInd { - SREM sreMsg - } with { - encode (sreMsg) "LibItsSremSsem_asn1" - } - - /** - * @desc Upper Tester message to check event/status at IUT - */ - type record UtSsemEventInd { - SSEM sseMsg - } with { - encode (sseMsg) "LibItsSremSsem_asn1" - } - - /** - * @desc List of Upper Tester messages to check event/status on MAPEM SPATEM IUT - */ - type record of UtSremEventInd UtSremEventIndList; - - /** - * @desc List of Upper Tester messages to check event/status on MAPEM SPATEM IUT - */ - type record of UtSsemEventInd UtSsemEventIndList; - - type record of RequestID RequestIDList; - + + /** + * @desc Upper Tester message to request triggering of an event at IUT + */ + type record UtSremTrigger { + BasicVehicleRole basicVehicleRole, + RequestImportanceLevel requestImportanceLevel + } with { + variant "FIELDORDER(msb)" + } + + type record of UtSremTrigger UtSremTriggerList; + + /** + * @desc Upper Tester message to request updating of an event at IUT + */ + type record UtSremUpdate { + RequestID requestID, + BasicVehicleRole basicVehicleRole, + RequestImportanceLevel requestImportanceLevel + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Upper Tester message to check event/status at IUT + */ + type record UtSremEventInd { + SREM sreMsg + } with { + encode (sreMsg) "LibItsSremSsem_asn1" + } + + /** + * @desc Upper Tester message to check event/status at IUT + */ + type record UtSsemEventInd { + SSEM sseMsg + } with { + encode (sseMsg) "LibItsSremSsem_asn1" + } + + /** + * @desc List of Upper Tester messages to check event/status on MAPEM SPATEM IUT + */ + type record of UtSremEventInd UtSremEventIndList; + + /** + * @desc List of Upper Tester messages to check event/status on MAPEM SPATEM IUT + */ + type record of UtSsemEventInd UtSsemEventIndList; + + type record of RequestID RequestIDList; + } with { encode "UpperTester" variant "" } - + } with { encode "LibItsSremSsem" } // End of module LibItsSremSsem_TypesAndValues -- GitLab From 87d844cc4272334377ad31bb5befa9d0ed23792f Mon Sep 17 00:00:00 2001 From: garciay Date: Sat, 28 Mar 2020 15:16:33 +0100 Subject: [PATCH 233/320] Unify STF525 TTCN-3 code --- ttcn/BTP/LibItsBtp_TypesAndValues.ttcn | 5 ++- ttcn/Http/LibItsHttp_Functions.ttcn | 8 ++-- ttcn/Http/LibItsHttp_Templates.ttcn | 52 ++++++++++++------------ ttcn/Http/LibItsHttp_TypesAndValues.ttcn | 8 ++-- ttcn/IVIM/LibItsIvim_TestSystem.ttcn | 1 + ttcn/Pki/LibItsPki_Functions.ttcn | 8 ++-- 6 files changed, 42 insertions(+), 40 deletions(-) diff --git a/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn b/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn index 808ce62a..7be36267 100644 --- a/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn +++ b/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn @@ -28,10 +28,11 @@ module LibItsBtp_TypesAndValues { type record BtpPacket { BtpHeader header, BtpRawPayload payload optional - } + } with { + encode "LibIts_Interface" variant "FIELDORDER(msb)" - } + } } // end btpPdus diff --git a/ttcn/Http/LibItsHttp_Functions.ttcn b/ttcn/Http/LibItsHttp_Functions.ttcn index f2c5257a..0761d7c5 100644 --- a/ttcn/Http/LibItsHttp_Functions.ttcn +++ b/ttcn/Http/LibItsHttp_Functions.ttcn @@ -46,7 +46,7 @@ module LibItsHttp_Functions { function f_init_default_headers_list( in charstring p_header_content_type := PICS_HEADER_CONTENT_TYPE, in charstring p_header_content_text := "", - out HeaderLines p_headers + out Headers p_headers ) { var integer v_i := 0; @@ -76,7 +76,7 @@ module LibItsHttp_Functions { function f_set_headers_list( in charstring_list p_headers_to_set, in charstring_list p_headers_value, - inout HeaderLines p_headers + inout Headers p_headers ) { // Sanity checks if (lengthof(p_headers_to_set) == 0) { @@ -101,7 +101,7 @@ module LibItsHttp_Functions { function f_remove_headers_list( in charstring_list p_headers_to_remove, - inout HeaderLines p_headers + inout Headers p_headers ) { // Sanity checks if (lengthof(p_headers_to_remove) == 0) { @@ -121,7 +121,7 @@ module LibItsHttp_Functions { } // End of function f_remove_headers_list function f_get_header( - in HeaderLines p_headers, + in Headers p_headers, in charstring p_header_name := c_header_content_text, out charstring_list p_header_value ) { diff --git a/ttcn/Http/LibItsHttp_Templates.ttcn b/ttcn/Http/LibItsHttp_Templates.ttcn index 626179e0..44dafe1b 100644 --- a/ttcn/Http/LibItsHttp_Templates.ttcn +++ b/ttcn/Http/LibItsHttp_Templates.ttcn @@ -48,7 +48,7 @@ module LibItsHttp_Templates { group http_headers { - template (value) HeaderLine m_header_line( + template (value) Header m_header_line( in template (value) charstring p_header_name, in template (value) charstring_list p_header_value ) := { @@ -62,7 +62,7 @@ module LibItsHttp_Templates { template (omit) Request m_http_request_get( in charstring p_uri, - in template (value) HeaderLines p_headers, + in template (value) Headers p_headers, in template (omit) HttpMessageBody p_body := omit ) := { method := "GET", @@ -75,7 +75,7 @@ module LibItsHttp_Templates { template Request mw_http_request_get( template (present) charstring p_uri := ?, - template (present) HeaderLines p_headers := ?, + template (present) Headers p_headers := ?, template HttpMessageBody p_body := * ) := { method := "GET", @@ -88,7 +88,7 @@ module LibItsHttp_Templates { template (omit) Request m_http_request_post( in charstring p_uri, - in template (value) HeaderLines p_headers, + in template (value) Headers p_headers, in template (omit) HttpMessageBody p_body := omit ) modifies m_http_request_get := { method := "POST" @@ -96,7 +96,7 @@ module LibItsHttp_Templates { template Request mw_http_request_post( template (present) charstring p_uri := ?, - template (present) HeaderLines p_headers := ?, + template (present) Headers p_headers := ?, template HttpMessageBody p_body := * ) modifies mw_http_request_get := { method := "POST" @@ -104,7 +104,7 @@ module LibItsHttp_Templates { template (omit) Request m_http_request_patch( in charstring p_uri, - in template (value) HeaderLines p_headers, + in template (value) Headers p_headers, in template (omit) HttpMessageBody p_body := omit ) modifies m_http_request_get := { method := "PATCH" @@ -112,7 +112,7 @@ module LibItsHttp_Templates { template Request mw_http_request_patch( template (present) charstring p_uri := ?, - template (present) HeaderLines p_headers := ?, + template (present) Headers p_headers := ?, template HttpMessageBody p_body := * ) modifies mw_http_request_get := { method := "PATCH" @@ -120,7 +120,7 @@ module LibItsHttp_Templates { template (omit) Request m_http_request_put( in charstring p_uri, - in template (value) HeaderLines p_headers, + in template (value) Headers p_headers, in template (omit) HttpMessageBody p_body := omit ) modifies m_http_request_get := { method := "PUT" @@ -128,7 +128,7 @@ module LibItsHttp_Templates { template Request mw_http_request_put( template (present) charstring p_uri := ?, - template (present) HeaderLines p_headers := ?, + template (present) Headers p_headers := ?, template HttpMessageBody p_body := * ) modifies mw_http_request_get := { method := "PUT" @@ -136,7 +136,7 @@ module LibItsHttp_Templates { template (omit) Request m_http_request_delete( in charstring p_uri, - in template (value) HeaderLines p_headers, + in template (value) Headers p_headers, in template (omit) HttpMessageBody p_body := omit ) modifies m_http_request_get := { method := "DELETE" @@ -144,7 +144,7 @@ module LibItsHttp_Templates { template Request mw_http_request_delete( template (present) charstring p_uri := ?, - template (present) HeaderLines p_headers := ?, + template (present) Headers p_headers := ?, template HttpMessageBody p_body := * ) modifies mw_http_request_get := { method := "DELETE" @@ -156,7 +156,7 @@ module LibItsHttp_Templates { template (value) Response m_http_response_ok( in template (value) HttpMessageBody p_body, - in template (value) HeaderLines p_header + in template (value) Headers p_header ) := { version_major := 1, version_minor := 1, @@ -167,7 +167,7 @@ module LibItsHttp_Templates { } // End of template m_http_response_ok template (value) Response m_http_response_ok_no_body( - in template (value) HeaderLines p_header + in template (value) Headers p_header ) := { version_major := 1, version_minor := 1, @@ -178,7 +178,7 @@ module LibItsHttp_Templates { } // End of template m_http_response_ok_no_body template (value) Response m_http_response_204_no_content( - in template (value) HeaderLines p_header + in template (value) Headers p_header ) modifies m_http_response_ok_no_body := { statuscode := 204, statustext := "No Content" @@ -186,7 +186,7 @@ module LibItsHttp_Templates { template (present) Response mw_http_response_ok( template (present) HttpMessageBody p_body := ?, - template (present) HeaderLines p_header := ? + template (present) Headers p_header := ? ) := { version_major := 1, version_minor := 1, @@ -198,7 +198,7 @@ module LibItsHttp_Templates { template (present) Response mw_http_response_201_created( template (present) HttpMessageBody p_body := ?, - template (present) HeaderLines p_header := ? + template (present) Headers p_header := ? ) modifies mw_http_response_ok := { statuscode := 201, statustext := "Created" @@ -206,7 +206,7 @@ module LibItsHttp_Templates { template (present) Response mw_http_response_202_accepted( template (present) HttpMessageBody p_body := ?, - template (present) HeaderLines p_header := ? + template (present) Headers p_header := ? ) modifies mw_http_response_ok := { statuscode := 202, statustext := "Accepted" @@ -214,7 +214,7 @@ module LibItsHttp_Templates { template (present) Response mw_http_response_204_no_content( template (present) HttpMessageBody p_body := ?, - template (present) HeaderLines p_header := ? + template (present) Headers p_header := ? ) modifies mw_http_response_ok := { statuscode := 204, statustext := "No Content" @@ -222,7 +222,7 @@ module LibItsHttp_Templates { template (value) Response m_http_response_ko( in template (value) HttpMessageBody p_body, - in template (value) HeaderLines p_header, + in template (value) Headers p_header, in template (value) integer p_statuscode := 404, in template (value) charstring p_statustext := "Not found" ) := { @@ -235,7 +235,7 @@ module LibItsHttp_Templates { } // End of template m_http_response_ko template (value) Response m_http_response_ko_no_body( - in template (value) HeaderLines p_header, + in template (value) Headers p_header, in template (value) integer p_statuscode := 404, in template (value) charstring p_statustext := "Not found" ) := { @@ -249,7 +249,7 @@ module LibItsHttp_Templates { template Response mw_http_response_ko( template HttpMessageBody p_body := *, - template (present) HeaderLines p_header := ? + template (present) Headers p_header := ? ) := { version_major := 1, version_minor := 1, @@ -261,7 +261,7 @@ module LibItsHttp_Templates { template Response mw_http_response_400_bad_request( template HttpMessageBody p_body := *, - template (present) HeaderLines p_header := ? + template (present) Headers p_header := ? ) modifies mw_http_response_ko := { statuscode := 400, statustext := "Bad Request" @@ -269,7 +269,7 @@ module LibItsHttp_Templates { template Response mw_http_response_401_unauthorized( template HttpMessageBody p_body := *, - template (present) HeaderLines p_header := ? + template (present) Headers p_header := ? ) modifies mw_http_response_ko := { statuscode := 401, statustext := "Unauthorized" @@ -277,7 +277,7 @@ module LibItsHttp_Templates { template Response mw_http_response_403_forbidden( template HttpMessageBody p_body := *, - template (present) HeaderLines p_header := ? + template (present) Headers p_header := ? ) modifies mw_http_response_ko := { statuscode := 403, statustext := "Forbidden" @@ -285,7 +285,7 @@ module LibItsHttp_Templates { template Response mw_http_response_404_not_found( template HttpMessageBody p_body := *, - template (present) HeaderLines p_header := ? + template (present) Headers p_header := ? ) modifies mw_http_response_ko := { statuscode := 404, statustext := "Not Found" @@ -293,7 +293,7 @@ module LibItsHttp_Templates { template Response mw_http_response_412_precondition_failed( template HttpMessageBody p_body := *, - template (present) HeaderLines p_header := ? + template (present) Headers p_header := ? ) modifies mw_http_response_ko := { statuscode := 412, statustext := "Precondition Failed" diff --git a/ttcn/Http/LibItsHttp_TypesAndValues.ttcn b/ttcn/Http/LibItsHttp_TypesAndValues.ttcn index 0142bce2..570fafcb 100644 --- a/ttcn/Http/LibItsHttp_TypesAndValues.ttcn +++ b/ttcn/Http/LibItsHttp_TypesAndValues.ttcn @@ -29,21 +29,21 @@ module LibItsHttp_TypesAndValues { const integer c_http_version_minor := PICS_HTTP_VERSION_MINOR; type record of charstring charstring_list; - type record HeaderLine { + type record Header { charstring header_name, charstring_list header_value optional } with { variant "FIELDORDER(msb)" } - type record of HeaderLine HeaderLines; + type record of Header Headers; type record Request { charstring method, charstring uri, integer version_major, integer version_minor, - HeaderLines header, + Headers header, HttpMessageBody body optional } with { variant "FIELDORDER(msb)" @@ -54,7 +54,7 @@ module LibItsHttp_TypesAndValues { integer version_minor, integer statuscode, charstring statustext, - HeaderLines header, + Headers header, HttpMessageBody body optional } with { variant "FIELDORDER(msb)" diff --git a/ttcn/IVIM/LibItsIvim_TestSystem.ttcn b/ttcn/IVIM/LibItsIvim_TestSystem.ttcn index e675f6c5..0bcb6439 100644 --- a/ttcn/IVIM/LibItsIvim_TestSystem.ttcn +++ b/ttcn/IVIM/LibItsIvim_TestSystem.ttcn @@ -112,6 +112,7 @@ module LibItsIvim_TestSystem { var UtIvimEventIndList vc_utEvents := {}; + var boolean vc_ivimDefaultActive := true; } // End of component ItsIvim group facilityPrimitives { diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 291ca62e..f8c17ab5 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -670,7 +670,7 @@ module LibItsPki_Functions { } // End of function f_verifyEcdsa function f_http_send( - in HeaderLines p_headers, + in Headers p_headers, in template (value) HttpMessage p_http_message ) runs on ItsPkiHttp { log(">>> f_http_send: ", p_http_message); @@ -1025,7 +1025,7 @@ module LibItsPki_Functions { p_result := true; } else { // Generate the certificate - if (f_generate_ec_certificate_for_inner_ec_response(p_inner_ec_request, p_private_key, p_digest, v_ec_certificate) == false) { + if (f_generate_ec_certificate_for_inner_ec_response(valueof(p_inner_ec_request), p_private_key, p_digest, v_ec_certificate) == false) { log("f_http_build_inner_ec_response: Failed to generate the certificate"); p_inner_ec_response := valueof( m_innerEcResponse_ko( @@ -3178,7 +3178,7 @@ module LibItsPki_Functions { out InnerEcResponse p_inner_ec_response, in boolean p_strict_checks := true ) runs on ItsPkiHttp return boolean { - var HeaderLines v_headers; + var Headers v_headers; var Oct32 v_request_hash; var Oct16 v_encrypted_sym_key; var Oct16 v_aes_sym_key; @@ -3289,7 +3289,7 @@ module LibItsPki_Functions { var Oct16 v_aes_enc_key; var InnerEcRequest v_inner_ec_request; var template (value) HttpMessage v_response; - var HeaderLines v_headers; + var Headers v_headers; tc_ac.stop; -- GitLab From 4b09f4e418e6e62ce9be0a9a44a5c1c9805585d9 Mon Sep 17 00:00:00 2001 From: garciay Date: Sun, 29 Mar 2020 09:22:41 +0200 Subject: [PATCH 234/320] Unify security external function names --- ttcn/Pki/LibItsPki_Functions.ttcn | 32 ++--- ttcn/Security/LibItsSecurity_Functions.ttcn | 140 ++++++++++---------- 2 files changed, 86 insertions(+), 86 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index f8c17ab5..5f1ee4c1 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -591,12 +591,12 @@ module LibItsPki_Functions { if (PX_VE_ALG == e_nist_p256) { return f_signWithEcdsaNistp256WithSha256(p_toBeSignedSecuredMessage, p_certificateIssuer, p_privateKey); } else if (PX_VE_ALG == e_brainpool_p256_r1) { - return f_signWithEcdsaBrainpoolp256WithSha256(p_toBeSignedSecuredMessage, p_certificateIssuer, p_privateKey); + return f_signWithEcdsaBrainpoolp256r1WithSha256(p_toBeSignedSecuredMessage, p_certificateIssuer, p_privateKey); } else if (PX_VE_ALG == e_brainpool_p384_r1) { if (p_certificateIssuer == int2oct(0, 32)) { - return f_signWithEcdsaBrainpoolp384WithSha384(p_toBeSignedSecuredMessage, int2oct(0, 48), p_privateKey); + return f_signWithEcdsaBrainpoolp384r1WithSha384(p_toBeSignedSecuredMessage, int2oct(0, 48), p_privateKey); } else { - return f_signWithEcdsaBrainpoolp384WithSha384(p_toBeSignedSecuredMessage, p_certificateIssuer, p_privateKey); + return f_signWithEcdsaBrainpoolp384r1WithSha384(p_toBeSignedSecuredMessage, p_certificateIssuer, p_privateKey); } } @@ -634,14 +634,14 @@ module LibItsPki_Functions { } } else if (ischosen(p_verification_key.ecdsaBrainpoolP256r1)) { if (ischosen(p_verification_key.ecdsaBrainpoolP256r1.compressed_y_0)) { - v_ret := f_verifyWithEcdsaBrainpoolp256WithSha256( + v_ret := f_verifyWithEcdsaBrainpoolp256r1WithSha256( p_tbs, p_issuer, p_signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only & p_signature_.ecdsaBrainpoolP256r1Signature.sSig, p_verification_key.ecdsaBrainpoolP256r1.compressed_y_0, 0); } else { - v_ret := f_verifyWithEcdsaBrainpoolp256WithSha256( + v_ret := f_verifyWithEcdsaBrainpoolp256r1WithSha256( p_tbs, p_issuer, p_signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only & p_signature_.ecdsaBrainpoolP256r1Signature.sSig, @@ -650,14 +650,14 @@ module LibItsPki_Functions { } } else if (ischosen(p_verification_key.ecdsaBrainpoolP384r1)) { if (ischosen(p_verification_key.ecdsaBrainpoolP384r1.compressed_y_0)) { - v_ret := f_verifyWithEcdsaBrainpoolp384WithSha384( + v_ret := f_verifyWithEcdsaBrainpoolp384r1WithSha384( p_tbs, p_issuer, p_signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only & p_signature_.ecdsaBrainpoolP384r1Signature.sSig, p_verification_key.ecdsaBrainpoolP384r1.compressed_y_0, 0); } else { - v_ret := f_verifyWithEcdsaBrainpoolp384WithSha384( + v_ret := f_verifyWithEcdsaBrainpoolp384r1WithSha384( p_tbs, p_issuer, p_signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only & p_signature_.ecdsaBrainpoolP384r1Signature.sSig, @@ -2300,7 +2300,7 @@ module LibItsPki_Functions { // In case of ITS-S privacy, v_signed_at_signature contained the data to be encrypted if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1)) { v_hashId := sha384; - v_tbs_signed := f_signWithEcdsaBrainpoolp384WithSha384(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); + v_tbs_signed := f_signWithEcdsaBrainpoolp384r1WithSha384(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); v_signature := valueof( m_signature_ecdsaBrainpoolP384r1( m_ecdsaP384Signature( @@ -2314,7 +2314,7 @@ module LibItsPki_Functions { } else { v_hashId := sha256; if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1)) { - v_tbs_signed := f_signWithEcdsaBrainpoolp256WithSha256(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); + v_tbs_signed := f_signWithEcdsaBrainpoolp256r1WithSha256(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); v_signature := valueof( m_signature_ecdsaBrainpoolP256r1( m_ecdsaP256Signature( @@ -2405,7 +2405,7 @@ module LibItsPki_Functions { log("f_generate_inner_at_request: Wrong BrainpoolP256r1 encryption variant"); return false; } - v_enc_signed_ec_signature := f_encryptWithEciesBrainpoolp256WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce); + v_enc_signed_ec_signature := f_encryptWithEciesBrainpoolp256r1WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce); if (v_public_compressed_ephemeral_mode == 0) { v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); } else { @@ -2687,7 +2687,7 @@ module LibItsPki_Functions { // TODO Simplify with f_signWithEcdsa if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1)) { v_hashId := sha384; - v_tbs_signed := f_signWithEcdsaBrainpoolp384WithSha384(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); + v_tbs_signed := f_signWithEcdsaBrainpoolp384r1WithSha384(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); v_signature := valueof( m_signature_ecdsaBrainpoolP384r1( m_ecdsaP384Signature( @@ -2701,7 +2701,7 @@ module LibItsPki_Functions { } else { v_hashId := sha256; if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1)) { - v_tbs_signed := f_signWithEcdsaBrainpoolp256WithSha256(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); + v_tbs_signed := f_signWithEcdsaBrainpoolp256r1WithSha256(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); v_signature := valueof( m_signature_ecdsaBrainpoolP256r1( m_ecdsaP256Signature( @@ -2791,7 +2791,7 @@ module LibItsPki_Functions { log("f_generate_inner_at_request_with_wrong_parameters: Wrong BrainpoolP256r1 encryption variant"); return false; } - v_enc_signed_ec_signature := f_encryptWithEciesBrainpoolp256WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce); + v_enc_signed_ec_signature := f_encryptWithEciesBrainpoolp256r1WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce); if (v_public_compressed_ephemeral_mode == 0) { v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); } else { @@ -3456,7 +3456,7 @@ module LibItsPki_Functions { if (p_enc_algorithm == e_nist_p256) { v_encrypted_request := f_encryptWithEciesNistp256WithSha256(v_encoded_request, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); } else if (p_enc_algorithm == e_brainpool_p256_r1) { - v_encrypted_request := f_encryptWithEciesBrainpoolp256WithSha256(v_encoded_request, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); + v_encrypted_request := f_encryptWithEciesBrainpoolp256r1WithSha256(v_encoded_request, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); } else { log("f_build_pki_secured_request_message_signed_with_pop: Wrong encryption variant"); return false; @@ -3568,7 +3568,7 @@ module LibItsPki_Functions { if (p_enc_algorithm == e_nist_p256) { v_encrypted_request := f_encryptWithEciesNistp256WithSha256(p_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); } else if (p_enc_algorithm == e_brainpool_p256_r1) { - v_encrypted_request := f_encryptWithEciesBrainpoolp256WithSha256(p_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); + v_encrypted_request := f_encryptWithEciesBrainpoolp256r1WithSha256(p_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); } else { log("f_build_pki_secured_request_message: Wrong encryption variant"); return false; @@ -3672,7 +3672,7 @@ module LibItsPki_Functions { if (p_enc_algorithm == e_nist_p256) { v_encrypted_request := f_encryptWithEciesNistp256WithSha256(v_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); } else if (p_enc_algorithm == e_brainpool_p256_r1) { - v_encrypted_request := f_encryptWithEciesBrainpoolp256WithSha256(v_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); + v_encrypted_request := f_encryptWithEciesBrainpoolp256r1WithSha256(v_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); } else { log("f_build_pki_secured_request_message_for_authorization: Wrong encryption variant"); return false; diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 037fa901..db195478 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -87,18 +87,18 @@ module LibItsSecurity_Functions { * @param p_privateKey The private key for signature * @return The signature value */ - function f_signWithEcdsaBrainpoolp256WithSha256( + function f_signWithEcdsaBrainpoolp256r1WithSha256( in octetstring p_toBeSignedSecuredMessage, in Oct32 p_certificateIssuer, in Oct32 p_privateKey ) return octetstring { - return fx_signWithEcdsaBrainpoolp256WithSha256( + return fx_signWithEcdsaBrainpoolp256r1WithSha256( p_toBeSignedSecuredMessage, p_certificateIssuer, p_privateKey ); - } // End of function f_signWithEcdsaBrainpoolp256WithSha256 + } // End of function f_signWithEcdsaBrainpoolp256r1WithSha256 /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature based on standard IEEE 1609.2 @@ -107,21 +107,21 @@ module LibItsSecurity_Functions { * @param p_privateKey The private key for signature * @return The signature value */ - function f_signWithEcdsaBrainpoolp384WithSha384( + function f_signWithEcdsaBrainpoolp384r1WithSha384( in octetstring p_toBeSignedSecuredMessage, in Oct48 p_certificateIssuer, in Oct48 p_privateKey ) return octetstring { - log(">>> f_signWithEcdsaBrainpoolp384WithSha384: ", p_toBeSignedSecuredMessage); - log(">>> f_signWithEcdsaBrainpoolp384WithSha384: ", p_certificateIssuer); - log(">>> f_signWithEcdsaBrainpoolp384WithSha384: ", p_privateKey); - return fx_signWithEcdsaBrainpoolp384WithSha384( + log(">>> f_signWithEcdsaBrainpoolp384r1WithSha384: ", p_toBeSignedSecuredMessage); + log(">>> f_signWithEcdsaBrainpoolp384r1WithSha384: ", p_certificateIssuer); + log(">>> f_signWithEcdsaBrainpoolp384r1WithSha384: ", p_privateKey); + return fx_signWithEcdsaBrainpoolp384r1WithSha384( p_toBeSignedSecuredMessage, p_certificateIssuer, p_privateKey ); - } // End of function f_signWithEcdsaBrainpoolp384WithSha384 + } // End of function f_signWithEcdsaBrainpoolp384r1WithSha384 function f_decrypt( in octetstring p_encryptPrivateKey, @@ -201,7 +201,7 @@ module LibItsSecurity_Functions { } else if (ischosen(v_pKRecipientInfo.encKey.eciesBrainpoolP256r1)) { var SymmetricCiphertext v_ciphertext := p_encrypedSecuredMessage.content.encryptedData.ciphertext; if (ischosen(v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.compressed_y_0)) { - v_decryptedSecuredMessage := f_decryptWithEciesBrainpoolp256WithSha256( + v_decryptedSecuredMessage := f_decryptWithEciesBrainpoolp256r1WithSha256( v_ciphertext.aes128ccm.ccmCiphertext, p_encryptPrivateKey, v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.compressed_y_0, @@ -212,7 +212,7 @@ module LibItsSecurity_Functions { p_salt, p_aes_sym_enc_key ); } else if (ischosen(v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.compressed_y_1)) { - v_decryptedSecuredMessage := f_decryptWithEciesBrainpoolp256WithSha256( + v_decryptedSecuredMessage := f_decryptWithEciesBrainpoolp256r1WithSha256( v_ciphertext.aes128ccm.ccmCiphertext, p_encryptPrivateKey, v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.compressed_y_1, @@ -344,7 +344,7 @@ module LibItsSecurity_Functions { * @see https://www.nominet.uk/researchblog/how-elliptic-curve-cryptography-encryption-works/ * @see http://digital.csic.es/bitstream/10261/32671/1/V2-I2-P7-13.pdf */ - function f_encryptWithEciesBrainpoolp256WithSha256( + function f_encryptWithEciesBrainpoolp256r1WithSha256( in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyCompressed, in integer p_compressed_mode, @@ -356,7 +356,7 @@ module LibItsSecurity_Functions { out Oct16 p_authentication_vector, out Oct12 p_nonce ) return octetstring { - return fx_encryptWithEciesBrainpoolp256WithSha256( + return fx_encryptWithEciesBrainpoolp256r1WithSha256( p_toBeEncryptedSecuredMessage, p_recipientsPublicKeyCompressed, p_compressed_mode, @@ -368,7 +368,7 @@ module LibItsSecurity_Functions { p_authentication_vector, p_nonce ); - } // End of function f_encryptWithEciesBrainpoolp256WithSha256 + } // End of function f_encryptWithEciesBrainpoolp256r1WithSha256 /** * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Brainpool-P256 algorithm @@ -383,7 +383,7 @@ module LibItsSecurity_Functions { * @see https://www.nominet.uk/researchblog/how-elliptic-curve-cryptography-encryption-works/ * @see http://digital.csic.es/bitstream/10261/32671/1/V2-I2-P7-13.pdf */ - function f_decryptWithEciesBrainpoolp256WithSha256( + function f_decryptWithEciesBrainpoolp256r1WithSha256( in octetstring p_encryptedSecuredMessage, in Oct32 p_privateEncKey, in Oct32 p_publicEphemeralKeyCompressed, @@ -394,7 +394,7 @@ module LibItsSecurity_Functions { in Oct32 p_salt, out Oct16 p_aes_sym_enc_key ) return octetstring { - return fx_decryptWithEciesBrainpoolp256WithSha256( + return fx_decryptWithEciesBrainpoolp256r1WithSha256( p_encryptedSecuredMessage, p_privateEncKey, p_publicEphemeralKeyCompressed, @@ -405,7 +405,7 @@ module LibItsSecurity_Functions { p_salt, p_aes_sym_enc_key ); - } // End of function f_decryptWithEcdsaBrainpoolp256WithSha256 + } // End of function f_decryptWithEcdsaBrainpoolp256r1WithSha256 /** * @desc Compute the HashedId8 value from the hash value @@ -510,25 +510,25 @@ module LibItsSecurity_Functions { * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @return true on success, false otherwise */ - function f_verifyWithEcdsaBrainpoolp256WithSha256( + function f_verifyWithEcdsaBrainpoolp256r1WithSha256( in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in Oct64 p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyCompressed, in integer p_compressed_mode ) return boolean { - log("f_verifyWithEcdsaBrainpoolp256WithSha256: toBeVerifiedData", p_toBeVerifiedData); - log("f_verifyWithEcdsaBrainpoolp256WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); - log("f_verifyWithEcdsaBrainpoolp256WithSha256: signature", p_signature); - log("f_verifyWithEcdsaBrainpoolp256WithSha256: ecdsaBrainpoolp256PublicKeyCompressed", p_ecdsaBrainpoolp256PublicKeyCompressed); - return fx_verifyWithEcdsaBrainpoolp256WithSha256( + log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: toBeVerifiedData", p_toBeVerifiedData); + log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); + log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: signature", p_signature); + log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: ecdsaBrainpoolp256PublicKeyCompressed", p_ecdsaBrainpoolp256PublicKeyCompressed); + return fx_verifyWithEcdsaBrainpoolp256r1WithSha256( p_toBeVerifiedData, p_certificateIssuer, p_signature, p_ecdsaBrainpoolp256PublicKeyCompressed, p_compressed_mode ); - } // End of function f_verifyWithEcdsaBrainpoolp256WithSha256 + } // End of function f_verifyWithEcdsaBrainpoolp256r1WithSha256 /** * @Desc Verify the signature of the specified data @@ -539,25 +539,25 @@ module LibItsSecurity_Functions { * @param p_ecdsaBrainpoolp256PublicKeyY The public key (y coordinate) * @return true on success, false otherwise */ - function f_verifyWithEcdsaBrainpoolp256WithSha256_1( // TODO To be removed + function f_verifyWithEcdsaBrainpoolp256r1WithSha256_1( // TODO To be removed in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in Oct64 p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyX, in Oct32 p_ecdsaBrainpoolp256PublicKeyY ) return boolean { -// log("f_verifyWithEcdsaBrainpoolp256WithSha256: toBeVerifiedData", p_toBeVerifiedData); -// log("f_verifyWithEcdsaBrainpoolp256WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); -// log("f_verifyWithEcdsaBrainpoolp256WithSha256: signature", p_signature); -// log("f_verifyWithEcdsaBrainpoolp256WithSha256: ecdsaBrainpoolp256PublicKeyX", p_ecdsaBrainpoolp256PublicKeyX); -// log("f_verifyWithEcdsaBrainpoolp256WithSha256: ecdsaBrainpoolp256PublicKeyY", p_ecdsaBrainpoolp256PublicKeyY); - return fx_verifyWithEcdsaBrainpoolp256WithSha256_1( +// log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: toBeVerifiedData", p_toBeVerifiedData); +// log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); +// log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: signature", p_signature); +// log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: ecdsaBrainpoolp256PublicKeyX", p_ecdsaBrainpoolp256PublicKeyX); +// log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: ecdsaBrainpoolp256PublicKeyY", p_ecdsaBrainpoolp256PublicKeyY); + return fx_verifyWithEcdsaBrainpoolp256r1WithSha256_1( p_toBeVerifiedData, p_certificateIssuer, p_signature, p_ecdsaBrainpoolp256PublicKeyX, p_ecdsaBrainpoolp256PublicKeyY); - } // End of function f_verifyWithEcdsaBrainpoolp256WithSha256_1 + } // End of function f_verifyWithEcdsaBrainpoolp256r1WithSha256_1 /** * @Desc Verify the signature of the specified data @@ -569,25 +569,25 @@ module LibItsSecurity_Functions { * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @return true on success, false otherwise */ - function f_verifyWithEcdsaBrainpoolp384WithSha384( + function f_verifyWithEcdsaBrainpoolp384r1WithSha384( in octetstring p_toBeVerifiedData, in Oct48 p_certificateIssuer, in Oct96 p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyCompressed, in integer p_compressed_mode ) return boolean { -// log("f_verifyWithEcdsaBrainpoolp384WithSha384: toBeVerifiedData", p_toBeVerifiedData); -// log("f_verifyWithEcdsaBrainpoolp384WithSha384: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); -// log("f_verifyWithEcdsaBrainpoolp384WithSha384: signature", p_signature); -// log("f_verifyWithEcdsaBrainpoolp384WithSha384: ecdsaBrainpoolp384PublicKeyCompressed", p_ecdsaBrainpoolp384PublicKeyCompressed); - return fx_verifyWithEcdsaBrainpoolp384WithSha384( +// log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: toBeVerifiedData", p_toBeVerifiedData); +// log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); +// log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: signature", p_signature); +// log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: ecdsaBrainpoolp384PublicKeyCompressed", p_ecdsaBrainpoolp384PublicKeyCompressed); + return fx_verifyWithEcdsaBrainpoolp384r1WithSha384( p_toBeVerifiedData, p_certificateIssuer, p_signature, p_ecdsaBrainpoolp384PublicKeyCompressed, p_compressed_mode ); - } // End of function f_verifyWithEcdsaBrainpoolp384WithSha384 + } // End of function f_verifyWithEcdsaBrainpoolp384r1WithSha384 /** * @Desc Verify the signature of the specified data @@ -598,25 +598,25 @@ module LibItsSecurity_Functions { * @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate) * @return true on success, false otherwise */ - function f_verifyWithEcdsaBrainpoolp384WithSha384_1( // TODO To be removed + function f_verifyWithEcdsaBrainpoolp384r1WithSha384_1( // TODO To be removed in octetstring p_toBeVerifiedData, in Oct48 p_certificateIssuer, in Oct96 p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyX, in Oct48 p_ecdsaBrainpoolp384PublicKeyY ) return boolean { -// log("f_verifyWithEcdsaBrainpoolp384WithSha384: toBeVerifiedData", p_toBeVerifiedData); -// log("f_verifyWithEcdsaBrainpoolp384WithSha384: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); -// log("f_verifyWithEcdsaBrainpoolp384WithSha384: signature", p_signature); -// log("f_verifyWithEcdsaBrainpoolp384WithSha384: ecdsaBrainpoolp384PublicKeyX", p_ecdsaBrainpoolp384PublicKeyX); -// log("f_verifyWithEcdsaBrainpoolp384WithSha384: ecdsaBrainpoolp384PublicKeyY", p_ecdsaBrainpoolp384PublicKeyY); - return fx_verifyWithEcdsaBrainpoolp384WithSha384_1( +// log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: toBeVerifiedData", p_toBeVerifiedData); +// log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); +// log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: signature", p_signature); +// log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: ecdsaBrainpoolp384PublicKeyX", p_ecdsaBrainpoolp384PublicKeyX); +// log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: ecdsaBrainpoolp384PublicKeyY", p_ecdsaBrainpoolp384PublicKeyY); + return fx_verifyWithEcdsaBrainpoolp384r1WithSha384_1( p_toBeVerifiedData, p_certificateIssuer, p_signature, p_ecdsaBrainpoolp384PublicKeyX, p_ecdsaBrainpoolp384PublicKeyY); - } // End of function f_verifyWithEcdsaBrainpoolp384WithSha384_1 + } // End of function f_verifyWithEcdsaBrainpoolp384r1WithSha384_1 /** * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. @@ -849,7 +849,7 @@ module LibItsSecurity_Functions { ) )); } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { - v_signature := f_signWithEcdsaBrainpoolp256WithSha256( + v_signature := f_signWithEcdsaBrainpoolp256r1WithSha256( v_secPayload, v_certificateIssuer, v_privateKey @@ -861,7 +861,7 @@ module LibItsSecurity_Functions { ) )); } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature)) { - v_signature := f_signWithEcdsaBrainpoolp384WithSha384( + v_signature := f_signWithEcdsaBrainpoolp384r1WithSha384( v_secPayload, v_certificateIssuer, v_privateKey @@ -1629,7 +1629,7 @@ module LibItsSecurity_Functions { v_signature := valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only) & valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP256r1Signature.sSig); log("f_verifyCertificateSignatureWithPublicKey: v_signedData=", v_signature); if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1.uncompressedP256)) { - return f_verifyWithEcdsaBrainpoolp256WithSha256_1( + return f_verifyWithEcdsaBrainpoolp256r1WithSha256_1( v_enc_msg, v_issuer, v_signature, @@ -1637,7 +1637,7 @@ module LibItsSecurity_Functions { valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.uncompressedP256.y) ); } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1.compressed_y_0)) { - return f_verifyWithEcdsaBrainpoolp256WithSha256( + return f_verifyWithEcdsaBrainpoolp256r1WithSha256( v_enc_msg, v_issuer, v_signature, @@ -1645,7 +1645,7 @@ module LibItsSecurity_Functions { 0 // Latest bit of the Y-coordinate is 0 ); } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1.compressed_y_1)) { - return f_verifyWithEcdsaBrainpoolp256WithSha256( + return f_verifyWithEcdsaBrainpoolp256r1WithSha256( v_enc_msg, v_issuer, v_signature, @@ -1674,7 +1674,7 @@ module LibItsSecurity_Functions { v_signature := valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only) & valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP384r1Signature.sSig); log("f_verifyCertificateSignatureWithPublicKey: v_signedData=", v_signature); if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1.uncompressedP384)) { - return f_verifyWithEcdsaBrainpoolp384WithSha384_1( + return f_verifyWithEcdsaBrainpoolp384r1WithSha384_1( v_enc_msg, v_issuer, v_signature, @@ -1682,7 +1682,7 @@ module LibItsSecurity_Functions { valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.uncompressedP384.y) ); } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1.compressed_y_0)) { - return f_verifyWithEcdsaBrainpoolp384WithSha384( + return f_verifyWithEcdsaBrainpoolp384r1WithSha384( v_enc_msg, v_issuer, v_signature, @@ -1690,7 +1690,7 @@ module LibItsSecurity_Functions { 0 // Latest bit of the Y-coordinate is 0 ); } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1.compressed_y_1)) { - return f_verifyWithEcdsaBrainpoolp384WithSha384( + return f_verifyWithEcdsaBrainpoolp384r1WithSha384( v_enc_msg, v_issuer, v_signature, @@ -1880,7 +1880,7 @@ module LibItsSecurity_Functions { v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only) & valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig); log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: v_signedData=", v_signedData); if (ischosen(p_publicKey.uncompressedP256)) { - v_result := f_verifyWithEcdsaBrainpoolp256WithSha256_1( + v_result := f_verifyWithEcdsaBrainpoolp256r1WithSha256_1( v_secPayload, valueof(p_certificateIssuer), v_signedData, @@ -1888,7 +1888,7 @@ module LibItsSecurity_Functions { valueof(p_publicKey.uncompressedP256.y) ); } else if (ischosen(p_publicKey.compressed_y_0)) { - v_result := f_verifyWithEcdsaBrainpoolp256WithSha256( + v_result := f_verifyWithEcdsaBrainpoolp256r1WithSha256( v_secPayload, valueof(p_certificateIssuer), v_signedData, @@ -1896,7 +1896,7 @@ module LibItsSecurity_Functions { 0 ); } else if (ischosen(p_publicKey.compressed_y_1)) { - v_result := f_verifyWithEcdsaBrainpoolp256WithSha256( + v_result := f_verifyWithEcdsaBrainpoolp256r1WithSha256( v_secPayload, valueof(p_certificateIssuer), v_signedData, @@ -1944,7 +1944,7 @@ module LibItsSecurity_Functions { v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only) & valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig); log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: v_signedData=", v_signedData); if (ischosen(p_publicKey.uncompressedP384)) { - v_result := f_verifyWithEcdsaBrainpoolp384WithSha384_1( + v_result := f_verifyWithEcdsaBrainpoolp384r1WithSha384_1( v_secPayload, valueof(p_certificateIssuer), v_signedData, @@ -1952,7 +1952,7 @@ module LibItsSecurity_Functions { valueof(p_publicKey.uncompressedP384.y) ); } else if (ischosen(p_publicKey.compressed_y_0)) { - v_result := f_verifyWithEcdsaBrainpoolp384WithSha384( + v_result := f_verifyWithEcdsaBrainpoolp384r1WithSha384( v_secPayload, valueof(p_certificateIssuer), v_signedData, @@ -1960,7 +1960,7 @@ module LibItsSecurity_Functions { 0 ); } else if (ischosen(p_publicKey.compressed_y_1)) { - v_result := f_verifyWithEcdsaBrainpoolp384WithSha384( + v_result := f_verifyWithEcdsaBrainpoolp384r1WithSha384( v_secPayload, valueof(p_certificateIssuer), v_signedData, @@ -2463,7 +2463,7 @@ module LibItsSecurity_Functions { * @param p_privateKey The private key for signature * @return The signature value */ - external function fx_signWithEcdsaBrainpoolp256WithSha256(in octetstring p_toBeSignedSecuredMessage, in Oct32 p_certificateIssuer, in Oct32 p_privateKey) return octetstring; + external function fx_signWithEcdsaBrainpoolp256r1WithSha256(in octetstring p_toBeSignedSecuredMessage, in Oct32 p_certificateIssuer, in Oct32 p_privateKey) return octetstring; /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature @@ -2471,7 +2471,7 @@ module LibItsSecurity_Functions { * @param p_privateKey The private key for signature * @return The signature value */ - external function fx_signWithEcdsaBrainpoolp384WithSha384(in octetstring p_toBeSignedSecuredMessage, in Oct48 p_certificateIssuer, in Oct48 p_privateKey) return octetstring; + external function fx_signWithEcdsaBrainpoolp384r1WithSha384(in octetstring p_toBeSignedSecuredMessage, in Oct48 p_certificateIssuer, in Oct48 p_privateKey) return octetstring; /** * @desc Verify the signature of the specified data @@ -2504,7 +2504,7 @@ module LibItsSecurity_Functions { * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaBrainpoolp256WithSha256(in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in Oct64 p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyCompressed, in integer p_compressed_mode) return boolean; + external function fx_verifyWithEcdsaBrainpoolp256r1WithSha256(in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in Oct64 p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyCompressed, in integer p_compressed_mode) return boolean; /** * @desc Verify the signature of the specified data @@ -2515,7 +2515,7 @@ module LibItsSecurity_Functions { * @param p_ecdsaBrainpoolp256PublicKeyY The public key (y coordinate) * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaBrainpoolp256WithSha256_1(in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in Oct64 p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyX, in Oct32 p_ecdsaBrainpoolp256PublicKeyY) return boolean; + external function fx_verifyWithEcdsaBrainpoolp256r1WithSha256_1(in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in Oct64 p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyX, in Oct32 p_ecdsaBrainpoolp256PublicKeyY) return boolean; /** * @desc Verify the signature of the specified data @@ -2526,7 +2526,7 @@ module LibItsSecurity_Functions { * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaBrainpoolp384WithSha384(in octetstring p_toBeVerifiedData, in Oct48 p_certificateIssuer, in Oct96 p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyCompressed, in integer p_compressed_mode) return boolean; + external function fx_verifyWithEcdsaBrainpoolp384r1WithSha384(in octetstring p_toBeVerifiedData, in Oct48 p_certificateIssuer, in Oct96 p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyCompressed, in integer p_compressed_mode) return boolean; /** * @desc Verify the signature of the specified data @@ -2537,7 +2537,7 @@ module LibItsSecurity_Functions { * @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate) * @return true on success, false otherwise */ - external function fx_verifyWithEcdsaBrainpoolp384WithSha384_1(in octetstring p_toBeVerifiedData, in Oct48 p_certificateIssuer, in Oct96 p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyX, in Oct48 p_ecdsaBrainpoolp384PublicKeyY) return boolean; + external function fx_verifyWithEcdsaBrainpoolp384r1WithSha384_1(in octetstring p_toBeVerifiedData, in Oct48 p_certificateIssuer, in Oct96 p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyX, in Oct48 p_ecdsaBrainpoolp384PublicKeyY) return boolean; /** * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. @@ -2648,9 +2648,9 @@ module LibItsSecurity_Functions { * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption * @return The encrypted message */ - external function fx_encryptWithEciesBrainpoolp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyCompressed, in integer p_compressed_mode, in octetstring p_salt, out Oct32 p_publicEphemeralKeyCompressed, out integer p_ephemeralKeyModeCompressed, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; + external function fx_encryptWithEciesBrainpoolp256r1WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyCompressed, in integer p_compressed_mode, in octetstring p_salt, out Oct32 p_publicEphemeralKeyCompressed, out integer p_ephemeralKeyModeCompressed, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; - external function fx_test_encryptWithEciesBrainpoolp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_privateEphemeralKey, in Oct32 p_recipientPublicKeyX, in Oct32 p_recipientPublicKeyY, in octetstring p_salt, out Oct32 p_publicEphemeralKeyX, out Oct32 p_publicEphemeralKeyY, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; + external function fx_test_encryptWithEciesBrainpoolp256r1WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_privateEphemeralKey, in Oct32 p_recipientPublicKeyX, in Oct32 p_recipientPublicKeyY, in octetstring p_salt, out Oct32 p_publicEphemeralKeyX, out Oct32 p_publicEphemeralKeyY, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; /** * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Brainpool-P256 algorithm @@ -2662,7 +2662,7 @@ module LibItsSecurity_Functions { * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption * @return The decrypted message */ - external function fx_decryptWithEciesBrainpoolp256WithSha256(in octetstring p_encryptedSecuredMessage, in Oct32 p_privateEncKey, in Oct32 p_publicEphemeralKeyCompressed, in integer p_ephemeralKeyModeCompressed, in Oct16 p_encrypted_sym_key, in Oct16 p_authentication_vector, in Oct12 p_nonce, in Oct32 p_salt, out Oct16 p_aes_sym_enc_key) return octetstring; + external function fx_decryptWithEciesBrainpoolp256r1WithSha256(in octetstring p_encryptedSecuredMessage, in Oct32 p_privateEncKey, in Oct32 p_publicEphemeralKeyCompressed, in integer p_ephemeralKeyModeCompressed, in Oct16 p_encrypted_sym_key, in Oct16 p_authentication_vector, in Oct12 p_nonce, in Oct32 p_salt, out Oct16 p_aes_sym_enc_key) return octetstring; } // End of group encryption -- GitLab From 9fd3f291599a06ba28b36128afe7dff953310fb8 Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 6 Apr 2020 08:18:43 +0200 Subject: [PATCH 235/320] Add TLM test --- ttcn/Pki/LibItsPki_Functions.ttcn | 89 +++++++++++++++++++-- ttcn/Pki/LibItsPki_Templates.ttcn | 9 +++ ttcn/Security/LibItsSecurity_Templates.ttcn | 30 +++---- 3 files changed, 106 insertions(+), 22 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 5f1ee4c1..d6c77e1c 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -3040,6 +3040,7 @@ module LibItsPki_Functions { log("f_verify_rca_crl_response_message: Invalid nextUpdate value"); return false; } + // TODO Verify RCA certificate & signature } } @@ -3066,7 +3067,7 @@ module LibItsPki_Functions { return false; } else { if (f_verify_ctl_entry(v_ctl_command.add) == false) { - log("f_verify_full_ctl: ctlCommands contains inavlid entries"); + log("f_verify_full_ctl: ctlCommands contains invalid entries"); return false; } } @@ -3116,33 +3117,43 @@ module LibItsPki_Functions { return false; } else { if (f_verify_ectl_entry(v_ectl_command.add) == false) { - log("f_verify_full_ectl: ctlCommands contains inavlid entries"); + log("f_verify_full_ectl: ctlCommands contains invalid entries"); return false; } } } // End of 'for' statements - + return true; } function f_verify_ctl_entry( in CtlEntry p_ctl_entry ) return boolean { + log(">>> f_verify_ctl_entry: p_ctl_entry=", p_ctl_entry); + if (ischosen(p_ctl_entry.rca)) { if (match(p_ctl_entry.rca, mw_root_ca_entry(mw_etsiTs103097Certificate)) == false) { return false; + } else { + // TODO Verify RCA certificate & signature } } else if (ischosen(p_ctl_entry.ea)) { if (match(p_ctl_entry.ea, mw_ea_entry(mw_etsiTs103097Certificate)) == false) { return false; + } else { + // TODO Verify RCA certificate & signature } } else if (ischosen(p_ctl_entry.aa)) { if (match(p_ctl_entry.aa, mw_aa_entry(mw_etsiTs103097Certificate)) == false) { return false; + } else { + // TODO Verify RCA certificate & signature } } else if (ischosen(p_ctl_entry.dc)) { if (match(p_ctl_entry.dc, mw_dc_entry) == false) { return false; + } else { + // TODO Verify RCA certificate & signature } } else { return false; @@ -3150,27 +3161,91 @@ module LibItsPki_Functions { return true; } - + function f_verify_ectl_entry( in CtlEntry p_ctl_entry ) return boolean { + log(">>> f_verify_ectl_entry: p_ctl_entry=", p_ctl_entry); + if (ischosen(p_ctl_entry.tlm)) { if (match(p_ctl_entry.tlm, mw_tlm_entry(mw_etsiTs103097Certificate)) == false) { return false; } else { // TODO Verify selsigned certificate } + } else if (ischosen(p_ctl_entry.rca)) { + if (match(p_ctl_entry.rca, mw_root_ca_entry(mw_etsiTs103097Certificate)) == false) { + return false; + } else { + // TODO Verify RCA certificate & signature + } } else { return false; } return true; } - + } // End of group rca - + + group tlm { + + function f_verify_tlm_ectl_response_message( + in Ieee1609Dot2Data p_ieee1609dot2_signed_data, + in boolean p_check_security := true, + out ToBeSignedTlmCtl p_to_be_signed_tlm_ectl + ) return boolean { + var bitstring v_etsi_ts_102941_data_msg; + var bitstring v_tbs; + var Certificate v_certificate; + var boolean v_result; + var Oct32 v_issuer; + var EtsiTs102941Data v_etsi_ts_102941_data; + + log(">>> f_verify_tlm_ectl_response_message: p_ieee1609dot2_signed_data= ", p_ieee1609dot2_signed_data); + + // 1. Verify signature + log("f_verify_tlm_ectl_response_message: p_ieee1609dot2_signed_data.content.signedData.tbsData= ", p_ieee1609dot2_signed_data.content.signedData.tbsData); + v_tbs := encvalue(p_ieee1609dot2_signed_data.content.signedData.tbsData); + v_certificate := p_ieee1609dot2_signed_data.content.signedData.signer.certificate[0]; + if (ischosen(p_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaBrainpoolP384r1Signature)) { + v_result := f_verifyEcdsa(bit2oct(v_tbs), int2oct(0, 48), p_ieee1609dot2_signed_data.content.signedData.signature_, v_certificate.toBeSigned.verifyKeyIndicator.verificationKey); + } else { + v_result := f_verifyEcdsa(bit2oct(v_tbs), int2oct(0, 32), p_ieee1609dot2_signed_data.content.signedData.signature_, v_certificate.toBeSigned.verifyKeyIndicator.verificationKey); + } + if (v_result == false) { + if (p_check_security == true) { + return false; + } + } + v_etsi_ts_102941_data_msg := oct2bit(p_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); + if (decvalue(v_etsi_ts_102941_data_msg, v_etsi_ts_102941_data) != 0) { + log("f_verify_tlm_ectl_response_message: Failed to decode EtsiTs102941Data"); + return false; + } else { + log("f_verify_tlm_ectl_response_message: v_etsi_ts_102941_data= ", v_etsi_ts_102941_data); + log("f_verify_pki_response_message: TlmCertificateTrustListMessage matching= ", match(v_etsi_ts_102941_data, mw_etsiTs102941Data_to_be_signed_tlm_ctl)); + if (match(v_etsi_ts_102941_data, mw_etsiTs102941Data_to_be_signed_tlm_ctl) == false) { + log("f_verify_tlm_ectl_response_message: Failed to decode certificateTrustListTlm"); + return false; + } else { + p_to_be_signed_tlm_ectl := v_etsi_ts_102941_data.content.certificateTrustListTlm; + log("f_verify_tlm_ectl_response_message: p_to_be_signed_tlm_ectl= ", p_to_be_signed_tlm_ectl); + if (p_to_be_signed_tlm_ectl.nextUpdate <= f_getCurrentTime() / 1000) { + log("f_verify_tlm_ectl_response_message: Invalid nextUpdate value: compared values=", p_to_be_signed_tlm_ectl.nextUpdate, "/", f_getCurrentTime() / 1000); + return false; + } + // TODO Verify RCA certificate & signature + } + } + + return true; + } + + } // End of group tlm + group awaiting_messages { - + function f_await_http_inner_ec_request_response( out Oct32 p_private_key, out Oct32 p_compressed_public_key, diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn index 5869bcb1..285c0f8f 100644 --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ b/ttcn/Pki/LibItsPki_Templates.ttcn @@ -169,6 +169,15 @@ module LibItsPki_Templates { } } // End of template mw_etsiTs102941Data_to_be_signed_crl + template (present) EtsiTs102941Data mw_etsiTs102941Data_to_be_signed_tlm_ctl( + template (present) ToBeSignedTlmCtl p_to_be_signed_tlm := ? + ) := { + version := PkiProtocolVersion, + content := { + certificateTrustListTlm := p_to_be_signed_tlm + } + } // End of template mw_etsiTs102941Data_to_be_signed_crl + template (value) EtsiTs102941DataContent m_enrolmentRequest( in template (value) InnerEcRequestSignedForPop p_enrolmentRequest ) := { diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index 82bbc0fa..ef6df220 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -344,19 +344,19 @@ module LibItsSecurity_Templates { * @desc Recv template for message signed with digest */ template (present) SignerIdentifier mw_signerIdentifier_digest( - in template (present) HashedId8 p_digest := ? + template (present) HashedId8 p_digest := ? ) := { digest := p_digest } // End of template mw_signerIdentifier_digest template (present) SignerIdentifier mw_signerIdentifier_certificate( - in template (present) EtsiTs103097Certificate p_certificate := ? + template (present) EtsiTs103097Certificate p_certificate := ? ) := { certificate := { p_certificate } } // End of template m_signerIdentifier_certificate template (present) SignerIdentifier mw_signerIdentifier_certificates( - in template (present) SequenceOfCertificate p_certificates := ? + template (present) SequenceOfCertificate p_certificates := ? ) := { certificate := p_certificates } // End of template mw_signerIdentifier_certificates @@ -376,7 +376,7 @@ module LibItsSecurity_Templates { * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.9 Signature */ template (present) Signature mw_signature( - in template (present) EcdsaP256Signature p_ecdsaSignature := ? + template (present) EcdsaP256Signature p_ecdsaSignature := ? ):= { ecdsaNistP256Signature := p_ecdsaSignature } // End of template mw_signature @@ -388,8 +388,8 @@ module LibItsSecurity_Templates { * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.10 EcdsaP256Signature */ template (present) EcdsaP256Signature mw_ecdsaSignature( - in template (present) EccP256CurvePoint p_rSig := ?, - in template (present) octetstring p_sSig := ? + template (present) EccP256CurvePoint p_rSig := ?, + template (present) octetstring p_sSig := ? ) := { rSig := p_rSig, sSig := p_sSig @@ -404,8 +404,8 @@ module LibItsSecurity_Templates { * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.19 TwoDLocation */ template (present) TwoDLocation mw_twoDLocation( - in template (present) SecLatitude p_latitude, - in template (present) SecLongitude p_longitude + template (present) SecLatitude p_latitude, + template (present) SecLongitude p_longitude ) := { latitude := p_latitude, longitude := p_longitude @@ -419,9 +419,9 @@ module LibItsSecurity_Templates { * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.20 ThreeDLocation */ template (present) ThreeDLocation mw_threeDLocation( - in template (present) SecLatitude p_latitude, - in template (present) SecLongitude p_longitude, - in template (present) SecElevation p_elevation + template (present) SecLatitude p_latitude, + template (present) SecLongitude p_longitude, + template (present) SecElevation p_elevation ) := { latitude := p_latitude, longitude := p_longitude, @@ -435,8 +435,8 @@ module LibItsSecurity_Templates { * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion */ template (present) GeographicRegion mw_geographicRegion_circle( - in template (present) TwoDLocation p_center := ?, - in template (present) UInt16 p_radius := ? + template (present) TwoDLocation p_center := ?, + template (present) UInt16 p_radius := ? ) := { circularRegion := { center := p_center, @@ -460,7 +460,7 @@ module LibItsSecurity_Templates { * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion */ template (present) GeographicRegion mw_geographicRegion_polygonal( - in template (present) PolygonalRegion p_polygonal_region := ? + template (present) PolygonalRegion p_polygonal_region := ? ) := { polygonalRegion := p_polygonal_region } // End of template mw_geographicRegion_polygonial @@ -471,7 +471,7 @@ module LibItsSecurity_Templates { * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion */ template (present) GeographicRegion mw_geographicRegion_identified( - in template (present) SequenceOfIdentifiedRegion p_identifiedRegion := ? + template (present) SequenceOfIdentifiedRegion p_identifiedRegion := ? ) := { identifiedRegion := p_identifiedRegion } // End of template mw_geographicRegion_identifiedRegion -- GitLab From 54117d219e38be67abcf07c6d39dfe3fff54185a Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 8 Apr 2020 09:29:29 +0200 Subject: [PATCH 236/320] Enhance AtsSecurity --- .../LibItsSecurity_TypesAndValues.ttcn | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn index 3c33b6ec..bdedd7b8 100644 --- a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn +++ b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn @@ -142,16 +142,18 @@ module LibItsSecurity_TypesAndValues { const charstring cc_taCert1901_BO := "CERT_TS_19_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the reserved region type has been used in region validity restriction of the AT certificate */ // IUT certificates & private keys - const charstring cc_taCert_CA2 := "CERT_IUT_CA2_AT"; - const charstring cc_taCert_CA3 := "CERT_IUT_CA3_AT"; + const charstring cc_taCert_CA2 := "CERT_IUT_CA2_AT"; + const charstring cc_taCert_CA3 := "CERT_IUT_CA3_AT"; const charstring cc_taCert_CC_AA := "CERT_IUT_CC_AA"; - const charstring cc_iutCert_A := "CERT_IUT_A_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ + const charstring cc_iutCert_A := "CERT_IUT_A_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ const charstring cc_iutCert_A_AA := "CERT_IUT_A_AA"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_B := "CERT_IUT_B_AT"; /** Default certificate, with circular region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_C := "CERT_IUT_C_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_D := "CERT_IUT_D_AT"; /** Certificate with a polygonal region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_E := "CERT_IUT_E_AT"; /** Certificate with a region identifier, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_F := "CERT_IUT_F_AT"; /** Certificate with a subject type indicating 'enrolment_credentials', to be used when secured messages are sent from TA to IUT */ + const charstring cc_iutCert_A_B := "CERT_IUT_A_B_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT - BrainpoolP256r1*/ + const charstring cc_iutCert_A_B3 := "CERT_IUT_A_B3_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT - BrainpoolP384r1*/ + const charstring cc_iutCert_B := "CERT_IUT_B_AT"; /** Default certificate, with circular region, to be used when secured messages are sent from TA to IUT */ + const charstring cc_iutCert_C := "CERT_IUT_C_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ + const charstring cc_iutCert_D := "CERT_IUT_D_AT"; /** Certificate with a polygonal region, to be used when secured messages are sent from TA to IUT */ + const charstring cc_iutCert_E := "CERT_IUT_E_AT"; /** Certificate with a region identifier, to be used when secured messages are sent from TA to IUT */ + const charstring cc_iutCert_F := "CERT_IUT_F_AT"; /** Certificate with a subject type indicating 'enrolment_credentials', to be used when secured messages are sent from TA to IUT */ /** * @desc Specification of basic format elements -- GitLab From 5cee2ec7a3e913384c8d521117f72101dd7f4bdc Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Wed, 8 Apr 2020 09:33:24 +0200 Subject: [PATCH 237/320] Enhance AtsPki --- ttcn/Pki/LibItsPki_Functions.ttcn | 3 +-- ttcn/Security/LibItsSecurity_Functions.ttcn | 8 ++++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index d6c77e1c..5813cdde 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -1913,8 +1913,7 @@ module LibItsPki_Functions { m_publicKeys( v_public_verification_key ), - m_certificateSubjectAttributes_id_omit/*FIXME No name*/( - /*oct2char(PICS_ITS_S_CANONICAL_ID),*/ + m_certificateSubjectAttributes_id_none( { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs valueof(m_appPermissions(c_its_aid_SCR, { bitmapSsp := PX_INNER_EC_CERTFICATE_BITMAP_SSP_SCR })) }, diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index db195478..3bd00481 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -659,7 +659,7 @@ module LibItsSecurity_Functions { log(">>> f_generate_key_pair_brainpoolp256r1"); return fx_generateKeyPair_brainpoolp256r1(p_privateKey, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressed_mode); } - + /** * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. * This function should not be used by the ATS @@ -679,7 +679,7 @@ module LibItsSecurity_Functions { ) return boolean { return fx_generateKeyPair_brainpoolp384r1(p_privateKey, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressed_mode); } - + /** * @desc Calculate digest over the certificate * @param p_cert The certificate @@ -2575,6 +2575,10 @@ module LibItsSecurity_Functions { */ external function fx_generateKeyPair_brainpoolp384r1(out Oct48 p_privateKey, out Oct48 p_publicKeyX, out Oct48 p_publicKeyY, out Oct48 p_publicKeyCompressed, out integer p_compressed_mode) return boolean; + external function fx_get_uncompressed_key_nistp256(in Oct32 p_privateKey, in Oct32 p_publicKeyCompressed, in integer p_compressed_mode, out Oct32 p_publicKeyY) return boolean; + external function fx_get_uncompressed_key_brainpoolp256r1(in Oct32 p_privateKey, in Oct32 p_publicKeyCompressed, in integer p_compressed_mode, out Oct32 p_publicKeyY) return boolean; + external function fx_get_uncompressed_key_brainpoolp384r1(in Oct48 p_privateKey, in Oct48 p_publicKeyCompressed, in integer p_compressed_mode, out Oct48 p_publicKeyY) return boolean; + } // End of group signing group encryption { -- GitLab From 0181ca54a8bcae4214b6aba217dff20f2035504e Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 8 Apr 2020 12:33:24 +0200 Subject: [PATCH 238/320] Unify STF525 TTCN-3 code with spirent --- ttcn/CAM/LibItsCam_TypesAndValues.ttcn | 2 +- .../LibItsGeoNetworking_Templates.ttcn | 156 ------------------ .../LibItsGeoNetworking_TypesAndValues.ttcn | 2 - ttcn/Pki/LibItsPki_Functions.ttcn | 8 +- ttcn/Pki/LibItsPki_Pics.ttcn | 2 +- ttcn/Pki/LibItsPki_TestSystem.ttcn | 7 + ttcn/Pki/LibItsPki_TypesAndValues.ttcn | 6 + ttcn/Security/LibItsSecurity_Pics.ttcn | 7 +- .../LibItsSecurity_TypesAndValues.ttcn | 2 +- 9 files changed, 23 insertions(+), 169 deletions(-) diff --git a/ttcn/CAM/LibItsCam_TypesAndValues.ttcn b/ttcn/CAM/LibItsCam_TypesAndValues.ttcn index b33dbb9a..d78ddde8 100644 --- a/ttcn/CAM/LibItsCam_TypesAndValues.ttcn +++ b/ttcn/CAM/LibItsCam_TypesAndValues.ttcn @@ -143,7 +143,7 @@ module LibItsCam_TypesAndValues { } /** - * @desc Upper Tester message to activate position and/or time + * @desc Upper Tester result message of request of triggering of an event at IUT */ type record UtActivatePositionTime { // empty on purpose diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn index 39a94c33..fba7d697 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn @@ -1356,86 +1356,6 @@ module LibItsGeoNetworking_Templates { } // end group geoNwPacketTsbTemplates - group geoNwPacketSaTemplates { - - /** - * @desc Send template for GeoNetworking SA Packet - * @param p_seqNumber Sequence number of SA packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_hopLimit The maximum number of hops (Default: c_defaultHopLimit) - */ - template (value) GnNonSecuredPacket m_geoNwSaPacket( - in template (value) UInt16 p_seqNumber, - in template (value) LongPosVector p_sourceLongPosVec, - in template (value) UInt8 p_hopLimit := c_defaultHopLimit, - in template (value) TrafficClass p_trafficClass := m_trafficClass - ) := { - commonHeader := valueof(m_commonHeader( - PX_GN_UPPER_LAYER, - m_saHeaderType_sa, - p_trafficClass, - p_hopLimit - )), - extendedHeader := valueof(m_tsbHeader( - p_seqNumber, - p_sourceLongPosVec - )), - payload := '00100011010203CAFEDECA'O - } - - /** - * @desc Receive template for GeoNetworking SA Packet - * @param p_seqNumber Sequence number of SA packet (Default: ?) - * @param p_sourceLongPosVec Long position vector of source (Default: ?) - */ - template (present) GnNonSecuredPacket mw_geoNwSaPacket( - in template (present) UInt16 p_seqNumber := ?, - in template (present) LongPosVector p_sourceLongPosVec := ? - ) := { - commonHeader := mw_commonHeader( - PX_GN_UPPER_LAYER, - m_saHeaderType_sa - ), - extendedHeader := mw_saHeader(p_seqNumber, p_sourceLongPosVec), - payload := * - } - - /** - * @desc Receive template for GeoNetworking SA Packet - * @param p_seqNumber Sequence number of SA packet (Default: ?) - * @param p_sourceLongPosVec Long position vector of source (Default: ?) - * @param p_hopLimit The maximum number of hops (Default: ?) - */ - template (present) GnNonSecuredPacket mw_geoNwSaPacketWithHl( - in template (present) UInt16 p_seqNumber := ?, - in template (present) LongPosVector p_sourceLongPosVec := ?, - in template (present) UInt8 p_hopLimit := ? - ) modifies mw_geoNwSaPacket := { - commonHeader := mw_commonHeaderWithHopLimit( - PX_GN_UPPER_LAYER, - m_saHeaderType_sa, - p_hopLimit - ) - } - - /** - * @desc Receive template for GeoNetworking SA Packet - * @param p_seqNumber Sequence number of SA packet (Default: ?) - * @param p_sourceLongPosVec Long position vector of source (Default: ?) - * @param p_nextHeader Id of next header - */ - template (present) GnNonSecuredPacket mw_geoNwSaPacketWithNextHeader( - in template (present) UInt16 p_seqNumber := ?, - in template (present) LongPosVector p_sourceLongPosVec := ?, - in template (value) NextHeader p_nextHeader - ) modifies mw_geoNwSaPacket := { - commonHeader := { - nextHeader := p_nextHeader - } - } - - } // end group geoNwPacketSaTemplates - } // end group geoNwPacketTemplates group geoNwHeadersTemplates { @@ -2332,82 +2252,6 @@ module LibItsGeoNetworking_Templates { } // end tsbHeaderTemplates - group saHeaderTemplates { - - /** - * @desc Send template for SA header - * @param p_seqNumber Sequence number of TSB packet - * @param p_srcPosVector Long position vector of source - */ - template ExtendedHeader m_saHeader( - in template (value) UInt16 p_seqNumber, - in template (value) LongPosVector p_srcPosVector - ) := { - tsbHeader := { - seqNumber := p_seqNumber, - reserved := c_uInt8Zero, - srcPosVector := p_srcPosVector - } - } - - /** - * @desc Receive template for TSB header - * @param p_seqNumber Sequence number of TSB packet - * @param p_sourceLongPosVec Long position vector of source - */ - template (present) ExtendedHeader mw_saHeader( - in template (present) UInt16 p_seqNumber, - in template (present) LongPosVector p_sourceLongPosVec - ) := { - tsbHeader := { - seqNumber := p_seqNumber, - reserved := ?, - srcPosVector := p_sourceLongPosVec - } - } - - /** - * @desc Send template for SA header type - */ - template (value) HeaderTST m_saHeaderType_sa := { - saHdr := { - headerType := e_serviceAnnouncement, - headerSubType := e_sa - } - } - - /** - * @desc Receive template for SA header type - */ - template (present) HeaderTST mw_saHeaderType_sa := { - saHdr := { - headerType := e_serviceAnnouncement, - headerSubType := e_sa - } - } - - /** - * @desc Send template for SA header type - */ - template (value) HeaderTST m_saHeaderType_eos := { - saHdr := { - headerType := e_serviceAnnouncement, - headerSubType := e_saEos - } - } - - /** - * @desc Receive template for SA header type - */ - template (present) HeaderTST mw_saHeaderType_eos := { - saHdr := { - headerType := e_serviceAnnouncement, - headerSubType := e_saEos - } - } - - } // end saHeaderTemplates - } // end geoNwHeadersTemplates group geoMiscTemplates { diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn index fe076b85..7d468e14 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn @@ -379,8 +379,6 @@ module LibItsGeoNetworking_TypesAndValues { BeaconHeader beaconHeader, LSRequestHeader lsRequestHeader, LSReplyHeader lsReplyHeader, - AnyHeader saHeader, // FIXME Cannot find description, AnyHeader was used as default - AnyHeader saEosHeader, // FIXME Cannot find description, AnyHeader was used as default AnyHeader anyHeader } with { variant "" diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 5813cdde..756af4f3 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -76,6 +76,8 @@ module LibItsPki_Functions { connect(self:syncPort, mtc:syncPort); connect(p_itss:syncPort, self:syncPort); connect(p_pki:syncPort, self:syncPort); + + connect(p_pki:infoPort, p_itss:infoPort); } // End of function f_cfMtcUp01 function f_cfMtcUp02( @@ -108,7 +110,7 @@ module LibItsPki_Functions { } f_connect4SelfOrClientSync(); - f_initialiseSecuredMode(p_ea_certificate_id, p_aa_certificate_id); + f_initialiseSecuredMode(p_ea_certificate_id, p_aa_certificate_id); // TODO To be removed??? // Setup EA certificate shared with PKI EA entity f_readCertificate(p_ea_certificate_id, vc_eaCertificate); @@ -304,6 +306,8 @@ module LibItsPki_Functions { disconnect(p_itss:syncPort, self:syncPort); disconnect(p_pki:syncPort, self:syncPort); + disconnect(p_pki:infoPort, p_itss:infoPort); + p_itss.done; p_pki.done; } @@ -2064,7 +2068,7 @@ module LibItsPki_Functions { ); // Signed the encoded InnerEcRequestSignedForPop log("f_generate_inner_ec_request_signed_for_pop: tbs= ", v_tbs); - log("f_generate_inner_ec_request_signed_for_pop: tbs= ", bit2oct(encvalue(v_tbs, "", "LibItsSecurity_asn1"))); + log("f_generate_inner_ec_request_signed_for_pop: tbs= ", bit2oct(encvalue(v_tbs))); v_tbs_signed := f_signWithEcdsa(bit2oct(encvalue(v_tbs)), int2oct(0, 32), p_private_key); // Finalyse signed InnerEcRequestSignedForPop if (PX_VE_ALG == e_nist_p256) { diff --git a/ttcn/Pki/LibItsPki_Pics.ttcn b/ttcn/Pki/LibItsPki_Pics.ttcn index ce5f4df8..5da7709c 100644 --- a/ttcn/Pki/LibItsPki_Pics.ttcn +++ b/ttcn/Pki/LibItsPki_Pics.ttcn @@ -73,7 +73,7 @@ module LibItsPki_Pics { /** * @desc Certificate used by the Test System acting as ITS-S */ - modulepar charstring PICS_TS_CERTIFICATE_ID := "CERT_TS_A_EA"; + modulepar charstring PICS_TS_CERTIFICATE_ID := "CERT_TS_A_AT"; /** * @desc Certificate used by the Test System acting as EA diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index d1c0f699..33518c28 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -51,6 +51,10 @@ module LibItsPki_TestSystem { in UtPkiResults; } // End of UpperTesterPort + type port InfoPort message { + inout InfoPortData + } // End of InfoPort + } // End of group portDefinitions group componentDefinitions { @@ -82,6 +86,9 @@ module LibItsPki_TestSystem { port HttpPort httpAtPort; /** Authorization end point */ port HttpPort httpCaPort; /** CA CTL/CRL end point */ port HttpPort httpTlmPort; /** TLM ECTL end point */ + + port InfoPort infoPort; + var Certificate vc_eaCertificate; /** Test Adapter EA certificate */ var octetstring vc_eaPrivateKey; /** Test Adapter EA private key for signature */ var octetstring vc_eaPrivateEncKey; /** Test Adapter EA private key for encryption */ diff --git a/ttcn/Pki/LibItsPki_TypesAndValues.ttcn b/ttcn/Pki/LibItsPki_TypesAndValues.ttcn index 6e634fc6..b1bc07e3 100644 --- a/ttcn/Pki/LibItsPki_TypesAndValues.ttcn +++ b/ttcn/Pki/LibItsPki_TypesAndValues.ttcn @@ -16,6 +16,7 @@ module LibItsPki_TypesAndValues { // LibIts import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + import from EtsiTs103097Module language "ASN.1:1997" all; group constants { @@ -130,6 +131,11 @@ module LibItsPki_TypesAndValues { encode "AdapterControl" } // End of group acPrimitives + type record InfoPortData { + octetstring hashed_id8, + EtsiTs103097Certificate at_certificate + } // End of type InfoPortData + } with { variant "" diff --git a/ttcn/Security/LibItsSecurity_Pics.ttcn b/ttcn/Security/LibItsSecurity_Pics.ttcn index b14b5709..4265a9fc 100644 --- a/ttcn/Security/LibItsSecurity_Pics.ttcn +++ b/ttcn/Security/LibItsSecurity_Pics.ttcn @@ -37,7 +37,7 @@ module LibItsSecurity_Pics { /** * Does the IUT support Brainpool P256r1 algorithm */ - modulepar boolean PICS_SEC_BRAINPOOL_P256R1 := true; + modulepar boolean PICS_SEC_BRAINPOOL_P256R1 := false; /** * Does the IUT support Brainpool P384r1 algorithm @@ -94,9 +94,4 @@ module LibItsSecurity_Pics { */ modulepar boolean PICS_SEC_ITS_AID_OTHER := true; - /** - * Does the IUT support encryption data? - */ - modulepar boolean PICS_SEC_ENCRYPTION_SUPPORT := true; - } // End of module LibItsSecurity_Pics diff --git a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn index bdedd7b8..53c98285 100644 --- a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn +++ b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn @@ -146,7 +146,7 @@ module LibItsSecurity_TypesAndValues { const charstring cc_taCert_CA3 := "CERT_IUT_CA3_AT"; const charstring cc_taCert_CC_AA := "CERT_IUT_CC_AA"; const charstring cc_iutCert_A := "CERT_IUT_A_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_A_AA := "CERT_IUT_A_AA"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ + const charstring cc_iutCert_A_AA := "CERT_IUT_A_AA"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT - NistP256*/ const charstring cc_iutCert_A_B := "CERT_IUT_A_B_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT - BrainpoolP256r1*/ const charstring cc_iutCert_A_B3 := "CERT_IUT_A_B3_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT - BrainpoolP384r1*/ const charstring cc_iutCert_B := "CERT_IUT_B_AT"; /** Default certificate, with circular region, to be used when secured messages are sent from TA to IUT */ -- GitLab From 05da1c7eb2266da50cbee511c01fb59623187412 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Wed, 8 Apr 2020 14:31:41 +0200 Subject: [PATCH 239/320] Enhance AtsPki / Titan --- .../LibItsGeoNetworking_TypesAndValues.ttcn | 14 -------------- ttcn/Pki/LibItsPki_TestSystem.ttcn | 4 +++- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn index 7d468e14..aadc30dd 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn @@ -619,18 +619,6 @@ module LibItsGeoNetworking_TypesAndValues { variant "FIELDORDER(msb)" } - /** - * @desc Identifies the header type and the header subtype for Service Announcement SA. - * @member headerType - * @member reserved - */ - type record SaHeaderType { - HeaderType headerType(e_serviceAnnouncement), - HeaderSubTypeSa headerSubType - } with { - variant "FIELDORDER(msb)" - } - /** * @desc Identifies the header type and the header subtype for Topologically-Scoped Broadcast TSB. * @member headerType @@ -720,7 +708,6 @@ module LibItsGeoNetworking_TypesAndValues { GeoBroadcastHeaderType geoBroadcastHdr, TsbHeaderType tsbHdr, LsHeaderType lsHdr, - SaHeaderType saHdr, UInt8 reserved } with { variant "FIELDORDER(msb)" @@ -737,7 +724,6 @@ module LibItsGeoNetworking_TypesAndValues { e_geoBroadcast(4), e_topologicallyScopedBroadcast(5), e_locationService(6), - e_serviceAnnouncement(7), e_reserved } with { variant "FIELDLENGTH(4)" //variant "4 bit" diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index 33518c28..ff34ae5b 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -52,7 +52,9 @@ module LibItsPki_TestSystem { } // End of UpperTesterPort type port InfoPort message { - inout InfoPortData + inout InfoPortData + } with { + extension "internal" } // End of InfoPort } // End of group portDefinitions -- GitLab From da895da51244716b9697cff6b76cba0c70de902c Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 10 Apr 2020 08:53:19 +0200 Subject: [PATCH 240/320] Remove old TTCN-3 Test Suites --- ttcn/CALM/ATSP/LibItsAtsp_Functions.ttcn3 | 1410 ------------- ttcn/CALM/ATSP/LibItsAtsp_Pics.ttcn3 | 232 --- ttcn/CALM/ATSP/LibItsAtsp_Pixits.ttcn3 | 200 -- ttcn/CALM/ATSP/LibItsAtsp_Templates.ttcn3 | 1067 ---------- .../CALM/ATSP/LibItsAtsp_TypesAndValues.ttcn3 | 247 --- ttcn/CALM/FNTP/LibItsFntp_Functions.ttcn3 | 1485 -------------- ttcn/CALM/FNTP/LibItsFntp_Pics.ttcn3 | 88 - ttcn/CALM/FNTP/LibItsFntp_Pixits.ttcn3 | 361 ---- ttcn/CALM/FNTP/LibItsFntp_Templates.ttcn3 | 1204 ----------- .../CALM/FNTP/LibItsFntp_TypesAndValues.ttcn3 | 153 -- ttcn/CALM/FSAP/LibItsFsap_Functions.ttcn3 | 1005 ---------- ttcn/CALM/FSAP/LibItsFsap_Pics.ttcn3 | 104 - ttcn/CALM/FSAP/LibItsFsap_Pixits.ttcn3 | 405 ---- ttcn/CALM/FSAP/LibItsFsap_Templates.ttcn3 | 1019 ---------- .../CALM/FSAP/LibItsFsap_TypesAndValues.ttcn3 | 126 -- ttcn/CALM/IICP/LibItsIicp_Functions.ttcn3 | 614 ------ ttcn/CALM/IICP/LibItsIicp_Pics.ttcn3 | 52 - ttcn/CALM/IICP/LibItsIicp_Pixits.ttcn3 | 223 --- ttcn/CALM/IICP/LibItsIicp_Templates.ttcn3 | 1762 ----------------- .../CALM/IICP/LibItsIicp_TypesAndValues.ttcn3 | 99 - ttcn/CALM/LibItsCalm_Interface.ttcn | 446 ----- ttcn/CALM/LibItsCalm_Pixits.ttcn3 | 192 -- ttcn/CALM/LibItsCalm_TestSystem.ttcn | 36 - ttcn/CALM/MGT/LibItsMgt_Functions.ttcn3 | 146 -- ttcn/CALM/MGT/LibItsMgt_Pixits.ttcn3 | 81 - ttcn/CALM/MGT/LibItsMgt_Templates.ttcn3 | 749 ------- ttcn/CALM/MGT/LibItsMgt_TypesAndValues.ttcn3 | 114 -- ttcn/DCC/LibItsDcc_Functions.ttcn | 944 --------- ttcn/DCC/LibItsDcc_Pics.ttcn | 152 -- ttcn/DCC/LibItsDcc_Pixits.ttcn | 815 -------- ttcn/DCC/LibItsDcc_Templates.ttcn | 95 - ttcn/DCC/LibItsDcc_TestSystem.ttcn | 181 -- ttcn/DCC/LibItsDcc_TypesAndValues.ttcn | 222 --- ttcn/V2G/LibItsV2G_Functions.ttcn | 296 --- ttcn/V2G/LibItsV2G_Pics.ttcn | 27 - ttcn/V2G/LibItsV2G_Pixits.ttcn | 17 - ttcn/V2G/LibItsV2G_Templates.ttcn | 263 --- ttcn/V2G/LibItsV2G_TestSystem.ttcn | 134 -- ttcn/V2G/LibItsV2G_TypesAndValues.ttcn | 226 --- ttcn/V2G/V2G_CI_AppProtocol.xsd | 55 - ttcn/V2G/V2G_CI_MsgBody.xsd | 484 ----- ttcn/V2G/V2G_CI_MsgDataTypes.xsd | 698 ------- ttcn/V2G/V2G_CI_MsgDef.xsd | 31 - ttcn/V2G/V2G_CI_MsgHeader.xsd | 38 - ttcn/V2G/xmldsig-core-schema.xsd | 308 --- xsd/V2G/V2G_CI_AppProtocol.xsd | 55 - xsd/V2G/V2G_CI_MsgBody.xsd | 482 ----- xsd/V2G/V2G_CI_MsgDataTypes.xsd | 696 ------- xsd/V2G/V2G_CI_MsgDef.xsd | 28 - xsd/V2G/V2G_CI_MsgHeader.xsd | 22 - xsd/V2G/xmldsig-core-schema.xsd | 308 --- 51 files changed, 20197 deletions(-) delete mode 100644 ttcn/CALM/ATSP/LibItsAtsp_Functions.ttcn3 delete mode 100644 ttcn/CALM/ATSP/LibItsAtsp_Pics.ttcn3 delete mode 100644 ttcn/CALM/ATSP/LibItsAtsp_Pixits.ttcn3 delete mode 100644 ttcn/CALM/ATSP/LibItsAtsp_Templates.ttcn3 delete mode 100644 ttcn/CALM/ATSP/LibItsAtsp_TypesAndValues.ttcn3 delete mode 100644 ttcn/CALM/FNTP/LibItsFntp_Functions.ttcn3 delete mode 100644 ttcn/CALM/FNTP/LibItsFntp_Pics.ttcn3 delete mode 100644 ttcn/CALM/FNTP/LibItsFntp_Pixits.ttcn3 delete mode 100644 ttcn/CALM/FNTP/LibItsFntp_Templates.ttcn3 delete mode 100644 ttcn/CALM/FNTP/LibItsFntp_TypesAndValues.ttcn3 delete mode 100644 ttcn/CALM/FSAP/LibItsFsap_Functions.ttcn3 delete mode 100644 ttcn/CALM/FSAP/LibItsFsap_Pics.ttcn3 delete mode 100644 ttcn/CALM/FSAP/LibItsFsap_Pixits.ttcn3 delete mode 100644 ttcn/CALM/FSAP/LibItsFsap_Templates.ttcn3 delete mode 100644 ttcn/CALM/FSAP/LibItsFsap_TypesAndValues.ttcn3 delete mode 100644 ttcn/CALM/IICP/LibItsIicp_Functions.ttcn3 delete mode 100644 ttcn/CALM/IICP/LibItsIicp_Pics.ttcn3 delete mode 100644 ttcn/CALM/IICP/LibItsIicp_Pixits.ttcn3 delete mode 100644 ttcn/CALM/IICP/LibItsIicp_Templates.ttcn3 delete mode 100644 ttcn/CALM/IICP/LibItsIicp_TypesAndValues.ttcn3 delete mode 100644 ttcn/CALM/LibItsCalm_Interface.ttcn delete mode 100644 ttcn/CALM/LibItsCalm_Pixits.ttcn3 delete mode 100644 ttcn/CALM/LibItsCalm_TestSystem.ttcn delete mode 100644 ttcn/CALM/MGT/LibItsMgt_Functions.ttcn3 delete mode 100644 ttcn/CALM/MGT/LibItsMgt_Pixits.ttcn3 delete mode 100644 ttcn/CALM/MGT/LibItsMgt_Templates.ttcn3 delete mode 100644 ttcn/CALM/MGT/LibItsMgt_TypesAndValues.ttcn3 delete mode 100644 ttcn/DCC/LibItsDcc_Functions.ttcn delete mode 100644 ttcn/DCC/LibItsDcc_Pics.ttcn delete mode 100644 ttcn/DCC/LibItsDcc_Pixits.ttcn delete mode 100644 ttcn/DCC/LibItsDcc_Templates.ttcn delete mode 100644 ttcn/DCC/LibItsDcc_TestSystem.ttcn delete mode 100644 ttcn/DCC/LibItsDcc_TypesAndValues.ttcn delete mode 100644 ttcn/V2G/LibItsV2G_Functions.ttcn delete mode 100644 ttcn/V2G/LibItsV2G_Pics.ttcn delete mode 100644 ttcn/V2G/LibItsV2G_Pixits.ttcn delete mode 100644 ttcn/V2G/LibItsV2G_Templates.ttcn delete mode 100644 ttcn/V2G/LibItsV2G_TestSystem.ttcn delete mode 100644 ttcn/V2G/LibItsV2G_TypesAndValues.ttcn delete mode 100644 ttcn/V2G/V2G_CI_AppProtocol.xsd delete mode 100644 ttcn/V2G/V2G_CI_MsgBody.xsd delete mode 100644 ttcn/V2G/V2G_CI_MsgDataTypes.xsd delete mode 100644 ttcn/V2G/V2G_CI_MsgDef.xsd delete mode 100644 ttcn/V2G/V2G_CI_MsgHeader.xsd delete mode 100644 ttcn/V2G/xmldsig-core-schema.xsd delete mode 100644 xsd/V2G/V2G_CI_AppProtocol.xsd delete mode 100644 xsd/V2G/V2G_CI_MsgBody.xsd delete mode 100644 xsd/V2G/V2G_CI_MsgDataTypes.xsd delete mode 100644 xsd/V2G/V2G_CI_MsgDef.xsd delete mode 100644 xsd/V2G/V2G_CI_MsgHeader.xsd delete mode 100644 xsd/V2G/xmldsig-core-schema.xsd diff --git a/ttcn/CALM/ATSP/LibItsAtsp_Functions.ttcn3 b/ttcn/CALM/ATSP/LibItsAtsp_Functions.ttcn3 deleted file mode 100644 index a78b7eb1..00000000 --- a/ttcn/CALM/ATSP/LibItsAtsp_Functions.ttcn3 +++ /dev/null @@ -1,1410 +0,0 @@ -/** - * @author ETSI / STF455 - * @version $URL$ - * $Id$ - * @desc Access Technology Layer (ISO 21218) functions - */ -module LibItsAtsp_Functions { - - // LibCommon - import from LibCommon_Sync { - function - f_connect4SelfOrClientSync, f_disconnect4SelfOrClientSync, - f_selfOrClientSyncAndVerdict, f_selfOrClientSyncAndVerdictTestBody; - altstep a_shutdown - }; - import from LibCommon_VerdictControl { - type FncRetCode - }; - import from LibCommon_Time { - function f_sleep, f_sleepIgnoreDef - }; - import from LibCommon_BasicTypesAndValues { - type UInt6, UInt8 - }; - - // LibIts - - // LibItsCalm - import from CALMllsap language "ASN.1:1997" { - type - UserPriority, VCIserialNumber, EUI64, - LLserviceAddr, INdata, IN_SAPaddress, - CIstatus, Link_ID, MedType, Errors, - I_Param, I_ParamNo, MedID, VirtualCIs - }; - import from CALMmsap language "ASN.1:1997" { - type - CIstateChng, Events21218, ErrStatus, - MI_Request_request, MI_Request_confirm, - MI_Command_request, MI_Command_confirm, - CommandRef - }; - import from CALMmanagement language "ASN.1:1997" { - type - ITS_scuId - }; - import from LibItsCalm_Interface { - type - UtInitialize, CfInitialize, CfEventInd, - UtResult, CfResult, - ItsCalm - }; - - import from LibItsAtsp_Templates all; - import from LibItsAtsp_Pics all; - import from LibItsAtsp_Pixits all; - import from LibItsAtsp_TypesAndValues all; - import from LibItsCalm_Interface all; - import from LibItsFsap_TypesAndValues { - type AcFsapPrimitive - }; - import from LibItsIicp_Functions { - altstep a_iicpDefault - }; - import from LibItsMgt_TypesAndValues { - const c_dniCiid; - type IParamNoList, IParamList - }; - import from LibItsMgt_Functions { - function f_getNextCommandRef - }; - - /** - * @desc Upper tester functions - */ - group utFunctions { - - /** - * @desc Requests to bring the IUT in an initial state - * @param p_utInitialize The initialisation to trigger. - * @verdict Unchanged on success, fail on error and inconc otherwise - */ - function f_utAtspInitializeIut(template (value) UtInitialize p_utInitialize) runs on ItsCalm { - - utPort.send(p_utInitialize); - tc_wait.start; - alt { - [] utPort.receive(UtResult:true) { - tc_wait.stop; - log("*** f_utAtspInitializeIut: INFO: IUT initialized ***"); - } - [] utPort.receive { - tc_wait.stop; - log("*** f_utAtspInitializeIut: INFO: IUT could not be initialized ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_wait.timeout { - log("*** f_utAtspInitializeIut: INFO: IUT could not be initialized in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [else] { // Shortcut defaults - //f_sleep(0.050); // 50 ms - repeat; - } - } // End of 'alt' statement - - } // End of function f_utAtspInitializeIut - - /** - * @desc Send a NFsapPrimitivesDown primitive and wait for the NFsapPrimitivesUp confirm response - * @param p_utAtspEvent The NFsapPrimitivesDown request - * @param p_utAtspEventInd The NFsapPrimitivesDown response - * @param p_discard Set to true if responses shall be discard, otherwise the function failed - * @param p_result The response value - * @verdict Unchanged on success, fail on error and inconc otherwise - */ - function f_utAtspEventResponse( - in template (value) UtAtspEvent p_utAtspEvent, - in template (present) UtAtspEventInd p_utAtspEventInd, - in boolean p_discard, - out UtAtspEventInd p_result) - runs on ItsCalm { - -// log("*** f_utAtspEventResponse: INFO: Send message: ", p_commandReq, " ***"); - utPort.send(p_utAtspEvent); -// log("*** f_utAtspEventResponse: INFO: Expected UtCommandConfirm: ", p_commandConf, " ***"); - tc_wait.start; - alt { - [] utPort.receive(p_utAtspEventInd) -> value p_result { -// log("*** f_utAtspEventResponse: INFO: Receive expected confirm: message ***"); - tc_wait.stop; - } - [] utPort.receive(UtAtspEventInd:? ) -> value p_result { - if (p_discard == false) { - tc_wait.stop; - log("*** f_utAtspEventResponse: ERROR: Event not correctly indicated at application layer ***", p_result); - f_selfOrClientSyncAndVerdict("fail", e_error); - } - else { - log("*** f_utAtspEventResponse: INFO: Another event indicated at application layer, repeating check ***"); - repeat; - } - } - [] tc_wait.timeout { - if (p_discard == false) { - log("*** f_utAtspEventResponse: ERROR: Timeout while waiting for event check result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - else { - log("*** f_utAtspEventResponse: INFO: Event not indicated at application layer ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - } // End of 'alt' statement - - } // End of function f_utAtspEventResponse - - /** - * @desc Send a NFsapPrimitivesDown primitive and do not wait for the NFsapPrimitivesDown confirm response - * @param p_utAtspEvent The NFsapPrimitivesDown primitive - * @verdict Unchanged on success, fail otherwise - */ - function f_utAtspEvent( - in template (value) UtAtspEvent p_utAtspEvent - ) runs on ItsCalm { - var UtAtspEventInd v_utAtspEventInd; - - utPort.send(p_utAtspEvent); - tc_noac.start; - alt { - [] utPort.receive(UtAtspEventInd:?) -> value v_utAtspEventInd { // FIXME Use altstep for UtPort - tc_noac.stop; - log("*** f_utAtspEvent: INFO: Unexpected message was received ***", v_utAtspEventInd); - // FIXME Check the content of the notification, not sure which fields should be set - repeat; - } - [] tc_noac.timeout { - log("*** f_utAtspEvent: INFO: CommandRequest succeed ***"); - } - } // End of 'alt' statement - - } // End of function f_utAtspEvent - - } // End of group utFunctions - - /** - * @desc Config tester functions - */ - group cfFunctions { - - /** - * @desc Requests to initialize the configuration tester - * @param p_cfInitialize The initialisation to trigger. - * @verdict Unchanged on success, fail otherwise - */ - function f_cfAtspInitialize(template (value) CfInitialize p_cfInitialize) runs on ItsCalm { - - cfPort.send(p_cfInitialize); - tc_wait.start; - alt { - [] cfPort.receive(CfResult:true) { - tc_wait.stop; - log("*** f_cfAtspInitialize: INFO: Configuration tester initialized ***"); - } - [] cfPort.receive { - tc_wait.stop; - log("*** f_cfAtspInitialize: INFO: Configuration tester could not be initialized ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_wait.timeout { - log("*** f_cfAtspInitialize: INFO: Configuration tester could not be initialized in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [else] { // Shortcut defaults - //f_sleep(0.050); // 50 ms - repeat; - } - } // End of 'alt' statement - - } // End of function f_cfAtspInitialize - - /** - * @desc Await for notification on MN-SAP - * @param p_cfAtspEventInd The MN_Request_request notification message. - * @param p_discard Set to true if responses shall be discard, otherwise the function failed - * @verdict Unchanged on success, fail otherwise - */ -/* TODO To be removed function f_cfAtspAwaitNotificationToManagement( - in template CfAtspEventInd p_cfAtspEventInd, - in boolean p_discard - ) runs on ItsCalm { - var CfAtspEventInd p_result; - - log("*** f_cfAtspAwaitNotificationToManagement: INFO: Expected event: ", p_cfAtspEventInd, " ***"); - tc_wait.start; - alt { - [] cfPort.receive(p_cfAtspEventInd) { - tc_wait.stop; - log("*** f_cfAtspAwaitNotificationToManagement: INFO: Notification event received ***"); - } - [] cfPort.receive(CfAtspEventInd: ?) -> value p_result { - if (p_discard == false) { - tc_wait.stop; - log("*** f_cfAtspAwaitNotificationToManagement: ERROR: Another event indicated at application layer ***", p_result); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } else { - log("*** f_cfAtspAwaitNotificationToManagement: INFO: Another event indicated at application layer, repeating check ***"); - repeat; - } - } - [] tc_wait.timeout { - if (p_discard == false) { - log("*** f_cfAtspAwaitNotificationToManagement: ERROR: Timeout while waiting for event check result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } else { - log("*** f_cfAtspAwaitNotificationToManagement: INFO: Event not indicated at application layer ***"); - } - } - } // End of 'alt' statement - - } // End of function f_cfAtspAwaitNotificationToManagement -*/ - } // End of group cfFunctions - - /** - * @desc Test adapter setting functions - */ - group atspConfigurationFunctions { - - /** - * @desc This configuration features: - */ - function f_cf01Up() runs on ItsCalm { - - // Sanity check - - // Map - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - map(self:cfPort, system:cfPort); - map(self:atspPort, system:atspPort); - - // Connect - f_connect4SelfOrClientSync(); - - // Set processing on shutdown - activate(a_cf01Down()); - - // Initialize the component - f_initialiseComponent("cf01Up"); - - // Initialze the IUT - f_initialState(); - - } // End of function f_cf01Up - - /** - * @desc Deletes configuration cf01 - */ - function f_cf01Down() runs on ItsCalm { - - deactivate; - - // Unmap - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - unmap(self:cfPort, system:cfPort); - unmap(self:atspPort, system:atspPort); - - // Disconnect - f_disconnect4SelfOrClientSync(); - - } // End of f_cf01Down - - /** - * @desc Behavior function for initializing component's variables and tables - * @param p_componentName Name of the component - * @param p_iicpMGM Set to true if IISC port shall be used - */ - function f_initialiseComponent(in charstring p_componentName) runs on ItsMgt { - - // Initialize variables - - // Set defaults - activate(a_atspDefault()); - } // End of function f_initialiseComponent - } - - group preambles { - - /** - * @desc Brings the IUT into an initial state. - */ - function f_initialState() runs on ItsCalm { - f_utAtspInitializeIut(m_utAtspInitialize); - f_cfAtspInitialize(m_cfAtspInitialize); - f_sleepIgnoreDef(PX_WAIT_FOR_IUT_READY); // Wait until the IUT is in a stable situation - cfPort.clear; // Because TestConfigIICP should trigger management port deletion message - } // End of function f_initialState - - - /** - * @desc Checks whether the IUT is in the initial CI state "active". - */ - function f_initialCIstateActive() runs on ItsCalm return CIstatus { - var CIstatus v_CIstatus; - // CI status has to be "active" - v_CIstatus := f_cnGetCiStatusParameterValueCI( f_get_CI_LinkID()); - if( v_CIstatus != c_ciStatusActive) - // wrong status - { - // Request operator to switch on the SUT or to activate the IUT - action("Switch on SUT or activate IUT"); - f_cnAwaitRegistrationCI(f_get_CI_LinkID(), PX_CI_MED_TYPE, true); - f_cnAwaitEventNotificationCI(f_get_CI_LinkID(), mw_miEvent21218_5(mw_miCIStatusParam(c_ciStatusActive)), true); - v_CIstatus := f_cnGetCiStatusParameterValueCI( f_get_CI_LinkID()); - } - // check again CI status after activation of IUT - if( v_CIstatus != c_ciStatusActive) - { - log("*** f_initialCIstateActive: ERROR: Invalid initial CI status returned ***", v_CIstatus); - f_selfOrClientSyncAndVerdict("error", e_timeout); // Might be just a time-out error - stop; - } - else - { - log("*** f_initialCIstateActive: Allowed initial CI status returned ***", v_CIstatus); - } - return v_CIstatus - } - // End of function f_initialCIstateActive - - /** - * @desc Checks whether the IUT is in the initial CI state "active" or connected. - */ - function f_initialCIstateActiveConnected() runs on ItsCalm return CIstatus { - var CIstatus v_CIstatus; - // CI status has to be "active" - v_CIstatus := f_cnGetCiStatusParameterValueCI( f_get_CI_LinkID()); - if( (v_CIstatus != c_ciStatusActive) and (v_CIstatus != c_ciStatusConnected)) - // wrong status - { - // Request operator to switch on the SUT or to activate the IUT - action("Switch on SUT or activate IUT"); - f_cnAwaitRegistrationCI(f_get_CI_LinkID(), PX_CI_MED_TYPE, true); - f_cnAwaitEventNotificationCI(f_get_CI_LinkID(), mw_miEvent21218_5(mw_miCIStatusParam(c_ciStatusActive)), true); - v_CIstatus := f_cnGetCiStatusParameterValueCI( f_get_CI_LinkID()); - } - // check again CI status after activation of IUT - if( (v_CIstatus != c_ciStatusActive) and (v_CIstatus != c_ciStatusConnected)) - { - log("*** f_initialCIstateActive: ERROR: Invalid initial CI status returned ***", v_CIstatus); - f_selfOrClientSyncAndVerdict("error", e_timeout); // Might be just a time-out error - stop; - } - else - { - log("*** f_initialCIstateActive: Allowed initial CI status returned ***", v_CIstatus); - } - return v_CIstatus - } - // End of function f_initialCIstateActiveConnected - - /** - * @desc Checks whether the IUT is in an operational initial CI state - * i.e. not in "not-existent", "existent", "unknown". - */ - function f_initialCIstatesOperational() runs on ItsCalm return CIstatus { - var CIstatus v_CIstatus; - // CI status has to be in any CI state except "not_existent", "existent", "unknown". - v_CIstatus := f_cnGetCiStatusParameterValueCI( f_get_CI_LinkID()); - if( (v_CIstatus == c_ciStatusUnknown) or (v_CIstatus == c_ciStatusNot_existent) or (v_CIstatus == c_ciStatusExistent) ) - // wrong status - { - // Request operator to switch on the SUT or to activate the IUT - action("Switch on SUT or activate IUT"); - f_cnAwaitRegistrationCI(f_get_CI_LinkID(), PX_CI_MED_TYPE, true); - f_cnAwaitEventNotificationCI(f_get_CI_LinkID(), mw_miEvent21218_5(mw_miCIStatusParam(c_ciStatusActive)), true); - v_CIstatus := f_cnGetCiStatusParameterValueCI( f_get_CI_LinkID()); - } - // check again CI status after activation of IUT - if( (v_CIstatus == c_ciStatusUnknown) or (v_CIstatus == c_ciStatusNot_existent) or (v_CIstatus == c_ciStatusExistent) ) - { - log("*** f_initialCIstatesOperational: ERROR: Invalid initial CI status returned ***", v_CIstatus); - f_selfOrClientSyncAndVerdict("error", e_timeout); // Might be just a time-out error - stop; - } - else - { - log("*** f_initialCIstatesOperational: Allowed initial CI status returned ***", v_CIstatus); - } - return v_CIstatus - } - // End of function f_initialCIstatesOperational - - } // End of group preambles - - group postambles { - - /** - * @desc The default postamble. - */ - function f_poDefault() runs on ItsCalm { - // Nothing to do - } // End of function f_poDefault - - } // End of group postambles - - group adapterControl { - - /** - * @desc Triggers event in the test system adaptation. - * @param p_event The event to trigger - */ - function f_acTriggerEvent( - in template (value) AcFsapPrimitive p_event - ) runs on ItsCalm { -// log("*** f_acTriggerEvent: send: ", p_event, "***"); - acPort.send(p_event); - } - } // End of group adapterControl - - group atspFunctions { - - group miSAP { - - /** - * @desc Wait for Registration Request from IUT - * @param p_linkID Link-ID used by IUT - * @param p_medType MedType of IUT - * @param p_discard Unexpected Confirm messages will be discarded, or cause testcase failure - */ - function f_cnAwaitRegistrationCI( - in template Link_ID p_linkID, // PIXIT Element - in template MedType p_medType, // PIXIT Element - in boolean p_discard // set to TRUE - ) runs on ItsCalm { - if(PICS_DYNREG) - { - // Wait for MI-Request.request "RegReq" - f_cnAwaitAndConfirmMI_RequestCI(mw_miRegRequest(p_linkID, ?, m_regRequest(p_medType)), p_discard); - - // Reply MI-Command.request "RegCmd" - f_cnSendMICOMMAND_RequestCheckSuccessCI(m_miRegistrationCommandRequest( - p_linkID, - f_getNextCommandRef(), - m_regCommand(PX_ITS_SCU_ID, p_medType)), p_discard); - } - // Check for reception of Status notification (I-Parameter 12 "CIstatus" set to "registered". - f_cnAwaitEventNotificationCI(p_linkID, mw_miEvent21218_5(mw_miCIStatusParam(c_ciStatusRegistered)), p_discard); - } // End of function f_cnAwaitRegistrationCI - - /** - * @desc Wait for a specific MI-REQUEST and confirm it - * @param p_expectedMI_Request MI-Request to expect - * @param p_discard Unexpected request messages will be discarded, or cause testcase failure - */ - function f_cnAwaitAndConfirmMI_RequestCI( - in template MI_Request_request p_expectedMI_Request, - in boolean p_discard // set to TRUE - ) runs on ItsCalm { - var CfAtspEventInd v_result; - var template CfAtspEventInd v_cfAtspEventInd; - - v_cfAtspEventInd := mw_cfAtspRequestRequest(p_expectedMI_Request); - log("*** f_cnAwaitAndConfirmMI_RequestCI: DEBUG: Expected MI-REQUEST.request: ", v_cfAtspEventInd, " ***"); - tc_wait.start; - alt { - [] cfPort.receive(v_cfAtspEventInd) -> value v_result { - tc_wait.stop; - log("*** f_cnAwaitAndConfirmMI_RequestCI: INFO: MI-REQUEST.request received ***"); - f_cnConfirmMI_RequestCI(m_cfAtspRequestConfirm(v_result.miRequestRequest, c_ciErrStatusSuccess)); - } - [] cfPort.receive( { miRequestRequest := ? } ) -> value v_result { - if (p_discard == false) { - tc_wait.stop; - log("*** f_cnAwaitAndConfirmMI_RequestCI: ERROR: An unexpected MI-REQUEST.Request was received ***", v_result); - f_selfOrClientSyncAndVerdict("error", e_timeout); // to be checked - } else { - log("*** f_cnAwaitAndConfirmMI_RequestCI: DEBUG: An unexpected MI-REQUEST.Request was received, repeating check ***"); - f_cnConfirmMI_RequestCI(m_cfAtspRequestConfirm(v_result.miRequestRequest, c_ciErrStatusSuccess)); - repeat; - } - } - [] cfPort.receive(CfAtspEventInd : ?) -> value v_result { - if (p_discard == false) { - tc_wait.stop; - log("*** f_cnAwaitAndConfirmMI_RequestCI: ERROR: An unexpected message was received ***", v_result); - f_selfOrClientSyncAndVerdict("error", e_timeout); // to be checked - } else { - log("*** f_cnAwaitAndConfirmMI_RequestCI: INFO: An unexpected message was received, repeating check ***"); - repeat; - } - } - [] tc_wait.timeout { - if (p_discard == false) { - log("*** f_cnAwaitAndConfirmMI_RequestCI: ERROR: Timeout while waiting for event check result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); // to be checked - } else { // What is the purpose of this? - log("*** f_cnAwaitAndConfirmMI_RequestCI: INFO: Event not indicated at application layer ***"); - } - } - } // End of 'alt' statement - } // End of function f_cnAwaitAndConfirmMI_RequestCI - - /** - * @desc Send an MI-REQUEST confirmation - * @param p_MI_RequestConfirm Confirmation to send - */ - function f_cnConfirmMI_RequestCI( - in template(value) MI_Request_confirm p_MI_RequestConfirm - ) runs on ItsCalm { - //Local variables - var template CfAtspEvent v_cfConfirmEvent; - - v_cfConfirmEvent := m_cfAtspMIRequest_confirm(p_MI_RequestConfirm); - log("*** f_cnConfirmMI_RequestCI: DEBUG: Sending MI-REQUEST.confirm: ", v_cfConfirmEvent, " ***"); - cfPort.send(v_cfConfirmEvent); - } // End of function f_cnConfirmMI_RequestCI - - /** - * @desc Send an MI-COMMAND request - * @param p_sentMI_Command Command to send - */ - function f_cnSendMICOMMAND_RequestCI( - in template(value) MI_Command_request p_sentMI_Command - ) runs on ItsCalm { - var template CfAtspEvent v_cfCommandEvent; - - v_cfCommandEvent := m_cfAtspCommandReqEvent(p_sentMI_Command); - log("*** f_cnSendMICOMMAND_RequestCI: DEBUG: Sending MI-COMMAND.request: ", v_cfCommandEvent, " ***"); - cfPort.send(v_cfCommandEvent); - } // End of function f_cnSendMICOMMAND_RequestCI - - /** - * @desc Send an MI-COMMAND request and wait for confirmation - * @param p_sentMI_Command Command to send wait confirmation for - * @param p_discard Unexpected Request messages will be discarded, or cause testcase failure - */ - function f_cnSendMICOMMAND_RequestCheckSuccessCI( - in template(value) MI_Command_request p_sentMI_Command, - in boolean p_discard // set to TRUE - ) runs on ItsCalm { - - f_cnSendMICOMMAND_RequestCI(p_sentMI_Command); - f_cnAwaitCommandConfirmSuccess(p_sentMI_Command, p_discard); - } // End of function f_cnSendMICOMMAND_RequestCheckSuccessCI - - /** - * @desc Await success confirmation for a specific command - * @param p_sentMI_Command Command to wait confirmation for - * @param p_discard Unexpected Confirm messages will be discarded, or cause testcase failure - */ - function f_cnAwaitCommandConfirmSuccess( - in template(value) MI_Command_request p_sentMI_Command, - in boolean p_discard // set to TRUE - ) runs on ItsCalm { - f_cnAwaitCommandConfirm(p_sentMI_Command, c_ciErrStatusSuccess, p_discard); - } // End of function f_cnAwaitCommandConfirmSuccess - - /** - * @desc Await confirmation with a specific content for a specific command - * @param p_sentMI_Command Command to wait confirmation for - * @param p_expectedStatus The specific status to expect - * @param p_discard Unexpected Confirm messages will be discarded, or cause testcase failure - */ - function f_cnAwaitCommandConfirm( - in template(value) MI_Command_request p_sentMI_Command, - in template(value) ErrStatus p_expectedStatus, - in boolean p_discard // set to TRUE - ) runs on ItsCalm { - var CfAtspEventInd v_result; - var template CfAtspEventInd v_cfAtspEventInd; - var template CfAtspEventInd v_cfAtspEventReq; - - v_cfAtspEventInd := mw_cfAtspCommandConfirm( - m_miCommandConfirm( - p_sentMI_Command.linkID, - p_sentMI_Command.commandRef, - p_expectedStatus)); - - v_cfAtspEventReq := mw_cfAtspRequestRequest( - mw_miEventsRequest( - p_sentMI_Command.linkID, - ?, - ?)); - - log("*** f_cnAwaitCommandConfirm: DEBUG: Expected MI-COMMAND.confirm: ", v_cfAtspEventInd, " ***"); - tc_wait.start; - alt { - [] cfPort.receive(v_cfAtspEventInd) -> value v_result { - tc_wait.stop; - log("*** f_cnAwaitCommandConfirm: INFO: Expected MI-COMMAND.confirm received ***"); - } - [] cfPort.receive( { miCommandConfirm := ? } ) -> value v_result { - tc_wait.stop; - log("*** f_cnAwaitCommandConfirm: ERROR: An unexpected MI-COMMAND.confirm was received ***", v_result); - f_selfOrClientSyncAndVerdict("error", e_timeout); // to be checked - } - [] cfPort.receive( v_cfAtspEventReq ) -> value v_result { - if (p_discard == false) { - tc_wait.stop; - log("*** f_cnAwaitCommandConfirm: ERROR: An unexpected MI-COMMAND.confirm was received ***", v_result); - f_selfOrClientSyncAndVerdict("error", e_timeout); // to be checked - } else { - log("*** f_cnAwaitCommandConfirm: INFO: An unexpected MI-COMMAND.confirm was received, repeating check ***"); - f_cnConfirmMI_RequestCI(m_cfAtspRequestConfirm(v_result.miRequestRequest, c_ciErrStatusSuccess)); - repeat; - } - } - [] cfPort.receive(CfAtspEventInd : ? ) -> value v_result { - if (p_discard == false) { - tc_wait.stop; - log("*** f_cnAwaitCommandConfirm: ERROR: An unexpected message was received ***", v_result); - f_selfOrClientSyncAndVerdict("error", e_timeout); // to be checked - } else { - log("*** f_cnAwaitCommandConfirm: INFO: An unexpected message was received, repeating check ***"); - repeat; - } - } - [] tc_wait.timeout { - if (p_discard == false) { - log("*** f_cnAwaitCommandConfirm: ERROR: Timeout while waiting for event check result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); // to be checked - } else { // What is the purpose of this? - log("*** f_cnAwaitCommandConfirm: INFO: Event not indicated at application layer ***"); - } - } - } // End of 'alt' statement - } // End of function f_cnAwaitCommandConfirm - - - /** - * @desc Return the number of VCIs values in the I-Parameter 33 - * @param p_iParam VirtualCis parameter to check - */ - function f_getVirualCIcount( - in I_Param p_iParam - ) return integer{ - if(p_iParam.paramNo == c_ciIParamNoVirtualCI) - { - return lengthof(p_iParam.parameter.VirtualCIs); - } - return 0; - } // End of function f_checkNoVirualCIs - - /** - * @desc Force CI to change state, wait for notification of reaching specific state - * @param p_linkID Link-ID used by IUT - * @param p_newState New state to force - * @param p_expectedStatus State to wait notification of - * @param p_discard Unexpected Confirm messages will be discarded, or cause testcase failure - */ - function f_cnTriggerStateChangeAndWaitCI( - in Link_ID p_linkID, // PIXIT Element - in CIstateChng p_newState, - in CIstatus p_expectedStatus, - in boolean p_discard // set to TRUE - ) runs on ItsCalm { - //Local variables - - f_cnSendMICOMMAND_RequestCheckSuccessCI(m_miStateChangeCommandRequest( - p_linkID, - f_getNextCommandRef(), - p_newState), true); - - f_cnAwaitEventNotificationCI(p_linkID, mw_miEvent21218_5( - mw_miCIStatusParam(p_expectedStatus)), p_discard); - } // End of function f_cnTriggerStateChangeAndWaitCI - - /** - * @desc Wait for a specific event, respond with confirmation - * @param p_linkID Link-ID used by IUT - * @param p_ev21218 21218 event to expect - * @param p_discard Unexpected event request messages will be discarded, or cause testcase failure - */ - function f_cnAwaitEventNotificationCI( - in template Link_ID p_linkID, // PIXIT Element - in template Events21218 p_ev21218, - in boolean p_discard // set to TRUE - ) runs on ItsCalm { - f_cnAwaitAndConfirmMI_RequestCI(mw_miEventsRequest(p_linkID, ?, p_ev21218), p_discard); - } // End of function f_cnAwaitEventNotificationCI - - /** - * @desc Set parameter values - * @param p_linkID Link-ID used by IUT - * @param p_paramValueList Parameter list to set values of - * @param p_discard Unexpected Confirm messages will be discarded, or cause testcase failure - * @return List of Errors representing set command success - */ - function f_cnSetIParameterValueCI( - in template Link_ID p_linkID, // PIXIT Element - in IParamList p_paramValueList, - in boolean p_discard // set to TRUE - ) runs on ItsCalm return Errors { - //local variable(s) - var template CfAtspEvent v_setCIparams; - var template CfAtspEventInd v_cfSetSuccess; - var Errors v_cfSetErrorList; - var CfAtspEventInd v_result; - var CommandRef v_commandRef := f_getNextCommandRef(); - - v_setCIparams := m_cfAtspSetReqEvent( - m_miSetRequest( - p_linkID, - v_commandRef, - p_paramValueList - ) - ); - cfPort.send(v_setCIparams); - - v_cfSetSuccess := mw_cfAtspEventIndSetConf( - mw_miSetConfirm(p_linkID, v_commandRef, ?)); - log("*** f_cnSetIParameterValueCI: INFO: Expected MI-Set.confirm: ", v_cfSetSuccess, " ***"); - tc_wait.start; - alt { - [] cfPort.receive(v_cfSetSuccess) -> value v_result{ - tc_wait.stop; - f_selfOrClientSyncAndVerdict("Expected message received", e_success); - log("*** f_cnSetIParameterValueCI: INFO: Expected 'MI-Set.confirm' received ***"); - v_cfSetErrorList := v_result.miSetConfirm.set_param; - } - [] cfPort.receive(CfAtspEventInd : ? ) -> value v_result { - if (p_discard == false) { - tc_wait.stop; - log("*** f_cnSetIParameterValueCI: ERROR: An unexpected MI-COMMAND was received ***", v_result); - f_selfOrClientSyncAndVerdict("error", e_error); // to be checked - } else { - log("*** f_cnSetIParameterValueCI: INFO: An unexpected MI-COMMAND was received, repeating check ***"); - repeat; - } - } - [] tc_wait.timeout { - if (p_discard == false) { - log("*** f_cnSetIParameterValueCI: ERROR: Timeout while waiting for event check result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); // to be checked - } else { // What is the purpose of this? - log("*** f_cnSetIParameterValueCI: INFO: Event not indicated at application layer ***"); - } - } - } // End of 'alt' statement - return v_cfSetErrorList; - } // End of function f_cnSetIParameterValueCI - - /** - * @desc Get parameter values - * @param p_linkID Link-ID used by IUT - * @param p_paramList Parameter list to get values of - * @param p_discard Unexpected Confirm messages will be discarded, or cause testcase failure - * @return List of IParameter values requested - */ - function f_cnGetIParameterValueCI( - in template Link_ID p_linkID, // PIXIT Element - in IParamNoList p_paramList, - in boolean p_discard // set to TRUE - ) runs on ItsCalm return IParamList { - //local variable(s) - var template CfAtspEvent v_getCIparam; - var template CfAtspEventInd v_cfGetSuccess; - var IParamList v_paramValueList := {}; - var CfAtspEventInd v_result; - var CommandRef c_commandRef := f_getNextCommandRef(); - - v_getCIparam := m_cfAtspGetReqEvent( - m_miGetRequest( - p_linkID, - c_commandRef, - p_paramList - ) - ); - cfPort.send(v_getCIparam); - - v_cfGetSuccess := mw_cfAtspEventIndGetConf( - mw_miGetConfirm(p_linkID, c_commandRef, ?)); - log("*** f_cnGetIParameterValueCI: INFO: Expected MI-Get.confirm: ", v_cfGetSuccess, " ***"); - tc_wait.start; - alt { - [] cfPort.receive(v_cfGetSuccess) -> value v_result{ - tc_wait.stop; - log("*** f_cnGetIParameterValueCI: INFO: Expected 'MI-Get.confirm' received ***"); - v_paramValueList := v_result.miGetConfirm.get_param; - } - [] cfPort.receive(CfAtspEventInd : ?) -> value v_result { - if (p_discard == false) { - tc_wait.stop; - log("*** f_cnGetIParameterValueCI: ERROR: An unexpected MI-COMMAND was received ***", v_result); - f_selfOrClientSyncAndVerdict("error", e_timeout); // to be checked - } else { - log("*** f_cnGetIParameterValueCI: INFO: An unexpected MI-COMMAND was received, repeating check ***"); - repeat; - } - } - [] tc_wait.timeout { - if (p_discard == false) { - log("*** f_cnGetIParameterValueCI: ERROR: Timeout while waiting for event check result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); // to be checked - } else { // What is the purpose of this? - log("*** f_cnGetIParameterValueCI: INFO: Event not indicated at application layer ***"); - } - } - } // End of 'alt' statement - return v_paramValueList; - }// End of function f_cnGetIParameterValueCI - - /** - * @desc Get current CiStatus IParameter value - * @param p_linkID Link-ID used by IUT - * @return The CIstatus value returned - */ - function f_cnGetCiStatusParameterValueCI( - in template Link_ID p_linkID // PIXIT Element - ) runs on ItsCalm return CIstatus { - //local variable(s) - var template CfAtspEvent v_getCIparam; - var template CfAtspEventInd v_cfGetCiStatusValue; - var CIstatus v_ciStatus; - var CfAtspEventInd v_result; - var CommandRef v_commandRef := f_getNextCommandRef(); - - v_ciStatus := c_ciStatusUnknown; // initialization with unknown status - - v_getCIparam := m_cfAtspGetReqEvent( - m_miGetRequest( - p_linkID, - v_commandRef, - { c_ciIParamNoCiStatus } ) ); - cfPort.send(v_getCIparam); - - v_cfGetCiStatusValue := mw_cfAtspEventIndGetConf( - mw_miGetConfirm(p_linkID, v_commandRef, { - { - paramNo := c_ciIParamNoCiStatus, - parameter := { - CIstatus := ? - } - } - })); - log("*** f_cnGetCiStatusParameterValueCI: INFO: Expected MI-Get.confirm: ", v_cfGetCiStatusValue, " ***"); - tc_wait.start; - alt { - [] cfPort.receive(v_cfGetCiStatusValue) -> value v_result{ - tc_wait.stop; - log("*** f_cnGetCiStatusParameterValueCI: INFO: Expected 'MI-Get.confirm' received ***"); - v_ciStatus := v_result.miGetConfirm.get_param[0].parameter.CIstatus; - } - [] cfPort.receive(CfAtspEventInd : ?) -> value v_result { - tc_wait.stop; - log("*** f_cnGetCiStatusParameterValueCI: ERROR: An unexpected MI-COMMAND was received ***", v_result); - repeat; - } - [] tc_wait.timeout { - log("*** f_cnGetCiStatusParameterValueCI: ERROR: Timeout while waiting for event check result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } // End of 'alt' statement - return v_ciStatus; - }// End of function f_cnGetCiStatusParameterValueCI - - /** - * @desc Test addressability of CI using Get current CiStatus IParameter value - * @param p_linkID Link-ID used by IUT - * @return The CIstatus value returned - */ - function f_cnTestGetCiStatusParameterValueNoReplyExpected( - in template Link_ID p_linkID - ) runs on ItsCalm { - //local variable(s) - var template CfAtspEvent v_getCIparam; - var template CfAtspEventInd v_cfGetCiStatusValue; - var CIstatus v_ciStatus; - var CfAtspEventInd v_result; - var CommandRef v_commandRef := f_getNextCommandRef(); - - v_getCIparam := m_cfAtspGetReqEvent( - m_miGetRequest( - p_linkID, - v_commandRef, - { c_ciIParamNoCiStatus } - ) - ); - cfPort.send(v_getCIparam); - - v_cfGetCiStatusValue := mw_cfAtspEventIndGetConf( - mw_miGetConfirm(p_linkID, v_commandRef, { - { - paramNo := c_ciIParamNoCiStatus, - parameter := { - CIstatus := ? - } - } - })); - log("*** f_cnTestGetCiStatusParameterValueNoReplyExpected: INFO: MI-Get.request sent", v_getCIparam, " ***"); - tc_ac.start; - alt { - [] cfPort.receive(v_cfGetCiStatusValue){ - tc_ac.stop; - log("*** f_cnTestGetCiStatusParameterValueNoReplyExpected: ERROR: Unexpected 'MI-Get.confirm' received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** f_cnTestGetCiStatusParameterValueNoReplyExpected: INFO: Expected Timeout ***"); - f_selfOrClientSyncAndVerdict("expected timeout", e_success); - } - } // End of 'alt' statement - }// End of function f_cnTestGetCiStatusParameterValueNoReplyExpected - - } // End of group miSAP - - group utPort { - - /** - * @desc Send IN-UNITDATA.Request message - * @param p_source_addr Source address value - * @param p_dst_addr Destination address value - * @param p_data Data to send - * @param p_priority Priority value - */ - function f_utSendIN_UNITDATA_Request( - in template(value) LLserviceAddr p_source_addr, - in template(value) LLserviceAddr p_dst_addr, - in template(value) INdata p_data, - in template(value) UserPriority p_priority - ) runs on ItsCalm { - var template UtAtspEvent v_utAtspEvent := m_utAtspEventDown(m_inPrimitivesDownUDR( - m_inUnitDataRequest(p_source_addr, p_dst_addr, p_data, p_priority))); - log("*** f_fnIN_UNITDATA_Request: INFO: Sending IN-UNITDATA.request: ", v_utAtspEvent, " ***"); - utPort.send(v_utAtspEvent); - - if(PICS_IN_UNITDATA_STATUS) - { - var template UtAtspEventInd v_result; - var template UtAtspEventInd v_recv := { - inSapPrimitivesUp := { - spRef := 1, - servPrimitive := { - IN_UNITDATA_STATUS_indication := { - source_addr := p_source_addr, - dest_addr := p_dst_addr, - data := p_data, - priority := p_priority, - accessParams := m_inUnitdataDefaultAP, - txStatus := c_ciINtxStatus_Success - } - } - } - }; - tc_wait.start; - alt { - [] utPort.receive(v_recv){ - tc_wait.stop; - log("*** f_utSendIN_UNITDATA_Request: INFO: IN-UNITDATA-STATUS.indication received ***"); - } - [] utPort.receive(UtAtspEventInd : ?) { - tc_wait.stop; - log("*** f_utSendIN_UNITDATA_Request: ERROR: An unexpected message was received ***", v_result); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_wait.timeout { - log("*** f_utSendIN_UNITDATA_Request: ERROR: Timeout while waiting for event check result ***"); - f_selfOrClientSyncAndVerdict("timeout", e_timeout); - } - } // End of 'alt' statement - } - }// End of function f_utSendIN_UNITDATA_Request - - /** - * @desc Check proper executing of MI-SET.command for a single I-Parameter - * @param p_cfSetErrorList Error list returned in MI-SET.confirm - * @return Boolean: TRUE = success - */ - function f_cnCheckOneIparamSetSuccess( - in I_ParamNo p_IparmNo, - in Errors p_cfSetErrorList - ) runs on ItsCalm return boolean { - //local variable(s) - var boolean v_returnValue; - - if(lengthof(p_cfSetErrorList) == 0){ - // no error occured - v_returnValue := true; - } - else if(lengthof(p_cfSetErrorList) == 1){ - // correct number or error statuses reported - if(p_cfSetErrorList[0].paramNo == p_IparmNo) { - // report for correct parameter - if (p_cfSetErrorList[0].errStatus == c_ciErrStatusSuccess) { - // success reported - v_returnValue := true; - } - else { - // Error reported - log("*** f_cnCheckOneIparamSetSuccess: ERROR: writing I-Parameter. Error code: ", p_cfSetErrorList[0].errStatus, " ***"); - v_returnValue := false; - } - } - else { - // Report for incorrect parameter - log("*** f_cnCheckOneIparamSetSuccess: ERROR: writing I-Parameter: wrong I-ParamNo: ", p_cfSetErrorList[0].paramNo, " ***"); - v_returnValue := false; - } - } - else { - // Incorrect size of Error list - log("*** f_cnCheckOneIparamSetSuccess: ERROR: writing I-Parameter: too many errors: ", lengthof(p_cfSetErrorList), " ***"); - v_returnValue := false; - } - - return v_returnValue; - }// End of function f_cnCheckOneIparamSetSuccess - - - /** - * @desc Check proper executing of MI-GET.command for a single I-Parameter - * @param p_returnedValues Value list returned in MI-GET.confirm - * @return Boolean: TRUE = success - */ - function f_cnCheckOneIparamGetSuccess( - in I_ParamNo p_IparmNo, - in IParamList p_IparameterList, - out I_Param p_Iparam - ) runs on ItsCalm return boolean { - //local variable(s) - var boolean v_returnValue; - - if(lengthof(p_IparameterList) == 1){ - // correct number or returned values - if(p_IparameterList[0].paramNo == p_IparmNo) { - // correct parameter returned - p_Iparam := p_IparameterList[0]; - log("*** f_cnCheckOneIparamGetSuccess: INFO: reading I-Parameter: ", p_IparmNo, " was correctly done: ", p_IparameterList[0].parameter, " ***"); - v_returnValue := true; - } - else { - v_returnValue := false; - // Report for incorrect parameter - if(p_IparameterList[0].paramNo==c_ciIParamNoErrors){ - // Error Code was returned - log("*** f_cnCheckOneIparamGetSuccess: ERROR: reading I-Parameter error: ", p_IparameterList[0].parameter, " was reported ***"); - } - else { - log("*** f_cnCheckOneIparamGetSuccess: ERROR: the following I-Parameter: ", p_IparameterList[0].paramNo, " was was returned ***"); - } - } - } - else { - // incorrect number or returned values - log("*** f_cnCheckOneIparamGetSuccess: ERROR: writing I-Parameter: too many errors: ", lengthof(p_IparameterList), " ***"); - v_returnValue := false; - } - - return v_returnValue; - }// End of function f_cnCheckOneIparamGetSuccess - - - } // End of group utPort - - group atspPort { - - /** - * @desc Send IN-UNITDATA.Request message - * @param p_source_addr Source address value - * @param p_dst_addr Destination address value - * @param p_data Data to send - * @param p_priority Priority value - */ - function f_atspSendIN_UNITDATA_Request( - in template(value) LLserviceAddr p_source_addr, - in template(value) LLserviceAddr p_dst_addr, - in template(value) INdata p_data, - in template(value) UserPriority p_priority - ) runs on ItsCalm { - var template AtspReq v_atspReq := m_atspReq(m_inPrimitivesDownUDR( - m_inUnitDataRequest(p_source_addr, p_dst_addr, p_data, p_priority))); - log("*** f_fnIN_UNITDATA_Request: INFO: Sending IN-UNITDATA.request: ", v_atspReq, " ***"); - atspPort.send(v_atspReq); - - if(PICS_IN_UNITDATA_STATUS) // this is applicable for the radio used to connect ITS test system with IUT - { - var template AtspInd v_result; - var template AtspInd v_recv := { - msgIn := { - spRef := 1, - servPrimitive := { - IN_UNITDATA_STATUS_indication := { - source_addr := p_source_addr, - dest_addr := p_dst_addr, - data := p_data, - priority := p_priority, - accessParams := m_inUnitdataDefaultAP, - txStatus := c_ciINtxStatus_Success - } - } - } - } - tc_wait.start; - alt { - [] atspPort.receive(v_recv){ - tc_wait.stop; - log("*** f_utSendIN_UNITDATA_Request: INFO: IN-UNITDATA-STATUS.indication received ***"); - } - [] atspPort.receive(AtspInd : { msgIn := ?, receptionTime := ? }/*TODO Use a template*/ ) -> value v_result { - tc_wait.stop; - log("*** f_utSendIN_UNITDATA_Request: ERROR: An unexpected message was received ***", v_result); - f_selfOrClientSyncAndVerdict("error", e_timeout); // to be checked - } - [] tc_wait.timeout { - log("*** f_utSendIN_UNITDATA_Request: ERROR: Timeout while waiting for event check result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); // to be checked - } - } // End of 'alt' statement - - } // End of if block - - } // End of function f_atspSendIN_UNITDATA_Request - - } // End of group atspPort - - } // End of group atspFunctions - - group atspAltsteps { - - /** - * @desc The base default. - */ - altstep a_atspDefault() runs on ItsMgt { - [] tc_wait.timeout { - log("*** a_atspDefault: ERROR: Timeout while awaiting reaction of the IUT prior to Upper Tester action ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] tc_ac.timeout { - log("*** a_atspDefault: ERROR: Timeout while awaiting the reception of a message ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] any timer.timeout { - log("*** a_atspDefault: INCONC: An unknown timer has expired in default ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] a_shutdown() { - f_poDefault(); - log("*** a_atspDefault: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - if(self == mtc) { - f_cf01Down(); - } - stop; - } - } // End of altstep a_fsapDefault() - - - /** - * @desc Default handling cf01 de-initialisation. - */ - altstep a_cf01Down() runs on ItsMgt { - [] a_shutdown() { - f_poDefault(); - f_cf01Down(); - log("*** a_cf01Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } // End of altstep a_cf01Down() - - } // End of group fsapAltsteps - - group atspPIXITHelperFunctions - { - /** - * @desc used to address a VCI in IUT, e.g. to be deleted - */ - function f_get_VCI_LinkID( - in EUI64 p_remoteCIID - ) return Link_ID { - if(PICS_MAC48) - { - return {remoteCIID := p_remoteCIID, localCIID := PX_LOCAL_CIID} - } - else - { - return { remoteCIID := p_remoteCIID, - localCIID := f_get_EUI64_LegacyCI(0, PX_ITS_SCU_ID, PX_Med_ID, 0)} - } - } // end - - /** - * @desc used to address CI in IUT itself. - */ - function f_get_CI_LinkID() return Link_ID{ - if(PICS_MAC48) - { - return {remoteCIID := PX_REMOTE_CIID_LOCAL_CI, localCIID := PX_LOCAL_CIID} - } - else - { - return { remoteCIID := f_get_EUI64_LegacyCI(0, PX_ITS_SCU_ID, PX_Med_ID, 0), - localCIID := f_get_EUI64_LegacyCI(0, PX_ITS_SCU_ID, PX_Med_ID, 0)} - } - } // end - - /** - * @desc Local CIID value part of the IUT itself - */ - function f_get_CI_Local_CIID() return EUI64{ - if(PICS_MAC48) - { - return PX_LOCAL_CIID; - } - else - { - return f_get_EUI64_LegacyCI(0, PX_ITS_SCU_ID, PX_Med_ID, 0); - } - } // end - - /** - * @desc used to address CI in the Test System itself - */ - function f_get_TesterCI_LinkID() return Link_ID{ - if(PICS_MAC48) - { - return {remoteCIID := PX_TESTER_REMOTE_CIID_LOCAL_CI, localCIID := PX_TESTER_LOCAL_CIID} - } - else - { - return { remoteCIID := f_get_EUI64_LegacyCI(0, 0, 0, 0), - localCIID := f_get_EUI64_LegacyCI(0, 0, 0, 0)} - } - } // end - - /** - * @desc used to send via a UC-VCI - */ - // source_address field - // use f_get_CI_LinkID - - /** - * @desc used to send via a UC-VCI in the IUT - */ - // destination_address field - function f_get_DestinationVCI_UC_LinkID() return Link_ID{ - if(PICS_MAC48) - { - return {remoteCIID := PX_REMOTE_CIID_UC , localCIID := PX_LOCAL_CIID} - } - else - { - return { remoteCIID := f_get_EUI64_LegacyCI(0, PX_ITS_SCU_ID, PX_Med_ID, PX_VCI_SERIAL_NUMBER), - localCIID := f_get_EUI64_LegacyCI(0, PX_ITS_SCU_ID, PX_Med_ID, 0)} - } - } // End of function f_get_DestinationVCI_UC_LinkID - - /** - * @desc used to send via a UC-VCI in the Test System to the IUT - */ - // destination_address field - function f_get_TesterDestinationVCI_UC_LinkID() return Link_ID{ - if(PICS_MAC48) - { - return {remoteCIID := PX_TESTER_REMOTE_CIID_LOCAL_CI , localCIID := PX_TESTER_LOCAL_CIID} - } - else - { - return { remoteCIID := f_get_EUI64_LegacyCI(0, 0, 0, 255), - localCIID := f_get_EUI64_LegacyCI(0, 0, 0, 0)} - } - } // End of function f_get_DestinationVCI_UC_LinkID - - /** - * @desc used to send via a BC-VCI in the IUT - */ - // source_address field - // use f_get_CI_LinkID - - /** - * @desc used to send via a BC-VCI - */ - // destination_address field - function f_get_DestinationVCI_BC_LinkID() return Link_ID{ - if(PICS_MAC48) - { - return {remoteCIID := PX_REMOTE_CIID_BC, localCIID := PX_LOCAL_CIID} - } - else - { - return { remoteCIID := f_get_EUI64_LegacyCI(63, PX_ITS_SCU_ID, PX_Med_ID, 65535), - localCIID := f_get_EUI64_LegacyCI(0, PX_ITS_SCU_ID, PX_Med_ID, 0)} - } - } // End of function f_get_DestinationVCI_BC_LinkID - - /** - * @desc used to send via a BC-VCI in the Test System to the IUT - */ - // destination_address field - function f_get_TesterDestinationVCI_BC_LinkID() return Link_ID{ - if(PICS_MAC48) - { - return {remoteCIID := PX_REMOTE_CIID_BC, localCIID := PX_TESTER_LOCAL_CIID} - } - else - { - return { remoteCIID := f_get_EUI64_LegacyCI(63, 0, 0, 65535), - localCIID := f_get_EUI64_LegacyCI(0, 0, 0, 0)} - } - } // End of function f_get_TesterDestinationVCI_BC_LinkID - - /** - * @desc used to send via a BC-VCI in the IUT - */ - // source_address field - // use f_get_CI_LinkID - - /** - * @desc used to send via a MC-VCI - */ - // destination_address field - function f_get_DestinationVCI_MC_LinkID() return Link_ID{ - if(PICS_MAC48) - { - return {remoteCIID := PX_REMOTE_CIID_MC, localCIID := PX_LOCAL_CIID} - } - else - { - return { remoteCIID := f_get_EUI64_LegacyCI(PX_LEGACY_VCI_MC_GROUP_ID, PX_ITS_SCU_ID, PX_Med_ID, PX_VCI_SERIAL_NUMBER_MC), - localCIID := f_get_EUI64_LegacyCI(0, PX_ITS_SCU_ID, PX_Med_ID, 0)} - } - - } // End of function f_get_DestinationVCI_MC_LinkID - - /** - * @desc used to send via a MC-VCI in the Test System to the IUT - */ - // destination_address field - function f_get_TesterDestinationVCI_MC_LinkID() return Link_ID{ - if(PICS_MAC48) - { - return {remoteCIID := PX_REMOTE_CIID_MC, localCIID := PX_TESTER_LOCAL_CIID} - } - else - { - return { remoteCIID := f_get_EUI64_LegacyCI(PX_LEGACY_VCI_MC_GROUP_ID, 0, 0, PX_VCI_SERIAL_NUMBER_MC), - localCIID := f_get_EUI64_LegacyCI(0, 0, 0, 0)} - } - - } // End of function f_get_TesterDestinationVCI_MC_LinkID - - /** - * @desc used to create the EUI64 format of a legacy CI - * @param p_uCmCbCnumber 63 for BC, 0 for UC, 1-62 for MC group - * @param p_iTS_scuID ITS-SCU-ID - * @param p_medID MedID - * @param p_vCIserialNumber Serial number unique in CI - */ - function f_get_EUI64_LegacyCI ( - in UInt6 p_uCmCbCnumber, - in ITS_scuId p_iTS_scuID, - in MedID p_medID, - in VCIserialNumber p_vCIserialNumber - ) return EUI64 { - var UInt8 v_U8Integer; - var EUI64 v_returnValue; - - v_U8Integer:= p_uCmCbCnumber * 4 +3; // 'shift left' two bits and set two lowest bits to one. - v_returnValue := int2oct(v_U8Integer,1) & - int2oct(p_iTS_scuID,2) & - 'FFFE'O & - int2oct(p_medID,1) & - int2oct(p_vCIserialNumber,2); - log("f_get_EUI64_LegacyCI: DEBUG: returns ", v_returnValue, " ***"); - return v_returnValue; - } // End of function f_get_EUI64_LegacyCI - - } // End of group atspPIXITHelperFunctions - -} // End of module LibItsAtsp_Functions diff --git a/ttcn/CALM/ATSP/LibItsAtsp_Pics.ttcn3 b/ttcn/CALM/ATSP/LibItsAtsp_Pics.ttcn3 deleted file mode 100644 index e9c3f495..00000000 --- a/ttcn/CALM/ATSP/LibItsAtsp_Pics.ttcn3 +++ /dev/null @@ -1,232 +0,0 @@ -/** - * @author ETSI / STF455 - * @version $URL$ - * $Id$ - * @desc Access Technology Layer (ISO 21218) PICS - */ -module LibItsAtsp_Pics { - - /** - * @desc ATSP PICS - */ - group atspPics { - - /** - * @desc PICS mnemonics for ISO 21218 "ITS - CALM - Access Technology Support" - * @see ETSI TS 102 760-1 v_stf455_v06 - */ - modulepar boolean PICS_ACT := false; - - /** - * @desc Is IUT supporting BC-VCI transmitter? - * @see ETSI TS 102 760-1 v_stf455_v06 C.11/4 - */ - modulepar boolean PICS_BCVCI := false; - - /** - * @desc Is IUT of CI access class CIAC-1 (no user authentiaction required, usage of CI is free of charge)? - * @see ETSI TS 102 760-1 v_stf455_v06 C.6/1 - */ - modulepar boolean PICS_CIAC1 := false; - - /** - * @desc Is IUT of CI access class CIAC-2 (access credentials required, usage of CI is subject of a service charge? - * @see ETSI TS 102 760-1 v_stf455_v06 C.6/2 - */ - modulepar boolean PICS_CIAC2 := false; - - /** - * @desc Is IUT of CI access class CIAC-3 (access credentials required, usage of CI is free of charge)? - * @see ETSI TS 102 760-1 v_stf455_v06 C.6/3 - */ - modulepar boolean PICS_CIAC3 := false; - - /** - * @desc Is IUT of CI class CIC-il1 (non-deterministic ITS station-internal network interface)? - * @see ETSI TS 102 760-1 v_stf455_v06 C.5/6 - */ - modulepar boolean PICS_CIC_il1 := false; - - /** - * @desc Is IUT of CI class CIC-il2 (deterministic ITS station-internal network interface)? - * @see ETSI TS 102 760-1 v_stf455_v06 C.5/7 - */ - modulepar boolean PICS_CIC_il2 := false; - - /** - * @desc Is IUT of CI class CIC-l1 (multiple simultaneous peer stations transceiver)? - * @see ETSI TS 102 760-1 v_stf455_v06 C.5/1 - */ - modulepar boolean PICS_CIC_l1 := false; - - /** - * @desc Is IUT of CI class CIC-l2 (single peer station transceiver)? - * @see ETSI TS 102 760-1 v_stf455_v06 C.5/2 - */ - modulepar boolean PICS_CIC_l2 := false; - - /** - * @desc Is IUT of CI class CIC-l3 (groupcast transmitter only)? - * @see ETSI TS 102 760-1 v_stf455_v06 C.5/3 - */ - modulepar boolean PICS_CIC_l3 := false; - - - /** - * @desc Is IUT of CI class CIC-l4 (broadcast receiver only)? - * @see ETSI TS 102 760-1 v_stf455_v06 C.5/4 - */ - modulepar boolean PICS_CIC_l4 := false; - - /** - * @desc Is IUT of CI class CIC-l5 (CEN / Japanese DSRC)? - * @see ETSI TS 102 760-1 v_stf455_v06 C.5/5 - */ - modulepar boolean PICS_CIC_l5 := false; - - /** - * @desc Is IUT supporting the connection procedure? - * @see ETSI TS 102 760-1 v_stf455_v06 C.11/7 - */ - modulepar boolean PICS_CONN := false; - - /** - * @desc Is IUT supporting the Cross-CI prioritization - interferer procedure? - * @see ETSI TS 102 760-1 v_stf455_v06 C.11/10 - */ - modulepar boolean PICS_CRCIP_I := false; - - /** - * @desc Is IUT supporting the Cross-CI prioritization - victim procedure? - * @see ETSI TS 102 760-1 v_stf455_v06 C.11/9 - */ - modulepar boolean PICS_CRCIP_V := false; - - /** - * @desc Is IUT supporting deletion of VCIs? - * @see ETSI TS 102 760-1 v_stf455_v04 C.11/18 - */ - modulepar boolean PICS_DELET := false; - /** - * @desc Is IUT supporting the disconnection procedure? - * @see ETSI TS 102 760-1 v_stf455_v06 C.11/8 - */ - modulepar boolean PICS_DISCONN := false; - - /** - * @desc Is IUT supporting dynamic registration using the standardized registration procedure? - * @see ETSI TS 102 760-1 v_stf455_v06 C.1/1 - */ - modulepar boolean PICS_DYNREG := true; - - /** - * @desc Is IUT supporting the inactivation procedure? - * @see ETSI TS 102 760-1 v_stf455_v06 C.11/3 - */ - modulepar boolean PICS_INACT := false; - - /** - * @desc Is IUT supporting the IN-UNITDATA-STATUS service? - * @see ETSI TS 102 760-1 v_stf455_v06 C.12/2 - */ - modulepar boolean PICS_INUDS := false; - - /** - * @desc Is IUT supporting notification-only I-Parameters? - * @see ETSI TS 102 760-1 v_stf455_v06 C.24 any selected notify-only I-Parameter - */ - modulepar boolean PICS_IPNO := false; - - /** - * @desc Is IUT supporting read-only I-Parameters? - * @see ETSI TS 102 760-1 v_stf455_v06 C.21 and C.22 any selected read-only I-Parameter - */ - modulepar boolean PICS_IPRO := false; - - /** - * @desc Is IUT supporting read/write I-Parameters? - * @see ETSI TS 102 760-1 v_stf455_v06 C.19 and C.20 any selected read/write I-Parameter - */ - modulepar boolean PICS_IPRW := false; - - /** - * @desc Is IUT supporting write-only I-Parameters? - * @see ETSI TS 102 760-1 v_stf455_v06 C.23 any selected write-only I-Parameter - */ - modulepar boolean PICS_IPWO := false; - - /** - * @desc Is IUT useing 48 bit MAC addresses? - * @see ETSI TS 102 760-1 v_stf455_v06 C.4/1 - */ - modulepar boolean PICS_MAC48 := false; - - /** - * @desc Is IUT supporting MC-VCI transmitter? - * @see ETSI TS 102 760-1 v_stf455_v06 C.8/2 - */ - modulepar boolean PICS_MCVCI := false; - - /** - * @desc Is IUT supporting rejection of DL-UNITDATA.reqeusts with user priority smaller than given in parameter "MinimumUserPriority"? - * @see ETSI TS 102 760-1 v_stf455_v06 C.11/20 - */ - modulepar boolean PICS_REJECT := false; - - /** - * @desc Is IUT supporting the resuming procedure? - * @see ETSI TS 102 760-1 v_stf455_v06 C.11/6 - */ - modulepar boolean PICS_RES := false; - - /** - * @desc Is IUT supporting the Regulatory Information Management procedure? - * @see ETSI TS 102 760-1 v_stf455_v06 C.11/12 - */ - modulepar boolean PICS_RIM := false; - - /** - * @desc Is IUT supporting SNAP? - * @see ETSI TS 102 760-1 v_stf455_v06 C.13/1 - */ - modulepar boolean PICS_SNAP := false; - - /** - * @desc Is IUT supporting the suspension procedure? - * @see ETSI TS 102 760-1 v_stf455_v06 C.11/5 - */ - modulepar boolean PICS_SUSP := false; - - /** - * @desc Is IUT supporting UC-VCI (transmitter and receiver)? - * @see ETSI TS 102 760-1 v_stf455_v06 C.8/3 - */ - modulepar boolean PICS_UCVCI := false; - - /** - * @desc Is IUT supporting the UnitDataCmd command? - * @see ETSI TS 102 760-1 v_stf455_v06 C.15/12 - */ - modulepar boolean PICS_UDC := false; - - /** - * @desc Is IUT supporting the WakeUp command? - * @see ETSI TS 102 760-1 v_stf455_v06 C.15/4 - */ - modulepar boolean PICS_WAKEUP := false; - - /** - * @desc Is IUT supporting the IN-UNITDATA-STATUS service primitive? - * @see ETSI TS 102 760-1 v_stf455_v06 C.12/2 - */ - modulepar boolean PICS_IN_UNITDATA_STATUS := false; - - /** - * @desc Is IUT supporting the Monitor command? - * @see ETSI TS 102 760-1 v_stf455_v06 C.15/11 - */ - modulepar boolean PICS_MONITOR := false; - - } // End of group atspPics - -} // End of module LibItsAtsp_Pics diff --git a/ttcn/CALM/ATSP/LibItsAtsp_Pixits.ttcn3 b/ttcn/CALM/ATSP/LibItsAtsp_Pixits.ttcn3 deleted file mode 100644 index 0239b96b..00000000 --- a/ttcn/CALM/ATSP/LibItsAtsp_Pixits.ttcn3 +++ /dev/null @@ -1,200 +0,0 @@ -/** - * @author ETSI / STF455 - * @version $URL$ - * $Id$ - * @desc Access Technology Layer (ISO 21218) Pixits - */ -module LibItsAtsp_Pixits { - - import from CALMllsap language "ASN.1:1997" { - type - EUI64, MedID, VCIserialNumber, IN_SAPaddress, I_ParamNo, I_Param, MedID - }; - - import from CALMmanagement language "ASN.1:1997" { - type - ITS_scuId - }; - - import from CALMmsap language "ASN.1:1997" { - type - DataUnitData, ParameterUnitData - }; - - import from LibItsAtsp_TypesAndValues all; - - import from LibCommon_BasicTypesAndValues { - type - UInt8, UInt6 - }; - - group Iparameter { - /** - * @desc Expected ITS-SCU-ID of the IUT CI - * @see ISO 21218 - Clause 6.2 Link Identifier - * I-Parameter No c_ciIParamNoITS_scuId - */ - modulepar ITS_scuId PX_ITS_SCU_ID := 0; - - /** - * @desc Expected MedID of the IUT CI - * @see ISO 21218 - Clause 6.2 Link Identifier - * I-Parameter No c_ciIParamNoMedID - */ - modulepar MedID PX_Med_ID := 0; - - /** - * @desc Expected MedType of the IUT CI - * @see ISO 21218 - Clause 6.3 Link Identifier - * I-Parameter No c_ciIParamNoMedID - */ - modulepar MedID PX_CI_MED_TYPE := 5; - - /** - * @desc MedType of potential interferer - * @see ISO 21218 - Clause 6.3 Link Identifier - * used in PrioReg - */ - modulepar MedID PX_CI_INTERFERER_MED_TYPE := 5; - - /** - * @desc Unknown I-Parameter No - * @see ISO 21218 - Clause 6.3 Link Identifier - */ - modulepar I_ParamNo PX_CI_UNKNOWN_PARAM_NO := 255; - - /** - * @desc Not supported I-Parameter - * @see ISO 21218 - Clause 6.3 Link Identifier - */ - modulepar I_Param PX_CI_NO_SUPPORT_PARAM := {paramNo := PX_CI_NO_SUPPORT_PARAM_NO, parameter := {UserPriority := 0} }; - modulepar I_ParamNo PX_CI_NO_SUPPORT_PARAM_NO := 125; - - /** - * @desc Supported I-Parameter with write or read/write access - * @see ISO 21218 - Clause 6.3 Link Identifier - */ - modulepar I_Param PX_CI_SUPPORT_PARAM_WR := {paramNo := PX_CI_SUPPORT_PARAM_WR_NO, parameter := {DataRate := 125} }; - modulepar I_ParamNo PX_CI_SUPPORT_PARAM_WR_NO := 39; - - /** - * @desc Supported Read-Only or Notify-Only I-Parameter - * @see ISO 21218 - Clause 6.3 Link Identifier - */ - modulepar I_ParamNo PX_CI_SUPPORT_NO_WRITE_ACCESS_PARAM_NO := c_ciIParamNoCiStatus; - modulepar I_Param PX_CI_SUPPORT_NO_WRITE_ACCESS_PARAM := {paramNo := PX_CI_SUPPORT_NO_WRITE_ACCESS_PARAM_NO, parameter := {CIstatus := 0} }; - - } // End of group Iparameter - - /** - * @desc T_DummyAckReq timer for prioritization procedure - * @see ISO 21218 - Clause 6.4.11.3 - */ - modulepar float PX_TIMER_DUMMYAckReq := 0.1; // in seconds In reality the value has to be smaller - - /** - * @desc Expected IN-SAP address - * @see ISO 21218 - Clause 8.2 Addressing - * FNTP: 186 - * IPv6: 182 - */ - modulepar IN_SAPaddress PX_IN_SAP_ADDRESS := 186; - - /** - * @desc Expected VCIserialNumber of the IUT UC-VCI - * @see ISO 21218 - Clause 6.3 Link Identifier - */ - modulepar VCIserialNumber PX_VCI_SERIAL_NUMBER := 0; - - /** - * @desc Expected VCIserialNumber of the IUT MC-VCI - * @see ISO 21218 - Clause 6.3 Link Identifier - */ - modulepar VCIserialNumber PX_VCI_SERIAL_NUMBER_MC := 0; - - /** - * @desc MultiCast group ID of the IUT legacy CI - * @see ISO 21218 - Clause 6.3 Link Identifier - * Range from 1 through 62 - */ - modulepar UInt6 PX_LEGACY_VCI_MC_GROUP_ID := 1; - - /** - * Wait until the IUT is in a stable situation - */ - modulepar float PX_WAIT_FOR_IUT_READY := 1.0; - - /** - * Data in UnitData - */ - modulepar DataUnitData PX_DATA_UNITDATA := 'ABCDEF'O; - - /** - * Parameter in UnitData - */ - modulepar ParameterUnitData PX_PARAMETER_UNITDATA := '012345'O; - - /** - * @desc Identifies RemoteLocalCIID group - * Values of RemoteCIID and LocalCIID - * @see ISO 21218 - Clause 6.3 Link Identifier and 8.2.2 Tables 6 and 7 - */ - group RemoteLocalCIID { - /** - * @desc Identifies RemoteCIID of local VCI - */ -// modulepar EUI64 PX_REMOTE_CIID_LOCAL := 'FFFFFFFFFEFFFFFF'O; // DNI - modulepar EUI64 PX_REMOTE_CIID_LOCAL_CI := PX_LOCAL_CIID; - - /** - * @desc Identifies the VCI localCIID on ITS-S router (e.g. It coud be the G5 radio MAC address of the IUT) - * NOTE 0A0B0CFFFE0D0E0F is MAC address 0A:0B:0C:0D:0E:0F - */ -// modulepar EUI64 PX_LOCAL_CIID := 'FFFFFFFFFEFFFFFF'O ; // DNI - modulepar EUI64 PX_LOCAL_CIID := '0A0B0CFFFE0D0E0F'O; // Commsignia FNTP setting (laptop) -// modulepar EUI64 PX_LOCAL_CIID := 'FFFFFFFFFEFFFFFF'O ; // Commsignia FSAP setting -// modulepar EUI64 PX_LOCAL_CIID := 'D4CA6DFFFF55A72C'O ; // Commsignia FNTP setting (ITS-S box) -// modulepar EUI64 PX_LOCAL_CIID := '000C42FFFF6A9E2C'O; // Peek setting (@home) -// modulepar EUI64 PX_LOCAL_CIID := '000C42FFFF974497'O; // Peek setting (@office) - - /** - * @desc Identifies RemoteCIID of VCI on ITS test system - */ -// modulepar EUI64 PX_TESTER_REMOTE_CIID_LOCAL := 'FFFFFFFFFEFFFFFF'O; // DNI - modulepar EUI64 PX_TESTER_REMOTE_CIID_LOCAL_CI := PX_TESTER_LOCAL_CIID; - - /** - * @desc Identifies the VCI localCIID on ITS test system (e.g. It coud be the G5 radio MAC address of the IUT) - * NOTE 0A0B0CFFFE0D0E0F is MAC address 0A:0B:0C:0D:0E:0F - */ - modulepar EUI64 PX_TESTER_LOCAL_CIID := 'FFFFFFFFFEFFFFFF'O ; // DNI -// modulepar EUI64 PX_TESTER_LOCAL_CIID := '0A0B0CFFFE0D0E0F'O; // tbd - - /** - * @desc Identifies the VCI for broadcast on ITS-S router - * Note that U/L bit is set to 1 for broadcast - */ - modulepar EUI64 PX_REMOTE_CIID_BC := 'FFFFFFFFFEFFFFFF'O; - - /** - * @desc Identifies the VCI for multicast on ITS-S router - */ - modulepar EUI64 PX_REMOTE_CIID_MC := 'EF0008FFFE011234'O; - - /** - * @desc Identifies the VCI for unicast on ITS-S router (peer station) ( - * this is the MAC address of the ITS test system - */ - modulepar EUI64 PX_REMOTE_CIID_UC := '030008FFFE010001'O; // Commsignia setting -// modulepar EUI64 PX_REMOTE_CIID_UC := '030008FFFF010001'O; // Peek setting - - /** - * @desc Identifies the VCI for unicast transmission to the IUT) ( - * this is the MAC address of the IUT - */ - modulepar EUI64 PX_TESTER_REMOTE_CIID_UC := '030008FFFE010001'O; // tbd - - } // End of group RemoteLocalCIID - - -} // End of module LibItsAtsp_Pixits diff --git a/ttcn/CALM/ATSP/LibItsAtsp_Templates.ttcn3 b/ttcn/CALM/ATSP/LibItsAtsp_Templates.ttcn3 deleted file mode 100644 index 5a8b3349..00000000 --- a/ttcn/CALM/ATSP/LibItsAtsp_Templates.ttcn3 +++ /dev/null @@ -1,1067 +0,0 @@ -/** - * @author ETSI / STF455 - * @version $URL$ - * $Id$ - * @desc Template definitions for Access Technology Support Protocols (ISO 21218) - */ -module LibItsAtsp_Templates { - - import from CALMllsap language "ASN.1:1997" { - type - Link_ID, MedID, MedType, CIstatus, - INsapPrimitivesDown, INsapPrimitivesUp, - IN_UNITDATA_request, IN_UNITDATA_indication, IN_UNITDATA_STATUS_indication, - UserPriority, - LLserviceAddr, INdata, IN_SAPaddress, EUI64, Link_ID, - AccessParameters, - NullType, Errors, INtxStatus - }; - - import from CALMmsap language "ASN.1:1997" { - type - CIstateChng, WakeUp, RIcmd, RI, - RegCmd, RegReq, Events21218, - PrioReg, RTSreq,RTSackCmd, RTScmd, RTSackReq, - E21218_3, E21218_4, E21218_5, E21218_7, - StationID, CommandRef, ErrStatus, - MI_Command_request, MI_Command_confirm, - MI_Request_request, MI_Request_confirm, - MI_Get_request, MI_Get_confirm, - MI_Set_request, MI_Set_confirm, - SimIUTcmd , - CONcmd, VciCmd, UnitData, - DataUnitData, ParameterUnitData - }; - - import from CALMmanagement language "ASN.1:1997" { - type - ITS_scuId - }; - - import from LibItsCalm_Pixits { - modulepar - PX_LOC_ITS_ATSP_ACCESS_SETTINGS_MX_SAP_SET, PX_LOC_ITS_ATSP_ACCESS_SETTINGS_MX_SAP_UNSET, - PX_IUT_LOWER_LAYER_USED, PX_IUT_LOWER_LAYER_UNUSED, - PX_IUT_TEST_MODE_ON - }; - import from LibItsCalm_Interface all; - import from LibItsAtsp_TypesAndValues all; - import from LibItsMgt_TypesAndValues { - type IParamNoList, IParamList - }; - - - group sendOperation { - - group cfPort { - - /** - * @desc Send template - * CfAtspEvent for sending MI-REQUEST.confirm over cfPort - * @param p_miReqConfirm: The MI-REQUEST.confirm primitive - */ - template CfAtspEvent m_cfAtspMIRequest_confirm( - in template(value) MI_Request_confirm p_miReqConfirm - ) := { - miRequestConfirm := p_miReqConfirm - } // End of template m_cfAtspMIRequest_confirm - - /** - * @desc Send template - * CfAtspEvent for sending MI-GET.request over cfPort - * @param p_miGetRequest: Get request to send - */ - template CfAtspEvent m_cfAtspGetReqEvent( - in template(value) MI_Get_request p_miGetRequest - ) := { - miGetRequest := p_miGetRequest - } // End of template m_cfAtspGetReqEvent - - /** - * @desc Send template - * CfAtspEvent for sending MI-SET.request over cfPort - * @param p_miSetRequest: Set request to send - */ - template CfAtspEvent m_cfAtspSetReqEvent( - in template(value) MI_Set_request p_miSetRequest - ) := { - miSetRequest := p_miSetRequest - } // End of template m_cfAtspSetReqEvent - - /** - * @desc Send template - * CfAtspEvent for sending MI-COMMAND.request over cfPort - * @param p_miCommandRequest: Command request to send - */ - template CfAtspEvent m_cfAtspCommandReqEvent( - in template(value) MI_Command_request p_miCommandRequest - ) := { - miCommandRequest := p_miCommandRequest - } // End of template m_cfAtspCommandReqEvent - - } // End of group cfPort - - group cfPortTools { - - /** - * @desc Send template - * MI-REQUEST.confirm to send - * @param p_MI_REQUEST_Request: The MI-REQUEST.request to confirm - * @param p_errorStatus: ErrStatus value of the confirmation - */ - template MI_Request_confirm m_cfAtspRequestConfirm( - in template(value) MI_Request_request p_MI_REQUEST_Request, - in template(value) ErrStatus p_errorStatus - ) := { - linkID := p_MI_REQUEST_Request.linkID, - commandRef := p_MI_REQUEST_Request.commandRef, - errStatus := p_errorStatus - } // End of template m_cfAtspRequestConfirm - - /** - * @desc Send template - * Registration Command to confirm with - * @param p_sourceLinkID - * @param p_destinationLinkID - * @param p_data - * @param p_priority - * @param p_parameter - */ - template UnitData m_unitDataCommand( - in template(value) Link_ID p_sourceLinkID, - in template(value) Link_ID p_destinationLinkID, - in template(value) DataUnitData p_data, - in template(value) UserPriority p_priority, - in template(value) ParameterUnitData p_parameter - ) := { - sourceAddr := p_sourceLinkID, - destAddr := p_destinationLinkID, - data := p_data, - priority := p_priority, - parameter := p_parameter - } // End of template m_unitDataCommand - - /** - * @desc Send template - * UnitData Command - * @param p_scudId: ITS-SCU-ID value - * @param p_medType: MedID value - */ - template RegCmd m_regCommand( - in template(value) ITS_scuId p_scudId, - in template(value) MedID p_medType - ) := { - scuId := p_scudId, - medID := p_medType - } // End of template m_regCommand - - /** - * @desc Send template for MI-COMMAND.request containing registration command service primitive - * @param p_linkID Link-ID of VCI / CI. - * @param p_commandRef Unique cyclic reference number of command. - * @param p_regCmd Registration command primitive - */ - template (value) MI_Command_request m_miRegistrationCommandRequest( - in template (value) Link_ID p_linkID, - in template (value) CommandRef p_commandRef, - in template (value) RegCmd p_regCmd - ) := { - linkID := p_linkID, - commandRef := p_commandRef, - ref := c_miCmd_regCmd, - command_param := {RegCmd := p_regCmd} - } // End of template m_miRegistrationCommandRequest - - /** - * @desc Send template for MI-COMMAND.request containing UnitDataCmd command service primitive - * @param p_linkID Link-ID of VCI / CI. - * @param p_commandRef Unique cyclic reference number of command. - * @param p_regCmd Registration command primitive - */ - template (value) MI_Command_request m_miUnitDataCmdCommandRequest( - in template (value) Link_ID p_linkID, - in template (value) CommandRef p_commandRef, - in template (value) UnitData p_unitData - ) := { - linkID := p_linkID, - commandRef := p_commandRef, - ref := c_miCmd_unitDataCmd, - command_param := {UnitData := p_unitData} - } // End of template MI_Command_request m_miUnitDataCmdCommandRequest - - /** - * @desc Generic send template for MI-COMMAND.confirm service primitive - * @param p_linkID Link-ID of VCI / CI. - * @param p_commandRef Unique cyclic reference number of command. - * @param p_errorStatus Unique identifier of error status. - */ - template (value) MI_Command_confirm m_miCommandConfirm( - in template (value) Link_ID p_linkID, - in template (value) CommandRef p_commandRef, - in template (value) ErrStatus p_errorStatus - ) := { - linkID := p_linkID, - commandRef := p_commandRef, - errStatus := p_errorStatus - } // End of template m_miCommandConfirm - - /** - * @desc Send template for MI-COMMAND.request containing state change command service primitive - * @param p_linkID Link-ID of VCI / CI. - * @param p_commandRef Unique cyclic reference number of command. - * @param p_stateChng State change primitive - */ - template (value) MI_Command_request m_miRTSackCmdCommandRequest( - in template (value) Link_ID p_linkID, - in template (value) CommandRef p_commandRef, - in template (value) RTSackCmd p_rTSackCmd - ) := { - linkID := p_linkID, - commandRef := p_commandRef, - ref := c_miCmd_rTSackCmd, - command_param := {RTSackCmd := p_rTSackCmd} - } // End of template m_miRTSackCmdCommandRequest - - /** - * @desc Send template for MI-COMMAND.request containing state change command service primitive - * @param p_linkID Link-ID of VCI / CI. - * @param p_commandRef Unique cyclic reference number of command. - * @param p_stateChng State change primitive - */ - template (value) MI_Command_request m_miStateChangeCommandRequest( - in template (value) Link_ID p_linkID, - in template (value) CommandRef p_commandRef, - in template (value) CIstateChng p_stateChng - ) := { - linkID := p_linkID, - commandRef := p_commandRef, - ref := c_miCmd_ciState, - command_param := {CIstateChng := p_stateChng} - } // End of template m_miStateChangeCommandRequest - - /** - * @desc Generic send template for MI-SET.request service primitive - * @param p_linkID Link ID of the peer station - * @param p_commandRef Unique cyclic reference number of command - * @param p_setParam List of parameters to be set - * @see ISO 24102-3 6.3.1 MI-SET.request - * @see ISO 21218 Annex A (normative) I parameters - */ - template (value) MI_Set_request m_miSetRequest( - in template (value) Link_ID p_linkId, - in template (value) CommandRef p_commandRef, - in template (value) IParamList p_setParam - ) := { - linkID := p_linkId, - commandRef := p_commandRef, - set_param := p_setParam - } // End of template m_miGetRequest - - /** - * @desc Generic send template for MI-GET.request service primitive - * @param p_linkID Link ID of the peer station - * @param p_commandRef Unique cyclic reference number of command - * @param p_getParamNo List of reference numbers of parameters to be retrieved - * @see ISO 24102-3 6.3.1 MI-GET.request - * @see ISO 21218 Annex A (normative) I parameters - */ - template (value) MI_Get_request m_miGetRequest( - in template (value) Link_ID p_linkId, - in template (value) CommandRef p_commandRef, - in template (value) IParamNoList p_getParamNo - ) := { - linkID := p_linkId, - commandRef := p_commandRef, - get_param_no := p_getParamNo - } // End of template m_miGetRequest - - /** - * @desc Send template for MI-COMMAND.request containing CONcmd command service primitive - * @param p_linkID Link-ID of VCI / CI. - * @param p_commandRef Unique cyclic reference number of command. - * @param p_conCmd Registration command primitive - */ - template (value) MI_Command_request m_miCONcmdCommandRequest( - in template (value) Link_ID p_linkID, - in template (value) CommandRef p_commandRef, - in template (value) CONcmd p_conCMD - ) := { - linkID := p_linkID, - commandRef := p_commandRef, - ref := c_miCmd_cONcmd, - command_param := {CONcmd := p_conCMD} - } // End of template m_miCONcmdCommandRequest - - /** - * @desc Send template for MI-COMMAND.request containing wake up command service primitive - * @param p_linkID Link-ID of VCI / CI. - * @param p_commandRef Unique cyclic reference number of command. - * @param p_wakeUp State change primitive - */ - template (value) MI_Command_request m_miWakeUpCommandRequest( - in template (value) Link_ID p_linkID, - in template (value) CommandRef p_commandRef, - in template (value) WakeUp p_wakeUp - ) := { - linkID := p_linkID, - commandRef := p_commandRef, - ref := c_miCmd_wakeUp, - command_param := {WakeUp := p_wakeUp} - } // End of template m_miWakeUpCommandRequest - - /** - * @desc Send template for MI-COMMAND.request containing regulatory info command service primitive - * @param p_linkID Link-ID of VCI / CI. - * @param p_commandRef Unique cyclic reference number of command. - * @param p_riCmd Regulatory information primitive - */ - template (value) MI_Command_request m_miRICmdCommandRequest( - in template (value) Link_ID p_linkID, - in template (value) CommandRef p_commandRef, - in template (value) RIcmd p_riCmd - ) := { - linkID := p_linkID, - commandRef := p_commandRef, - ref := c_miCmd_rIcmd, - command_param := {RIcmd := p_riCmd} - } // End of template m_miRICmdCommandRequest - - /** - * @desc Send template for MI-COMMAND.request containing regulatory info command service primitive - * @param p_linkID Link-ID of VCI / CI. - * @param p_ri Regulatory information - */ - template (value) RIcmd m_miRICmd( - in template (value) Link_ID p_linkID, - in template (value) RI p_ri - ) := { - linkID := p_linkID, - ri := p_ri - } // End of template m_miRICmd - - /** - * @desc Send template for MI-COMMAND.request containing VCIcmd command service primitive - * @param p_linkID Link-ID of VCI / CI. - * @param p_commandRef Unique cyclic reference number of command. - * @param p_vciCmd VCIcmd value - */ - template (value) MI_Command_request m_miVCIcmdCommandRequest( - in template (value) Link_ID p_linkID, - in template (value) CommandRef p_commandRef, - in template (value) VciCmd p_vciCmd - ) := { - linkID := p_linkID, - commandRef := p_commandRef, - ref := c_miCmd_vciCmd, - command_param := {VciCmd := p_vciCmd} - } // End of template m_miVCIcmdCommandRequest - - /** - * @desc Send template for MI-COMMAND.request containing unknown command - * @param p_linkID Link-ID of VCI / CI. - * @param p_commandRef Unique cyclic reference number of command. - */ - template (value) MI_Command_request m_miUnknwonCommandRequest( - in template (value) Link_ID p_linkID, - in template (value) CommandRef p_commandRef - ) := { - linkID := p_linkID, - commandRef := p_commandRef, - ref := c_miCmd_UnknownCmd, - command_param := {UnknownCommand := 100} - } // End of template m_miUnknownCommandRequest - - } // End of group cfPortTools - - group atspPort { - - /** - * @desc Send template - * Allows ITS test system to request frame transmission to IUT - * @param p_inSapPrimitiveDown: IN-SAP primitive to send - */ - template AtspReq m_atspReq( - template(value) INsapPrimitivesDown p_inSapPrimitiveDown - ) := { - msgOut:= p_inSapPrimitiveDown - } // End of template m_atspReq - - } // End of group atspPort - - group utPort { - - /** - * @desc Send template INsapPrimitivesDown - * UtAtspEvent for sending any of the IN SAP primitives over utPort - * @param p_inSapPrimitiveDown: IN SAP primitive to send - */ - template UtAtspEvent m_utAtspEventDown( - in template(value) INsapPrimitivesDown p_inSapPrimitiveDown - ) := { - inSapPrimitivesDown := p_inSapPrimitiveDown - } // End of template m_utAtspEventDown - - /** - * @desc Receive template INsapPrimitivesUp - * UtAtspEvent for receiving any of the IN SAP primitives over utPort - * @param p_inSapPrimitiveUp: IN SAP primitive to be received - */ - template UtAtspEventInd m_utAtspEventInd( - in template(value) INsapPrimitivesUp p_inSapPrimitiveUp - ) := { - inSapPrimitivesUp := p_inSapPrimitiveUp - } // End of template m_utAtspEventUp - - } // End of group utPort - - group ut_astpPortTools { - - /** - * @desc Send template - * UtAtspEvent for sending IN-UNITDATA.request - * @param p_inUnitdataRequest: IN-UNITDATA.request primitive to send - */ - template INsapPrimitivesDown m_inPrimitivesDownUDR( - in template(value) IN_UNITDATA_request p_inUnitdataRequest - ) := { - spRef := 0, - servPrimitive := { - IN_UNITDATA_request := p_inUnitdataRequest - } - } // End of template m_inPrimitivesDownUDR - - /** - * @desc Send template - * AccessParameters default value template used for sending - */ - template(value) AccessParameters m_inUnitdataDefaultAP := { - apRef := 0, - aParameter := { - NullType := NULL - } - } // End of template m_inUnitdataDefaultAP - - /** - * @desc Send template - * IN-UNITDATA.request message for sending - * @param p_source_addr: Source address - * @param p_dest_addr: Destination address - * @param p_data: Data to send - * @param p_priority: User priority value - */ - template(value) IN_UNITDATA_request m_inUnitDataRequest( - in template(value) LLserviceAddr p_source_addr, - in template(value) LLserviceAddr p_dest_addr, - in template(value) INdata p_data, - in template(value) UserPriority p_priority - ) := { - source_addr := p_source_addr, - dest_addr := p_dest_addr, - data := p_data, - priority := p_priority, - accessParams := m_inUnitdataDefaultAP - } // End of template m_inUnitDataRequest - - /** - * @desc Send template - * Used for creating source and destination addres values for IN-UNITDATA.request(STATUS) - * @param p_SAPAddress: IN-SAP part of the address - * @param p_linkID: LinkID used to create address - */ - template LLserviceAddr m_inLLServiceAddr( - in template(value) IN_SAPaddress p_SAPAddress, - in template(value) Link_ID p_linkID - ) := { - csap := p_SAPAddress, - linkID := p_linkID - } // End of template m_inLLServiceAddr - - /** - * @desc Send template - * Default empty data - */ - template(value) INdata m_inDataEmpty := ''O; - // End of template m_inDataEmpty - - /** - * @desc Send template - * 'AA' data - */ - template(value) INdata m_inDataAA := 'AA'O; - // End of template m_inDataEmpty - - /** - * @desc Send template - * 'BB' data - */ - template(value) INdata m_inDataBB := 'AA'O; - // End of template m_inDataEmpty - - /** - * @desc Send template - * Lowest user priority value - */ - template(value) UserPriority m_inUserPriorityLowest := 0; - // End of template m_inUserPriorityLowest - - /** - * @desc Send template - * Highest user priority value - */ - template(value) UserPriority m_inUserPriorityHighest := 255; - // End of template m_inUserPriorityHighest - - /** - * @desc Send template - * Average user priority value - */ - template(value) UserPriority m_inUserPriorityAverage := 127; - // End of template m_inUserPriorityAverage - - - } // End of group ut_astpPortTools - - - } // End of group sendOperation - - group recvOperation { - - group cfPort { - - /** - * @desc Receive template - * CfAtspEventInd to notify reception of an expected frame given by p_miRequestReq - * @param p_miRequestReq: The MI_REQUEST.request primitive - */ - template CfAtspEventInd mw_cfAtspRequestRequest(in template MI_Request_request p_miRequestReq) := { - miRequestRequest:= p_miRequestReq - } // End of template mw_cfAtspRequestRequest - - /** - * @desc Receive template - * CfAtspEventInd to notify reception of an expected frame given by p_miCommandConfirm - * @param p_miCommandConfirm: The MI-COMMAND.confirm primitive - */ - template CfAtspEventInd mw_cfAtspCommandConfirm(in template MI_Command_confirm p_miCommandConfirm) := { - miCommandConfirm:= p_miCommandConfirm - } // End of template mw_cfAtspCommandConfirm - - /** - * @desc Receive template - * CfAtspEventInd to notify reception of an expected frame given by p_miGetConfirm - * @param p_miGetConfirm: The MI-GET.confirm primitive - */ - template CfAtspEventInd mw_cfAtspEventIndGetConf(in template MI_Get_confirm p_miGetConfirm) := { - miGetConfirm := p_miGetConfirm - } // End of template mw_cfAtspEventIndGetConf - - /** - * @desc Receive template - * CfAtspEventInd to notify reception of an expected frame given by p_miSetConfirm - * @param p_miSetConfirm: The MI-SET.confirm primitive - */ - template CfAtspEventInd mw_cfAtspEventIndSetConf(in template MI_Set_confirm p_miSetConfirm) := { - miSetConfirm := p_miSetConfirm - } // End of template mw_cfAtspEventIndSetConf - - } // End of group cfPort - - group cfPortTools { - - /** - * @desc Generic receive template for registration request in MI-REQUEST.request service primitive - * @param p_linkID Link-ID of VCI / CI. - * @param p_commandRef Unique cyclic reference number of command. - * @param p_regReq Registration request primitive - */ - template MI_Request_request mw_miRegRequest( - in template Link_ID p_linkID, - in template CommandRef p_commandRef, - in template RegReq p_regReq - ) := { - linkID := p_linkID, - commandRef := p_commandRef, - ref := c_miReq_regReq, - request_param := { - RegReq := p_regReq - } - } // End of template mw_miRegRequest - - /** - * @desc Generic receive template for registration request with a specific MedType - * @param p_medType Expected MedType - */ - template RegReq m_regRequest( - in template(value) MedType p_medType - ) := { - medType := p_medType - } // End of template m_regRequest - - /** - * @desc Generic receive template for notifications of IParameters in MI-REQUEST.request service primitive - * @param p_parameter Parameter monitor event data - */ - template Events21218 mw_miEvent21218_5( - in template E21218_5 p_parameter - ) := { - eventNo := 5, - event := { - E21218_5 := p_parameter - } - } // End of template mw_miEvent21218_5 - - /** - * @desc Generic receive template for VCI notifications in MI-REQUEST.request service primitive - * @param p_parameter VCI created event data - */ - template Events21218 mw_miEvent21218_3( - in template E21218_3 p_parameter - ) := { - eventNo := 3, - event := { - E21218_3 := p_parameter - } - } // End of template mw_miEvent21218_3 - - /** - * @desc Generic receive template for VCI notifications in MI-REQUEST.request service primitive - * @param p_parameter VCI deleted event data - */ - template Events21218 mw_miEvent21218_4( - in template Link_ID p_parameter - ) := { - eventNo := 4, - event := { - E21218_4 := p_parameter - } - } // End of template mw_miEvent21218_4 - - /** - * @desc Generic receive template for notifications of CIstatus in MI-REQUEST.request service primitive - * @param p_ciStatus CiStatus parameter notification data - */ - template E21218_5 mw_miCIStatusParam( - in template CIstatus p_ciStatus - ) := { - paramNo := c_ciIParamNoCiStatus, - parameter := { - CIstatus := p_ciStatus - } - } // End of template mw_miCIStatusParam - - /** - * @desc Generic receive template for VCI notifications in MI-REQUEST.request service primitive - * @param p_parameter VCI reset event data - */ - template Events21218 mw_miEvent21218_7( - in template E21218_7 p_parameter - ) := { - eventNo := 7, - event := { - E21218_7 := p_parameter - } - } // End of template mw_miEvent21218_3 - - /** - * @desc Generic receive template for event notification in MI-REQUEST.request service primitive - * @param p_linkID Link-ID of VCI / CI. - * @param p_commandRef Unique cyclic reference number of command. - * @param p_event Event notification primitive - */ - template MI_Request_request mw_miEventsRequest( - in template Link_ID p_linkID, - in template CommandRef p_commandRef, - in template Events21218 p_event - ) := { - linkID := p_linkID, - commandRef := p_commandRef, - ref := c_miReq_events, - request_param := { - Events21218 := p_event - } - } // End of template mw_miEventsRequest - - /** - * @desc Generic receive template for prioritization registration request in MI-REQUEST.request service primitive - * @param p_linkID Link-ID of VCI / CI. - * @param p_commandRef Unique cyclic reference number of command. - * @param p_regReq Registration request primitive - */ - template MI_Request_request mw_miPrioRegRequest( - in template Link_ID p_linkID, - in template CommandRef p_commandRef, - in template PrioReg p_prioReg - ) := { - linkID := p_linkID, - commandRef := p_commandRef, - ref := c_miReq_prioReg, - request_param := { - PrioReg := p_prioReg - } - } // End of template mw_miPrioRegRequest - - /** - * @desc Generic receive template for prioritization registration request in MI-REQUEST.request service primitive - * @param p_linkID Link-ID of VCI / CI. - * @param p_commandRef Unique cyclic reference number of command. - * @param p_regReq Registration request primitive - */ - template MI_Request_request mw_miRTSackReqRequest( - in template Link_ID p_linkID, - in template CommandRef p_commandRef, - in template RTSackReq p_rTSackReq - ) := { - linkID := p_linkID, - commandRef := p_commandRef, - ref := c_miReq_rTSackReq, - request_param := { - RTSackReq := p_rTSackReq - } - } // End of template mw_miRTSackReqRequest - - /** - * @desc Generic receive template for prioritization request in MI-REQUEST.request service primitive - * @param p_linkID Link-ID of VCI / CI. - * @param p_commandRef Unique cyclic reference number of command. - * @param p_regReq Registration request primitive - */ - template MI_Request_request mw_miRTSreqRequest( - in template Link_ID p_linkID, - in template CommandRef p_commandRef, - in template RTSreq p_rTSreq - ) := { - linkID := p_linkID, - commandRef := p_commandRef, - ref := c_miReq_prioReg, - request_param := { - RTSreq := p_rTSreq - } - } // End of template mw_miRTSreqRequest - - /** - * @desc Generic receive template for prioritization request in MI-REQUEST.request service primitive - * @param p_linkID Link-ID of VCI / CI. - * @param p_commandRef Unique cyclic reference number of command. - * @param p_regReq Registration request primitive - */ - template MI_Request_request mw_miRTScmdRequest( - in template Link_ID p_linkID, - in template CommandRef p_commandRef, - in template RTScmd p_rTScmd - ) := { - linkID := p_linkID, - commandRef := p_commandRef, - ref := c_miCmd_rTScmd, - request_param := { - RTScmd := p_rTScmd - } - } // End of template mw_miRTScmdRequest - - /** - * @desc Generic receive template for MI-SET.confirm service primitive - * @param p_linkID Link ID of the peer station - * @param p_commandRef Unique cyclic reference number of command. Same value as in related MI-SET.request - * @param p_errors List of errors - * @see ISO 24102-3 6.3.1 MI-SET.confirm - * @see ISO 21218 Annex A (normative) I parameters - */ - template MI_Set_confirm mw_miSetConfirm( - in template Link_ID p_linkID, - in template CommandRef p_commandRef, - in template Errors p_iErrors - ) := { - linkID := p_linkID, - commandRef := p_commandRef, - set_param := p_iErrors - } // End of template mw_miSetConfirm - - /** - * @desc Generic receive template for MI-GET.confirm service primitive - * @param p_linkID Link ID of the peer station - * @param p_commandRef Unique cyclic reference number of command. Same value as in related MI-GET.request - * @param p_getParam List of reference parameters returned - * @see ISO 24102-3 6.3.1 MI-GET.confirm - * @see ISO 21218 Annex A (normative) I parameters - */ - template MI_Get_confirm mw_miGetConfirm( - in template Link_ID p_linkID, - in template CommandRef p_commandRef, - in template IParamList p_iParams - ) := { - linkID := p_linkID, - commandRef := p_commandRef, - get_param := p_iParams - } // End of template mw_miGetConfirm - - /** - * @desc Generic receive template for VCI Created / Deleleted / Reset notifications in MI-REQUEST.request service primitive - * @param p_remoteCIID RemoteCIID of the VCI event data - * @param p_localCIID LocalCIID of the VCI event data - */ - template Link_ID mw_miVCICreDelRes( - in template EUI64 p_remoteCIID, - in template EUI64 p_localCIID - ) := { - remoteCIID := p_remoteCIID, - localCIID := p_localCIID - } // End of template mw_miVCICreDelRes - - /** - * @desc Generic receive template for matching any LinkID value - */ - template Link_ID mw_miLinkIndAny := - { - remoteCIID := ?, - localCIID := ? - } // End of template mw_miLinkIndAny - - template CfAtspEventInd mw_miEventMI_RequestRequest_any := { - miRequestRequest := ? - } // End of template mw_miEventMI_RequestRequest_any - - /** - * @desc Generic receive template for notifications of errors in MI-REQUEST.request service primitive - */ - template E21218_5 mw_miCIStatusErrors := { - paramNo := 0, - parameter := { - Errors := ? - } - } // End of template mw_miCIStatusErrors - - } // End of group cfPortTools - - group atspPort { - - /** - * @desc Receive template - * Allows ITS test system to receive frame from IUT - * @param p_inSapPrimitiveUp: IN-SAP primitive to receive - */ - template(present) AtspInd mw_atspInd( - template INsapPrimitivesUp p_inSapPrimitiveUp - ) := { - msgIn:= p_inSapPrimitiveUp - } // End of template m_atspInd - - } // End of group atspPort - - group utPort { - - - - - } // End of group utPort - - group ut_atspPortTools { - - /** - * @desc Receive template - * Generic template for notifications from a CI via the IN-SAP - * @see ISO 21218 - Clause 8.3.1 - */ - template INsapPrimitivesUp mw_InSapPrimitiveUp_any := { - spRef := ?, - servPrimitive := ? - } // End of template mw_InSapPrimitiveUp_any - - /** - * @desc Receive template - * IN-UNITDATA.indication to notify reception of any frame from any CI - * @see ISO 21218 - Clause 8.3.1 - */ - template INsapPrimitivesUp mwd_inUnitDataInd_any modifies mw_InSapPrimitiveUp_any:= { - spRef := 0, - servPrimitive := { IN_UNITDATA_indication := ? } - } // End of template mwd_inUnitDataInd_any - - /** - * @desc Receive template - * IN-UNITDATA.indication to notify reception of an expected frame given by p_inUnitdataInd - * @param p_inUnitdataInd: The IN-UNITDATA.indication primitive - * @see ISO 21218 - Clause 8.3.1 - */ - template INsapPrimitivesUp mwd_inUnitDataInd( - in template (present) IN_UNITDATA_indication p_inUnitdataInd - ) modifies mwd_inUnitDataInd_any:= { - spRef := 0, - servPrimitive := { IN_UNITDATA_indication := p_inUnitdataInd } - } // End of template mwd_inUnitDataInd - - /** - * @desc Receive template - * IN-UNITDATA-Status.indication to notify any status of any previous transmission request - * @see ISO 21218 - Clause 8.3.1 - */ - template INsapPrimitivesUp mw_inUnitDataStatusInd_any := { - spRef := 1, - servPrimitive := { IN_UNITDATA_STATUS_indication := ? } - } // End of template mw_inUnitDataStatusInd_any - - /** - * @desc Receive template - * IN-UNITDATA-Status.indication to notify an expected status of a previous transmission request - * given by p_inUnitdataStatusInd - * @param p_inUnitdataStatusInd: The IN-UNITDATA-Status.indication primitive - * @see ISO 21218 - Clause 8.3.1 - */ - template INsapPrimitivesUp mwd_inUnitDataStatusInd( - in template (value) IN_UNITDATA_STATUS_indication p_inUnitdataStatusInd - ) modifies mw_inUnitDataStatusInd_any := { - spRef := 1, - servPrimitive := { IN_UNITDATA_STATUS_indication := p_inUnitdataStatusInd } - } // End of template mw_inUnitDataStatusInd - - /** - * @desc IN-UNITDATA.indication primitive - * @param p_insap_source_address Source LinkId - * @param p_insap_dest_address Destination LinkId - * @param p_inData Data in octetstring format - * @param p_priority User Priority - * @param p_accessParameters Access Parameters - * @see ISO 21218 - Clause 8.3.3 - */ - template (present) IN_UNITDATA_indication mw_inUnitDataInd( - in template LLserviceAddr p_insapSourceAddress, - in template LLserviceAddr p_insapDestAddress, - in template INdata p_inData, - in template UserPriority p_priority, - in template AccessParameters p_accessParameters - ) := { - source_addr := p_insapSourceAddress, - dest_addr := p_insapDestAddress, - data := p_inData, - priority := p_priority, - accessParams := p_accessParameters - }; // End of template m_inUnitDataInd - - /** - * @desc IN-UNITDATA-STATUS.indication primitive - * @param p_insap_source_address Source LinkId - * @param p_insap_dest_address Destination LinkId - * @param p_inData Data in octetstring format - * @param p_priority User Priority - * @param p_accessParameters Access Parameters - * @see ISO 21218 - Clause 8.3.3 - */ - template (present) IN_UNITDATA_STATUS_indication mw_inUnitDataStatusInd( - in template LLserviceAddr p_insapSourceAddress, - in template LLserviceAddr p_insapDestAddress, - in template INdata p_inData, - in template UserPriority p_priority, - in template AccessParameters p_accessParameters, - in template INtxStatus p_txStatus - ) := { - source_addr := p_insapSourceAddress, - dest_addr := p_insapDestAddress, - data := p_inData, - priority := p_priority, - accessParams := p_accessParameters, - txStatus := p_txStatus - }; // End of template m_inUnitDataStatusInd - - /** - * @desc Send template - * IN-UNITDATA.request primitive - * @param p_insap_source_address Source linkId - * @param p_insap_dest_address Destination linkId - * @param p_inData Data in octetstring format - * @param p_priority User Priority - * @param p_accessParameters Access Parameters - * @see ISO 21218 - Clause 8.3.3 - */ - template (value) IN_UNITDATA_indication m_inUnitDataInd( - in template LLserviceAddr p_insapSourceAddress, - in template LLserviceAddr p_insapDestAddress, - in template INdata p_inData, - in template UserPriority p_priority, - in template AccessParameters p_accessParameters - ) := { - source_addr := p_insapSourceAddress, - dest_addr := p_insapDestAddress, - data := p_inData, - priority := p_priority, - accessParams := p_accessParameters - }; // End of template m_inUnitDataInd - - /** - * @desc Send template - * LLserviceAddr (IN-SAP source and destination address) - * @param p_inSAPaddress DSAP/SSAP address of the N&T layer protocol - * @param p_linkId Link identifier of the CI - * @see ISO 21218 - Clause 8.2.2 - */ - template (value) LLserviceAddr m_llServiceAddr( - in template IN_SAPaddress p_inSAPaddress, - in template Link_ID p_linkId - ) := { - csap := p_inSAPaddress, - linkID := p_linkId - }; // End of template m_llServiceAddr - - /** - * @desc Send template - * Link-ID based on the combination of remote and local CIID - * @param p_remoteLinkId Remote link ID - * @param p_localLinkId Local link ID - * @see ISO 21218 - Clause 8.2.2 - */ - template (value) Link_ID m_linkId( - in template EUI64 p_remoteLinkId, - in template EUI64 p_localLinkId - ) := { - remoteCIID := p_remoteLinkId, - localCIID := p_localLinkId - }; // End of template m_linkID - - } // End of group ut_atspPortTools - - } // End of group recvOperation - - - group atspInitPrimitives { - /** - * @desc Templates used to - *
  • trigger message on Upper Tester
  • - *
  • capture indication message sent by the IUT
  • - */ - group utPrimitives { - - /** - * @desc Initializes the SUT for ATSP testing - * See Test System Configuration Access to SUT - */ - template (value) UtInitialize m_utAtspInitialize := { - utAtspInitialize := { - mcmdRq := { - mCmdRef := 255, - mcmd := { - TestConfigIICP := { - location := '100000'B, // PX_LOC_ITS_ATSP_ACCESS_SETTINGS_MX_SAP_SET, - lowerLayers := PX_IUT_LOWER_LAYER_USED, - testMode := PX_IUT_TEST_MODE_ON - } - } // End of field 'mcmd' - } // End of field 'mcmdRq' - } // End of field 'utAtspInitialize' - } // End of template m_utAtspInitialize - - } // End of group utPrimitives - - group cfPrimitives { - - /** - * @desc Initializes the Configuration tester - */ - template (value) CfInitialize m_cfAtspInitialize := { - cfAtspInitialize := { - } // End of field 'cfAtspInitialize' - - } // End of template m_cfAtspInitialize - - } // End of group cfPrimitives - - } // End of group atspInitPrimitives - - -} // End of module LibItsAtsp_Templates \ No newline at end of file diff --git a/ttcn/CALM/ATSP/LibItsAtsp_TypesAndValues.ttcn3 b/ttcn/CALM/ATSP/LibItsAtsp_TypesAndValues.ttcn3 deleted file mode 100644 index f095e724..00000000 --- a/ttcn/CALM/ATSP/LibItsAtsp_TypesAndValues.ttcn3 +++ /dev/null @@ -1,247 +0,0 @@ -/** - * @author ETSI / STF455 - * @version $URL$ - * $Id$ - * @desc Types and constants definitions for Access Technology Layer (ISO 21218) - */ -module LibItsAtsp_TypesAndValues { - - import from CALMiitsscu language "ASN.1:1997" { - type - McmdRq - }; - import from CALMmsap language "ASN.1:1997" { - type - SimIUTcmd, SimIUTreq, CIstateChng, - MI_Command_request, MI_Command_confirm, - MI_Request_request, MI_Request_confirm, - MI_Get_request, MI_Get_confirm, - MI_Set_request, MI_Set_confirm, - ErrStatus, WakeUp, - CONcmd - }; - - import from CALMllsap language "ASN.1:1997" { - type - INsapPrimitivesUp, INsapPrimitivesDown, - I_ParamNo, INtxStatus, CIstatus, - UserPriority - }; - - import from LibCommon_BasicTypesAndValues { - type - UInt8 - }; - - group cfContants { - - const UInt8 c_miCmd_regCmd := 1; - const UInt8 c_miCmd_ciState := 2; - const UInt8 c_miCmd_wakeUp := 3; - const UInt8 c_miCmd_rTScmd := 4; - const UInt8 c_miCmd_rTSackCmd := 5; - const UInt8 c_miCmd_cONcmd := 6; - const UInt8 c_miCmd_rIcmd := 7; - const UInt8 c_miCmd_manuCmd := 8; - const UInt8 c_miCmd_vciCmd := 9; - const UInt8 c_miCmd_monitor := 10; - const UInt8 c_miCmd_unitDataCmd := 11; - const UInt8 c_miCmd_UnknownCmd := 254; // this is not part of the standard, only for testing. - const UInt8 c_miCmd_testMI := 255; - - const UInt8 c_miReq_regReq := 1; - const UInt8 c_miReq_prioReg := 2; - const UInt8 c_miReq_rTSreq := 3; - const UInt8 c_miReq_rTSackReq := 4; - const UInt8 c_miReq_rIreq := 5; - const UInt8 c_miReq_manuReq := 6; - const UInt8 c_miReq_events := 7; - const UInt8 c_miReq_posUpdateReq := 8; - const UInt8 c_miReq_unitDataReq := 9; - const UInt8 c_miReq_testMIecho := 255; - - const CONcmd c_ciConDeleteAC := 0; - const CONcmd c_ciConConnect := 1; - const CONcmd c_ciConDisconnect :=255; - - const CIstateChng c_ciStateChngDeregister := 0; - const CIstateChng c_ciStateChngActivate := 4; - const CIstateChng c_ciStateChngResume := 8; - const CIstateChng c_ciStateChngConnect := 16; - const CIstateChng c_ciStateChngDisconnect := 32; - const CIstateChng c_ciStateChngSuspend := 64; - const CIstateChng c_ciStateChngInactivate := 128; - const CIstateChng c_ciStateChngInvalidValue := 255; - - const CIstatus c_ciStatusNot_existent := 0; - const CIstatus c_ciStatusExistent := 1; - const CIstatus c_ciStatusUnknown := 2; - const CIstatus c_ciStatusRegistered := 4; - const CIstatus c_ciStatusActive := 8; - const CIstatus c_ciStatusConnected := 16; - const CIstatus c_ciStatusSuspended := 64; - const CIstatus c_ciStatusInactive := 128; - - const UInt8 c_PrioStatus_release := 0; - const UInt8 c_PrioStatus_request :=16; - const UInt8 c_PrioStatus_ignored := 64; - const UInt8 c_PrioStatus_granted := 128; - - const I_ParamNo c_ciIParamNoErrors := 0; - const I_ParamNo c_ciIParamNoCommProfile := 2; - const I_ParamNo c_ciIParamNoProperties := 3; - const I_ParamNo c_ciIParamNoManuDeviceID := 4; - const I_ParamNo c_ciIParamNoITS_scuId := 5; - const I_ParamNo c_ciIParamNoMedID := 6; - const I_ParamNo c_ciIParamNoLocalCIID := 7; - const I_ParamNo c_ciIParamNoTimeoutReg := 8; - const I_ParamNo c_ciIParamNoMacAddress := 9; - const I_ParamNo c_ciIParamNoMacAddrTemp := 10; - const I_ParamNo c_ciIParamNoCiClass := 11; - const I_ParamNo c_ciIParamNoCiaClass := 12; - const I_ParamNo c_ciIParamNoCiStatus := 13; - const I_ParamNo c_ciIParamNoNotify := 16; - const I_ParamNo c_ciIParamNoMedType := 17; - const I_ParamNo c_ciIParamNoRegInfo := 18; - const I_ParamNo c_ciIParamNoConnect := 19; - const I_ParamNo c_ciIParamNoSimPin := 20; - const I_ParamNo c_ciIParamNoProviderInfo := 21; - const I_ParamNo c_ciIParamNoMinUserPriority := 22; - const I_ParamNo c_ciIParamNoQueueLevel := 23; - const I_ParamNo c_ciIParamNoQueueLowTh := 24; - const I_ParamNo c_ciIParamNoQueueAlarmTh := 25; - const I_ParamNo c_ciIParamNoDistancePeer := 26; - const I_ParamNo c_ciIParamNoCommRangeRef := 27; - const I_ParamNo c_ciIParamNoTimeOfLastRecep := 28; - const I_ParamNo c_ciIParamNoInactTimeLimit := 29; - const I_ParamNo c_ciIParamNoMediumUsage := 30; - const I_ParamNo c_ciIParamNoMedUseObsTime := 31; - const I_ParamNo c_ciIParamNoPeerMAC := 32; - const I_ParamNo c_ciIParamNoVirtualCI := 33; - const I_ParamNo c_ciIParamNoMinPrioCrossCI := 34; - const I_ParamNo c_ciIParamNoRxSens := 35; - const I_ParamNo c_ciIParamNoTxPower := 36; - const I_ParamNo c_ciIParamNoTxPowMax := 37; - const I_ParamNo c_ciIParamNoPeerRXpower := 38; - const I_ParamNo c_ciIParamNoDataRate := 39; - const I_ParamNo c_ciIParamNoDataRateNW := 40; - const I_ParamNo c_ciIParamNoDataRatesNW := 41; - const I_ParamNo c_ciIParamNoDataRateNWreq := 42; - const I_ParamNo c_ciIParamNoDirectivity := 43; - const I_ParamNo c_ciIParamNoBlockLength := 44; - const I_ParamNo c_ciIParamNoFreeAirTime := 45; - const I_ParamNo c_ciIParamNoFrameLengthMax := 46; - const I_ParamNo c_ciIParamNoKineVectIn := 47; - const I_ParamNo c_ciIParamNoKineVectOut := 48; - const I_ParamNo c_ciIParamNoCost := 49; - const I_ParamNo c_ciIParamNoReliability := 50; - const I_ParamNo c_ciIParamNoLogicalChannel := 51; - - const UserPriority c_IParamValueMinPrioCrossCI := 100; - - const ErrStatus c_ciErrStatusSuccess := 0; - const ErrStatus c_ciErrStatusUnspecFailure := 1; - const ErrStatus c_ciErrStatusInvalParamNo := 2; - const ErrStatus c_ciErrStatusInvalParamVal := 3; - const ErrStatus c_ciErrStatusRiViolation := 4; - const ErrStatus c_ciErrStatusCmdReqNo := 5; - const ErrStatus c_ciErrStatusCmdReqVal := 6; - const ErrStatus c_ciErrStatusAccessViolation := 7; - const ErrStatus c_ciErrStatusInvalidType := 8; - const ErrStatus c_ciErrStatusSequenceError := 9; - const ErrStatus c_ciErrStatusNonavailValue := 10; - const ErrStatus c_ciErrStatusHardwareFailure := 255; - - - const WakeUp c_ciWakeUpDisable := 0; - const WakeUp c_ciWakeUpEnable := 255; - - const INtxStatus c_ciINtxStatus_Success := 0; - const INtxStatus c_ciINtxStatus_QueueFull := 1; - const INtxStatus c_ciINtxStatus_Timeout := 2; - const INtxStatus c_ciINtxStatus_Priority := 3; - const INtxStatus c_ciINtxStatus_unspecFailure := 255; - - } - - group cnPrimitives { - /** - * @desc Trigger to initialize the IUT. - * @member McmdRq MN-COMMAND-Request message to initialize the upper tester - * - * @see TS 1xx xxx V<0.0.0> (<2013-04>) - */ - type record UtAtspInitialize { - McmdRq mcmdRq - } with { - encode (mcmdRq) "LibItsIicp_asn1" - } - - /** - * @desc Trigger to initialize the IUT. - * @member McmdRq MN-COMMAND-Request message to initialize the upper tester - * - * @see TS 1xx xxx V<0.0.0> (<2013-04>) - */ - type record CfAtspInitialize { - } - - /** - * @desc Send a MI-SAP.request primitive to the Management layer through a SAP. - * @member miRequestRequest MI_Request_request primitive - */ - type union CfAtspEventInd { - MI_Request_request miRequestRequest, - MI_Command_confirm miCommandConfirm, - MI_Get_confirm miGetConfirm, - MI_Set_confirm miSetConfirm - } - with { - encode (miCommandConfirm, miRequestRequest, miGetConfirm, miSetConfirm) "LibItsCALMmsap_asn1" - } - - /** - * @desc Send a MI-SAP.request primitive to the Management layer through a SAP. - * @member mnCommandRequest MI_Command_request primitive - */ - type union CfAtspEvent { - MI_Request_confirm miRequestConfirm, - MI_Command_request miCommandRequest, - MI_Get_request miGetRequest, - MI_Set_request miSetRequest - } - with { - encode (miRequestConfirm, miCommandRequest, miGetRequest, miSetRequest) "LibItsCALMmsap_asn1" - } - - - } // End of group cnPrimitives - - - group utPrimitives { - - /** - * @desc Present an IN-SAP service primitive to the access layer - * @member inSapPrimitivesDown IN-SAP down primitive - */ - type union UtAtspEvent { - INsapPrimitivesDown inSapPrimitivesDown - } - with { - encode (inSapPrimitivesDown) "LibItsAtsp_asn1" - } - - /** - * @desc Present an IN-SAP service primitive to networking & transport layer - * @member inSapPrimitivesUp IN-SAP up primitive - */ - type union UtAtspEventInd { - INsapPrimitivesUp inSapPrimitivesUp - } - with { - encode (inSapPrimitivesUp) "LibItsAtsp_asn1" - } - - } // End of group utPrimitives - -} // End of module LibItsAtsp_TypesAndValues diff --git a/ttcn/CALM/FNTP/LibItsFntp_Functions.ttcn3 b/ttcn/CALM/FNTP/LibItsFntp_Functions.ttcn3 deleted file mode 100644 index 7e83f701..00000000 --- a/ttcn/CALM/FNTP/LibItsFntp_Functions.ttcn3 +++ /dev/null @@ -1,1485 +0,0 @@ -/** - * @author ETSI / STF422_EETS - * @version $URL$ - * $Id$ - * @desc FAST networking & transport layer protocol (ISO 29281-2) functions - */ -module LibItsFntp_Functions { - - // Libcommon - import from LibCommon_Sync { - function - f_connect4SelfOrClientSync, f_disconnect4SelfOrClientSync, - f_selfOrClientSyncAndVerdict, f_selfOrClientSyncAndVerdictTestBody; - altstep a_shutdown - }; - import from LibCommon_VerdictControl { - type FncRetCode - }; - import from LibCommon_Time { - function f_sleep, f_sleepIgnoreDef - }; - import from LibCommon_BasicTypesAndValues { - type UInt16 - }; - - // LibIts - - // LibItsCalm - import from CALMmanagement language "ASN.1:1997" { - type StationID, ITS_scuId; - }; - import from CALMllsap language "ASN.1:1997" { - type - EUI64, IN_SAPaddress, LLserviceAddr, Link_ID, AccessParameters - }; - import from CALMmsap language "ASN.1:1997" { - type - FWTsetNot - }; - import from CITSapplReq language "ASN.1:1997" { - type ServiceRef - }; - import from CALMfntp language "ASN.1:1997" all; - import from LibItsFntp_TypesAndValues { - const c_portDyn, c_portNon; - type - UtFntpEvent, UtFntpEventInd, - CfFntpEventInd - }; - import from LibItsFntp_Pics { - modulepar PICS_ITS_MGT_NOT - }; - import from LibItsFntp_Templates all; - import from LibItsFntp_Pixits all; - import from LibItsFntp_Pics { - modulepar PICS_ITS_S_INW, PICS_ROLE_RH; - }; - import from LibItsMgt_TypesAndValues { - group constants - }; - import from LibItsMgt_Templates { - template - mdw_fwtSetNotRequestReq, mdw_fwtDeleteFntp, - mw_mnRequestRequest_setNotFNTP - }; - import from LibItsCalm_Interface { - type - UtInitialize, CfInitialize, CfEventInd, - UtResult, CfResult, - ItsCalm - }; - - /** - * @desc Upper tester functions - */ - group utFunctions { - - /** - * @desc Requests to bring the IUT in an initial state - * @param p_utInitialize The initialisation to trigger. - * @verdict Unchanged on success, fail on error and inconc otherwise - */ - function f_utFntpInitializeIut(template (value) UtInitialize p_utInitialize) runs on ItsCalm { - - utPort.send(p_utInitialize); - tc_wait.start; - alt { - [] utPort.receive(UtResult:true) { - tc_wait.stop; - log("*** f_utFntpInitializeIut: INFO: IUT initialized ***"); - } - [] utPort.receive { - tc_wait.stop; - log("*** f_utFntpInitializeIut: INFO: IUT could not be initialized ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_wait.timeout { - log("*** f_utFntpInitializeIut: INFO: IUT could not be initialized in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [else] { // Shortcut defaults - //f_sleep(0.050); // 50 ms - repeat; - } - } // End of 'alt' statement - - } // End of function f_utFntpInitializeIut - - /** - * @desc Send a NFsapPrimitivesDown primitive and wait for the NFsapPrimitivesUp confirm response - * @param p_utFntpEvent The NFsapPrimitivesDown request - * @param p_utFntpEventInd The NFsapPrimitivesDown response - * @param p_discard Set to true if responses shall be discard, otherwise the function failed - * @param p_result The response value - * @verdict Unchanged on success, fail on error and inconc otherwise - */ - function f_utFntpEventResponse( - in template (value) UtFntpEvent p_utFntpEvent, - in template (present) UtFntpEventInd p_utFntpEventInd, - in boolean p_discard, - out UtFntpEventInd p_result) - runs on ItsCalm { - -// log("*** f_utFntpEventResponse: INFO: Send message: ", p_commandReq, " ***"); - utPort.send(p_utFntpEvent); -// log("*** f_utFntpEventResponse: INFO: Expected UtCommandConfirm: ", p_commandConf, " ***"); - tc_wait.start; - alt { - [] utPort.receive(p_utFntpEventInd) -> value p_result { -// log("*** f_utFntpEventResponse: INFO: Receive expected confirm: message ***"); - tc_wait.stop; - } - [] utPort.receive(UtFntpEventInd:? ) -> value p_result { - if (p_discard == false) { - tc_wait.stop; - log("*** f_utFntpEventResponse: ERROR: Event not correctly indicated at application layer ***", p_result); - f_selfOrClientSyncAndVerdict("fail", e_error); - } - else { - log("*** f_utFntpEventResponse: INFO: Another event indicated at application layer, repeating check ***"); - repeat; - } - } - [] tc_wait.timeout { - if (p_discard == false) { - log("*** f_utFntpEventResponse: ERROR: Timeout while waiting for event check result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - else { - log("*** f_utFntpEventResponse: INFO: Event not indicated at application layer ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - } // End of 'alt' statement - - } // End of function f_utFntpEventResponse - - /** - * @desc Send a NFsapPrimitivesDown primitive and do not wait for the NFsapPrimitivesDown confirm response - * @param p_utFntpEvent The NFsapPrimitivesDown primitive - * @verdict Unchanged on success, fail otherwise - */ - function f_utFntpEvent( - in template (value) UtFntpEvent p_utFntpEvent - ) runs on ItsCalm { - var UtFntpEventInd v_utFntpEventInd; - - utPort.send(p_utFntpEvent); - tc_noac.start; - alt { - [] utPort.receive(mdw_fntpCommConfirm_anyError(?)) { // Failure expected - tc_noac.stop; - log("*** f_utFntpEvent: ERROR: Message is confirmed on error only (see ISO/IEC WD 29281-1 Clause 7.6.2 Basic procedure) ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] utPort.receive(mw_fntpCommConfirm_success) { // FIXME Use altstep for UtPort - tc_noac.stop; - log("*** f_utFntpEvent: INFO: Message was confirmed successfully ***"); - } - [] utPort.receive(UtFntpEventInd:?) -> value v_utFntpEventInd { // FIXME Use altstep for UtPort - tc_noac.stop; - log("*** f_utFntpEvent: INFO: Unexpected message was received ***", v_utFntpEventInd); - // FIXME Check the content of the notification, not sure which fields should be set - repeat; - } - [] tc_noac.timeout { - log("*** f_utFntpEvent: INFO: CommandRequest succeed ***"); - } - } // End of 'alt' statement - - } // End of function f_utFntpEvent - - } // End of group utFunctions - - /** - * @desc Config tester functions - */ - group cfFunctions { - - /** - * @desc Requests to initialize the configuration tester - * @param p_cfInitialize The initialisation to trigger. - * @verdict Unchanged on success, fail otherwise - */ - function f_cfFntpInitialize(template (value) CfInitialize p_cfInitialize) runs on ItsCalm { - - cfPort.send(p_cfInitialize); - tc_wait.start; - alt { - [] cfPort.receive(CfResult:true) { - tc_wait.stop; - log("*** f_cfFntpInitialize: INFO: Configuration tester initialized ***"); - } - [] cfPort.receive { - tc_wait.stop; - log("*** f_cfFntpInitialize: INFO: Configuration tester could not be initialized ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_wait.timeout { - log("*** f_cfFntpInitialize: INFO: Configuration tester could not be initialized in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [else] { // Shortcut defaults - //f_sleep(0.050); // 50 ms - repeat; - } - } // End of 'alt' statement - - } // End of function f_cfFntpInitialize - - /** - * @desc Await for notification on MN-SAP - * @param p_cfFntpEventInd The MN_Request_request notification message. - * @param p_discard Set to true if responses shall be discard, otherwise the function failed - * @verdict Unchanged on success, fail otherwise - */ - function f_cfFntpAwaitNotificationToManagement( - in template CfFntpEventInd p_cfFntpEventInd, - in boolean p_discard - ) runs on ItsCalm { - var CfFntpEventInd p_result; - - log("*** f_cfFntpAwaitNotificationToManagement: INFO: Expected event: ", p_cfFntpEventInd, " ***"); - tc_wait.start; - alt { - [] cfPort.receive(p_cfFntpEventInd) { - tc_wait.stop; - log("*** f_cfFntpAwaitNotificationToManagement: INFO: Notification event received ***"); - } - [] cfPort.receive(CfFntpEventInd: ?) -> value p_result { - if (p_discard == false) { - tc_wait.stop; - log("*** f_cfFntpAwaitNotificationToManagement: ERROR: Another event indicated at application layer ***", p_result); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } else { - log("*** f_cfFntpAwaitNotificationToManagement: INFO: Another event indicated at application layer, repeating check ***"); - repeat; - } - } - [] tc_wait.timeout { - if (p_discard == false) { - log("*** f_cfFntpAwaitNotificationToManagement: ERROR: Timeout while waiting for event check result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } else { - log("*** f_cfFntpAwaitNotificationToManagement: INFO: Event not indicated at application layer ***"); - } - } - } // End of 'alt' statement - - } // End of function f_cfFntpAwaitNotificationToManagement - - } // End of group cfFunctions - - /** - * @desc Test adapter setting functions - */ - group fntpConfigurationFunctions { - - /** - * @desc This configuration features: - *
  • Host and Router are combined (see ISO/WD 29281-2 - Figure 1 - Implementation architecture I)
  • - *
  • MGT1 IISC Port (IISC/LAN) is not used
  • - */ - function f_cf01Up() runs on ItsCalm { - - // Sanity check - if (PICS_ITS_S_INW or not(PICS_ROLE_RH)) { - log("*** f_cf01Up: ERROR: 'PICS_ITS_S_INW or not(PICS_ROLE_RH)' required for stting up CF01 ***"); - stop; - } - - // Map - map(self:utPort, system:utPort); - map(self:cfPort, system:cfPort); // FIXME Add check PICS_ITS_MGT_NOT - map(self:fntpPort, system:fntpPort); - - vc_commandRef := 0; - vc_pduCounter := 0; - - // Connect - f_connect4SelfOrClientSync(); - - // Set processing on shutdown - activate(a_cf01Down()); - - // Initialize the component - f_initialiseComponent("cf01Up"); - - // Initialze the IUT - f_initialState(); - - } // End of function f_cf01Up - - /** - * @desc This configuration features: - *
  • Host and Router are separated (see ISO/WD 29281-2 - Figure 3 - Implementation architecture II & III)
  • - *
  • MGT1 IISC Port (IISC/LAN) is not used
  • - */ - function f_cf02Up() runs on ItsCalm { - - // Sanity check - if (not(PICS_ITS_S_INW)) { - log("*** f_cf02Up: ERROR: PICS_ITS_S_INW required for setting uo CF02 ***"); - stop; - } - - vc_commandRef := 0; - vc_pduCounter := 0; - - // Map - map(self:utPort, system:utPort); - map(self:cfPort, system:cfPort); // FIXME Add check PICS_ITS_MGT_NOT - map(self:fntpPort, system:fntpPort); - - // Connect - f_connect4SelfOrClientSync(); - - // Set processing on shutdown - activate(a_cf02Down()); - - // Initialize the component - f_initialiseComponent("cf02Up"); - - // Initialze the IUT - f_initialState(); - - } // End of function f_cf02Up - - /** - * @desc Deletes configuration cf01 - */ - function f_cf01Down() runs on ItsCalm { - - deactivate; - - // Unmap - unmap(self:utPort, system:utPort); - unmap(self:cfPort, system:cfPort); // FIXME Add check PICS_ITS_MGT_NOT - unmap(self:fntpPort, system:fntpPort); - - // Disconnect - f_disconnect4SelfOrClientSync(); - - } // end f_cf01Down - - /** - * @desc Deletes configuration cf02 - */ - function f_cf02Down() runs on ItsCalm { - - deactivate; - - // Unmap - unmap(self:utPort, system:utPort); - unmap(self:cfPort, system:cfPort); // FIXME Add check PICS_ITS_MGT_NOT - unmap(self:fntpPort, system:fntpPort); - - // Disconnect - f_disconnect4SelfOrClientSync(); - - } // End of f_cf02Down - - /** - * @desc Behavior function for initializing component's variables and tables - * @param p_componentName Name of the component - */ - function f_initialiseComponent(in charstring p_componentName) runs on ItsCalm { - - // Initialize variables - vc_componentName := p_componentName; - vc_portNumber := { portLong := c_portNon }; - - // Set defaults - activate(a_fntpDefault()); // Default for Fntp module - } // End of f_initialiseComponent - - } // End of group fntpConfigurationFunctions - - /** - * @desc Preambule functions - */ - group preambles { - - /** - * @desc Brings the IUT into an initial state. - */ - function f_initialState() runs on ItsCalm { - - if (PICS_ITS_MGT_NOT == true) { - f_utFntpInitializeIut(m_utFntpInitialize_with_management); - } else { - f_utFntpInitializeIut(m_utFntpInitialize_without_management); - } - f_cfFntpInitialize(m_cfFntpInitialize); - f_sleepIgnoreDef(PX_WAIT_FOR_IUT_READY); // Wait until the IUT is in a stable situation (beaconing...) - cfPort.clear; // Because TestConfigIICP should trigger management port deletion message - } // End of function f_initialState - - /** - * @desc Implement the following Initial conditions: - *
  • the IUT having set up properly the FNTP forwarding table, and the local port number of the ITS-S application
  • - *
  • the IUT having an entry in the FNTP forwarding table for unicast communication with remote Link Port and Service Port
  • - *
  • the IUT having an entry in the FNTP forwarding table for Service Port = port1, but not for Service Port = port2
  • - *
  • the IUT having an entry in the FNTP forwarding table for a Service Port, but no entry for the peer station
  • - * @param p_port Indicates the port number - * @verdict Unchanged on success, set to fail on error (e_timeout) - * @see ISO 29281-2 Clause 8.2 - */ - // TODO Consider case of c_portDyn, and use f_utEventResponse - function f_initializeFntpForwardingTable(in PortNumber p_port) runs on ItsCalm { - - f_utFntpEventResponse( - m_generateNfFntpPortCreationRequest( - f_getIutServiceRef(), - p_port - ), - mw_utFntpEventInd( - mw_fntpPortConfirm( - f_getIutServiceRef(), - p_port - ) - ), - false, - vc_utEventInd.utFntpEventInd - ); - // Store the allocated port number - vc_portNumber := p_port; - if (ischosen(vc_portNumber.portShort)) { - log("*** f_initializeFntpForwardingTable: INFO: portNumber value is: " & int2str(vc_portNumber.portShort) & " ***"); - } else { - log("*** f_initializeFntpForwardingTable: INFO: portNumber value is: " & int2str(vc_portNumber.portLong) & " ***"); - } - if (PICS_ITS_MGT_NOT) { - // And wait for a MN-SAP.MN-REQUEST/FWTupdate message sent to ITS management entity to update the forwarding table - f_fntpAwaitFwtUpdate_reference( - vc_portNumber, - vc_reference - ); - } - } // End of function f_initializeFntpForwardingTable - - /** - * @desc Wait for MN_Request_request/FWTupdate message sent by IST management entity to update the forwarding table - * @param p_portNumber Contains either the value PORT_NON in order to indicate dynamic assignment of a port number by the port number manager, or a valid value of a well-known static port PORT_REG - * @param p_reference The reference value associated to the provided port number - * @verdict Unchanged - */ - function f_fntpAwaitFwtUpdate_reference( - in template (present) PortNumber p_portNumber, - out integer p_reference - ) runs on ItsCalm { - - f_cfAwaitCreationPortNotificationToManagement( - mw_cfFntpEventInd( - mdw_fwtSetNotRequestReq( - p_portNumber, - PX_USER_PRIORITY, - c_linkId_unknown, - c_unknown_portLong, - c_unknown_portLong - ) - ), - false, - p_reference - ); - } // End of function f_fntpAwaitFwtUpdate_reference - - /** - * @desc Wait for notification from IUT to Management layer - * @param p_cfFntpEventInd Receive template of the expected event - * @param p_discard Set to true if command confirm responses shall be discard, otherwise the function failed - * @param p_reference The reference value associated to the provided port number - * @verdict Unchanged on success, set to fail on error (e_timeout) - */ - function f_cfAwaitCreationPortNotificationToManagement( - in template CfFntpEventInd p_cfFntpEventInd, - in boolean p_discard, - out integer p_reference - ) runs on ItsCalm { - var CfFntpEventInd p_result; - - p_reference := 65535; // See noFNTPfwtEntries FIXME Create a constant - - log("*** f_cfAwaitCreationPortNotificationToManagement: INFO: Expected event: ", p_cfFntpEventInd, " ***"); - tc_wait.start; - alt { - [] cfPort.receive(p_cfFntpEventInd) -> value p_result { - tc_wait.stop; - p_reference := p_result.mnRequestRequest.request_param.FWTsetNot.fwt.SetNotFNTP.reference; - log("*** f_cfAwaitCreationPortNotificationToManagement: INFO: Notification event received, reference entry=", p_reference, " ***"); - } - [] cfPort.receive(CfFntpEventInd: ?) -> value p_result { - if (p_discard == false) { - tc_wait.stop; - log("*** f_cfAwaitCreationPortNotificationToManagement: ERROR: Another event indicated at application layer ***", p_result); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } else { - log("*** f_cfAwaitCreationPortNotificationToManagement: INFO: Another event indicated at application layer, repeating check ***"); - repeat; - } - } - [] tc_wait.timeout { - if (p_discard == false) { - log("*** f_cfAwaitCreationPortNotificationToManagement: ERROR: Timeout while waiting for event check result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } else { - log("*** f_cfAwaitCreationPortNotificationToManagement: INFO: Event not indicated at application layer ***"); - } - } - } // End of 'alt' statement - - } // End of function f_cfAwaitCreationPortNotificationToManagement - - /** - * @desc Wait for MN_Request_request/FWT Update notification from IUT to Management layer - * @param p_portNumber The provided port number value - * @param p_linkId Set VCI link identifier - * @param p_remotePortNumber The remote port number value - * @param p_linkPortNumber The linked port number value - * @verdict Unchanged on success, set to fail on error (e_timeout) - */ - function f_fntpAwaitFwtUpdate( - in template (present) PortNumber p_portNumber, - in template (value) Link_ID p_linkId, - in template (value) PortNumber p_remotePortNumber, - in template (value) PortNumber p_linkPortNumber - ) runs on ItsCalm { - - f_cfFntpAwaitNotificationToManagement( - mw_cfFntpEventInd( - mdw_fwtSetNotRequestReq( - p_portNumber, - PX_USER_PRIORITY, - p_linkId, - p_remotePortNumber, - p_linkPortNumber - ) - ), - false - ); - } // End of function f_fntpAwaitFwtUpdate - - /** - * @desc Wait for MN_Request_request/FWT Delete notification from IUT to Management layer - * @param p_reference The reference value associated to the provided port number - * @verdict Unchanged on success, set to fail on error (e_timeout) - */ - function f_fntpAwaitFwtDelete( - in template (value) integer p_reference - ) runs on ItsCalm { - - f_cfFntpAwaitNotificationToManagement( - mw_cfFntpEventInd( - mdw_fwtDeleteFntp( - p_reference - ) - ), - false - ); - } // End of function f_fntpAwaitFwtDelete() - - /** - * @desc Generate a NF-SAP request and wait for a confirm message - * @param p_generateNfSapRequest The NF-SAP request message to send - * @param p_nfSapRequestConfirm The command confirm response - * @param p_discard Set to true if command confirm responses shall be discard, otherwise the function failed - * @param p_result The command/request confirm response - * @verdict Unchanged on success, fail otherwise - */ - function f_fntpGenerateNfSApRequestWithConfirm( - in template (value) UtFntpEvent p_generateNfSapRequest, - in template (present) UtFntpEventInd p_nfSapRequestConfirm, - in boolean p_discard, - out UtFntpEventInd p_result - ) runs on ItsCalm { - - f_utFntpEventResponse( - p_generateNfSapRequest, - p_nfSapRequestConfirm, - p_discard, - p_result - ); - - } // End of function f_fntpGenerateNfSApRequestWithConfirm - - /** - * @desc Generate a NFsapPrimitivesDown primitive without waiting for a confirm message - * @param p_utFntpEvent The NFsapPrimitivesDown primitive to send - * @verdict Unchanged - */ - function f_fntpGenerateNfSApRequestWithoutConfirm( - in template (value) UtFntpEvent p_utFntpEvent - ) runs on ItsCalm { - - f_utFntpEvent(p_utFntpEvent); - - } // End of function f_fntpGenerateNfSApRequestWithoutConfirm - - /** - * @desc Await for NFsapPrimitivesUp primitive - * @param p_portNumber The port number value - * @param p_linkId The source link identifier - * @verdict Unchanged on success, fail on error and inconc otherwise - */ - function f_fntpAwaitNfSapCommConfirm( - in template (present) PortNumber p_portNumber, - in template (present) Link_ID p_linkId - ) runs on ItsCalm { - var UtFntpEventInd v_utFntpEventInd; - - log("*** f_fntpAwaitNfSapCommConfirm: DEBUG: Expected template: ", - mw_utFntpEventInd( - mdw_checkNfFntpCommIndication( - vc_portNumber, // Destination port of DL-UNITDATA.request primitive - p_portNumber, // Source port of DL-UNITDATA.request primitive - p_linkId // Source address of DL-UNITDATA.request primitive - ))); - tc_wait.start; - alt { - [] utPort.receive( - mw_utFntpEventInd( - mdw_checkNfFntpCommIndication( - vc_portNumber, // Destination port of DL-UNITDATA.request primitive - p_portNumber, // Source port of DL-UNITDATA.request primitive - p_linkId // Source address of DL-UNITDATA.request primitive - ))) -> value v_utFntpEventInd { - tc_wait.stop; - log("*** f_fntpAwaitNfSapCommConfirm: INFO: NF-SAP Communication indication received:", v_utFntpEventInd, " ***"); - } - [] utPort.receive( - mw_utFntpEventInd( - mw_checkNfFntpCommIndication_any - )) -> value v_utFntpEventInd { - tc_wait.stop; - log("*** f_fntpAwaitNfSapCommConfirm: INFO: Unexpected NF-SAP Communication indication received:", v_utFntpEventInd, " ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] utPort.receive(UtFntpEventInd:?) -> value v_utFntpEventInd { - tc_wait.stop; - log("*** f_fntpAwaitNfSapCommConfirm: INFO: Unknown NF-SAP Communication indication received:", v_utFntpEventInd, " ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_wait.timeout { - log("*** f_fntpAwaitNfSapCommConfirm: ERROR: Timeout while waiting for event check result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } // End of 'alt' statement - } // End of function f_fntpAwaitNfSapCommConfirm - - /** - * @desc Call this method to remove entry created by f_initializeFntpForwardingTable() in FNTP Forwarding Table - * @verdict Unchanged on success, fail on error and inconc otherwise - */ - function f_unInitializeFntpForwardingTable() runs on ItsCalm { - // check c_portDyn - // Send for FTN-SOCKET.request & Wait for FTN-SOCKET.confirm - - f_utFntpEventResponse( - m_generateNfFntpPortDeletionRequest( - f_getIutServiceRef(), - vc_portNumber - ), - mw_utFntpEventInd( - mw_fntpPortConfirm( - f_getIutServiceRef(), - c_unknown_portLong - ) - ), - false, - vc_utEventInd.utFntpEventInd - ); - - if (PICS_ITS_MGT_NOT) { - // And wait for a MN-SAP.MN-REQUEST/FWTupdate message sent to ITS management entity to update the forwarding table - f_fntpAwaitFwtDelete( - vc_reference - ); - } - } // End of function f_unInitializeFntpForwardingTable - - /** - * @desc Trigger a basic FNTPNPDU to create an entry in forwarding table for a known peer station - * @verdict Unchanged on success, fail on error and inconc otherwise - */ - function f_setupKnownPeerStation() runs on ItsCalm { - f_sendBasicFntpNpdu( - f_getIutRemotePortNumberValue(), - vc_portNumber, - m_llServiceAddr(mw_linkId(f_getIutRemoteDestCiidUc(), f_getIutWlLocalCiid())), - m_llServiceAddr(mw_linkId(f_getIutWlLocalCiid(), f_getIutWlLocalCiid())) - ); - if (PICS_ITS_MGT_NOT) { - // And wait for a MN-SAP.MN-REQUEST/FWTupdate message sent to ITS management entity to update the forwarding table - f_fntpAwaitFwtUpdate( - vc_portNumber, - mw_linkId(f_getIutRemoteDestCiidUc(), f_getIutWlLocalCiid()), - f_getIutRemotePortNumberValue(), - vc_portNumber - ); - } - // And wait for NF-SAP Comm.ind message sent by the FNTP to the ITS facilities entity - f_fntpAwaitNfSapCommConfirm( - f_getIutRemotePortNumberValue(), - m_linkId(f_getIutRemoteDestCiidUc(), f_getIutWlLocalCiid()) - ); - } // End of function f_setupKnownPeerStation - - } // End of group preambles - - /** - * @desc Postambule functions - */ - group postambles { - - /** - * @desc The default postamble. - */ - function f_poDefault() runs on ItsCalm { - // Nothing to do - } - - } // End of group postambles - - /** - * @desc Message triggreing functions - */ - group messagesTriggering { - - /** - * @desc Triggers test adapter to send FNTP basic NDPU - * @param p_sourcePort Source port (c_portRtr or c_portHst) - * @param p_destinationPort Destination port (c_portRtr or c_portHst) - * @param p_inSapSourceAddress IN-SAP source port - * @param p_inSapDestAddress IN-SAP destination port - * @verdict Unchanged - */ - function f_sendBasicFntpNpdu( - in template (value) PortNumber p_sourcePort, - in template (value) PortNumber p_destinationPort, - in template (value) LLserviceAddr p_inSapSourceAddress, - in template (value) LLserviceAddr p_inSapDestAddress - ) runs on ItsCalm { - fntpPort.send( - m_fntpReq( - m_generateFntpNpdu( - p_inSapSourceAddress, - p_inSapDestAddress, - bit2oct( - encvalue( - m_fntpBasicNpdu( - p_sourcePort, - p_destinationPort - ) - ) - ) - ) - ) - ); - } // End of function f_sendBasicFntpNpdu - - /** - * @desc Triggers test adapter to send FNTP forwarding NDPU - * @param p_sourcePort Source port (c_portRtr or c_portHst) - * @param p_destinationPort Destination port (c_portRtr or c_portHst) - * @param p_fromPort Forwarding source port - * @param p_toPort Forwarding destination port - * @param p_inSapSourceAddress IN-SAP source port - * @param p_inSapDestAddress IN-SAP destination port - * @param p_counter Expected value of FNTP packet counter counter field - * @param p_hops N-hops value - * @verdict Unchanged - */ - function f_sendForwardingNpdu( - in template (value) PortNumber p_sourcePort, - in template (value) PortNumber p_destinationPort, - in template (value) PortNumber p_fromPort, - in template (value) PortNumber p_toPort, - in template (value) LLserviceAddr p_inSapSourceAddress, - in template (value) LLserviceAddr p_inSapDestAddress, - in template (value) FNTPpacketCounter p_counter, - in template (value) FNTPhopCount p_hops - ) runs on ItsCalm { - fntpPort.send( - m_fntpReq( - m_generateFntpNpdu( - p_inSapSourceAddress, - p_inSapDestAddress, - bit2oct( - encvalue( - md_fntpForwardingNpdu( - p_sourcePort, - p_destinationPort, - p_hops, - p_fromPort, - p_toPort, - p_counter - ) - ) - ) - ) - ) - ); - } // End of function f_sendForwardingNpdu - - /** - * @desc Triggers test adapter to send FNTP NDPU - * @param p_sourcePort Source port number - * @param p_destinationPort Destination port number - * @param p_inSapSourceAddress IN-SAP source port - * @param p_inSapDestAddress IN-SAP destination port - * @param p_hops N-hops value - * @verdict Unchanged - */ - function f_sendExtendedFntpNpdu( - in template (value) PortNumber p_sourcePort, - in template (value) PortNumber p_destinationPort, - in template (value) LLserviceAddr p_inSapSourceAddress, - in template (value) LLserviceAddr p_inSapDestAddress, - in FNTPhopCount p_hops - ) runs on ItsCalm { - fntpPort.send( - m_fntpReq( - m_generateFntpNpdu( - p_inSapSourceAddress, - p_inSapDestAddress, - bit2oct( - encvalue( - m_fntpExtendedNpdu( - p_sourcePort, - p_destinationPort, - p_hops - ) - ) - ) - ) - ) - ); - } // End of function f_sendExtendedFntpNpdu - - /** - * @desc Triggers lower tester to send FNTP station-internal NDPU with several hops and an invalid control field - * @param p_sourcePort Source port - * @param p_destinationPort Destination port - * @param p_inSapSourceAddress IN-SAP source port - * @param p_inSapDestAddress IN-SAP destination port - * @param p_hops N-hops value - * @verdict Unchanged - */ - function f_sendFntpNpduInvalidCtrlField( - in template (value) PortNumber p_sourcePort, - in template (value) PortNumber p_destinationPort, - in template (value) LLserviceAddr p_inSapSourceAddress, - in template (value) LLserviceAddr p_inSapDestAddress, - in template (value) FNTPhopCount p_hops - ) runs on ItsCalm { - fntpPort.send( - m_fntpReq( - m_generateFntpNpdu( - p_inSapSourceAddress, - p_inSapDestAddress, - bit2oct( - encvalue( - md_fntpExtendedNpdu_invalidCtrlField( - p_sourcePort, - p_destinationPort, - p_hops - ) - ) - ) - ) - ) - ); - } // End of function f_sendFntpNpduInvalidCtrlField - - /** - * @desc Triggers lower tester to send FNTP station-internal NDPU with bit5 set - * @param p_sourcePort Source port - * @param p_destinationPort Destination port - * @param p_inSapSourceAddress IN-SAP source port - * @param p_inSapDestAddress IN-SAP destination port - * @verdict Unchanged - */ - function f_sendFntpNpduInvalidBitSet( - in template (value) PortNumber p_sourcePort, - in template (value) PortNumber p_destinationPort, - in template (value) LLserviceAddr p_inSapSourceAddress, - in template (value) LLserviceAddr p_inSapDestAddress - ) runs on ItsCalm { - fntpPort.send( - m_fntpReq( - m_generateFntpNpdu( - p_inSapSourceAddress, - p_inSapDestAddress, - bit2oct( - encvalue( - md_fntpExtendedNpdu_invalidBitSet( - p_sourcePort, - p_destinationPort, - omit - ) - ) - ) - ) - ) - ); - } // End of function f_sendFntpNpduInvalidBitSet - - /** - * @desc Triggers test adapter to send FNTP NDPU - * @param p_sourcePort Source port - * @param p_destinationPort Destination port - * @param p_inSapSourceAddress IN-SAP source port - * @param p_inSapDestAddress IN-SAP destination port - * @param p_hops N-hops value - * @param p_rxCIP Receive (RX) parameter settings - * @param p_txCIP Transmit (TX) parameters of a VCI - * @param p_accessParams Access parameters - * @verdict Unchanged - */ - function f_sendFntpNpduCip( - in template (value) PortNumber p_sourcePort, - in template (value) PortNumber p_destinationPort, - in template (value) LLserviceAddr p_inSapSourceAddress, - in template (value) LLserviceAddr p_inSapDestAddress, - in template (value) FNTPhopCount p_hops, - in template (value) RXcip p_rxCip, // TODO Perhaps this parameter is not required, p_accessParams would be enough - in template (value) TXcip p_txCip, // TODO Perhaps this parameter is not required, p_accessParams would be enough - in template (value) AccessParameters p_accessParams - ) runs on ItsCalm { - fntpPort.send( - m_fntpReq( - md_generateFntpNpduCip( - p_inSapSourceAddress, - p_inSapDestAddress, - bit2oct( - encvalue( - md_fntpExtendedNpdu_cip( - p_sourcePort, - p_destinationPort, - p_hops, - p_rxCip, // TODO Perhaps this parameter is not required, p_accessParams would be enough - p_txCip // TODO Perhaps this parameter is not required, p_accessParams would be enough - ) - ) - ), - p_accessParams - ) - ) - ); - } // End of function f_sendFntpNpduCip - - /** - * @desc Triggers test adapter to send FNTP forwarding NDPU with an unknown ITS-SCU-ID - * @param p_sourcePort Source port (c_portRtr or c_portHst) - * @param p_destinationPort Destination port (c_portRtr or c_portHst) - * @param p_fromPort Forwarding source port - * @param p_toPort Forwarding destination port - * @param p_sourcePort IN-SAP source port - * @param p_destinationPort IN-SAP destination port - * @param p_counter Expected value of FNTP packet counter counter field - * @param p_hops N-hops value - * @verdict Unchanged - */ - function f_sendFntpForwardingNpduWithUnknownItsSciId( - in template (value) PortNumber p_sourcePort, - in template (value) PortNumber p_destinationPort, - in template (value) PortNumber p_fromPort, - in template (value) PortNumber p_toPort, - in template (value) LLserviceAddr p_inSapSourceAddress, - in template (value) LLserviceAddr p_inSapDestAddress, - in template (value) FNTPpacketCounter p_counter, - in template (value) FNTPhopCount p_hops - ) runs on ItsCalm { - fntpPort.send( - m_fntpReq( - m_generateFntpNpdu( - p_inSapSourceAddress, - p_inSapDestAddress, - bit2oct( - encvalue( - md_fntpForwardingNpdu_unknownItsScuId( - p_sourcePort, - p_destinationPort, - p_hops, - p_fromPort, - p_toPort, - p_counter - ) // End of field 'md_fntpForwardingNpdu_UnknownITS_SCU_ID' - ) // End of function encvalue - ) // End of function bit2oct - ) // End of field 'm_generateFntpNPDU' - ) - ); - } // End of function f_sendFntpForwardingNpduWithUnknownItsSciId - - /** - * @desc Triggers test adapter to send FNTP forwarding NDPU with CIP - * @param p_sourcePort Source port (c_portRtr or c_portHst) - * @param p_destinationPort Destination port (c_portRtr or c_portHst) - * @param p_fromPort Forwarding source port - * @param p_toPort Forwarding destination port - * @param p_sourcePort IN-SAP source port - * @param p_destinationPort IN-SAP destination port - * @param p_counter Expected value of FNTP packet counter counter field - * @param p_hops N-hops value - * @param p_rxCIP Receive (RX) parameter settings - * @param p_txCIP Transmit (TX) parameters of a VCI - * @verdict Unchanged - */ - function f_sendFntpForwardingNpduCip( - in template (value) PortNumber p_sourcePort, - in template (value) PortNumber p_destinationPort, - in template (value) PortNumber p_fromPort, - in template (value) PortNumber p_toPort, - in template (value) LLserviceAddr p_inSapSourceAddress, - in template (value) LLserviceAddr p_inSapDestAddress, - in template (value) FNTPpacketCounter p_counter, - in template (value) FNTPhopCount p_hops, - in template (value) RXcip p_rxCip, // TODO Perhaps this parameter is not required, p_accessParams would be enough - in template (value) TXcip p_txCip, // TODO Perhaps this parameter is not required, p_accessParams would be enough - in template (value) AccessParameters p_accessParams - ) runs on ItsCalm { - fntpPort.send( - m_fntpReq( - md_generateFntpNpduCip( - p_inSapSourceAddress, - p_inSapDestAddress, - bit2oct( - encvalue( - md_fntpForwardingNpdu_cip( - p_sourcePort, - p_destinationPort, - p_hops, - p_fromPort, - p_toPort, - p_counter, - p_rxCip, // TODO Perhaps this parameter is not required, p_accessParams would be enough - p_txCip // TODO Perhaps this parameter is not required, p_accessParams would be enough - ) // End of field 'md_fntpForwardingNpdu_CIP' - ) // End of function 'encvalue' - ), // End of function 'bit2oct' - p_accessParams - ) - ) - ); - } // End of function f_sendFntpForwardingNpduCip - - } // End of group messagesTriggering - - /** - * @desc Validation helpers functions - */ - group internalFunctions { // TODO Use parametrized function (ETSI ES 202 784) insetad of the three oct2xxx functions - - /** - * @desc This function convert the specified octetstring into a template (FNTPNPDU or FntpExtInd or FntpFwdInd) - * This SHALL be done due to the ASN.1 description of IN-SAP service primitives DL_Unitdata_request/DL_Unitdata_indication - * @param p_data An octetstring to decode - * @param p_syncPoint Current synchronisation point, required to set verdict according to the LibCommon rules - * @param p_decoded The decoded message - * @verdict Unchanged on success, set to fail otherwise - * @see ISO/CD 21218 - Clause 8.2.2 - */ - function f_oct2npdu(in octetstring p_data, in charstring p_syncPoint, out FNTPNPDU p_decoded) runs on ItsCalm { - var bitstring v_data; - var integer v_result; - -// log("*** f_oct2npdu: INFO: pdu: " & oct2str(p_data) & " ***"); - v_data := oct2bit(p_data); - v_result := decvalue(v_data, p_decoded); - if (v_result == 1) { - log("*** f_oct2npdu: FAIL: 'decvalue' operation failed ***"); - f_selfOrClientSyncAndVerdictTestBody(p_syncPoint, e_error); - } else if (v_result == 2) { - log("*** f_oct2npdu: FAIL: 'decvalue' operation failed, not enougth bits ***"); - f_selfOrClientSyncAndVerdictTestBody(p_syncPoint, e_error); - } -// log("*** f_oct2npdu: INFO: Decoded message done ***"); - } // End of function f_oct2npdu - - } // End of group internalFunctions - - /** - * @desc PIXIT accessors - */ - group iutFunctions { - - group cf01 { - - /** - * @desc Get the local identifier of the VCI - * @return The local identifier of the VCI - * @see PX_WL_LOCAL_CIID - * @verdict Unchanged - * @see ISO 21218 - Clause 6.2 Link Identifier - */ - function f_getIutWlLocalCiid() return EUI64 { - return PX_WL_LOCAL_CIID; - } - - function f_getIutWlRemoteCiid() return EUI64 { - return PX_WL_REMOTE_CIID; - } - - /** - * @desc Get the local identifier of the VCI for broadcast on ITS-S host - * @return The local identifier of the VCI for broadcast on ITS-S host - * @see PX_WL_REMOTE_CIID_BC - * @verdict Unchanged - */ - function f_getIutWlRemoteCiidBc() return EUI64 { - return PX_WL_REMOTE_CIID_BC; - } - - /** - * @desc Get the remote CIID for unicast (peer to peer) - * @return The remote CIID for unicast - * @see PX_WL_REMOTE_CIID_UC - * @verdict Unchanged - */ - function f_getIutWlRemoteCiidUc() return EUI64 { - return PX_WL_REMOTE_CIID_UC; - } - - /** - * @desc Get the IUT Link-ID in broadcast transmission mode - * @return The IUT Link-ID in broadcast transmission mode - * @see PX_WL_LINK_ID_BC - * @verdict Unchanged - * @see ISO 21218 - Clause 6.2 Link Identifier - */ - function f_getIutWlLinkIdBc() return Link_ID { - return PX_WL_LINK_ID_BC; - } - - /** - * @desc Get an unknown VCI to be used to transmit the packet, i.e. the peer station, for Unicast - * @return An unknown VCI to be used to transmit the packet - * @see PX_WL_LINK_ID_UNKWNON_UC - * @verdict Unchanged - */ - function f_getIutWlLinkIdUnknownUc() return Link_ID { - return PX_WL_LINK_ID_UNKWNON_UC; - } - - /** - * @desc Get the VCI to be used to transmit the packet, i.e. the peer station, for Unicast - * @return The VCI to be used to transmit the packet, i.e. the peer station, for Unicast - * @see PX_WL_LINK_ID_UC - * @verdict Unchanged - */ - function f_getIutWlLinkIdUc() return Link_ID { - return PX_WL_LINK_ID_UC; - } - - } // End of group cf01 - - group cf02 { - - /** - * @desc Get the local identifier of the VCI - * @return The local identifier of the VCI - * @see PX_LAN_LOCAL_CIID - * @verdict Unchanged - * @see ISO 21218 - Clause 6.2 Link Identifier - */ - function f_getIutLanLocalCiid() return EUI64 { - return PX_LAN_LOCAL_CIID; - } - - /** - * @desc Get the local identifier of the VCI for broadcast on ITS-S host - * @return The local identifier of the VCI for broadcast on ITS-S host - * @see PX_LAN_REMOTE_CIID_BC - * @verdict Unchanged - */ - function f_getIutLanRemoteCiidBc() return EUI64 { - return PX_LAN_REMOTE_CIID_BC; - } - - /** - * @desc Get the IUT Link-ID in broadcast transmission mode - * @return The IUT Link-ID in broadcast transmission mode - * @see PX_LAN_LINK_ID_BC - * @verdict Unchanged - * @see ISO 21218 - Clause 6.2 Link Identifier - */ - function f_getIutLanLinkIdBc() return Link_ID { - return PX_LAN_LINK_ID_BC; - } - - /** - * @desc Get the identifier of a different VCI on ITS-S host/router only - * @return The identifier of a different VCI on ITS-S host/router only - * @see PX_LAN_DIFFERENT_LOCAL_CIID - * @verdict Unchanged - */ - function f_getIutLanDifferentLocalCiid() return EUI64 { - return PX_LAN_DIFFERENT_LOCAL_CIID; - } - - } // End of group cf02 - - group peerStation { - - /** - * @desc Get the local identifier of the VCI - * @return The local identifier of the VCI - * @see PX_DEST_LOCAL_CIID - * @verdict Unchanged - * @see ISO 21218 - Clause 6.2 Link Identifier - */ - function f_getIutDestLocalCiid() return EUI64 { - return PX_DEST_LOCAL_CIID; - } - - /** - * @desc Get the remote identifier of the VCI for broadcast on ITS-S host - * @return The remote identifier of the VCI for broadcast on ITS-S host - * @see PX_DEST_REMOTE_CIID_BC - * @verdict Unchanged - * @see ISO 21218 - Clause 6.2 Link Identifier - */ - function f_getIutRemoteDestCiidBc() return EUI64 { - return PX_DEST_REMOTE_CIID_BC; - } - - /** - * @desc Get the remote identifier of a second VCI for unicast (peer to peer) on ITS-S host - * @return The remote identifier of a a second VCI for unicast (peer to peer) on ITS-S host - * @see PX_DEST_REMOTE_CIID_UC - * @verdict Unchanged - */ - function f_getIutRemoteDestCiidUc() return EUI64 { - return PX_DEST_REMOTE_CIID_UC; - } - - /** - * @desc Get the identifier of a second VCI for unicast (peer to peer) on ITS-S host - * @return The identifier of a a second VCI for unicast (peer to peer) on ITS-S host - * @see PX_WL_SECOND_REMOTE_CIID_BC - * @verdict Unchanged - */ - function f_getIutSecondRemoteDestCiidBc() return EUI64 { - return PX_SECOND_REMOTE_CIID_BC; - } - - } // End of group peerStation - - /** - * @desc Get the application port number, used instead of c_portDyn - * @return The application port number, used instead of c_portDyn - * @see PX_APP_PORT_NUMBER - * @verdict Unchanged - */ - function f_getIutAppPortValue() return PortNumber { - return PX_APP_PORT_NUMBER; - } - - /** - * @desc Get the source forwarding port - * @return The source forwarding port - * @see PX_FORWARDING_SRC_PORT - * @verdict Unchanged - */ - function f_getIutForwardingSrcPort() return PortNumber { - return PX_FORWARDING_SRC_PORT; - } - - /** - * @desc Get the destination forwarding port - * @return The destination forwarding port - * @see PX_FORWARDING_DST_PORT - * @verdict Unchanged - */ - function f_getIutForwardingDestPort() return PortNumber { - return PX_FORWARDING_DST_PORT; - } - - /** - * @desc Get the source port number, i.e. the local endpoint - * @return The source port number - * @see PX_LOCAL_PORT_NUMBER - * @verdict Unchanged - */ - function f_getIutLocalPortNumberValue() return PortNumber { - return PX_LOCAL_PORT_NUMBER; - } - - /** - * @desc Unknown broadcast VCI - * @return An unknown broadcast VCI - * @see PX_WL_LINK_ID_UNKWNON_BC - * @verdict Unchanged - */ - function f_getIutWlLinkIdUnknownBc() return Link_ID { - return PX_WL_LINK_ID_UNKWNON_BC; - } - - /** - * @desc Get the ITS-SP payload EPDU - * @return The ITS-SP payload EPDU - * @see PX_ITS_FPDU - * @verdict Unchanged - */ - function f_getIutItsFpdu() return ITSfpdu { - return PX_ITS_FPDU; - } - - /** - * @desc Get the service reference defining a number uniquely identifying the endpoint at this host in an implementation specific way - * @return The service reference - * @see PX_SERVICE_REF - * @verdict Unchanged - */ - function f_getIutServiceRef() return ServiceRef { - return PX_SERVICE_REF; - } - - /** - * @desc Get the Single-hop value - * @return The Single-hop value - * @verdict Unchanged - */ - function f_getIutShopValue() return FNTPhopCount { - return PX_SHOP; - } - - /** - * @desc Get the N-hops value - * @return The N-hops value - * @verdict Unchanged - */ - function f_getIutNhopsValue() return FNTPhopCount { - return PX_NHOPS; - } - - /** - * @desc Get a service port number - * @return The service port number - * @see PX_SERVICE_PORT - * @verdict Unchanged - */ - function f_getIutServicePortValue() return PortNumber { - return PX_SERVICE_PORT; - } - - /** - * @desc Get the reception access parameter - * @return The reception access parameter - * @see PX_CIP_RX_SETTINGS - * @verdict Unchanged - */ - function f_getIutRxCipValue() return RXcip { - return PX_CIP_RX_SETTINGS; - } - - /** - * @desc Get the transmission access parameter - * @return The transmission access parameter - * @see PX_CIP_TX_SETTINGS - * @verdict Unchanged - */ - function f_getIutTxCipValue() return TXcip { - return PX_CIP_TX_SETTINGS; - } - - function f_getIutAccessParametersValue() return AccessParameters { - return PX_ACCESS_PARAMETERS_SETTINGS; - } - - /** - * @desc Get the remote port number value - * @return The remote port number value - * @see PX_REMOTE_PORT_NUMBER - * @verdict Unchanged - */ - function f_getIutRemotePortNumberValue() return PortNumber { - return PX_REMOTE_PORT_NUMBER; - } // End of function f_getIutRemotePortNumberValue - - /** - * @desc Get the second remote port number value - * @return The second remote port number value - * @see PX_SECOND_REMOTE_PORT_NUMBER - * @verdict Unchanged - */ - function f_getIutSecondRemotePortNumberValue() return PortNumber { - return PX_SECOND_REMOTE_PORT_NUMBER; - } // End of function f_getIutSecondRemotePortNumberValue - - } // End of group iutFunctions - - /** - * @desc altstep functions - */ - group fntpAltsteps { - - /** - * @desc The base default. - */ - altstep a_fntpDefault() runs on ItsCalm { - [] tc_wait.timeout { - log("*** a_fntpDefault: ERROR: Timeout while awaiting reaction of the IUT prior to Upper Tester action ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] tc_ac.timeout { // For security because it should be done in main altsetp bloc - log("*** a_fntpDefault: ERROR: Timeout while awaiting the reception of a message ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] any timer.timeout { - log("*** a_fntpDefault: INCONC: An unknown timer has expired in default ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] a_shutdown() { - f_poDefault(); - log("*** a_fntpDefault: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - if(self == mtc) { - f_cf01Down(); - } - stop; - } - } // End of altstep a_fntpDefault() - - /** - * @desc The base default. - */ - altstep a_fntpUnsollictedMessages() runs on ItsCalm { - [] fntpPort.receive(mw_fntpInd(mw_fntpInSapPrimitiveReq(mw_inUnitDataReq_any))) { - log("*** a_fntpDefault: INFO: Unexpected FNTP NDPU received in default ***"); - } - [] fntpPort.receive(mw_fntpInd(?)) { - log("*** a_fntpUnsollictedMessages: INFO: Unkown FNTP NDPU received in default ***"); - } - [] fntpPort.receive { - log("*** a_fntpUnsollictedMessages: INFO: Unkown message received in default ***"); - } - } // End of altstep a_fntpUnsollictedMessages() - - /** - * @desc Default handling cf01 de-initialisation. - */ - altstep a_cf01Down() runs on ItsCalm { - [] a_shutdown() { - f_poDefault(); - f_cf01Down(); - log("*** a_cf01Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } // End of altstep a_cf01Down() - - /** - * @desc Default handling cf02 de-initialisation. - */ - altstep a_cf02Down() runs on ItsCalm { - [] a_shutdown() { - f_poDefault(); - f_cf02Down(); - log("*** a_cf02Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } // End of altstep a_cf02Down() - - } // End of group fntpAltsteps - -} // End of module LibItsFntp_Functions \ No newline at end of file diff --git a/ttcn/CALM/FNTP/LibItsFntp_Pics.ttcn3 b/ttcn/CALM/FNTP/LibItsFntp_Pics.ttcn3 deleted file mode 100644 index b90c65db..00000000 --- a/ttcn/CALM/FNTP/LibItsFntp_Pics.ttcn3 +++ /dev/null @@ -1,88 +0,0 @@ -/** - * @author ETSI / STF422_EETS - * @version $URL$ - * $Id$ - * @desc FAST networking & transport layer protocol (ISO 29281) PICS - */ -module LibItsFntp_Pics { - - /** - * @desc FNTP PICS - */ - group fntpPics { - - /** - * @desc Does the architecture implement ITS station-internal network? - * @see ETSI TS 102 985-1 v1.1.2 A.1/1 - */ - modulepar boolean PICS_ITS_S_INW := false; - - /** - * @desc Is IUT an host only? - * @see ETSI TS 102 985-1 v1.1.2 A.2/1 - */ - modulepar boolean PICS_ROLE_RONLY := false; - - /** - * @desc Is IUT a router only? - * @see ETSI TS 102 985-1 v1.1.2 A.2/2 - */ - modulepar boolean PICS_ROLE_HONLY := false; - - /** - * @desc Is IUT both host and router? - * @see ETSI TS 102 985-1 v1.1.2 A.2/3 - */ - modulepar boolean PICS_ROLE_RH := true; - - /** - * @desc Is IUT support basic architecture? - * @see ETSI TS 102 985-1 v1.1.2 A.3/1 - */ - modulepar boolean PICS_BASIC := true; - - /** - * @desc Is IUT support extended architecture? - * @see ETSI TS 102 985-1 v1.1.2 A.3/2 - */ - modulepar boolean PICS_EXT := false; - - /** - * @desc Is IUT support ITS station-internal forwarding? - * @see ETSI TS 102 985-1 v1.1.2 A.4/1 - */ - modulepar boolean PICS_IFWD := false; - - /** - * @desc Is IUT support secure communication? - * @see ETSI TS 102 985-1 v1.1.2 A.4/2 - */ - modulepar boolean PICS_SEC := false; - - /** - * @desc Is IUT support N-hop broadcast? - * @see ETSI TS 102 985-1 v1.1.2 A.4/3 - */ - modulepar boolean PICS_NHOPBC := false; - - /** - * @desc Is access parameters settings supported? - * @see ETSI TS 102 985-1 v1.1.2 A.4/5 - */ - modulepar boolean PICS_CIP := false; - - /** - * @desc Is IUT support 15628 Kernel Emulation? - * @see ETSI TS 102 985-1 v1.1.2 A.5/1 - */ - modulepar boolean PICS_15628 := false; - - /** - * @desc Is IUT support notification to the ITS Management layer - * @see ETSI TS 102 985-1 v1.1.2 A.6/3 - */ - modulepar boolean PICS_ITS_MGT_NOT := false; - - } // End of group fntpPics - -} // End of module LibItsFntp_Pics \ No newline at end of file diff --git a/ttcn/CALM/FNTP/LibItsFntp_Pixits.ttcn3 b/ttcn/CALM/FNTP/LibItsFntp_Pixits.ttcn3 deleted file mode 100644 index fb4b7e1b..00000000 --- a/ttcn/CALM/FNTP/LibItsFntp_Pixits.ttcn3 +++ /dev/null @@ -1,361 +0,0 @@ -/** - * @author ETSI / STF422_EETS - * @version $URL$ - * $Id$ - * @desc FAST networking & transport layer protocol (ISO 29281-2) Pixits - * @see ETSI TS 102 985-3 v1.1.2 - */ -module LibItsFntp_Pixits { - - // LibCommon - import from LibCommon_DataStrings { - type Bit6, Bit7 - }; - - // LibIts - - // LibItsCalm - import from CITSapplMgmtApplReg language "ASN.1:1997" { - type ITSaid - }; - import from CALMmanagement language "ASN.1:1997" { - type - ITS_scuId, StationID - }; - import from CALMllsap language "ASN.1:1997" { - type - EUI64, - UserPriority, Link_ID, - AccessParameters, NullType - }; - import from CALMfntp language "ASN.1:1997" { - type - PortNumber, ITSfpdu, FNTPhopCount, - RXcip, TXcip - }; - import from CALMlegacySupport language "ASN.1:1997" { - type FNTPlpp - }; - import from CITSapplReq language "ASN.1:1997" { - type ServiceRef - }; - - /** - * @desc Service reference value used bu NF-FNTP-PORT.request SAP primitive - */ - group generalSettings { - - /** - * @desc Defines a number uniquely identifying the endpoint at this host in an implementation specific way - * @see ISO 29281-2 - Clause 8.2.1 Link Identifier - */ - modulepar ServiceRef PX_SERVICE_REF := { - itsaid:= { - content := 8 - }, - instance := 1, - flowNo := 0 - }; - - /** - * @desc ITS-SP payload - * For instance, a DENM messages associated to a Slow vehicle in ASN.1 PER encoding - */ - modulepar ITSfpdu PX_ITS_FPDU := '0102000000021b3b4056b49d200d693a3ffffffffc21f861a83c87843f7ffff809f754399d4eba7fff84202800'O; - - /** - * @desc The user priority as specified in ISO 21218 - */ - modulepar UserPriority PX_USER_PRIORITY := 0; - - /** - * @desc The ITS-SCU-ID of the host ITS-SCU - */ - modulepar ITS_scuId PX_HOST_SCU_ID := 8; - - /** - * @desc The ITS-SCU-ID of an unknown host ITS-SCU - */ - modulepar ITS_scuId PX_UNKNOWN_HOST_SCU_ID := 65534; - - } // End of group generalSettings - - /** - * @desc 64 bits MAC addresses for local CIs/VCIs for ITS_S router (e.g.G5 CI/VCI) - */ - group routerWlanVcisMac { - - /** - * @desc Identifies the VCI localCIID on ITS-S router (e.g. It coud be the G5 radio MAC address of the IUT) - * @see ISO 21218 - Clause 6.2 Link Identifier - * NOTE 0A0B0CFFFE0D0E0F is MAC address 0A:0B:0C:0D:0E:0F - */ - modulepar EUI64 PX_WL_LOCAL_CIID := '0A0B0CFFFE0D0E0F'O; // Commsignia FNTP setting (laptop) -// modulepar EUI64 PX_WL_LOCAL_CIID := 'FFFFFFFFFEFFFFFF'O ; // Commsignia FSAP setting -// modulepar EUI64 PX_WL_LOCAL_CIID := 'D4CA6DFFFF55A72C'O ; // Commsignia FNTP setting (ITS-S box) -// modulepar EUI64 PX_WL_LOCAL_CIID := '000C42FFFF6A9E2C'O; // Peek setting (@home) -// modulepar EUI64 PX_WL_LOCAL_CIID := '000C42FFFF974497'O; // Peek setting (@office) - - /** - * @desc Identifies the VCI remoteCIID on ITS-S router (e.g. It coud be the G5 radio MAC address of the IUT) - * @see ISO 21218 - Clause 6.2 Link Identifier - */ - modulepar EUI64 PX_WL_REMOTE_CIID := '0A0B0CFFFE0D0E0F'O; // Commsignia setting -// modulepar EUI64 PX_WL_REMOTE_CIID := '000C42FFFF6A9E2C'O; // Peek setting (@home) -// modulepar EUI64 PX_WL_REMOTE_CIID := '000C42FFFF974497'O; // Peek setting (@office) - - /** - * @desc Identifies the VCI for broadcast on ITS-S router - * Note that U/L bit is set to 1 for broadcast - */ - modulepar EUI64 PX_WL_REMOTE_CIID_BC := 'FFFFFFFFFEFFFFFF'O; - - /** - * @desc Identifies the VCI for multicast on ITS-S router - */ - modulepar EUI64 PX_WL_REMOTE_CIID_MC := 'EF0008FFFE011234'O; - - /** - * @desc Identifies the VCI for unicast on ITS-S router (peer station) - */ - modulepar EUI64 PX_WL_REMOTE_CIID_UC := '030008FFFE010001'O; // Commsignia setting -// modulepar EUI64 PX_WL_REMOTE_CIID_UC := '030008FFFF010001'O; // Peek setting - - /** - * @desc Identifies an unknown CI on ITS-S router - */ - modulepar EUI64 PX_WL_LOCAL_CIID_UNKNOWN := '030008FFFE020001'O; - - /** - * @desc Identifies the VCI for multicast on ITS-S router - */ - modulepar EUI64 PX_WL_REMOTE_CIID_UNKNOWN_UC := '030008FFFE020001'O; - - /** - * @desc Identifies an unknown CI on ITS-S router - */ - modulepar EUI64 PX_WL_REMOTE_CIID_UNKNOWN_BC := 'FF0008FFFF02FFFF'O; - - } // End of group routerWlanVcisMac - - /** - * @desc 64 bits MAC addresses for lan CIs/VCIs to connect to the ITS station-internal network - */ - group routerLanVcisMac { - - /** - * @desc Identifies the CI on ITS-S host - * @see ISO 21218 - Clause 6.2 Link Identifier - */ - modulepar EUI64 PX_LAN_LOCAL_CIID := '03000AFFFEFF0000'O; - - /** - * @desc Identifies the VCI for broadcast on ITS-S host - */ - modulepar EUI64 PX_LAN_REMOTE_CIID_BC := 'FF000AFFFEFFFFFF'O; - - /** - * @desc Identifies the VCI for unicast on ITS-S host - */ - modulepar EUI64 PX_LAN_REMOTE_CIID_UC := '03000AFFFEFF0001'O; - - /** - * @desc Identifies a different VCI on ITS-S host - * @see ISO 21218 - Clause 6.2 Link Identifier - */ - modulepar EUI64 PX_LAN_DIFFERENT_LOCAL_CIID := '03000AFFFEFE0001'O; - - } // End of routerLanVcisMac - - /** - * @desc 64 bits MAC addresses for the peer ITS-S station - */ - group peerItsStationVcisMac { - - /** - * @desc Identifies uniquely a specific CI in a specific ITS-SCU - * @see ISO 21218 - Clause 6.2 Link Identifier - */ - modulepar EUI64 PX_DEST_LOCAL_CIID := '030009FFFE010000'O; - - /** - * @desc Identifies uniquely a specific CI in a specific ITS-SCU for broadcast - */ - modulepar EUI64 PX_DEST_REMOTE_CIID_BC := 'FFFFFFFFFEFFFFFF'O; // Standard value -// modulepar EUI64 PX_DEST_REMOTE_CIID_BC := 'FFFFFFFFFFFFFFFF'O; // For Peek - - /** - * @desc Identifies uniquely a specific CI in a specific ITS-SCU for multicast - */ - modulepar EUI64 PX_DEST_REMOTE_CIID_MC := '030009FFFE010001'O; - - /** - * @desc Identifies uniquely a specific VCI in a specific ITS-SCU for unicast (peer to peer) - */ - modulepar EUI64 PX_DEST_REMOTE_CIID_UC := '030009FFFE010001'O; // Commsignia -// modulepar EUI64 PX_DEST_REMOTE_CIID_UC := 'D4CA6DFFFF55A72C'O; // Peek - - /** - * @desc Identifies a second VCI for unicast (peer to peer) on ITS-SCU - */ - modulepar EUI64 PX_SECOND_REMOTE_CIID_BC := '040002FFFE010005'O; - - } // End of peerItsStationVcisMac - - /** - * @desc Contains the Link Identifier parameters for broadcast, Multicast and unicast modes - * @see ISO 21218 Clause 6.2 - * Notes: - *
  • vciID Identifies the MAC address of the Communication Interface identified by the CIID
  • - *
  • CIID Identifies the Communication Interface of the ITS-SCU. 0 indicates unknown or not existent
  • - *
  • scuID Identifies the ITS-SCU in the ITS station
  • - */ - group linkIds { - - group cf01 { - - /** - * @desc Identify the VCI to be used to transmit the packet outside (e.g. G5), i.e. the IUT station, for Broadcast - */ - modulepar Link_ID PX_WL_LINK_ID_BC := { - remoteCIID := PX_WL_REMOTE_CIID_BC, - localCIID := PX_WL_LOCAL_CIID - } - - } // End of group cf01 - - group cf02 { - - /** - * @desc Identify the VCI to be used to transmit the packet to the LAN, for Broadcast - */ - modulepar Link_ID PX_LAN_LINK_ID_BC := { - remoteCIID := PX_LAN_REMOTE_CIID_BC, - localCIID := PX_LAN_LOCAL_CIID - } - - } // End of group cf02 - - /** - * @desc Identify an unknown VCI to be used to transmit the packet, i.e. the peer station, for Broadcast - */ - modulepar Link_ID PX_WL_LINK_ID_UNKWNON_BC := { - remoteCIID := PX_WL_REMOTE_CIID_UNKNOWN_BC, - localCIID := PX_WL_LOCAL_CIID_UNKNOWN - } - - /** - * @desc Identify an unknown VCI to be used to transmit the packet, i.e. the peer station, for Unicast - */ - modulepar Link_ID PX_WL_LINK_ID_UNKWNON_UC := { - remoteCIID := PX_WL_REMOTE_CIID_UNKNOWN_UC, - localCIID := PX_WL_LOCAL_CIID_UNKNOWN - } - - /** - * @desc Identify the VCI to be used to transmit the packet, i.e. the peer station, for Unicast - */ - modulepar Link_ID PX_WL_LINK_ID_UC := { - remoteCIID := PX_WL_REMOTE_CIID_UC, - localCIID := PX_WL_LOCAL_CIID - } - - } // End of group linkIds - - /** - * @desc Source and destination Ports - * @see ISO/WD 29281-2 Clause 6.2.2.2 - */ - group portNumbers { - - /** - * @desc Indicate the application port number, used instead of c_portDyn - */ - modulepar PortNumber PX_APP_PORT_NUMBER := { portLong := 12345 } ; - - /** - * @desc Indicate the source port number, i.e. the local endpoint - */ - modulepar PortNumber PX_LOCAL_PORT_NUMBER := { portLong := 5555 } ; - - /** - * @desc Indicate the destination port number, i.e. the peer ITS-SP - */ - modulepar PortNumber PX_REMOTE_PORT_NUMBER := { portLong := 5556 } ; - - /** - * @desc Indicate a second destination port number - */ - modulepar PortNumber PX_SECOND_REMOTE_PORT_NUMBER := { portLong := 5557 } ; - - /** - * @desc Indicate an unknown destination port number - */ - modulepar PortNumber PX_UNKNOWN_REMOTE_PORT_NUMBER := { portLong := 666 } ; - - /** - * @desc Indicate the forwarding source port number, i.e. the originator endpoint - * @see ISO/CD 29281-2 Clause 8.3.1 - */ - modulepar PortNumber PX_FORWARDING_SRC_PORT := { portLong := 5550 } ; - - /** - * @desc Indicate the forwarding destination port number, i.e. the destinator endpoint - * @see ISO/CD 29281-2 Clause 8.3.1 - */ - modulepar PortNumber PX_FORWARDING_DST_PORT := { portLong := 5551 } ; - - /** - * @desc Indicate the forwarding destination port number, i.e. the destinator endpoint - * @see ISO/CD 29281-2 Clause 8.3.1 - */ - modulepar PortNumber PX_SERVICE_PORT := { portLong := 32700 } ; - - } // End of group portNumbers - - group hopsConstants { - - /** - * Single hop value - * @see ISO/CD 29281-2 Clause 8.3.1 NF-FNTP-COMM.request - */ - modulepar FNTPhopCount PX_SHOP := 0; - - /** - * N hops value - * @see ISO/CD 29281-2 Clause 8.3.1 NF-FNTP-COMM.request - */ - modulepar FNTPhopCount PX_NHOPS := 5; - - } // End of group hopsConstants - - group cipConstants { - - /** - * Access parameters settings for reception - * @see ISO/CD 29281-2 Clause 7.10.1 Purpose of CIPs - */ - modulepar RXcip PX_CIP_RX_SETTINGS := 'CAFEDECA'O; - - /** - * Access parameters settings for transmission - * @see ISO/CD 29281-2 Clause 7.10.1 Purpose of CIPs - */ - modulepar TXcip PX_CIP_TX_SETTINGS := 'C0CAC01A'O; - - } // End of group cipConstants - - group accessParams { - - modulepar AccessParameters PX_ACCESS_PARAMETERS_SETTINGS := { - apRef := 0, - aParameter := { NullType := NULL } - } - - } // End of group accessParams - - /** - * Wait until the IUT is in a stable situation (beaconing...) - */ - modulepar float PX_WAIT_FOR_IUT_READY := 1.0; -} // End of module LibItsFntp_Pixits \ No newline at end of file diff --git a/ttcn/CALM/FNTP/LibItsFntp_Templates.ttcn3 b/ttcn/CALM/FNTP/LibItsFntp_Templates.ttcn3 deleted file mode 100644 index 63ba98f7..00000000 --- a/ttcn/CALM/FNTP/LibItsFntp_Templates.ttcn3 +++ /dev/null @@ -1,1204 +0,0 @@ -/** - * @author ETSI / STF455 - * @version $URL$ - * $Id$ - * @desc Templates definitions for FAST networking & transport layer protocol (ISO 29281-1) - */ -module LibItsFntp_Templates { - - // LibCommon - import from LibCommon_BasicTypesAndValues { - type - UInt8, UInt16; - }; - import from LibCommon_DataStrings { - type Oct1 - }; - - // LibIts - - // LibItsCalm - import from CALMllsap language "ASN.1:1997" { - type - IN_SAPaddress, EUI64, LLserviceAddr, Link_ID, INdata, AccessParameters, - INsapPrimitivesDown, INsapPrimitivesUp, - IN_UNITDATA_request, IN_UNITDATA_indication - }; - import from CALMmsap language "ASN.1:1997" { - type - CommandRef, ErrStatus, - MN_Command_confirm, - MN_Request_request, - SimNUTcmd, SimNLTcmd - }; - import from CALMmanagement language "ASN.1:1997" { - type - StationID, ITS_scuId - }; - import from CALMiitsscu language "ASN.1:1997" { - type - McmdRs, TestConfigIICP, - PduCounter - }; - import from CITSapplReq language "ASN.1:1997" { - type ServiceRef - }; - import from CALMfntp language "ASN.1:1997" all; - import from LibItsCalm_Pixits { - modulepar - PX_LOC_ITS_FNTP_ACCESS_SETTINGS_MX_SAP_SET, PX_LOC_ITS_FNTP_ACCESS_SETTINGS_MX_SAP_UNSET, - PX_IUT_LOWER_LAYER_USED, PX_IUT_LOWER_LAYER_UNUSED, - PX_IUT_TEST_MODE_ON - }; - import from LibItsFntp_TypesAndValues { - group fntpPortsValues; - type - UtFntpEvent, UtFntpEventInd, - CfFntpEventInd - }; - import from LibItsFntp_Pixits all; - import from LibItsMgt_Functions { - function - f_getNextCommandRef, - f_getIutDestItsScuId, f_getIutOtherItsScuId, - f_getNextPduCounter - }; - import from LibItsCalm_Interface { - type - FntpReq, FntpInd, - UtInitialize, CfInitialize - }; - - /** - * @desc constants definitions - */ - group csapCstes { - - /** - * @desc CSAP value - * @see ISO 21218 - Table 5 — Addresses for the Link Service Access Point (IN-SAP) - */ - const IN_SAPaddress c_fntpInSapAddress := 186; //oct2int('BA'O); - - } // group csapCstes - - /** - * @desc ASN.1 error status definitions - */ - group errorStatusCstes { - - /** - * @desc Success code - */ - const FNTPerrorStatus c_errStatus_success := 0; - - /** - * @desc Unexpected failure code - */ - const FNTPerrorStatus c_errStatus_unspecFailure := 1; - - } // group errorStatusCstes - - /** - * @descFNTP templates definitions - */ - group fntpPrimitives { - - /** - * @desc Send template for IN-SAP Message (FntpPort Primitive) - * @param p_inSapPrimitivesUp IN-SAP message to be sent to the IUT - */ - template (value) FntpReq m_fntpReq( - template (value) INsapPrimitivesUp p_inSapPrimitivesUp - ) := { - msgOut := p_inSapPrimitivesUp - } - - /** - * @desc Receive template for IN-SAP message (FntpPort Primitive) - * @param p_inSapPrimitivesDown Expected IN-SAP message generqted by the IUT - */ - template FntpInd mw_fntpInd( - template (present) INsapPrimitivesDown p_inSapPrimitivesDown - ) := { - msgIn := p_inSapPrimitivesDown, - receptionTime := ? - } - - /** - * @desc Primitive on IN-SAP interface - * @see ISO 21218 - Clause 8.3 - * @see ISO 29281-2 - Clause 7.1.2 - */ - group inSapPrimitives { - - group sendOperation { - - /** - * @desc Generate a FNTP NPDU through IN-SAP - * @param p_insapSourceAddress Source linkId - * @param p_insapDestAddress Destination linkId - * @param p_inData The FNTP NPDU in octetstring format - * @see ISO 21218 - Clause 8.3.3 - */ - template (value) IN_UNITDATA_indication m_inUnitDataInd( - in template (value) LLserviceAddr p_insapSourceAddress, - in template (value) LLserviceAddr p_insapDestAddress, - in template (value) INdata p_inData - ) := { - source_addr := p_insapSourceAddress, - dest_addr := p_insapDestAddress, - data := p_inData, - priority := 0, - accessParams := { - apRef := 0, - aParameter := { NullType:= NULL } - } - } // End of template m_inUnitDataInd - - /** - * @desc Send template for IN-SAP source and destination address - * @param p_linkId Link identifier of the CI - * @see ISO 21218 - Clause 8.2.2 - */ - template (value) LLserviceAddr m_llServiceAddr( - in template (value) Link_ID p_linkId - ) := { - csap := c_fntpInSapAddress, - linkID := p_linkId - } // // End of template m_llServiceAddr - - /** - * @desc Send template for link-ID - * @param p_remoteLinkId Remote link ID - * @param p_localLinkId Local link ID - * @see ISO 21218 - Clause 8.2.2 - */ - template (value) Link_ID m_linkId( - in template (value) EUI64 p_remoteLinkId, - in template (value) EUI64 p_localLinkId - ) := { - remoteCIID := p_remoteLinkId, - localCIID := p_localLinkId - } // End of template m_linkID - - } // End of group sendOperation - - group recvOperation { - - /** - * @desc Receive template for a SAP primitive message on IN-SAP interface - * @param p_inUnitdataRq The IN-DATA.request SAP primitive message - * @see ISO 21218 - Clause 8.3.1 - * @see ISO 29281-2 - Clause 7.1.2 - */ - template INsapPrimitivesDown mw_fntpInSapPrimitiveReq( - in template (present) IN_UNITDATA_request p_inUnitdataRq - ) := { - spRef := 0, - servPrimitive := { IN_UNITDATA_request := p_inUnitdataRq } - } // End of template m_fntpImPrimitiveReq - - /** - * @desc Generic receive template for IN-UNITDATA.request SAP primitive - * @see ISO 21218 - Clause 8.2.2 - */ - template IN_UNITDATA_request mw_inUnitDataReq_any := { - source_addr := { - csap := c_fntpInSapAddress, - linkID := ? - }, - dest_addr := { - csap := c_fntpInSapAddress, - linkID := ? - }, - data := ?, - priority := PX_USER_PRIORITY, - accessParams := { - apRef := ?, - aParameter := ? - } - } // End of template mw_inUnitDataReq_any - - /** - * @desc Receive template for IN-UNITDATA.request SAP primitive - * @param p_sourceLinkId Source linkId - * @param p_destLinkId Destination linkId - * @see ISO 21218 - Clause 8.2.2 - */ - template IN_UNITDATA_request mdw_inUnitDataReq( - in template (present) Link_ID p_sourceLinkId, - in template (present) Link_ID p_destLinkId - ) modifies mw_inUnitDataReq_any := { - source_addr := { - csap := c_fntpInSapAddress, - linkID := p_sourceLinkId - }, - dest_addr := { - csap := c_fntpInSapAddress, - linkID := p_destLinkId - } - } // End of template mdw_inUnitDataReq - - /** - * @desc Receive template for IN-UNITDATA.request SAP primitive - * @param p_sourceLinkId Source linkId - * @param p_destLinkId Destination linkId - * @param p_accessParams Access parameters - * @see ISO 21218 - Clause 8.2.2 - */ - template IN_UNITDATA_request mdw_inUnitDataReqCip( - in template (present) Link_ID p_sourceLinkId, - in template (present) Link_ID p_destLinkId, - in template (present) AccessParameters p_accessParams - ) modifies mdw_inUnitDataReq := { - accessParams := p_accessParams - } // End of template mdw_inUnitDataReqCip - - /** - * @desc Receive template for link-ID - * @param p_remoteLinkId Remote link Id - * @param p_localLinkId Source link Id - * @see ISO 21218 - Clause 8.2.2 - */ - template Link_ID mw_linkId( - in template (present) EUI64 p_remoteLinkId, - in template (present) EUI64 p_localLinkId - ) := { - remoteCIID := p_remoteLinkId, - localCIID := p_localLinkId - } // End of template mw_linkID - - /** - * @desc Receive template for IN-SAP source and destination address - * @param p_linkId Link identifier of the CI - * @see ISO 21218 - Clause 8.2.2 - */ - template LLserviceAddr mw_llServiceAddr( - in template (present) Link_ID p_linkId - ) := { - csap := c_fntpInSapAddress, - linkID := p_linkId - } // End of template mw_llServiceAddr - - } // End of group recvOperation - - } // End of group inSapPrimitives - - /** - * @desc Fntp NPUD templates - */ - group fntpBasicNpdu { - - /** - * @desc Send template for basic NPDU for UC/BC transmission- N/single hop - * For basic FNTPNPDU, S-Hop is required (see ISO 29281-1 Clause 5.1.2 Basic mode of operation) - * @param p_sourcePort Source port - * @param p_destinationPort Destination port - */ - template FNTPNPDU m_fntpBasicNpdu( - in template (value) PortNumber p_sourcePort, - in template (value) PortNumber p_destinationPort - ) := { - header := { - sourcePort := p_sourcePort, - destinationPort := p_destinationPort, - options := { - intForw := omit, - sec := omit, - hops := omit, // It means single-hop - lpp := omit, - cip := omit, - opt5 := omit, - opt6 := omit, - opt7 := omit - } // End of 'options' field - }, // End of 'header' field - body := PX_ITS_FPDU - } // End of template m_fntpBasicNpdu - - /** - * @desc Send template for basic NPDU for UC/BC transmission- N/single hop - * @param p_sourcePort Source port - * @param p_destinationPort Destination port - * @param p_hops N-hops value - */ - template FNTPNPDU m_fntpExtendedNpdu( - in template (value) PortNumber p_sourcePort, - in template (value) PortNumber p_destinationPort, - in template (omit) FNTPhopCount p_hops - ) := { - header := { - sourcePort := p_sourcePort, - destinationPort := p_destinationPort, - options := { - intForw := omit, - sec := omit, - hops := p_hops, - lpp := omit, - cip := omit, - opt5 := omit, - opt6 := omit, - opt7 := omit - } // End of 'options' field - }, // End of 'header' field - body := PX_ITS_FPDU - } // End of template m_fntpExtendedNpdu - - /** - * @desc Generic receive template for FNTP basic NPDU - * Used for: - *
  • modifying restrictif template
  • - *
  • default altstep
  • - */ - template FNTPNPDU mw_fntpBasicNpdu_any := { - header := { - sourcePort := { portLong := complement((c_portReservedLow .. c_portReservedHigh)) }, // See ISO 29281-2 Table 1: FNTP endpoints identified by port numbers - destinationPort := ?, - options := mw_noFntpOptions - }, // End of 'header' field - body := ? - } // End of template mw_fntpBasicNpdu_any - - /** - * @desc Receive template for FNTP basic NPDU, specifying port values - * For basic FNTPNPDU, S-Hop is required (see ISO 29281-1 Clause 5.1.2 Basic mode of operation) - * @param p_sourcePort Source port number - * @param p_destinationPort Destination (or remote) port number - */ - template (present) FNTPNPDU mdw_fntpBasicNpdu( - in template (present) PortNumber p_sourcePort, - in template (present) PortNumber p_destinationPort - ) modifies mw_fntpBasicNpdu_any := { - header := { - sourcePort := p_sourcePort, - destinationPort := p_destinationPort, - options := { - hops := 0 ifpresent - } // End of 'options' field - }, // End of 'header' field - body := PX_ITS_FPDU - } // End of template mw_basicNpdu - - } // End of group fntpBasicNpdu - - group fntpExtendedNpdu { - - /** - * @desc Send template for FNTP extended NPDU with an invalid control fields (lpp is set) - * @param p_sourcePort Broadcast source port - * @param p_destinationPort Broadcast destination port - * @param p_hops N-hops value - * @see ISO 29281-2 - Table 3 — FNTP control field (implemented as OPTION selector in ASN.1) - */ - template FNTPNPDU md_fntpExtendedNpdu_invalidCtrlField( - in template (value) PortNumber p_sourcePort, - in template (value) PortNumber p_destinationPort, - in template (omit) FNTPhopCount p_hops /* TODO this seems to be wrong */ - ) modifies m_fntpBasicNpdu := { - header := { - options := { - lpp := 'FFFFFFFF'O /* this is not an invalid control field */ - } - } // End of 'header' field - } // End of template md_fntpExtendedNpdu_invalidCtrlField - - /** - * @desc Send template for FNTP extended NPDU with an invalid control fields (lpp is set) - * @param p_sourcePort Broadcast source port - * @param p_destinationPort Broadcast destination port - * @param p_hops N-hops value - * @see ISO 29281-2 - Table 3 — FNTP control field (implemented as OPTION selector in ASN.1) - */ - template FNTPNPDU md_fntpExtendedNpdu_invalidBitSet( - in template (value) PortNumber p_sourcePort, - in template (value) PortNumber p_destinationPort, - in template (omit) FNTPhopCount p_hops - ) modifies m_fntpBasicNpdu := { - header := { - options := { - opt5 := NULL - } // End of 'options' field - } // End of 'header' field - } // End of template md_fntpExtendedNpdu_invalidBitSet - - /** - * @desc Send template for FNTP extended NPDU with an invalid control fields (lpp is set) - * @param p_sourcePort Broadcast source port - * @param p_destinationPort Broadcast destination port - * @param p_hops N-hops value - * @param p_rxCIP Receive (RX) parameter settings - * @param p_txCIP Transmit (TX) parameters of a VCI - */ - template FNTPNPDU md_fntpExtendedNpdu_cip( - in template (value) PortNumber p_sourcePort, - in template (value) PortNumber p_destinationPort, - in template (omit) FNTPhopCount p_hops, // Should be omitted - in template (value) RXcip p_rxCip, - in template (value) TXcip p_txCip - ) modifies m_fntpBasicNpdu := { - header := { - options := { - hops := p_hops, - cip := { - rxCIP := p_rxCip, - txCIP := p_txCip - } // End of 'cip' field - } // End of'options' field - } // End of 'header' field - } // End of template md_fntpExtendedNpdu_cip - - /** - * @desc Send template for FNTP extended NPDU for BC transmission-single/N-hops - * @param p_sourcePort Broadcast source port - * @param p_destinationPort Broadcast destination port - */ - template (present) FNTPNPDU mdw_fntpExtendedNpdu( - in template (present) PortNumber p_sourcePort, - in template (present) PortNumber p_destinationPort - ) modifies mdw_fntpBasicNpdu := { - header := { - options := mdw_nHopNfFntpOptions(PX_NHOPS) - } // End of field 'header' - } // End of template mdw_fntpExtendedNPDU - - /** - * @desc Send template for FNTP extended NPDU for BC transmission-single/N-hops - * @param p_sourcePort Broadcast source port - * @param p_destinationPort Broadcast destination port - */ - template (present) FNTPNPDU mdw_fntpExtendedNpdu_portNumber( - in template (present) PortNumber p_sourcePort, - in template (present) PortNumber p_destinationPort, - in template (omit) FNTPhopCount p_hops - ) modifies mdw_fntpBasicNpdu := { - header := { - options := mdw_nHopNfFntpOptions(p_hops) - } // End of field 'header' - } // End of template mdw_fntpExtendedNpdu_portNumber - - /** - * @desc Send template for FNTP extended NPDU for BC transmission-single/N-hops with CIP - * @param p_rxCIP Receive (RX) parameter settings - * @param p_txCIP Transmit (TX) parameters of a VCI - */ - template (present) FNTPNPDU mw_fntpExtendedNpduCip( - in template (present) RXcip p_rxCip, - in template (present) TXcip p_txCip - ) := { - header := { - sourcePort := { portLong := complement((c_portReservedLow .. c_portReservedHigh)) }, // See ISO 29281-2 Table 1: FNTP endpoints identified by port numbers - destinationPort := ?, - options := mdw_nHopNfFntpOptions_cip( - PX_NHOPS, - p_rxCip, - p_txCip - ) - }, // End of field 'header' - body := ? - } // End of template mdw_fntpExtendedNPDU - - } // End of group fntpExtendedNpdu - - group fntpForwardingNpdu { - - /** - * @desc Send template for FNTP forwarding NPDU - * @param p_sourcePort Source port (c_portRtr or c_portHst) - * @param p_destinationPort Destination port (c_portRtr or c_portHst) - * @param p_hops N-hops value - * @param p_fromPort Forwarding source port - * @param p_toPort Forwarding destination port - * @param p_counter Expected value of FNTP packet counter counter field - */ - template (value) FNTPNPDU md_fntpForwardingNpdu( - in template (value) PortNumber p_sourcePort, - in template (value) PortNumber p_destinationPort, - in template (value) FNTPhopCount p_hops, - in template (value) PortNumber p_fromPort, - in template (value) PortNumber p_toPort, - in template (value) FNTPpacketCounter p_counter - ) modifies m_fntpBasicNpdu := { - header := { - options := { - intForw := { - hostITS_scuId := PX_HOST_SCU_ID, - link := PX_WL_LINK_ID_UC, - counter := p_counter, - sourcePort := p_fromPort, - destinationPort := p_toPort - } // End of field 'intForw' - } // End of field 'options' - } // End of field 'header' - } // End of template md_fntpForwardingNpdu - - /** - * @desc Send template for FNTP forwarding NPDU with an unknown ITS-SCU-ID - * @param p_sourcePort Source port (c_portRtr or c_portHst) - * @param p_destinationPort Destination port (c_portRtr or c_portHst) - * @param p_hops N-hops value - * @param p_fromPort Forwarding source port - * @param p_toPort Forwarding destination port - * @param p_counter Expected value of FNTP packet counter counter field - */ - template (value) FNTPNPDU md_fntpForwardingNpdu_unknownItsScuId( - in template (value) PortNumber p_sourcePort, - in template (value) PortNumber p_destinationPort, - in template (value) FNTPhopCount p_hops, - in template (value) PortNumber p_fromPort, - in template (value) PortNumber p_toPort, - in template (value) FNTPpacketCounter p_counter - ) modifies md_fntpForwardingNpdu := { - header := { - options := { - intForw := { - hostITS_scuId := PX_UNKNOWN_HOST_SCU_ID, - link := PX_WL_LINK_ID_UC, - counter := p_counter, - sourcePort := p_fromPort, - destinationPort := p_toPort - } // End of field 'intForw' - } // End of field 'options' - } // End of field 'header' - } // End of template md_fntpForwardingNpdu_UnknownITtsScuId - - /** - * @desc Send template for FNTP forwarding NPDU with CIPs - * @param p_sourcePort Source port (c_portRtr or c_portHst) - * @param p_destinationPort Destination port (c_portRtr or c_portHst) - * @param p_hops N-hops value - * @param p_fromPort Forwarding source port - * @param p_toPort Forwarding destination port - * @param p_counter Expected value of FNTP packet counter counter field - * @param p_rxCIP Receive (RX) parameter settings - * @param p_txCIP Transmit (TX) parameters of a VCI - */ - template (value) FNTPNPDU md_fntpForwardingNpdu_cip( - in template (value) PortNumber p_sourcePort, - in template (value) PortNumber p_destinationPort, - in template (value) FNTPhopCount p_hops, - in template (value) PortNumber p_fromPort, - in template (value) PortNumber p_toPort, - in template (value) FNTPpacketCounter p_counter, - in template (value) RXcip p_rxCip, - in template (value) TXcip p_txCip - ) modifies md_fntpForwardingNpdu := { - header := { - options := { - intForw := { - hostITS_scuId := PX_HOST_SCU_ID, - link := PX_WL_LINK_ID_UC, - counter := p_counter, - sourcePort := p_fromPort, - destinationPort := p_toPort - }, // End of field 'intForw' - cip := { - rxCIP := p_rxCip, - txCIP := p_txCip - } // End of field 'cip' - } // End of field 'options' - } // End of field 'header' - } // End of template md_fntpForwardingNpdu_cip - - /** - * @desc Generic receive template for FNTP forwarding NPDU - */ - template (present) FNTPNPDU mw_fntpForwardingNpdu_any := { - header := { - sourcePort := ?, - destinationPort := ?, - options := { - intForw := { - hostITS_scuId := ?, - link := { - remoteCIID := ?, - localCIID := ? - }, - counter := ?, - sourcePort := ?, - destinationPort := ? - }, - sec := omit, - hops := ?, - lpp := omit, - cip := omit, - opt5 := omit, - opt6 := omit, - opt7 := omit - } - }, - body := ? - } // End of template mw_fntpForwardingNpdu_any - - /** - * @desc Receive template for FNTP forwarding NPDU - * @param p_sourcePort Source port - * @param p_destinationPort Destination port - * @param p_fromPort Forwarding source port - * @param p_toPort Forwarding destination port - * @param p_hops N-hops value - * @param p_counter Expected value of FNTP packet counter counter field - */ - template (present) FNTPNPDU mdw_fntpForwardingNpdu( - in template (present) UInt16 p_sourcePort, // FIXME Change it into PortNumber - in template (present) UInt16 p_destinationPort, // FIXME Change it into PortNumber - in template (present) PortNumber p_fromPort, - in template (present) PortNumber p_toPort, - in template (present) FNTPpacketCounter p_counter, - in template (present) FNTPhopCount p_hops - ) modifies mw_fntpForwardingNpdu_any := { - header := { - sourcePort := { portLong := p_sourcePort }, - destinationPort := { portLong := p_destinationPort }, - options := { - intForw := { - counter := p_counter, - sourcePort := p_fromPort, - destinationPort := p_toPort - }, // End of field 'intForw' - hops := p_hops - } // End of field 'options' - }, // End of field 'header' - body := PX_ITS_FPDU - } // End of template mdw_fntpForwardingNpdu - - /** - * @desc Receive template for FNTP forwarding NPDU with CIP - * @param p_sourcePort Source port - * @param p_destinationPort Destination port - * @param p_fromPort Forwarding source port - * @param p_toPort Forwarding destination port - * @param p_hops N-hops value - * @param p_counter Expected value of FNTP packet counter counter field - * @param p_rxCIP Receive (RX) parameter settings - * @param p_txCIP Transmit (TX) parameters of a VCI - */ - template (present) FNTPNPDU mdw_fntpForwardingNpduCip( - in template (present) UInt16 p_sourcePort, - in template (present) UInt16 p_destinationPort, - in template (present) PortNumber p_fromPort, - in template (present) PortNumber p_toPort, - in template (present) FNTPpacketCounter p_counter, - in template (present) FNTPhopCount p_hops, - in template (present) RXcip p_rxCip, - in template (present) TXcip p_txCip - ) modifies mdw_fntpForwardingNpdu := { - header := { - sourcePort := { portLong := c_portRtr }, - destinationPort := { portLong := c_portHst }, - options := { - intForw := { - counter := p_counter, - sourcePort := p_fromPort, - destinationPort := p_toPort - }, // End of field 'intForw' - hops := p_hops, - cip := { - rxCIP := p_rxCip, - txCIP := p_txCip - } // End of field 'cip' - } // End of field 'options' - } // End of field 'header' - } // End of template mdw_fntpForwardingNpduCip - - } // End of group fntpForwardingNpdu - - group fntpManagement { - - /** - * @desc Generic receive template for UpdateNotFNTP - */ - template UpdateNotFNTP mw_updateNotFNTP_any := { - fill := '0'B, - reference := ?, - remotePort := *, - linkID := *, - ciStatus := *, - linkPort := *, - serviceInfo := *, - priority := *, - timeout_ := * - } // End of template mw_updateNotFNTP_any - - /** - * @desc Receive template for UpdateNotFNTP - * @param p_remotePort Remote port value - */ - template (present) UpdateNotFNTP mdw_updateNotFNTP_port( - in template (present) PortNumber p_remotePort - ) modifies mw_updateNotFNTP_any := { - remotePort := p_remotePort - } // End of template mdw_updateNotFNTP_port - - } // End of group fntpManagement - - /** - * @desc template used to trigger message on Lower Tester - */ - group taPrimitives { - - /** - * @desc Generate a FNTP NPDU through IN-SAP - * @param p_insapSourceAddress Source linkId - * @param p_insapDestAddress Destination linkId - * @param p_inData The FNTP NPDU in octetstring format - * @see ISO 21218 - Clause 8.3.3 - */ - template (value) INsapPrimitivesUp m_generateFntpNpdu( - in template (value) LLserviceAddr p_insapSourceAddress, - in template (value) LLserviceAddr p_insapDestAddress, - in template (value) INdata p_inData - ) := { - spRef := 0, - servPrimitive := { - IN_UNITDATA_indication := - m_inUnitDataInd( - p_insapSourceAddress, - p_insapDestAddress, - p_inData - ) - } - } // End of template m_generateFntpNpdu1 - - /** - * @desc Generate a FNTP NPDU through IN-SAP - * @param p_insapSourceAddress Source linkId - * @param p_insapDestAddress Destination linkId - * @param p_inData The FNTP NPDU in octetstring format - * @param p_accessParams access_parameters parameter - * @see ISO 21218 - Clause 8.3.3 & Clause 8.5 - * @see ISO 29281-2 - Clause 7.10.1 - */ - template (value) INsapPrimitivesUp md_generateFntpNpduCip( - in template (value) LLserviceAddr p_insapSourceAddress, - in template (value) LLserviceAddr p_insapDestAddress, - in template (value) INdata p_inData, - in template (present) AccessParameters p_accessParams - ) modifies m_generateFntpNpdu := { - servPrimitive := { - IN_UNITDATA_indication := { - accessParams := p_accessParams - } // End of field 'inUnitdataInd' - } // End of field 'servPrimitive' - } // End of template m_generateFntpNpduCip - - } // End of group taPrimitives - - /** - * @desc Templates used to - *
  • trigger message on Upper Tester
  • - *
  • capture indication message sent by the IUT
  • - */ - group utPrimitives { - - /** - * @desc Initializes the FNTP IUT including support notification to the Management entity - * See Test System Configuration Access to SUT - */ - template (value) UtInitialize m_utFntpInitialize_with_management := { - utFntpInitialize := { - mcmdRq := { - mCmdRef := 255, - mcmd := { - TestConfigIICP := { - location := PX_LOC_ITS_FNTP_ACCESS_SETTINGS_MX_SAP_UNSET, - lowerLayers := PX_IUT_LOWER_LAYER_UNUSED, // PX_IUT_LOWER_LAYER_USED - testMode := PX_IUT_TEST_MODE_ON - } - } // End of field 'mcmd' - } // End of field 'mcmdRq' - } // End of field 'utFntpInitialize' - } // End of template m_utFntpInitialize_with_management - - /** - * @desc Initializes the FNTP IUT without support notification to the Management entity - * See Test System Configuration Access to SUT - */ - template (value) UtInitialize m_utFntpInitialize_without_management := { - utFntpInitialize := { - mcmdRq := { - mCmdRef := 255, - mcmd := { - TestConfigIICP := { - location := PX_LOC_ITS_FNTP_ACCESS_SETTINGS_MX_SAP_UNSET, - lowerLayers := PX_IUT_LOWER_LAYER_UNUSED, // PX_IUT_LOWER_LAYER_USED - testMode := PX_IUT_TEST_MODE_ON - } - } // End of field 'mcmd' - } // End of field 'mcmdRq' - } // End of field 'utFntpInitialize' - } // End of template m_utFntpInitialize_without_management - - /** - * @desc Receive template to generate a NFsapPrimitivesUp message - * @param p_nfSapPrimitivesUp The NFsapPrimitivesUp message - */ - template (present) UtFntpEventInd mw_utFntpEventInd( - in template (present) NFsapPrimitivesUp p_nfSapPrimitivesUp - ) := { - nfSapPrimitivesUp := p_nfSapPrimitivesUp - } // End of template mw_utFntpEventInd - - group fntpNfPort { - - /** - * @desc Send template to request creation or modification of a socket for an endpoint - * @param p_serviceRef Number uniquely identifying the endpoint at this host in an implementation specific way - * @param p_portNumber Contains either the value PORT_NON in order to indicate dynamic assignment of a port number by the port number manager, or a valid value of a well-known static port PORT_REG - * @see ISO 29281-2 Clause 8.2.1 - */ - template (value) UtFntpEvent m_generateNfFntpPortCreationRequest( - in template (value) ServiceRef p_serviceRef, - in template (value) PortNumber p_portNumber - ) := { - nfSapPrimitivesDown := { - spRef := 0, - servPrimitive := { - NFfntpPortRequest := { - serviceRef := p_serviceRef, - operation := 255, // FIXME Change to constant - portno := p_portNumber, - priority := PX_USER_PRIORITY - } // End of field 'NFfntpPortRequest' - } // End of field 'servPrimitive' - } // End of field 'nfSapPrimitivesDown' - } // End of template m_generateNfFntpPortCreationRequest - - /** - * @desc Send template to request deletion of a socket for an endpoint - * @param p_serviceRef Number uniquely identifying the endpoint at this host in an implementation specific way - * @param p_portNumber Contains the port to be deleted - * @see ISO 29281-2 Clause 8.2.1 - */ - template (value) UtFntpEvent m_generateNfFntpPortDeletionRequest( - in template (value) ServiceRef p_serviceRef, - in template (value) PortNumber p_portNumber - ) := { - nfSapPrimitivesDown := { - spRef := 0, - servPrimitive := { - NFfntpPortRequest := { - serviceRef := p_serviceRef, - operation := 0, // Deletion requested FIXME Change to constant - portno := p_portNumber, - priority := PX_USER_PRIORITY - } // End of field 'NFfntpPortRequest' - } // End of field 'servPrimitive' - } // End of field 'nfSapPrimitivesDown' - } // End of template m_generateNfFntpPortDeletionRequest - - /** - * @desc Receive template used by the FNTP to acknowledge a previous NF-FNTP-PORT.request - * @param p_serviceRef Contains the same value provided in parameter "serviceRef" in the related NF-FNTP-SOCKET.request - * @param p_servicePort Contains the Service port number assigned by the FNTP - * @see ISO 29281-2 Clause 8.2.2 - */ - template NFsapPrimitivesUp mw_fntpPortConfirm( - in template (present) ServiceRef p_serviceRef, - in template (present) PortNumber p_servicePort - ) := { - spRef := 0, - servPrimitive := { - NFfntpPortConfirm := { - serviceRef := p_serviceRef, - servicePort := p_servicePort - } // End of field 'NFfntpPortConfirm' - } // End of field 'servPrimitive' - } // End of template mw_fntpPortConfirm - - } // End of group fntpNfPort - - /** - * @desc Receive a succesful COMMAND.confirm primitive - * @see ISO 29281-2 Clause 8.2.1 NF-FNTP-PORT.request - */ - template (present) UtFntpEventInd mw_fntpCommConfirm_success := { //FIXME To be renamed - nfSapPrimitivesUp := { - spRef := 1, - servPrimitive := { - NFfntpCommConfirm := { - commRef := ?, - servicePort := ?, - errStatus := c_errStatus_success - } // End of field 'NFfntpCommConfirm' - } // End of field 'servPrimitive' - } // End of field 'nfSapPrimitivesUp' - } // End of template mw_fntpCommConfirm_success - - /** - * @desc Receive a succesful COMMAND.confirm primitive - * @see ISO 29281-2 Clause 8.2.1 NF-FNTP-PORT.request - */ - template (present) UtFntpEventInd mdw_fntpCommConfirm_success( - in template (value) PortNumber p_port - ) modifies mw_fntpCommConfirm_success := { //FIXME To be renamed - nfSapPrimitivesUp := { - servPrimitive := { - NFfntpCommConfirm := { - servicePort := p_port, - errStatus := c_errStatus_success - } // End of field 'NFfntpCommConfirm' - } // End of field 'servPrimitive' - } // End of field 'nfSapPrimitivesUp' - } // End of template mw_fntpCommConfirm_success - - /** - * @desc Receive a succesful COMMAND.confirm primitive - * @see ISO 29281-2 Clause 8.2.1 NF-FNTP-PORT.request - */ - template (present) UtFntpEventInd mdw_fntpCommConfirm_anyError( - in template (present) PortNumber p_port - ) modifies mw_fntpCommConfirm_success := { - nfSapPrimitivesUp := { - servPrimitive := { - NFfntpCommConfirm := { - servicePort := p_port, - errStatus := complement(c_errStatus_success) - } // End of field 'NFfntpCommConfirm' - } // End of field 'servPrimitive' - } // End of field 'nfSapPrimitivesUp' - } // End of template mdw_fntpCommConfirm_anyError - - /** - * @desc Receive an unsuccesful COMMAND.confirm primitive - * @see ISO/WD 29281-2 Clause 8.3.2 - */ - template (present) UtFntpEventInd mdw_fntpCommConfirm_unspecFailure( - in template (present) PortNumber p_port - ) modifies mdw_fntpCommConfirm_anyError := { - nfSapPrimitivesUp := { - servPrimitive := { - NFfntpCommConfirm := { - errStatus := c_errStatus_unspecFailure - } // End of field 'NFfntpCommConfirm' - } // End of field 'servPrimitive' - } // End of field 'nfSapPrimitivesUp' - } // End of template mdw_fntpCommConfirm_fail - - /** - * @desc Send template for a NF-SAP command request - * @param p_commRef Unique cyclic reference number of command - * @param p_servicePort Port number allocated by FN-FNTP-SOCKECT.create operation - * @param p_linkID Identifies the VCI to be used to transmit the packet - * @param p_data Contains the ITS-SP payload EPDU - * @param p_controlField Content of the FNTP control field in the FNTP extended header - * @see ISO 29281-2 Clause 8.3.1 - */ - template (value) UtFntpEvent m_generateNfFntpCommRequest( - in template (value) CommandRef p_commRef, - in template (value) PortNumber p_servicePort, - in template (value) Link_ID p_linkId, - in template (value) ITSfpdu p_data, - in template (value) FntpOptions p_controlField - ) := { - nfSapPrimitivesDown := { - spRef := 1, - servPrimitive := { - NFfntpCommRequest := { - commRef := p_commRef, - servicePort := p_servicePort, - remotePort := PX_REMOTE_PORT_NUMBER, - linkID := p_linkId, - data := p_data, - priority := PX_USER_PRIORITY, - controlField := p_controlField - } // End of field 'NFfntpCommRequest' - } // End of field 'servPrimitive' - } // End of field 'nfSapPrimitivesDown' - } // End of template m_generateNfFntpCommRequest - - /** - * @desc Receive an COMMAND.indication primitive - * @see ISO 29281-2 Clause 8.3.3 - */ - template (present) NFsapPrimitivesUp mw_checkNfFntpCommIndication_any := { - spRef := 2, - servPrimitive := { - NFfntpCommIndication := { - servicePort := ?, - remotePort := ?, - linkID := ?, - data := PX_ITS_FPDU, - priority := PX_USER_PRIORITY, - controlField := mw_noFntpOptions - } // End of field 'NFfntpCommIndication' - } // End of field 'servPrimitive' - } // End of template mw_checkNfFntpCommIndication_any - - /** - * @desc Receive an COMMAND.indication primitive - * @param p_servicePort Set equal to "destinationPort" given in the NPDU - * @param p_port Set equal to "sourcePort" given in the NPDU - * @param p_linkID Identify the VCI associated with the peer station - */ - template (present) NFsapPrimitivesUp mdw_checkNfFntpCommIndication( - in template (present) PortNumber p_servicePort, - in template (present) PortNumber p_remotePort, - in template (present) Link_ID p_linkId - ) modifies mw_checkNfFntpCommIndication_any := { - servPrimitive := { - NFfntpCommIndication := { - servicePort := p_servicePort, - remotePort := p_remotePort, - linkID := p_linkId - } // End of field 'NFfntpCommIndication' - } // End of field 'servPrimitive' - } // End of template mw_checkNfFntpCommIndication - - /** - * @desc Receive an COMMAND.indication primitive with Access parameters - * @param p_servicePort Set equal to "destinationPort" given in the NPDU - * @param p_port Set equal to "sourcePort" given in the NPDU - * @param p_linkID Identify the VCI associated with the peer station - * @param p_nHopNfFntpOptionsCip FNTP options with Access parameters - * @see ISO/WD 29281-2 Clause 6.2.2.3.6 CIP management - */ - template (present) NFsapPrimitivesUp mdw_checkNfFntpCommIndicationCip( - in template (present) PortNumber p_servicePort, - in template (present) PortNumber p_remotePort, - in template (present) Link_ID p_linkId, - in template (present) FntpOptions p_nHopNfFntpOptionsCip - ) modifies mw_checkNfFntpCommIndication_any := { - servPrimitive := { - NFfntpCommIndication := { - servicePort := p_servicePort, - remotePort := p_remotePort, - linkID := p_linkId, - controlField := p_nHopNfFntpOptionsCip - } // End of field 'NFfntpCommIndication' - } // End of field 'servPrimitive' - } // End of template mdw_checkNfFntpCommIndicationCip - - /** - * @desc Templates for FNTP control fields - * @see ISO 29281-2 Clause 6.2.2.3 - */ - group fntpControlFields { - - /** - * @desc Send template for no FNTP control fields set, meaning "Basic procedure" (ISO 29281-2 Clause 7.6.1) - * @see ISO 29281-2 Clause 6.2.2.3.1 - */ - template (value) FntpOptions m_noFntpOptions := { - intForw := omit, - sec := omit, - hops := omit, - lpp := omit, - cip := omit, - opt5 := omit, - opt6 := omit, - opt7 := omit - } // End of template m_noFntpOptions - - /** - * @desc Send template for a S/N-hops communications - * @param p_hops Number of hops. This parameter shall be set to zero for single hop - * @see ISO 29281-2 Clause 6.2.2.3.1 - */ - template (value) FntpOptions md_nHopNfFntpOptions( - in template (value) FNTPhopCount p_hops - ) modifies m_noFntpOptions := { - hops := p_hops - } // End of template md_nHopNfFntpOptions - - /** - * @desc Receive template for no FNTP control fields set, meaning "Basic procedure" (ISO 29281-2 Clause 7.6.1) - * @see ISO 29281-2 Clause 6.2.2.3.1 - */ - template FntpOptions mw_noFntpOptions := { - intForw := omit, - sec := omit, - hops := omit, - lpp := omit, - cip := omit, - opt5 := omit, - opt6 := omit, - opt7 := omit - } // End of template mw_noFntpOptions - - /** - * @desc Receive template for a S/N-hops communications - * @param p_hops Number of hops. This parameter shall be set to zero for single hop - * @see ISO 29281-2 Clause 6.2.2.3.1 - */ - template (present) FntpOptions mdw_nHopNfFntpOptions( - in template (present) FNTPhopCount p_hops - ) modifies mw_noFntpOptions := { - hops := p_hops - } // End of template mdw_nHopNfFntpOptions - - /** - * @desc Send template for unsupported control fiel - * @see ISO 29281-2 Clause 6.2.6 - */ - template (value) FntpOptions md_nonSupportedFntpControlField - modifies m_noFntpOptions := { - opt5 := NULL - } // End of template md_nonSupportedFntpControlField - - /** - * @desc Send template for with CIP required - * @param p_hops Number of hops. This parameter shall be set to zero for single hop - * @param p_rxCIP Receive (RX) parameter settings - * @param p_txCIP Transmit (TX) parameters of a VCI - * @see ISO 29281-2 Clause 7.10 - */ - template (value) FntpOptions md_cipNfFntpOptions( - in template (value) FNTPhopCount p_hops, - in template (value) RXcip p_rxCip, - in template (value) TXcip p_txCip - ) modifies md_nHopNfFntpOptions := { - cip := { - rxCIP := p_rxCip, - txCIP := p_txCip - } // End of field 'cip' - } // End of template md_cipNfFntpOptions - - /** - * @desc Receive template for a S/N-hops communications with CIP - * @param p_hops Number of hops. This parameter shall be set to zero for single hop - * @param p_rxCIP Receive (RX) parameter settings - * @param p_txCIP Transmit (TX) parameters of a VCI - * @see ISO 29281-2 Clause 6.2.2.3.1 - */ - template FntpOptions mdw_nHopNfFntpOptions_cip( - in template (present) FNTPhopCount p_hops, - in template RXcip p_rxCip, - in template TXcip p_txCip - ) modifies mw_noFntpOptions := { - hops := p_hops, - cip := { - rxCIP := p_rxCip, - txCIP := p_txCip - } // End of field 'cip' - } // End of template mdw_nHopNfFntpOptions_cip - - } // End of group fntpControlFields - - } // End of group utPrimitives - - group cfPrimitives { - - /** - * @desc Initializes the Configuration tester - */ - template (value) CfInitialize m_cfFntpInitialize := { - cfFntpInitialize := { - } // End of field 'cfFntpInitialize' - } // End of template m_cfFntpInitialize - - /** - * @desc Receive template for configuration message (CfPort Primitive) - * @param p_mnRequestRequest Expected MN_Request_rquest message - */ - template (present) CfFntpEventInd mw_cfFntpEventInd( - template (present) MN_Request_request p_mnRequestRequest - ) := { - mnRequestRequest := p_mnRequestRequest - } // End of template mw_cfFntpEventInd - - } // End of group cfPrimitives - - } // End of group fntpPrimitives - -} // End of module LibItsFntp_Templates \ No newline at end of file diff --git a/ttcn/CALM/FNTP/LibItsFntp_TypesAndValues.ttcn3 b/ttcn/CALM/FNTP/LibItsFntp_TypesAndValues.ttcn3 deleted file mode 100644 index 05dfed23..00000000 --- a/ttcn/CALM/FNTP/LibItsFntp_TypesAndValues.ttcn3 +++ /dev/null @@ -1,153 +0,0 @@ -/** - * @author ETSI / STF422_EETS - * @version $URL$ - * $Id$ - * @desc Types and constants definitions for Fast Networking & Transport layer Protocol (ISO 29281-2) - */ -module LibItsFntp_TypesAndValues { - - // LibCommon - import from LibCommon_BasicTypesAndValues { - type UInt16 - }; - import from LibCommon_DataStrings { - type Bit1, Bit6 - }; - - // LibIts - - // LibItsCalm - import from CALMllsap language "ASN.1:1997" { - type - INsapPrimitivesUp - }; - import from CALMfntp language "ASN.1:1997" { - type - FNTPNPDU, - NFsapPrimitivesDown, NFsapPrimitivesUp, FNTPintForwarding, - PortNumber - }; - import from CALMiitsscu language "ASN.1:1997" { - type - McmdRq - }; - import from CALMmsap language "ASN.1:1997" { - type - MN_Request_request, MN_Request - }; - - /** - * @desc FNTP port values - * @see ISO/CD 29281-2 Table 1 — FNTP endpoints identified by port numbers - */ - group fntpPortsValues { - - /** - * @desc Groupcast manager, i.e. Service Advertisement Message (SAM) endpoint - */ - const UInt16 c_portSam := 0; - - /** - * @desc dynamic port - */ - const UInt16 c_portDyn := 128; - - /** - * @desc Low limit of reserved range - */ - const UInt16 c_portReservedLow := 32717; - - /** - * @desc High limit of reserved range - */ - const UInt16 c_portReservedHigh := 32763; - - /** - * @desc Inter ITS-SCU communications specified in ISO 24102-4 - */ - const UInt16 c_portIic := 32764; - - /** - * @desc Shall be used to identify an ITS-SCU with functionality of an ITS-S router. These values shall be used only in the FNTP forwarding header - */ - const UInt16 c_portRtr := 32765; - - /** - * @desc Shall be used to identify an ITS-SCU with functionality of an ITS-S host. These values shall be used only in the FNTP forwarding header - */ - const UInt16 c_portHst := 32766; - - /** - * @desc Unknown or 'don't care' port - */ - const UInt16 c_portNon := 32767; - - } // End of group fntpPortsValues - - group utPrimitives { - - /** - * @desc Trigger to initialize the IUT. - * @member McmdRq IICPrequests/McmdRq message to initialize the upper tester - * - * @see ISO 24102-4 - */ - type record UtFntpInitialize { - McmdRq mcmdRq - } with { - encode (mcmdRq) "LibItsIicp_asn1" - } - - /** - * @desc Events at the application layer of the IUT. - * @member nfSapPrimitivesDown NF-SAP down primitive - */ - type union UtFntpEvent { - NFsapPrimitivesDown nfSapPrimitivesDown - } - with { - encode (nfSapPrimitivesDown) "LibItsFntp_asn1" - } - - /** - * @desc Send a NF-SAP primitive from Facility layer through a SAP. - * @member nfSapPrimitivesUp NF-SAP up primitive - */ - type union UtFntpEventInd { - NFsapPrimitivesUp nfSapPrimitivesUp - } - with { - encode (nfSapPrimitivesUp) "LibItsFntp_asn1" - } - - } with { - encode "UpperTester" - } // End of group utPrimitives - - group cfPrimitives { - - /** - * @desc Trigger to initialize the IUT. - */ - type record CfFntpInitialize { - } - - /** - * @desc Send a MN-SAP.request primitive to the Management layer through a SAP. - * @member mnRequestRequest MN_REQUEST_Request primitive - */ - type union CfFntpEventInd { - MN_Request_request mnRequestRequest - } - with { - encode (mnRequestRequest) "LibItsCALMmsap_asn1" - } - - } with { - encode "ConfigTester" - } // End of group cfPrimitives - -} -with { - encode "LibItsFntp" -} //End of module LibItsFntp_TypesAndValues \ No newline at end of file diff --git a/ttcn/CALM/FSAP/LibItsFsap_Functions.ttcn3 b/ttcn/CALM/FSAP/LibItsFsap_Functions.ttcn3 deleted file mode 100644 index f9c6940d..00000000 --- a/ttcn/CALM/FSAP/LibItsFsap_Functions.ttcn3 +++ /dev/null @@ -1,1005 +0,0 @@ -/** - * @author ETSI / STF422_EETS - * @version $URL$ - * $Id$ - * @desc Fast service advertisement protocol (ISO 24102-5) functions - */ -module LibItsFsap_Functions { - - // Libcommon - import from LibCommon_Sync all; - import from LibCommon_Time { - function f_sleep, f_sleepIgnoreDef - }; - - // LibIts - import from CITSapplMgmtApplReg language "ASN.1:1997" { - type ITSaid - }; - import from CALMllsap language "ASN.1:1997" { - type EUI64 - }; - import from CALMmanagement language "ASN.1:1997" { - type - ITS_scuId, StationID, - ApplicationID - }; - import from CALMiitsscu language "ASN.1:1997" { - type - ITS_SCUtype - }; - import from CALMmsap language "ASN.1:1997" { - type CommandRef - }; - import from CALMfsap language "ASN.1:1997" { - type - SAM, - CTX, CTXrxNot, - GCregClient, - GCschedule, ServiceDataReg, ServiceList, - ContextData - }; - import from CALMfntp language "ASN.1:1997" { - type - PortNumber - }; - import from LibItsMgt_Templates all; // FIXME Remove 'all' - import from LibItsMgt_Functions all; // FIXME Remove 'all' - import from LibItsFsap_TypesAndValues all; - import from LibItsFsap_Templates all; - import from LibItsFsap_Pixits all; - import from LibItsFsap_Pics all; - import from LibItsIicp_Functions { - altstep a_iicpDefault - }; - import from LibItsFntp_Templates { - template - m_llServiceAddr, m_linkId - }; - import from LibItsFntp_Functions { - function - f_getIutRemoteDestCiidBc, f_getIutRemoteDestCiidUc, f_getIutWlLocalCiid - }; - import from LibItsCalm_Interface all; // FIXME Remove 'all' - - /** - * @desc Upper tester functions - */ - group utFunctions { - - /** - * @desc Requests to bring the IUT in an initial state - * @param p_utInitialize The initialisation to trigger. - * @verdict Unchanged on success, fail on error and inconc otherwise - */ - function f_utFsapInitializeIut(template (value) UtInitialize p_utInitialize) runs on ItsCalm { - - utPort.send(p_utInitialize); - tc_wait.start; - alt { - [] utPort.receive(UtResult:true) { - tc_wait.stop; - log("*** f_utFsapInitializeIut: INFO: IUT initialized ***"); - } - [] utPort.receive { - tc_wait.stop; - log("*** f_utFsapInitializeIut: INFO: IUT could not be initialized ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_wait.timeout { - log("*** f_utFsapInitializeIut: INFO: IUT could not be initialized in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [else] { // Shortcut defaults - //f_sleep(0.050); // 50 ms - repeat; - } - } // End of 'alt' statement - - } // End of function f_utFsapInitializeIut - - /** - * @desc Send a FAsapPrimitivesDown primitive and wait for the NFsapPrimitivesUp confirm response - * @param p_utFsapEvent The FAsapPrimitivesDown request - * @param p_utFsapEventInd The FAsapPrimitivesDown response - * @param p_discard Set to true if responses shall be discard, otherwise the function failed - * @param p_result The response value - * @verdict Unchanged on success, fail on error and inconc otherwise - */ - function f_utFsapEventResponse( - in template (value) UtFsapEvent p_utFsapEvent, - in template (present) UtFsapEventInd p_utFsapEventInd, - in boolean p_discard, - out UtFsapEventInd p_result) - runs on ItsCalm { - -// log("*** f_utFsapEventResponse: INFO: Send message: ", p_commandReq, " ***"); - utPort.send(p_utFsapEvent); -// log("*** f_utFsapEventResponse: INFO: Expected UtCommandConfirm: ", p_commandConf, " ***"); - tc_wait.start; - alt { - [] utPort.receive(p_utFsapEventInd) -> value p_result { -// log("*** f_utFsapEventResponse: INFO: Receive expected confirm: message ***"); - tc_wait.stop; - } - [] utPort.receive(UtFsapEventInd:? ) -> value p_result { - if (p_discard == false) { - tc_wait.stop; - log("*** f_utFsapEventResponse: ERROR: Event not correctly indicated at application layer ***", p_result); - f_selfOrClientSyncAndVerdict("fail", e_error); - } - else { - log("*** f_utFsapEventResponse: INFO: Another event indicated at application layer, repeating check ***"); - repeat; - } - } - [] tc_wait.timeout { - if (p_discard == false) { - log("*** f_utFsapEventResponse: ERROR: Timeout while waiting for event check result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - else { - log("*** f_utFsapEventResponse: INFO: Event not indicated at application layer ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - } // End of 'alt' statement - - } // End of function f_utFsapEventResponse - - /** - * @desc Send a FAsapPrimitivesDown primitive and do not wait for the NFsapPrimitivesDown confirm response - * @param p_utFsapEvent The FAsapPrimitivesDown primitive - * @verdict Unchanged on success, fail otherwise - */ - function f_utFsapEvent( - in template (value) UtFsapEvent p_utFsapEvent - ) runs on ItsCalm { - var UtFsapEventInd v_utFsapEventInd; - - utPort.send(p_utFsapEvent); - tc_noac.start; - alt { - [] utPort.receive(UtFsapEventInd:?) -> value v_utFsapEventInd { // FIXME Use altstep for UtPort - tc_noac.stop; - log("*** f_utFsapEvent: INFO: Unexpected message was received ***", v_utFsapEventInd); - } - [] tc_noac.timeout { - log("*** f_utFsapEvent: INFO: FAsapPrimitivesUp succeed ***"); - } - } // End of 'alt' statement - - } // End of function f_utFsapEvent - - } // End of group utFunctions - - /** - * @desc Config tester functions - */ - group cfFunctions { - - /** - * @desc Requests to initialize the configuration tester - * @param p_cfInitialize The initialisation to trigger. - * @verdict Unchanged on success, fail otherwise - */ - function f_cfFsapInitialize(template (value) CfInitialize p_cfInitialize) runs on ItsCalm { - - cfPort.send(p_cfInitialize); - tc_wait.start; - alt { - [] cfPort.receive(CfResult:true) { - tc_wait.stop; - log("*** f_cfFsapInitialize: INFO: Configuration tester initialized ***"); - } - [] cfPort.receive { - tc_wait.stop; - log("*** f_cfFsapInitialize: INFO: Configuration tester could not be initialized ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_wait.timeout { - log("*** f_cfFsapInitialize: INFO: Configuration tester could not be initialized in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [else] { // Shortcut defaults - //f_sleep(0.050); // 50 ms - repeat; - } - } // End of 'alt' statement - - } // End of function f_cfFsapInitialize - - /** - * @desc Await for notification on MF-SAP - * @param p_cfFsapEventInd The MF_Request_request notification message. - * @param p_discard Set to true if responses shall be discard, otherwise the function failed - * @verdict Unchanged on success, fail otherwise - */ - function f_cfFsapAwaitNotificationToManagement( - in template CfFsapEventInd p_cfFsapEventInd, - in boolean p_discard - ) runs on ItsCalm { - var CfFsapEventInd p_result; - - log("*** f_cfFsapAwaitNotificationToManagement: INFO: Expected event: ", p_cfFsapEventInd, " ***"); - tc_wait.start; - alt { - [] cfPort.receive(p_cfFsapEventInd) { - tc_wait.stop; - log("*** f_cfFsapAwaitNotificationToManagement: INFO: Notification event received ***"); - } - [] cfPort.receive(CfFsapEventInd: ?) -> value p_result { - if (p_discard == false) { - tc_wait.stop; - log("*** f_cfFsapAwaitNotificationToManagement: ERROR: Another event indicated at application layer ***", p_result); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } else { - log("*** f_cfFsapAwaitNotificationToManagement: INFO: Another event indicated at application layer, repeating check ***"); - repeat; - } - } - [] tc_wait.timeout { - if (p_discard == false) { - log("*** f_cfFsapAwaitNotificationToManagement: ERROR: Timeout while waiting for event check result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } else { - log("*** f_cfFsapAwaitNotificationToManagement: INFO: Event not indicated at application layer ***"); - } - } - } // End of 'alt' statement - - } // End of function f_cfFsapAwaitNotificationToManagement - - } // End of group cfFunctions - - group fsapConfigurationFunctions { - - /** - * @desc This configuration features: - *
  • Host and Router are combined (see ISO/WD 29281-2 - Figure 1 - Implementation architecture I)
  • - *
  • MGT1 IISC Port (IISC/LAN) is not used
  • - */ - function f_cf01Up() runs on ItsCalm { - - // Sanity check - if (PICS_ITS_S_INW) { - log("*** f_cf01Up: ERROR: PICS_ITS_S_INW shall not be required for executing the TC ***"); - stop; - } - - // Map - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - map(self:cfPort, system:cfPort); // FIXME Add check PICS_ITS_MGT_NOT - map(self:fsapPort, system:fsapPort); - - // Connect - f_connect4SelfOrClientSync(); - - // Set processing on shutdown - activate(a_cf01Down()); - - // Initialize the component - f_initialiseComponent("cf01Up"); - - // Initialze the IUT - f_initialState(); - - } // End of function f_cf01Up - - /** - * @desc This configuration features: - *
  • Host and Router are separated (see ISO/WD 29281-2 - Figure 3 - Implementation architecture II & III)
  • - *
  • MGT1 IISC Port (IISC/LAN) is used if specified
  • - */ - function f_cf02Up() runs on ItsCalm { - - // Sanity check - if (not(PICS_ITS_S_INW)) { - log("*** f_cf02Up: ERROR: PICS_ITS_S_INW required for executing the TC ***"); - stop; - } - - vc_commandRef := 0; - vc_pduCounter := 0; - - // Map - map(self:utPort, system:utPort); - map(self:cfPort, system:cfPort); // FIXME Add check PICS_ITS_MGT_NOT - map(self:fsapPort, system:fsapPort); - - // Connect - f_connect4SelfOrClientSync(); - - // Set processing on shutdown - activate(a_cf02Down()); - - // Initialize the component - f_initialiseComponent("cf02Up"); - - // Initialze the IUT - f_initialState(); - - } // End of function f_cf02Up - - /** - * @desc Deletes configuration cf01 - */ - function f_cf01Down() runs on ItsCalm { - - deactivate; - - // Unmap - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - unmap(self:cfPort, system:cfPort); // FIXME Add check PICS_ITS_MGT_NOT - unmap(self:fsapPort, system:fsapPort); - - // Disconnect - f_disconnect4SelfOrClientSync(); - - } // End of f_cf01Down - - /** - * @desc Deletes configuration cf02 - */ - function f_cf02Down() runs on ItsCalm { - - deactivate; - - // Unmap - unmap(self:utPort, system:utPort); - unmap(self:cfPort, system:cfPort); // FIXME Add check PICS_ITS_MGT_NOT - unmap(self:fsapPort, system:fsapPort); - - // Disconnect - f_disconnect4SelfOrClientSync(); - - } // End of f_cf02Down - - /** - * @desc Behavior function for initializing component's variables and tables - * @param p_componentName Name of the component - * @param p_iicpMGM Set to true if IISC port shall be used - */ - function f_initialiseComponent(in charstring p_componentName) runs on ItsMgt { - - // Initialize variables - - // Set defaults - activate(a_fsapDefault()); - if (p_componentName == "cf02Up") { - activate(a_iicpDefault()); - } - } // end f_initialiseComponent - - } // End of group fsapConfigurationFunctions - - group preambles { - - /** - * @desc Brings the IUT into an initial state. - */ - function f_initialState() runs on ItsCalm { - if (PICS_ITS_MGT_NOT == true) { - f_utFsapInitializeIut(m_utFsapInitialize_with_management); - } else { - f_utFsapInitializeIut(m_utFsapInitialize_without_management); - } // FIXME Add suport of PICS_FSAP_FNTP - f_cfFsapInitialize(m_cfFsapInitialize); - f_sleepIgnoreDef(PX_WAIT_FOR_IUT_READY); // Wait until the IUT is in a stable situation (beaconing...) - cfPort.clear; // Because TestConfigIICP should trigger management port deletion message - } // End of function f_initialState - - /** - * @desc Generte FAsapPrimitivesDown primitive - * @param p_utFsapEvent The FAsapPrimitivesDown primitive - * @verdict Unchanged - */ - function f_fsapGenerateFaPrimitiveWithConfirm( - in template (value) UtFsapEvent p_generateFaSapRequest, - in template (present) UtFsapEventInd p_faSapRequestConfirm, - in boolean p_discard, - out UtFsapEventInd p_result - ) runs on ItsCalm { - - f_utFsapEventResponse( - p_generateFaSapRequest, - p_faSapRequestConfirm, - p_discard, - p_result - ); - - } // End of function f_fsapGenerateFaPrimitiveWithConfirm - - /** - * @desc Generte FAsapPrimitivesDown primitive - * @param p_utFsapEvent The FAsapPrimitivesDown primitive - * @verdict Unchanged - */ - function f_fsapGenerateFaPrimitiveWithoutConfirm( - in template (value) UtFsapEvent p_utFsapEvent - ) runs on ItsCalm { - - f_utFsapEvent(p_utFsapEvent); - - } // End of function f_fsapGenerateFaPrimitiveWithoutConfirm - - /** - * @desc Wait for MF_Request_request/CTXrxNot message sent by ITS management entity - * @param p_ctxRxNot CTXrxNot value - * @verdict Unchanged - */ - function f_fsapAwaitCtxRxNot( - in template (present) CTXrxNot p_ctxRxNot - ) runs on ItsCalm { - - f_cfFsapAwaitNotificationToManagement( - mw_cfFsapEventInd( - mw_mfRequestRequest_ctx( - p_ctxRxNot - ) - ), - false - ); - - } // End of function f_fsapAwaitCtxRxNot - - /** - * @desc Makes the simulated ITS Service Provider for IUT - */ - function f_startServiceProvider( - in template (value) ServiceList p_serviceList, - in template (value) PortNumber p_sourcePort, - in template (value) PortNumber p_destinationPort - ) runs on ItsCalm { - f_acFsapTriggerEvent( - AcFsapPrimitive: { - inSapPrimitivesUp := m_generateSamMessagePdu( - m_llServiceAddr(m_linkId(f_getIutRemoteDestCiidBc(), f_getIutWlLocalCiid())), - m_llServiceAddr(m_linkId(f_getIutRemoteDestCiidBc(), f_getIutWlLocalCiid())), - bit2oct( - encvalue( - m_fsapBasicFntpNpdu( - p_sourcePort, - p_destinationPort, - bit2oct( - encvalue( - m_sam( - f_getIutClientId(), - f_getIutServiceId(), - p_serviceList - ) - ) - ) - ) - ) - ) - ) // End of field 'm_generateSamMessagePdu' - } - ); - f_sleepIgnoreDef(PX_SP_DISCOVERY_DELAY); - } // End of function f_startServiceProvider - - /** - * @desc Makes the simulated ITS Service Provider for IUT - */ - function f_stopServiceProvider() runs on ItsCalm { - f_acFsapTriggerEvent(AcFsapPrimitive: { stopTransmission := true }); - f_sleepIgnoreDef(PX_SP_DISCOVERY_DELAY); - } // End of function f_stopServiceProvider - - } // End of group preambles - - group postambles { - - /** - * @desc The default postamble. - */ - function f_poDefault() runs on ItsCalm { - // Nothing to do - } // End of function f_poDefault - - } // End of group postambles - - group adapterControl { - - /** - * @desc Triggers event in the test system adaptation. - * @param p_event The event to trigger - */ - function f_acFsapTriggerEvent( - in template (value) AcFsapPrimitive p_event - ) runs on ItsCalm { -// log("*** f_acFsapTriggerEvent: send: ", p_event, "***"); - acPort.send(p_event); - } - - /** - * @desc Triggers event in the test system adaptation via NF-SAP interface. - * @param p_event The event to trigger - */ - function f_sendCtx( - in template (value) PortNumber p_sourcePort, - in template (value) PortNumber p_destinationPort, - template (value) CTX p_ctx - ) runs on ItsCalm { - if (PICS_FSAP_FNTP == true) { - log( - "*** f_sendCtx: Send CTX: ", - p_ctx, - "***"); - fsapPort.send( - m_fsapReq_inSap( - m_inSapPrimitivesUp( - m_llServiceAddr(m_linkId(f_getIutRemoteDestCiidUc(), f_getIutWlLocalCiid())), - m_llServiceAddr(m_linkId(f_getIutWlLocalCiid(), f_getIutWlLocalCiid())), - bit2oct( - encvalue( - m_fsapBasicFntpNpdu( - p_sourcePort, - p_destinationPort, - bit2oct( - encvalue( - p_ctx - ) - ) - ) - ) - ) - ) - ) - ); - } else { - fsapPort.send( - m_fsapReq_nfSap( - m_nfSapPrimitivesUp( - p_sourcePort, // FIXME Wrong value I guess - p_destinationPort, // FIXME Wrong value I guess - m_linkId(f_getIutWlLocalCiid(), f_getIutWlLocalCiid()), - bit2oct( - encvalue( - p_ctx - ) - ) - ) - ) - ); - } - } // End of function f_sendCtx - - } // End of group adapterControl - - group testerFunctions { - - } // End of group testerFunctions - - group internalFunctions { // TODO Use parametrized function (ETSI ES 202 784) insetad of the three oct2xxx functions - - group serviceProvider { - - function f_regServer( - in template (value) GCschedule p_gcSchedule, - in template (value) ServiceDataReg p_serviceDataReg - ) runs on ItsCalm { - f_fsapGenerateFaPrimitiveWithConfirm( - m_generateFaSapPrimitivesDown( - m_faSapPrimitivesDown_gcRegServer( - m_gcRegServer( - f_getIutApplicationId(), - p_gcSchedule, - p_serviceDataReg - ) - ) - ), - mw_fsapGcRegServerConf(f_getIutApplicationId()), - true, - vc_utEventInd.utFsapEventInd - ); - } // End of function f_regServer - - function f_deregServer() runs on ItsCalm { - f_fsapGenerateFaPrimitiveWithConfirm( - m_generateFaSapPrimitivesDown( - m_faSapPrimitivesDown_gcDeregServer( - m_gcDeregServer( - f_getIutApplicationId() - ) - ) - ), - mw_fsapGcDeregServerConf(f_getIutApplicationId()), // Expected GCDeregServerConf - true, - vc_utEventInd.utFsapEventInd - ); - } // End of function f_deregServer - - /** - * @desc This function convert the specified octetstring into a template (SAM) - * This SHALL be done due to the ASN.1 description of IN-SAP service primitives DL_Unitdata_request/DL_Unitdata_indication - * @param p_data An octetstring to decode - * @param p_syncPoint Current synchronisation point, required to set verdict according to the LibCommon rules - * @param p_decoded The decoded message - * @verdict Unchanged on success, set to fail otherwise - * @see ISO/CD 21218 - Clause 8.2.2 - */ - function f_oct2sam( - in octetstring p_data, - in charstring p_syncPoint, - out SAM p_decoded - ) runs on ItsCalm { - var bitstring v_data; - var integer v_result; - -// log("*** f_oct2sam: INFO: pdu: " & oct2str(p_data) & " ***"); - v_data := oct2bit(p_data); - v_result := decvalue(v_data, p_decoded); - if (v_result == 1) { - log("*** f_oct2sam: FAIL: 'decvalue' operation failed ***"); - f_selfOrClientSyncAndVerdictTestBody(p_syncPoint, e_error); - } else if (v_result == 2) { - log("*** f_oct2sam: FAIL: 'decvalue' operation failed, not enougth bits ***"); - f_selfOrClientSyncAndVerdictTestBody(p_syncPoint, e_error); - } -// log("*** f_oct2sam: INFO: Decoded message done ***"); - } // End of function f_oct2sam - - /** - * @desc This function convert the specified octetstring into a template (CTX) - * This SHALL be done due to the ASN.1 description of IN-SAP service primitives DL_Unitdata_request/DL_Unitdata_indication - * @param p_data An octetstring to decode - * @param p_syncPoint Current synchronisation point, required to set verdict according to the LibCommon rules - * @param p_decoded The decoded message - * @verdict Unchanged on success, set to fail otherwise - * @see ISO/CD 21218 - Clause 8.2.2 - */ - function f_oct2ctx( - in octetstring p_data, - in charstring p_syncPoint, - out CTX p_decoded - ) runs on ItsCalm { - var bitstring v_data; - var integer v_result; - - log("*** f_oct2ctx: INFO: pdu: " & oct2str(p_data) & " ***"); - v_data := oct2bit(p_data); - v_result := decvalue(v_data, p_decoded); - if (v_result == 1) { - log("*** f_oct2ctx: FAIL: 'decvalue' operation failed ***"); - f_selfOrClientSyncAndVerdictTestBody(p_syncPoint, e_error); - } else if (v_result == 2) { - log("*** f_oct2ctx: FAIL: 'decvalue' operation failed, not enougth bits ***"); - f_selfOrClientSyncAndVerdictTestBody(p_syncPoint, e_error); - } - log("*** f_oct2ctx: INFO: Decoded message done ***"); - } // End of function f_oct2ctx - - } // End of group serviceProvider - - group serviceUser { - - function f_regClient( - in template (value) ApplicationID p_applicationId, - in template (value) ITSaid p_serviceId, - in template (value) GCregClient p_gcRegClient - ) runs on ItsCalm { - - f_fsapGenerateFaPrimitiveWithConfirm( - m_generateFaSapPrimitivesDown( - m_faSapPrimitivesDown_gcRegClient( - p_gcRegClient - ) - ), - mw_fsapGcRegClientConf(p_applicationId), - true, - vc_utEventInd.utFsapEventInd - ); - } // End of function f_regClient - - function f_deregClient( - in template (value) ApplicationID p_applicationId - ) runs on ItsCalm { - - f_fsapGenerateFaPrimitiveWithConfirm( - m_generateFaSapPrimitivesDown( - m_faSapPrimitivesDown_gcDeregClient( - p_applicationId - ) - ), - mw_fsapGcDeregClientConf(p_applicationId), // Expected GCDeregClientConf - true, - vc_utEventInd.utFsapEventInd - ); - } // End of function f_deregClient - - } // End of group serviceUser - - } // End of group internalFunctions - - group iutFunctions { - - /** - * @desc Get the local identifier of the VCI for broadcast on ITS-S host - * @return The local identifier of the VCI for broadcast on ITS-S host - * @see PX_WL_REMOTE_CIID_BC - * @verdict Unchanged - */ - function f_getIutSrcRemoteCiId() return EUI64 { - return PX_SRC_REMOTE_CIID; - } - - /** - * @desc Get the identifier of a VCI on ITS-S host/router only - * @return The identifier of a different VCI on ITS-S host/router only - * @see PX_WL_LOCAL_CIID - * @verdict Unchanged - */ - function f_getIutSrcLocalCiId() return EUI64 { - return PX_WL_LOCAL_CIID; - } - - function f_getIutMedTypeIso21215LocalCiid() return EUI64 { - return PX_IUT_MEDTYPE_ISO21215_LOCAL_CIID; - } - - function f_getIutMedTypeIso21215RemoteCiid() return EUI64 { - return PX_IUT_MEDTYPE_ISO21215_REMOTE_CIID; - } - - function f_getIutMedTypeOtherLocalCiid() return EUI64 { - return PX_IUT_MEDTYPE_OTHER_LOCAL_CIID; - } - - function f_getIutMedTypeOtherRemoteCiid() return EUI64 { - return PX_IUT_MEDTYPE_OTHER_REMOTE_CIID; - } - - /** - * @desc Gets the SAM retransmit timer. - * @return SAM retransmit timer - * @see PICS_SAM_RETRANSMIT_TIMER - */ - function f_getIutSamRetransmitTimer() return float { - return 0.9 * PICS_SAM_RETRANSMIT_TIMER / 100.0; // 90% - } - - /** - * @desc Gets the maximum SAM jitter. - * @return Maximum SAM jitter - * @see PICS_SAM_RETRANSMIT_TIMER - */ - function f_getIutSamMaxJitter() return float { - return 1.1 * PICS_SAM_RETRANSMIT_TIMER / 100.0; // 110% - } - - /** - * @desc Get the ITS application object ID (ITS-AID) for GCregServer MF-REQUEST - * @return The ITS application object ID (ITS-AID) - * @see PX_APPLICATION_ID - */ - function f_getIutApplicationId() return ApplicationID { - return PX_APPLICATION_ID; - } - - /** - * @desc Get the ITS application object ID (ITS-AID) for GCregClient MF-REQUEST - * @return The ITS application object ID (ITS-AID) - * @see PX_CLIENT_APPLICATION_ID - */ - function f_getIutClientApplicationId() return ApplicationID { - return PX_CLIENT_APPLICATION_ID; - } - - /** - * @desc Get the globally unique ITS-AID of the ITS-S application - * @return The globally unique ITS-AID of the ITS-S application - * @see PX_ITS_AID - */ - function f_getIutServiceId() return ITSaid { - return PX_ITS_AID; - } - - /** - * @desc Get the server identifier value - * @return The client identifier value - * @see PX_SERVER_ID - */ - function f_getIutServerId() return StationID { - return PX_SERVER_ID; - } - - function f_getLocalClientId() return StationID { - return PX_LOCAL_ID; - } - /** - * @desc Get the service client ITS station value - * @return The service client ITS station value - * @see PX_CLIENT_ID - */ - function f_getIutClientId() return StationID { - return PX_IUT_ID; - } - - /** - * @desc Get the scheduling information with a specific access technology - * @return The scheduling information - * @see PX_GSCHED_ACCESS_TECH_NONIP - */ - function f_getIutGcScheduleWithAccessTechAndNonIp() return GCschedule { - return { PX_GSCHED_ACCESS_TECH_NONIP }; - } - - /** - * @desc Get the scheduling information with a specific access technology using a long period time - * @return The scheduling information - * @see PX_GSCHED_ACCESS_TECH_NONIP - */ - function f_getIutGcScheduleLongTPeriodTimeWithAccessTechAndNonIp() return GCschedule { - return { PX_GSCHED_LOG_PERIOD_TIME_ACCESS_TECH_NONIP }; - } - - /** - * @desc Get the scheduling information with an unknown access technology - * @return The scheduling information - * @see PX_GSCHED_ACCESS_UNKNOWN_TECH_NONIP - */ - function f_getIutGCscheduleWithUnknownAccessTechAndNonIp() return GCschedule { - return { PX_GSCHED_ACCESS_UNKNOWN_TECH_NONIP }; - } - - - /** - * @desc Get the scheduling information with no access technology - * @return The scheduling information - * @see PX_GSCHED_NONIP - */ - function f_getIutGCscheduleWithNonIp() return GCschedule { - return { PX_GSCHED_NONIP }; - } - - /** - * @desc Get advertisement details with no session phase - * @return The advertisement details - * @see PX_SERVICE_DATA_REG_WITH_NO_SESSION_PHASE - */ - function f_getIutServiceDataRegWithNoSession() return ServiceDataReg { - return PX_SERVICE_DATA_REG_WITH_NO_SESSION_PHASE; - } - - /** - * @desc Get advertisement details with a specific access technology and with request to change communication channel for session phase - * @return The advertisement details - * @see PX_SERVICE_DATA_REG_WITH_SESSION_PHASE_AND_CHANNEL_CHANGE - */ - function f_getIutServiceDataRegWithNoSessionAndChannelChange() return ServiceDataReg { - return PX_SERVICE_DATA_REG_WITH_SESSION_PHASE_AND_CHANNEL_CHANGE; - } - - /** - * @desc Get advertisement details without request to change communication channel for session phase and without request to change communication channel for session phase - * @return The advertisement details - * @see PX_SERVICE_DATA_REG_WITH_SESSION_PHASE - */ - function f_getIutServiceDataRegWithSession() return ServiceDataReg { - return PX_SERVICE_DATA_REG_WITH_SESSION_PHASE; - } - - /** - * @desc Get non-IP information on services offered, with no session phase and no channel change requested - * @return The non-IP information on services offered - * @see PX_NO_IP_SERVICE_WITH_NO_SESSION_AND_NO_CHANGE_CHANNEL - */ - function f_getIutServicelistWithNoSessionAndNoChannelChange() return ServiceList { - return { PX_NO_IP_SERVICE_WITH_NO_SESSION_AND_NO_CHANGE_CHANNEL }; - } - - /** - * @desc Get non-IP information on services offered, with session phase and no channel change requested - * @return The non-IP information on services offered - * @see PX_NO_IP_SERVICE_WITH_SESSION_AND_NO_CHANGE_CHANNEL - */ - function f_getIutServicelistWithSessionAndNoChangeChannel() return ServiceList { - return { PX_NO_IP_SERVICE_WITH_SESSION_AND_NO_CHANGE_CHANNEL }; - } - - /** - * @desc Get non-IP information on services offered, with no session phase and channel change requested - * @return The non-IP information on services offered - * @see PX_NO_IP_SERVICE_WITH_SESSION_AND_CHANNEL_CHANGE - */ - function f_getIutServicelistWithSessionAndChangeChannel() return ServiceList { - return { PX_NO_IP_SERVICE_WITH_SESSION_AND_CHANNEL_CHANGE }; - } - - /** - * @desc Get non-IP information on an unknown services offered, with session phase and no channel change requested - * @return The non-IP information on services offered - * @see PX_NO_IP_SERVICE_WITH_UNKNOWN_SERVICE_ID - */ - function f_getIutServicelistWithUnknownServiceId() return ServiceList { - return { PX_NO_IP_SERVICE_WITH_UNKNOWN_SERVICE_ID }; - } - - /** - * @desc Get non-IP information on services offered, with session phase and channel change requested on an unknown channel - * @return The non-IP information on services offered - * @see PX_NO_IP_SERVICE_WITH_UNKNOWN_CHANNEL - */ - function f_getIutServicelistWithUnknownChannel() return ServiceList { - return { PX_NO_IP_SERVICE_WITH_UNKNOWN_CHANNEL }; - } - - /** - * @desc Get the session port as acknowledgement of GCsamctx offered byt the ITS application - * @return The session port - * @see PX_SESSION_PORT - */ - function f_getIutSessionPort() return PortNumber { - return PX_SESSION_PORT; - } - - /** - * @desc Get the context data value - * @return The context data value - * @see PX_CONTEXT_DATA - */ - function f_getContextData() return ContextData { - return PX_CONTEXT_DATA; - } - - } // End of group iutFunctions - - group fsapAltsteps { - - /** - * @desc The base default. - */ - altstep a_fsapDefault() runs on ItsMgt { - [] tc_wait.timeout { - log("*** a_fsapDefault: ERROR: Timeout while awaiting reaction of the IUT prior to Upper Tester action ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] tc_ac.timeout { - log("*** a_fsapDefault: ERROR: Timeout while awaiting the reception of a message ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] any timer.timeout { - log("*** a_fsapDefault: INCONC: An unknown timer has expired in default ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] a_shutdown() { - f_poDefault(); - log("*** a_fsapDefault: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - if(self == mtc) { - f_cf01Down(); - } - stop; - } - } // End of altstep a_fsapDefault() - - /** - * @desc Default handling cf01 de-initialisation. - */ - altstep a_cf01Down() runs on ItsMgt { - [] a_shutdown() { - f_poDefault(); - f_cf01Down(); - log("*** a_cf01Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } // End of altstep a_cf01Down() - - /** - * @desc Default handling cf02 de-initialisation. - */ - altstep a_cf02Down() runs on ItsMgt { - [] a_shutdown() { - f_poDefault(); - f_cf02Down(); - log("*** a_cf02Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } // End of altstep a_cf02Down() - - } // End of group fsapAltsteps - -} // End of module LibItsFsap_Functions \ No newline at end of file diff --git a/ttcn/CALM/FSAP/LibItsFsap_Pics.ttcn3 b/ttcn/CALM/FSAP/LibItsFsap_Pics.ttcn3 deleted file mode 100644 index c4f82a17..00000000 --- a/ttcn/CALM/FSAP/LibItsFsap_Pics.ttcn3 +++ /dev/null @@ -1,104 +0,0 @@ -/** - * @author ETSI / STF422_EETS - * @version $URL$ - * $Id$ - * @desc Fast service advertisement protocol (ISO 24102-5) PICS - */ -module LibItsFsap_Pics { - - /** - * @desc FSAP PICS - */ - group fsapPics { - - /** - * @desc Is FSAP Service Provider role ? - * @see ETSI TS 102 797-1 v1.1.2 D.2/1 - */ - modulepar boolean PICS_FSAP_ROLE_SP := true; - - /** - * @desc Is FSAP Service User role ? - * @see ETSI TS 102 797-1 v1.1.2 D.2/2 - */ - modulepar boolean PICS_FSAP_ROLE_SU := true; - - /** - * @desc Is supported SIP ? - * @see ETSI TS 102 797-1 v1.1.2 D.2/1 - */ - modulepar boolean PICS_SIP := true; - - /** - * @desc Is supported SIP with support of CTX message mode ? - * @see ETSI TS 102 797-1 v1.1.2 D.3/1 - */ - modulepar boolean PICS_SIP_W_CTX := true; - - /** - * @desc Is supported SIP without support of CTX message mode ? - * @see ETSI TS 102 797-1 v1.1.2 D.3/2 - */ - modulepar boolean PICS_SIP_N_CTX := false; - - /** - * @desc Is IUT an host only? - * @see ETSI TS 102 797-1 v1.1.2 D.4/1 - */ - modulepar boolean PICS_ROLE_RONLY := false; - - /** - * @desc Is IUT a router only? - * @see ETSI TS 102 797-1 v1.1.2 D.4/2 - */ - modulepar boolean PICS_ROLE_HONLY := false; - - /** - * @desc Is IUT both host and router? - * @see ETSI TS 102 797-1 v1.1.2 D.4/3 - */ - modulepar boolean PICS_ROLE_RH := true; - - /** - * @desc Does the architecture implement ITS station-internal network? - * @see ETSI TS 102 797-1 v1.1.2 D.5/1 - */ - modulepar boolean PICS_ITS_S_INW := false; - - /** - * @desc Duration of SAM retransmit timer [ms] - */ - modulepar float PICS_SAM_RETRANSMIT_TIMER := 1000.0; - - /** - * @desc Is IISC available? - * @see ISO 24102-4 - */ - modulepar boolean PICS_IICP_MGM := true; - - /** - * @desc Is FSAP and FNTP linked together. - * On true, fsapPort is on IN-SAP, otherwise fsapPort is on NF-SAP - */ - modulepar boolean PICS_FSAP_FNTP := true; - - /** - * @desc Is IUT support notification to the ITS Management layer - */ - modulepar boolean PICS_ITS_MGT_NOT := false; - - /** - * @desc TODO - * @see ETSI TS 102 797-1 v1.1.2 D.13/1 - */ - modulepar boolean PICS_FSAP_MULTIPLE_AL_TECHNOLOGIES := true; - - /** - * @desc TODO - * @see ETSI TS 102 797-1 v1.1.2 D.13/2 - */ - modulepar boolean PICS_FSAP_CHANGE_COMM_CHANNEL := true; - - } // End of group fsapPics - -} // End of module LibItsFsap_Pics \ No newline at end of file diff --git a/ttcn/CALM/FSAP/LibItsFsap_Pixits.ttcn3 b/ttcn/CALM/FSAP/LibItsFsap_Pixits.ttcn3 deleted file mode 100644 index c890b9f3..00000000 --- a/ttcn/CALM/FSAP/LibItsFsap_Pixits.ttcn3 +++ /dev/null @@ -1,405 +0,0 @@ -/** - * @version $URL$ - * $Id$ - * @desc Fast service advertisement protocol (ISO 24102-5) Pixits - */ -module LibItsFsap_Pixits { - - // LibCommon - - // LibIts - import from CALMllsap language "ASN.1:1997" all; - import from CITSapplMgmtApplReg language "ASN.1:1997" { - type ITSaid - }; - import from CALMmanagement language "ASN.1:1997" { - type - ApplicationID, - ITS_scuId, StationID, - Talive - }; - import from CALMfsap language "ASN.1:1997" { - type - FmtID, VersionFSAP, - GCsched, NonipService, ServiceDataReg, - ContextData - }; - import from CALMfntp language "ASN.1:1997" { - type - PortNumber - }; - import from LibItsFntp_TypesAndValues { - const - c_portNon - }; - import from LibItsMgt_TypesAndValues { - group asn1Constants, constants - }; - import from LibItsFsap_Pics { - modulepar - PICS_SAM_RETRANSMIT_TIMER - }; - - /** - * @desc Source and destination Ports - * @see ISO/WD 29281-2 Clause 6.2.2.2 - */ - group portNumbers { - - /** - * @desc Indicate the application port number, used instead of c_portDyn - */ - modulepar PortNumber PX_APP_PORT_NUMBER := { portLong := 12345 } ; - - /** - * @desc Indicate the source port number, i.e. the local endpoint - */ - modulepar PortNumber PX_LOCAL_PORT_NUMBER := { portLong := 5555 } ; - - /** - * @desc Indicate the destination port number, i.e. the peer ITS-SP - */ - modulepar PortNumber PX_REMOTE_PORT_NUMBER := { portLong := 5556 } ; - - } // End of group portNumbers - - /** - * @desc Local settings - */ - group local { - - /** - * @desc Identifies the CI on ITS-S host - * @see ISO 21218 - Clause 6.2 Link Identifier - */ - modulepar EUI64 PX_WL_LOCAL_CIID := '03000AFFFFFF0000'O; - - /** - * @desc Identifies the VCI on ITS-S host - */ - modulepar EUI64 PX_SRC_REMOTE_CIID := 'FF000AFFFFFFFFFF'O; - - /** - * @desc Priority of the ITS-S application - */ - modulepar UserPriority PX_USER_PRIORITY := 0; - - } // End of group local - - group iutVcisMac { - - modulepar EUI64 PX_IUT_MEDTYPE_ISO21215_LOCAL_CIID := '0A0B0CFFFE0D0E10'O; // Commsignia settings -// modulepar EUI64 PX_IUT_MEDTYPE_ISO21215_LOCAL_CIID := '000C42FFFF974497'O; // Peek settings - - modulepar EUI64 PX_IUT_MEDTYPE_ISO21215_REMOTE_CIID := '0A0B0CFFFE0D0E10'O; // Commsignia settings -// modulepar EUI64 PX_IUT_MEDTYPE_ISO21215_REMOTE_CIID := '000C42FFFF974497'O; // Peek settings - - modulepar EUI64 PX_IUT_MEDTYPE_OTHER_LOCAL_CIID := '0A0B0CFFFE0D0E0F'O; - - modulepar EUI64 PX_IUT_MEDTYPE_OTHER_REMOTE_CIID := '0A0B0CFFFE0D0E0F'O; - - } // End of group iutVcisMac - - group cRegServer { - - /** - * @desc The service provider ITS station - */ - modulepar StationID PX_SERVER_ID := '11111111'O; - - /** - * @desc The service client ITS station - */ -// modulepar StationID PX_IUT_ID := '0000473A'O; // Commsignia setting (ITS-S box) - modulepar StationID PX_IUT_ID := '00003039'O; // Commsignia setting (laptop) -// modulepar StationID PX_IUT_ID := '5045454B'O; // Peek setting - - /** - * @desc The service client ITS station - */ - modulepar StationID PX_LOCAL_ID := '00003930'O; // Commsignia setting -// modulepar StationID PX_LOCAL_ID := '5045454B'O; // Peek setting - - /** - * @desc The globally unique ITS-AID of the ITS-S application - */ - modulepar ITSaid PX_ITS_AID := { content := 8 } - - - /** - * @desc The globally unique ITS-AID of the ITS-S application is case of change channel - * TODO Add phrasing here - */ - modulepar ITSaid PX_ITS_AID_CHANNEL_CHANGE := { content := 99 } - - /** - * @desc An unknown ITS-AID of the ITS-S application - */ - modulepar ITSaid PX_UNKNOWN_ITS_AID := { content := 126 } - - /** - * @desc A session port value - */ - modulepar PortNumber PX_SESSION_PORT := { portLong := 7896 } - - /** - * @desc An unspecified session port value - */ - modulepar PortNumber PX_NO_SESSION_PORT := c_unknown_portLong; - - /** - * @desc An unnknown session port value - */ - modulepar PortNumber PX_UNKNOWN_SESSION_PORT := { portLong := 1234 } - - /** - * @desc ITS application object ID (ITS-AID) for GCregServer MF-REQUEST - * @see ISO EN 17419 - * @see ISO 24102-5 Clause 8.3.1 Groupcast registration - */ - modulepar ApplicationID PX_APPLICATION_ID := { - hostITS_scuId := 1, - seqNumber := { - itsaid := PX_ITS_AID, - instance := 1, - flowNo := 0 - } - } - - /** - * @desc ITS application object ID (ITS-AID) for GCregClient MF-REQUEST - * @see ISO EN 17419 - * @see ISO 24102-5 Clause 8.3.1 Groupcast registration - */ - modulepar ApplicationID PX_CLIENT_APPLICATION_ID := { - hostITS_scuId := 2, - seqNumber := { - itsaid := PX_ITS_AID, - instance := 1, - flowNo := 0 - } - } - - /** - * @desc Scheduling information for registration / deregistration request in order to select the proper VCI in the ITS-station for communication - * 'medium' field indicates a request of specific access technology - * @see ISO/CD 24102-5 Clause 8.2.4 Groupcast communication management - */ - modulepar GCsched PX_GSCHED_ACCESS_TECH_NONIP := { - medium := c_medType_iso21215, - directivity := { - mode := 0, // FIXME Check why TTwb raises an error using DirMode_fixed_ - dirPredef := 0, - fill := '0000000'B, - dirVar := { // For Commsignia: shall be empty - /*{ - fill := '0000000'B, - bsAzimuth := 0, - bsElevation := 0, - openHorizontal := 128, - openVertical := 180 - }*/ - } - }, // End of field 'directivity' - gcInterval := float2int(PICS_SAM_RETRANSMIT_TIMER) // SAM Repeat timer in ms - } // End of modulepar PX_GSCHED_ACCESS_TECH_NONIP - - /** - * @desc Scheduling information for registration / deregistration request in order to select the proper VCI in the ITS-station for communication, - * with a long period time value - * 'medium' field indicates a request of specific access technology - * Used for TC_FSAP_SP_HR_BV_05 - * @see ISO/CD 24102-5 Clause 8.2.4 Groupcast communication management - */ - modulepar GCsched PX_GSCHED_LOG_PERIOD_TIME_ACCESS_TECH_NONIP := { - medium := c_medType_iso21215, // IR - directivity := { - mode := c_dirMode_fixed, - dirPredef := 0, - fill := '0000000'B, - dirVar := { } - }, // End of field 'directivity' - gcInterval := 30000 // SAM Repeat timer in ms - } // End of modulepar PX_GSCHED_ACCESS_TECH_NONIP - - /** - * @desc Scheduling information for registration / deregistration request in order to select the proper VCI in the ITS-station for communication - * 'medium' field indicates a request of an unknown access technology - * For TC_FSAP_SP_HR_BV_05, increase - * @see ISO/CD 24102-5 Clause 8.2.4 Groupcast communication management - */ - modulepar GCsched PX_GSCHED_ACCESS_UNKNOWN_TECH_NONIP := { - medium := c_medType_iso21214, // IR - directivity := { - mode := c_dirMode_fixed, - dirPredef := 0, - fill := '0000000'B, - dirVar := { } - }, // End of field 'directivity' - gcInterval := float2int(PICS_SAM_RETRANSMIT_TIMER) // SAM Repeat timer in ms - } // End of modulepar PX_GSCHED_ACCESS_TECH_NONIP - - /** - * @desc Scheduling information for registration / deregistration request in order to select the proper VCI in the ITS-station for communication - * 'medium' field indicates no request of specific access technology - * @see ISO/CD 24102-5 Clause 8.2.4 Groupcast communication management - */ - modulepar GCsched PX_GSCHED_NONIP := { - medium := c_medType_any, // FIXME Check why TTwb raises an error using MedType_any_ - directivity := { - mode := 0, // FIXME Check why TTwb raises an error using DirMode_fixed_ - dirPredef := 0, - fill := '0000000'B, - dirVar := { } - }, // End of field 'directivity' - gcInterval := float2int(PICS_SAM_RETRANSMIT_TIMER) // SAM Repeat timer in ms - } // End of modulepar PX_GSCHED_NONIP - - /** - * @desc Receive template for advertisement details with no session phase - */ - modulepar ServiceDataReg PX_SERVICE_DATA_REG_WITH_NO_SESSION_PHASE := { - fill := '0000000'B, - datareg := { - nonipData := { - serviceID := PX_ITS_AID, - serviceData := ''O, - providerPort := PX_NO_SESSION_PORT - } // End of field 'nonipData' - } // End of field 'datareg' - } // End of modulepar PX_SERVICE_DATA_REG_WITH_NO_SESSION_PHASE - - /** - * @desc Receive template for advertisement details with session phase - */ - modulepar ServiceDataReg PX_SERVICE_DATA_REG_WITH_SESSION_PHASE := { - fill := '0000000'B, - datareg := { - nonipData := { - serviceID := PX_ITS_AID, - serviceData := ''O, - providerPort := PX_SESSION_PORT - } // End of field 'nonipData' - } // End of field 'datareg' - } // End of modulepar PX_SERVICE_DATA_REG_WITH_SESSION_PHASE - - /** - * @desc Receive template for advertisement details with session phase and channel change requested - */ - modulepar ServiceDataReg PX_SERVICE_DATA_REG_WITH_SESSION_PHASE_AND_CHANNEL_CHANGE := { - fill := '0000000'B, - datareg := { - nonipData := { - serviceID := PX_ITS_AID_CHANNEL_CHANGE, - serviceData := ''O, - providerPort := PX_SESSION_PORT - } // End of field 'nonipData' - } // End of field 'datareg' - } // End of modulepar PX_SERVICE_DATA_REG_WITH_SESSION_PHASE_AND_CHANNEL_CHANGE - - } // End of group cRegServer - - group sam { - - /** - * @desc TODO - */ - modulepar integer PX_NO_SESSION_CHANNEL := 0; - - /** - * @desc TODO - */ - modulepar integer PX_SESSION_CHANNEL := 1; - - /** - * @desc Non-IP information on services offered, with no session phase and no channel change requested - * @see ISO 24102-5 Figure 9 — serviceList - */ - modulepar NonipService PX_NO_IP_SERVICE_WITH_NO_SESSION_AND_NO_CHANGE_CHANNEL := { - serviceID := PX_ITS_AID, - serviceData := ''O, - serverPort := PX_NO_SESSION_PORT, - sessionChannel := PX_NO_SESSION_CHANNEL - } // End of modulepar PX_NO_IP_SERVICE_WITH_NO_SESSION_AND_NO_CHANGE_CHANNEL - - /** - * @desc Non-IP information on services offered, with session phase and no channel change requested - * @see ISO 24102-5 Figure 9 — serviceList - */ - modulepar NonipService PX_NO_IP_SERVICE_WITH_SESSION_AND_NO_CHANGE_CHANNEL := { - serviceID := PX_ITS_AID, - serviceData := ''O, - serverPort := PX_SESSION_PORT, - sessionChannel := PX_NO_SESSION_CHANNEL - } // End of modulepar PX_NO_IP_SERVICE_WITH_SESSION_AND_NO_CHANGE_CHANNEL - - /** - * @desc Non-IP information on services offered, with no session phase and channel change requested - * @see ISO 24102-5 Figure 9 — serviceList - */ - modulepar NonipService PX_NO_IP_SERVICE_WITH_SESSION_AND_CHANNEL_CHANGE := { - serviceID := PX_ITS_AID_CHANNEL_CHANGE, - serviceData := ''O, - serverPort := PX_SESSION_PORT, - sessionChannel := 1 - } // End of modulepar PX_NO_IP_SERVICE_WITH_SESSION_AND_CHANNEL_CHANGE - - /** - * @desc Non-IP information on an unknown services offered, with session phase and no channel change requested - * @see ISO 24102-5 Figure 9 — serviceList - */ - modulepar NonipService PX_NO_IP_SERVICE_WITH_UNKNOWN_SERVICE_ID := { - serviceID := PX_UNKNOWN_ITS_AID, - serviceData := ''O, - serverPort := PX_SESSION_PORT, - sessionChannel := PX_SESSION_CHANNEL - } // End of modulepar PX_NO_IP_SERVICE_WITH_UNKNOWN_SERVICE_ID - - /** - * @desc Non-IP information on services offered, with session phase and channel change requested on an unknown channel - * @see ISO 24102-5 Figure 9 — serviceList - */ - modulepar NonipService PX_NO_IP_SERVICE_WITH_UNKNOWN_CHANNEL := { - serviceID := PX_ITS_AID, - serviceData := ''O, - serverPort := PX_UNKNOWN_SESSION_PORT, - sessionChannel := PX_SESSION_CHANNEL - } // End of modulepar PX_NO_IP_SERVICE_WITH_UNKNOWN_CHANNEL - - modulepar ContextData PX_CONTEXT_DATA := '4743726567436C69656E74'O; - - } // End of group sam - - group parametrisation { - - /** - * @desc SAM tag identifier - * @see ISO 24102-5 Clause 7.2.1 Overview - */ - modulepar FmtID PX_FMTID_SAM := 0; // FIXME Check why TTWB raises an error using CLAMfsap.FmtID_sam_ - - /** - * @desc CTX tag identifier - * @see ISO 24102-5 Clause 7.2.1 Overview - */ - modulepar FmtID PX_FMTID_CTX := 1; // FIXME Check why TTWB raises an error using CLAMfsap.FmtID_ctx_ - - /** - * @desc FSAP version number - * @see ISO 24102-5 Clause 7.2.2 Service advertisement message - */ - modulepar VersionFSAP PX_VERSION_FSAP := 0; - - /** - * Wait until the IUT is in a stable situation (beaconing...) - */ - modulepar float PX_WAIT_FOR_IUT_READY := 1.0; - - /** - * @desc Time necessary for IUT to detect SAM messages (in seconds) - */ - modulepar float PX_SP_DISCOVERY_DELAY := PICS_SAM_RETRANSMIT_TIMER * 2.0 / 1000.0; - - } // End of group parametrisation - -} // End of module LibItsFsap_Pixits \ No newline at end of file diff --git a/ttcn/CALM/FSAP/LibItsFsap_Templates.ttcn3 b/ttcn/CALM/FSAP/LibItsFsap_Templates.ttcn3 deleted file mode 100644 index e994d1f0..00000000 --- a/ttcn/CALM/FSAP/LibItsFsap_Templates.ttcn3 +++ /dev/null @@ -1,1019 +0,0 @@ -/** - * @author ETSI / STF422_EETS - * @version $URL$ - * $Id$ - * @desc Templates definitions for Fast service advertisement protocol (ISO 24102-5) - */ -module LibItsFsap_Templates { - // LibCommon - - // LibIts - - // LibItsCalm - import from CALMmanagement language "ASN.1:1997" { - type - ApplicationID, - ITS_scuId, StationID - }; - import from CITSapplMgmtApplReg language "ASN.1:1997" { - type - ITSaid - }; - import from CALMmsap language "ASN.1:1997" { - type - FAsapPrimitivesDown, FAsapPrimitivesUp, - MF_Request_request - /* TODO To be removed - MF_Command_request, MF_Command_confirm, MF_Command, - MF_Request */ - }; - import from CALMllsap language "ASN.1:1997" { - type - LLserviceAddr, Link_ID, - INsapPrimitivesUp, INsapPrimitivesDown, - IN_UNITDATA_request, IN_UNITDATA_indication, - INdata - }; - import from CALMfntp language "ASN.1:1997" { - type - PortNumber, FntpOptions, - FNTPNPDU, ITSfpdu, - NFsapPrimitivesUp, NFsapPrimitivesDown, - NFfntpCommIndication - }; - import from CALMfsap language "ASN.1:1997" { - type - GCregServer, GCderegServer, - GCregClient, GCderegClient, - GCschedule, - ServiceDataReg, ServiceData, - ContextData, - ServiceList, ServiceInfo, - NonipContext, - ChannelList, - SessionChannel, - SAMserviceData, CTXserviceData, - SAM, SAMrxNot, GCsam, GCsamctx, GCsamctxConf, - CTX, CTXrxNot, GCctxTxCmd, GCctx - }; - import from LibItsFsap_TypesAndValues { - type - UtFsapEvent, UtFsapEventInd, - CfFsapEventInd - , AcFsapPrimitive - }; - import from LibItsFsap_Pixits { - modulepar - PX_FMTID_CTX, PX_VERSION_FSAP, PX_FMTID_SAM, - PX_USER_PRIORITY, PX_REMOTE_PORT_NUMBER - }; - import from LibItsFntp_Templates { - template - m_fntpBasicNpdu, - m_inUnitDataInd - }; - import from LibItsCalm_Pixits { - modulepar - PX_LOC_ITS_FSAP_ACCESS_SETTINGS_MX_SAP_SET, PX_LOC_ITS_FSAP_ACCESS_SETTINGS_MX_SAP_UNSET, - PX_IUT_LOWER_LAYER_USED, PX_IUT_LOWER_LAYER_UNUSED, - PX_IUT_TEST_MODE_ON - }; - import from LibItsCalm_Interface all; - - group fsapPrimitives { - - /** - * @desc Send template for IN-SAP Messages (FsapPort Primitive) - * @param p_inSapPrimitivesUp IN-SAP message to be sent - */ - template (value) FsapReq m_fsapReq_nfSap( - template (value) NFsapPrimitivesUp p_nfSapPrimitivesUp - ) := { - msgOut_nf := p_nfSapPrimitivesUp - } // End of template m_fsapReq_nfSap - - /** - * @desc Receive template for IN-SAP message (FsapPort Primitive) - * @param p_inSapPrimitivesDown Expected IN-SAP message - */ - template FsapInd mw_fsapInd_nfSap( - template (present) NFsapPrimitivesDown p_nfSapPrimitivesDown - ) := { - msgIn := { - msgIn_nf := p_nfSapPrimitivesDown - }, - receptionTime := ? - } // End of template mw_fsapInd_nfSap - - /** - * @desc Send template for DEN Message (DenmPort Primitive) - * @param p_inSapPrimitivesUp IN-SAP message to be sent - */ - template (value) FsapReq m_fsapReq_inSap( - template (value) INsapPrimitivesUp p_inSapPrimitivesUp - ) := { - msgOut_in := p_inSapPrimitivesUp - } - - /** - * @desc Receive template for IN-SAP message (FntpPort Primitive) - * @param p_inSapPrimitivesDown Expected IN-SAP message - */ - template FsapInd mw_fsapInd_inSap( - template (present) INsapPrimitivesDown p_inSapPrimitivesDown - ) := { - msgIn := { - msgIn_in := p_inSapPrimitivesDown - }, - receptionTime := ? - } // End of template mw_fsapInd_inSap - - /** - * @desc Primitive on IN-SAP interface - * @see ISO/CD 21218 - Clause 8.3 - * @see ISO/CD 29281-2 - Clause 7.1.2 - */ - group inSapPrimitives { - - group sendOperation { - - /** - * @desc Generate a SAM notification message through IN-SAP - * @param p_insap_source_address Source linkId - * @param p_insap_dest_address Destination linkId - * @param p_sam The SAM message in octetstring format - * @see ISO/CD 21218 - Clause 8.3.3 - * @see ISO 29281 - Clause 7.9.3 - */ - template (value) INsapPrimitivesUp m_generateSamMessagePdu( - in template (value) LLserviceAddr p_insapSourceAddress, - in template (value) LLserviceAddr p_insapDestAddress, - in template (value) INdata p_data - ) := { - spRef := 0, - servPrimitive := { - IN_UNITDATA_indication := { - source_addr := p_insapSourceAddress, - dest_addr := p_insapDestAddress, - data := p_data, - priority := PX_USER_PRIORITY, - accessParams := { - apRef := 0, - aParameter := { NullType := NULL } - } - } // End of field 'inUnitdataInd' - } // End of field 'servPrimitive' - } // End of template m_generateSamMessagePdu - - /** - * @desc Generate a CTX reception message through IN-SAP - * @param p_insap_source_address Source linkId - * @param p_insap_dest_address Destination linkId - * @param p_ctx The SAM message in octetstring format - * @see ISO/CD 21218 - Clause 8.3.3 - * @see ISO 29281 - Clause 7.9.4 - */ - template (value) INsapPrimitivesUp m_generateCtxMessagePdu( - in template (value) LLserviceAddr p_insapSourceAddress, - in template (value) LLserviceAddr p_insapDestAddress, - in template (value) INdata p_ctx - ) := { - spRef := 0, - servPrimitive := { - IN_UNITDATA_indication := { - source_addr := p_insapSourceAddress, - dest_addr := p_insapDestAddress, - data := p_ctx, - priority := PX_USER_PRIORITY, - accessParams := { - apRef := 0, - aParameter := ? - } - } // End of field 'inUnitdataInd' - } // End of field 'servPrimitive' - } // End of template m_generateCtxMessagePdu - - } // End of group sendOperation - - group recvOperation { - - /** - * @desc Receive template for a SAP primitive message on IN-SAP interface - * @param p_inUnitdataRq The IN-DATA.request SAP primitive message - * @see ISO/CD 21218 - Clause 8.3.1 - * @see ISO/CD 29281-2 - Clause 7.1.2 - */ - template INsapPrimitivesDown mw_fsapInSapPrimitiveReq( - in template (present) IN_UNITDATA_request p_inUnitdataRq - ) := { - spRef := 0, - servPrimitive := { IN_UNITDATA_request := p_inUnitdataRq } - } // End of template m_fntpImPrimitiveReq - - } // End of group recvOperation - - } // End of group inSapPrimitives - - /** - * @desc Primitive on IN-SAP interface - * @see ISO/CD 21218 - Clause 8.3 - * @see ISO/CD 29281-2 - Clause 7.1.2 - */ - group nfSapPrimitives { - - group recvOperation { - - /** - * @desc Receive template for a SAP primitive message on IN-SAP interface - * @param p_inUnitdataRq The IN-DATA.request SAP primitive message - * @see ISO/CD 21218 - Clause 8.3.1 - * @see ISO/CD 29281-2 - Clause 7.1.2 - */ - template (present) NFsapPrimitivesDown mw_fsapNfSapPrimitiveReq( - in template (present) PortNumber p_servicePort, - in template (present) Link_ID p_linkId, - in template (present) ITSfpdu p_data - ) := { - spRef := 1, - servPrimitive := { - NFfntpCommRequest := { - commRef := ?, - servicePort := p_servicePort, - remotePort := PX_REMOTE_PORT_NUMBER, - linkID := p_linkId, - data := p_data, - priority := PX_USER_PRIORITY, - controlField := ? - } // End of field 'NFfntpCommRequest' - } // End of field 'servPrimitive' - } // End of template mw_fsapNfSapPrimitiveReq - - } // End of group recvOperation - - } // End of group nfSapPrimitives - - /** - * @desc Templates used to - *
  • trigger message on Upper Tester
  • - *
  • capture indication message sent by the IUT
  • - */ - group utPrimitives { - - /** - * @desc Initializes the FSAP IUT including support notification to the Management entity - * See Test System Configuration Access to SUT - */ - template (value) UtInitialize m_utFsapInitialize_with_management := { - utFsapInitialize := { - mcmdRq := { - mCmdRef := 255, - mcmd := { - TestConfigIICP := { - location := PX_LOC_ITS_FSAP_ACCESS_SETTINGS_MX_SAP_SET, - lowerLayers := PX_IUT_LOWER_LAYER_UNUSED, // PX_IUT_LOWER_LAYER_USED - testMode := PX_IUT_TEST_MODE_ON - } - } // End of field 'mcmd' - } // End of field 'mcmdRq' - } // End of field 'utFntpInitialize' - } // End of template m_utFntpInitialize - - /** - * @desc Initializes the FSAP IUT without support notification to the Management entity - * See Test System Configuration Access to SUT - */ - template (value) UtInitialize m_utFsapInitialize_without_management := { - utFsapInitialize := { - mcmdRq := { - mCmdRef := 255, - mcmd := { - TestConfigIICP := { - location := PX_LOC_ITS_FSAP_ACCESS_SETTINGS_MX_SAP_SET, - lowerLayers := PX_IUT_LOWER_LAYER_UNUSED, // PX_IUT_LOWER_LAYER_USED - testMode := PX_IUT_TEST_MODE_ON - } - } // End of field 'mcmd' - } // End of field 'mcmdRq' - } // End of field 'utFntpInitialize' - } // End of template m_utFntpInitialize - - /** - * @desc Send template to generate a FAsapPrimitivesDown message - * @param p_faSapPrimitivesDown The FAsapPrimitivesDown message - */ - template (value) UtFsapEvent m_generateFaSapPrimitivesDown( - in template (value) FAsapPrimitivesDown p_faSapPrimitivesDown - ) := { - faSapPrimitivesDown := p_faSapPrimitivesDown - } // End of template m_generateFaSapPrimitivesDown - - /** - * @desc Receive template for FAsapPrimitivesUp/GcRegServerConf message - * @param p_applicationID Application Identifier - */ - template UtFsapEventInd mw_fsapGcRegServerConf( - in template (present) ApplicationID p_applicationID - ) := { - faSapPrimitivesUp := { - spRef := 3, - servPrimitive := { - GCregServerConf := { - applicationID := p_applicationID - } - } - } - } // End of template mw_fsapGcRegServerConf - - /** - * @desc Receive template for FAsapPrimitivesUp/GcRegServerConf message - * @param p_applicationID Application Identifier - */ - template UtFsapEventInd mw_fsapGcDeregServerConf( - in template (present) ApplicationID p_applicationID - ) := { - faSapPrimitivesUp := { - spRef := 5, - servPrimitive := { - GCderegServerConf := { - applicationID := p_applicationID - } - } - } - } // End of template mw_fsapGcDeregServerConf - - /** - * @desc Receive template for FAsapPrimitivesUp/GcRegClientConf message - * @param p_applicationID Application Identifier - */ - template UtFsapEventInd mw_fsapGcRegClientConf( - in template (present) ApplicationID p_applicationID - ) := { - faSapPrimitivesUp := { - spRef := 6, - servPrimitive := { - GCregClientConf := { - applicationID := p_applicationID - } - } - } - } // End of template mw_fsapGcRegClientConf - - /** - * @desc Receive template for FAsapPrimitivesUp/GcDeregClientConf message - * @param p_applicationID Application Identifier - */ - template UtFsapEventInd mw_fsapGcDeregClientConf( - in template (present) ApplicationID p_applicationID - ) := { - faSapPrimitivesUp := { - spRef := 8, - servPrimitive := { - GCderegClientConf := { - applicationID := p_applicationID - } - } - } - } // End of template mw_fsapGcDeregClientConf - - /** - * @desc Receive template for FAsapPrimitivesUp/GCctx message - * @param p_gcCtx GCctx notification message - */ - template UtFsapEventInd mw_fsapGcCtx( - in template (present) GCctx p_gcCtx - ) := { - faSapPrimitivesUp := { - spRef := 10, - servPrimitive := { - GCctx := p_gcCtx - } // End of field 'servPrimitive' - } // End of field 'faSapPrimitivesUp' - } // End of template mw_fsapGcCtx - - /** - * @desc Receive template for FAsapPrimitivesUp/GCctx message - * @param p_gcCtx GCctx notification message - */ - template UtFsapEventInd mw_fsapGcSam( - in template (present) GCsam p_gcSam - ) := { - faSapPrimitivesUp := { - spRef := 9, - servPrimitive := { - GCsam := p_gcSam - } // End of field 'servPrimitive' - } // End of field 'faSapPrimitivesUp' - } // End of template mw_fsapGcSam - - /** - * @desc Receive template for FAsapPrimitivesUp/GCsamctx message - * @param p_gcSamCtx GCsamctx notification message - */ - template UtFsapEventInd mw_fsapGcSamCtx( - in template (present) GCsamctx p_gcSamCtx - ) := { - faSapPrimitivesUp := { - spRef := 2, - servPrimitive := { - GCsamctx := p_gcSamCtx - } // End of field 'servPrimitive' - } // End of field 'faSapPrimitivesUp' - } // End of template mw_fsapGcSamCtx - - } // End of group utPrimitives - - group cfPrimitives { - - /** - * @desc Initializes the Configuration tester - */ - template (value) CfInitialize m_cfFsapInitialize := { - cfFsapInitialize := { - } // End of field 'cfFsapInitialize' - } // End of template m_cfFsapInitialize - - /** - * @desc Receive template for configuration message (CfPort Primitive) - * @param p_mfRequestRequest Expected MF_Request_request message - */ - template CfFsapEventInd mw_cfFsapEventInd( - template (present) MF_Request_request p_mfRequestRequest - ) := { - mfRequestRequest := p_mfRequestRequest - } // End of template mw_cfFsapEventInd - - } // End of group cfPrimitives - - group taPrimitives { - - } // End of group taPrimitives - - group cregServerMessage { - - group cregServerMessageSend { - - template (value) FAsapPrimitivesDown m_faSapPrimitivesDown_gcRegServer( - in template (value) GCregServer p_gcRegServer - ) := { - spRef := 3, - servPrimitive := { GCregServer := p_gcRegServer } - } // End of template m_generateFaSapPrimitivesDown - - template (value) FAsapPrimitivesDown m_faSapPrimitivesDown_gcDeregServer( - in template (value) GCderegServer p_gcDeregServer - ) := { - spRef := 5, - servPrimitive := { GCderegServer := p_gcDeregServer } - } // End of template m_faSapPrimitivesDown_gcDeregServer - - /** - * @desc Send a GCregServer registration request for an ITS-S application - * @param p_applicationId The Application ID - * @param p_gCschedule A set of scheduling information - * @param p_serviceDataReg Additional service data information - * @see ISO 24102-3 Table C.1 — MF-REQUESTs - * @see ISO 24102-5 Clause 8.2.1 Groupcast registration - */ - template (value) GCregServer m_gcRegServer( - in template (value) ApplicationID p_applicationId, - in template (value) GCschedule p_gCschedule, - in template (value) ServiceDataReg p_serviceDataReg - ) := { - applicationID := p_applicationId, - gCschedule := p_gCschedule, - priority := PX_USER_PRIORITY, - serviceDataReg := p_serviceDataReg - //} // End of field 'gCregServer' - } // End of template m_gcRegServer - - template (value) GCderegServer m_gcDeregServer( - in template (value) ApplicationID p_applicationId - ) := { - applicationID := p_applicationId - } // End of template m_gcDeregServer - - } // End of group cregServerMessageSend - - group cregServerMessageRecv { - - /** - * @desc Generic receive GCregServer template - * Used for: - *
  • modifying restrictif template
  • - *
  • default altstep
  • - * @see ISO 24102-3 Table C.1 — MF-REQUESTs - * @see ISO 24102-5 Clause 8.2.1 Groupcast registration - */ - template GCregServer mw_gCregServer_any := { - applicationID := { - hostITS_scuId := ?, - seqNumber := ? - }, // End of field applicationID'' - gCschedule := ?, - priority := ?, - serviceDataReg := { - datareg := { - nonipData := ? - } // End of field 'datareg' - } // End of field 'serviceDataReg' - } // End of template mw_gCregServer - - } // End of group cregServerMessageRecv - - } // End of group cregServerMessage - - group cregClientMessage { - - group cregClientMessageSend { - - template (value) FAsapPrimitivesDown m_faSapPrimitivesDown_gcRegClient( - in template (value) GCregClient p_gcRegClient - ) := { - spRef := 6, - servPrimitive := { GCregClient := p_gcRegClient } - } // End of template m_faSapPrimitivesDown_gcRegClient - - /** - * @desc Send template for a GCregClient without a session, CTX is not requested - * @param p_applicationId The Application ID - * @param p_serviceId The globally unique ITS-AID of the ITS-S application - * @see ISO 24102-5 Clause 8.5 - */ - template (value) GCregClient m_gCregClientWithNoSessionAndNoCtx( - in template (value) ApplicationID p_applicationId, - in template (value) ITSaid p_serviceId - ) := { - applicationID := p_applicationId, - priority := PX_USER_PRIORITY, - serviceID := p_serviceId, - contextData := ''O - } // End of template m_gCregClientWithNoSessionAndNoCtx - - /** - * @desc Send template for a GCregClient without a session, CTX is requested - * @param p_applicationId The Application ID - * @param p_serviceId The globally unique ITS-AID of the ITS-S application - * @see ISO 24102-5 Clause 8.3.1 Groupcast registration - */ - template (value) GCregClient m_gCregClientWithSessionAndCtx( - in template (value) ApplicationID p_applicationId, - in template (value) ITSaid p_serviceId, - in template (value) ContextData p_contextData - ) := { - // gCregClient := { - applicationID := p_applicationId, - priority := PX_USER_PRIORITY, - serviceID := p_serviceId, - contextData := p_contextData - // } // End of field 'gCregClient' - } // End of template m_gCregClientWithSessionAndCtx - - template (value) FAsapPrimitivesDown m_faSapPrimitivesDown_gcDeregClient( - in template (value) ApplicationID p_applicationId - ) := { - spRef := 8, - servPrimitive := { - GCderegClient := { - applicationID := p_applicationId - } - } - } // End of template m_faSapPrimitivesDown_gcRegClient - - } // End of group cregClientMessageSend - - group cderegServerMessageRecv { - - } // End of group cderegServerMessageRecv - - } // End of group cregClientMessage - - group samMessage { - - group samMessageSend { - - /** - * @desc Send template for SAM - * @param p_applicationId The Application ID - * @param p_serverId Server identifier - * @param p_serviceData Additional SAM service data information - * @see ISO 24102-5 Clause 8.3.4 Reception of SAM and transmission of CTX - */ - template (value) SAM m_sam( - in template (value) StationID p_serverId, - in template (value) ITSaid p_serviceId, - in template (value) ServiceList p_serviceList - ) := { - fmtID := PX_FMTID_SAM, - version := PX_VERSION_FSAP, - serverID := p_serverId, - serviceList := p_serviceList, - channelList := { }, - ipServList := { // Empty list - } - } // End of template mw_sam - - template (value) GCsamctxConf m_gcSamCtxConf( - in template (value) ApplicationID p_applicationID, - in template (value) LLserviceAddr p_link, - in template (value) PortNumber p_port - ) := { - applicationID := p_applicationID, - link := p_link, - port_ := p_port - } // End of template m_mfRequest_samRxNot - - } // End of group samMessageSend - - group samMessageRecv { - - template (value) FAsapPrimitivesDown m_faSapPrimitivesDown_gcSamCtxConf( - in template (value) GCsamctxConf p_gcSamCtxConf - ) := { - spRef := 2, - servPrimitive := { GCsamctxConf := p_gcSamCtxConf } - } // End of template m_faSapPrimitivesDown_gcSamCtxConf - - /** - * @desc Receive template for SAM - * @param p_applicationId The Application ID - * @param p_serverId Server identifier - * @param p_serviceData Additional SAM service data information - * @see ISO 24102-5 Clause 8.3.4 Reception of SAM and transmission of CTX - */ - template (present) SAM mw_sam( - in template (present) StationID p_serverId, - in template (present) ServiceList p_serviceList - ) := { - fmtID := PX_FMTID_SAM, - version := PX_VERSION_FSAP, - serverID := p_serverId, - serviceList := p_serviceList, - channelList := ?, - ipServList := { // Empty list - } - } // End of template mw_sam - - template (present) SAM mw_sam_channelList( - in template (present) StationID p_serverId, - in template (present) ServiceList p_serviceList, - in template (present) ChannelList p_channelList - ) modifies mw_sam := { - channelList := p_channelList - } // End of template mw_sam_channelList - - template (present) GCsam mw_gcSam( - in template (present) ApplicationID p_applicationId, - in template (present) StationID p_serverId, - in template (present) SAMserviceData p_samServiceData, - in template (present) LLserviceAddr p_linkId - ) := { - applicationID := p_applicationId, - serverID := p_serverId, - serviceData := p_samServiceData, - link := p_linkId - } // End of template mw_gcSam - - /** - * @desc Receive template for GCsamctx - * @param p_applicationId The Application ID - * @param p_serverId Server identifier - * @param p_serviceInfo Additional service data information - * @see ISO 24102-5 Clause 8.3.4 Reception of SAM and transmission of CTX - */ - template (present) GCsamctx mw_gcSamCtx( - in template (present) ApplicationID p_applicationId, - in template (present) StationID p_serverId, - in template (present) ServiceInfo p_serviceInfo, - in template (present) LLserviceAddr p_link - ) := { - applicationID := p_applicationId, - serverID := p_serverId, - serviceInfo := p_serviceInfo, - link := p_link - } // End of template mdw_mfCommand_gcSamCtx - - /** - * @desc Receive template for SAMserviceData - * @param p_serviceId Service identifier - * @param p_serviceData Additional service data information - * @param p_providerPort Service user port number - */ - template (present) SAMserviceData mw_samDataServerciceWithAccessTechAndNonIp( - in template (present) ITSaid p_serviceId, - in template (present) ServiceData p_serviceData, - in template (present) PortNumber p_providerPort, - in template (present) SessionChannel p_sessionChannel - ) := { - fill := '0000000'B, - servData := { - nonipService := { - serviceID := p_serviceId, - serviceData := p_serviceData, - providerPort := p_providerPort, - sessionChannel := p_sessionChannel - } // End of field 'nonipService' - } // End of field 'servData' - } // End of template mw_samDataServerciceWithAccessTechAndNonIP - - template (present) ServiceInfo mw_serviceInfo_nonipService( - in template (present) ITSaid p_serviceId, - in template (present) PortNumber p_providerPort - ) := { - fill := '0000000'B, - info := { - nonipService := { - serviceID := p_serviceId, - providerPort := p_providerPort - } // End of field 'nonipService' - } // End of field 'info' - } // End of template mw_serviceInfo_nonipService - - template (present) SessionChannel mw_sessionChannel( - in template (present) integer p_serviceChannel - ) := { - serviceChannel := p_serviceChannel, - medium := ?, - schParams := ? - } // End of template mw_sessionChannel - - } // End of group samMessageRecv - - } // End of group samMessage - - group ctxMessage { - - group ctxMessageSend { - - template (value) INsapPrimitivesUp m_inSapPrimitivesUp( - in template (value) LLserviceAddr p_insapSourceAddress, - in template (value) LLserviceAddr p_insapDestAddress, - in template (value) INdata p_inData - ) := { - spRef := 0, - servPrimitive := { - IN_UNITDATA_indication := - m_inUnitDataInd( - p_insapSourceAddress, - p_insapDestAddress, - p_inData - ) - } - } // End of template m_inSapPrimitivesUp - - // FIXME To be continued - template (value) NFsapPrimitivesUp m_nfSapPrimitivesUp( - in template (value) PortNumber p_servicePort, - in template (value) PortNumber p_remotePort, - in template (value) Link_ID p_linkId, - in template (value) ITSfpdu p_data - ) := { - spRef := 2, - servPrimitive := { - NFfntpCommIndication := { - servicePort := p_servicePort, - remotePort := p_remotePort, - linkID := p_linkId, - data := p_data, - priority := PX_USER_PRIORITY, - controlField := m_noFntpOptions - } - } - } // End of template m_nfSapPrimitivesUp - - /** - * @desc Send "CTX" in reply to SAM - * @param p_linkID Source address - * @param p_ctx CTX information - * @see ISO 24102-5 Clause 8.2.6 - * @see ISO 21218 Clause 5.4.2.1 & 5.4.2.2 - */ - template (value) CTXrxNot m_ctxRxNot( - in template (value) LLserviceAddr p_linkId, - in template (value) CTX p_ctx - ) := { - // cTXrxNot := { - link := p_linkId, - ctx := p_ctx - //} // // End of field 'cTXrxNot' - } // End of template m_ctxRxNot - - /** - * @desc Send template for CTX - * @param p_clientID Client identifier - * @see ISO 24102-5 Clause 8.2.6 Reception of CTX - */ - template (value) CTX m_ctx( - in template (value) StationID p_clientId - ) := { - fmtID := PX_FMTID_CTX, - version := PX_VERSION_FSAP, - clientID := p_clientId, - servContextList := { }, - ipContextList := { } - } // End of template m_ctx - - template (value) CTX m_ctx_noip( - in template (value) StationID p_clientId, - in template (value) NonipContext p_noIpContext - ) modifies m_ctx := { - servContextList := { - p_noIpContext - } - } // End of template m_ctx_noip - - /** - * @desc Send template for CTX in non-ip context - * @param p_serviceId The globally unique ITS-AID of the ITS-S application - * @param p_contextData Service port number - * @param p_userPort Service port number - * @see ISO2410-5 Clause 8.2.1 Groupcast registration - * @see ISO2410-5 Figure 9 — serviceList - */ - template (value) NonipContext m_nonIpContext( - in template (value) ITSaid p_serviceId, - in template (value) ContextData p_contextData, - in template (value) PortNumber p_userPort - ) := { - serviceID := p_serviceId, - contextData := p_contextData, - userPort := p_userPort - } // End of template m_nonIpContext - - } // End of group ctxMessageSend - - group ctxMessageRecv { - - /** - * @desc Receive template for GCctx - * @param p_applicationId The application ID - * @param p_clientID Client identifier - * @param p_serviceContext Additional service context information - * @see ISO 24102-5 Clause 8.2.6 Reception of CTX - */ - template (present) GCctx mdw_gCctx( // FIXME To be renamed - in template (present) ApplicationID p_applicationId, - in template (present) StationID p_clientId, - in template (present) CTXserviceData p_serviceContext - ) := { - applicationID := p_applicationId, - clientID := p_clientId, - serviceContext := p_serviceContext - } // End of template mdw_gCctx - - /** - * @desc Receive template for GCctxTxCmd - * @param p_link Source address - * @param p_ctx CTX information - * @see ISO 24102-5 Clause 8.3.4 Reception of SAM and transmission of CTX - */ - template (present) GCctxTxCmd mdw_mfCommand_gcCtxTxCmd( - in template (present) CALMllsap.LLserviceAddr p_link, - in template (present) CTX p_ctx - ) := { - // gCctxTxCmd := { - link := p_link, - ctx := p_ctx - // } // End of header 'gCctxTxCmd' - } // End of template mdw_mfCommand_gcCtxTxCmd - - /** - * @desc Generic receive template for CTX. - * Used for: - *
  • modifying restrictif template
  • - *
  • default altstep
  • - * @see ISO 24102-5 Clause 8.2.6 Reception of CTX - */ - template (present) CTX mw_ctx_any := { - fmtID := PX_FMTID_CTX, - version := PX_VERSION_FSAP, - clientID := ?, - servContextList := ?, - ipContextList := ? - } // End of template mw_ctx_any - - /** - * @desc Send template for CTX - * @param p_clientID Client identifier - * @see ISO 24102-5 Clause 8.2.6 Reception of CTX - */ - template (present) CTX mdw_ctx( - in template (present) StationID p_clientId - ) modifies mw_ctx_any := { - clientID := p_clientId - } // End of template mw_ctx - - /** - * @desc Receive template for CTX with non-ip service context - * @param p_servContext Additional service data information for non-IP based services (timeout information) - * @see ISO2410-5 Clause 8.2.1 Groupcast registration - * @see ISO2410-5 Figure 9 — serviceList - */ - template (present) CTX mdw_ctx_nonIpContext( - in template (present) StationID p_clientId, - in template (present) NonipContext p_servContext - ) modifies mdw_ctx := { - servContextList := { p_servContext } // FIXME To be reviewed during validation superset(p_servContext) - } // End of template mdw_ctx_nonIpContext - - /** - * @desc Receive template for CTX in non-ip context - * @param p_serviceId The globally unique ITS-AID of the ITS-S application - * @param p_userPort Service port number - * @see ISO2410-5 Clause 8.2.1 Groupcast registration - * @see ISO2410-5 Figure 9 — serviceList - */ - template (present) NonipContext mw_nonIpContext( - in template (present) ITSaid p_serviceId, - in template (present) PortNumber p_userPort - ) := { - serviceID := p_serviceId, - contextData := ?, - userPort := p_userPort - } // End of template mw_nonIpContext - - /** - * @desc Receive template for CTX in non-ip context - * @param p_serviceId The globally unique ITS-AID of the ITS-S application - * @param p_userPort Service port number - * @param p_contextData A context data value - * @see ISO2410-5 Clause 8.2.1 Groupcast registration - * @see ISO2410-5 Figure 9 — serviceList - */ - template (present) NonipContext mw_nonIpContext_contextdata( - in template (present) ITSaid p_serviceId, - in template (present) PortNumber p_userPort, - in template (value) ContextData p_contextData - ) modifies mw_nonIpContext := { - contextData := p_contextData - } // End of template mw_nonIpContext - - /** - * @desc Generic receive template for CTXserviceData - * Used for: - *
  • modifying restrictif template
  • - *
  • default altstep
  • - */ - template (present) CTXserviceData mw_ctxDataServercice_any := { - fill := '0000000'B, - servData := ? - } // End of template mw_ctxDataServercice_any - - /** - * @desc Receive template for CTXserviceData - * @param p_serviceId The globally unique ITS-AID of the ITS-S application - * @param p_contextData Additional context data information for non-IP based services (timeout information) - * @param p_userPort Service port number - */ - template (present) CTXserviceData mdw_ctxServiceDataNonIp( - in template (present) ITSaid p_serviceId, - in template (present) ContextData p_contextData, - in template (present) PortNumber p_userPort - ) modifies mw_ctxDataServercice_any := { - servData := { - nonipContext := { - serviceID := p_serviceId, - contextData := p_contextData, - userPort := p_userPort - } // End of field 'nonipService' - } // End of field 'servData' - } // End of template mdw_ctxServiceDataNonIp - - } // End of group ctxMessageRecv - - } // End of group ctxMessage - - /** - * @desc Fntp NPUD templates - */ - group fsapFntpNpdu { - - /** - * @desc Send template for basic NPDU for UC/BC transmission- N/single hop - * For basic FNTPNPDU, S-Hop is required (see ISO 29281-1 Clause 5.1.2 Basic mode of operation) - * @param p_sourcePort Source port - * @param p_destinationPort Destination port - */ - template (value) FNTPNPDU m_fsapBasicFntpNpdu( - in template (value) PortNumber p_sourcePort, - in template (value) PortNumber p_destinationPort, - in template (value) ITSfpdu p_body - ) modifies m_fntpBasicNpdu := { - body := p_body - } // End of template m_fntpBasicNpdu - - template (value) FntpOptions m_noFntpOptions := { - intForw := omit, - sec := omit, - hops := omit, - lpp := omit, - cip := omit, - opt5 := omit, - opt6 := omit, - opt7 := omit - } // End of template m_noFntpOptions - - } // End of group fsapFntpNpdu - - } // End of group fsapPrimitives - -} // End of module LibItsFsap_Templates \ No newline at end of file diff --git a/ttcn/CALM/FSAP/LibItsFsap_TypesAndValues.ttcn3 b/ttcn/CALM/FSAP/LibItsFsap_TypesAndValues.ttcn3 deleted file mode 100644 index c3f22152..00000000 --- a/ttcn/CALM/FSAP/LibItsFsap_TypesAndValues.ttcn3 +++ /dev/null @@ -1,126 +0,0 @@ -/** - * @author ETSI / STF422_EETS - * @version $URL$ - * $Id$ - * @desc Types and constants definitions for Fast Service Advertisement Protocol (ISO 24102-4) - */ -module LibItsFsap_TypesAndValues { - - // LibCommon - - // LibIts - - // LibItsCalm - import from CALMiitsscu language "ASN.1:1997" { - type - McmdRq - }; - import from CALMllsap language "ASN.1:1997" { - type - INsapPrimitivesUp - }; - import from CALMmsap language "ASN.1:1997" { - type - FAsapPrimitivesUp, FAsapPrimitivesDown, - MF_Command_request, MF_Request_request - }; - import from CALMfntp language "ASN.1:1997" { - type - NFsapPrimitivesDown, NFsapPrimitivesUp - }; - import from CALMfsap language "ASN.1:1997" { - type - SAM - }; - - /** - * @desc UpperTester primitives - */ - group utPrimitives { - - /** - * @desc Trigger to initialize the IUT. - */ - type record UtFsapInitialize { - McmdRq mcmdRq - } with { - encode (mcmdRq) "LibItsIicp_asn1" - } - - /** - * @desc Events at the application layer of the IUT. - */ - type union UtFsapEvent { - FAsapPrimitivesDown faSapPrimitivesDown - } - with { - encode (faSapPrimitivesDown) "LibItsCALMmsap_asn1" - } - - /** - * @desc Send a MF-SAP primitive from Facility layer through a SAP. - * @member faSapPrimitivesUp MF-SAP up primitive - */ - type union UtFsapEventInd { - FAsapPrimitivesUp faSapPrimitivesUp - } - with { - encode (faSapPrimitivesUp) "LibItsCALMmsap_asn1" - } - - } with { - encode "UpperTester" - } // End of group utPrimitives - - /** - * @desc ConfigTester primitives - */ - group cfPrimitives { - - /** - * @desc Trigger to initialize the IUT. - * @member McmdRq MN-COMMAND-Request message to initialize the upper tester - */ - type record CfFsapInitialize { - } - - /** - * @desc Send a MA-SAP.request primitive to the Management layer through a SAP. - * @member mnRequestRequest MN_REQUEST_Request primitive - */ - type union CfFsapEventInd { - MF_Request_request mfRequestRequest - } - with { - encode (mfRequestRequest) "LibItsCALMmsap_asn1" - } - - } with { - encode "ConfigTester" - } // End of group cfPrimitives - - /** - * @desc Test Adapter control primitives - */ - group acPrimitives { - - /** - * @desc TA primitives for FSAP - */ - type union AcFsapPrimitive { - INsapPrimitivesUp inSapPrimitivesUp, - boolean stopTransmission - } - with { - encode (inSapPrimitivesUp) "LibItsCALMllsap_asn1" - encode "AdapterControl" - } - - } with { - encode "AdapterControl" - }// End of group acPrimitives - -} -with { - encode "LibItsFsap" -} //End of module LibItsFsap_TypesAndValues \ No newline at end of file diff --git a/ttcn/CALM/IICP/LibItsIicp_Functions.ttcn3 b/ttcn/CALM/IICP/LibItsIicp_Functions.ttcn3 deleted file mode 100644 index 13739205..00000000 --- a/ttcn/CALM/IICP/LibItsIicp_Functions.ttcn3 +++ /dev/null @@ -1,614 +0,0 @@ -/** - * @author ETSI / STF422_EETS - * @version $URL$ - * $Id$ - * @desc Inter-ITS-SCU communications (ISO 24102-4) functions - */ -module LibItsIicp_Functions { - - // LibCommon - import from LibCommon_Sync all; - import from LibCommon_Time { - function f_sleep, f_sleepIgnoreDef - }; - import from LibCommon_BasicTypesAndValues { - const - c_uInt8Max; - }; - import from LibCommon_Sync { - function - f_selfOrClientSyncAndVerdict, f_selfOrClientSyncAndVerdictPreamble - }; - import from LibCommon_VerdictControl all; - - // LibIts - - // LibItsCalm - import from CALMllsap language "ASN.1:1997" { - type - Link_ID, Errors - }; - import from CALMmsap language "ASN.1:1997" { - type - MF_Request_confirm, - WakeUp, RegReq, StateCInotify, - LDMregister - }; - import from CALMmanagement language "ASN.1:1997" { - type - ITS_scuId, Talive - }; - import from CALMiitsscu language "ASN.1:1997" { - type - IIC_Request, IIC_Response, - SimUt, - ITS_SCUtype, ITS_SCUalive, - VCI_Info, VCI_info_res, VCI_update_req - }; - import from CALMfntp language "ASN.1:1997" { - type SetNotFNTP, DeleteFNTP - }; - import from LibItsMgt_TypesAndValues { - type IParamNoList, IParamList - }; - import from LibItsMgt_Functions { - function - f_getIutSourceItsScuId, f_getIutDestItsScuId, - f_getNextPduCounter - }; - import from LibItsIicp_TypesAndValues all; - import from LibItsIicp_Templates all; - import from LibItsIicp_Pics { - modulepar PICS_ITS_MGT_NOT - }; - import from LibItsIicp_Pixits all; - import from LibItsCalm_Interface { - type - UtInitialize, CfInitialize, CfEventInd, - UtResult, CfResult, - ItsCalm - }; - - /** - * @desc Upper tester functions - */ - group utFunctions { - - /** - * @desc Requests to bring the IUT in an initial state - * @param p_utInitialize The initialisation to trigger. - * @verdict Unchanged on success, fail on error and inconc otherwise - */ - function f_utIicpInitializeIut(template (value) UtInitialize p_utInitialize) runs on ItsCalm { - - utPort.send(p_utInitialize); - tc_wait.start; - alt { - [] utPort.receive(UtResult:true) { - tc_wait.stop; - log("*** f_utIicpInitializeIut: INFO: IUT initialized ***"); - } - [] utPort.receive { - tc_wait.stop; - log("*** f_utIicpInitializeIut: INFO: IUT could not be initialized ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_wait.timeout { - log("*** f_utIicpInitializeIut: INFO: IUT could not be initialized in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [else] { // Shortcut defaults - //f_sleep(0.050); // 50 ms - repeat; - } - } // End of 'alt' statement - - } // End of function f_utIicpInitializeIut - - /** - * @desc Send a NFsapPrimitivesDown primitive and wait for the NFsapPrimitivesUp confirm response - * @param p_utIicpEvent The NFsapPrimitivesDown request - * @param p_utIicpEventInd The NFsapPrimitivesDown response - * @param p_discard Set to true if responses shall be discard, otherwise the function failed - * @param p_result The response value - * @verdict Unchanged on success, fail on error and inconc otherwise - */ - function f_utIicpEventResponse( - in template (value) UtIicpEvent p_utIicpEvent, - in template (present) UtIicpEventInd p_utIicpEventInd, - in boolean p_discard, - out UtIicpEventInd p_result) - runs on ItsCalm { - -// log("*** f_utIicpEventResponse: INFO: Send message: ", p_commandReq, " ***"); - utPort.send(p_utIicpEvent); -// log("*** f_utIicpEventResponse: INFO: Expected UtCommandConfirm: ", p_commandConf, " ***"); - tc_wait.start; - alt { - [] utPort.receive(p_utIicpEventInd) -> value p_result { -// log("*** f_utIicpEventResponse: INFO: Receive expected confirm: message ***"); - tc_wait.stop; - } - [] utPort.receive(UtIicpEventInd:? ) -> value p_result { - if (p_discard == false) { - tc_wait.stop; - log("*** f_utIicpEventResponse: ERROR: Event not correctly indicated at application layer ***", p_result); - f_selfOrClientSyncAndVerdict("fail", e_error); - } - else { - log("*** f_utIicpEventResponse: INFO: Another event indicated at application layer, repeating check ***"); - repeat; - } - } - [] tc_wait.timeout { - if (p_discard == false) { - log("*** f_utIicpEventResponse: ERROR: Timeout while waiting for event check result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - else { - log("*** f_utIicpEventResponse: INFO: Event not indicated at application layer ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - } // End of 'alt' statement - - } // End of function f_utIicpEventResponse - - /** - * @desc Send a NFsapPrimitivesDown primitive and do not wait for the NFsapPrimitivesDown confirm response - * @param p_utIicpEvent The NFsapPrimitivesDown primitive - * @verdict Unchanged on success, fail otherwise - */ - function f_utIicpEvent( - in template (value) UtIicpEvent p_utIicpEvent - ) runs on ItsCalm { - utPort.send(p_utIicpEvent); - } // End of function f_utIicpEvent - - } // End of group utFunctions - - /** - * @desc Test trigger function - */ - group whenFunctions { - - /** - * @desc Send a IIC-Request primitive - * @param p_IIC_Request The IIC-Request primitive - * @verdict Unchanged on success, fail otherwise - */ - function f_iicpEvent_IIC_Request( - in template (value) IIC_Request p_IIC_Request - ) runs on ItsCalm { - iicpPort.send( - m_iicpReq( - p_IIC_Request - )); - } // End of function f_iicpEvent_IIC_Request - - /** - * @desc Send a IIC-Request primitive - * @param p_IIC_Request The IIC-Request primitive - * @verdict Unchanged on success, fail otherwise - */ - function f_iicpEvent_IIC_Response( - in template (value) IIC_Response p_IIC_Response - ) runs on ItsCalm { - iicpPort.send( - m_iicpResp( - p_IIC_Response - )); - } // End of function f_iicpEvent_IIC_Response - - } // End of group whenFunctions - - /** - * @desc Test adapter setting functions - */ - group iicpConfigurationFunctions { - - /** - * @desc This configuration features: - *
  • Host and Router are combined (see ISO/WD 29281-2 - Figure 1 - Implementation architecture I)
  • - *
  • MGT1 IISC Port (IISC/LAN) is used if specified
  • - */ - function f_cf01Up() runs on ItsCalm { - - // Map - map(self:utPort, system:utPort); - map(self:iicpPort, system:iicpPort); - - // Connect - f_connect4SelfOrClientSync(); - - // Set processing on shutdown - activate(a_cf01Down()); - - // Initialize the component - f_initialiseComponent("cf01Up"); - - // Initialze the IUT - f_initialState(); - - } // End of function f_cf01Up - - /** - * @desc Deletes configuration cf01 - */ - function f_cf01Down() runs on ItsCalm { - - deactivate; - - // Unmap - unmap(self:utPort, system:utPort); - unmap(self:iicpPort, system:iicpPort); - - // Disconnect - f_disconnect4SelfOrClientSync(); - - } // End of f_cf01Down - - /** - * @desc Behavior function for initializing component's variables and tables - * @param p_componentName Name of the component - * @param p_iicpMGM Set to true if IISC port shall be used - */ - function f_initialiseComponent(in charstring p_componentName) runs on ItsCalm { - - // Initialize variables - - // Set defaults - activate(a_iicpDefault()); - - } // end f_initialiseComponent - - } // End of group iicpConfigurationFunctions - - group functions { - - } // End of group functions - - group messagesTriggering { - - /** - * @desc Triggers a request command event in the test system adaptation. - * @param p_rCmd The remote commad to trigger - * @return FncRetCode - */ - function f_sendAliveMessage( - in ITS_scuId p_scuIdSource, - in ITS_scuId p_scuIdDest, - in template (value) ITS_SCUalive p_scuAlive - ) runs on ItsCalm { - iicpPort.send( - m_iicpReq( - m_iicRequest( - p_scuIdSource, // The ITS SCU-ID of the sender - p_scuIdDest, - f_getNextPduCounter(), - m_pduRequest_scuAlive( - p_scuAlive - ) - ) - ) - ); - - } // End of function f_sendAliveMessage - - } // End of group messagesTriggering - - group iicpAltsteps { - - /** - * @desc Trap for not processed IICP message. - * @verdict Set to fail on unknown message - */ - altstep a_iicpDefault() runs on ItsCalm { - [] iicpPort.receive( - mw_iicpIndReq( - mdw_iicRequestTx_scuAlive( - ?, - 65535, - mw_scuAlive( - ?, - ? - )))) { - log("*** a_iicpDefault: INFO: Broadcasted Alive message, skip it and repeat ***"); - repeat; - } - [] iicpPort.receive(mw_iicpIndReq(mw_iicpRequest_any)) { // Receive any IIC-Request message - log("*** a_iicpDefault: INFO: Remote IIC-Request command service primitive received in default ***"); - repeat; - } - [] iicpPort.receive(mw_iicpIndResp(mw_iicpResponse_any)) { // Receive any IIC-Response message - log("*** a_iicpDefault: INFO: Remote IIC-Response command service primitive received in default ***"); - repeat; - } - [] iicpPort.receive { // Receive unknown message - log("*** a_iicpDefault: ERROR: event received on IICP port in default ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_wait.timeout { - log("*** a_iicpDefault: ERROR: Timeout while awaiting reaction of the IUT prior to Upper Tester action ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] tc_ac.timeout { - log("*** a_iicpDefault: ERROR: Timeout while awaiting the reception of a message ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] any timer.timeout { - log("*** a_iicpDefault: INCONC: An unknown timer has expired in default ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] a_shutdown() { - f_poDefault(); - log("*** a_iicpDefault: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - if(self == mtc) { - f_cf01Down(); - } - stop; - } - } // End of altstep a_iicpDefault - - /** - * @desc Default handling cf01 de-initialisation. - */ - altstep a_cf01Down() runs on ItsCalm { - [] a_shutdown() { - f_poDefault(); - f_cf01Down(); - log("*** a_cf01Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } // End of altstep a_cf01Down() - - } // End of group iicpAltsteps - - group preamble { - - /** - * @desc Brings the IUT into an initial state. - */ - function f_initialState() runs on ItsCalm { - - if (PICS_ITS_MGT_NOT == true) { - f_utIicpInitializeIut(m_utIicpInitialize_with_management); - } else { - f_utIicpInitializeIut(m_utIicpInitialize_without_management); - } -// f_cfIicpInitialize(m_cfIicpInitialize); - f_sleepIgnoreDef(PX_WAIT_FOR_IUT_READY); // Wait until the IUT is in a stable situation (beaconing...) - cfPort.clear; // Because TestConfigIICP should trigger management port deletion message - } // End of function f_initialState - - } // End of group preamble - - group postambles { - - /** - * @desc The default postamble. - */ - function f_poDefault() runs on ItsCalm { - // Nothing to do - } // End of function f_poDefault - - } // End of group postambles - - group adapterControl { - - } // End of group adapterControl - - group testerFunctions { - - /** - * @desc matches a record of values if, and only if, the record of values contains at least all of the elements defined within the SuperSet, and may contain more. - * @param p_vciInfoRes Received datas to be checked - * @param p_baseTemplate Template to be matched - * @return true on matching, false otherwise - * @verdict Unchanged - * @see ETSI ES 201 873-1 V4.3.1 (2011-06) - */ - function f_superset_VCI_Info(in VCI_info_res p_vciInfoRes, in template (present) VCI_Info p_baseTemplate) return boolean { - var integer v_counter; - - for (v_counter := 0; v_counter < lengthof(p_vciInfoRes); v_counter := v_counter + 1) { - if (match(p_vciInfoRes[v_counter], p_baseTemplate)) { - return true; - } - } // End of 'for' statement - - return false; - } - - /** - * @desc matches a record of values if, and only if, the record of values contains at least all of the elements defined within the SuperSet, and may contain more. - * @param p_vciInfoRes Received datas to be checked - * @param p_baseTemplate Template to be matched - * @return true on matching, false otherwise - * @verdict Unchanged - * @see ETSI ES 201 873-1 V4.3.1 (2011-06) - */ - function f_superset_VCI_Update(in VCI_update_req p_vciUpdate, in template (present) VCI_Info p_baseTemplate) return boolean { - var integer v_counter; - - for (v_counter := 0; v_counter < lengthof(p_vciUpdate); v_counter := v_counter + 1) { - if (match(p_vciUpdate[v_counter], p_baseTemplate)) { - return true; - } - } // End of 'for' statement - - return false; - } - - } // End of group testerFunctions - - group iutFunctions { - - /** - * @desc Get the active VCI link identifier - * @return The active VCI link identifier - * @see PX_ACTIVE_VCI_LINK_ID - */ - function f_getIutCiLinkId() return Link_ID { - return PX_ACTIVE_VCI_LINK_ID; - } - - /** - * @desc Gets the Local/source ITS scuID - * @return The Local/source ITS scuID - * @see PX_LOCAL_ITS_SCU_ID - * @see ISO/WD 24102-4 - Table 2 — ITS-SCU-ID value assignment - */ - function f_getIutLocalItsScuId() return ITS_scuId { - return PX_LOCAL_ITS_SCU_ID; - } - - /** - * @desc Get the type of ITS-SCU in the "Data" element - * @return The type of ITS-SCU in the "Data" element - * @see PX_SRC_ITS_SCU_TYPE - */ - function f_getIutSourceItsScuType() return ITS_SCUtype { - return PX_SRC_ITS_SCU_TYPE; - } - - - /** - * @desc Gets the type ITS scuID - * @return The type ITS scuID - * @see PX_LOCAL_ITS_TYPE - * @see ISO/WD 24102-4 - Table 2 — ITS-SCU-ID value assignment - */ - function f_getIutLocalItsType() return ITS_SCUtype { - return PX_LOCAL_ITS_TYPE; - } - - /** - * @desc Gets the Alive timer - * @return The Alive timer - * @see PX_TALIVE - */ - function f_getIutTalive() return Talive { - return PX_TALIVE; - } - - /** - * @desc Gets the Talive retransmit timer. - * @return Talive retransmit timer - * @see PX_TALIVE - */ - function f_getIutTaliveRetransmitTimer() return float { - return 0.9 * int2float(PX_TALIVE); // 90%; - } - - /** - * @desc Gets the maximum Talive jitter. - * @return Maximum Talive jitter - * @see PICS_SAM_RETRANSMIT_TIMER - */ - function f_getIutTaliveMaxJitter() return float { - return 1.1 * int2float(PX_TALIVE); // 110%; - } - - /** - * @desc Get the MI-Command value used for remote command - * @return The MI-Command value used for remote command - * @see PX_MI_RCMD_STATECINOTIFY - */ - function f_getIutRemoteCmdForMiCommand() return WakeUp { - return PX_MI_RCMD_STATECINOTIFY; - } - - /** - * @desc Get the MI-Request value used for remote command - * @return The MI-Request value used for remote command - * @see PX_MI_RCMD_REGTYPE - */ - function f_getIutRemoteCmdForMiRequest() return RegReq { - return PX_MI_RCMD_REGTYPE; - } - - /** - * @desc Get the Link_ID value used for remote command - * @return The MI-Request value used for remote command - * @see PX_MI_RCMD_REGTYPE - */ - function f_getIutRemoteCmdForMiRequestLinkID() return Link_ID { - return PX_MI_RCMD_LINKID; - } - - /** - * @desc Get the MM-Command value used for remote command - * @return The MM-Command value used for remote command - * @see PX_MN_RCMD_STATECINOTIFY - */ - function f_getIutRemoteCmdForMnCommand() return DeleteFNTP { - return PX_MN_RCMD_FWTDELETEFNTP; - } - - /** - * @desc Get the MM-Request value used for remote command - * @return The MN-Request value used for remote command - * @see PX_MN_RCMD_FWYSETNOTIFY - */ - function f_getIutRemoteCmdForMnRequest() return SetNotFNTP { - return PX_MN_RCMD_FWYSETNOTIFY; - } - - /** - * @desc Get the MF-Command value used for remote command - * @return The MF-Command value used for remote command - * @see PX_MF_RCMD_STATECINOTIFY - */ - function f_getIutRemoteCmdForMfCommand() return StateCInotify { - return PX_MF_RCMD_STATECINOTIFY; - } - - /** - * @desc Get the MF-Request value used for remote command - * @return The MF-Request value used for remote command - * @see PX_MF_RCMD_LDM_REGISTER - */ - function f_getIutRemoteCmdForMfRequest() return LDMregister { - return PX_MF_RCMD_LDM_REGISTER; - } - - /** - * @desc Get the List of reference number of parameter to be monitored - * @return The List of reference number of parameter to be monitored - * @see PX_MI_IPARAMNOLIST - */ - function f_getIutIparamNoList() return IParamNoList { - return PX_MI_IPARAMNOLIST; - } - - /** - * @desc Get the list of error status for each parameter to be monitored - * @return The list of error status for each parameter to be monitored - * @see PX_MI_IPARAMNOLIST - */ - function f_getIutIparamList() return IParamList { - return PX_MI_IPARAMLIST; - } - - /** - * @desc Get the list of error status for each parameter to be monitored - * @return The list of error status for each parameter to be monitored - * @see PX_MI_ERRORSLIST - */ - function f_getIutErrorsList() return Errors { - return PX_MI_ERRORSLIST; - } - - /** - * @desc Get a IIC-Response value - * @return The IIC-Response value - * @see PX_IIC_RESPONSE - */ - function f_getIutIicResponse() return MF_Request_confirm { - return PX_IIC_RESPONSE; - } - - } // End of group iutFunctions - -} // End of module LibItsIicp_Functions \ No newline at end of file diff --git a/ttcn/CALM/IICP/LibItsIicp_Pics.ttcn3 b/ttcn/CALM/IICP/LibItsIicp_Pics.ttcn3 deleted file mode 100644 index bab6bfb6..00000000 --- a/ttcn/CALM/IICP/LibItsIicp_Pics.ttcn3 +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @author ETSI / STF422_EETS - * @version $URL$ - * $Id$ - * @desc Fast service advertisement protocol (ISO 24102-5) PICS - */ -module LibItsIicp_Pics { - - /** - * @desc IICP PICS - */ - group iicpPics { - - /** - * @desc Is IUT an host only? - * @see ETSI TS 102 797-1 v0.0.0 C.5/1 - */ - modulepar boolean PICS_ROLE_RONLY := false; - - /** - * @desc Is IUT a router only? - * @see ETSI TS 102 797-1 v0.0.0 C.5/2 - */ - modulepar boolean PICS_ROLE_HONLY := false; - - /** - * @desc Is IUT both host and router? - * @see ETSI TS 102 797-1 v0.0.0 C.5/3 - */ - modulepar boolean PICS_ROLE_RH := false; - - /** - * @desc Does the architecture implement ITS station-internal network? - * @see ETSI TS 102 797-1 v0.0.0 C.6/1 - */ - modulepar boolean PICS_ITS_S_INW := false; - - /** - * @desc Is IISC available? - * @see ISO/WD 24102-4 - */ - modulepar boolean PICS_IICP_MGM := true; - - /** - * @desc Is IUT support notification to the ITS Management layer - * @see ETSI TS 102 985-1 v1.1.2 A.6/3 - */ - modulepar boolean PICS_ITS_MGT_NOT := false; - - } // End of group iicpPics - -} // End of module LibItsIicp_Pics \ No newline at end of file diff --git a/ttcn/CALM/IICP/LibItsIicp_Pixits.ttcn3 b/ttcn/CALM/IICP/LibItsIicp_Pixits.ttcn3 deleted file mode 100644 index 318e0567..00000000 --- a/ttcn/CALM/IICP/LibItsIicp_Pixits.ttcn3 +++ /dev/null @@ -1,223 +0,0 @@ -/** - * @author ETSI / STF422_EETS - * @version $URL$ - * $Id$ - * @desc Inter-ITS-SCU communications (ISO 24102-4) Pixits - */ -module LibItsIicp_Pixits { - - // LibCommon - import from LibCommon_DataStrings { - type Bit4 - }; - - // LibIts - import from CALMllsap language "ASN.1:1997" { - type - Link_ID, CIstatus, MedType, Errors - }; - import from CALMmsap language "ASN.1:1997" { - type - MF_Command, MN_Command, MI_Command, - MF_Request, MN_Request, MI_Request, - MF_Request_confirm, - WakeUp, RegReq, StateCInotify, LDMregister - }; - import from CALMmanagement language "ASN.1:1997" { - type - ITS_scuId, Talive - }; - import from CALMiitsscu language "ASN.1:1997" { - type ITS_SCUtype - }; - import from CALMfntp language "ASN.1:1997" { - type - PortNumber, - SetNotFNTP, DeleteFNTP - }; - import from LibItsMgt_TypesAndValues { - type IParamNoList, IParamList - }; - - /** - * @desc Defines the active CI link identifier - */ - modulepar Link_ID PX_ACTIVE_VCI_LINK_ID := { - remoteCIID := '0000000000000000'O, - localCIID := '0000000000000000'O - }; - - /** - * @desc ITS-SCU-ID of the source ITS-SCU which produces the request - */ - modulepar ITS_scuId PX_SRC_ITS_SCU_ID := 5; - - /** - * @desc ITS_SCUtype of the source ITS-SCU which produces the request - */ - modulepar ITS_SCUtype PX_SRC_ITS_SCU_TYPE := 2; // router - - /** - * @desc ITS-SCU-ID of the destination ITS-SCU which shall evaluate the request - */ - modulepar ITS_scuId PX_DST_ITS_SCU_ID := 0; - - /** - * @desc The own ITS scuID - * @see ISO/WD 24102-4 - Table 2 — ITS-SCU-ID value assignment - */ - modulepar ITS_scuId PX_LOCAL_ITS_SCU_ID := 8; - - /** - * @desc The type ITS scuID - * @see ISO/WD 24102-4 - Table 2 — ITS-SCU-ID value assignment - */ -// modulepar ITS_SCUtype PX_LOCAL_ITS_TYPE := 1; // ITS_SCUtype_host_ - modulepar ITS_SCUtype PX_LOCAL_ITS_TYPE := 255; // any - broadcast address - - /** - * @desc Host ITS-SCU-ID - */ - modulepar ITS_scuId PX_HOST_SCU_ID := 0; - - /** - * @desc Alive timer - */ - modulepar Talive PX_TALIVE := 5000; - - /** - * Wait until the IUT is in a stable situation (beaconing...) - */ - modulepar float PX_WAIT_FOR_IUT_READY := 1.0; - - /** - * @desc MI-Command value used for IICP/COM/xx TPs - * NOTE that this PIXIT is used just for compiling purposes. The real PIXIT shall be written according to the IUT capabilities - */ - modulepar WakeUp PX_MI_RCMD_STATECINOTIFY := 10; - - /** - * @desc MN-Command value used for IICP/COM/xx TPs - * NOTE that this PIXIT is used just for compiling purposes. The real PIXIT shall be written according to the IUT capabilities - */ - modulepar DeleteFNTP PX_MN_RCMD_FWTDELETEFNTP := { - reference := 10 - } - - /** - * @desc MN-Request value used for IICP/COM/xx TPs - * NOTE that this PIXIT is used just for compiling purposes. The real PIXIT shall be written according to the IUT capabilities - */ - modulepar SetNotFNTP PX_MN_RCMD_FWYSETNOTIFY := { - reference := 0, - remotePort := { - portLong := 12345 - }, - linkID := { - remoteCIID := '0000000000000000'O, - localCIID := '0000000000000000'O - }, - ciStatus := 0, - linkPort := { - portShort := 0 - }, - serviceInfo := { - servicePort := { - portShort := 0 - }, - hostITSscu := 0, - servicePriority := 0 - }, - priority := 0, - timeout_ := 0 - } - - /** - * @desc MI-Request value used for IICP/COM/xx TPs - * NOTE that this PIXIT is used just for compiling purposes. The real PIXIT shall be written according to the IUT capabilities - */ - modulepar RegReq PX_MI_RCMD_REGTYPE := { - medType := 10 // FIXME Check why TTWB does not accespt MedType_iso17515_ - } - - /** - * @desc Link-ID used for remote command - * NOTE that this PIXIT is used just for compiling purposes. The real PIXIT shall be written according to the IUT capabilities - */ - modulepar Link_ID PX_MI_RCMD_LINKID := { - remoteCIID := '0000000000000000'O, - localCIID := '0000000000000000'O - } - - /** - * @desc MF-Command value used for IICP/COM/xx TPs - * NOTE that this PIXIT is used just for compiling purposes. The real PIXIT shall be written according to the IUT capabilities - */ - modulepar StateCInotify PX_MF_RCMD_STATECINOTIFY := { - linkId := { - remoteCIID := '0000000000000000'O, - localCIID := '0000000000000000'O - }, - cIstatus := 8 - } - - /** - * @desc MF-Command value used for IICP/COM/xx TPs - * NOTE that this PIXIT is used just for compiling purposes. The real PIXIT shall be written according to the IUT capabilities - */ - modulepar LDMregister PX_MF_RCMD_LDM_REGISTER := { - iTS_scuId := 0, - reference := ''O - } - - /** - * @desc List of reference number of parameter to be monitored - * NOTE that this PIXIT is used just for compiling purposes. The real PIXIT shall be written according to the IUT capabilities - * @see ISO 21218 Table A.1 — I parameters - */ - modulepar IParamNoList PX_MI_IPARAMNOLIST := { - 0, // AuxiliaryChannel - 1 // ControlChannel - } - - /** - * @desc List of error status for each parameter to be monitored - * NOTE that this PIXIT is used just for compiling purposes. The real PIXIT shall be written according to the IUT capabilities - * @see ISO 21218 Table A.1 — I parameters - */ - modulepar IParamList PX_MI_IPARAMLIST := { - { - paramNo := 0, - parameter := { - Errors := { - { - paramNo := 0, - errStatus := 0 - } - } - } // End of 'errors' list - } // End of list of 'IParamList' list - } - /** - * @desc List of errors - * NOTE that this PIXIT is used just for compiling purposes. The real PIXIT shall be written according to the IUT capabilities - * @see ISO 21218 Clause A.2.53 Errors (I-Param.No=255) - */ - modulepar Errors PX_MI_ERRORSLIST := { - { - paramNo := 0, - errStatus := 0 - } // End of SingleError list - } - - /** - * @desc Error status in response of MF-REQUEST.request service primitive - */ - modulepar MF_Request_confirm PX_IIC_RESPONSE := { - commandRef := 1, - ref := 9, - reqConfirm_param := {ITS_scuId := 0}, - errStatus := 0 - } // End of modulepar PX_IIC_RESPONSE - -} // End of module LibItsIicp_Pixits diff --git a/ttcn/CALM/IICP/LibItsIicp_Templates.ttcn3 b/ttcn/CALM/IICP/LibItsIicp_Templates.ttcn3 deleted file mode 100644 index a3ecbeff..00000000 --- a/ttcn/CALM/IICP/LibItsIicp_Templates.ttcn3 +++ /dev/null @@ -1,1762 +0,0 @@ -/** - * @author ETSI / STF422_EETS - * @version $URL$ - * $Id$ - * @desc Templates definitions for Inter-ITS-SCU communications (ISO 24102-4) - */ -module LibItsIicp_Templates { - - // LibCommon - import from LibCommon_BasicTypesAndValues { - type - UInt8, UInt16; - }; - - // LibIts - - // LibItsCalm - import from CALMiitsscu language "ASN.1:1997" { - type - McmdRs, TestConfigIICP, - IIC_Request, IICrequestTX, IICrequestRX, - IIC_Response, IICresponseTX, IICresponseRX, - PduRequest, PduResponse, - PduCounter, - McmdRq, - SimUt, - ITS_SCUalive, ITS_SCUtype, AliveMessage, - VCI_info_req, VCI_info_res, VCI_update_req, VCI_Info, - PduErrStatus - }; - import from CALMmanagement language "ASN.1:1997" { - type ITS_scuId - }; - // FIXME Why ErrStatus not found? - import from CALMllsap language "ASN.1:1997" all;/*{ - type - ErrStatus, - MedType , CIaClass, CIclass, CIstatus - };*/ - import from CALMmsap language "ASN.1:1997" all; - import from CALMfntp language "ASN.1:1997" { - type PortNumber - }; - import from LibItsIicp_TypesAndValues { - type - UtIicpEvent, UtIicpEventInd - }; - import from LibItsCalm_Pixits { - modulepar - PX_LOC_ITS_IICP_ACCESS_SETTINGS_MX_SAP_SET, PX_LOC_ITS_IICP_ACCESS_SETTINGS_MX_SAP_UNSET, - PX_IUT_LOWER_LAYER_USED, PX_IUT_LOWER_LAYER_UNUSED, - PX_IUT_TEST_MODE_ON - }; - import from LibItsMgt_Templates { - template - mw_mfCommandRequest_any - }; - import from LibItsMgt_Functions { - function - f_getIutSourceItsScuId, f_getIutDestItsScuId, f_getIutOtherItsScuId - }; - - import from LibItsCalm_Interface { - type - IicpReq, IicpInd, - UtInitialize, CfInitialize - }; - -// TODO Yann Continue code review from here - /** - * @desc ASSN.1 error status definitions - */ - group errorStatusCstes { - - const ErrStatus c_errStatus_success := 0; - - const ErrStatus c_errStatus_unspecFailure := 1; - - } // group errorStatusCstes - - group iicpPrimitives { - - /** - * @desc Send template for Iisc packet (Inter-ITS-SCU communication Primitives) - * @param p_msgOut Inter-ITS-SCU communication packet to send - */ - template (value) IicpReq m_iicpReq( - template (value) IIC_Request p_msgOut - ) := { - msgOut := { - msg_req := p_msgOut - } - } // End of template m_iicpReq - - /** - * @desc Send template for Iisc packet (Inter-ITS-SCU communication Primitives) - * @param p_msgOut Inter-ITS-SCU communication packet to send - */ - template (value) IicpReq m_iicpResp( - template (value) IIC_Response p_msgOut - ) := { - msgOut := { - msg_resp := p_msgOut - } - } // End of template m_iicpResp - - /** - * @desc Send template for Iisc packet (Inter-ITS-SCU communication Primitives) - * @param p_msgInOut Inter-ITS-SCU communication packet to send - */ - template (present) IicpInd mw_iicpIndReq( - template (present) IIC_Request p_msgInReq - ) := { - msgIn := { - msg_req := p_msgInReq - }, - receptionTime := ? - } // End of template mw_iicpIndReq - - template (present) IicpInd mw_iicpIndResp( - template (present) IIC_Response p_msgInResp - ) := { - msgIn := { - msg_resp := p_msgInResp - }, - receptionTime := ? - } // End of template mw_iicpIndResp - - group testIicpConfig { - - /** - * @desc Initializes the IICP IUT including support notification to the Management entity - * See Test System Configuration Access to SUT - */ - template (value) PduRequest m_pduRequest_testIicpConfig := { - reqRef := 9, - iicpReq := { - McmdRq := { - mCmdRef := 255, - mcmd := { - TestConfigIICP := { - location := PX_LOC_ITS_IICP_ACCESS_SETTINGS_MX_SAP_UNSET, - lowerLayers := PX_IUT_LOWER_LAYER_UNUSED, // PX_IUT_LOWER_LAYER_USED - testMode := PX_IUT_TEST_MODE_ON - } - } // End of field 'mcmd' - } // End of field 'McmdRq' - } // End of field 'iicpReq' - } // End of template m_pduRequest_testIicpConfig - - } // End of group testIicpConfig - - group taPrimitives { - - } // End of group taPrimitives - - /** - * @desc MF-SAP service primitives templates - * @see ISO 24102-3 Clause 8.2.2 MF-COMMAND.request - */ - group mfCommandRequest { - - group mfCommandRequestSend { - - /** - * @desc Send template for PduRequest/MF-COMMAND.request - * @param p_mfCommandReq MF-COMMAND.request description - * @see ISO 24102-4 Clause 8.2.1 IIC-Request PDU - */ - template (value) PduRequest m_pduRequest_mfCommandReq( - in template (value) MF_Command_request p_mfCommandReq - ) := { - reqRef := 1, - iicpReq := { MF_Command_request := p_mfCommandReq } - } // End of template m_pduRequest_mfCommandReq - - } // End of group mfCommandRequestSend - - } // End of group mfCommandRequest - - /** - * @desc MF-SAP service primitives templates - * @see ISO 24102-3 Clause 8.2.3 MF-COMMAND.confirm - */ - group mfCommandConfirm { - - group mfCommandConfirmRecv { - - /** - * @desc Send template for PduRequest/MF-COMMAND.confirm - * @param p_mfCommandReq MF-COMMAND.confirm description - * @see ISO 24102-4 Clause 8.2.2 IIC-Response PDU - */ - template (value) PduResponse mw_pduResponse_mfCommandConfirm( - in template (value) MF_Command_confirm p_mfCommandConfirm - ) := { - resRef := 1, - iicpRes := { MF_Command_confirm := p_mfCommandConfirm } - } // End of template mw_pduResponse_mfCommandConfirm - - } // End of group mfCommandConfirmRecv - - } // End of group mfCommandConfirm - - /** - * @desc MF-SAP service primitives templates - * @see ISO 24102-3 Clause 8.3 MF-REQUESTs - */ - group mfRequestRequest { - - group mfRequestRequestSend { - - /** - * @desc Send template for PduRequest/MF-Request.request - * @param p_mf_rreq MF-REQUEST.request mesage description - * @see ISO 24102-4 Clause 8.2.1 IIC-Request PDU - */ -/*FIXME To be removed template (value) PduRequest m_pduRequest_mfRequestRequest( - in template (value) MF_Request_request p_mfReqReq - ) := { - reqRef := 2, - iicpReq := { MF_Request_request := p_mfReqReq } - } // End of template m_pduRequest_mfRequestRequest -*/ - /** - * @desc Send template for PduResponse/MF-Request.confirm - * @param p_mf_rreq MF-REQUEST.confirm mesage description - * @see ISO 24102-4 Clause 8.2.2 IIC-Response PDU - */ - template (value) PduResponse m_pduResponse_mfRequestConfirm( - in template (value) MF_Request_confirm p_mfReqReq - ) := { - resRef := 2, - iicpRes := { MF_Request_confirm := p_mfReqReq } - } // End of template m_pduResponse_mfRequestConfirm - - } // End of group mfRequestRequestSend - - group mfRequestRequestRecv { - - /** - * @desc Receive template for PduRequest/MF-REQUEST.request message - * @param p_mfRequestReq MF-REQUEST.request message description - */ - template (present) PduRequest mw_pduRequest_mfRequestRequest( - in template (present) MF_Request_request p_mfReqReq - ) := { - reqRef := 2, - iicpReq := { MF_Request_request := p_mfReqReq } - } // End of template mw_pduRequest_mfRequestRequest - - /** - * @desc Receive template for MF-REQUEST.request in case of forwarding the IIC-Request PDU to the IICA - * @param p_commandRef Command reference - * @param p_iICrequestRX IICrequestRX message description - * @see ISO 24102-4 Clause 8.3.1 IIC-Request PDU - */ - template (value) MF_Request_request m_mfRequestRequest_iicRequestRx( - in template (value) CommandRef p_commandRef, - in template (value) IICrequestRX p_iicRequestRx - ) := { - commandRef := p_commandRef, - ref := 12, - request_param := { IICrequestRX := p_iicRequestRx } - } // End of template m_mfRequestRequest_iicRequestRx - - } // End of group mfRequestRequestRecv - - } // End of group mfRequestRequest - - /** - * @desc MN-SAP service primitives templates - * @see ISO 24102-3 Clause 7.2 MN-COMMANDs - */ - group mnCommandRequest { - - group mnCommandRequestSend { - - /** - * @desc Receive template for PduRequest/MN-COMMAND.request - * @param p_mnCommandReq MN-COMMAND.request description - * @see ISO 24102-4 Clause 8.2.1 IIC-Request PDU - */ - template (value) PduRequest m_pduRequest_mnCommandReq( - in template (value) MN_Command_request p_mnCommandReq - ) := { - reqRef := 3, - iicpReq := { MN_Command_request := p_mnCommandReq } - } // End of template m_pduRequest_mnCommandReq - - } // End of group mnCommandRequestSend - - group mnCommandRequestRecv { - - /** - * @desc Receive template for PduRequest/MN-COMMAND.request - * @param p_mnCommandReq MN-COMMAND.request description - * @see ISO 24102-4 Clause 8.2.1 IIC-Request PDU - */ - template (present) PduRequest mw_pduRequest_mnCommandReq( - in template (present) MN_Command_request p_mnCommandReq - ) := { - reqRef := 3, - iicpReq := { MN_Command_request := p_mnCommandReq } - } // End of template mw_pduRequest_mnCommandReq - - } // End of group mnCommandRequestRecv - - } // End of group mnCommandRequest - - /** - * @desc MN-SAP service primitives templates - * @see ISO 24102-3 Clause 7.3 MN-REQUESTs - */ - group mnRequestRequest { - - group mnRequestRequestSend { - - /** - * @desc Send template for PduRequest/MN-Request.request - * @param p_mn_rreq MMN-Request-request mesage description - * @see ISO 24102-4 Clause 8.2.1 IIC-Request PDU - */ - template (value) PduRequest m_pduRequest_mnRequestRequest( - in template (value) MN_Request_request p_mnReqReq - ) := { - reqRef := 4, - iicpReq := { MN_Request_request := p_mnReqReq } - } // End of template m_pduRequest_mnRequestRequest - - } // End of group mnRequestRequestSend - - group mnRequestRequestRecv { - - } // End of group mnRequestRequestRecv - - } // End of group mnRequestRequest - - /** - * @desc MI-SAP service primitives templates - * @see ISO 24102-3 Clause 6.4 MN-COMMANDs - */ - group miCommandRequest { - - group miCommandRequestSend { - - /** - * @desc Send template for PduRequest/MI-COMMAND.request - * @param p_miCommandReq MI-COMMAND.request description - * @see ISO 24102-4 Clause 8.2.1 IIC-Request PDU - */ - template (value) PduRequest m_pduRequest_miCommandReq( - in template (value) MI_Command_request p_miCommandReq - ) := { - reqRef := 5, - iicpReq := { MI_Command_request := p_miCommandReq } - } // End of template m_pduRequest_miCommandReq - - } // End of group miCommandRequestSend - - group miCommandRequestRecv { - - /** - * @desc Receive template for PduRequest/MI-COMMAND.request - * @param p_miCommandReq MI-COMMAND.request description - * @see ISO 24102-4 Clause 8.2.1 IIC-Request PDU - */ - template (present) PduRequest mw_pduRequest_miCommandReq( - in template (present) MI_Command_request p_miCommandReq - ) := { - reqRef := 5, - iicpReq := { MI_Command_request := p_miCommandReq } - } // End of template mw_pduRequest_miCommandReq - - } // End of group miCommandRequestRecv - - } // End of group miCommandRequest - - /** - * @desc MI-SAP service primitives templates - * @see ISO 24102-3 Clause 6.2 MI-SETs - * @see ISO 24102-3 Clause 6.3 MI-GETs - */ - group miGetSetRequest { - - group miGetSetRequestSend { - - /** - * @desc Send template for PduRequest/MI-GET.request - * @param p_mi_rget MI-GET.request mesage description - * @see ISO 24102-4 Clause 8.2.1 IIC-Request PDU - */ - template (value) PduRequest m_pduRequest_miGetReq( - in template (value) MI_Get_request p_miReqGet - ) := { - reqRef := 7, - iicpReq := { MI_Get_request := p_miReqGet } - } // End of template m_pduRequest_miGetReq - - /** - * @desc Send template for PduRequest/MI-SET.request - * @param p_mi_rget MI-SET.request mesage description - * @see ISO 24102-4 Clause 8.2.1 IIC-Request PDU - */ - template (value) PduRequest m_pduRequest_miSetReq( - in template (value) MI_Set_request p_miReqSet - ) := { - reqRef := 8, - iicpReq := { MI_Set_request := p_miReqSet } - } // End of template m_pduRequest_miSetReq - - } // End of group miGetSetRequestSend - - } // End of group miGetSetRequest - - /** - * @desc MI-SAP service primitives templates - * @see ISO 24102-3 Clause 6.5 MI-REQUESTs - */ - group miRequestRequest { - - group miRequestRequestSend { - - /** - * @desc Send template for PduRequest/MF-Request.request - * @param p_mi_rreq MI-REQUEST.request mesage description - * @see ISO 24102-4 Clause 8.2.1 IIC-Request PDU - */ - template (value) PduRequest m_pduRequest_miRequestRequest( - in template (value) MI_Request_request p_miReqReq - ) := { - reqRef := 6, - iicpReq := { MI_Request_request := p_miReqReq } - } // End of template m_pduRequest_miRequestRequest - - } // End of group miRequestRequestSend - - group miRequestRequestRecv { - - } // End of group miRequestRequestRecv - - } // End of group miRequestRequest - - /** - * @desc ITS-SCUalive templates - * @see ISO 24102-4 Clause 9.2 ITS-SCU-ID assignment - */ - group aliveMessages { - - group aliveMessagesSend { - - /** - * @desc Send template for IIC-Request PDU ITS-SCUalive message - * @param p_alive ITS_SCUalive message description - * @see ISO 24102-4 Clause 9.2 ITS-SCU-ID assignment - */ - template (value) PduRequest m_pduRequest_scuAlive( - in template (value) ITS_SCUalive p_alive - ) := { - reqRef := 0, - iicpReq := { ITS_SCUalive := p_alive } - } // End of template m_pduRequest_scuAlive - - /** - * @desc Send template for IIC-Request PDU ITS-SCUalive message - * @param p_message The Alive message (new, delete...) - * @param p_its_scuType The type of ITS-SCU in the "Data" element - * @see ISO 24102-4 Table 4 — Error handling procedure for IIC-Response PDU - */ - template (value) ITS_SCUalive m_scuAlive( - in template (value) AliveMessage p_message, - in template (value) ITS_SCUtype p_itsScuType - ) := { - message_ := p_message, - its_scuType := p_itsScuType - } // End of template m_scuAlive_any - - } // End of group aliveMessagesSend - - group aliveMessagesRecv { - - /** - * @desc Receive template for ITS-SCUalive message - * @param p_message The Alive message (new, delete...) - * @param p_its_scuType The type of ITS-SCU in the "Data" element - * @see ISO 24102-4 Table 4 — Error handling procedure for IIC-Response PDU - */ - template ITS_SCUalive mw_scuAlive( - in template (present) AliveMessage p_message, - in template (present) ITS_SCUtype p_itsScuType - ) := { - message_ := p_message, - its_scuType := p_itsScuType - } // End of template mw_scuAlive - - /** - * @desc Receive template for IICrequestTX/SCU-Alive message - * @param p_sourceItsScuId The source ITS-SCU-ID - * @param p_destinationItsScuId The destination ITS-SCU-ID - * @param p_alive The Alive message (new, delete...) - * @see ISO 24102-4 Clause 8.2.1 IIC-Request PDU - */ - template IICrequestTX mdw_iicRequestTx_scuAlive( - in template (present) ITS_scuId p_sourceItsScuId, - in template (present) ITS_scuId p_destinationItsScuId, - in template (present) ITS_SCUalive p_alive - ) modifies mw_iicRequestTx_any := { - sourceITS_scuId := p_sourceItsScuId, - destinationITS_scuId := p_destinationItsScuId, - pduRequest := { - reqRef := 0, - iicpReq := { ITS_SCUalive := p_alive } - } // End of 'pduRequest' field - } // End of template mdw_iicRequestTx_scuAlive - - /** - * @desc Receive template for IICrequestRX/SCU-Alive message - * @param p_sourceItsScuId The source ITS-SCU-ID - * @param p_destinationItsScuId The destination ITS-SCU-ID - * @param p_alive The Alive message (alive, new, delete) - * @see ISO 24102-4 Clause 8.3.1 IIC-Request PDU - * @see ISO 24102-4 Table B.2 — ITS-SCU-id request PDU - */ - template IICrequestRX mdw_iicRequestRx_scuAlive( - in template (present) ITS_scuId p_sourceItsScuId, - in template (present) ITS_scuId p_destinationItsScuId, - in template (present) ITS_SCUalive p_alive - ) modifies mw_iicRequestTx_any := { // WARNING type IIC_Request == IICrequestTX == IICrequestRX; - sourceITS_scuId := p_sourceItsScuId, - destinationITS_scuId := p_destinationItsScuId, - pduRequest := { - reqRef := 0, - iicpReq := { ITS_SCUalive := p_alive } - } // End of 'pduRequest' field - } // End of template mdw_iicRequestRx_scuAlive - - /** - * @desc Receive template for IICresponseTX/SCU-Alive message - * @param p_sourceItsScuId The source ITS-SCU-ID - * @param p_destinationItsScuId The destination ITS-SCU-ID - * @param p_alive The Alive message (new, delete...) - * @param p_errorStatus Error status - * @see ISO 24102-4 Clause 8.2.1 IIC-Request PDU - * @see ISO 24102-4 Table 4 — Error handling procedure for IIC-Response PDU - */ - template IICresponseTX mdw_iicResponseTx_scuAlive( - in template (present) ITS_scuId p_sourceItsScuId, - in template (present) ITS_scuId p_destinationItsScuId, - in template (present) ITS_SCUalive p_alive, - in template (present) PduErrStatus p_errorStatus - ) modifies mw_iicResponseTx_any := { - sourceITS_scuId := p_sourceItsScuId, - destinationITS_scuId := p_destinationItsScuId, - pduResponse := { - resRef := 0, - iicpRes := { ITS_SCUalive := p_alive } - }, // End of 'pduResponse' field - errorStatus := p_errorStatus - } // End of template mdw_iicResponseTx_scuAlive - - } // End of group aliveMessagesRecv - - } // End of group aliveMessages - - /** - * @desc ITS-SCUalive templates - * @see ISO 24102-4 Clause 8.2.1 IIC-Request PDU - * @see ISO 24102-4 Clause B.2.3 VCI-info - */ - group vciInfoReq { - - group vciInfoReqSend { - - /** - * @desc Send template for IIC-Request PDU VCI-info message - * @param p_vCI_info Request to all ITS-SCUs containing a router, to report about existing VCIs. Information to be stored in VCI list - * @see ISO 24102-4 Clause B.2.3 VCI-info - */ - template (value) PduRequest m_pduRequest_vciInfoReq( - in template (value) VCI_info_req p_vciInfo - ) := { - reqRef := 9, - iicpReq := { - McmdRq := { - mCmdRef := 1, - mcmd := { VCI_info_req := p_vciInfo } - } - } - } // End of template m_pduRequest_vciInfoReq - - /** - * @desc Send template for VCI-info-req message - * @param p_medType Indicates requested type of medium as specified in ISO 21218 - * @param p_iciaClass Indicates requested CI access class as specified in ISO 21218 - * @param p_ciClass Indicates requested CI class as specified in ISO 21218 - * @see ISO 24102-4 Table B.4 — VCI-info request PDU - */ - template (value) VCI_info_req m_vciInfoReq( - in template (value) MedType p_medType, - in template (value) CIaClass p_iciaClass, - in template (value) CIclass p_ciClass - ) := { - medType := p_medType, - ciaClass := p_iciaClass, - ciClass := p_ciClass - } // End of template m_vciInfoReq - - } // End of group vciInfoReqSend - - group vciInfoReqSendRecv { - - /** - * @desc Receive template for IICrequestTX/VCI-info message - * @param p_sourceItsScuId The source ITS-SCU-ID - * @param p_destinationItsScuId The destination ITS-SCU-ID - * @param p_vCI_info The VCI-info request - * @see ISO 24102-4 Clause 8.2.1 IIC-Request PDU - */ - template IICrequestRX mdw_iicRequestTx_vciInfoReq( - in template (present) ITS_scuId p_sourceItsScuId, - in template (present) ITS_scuId p_destinationItsScuId, - in template (present) VCI_info_req p_vciInfo - ) modifies mw_iicRequestTx_any := { - sourceITS_scuId := p_sourceItsScuId, - destinationITS_scuId := p_destinationItsScuId, - pduRequest := { - reqRef := 0, - iicpReq := { - PduRequest := { - reqRef := 9, - iicpReq := { - McmdRq := { - mCmdRef := 1, - mcmd := { VCI_info_req := p_vciInfo } - } // End of 'McmdRq' field - } // End of 'iicpReq' field - } // End of 'PduRequest' field - } // End of 'iicpReq' field - } // End of 'pduRequest' field - } // End of template mdw_iicRequestTx_vciInfoReq - - /** - * @desc Receive template for VCI-info-req message - * @param p_medType Indicates requested type of medium as specified in ISO 21218 - * @param p_iciaClass Indicates requested CI access class as specified in ISO 21218 - * @param p_ciClass Indicates requested CI class as specified in ISO 21218 - * @see ISO 24102-4 Table B.4 — VCI-info request PDU - */ - template VCI_info_req mw_vciInfoReq( - in template (present) MedType p_medType, - in template (present) CIaClass p_iciaClass, - in template (present) CIclass p_ciClass - ) := { - medType := p_medType, - ciaClass := p_iciaClass, - ciClass := p_ciClass - } // End of template mw_vciInfoReq - - } // End of group vciInfoReqSendRecv - - } // End of group vciInfoReq - - group vciInfoRes { - - /** - * @desc Receive template for IICresponse/VCI-info message - * @param p_sourceItsScuId The source ITS-SCU-ID - * @param p_destinationItsScuId The destination ITS-SCU-ID - * @param p_vCI_info The VCI-info request - * @see ISO 24102-4 Clause 8.2.1 IIC-Request PDU - */ - template IIC_Response mw_iicpResponse_vciInfoRes( - in template (present) ITS_scuId p_sourceItsScuId, - in template (present) ITS_scuId p_destinationItsScuId, - in template (present) VCI_info_res p_vciInfo - ) modifies mdw_iicpResponse_success := { - sourceITS_scuId := p_sourceItsScuId, - destinationITS_scuId := p_destinationItsScuId, - pduResponse := { - resRef := 9, - iicpRes := { - McmdRs := { - mCmdRef := 1, - mcmd := { VCI_info_res := p_vciInfo } - } // End of 'McmdRq' field - } // End of 'iicpRes' field - } // End of 'pduResponse' field - } // End of template mdw_iicRequestTx_vciInfoReq - - template (value) McmdRs m_mcmdRs_vciInfoRes(in template (value) VCI_info_res p_vciInfoRes) := { - mCmdRef := 1, - mcmd := { VCI_info_res := p_vciInfoRes } - } // End of template m_mcmdRs_vciInfoRes - - template (value) VCI_info_res m_vciInfoRes(in template (value) VCI_Info p_vciInfo) := { - p_vciInfo - } // End of template m_pduRequest_vciInfoReq - - } // End of group vciInfoRes - - group vciInfo { - - group vciInfoSend { - - /** - * @desc Send template for VCI-Info message - * @param p_linkId Link identifier of the CI - * @param p_medType Indicates requested type of medium as specified in ISO 21218 - * @param p_iciaClass Indicates requested CI access class as specified in ISO 21218 - * @param p_ciClass Indicates requested CI class as specified in ISO 21218 - * @param p_status Status of the CI - * @see ISO 24102-4 Table B.6 — VCI-update request PDU - */ - template (value) VCI_Info m_vciInfo( - in template (value) Link_ID p_linkId, - in template (value) MedType p_medType, - in template (value) CIaClass p_iciaClass, - in template (value) CIclass p_ciClass, - in template (value) CIstatus p_status - ) := { - linkId := p_linkId, - medType := p_medType, - ciaClass := p_iciaClass, - ciClass := p_ciClass, - status := p_status - } // End of template m_vciInfo - - } // End of group vciInfoSend - - group vciInfoRecv { - - /** - * @desc Receive template for VCI-info-res message - * @param p_linkId Link identifier of the CI - * @param p_medType Indicates requested type of medium as specified in ISO 21218 - * @param p_iciaClass Indicates requested CI access class as specified in ISO 21218 - * @param p_ciClass Indicates requested CI class as specified in ISO 21218 - * @param p_status Status of the CI - */ - template (present) VCI_Info mw_vciInfo( - in template (present) Link_ID p_linkId, - in template (present) MedType p_medType, - in template (present) CIaClass p_iciaClass, - in template (present) CIclass p_ciClass, - in template (present) CIstatus p_status - ) := { - linkId := p_linkId, - medType := p_medType, - ciaClass := p_iciaClass, - ciClass := p_ciClass, - status := p_status - } // End of template mw_vciInfo - - } // End of group vciInfoRecv - - } // End of group vciInfo - - group vciUpdate { - - group vciUpdateSend { - - /** - * @desc Send template for IIC-Request PDU VCI-update message with an empty update list - * Used for VCI-update request - * @see ISO 24102-4 Clause B.2.4 VCI-update - */ - template (value) PduRequest m_pduRequest_vciUpdateReq_empty := { - reqRef := 9, - iicpReq := { - McmdRq := { - mCmdRef := 2, - mcmd := { VCI_update_req := { } } - } // End of 'McmdRq' field - } // End of 'iicpReq' field - } // End of template m_pduRequest_vciUpdateReq_empty - - /** - * @desc Send template for IIC-Request PDU VCI-update message - * @param p_vCI_update VCI-update message description - * @see ISO 24102-4 Clause B.2.4 VCI-update - */ - template (value) PduRequest m_pduRequest_vciUpdateReq( - in template (value) VCI_Info p_vciInfo - ) modifies m_pduRequest_vciUpdateReq_empty := { - iicpReq := { - McmdRq := { - mcmd := { VCI_update_req := { p_vciInfo } } - } // End of 'McmdRq' field - } // End of 'iicpReq' field - } // End of template m_pduRequest_vciUpdateReq - - } // End of group vciUpdateSend - - group vciUpdateRecv { - - /** - * @desc Receive template for IICrequestTX/SCU-Alive message - * @param p_sourceItsScuId The source ITS-SCU-ID - * @param p_destinationItsScuId The destination ITS-SCU-ID - * @param p_vciUpdate The VCI-update message - * @see ISO 24102-4 Clause 8.2.1 IIC-Request PDU - */ - template (present) IICrequestTX mdw_iicRequestTx_vciUpdate( - in template (present) ITS_scuId p_sourceItsScuId, - in template (present) ITS_scuId p_destinationItsScuId, - in template (present) VCI_update_req p_vciUpdate - ) modifies mw_iicRequestTx_any := { - sourceITS_scuId := p_sourceItsScuId, - destinationITS_scuId := p_destinationItsScuId, - pduRequest := { - reqRef := 0, - iicpReq := { - PduRequest := { - reqRef := 9, - iicpReq := { - McmdRq := { - mCmdRef := 2, - mcmd := { VCI_update_req := p_vciUpdate } - } // End of 'McmdRq' field - } // End of 'iicpReq' field - } // End of 'PduRequest' field - } // End of 'iicpReq' field - } // End of 'pduRequest' field - } // End of template mdw_iicRequestTx_vciUpdate - - } // End of group vciUpdateRecv - - } // End of group vciUpdate - - group iicpTemplates { - - group iicpTemplatesSend { - - template (value) IIC_Request m_iicRequest( - in template (value) ITS_scuId p_sourceItsScuId, - in template (value) ITS_scuId p_destinationItsScuId, - in template (value) PduCounter p_pduCounter, - in template (value) PduRequest p_pduRequest - ) := { - sourceITS_scuId := p_sourceItsScuId, - destinationITS_scuId := p_destinationItsScuId, - pduCounter := p_pduCounter, - requestID := 0, - pduRequest := p_pduRequest, - secRq := { - secRqRef := 0, - secRq := { NullType := NULL } // No security - } // End of field 'secRq' - } // End of template m_iicRequest - - template (value) IIC_Response m_iicResponse( - in template (value) ITS_scuId p_sourceItsScuId, - in template (value) ITS_scuId p_destinationItsScuId, - in template (value) PduCounter p_pduCounter, - in template (value) PduResponse p_pduResponse - ) := { - sourceITS_scuId := p_sourceItsScuId, - destinationITS_scuId := p_destinationItsScuId, - pduCounter := p_pduCounter, - responseID := 1, - pduResponse := p_pduResponse, - secRs := { - secRsRef := 0, - secRs := { NullType := NULL } // No security - } // End of field 'secRq' - } // End of template m_iicResponse - - } // End of group iicpTemplatesSend - - group iicpTemplatesRecv { - - /** - * @desc Unspecified receive template - * Used for: - *
  • modifying restrictif template
  • - *
  • default altstep
  • - * - * @see ISO 24102-4 Clause 7 - * - * Note that all fields are mandatory - */ - template IIC_Request mw_iicpRequest_any := { - sourceITS_scuId := ?, - destinationITS_scuId := ?, - pduCounter := ?, - requestID := 0, - pduRequest := { - reqRef := ?, - iicpReq := ? - }, // End of field 'pduRequest' - secRq := { - secRqRef := 0, // No security - secRq := ? - } // End of field 'secRq' - } // End of template mw_iicpRequest_any - - template (present) IIC_Request mdw_iicRequest_notify( - in template (present) ITS_scuId p_sourceItsScuId, - in template (present) ITS_scuId p_destinationItsScuId, - in template (present) PduCounter p_pduCounter, - in template (present) PduRequest p_pduRequest - ) modifies mw_iicpRequest_any := { - sourceITS_scuId := p_sourceItsScuId, - destinationITS_scuId := p_destinationItsScuId, - pduCounter := p_pduCounter, - requestID := 0, - pduRequest := p_pduRequest - } // End of template mdw_iicRequest_notify - - /** - * @desc Unspecified receive template - * Used for: - *
  • modifying restrictif template
  • - *
  • default altstep
  • - * - * @see ISO 24102-4 Clause 7 - * - * Note that all fields are mandatory - */ - template IIC_Response mw_iicpResponse_any := { - sourceITS_scuId := ?, - destinationITS_scuId := ?, - pduCounter := ?, - responseID := 1, - pduResponse := { - resRef := ?, - iicpRes := ? - }, // End of field 'pduResponse' - errorStatus := ?, - secRs := ? - } // End of template mw_iicpResponse_any - - /** - * @desc Receive template for success response - */ - template IIC_Response mdw_iicpResponse_success - modifies mw_iicpResponse_any := { - errorStatus := c_errStatus_success - } // End of template mdw_iicpResponse_success - - /** - * @desc Unspecified receive template - * Used for: - *
  • modifying restrictif template
  • - *
  • default altstep
  • - * - * @see ISO 24102-4 Clause 7 - * - * Note that all fields are mandatory - */ - template IICresponseTX mw_iicpResponseTx_any := { - sourceITS_scuId := ?, - destinationITS_scuId := ?, - pduCounter := ?, - responseID := 1, - pduResponse := { - resRef := ?, - iicpRes := ? - }, // End of field 'pduResponse' - errorStatus := ?, - secRs := ? - } // End of template mw_iicpResponseTx_any - - /** - * @desc Receive template for success response - */ - template IICresponseTX mdw_iicpResponseTx_success - modifies mw_iicpResponseTx_any := { - errorStatus := c_errStatus_success - } // End of template mdw_iicpResponseTx_success - - } // End of group iicpTemplatesRecv - - group remoteCommands { - - /** - * @desc Unspecified receive template for IICRequestRx service primitive - * Used for: - *
  • modifying restrictif template
  • - */ - template IICresponseRX mw_iicResponseRx_any := { - sourceITS_scuId := ?, - destinationITS_scuId := ?, - pduCounter := ?, - responseID := 1, - pduResponse := { - resRef := ?, - iicpRes := ? - }, // End of field 'pduResponse' - errorStatus := ?, - secRs := { - secRsRef := 0, - secRs := ? - } // End of field 'secRs' - } // End of template mw_iicResponseRx_any - - /** - * @desc Unspecified receive template for IICRequestTx service primitive - * Used for: - *
  • modifying restrictif template
  • - */ - template IICrequestTX mw_iicRequestTx_any := { - sourceITS_scuId := ?, - destinationITS_scuId := ?, - pduCounter := ?, - requestID := 0, - pduRequest := { - reqRef := ?, - iicpReq := ? - }, // End of field 'pduRequest' - secRq := { - secRqRef := 0, - secRq := ? - } // End of field 'secRq' - } // End of template mw_iicRequestTx_any - - /** - * @desc Unspecified receive template for IICResponseTx service primitive - * Used for: - *
  • modifying restrictif template
  • - */ - template IICresponseTX mw_iicResponseTx_any := { - sourceITS_scuId := ?, - destinationITS_scuId := ?, - pduCounter := ?, - responseID := 1, - pduResponse := { - resRef := ?, - iicpRes := ? - }, // End of field 'pduResponse' - errorStatus := ?, - secRs := { - secRsRef := 0, - secRs := ? - } // End of field 'secRs' - } // End of template mw_iicResponseTx_any - - group miCommandsRecv { - - /** - * @desc Receive template for IICrequestTX/remote command message - * @param p_sourceItsScuId The source ITS-SCU-ID - * @param p_destinationItsScuId The other ITS-SCU-ID - * @param p_mi_rcmd The MI-COMMAND.request message - * @see ISO 24102-4 Clause 8.2.1 IIC-Request PDU - */ - template IICrequestTX mdw_iicRequestTx_miCommandRequest( - in template (present) ITS_scuId p_sourceItsScuId, - in template (present) ITS_scuId p_destinationItsScuId, - in template (present) MI_Command_request p_miReqCmd - ) modifies mw_iicRequestTx_any := { - sourceITS_scuId := p_sourceItsScuId, - destinationITS_scuId := p_destinationItsScuId, - pduRequest := { - reqRef := 5, - iicpReq := { MI_Command_request := p_miReqCmd } - } // End of 'pduRequest' field - } // End of template mdw_iicRequestTx_miCommandRequest - - /** - * @desc Receive template for IICresponseTX message with success status - * @param p_sourceItsScuId The source ITS-SCU-ID - * @param p_destinationItsScuId The destination ITS-SCU-ID - * @param p_mi_rcmd The MI-COMMAND.confirm message - * @see ISO 24102-4 Clause 8.2.2 IIC-Response PDU - */ - template IICresponseTX mdw_iicResponseTx_miCommandConfirm( - in template (present) ITS_scuId p_sourceItsScuId, - in template (present) ITS_scuId p_destinationItsScuId, - in template (present) MI_Command_confirm p_miReqCmd - ) modifies mw_iicResponseTx_any := { - sourceITS_scuId := p_sourceItsScuId, - destinationITS_scuId := p_destinationItsScuId, - pduResponse := { - resRef := 5, - iicpRes := { MI_Command_confirm := p_miReqCmd } - }, // End of 'pduRequest' field - errorStatus := c_errStatus_success - } // End of template mdw_iicResponseTx_miCommandConfirm - - /** - * @desc Receive template for IICrequestTX/remote command message - * @param p_sourceItsScuId The source ITS-SCU-ID - * @param p_destinationItsScuId The other ITS-SCU-ID - * @param p_mi_rreq The MI-Request.request message - * @see ISO 24102-4 Clause 8.2.1 IIC-Request PDU - */ - template IICrequestTX mdw_iicRequestTx_miRequestRequest( - in template (present) ITS_scuId p_sourceItsScuId, - in template (present) ITS_scuId p_destinationItsScuId, - in template (present) MI_Request_request p_miReqReq - ) modifies mw_iicRequestTx_any := { - sourceITS_scuId := p_sourceItsScuId, - destinationITS_scuId := p_destinationItsScuId, - pduRequest := { - reqRef := 6, - iicpReq := { MI_Request_request := p_miReqReq } - } // End of 'pduRequest' field - } // End of template mdw_iicRequestTx_miRequestRequest - - /** - * @desc Receive template for IICresponseTX message with success status - * @param p_sourceItsScuId The source ITS-SCU-ID - * @param p_destinationItsScuId The destination ITS-SCU-ID - * @param p_mi_rcmd The MI-COMMAND.confirm message - * @see ISO 24102-4 Clause 8.2.2 IIC-Response PDU - */ - template IICresponseTX mdw_iicResponseTx_miRequestRequest( - in template (present) ITS_scuId p_sourceItsScuId, - in template (present) ITS_scuId p_destinationItsScuId, - in template (present) MI_Request_confirm p_miReqReq - ) modifies mw_iicResponseTx_any := { - sourceITS_scuId := p_sourceItsScuId, - destinationITS_scuId := p_destinationItsScuId, - pduResponse := { - resRef := 6, - iicpRes := { MI_Request_confirm := p_miReqReq } - }, // End of 'pduResponse' field - errorStatus := c_errStatus_success - } // End of template mdw_iicResponseTx_miRequestRequest - - } // End of group miCommands - - group miGetSet { - - /** - * @desc Receive template for IICrequestTX/remote command message - * @param p_sourceItsScuId The source ITS-SCU-ID - * @param p_destinationItsScuId The other ITS-SCU-ID - * @param p_miReqGet The MI-GET.request message - * @see ISO 24102-3 Clause 6.3.1 MI-GET.request - * @see ISO 24102-4 Clause 8.2.1 IIC-Request PDU - */ - template IICrequestTX mdw_iicRequestTx_miGetRequest( - in template (present) ITS_scuId p_sourceItsScuId, - in template (present) ITS_scuId p_destinationItsScuId, - in template (present) MI_Get_request p_miReqGet - ) modifies mw_iicRequestTx_any := { - sourceITS_scuId := p_sourceItsScuId, - destinationITS_scuId := p_destinationItsScuId, - pduRequest := { - reqRef := 7, - iicpReq := { MI_Get_request := p_miReqGet } - } // End of 'pduRequest' field - } // End of template mdw_iicRequestTx_miGetRequest - - /** - * @desc Receive template for IICresponseTX message with success status - * @param p_sourceItsScuId The source ITS-SCU-ID - * @param p_destinationItsScuId The destination ITS-SCU-ID - * @param p_miReqGet The MI-GET.confirm message - * @see ISO 24102-4 Clause 8.2.2 IIC-Response PDU - */ - template IICresponseTX mdw_iicResponseTx_miGetRequest( - in template (present) ITS_scuId p_sourceItsScuId, - in template (present) ITS_scuId p_destinationItsScuId, - in template (present) MI_Get_confirm p_miReqGet - ) modifies mw_iicResponseTx_any := { - sourceITS_scuId := p_sourceItsScuId, - destinationITS_scuId := p_destinationItsScuId, - pduResponse := { - resRef := 7, - iicpRes := { MI_Get_confirm := p_miReqGet } - }, // End of 'pduResponse' field - errorStatus := c_errStatus_success - } // End of template mdw_iicResponseTx_miGetRequest - - /** - * @desc Receive template for IICrequestTX/remote command message - * @param p_sourceItsScuId The source ITS-SCU-ID - * @param p_destinationItsScuId The other ITS-SCU-ID - * @param p_miReqSet The MI-SET.request message - * @see ISO 24102-3 Clause 6.2.1 MI-SET.request - * @see ISO 24102-4 Clause 8.2.1 IIC-Request PDU - */ - template IICrequestTX mdw_iicRequestTx_miSetRequest( - in template (present) ITS_scuId p_sourceItsScuId, - in template (present) ITS_scuId p_destinationItsScuId, - in template (present) MI_Set_request p_miReqSet - ) modifies mw_iicRequestTx_any := { - sourceITS_scuId := p_sourceItsScuId, - destinationITS_scuId := p_destinationItsScuId, - pduRequest := { - reqRef := 8, - iicpReq := { MI_Set_request := p_miReqSet } - } // End of 'pduRequest' field - } // End of template mdw_iicRequestTx_miSetRequest - - /** - * @desc Receive template for IICresponseTX message with success status - * @param p_sourceItsScuId The source ITS-SCU-ID - * @param p_destinationItsScuId The destination ITS-SCU-ID - * @param p_miReqSet The MI-GET.confirm message - * @see ISO 24102-4 Clause 8.2.2 IIC-Response PDU - */ - template IICresponseTX mdw_iicResponseTx_miSetRequest( - in template (present) ITS_scuId p_sourceItsScuId, - in template (present) ITS_scuId p_destinationItsScuId, - in template (present) MI_Set_confirm p_miReqSet - ) modifies mw_iicResponseTx_any := { - sourceITS_scuId := p_sourceItsScuId, - destinationITS_scuId := p_destinationItsScuId, - pduResponse := { - resRef := 8, - iicpRes := { MI_Set_confirm := p_miReqSet } - }, // End of 'pduResponse' field - errorStatus := c_errStatus_success - } // End of template mdw_iicResponseTx_miSetRequest - - /** - * @desc Receive template for IICresponse message with success status - * @param p_sourceItsScuId The source ITS-SCU-ID - * @param p_destinationItsScuId The destination ITS-SCU-ID - * @param p_miCommandConfirm The MI_Command_confirm expected template - * @see ISO 24102-4 Clause 8.2.1 IIC-Request PDU - */ - template IICresponseTX mdw_iicpResponseTx_miCommandConfirm( - in template (present) ITS_scuId p_sourceItsScuId, - in template (present) ITS_scuId p_destinationItsScuId, - in template (present) MI_Command_confirm p_miCommandConfirm - ) modifies mdw_iicpResponseTx_success := { - sourceITS_scuId := p_sourceItsScuId, - destinationITS_scuId := p_destinationItsScuId, - pduResponse := { - resRef := 5, - iicpRes := { MI_Command_confirm := p_miCommandConfirm } - } // End of 'pduResponse' field - } // End of template mdw_iicpResponseTx_miCommandConfirm - - /** - * @desc Receive template for IICresponse message with success status - * @param p_sourceItsScuId The source ITS-SCU-ID - * @param p_destinationItsScuId The destination ITS-SCU-ID - * @param p_miGetConfirm The MI_Get_confirm expected template - * @see ISO 24102-4 Clause 8.2.1 IIC-Request PDU - */ - template IICresponseTX mdw_iicpResponseTx_miGetConfirm( - in template (present) ITS_scuId p_sourceItsScuId, - in template (present) ITS_scuId p_destinationItsScuId, - in template (present) MI_Get_confirm p_miGetConfirm - ) modifies mdw_iicpResponseTx_success := { - sourceITS_scuId := p_sourceItsScuId, - destinationITS_scuId := p_destinationItsScuId, - pduResponse := { - resRef := 7, - iicpRes := { MI_Get_confirm := p_miGetConfirm } - } // End of 'pduResponse' field - } // End of template mdw_iicpResponseTx_miGetConfirm - - /** - * @desc Receive template for IICresponse message with success status - * @param p_sourceItsScuId The source ITS-SCU-ID - * @param p_destinationItsScuId The destination ITS-SCU-ID - * @param p_miSetConfirm The MI_Set_confirm expected template - * @see ISO 24102-4 Clause 8.2.1 IIC-Request PDU - */ - template IICresponseTX mdw_iicpResponseTx_miSetConfirm( - in template (present) ITS_scuId p_sourceItsScuId, - in template (present) ITS_scuId p_destinationItsScuId, - in template (present) MI_Set_confirm p_miSetConfirm - ) modifies mdw_iicpResponseTx_success := { - sourceITS_scuId := p_sourceItsScuId, - destinationITS_scuId := p_destinationItsScuId, - pduResponse := { - resRef := 8, - iicpRes := { MI_Set_confirm := p_miSetConfirm } - } // End of 'pduResponse' field - } // End of template mdw_iicpResponseTx_miSetConfirm - - } // End of group miCommandsRecv - - group mnCommands { - - group mnCommandsSend { - - /** - * @desc TODO - */ - template (value) IICrequestTX m_iicRequestTx_mnRequestRequest( - in template (value) ITS_scuId p_sourceItsScuId, - in template (value) ITS_scuId p_destinationItsScuId, - in template (value) PduCounter p_pduCounter, - in template (value) MN_Request_request p_mnReqReq - ) := { - sourceITS_scuId := p_sourceItsScuId, - destinationITS_scuId := p_destinationItsScuId, - pduCounter := p_pduCounter, - requestID := 0, - pduRequest := { - reqRef := 4, - iicpReq := { MN_Request_request := p_mnReqReq } - }, // End of 'pduRequest' field - secRq := { - secRqRef := 0, - secRq := { NullType := NULL } // No security - } - } // End of template m_iicRequestTx_mnRequestRequest - - } // End of group mnCommandsSend - - group mnCommandsRecv { - - /** - * @desc Receive template for IICrequestTX/remote command message - * @param p_sourceItsScuId The source ITS-SCU-ID - * @param p_destinationItsScuId The other ITS-SCU-ID - * @param p_mnCmdReq The MN-COMMAND.request message - * @see ISO 24102-4 Clause 8.2.1 IIC-Request PDU - */ - template IICrequestTX mdw_iicRequestTx_mnCommandRequest( - in template (present) ITS_scuId p_sourceItsScuId, - in template (present) ITS_scuId p_destinationItsScuId, - in template (present) MN_Command_request p_mnCmdReq - ) modifies mw_iicRequestTx_any := { - sourceITS_scuId := p_sourceItsScuId, - destinationITS_scuId := p_destinationItsScuId, - pduRequest := { - reqRef := 3, - iicpReq := { MN_Command_request := p_mnCmdReq } - } // End of 'pduRequest' field - } // End of template mdw_iicRequestTx_mnCommandRequest - - /** - * @desc Receive template for IICrequestTX/remote command message - * @param p_sourceItsScuId The source ITS-SCU-ID - * @param p_destinationItsScuId The other ITS-SCU-ID - * @param p_mn_rreq The MN-Request.request message - * @see ISO 24102-4 Clause 8.2.1 IIC-Request PDU - */ - template IICrequestTX mdw_iicRequestTx_mnRequestRequest( - in template (present) ITS_scuId p_sourceItsScuId, - in template (present) ITS_scuId p_destinationItsScuId, - in template (present) MN_Request_request p_mnReqReq - ) modifies mw_iicRequestTx_any := { - sourceITS_scuId := p_sourceItsScuId, - destinationITS_scuId := p_destinationItsScuId, - pduRequest := { - reqRef := 4, - iicpReq := { MN_Request_request := p_mnReqReq } - } // End of 'PduRequest' field - } // End of template mdw_iicRequestTx_mnRequestRequest - - /** - * @desc Receive template for IICresponseTX message with success status - * @param p_sourceItsScuId The source ITS-SCU-ID - * @param p_destinationItsScuId The destination ITS-SCU-ID - * @param p_mnReqConf The MN_Request_confirm expected template - * @see ISO 24102-4 Clause 8.2.2 IIC-Response PDU - */ - template IICresponseTX mdw_iicResponseTx_mnRequestRequest( - in template (present) ITS_scuId p_sourceItsScuId, - in template (present) ITS_scuId p_destinationItsScuId, - in template (present) MN_Request_confirm p_mnReqConf - ) modifies mw_iicResponseTx_any := { - sourceITS_scuId := p_sourceItsScuId, - destinationITS_scuId := p_destinationItsScuId, - pduResponse := { - resRef := 4, - iicpRes := { MN_Request_confirm := p_mnReqConf } - }, // End of 'pduResponse' field - errorStatus := c_errStatus_success - } // End of template mdw_iicResponseTx_mnRequestRequest - - /** - * @desc Receive template for IICresponse message with success status - * @param p_sourceItsScuId The source ITS-SCU-ID - * @param p_destinationItsScuId The destination ITS-SCU-ID - * @param p_vCI_info The VCI-info request - * @see ISO 24102-4 Clause 8.2.1 IIC-Request PDU - */ - template IICresponseTX mdw_iicpResponseTx_mnCommandConfirm( - in template (present) ITS_scuId p_sourceItsScuId, - in template (present) ITS_scuId p_destinationItsScuId, - in template (present) MN_Command_confirm p_mnCommandConfirm - ) modifies mdw_iicpResponseTx_success := { - sourceITS_scuId := p_sourceItsScuId, - destinationITS_scuId := p_destinationItsScuId, - pduResponse := { - resRef := 3, - iicpRes := { MN_Command_confirm := p_mnCommandConfirm } - } // End of 'pduResponse' field - } // End of template mdw_iicpResponseTx_mnCommandConfirm - - } // End of group mnCommandsrecv - - } // End of group mnCommands - - group mfCommands { - - group mfCommandsSend { - - /** - * @desc Send template for IICrequestRX/remote message - * @param p_sourceItsScuId The source ITS-SCU-ID - * @param p_destinationItsScuId The destination ITS-SCU-ID - * @param p_pduCounter Even number generated from a cyclic counter at the ITS-SCU, which produces the request - * @param p_mf_rcmd The MF-COMMAND.request message - * @see ISO 24102-4 Clause 8.2.1 IIC-Request PDU - */ - template (value) IICrequestRX m_iicRequestRx_mfCommandRequest( - in template (value) ITS_scuId p_sourceItsScuId, - in template (value) ITS_scuId p_destinationItsScuId, - in template (value) PduCounter p_pduCounter, - in template (value) MF_Command_request p_mfCmdReq - ) := { - sourceITS_scuId := p_sourceItsScuId, - destinationITS_scuId := p_destinationItsScuId, - pduCounter := p_pduCounter, - requestID := 0, - pduRequest := { - reqRef := 1, - iicpReq := { MF_Command_request := p_mfCmdReq } - }, // End of 'pduRequest' field - secRq := { - secRqRef := 0, - secRq := { NullType := NULL } // No security - } - } // End of template m_iicRequestRx_mfCommandRequest - - /** - * @desc TODO - */ - template (value) IICrequestRX m_iicRequestRx_mfRequestRequest( - in template (value) ITS_scuId p_sourceItsScuId, - in template (value) ITS_scuId p_destinationItsScuId, - in template (value) PduCounter p_pduCounter, - in template (value) MF_Request_request p_mfReqReq - ) := { - sourceITS_scuId := p_sourceItsScuId, - destinationITS_scuId := p_destinationItsScuId, - pduCounter := p_pduCounter, - requestID := 0, - pduRequest := { - reqRef := 0, - iicpReq := { - PduRequest := { - reqRef := 2, - iicpReq := { MF_Request_request := p_mfReqReq } - } // End of 'PduRequest' field - } // End of 'iicpReq' field - }, // End of 'pduRequest' field - secRq := { - secRqRef := 0, - secRq := { NullType := NULL } // No security - } - } // End of template m_iicRequestRx_mfRequestRequest - - } // End of group mfCommandsSend - - group mfCommandsRecv { - - /** - * @desc Receive template for IICrequestTX/remote message - * @param p_sourceItsScuId The source ITS-SCU-ID - * @param p_destinationItsScuId The destination ITS-SCU-ID - * @param p_mf_rcmd The MF-COMMAND.request message - * @see ISO 24102-4 Clause 8.2.1 IIC-Request PDU - */ - template (present) IICrequestTX mdw_iicRequestTx_mfCommandRequest( - in template (present) ITS_scuId p_sourceItsScuId, - in template (present) ITS_scuId p_destinationItsScuId, - in template (present) MF_Command_request p_mfCmdReq - ) modifies mw_iicRequestTx_any := { - sourceITS_scuId := p_sourceItsScuId, - destinationITS_scuId := p_destinationItsScuId, - pduRequest := { - reqRef := 0, - iicpReq := { - PduRequest := { - reqRef := 1, - iicpReq := { MF_Command_request := p_mfCmdReq } - } // End of 'PduRequest' field - } // End of 'iicpReq' field - } // End of 'pduRequest' field - } // End of template mdw_iicRequestTx_mfCommandRequest - - /** - * @desc Receive template for IICresponseTX message with success status - * @param p_sourceItsScuId The source ITS-SCU-ID - * @param p_destinationItsScuId The destination ITS-SCU-ID - * @param p_mf_rcmd The MF-COMMAND.confirm message - * @see ISO 24102-4 Clause 8.2.2 IIC-Response PDU - */ - template IICresponseTX mdw_iicResponseTx_mfCommandRequest( // FIXME Rename into mdw_iicResponseTx_mfCommandConfirm - in template (present) ITS_scuId p_sourceItsScuId, - in template (present) ITS_scuId p_destinationItsScuId, - in template (present) MF_Command_confirm p_mnCmdConf - ) modifies mw_iicResponseTx_any := { - sourceITS_scuId := p_sourceItsScuId, - destinationITS_scuId := p_destinationItsScuId, - pduResponse := { - resRef := 1, - iicpRes := { MF_Command_confirm := p_mnCmdConf } - }, // End of 'pduRequest' field - errorStatus := c_errStatus_success - } // End of template mdw_iicResponseTx_mfCommandRequest - - /** - * @desc Receive template for IICresponse/VCI-info message - * @param p_sourceItsScuId The source ITS-SCU-ID - * @param p_destinationItsScuId The destination ITS-SCU-ID - * @param p_vCI_info The VCI-info request - * @see ISO 24102-4 Clause 8.2.1 IIC-Request PDU - */ - template IICresponseTX mdw_iicpResponse_mfCommandConfirm( - in template (present) ITS_scuId p_sourceItsScuId, - in template (present) ITS_scuId p_destinationItsScuId, - in template (present) MF_Command_confirm p_mfCommandConfirm - ) modifies mdw_iicpResponseTx_success := { - sourceITS_scuId := p_sourceItsScuId, - destinationITS_scuId := p_destinationItsScuId, - pduResponse := { - resRef := 1, - iicpRes := { MF_Command_confirm := p_mfCommandConfirm } - } // End of 'pduResponse' field - } // End of template mdw_iicpResponse_mfCommandConfirm - - } // End of group mfCommandsRecv - - } // End of group mfCommands - - group mfRequest { - - group mfRequestRecv { - - /** - * @desc Send template for IICrequest/MF_Request_Request - * @param p_sourceItsScuId ITS-SCU-ID of source ITS-SCU, which produces the request - * @param p_destinationItsScuId ITS-SCU-ID of destination ITSSCU, which shall evaluate the request. - * @param p_pduCounter Even number generated from a cyclic counter at the ITS-SCU, which produces the request - * @param pduRequest Information description - * @see ISO 24102-4 Clause 7 Protocol data units - */ - template (present) IICrequestTX mdw_iicRequestTx_mfRequestRequest( - in template (present) ITS_scuId p_sourceItsScuId, - in template (present) ITS_scuId p_destinationItsScuId, - in template (present) MF_Request_request p_mfRequestRequest - ) modifies mw_iicRequestTx_any := { - sourceITS_scuId := p_sourceItsScuId, - destinationITS_scuId := p_destinationItsScuId, - pduRequest := { - reqRef := 2, - iicpReq := { - MF_Request_request := p_mfRequestRequest - } - } - } // End of template mdw_iicRequestTx_mfRequestRequest - - } // End of group mfRequestRecv - - } // End of group mfRequest - - } // End of group remoteCommands - - } // End of group iicpTemplates - - /** - * @desc Templates used to - *
  • trigger message on Upper Tester
  • - *
  • capture indication message sent by the IUT
  • - */ - group utPrimitives { - - /** - * @desc Initializes the FNTP IUT including support notification to the Management entity - * See Test System Configuration Access to SUT - */ - template (value) UtInitialize m_utIicpInitialize_with_management := { - utIicpInitialize := { - mcmdRq := { - mCmdRef := 255, - mcmd := { - TestConfigIICP := { - location := PX_LOC_ITS_IICP_ACCESS_SETTINGS_MX_SAP_SET, - lowerLayers := PX_IUT_LOWER_LAYER_USED, - testMode := PX_IUT_TEST_MODE_ON - } - } // End of field 'mcmd' - } // End of field 'mcmdRq' - } // End of field 'utIicpInitialize' - } // End of template m_utIicpInitialize_with_management - - /** - * @desc Initializes the FNTP IUT without support notification to the Management entity - * See Test System Configuration Access to SUT - */ - template (value) UtInitialize m_utIicpInitialize_without_management := { - utIicpInitialize := { - mcmdRq := { - mCmdRef := 255, - mcmd := { - TestConfigIICP := { - location := PX_LOC_ITS_IICP_ACCESS_SETTINGS_MX_SAP_UNSET, - lowerLayers := PX_IUT_LOWER_LAYER_UNUSED, - testMode := PX_IUT_TEST_MODE_ON - } - } // End of field 'mcmd' - } // End of field 'mcmdRq' - } // End of field 'utIicpInitialize' - } // End of template m_utIicpInitialize_without_management - - /** - * @desc Send template for UtIicpEvent - * @param p_mcmdRs McmdRs message - */ - template (value) UtIicpEvent m_utIicpEvent_McmdRs( - in template (value) McmdRs p_mcmdRs - ) := { - mcmdRs := p_mcmdRs - } // End of template m_utIicpEvent_McmdRs - - /** - * @desc Send template for UtIicpEvent - * @param p_mf_Command_confirm MF_Command_confirm message - */ - template (value) UtIicpEvent m_utIicpEvent_MfCommandConfirm( - in template (value) MF_Command_confirm p_mf_Command_confirm - ) := { - mf_Command_confirm := p_mf_Command_confirm - } // End of template m_utIicpEvent_MfCommandConfirm - - /** - * @desc Send template for UtIicpEvent - * @param p_mn_Command_confirm MN_Command_confirm message - */ - template (value) UtIicpEvent m_utIicpEvent_MnCommandConfirm( - in template (value) MN_Command_confirm p_mn_Command_confirm - ) := { - mn_Command_confirm := p_mn_Command_confirm - } // End of template m_utIicpEvent_MnCommandConfirm - - /** - * @desc Send template for UtIicpEvent - * @param p_mi_Command_confirm MI_Command_confirm message - */ - template (value) UtIicpEvent m_utIicpEvent_MiCommandConfirm( - in template (value) MI_Command_confirm p_mi_Command_confirm - ) := { - mi_Command_confirm := p_mi_Command_confirm - } // End of template m_utIicpEvent_MiCommandConfirm - - /** - * @desc Send template for UtIicpEvent - * @param p_mi_Get_confirm MI_Get_confirm message - */ - template (value) UtIicpEvent m_utIicpEvent_MiGetConfirm( - in template (value) MI_Get_confirm p_mi_Get_confirm - ) := { - mi_Get_confirm := p_mi_Get_confirm - } // End of template m_utIicpEvent_MiGetConfirm - - /** - * @desc Send template for UtIicpEvent - * @param p_mi_Set_confirm MI_Set_confirm message - */ - template (value) UtIicpEvent m_utIicpEvent_MiSetConfirm( - in template (value) MI_Set_confirm p_mi_Set_confirm - ) := { - mi_Set_confirm := p_mi_Set_confirm - } // End of template m_utIicpEvent_MiSetConfirm - - /** - * @desc Receive template for UtIicpEventInd - */ - template (present) UtIicpEventInd mw_utIicpEventInd_McmdRq( - in template (present) McmdRq p_mcmdRq - ) := { - mcmdRq := p_mcmdRq - } // End of template mw_utIicpEventInd_McmdRq - - /** - * @desc Receive template for UtIicpEventInd - */ - template (present) UtIicpEventInd mw_utIicpEventInd_MfCommandRequest( - in template (present) MF_Command_request p_mf_Command_request - ) := { - mf_Command_request := p_mf_Command_request - } // End of template mw_utIicpEventInd_MfCommandRequest - - /** - * @desc Receive template for UtIicpEventInd - */ - template (present) UtIicpEventInd mw_utIicpEventInd_MnCommandRequest( - in template (present) MN_Command_request p_mn_Command_request - ) := { - mn_Command_request := p_mn_Command_request - } // End of template mw_utIicpEventInd_MnCommandRequest - - /** - * @desc Receive template for UtIicpEventInd - */ - template (present) UtIicpEventInd mw_utIicpEventInd_MiCommandRequest( - in template (present) MI_Command_request p_mi_Command_request - ) := { - mi_Command_request := p_mi_Command_request - } // End of template mw_utIicpEventInd_MiCommandRequest - - /** - * @desc Receive template for UtIicpEventInd - */ - template (present) UtIicpEventInd mw_utIicpEventInd_MiGetRequest( - in template (present) MI_Get_request p_mi_Get_request - ) := { - mi_Get_request := p_mi_Get_request - } // End of template mw_utIicpEventInd_MiGetRequest - - /** - * @desc Receive template for UtIicpEventInd - */ - template (present) UtIicpEventInd mw_utIicpEventInd_MiSetRequest( - in template (present) MI_Set_request p_mi_Set_request - ) := { - mi_Set_request := p_mi_Set_request - } // End of template mw_utIicpEventInd_MiSetRequest - - group simUtInPrimitives { // TODO To be removed - - template (value) PduRequest m_iicpSimUtReq( - in template (value) SimUt p_simUtIn - ) := { - } // End of template m_iicpSimUtReqt - - /** - * @desc Send template for IIC-Request SimUtIn message - * @param p_simUtIn SimUtIn message - */ - template (value) SimUt m_simUtIn_vciInfo( - in template (value) VCI_info_req p_vciInfo - ) := { - fill := '000'B, - action_ := { - mcmdTrigger := { - mCmdRef := 1, - mcmd := { VCI_info_req := p_vciInfo } - } // End of field 'mcmdTrigger' - } // End of field 'action' - } // End of template m_simUtIn_vciInfo - - } // End of group simUtInPrimitives - - group simUtOutPrimitives { - /** - * @desc Send template for IIC-Request SimUtOut message - * @param p_simUtOut SimUtOut message - */ - template (present) PduRequest m_pduRequest_simUtOut( - in template (present) SimUt p_simUtOut - ) := { - reqRef := 241, - iicpReq := { - SimUt := p_simUtOut - } - } // End of template m_pduRequest_simUtOut - - - } // End of group simUtInPrimitives - - } // End of group utPrimitives - - } // End of group iicpPrimitives - -} // End of module LibItsIicp_Templates \ No newline at end of file diff --git a/ttcn/CALM/IICP/LibItsIicp_TypesAndValues.ttcn3 b/ttcn/CALM/IICP/LibItsIicp_TypesAndValues.ttcn3 deleted file mode 100644 index 8dcb1974..00000000 --- a/ttcn/CALM/IICP/LibItsIicp_TypesAndValues.ttcn3 +++ /dev/null @@ -1,99 +0,0 @@ -/** - * @author ETSI / STF422_EETS - * @version $URL$ - * $Id$ - * @desc Types and constants definitions for Inter-ITS-SCU communications (ISO 24102-4) - */ -module LibItsIicp_TypesAndValues { - - // LibCommon - - // LibIts - - // LibItsCalm - import from CALMiitsscu language "ASN.1:1997" { - type - McmdRq, McmdRs, - SimUt - }; - import from CALMmsap language "ASN.1:1997" { - type - MF_Command_request, MF_Command_confirm, MN_Command_request, MN_Command_confirm, MI_Command_request, MI_Command_confirm, - MF_Request_request, MN_Request_request, MI_Request_request, - MI_Get_request, MI_Set_request, MI_Get_confirm, MI_Set_confirm - }; - - group utPrimitives { - - /** - * @desc Trigger to initialize the IUT. - * @member McmdRq IICPrequests/McmdRq message to initialize the upper tester - * - * @see ISO 24102-4 - */ - type record UtIicpInitialize { - McmdRq mcmdRq - } with { - encode (mcmdRq) "LibItsIicp_asn1" - } - - /** - * @desc Events at the application layer of the IUT. - * @member mcmdRs McmdRs confirm - */ - type union UtIicpEvent { - McmdRs mcmdRs, - MF_Request_request mf_Request_request, - MN_Request_request mn_Request_request, - MI_Request_request mi_Request_request, - MI_Get_request mi_Get_request, - MI_Set_request mi_Set_request, - MF_Command_confirm mf_Command_confirm, - MN_Command_confirm mn_Command_confirm, - MI_Command_confirm mi_Command_confirm, - MI_Get_confirm mi_Get_confirm, - MI_Set_confirm mi_Set_confirm - } - with { - encode (mcmdRs) "LibItsIicp_asn1" - encode (mf_Request_request) "LibItsCALMmsap_asn1" - encode (mn_Request_request) "LibItsCALMmsap_asn1" - encode (mi_Request_request) "LibItsCALMmsap_asn1" - encode (mi_Get_request) "LibItsCALMmsap_asn1" - encode (mi_Set_request) "LibItsCALMmsap_asn1" - encode (mf_Command_confirm) "LibItsCALMmsap_asn1" - encode (mn_Command_confirm) "LibItsCALMmsap_asn1" - encode (mi_Command_confirm) "LibItsCALMmsap_asn1" - encode (mi_Get_confirm) "LibItsCALMmsap_asn1" - encode (mi_Set_confirm) "LibItsCALMmsap_asn1" - } - - /** - * @desc Send a IICPpdu primitive from Facility layer through a SAP. FIXME Check the comment - * @member mcmdRq McmdReq data structure - */ - type union UtIicpEventInd { - McmdRq mcmdRq, - MF_Command_request mf_Command_request, - MN_Command_request mn_Command_request, - MI_Command_request mi_Command_request, - MI_Get_request mi_Get_request, - MI_Set_request mi_Set_request - } - with { - encode (mcmdRq) "LibItsIicp_asn1" - encode (mf_Command_request) "LibItsCALMmsap_asn1" - encode (mn_Command_request) "LibItsCALMmsap_asn1" - encode (mi_Command_request) "LibItsCALMmsap_asn1" - encode (mi_Get_request) "LibItsCALMmsap_asn1" - encode (mi_Set_request) "LibItsCALMmsap_asn1" - } - - } with { - encode "UpperTester" - } // End of group utPrimitives - -} -with { - encode "LibItsIicp" -} // End of module LibItsIicp_TypesAndValues diff --git a/ttcn/CALM/LibItsCalm_Interface.ttcn b/ttcn/CALM/LibItsCalm_Interface.ttcn deleted file mode 100644 index dba41a95..00000000 --- a/ttcn/CALM/LibItsCalm_Interface.ttcn +++ /dev/null @@ -1,446 +0,0 @@ -/** - * @author ETSI / STF405 - * @version $URL$ - * $Id$ - * @desc Module containing PTCs and interface ports definitions for ITS - * - */ -module LibItsCalm_Interface { - - // LibCommon - import from LibCommon_Sync { - function f_selfOrClientSyncAndVerdict - }; - - // LibIts - IP Protocols - - // LibItsCalm - import from CALMiitsscu language "ASN.1:1997" { - type - IIC_Request, IIC_Response, - PduCounter - }; - import from CALMllsap language "ASN.1:1997" { - type - INsapPrimitivesUp, INsapPrimitivesDown, - Time48IAT - }; - import from CALMmsap language "ASN.1:1997" { - type - CommandRef - }; - import from CALMfntp language "ASN.1:1997" all; // FIXME Remove 'all' - import from LibItsFntp_TypesAndValues { - type - UtFntpInitialize, UtFntpEvent, UtFntpEventInd, - CfFntpInitialize, CfFntpEventInd - }; - import from LibItsFsap_TypesAndValues { - type - UtFsapInitialize, UtFsapEvent, UtFsapEventInd, - CfFsapInitialize, CfFsapEventInd - , AcFsapPrimitive - }; - import from LibItsIicp_TypesAndValues { - type - UtIicpInitialize, UtIicpEventInd, UtIicpEvent - }; - import from LibItsAtsp_TypesAndValues { - type - UtAtspInitialize, UtAtspEventInd, UtAtspEvent, - CfAtspInitialize, CfAtspEventInd, CfAtspEvent - }; - - // LibIts - import from LibItsCommon_TestSystem { - type ItsBaseComponent - }; - - group adapterInterface { - - group portDefinitions { - - /** - * @desc Adapter control port - */ - type port AdapterControlPort message { - out - AcFsapPrimitive; // Non IP Protocols - } // End AdapterControlPort - - /** - * @desc Upper Tester port - */ - type port UpperTesterPort message { - out - UtInitialize, UtFntpEvent, UtFsapEvent, UtIicpEvent, UtAtspEvent; - in - UtResult, UtFntpEventInd, UtFsapEventInd, UtIicpEventInd, UtAtspEventInd - } // End of UpperTesterPort - - /** - * @desc Configuration IUT port (Management SAP: Mx-SAP) - */ - type port ConfigTesterPort message { - out - CfInitialize, CfAtspEvent; - in - CfResult, CfFntpEventInd, CfFsapEventInd/*, CfIicpEventInd*/, CfAtspEventInd - } // End of ConfigTesterPort - - } // End portDefinitions - - } // adapterInterface - - group interfaceComponents { - - /** - * @desc Test component for ITS Management layer - * @member utPort Upper tester port - * @member acPort TA configuration port - * @member iicpPort IICP protocol port - */ - type component ItsMgt extends ItsBaseComponent { - - port UpperTesterPort utPort; - port AdapterControlPort acPort; - port ConfigTesterPort cfPort; - - // MGT1 ports - Used to send remote command to/from - port IicpPort iicpPort; // ITS station-internal management communications protocol - - // Timers - - // Variables - var CommandRef vc_commandRef := 0; // Cyclic counter identifying a NF-FNTP-COM.request - var PduCounter vc_pduCounter := 0; // Cyclic counter identifying a IICP PDU counter - var integer vc_noFntpFwtEntry := 0; - - } // End of component ItsMgt - - /** - * @desc Test component for ITS Network and Transport layer - * @member fntpPort Fast Network & Transport layer Protocol port - * @member fsapPort Fast Service Advertisement Protocol port - * @member atspPort Access Technology Support Protocol port - */ - type component ItsCalm extends ItsMgt { - // MGT2 ports - Used to send command to/from through SAP interfaces - port FsapPort fsapPort; // Fast Service Advertisement Protocol - // NT3 ports - port FntpPort fntpPort; - // AccessLayer ports - port AtspPort atspPort; - - // timers - - // Variables for Fntp - var charstring vc_componentName := ""; - var PortNumber vc_portNumber := { portLong := 0 }; - var integer vc_reference := 65535; // See noFNTPfwtEntries FIXME Create a constant - var UtEventInd vc_utEventInd; - - } // End of component ItsCalm - - } // End of group interfaceComponents - - group interfacePorts { - - group managementPorts { - - group mgt1Ports { - - /** - * @desc MGT1 IICP Port (IICP/LAN) - */ - type port IicpPort message { - inout - IicpReq, - IicpInd; - } // End of port IicpPort - - } // End of group mgt1Ports - - group mgt2Ports { - - /** - * @desc MGT2 Fsap Port - */ - type port FsapPort message { - in - FsapInd; - out - FsapReq; - } // End of port FsapPort - - } // End of group mgt2Ports - - } // End of group managementPorts - - group networkAndTransportPorts { - - group nt3Ports { - - /** - * @desc NT3 Fntp Port - */ - type port FntpPort message { - in - FntpInd; - out - FntpReq - } // End of port FntpPort - - } // End of group nt3Ports - - } // End of group networkAndTransportPorts - - group accessLayerPorts { - - /** - * @desc AccessLayer Port (Radio, IR...) - */ - type port AtspPort message { - in - AtspInd; - out - AtspReq; - } // End of port AtsPort - - } // End of group accessLayerPorts - - } // End of group interfacePorts - - group interfacePrimitives { - - group managementPrimitives { - - group mgt1Primitives { - - /** - * @desc MGT1 IICP Request Primitive - */ - type record IicpReq { - IicpMsg msgOut - } - with { - encode "LibIts_Interface" - } - - /** - * @desc TODO - */ - type union IicpMsg { - IIC_Request msg_req, - IIC_Response msg_resp - } with { - encode (msg_req) "LibItsIicp_asn1"; - encode (msg_resp) "LibItsIicp_asn1"; - encode "LibIts_Interface" - } - - /** - * @desc MGT1 IICP Request/Indication Primitive - */ - type record IicpInd { - IicpMsg msgIn, - Time48IAT receptionTime - } - with { - encode (receptionTime) "LibItsCALMllsap_asn1"; - encode "LibIts_Interface" - } - - } // End of group mgt1Primitives - - /** - * @desc MGT2 Management Service Primitives - * @see ISO/CD 24102-3 - */ - group mgt2Primitives { - - /** - * @desc TODO - */ - type union FsapReq { - NFsapPrimitivesUp msgOut_nf, - INsapPrimitivesUp msgOut_in - } with { - encode (msgOut_nf) "LibItsCALMfntp_asn1"; - encode (msgOut_in) "LibItsCALMllsap_asn1"; - encode "LibIts_Interface" - } - - /** - * @desc TODO - */ - type union FsapMsg { - NFsapPrimitivesDown msgIn_nf, - INsapPrimitivesDown msgIn_in - } with { - encode (msgIn_nf) "LibItsCALMfntp_asn1"; - encode (msgIn_in) "LibItsCALMllsap_asn1"; - encode "LibIts_Interface" - } - type record FsapInd { - FsapMsg msgIn, - Time48IAT receptionTime - } with { - encode (receptionTime) "LibItsCALMllsap_asn1"; - encode "LibIts_Interface" - } - - } // End of group mgt2Primitives - - } // End of group managementPrimitives - - group networkAndTransportPrimitives { - - group nt3Primitives { - - /** - * @desc FNTP output protocol port primitive - * @member msgOut Message to send to the protocol port (INsapPrimitivesUp) - */ - type union FntpReq { - INsapPrimitivesUp msgOut - } with { - encode (msgOut) "LibItsCALMllsap_asn1"; - encode "LibIts_Interface" - } - - /** - * @desc FNTP input protocol port primitive (INsapPrimitivesDown) - * @member msgIn Message monitored on the protocol port (INsapPrimitivesUp) - * @member receptionTime Timestamp when then message is received by the test adapter (different than the generation generation timestamp) - */ - type record FntpInd { - INsapPrimitivesDown msgIn, - Time48IAT receptionTime - } with { - encode (msgIn) "LibItsCALMllsap_asn1"; - encode (receptionTime) "LibItsCALMllsap_asn1"; - encode "LibIts_Interface" - } - - } // End of group nt3Primitives - - } // End of group networkAndTransportPrimitives - - group accessLayerPrimitives { - - /** - * @desc ATSP (output from ITS test system) port primitive - * @member msgOut Message to send to the protocol port (INsapPrimitivesDown) - * used to communicate with the radio box connected to the ITS test system - */ - type record AtspReq { - INsapPrimitivesDown msgOut - } with { - encode (msgOut) "LibItsCALMllsap_asn1" - encode "LibIts_Interface" - } - - /** - * @desc ATSP (input to ITS test system) port primitive (INsapPrimitivesUp) - * @member msgIn Message monitored on the protocol port (INsapPrimitivesUp) - */ - type record AtspInd { - INsapPrimitivesUp msgIn, - Time48IAT receptionTime - } with { - encode (msgIn) "LibItsCALMllsap_asn1" - encode (receptionTime) "LibItsCALMllsap_asn1"; - encode "LibIts_Interface" - } - - } // End of group accessLayerPrimitives - - } with { - encode "LibIts_Interface" - } // End of group interfacePrimitives - - group upperTester { - - /** - * @desc Upper Tester message to initialize IUT - */ - type union UtInitialize { - UtFntpInitialize utFntpInitialize, - UtFsapInitialize utFsapInitialize, - UtIicpInitialize utIicpInitialize, - UtAtspInitialize utAtspInitialize - } - - /** - * @desc Upper Tester message to trigger an action on IUT - */ - type record UtTrigger { - UtEvent utEvent - } - - /** - * @desc Upper Tester message to check event/status on IUT - */ - type record UtCheck { - UtEvent utEvent - } - - /** - * @desc Upper Tester message describing an action/event - */ - type union UtEvent { // TODO To be moved into each library (cf. CAM/DENM) - UtFntpEvent utFntpEvent, - UtFsapEvent utFsapEvent, - UtAtspEvent utAtspEvent - } - - /** - * @desc Upper Tester message describing an incoming event - */ - type union UtEventInd { // TODO To be moved into each library (cf. CAM/DENM) - UtFntpEventInd utFntpEventInd, - UtFsapEventInd utFsapEventInd, - UtAtspEventInd utAtspEventInd - } - - /** - * @desc Upper Tester response message - */ - type boolean UtResult; - - } with { - encode "UpperTester" - } // End of group upperTester - - group configIUT { - - /** - * @desc Message to initialize Configuration Tester - */ - type union CfInitialize { - CfFntpInitialize cfFntpInitialize, - CfFsapInitialize cfFsapInitialize, - CfAtspInitialize cfAtspInitialize - } - - type union CfEventInd { - CfFntpEventInd cfFntpEventInd, - CfFsapEventInd cfFsapEventInd, - CfAtspEventInd cfAtspEventInd - } - - type union CfEvent { - CfAtspEvent cfAtspEvent - } - - /** - * @desc Config Tester response message - */ - type boolean CfResult; - - } with { - encode "ConfigTester" - } // End of group configIUT - -} // End of module LibItsCalm_Interface diff --git a/ttcn/CALM/LibItsCalm_Pixits.ttcn3 b/ttcn/CALM/LibItsCalm_Pixits.ttcn3 deleted file mode 100644 index 1a215393..00000000 --- a/ttcn/CALM/LibItsCalm_Pixits.ttcn3 +++ /dev/null @@ -1,192 +0,0 @@ -module LibItsCalm_Pixits { - - // LibCommon - import from LibCommon_DataStrings { - type Bit1, Bit6 - }; - - /** - * @desc Location of the IUT, which defines the interface(s) of the IUT for upper (/ lower) tester access. - * Used for ATSP ATS - *
  • ITS-S access layer: Upper tester access is via IN-SAP
  • - *
  • ITS-S networking & transport layer: Upper / lower tester access is via NF-SAP
  • - *
  • ITS-S facilities layer: Upper / lower tester access is via FA-SAP
  • - *
  • ITS-S management entity: Upper / lower tester access is via MX-SAPs
  • - *
  • ITS-S security entity (not supported in the present document)
  • - *
  • ITS-S application entity (not supported in the present document)
  • - */ - modulepar Bit6 PX_LOC_ITS_ATSP_ACCESS_SETTINGS_MX_SAP_SET := - PX_IUT_AL_xT_AT_IN_SAP_SET & - PX_IUT_FNTP_xT_AT_NF_SAP_UNSET & - PX_IUT_FAC_xT_AT_FA_SAP_UNSET & - PX_IUT_MGT_xT_AT_Mx_SAP_SET & - '00'B; - - /** - * @desc Location of the IUT, which defines the interface(s) of the IUT for upper (/ lower) tester access. - * Used for FNTP ATS - *
  • ITS-S access layer: Upper tester access is via IN-SAP
  • - *
  • ITS-S networking & transport layer: Upper / lower tester access is via NF-SAP
  • - *
  • ITS-S facilities layer: Upper / lower tester access is via FA-SAP
  • - *
  • ITS-S management entity: Upper / lower tester access is via MX-SAPs not supported
  • - *
  • ITS-S security entity (not supported in the present document)
  • - *
  • ITS-S application entity (not supported in the present document)
  • - */ - modulepar Bit6 PX_LOC_ITS_ATSP_ACCESS_SETTINGS_MX_SAP_UNSET := - PX_IUT_AL_xT_AT_IN_SAP_SET & - PX_IUT_FNTP_xT_AT_NF_SAP_UNSET & - PX_IUT_FAC_xT_AT_FA_SAP_UNSET & - PX_IUT_MGT_xT_AT_Mx_SAP_UNSET & - '00'B; - - /** - * @desc Location of the IUT, which defines the interface(s) of the IUT for upper (/ lower) tester access. - * Used for FNTP ATS - *
  • ITS-S access layer: Upper tester access is via IN-SAP
  • - *
  • ITS-S networking & transport layer: Upper / lower tester access is via NF-SAP
  • - *
  • ITS-S facilities layer: Upper / lower tester access is via FA-SAP
  • - *
  • ITS-S management entity: Upper / lower tester access is via MX-SAPs
  • - *
  • ITS-S security entity (not supported in the present document)
  • - *
  • ITS-S application entity (not supported in the present document)
  • - */ - modulepar Bit6 PX_LOC_ITS_FNTP_ACCESS_SETTINGS_MX_SAP_SET := - PX_IUT_AL_xT_AT_IN_SAP_UNSET & - PX_IUT_FNTP_xT_AT_NF_SAP_SET & - PX_IUT_FAC_xT_AT_FA_SAP_UNSET & - PX_IUT_MGT_xT_AT_Mx_SAP_SET & - '00'B; - - /** - * @desc Location of the IUT, which defines the interface(s) of the IUT for upper (/ lower) tester access. - * Used for FNTP ATS - *
  • ITS-S access layer: Upper tester access is via IN-SAP
  • - *
  • ITS-S networking & transport layer: Upper / lower tester access is via NF-SAP
  • - *
  • ITS-S facilities layer: Upper / lower tester access is via FA-SAP
  • - *
  • ITS-S management entity: Upper / lower tester access is via MX-SAPs not supported
  • - *
  • ITS-S security entity (not supported in the present document)
  • - *
  • ITS-S application entity (not supported in the present document)
  • - */ - modulepar Bit6 PX_LOC_ITS_FNTP_ACCESS_SETTINGS_MX_SAP_UNSET := - PX_IUT_AL_xT_AT_IN_SAP_UNSET & - PX_IUT_FNTP_xT_AT_NF_SAP_SET & - PX_IUT_FAC_xT_AT_FA_SAP_UNSET & - PX_IUT_MGT_xT_AT_Mx_SAP_UNSET & - '00'B; - - /** - * @desc Location of the IUT, which defines the interface(s) of the IUT for upper (/ lower) tester access. - * Used for FSAP ATS - *
  • ITS-S access layer: Upper tester access is via IN-SAP
  • - *
  • ITS-S networking & transport layer: Upper / lower tester access is via NF-SAP
  • - *
  • ITS-S facilities layer: Upper / lower tester access is via FA-SAP
  • - *
  • ITS-S management entity: Upper / lower tester access is via MX-SAPs
  • - *
  • ITS-S security entity (not supported in the present document)
  • - *
  • ITS-S application entity (not supported in the present document)
  • - */ - modulepar Bit6 PX_LOC_ITS_FSAP_ACCESS_SETTINGS_MX_SAP_SET := - PX_IUT_AL_xT_AT_IN_SAP_UNSET & - PX_IUT_FNTP_xT_AT_NF_SAP_SET & - PX_IUT_FAC_xT_AT_FA_SAP_SET & - PX_IUT_MGT_xT_AT_Mx_SAP_SET & - '00'B; - /** - * @desc Location of the IUT, which defines the interface(s) of the IUT for upper (/ lower) tester access. - * Used for FSAP ATS - *
  • ITS-S access layer: Upper tester access is via IN-SAP
  • - *
  • ITS-S networking & transport layer: Upper / lower tester access is via NF-SAP
  • - *
  • ITS-S facilities layer: Upper / lower tester access is via FA-SAP
  • - *
  • ITS-S management entity: Upper / lower tester access is via MX-SAPs not supported
  • - *
  • ITS-S security entity (not supported in the present document)
  • - *
  • ITS-S application entity (not supported in the present document)
  • - */ - modulepar Bit6 PX_LOC_ITS_FSAP_ACCESS_SETTINGS_MX_SAP_UNSET := - PX_IUT_AL_xT_AT_IN_SAP_UNSET & - PX_IUT_FNTP_xT_AT_NF_SAP_SET & - PX_IUT_FAC_xT_AT_FA_SAP_SET & - PX_IUT_MGT_xT_AT_Mx_SAP_UNSET & - '00'B; - - /** - * @desc Location of the IUT, which defines the interface(s) of the IUT for upper (/ lower) tester access. - * Used for IICP ATS - *
  • ITS-S access layer: Upper tester access is via IN-SAP
  • - *
  • ITS-S networking & transport layer: Upper / lower tester access is via NF-SAP
  • - *
  • ITS-S facilities layer: Upper / lower tester access is via FA-SAP
  • - *
  • ITS-S management entity: Upper / lower tester access is via MX-SAPs not supported
  • - *
  • ITS-S security entity (not supported in the present document)
  • - *
  • ITS-S application entity (not supported in the present document)
  • - */ - modulepar Bit6 PX_LOC_ITS_IICP_ACCESS_SETTINGS_MX_SAP_SET := - PX_IUT_AL_xT_AT_IN_SAP_UNSET & - PX_IUT_FNTP_xT_AT_NF_SAP_SET & - PX_IUT_FAC_xT_AT_FA_SAP_SET & - PX_IUT_MGT_xT_AT_Mx_SAP_SET & - '00'B; - - /** - * @desc Location of the IUT, which defines the interface(s) of the IUT for upper (/ lower) tester access. - * Used for IICP ATS - *
  • ITS-S access layer: Upper tester access is via IN-SAP
  • - *
  • ITS-S networking & transport layer: Upper / lower tester access is via NF-SAP
  • - *
  • ITS-S facilities layer: Upper / lower tester access is via FA-SAP
  • - *
  • ITS-S management entity: Upper / lower tester access is via MX-SAPs not supported
  • - *
  • ITS-S security entity (not supported in the present document)
  • - *
  • ITS-S application entity (not supported in the present document)
  • - */ - modulepar Bit6 PX_LOC_ITS_IICP_ACCESS_SETTINGS_MX_SAP_UNSET := - PX_IUT_AL_xT_AT_IN_SAP_UNSET & - PX_IUT_FNTP_xT_AT_NF_SAP_UNSET & - PX_IUT_FAC_xT_AT_FA_SAP_UNSET & - PX_IUT_MGT_xT_AT_Mx_SAP_UNSET & - '00'B; - - /** - * @desc Indicates that IN-SAP interface is not used - */ - modulepar Bit1 PX_IUT_AL_xT_AT_IN_SAP_UNSET := '0'B; - /** - * @desc Indicates that IN-SAP interface is used - */ - modulepar Bit1 PX_IUT_AL_xT_AT_IN_SAP_SET := '1'B; - - /** - * @desc Indicates that NF-SAP interface is not used - */ - modulepar Bit1 PX_IUT_FNTP_xT_AT_NF_SAP_UNSET := '0'B; - /** - * @desc Indicates that NF-SAP interface is used - */ - modulepar Bit1 PX_IUT_FNTP_xT_AT_NF_SAP_SET := '1'B; - - /** - * @desc Indicates that FA-SAP interface is not used - */ - modulepar Bit1 PX_IUT_FAC_xT_AT_FA_SAP_UNSET := '0'B; - /** - * @desc Indicates that FA-SAP interface is not used - */ - modulepar Bit1 PX_IUT_FAC_xT_AT_FA_SAP_SET := '1'B; - - /** - * @desc Indicates that management SAP (Mx-SAP) interfaces are not used - */ - modulepar Bit1 PX_IUT_MGT_xT_AT_Mx_SAP_UNSET := '0'B; - /** - * @desc Indicates that management SAP (Mx-SAP) interfaces are used - */ - modulepar Bit1 PX_IUT_MGT_xT_AT_Mx_SAP_SET := '1'B; - - /** - * @desc Lower layers - * This means that Teat Adapter should set fnt port setting to Fntp/ETH - */ - modulepar Bit1 PX_IUT_LOWER_LAYER_USED := '1'B; - modulepar Bit1 PX_IUT_LOWER_LAYER_UNUSED := '0'B; - - /** - * @desc Test mode - */ - modulepar Bit1 PX_IUT_TEST_MODE_OFF := '0'B; - modulepar Bit1 PX_IUT_TEST_MODE_ON := '1'B; - -} // End of module module LibItsCalm_Pixits diff --git a/ttcn/CALM/LibItsCalm_TestSystem.ttcn b/ttcn/CALM/LibItsCalm_TestSystem.ttcn deleted file mode 100644 index 4f021d84..00000000 --- a/ttcn/CALM/LibItsCalm_TestSystem.ttcn +++ /dev/null @@ -1,36 +0,0 @@ -/** - * @author ETSI / STF405 - * @version $URL$ - * $Id$ - * @desc Test System module for ITS - * - */ -module LibItsCalm_TestSystem { - - // LibIts - import from LibItsCalm_Interface all; - - group componentDefinitions { - - /** - * @desc ITS System Adapter - */ - type component ItsCalmSystem { - - port UpperTesterPort utPort; - port AdapterControlPort acPort; - port ConfigTesterPort cfPort; - - // MGT1 ports - port IicpPort iicpPort; // ITS station-internal management communications protocol - // MGT2 ports - port FsapPort fsapPort; // Fast Service Advertisement Protocol - // NT3 ports - port FntpPort fntpPort; // Fast Network & Transport layer Protocol - // - port AtspPort atspPort; // Access Layer port - } // End of component ItsCalmSystem - - } // End of group componentDefinitions - -} // End of module LibItsCalm_TestSystem \ No newline at end of file diff --git a/ttcn/CALM/MGT/LibItsMgt_Functions.ttcn3 b/ttcn/CALM/MGT/LibItsMgt_Functions.ttcn3 deleted file mode 100644 index 963868a5..00000000 --- a/ttcn/CALM/MGT/LibItsMgt_Functions.ttcn3 +++ /dev/null @@ -1,146 +0,0 @@ -/** - * @author ETSI / STF422_EETS - * @version $URL$ - * $Id$ - * @desc ITS station management (ISO 24102-3) functions - */ -module LibItsMgt_Functions { - - // LibCommon - import from LibCommon_BasicTypesAndValues { - const - c_uInt8Max; - }; - import from LibCommon_Sync { - function - f_selfOrClientSyncAndVerdict, f_selfOrClientSyncAndVerdictPreamble - }; - import from LibCommon_VerdictControl all; - - // LibIts - import from CALMiitsscu language "ASN.1:1997" { - type - PduCounter - }; - import from CALMllsap language "ASN.1:1997" { - type - MedType, CIaClass, CIclass - }; - import from CALMmanagement language "ASN.1:1997" { - type - ITS_scuId - }; - import from CALMmsap language "ASN.1:1997" { - type - CommandRef, - MN_Request_request, FWTupdate, - MF_Request_request - }; -// import from CALMfsap language "ASN.1:1997" { -// type -// GCregServer, GCregClient, GCderegClient, GCctxTxCmd, CTXrxNot -// }; - import from LibItsMgt_Templates all; - import from LibItsMgt_Pixits all; - import from LibItsCalm_Interface { - type - ItsMgt/*, - MgtMnSapCommandReq FXME To be removed */ - }; - - group preambule { - - } // End of group preambule - - group testerFunctions { - - /** - * @desc Increments the pdu counter and returns the new even value - * @return The new pdu counter value - * - * @see ISO/WD 24102-4 - Clause 6.2.1 - */ - function f_getNextPduCounter() runs on ItsMgt return PduCounter { - vc_pduCounter := (vc_pduCounter + 2) mod (c_uInt8Max - 1); // ISO/WD 24102-4 - Clause 6.2.1: modulus 254 - return vc_pduCounter; - } // End of function f_getNextPduCounter - - /** - * @desc Increments the commandRef value and returns it - * @return The new commandRef value - */ - function f_getNextCommandRef() runs on ItsMgt return CommandRef { - vc_commandRef := (vc_commandRef + 1) mod (c_uInt8Max + 1); - return vc_commandRef; - } // End of function f_getNextCommandRef - - } // End of group testerFunctions - - group iutFunctions { - - /** - * @desc Get the ITS-SCU-ID of the source ITS-SCU which produces the request - * @return The ITS-SCU-ID of the source ITS-SCU which produces the request - * @see PX_SRC_ITS_SCU_ID - */ - function f_getIutSourceItsScuId() return ITS_scuId { - return PX_SRC_ITS_SCU_ID; - } - - /** - * @desc Get the ITS-SCU-ID of the source ITS-SCU which produces AliveMessages - * @return The ITS-SCU-ID of the source ITS-SCU which produces AliveMessages - * @see PX_SRC_ITS_SCU_ID_ALIVE - */ - function f_getIutSourceItsScuIdAlive() return ITS_scuId { - return PX_SRC_ITS_SCU_ID_ALIVE; - } - - /** - * @desc Get the Host ITS-SCU-ID - * @return The Host ITS-SCU-ID - * @see PX_DST_ITS_SCU_ID - */ - function f_getIutDestItsScuId() return ITS_scuId { - return PX_DST_ITS_SCU_ID; - } - - /** - * @desc Get an other ITS-SCU-ID - * @return The other ITS-SCU-ID - * @see PX_OTHER_ITS_SCU_ID - */ - function f_getIutOtherItsScuId() return ITS_scuId { - return PX_OTHER_ITS_SCU_ID; - } - - /** - * @desc Get the type of access technology (medium) - * @return The type of access technology (medium) - * @see PX_MED_TYPE - */ - function f_getIutMedType() return MedType { - return PX_MED_TYPE; - } - - /** - * @desc Get the CI access class - * @return The CI access class - * @see PX_CIACLASS - */ - function f_getIutCiAccessClass() return CIaClass { - return PX_CIACLASS; - } - - /** - * @desc Get the CI class - * @return The CI class - * @see PX_CICLASS - */ - function f_getIutCiClass() return CIclass { - return PX_CICLASS; - } - - } // End of group iutFunctions - -} // End of module LibItsMgt_Functions \ No newline at end of file diff --git a/ttcn/CALM/MGT/LibItsMgt_Pixits.ttcn3 b/ttcn/CALM/MGT/LibItsMgt_Pixits.ttcn3 deleted file mode 100644 index 791a892e..00000000 --- a/ttcn/CALM/MGT/LibItsMgt_Pixits.ttcn3 +++ /dev/null @@ -1,81 +0,0 @@ -/** - * @author ETSI / STF422_EETS - * @version $URL$ - * $Id$ - * @desc ITS station management (ISO 24102-3) Pixits - */ -module LibItsMgt_Pixits { - - // LibCommon - import from LibCommon_DataStrings { - type Bit4 - }; - - // LibIts - import from CALMiitsscu language "ASN.1:1997" { - type ITS_SCUtype - }; - import from CALMllsap language "ASN.1:1997" { - type - MedType, CIaClass, CIclass - }; - import from CALMfntp language "ASN.1:1997" { - type PortNumber - }; - import from CALMmanagement language "ASN.1:1997" { - type ITS_scuId - }; - import from LibItsMgt_TypesAndValues { - group asn1Constants - }; - - /** - * @desc ITS-SCU-ID of the source ITS-SCU which produces the request - */ - modulepar ITS_scuId PX_SRC_ITS_SCU_ID := 10; - - /** - * @desc ITS-SCU-ID of the source ITS-SCU which produces AliveMessages - */ - modulepar ITS_scuId PX_SRC_ITS_SCU_ID_ALIVE := 12; - - /** - * @desc ITS_SCUtype of the source ITS-SCU which produces the request - */ - modulepar ITS_SCUtype PX_SRC_ITS_SCU_TYPE := 2; // router - - /** - * @desc ITS-SCU-ID of the destination ITS-SCU which shall evaluate the request - */ - modulepar ITS_scuId PX_DST_ITS_SCU_ID := 12; - - /** - * @desc ITS-SCU-ID of an other ITS-SCU which shall evaluate the request - */ - modulepar ITS_scuId PX_OTHER_ITS_SCU_ID := 0; - - /** - * @desc Defines the value to set to fill field for PduRequest field - * @see ISO/WD 24102-4 - Clause 7 - */ - modulepar Bit4 PX_PDU_REQUEST_FILL_FIELD_VALUE := '0000'B; - - /** - * @desc Indicates type of access technology (medium) - * @see ISO 21218 - */ - modulepar MedType PX_MED_TYPE := c_medType_unknown; - - /** - * @desc Indicates the CI access class - * @see ISO 21218 - */ - modulepar CIaClass PX_CIACLASS := c_cIaClass_unknown; - - /** - * @desc Indicates the CI class - * @see ISO 21218 - */ - modulepar CIclass PX_CICLASS := c_cIClass_unknown; - -} // End of module LibItsMgt_Pixits diff --git a/ttcn/CALM/MGT/LibItsMgt_Templates.ttcn3 b/ttcn/CALM/MGT/LibItsMgt_Templates.ttcn3 deleted file mode 100644 index ecc94263..00000000 --- a/ttcn/CALM/MGT/LibItsMgt_Templates.ttcn3 +++ /dev/null @@ -1,749 +0,0 @@ -/** - * @author ETSI / STF422_EETS - * @version $URL$ - * $Id$ - * @desc Templates definitions for ITS station management (ISO 24102-3) - */ -module LibItsMgt_Templates { - - // LibCommon - import from LibCommon_BasicTypesAndValues { - type - UInt8, UInt16; - }; - - // LibIts - import from CALMmanagement language "ASN.1:1997" { - type ITS_scuId - }; - // FIXME Check why TTWB raises an error on ErrStatus (not found)? - import from CALMllsap language "ASN.1:1997" all;/*{ - type - ErrStatus, - MedType , CIaClass, CIclass - };*/ - import from CALMmsap language "ASN.1:1997" all; - import from CALMfntp language "ASN.1:1997" { - type - PortNumber, - SetFNTP, UpdateFNTP, SetNotFNTP, DeleteFNTP - }; - import from CALMfsap language "ASN.1:1997" { - type - GCregServer, - GCregClient, - SAMrxNot, - CTXrxNot, - GCsamctxConf - }; - import from LibItsMgt_TypesAndValues { - group constants; - type IParamNoList, IParamList - }; - import from LibItsMgt_Pixits { - modulepar PX_PDU_REQUEST_FILL_FIELD_VALUE - }; - - group mgtSapTemplates { - - /** - * @desc MF-SAP service primitives templates - * @see ISO 24102-3 Clause 8 - */ - group mgtMfSapTemplates { - - /** - * @desc Templates for MF-SAP - * @see ISO 24102-3 Clause 8.2 - */ - group mfCommand { - - group mfCommandSend { - - /** - * @desc Generic send template for MF-COMMAND.request service primitive - * @param p_commandRef Unique cyclic reference number of command. - * @param p_mfCmd MF-Command message description - */ - template (value) MF_Command_request m_mfCommandRequest_stateCInotify( - in template (value) CommandRef p_commandRef, - in template (value) StateCInotify p_stateCInotify - ) := { - commandRef := p_commandRef, - ref := 7, - command_param := { StateCInotify := p_stateCInotify } - } // End of template m_mfCommandRequest_stateCInotify - - /** - * @desc Send template for PduRequest/MF-COMMAND.confirm - * @param p_mfCommandReq MF-COMMAND.confirm description - * @see ISO 24102-4 Clause 8.2.1 IIC-Request PDU - */ - template (value) MF_Command_confirm m_mfCommand_confirm_stateCInotify( - in template (value) CommandRef p_commandRef - ) := { - commandRef := p_commandRef, - ref := 7, - cmdConfirm_param := { NullType := NULL }, - errStatus:= 0 - } // End of template m_mfCommand_confirm_stateCInotify - - } // End of group mfCommandSend - - group mfCommandRecv { - - /** - * @desc Unspecified receive template for MF-COMMAND.request service primitive - * Used for: - *
  • modifying restrictif template
  • - *
  • default altstep
  • - * @see a_mgtMfSapPortDefault altstep statement - */ - template MF_Command_request mw_mfCommandRequest_any := { - commandRef := ?, - ref := ?, - command_param := ? - } // End of template mw_mfCommandRequest_any - - /** - * @desc Unspecified receive template for MF-COMMAND.confirm service primitive - * @see a_mgtMfSapPortDefault altstep statement - * @see ISO 24102-3 Clause 8.3.3 - */ - template MF_Command_confirm mw_mfCommandConfirm_any := { - commandRef := ?, - ref := ?, - cmdConfirm_param := ?, - errStatus := ? - } // End of template mw_mfCommandConfirm_any - - /** - * @desc Receive template for MF-Request.confirm service primitive - * @param p_errorStatus Error status - */ - template MF_Command_confirm mdw_mfCommandConfirm( - in template (present) ErrStatus p_errorStatus - ) modifies mw_mfCommandConfirm_any:= { - errStatus := p_errorStatus - } // End of template mw_mfCommandConfirm - - template MF_Command_confirm mdw_mfCommandConfirm_gCsamctxConf( - in template (value) ErrStatus p_errorStatus - ) modifies mdw_mfCommandConfirm := { - ref := 2/*, - cmdConfirm_param := { GCsamctxConf := ? }*/ - } // End of template mdw_mfCommandConfirm_gCsamctxConf - - } // End of group mfCommandRecv - - } // End of group mfCommand - - group mfRequestRequest { - - group mfRequestRequestSend { - - /** - * @desc Generic receive template for MF-REQUEST.request service primitive - * @param p_commandRef Unique cyclic reference number of command. - * @param p_request_param MF-Request message description - */ - template (value) MF_Request_request m_mfRequestRequest_ldmRegister( - in template (value) CommandRef p_commandRef, - in template (value) LDMregister p_ldmRegister - ) := { - commandRef := p_commandRef, - ref := 9, - request_param := { LDMregister := p_ldmRegister } - } // End of template m_mfRequestRequest - - } // End of group mfRequestRequestSend - - group mfRequestRequestRecv { - - /** - * @desc Receive template for MF-REQUEST.request service primitive - * @param p_commandRef Unique cyclic reference number of command. Same value as in related MF-REQUEST.request - * @param p_ctx Command issued by the ITS-S facilities layer and sent to the ITS-S management entity via the MF-SAP - */ - template (present) MF_Request_request mw_mfRequestRequest_ctx( - in template (present) CTXrxNot p_ctx - ) := { - commandRef := ?, - ref := 11, - request_param := { CTXrxNot := p_ctx } - } // End of template mw_mfRequestRequest_ctx - - /** - * @desc Receive template for MF-REQUEST.request service primitive - * @param p_commandRef Unique cyclic reference number of command. Same value as in related MF-REQUEST.request - * @param p_gCregClient Command issued by the ITS-S facilities layer and sent to the ITS-S management entity via the MF-SAP - */ - template (present) MF_Request_request mw_mfRequestRequest_gCregClient( - in template (present) CommandRef p_commandRef, - in template (present) GCregClient p_gCregClient - ) := { - commandRef := p_commandRef, - ref := 6, - request_param := { GCregClient := p_gCregClient } - } // End of template mw_mfRequestRequest_gCregClient - - /** - * @desc Receive template for MF-REQUEST.request service primitive - * @param p_commandRef Unique cyclic reference number of command. Same value as in related MF-REQUEST.request - * @param p_ldmregister Command issued by the ITS-S facilities layer and sent to the ITS-S management entity via the MF-SAP - */ - template (present) MF_Request_request mw_mfRequestRequest_ldmRegister( - in template (present) CommandRef p_commandRef, - in template (present) LDMregister p_ldmregister - ) := { - commandRef := p_commandRef, - ref := 9, - request_param := { LDMregister := p_ldmregister } - } // End of template mw_mfRequestRequest_ldmRegister - - } // End of group mfRequestRequestRecv - - } // End of group mfRequestRequest - - } // End of group mgtMfSapTemplates - - /** - * @desc MN-SAP service primitives templates - * @see ISO 24102-3 Clause 7 - */ - group mgtMnSapTemplates { - - group mnCommandRequest { - - group mfCommandRequestSend { - - /** - * @desc Receive template for MN-COMMAND.request service primitive - * @param p_commandRef TODO - * @param p_deleteFntp TODO - * @see ISO 24102-3 Clause 7.3.3 - */ - template (value) MN_Command_request m_mnCommandRequest_deleteFntp( - in template (value) CommandRef p_commandRef, - in template (value) DeleteFNTP p_deleteFntp - ) := { - commandRef := p_commandRef, - ref := 4, - command_param := { - FWTdelete := { - fwtNo := 0, - fwt := { - DeleteFNTP := p_deleteFntp - } // End of field 'fwt' - } // End of field 'FWTdelete' - } // End of field 'request_param' - } // End of template m_mnCommandRequest_deleteFntp - - } // group mnCommandRequestSend - - group mnCommandRequestRecv { - - /** - * @desc Receive template for MN-COMMAND.request service primitive - * @param p_commandRef TODO - * @param p_deleteFntp TODO - * @see ISO 24102-3 Clause 7.3.3 - */ - template (present) MN_Command_confirm mw_mnCommandConfirm_deleteFntpConf( - in template (present) CommandRef p_commandRef, - in template (present) DeleteFNTP p_deleteFntp - ) := { - commandRef := p_commandRef, - ref := 4, - cmdConfirm_param := { - FWTdelete := { - fwtNo := 0, - fwt := { - DeleteFNTP := p_deleteFntp - } // End of field 'fwt' - } // End of field 'FWTdelete' - }, // End of field 'request_param' - errStatus := 0 - } // End of template mw_mnCommandRequest_deleteFntp - - /** - * @desc Unspecified receive template for MN-COMMAND.confirm service primitive - * @see a_mgtMnSapPortDefault altstep statement - * @see ISO 24102-3 Clause 7.3.3 - */ - template MN_Command_confirm mw_mnCommandConfirm_any := { - commandRef := ?, - ref := ?, - cmdConfirm_param := ?, - errStatus := ? - } // End of template mw_mnCommandConfirm_any - - template MN_Command_confirm mdw_mnCommandConfirm( - in template (present) ErrStatus p_errorStatus - ) modifies mw_mnCommandConfirm_any:= { - errStatus := p_errorStatus - } // End of template mdw_mnCommandConfirm - - } // group nCommandRequestRecv - - } // End of group mnCommandRequest - - group mnRequestRequest { - - group mnRequestRequestSend { - - /** - * @desc Generic receive template for MN-REQUEST.request service primitive - * @param p_commandRef Unique cyclic reference number of command. - * @param p_request_param MF-Request message description - */ - template (value) MN_Request_request m_mnRequestRequest_setNotFNTP( - in template (value) CommandRef p_commandRef, - in template (value) SetNotFNTP p_setNotFntp - ) := { - commandRef := p_commandRef, - ref := 2, - request_param := { - FWTsetNot := { - fwtNo := 0, - fwt := { - SetNotFNTP := p_setNotFntp - } // End of 'fwt' field - } // End of 'FWTsetNot' field - } // End of 'request_param' field - } // End of template m_mnRequestRequest_setNotFNTP - - } // End of group mnRequestRequestSend - - group mnRequestRequestRecv { - - /** - * @desc Unspecified receive template for MN-REQUEST.request service primitive - * Used for: - *
  • modifying restrictif template
  • - *
  • default altstep
  • - * @see a_mgtMnSapPortDefault altstep statement - */ - template MN_Request_request mw_mnRequestRequest_any := { - commandRef := ?, - ref := ?, - request_param := ? - } // End of template mw_mnRequestRequest_any - - /** - * @desc Unspecified receive template for MN-REQUEST.confirm service primitive - * Used for: - *
  • modifying restrictif template
  • - *
  • default altstep
  • - * @see a_mgtMnSapPortDefault altstep statement - */ - template MN_Request_confirm mw_mnRequestConfirm_any := { - commandRef := ?, - ref := ?, - reqConfirm_param := ?, - errStatus := ? - } // End of template mw_mnRequestConfirm_any - - /** - * @desc Receive template for MN-Request.confirm service primitive - * @param p_errorStatus Error status in response of MN-REQUEST.request service primitive - */ - template MN_Request_confirm mw_mnRequestConfirm( - in template (present) ErrStatus p_errorStatus - ) modifies mw_mnRequestConfirm_any := { - errStatus := p_errorStatus - } // End of template mw_mnRequestConfirm - - /** - * @desc Receive template for MN-REQUEST.request service primitive - * @param p_commandRef Unique cyclic reference number of command. Same value as in related MNREQUEST.request - * @param p_mnReq Command issued by the ITS-S facilities layer and sent to the ITS-S management entity via the MN-SAP - */ - template MN_Request_request mw_mnRequestRequest_setNotFNTP( - in template (present) CommandRef p_commandRef, - in template (present) SetNotFNTP p_setNotFNTP - ) := { - commandRef := p_commandRef, - ref := 2, - request_param := { - FWTsetNot := { - fwtNo := 0, - fwt := { - SetNotFNTP := p_setNotFNTP - } // End of field 'fwt' - } // End of field 'FWTsetNot' - } // End of field 'request_param' - } // End of template mw_mnRequestRequest_setNotFNTP - - } // End of group mnRequestRequestRecv - - } // End of group mnRequestRequest - - group fwtNotifies { - - /** - * @desc Receive "FWTsetNot message" to notify the creation of an entry in a forwarding table - * @see ISO 24102-3 Clause E.2.3 - */ - template (present) MN_Request_request mdw_fwtSetNotRequestReq_any - modifies mw_mnRequestRequest_any := { - ref := 2, - request_param := { - FWTsetNot := { - fwtNo := 0, - fwt := { - SetNotFNTP := mw_fwtSetNot_any - } // End of field 'fwt' - } // End of field 'FWTsetNot' - } // End of field 'request_param' - } // End of template mdw_fWTSetNotRequestReq_any - - /** - * @desc Receive "FWTsetNot message" to notify the creation of an entry in a forwarding table - * @param p_portNumber The provided port number value - * @param p_linkId Set VCI link identifier - * @param p_remotePortNumber The remote port number value - * @param p_linkPortNumber The linked port number value - * @see ISO 24102-3 Clause E.2.3 - */ - template (present) MN_Request_request mdw_fwtSetNotRequestReq( - in template (present) PortNumber p_portNumber, - in template (value) UserPriority p_userPriority, - in template (value) Link_ID p_linkId, - in template (value) PortNumber p_remotePortNumber, - in template (value) PortNumber p_linkPortNumber - ) modifies mdw_fwtSetNotRequestReq_any := { - request_param := { - FWTsetNot := { - fwtNo := 0, - fwt := { - SetNotFNTP := { - remotePort := p_remotePortNumber, - linkID := p_linkId, - linkPort := p_linkPortNumber, - serviceInfo := { - servicePort := p_portNumber, - hostITSscu := ?, - servicePriority := 0 // FIXME Shall be a parameter - }, - priority := p_userPriority - } - } // End of field 'fwt' - } // End of field 'FWTsetNot' - } // End of field 'request_param' - } // End of template mdw_fwtSetNotRequestReq - - /** - * @desc Receive MN_Request_request/FWTdeleteNot template - * @param p_reference The reference value associated to the provided port number - * @see ISO 24102-3 Clause 7.3.3 - */ - template MN_Request_request mdw_fwtDeleteFntp( - in template (present) integer p_reference - ) modifies mw_mnRequestRequest_any := { - ref := 4, - request_param := { - FWTdeleteNot := { - fwtNo := 2, - fwt := { - DeleteNotFNTP := { - reference := p_reference - } - } // End of field 'fwt' - } // End of field 'FWTdeletNot' - } // End of field 'request_param' - } // End of template mw_fwtDeleteFntp - - } // End of group fwtNotifies - - group fwtCommands { - - /** - * @desc Received template on forwarding table update request - * @see ISO 24102-3 Clause D.2.4 - */ - template MN_Command_request mw_fwtUpdateCommandReq := { - commandRef := ?, - ref := 3, - command_param := { - FWTupdate := { - fwtNo := 0, - fwt := { - UpdateFNTP := mw_fwtUpdate - } // End of field 'fwt' - } // End of field 'FWTupdate' - } // End of field 'command_param' - } // End of template mw_fWTUpdateCommandReq - - /** - * @desc Received template on forwarding table change request - * @see ISO 24102-3 D.2.3 FWTset - */ - template MN_Command_request mw_fwtSetCommandReq := { - commandRef := ?, - ref := 2, - command_param := { - FWTset := { - fwtNo := 0, - fwt := { - SetFNTP := mw_fwtSet_any - } // End of field 'fwt' - } // End of field 'FWTset' - } // End of field 'command_param' - } // End of template mw_fwtSetCommandReq - - /** - * @desc Receive a "FWTupdate message" to update the FNTP forwarding table - * @see ISO 24102-3 Clause E.2.4 - */ - template UpdateFNTP mw_fwtUpdate := { - fill := '0'B, - reference := ?, - remotePort := omit, - linkID := omit, - ciStatus := omit, - linkPort := omit, - serviceInfo := omit, - priority := omit, - timeout_ := 100 - } // End of template mw_fwtUpdate - - /** - * @desc Generic received template on setting an entry in the forwarding table of a networking protocol - * Used for: - *
  • modifying restrictif template
  • - *
  • default altstep
  • - * @see ISO 24102-3 D.2.3 FWTset - */ - template SetFNTP mw_fwtSet_any := { - remotePort := ?, - linkID := ?, - ciStatus := ?, - linkPort := ?, - serviceInfo := ?, - priority := ?, - timeout_ := ? - } // End of template mw_fwtSet_any - - template SetNotFNTP mw_fwtSetNot_any := { - reference := ?, - remotePort := ?, - linkID := ?, - ciStatus := ?, - linkPort := ?, - serviceInfo := ?, - priority := ?, - timeout_ := ? - } // End of template mw_fwtSetNot_any - - } // End of group fwtCommands - - } // End of group mgtMnSapTemplates - - group mgtMiSapTemplates { - - group mgtMiSapTemplatesSend { - - /** - * @desc Send template for MI-COMMAND.request service primitive - * @param p_linkID Link ID of the peer station - * @param p_commandRef Unique cyclic reference number of command. Same value as in related MN-REQUEST.request - * @param p_command_param MI_Command message description - * @see ISO 24102-3 Clause 6.4.2 MI-COMMAND.request - */ - template (value) MI_Command_request m_miCommandRequest_wakeUp( - in template (value) Link_ID p_linkId, - in template (value) CommandRef p_commandRef, - in template (value) WakeUp p_wakeUp - ) := { - linkID := p_linkId, - commandRef := p_commandRef, - ref := 3, - command_param := { - WakeUp := p_wakeUp - } // End of 'command_param' field - } // End of template m_miCommandRequest_wakeUp - - /** - * @desc Generic receive template for MN-REQUEST.request service primitive - * @param p_linkId Link identifier of the CI - * @param p_commandRef Unique cyclic reference number of command. - * @param p_request_param MI-Request message description - */ - template (value) MI_Request_request m_miRequestRequest_regReq( - in template (value) Link_ID p_linkId, - in template (value) CommandRef p_commandRef, - in template (value) RegReq p_regReq - ) := { - linkID := p_linkId, - commandRef := p_commandRef, - ref := 1, - request_param := { RegReq := p_regReq } - } // End of template m_miRequestRequest_regReq - - /** - * @desc Send template for MI-GET service primitive - * @param p_linkID Link ID of the peer station - * @param p_commandRef Unique cyclic reference number of command. Same value as in related MN-REQUEST.request - * @param p_get_param_no Reference number of parameter to be monitored - * @see ISO 24102-3 6.3.1 MI-GET.request - * @see ISO 21218 Annex A (normative) I parameters - */ - template (value) MI_Get_request m_miGetRequest( - in template (value) Link_ID p_linkId, - in template (value) CommandRef p_commandRef, - in template (value) IParamNoList p_getParamNo - ) := { - linkID := p_linkId, - commandRef := p_commandRef, - get_param_no := p_getParamNo - } // End of template m_miGetRequest - - /** - * @desc Send template for MI-SET service primitive - * @param p_linkID Link ID of the peer station - * @param p_commandRef Unique cyclic reference number of command. Same value as in related MN-REQUEST.request - * @param p_get_param_no Reference number of parameter to be monitored - * @see ISO 24102-3 6.3.1 MI-SET.request - * @see ISO 21218 Annex A (normative) I parameters - */ - template (value) MI_Set_request m_miSetRequest( - in template (value) Link_ID p_linkId, - in template (value) CommandRef p_commandRef, - in template (value) IParamList p_setParam - ) := { - linkID := p_linkId, - commandRef := p_commandRef, - set_param := p_setParam - } // End of template m_miSetRequest - - } // End of group mgtMiSapTemplatesSend - - group mgtMiSapTemplatesRecv { - - /** - * @desc Receive template for MI-COMMAND.request service primitive - * @param p_linkID Link ID of the peer station - * @param p_commandRef Unique cyclic reference number of command. Same value as in related MN-REQUEST.request - * @param p_miCmd MI-Command message description - * @see ISO 24102-3 6.4.2 MI-COMMAND.request - */ - template (present) MI_Command_request mw_miCommandRequest_wakeUp( - in template (present) Link_ID p_linkId, - in template (present) CommandRef p_commandRef, - in template (present) WakeUp p_wakeUp - ) := { - linkID := p_linkId, - commandRef := p_commandRef, - ref := 3, - command_param := {WakeUp := p_wakeUp} - } // End of template mw_miCommandRequest_wakeUp - - /** - * @desc Send template for MI-COMMAND.confirm service primitive - * @see ISO 24102-3 Clause 6.4.3 MI-COMMAND.confirm - */ - template (present) MI_Command_confirm mw_miCommandConfirm_wakeUp( - in template (present) Link_ID p_linkId, - in template (present) CommandRef p_commandRef - ) := { - linkID := p_linkId, - commandRef := p_commandRef, - errStatus := 0 - } // End of template mw_miCommandConfirm_wakeUp - - /** - * @desc Receive template for MI-REQUEST.request service primitive - * @param p_commandRef Unique cyclic reference number of command. Same value as in related MNREQUEST.request - * @param p_miReq Command issued by the ITS-S facilities layer and sent to the ITS-S management entity via the MI-SAP - */ - template (present) MI_Request_request mw_miRequestRequest_regReq( - in template (present) Link_ID p_linkId, - in template (present) CommandRef p_commandRef, - in template (present) RegReq p_regReq - ) := { - linkID := p_linkId, - commandRef := p_commandRef, - ref := 1, - request_param := { RegReq := p_regReq } - } // End of template mw_miRequestRequest_regReq - - template (present) MI_Request_confirm mw_miRequestConfirm( - in template (present) ErrStatus p_errorStatus - ) := { - linkID := ?, - commandRef := ?, - errStatus := p_errorStatus - } // End of template mw_miRequestConfirm - - /** - * @desc Receive template for MI-GET.request service primitive - * @param p_linkID Link ID of the peer station - * @param p_commandRef Unique cyclic reference number of command. Same value as in related MN-REQUEST.request - * @param p_get_param_no Reference number of parameter to be monitored - * @see ISO 24102-3 6.3.1 MI-GET.request - * @see ISO 21218 Annex A (normative) I parameters - */ - template (present) MI_Get_request mw_miGetRequest( - in template (present) Link_ID p_linkId, - in template (present) CommandRef p_commandRef, - in template (present) IParamNoList p_getParamNo - ) := { - linkID := p_linkId, - commandRef := p_commandRef, - get_param_no := p_getParamNo - } // End of template mw_miGetRequest - - /** - * @desc Send template for MI-GET.confirm service primitive - * @see ISO 24102-3 Clause 6.4.2 MI-GET.confirm - */ - template (present) MI_Get_confirm mw_miGetConfirm( - in template (present) Link_ID p_linkId, - in template (present) CommandRef p_commandRef, - in template (present) IParamList p_getParam - ) := { - linkID := p_linkId, - commandRef := p_commandRef, - get_param := p_getParam - } // End of template mw_miGetConfirm - - /** - * @desc Receive template for MI-SET.request service primitive - * @param p_linkID Link ID of the peer station - * @param p_commandRef Unique cyclic reference number of command. Same value as in related MN-REQUEST.request - * @param p_set_param Reference number of parameter to be monitored - * @see ISO 24102-3 6.3.1 MI-SET.request - * @see ISO 21218 Annex A (normative) I parameters - */ - template (present) MI_Set_request mw_miSetRequest( - in template (present) Link_ID p_linkId, - in template (present) CommandRef p_commandRef, - in template (present) IParamList p_setParam - ) := { - linkID := p_linkId, - commandRef := p_commandRef, - set_param := p_setParam - } // End of template mw_miSetRequest - - /** - * @desc Send template for MI-SET.confirm service primitive - * @see ISO 24102-3 Clause 6.2.2 MI-SET.confirm - */ - template (present) MI_Set_confirm mw_miSetConfirm( - in template (present) Link_ID p_linkId, - in template (present) CommandRef p_commandRef, - in template (present) Errors p_setParam - ) := { - linkID := p_linkId, - commandRef := p_commandRef, - set_param := p_setParam - } // End of template mw_miSetConfirm - - } // End of mgtMiSapTemplatesRecv - - } // End of group mgtMiSapTemplates - - } // End of group mgtSapTemplates - -} // End of module LibItsMgt_Templates \ No newline at end of file diff --git a/ttcn/CALM/MGT/LibItsMgt_TypesAndValues.ttcn3 b/ttcn/CALM/MGT/LibItsMgt_TypesAndValues.ttcn3 deleted file mode 100644 index 77d53f59..00000000 --- a/ttcn/CALM/MGT/LibItsMgt_TypesAndValues.ttcn3 +++ /dev/null @@ -1,114 +0,0 @@ -/** - * @author ETSI / STF422_EETS - * @version $URL$ - * $Id$ - * @desc Types and constants definitions for ITS station management (ISO 24102-3) - */ -module LibItsMgt_TypesAndValues { - - // LibCommon - import from LibCommon_BasicTypesAndValues { - type UInt8 - }; - - // LibIts - - // LibItsCalm - import from CALMllsap language "ASN.1:1997" { - type - I_Param, I_ParamNo, Errors, Link_ID, EUI64 - }; - import from CALMfntp language "ASN.1:1997" { - type - PortNumber - }; - - group asn1Constants { - - group medTypeConstants { // CALMllsap ASN.1 module - - const UInt8 c_medType_unknown := 0; - const UInt8 c_medType_any := 1; - const UInt8 c_medType_iso21212 := 2; // 2G - const UInt8 c_medType_iso21213 := 3; // 3G - const UInt8 c_medType_iso21214 := 4; // IR - const UInt8 c_medType_iso21215 := 5; // M5 - const UInt8 c_medType_iso21216 := 6; // MM - const UInt8 c_medType_iso25112 := 7; // 802.16e - const UInt8 c_medType_iso25113 := 8; // HC-SDMA - const UInt8 c_medType_iso29283 := 9; // 802.20 - const UInt8 c_medType_iso17515 := 10; // LTE - const UInt8 c_medType_iso15628 := 128; // DSRC - const UInt8 c_medType_can := 254; - const UInt8 c_medType_ethernet := 255; - - } // End of group medTypeConstants - - group cIaClassConstants { // CALMllsap ASN.1 module - - const UInt8 c_cIaClass_unknown := 0; - const UInt8 c_cIaClass_ciac_1 := 1; - const UInt8 c_cIaClass_ciac_2 := 2; - const UInt8 c_cIaClass_ciac_3 := 3; - } // End of group cIcClassConstants - - group cIClassConstants { // CALMllsap ASN.1 module - - const UInt8 c_cIClass_unknown := 0; - const UInt8 c_cIClass_cic_l1 := 1; - const UInt8 c_cIClass_cic_l2 := 2; - const UInt8 c_cIClass_cic_l3 := 3; - const UInt8 c_cIClass_cic_l4 := 4; - const UInt8 c_cIClass_cic_l5 := 5; - const UInt8 c_cIClass_cic_il1 := 254; - const UInt8 c_cIClass_cic_il2 := 255; - - } // End of group cIcClassConstants - - group dirModeConstants { // CALMllsap ASN.1 module - - const UInt8 c_dirMode_fixed := 0; - const UInt8 c_dirMode_tracking := 255; - - } // End of group dirModeConstants - - } // End of group asn1Constants - - group constants { - - const PortNumber c_unknown_portLong := { - portLong := 32767 - } - - /** - * @desc Get the DNI CCID value - * @return The DNI CCID value - * @verdict Unchanged - * @see ISO 21218 - Annex C.1 EUI-64 format - */ - const EUI64 c_dniCiid := 'FFFFFFFFFFFFFFFF'O; - - const Link_ID c_linkId_unknown := { - remoteCIID := c_dniCiid, - localCIID := c_dniCiid - } - - } // End of group constants - - - /** - * Need to redefine ASN.1 type get-param-no SEQUENCE OF I-ParamNo - */ - type record of I_ParamNo IParamNoList; - - /** - * Need to redefine ASN.1 type set-param SEQUENCE OF I-Param - */ - type record of I_Param IParamList; - -// type record of Errors IErrorsList; - -} -with { - encode "LibItsMgt_TypesAndValues" -} // End of module LibItsMgt_TypesAndValues diff --git a/ttcn/DCC/LibItsDcc_Functions.ttcn b/ttcn/DCC/LibItsDcc_Functions.ttcn deleted file mode 100644 index e0b16e31..00000000 --- a/ttcn/DCC/LibItsDcc_Functions.ttcn +++ /dev/null @@ -1,944 +0,0 @@ -module LibItsDcc_Functions { - - // Libcommon - import from LibCommon_Sync all; - import from LibCommon_Time all; - import from LibCommon_VerdictControl all; - - // LibIts - import from LibItsDcc_TypesAndValues all; - import from LibItsDcc_Templates all; - import from LibItsDcc_Pixits all; - import from LibItsDcc_Pics all; - import from LibItsDcc_TestSystem all; - - group dccConfigurationFunctions { - - /** - * @desc Setups default configuration - */ - function f_cfUp(out UtComp p_utComp, - out ItsInDcc p_itsInDcc, - out ItsRrxDcc p_itsRrxDcc, - in template (value) UtTrigger p_trigger) runs on ServerSyncComp { - - // Create - p_utComp := UtComp.create("Upper Tester") alive; - p_itsInDcc := ItsInDcc.create("IN_SAP"); - p_itsRrxDcc := ItsRrxDcc.create("RRX"); - - // Connect - connect(p_utComp:syncPort, self:syncPort); - connect(p_itsInDcc:syncPort, self:syncPort); - connect(p_itsRrxDcc:syncPort, self:syncPort); - connect(p_itsInDcc:checkPort, mtc:checkPort); - connect(p_itsRrxDcc:checkPort, mtc:checkPort); - - //Map - map(p_utComp:utPort, system:utPort); - map(p_itsInDcc:inPort, system:inPort); - map(p_itsRrxDcc:rrxPort, system:rrxPort); - - // Initialize radio equipment - p_utComp.start(f_utInitializeIut(m_utInitialize(m_utRadioInitialize))); - p_utComp.done; - // Put channel(s) into defined state - p_utComp.start(f_utTriggerEvent(p_trigger)); - p_utComp.done; - } // end f_cfUp - - /** - * @desc Deletes default configuration - */ - function f_cfDown(in UtComp p_utComp, - in ItsInDcc p_itsInDcc, - in ItsRrxDcc p_itsRrxDcc) runs on ServerSyncComp { - - f_serverWaitForAllClientsToStop(); - // Disconnect - disconnect(p_utComp:syncPort, self:syncPort); - disconnect(p_itsInDcc:syncPort, self:syncPort); - disconnect(p_itsRrxDcc:syncPort, self:syncPort); - disconnect(p_itsInDcc:checkPort, mtc:checkPort); - disconnect(p_itsRrxDcc:checkPort, mtc:checkPort); - - // Unmap - unmap(p_utComp:utPort, system:utPort); - unmap(p_itsInDcc:inPort, system:inPort); - unmap(p_itsRrxDcc:rrxPort, system:rrxPort); - - } // end f_cfDown - - } // end of dccConfigurationFunctions - - /** - * @desc Upper tester functions - */ - group utFuntions { - - /** - * @desc Requests to bring the IUT in an initial state - * @param p_init The initialisation to trigger. - */ - function f_utInitializeIut(template (value) UtInitialize p_init) runs on UtComp { - - utPort.send(p_init); - tc_wait.start; - alt { - [] utPort.receive(UtResult:true) { - tc_wait.stop; - log("*** " & __SCOPE__ & ": INFO: IUT initialized ***"); - } - [] utPort.receive { - tc_wait.stop; - log("*** " & __SCOPE__ & ": INFO: IUT could not be initialized ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_wait.timeout { - log("*** " & __SCOPE__ & ": INFO: IUT could not be initialized in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [else] { // Shortcut defaults - //f_sleep(0.050); // 50 ms - repeat; - } - } - } - - /** - * @desc Triggers event on the radio interface - * @param p_trigger The event to trigger. - */ - function f_utTriggerEvent(template (value) UtTrigger p_trigger) runs on UtComp { - - utPort.send(p_trigger); - alt { - [] utPort.receive(UtResult:true) { - tc_wait.stop; - log("*** " & __SCOPE__ & ": INFO: Event sccessfully triggered ***"); - } - [] utPort.receive { - tc_wait.stop; - log("*** " & __SCOPE__ & ": INFO: Event could not be triggered ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_wait.timeout { - log("*** " & __SCOPE__ & ": INFO: Event could not be triggered in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [else] { // Shortcut defaults - //f_sleep(0.050); // 50 ms - repeat; - } - } - - } - } // End of group utFunctions - - group rrxFunctions { - - /** - * @desc Receive frames via the radio link and check that all expected frames are sent with - * the requested Tx power and inter-packet spacing on the chosen channel - * @param p_tOff Requested Toff value - * @param p_expectedTxPower Expected Tx send power value - * @param p_channel Channel on which the frame has been sent - * @param p_checkPower If true, the power of the received signal will be checked - */ - function f_rRX_ExpectedFramesSent(float p_tOff, - integer p_expectedTxPower, - Channel p_channel, - boolean p_checkPower := true) runs on ItsRrxDcc { - - var RrxInd v_rrxInd; - var integer v_frameReceivedCount := 0; - - template integer m_expectedPowerWithDelta := ((p_expectedTxPower - PIXIT_POWER_DELTA) .. (p_expectedTxPower + PIXIT_POWER_DELTA)); - - timer tc_testDuration := f_getTestDuration(p_tOff) + p_tOff; - timer tc_tOffCheck := 2.0 * p_tOff; - - f_selfOrClientSyncAndVerdict(c_prDone, e_success); - - tc_testDuration.start; - - alt { - [] rrxPort.receive(m_rrxInd(p_channel, ?)) -> value v_rrxInd { - v_frameReceivedCount := v_frameReceivedCount + 1; - if(p_checkPower and match(v_rrxInd.measuredPower, m_expectedPowerWithDelta)) - { log("*** function " & __SCOPE__ & ": FAIL: The measured Tx power is different to the requested Tx power. ***"); - setverdict(fail)} - tc_tOffCheck.start; - alt { - [] rrxPort.receive(m_rrxInd(p_channel, ?)) -> value v_rrxInd { - v_frameReceivedCount := v_frameReceivedCount + 1; - if(p_checkPower and match(v_rrxInd.measuredPower, m_expectedPowerWithDelta)) - { log("*** function " & __SCOPE__ & ": FAIL: The measured Tx power is different to the requested Tx power. ***"); - setverdict(fail)} - if(tc_tOffCheck.read < p_tOff) - { log("*** function " & __SCOPE__ & ": FAIL: The inter-packet spacing time interval is smaller than the minimum allowed. ***"); - setverdict(fail)} - tc_tOffCheck.start; - repeat; - } - [] tc_tOffCheck.timeout { - tc_tOffCheck.start; - repeat; - } - [] tc_testDuration.timeout - {setverdict(pass)} - } - } - [] tc_testDuration.timeout { - log("*** function " & __SCOPE__ & ": FAIL: No packet received on the radio interface. ***"); - setverdict(fail) - } - } - - checkPort.send(v_frameReceivedCount); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - - } // End of function f_rRX_ExpectedFramesSent - - /** - * @desc Receive frames via the radio link and check that all expected frames are sent with - * the requested Tx power and inter-packet spacing on the chosen channels - * @param p_tOff Requested Toff value - * @param p_expectedTxPower Expected Tx send power value - * @param p_channel_1 Channel on which the frame has been sent - * @param p_channel_2 Channel on which the frame has been sent - * @param p_checkPower If true, the power of the received signal will be checked - */ - function f_rRX_ExpectedFramesSentOn2Channels(float p_tOff, - integer p_expectedTxPower, - Channel p_channel_1, - Channel p_channel_2, - boolean p_checkPower := false) runs on ItsRrxDcc { - - var RrxInd v_rrxInd; - var integer v_frameReceivedCount := 0; - var boolean v_channel_1, v_channel_2 := false; - - template integer m_expectedPowerWithDelta := ((p_expectedTxPower - PIXIT_POWER_DELTA) .. (p_expectedTxPower + PIXIT_POWER_DELTA)); - - timer tc_testDuration := f_getTestDuration(p_tOff) + p_tOff; - timer tc_tOffCheck := 2.0 * p_tOff; - - f_selfOrClientSyncAndVerdict(c_prDone, e_success); - - tc_testDuration.start; - - alt { - [] rrxPort.receive(m_rrxInd((p_channel_1, p_channel_2), ?)) -> value v_rrxInd { - v_frameReceivedCount := v_frameReceivedCount + 1; - select (v_rrxInd.channel) { - case (p_channel_1) { - v_channel_1 := true; - } - case (p_channel_2) { - v_channel_2 := true; - } - } - if(p_checkPower and match(v_rrxInd.measuredPower, m_expectedPowerWithDelta)) - { log("*** function " & __SCOPE__ & ": FAIL: The measured Tx power is different to the requested Tx power. ***"); - setverdict(fail)} - tc_tOffCheck.start; - alt { - [] rrxPort.receive(m_rrxInd((p_channel_1, p_channel_2), ?)) -> value v_rrxInd { - v_frameReceivedCount := v_frameReceivedCount + 1; - select (v_rrxInd.channel) { - case (p_channel_1) { - v_channel_1 := true; - } - case (p_channel_2) { - v_channel_2 := true; - } - } - if(p_checkPower and match(v_rrxInd.measuredPower, m_expectedPowerWithDelta)) - { log("*** function " & __SCOPE__ & ": FAIL: The measured Tx power is different to the requested Tx power. ***"); - setverdict(fail)} - if(tc_tOffCheck.read < p_tOff) - { log("*** function " & __SCOPE__ & ": FAIL: The inter-packet spacing time interval is smaller than the minimum allowed. ***"); - setverdict(fail)} - tc_tOffCheck.start; - repeat; - } - [] tc_tOffCheck.timeout { - tc_tOffCheck.start; - repeat; - } - [] tc_testDuration.timeout { - if(not v_channel_1 and not v_channel_2) { - log("*** function " & __SCOPE__ & ": FAIL: All frames have been sent via the two channel. ***"); - setverdict(fail); - } - else { - setverdict(pass); - } - } - } - } - [] tc_testDuration.timeout { - log("*** function " & __SCOPE__ & ": FAIL: No packet received on the radio interface. ***"); - setverdict(fail) - } - } - - checkPort.send(v_frameReceivedCount); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - - } // End of function f_rRX_ExpectedFramesSent - - /** - * @desc Check that no frames are received via the radio link - * @param p_tOff Requested Toff value - */ - function f_rRX_NoFramesSent(float p_tOff) runs on ItsRrxDcc { - - timer tc_testDuration := f_getTestDuration(p_tOff); - - f_selfOrClientSyncAndVerdict(c_prDone, e_success); - - tc_testDuration.start; - - alt { - [] rrxPort.receive(m_rrxInd(?, ?)) { - log("*** function " & __SCOPE__ & ": FAIL: A radio frame was received when none was expected. ***"); - setverdict(fail) - } - [] tc_testDuration.timeout { - setverdict(pass) - } - } - - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - - } // End of function f_rRX_NoFramesSent - } // End of group rrxFunctions - - /** - * @desc IN SAP functions - */ - group inFuntions { - - /** - * @desc Request sending of frames via the IN_SAP and check that all frames are - * reported as sent with the requested Tx power - * @param p_tOff Requested Toff value - * @param p_requestedTxPower Requested Tx send power value - * @param p_dCCProfileIdentifier Requested DCC profile - * @param p_channel Channel on which the frame has been sent - */ - function f_iN_AllRequestedFramesSent(float p_tOff, - integer p_requestedTxPower, - integer p_dCCProfileIdentifier, - Channel p_channel) runs on ItsInDcc { - - var integer v_commandReference := float2int(int2float(c_maxCommandReference)*rnd()); - var InSta v_inSta; - var integer v_frameRequestedCount := 1; - var integer v_frameAcknowledgedCount := 0; - - timer tc_testDuration := f_getTestDuration(p_tOff); - timer tc_tOff := p_tOff; - - f_selfOrClientSyncAndVerdict(c_prDone, e_success); - - inPort.send(m_In_Request(v_commandReference, - PIXIT_REFERENCE_BURST, - p_requestedTxPower, - p_dCCProfileIdentifier)); - tc_testDuration.start; - - alt { - [] inPort.receive(mw_In_Status(v_commandReference, - p_channel, - true)) -> value v_inSta { - v_commandReference := (v_commandReference + 1) mod c_maxCommandReference; - v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; - if(v_inSta.achievedSendPower != p_requestedTxPower) - { log("*** function " & __SCOPE__ & ": FAIL: The achieved Tx power is different to the requested Tx power. ***"); - setverdict(fail)} - tc_tOff.start; - repeat; - } - - [] tc_tOff.timeout { - inPort.send(m_In_Request(v_commandReference, - PIXIT_REFERENCE_BURST, - p_requestedTxPower, - p_dCCProfileIdentifier)); - v_frameRequestedCount := v_frameRequestedCount + 1; - repeat; - } - - [] tc_testDuration.timeout { - if(v_frameAcknowledgedCount == v_frameRequestedCount) - {setverdict(pass)} - else - {tc_tOff.start; - alt { - [] inPort.receive(mw_In_Status(v_commandReference, - p_channel, - true)) -> value v_inSta { - tc_tOff.stop; - v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; - if(v_inSta.achievedSendPower != p_requestedTxPower) - { log("*** function " & __SCOPE__ & ": FAIL: The achieved Tx power is different to the requested Tx power. ***"); - setverdict(fail)} - else if(v_frameAcknowledgedCount != v_frameRequestedCount) - { log("*** function " & __SCOPE__ & ": FAIL: Not all requested frames have been acknowledged. ***"); - setverdict(fail)} - else - {setverdict(pass)} - } - - [] tc_tOff.timeout { - log("*** function " & __SCOPE__ & ": FAIL: Not all requested frames have been acknowledged. ***"); - setverdict(fail) - } - } - } - } - } - checkPort.send(v_frameAcknowledgedCount); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - - } // End of function f_iN_AllRequestedFramesSent - - /** - * @desc Request sending of frames via the IN_SAP and check that all frames are - * reported as sent with reduced Tx power being lower than the maximum allowed Tx power - * @param p_tOff Requested Toff value - * @param p_requestedTxPower Requested Tx send power value - * @param p_dCCProfileIdentifier Requested DCC profile - * @param p_channel Channel on which the frame has been sent - * @param p_maxTxPower Maximum allowed Tx power value - */ - function f_iN_FramesSentTxPowerReduction(float p_tOff, - integer p_requestedTxPower, - integer p_dCCProfileIdentifier, - Channel p_channel, - integer p_maxTxPower) runs on ItsInDcc { - - var integer v_commandReference := float2int(int2float(c_maxCommandReference)*rnd()); - var InSta v_inSta; - var integer v_frameRequestedCount := 1; - var integer v_frameAcknowledgedCount := 0; - - timer tc_testDuration := f_getTestDuration(p_tOff); - timer tc_tOff := p_tOff; - - f_selfOrClientSyncAndVerdict(c_prDone, e_success); - - inPort.send(m_In_Request(v_commandReference, - PIXIT_REFERENCE_BURST, - p_requestedTxPower, - p_dCCProfileIdentifier)); - tc_testDuration.start; - - alt { - [] inPort.receive(mw_In_Status(v_commandReference, - p_channel, - true)) -> value v_inSta { - v_commandReference := (v_commandReference + 1) mod c_maxCommandReference; - v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; - if(v_inSta.achievedSendPower >= p_maxTxPower) - { log("*** function " & __SCOPE__ & ": FAIL: The achieved Tx power is higher than the maximum allowed Tx power. ***"); - setverdict(fail)} - tc_tOff.start; - repeat; - } - - [] tc_tOff.timeout { - inPort.send(m_In_Request(v_commandReference, - PIXIT_REFERENCE_BURST, - p_requestedTxPower, - p_dCCProfileIdentifier)); - v_frameRequestedCount := v_frameRequestedCount + 1; - repeat; - } - - [] tc_testDuration.timeout { - if(v_frameAcknowledgedCount == v_frameRequestedCount) - {setverdict(pass)} - else - {tc_tOff.start; - alt { - [] inPort.receive(mw_In_Status(v_commandReference, - p_channel, - true)) -> value v_inSta { - tc_tOff.stop; - v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; - if(v_inSta.achievedSendPower >= p_maxTxPower) - { log("*** function " & __SCOPE__ & ": FAIL: The achieved Tx power is higher than the maximum allowed Tx power. ***"); - setverdict(fail)} - else if(v_frameAcknowledgedCount != v_frameRequestedCount) - { log("*** function " & __SCOPE__ & ": FAIL: Not all requested frames have been acknowledged. ***"); - setverdict(fail)} - else - {setverdict(pass)} - } - - [] tc_tOff.timeout { - log("*** function " & __SCOPE__ & ": FAIL: Not all requested frames have been acknowledged. ***"); - setverdict(fail) - } - } - } - } - } - checkPort.send(v_frameAcknowledgedCount); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - - } // End of function f_iN_FramesSentTxPowerReduction - - /** - * @desc Request sending of frames via the IN_SAP and check that all frames are dropped - * @param p_tOff Requested Toff value - * @param p_requestedTxPower Requested Tx send power value - * @param p_dCCProfileIdentifier Requested DCC profile - */ - function f_iN_AllRequestedFramesDropped(float p_tOff, - integer p_requestedTxPower, - integer p_dCCProfileIdentifier) runs on ItsInDcc { - - var integer v_commandReference := float2int(int2float(c_maxCommandReference)*rnd()); - var InSta v_inSta; - - timer tc_testDuration := f_getTestDuration(p_tOff); - timer tc_tOff := p_tOff; - - f_selfOrClientSyncAndVerdict(c_prDone, e_success); - - inPort.send(m_In_Request(v_commandReference, - PIXIT_REFERENCE_BURST, - p_requestedTxPower, - p_dCCProfileIdentifier)); - tc_testDuration.start; - - alt { - [] inPort.receive(mw_In_Status(v_commandReference, - ?, - ?)) -> value v_inSta { - v_commandReference := (v_commandReference + 1) mod c_maxCommandReference; - if(v_inSta.transmissionSuccessStatus) - { log("*** function " & __SCOPE__ & ": FAIL: A frame that should have been dropped is achnowledged as successfully sent. ***"); - setverdict(fail)} - tc_tOff.start; - repeat; - } - - [] tc_tOff.timeout { - inPort.send(m_In_Request(v_commandReference, - PIXIT_REFERENCE_BURST, - p_requestedTxPower, - p_dCCProfileIdentifier)); - repeat; - } - - [] tc_testDuration.timeout { - setverdict(pass) - } - } - f_selfOrClientSyncAndVerdict(c_prDone, e_success); - - } // End of function f_iN_AllRequestedFramesDropped - - /** - * @desc Request sending of frames via the IN_SAP and check that some frames are - * reported as sent and some reported as dropped - * @param p_tOff Requested Toff value - * @param p_requestedTxPower Requested Tx send power value - * @param p_dCCProfileIdentifier Requested DCC profile - * @param p_channel Channel on which the frame has been sent - */ - function f_iN_SomeRequestedFramesSent(float p_tOff, - integer p_requestedTxPower, - integer p_dCCProfileIdentifier, - Channel p_channel) runs on ItsInDcc { - - var integer v_commandReference := float2int(int2float(c_maxCommandReference)*rnd()); - var InSta v_inSta; - var integer v_frameRequestedCount := 1; - var integer v_frameAcknowledgedCount := 0; - var integer v_frameSentCount := 0; - var boolean v_frameSent, v_frameDropped := false; - - timer tc_testDuration := f_getTestDuration(p_tOff); - timer tc_tOff := p_tOff; - - f_selfOrClientSyncAndVerdict(c_prDone, e_success); - - inPort.send(m_In_Request(v_commandReference, - PIXIT_REFERENCE_BURST, - p_requestedTxPower, - p_dCCProfileIdentifier)); - tc_testDuration.start; - - alt { - [] inPort.receive(mw_In_Status(v_commandReference, - p_channel, - true)) -> value v_inSta { - v_commandReference := (v_commandReference + 1) mod c_maxCommandReference; - v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; - v_frameSentCount := v_frameSentCount + 1; - v_frameSent := true; - tc_tOff.start; - repeat; - } - - [] inPort.receive(mw_In_Status(v_commandReference, - p_channel, - false)) -> value v_inSta { - v_commandReference := (v_commandReference + 1) mod c_maxCommandReference; - v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; - v_frameDropped := true; - tc_tOff.start; - repeat; - } - - [] tc_tOff.timeout { - inPort.send(m_In_Request(v_commandReference, - PIXIT_REFERENCE_BURST, - p_requestedTxPower, - p_dCCProfileIdentifier)); - v_frameRequestedCount := v_frameRequestedCount + 1; - repeat; - } - - [] tc_testDuration.timeout { - if(not v_frameSent and v_frameDropped) - { log("*** function " & __SCOPE__ & ": FAIL: There are either no sent frames or no dropped frames acknowledged. ***"); - setverdict(fail)} - if(v_frameAcknowledgedCount == v_frameRequestedCount) - {setverdict(pass)} - else - {tc_tOff.start; - alt { - [] inPort.receive(mw_In_Status(v_commandReference, - p_channel, - ?)) -> value v_inSta { - tc_tOff.stop; - v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; - if(v_inSta.transmissionSuccessStatus) - { v_frameSentCount := v_frameSentCount + 1;} - if(v_frameAcknowledgedCount != v_frameRequestedCount) - { log("*** function " & __SCOPE__ & ": FAIL: Not all requested frames have been acknowledged. ***"); - setverdict(fail)} - else - {setverdict(pass)} - } - - [] tc_tOff.timeout { - log("*** function " & __SCOPE__ & ": FAIL: Not all requested frames have been acknowledged. ***"); - setverdict(fail) - } - } - } - } - } - checkPort.send(v_frameSentCount); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - - } // End of function f_iN_SomeRequestedFramesSent - - /** - * @desc Request sending of frames via the IN_SAP and check that all frames are - * reported as sent via two different channels - * @param p_tOff Requested Toff value - * @param p_requestedTxPower Requested Tx send power value - * @param p_dCCProfileIdentifier Requested DCC profile - * @param p_channel_1 First channel on which the frame has been sent - * @param p_channel_2 Second channel on which the frame has been sent - */ - function f_iN_AllRequestedFramesSentOn2Channels(float p_tOff, - integer p_requestedTxPower, - integer p_dCCProfileIdentifier, - Channel p_channel_1, - Channel p_channel_2) runs on ItsInDcc { - - var integer v_commandReference := float2int(int2float(c_maxCommandReference)*rnd()); - var InSta v_inSta; - var integer v_frameRequestedCount := 1; - var integer v_frameAcknowledgedCount := 0; - var boolean v_channel_1, v_channel_2 := false; - - timer tc_testDuration := f_getTestDuration(p_tOff); - timer tc_tOff := p_tOff; - - f_selfOrClientSyncAndVerdict(c_prDone, e_success); - - inPort.send(m_In_Request(v_commandReference, - PIXIT_REFERENCE_BURST, - p_requestedTxPower, - p_dCCProfileIdentifier)); - tc_testDuration.start; - - alt { - [] inPort.receive(mw_In_Status(v_commandReference, - p_channel_1, - true)) -> value v_inSta { - v_commandReference := (v_commandReference + 1) mod c_maxCommandReference; - v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; - v_channel_1 := true; - tc_tOff.start; - repeat; - } - - [] inPort.receive(mw_In_Status(v_commandReference, - p_channel_2, - true)) -> value v_inSta { - v_commandReference := (v_commandReference + 1) mod c_maxCommandReference; - v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; - v_channel_2 := true; - tc_tOff.start; - repeat; - } - - [] tc_tOff.timeout { - inPort.send(m_In_Request(v_commandReference, - PIXIT_REFERENCE_BURST, - p_requestedTxPower, - p_dCCProfileIdentifier)); - v_frameRequestedCount := v_frameRequestedCount + 1; - repeat; - } - - [] tc_testDuration.timeout { - if(not v_channel_1 and not v_channel_2) - { log("*** function " & __SCOPE__ & ": FAIL: All frames have been sent via the two channel. ***"); - setverdict(fail)} - if(v_frameAcknowledgedCount == v_frameRequestedCount) - {setverdict(pass)} - else - {tc_tOff.start; - alt { - [] inPort.receive(mw_In_Status(v_commandReference, - ?, - true)) -> value v_inSta { - tc_tOff.stop; - v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; - if(v_frameAcknowledgedCount != v_frameRequestedCount) - { log("*** function " & __SCOPE__ & ": FAIL: Not all requested frames have been acknowledged. ***"); - setverdict(fail)} - else - {setverdict(pass)} - } - - [] tc_tOff.timeout { - log("*** function " & __SCOPE__ & ": FAIL: Not all requested frames have been acknowledged. ***"); - setverdict(fail) - } - } - } - } - } - checkPort.send(v_frameAcknowledgedCount); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - - } // End of function f_iN_AllRequestedFramesSentOn2Channels - } // End of group inFunctions - - group checkFunctions { - - function f_checkExpectedFrames() runs on ItsDccMts return FncRetCode { - var FncRetCode v_ret := e_success; - var integer v_framesIn := -1; - var integer v_framesRxx := -1; - timer t_check := PX_TSYNC_TIME_LIMIT; - - t_check.start; - alt { - [v_framesIn==-1] checkPort.receive(integer:?) from vc_itsInDcc -> value v_framesIn { - t_check.stop; - if (v_framesRxx != -1) { - t_check.start; - repeat; - } - } - [v_framesRxx==-1] checkPort.receive(integer:?) from vc_itsRrxDcc -> value v_framesRxx { - t_check.stop; - if (v_framesIn != -1) { - t_check.start; - repeat; - } - } - [] t_check.timeout { - log("**** " & __SCOPE__ & ": Timeout while waiting for number of frames indication ****") ; - return e_error; - } - } - - if (v_framesIn != v_framesRxx) { - v_ret := e_error; - } - - return v_ret; - } // End of function f_checkExpectedFrames - - } // End of group checkFunctions - - group auxiliaryFunction { - - /** - * @desc Returns the test duration based on the number of requested frames - * @param p_tOff Requested Toff value - * @return Test duration - */ - function f_getTestDuration(float p_tOff) return float { - return p_tOff * int2float(PIXIT_NUMBER_OF_FRAMES + 1); - } - - /** - * @desc Retrieves the string representation of a Channel. - * @param The channel enumerated. - * @return The string representation. - */ - function f_channel2str(Channel p_channel) return charstring { - select(p_channel) { - case (cCH) { - return "CCH"; - } - case (sCH1) { - return "SCH1"; - } - case (sCH2) { - return "SCH2"; - } - case (sCH3) { - return "SCH"; - } - case (sCH4) { - return "SCH4"; - } - case else { - return "unknown channel"; - } - } - } - - /** - * @desc Retrieves the string representation of a ChannelState. - * @param The channel state enumerated. - * @return The string representation. - */ - function f_channelState2str(ChannelState p_state) return charstring { - select(p_state) { - case (relaxed) { - return "relaxed"; - } - case (active) { - return "active"; - } - case (restrictive) { - return "restrictive"; - } - case else { - return "unknown channel state"; - } - } - } - - function f_getAcceptablePower(Channel p_channel, ChannelState p_state) return integer { - var integer v_ret; - - select (p_channel) { - case (cCH) { - select (p_state) { - case (relaxed) { - return PIXIT_ACCEPTABLE_POWER_CCH_RELAXED; - } - case (active) { - return PIXIT_ACCEPTABLE_POWER_CCH_ACTIVE; - } - case (restrictive) { - return PIXIT_ACCEPTABLE_POWER_CCH_RESTRICTIVE; - } - case else { - testcase.stop(__SCOPE__ & ": Unknown channel state " & f_channelState2str(p_state) & " for " & f_channel2str(p_channel)); - } - } - } - case (sCH1) { - select (p_state) { - case (relaxed) { - return PIXIT_ACCEPTABLE_POWER_SCH1_RELAXED; - } - case (active) { - return PIXIT_ACCEPTABLE_POWER_SCH1_ACTIVE; - } - case (restrictive) { - return PIXIT_ACCEPTABLE_POWER_SCH1_RESTRICTIVE; - } - case else { - testcase.stop(__SCOPE__ & ": Unknown channel state " & f_channelState2str(p_state) & " for " & f_channel2str(p_channel)); - } - } - } - case (sCH2) { - select (p_state) { - case (relaxed) { - return PIXIT_ACCEPTABLE_POWER_SCH2_RELAXED; - } - case (active) { - return PIXIT_ACCEPTABLE_POWER_SCH2_ACTIVE; - } - case (restrictive) { - return PIXIT_ACCEPTABLE_POWER_SCH2_RESTRICTIVE; - } - case else { - testcase.stop(__SCOPE__ & ": Unknown channel state " & f_channelState2str(p_state) & " for " & f_channel2str(p_channel)); - } - } - } - case (sCH3) { - select (p_state) { - case (relaxed) { - return PIXIT_ACCEPTABLE_POWER_SCH3_RELAXED; - } - case (active) { - return PIXIT_ACCEPTABLE_POWER_SCH3_ACTIVE; - } - case (restrictive) { - return PIXIT_ACCEPTABLE_POWER_SCH3_RESTRICTIVE; - } - case else { - testcase.stop(__SCOPE__ & ": Unknown channel state " & f_channelState2str(p_state) & " for " & f_channel2str(p_channel)); - } - } - } - case (sCH4) { - select (p_state) { - case (relaxed) { - return PIXIT_ACCEPTABLE_POWER_SCH4_RELAXED; - } - case (active) { - return PIXIT_ACCEPTABLE_POWER_SCH4_ACTIVE; - } - case (restrictive) { - return PIXIT_ACCEPTABLE_POWER_SCH4_RESTRICTIVE; - } - case else { - testcase.stop(__SCOPE__ & ": Unknown channel state " & f_channelState2str(p_state) & " for " & f_channel2str(p_channel)); - } - } - } - case else { - testcase.stop(__SCOPE__ & ": Unknown channel " & f_channel2str(p_channel)); - } - } - } - } - - group externalFunction { - - /** - * @desc Returns the string representation of the float value - * @param p_float The float value - * @return The string representation of the float value - */ - // external function fx_float2str(float p_float) return charstring; - - } -} // End of module LibItsDcc_Functions \ No newline at end of file diff --git a/ttcn/DCC/LibItsDcc_Pics.ttcn b/ttcn/DCC/LibItsDcc_Pics.ttcn deleted file mode 100644 index a773aa3e..00000000 --- a/ttcn/DCC/LibItsDcc_Pics.ttcn +++ /dev/null @@ -1,152 +0,0 @@ -/** - * @author ETSI / STF421 - * @version $URL$ - * $Id$ - * @desc DCC (TS 102 724) Pics - * @see ETSI TS 102 917-1 - */ -module LibItsDcc_Pics { - - group dccPics { - group roles { - /** - * @desc Is the IUT implemented to support the role of a single transceiver ITS station? - * @see ETSI TS 102 917-1 v1.1.1 A.2/1 - */ - modulepar boolean PICS_SINGLE_TRANSCEIVER; - - /** - * @desc Is the IUT implemented to support the role of a multiple transceiver ITS station? - * @see ETSI TS 102 917-1 v1.1.1 A.2/2 - */ - modulepar boolean PICS_MULTIPLE_TRANSCEIVER; - - } // end group roles - - group channelSupport { - /** - * @desc Does IUT support the usage of the ITS-G5B band? - * @see ETSI TS 102 917-1 v1.1.1 A.3/2 - */ - modulepar boolean PICS_SUPPORT_ITS_G5B; - - /** - * @desc Does IUT support the usage of the SCH1? - * @see ETSI TS 102 917-1 v1.1.1 A.4/2 - */ - modulepar boolean PICS_SUPPORT_SCH1; - - /** - * @desc Does IUT support the usage of the SCH2? - * @see ETSI TS 102 917-1 v1.1.1 A.4/3 - */ - modulepar boolean PICS_SUPPORT_SCH2; - - /** - * @desc Does IUT support the usage of the SCH3? - * @see ETSI TS 102 917-1 v1.1.1 A.4/4 - */ - modulepar boolean PICS_SUPPORT_SCH3; - - /** - * @desc Does IUT support the usage of the SCH4? - * @see ETSI TS 102 917-1 v1.1.1 A.4/5 - */ - modulepar boolean PICS_SUPPORT_SCH4; - - } // end group channelSupport - - group maximumTransmissionPower { - /** - * @desc Give the maximum Transmission power for the CCH in the Relaxed state. Value in dBm. - * @see ETSI TS 102 917-1 v1.1.1 A.5/1 - */ - modulepar integer PICS_MAXPOWER_CCH_RELAXED; - - /** - * @desc Give the maximum Transmission power for the CCH in the Active state. Value in dBm. - * @see ETSI TS 102 917-1 v1.1.1 A.5/2 - */ - modulepar integer PICS_MAXPOWER_CCH_ACTIVE; - - /** - * @desc Give the maximum Transmission power for the CCH in the Restrictive state. Value in dBm. - * @see ETSI TS 102 917-1 v1.1.1 A.5/3 - */ - modulepar integer PICS_MAXPOWER_CCH_RESTRICTIVE; - - /** - * @desc Give the maximum Transmission power for the SCH1 in the Relaxed state. Value in dBm. - * @see ETSI TS 102 917-1 v1.1.1 A.5/4 - */ - modulepar integer PICS_MAXPOWER_SCH1_RELAXED; - - /** - * @desc Give the maximum Transmission power for the SCH1 in the Active state. Value in dBm. - * @see ETSI TS 102 917-1 v1.1.1 A.5/5 - */ - modulepar integer PICS_MAXPOWER_SCH1_ACTIVE; - - /** - * @desc Give the maximum Transmission power for the SCH1 in the Restrictive state. Value in dBm. - * @see ETSI TS 102 917-1 v1.1.1 A.5/6 - */ - modulepar integer PICS_MAXPOWER_SCH1_RESTRICTIVE; - - /** - * @desc Give the maximum Transmission power for the SCH2 in the Relaxed state. Value in dBm. - * @see ETSI TS 102 917-1 v1.1.1 A.5/7 - */ - modulepar integer PICS_MAXPOWER_SCH2_RELAXED; - - /** - * @desc Give the maximum Transmission power for the SCH2 in the Active state. Value in dBm. - * @see ETSI TS 102 917-1 v1.1.1 A.5/8 - */ - modulepar integer PICS_MAXPOWER_SCH2_ACTIVE; - - /** - * @desc Give the maximum Transmission power for the SCH2 in the Restrictive state. Value in dBm. - * @see ETSI TS 102 917-1 v1.1.1 A.5/9 - */ - modulepar integer PICS_MAXPOWER_SCH2_RESTRICTIVE; - - /** - * @desc Give the maximum Transmission power for the SCH3 in the Relaxed state. Value in dBm. - * @see ETSI TS 102 917-1 v1.1.1 A.5/10 - */ - modulepar integer PICS_MAXPOWER_SCH3_RELAXED; - - /** - * @desc Give the maximum Transmission power for the SCH3 in the Active state. Value in dBm. - * @see ETSI TS 102 917-1 v1.1.1 A.5/11 - */ - modulepar integer PICS_MAXPOWER_SCH3_ACTIVE; - - /** - * @desc Give the maximum Transmission power for the SCH3 in the Restrictive state. Value in dBm. - * @see ETSI TS 102 917-1 v1.1.1 A.5/12 - */ - modulepar integer PICS_MAXPOWER_SCH3_RESTRICTIVE; - - /** - * @desc Give the maximum Transmission power for the SCH4 in the Relaxed state. Value in dBm. - * @see ETSI TS 102 917-1 v1.1.1 A.5/13 - */ - modulepar integer PICS_MAXPOWER_SCH4_RELAXED; - - /** - * @desc Give the maximum Transmission power for the SCH4 in the Active state. Value in dBm. - * @see ETSI TS 102 917-1 v1.1.1 A.5/14 - */ - modulepar integer PICS_MAXPOWER_SCH4_ACTIVE; - - /** - * @desc Give the maximum Transmission power for the SCH4 in the Restrictive state. Value in dBm. - * @see ETSI TS 102 917-1 v1.1.1 A.5/15 - */ - modulepar integer PICS_MAXPOWER_SCH4_RESTRICTIVE; - - } // end group maximumTransmissionPower - } // end group dccPics -} // End of module LibItsDcc_Pics \ No newline at end of file diff --git a/ttcn/DCC/LibItsDcc_Pixits.ttcn b/ttcn/DCC/LibItsDcc_Pixits.ttcn deleted file mode 100644 index aee63d21..00000000 --- a/ttcn/DCC/LibItsDcc_Pixits.ttcn +++ /dev/null @@ -1,815 +0,0 @@ -/** - * @author ETSI / STF421 - * @version $URL$ - * $Id$ - * @desc DCC (TS 102 724) Pixits - * @see ETSI TS 102 917-3 - */ -module LibItsDcc_Pixits { - - import from LibItsDcc_TypesAndValues {group moduleParTables;} - - group acceptableTransmissionPower { - /** - * @desc Give an acceptable Transmission power for the CCH in the Relaxed state. Value in dBm. - * @desc The value has to be below the maximum Transmission power given in TS 102 917-1 PICS A.5/1. - * @see ETSI TS 102 917-3 v1.1.1 A.1/1 - */ - modulepar integer PIXIT_ACCEPTABLE_POWER_CCH_RELAXED; - - /** - * @desc Give an acceptable Transmission power for the CCH in the Active state. Value in dBm. - * @desc The value has to be below the maximum Transmission power given in TS 102 917-1 PICS A.5/2. - * @see ETSI TS 102 917-3 v1.1.1 A.1/2 - */ - modulepar integer PIXIT_ACCEPTABLE_POWER_CCH_ACTIVE; - - /** - * @desc Give an acceptable Transmission power for the CCH in the Restrictive state. Value in dBm. - * @desc The value has to be below the maximum Transmission power given in TS 102 917-1 PICS A.5/3. - * @see ETSI TS 102 917-3 v1.1.1 A.1/3 - */ - modulepar integer PIXIT_ACCEPTABLE_POWER_CCH_RESTRICTIVE; - - /** - * @desc Give an acceptable Transmission power for the SCH1 in the Relaxed state. Value in dBm. - * @desc The value has to be below the maximum Transmission power given in TS 102 917-1 PICS A.5/4. - * @see ETSI TS 102 917-3 v1.1.1 A.1/4 - */ - modulepar integer PIXIT_ACCEPTABLE_POWER_SCH1_RELAXED; - - /** - * @desc Give an acceptable Transmission power for the SCH1 in the Active state. Value in dBm. - * @desc The value has to be below the maximum Transmission power given in TS 102 917-1 PICS A.5/5. - * @see ETSI TS 102 917-3 v1.1.1 A.1/5 - */ - modulepar integer PIXIT_ACCEPTABLE_POWER_SCH1_ACTIVE; - - /** - * @desc Give an acceptable Transmission power for the SCH1 in the Restrictive state. Value in dBm. - * @desc The value has to be below the maximum Transmission power given in TS 102 917-1 PICS A.5/6. - * @see ETSI TS 102 917-3 v1.1.1 A.1/6 - */ - modulepar integer PIXIT_ACCEPTABLE_POWER_SCH1_RESTRICTIVE; - - /** - * @desc Give an acceptable Transmission power for the SCH2 in the Relaxed state. Value in dBm. - * @desc The value has to be below the maximum Transmission power given in TS 102 917-1 PICS A.5/7. - * @see ETSI TS 102 917-3 v1.1.1 A.1/7 - */ - modulepar integer PIXIT_ACCEPTABLE_POWER_SCH2_RELAXED; - - /** - * @desc Give an acceptable Transmission power for the SCH2 in the Active state. Value in dBm. - * @desc The value has to be below the maximum Transmission power given in TS 102 917-1 PICS A.5/8. - * @see ETSI TS 102 917-3 v1.1.1 A.1/8 - */ - modulepar integer PIXIT_ACCEPTABLE_POWER_SCH2_ACTIVE; - - /** - * @desc Give an acceptable Transmission power for the SCH2 in the Restrictive state. Value in dBm. - * @desc The value has to be below the maximum Transmission power given in TS 102 917-1 PICS A.5/9. - * @see ETSI TS 102 917-3 v1.1.1 A.1/9 - */ - modulepar integer PIXIT_ACCEPTABLE_POWER_SCH2_RESTRICTIVE; - - /** - * @desc Give an acceptable Transmission power for the SCH3 in the Relaxed state. Value in dBm. - * @desc The value has to be below the maximum Transmission power given in TS 102 917-1 PICS A.5/10. - * @see ETSI TS 102 917-3 v1.1.1 A.1/10 - */ - modulepar integer PIXIT_ACCEPTABLE_POWER_SCH3_RELAXED; - - /** - * @desc Give an acceptable Transmission power for the SCH3 in the Active state. Value in dBm. - * @desc The value has to be below the maximum Transmission power given in TS 102 917-1 PICS A.5/11. - * @see ETSI TS 102 917-3 v1.1.1 A.1/11 - */ - modulepar integer PIXIT_ACCEPTABLE_POWER_SCH3_ACTIVE; - - /** - * @desc Give an acceptable Transmission power for the SCH3 in the Restrictive state. Value in dBm. - * @desc The value has to be below the maximum Transmission power given in TS 102 917-1 PICS A.5/12. - * @see ETSI TS 102 917-3 v1.1.1 A.1/12 - */ - modulepar integer PIXIT_ACCEPTABLE_POWER_SCH3_RESTRICTIVE; - - /** - * @desc Give an acceptable Transmission power for the SCH4 in the Relaxed state. Value in dBm. - * @desc The value has to be below the maximum Transmission power given in TS 102 917-1 PICS A.5/13. - * @see ETSI TS 102 917-3 v1.1.1 A.1/13 - */ - modulepar integer PIXIT_ACCEPTABLE_POWER_SCH4_RELAXED; - - /** - * @desc Give an acceptable Transmission power for the SCH4 in the Active state. Value in dBm. - * @desc The value has to be below the maximum Transmission power given in TS 102 917-1 PICS A.5/14. - * @see ETSI TS 102 917-3 v1.1.1 A.1/14 - */ - modulepar integer PIXIT_ACCEPTABLE_POWER_SCH4_ACTIVE; - - /** - * @desc Give an acceptable Transmission power for the SCH4 in the Restrictive state. Value in dBm. - * @desc The value has to be below the maximum Transmission power given in TS 102 917-1 PICS A.5/15. - * @see ETSI TS 102 917-3 v1.1.1 A.1/15 - */ - modulepar integer PIXIT_ACCEPTABLE_POWER_SCH4_RESTRICTIVE; - - } // end group acceptableTransmissionPower - - group inachievableTransmissionPower { - /** - * @desc Give a Transmission power that cannot be achieved for the CCH in the Relaxed state. Value in dBm. - * @desc The value has to be above the maximum Transmission power given in TS 102 917-1 PICS A.5/1. - * @see ETSI TS 102 917-3 v1.1.1 A.2/1 - */ - modulepar integer PIXIT_INACHIEVABLE_POWER_CCH_RELAXED; - - /** - * @desc Give a Transmission power that cannot be achieved for the CCH in the Active state. Value in dBm. - * @desc The value has to be above the maximum Transmission power given in TS 102 917-1 PICS A.5/2. - * @see ETSI TS 102 917-3 v1.1.1 A.2/2 - */ - modulepar integer PIXIT_INACHIEVABLE_POWER_CCH_ACTIVE; - - /** - * @desc Give a Transmission power that cannot be achieved for the CCH in the Restrictive state. Value in dBm. - * @desc The value has to be above the maximum Transmission power given in TS 102 917-1 PICS A.5/3. - * @see ETSI TS 102 917-3 v1.1.1 A.2/3 - */ - modulepar integer PIXIT_INACHIEVABLE_POWER_CCH_RESTRICTIVE; - - /** - * @desc Give a Transmission power that cannot be achieved for the SCH1 in the Relaxed state. Value in dBm. - * @desc The value has to be above the maximum Transmission power given in TS 102 917-1 PICS A.5/4. - * @see ETSI TS 102 917-3 v1.1.1 A.2/4 - */ - modulepar integer PIXIT_INACHIEVABLE_POWER_SCH1_RELAXED; - - /** - * @desc Give a Transmission power that cannot be achieved for the SCH1 in the Active state. Value in dBm. - * @desc The value has to be above the maximum Transmission power given in TS 102 917-1 PICS A.5/5. - * @see ETSI TS 102 917-3 v1.1.1 A.2/5 - */ - modulepar integer PIXIT_INACHIEVABLE_POWER_SCH1_ACTIVE; - - /** - * @desc Give a Transmission power that cannot be achieved for the SCH1 in the Restrictive state. Value in dBm. - * @desc The value has to be above the maximum Transmission power given in TS 102 917-1 PICS A.5/6. - * @see ETSI TS 102 917-3 v1.1.1 A.2/6 - */ - modulepar integer PIXIT_INACHIEVABLE_POWER_SCH1_RESTRICTIVE; - - /** - * @desc Give a Transmission power that cannot be achieved for the SCH2 in the Relaxed state. Value in dBm. - * @desc The value has to be above the maximum Transmission power given in TS 102 917-1 PICS A.5/7. - * @see ETSI TS 102 917-3 v1.1.1 A.2/7 - */ - modulepar integer PIXIT_INACHIEVABLE_POWER_SCH2_RELAXED; - - /** - * @desc Give a Transmission power that cannot be achieved for the SCH2 in the Active state. Value in dBm. - * @desc The value has to be above the maximum Transmission power given in TS 102 917-1 PICS A.5/8. - * @see ETSI TS 102 917-3 v1.1.1 A.2/8 - */ - modulepar integer PIXIT_INACHIEVABLE_POWER_SCH2_ACTIVE; - - /** - * @desc Give a Transmission power that cannot be achieved for the SCH3 in the Relaxed state. Value in dBm. - * @desc The value has to be above the maximum Transmission power given in TS 102 917-1 PICS A.5/10. - * @see ETSI TS 102 917-3 v1.1.1 A.2/9 - */ - modulepar integer PIXIT_INACHIEVABLE_POWER_SCH3_RELAXED; - - /** - * @desc Give a Transmission power that cannot be achieved for the SCH3 in the Active state. Value in dBm. - * @desc The value has to be above the maximum Transmission power given in TS 102 917-1 PICS A.5/11. - * @see ETSI TS 102 917-3 v1.1.1 A.2/10 - */ - modulepar integer PIXIT_INACHIEVABLE_POWER_SCH3_ACTIVE; - - /** - * @desc Give a Transmission power that cannot be achieved for the SCH3 in the Restrictive state. Value in dBm. - * @desc The value has to be above the maximum Transmission power given in TS 102 917-1 PICS A.5/12. - * @see ETSI TS 102 917-3 v1.1.1 A.2/11 - */ - modulepar integer PIXIT_INACHIEVABLE_POWER_SCH3_RESTRICTIVE; - - /** - * @desc Give a Transmission power that cannot be achieved for the SCH4 in the Relaxed state. Value in dBm. - * @desc The value has to be above the maximum Transmission power given in TS 102 917-1 PICS A.5/13. - * @see ETSI TS 102 917-3 v1.1.1 A.2/12 - */ - modulepar integer PIXIT_INACHIEVABLE_POWER_SCH4_RELAXED; - - /** - * @desc Give a Transmission power that cannot be achieved for the SCH4 in the Active state. Value in dBm. - * @desc The value has to be above the maximum Transmission power given in TS 102 917-1 PICS A.5/14. - * @see ETSI TS 102 917-3 v1.1.1 A.2/13 - */ - modulepar integer PIXIT_INACHIEVABLE_POWER_SCH4_ACTIVE; - - /** - * @desc Give a Transmission power that cannot be achieved for the SCH4 in the Restrictive state. Value in dBm. - * @desc The value has to be above the maximum Transmission power given in TS 102 917-1 PICS A.5/15. - * @see ETSI TS 102 917-3 v1.1.1 A.2/14 - */ - modulepar integer PIXIT_INACHIEVABLE_POWER_SCH4_RESTRICTIVE; - - } // end group inachievableTransmissionPower - - /** - * @desc Give the content of the reference burst to be sent on the radio interface. - * @see ETSI TS 102 917-3 v1.1.1 A.3/1 - */ - modulepar octetstring PIXIT_REFERENCE_BURST; - - /** - * @desc Give the allowed delta between requested and measured power value. - * @see ETSI TS 102 917-3 v1.1.1 A.3/2 - */ - modulepar integer PIXIT_POWER_DELTA; - - /** - * @desc Give the number of frames to be requested in a test; used to calculate the overall test duration. - * @see ETSI TS 102 917-3 v1.1.1 A.3/3 - */ - modulepar integer PIXIT_NUMBER_OF_FRAMES; - - group testcaseDataTables { - - /** - * @desc Give the content of Table 7. - * @see ETSI TS 102 917-2 Table 7 - */ - modulepar ProfileTimeAspects PIXIT_TABLE_7_TC_STS_REL_01_03 := { - { 0, 20.0, 0.050 }, - { 1, 10.0, 0.095 }, - { 2, 10.0, 0.095 }, - { 3, 4.0, 0.250 }, - { 4, 2.0, 0.500 }, - { 5, 1.0, 1.000 }, - { 6, 0.2, 5.000 }, - { 7, 0.1, 10.000 }, - { 8, 0.1, 10.000 } - } - - /** - * @desc Give the content of Table 8. - * @see ETSI TS 102 917-2 Table 8 - */ - modulepar ProfileTimeAspects PIXIT_TABLE_8_TC_STS_ACT_01_03 := { - { 0, 20.0, 0.050 }, - { 1, 5.0, 0.190 }, - { 2, 5.0, 0.190 }, - { 3, 2.0, 0.500 } - } - - /** - * @desc Give the content of Table 9. - * @see ETSI TS 102 917-2 Table 9 - */ - modulepar ProfileTimeAspects PIXIT_TABLE_9_TC_STS_RES_01_03 := { - { 0, 20.0, 0.050 }, - { 1, 4.0, 0.250 }, - { 2, 4.0, 0.250 }, - { 3, 1.0, 1.000 } - } - - /** - * @desc Give the content of Table 10. - * @see ETSI TS 102 917-2 Table 10 - */ - modulepar ProfileChannelTimeChannelAspects PIXIT_TABLE_10_TC_MTS_CCH_01 := { - { 1, - { - { active, { 5.0, 0.190, { relaxed, active, restrictive } } }, - { restrictive, { 4.0, 0.250, { relaxed, active, restrictive } } } - } - }, - { 2, - { - { active, { 5.0, 0.190, { active, restrictive } } }, - { restrictive, { 4.0, 0.250, { active, restrictive } } } - } - }, - { 3, - { - { active, { 5.0, 0.190, { restrictive } } }, - { restrictive, { 4.0, 0.250, { restrictive } } } - } - } - } - - /** - * @desc Give the content of Table 11. - * @see ETSI TS 102 917-2 Table 11 - */ - modulepar ProfileChannelAspects PIXIT_TABLE_11_TC_MTS_CCH_02 := { - { 5, - { - { - active, - { - { active, active }, - { restrictive, active }, - { active, restrictive }, - { restrictive, restrictive } - } - }, - { - restrictive, - { - { active, active }, - { restrictive, active }, - { active, restrictive }, - { restrictive, restrictive } - } - } - } - }, - { 6, - { - { - active, - { - { active, active }, - { restrictive, active }, - { active, restrictive }, - { restrictive, restrictive } - } - }, - { - restrictive, - { - { active, active }, - { restrictive, active }, - { active, restrictive }, - { restrictive, restrictive } - } - } - } - }, - { 7, - { - { - active, - { - { active, active }, - { restrictive, active }, - { active, restrictive }, - { restrictive, restrictive } - } - }, - { - restrictive, - { - { active, active }, - { restrictive, active }, - { active, restrictive }, - { restrictive, restrictive } - } - } - } - }, - { 8, - { - { - active, - { - { active, active }, - { restrictive, active }, - { active, restrictive }, - { restrictive, restrictive } - } - }, - { - restrictive, - { - { active, active }, - { restrictive, active }, - { active, restrictive }, - { restrictive, restrictive } - } - } - } - } - } - - /** - * @desc Give the content of Table 12. - * @see ETSI TS 102 917-2 Table 12 - */ - modulepar ProfileTimeChannelAspects PIXIT_TABLE_12_TC_MTS_ACT_01 := { - { 2, - { - 5.0, 0.190, { relaxed } - } - }, - { 3, - { - 2.0, 0.500, { relaxed, active } - } - } - } - - /** - * @desc Give the content of Table 13. - * @see ETSI TS 102 917-2 Table 13 - */ - modulepar ChannelStates PIXIT_TABLE_13_TC_MTS_ACT_02 := { - relaxed, - active - } - - /** - * @desc Give the content of Table 14. - * @see ETSI TS 102 917-2 Table 14 - */ - modulepar ChannelStates PIXIT_TABLE_14_TC_MTS_ACT_03 := { - relaxed, - active, - restrictive - } - - /** - * @desc Give the content of Table 15. - * @see ETSI TS 102 917-2 Table 15 - */ - modulepar ProfileTimeAspects PIXIT_TABLE_15_TC_MTS_ACT_04 := { - { 5, 2.0, 0.500 }, - { 6, 2.0, 0.500 }, - { 7, 1.0, 1.000 }, - { 8, 1.0, 1.000 } - } - - /** - * @desc Give the content of Table 16. - * @see ETSI TS 102 917-2 Table 16 - */ - modulepar ChannelProfileTimeAspects PIXIT_TABLE_16_TC_MTS_ACT_05 := { - { - active, - { - { 5, 2.0, 0.500 }, - { 6, 2.0, 0.500 }, - { 7, 1.0, 1.000 }, - { 8, 0.5, 2.000 } - } - }, - { - restrictive, - { - { 5, 2.0, 0.500 }, - { 6, 2.0, 0.500 }, - { 7, 1.0, 1.000 }, - { 8, 0.5, 2.000 } - } - } - } - - /** - * @desc Give the content of Table 17. - * @see ETSI TS 102 917-2 Table 17 - */ - modulepar ProfileTimeChannelAspects PIXIT_TABLE_17_TC_MTS_RES_01 := { - { 2, - { - 4.0, 0.250, { relaxed } - } - }, - { 3, - { - 1.0, 1.000, { relaxed, active } - } - } - } - - /** - * @desc Give the content of Table 18. - * @see ETSI TS 102 917-2 Table 18 - */ - modulepar ChannelStates PIXIT_TABLE_18_TC_MTS_RES_02 := { - relaxed, - active - } - - /** - * @desc Give the content of Table 19. - * @see ETSI TS 102 917-2 Table 19 - */ - modulepar ChannelStates PIXIT_TABLE_19_TC_MTS_RES_03 := { - relaxed, - active, - restrictive - } - - /** - * @desc Give the content of Table 20. - * @see ETSI TS 102 917-2 Table 20 - */ - modulepar ProfileTimeAspects PIXIT_TABLE_20_TC_MTS_RES_04 := { - { 5, 2.0, 0.500 }, - { 6, 2.0, 0.500 }, - { 7, 1.0, 1.000 }, - { 8, 1.0, 1.000 } - } - - /** - * @desc Give the content of Table 21. - * @see ETSI TS 102 917-2 Table 21 - */ - modulepar ChannelProfileTimeAspects PIXIT_TABLE_21_TC_MTS_RES_05 := { - { - active, - { - { 5, 2.0, 0.500 }, - { 6, 2.0, 0.500 }, - { 7, 1.0, 1.000 }, - { 8, 0.5, 2.000 } - } - }, - { - restrictive, - { - { 5, 2.0, 0.500 }, - { 6, 2.0, 0.500 }, - { 7, 1.0, 1.000 }, - { 8, 0.5, 2.000 } - } - } - } - - /** - * @desc Give the content of Table 22. - * @see ETSI TS 102 917-2 Table 22 - */ - modulepar ProfileTimeAspects PIXIT_TABLE_22_TC_MTS_SCH1_01_03 := { - { 9, 10.0, 0.100 }, - { 10, 10.0, 0.100 }, - { 11, 10.0, 0.100 }, - { 12, 2.0, 0.500 }, - { 13, 1.0, 1.000 }, - { 14, 0.2, 5.000 }, - { 15, 0.1, 10.000 }, - { 16, 0.1, 10.000 } - } - - /** - * @desc Give the content of Table 23. - * @see ETSI TS 102 917-2 Table 23 - */ - modulepar ProfileTimeAspects PIXIT_TABLE_23_TC_MTS_SCH1_05_07 := { - { 9, 5.0, 0.200 }, - { 10, 5.0, 0.200 }, - { 11, 2.0, 0.500 } - } - - /** - * @desc Give the content of Table 24. - * @see ETSI TS 102 917-2 Table 24 - */ - modulepar ProfileTimeAspects PIXIT_TABLE_24_TC_MTS_SCH1_09_11 := { - { 9, 4.0, 0.250 }, - { 10, 4.0, 0.250 } - } - - /** - * @desc Give the content of Table 25. - * @see ETSI TS 102 917-2 Table 25 - */ - modulepar ProfileTimeAspects PIXIT_TABLE_25_TC_MTS_SCH2_01_03:= { - { 11, 0.2, 5.000 }, - { 12, 0.2, 5.000 }, - { 13, 0.2, 5.000 }, - { 14, 0.1, 10.000 }, - { 15, 0.5, 20.000 }, - { 16, 0.5, 20.000 } - } - - /** - * @desc Give the content of Table 26. - * @see ETSI TS 102 917-2 Table 26 - */ - modulepar ChannelStates PIXIT_TABLE_26_TC_G5B_CCH_01 := { - active, - restrictive - } - - /** - * @desc Give the content of Table 27. - * @see ETSI TS 102 917-2 Table 27 - */ - modulepar ProfileChannelAspects2 PIXIT_TABLE_27_TC_G5B_CCH_02 := { - { 7, - { - { - active, - { restrictive } - }, - { - restrictive, - { restrictive } - } - } - }, - { 8, - { - { - active, - { active ,restrictive } - }, - { - restrictive, - { active, restrictive } - } - } - } - } - - /** - * @desc Give the content of Table 28. - * @see ETSI TS 102 917-2 Table 28 - */ - modulepar ChannelProfileTimeAspects PIXIT_TABLE_28_TC_G5B_CCH_03_04 := { - { - relaxed, - { - { 5, 10.0, 0.100 }, - { 6, 10.0, 0.100 }, - { 7, 4.0, 0.250 }, - { 8, 2.0, 0.500 } - } - }, - { - active, - { - { 5, 5.0, 0.200 }, - { 6, 5.0, 0.200 }, - { 7, 2.0, 0.500 } - } - }, - { - restrictive, - { - { 5, 4.0, 0.250 }, - { 6, 4.0, 0.250 } - } - } - } - - /** - * @desc Give the content of Table 29. - * @see ETSI TS 102 917-2 Table 29 - */ - modulepar ProfileTimeAspects PIXIT_TABLE_29_TC_G5B_SCH3_01_03 := { - { 9, 1.0, 1.000 }, - { 10, 1.0, 1.000 }, - { 11, 1.0, 1.000 }, - { 12, 1.0, 1.000 }, - { 13, 1.0, 1.000 }, - { 14, 1.0, 1.000 }, - { 15, 1.0, 1.000 }, - { 16, 1.0, 1.000 }, - { 17, 10.0, 0.100 }, - { 18, 10.0, 0.100 }, - { 19, 4.0, 0.250 }, - { 20, 2.0, 0.500 }, - { 21, 1.0, 1.000 }, - { 22, 1.0, 1.000 }, - { 23, 1.0, 1.000 }, - { 24, 1.0, 1.000 } - } - - /** - * @desc Give the content of Table 30 (without SCH4 channel state). - * @see ETSI TS 102 917-2 Table 30 - */ - modulepar ProfileTimeAspects PIXIT_TABLE_30_TC_G5B_SCH3_05_07 := { - { 17, 5.0, 0.200 }, - { 18, 5.0, 0.200 }, - { 19, 2.0, 0.500 } - } - - /** - * @desc Give the content of Table 30 (only SCH4 channel state). - * @remark All values have to be seen in the context together with PIXIT_TABLE_30_TC_G5B_SCH3_05_07. - * @see ETSI TS 102 917-2 Table 30 - */ - modulepar ChannelStates PIXIT_TABLE_30_TC_G5B_SCH3_05_07_SCH4 := { - relaxed, - active, - restrictive - } - - /** - * @desc Give the content of Table 31. - * @see ETSI TS 102 917-2 Table 31 - */ - modulepar ChannelProfileAspects PIXIT_TABLE_31_TC_G5B_SCH3_09 := { - { active, - { 11, 12, 13, 14, 15, 16, 20, 21, 22, 23, 24 } - }, - { restrictive, - { 11, 12, 13, 14, 15, 16, 20, 21, 22, 23, 24 } - } - } - - /** - * @desc Give the content of Table 32. - * @see ETSI TS 102 917-2 Table 32 - */ - modulepar ProfileTimeAspects PIXIT_TABLE_32_TC_G5B_SCH3_10_12 := { - { 17, 5.0, 0.200 }, - { 18, 5.0, 0.200 }, - { 19, 2.0, 0.500 } - } - - /** - * @desc Give the content of Table 32 (only SCH4 channel state). - * @remark All values have to be seen in the context together with PIXIT_TABLE_30_TC_G5B_SCH3_05_07. - * @see ETSI TS 102 917-2 Table 32 - */ - modulepar ChannelStates PIXIT_TABLE_32_TC_G5B_SCH3_10_12_SCH4 := { - relaxed, - active, - restrictive - } - - /** - * @desc Give the content of Table 33. - * @see ETSI TS 102 917-2 Table 33 - */ - modulepar ChannelProfileAspects PIXIT_TABLE_33_TC_G5B_SCH3_14 := { - { active, - { 11, 12, 13, 14, 15, 16, 20, 21, 22, 23, 24 } - }, - { restrictive, - { 11, 12, 13, 14, 15, 16, 20, 21, 22, 23, 24 } - } - } - - /** - * @desc Give the content of Table 34 - * @see ETSI TS 102 917-2 Table 34 - */ - modulepar ChannelProfileAspects PIXIT_TABLE_34_TC_G5B_SCH4_01_03 := { - { active, - { 9, 10, 11, 12, 13, 14, 15, 16, 20, 21, 22, 23, 24 } - }, - { restrictive, - { 9, 10, 11, 12, 13, 14, 15, 16, 20, 21, 22, 23, 24 } - } - } - - /** - * @desc Give the content of Table 34 only SCH3 state - * @see ETSI TS 102 917-2 Table 34 - */ - modulepar ChannelStates PIXIT_TABLE_34_TC_G5B_SCH4_01_03_SCH3 := { - active, - restrictive - } - - /** - * @desc Give the content of Table 35 (without SCH3 channel state). - * @see ETSI TS 102 917-2 Table 35 - */ - modulepar ProfileTimeAspects PIXIT_TABLE_35_TC_G5B_SCH4_04_07 := { - { 9, 5.0, 0.200 }, - { 10, 5.0, 0.200 }, - { 11, 2.0, 0.500 } - } - - /** - * @desc Give the content of Table 35 (only SCH3 channel state). - * @remark All values have to be seen in the context together with PIXIT_TABLE_35_TC_G5B_SCH4_04_07. - * @see ETSI TS 102 917-2 Table 35 - */ - modulepar ChannelStates PIXIT_TABLE_35_TC_G5B_SCH4_04_07_SCH3 := { - active, - restrictive - } - - /** - * @desc Give the content of Table 36 (without SCH3 channel state). - * @see ETSI TS 102 917-2 Table 36 - */ - modulepar ProfileTimeAspects PIXIT_TABLE_36_TC_G5B_SCH4_08_11 := { - { 9, 4.0, 0.250 }, - { 10, 4.0, 0.250 } - } - - /** - * @desc Give the content of Table 36 (only SCH3 channel state). - * @remark All values have to be seen in the context together with PIXIT_TABLE_36_TC_G5B_SCH4_08_11. - * @see ETSI TS 102 917-2 Table 36 - */ - modulepar ChannelStates PIXIT_TABLE_36_TC_G5B_SCH4_08_11_SCH3 := { - active, - restrictive - } - - } - -} // End of module LibItsDcc_Pixits \ No newline at end of file diff --git a/ttcn/DCC/LibItsDcc_Templates.ttcn b/ttcn/DCC/LibItsDcc_Templates.ttcn deleted file mode 100644 index 4b4c4a62..00000000 --- a/ttcn/DCC/LibItsDcc_Templates.ttcn +++ /dev/null @@ -1,95 +0,0 @@ -/** - * @author ETSI / STF421 - * @version $URL$ - * $Id$ - * @desc DCC (TS 102 724) Templates - * @see ETSI TS 102 917-3 - */ -module LibItsDcc_Templates { - - // LibCommon - - // LibIts - import from LibItsDcc_TypesAndValues all; - import from LibItsDcc_TestSystem all; - /** - * @desc Templates used to trigger actions at the Upper Tester - * and to capture indication message sent by the IUT on the radio interface - */ - group utPrimitives { - /** - * @desc Ut Initialize Primitive template - */ - template (value) UtInitialize m_utInitialize(template (value) UtRadioInitialize p_utRadioInitialize) := - { - utRadioInitialize := p_utRadioInitialize - }// End m_utRadioInitialize - - /** - * @desc UtRadioInitialize Primitive template - */ - template (value) UtRadioInitialize m_utRadioInitialize := - { - }// End m_utRadioInitialize - - /** - * @desc UtRadioEvent Primitive template - */ - template (value) UtTrigger m_utRadioEvent(template (omit) ChannelState p_cch := omit, - template (omit) ChannelState p_sch1 := omit, - template (omit) ChannelState p_sch2 := omit, - template (omit) ChannelState p_sch3 := omit, - template (omit) ChannelState p_sch4 := omit) := - {utRadioEvent:= {cchChannelState := p_cch, - sch1ChannelState := p_sch1, - sch2ChannelState := p_sch2, - sch3ChannelState := p_sch3, - sch4ChannelState := p_sch4 - }}// End m_utRadioEvent - } // End of group utPrimitives - - group rrxPrimitives { - /** - * @desc RRX Indication Primitive template - */ - template (present) RrxInd m_rrxInd(template (present) Channel p_channel, - template (present) integer p_measuredPower) := - { - channel := p_channel, - measuredPower := p_measuredPower - } // End m_utRadioCommandIndication - - } // End of group rrxPrimitives - - /** - * @desc Primitive on IN-SAP interface - */ - group inSapPrimitives { - /** - * @desc IN Request Primitive template - */ - template InReq m_In_Request(integer p_commandReference, - octetstring p_referenceBurst, - integer p_requestedTxPower, - integer p_dCCProfileIdentifier) := - {commandReference := p_commandReference, - referenceBurst := p_referenceBurst, - requestedSendPower := p_requestedTxPower, - dCCProfileIdentifier := p_dCCProfileIdentifier - } // End m_In_Request - - /** - * @desc IN Status Primitive template - */ - template (present) InSta mw_In_Status(template (present) integer p_commandReference, - template (present) Channel p_channel, - template (present) boolean p_transmissionSuccessStatus) := - {commandReference := p_commandReference, - channel := p_channel, - transmissionSuccessStatus := p_transmissionSuccessStatus, - achievedSendPower := ? - } // End mw_In_Status - - } // End of group inSapPrimitives - -} // End of module LibItsDcc_Templates \ No newline at end of file diff --git a/ttcn/DCC/LibItsDcc_TestSystem.ttcn b/ttcn/DCC/LibItsDcc_TestSystem.ttcn deleted file mode 100644 index cc42d6fd..00000000 --- a/ttcn/DCC/LibItsDcc_TestSystem.ttcn +++ /dev/null @@ -1,181 +0,0 @@ -/** - * @author ETSI / STF421 - * @version $URL$ - * $Id$ - * @desc Test System module for ITS - * - */ -module LibItsDcc_TestSystem { - - // LibCommon - import from LibCommon_Time {modulepar all;} - import from LibCommon_Sync all; - - // LibIts - import from LibItsCommon_TypesAndValues all; - import from LibItsCommon_TestSystem all; - - import from LibItsDcc_TypesAndValues all; - - - group portDefinitions { - - /** - * @desc Upper Tester port - */ - type port UpperTesterPort message { - out - UtInitialize, UtTrigger; - in - UtResult - } // end UpperTesterPort - - /** - * @desc IN Port used to trigger events at the access layer and to monitor the results - */ - type port InPort message { - in InSta; - out InReq; - } // End of port InPort - - /** - * @desc RRX Port used to receive events at the radio access - */ - type port RrxPort message { - in RrxInd; - } // End of port InPort - - /** - * @desc Check Port used for intercomponent exchange of data to check - */ - type port CheckPort message { -//FIXME RGY "all" is not supported by Titan in port message lists; only integers are sent and received via checkPort-s; -// inout all; - inout integer; - } - - } // end portDefinitions - - group componentDefinitions { - - /** - * @desc ITS System Adapter - */ - type component ItsDccSystem { - - port UpperTesterPort utPort; - port InPort inPort; - port RrxPort rrxPort; - port SyncPort syncPort; - - } // End of component ItsDccSystem - - /** - * @desc Test component for configuration of the channel traffic states - */ - type component UtComp extends ItsBaseComponent { - - port UpperTesterPort utPort; - - //timers - - //component variables - - //default - var default vc_default := null; - - //global variables - - } // End of component UtComp - - /** - * @desc Test component for ITS Access layer - */ - type component ItsInDcc extends ItsBaseComponent { - - // IN ports - port InPort inPort; - port CheckPort checkPort; - - //timers - - //component variables - - //default - var default vc_default := null; - - //global variables - - } // End of component ItsInDcc - - /** - * @desc Test component for ITS Access layer - */ - type component ItsRrxDcc extends ItsBaseComponent { - - // RRX ports - port RrxPort rrxPort; - port CheckPort checkPort; - - //timers - - //component variables - - //default - var default vc_default := null; - - //global variables - - } // End of component ItsInDcc - - /** - * @desc Test component for ITS DCC MTC - */ - type component ItsDccMts extends ItsBaseMtc { - - // MTC ports - port CheckPort checkPort; - - //timers - - //component variables - var UtComp vc_utComp; - var ItsInDcc vc_itsInDcc; - var ItsRrxDcc vc_itsRrxDcc; - - //default - var default vc_default := null; - - //global variables - - } // End of component ItsDccMts - - } // End of group componentDefinitions - - group upperTester { - - /** - * @desc Upper Tester message to initialize IUT - */ - type union UtInitialize { - UtRadioInitialize utRadioInitialize - } - - /** - * @desc Upper Tester message to trigger an action on IUT - */ - type record UtTrigger { - UtRadioEvent utRadioEvent - } - - /** - * @desc Upper Tester response message - */ - type boolean UtResult; - - - } // End of group upper tester - with { - encode "LibIts_Interface" - } // End of group interfacePrimitives -} // End of module LibItsDcc_TestSystem \ No newline at end of file diff --git a/ttcn/DCC/LibItsDcc_TypesAndValues.ttcn b/ttcn/DCC/LibItsDcc_TypesAndValues.ttcn deleted file mode 100644 index 5da71e63..00000000 --- a/ttcn/DCC/LibItsDcc_TypesAndValues.ttcn +++ /dev/null @@ -1,222 +0,0 @@ -/** - * @author ETSI / STF421 - * @version $URL$ - * $Id$ - * @desc DCC (TS 102 724) Types - * @see ETSI TS 102 917-3 - */ -module LibItsDcc_TypesAndValues { - - // LibCommon - - // LibIts - - group utRadioPrimitives { - - /** - * @desc Trigger to initialize the IUT. - */ - type record UtRadioInitialize { - } - - /** - * @desc Radio Event to bring the IUT to defined channel states. - */ - type record UtRadioEvent { - ChannelState cchChannelState optional, - ChannelState sch1ChannelState optional, - ChannelState sch2ChannelState optional, - ChannelState sch3ChannelState optional, - ChannelState sch4ChannelState optional - } - - } // End of group utRadioPrimitives - - group rrxSapPrimitives { - /** - * @desc Receive an indication related to frames sent by the IUT at the radio interface. - */ - type record RrxInd { - Channel channel, - integer measuredPower - } - - } // End of group rrxSapPrimitives - - group inSapPrimitives { - - /** - * @desc IN Request Primitive - */ - type record InReq { - integer commandReference, - octetstring referenceBurst, - integer requestedSendPower, - integer dCCProfileIdentifier - } // End InReq - - /** - * @desc IN Status Primitive - */ - type record InSta { - integer commandReference, - Channel channel, - boolean transmissionSuccessStatus, - integer achievedSendPower - } // End InSta - - } // End of group inSapPrimitives - - group subFields { - - type enumerated Channel { - cCH(0), - sCH1(1), - sCH2(2), - sCH3(3), - sCH4(4) - } - - type enumerated ChannelState { - relaxed(0), - active(1), - restrictive(2) - } - - } // End of group subFields - - group moduleParTables { - - type integer ProfileType(0..infinity); - - type record ProfileTimeAspect { - ProfileType profile, - float messageInterval, //in Hz - float tOff //in ms - } - - type record of ProfileTimeAspect ProfileTimeAspects; - - type record ChannelProfileTimeAspect { - ChannelState state, - record of ProfileTimeAspect aspects - } - - type record of ChannelProfileTimeAspect ChannelProfileTimeAspects; - - type record TimeChannelAspect { - float messageInterval, //in Hz - float tOff, //in ms - record of ChannelState sch1States - } - - type record ChannelTimeChannelAspect { - ChannelState cchState, - TimeChannelAspect aspect - } - - type record of ChannelTimeChannelAspect ChannelTimeChannelAspects; - - type record SingleChannelTimeChannelAspect { - ChannelState cchState, - SingleTimeChannelAspect aspect - } - - type record SingleTimeChannelAspect { - float messageInterval, //in Hz - float tOff, //in ms - ChannelState sch1State - } - - type record ProfileChannelTimeChannelAspect { - ProfileType profile, - ChannelTimeChannelAspects aspects - } - - type record ProfileTimeChannelAspect { - ProfileType profile, - TimeChannelAspect aspect - } - - type record ProfileSingleChannelTimeChannelAspect { - ProfileType profile, - SingleChannelTimeChannelAspect aspect - } - - type record ProfileSingleTimeChannelAspect { - ProfileType profile, - SingleTimeChannelAspect aspect - } - - type record of ProfileChannelTimeChannelAspect ProfileChannelTimeChannelAspects; - - type record of ProfileTimeChannelAspect ProfileTimeChannelAspects; - - type record SingleChannelAspect { - ChannelState cchState, - ChannelState sch1State, - ChannelState sch2State - } - - type record ProfileSingleChannelAspect { - ProfileType profile, - SingleChannelAspect aspect - } - - type record SingleChannelAspect2 { - ChannelState cchState, - ChannelState sch3State - } - - type record ProfileSingleChannelAspect2 { - ProfileType profile, - SingleChannelAspect2 aspect - } - - type record ProfileChannelAspect { - ProfileType profile, - record of record { - ChannelState cchState, - record of record { - ChannelState sch1State, - ChannelState sch2State - } states - } aspects - } - - type record of ProfileChannelAspect ProfileChannelAspects; - - type record ProfileChannelAspect2 { - ProfileType profile, - record of record { - ChannelState cchState, - record of ChannelState sch3States - } aspects - } - - type record of ProfileChannelAspect2 ProfileChannelAspects2; - - type record ChannelProfileAspect { - ChannelState state, - record of ProfileType profiles - } - - type record SingleChannelProfileAspect { - ChannelState state, - ProfileType profile - } - - type record of ChannelProfileAspect ChannelProfileAspects; - - type record of ChannelState ChannelStates; - } - - group Constants { - - const integer c_maxCommandReference := 256; - - } // End of group Constants -} -with { - encode "LibItsDcc_TypesAndValues" -} //End of module LibItsDcc_TypesAndValues \ No newline at end of file diff --git a/ttcn/V2G/LibItsV2G_Functions.ttcn b/ttcn/V2G/LibItsV2G_Functions.ttcn deleted file mode 100644 index cfad118c..00000000 --- a/ttcn/V2G/LibItsV2G_Functions.ttcn +++ /dev/null @@ -1,296 +0,0 @@ -/** - * @author ETSI / STFS46 - * @version $URL$ - * $Id$ - * @desc Module containing functions for V2G application layer protocols - * - */ - - module LibItsV2G_Functions { - - // LibCommon - import from LibCommon_Sync all; - - // LibIts - import from LibItsCommon_Functions all; - import from LibItsV2G_TestSystem all; - import from LibItsV2G_TypesAndValues all; - import from LibItsV2G_Templates all; - import from LibItsV2G_Pixits all; - - group utFuntions { - - /** - * @desc Requests to bring the IUT in an initial state - * @param p_init The initialisation to trigger. - */ - function f_utInitializeIut(template (value) UtInitialize p_init) runs on ItsV2G { - - utPort.send(p_init); - tc_wait.start; - alt { - [] utPort.receive(UtResult:true) { - tc_wait.stop; - log("*** f_utInitializeIut: INFO: IUT initialized ***"); - } - [] utPort.receive { - tc_wait.stop; - log("*** f_utInitializeIut: INFO: IUT could not be initialized ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_wait.timeout { - log("*** f_utInitializeIut: INFO: IUT could not be initialized in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [else] { // Shortcut defaults - //f_sleep(0.050); // 50 ms - repeat; - } - } - - } - - /** - * @desc Triggers event from the application layer - * @param p_event The event to trigger. - */ - function f_utTriggerEvent(template (value) UtEvent p_event) runs on ItsV2G { - var template (value) UtTrigger v_utMsg := { p_event }; - - utPort.send(v_utMsg); - alt { - [] utPort.receive(UtResult:true) { - tc_wait.stop; - } - [] utPort.receive { - tc_wait.stop; - } - [] tc_wait.timeout { - } - [else] { // Shortcut defaults - //f_sleep(0.050); // 50 ms - repeat; - } - } - } - - /** - * @desc Checks that the event was indicated at the application layer - * @param p_event The event to check. - * @param p_discard The event should not appear. Default value: FALSE. - */ - function f_utCheckEvent(template (value) UtEvent p_event, boolean p_discard) runs on ItsV2G { - var template (value) UtCheck v_utMsg := { p_event }; - - utPort.send(v_utMsg); - tc_wait.start; - alt { - [] utPort.receive(UtResult:true) { - tc_wait.stop; - if (p_discard == false) { - log("*** f_utCheckEvent: INFO: Event correctly indicated at application layer ***"); - } - else { - log("*** f_utCheckEvent: ERROR: Event indicated at application layer where it should be discarded ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - } - [] utPort.receive(UtResult:false) { - tc_wait.stop; - if (p_discard == false) { - log("*** f_utCheckEvent: ERROR: Event not correctly indicated at application layer ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - else { - log("*** f_utCheckEvent: INFO: Event not indicated at application layer***"); - } - } - [] tc_wait.timeout { - log("*** f_utCheckEvent: ERROR: Timeout while waiting for event check result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [else] { // Shortcut defaults - //f_sleep(0.050); // 50 ms - repeat; - } - } - } - - } // End of group utFunctions - - group configurationFunctions { - - /** - * @desc Setups default configuration - */ - function f_cfUp() runs on ItsV2G { - - map(self:utPort, system:utPort); - map(self:v2gPort, system:v2gPort); - - } // end f_cfUp - - /** - * @desc Deletes default configuration - */ - function f_cfDown() runs on ItsV2G { - - unmap(self:utPort, system:utPort); - unmap(self:v2gPort, system:v2gPort); - - } // end f_cfDown - - } // end configurationFunctions - - group v2gAltsteps { - - /** - * @desc The base default. - */ - altstep a_default() runs on ItsV2G { - - [] v2gPort.receive { - log("*** a_default: ERROR: Received an unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_wait.timeout { - log("*** a_default: INCONC: Timeout while awaiting reaction of the IUT prior to Upper Tester action ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] tc_ac.timeout { - log("*** a_default: INCONC: Timeout while awaiting the reception of a message ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] a_shutdown() { - f_poDefault(); - f_cfDown(); - log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - } //end v2gAltsteps - - group preambles { - - /** - * @desc The default preamble. - */ - function f_prDefault() runs on ItsV2G { - activate(a_default()); - } - - /** - * @desc Brings the IUT into an initial state. - */ - function f_prInitialState() runs on ItsV2G { - - f_utInitializeIut(m_v2gInitialize); - f_prDefault(); - } - // E X A M P L E - /** - * @desc Brings the IUT into Session Discovery state completed. - */ - function f_prSessionDiscoveryCompleted() runs on ItsV2G { - - f_utInitializeIut(m_v2gInitialize); - f_prDefault(); - //f_sessionDiscoveryCompleted(); - - } - // E X A M P L E - /** - * @desc Performs Supported Application Protocol. - */ - function f_supportedApplicationCompleted() runs on ItsV2G { - - //TODO - - } - - /** - * @desc Performs preamble up to received a SDP Request - * @param p_sdpReponse If function must send a SDP Response or must not - * @see f_prInitialState() - */ - function f_prSdpRequestReceived() runs on ItsV2G { - f_prInitialState(); - f_receiveSdpRequest(); - } - - /** - * @desc Performs preamble sending a SDP Message - * @param p_sdpMessage SDP message to be sent - * @see f_prInitialState() - * @see f_sendv2gMessage() - */ - function f_prSendSdpMessage(in template Sdp_Message p_sdpMessage) runs on ItsV2G { - f_prInitialState(); - f_sendV2Gmessage(m_sdpReq(p_sdpMessage)); - } - - } // end of group preambles - - group sdpFunctions { - /** - * @desc Received a SDP Request - * @param p_response If function must send a SDP Response or must not - */ - function f_receiveSdpRequest() runs on ItsV2G { - tc_v2g_secc_sequenceTimeout.start; - alt { - [] v2gPort.receive(mw_sdpInd ( mw_sdpRequestMessage (mw_sdpRequestHeader, mw_sdpRequestPayload_generic))) -> value vc_v2gIndMessage - { - tc_v2g_secc_sequenceTimeout.stop; - log("*** TP_EVCC_SDP_CLI_BV_01: PASS: SDP request message received BEFORE expiry of the sequence performance timer***"); - setverdict(pass); - } - [] tc_v2g_secc_sequenceTimeout.timeout { - log("*** TP_EVCC_SDP_CLI_BV_01: FAIL: SDP session request message not receive ***"); - setverdict(fail); - } - } - } - - /** - * @desc Send a SDP Response message based on content of SDP Request - * @param p_sdpRequest SDP Request Message - */ - function f_sendSdpResponse(in Sdp_Message p_sdpRequest) runs on ItsV2G - { - // To be completed!!! -> Use templates for sending and not variables! - var V2Greq v_sdpResponseMessage; - - v_sdpResponseMessage.sdpOut.sdpPayload.sdpResponse.security := p_sdpRequest.sdpPayload.sdpRequest.security; - v_sdpResponseMessage.sdpOut.sdpPayload.sdpResponse.transportProtocol := p_sdpRequest.sdpPayload.sdpRequest.transportProtocol; - - v2gPort.send(v_sdpResponseMessage); - } - - } // end of sdp functions - - group v2gFunctions { - - /** - * @desc Send a V2G message - * @param p_v2gMessage V2G message to be sent - */ - function f_sendV2Gmessage(in template V2Greq p_v2gMessage) runs on ItsV2G - { - v2gPort.send(p_v2gMessage); - } - - } // end of v2g functions - - group postambles { - - /** - * @desc The default postamble. - */ - function f_poDefault() runs on ItsV2G { - //empty - } - - } // end postambles - -} // end LibItsV2G_Functions \ No newline at end of file diff --git a/ttcn/V2G/LibItsV2G_Pics.ttcn b/ttcn/V2G/LibItsV2G_Pics.ttcn deleted file mode 100644 index e8870de2..00000000 --- a/ttcn/V2G/LibItsV2G_Pics.ttcn +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @author ETSI / STFS46 - * @version $URL$ - * $Id$ - * @desc V2G PICS - * - */ -module LibItsV2G_Pics { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - - group v2gPics { - - - // E X A M P L E - /** - * @desc EVCC sequence performance time - * @see PICS doc v1.1.1 A.2/1 - */ - modulepar float PICS_EVCC_SEQUENCE_PERFORMANCE_TIME := 10.0; - - - - } // end v2gPics - -} // end LibItsV2G_Pics diff --git a/ttcn/V2G/LibItsV2G_Pixits.ttcn b/ttcn/V2G/LibItsV2G_Pixits.ttcn deleted file mode 100644 index 04473911..00000000 --- a/ttcn/V2G/LibItsV2G_Pixits.ttcn +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @author ETSI / STFS46 - * @version $URL$ - * $Id$ - * @desc V2G application layer protocols Pixits - * - */ -module LibItsV2G_Pixits { - - // LibIts - import from LibItsV2G_TypesAndValues all; - - - - - -} // end LibItsV2G_Pixits \ No newline at end of file diff --git a/ttcn/V2G/LibItsV2G_Templates.ttcn b/ttcn/V2G/LibItsV2G_Templates.ttcn deleted file mode 100644 index 8530413d..00000000 --- a/ttcn/V2G/LibItsV2G_Templates.ttcn +++ /dev/null @@ -1,263 +0,0 @@ -/** - * @author ETSI / STFS46 - * @version $URL$ - * $Id$ - * @desc V2G application layer protocols Templates - * - */ -module LibItsV2G_Templates { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibItsCommon - import from LibItsCommon_ASN1_NamedNumbers all; - - // LibItsV2G - import from LibItsV2G_TestSystem all; - import from LibItsV2G_TypesAndValues all; - import from LibItsV2G_Pixits all; - import from LibItsV2G_TypeAliases all; - - //XSD - import from urn_iso_15118_2_2010_MsgDef all; - import from urn_iso_15118_2_2010_MsgDataTypes all; - - group v2gPrimitivesTemplates { - - - - group utPrimitives { - - /** - * @desc Initializes the V2G IUT. - */ - template (value) UtInitialize m_v2gInitialize := { - utV2Ginitialize := { - } - } - - /** - * @desc Upper Tester template for checking that V2G payload has been transmitted to upper layer - * @param p_payload Payload to be checked - */ -//FIXME RGY by standard conversion all field names are lowercase -// template (value) UtEvent m_checkPayload(in V2G_Message.Body p_body) := { - template (value) UtEvent m_checkPayload(in V2G_Message.body p_body) := { - utV2Gevent := { - v2gBody := p_body - } - } - - } // end utPrimitives - - } // v2gPrimitivesTemplates - - group v2gPduTemplates { - - /** - * @desc Receive template for V2G Message (V2Gport Primitive) - * @param p_v2gMsg V2G Message to be received - */ - template V2Gind mw_v2gInd ( - in template (present) V2G_Message p_v2gMsg - ) := { - v2gIn := p_v2gMsg - }; - - /** - * @desc Receive template for SDP Message (V2Gport Primitive) - * @param p_sdpMsg SDP Message to be received - */ - template V2Gind mw_sdpInd ( - in template (present) Sdp_Message p_sdpMsg - ) := { - sdpIn := p_sdpMsg - }; - - template V2Greq m_sdpReq ( - in template (present) Sdp_Message p_sdpMsg - ) := { - sdpOut := p_sdpMsg - }; - - /** - * @desc Send template for V2G Message (V2Gport Primitive) - * @param p_v2gMsg V2G Message to be sent - */ - template (value) V2Greq m_v2gReq ( - in template (value) V2G_Message p_v2gMsg - ) := { - v2gOut := p_v2gMsg - }; - - // E X A M P L E - /** - * @desc Receive template for V2G Message for Session Request - */ - template V2G_Message mw_v2gMsg_sessionRequest (in template (present) sessionIDType_TYPE p_sId, - in template (present) evccIDType_TYPE p_evccId ):= { -/*FIXME RGY by standard conversion all field names are lowercase - Header := { - SessionID := p_sId, - Notification := omit, - Signature := omit - }, - Body := { - BodyElement := omit//p_evccId -*/ - header := { - sessionID := p_sId, - notification := omit, - signature_ := omit - }, - body := { - bodyElement := omit//p_evccId - } - } - - } // end v2gPduTemplates - - group sdpMessageTemplates { - /** - * @desc Receive template for Generic Header SDP - */ - template Sdp_Header mw_sdpHeader_generic := { - protocolVersion := ?, - inverseProtocolVersion := ?, - payloadType := ?, - payloadLength := ? - } - - /** - * @desc Receive template for Header SDP Request Message - * @see mw_sdpGenericHeader - */ - template Sdp_Header mw_sdpRequestHeader modifies mw_sdpHeader_generic := { - protocolVersion := c_protocolVersion1, - inverseProtocolVersion := c_inverseProtocolVersion1, - payloadType := c_sdpRequestMessagePayloadType, - payloadLength := c_sdpRequestPayloadLength - } - - /** - * @desc Receive template for Header SDP Response Message - * @see mw_sdpGenericHeader - */ - template Sdp_Header mw_sdpReponseHeader modifies mw_sdpHeader_generic := { - protocolVersion := c_protocolVersion1, - inverseProtocolVersion := c_inverseProtocolVersion1, - payloadType := c_sdpResponseMessagePayloadType, - payloadLength := c_sdpResponsePayloadLength - } - - /** - * @desc Receive template for Generic Payload of a SDP Request Message - */ - template Sdp_Request mw_sdpRequestPayload_generic := { - security := ?, - transportProtocol := ? - } - - /** - * @desc Receive template for Generic Payload of a SDP Response Message - */ - template Sdp_Response mw_sdpResponsePayload_generic := { - seccIPAddress := ?, - seccPort := ?, - security := ?, - transportProtocol := ? - } - - /** - * @desc Receive template for Specific Payload of a SDP Response Message - * @param p_sec Security Encoding field - * @param p_transProto Transport Protocol field - * @see mw_sdpResponsePayload_generic - */ - template Sdp_Response mw_sdpResponsePayload(in Oct1 p_sec, in Oct1 p_transProto) - modifies mw_sdpResponsePayload_generic := { - seccIPAddress := ?, - seccPort := ?, - security := p_sec, - transportProtocol := p_transProto - } - - /** - * @desc Receive template for Specific Payload of a SDP Request Message - * @param p_sec Security Encoding field - * @param p_transProto Transport Protocol field - * @see mw_sdpGenericPayloadRequest - */ - template Sdp_Request mw_sdpRequestPayload(in Oct1 p_sec, in Oct1 p_transProto) - modifies mw_sdpRequestPayload_generic := { - security := p_sec, - transportProtocol := p_transProto - } - - /** - * @desc Receive template for SDP Request Message - * @param p_sdpH Header of the message - * @param p_sdpP Payload of a Request message - */ - template Sdp_Message mw_sdpRequestMessage (in template Sdp_Header p_sdpH, - in template Sdp_Request p_sdpP) := { - sdpHeader := p_sdpH, - sdpPayload := { - sdpRequest := p_sdpP - } - } - - /** - * @desc Receive template for SDP Response Message - * @param p_sdpH Header of the message - * @param p_sdpP Payload of a Response message - */ - template Sdp_Message mw_sdpResponseMessage (in template Sdp_Header p_sdpH, - in template Sdp_Response p_sdpP) := { - sdpHeader := p_sdpH, - sdpPayload := { - sdpResponse := p_sdpP - } - } - - /** - * @desc Send template for SDP Request Message - * @param p_sdpH Header of the message - * @param p_sdpP Payload of a Request message - */ - template Sdp_Message m_sdpRequestMessage (in template Sdp_Header p_sdpH, - in template Sdp_Request p_sdpP) := { - sdpHeader := p_sdpH, - sdpPayload := { - sdpRequest := p_sdpP - } - } - - /** - * @desc Send template for SDP Request Message Header - * @see mw_sdpGenericHeader - */ - template Sdp_Header m_sdpRequestHeader := { - protocolVersion := c_protocolVersion1, - inverseProtocolVersion := c_inverseProtocolVersion1, - payloadType := c_sdpRequestMessagePayloadType, - payloadLength := c_sdpRequestPayloadLength - } - - /** - * @desc Send template for SDP Request Message Payload - * @param p_sec Security Encoding field - * @param p_transProto Transport Protocol field - * @see mw_sdpGenericPayloadRequest - */ - template Sdp_Request m_sdpRequestPayload(in Oct1 p_sec, in Oct1 p_transProto) := { - security := p_sec, - transportProtocol := p_transProto - } - - } // end sdpMessageTemplates - - -} // end LibItsV2G_Templates \ No newline at end of file diff --git a/ttcn/V2G/LibItsV2G_TestSystem.ttcn b/ttcn/V2G/LibItsV2G_TestSystem.ttcn deleted file mode 100644 index 3f8fbdde..00000000 --- a/ttcn/V2G/LibItsV2G_TestSystem.ttcn +++ /dev/null @@ -1,134 +0,0 @@ -/** - * @author ETSI / STFS46 - * @version $URL$ - * $Id$ - * @desc Test System module for ITS V2G - * - */ -module LibItsV2G_TestSystem { - - // LibCommon - import from LibCommon_Time {modulepar all}; - import from LibCommon_Sync all; - - // LibIts - import from LibItsCommon_TestSystem all; - import from LibItsV2G_TypesAndValues all; - - //XSD - import from urn_iso_15118_2_2010_MsgDef all; - import from urn_iso_15118_2_2010_MsgDataTypes all; - - import from V2G_typeAliases all; - - group portDefinitions { - - /** - * @desc Adapter control port - */ - type port AdapterControlPort message { - out - AcV2Gprimitive; - in - AcV2Gresponse; - } // end AdapterControlPort - - /** - * @desc Upper Tester port - */ - type port UpperTesterPort message { - out - UtInitialize, UtTrigger, UtCheck; - in - UtResult; - } // end UpperTesterPort - - } // end portDefinitions - - group interfacePorts { - - group v2gApplicationLayerPorts { - - group ap1Ports { - - /** - * @desc AP1 V2G Application Layer Port - */ - type port V2Gport message { - in V2Gind; - out V2Greq; - } // end V2Gport - - } // End of group ap1Ports - - } // End of group v2gApplicationLayerPorts - - } // End of group interfacePorts - - group componentDefinitions { - - /** - * @desc ITS System Adapter - */ - type component ItsV2Gsystem { - - port UpperTesterPort utPort; - port AdapterControlPort acPort; - - // NT1 ports - port V2Gport v2gPort; - - } // end component ItsAdapter - - } // End of group componentDefinitions - - /** - * @desc Test component for ITS V2G Application layer - */ - type component ItsV2G extends ItsBaseComponent { - - port UpperTesterPort utPort; - port AdapterControlPort acPort; - - // NT1 ports - port V2Gport v2gPort; - - // timers - timer tc_v2g_secc_sequenceTimeout := c_v2g_seccSequenceTimeout * 0.95; - timer tc_v2g_evcc_sequenceTimeout := c_v2g_evccSequenceTimeout * 0.95; - - // Global variables E X A M P L E - var sessionIDType_TYPE vc_sId; - var evccIDType_TYPE vc_evccId; - var V2Gind vc_v2gIndMessage; - - } // End of component ItsV2G - - group v2gApplicationLayerPrimitives { - - group ap1Primitives { - - /** - * @desc AP1 V2G Indication Primitive - */ - type union V2Gind { - V2G_Message v2gIn, - Sdp_Message sdpIn - } - - /** - * @desc AP1 V2G Request Primitive - */ - type union V2Greq { - V2G_Message v2gOut, - Sdp_Message sdpOut - } - - } // end ap1Primitives - - } // End of group v2gApplicationLayerPrimitives - with { - encode "LibIts_Interface" - } // end interfacePrimitives - -} // End of module LibItsV2G_TestSystem diff --git a/ttcn/V2G/LibItsV2G_TypesAndValues.ttcn b/ttcn/V2G/LibItsV2G_TypesAndValues.ttcn deleted file mode 100644 index 9f424d13..00000000 --- a/ttcn/V2G/LibItsV2G_TypesAndValues.ttcn +++ /dev/null @@ -1,226 +0,0 @@ -/** - * @author ETSI / STFS46 - * @version $URL$ - * $Id$ - * @desc Module containing types and values for V2G application layer protocols - * - */ -module LibItsV2G_TypesAndValues { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - //import from iso_15118_2_2010_MsgBody all; //language "XSD" all with {extension "File:V2G_CI_MsgBody.xsd" }; - import from urn_iso_15118_2_2010_AppProtocol all;//language "XSD" all with {extension "File:XSD/V2G_CI_AppProtocol.xsd" }; - //import from iso_15118_2_2010_MsgDataTypes all;//language "XSD" all with {extension "File:XSD/V2G_CI_MsgDataTypes.xsd" }; - import from urn_iso_15118_2_2010_MsgDef all;//language "XSD" all with {extension "File:XSD/V2G_CI_MsgDef.xsd" }; - //import from iso_15118_2_2010_MsgHeader all;//language "XSD" all with {extension "File:XSD/V2G_CI_MsgHeader.xsd" }; - //import from org_w3_www__2000_09_xmldsig all;//language "XSD" all with {extension "File:XSD/xmldsig-core-schema.xsd" }; - - group v2gPdus { - - group SDPMessages { - - /** - * @desc SDP (Session Discovery Protocol) message description - */ - type record Sdp_Message { - Sdp_Header sdpHeader, - Sdp_Payload sdpPayload - } - } - } // end v2gPdus - - group v2gHeaders { - - group SDPMessages { - - /** - * @desc SDP (Session Discovery Protocol) Header description - */ - type record Sdp_Header { - Oct1 protocolVersion, - Oct1 inverseProtocolVersion, - Oct2 payloadType, - UInt16 payloadLength - } - } - - } // end v2gHeaders - - group v2gPayload { - - group SDPMessages { - - /** - * @desc SDP (Session Discovery Protocol) Payload description - */ - type union Sdp_Payload { - Sdp_Request sdpRequest, - Sdp_Response sdpResponse - } - - /** - * @desc SDP (Session Discovery Protocol) Request message description - */ - type record Sdp_Request - { - Oct1 security, - Oct1 transportProtocol - } - - /** - * @desc SDP (Session Discovery Protocol) Response message description - */ - type record Sdp_Response - { - Ipv6Address seccIPAddress, // IPv6 - UInt16 seccPort, - Oct1 security, - Oct1 transportProtocol - } - } - - } //end v2gPayload - - group IPAddress - { - /** - * @desc IPv6 Address - */ - type Oct16 Ipv6Address; - } // end IPAddress - - group acPrimitives { - - /** - * @desc TA primitives for V2G - * @member AcRetrieveUdpPort - - * @member Primitive2 - - */ - type union AcV2Gprimitive { - AcRetrieveUdpPort acRetrieveUdpPort - //Primitive2 primitive2, - } - - /** - * @desc Primitive for receiveing response from TA - * @member getLongPosVector - */ - type union AcV2Gresponse { - //UdpPort udpPort, - AcV2GresponseFailure failure - } - - /** - * @desc Primitive for TA to retrive UDP port - * @member beaconHeader Beacon template - */ - type record AcRetrieveUdpPort { - //anything you need to retrieve the correct udp port - } - - type record AcV2GresponseFailure { - boolean failure - } - - - } // end acPrimitives - - group utPrimitives { - - group utCommonPrimitives { - - /** - * @desc Upper Tester message to initialize IUT - */ - type union UtInitialize { - UtV2Ginitialize utV2Ginitialize - } - - /** - * @desc Upper Tester message describing an action/event - */ - type union UtEvent { - UtV2Gevent utV2Gevent - } - - /** - * @desc Upper Tester message to trigger an action on IUT - */ - type record UtTrigger { - UtEvent utEvent - } - - /** - * @desc Upper Tester message to check event/status on IUT - */ - type record UtCheck { - UtEvent utEvent - } - - /** - * @desc Upper Tester response message - */ - type boolean UtResult; - } - with { - encode "UpperTester" - } - - /** - * @desc Upper Tester message to initialize V2G IUT - */ - type record UtV2Ginitialize { - } - - /** - * @desc Upper Tester message generating V2G message - */ - type union UtV2Gevent { -//FIXME RGY by standard conversion all field names are lowercase -// V2G_Message.Header v2gHeader, -// V2G_Message.Body v2gBody - V2G_Message.header v2gHeader, - V2G_Message.body v2gBody - } - - } // end utPrimitives - - group sdpValues { - - const Oct1 c_protocolVersion1 := '01'O; - const Oct1 c_inverseProtocolVersion1 := 'FE'O; - - const Oct2 c_sdpRequestMessagePayloadType := '9000'O; - const Oct2 c_sdpResponseMessagePayloadType := '9001'O; - - const UInt16 c_sdpRequestPayloadLength := 2; - const UInt16 c_sdpResponsePayloadLength := 18; - - const Oct1 c_securedwithTLS := '00'O; - const Oct1 c_noTransportLayerSecurity := '10'O; - - const Oct1 c_transportProtocolTCP := '00'O; - const Oct1 c_transportProtocolUDP := '10'O; - - const UInt16 c_V2G_UDP_SDP_SERVER := 15118; - - const integer c_maxNbrSdpRequestRetrans := 4; - const integer c_maxNbrConsecutiveSdpRequest := 5; - - } // end sdpValues - - group timerTimeouts - { - const float c_v2g_seccSequenceTimeout := 60.0; - const float c_v2g_evccSequenceTimeout := 40.0; - - const float c_v2g_sdpRetransmissionTimeout := 0.25; - } -} -with { - encode "LibItsV2G" -} diff --git a/ttcn/V2G/V2G_CI_AppProtocol.xsd b/ttcn/V2G/V2G_CI_AppProtocol.xsd deleted file mode 100644 index ea3713dc..00000000 --- a/ttcn/V2G/V2G_CI_AppProtocol.xsd +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ttcn/V2G/V2G_CI_MsgBody.xsd b/ttcn/V2G/V2G_CI_MsgBody.xsd deleted file mode 100644 index 5e9a3f48..00000000 --- a/ttcn/V2G/V2G_CI_MsgBody.xsd +++ /dev/null @@ -1,484 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ttcn/V2G/V2G_CI_MsgDataTypes.xsd b/ttcn/V2G/V2G_CI_MsgDataTypes.xsd deleted file mode 100644 index dc860bc0..00000000 --- a/ttcn/V2G/V2G_CI_MsgDataTypes.xsd +++ /dev/null @@ -1,698 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Time in hours - - - - - Time in minutes - - - - - Time in seconds - - - - - Current in Ampere - - - - - Ampere hour - - - - - Voltage in Volt - - - - - Apparent power in Volt Ampere - - - - - Active power in Watt - - - - - Watt per second - - - - - Real energy in Watt hours - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ttcn/V2G/V2G_CI_MsgDef.xsd b/ttcn/V2G/V2G_CI_MsgDef.xsd deleted file mode 100644 index 5ae1e097..00000000 --- a/ttcn/V2G/V2G_CI_MsgDef.xsd +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ttcn/V2G/V2G_CI_MsgHeader.xsd b/ttcn/V2G/V2G_CI_MsgHeader.xsd deleted file mode 100644 index 35dff7ab..00000000 --- a/ttcn/V2G/V2G_CI_MsgHeader.xsd +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/ttcn/V2G/xmldsig-core-schema.xsd b/ttcn/V2G/xmldsig-core-schema.xsd deleted file mode 100644 index 003d8e1c..00000000 --- a/ttcn/V2G/xmldsig-core-schema.xsd +++ /dev/null @@ -1,308 +0,0 @@ - - - - - - ]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/xsd/V2G/V2G_CI_AppProtocol.xsd b/xsd/V2G/V2G_CI_AppProtocol.xsd deleted file mode 100644 index ea3713dc..00000000 --- a/xsd/V2G/V2G_CI_AppProtocol.xsd +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/xsd/V2G/V2G_CI_MsgBody.xsd b/xsd/V2G/V2G_CI_MsgBody.xsd deleted file mode 100644 index 8f0f8c2f..00000000 --- a/xsd/V2G/V2G_CI_MsgBody.xsd +++ /dev/null @@ -1,482 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/xsd/V2G/V2G_CI_MsgDataTypes.xsd b/xsd/V2G/V2G_CI_MsgDataTypes.xsd deleted file mode 100644 index fef8edf8..00000000 --- a/xsd/V2G/V2G_CI_MsgDataTypes.xsd +++ /dev/null @@ -1,696 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Time in hours - - - - - Time in minutes - - - - - Time in seconds - - - - - Current in Ampere - - - - - Ampere hour - - - - - Voltage in Volt - - - - - Apparent power in Volt Ampere - - - - - Active power in Watt - - - - - Watt per second - - - - - Real energy in Watt hours - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/xsd/V2G/V2G_CI_MsgDef.xsd b/xsd/V2G/V2G_CI_MsgDef.xsd deleted file mode 100644 index 44ca759a..00000000 --- a/xsd/V2G/V2G_CI_MsgDef.xsd +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/xsd/V2G/V2G_CI_MsgHeader.xsd b/xsd/V2G/V2G_CI_MsgHeader.xsd deleted file mode 100644 index a4bbc6c4..00000000 --- a/xsd/V2G/V2G_CI_MsgHeader.xsd +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/xsd/V2G/xmldsig-core-schema.xsd b/xsd/V2G/xmldsig-core-schema.xsd deleted file mode 100644 index 003d8e1c..00000000 --- a/xsd/V2G/xmldsig-core-schema.xsd +++ /dev/null @@ -1,308 +0,0 @@ - - - - - - ]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- GitLab From be2e85fb3d600a9dff37b163ef8943722589f192 Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 10 Apr 2020 09:24:49 +0200 Subject: [PATCH 241/320] Remove old ASN.1 files --- asn1/CALMfntp/CALMfntp.asn | 235 ----- asn1/CALMfntp/CALMlegacySupport.asn | 29 - asn1/CALMfsap/CALMfsap.asn | 333 ------- asn1/CALMiitsscu/CALMiitsscu.asn | 392 -------- asn1/CALMipv6/CALMipv6.asn | 98 -- asn1/CALMllsap/CALMllsap.asn | 561 ------------ asn1/CALMmanagement/CALMmanagement.asn | 152 ---- asn1/CALMmsap/CALMmsap.asn | 1137 ------------------------ 8 files changed, 2937 deletions(-) delete mode 100644 asn1/CALMfntp/CALMfntp.asn delete mode 100644 asn1/CALMfntp/CALMlegacySupport.asn delete mode 100644 asn1/CALMfsap/CALMfsap.asn delete mode 100644 asn1/CALMiitsscu/CALMiitsscu.asn delete mode 100644 asn1/CALMipv6/CALMipv6.asn delete mode 100644 asn1/CALMllsap/CALMllsap.asn delete mode 100644 asn1/CALMmanagement/CALMmanagement.asn delete mode 100644 asn1/CALMmsap/CALMmsap.asn diff --git a/asn1/CALMfntp/CALMfntp.asn b/asn1/CALMfntp/CALMfntp.asn deleted file mode 100644 index 696ee9d7..00000000 --- a/asn1/CALMfntp/CALMfntp.asn +++ /dev/null @@ -1,235 +0,0 @@ -CALMfntp { iso (1) standard (0) calm-nonip(29281) fntp(1) asnm-1 (1)} - -DEFINITIONS AUTOMATIC TAGS::=BEGIN - -IMPORTS - -CIstatus, Link-ID, UserPriority FROM CALMllsap {iso(1) standard(0) calm-ll-sap(21218) asnm-1(1)} - -ITS-scuId FROM CALMmanagement { iso (1) standard (0) calm-management (24102) local (1) asnm-1 (1)} - -COMMUPDOWN FROM CALMmsap { iso (1) standard (0) calm-management (24102) msap (3) asnm-1 (1)} - -FNTPlpp FROM CALMlegacySupport { iso (1) standard (0) calm-nonip(29281) legacy (2) asnm-1 (1)} - -ServiceRef FROM CITSapplReq {iso(1) standard(0) cits-applReq (17423) asnm-1 (1)} -; - --- End of IMPORTS - --- Types - --- PDUs -- - - -- FNTP NPDU -- - -FNTPNPDU::=SEQUENCE{ - header FNTPHeader, - body ITSfpdu -- specific to an ITS-S application / message - } - -FNTPHeader::=SEQUENCE{ - sourcePort PortNumber, - destinationPort PortNumber, - options FntpOptions - } - -FntpOptions::=SEQUENCE{ - intForw FNTPintForwarding OPTIONAL, - sec FNTPsecurity OPTIONAL, - hops FNTPhopCount OPTIONAL, - lpp FNTPlpp OPTIONAL, - cip FNTPCIPheader OPTIONAL, - opt5 NULL OPTIONAL, - opt6 NULL OPTIONAL, - opt7 NULL OPTIONAL -} - -FNTPintForwarding::=SEQUENCE{ - hostITS-scuId ITS-scuId, - link Link-ID, - counter FNTPpacketCounter, - sourcePort PortNumber, - destinationPort PortNumber - } - -FNTPpacketCounter::=INTEGER(0..255) - -FNTPsecurity::=OCTET STRING (SIZE(0..65535)) - -FNTPhopCount::=INTEGER(0..255) - -FNTPCIPheader::=SEQUENCE{ - rxCIP RXcip, - txCIP TXcip - } - -RXcip::=OCTET STRING (SIZE(0..255)) - -TXcip::=OCTET STRING (SIZE(0..255)) -- may optionally be forwarded to peer ITS station - - --- Managements SAP service primitives -- --- Payload definitions for primitives defined in ISO 24102 -- - - -- MN-SAP -- - - -- FWTxxx -- - -DeleteFNTP::=SEQUENCE{ - reference INTEGER(0..noFNTPfwtEntries) - } - -DeleteNotFNTP::=SEQUENCE{ - reference INTEGER(0..noFNTPfwtEntries) - } - -SetFNTP::=SEQUENCE{ - remotePort PortNumber, - linkID Link-ID, - ciStatus CIstatus, - linkPort PortNumber, - serviceInfo HostServiceInfo, --formerly ServiceNWref - priority UserPriority, - timeout NTtimeout - } -- SetConfFNTP will return the reference pointing to the new entry. - -SetConfFNTP::=SEQUENCE{ - reference INTEGER(0..noFNTPfwtEntries) - } - -HostServiceInfo::=SEQUENCE{ - servicePort PortNumber, - hostITSscu ITS-scuId, - servicePriority UserPriority - } - -SetNotFNTP::=SEQUENCE{ - reference INTEGER(0..noFNTPfwtEntries), - remotePort PortNumber, - linkID Link-ID, - ciStatus CIstatus, - linkPort PortNumber, - serviceInfo HostServiceInfo, - priority UserPriority, - timeout NTtimeout - } - -UpdateFNTP::=SEQUENCE{ - fill BIT STRING (SIZE(1)), - reference INTEGER(0..noFNTPfwtEntries), - remotePort PortNumber OPTIONAL, - linkID Link-ID OPTIONAL, - ciStatus CIstatus OPTIONAL, - linkPort PortNumber OPTIONAL, - serviceInfo HostServiceInfo OPTIONAL, - priority UserPriority OPTIONAL, - timeout NTtimeout OPTIONAL - } - -UpdateNotFNTP::=SEQUENCE{ - fill BIT STRING (SIZE(1)), - reference INTEGER(0..noFNTPfwtEntries), - remotePort PortNumber OPTIONAL, - linkID Link-ID OPTIONAL, - ciStatus CIstatus OPTIONAL, - linkPort PortNumber OPTIONAL, - serviceInfo HostServiceInfo OPTIONAL, - priority UserPriority OPTIONAL, - timeout NTtimeout OPTIONAL - } - - -- NF-SAP -- - -NFSAP ::= COMMUPDOWN - -NFsapPrimitivesDown::=SEQUENCE{ - spRef NFSAP.&primitiveRef ({NFsapspsdown}), - servPrimitive NFSAP.&Primitive({NFsapspsdown}{@spRef}) - } - -NFsapspsdown NFSAP::={fntpPortRequest | fntpCommRequest, ...} - -fntpPortRequest NFSAP::={&primitiveRef 0, &Primitive NFfntpPortRequest} -fntpCommRequest NFSAP::={&primitiveRef 1, &Primitive NFfntpCommRequest} - -NFsapPrimitivesUp::=SEQUENCE{ - spRef NFSAP.&primitiveRef ({NFsapspsup}), - servPrimitive NFSAP.&Primitive({NFsapspsup}{@spRef}) - } - -NFsapspsup NFSAP::={fntpPortConfirm | fntpCommConfirm | fntpCommIndication, ...} - -fntpPortConfirm NFSAP::={&primitiveRef 0, &Primitive NFfntpPortConfirm} -fntpCommConfirm NFSAP::={&primitiveRef 1, &Primitive NFfntpCommConfirm} -fntpCommIndication NFSAP::={&primitiveRef 2, &Primitive NFfntpCommIndication} - -PortOp::=INTEGER{ - delete (0), - create (255) - } (0..255) - -NFfntpPortRequest::=SEQUENCE{ - serviceRef ServiceRef, - operation PortOp, - portno PortNumber, - priority UserPriority - } - -NFfntpPortConfirm::=SEQUENCE{ - serviceRef ServiceRef, - servicePort PortNumber - } - -NFfntpCommRequest::=SEQUENCE{ - commRef INTEGER(0..255), - servicePort PortNumber, - remotePort PortNumber, - linkID Link-ID, - data ITSfpdu, - priority UserPriority, - controlField FntpOptions -- some options do not apply - } - -NFfntpCommConfirm::=SEQUENCE{ - commRef INTEGER(0..255), - servicePort PortNumber, - errStatus FNTPerrorStatus - } - -FNTPerrorStatus::=INTEGER{ - success (0), - unspecFailure (1), - ciBusyTX (2), - noForwardInfo (254), - ciSuspend (255) - } (0..255) - -NFfntpCommIndication::=SEQUENCE{ - servicePort PortNumber, - remotePort PortNumber, - linkID Link-ID, - data ITSfpdu, - priority UserPriority, - controlField FntpOptions - } - --- General types -- - -PortNumber::=CHOICE{ - portShort INTEGER(0..127), - portLong INTEGER(0..32767) - } - -ITSfpdu::=OCTET STRING(SIZE(0..65535)) -- as defined by application. Details not known to FNTP - - -NTtimeout::=INTEGER(0..65535) -- in s - --- Values - -noFNTPfwtEntries INTEGER::=65535 - - - -END diff --git a/asn1/CALMfntp/CALMlegacySupport.asn b/asn1/CALMfntp/CALMlegacySupport.asn deleted file mode 100644 index a6415b06..00000000 --- a/asn1/CALMfntp/CALMlegacySupport.asn +++ /dev/null @@ -1,29 +0,0 @@ -CALMlegacySupport { iso (1) standard (0) calm-nonip(29281) legacy (2) asnm-1 (1)} - -DEFINITIONS AUTOMATIC TAGS::=BEGIN - -IMPORTS -PortNumber FROM CALMfntp { iso (1) standard (0) calm-nonip(29281) fntp(1) asnm-1 (1)} -; - --- End of IMPORTS - --- General types -- - -Param15628::=SEQUENCE{ - fill BIT STRING (SIZE(7)), - params CHOICE{ - legacyOption [0] INTEGER(0..255), - portPM [1] PortNumber -- Port number of 15628 Port Manager --- [2-254] - } - } - -FNTPlpp::=OCTET STRING (SIZE(0..65535)) - --- Values - - --- Dummy values not defined here which cannot be imported. To be replaced by proper type. - -END diff --git a/asn1/CALMfsap/CALMfsap.asn b/asn1/CALMfsap/CALMfsap.asn deleted file mode 100644 index cf5addfa..00000000 --- a/asn1/CALMfsap/CALMfsap.asn +++ /dev/null @@ -1,333 +0,0 @@ -CALMfsap { iso (1) standard (0) calm-management (24102) fsap (5) asnm-1 (1)} - -DEFINITIONS AUTOMATIC TAGS::=BEGIN - -IMPORTS - -ITSaid FROM CITSapplMgmtApplReg {iso(1) standard(0) cits-applMgmt (17419) applRegistry (2)} - -PortNumber FROM CALMfntp { iso (1) standard (0) calm-nonip(29281) fntp(1) asnm-1(1)} - -Directivity, LLserviceAddr, MedType, UserPriority FROM CALMllsap {iso(1) standard(0) calm-ll-sap(21218) asnm-1(1)} - -ApplicationID, ITS-scuId, StationID FROM CALMmanagement { iso (1) standard (0) calm-management (24102) local (1) asnm-1(1)} - -TransportAddressType, TransportAddress FROM TRANSPORT-ADDRESS-MIB - -; - --- End of IMPORTS - --- Types - --- PDUs -- - --- SAM -- - -SAM::=SEQUENCE{ - fmtID FmtID, -- value sam - version VersionFSAP, - serverID StationID, - serviceList ServiceList, - channelList ChannelList, - ipServList IpServList - } - -FmtID::=INTEGER{ - sam (0), - ctx (1) - } (0..15) - -VersionFSAP::=INTEGER(0..15) - -ServiceList::=SEQUENCE (SIZE(0..noNonipServices))OF NonipService - -ChannelList::=SEQUENCE(SIZE(0..noChannels)) OF SessionChannel --- Name changed from ServiceChannel to SessionChannel for clarification - -IpServList::=SEQUENCE (SIZE(0..noIpServices))OF IpService - -NonipService::=SEQUENCE{ - serviceID ITSaid, - serviceData ServiceData, - serverPort PortNumber, -- always transmitted, even if not used - sessionChannel INTEGER(0..noChannels) -- '0':no change of channel - } - -SessionChannel::= SEQUENCE{ - serviceChannel INTEGER(0..255), -- medium-specific channel number - medium MedType, -- identification of access technology - schParams OCTET STRING -- medium-specific parameters -} - -IpService::=SEQUENCE{ - serviceID ITSaid, - serviceData IpServiceData, - ipInfo IpInfo, - sessionChannel INTEGER(0..noChannels) -} - --- CTX -- - -CTX::=SEQUENCE{ - fmtID FmtID, -- value ctx - version VersionFSAP, - clientID StationID, - servContextList ServContextList, - ipContextList IpContextList -} - -ServContextList::=SEQUENCE (SIZE(0..noNonipContexts))OF NonipContext - -IpContextList::=SEQUENCE (SIZE(0..noIpContexts))OF IpContext - -IpContext::=SEQUENCE{ - serviceID ITSaid, - contextData IpContextData, - ipInfo IpInfo -} - --- MF-SAP services -- - -GCctxTxCmd::=SEQUENCE{ - link LLserviceAddr, -- NT protocol and UC-VCI - ctx CTX - } - -GCperiodCmd::=SEQUENCE{ - applicationID ApplicationID, - bcVCIs SEQUENCE (SIZE(1..256)) OF LLserviceAddr, - gcInterval GcInterval, -- repetition interval - priority UserPriority, -- of advertisement - serviceDataReg ServiceDataReg -- advertisement details - } - -GCsamctx::= SEQUENCE{ - applicationID ApplicationID, -- unique in the host - serverID StationID, -- of peer station - serviceInfo ServiceInfo, - link LLserviceAddr - } - -GCsamctxConf::= SEQUENCE{ - applicationID ApplicationID, -- unique in the host - link LLserviceAddr, -- as received in the GCsamctx - port PortNumber -- dynamically assigned port number to be used in CTX - } - -GCdeleteCmd::=SEQUENCE{ - applicationID ApplicationID - } - -ServiceInfo::=SEQUENCE{ - fill BIT STRING (SIZE(7)), - info CHOICE{ - nonipService NonipSAMctx, - ipService IpSAMctx - } - } - -NonipSAMctx::=SEQUENCE{ - serviceID ITSaid, - providerPort PortNumber - } - -IpSAMctx::=SEQUENCE{ - serviceID ITSaid, - ipInfo IpInfo - } - --- MN-SAP services -- - -CTXrxNot::=SEQUENCE{ - link LLserviceAddr, - ctx CTX - } - -SAMrxNot::=SEQUENCE{ - link LLserviceAddr, - sam SAM - } - -GCsam::= SEQUENCE{ - applicationID ApplicationID, -- unique in the host - serverID StationID, -- peer station - serviceData SAMserviceData, - link LLserviceAddr -} - -SAMserviceData::=SEQUENCE{ - fill BIT STRING (SIZE(7)), - servData CHOICE { - nonipService NonipSAM, - ipService IpSAM - } - } - -NonipSAM::=SEQUENCE{ - serviceID ITSaid, - serviceData ServiceData, - providerPort PortNumber, - sessionChannel SessionChannel -} - -IpSAM::=SEQUENCE{ - serviceID ITSaid, - serviceData IpServiceData, - ipInfo IpInfo, - sessionChannel SessionChannel - } - -GCctx::= SEQUENCE{ - applicationID ApplicationID, -- unique in the host - clientID StationID, -- peer station - serviceContext CTXserviceData - } - -CTXserviceData::=SEQUENCE{ - fill BIT STRING (SIZE(7)), - servData CHOICE { - nonipContext NonipContext, - ipContext IpContext - } - } - -NonipContext::=SEQUENCE{ - serviceID ITSaid, - contextData ContextData, - userPort PortNumber - } - -GCregServer::= SEQUENCE{ - applicationID ApplicationID, - gCschedule GCschedule, - priority UserPriority, - serviceDataReg ServiceDataReg - } - -GCupdateServer::= SEQUENCE{ - applicationID ApplicationID, - gCschedule GCschedule, - fill BIT STRING (SIZE(7)), - serviceDataReg SEQUENCE (SIZE(0..1)) OF ServiceDataReg - } - -GCderegServer::= SEQUENCE{ - applicationID ApplicationID - } - -GCregClient::= SEQUENCE{ - applicationID ApplicationID, - priority UserPriority, - serviceID ITSaid, - contextData ContextData - } - -GCupdateClient::= SEQUENCE{ - applicationID ApplicationID, - serviceID ITSaid, - contextData ContextData - } - -GCderegClient::= SEQUENCE{ - applicationID ApplicationID - } - -GCregServerConf::= SEQUENCE{ - applicationID ApplicationID - } - -GCupdateServerConf::= SEQUENCE{ - applicationID ApplicationID - } - -GCderegServerConf::= SEQUENCE{ - applicationID ApplicationID - } - -GCregClientConf::= SEQUENCE{ - applicationID ApplicationID - } - -GCupdateClientConf::= SEQUENCE{ - applicationID ApplicationID - } - -GCderegClientConf::= SEQUENCE{ - applicationID ApplicationID - } - - --- General types -- -ServiceData::=OCTET STRING (SIZE(0..noServiceDataOctets)) - -ContextData::=OCTET STRING (SIZE(0..noContextDataOctets)) - -IpServiceData::=OCTET STRING (SIZE(0..noIpServiceDataOctets)) - -IpContextData::=OCTET STRING (SIZE(0..noIpContextDataOctets)) - -GCschedule::= SEQUENCE (SIZE(0..255)) OF GCsched - -GCsched::= SEQUENCE{ - medium MedType, - directivity Directivity, - gcInterval GcInterval - } - -ServiceDataReg::= SEQUENCE{ - fill BIT STRING (SIZE(7)), - datareg CHOICE{ - nonipData [0] NonipServiceReg, - ipData [1] IpServiceReg - } - } - -NonipServiceReg::=SEQUENCE{ - serviceID ITSaid, - serviceData OCTET STRING (SIZE(0..noServiceDataOctets)), - providerPort PortNumber -- if not used, put PORT_UNK -} - -IpServiceReg::=SEQUENCE{ - serviceID ITSaid, - serviceData OCTET STRING (SIZE(0..noIpServiceDataOctets)), - ipInfo IpInfo - } - -GcInterval::=INTEGER(0..65535) -- in ms - -IpInfo::=SEQUENCE{ - address IpAddressInfo - } - -IpAddressInfo::=SEQUENCE{ - addressType TransportAddressType, - address TransportAddress -} - --- Values --- to be corrected / confirmed - -noNonipServices INTEGER::=255 - -noChannels INTEGER::=255 - -noIpServices INTEGER::=255 - -noNonipContexts INTEGER::=255 - -noIpContexts INTEGER::=255 - -noServiceDataOctets INTEGER::=65535 - -noIpServiceDataOctets INTEGER::=65535 - -noContextDataOctets INTEGER::=65535 - -noIpContextDataOctets INTEGER::=65535 - -versionNoFSAP INTEGER::=0 -- This standard - - -END diff --git a/asn1/CALMiitsscu/CALMiitsscu.asn b/asn1/CALMiitsscu/CALMiitsscu.asn deleted file mode 100644 index c6815463..00000000 --- a/asn1/CALMiitsscu/CALMiitsscu.asn +++ /dev/null @@ -1,392 +0,0 @@ ----- - -CALMiitsscu { iso (1) standard (0) calm-management (24102) iitsscu (4) asnm-1 (1) version1 (1)} -DEFINITIONS AUTOMATIC TAGS::=BEGIN - -IMPORTS -CIaClass, CIclass, CIstatus, Directivity, Link-ID, LLserviceAddr, MACaddress, MedType, NullType FROM CALMllsap {iso(1) standard(0) calm-ll-sap(21218) asnm-1 (1) version1 (1)} - -ITS-scuId, Param24102No, Param24102 FROM CALMmanagement { iso (1) standard (0) calm-management (24102) local (1) asnm-1 (1) version1 (1)} - -SimFUTcmd, SimFUTreq, SimFLTcmd, SimNUTcmd, SimNLTcmd, SimIUTcmd, SimFLTreq, SimNUTreq, SimNLTreq, SimIUTreq, ErrStatus, MF-Command-request, MF-Request-request, MN-Command-request, MN-Request-request, MI-Command-request, MI-Request-request, MA-Command-request, MA-Request-request, MS-Command-request, MS-Request-request, MI-Get-request, MI-Set-request, MF-Command-confirm, MF-Request-confirm, MN-Command-confirm, MN-Request-confirm, MI-Command-confirm, MI-Request-confirm, MA-Command-confirm, MA-Request-confirm, MS-Command-confirm, MS-Request-confirm, MI-Get-confirm, MI-Set-confirm FROM CALMmsap {iso (1) standard (0) calm-management (24102) msap (3) asnm-1 (1) version1 (1)} - --- Details on SecRq and SecRs to be provided by a standard on security -; --- End of IMPORTS - --- Types - --- PDUs -- --- IIC-Request PDU -IIC-Request::=SEQUENCE{ - sourceITS-scuId ITS-scuId, - destinationITS-scuId ITS-scuId, - pduCounter PduCounter, - requestID RequestID, -- value zero - pduRequest PduRequest, - secRq SecRq - } - -RequestID::=INTEGER{ - request (0) - } (0..255) - -RefIICP ::= INTEGER { -- Define IICPREQ.ref values range - c-alive (0), - c-mfRcmd (1), - c-mfRreq (2), - c-mnRcmd (3), - c-mnRreq (4), - c-miRcmd (5), - c-miRreq (6), - c-miRget (7), - c-miRset (8), - c-mCmd (9), - c-maRcmd (10), - c-maRreq (11), - c-msRcmd (12), - c-msRreq (13), - c-simUtIn (240), - c-simUtOut (241), - c-simAutCmd (242), - c-simAutReq (243), - c-simFutCmd (244), - c-simFutReq (245), - c-simNutCmd (246), - c-simNutReq (247), - c-simIutCmd (248), - c-simIutReq (249), - c-simAltCmd (250), - c-simAltReq (251), - c-simFltCmd (252), - c-simFltReq (253), - c-simNltCmd (254), - c-simNltReq (255) -} (0..255) - -IICPREQ::=CLASS{ - &ref RefIICP UNIQUE, -- data type identifier - &IICPrequest - } - -IICPrequests IICPREQ::={aliveRq | mfRcmdRq | mfRreqRq | mnRcmdRq | mnRreqRq | miRcmdRq | miRreqRq | miRgetRq | miRsetRq | mCmdRq | maRcmdRq | maRreqRq | msRcmdRq | msRreqRq | simFutCmdRq | simFutReqRq | simNutCmdRq | simNutReqRq | simIutCmdRq | simIutReqRq | simFltCmdRq | simFltReqRq | simNltCmdRq | simNltReqRq | simUtInRq | simUtOutRq, ...} - -PduRequest::=SEQUENCE{ - reqRef IICPREQ.&ref({IICPrequests}), -- data type identifier - iicpReq IICPREQ.&IICPrequest({IICPrequests}{@reqRef}) - } - -aliveRq IICPREQ::={&ref c-alive, &IICPrequest ITS-SCUalive} -mfRcmdRq IICPREQ::={&ref c-mfRcmd, &IICPrequest MF-Command-request} -mfRreqRq IICPREQ::={&ref c-mfRreq, &IICPrequest MF-Request-request} -mnRcmdRq IICPREQ::={&ref c-mnRcmd, &IICPrequest MN-Command-request} -mnRreqRq IICPREQ::={&ref c-mnRreq, &IICPrequest MN-Request-request} -miRcmdRq IICPREQ::={&ref c-miRcmd, &IICPrequest MI-Command-request} -miRreqRq IICPREQ::={&ref c-miRreq, &IICPrequest MI-Request-request} -miRgetRq IICPREQ::={&ref c-miRget, &IICPrequest MI-Get-request} -miRsetRq IICPREQ::={&ref c-miRset, &IICPrequest MI-Set-request} -mCmdRq IICPREQ::={&ref c-mCmd, &IICPrequest McmdRq} -maRcmdRq IICPREQ::={&ref c-maRcmd, &IICPrequest MA-Command-request} -maRreqRq IICPREQ::={&ref c-maRreq, &IICPrequest MA-Request-request} -msRcmdRq IICPREQ::={&ref c-msRcmd, &IICPrequest MS-Command-request} -msRreqRq IICPREQ::={&ref c-msRreq, &IICPrequest MS-Request-request} --- simAutCmdRq IICPREQ::={&ref c-simAutCmd, &IICPrequest SimAUTcmd} --- simAutReqRq IICPREQ::={&ref c-simAutReq, &IICPrequest SimAUTreq} -simFutCmdRq IICPREQ::={&ref c-simFutCmd, &IICPrequest SimFUTcmd} -simFutReqRq IICPREQ::={&ref c-simFutReq, &IICPrequest SimFUTreq} -simNutCmdRq IICPREQ::={&ref c-simNutCmd, &IICPrequest SimNUTcmd} -simNutReqRq IICPREQ::={&ref c-simNutReq, &IICPrequest SimNUTreq} -simIutCmdRq IICPREQ::={&ref c-simIutCmd, &IICPrequest SimIUTcmd} -simIutReqRq IICPREQ::={&ref c-simIutReq, &IICPrequest SimIUTreq} --- simAltCmdRq IICPREQ::={&ref c-simAltCmd, &IICPrequest SimALTcmd} --- simAltReqRq IICPREQ::={&ref c-simAltReq, &IICPrequest SimALTreq} -simFltCmdRq IICPREQ::={&ref c-simFltCmd, &IICPrequest SimFLTcmd} -simFltReqRq IICPREQ::={&ref c-simFltReq, &IICPrequest SimFLTreq} -simNltCmdRq IICPREQ::={&ref c-simNltCmd, &IICPrequest SimNLTcmd} -simNltReqRq IICPREQ::={&ref c-simNltReq, &IICPrequest SimNLTreq} -simUtInRq IICPREQ::={&ref c-simUtIn, &IICPrequest SimUt} -simUtOutRq IICPREQ::={&ref c-simUtOut, &IICPrequest SimUt} - - -ITS-SCUalive::=SEQUENCE{ - message AliveMessage, - its-scuType ITS-SCUtype - } - -AliveMessage::= INTEGER{ - alive (0), - delete (1), - new (255) - } (0..255) - -ITS-SCUtype::= INTEGER{ - unknown (0), - host (1), -- multicast address - router (2), -- multicast address - itsTestSystem (3), -- used in conformance testing - itsTestCIunit (4), -- used in conformance testing - any (255) -- broadcast address - } (0..255) - -SimUt::=SEQUENCE{ - fill BIT STRING (SIZE(3)), -- all bits set to '0' - action CHOICE{ - mfCmdReq MF-Command-request, - mfCmdConf MF-Command-confirm, - mnCmdReq MN-Command-request, - mnCmdConf MN-Command-confirm, - miCmdReq MI-Command-request, - miCmdConf MI-Command-confirm, - maCmdReq MA-Command-request, - maCmdConf MA-Command-confirm, - mfReqReq MF-Request-request, - mfReqConf MF-Request-confirm, - mnReqReq MN-Request-request, - mnReqConf MN-Request-confirm, - miReqReq MI-Request-request, - miReqConf MI-Request-confirm, - maReqReq MA-Request-request, - maReqConf MA-Request-confirm, - miGetReq MI-Get-request, - miGetConf MI-Get-confirm, - miSetReq MI-Set-request, - miSetConf MI-Set-confirm, - mcmdTrigger McmdRq, - mcmdEvent McmdRs --- msCmdReq MS-Command-request, --- msCmdConf MS-Command-confirm, --- msReqReq MS-Request-request, --- msReqConf MS-Request-confirm - } - } - - --- General OBJECT CLASS for management commands - -RefMcmdRq ::= INTEGER { -- allows for 256 commands - c-pingRq (0), - c-vCIinfoRq (1), - c-vCIupdateRq (2), - c-getParam24102Rq (3), - c-setParam24102Rq (4), - c-testIicpRq (254), - c-testConfigRq (255) -} (0..255) - -MCMDREQ::=CLASS{ - &refMcmd RefMcmdRq UNIQUE, -- allows for 256 commands - &Mcmd - } - -McmdReqs MCMDREQ::={pingRq | vCIinfoRq | vCIupdateRq | getParam24102Rq | setParam24102Rq | testConfigRq, ...} - -McmdRq::=SEQUENCE{ - mCmdRef MCMDREQ.&refMcmd({McmdReqs}), - mcmd MCMDREQ.&Mcmd ({McmdReqs}{@mCmdRef}) - } - -pingRq MCMDREQ::={&refMcmd c-pingRq, &Mcmd PingIICP} -vCIinfoRq MCMDREQ::={&refMcmd c-vCIinfoRq, &Mcmd VCI-info-req} -vCIupdateRq MCMDREQ::={&refMcmd c-vCIupdateRq, &Mcmd VCI-update-req} -getParam24102Rq MCMDREQ::={&refMcmd c-getParam24102Rq, &Mcmd Param24102No} -setParam24102Rq MCMDREQ::={&refMcmd c-setParam24102Rq, &Mcmd Param24102} -testConfigRq MCMDREQ::={&refMcmd c-testConfigRq, &Mcmd TestConfigIICP} - -PingIICP::=OCTET STRING (SIZE(0..255)) - -VCI-info-req::=SEQUENCE{ - medType MedType, - ciaClass CIaClass, - ciClass CIclass - } - -VCI-update-req::=SEQUENCE (SIZE(0..255)) OF VCI-Info - -VCI-Info::=SEQUENCE{ - linkId Link-ID, - medType MedType, - ciaClass CIaClass, - ciClass CIclass, - status CIstatus - } - -TestConfigIICP::=SEQUENCE{ - location BIT STRING (SIZE(6)), - lowerLayers BIT STRING (SIZE(1)), - testMode BIT STRING (SIZE(1)) - } - - - --- IIC-Response PDU - -IIC-Response::=SEQUENCE{ - sourceITS-scuId ITS-scuId, - destinationITS-scuId ITS-scuId, - pduCounter PduCounter, - responseID ResponseID, -- value 1 - pduResponse PduResponse, - errorStatus PduErrStatus, - secRs SecRs - } - -ResponseID::=INTEGER{ - response (1) - } (0..255) - - -IICPRES::=CLASS{ - &ref RefIICP UNIQUE, - &IICPresponse - } - -IICPresponses IICPRES::={aliveRs | mfRcmdRs | mfRreqRs | mnRcmdRs | mnRreqRs | miRcmdRs | miRreqRs | miRgetRs | miRgetRs | miRsetRs | mCmdRs | maRcmdRs | maRreqRs | msRcmdRs | msRreqRs | simAutCmdRs | simAutReqRs | simFutCmdRs | simFutReqRs | simNutCmdRs | simNutReqRs | simIutCmdRs | simIutReqRs | simAltCmdRs | simAltReqRs | simFltCmdRs | simFltReqRs | simNltCmdRs | simNltReqRs | simUtInRs | simUtOutRs, ...} - -PduResponse::=SEQUENCE{ - resRef IICPRES.&ref({IICPresponses}), -- data type identifier - iicpRes IICPRES.&IICPresponse({IICPresponses}{@resRef}) - } - -aliveRs IICPRES::={&ref c-alive, &IICPresponse ITS-SCUalive} -mfRcmdRs IICPRES::={&ref c-mfRcmd, &IICPresponse MF-Command-confirm} -mfRreqRs IICPRES::={&ref c-mfRreq, &IICPresponse MF-Request-confirm} -mnRcmdRs IICPRES::={&ref c-mnRcmd, &IICPresponse MN-Command-confirm} -mnRreqRs IICPRES::={&ref c-mnRreq, &IICPresponse MN-Request-confirm} -miRcmdRs IICPRES::={&ref c-miRcmd, &IICPresponse MI-Command-confirm} -miRreqRs IICPRES::={&ref c-miRreq, &IICPresponse MI-Request-confirm} -miRgetRs IICPRES::={&ref c-miRget, &IICPresponse MI-Get-confirm} -miRsetRs IICPRES::={&ref c-miRset, &IICPresponse MI-Set-confirm} -mCmdRs IICPRES::={&ref c-mCmd, &IICPresponse McmdRs} -maRcmdRs IICPRES::={&ref c-maRcmd, &IICPresponse MA-Command-confirm} -maRreqRs IICPRES::={&ref c-maRreq, &IICPresponse MA-Request-confirm} -msRcmdRs IICPRES::={&ref c-msRcmd, &IICPresponse MS-Command-confirm} -msRreqRs IICPRES::={&ref c-msRreq, &IICPresponse MS-Request-confirm} -simAutCmdRs IICPRES::={&ref c-simAutCmd, &IICPresponse NULL} -simAutReqRs IICPRES::={&ref c-simAutReq, &IICPresponse NULL} -simFutCmdRs IICPRES::={&ref c-simFutCmd, &IICPresponse NULL} -simFutReqRs IICPRES::={&ref c-simFutReq, &IICPresponse NULL} -simNutCmdRs IICPRES::={&ref c-simNutCmd, &IICPresponse NULL} -simNutReqRs IICPRES::={&ref c-simNutReq, &IICPresponse NULL} -simIutCmdRs IICPRES::={&ref c-simIutCmd, &IICPresponse NULL} -simIutReqRs IICPRES::={&ref c-simIutReq, &IICPresponse NULL} -simAltCmdRs IICPRES::={&ref c-simAltCmd, &IICPresponse NULL} -simAltReqRs IICPRES::={&ref c-simAltReq, &IICPresponse NULL} -simFltCmdRs IICPRES::={&ref c-simFltCmd, &IICPresponse NULL} -simFltReqRs IICPRES::={&ref c-simFltReq, &IICPresponse NULL} -simNltReqRs IICPRES::={&ref c-simNltReq, &IICPresponse NULL} -simNltCmdRs IICPRES::={&ref c-simNltCmd, &IICPresponse NULL} -simUtInRs IICPRES::={&ref c-simUtIn, &IICPresponse NULL} -simUtOutRs IICPRES::={&ref c-simUtOut, &IICPresponse NULL} - -RefMcmdRs ::= INTEGER { - c-pingRs (0), - c-vCIinfoRs (1), - c-vCIupdateRs (2), - c-getParam24102Rs (3), - c-setParam24102Rs (4), - c-testIicpRs (254), - c-testConfigRs (255) -} (0..255) - -MCMDRES::=CLASS{ - &refMcmd RefMcmdRs UNIQUE, - &Mcmd - } - -McmdRess MCMDRES::={pingRs | vCIinfoRs | vCIupdateRs | getParam24102Rs | setParam24102Rs | testConfigRs, ...} - -McmdRs::=SEQUENCE{ - mCmdRef MCMDRES.&refMcmd({McmdRess}), - mcmd MCMDRES.&Mcmd ({McmdRess}{@mCmdRef}) - } - -pingRs MCMDRES::={&refMcmd c-pingRs, &Mcmd PingIICP} -vCIinfoRs MCMDRES::={&refMcmd c-vCIinfoRs, &Mcmd VCI-info-res} -vCIupdateRs MCMDRES::={&refMcmd c-vCIupdateRs, &Mcmd NULL} -getParam24102Rs MCMDRES::={&refMcmd c-getParam24102Rs, &Mcmd Param24102} -setParam24102Rs MCMDRES::={&refMcmd c-setParam24102Rs, &Mcmd ErrStatus} -testConfigRs MCMDRES::={&refMcmd c-testConfigRs, &Mcmd NullType} - -PduErrStatus::=INTEGER{ - success (0), - pduUnknown (1), - duplicateITS-scuId (2), - invalidAliveMessage (3), - invalidITSscuType (4), - unspecFailure (255) - } (0..255) - -VCI-info-res::=SEQUENCE (SIZE(0..255)) OF VCI-Info - --- SECURITY IIC_REQUEST -RefSECIICPRQ ::= INTEGER { - c-secRqRef (0), - c-secRq (1) -} (0..255) - -SECIICPRQ::=CLASS{ - &ref RefSECIICPRQ UNIQUE, -- security type identifier - &SecIICP - } - - -SecIICPRQs SECIICPRQ::={noSecurityRq | octStringRq, ...} - -SecRq::=SEQUENCE{ - secRqRef SECIICPRQ.&ref({SecIICPRQs}), - secRq SECIICPRQ.&SecIICP({SecIICPRQs}{@secRqRef}) - } - -noSecurityRq SECIICPRQ::={&ref c-secRqRef, &SecIICP NullType} -octStringRq SECIICPRQ::={&ref c-secRq, &SecIICP SecIICPpayload } - --- SECURITY IIC_RESPONSE -RefSECIICPRS ::= INTEGER { - c-secRsRef (0), - c-secRs (1) -} (0..255) -SECIICPRS ::= CLASS{ - &ref RefSECIICPRS UNIQUE, -- security type identifier - &SecIICP - } -SECIICPRSs SECIICPRS::={noSecurityRs | octStringRs, ...} - - -SecRs::=SEQUENCE{ - secRsRef SECIICPRS.&ref({SECIICPRSs}), - secRs SECIICPRS.&SecIICP({SECIICPRSs}{@secRsRef}) - } - -noSecurityRs SECIICPRS::={&ref c-secRsRef, &SecIICP NullType} -octStringRs SECIICPRS::={&ref c-secRs, &SecIICP SecIICPpayload } - -SecIICPpayload ::= OCTET STRING (SIZE(0..65535)) --- MF-SAP -- - --- MF-COMMANDs -- - -IICrequestTX::=IIC-Request - -IICresponseTX::=IIC-Response - --- MF-REQUESTs -- - -IICrequestRX::=IIC-Request - -IICresponseRX::=IIC-Response - - --- General types -- - -PduCounter::=INTEGER(0..65535) - --- Values - -version INTEGER(0..255)::=2 -- version of this ASN.1 module - -/* - The ASN.1 specification has been checked for conformance to the ASN.1 - standards by OSS ASN.1 Syntax Checker, and by OSS ASN-1STEP -*/ - -END diff --git a/asn1/CALMipv6/CALMipv6.asn b/asn1/CALMipv6/CALMipv6.asn deleted file mode 100644 index 1a4da01f..00000000 --- a/asn1/CALMipv6/CALMipv6.asn +++ /dev/null @@ -1,98 +0,0 @@ -CALMipv6 { iso(1) standard(0) calm-ipv6(21210) asnm-1(1)} - -DEFINITIONS AUTOMATIC TAGS::=BEGIN - -IMPORTS -Link-ID, CIstatus, UserPriority FROM CALMllsap {iso(1) standard(0) calm-ll-sap(21218) asnm-1(1)} - -IpAddressInfo FROM CALMfsap { iso (1) standard (0) calm-management (24102) fsap (5) asnm-1 (1)} - -TransportAddressType, TransportAddress FROM TRANSPORT-ADDRESS-MIB; --- It needs to be checked whether this ASN.1 module is the correct one. - --- End of IMPORTS - -DeleteIPv6::=SEQUENCE -- used in 24102 -{ -reference INTEGER(0..65535) -} - -DeleteNotIPv6::=SEQUENCE -- used in 24102 -{ -reference INTEGER(0..65535) -} - -SetConfIPv6::=SEQUENCE -- used in 24102 -{ -reference INTEGER(0..65535) -} - -SetIPv6::=SEQUENCE -- used in 24102 -{ -reference INTEGER(0..65535), -remoteIP IpAddressInfo, -ciid Link-ID, -ciStatus CIstatus, -localIP IpAddressInfo, -priority UserPriority, -timeout IPv6timeout -} - -SetNotIPv6::=SEQUENCE -- used in 24102 -{ -reference INTEGER(0..65535), -remoteIP IpAddressInfo, -ciid Link-ID, -ciStatus CIstatus, -localIP IpAddressInfo, -priority UserPriority, -timeout IPv6timeout -} - -UpdateIPv6::=SEQUENCE -- used in 24102 -{ -fill [0] BIT STRING (SIZE(2)), -reference [1] INTEGER(0..65535), -remoteIP [2] IpAddressInfo OPTIONAL, -ciid [3] Link-ID OPTIONAL, -ciStatus [4] CIstatus OPTIONAL, -localIP [5] IpAddressInfo OPTIONAL, -priority [6] UserPriority OPTIONAL, -timeout [7] IPv6timeout OPTIONAL -} - -UpdateNotIPv6::=SEQUENCE -- used in 24102 -{ -fill [0] BIT STRING (SIZE(2)), -reference [1] INTEGER(0..65535), -remoteIP [2] IpAddressInfo OPTIONAL, -ciid [3] Link-ID OPTIONAL, -ciStatus [4] CIstatus OPTIONAL, -localIP [5] IpAddressInfo OPTIONAL, -priority [6] UserPriority OPTIONAL, -timeout [7] IPv6timeout OPTIONAL -} - -IPv6timeout::=INTEGER(0..65535) -- Used in IPv6 forwarding tables; in ms - --- CME-Application-SET::= --- This was used in the previous version of IS21217. --- Needs to be checked how it is used now. --- If this is no more used, then IS24102 needs to be changed. - --- IpAddress::= --- Part of CME-Application-SET --- Is contained in IpAddressInfo - --- SocketID::= --- Part of CME-Application-SET --- Likely the meaning is the same as for "reference" used above - --- PhysicalInfo::= --- Part of CME-Application-SET - --- PortNumber::= --- Part of CME-Application-SET --- Is contained in IpAddressInfo - -END diff --git a/asn1/CALMllsap/CALMllsap.asn b/asn1/CALMllsap/CALMllsap.asn deleted file mode 100644 index d78f3a6c..00000000 --- a/asn1/CALMllsap/CALMllsap.asn +++ /dev/null @@ -1,561 +0,0 @@ ----- - -CALMllsap {iso(1) standard(0) calm-ll-sap(21218) asnm-1(1)} DEFINITIONS AUTOMATIC TAGS::=BEGIN - --- EXPORTS; - -IMPORTS - -ITS-scuId FROM CALMmanagement { iso (1) standard (0) calm-management (24102) local (1) asnm-1 (1)} - - -ErrStatus, COMMUPDOWN FROM CALMmsap { iso (1) standard (0) calm-management (24102) msap (3) asnm-1 (1)} - - -MediumCost FROM CITSapplReq {iso(1) standard(0) cits-applReq (17423) asnm-1} - -LogicalChannelType FROM CITSapplMgmtComm {iso(1) standard(0) cits-applMgmt (17419) comm (3)} -; - --- End of IMPORTS - -Alt::=INTEGER(0..65535) -- Resolution 0,1 m. - -CIaClass::=INTEGER{ - unknown (0), - ciac-1 (1), - ciac-2 (2), - ciac-3 (3) - } (0..255) - -CIclass::=INTEGER{ - unknown (0), - cic-l1 (1), - cic-l2 (2), - cic-l3 (3), - cic-l4 (4), - cic-l5 (5), - cic-il1 (254), - cic-il2 (255) - } (0..255) - -Link-ID::=SEQUENCE{ -- Link-ID - remoteCIID EUI64, -- CI in peer ITS-S(s) - localCIID EUI64 -- Unique ID of local CI - } - -CIstatus::=INTEGER{ - not-existent (0), - existent (1), - unknown (2), - registered (4), - active (8), - connected (16), - suspended (64), - inactive (128) - } (0..255) - -CommProfile::=SEQUENCE (SIZE(0..255)) OF I-Param - -Connect::=INTEGER{ - automatic (0), - manual (255) - } (0..255) - -IN-SAPaddress::=INTEGER(0..255) - -DataRate::= INTEGER(0..4294967295) -- in 100 bit/s - -DataRatesNW::=SEQUENCE{ -- available to the appl. - minimum DataRate, -- minimum possible value - maximum DataRate -- maximum possible value - } - -Directivity::=SEQUENCE{ - mode DirMode, - dirPredef INTEGER(0..255), -- 0: see dirVar - -- >0: predefined direction - fill BIT STRING (SIZE(7)), - dirVar SEQUENCE (SIZE(0..1)) OF DirVar - } - -DirMode::=INTEGER{ - fixed (0), - tracking (255) - } (0..255) - - -DirVar::=SEQUENCE{ - bsAzimuth INTEGER(-32768..32767) , -- -180 - +180 - bsElevation INTEGER(-128..127) , -- -90 - +90 - openHorizontal INTEGER(0..255) , -- 0 - 180 - openVertical INTEGER(0..255) -- 0 - 180 - } - -TxPowMax::=INTEGER(0..255) -- unit, minimum value and step size defined by access technology (medium) - -Errors::=SEQUENCE (SIZE(0..255)) OF SingleError - -SingleError::=SEQUENCE{ - paramNo INTEGER(0..255), -- ref number of parameter - errStatus ErrStatus -- IS24102-3 - } - -Gs::=INTEGER(0..65535) -- Resolution 0,01 m/s. - -KineVectIn::=SEQUENCE{ - dut Time48IAT, -- date and universal time - lat Lat, -- latitude - lon Lon, -- longitude - alt Alt, -- altitude / elevation - gs Gs, -- ground speed - tta Tta -- true track angle - } - -KineVectOut::=SEQUENCE{ - dut Time48IAT, -- date and universal time - fill BIT STRING (SIZE(5)), -- used for octet alignment in PER - options SEQUENCE (SIZE(0..5)) OF KineVectOptions -- options - } - -KineVectOptions::=CHOICE{ - lat Lat, -- latitude - lon Lon, -- longitude - alt Alt, -- altitude - gs Gs, -- ground speed - tta Tta -- true track angle - } - -Lat::=INTEGER(-2147483648..2147483647) -- equals ± pi/2 - -Lon::=INTEGER(-2147483648..2147483647) -- equals ± pi - -LLserviceAddr::=SEQUENCE{ - csap IN-SAPaddress, - linkID Link-ID - } - - -MACaddress::=OCTET STRING (SIZE(6)) - -MediumUsage::=SEQUENCE{ - receive INTEGER(0..255), - transmit INTEGER(0..255) - } - -MedType::=INTEGER{ - unknown (0), - any (1), - iso21212 (2), -- 2G - iso21213 (3), -- 3G - iso21214 (4), -- IR - iso21215 (5), -- M5 - iso21216 (6), -- MM - iso25112 (7), -- 802.16e - iso25113 (8), -- HC-SDMA - iso29283 (9), -- 802.20 - iso17515 (10), -- LTE - iso15628 (128), -- DSRC - can (254), - ethernet (255) - } (0..255) - -MedUseObsTime::=SEQUENCE { - value INTEGER(0..1023), -- valid parameter number (10 bits in PER) - unit TimeUnit - } -- 2 octets in PER - -TimeUnit::=INTEGER{ - microseconds (0), - milliseconds (1), - seconds (2), - minutes (3), - hours (4), - days (5), - weeks (6), - months (7), - years (8) - }(0..63) -- 6 bits in PER - -Notify::=SEQUENCE (SIZE(0..255)) OF INTEGER(0..255) -- valid parameter number - - -PeerRXpower::=INTEGER(0..255) - -PARAMS ::= CLASS { - ¶mRef INTEGER(0..255), - &Parameter - } - -IPARAM ::= PARAMS - -I-Params IPARAM::={errors | commProfile | properties | manuDeviceID | iTS-scuId | medID | localCIID | timeoutReg | macAddress | macAddrTemp | ciClass | ciaClass | ciStatus | notify | medType | regInfo | connect | simPin | providerInfo | minUserPriority | queueLevel | queueLowTh | queueAlarmTh | distancePeer | commRangeRef | timeOfLastRecep | inactTimeLimit | mediumUsage | medUseObsTime | peerMAC | virtualCIs | minPrioCrossCI | rxSens | txPower | txPowMax | peerRXpower | dataRate | dataRateNW | dataRatesNW | dataRateNWreq | directivity | blockLength | freeAirTime | frameLengthMax | kineVectIn | kineVectOut | cost | reliability | logicalChannel, ...} - -I-Param::=SEQUENCE{ - paramNo IPARAM.¶mRef({I-Params}), - parameter IPARAM.&Parameter({I-Params}{@paramNo}) - } - -errors IPARAM::={¶mRef 0, &Parameter Errors} -commProfile IPARAM::={¶mRef 2, &Parameter CommProfile} -properties IPARAM::={¶mRef 3, &Parameter Properties} -manuDeviceID IPARAM::={¶mRef 4, &Parameter UTF8String} -iTS-scuId IPARAM::={¶mRef 5, &Parameter ITS-scuId} -medID IPARAM::={¶mRef 6, &Parameter MedID} -localCIID IPARAM::={¶mRef 7, &Parameter EUI64} -timeoutReg IPARAM::={¶mRef 8, &Parameter INTEGER(0..255)} -macAddress IPARAM::={¶mRef 9, &Parameter MACaddress} -macAddrTemp IPARAM::={¶mRef 10, &Parameter MACaddress} -ciClass IPARAM::={¶mRef 11, &Parameter CIclass} -ciaClass IPARAM::={¶mRef 12, &Parameter CIaClass} -ciStatus IPARAM::={¶mRef 13, &Parameter CIstatus} -notify IPARAM::={¶mRef 16, &Parameter Notify} -medType IPARAM::={¶mRef 17, &Parameter MedType} -regInfo IPARAM::={¶mRef 18, &Parameter RegInfo} -connect IPARAM::={¶mRef 19, &Parameter Connect} -simPin IPARAM::={¶mRef 20, &Parameter SimPin} -providerInfo IPARAM::={¶mRef 21, &Parameter ProviderInfo} -minUserPriority IPARAM::={¶mRef 22, &Parameter UserPriority} -- DEFAULT 0 -queueLevel IPARAM::={¶mRef 23, &Parameter QueueLevel} -queueLowTh IPARAM::={¶mRef 24, &Parameter QueueValue} -queueAlarmTh IPARAM::={¶mRef 25, &Parameter QueueValue} -distancePeer IPARAM::={¶mRef 26, &Parameter Distance} -commRangeRef IPARAM::={¶mRef 27, &Parameter Distance} -timeOfLastRecep IPARAM::={¶mRef 28, &Parameter Time48IAT} - -- 1 ms resolution -inactTimeLimit IPARAM::={¶mRef 29, &Parameter INTEGER(0..65535)} - -- milliseconds -mediumUsage IPARAM::={¶mRef 30, &Parameter MediumUsage} -medUseObsTime IPARAM::={¶mRef 31, &Parameter MedUseObsTime} -peerMAC IPARAM::={¶mRef 32, &Parameter MACaddress} -virtualCIs IPARAM::={¶mRef 33, &Parameter VirtualCIs} -minPrioCrossCI IPARAM::={¶mRef 34, &Parameter UserPriority} -rxSens IPARAM::={¶mRef 35, &Parameter INTEGER(0..255)} -txPower IPARAM::={¶mRef 36, &Parameter INTEGER(0..255)} -txPowMax IPARAM::={¶mRef 37, &Parameter TxPowMax} -peerRXpower IPARAM::={¶mRef 38, &Parameter PeerRXpower} -dataRate IPARAM::={¶mRef 39, &Parameter DataRate} -dataRateNW IPARAM::={¶mRef 40, &Parameter DataRate} -dataRatesNW IPARAM::={¶mRef 41, &Parameter DataRatesNW} -dataRateNWreq IPARAM::={¶mRef 42, &Parameter DataRate} -directivity IPARAM::={¶mRef 43, &Parameter Directivity} -blockLength IPARAM::={¶mRef 44, &Parameter INTEGER(0..65535)} -freeAirTime IPARAM::={¶mRef 45, &Parameter INTEGER(0..255)} - -- measured in milliseconds -frameLengthMax IPARAM::={¶mRef 46, &Parameter INTEGER(0..255)} - -- measured in milliseconds -kineVectIn IPARAM::={¶mRef 47, &Parameter KineVectIn} -kineVectOut IPARAM::={¶mRef 48, &Parameter KineVectOut} -cost IPARAM::={¶mRef 49, &Parameter MediumCost} -reliability IPARAM::={¶mRef 50, &Parameter INTEGER(0..255)} -logicalChannel IPARAM::={¶mRef 51, &Parameter LogicalChannels} - -Time48IAT ::= INTEGER { utcStartOf2004(0), oneMillisecAfterUTCStartOf2004(1) } (0..281474976710655) -- International Atomic Time with one millisecond steps - -I-ParamNo::=INTEGER{ - errors (0), - commProfile (2), - properties (3), - manuDeviceID (4), - iTS-scuId (5), - medID (6), - localCIID (7), - timeoutReg (8), - macAddress (9), - macAddrTemp (10), - ciClass (11), - ciaClass (12), - ciStatus (13), - notify (16), - medType (17), - regInfo (18), - connect (19), - simPin (20), - providerInfo (21), - minUserPriority (22), - queueLevel (23), - queueLowTh (24), - queueAlarmTh (25), - distancePeer (26), - commRangeRef (27), - timeOfLastRecep (28), - inactTimeLimit (29), - mediumUsage (30), - medUseObsTime (31), - peerMAC (32), - virtualCI (33), - minPrioCrossCI (34), - rxSens (35), - txPower (36), - txPowMax (37), - peerRXpower (38), - dataRate (39), - dataRateNW (40), - dataRatesNW (41), - dataRateNWreq (42), - directivity (43), - blockLength (44), - freeAirTime (45), - frameLengthMax (46), - kineVectIn (47), - kineVectOut (48), - cost (49), - reliability (50), - logicalChannel (51) - } (0..255) - -SimPin::=OCTET STRING - -LogicalChannels::=SEQUENCE (SIZE(0..255)) OF LogicalChannelType - -Distance::=INTEGER(0..65535) -- measured in 1/10 m - -MedID::=INTEGER(0..255) - -Properties::=SEQUENCE (SIZE(0..255)) OF I-Param -- only selected parameters - -ProviderInfo::=SEQUENCE{ - provName OCTET STRING (SIZE(0..255)), -- Name of provider - apn OCTET STRING (SIZE(0..255)), -- Name of access point - username OCTET STRING (SIZE(0..255)), -- Log-in name of user - password OCTET STRING (SIZE(0..255)) -- Password for log-in - } - -QueueLevel::=SEQUENCE{ - priority UserPriority, - level QueueValue - } - -QueueValue::=INTEGER(0..255) - -RegInfo::=SEQUENCE{ - status RegInfoStatus, - limits RegulatoryScheme - } - -RegInfoStatus::=INTEGER{ - notApplicable (0), - invalid (1), - new (254), - valid (255) - } (0..255) - - - -REGULSCHEME::=CLASS { - ®ID INTEGER(0..255), - &RegInfo - } - - -RegulatoryScheme::=SEQUENCE{ - reguIdent REGULSCHEME.®ID({RegulSchemes}), - reguInfo REGULSCHEME.&RegInfo({RegulSchemes}{@reguIdent}) - } - -RegulSchemes REGULSCHEME::={nullRegScheme, ...} -- to be filled - -nullRegScheme REGULSCHEME::={®ID 0, &RegInfo NULL} - - -Tta::=INTEGER(0..65535) -- Resolution 0,1°. - -UserPriority::=INTEGER(0..255) - -VirtualCIs::=SEQUENCE (SIZE(0..65535))OF RemoteCIID - -INSAP ::= COMMUPDOWN - -INsapspsdown INSAP::={inUnitdataRq | inDataAckRq | inReplyAckRq | inReplyUpdateRq, ...} - -INsapPrimitivesDown::=SEQUENCE{ - spRef INSAP.&primitiveRef({INsapspsdown}), - servPrimitive INSAP.&Primitive({INsapspsdown}{@spRef}) - } - -inUnitdataRq INSAP::={&primitiveRef 0, &Primitive IN-UNITDATA-request} -inDataAckRq INSAP::={&primitiveRef 1, &Primitive IN-DATA-ACK-request} -inReplyAckRq INSAP::={&primitiveRef 2, &Primitive IN-REPLY-ACK-request} -inReplyUpdateRq INSAP::={&primitiveRef 3, &Primitive IN-REPLY-UPDATE-request} - -IN-UNITDATA-request::=SEQUENCE{ - source-addr LLserviceAddr, - dest-addr LLserviceAddr, - data INdata, - priority UserPriority, - accessParams AccessParameters - } - -IN-DATA-ACK-request::=SEQUENCE{ - source-addr LLserviceAddr, - dest-addr LLserviceAddr, - data INdata, - priority UserPriority, - serviceClass MACServiceClass - } - -IN-REPLY-ACK-request::=SEQUENCE{ - source-addr LLserviceAddr, - dest-addr LLserviceAddr, - data INdata, - priority UserPriority, - serviceClass MACServiceClass - } - -IN-REPLY-UPDATE-request::=SEQUENCE{ - source-addr LLserviceAddr, - data INdata - } - -INSAPUP::= COMMUPDOWN - -INsapspsup INSAP::={inUnitdataInd | inUnitdataStatusInd | inDataAckInd | inDataAckStatusInd | inReplyInd | inReplyStatusInd | inReplyUpdateStatusInd, ...} - -INsapPrimitivesUp::=SEQUENCE{ - spRef INSAP.&primitiveRef ({INsapspsup}), - servPrimitive INSAP.&Primitive ({INsapspsup}{@spRef}) - } - -inUnitdataInd INSAP::={&primitiveRef 0, &Primitive IN-UNITDATA-indication} -inUnitdataStatusInd INSAP::={&primitiveRef 1, &Primitive IN-UNITDATA-STATUS-indication} -inDataAckInd INSAP::={&primitiveRef 2, &Primitive IN-DATA-ACK-indication} -inDataAckStatusInd INSAP::={&primitiveRef 3, &Primitive IN-DATA-ACK-STATUS-indication} -inReplyInd INSAP::={&primitiveRef 4, &Primitive IN-REPLY-indication} -inReplyStatusInd INSAP::={&primitiveRef 5, &Primitive IN-REPLY-STATUS-indication} -inReplyUpdateStatusInd INSAP::={&primitiveRef 6, &Primitive IN-REPLY-UPDATE-STATUS-indication} - -IN-UNITDATA-indication::=SEQUENCE{ - source-addr LLserviceAddr, - dest-addr LLserviceAddr, - data INdata, - priority UserPriority, - accessParams AccessParameters - } - -IN-UNITDATA-STATUS-indication::=SEQUENCE{ - source-addr LLserviceAddr, - dest-addr LLserviceAddr, - data INdata, - priority UserPriority, - accessParams AccessParameters, - txStatus INtxStatus - } - -IN-DATA-ACK-indication::=SEQUENCE{ - source-addr LLserviceAddr, - dest-addr LLserviceAddr, - data INdata, - priority UserPriority, - serviceClass MACServiceClass - } - -IN-DATA-ACK-STATUS-indication::=SEQUENCE{ - source-addr LLserviceAddr, - dest-addr LLserviceAddr, - data INdata, - priority UserPriority, - serviceClass MACServiceClass, - status INtxStatus - } - -IN-REPLY-indication::=SEQUENCE{ - source-addr LLserviceAddr, - dest-addr LLserviceAddr, - data INdata, - priority UserPriority, - serviceClass MACServiceClass - } - -IN-REPLY-STATUS-indication::=SEQUENCE{ - source-addr LLserviceAddr, - status INtxStatus - } - -IN-REPLY-UPDATE-STATUS-indication::=SEQUENCE{ - source-addr LLserviceAddr, - data INdata, - priority UserPriority, - accessParams AccessParameters, - txStatus INtxStatus - } - -INdata::=OCTET STRING (SIZE(0..65535)) - -ACCPARAM ::= PARAMS - -nullAP ACCPARAM::={¶mRef 0, &Parameter NullType} - -AccessParameters::=SEQUENCE{ - apRef ACCPARAM.¶mRef ({AccParams}), - aParameter ACCPARAM.&Parameter ({AccParams}{@apRef}) - } - -AccParams ACCPARAM::={nullAP, ...} - -NullType::=NULL - -MACServiceClass::=INTEGER{ - macAckNotUsed (0), - macAckUsed (255) - } (0..255) - -INtxStatus::=INTEGER{ - success (0), - queueFull (1), - timeout (2), - priority (3), - unspecFailure (255) - } (0..255) - -VCIserialNumber::=INTEGER(0..65535) - -EUI64::=OCTET STRING (SIZE(8)) - -LegacyCIID::=SEQUENCE{ - selector1 OneOCTETones, - iTS-scuId ITS-scuId, - selector2 TwoOCTETones, - medID MedID, - vciSerialNumber VCIserialNumber - } - -RemoteCIID::=EUI64 - -OneOCTETones::=INTEGER{ - all (255) - } (0..255) - -TwoOCTETones::=INTEGER{ - all (65535) - } (0..65535) - -EUI64MAC48::=SEQUENCE{ - oui MACoui, - selector2 TwoOCTETones, - ext MACext - } - -MACoui::=SEQUENCE{ - uoi1 INTEGER(0..63), - ulBit BOOLEAN, - igBIT BOOLEAN, - uoi2 OCTET STRING (SIZE(2)) - } - -MACext::=OCTET STRING (SIZE(3)) - -MACmcID::=SEQUENCE{ - ucgc INTEGER(0..63), - mc INTEGER{all (3)} (0..3), - serial OCTET STRING (SIZE(2)) - } - - --- Values - -version INTEGER(0..255)::= 2 -- insert version value - - - -END - diff --git a/asn1/CALMmanagement/CALMmanagement.asn b/asn1/CALMmanagement/CALMmanagement.asn deleted file mode 100644 index 8432b1dc..00000000 --- a/asn1/CALMmanagement/CALMmanagement.asn +++ /dev/null @@ -1,152 +0,0 @@ ----- - - -CALMmanagement { iso (1) standard (0) calm-management (24102) local (1) asnm-1 (1)} - -DEFINITIONS AUTOMATIC TAGS::=BEGIN - -IMPORTS - -CIstatus, Connect, DataRate, DataRatesNW, Directivity, KineVectOut, Link-ID, MACaddress, MedType, PARAMS, UserPriority FROM CALMllsap {iso(1) standard(0) calm-ll-sap(21218) asnm-1(1)} - -ITS-SCUtype FROM CALMiitsscu {iso (1) standard (0) calm-management (24102) iitsscu (4) asnm-1 (1)} - -ITSSappCPReqReg, ServiceRef, MediumCost FROM CITSapplReq {iso(1) standard(0) cits-applReq (17423) asnm-1 (1)} - -LogicalChannelType FROM CITSapplMgmtComm {iso(1) standard(0) cits-applMgmt (17419) comm (3)} - -; - --- End of IMPORTS - --- Types - -ApplReqList::=ITSSappCPReqReg -- from TS 17423 - -ApplicationID::=SEQUENCE{ - hostITS-scuId ITS-scuId, - seqNumber ServiceRef -- unique in the ITS-SCU (host) - } - - -CrCiPrioList::=SEQUENCE (SIZE(0..255)) OF CrCiPrioReq - -CrCiPrioReq::=SEQUENCE{ - linkId Link-ID, -- requesting CI - timeout INTEGER(0..255), - request CCPrequest, - interferer SEQUENCE OF CCPpotInt -- potential interferers - } - -CCPrequest::=SEQUENCE (SIZE(0..255)) OF SEQUENCE - { - reqNo INTEGER(0..255), - priority UserPriority, - status CCPstatus - } - -CCPpotInt::=SEQUENCE{ - linkID Link-ID, -- interferer - status CCPstatus - } - -CCPstatus::=INTEGER{ - released (0), - requestd (16), - ignored (64), - granted (128) - } - -ITS-scuId::=INTEGER(0..65535) - -ITS-scuList::=SEQUENCE{ - iTS-scuId ITS-scuId, - its-scuType ITS-SCUtype, - time GeneralizedTime, - uniqueID PrintableString - } - -ITS-SSI::=SEQUENCE{ - stationType StationType, - stationID StationID, - stationPosition KineVectOut - } - -MPARAM ::= PARAMS - -Param24102::=SEQUENCE{ - paramNo MPARAM.¶mRef({M-Params}), - param MPARAM.&Parameter({M-Params}{@paramNo}) - } - -M-Params MPARAM::={stationID | minPrioCrossCI | stationPosition | iTS-scuId | vciList | crCiPrioList | timerITS-SSI | its-ssi | applReqList | vCIperformList | talive | iTS-scuList, ...} - -stationID MPARAM::={¶mRef 0, &Parameter StationID} -minPrioCrossCI MPARAM::={¶mRef 1, &Parameter UserPriority} -stationPosition MPARAM::={¶mRef 2, &Parameter KineVectOut} -iTS-scuId MPARAM::={¶mRef 3, &Parameter ITS-scuId} -vciList MPARAM::={¶mRef 4, &Parameter VciList} -crCiPrioList MPARAM::={¶mRef 5, &Parameter CrCiPrioList} -timerITS-SSI MPARAM::={¶mRef 6, &Parameter INTEGER(0..65535)} -its-ssi MPARAM::={¶mRef 7, &Parameter ITS-SSI} -applReqList MPARAM::={¶mRef 8, &Parameter ApplReqList} -vCIperformList MPARAM::={¶mRef 9, &Parameter VCIperformList} -talive MPARAM::={¶mRef 10, &Parameter Talive} -iTS-scuList MPARAM::={¶mRef 11, &Parameter ITS-scuList} - - -Param24102No::=INTEGER{ - stationID (0), - minPrioCrossCI (1), - stationPosition (2), - iTS-scuId (3), - vciList (4), - crCiPrioList (5), - timerITS-SSI (6), - its-ssi (7), - applReqList (8), - vCIperformList (9), - talive (10), - iTS-scuList (11) - } (0..255) - -Talive::=INTEGER(0..65535) -- time in ms - -VciList::=SEQUENCE (SIZE(0..255)) OF VciListEntry - -VciListEntry::=SEQUENCE{ - linkId Link-ID, - medType MedType, - status CIstatus, - connect Connect, - macAddress MACaddress - } - -VCIperformList::=SEQUENCE (SIZE(0..255)) OF VCIperformance - -VCIperformance::=SEQUENCE{ - linkId Link-ID, - channelType LogicalChannelType, - channelNo INTEGER(0..255), - minUserPrio UserPriority, - dataRateNW DataRate, - dataRatesNW DataRatesNW, - directivity Directivity, - commRangeRef INTEGER(0..65535), -- in 1/10 m - cost MediumCost, - reliability INTEGER(0..255) - } - -StationID::=OCTET STRING (SIZE(4)) - -StationType::= INTEGER{ - mobile (0), -- vehicle - fixed (1), -- roadside - portable (2), - infrastructure (254), -- central - unknown (255) - } (0..255) - - - -END diff --git a/asn1/CALMmsap/CALMmsap.asn b/asn1/CALMmsap/CALMmsap.asn deleted file mode 100644 index 0303062b..00000000 --- a/asn1/CALMmsap/CALMmsap.asn +++ /dev/null @@ -1,1137 +0,0 @@ ----- - -CALMmsap { iso (1) standard (0) calm-management (24102) msap (3) asnm-1 (1)} - -DEFINITIONS AUTOMATIC TAGS::=BEGIN - -IMPORTS - -CIclass, CIstatus, Errors, INsapPrimitivesDown, INsapPrimitivesUp, I-Param, I-ParamNo, KineVectOut, Link-ID, MACaddress, MedID, MedType, UserPriority, NullType FROM CALMllsap {iso(1) standard(0) calm-ll-sap(21218) asnm-1(1)} - -ITS-scuId, ITS-SSI FROM CALMmanagement { iso (1) standard (0) calm-management (24102) local(1) asnm-1 (1)} - -IICrequestTX, IICresponseTX, IICrequestRX, IICresponseRX FROM CALMiitsscu { iso (1) standard (0) calm-management (24102) iitsscu (4) asnm-1 (1)} - -GCctx, GCdeleteCmd, GCregServer, GCregServerConf, GCsam, GCsamctx, GCsamctxConf, GCctxTxCmd, GCperiodCmd, CTXrxNot, SAMrxNot, GCupdateServer, GCupdateServerConf, GCderegServer, GCderegServerConf, GCregClient, GCregClientConf, GCupdateClient, GCupdateClientConf, GCderegClient, GCderegClientConf FROM CALMfsap { iso (1) standard (0) calm-management (24102) fsap (5) asnm-1 (1)} - -SetIPv6, SetConfIPv6, UpdateIPv6, DeleteIPv6, SetNotIPv6, UpdateNotIPv6, DeleteNotIPv6 FROM CALMipv6{iso(1) standard(0) calm-ipv6(21210) asnm-1(1)} - -HostServiceInfo, NFsapPrimitivesDown, NFsapPrimitivesUp, SetFNTP, SetConfFNTP, UpdateFNTP, DeleteFNTP, SetNotFNTP, UpdateNotFNTP, DeleteNotFNTP FROM CALMfntp { iso (1) standard (0) calm-nonip(29281) fntp(1) asnm-1 (1)} - - -ITS-S-Appl-Reg, ITS-S-Appl-RegConf, ITS-S-Appl-RegFinal FROM CITSapplReq {iso(1) standard(0) cits-applReq (17423) asnm-1 (1)} - -; - --- End of IMPORTS - --- GENERIC OBJECT CLASSES - --- Communication-SAP generic OBJECT CLASS -COMMUPDOWN::=CLASS { - &primitiveRef INTEGER(0..255), - &Primitive - } - --- FA-SAP services up and down -FASAPDOWN::=COMMUPDOWN - -FAsapPrimitivesDown::=SEQUENCE{ - spRef FASAPDOWN.&primitiveRef({FAsapspsdown}), - servPrimitive FASAPDOWN.&Primitive({FAsapspsdown}{@spRef}) - } - -FAsapspsdown FASAPDOWN::={gCsamctxConfFA | gCregServerFA | gCupdateServerFA | gCderegServerFA | gCregClientFA | gCupdateClientFA | gCderegClientFA, ...} - -gCsamctxConfFA FASAPDOWN::={&primitiveRef 2, &Primitive GCsamctxConf} -gCregServerFA FASAPDOWN::={&primitiveRef 3, &Primitive GCregServer} -gCupdateServerFA FASAPDOWN::={&primitiveRef 4, &Primitive GCupdateServer} -gCderegServerFA FASAPDOWN::={&primitiveRef 5, &Primitive GCderegServer} -gCregClientFA FASAPDOWN::={&primitiveRef 6, &Primitive GCregClient} -gCupdateClientFA FASAPDOWN::={&primitiveRef 7, &Primitive GCupdateClient} -gCderegClientFA FASAPDOWN::={&primitiveRef 8, &Primitive GCderegClient} - - -FASAPUP::=COMMUPDOWN - -FAsapPrimitivesUp::=SEQUENCE{ - spRef FASAPUP.&primitiveRef({FAsapspsup}), - servPrimitive FASAPUP.&Primitive({FAsapspsup}{@spRef}) - } - -FAsapspsup FASAPUP::={gCsamctxFA | gCregServerConfFA | gCupdateServerConfFA | gCderegServerConfFA | gCregClientConfFA | gCupdateClientConfFA | gCderegClientConfFA| gCsamFA | gCctxFA, ...} - -gCsamctxFA FASAPUP::={&primitiveRef 2, &Primitive GCsamctx} -gCregServerConfFA FASAPUP::={&primitiveRef 3, &Primitive GCregServerConf} -gCupdateServerConfFA FASAPUP::={&primitiveRef 4, &Primitive GCupdateServerConf} -gCderegServerConfFA FASAPUP::={&primitiveRef 5, &Primitive GCderegServerConf} -gCregClientConfFA FASAPUP::={&primitiveRef 6, &Primitive GCregClientConf} -gCupdateClientConfFA FASAPUP::={&primitiveRef 7, &Primitive GCupdateClientConf} -gCderegClientConfFA FASAPUP::={&primitiveRef 8, &Primitive GCderegClientConf} -gCsamFA FASAPUP::={&primitiveRef 9, &Primitive GCsam} -gCctxFA FASAPUP::={&primitiveRef 10, &Primitive GCctx} - - - --- MX-SAP generic OBJECT CLASS -MXSERV::=CLASS { - &mxref INTEGER(0..255), - &MXParam - } - - --- MF-SAP Service primitives -- --- MF-SAP Command.request -- - -MFSAP-CR::=MXSERV - -MF-Command MFSAP-CR::={simFUTcmd | simFLTcmd | gCsamctx | gCsam | gCctx | lDMnotifyCmd | legacyCICmd | stateCInotify | gCperiodCmd | gCctxTxCmd | gCdeleteCmd | iICrequestTX | iICresponseTX | testMF, ...} -- insert simFUTcmd once being defined and activate below - -MF-Command-request::=SEQUENCE{ - commandRef CommandRef, - ref MFSAP-CR.&mxref({MF-Command}), - command-param MFSAP-CR.&MXParam({MF-Command}{@ref}) - } - -simFUTcmd MFSAP-CR::={&mxref 0, &MXParam SimFUTcmd} -simFLTcmd MFSAP-CR::={&mxref 1, &MXParam SimFLTcmd} -gCsamctx MFSAP-CR::={&mxref 2, &MXParam GCsamctx} -gCsam MFSAP-CR::={&mxref 3, &MXParam GCsam} -gCctx MFSAP-CR::={&mxref 4, &MXParam GCctx} -lDMnotifyCmd MFSAP-CR::={&mxref 5, &MXParam LDMnotify} -legacyCICmd MFSAP-CR::={&mxref 6, &MXParam LegacyCIreq} -stateCInotify MFSAP-CR::={&mxref 7, &MXParam StateCInotify} -gCperiodCmd MFSAP-CR::={&mxref 8, &MXParam GCperiodCmd} -gCctxTxCmd MFSAP-CR::={&mxref 9, &MXParam GCctxTxCmd} -gCdeleteCmd MFSAP-CR::={&mxref 10, &MXParam GCdeleteCmd} -iICrequestTX MFSAP-CR::={&mxref 11, &MXParam IICrequestTX} -iICresponseTX MFSAP-CR::={&mxref 12, &MXParam IICresponseTX} -testMF MFSAP-CR::={&mxref 255, &MXParam OCTET STRING (SIZE(0..255))} - -SimFUTcmd::=FAsapPrimitivesDown - -SimFLTcmd::=NFsapPrimitivesUp - -LDMnotify::=SEQUENCE (SIZE(0..255)) OF RadarView - -RadarView::=SEQUENCE{ - peerITS-SSI ITS-SSI - } - -LegacyCIreq::=SEQUENCE{ - cIclass CIclass, - legacyOption INTEGER(0..255), - linkId Link-ID - } - -StateCInotify::=SEQUENCE{ - linkId Link-ID, - cIstatus CIstatus -} - --- MF-SAP Command.confirm -- - -MFSAP-CC ::= MXSERV - -MF-CmdConfirm MFSAP-CC::={simFUTcmdConf | simFLTcmdConf | gCsamctxConf | gCsamConf | gCctxConf | lDMnotifyConf | legacyCIConf | stateCInotifyConf | gCperiodCmdConf | gCctxTxCmdConf | gCdeleteCmdConf | iICrequestTXConf | iICresponseTXConf | testMFConf, ...} - -MF-Command-confirm::=SEQUENCE{ - commandRef CommandRef, - ref MFSAP-CC.&mxref({MF-CmdConfirm}), - cmdConfirm-param MFSAP-CC.&MXParam({MF-CmdConfirm}{@ref}), - errStatus ErrStatus - } - -simFUTcmdConf MFSAP-CC::={&mxref 0, &MXParam NullType} -simFLTcmdConf MFSAP-CC::={&mxref 1, &MXParam NullType} -gCsamctxConf MFSAP-CC::={&mxref 2, &MXParam GCsamctxConf} -gCsamConf MFSAP-CC::={&mxref 3, &MXParam NullType} -gCctxConf MFSAP-CC::={&mxref 4, &MXParam NullType} -lDMnotifyConf MFSAP-CC::={&mxref 5, &MXParam NullType} -legacyCIConf MFSAP-CC::={&mxref 6, &MXParam HostServiceInfo} -stateCInotifyConf MFSAP-CC::={&mxref 7, &MXParam NullType} -gCperiodCmdConf MFSAP-CC::={&mxref 8, &MXParam NullType} -gCctxTxCmdConf MFSAP-CC::={&mxref 9, &MXParam NullType} -gCdeleteCmdConf MFSAP-CC::={&mxref 10, &MXParam NullType} -iICrequestTXConf MFSAP-CC::={&mxref 11, &MXParam NullType} -iICresponseTXConf MFSAP-CC::={&mxref 12, &MXParam NullType} -testMFConf MFSAP-CC::={&mxref 255, &MXParam NullType} - --- MF-SAP Request.request -- - -MFSAP-RR::=MXSERV - -MF-Request MFSAP-RR::={simFUTreq | simFLTreq | iTS-S-Appl-Reg | gCregServer | gCupdateServer | gCderegServer | gCregClient | gCupdateClient | gCderegClient | lDMregister | sAMrxNot | cTXrxNot | iICrequestRX | iICresponseRX | iTS-S-Appl-ReqFinal | testMFecho, ...} - -MF-Request-request::=SEQUENCE{ - commandRef CommandRef, - ref MFSAP-RR.&mxref({MF-Request}), - request-param MFSAP-RR.&MXParam({MF-Request}{@ref}) - } - -simFUTreq MFSAP-RR::={&mxref 0, &MXParam SimFUTreq} -simFLTreq MFSAP-RR::={&mxref 1, &MXParam SimFLTreq} -iTS-S-Appl-Reg MFSAP-RR::={&mxref 2, &MXParam ITS-S-Appl-Reg} -gCregServer MFSAP-RR::={&mxref 3, &MXParam GCregServer} -gCupdateServer MFSAP-RR::={&mxref 4, &MXParam GCupdateServer} -gCderegServer MFSAP-RR::={&mxref 5, &MXParam GCderegServer} -gCregClient MFSAP-RR::={&mxref 6, &MXParam GCregClient} -gCupdateClient MFSAP-RR::={&mxref 7, &MXParam GCupdateClient} -gCderegClient MFSAP-RR::={&mxref 8, &MXParam GCderegClient} -lDMregister MFSAP-RR::={&mxref 9, &MXParam LDMregister} -sAMrxNot MFSAP-RR::={&mxref 10, &MXParam SAMrxNot} -cTXrxNot MFSAP-RR::={&mxref 11, &MXParam CTXrxNot} -iICrequestRX MFSAP-RR::={&mxref 12, &MXParam IICrequestRX} -iICresponseRX MFSAP-RR::={&mxref 13, &MXParam IICresponseRX} -iTS-S-Appl-ReqFinal MFSAP-RR::={&mxref 14, &MXParam ITS-S-Appl-RegFinal} -testMFecho MFSAP-RR::={&mxref 255, &MXParam TestMFecho} - -SimFUTreq::=FAsapPrimitivesUp - -SimFLTreq::=NFsapPrimitivesDown - -LDMregister::=SEQUENCE{ - iTS-scuId ITS-scuId, - reference OCTET STRING (SIZE(0..65535)) - } - -TestMFecho::=SEQUENCE{ - sap INTEGER{f (70)} (0..255), -- indicating MF-SAP - info OCTET STRING (SIZE(0..255)) - } - --- MF-SAP Request.confirm -- - -MFSAP-RC::=MXSERV - -MF-ReqConfirm MFSAP-RC::={simFUTreqConf | simFLTreqConf | iTS-S-Appl-RegConf | gCregServerConf | gCupdateServerConf | gCderegServerConf | gCregClientConf | gCupdateClientConf | gCderegClientConf | lDMregisterConf | sAMrxNotConf | cTXrxNotConf | iICrequestRXConf | iICresponseRXConf | iTS-S-Appl-ReqFinalConf | testMFechoConf, ...} - -MF-Request-confirm::=SEQUENCE{ - commandRef CommandRef, - ref MFSAP-RC.&mxref({MF-ReqConfirm}), - reqConfirm-param MFSAP-RC.&MXParam({MF-ReqConfirm}{@ref}), - errStatus ErrStatus - } - -simFUTreqConf MFSAP-RC::={&mxref 0, &MXParam NULL} -simFLTreqConf MFSAP-RC::={&mxref 1, &MXParam NULL} -iTS-S-Appl-RegConf MFSAP-RC::={&mxref 2, &MXParam NULL} -gCregServerConf MFSAP-RC::={&mxref 3, &MXParam GCregServerConf} -gCupdateServerConf MFSAP-RC::={&mxref 4, &MXParam GCupdateServerConf} -gCderegServerConf MFSAP-RC::={&mxref 5, &MXParam GCderegServerConf} -gCregClientConf MFSAP-RC::={&mxref 6, &MXParam GCregClientConf} -gCupdateClientConf MFSAP-RC::={&mxref 7, &MXParam GCupdateClientConf} -gCderegClientConf MFSAP-RC::={&mxref 8, &MXParam GCderegClientConf} -lDMregisterConf MFSAP-RC::={&mxref 9, &MXParam ITS-scuId} -sAMrxNotConf MFSAP-RC::={&mxref 10, &MXParam NULL} -cTXrxNotConf MFSAP-RC::={&mxref 11, &MXParam NULL} -iICrequestRXConf MFSAP-RC::={&mxref 12, &MXParam NULL} -iICresponseRXConf MFSAP-RC::={&mxref 13, &MXParam NULL} -iTS-S-Appl-ReqFinalConf MFSAP-RC::={&mxref 14, &MXParam NULL} -testMFechoConf MFSAP-RC::={&mxref 255, &MXParam NULL} - --- MN-SAP Service primitives -- --- MN-SAP Command.request -- - -MNSAP-CR::=MXSERV - -MN-Command MNSAP-CR::={simNUTcmd | simNLTcmd | fWTset | fWTupdate | fWTdelete | testMN, ...} - -MN-Command-request::=SEQUENCE{ - commandRef CommandRef, - ref MNSAP-CR.&mxref({MN-Command}), - command-param MNSAP-CR.&MXParam({MN-Command}{@ref}) - } - -simNUTcmd MNSAP-CR::={&mxref 0, &MXParam SimNUTcmd} -simNLTcmd MNSAP-CR::={&mxref 1, &MXParam SimNLTcmd} -fWTset MNSAP-CR::={&mxref 2, &MXParam FWTset} -fWTupdate MNSAP-CR::={&mxref 3, &MXParam FWTupdate} -fWTdelete MNSAP-CR::={&mxref 4, &MXParam FWTdelete} -testMN MNSAP-CR::={&mxref 255, &MXParam OCTET STRING (SIZE(0..255))} - -SimNUTcmd::=NFsapPrimitivesDown - -SimNLTcmd::=INsapPrimitivesUp - -FWT::=CLASS { - &fwtRef INTEGER(0..255), - &Fwt - } - -FWTset::=SEQUENCE{ - fwtNo FWT.&fwtRef({NTprotsSet}), - fwt FWT.&Fwt({NTprotsSet}{@fwtNo}) - } - -NTprotsSet FWT::={fntpset, ...} - -FWTupdate::=SEQUENCE{ - fwtNo FWT.&fwtRef({NTprotsUpdate}), - fwt FWT.&Fwt({NTprotsUpdate}{@fwtNo}) - } - -NTprotsUpdate FWT::={fntpupdate, ...} - -FWTdelete::=SEQUENCE{ - fwtNo FWT.&fwtRef({NTprotsDelete}), - fwt FWT.&Fwt({NTprotsDelete}{@fwtNo}) - } - -NTprotsDelete FWT::={fntpdelete, ...} - -fntpset FWT::={&fwtRef 0, &Fwt SetFNTP} -fntpupdate FWT::={&fwtRef 1, &Fwt UpdateFNTP} -fntpdelete FWT::={&fwtRef 2, &Fwt DeleteFNTP} - --- MN-SAP Command.confirm -- - -MNSAP-CC::=MXSERV - -MN-CmdConfirm MNSAP-CC::={simNUTcmdConf | simNLTcmdConf | fWTsetConf | fWTupdateConf | fWTdeletConf | testMNConf, ...} - -MN-Command-confirm::=SEQUENCE{ - commandRef CommandRef, - ref MNSAP-CC.&mxref({MN-CmdConfirm}), - cmdConfirm-param MNSAP-CC.&MXParam({MN-CmdConfirm}{@ref}), - errStatus ErrStatus - } - -simNUTcmdConf MNSAP-CC::={&mxref 0, &MXParam NULL} -simNLTcmdConf MNSAP-CC::={&mxref 1, &MXParam NULL} -fWTsetConf MNSAP-CC::={&mxref 2, &MXParam FWTsetConf} -fWTupdateConf MNSAP-CC::={&mxref 3, &MXParam FWTupdateConf} -fWTdeletConf MNSAP-CC::={&mxref 4, &MXParam FWTdeleteConf} -testMNConf MNSAP-CC::={&mxref 255, &MXParam NULL} - -FWTCONF::=CLASS { - &fwtRef INTEGER(0..255), - &Fwt - } - -FWTsetConf::=SEQUENCE{ - fwtNo FWTCONF.&fwtRef({NTprotsSetConf}), - fwt FWTCONF.&Fwt({NTprotsSetConf}{@fwtNo}) - } - -NTprotsSetConf FWTCONF::={fntpsetConf, ...} - -FWTupdateConf::=SEQUENCE{ - fwtNo FWTCONF.&fwtRef({NTprotsUpdateConf}), - fwt FWTCONF.&Fwt({NTprotsUpdateConf}{@fwtNo}) - } - -NTprotsUpdateConf FWTCONF::={fntpupdateConf, ...} - -FWTdeleteConf::=SEQUENCE{ - fwtNo FWTCONF.&fwtRef({NTprotsDeleteConf}), - fwt FWTCONF.&Fwt({NTprotsDeleteConf}{@fwtNo}) - } - -NTprotsDeleteConf FWTCONF::={fntpdeleteConf, ...} - -fntpsetConf FWTCONF::={&fwtRef 0, &Fwt SetConfFNTP} -fntpupdateConf FWTCONF::={&fwtRef 1, &Fwt NULL} -fntpdeleteConf FWTCONF::={&fwtRef 2, &Fwt NULL} - --- MN-SAP Request.request -- - -MNSAP-RR::=MXSERV - -MN-Request MNSAP-RR::={simNUTreq | simNLTreq | fWTsetNot | fWTupdateNot | fWTdeletNot | vCIcreatePeerMAC | its-ssiPeerNot | testMNecho, ...} - -MN-Request-request::=SEQUENCE{ - commandRef CommandRef, - ref MNSAP-RR.&mxref({MN-Request}), - request-param MNSAP-RR.&MXParam({MN-Request}{@ref}) - } - -simNUTreq MNSAP-RR::={&mxref 0, &MXParam SimNUTreq} -simNLTreq MNSAP-RR::={&mxref 1, &MXParam SimNLTreq} -fWTsetNot MNSAP-RR::={&mxref 2, &MXParam FWTsetNot} -fWTupdateNot MNSAP-RR::={&mxref 3, &MXParam FWTupdateNot} -fWTdeletNot MNSAP-RR::={&mxref 4, &MXParam FWTdeleteNot} -vCIcreatePeerMAC MNSAP-RR::={&mxref 5, &MXParam VCIcreatePeerMAC} -its-ssiPeerNot MNSAP-RR::={&mxref 6, &MXParam Its-ssiPeerNot} -testMNecho MNSAP-RR::={&mxref 255, &MXParam TestMNecho} - -SimNUTreq::=NFsapPrimitivesUp - -SimNLTreq::=INsapPrimitivesDown - -FWTNOT::=CLASS { - &fwtRef INTEGER(0..255), - &Fwt - } - -FWTsetNot::=SEQUENCE{ - fwtNo FWTNOT.&fwtRef({NTprotsSetNot}), - fwt FWTNOT.&Fwt({NTprotsSetNot}{@fwtNo}) - } - -NTprotsSetNot FWTNOT::={fntpsetNot, ...} - -FWTupdateNot::=SEQUENCE{ - fwtNo FWTNOT.&fwtRef({NTprotsUpdateNot}), - fwt FWTNOT.&Fwt({NTprotsUpdateNot}{@fwtNo}) - } - -NTprotsUpdateNot FWTNOT::={fntpupdateNot, ...} - -FWTdeleteNot::=SEQUENCE{ - fwtNo FWTNOT.&fwtRef({NTprotsDeleteNot}), - fwt FWTNOT.&Fwt({NTprotsDeleteNot}{@fwtNo}) - } - -NTprotsDeleteNot FWTNOT::={fntpdeleteNot, ...} - -fntpsetNot FWTNOT::={&fwtRef 0, &Fwt SetNotFNTP} -fntpupdateNot FWTNOT::={&fwtRef 1, &Fwt UpdateNotFNTP} -fntpdeleteNot FWTNOT::={&fwtRef 2, &Fwt DeleteNotFNTP} - - -VCIcreatePeerMAC::=SEQUENCE{ - reference INTEGER(0..255), - linkId Link-ID, - peerMac MACaddress - } - -Its-ssiPeerNot::=SEQUENCE{ - sap INTEGER(0..255), - mACaddress MACaddress, - linkId Link-ID, - its-ssiData ITS-SSI - } - -StationType::= INTEGER{ - mobile (0), - fixed (1), - infrastructure (2), - vehicle (3), - roadside (4), - central (5), - portable (6), - unknown (255) - }(0..255) - -StationID::=OCTET STRING (SIZE(4)) - -TestMNecho::=SEQUENCE{ - sap INTEGER{n (78)} (0..255), -- indicating MN-SAP - info OCTET STRING (SIZE(0..255)) - } - --- MN-SAP Request.confirm -- - -MNSAP-RC::=MXSERV - -MN-ReqConfirm MNSAP-RC::={simNUTreqConf | simNLTreqConf | fWTsetNotConf | fWTupdateNotConf | fWTdeletNotConf | vCIcreatePeerMACConf | its-ssiPeerNotConf | testMNechoConf, ...} - -MN-Request-confirm::=SEQUENCE{ - commandRef CommandRef, - ref MNSAP-RC.&mxref({MN-ReqConfirm}), - reqConfirm-param MNSAP-RC.&MXParam({MN-ReqConfirm}{@ref}), - errStatus ErrStatus - } - -simNUTreqConf MNSAP-RC::={&mxref 0, &MXParam NULL} -simNLTreqConf MNSAP-RC::={&mxref 1, &MXParam NULL} -fWTsetNotConf MNSAP-RC::={&mxref 2, &MXParam NULL} -fWTupdateNotConf MNSAP-RC::={&mxref 3, &MXParam NULL} -fWTdeletNotConf MNSAP-RC::={&mxref 4, &MXParam NULL} -vCIcreatePeerMACConf MNSAP-RC::={&mxref 5, &MXParam VCIPeerMAC} -its-ssiPeerNotConf MNSAP-RC::={&mxref 6, &MXParam NULL} -testMNechoConf MNSAP-RC::={&mxref 255, &MXParam NULL} - -VCIPeerMAC::=SEQUENCE{ - reference INTEGER(0..255), - linkId Link-ID - } - - --- MI-SAP Service primitives -- --- MI-SAP Command.request -- - -MISAP-CR::=MXSERV - -MI-Command MISAP-CR::={simIUTcmd | regCmd | cIstate | wakeUp | rTScmd | rTSackCmd | cONcmd | rIcmd | manuCmd | vciCmd | monitor | unitDataCmd | testMI |unknownCmd, ...} - -MI-Command-request::=SEQUENCE{ - linkID Link-ID, - commandRef CommandRef, - ref MISAP-CR.&mxref({MI-Command}), - command-param MISAP-CR.&MXParam({MI-Command}{@ref}) - } - -simIUTcmd MISAP-CR::={&mxref 0, &MXParam SimIUTcmd} -regCmd MISAP-CR::={&mxref 1, &MXParam RegCmd} -cIstate MISAP-CR::={&mxref 2, &MXParam CIstateChng} -wakeUp MISAP-CR::={&mxref 3, &MXParam WakeUp} -rTScmd MISAP-CR::={&mxref 4, &MXParam RTScmd} -rTSackCmd MISAP-CR::={&mxref 5, &MXParam RTSackCmd} -cONcmd MISAP-CR::={&mxref 6, &MXParam CONcmd} -rIcmd MISAP-CR::={&mxref 7, &MXParam RIcmd} -manuCmd MISAP-CR::={&mxref 8, &MXParam OCTET STRING} -vciCmd MISAP-CR::={&mxref 9, &MXParam VciCmd} -monitor MISAP-CR::={&mxref 10, &MXParam Monitor} -unitDataCmd MISAP-CR::={&mxref 11, &MXParam UnitData} -testMI MISAP-CR::={&mxref 255, &MXParam OCTET STRING (SIZE(0..255))} -unknownCmd MISAP-CR::={&mxref 254, &MXParam UnknownCommand} - -UnknownCommand::=INTEGER - -SimIUTcmd::=INsapPrimitivesDown - -RegCmd::=SEQUENCE{ - scuId ITS-scuId, - medID MedID - } - -CIstateChng::=INTEGER{ - deregister (0), - activate (4), - resume (8), - connect (16), - disconnect (32), - suspend (64), - inactivate (128) - }(0..255) - -WakeUp::=INTEGER(0..255) - -RTScmd::=SEQUENCE{ - reqID ReqID, - priority UserPriority, - seqNo INTEGER(0..255), - status INTEGER { - release (0), -- release prioritization - request (16) -- request prioritization - }(0..255) - } - -ReqID::=SEQUENCE{ - linkID Link-ID - } - -RTSackCmd::=SEQUENCE{ - priority UserPriority, - seqNo INTEGER(0..255), - status INTEGER { - ignored (64), -- request ignored - granted (128) -- request granted - }(0..255) - } - -CONcmd::=INTEGER{ - deleteAC (0), - connect (1), - disconnect (255) - }(0..255) - -RIcmd::=SEQUENCE{ - linkID Link-ID, - ri RI - } - -RI::=OCTET STRING (SIZE(0..65535)) - -VciCmd::=SEQUENCE{ - fill BIT STRING (SIZE(7)), - linkID Link-ID, - alive BOOLEAN OPTIONAL - } - -Monitor::=SEQUENCE (SIZE(0..255)) OF SEQUENCE{ - paramNo INTEGER(0..255), -- valid parameter number - active INTEGER{ - stop (0), - start (255) - }(0..255) - } - -UnitData::=SEQUENCE{ - sourceAddr Link-ID, - destAddr Link-ID, - data DataUnitData, - priority UserPriority, - parameter ParameterUnitData -- tbd dependent on medium - } - -DataUnitData::=OCTET STRING (SIZE(0..65535)) - -ParameterUnitData::=OCTET STRING (SIZE(0..65535)) - --- MI-SAP Command.Confirm -- - -MI-Command-confirm::=SEQUENCE{ - linkID Link-ID, - commandRef CommandRef, - errStatus ErrStatus - } - --- MI-SAP Request.request -- - -MISAP-RR::=MXSERV - -MI-Request MISAP-RR::={simIUTreq | regReq | prioReg | rTSreq | rTSackReq | rIreq | manuReq | events | posUpdateReq | unitDataReq | testMIecho, ...} - -MI-Request-request::=SEQUENCE{ - linkID Link-ID, - commandRef CommandRef, - ref MISAP-RR.&mxref({MI-Request}), - request-param MISAP-RR.&MXParam({MI-Request}{@ref}) - } - -simIUTreq MISAP-RR::={&mxref 0, &MXParam SimIUTreq} -regReq MISAP-RR::={&mxref 1, &MXParam RegReq} -prioReg MISAP-RR::={&mxref 2, &MXParam PrioReg} -rTSreq MISAP-RR::={&mxref 3, &MXParam RTSreq} -rTSackReq MISAP-RR::={&mxref 4, &MXParam RTSackReq} -rIreq MISAP-RR::={&mxref 5, &MXParam RIreq} -manuReq MISAP-RR::={&mxref 6, &MXParam OCTET STRING} -events MISAP-RR::={&mxref 7, &MXParam Events21218} -posUpdateReq MISAP-RR::={&mxref 8, &MXParam PosUpdateReq} -unitDataReq MISAP-RR::={&mxref 9, &MXParam UnitData} -testMIecho MISAP-RR::={&mxref 255, &MXParam TestMIecho} - -SimIUTreq::=INsapPrimitivesUp - -RegReq::=SEQUENCE{ - medType MedType - } - -PrioReg::=SEQUENCE{ - interferers Interferers, - timeout INTEGER(0..255) - } - -Interferers::=SEQUENCE (SIZE(0..255)) OF MedType - -RTSreq::=SEQUENCE{ - priority UserPriority, - seqNo INTEGER(0..255), - status INTEGER { - release (0), -- release prioritization - request (16) -- request prioritization - }(0..255) - } - -RTSackReq::=SEQUENCE{ - reqID ReqID, - seqNo INTEGER(0..255), - status INTEGER { - ignored (64), -- request ignored - granted (128) -- request granted - }(0..255) - } - -RIreq::=SEQUENCE{ - medType MedType, -- medium for retrieval - riAccess RIaccess -- request frame details - } - -RIaccess::=OCTET STRING (SIZE(0..65535)) - -EVENT21218::=CLASS { - &eventRef INTEGER(0..255), - &Event21218 - } - -Events21218::=SEQUENCE{ - eventNo EVENT21218.&eventRef({Events-21218}), - event EVENT21218.&Event21218({Events-21218} {@eventNo}) - } - -Events-21218 EVENT21218::={minUserPrio | txQueueThreshold | txQueueFull | vciCreated | vciDeleted | paramMonitor | txQueueLow | vciReset, ...} - - -minUserPrio EVENT21218::={&eventRef 0, &Event21218 E21218-0} --- MinimumUserPriority -txQueueThreshold EVENT21218::={&eventRef 1, &Event21218 E21218-1} --- TX queue at threshold -txQueueFull EVENT21218::={&eventRef 2, &Event21218 E21218-2} -- TX queue full -vciCreated EVENT21218::={&eventRef 3, &Event21218 E21218-3} -- VCI created -vciDeleted EVENT21218::={&eventRef 4, &Event21218 E21218-4} -- VCI deleted -paramMonitor EVENT21218::={&eventRef 5, &Event21218 E21218-5} --- Automatic notification -txQueueLow EVENT21218::={&eventRef 6, &Event21218 E21218-6} --- TX queue below low thresh. -vciReset EVENT21218::={&eventRef 7, &Event21218 E21218-7} -- VCI reset - -E21218-0::=SEQUENCE{ - priority UserPriority, - linkID Link-ID - } - -E21218-1::=UserPriority - -E21218-2::=UserPriority - -E21218-3::=Link-ID - -E21218-4::=Link-ID - -E21218-5::=I-Param - -E21218-6::=UserPriority - -E21218-7::=Link-ID - -PosUpdateReq::=INTEGER(0..65535) -- 0: Update disabled - -- >0: Update interval in ms - -TestMIecho::=SEQUENCE{ - sap INTEGER{i (73)} (0..255), -- indicating MI-SAP - info OCTET STRING (SIZE(0..255)) - } - --- MI-SAP Request.confirm -- - -MI-Request-confirm::=SEQUENCE{ - linkID Link-ID, - commandRef CommandRef, - errStatus ErrStatus - } - --- MI-SAP Set.request -- - -MI-Set-request::=SEQUENCE{ - linkID Link-ID, - commandRef CommandRef, - set-param SEQUENCE OF I-Param - } - --- MI-SAP Set.confirm -- - -MI-Set-confirm::=SEQUENCE{ - linkID Link-ID, - commandRef CommandRef, - set-param Errors -- previously this was SEQUENCE OF Errors, which is wrong. - } - --- MI-SAP Get.request -- - -MI-Get-request::=SEQUENCE{ - linkID Link-ID, - commandRef CommandRef, - get-param-no SEQUENCE OF I-ParamNo - } - --- MI-SAP Get.confirm -- - -MI-Get-confirm::=SEQUENCE{ - linkID Link-ID, - commandRef CommandRef, - get-param SEQUENCE OF I-Param - } - --- SF-SAP Service primitives -- --- SF-SAP Command.request -- - --- activate the following once an SF-Command is defined --- SFSAP-CR::=MXSERV --- --- SF-Command-request::=SEQUENCE{ --- commandRef CommandRef, --- ref SFSAP-CR.&mxref({SF-Command}), --- command-param SFSAP-CR.&MXParam({SF-Command}{@ref}) --- } --- --- SF-Command SFSAP-CR::={, ...} - - --- SF-SAP Command.confirm -- - --- activate the following once an SF-CmdConfirm is defined --- SFSAP-CC::=MXSERV --- --- SF-Command-confirm::=SEQUENCE{ --- commandRef CommandRef, --- ref SFSAP-CC.&mxref({SF-CmdConfirm}), --- cmdConfirm-param SFSAP-CC.&MXParam({SF-CmdConfirm}{@ref}), --- errStatus ErrStatus --- } --- --- SF-CmdConfirm SFSAP-CC::={, ...} - - --- SF-SAP Request.request -- - --- activate the following once an SF-Request is defined --- SFSAP-RR::=MXSERV --- --- SF-Request-request::=SEQUENCE{ --- commandRef CommandRef, --- ref SFSAP-RR.&mxref({SF-Request}), --- request-param SFSAP-RR.&MXParam({SF-Request}{@ref}) --- } --- --- SF-Request SFSAP-RR::={, ...} - - --- SF-SAP Request.confirm -- - --- activate the following once an SN-ReqConfirm is defined --- SFSAP-RC::=MXSERV --- --- SF-Request-confirm::=SEQUENCE{ --- commandRef CommandRef, --- ref SFSAP-RC.&mxref({SF-ReqConfirm}), --- reqConfirm-param SFSAP-RC.&MXParam({SF-ReqConfirm}{@ref}), --- errStatus ErrStatus --- } --- --- SF-ReqConfirm SFSAP-RC::={, ...} - - --- SN-SAP Service primitives -- --- SN-SAP Command.request -- - --- activate the following once an SN-Command is defined --- SNSAP-CR::=MXSERV --- --- SN-Command-request::=SEQUENCE{ --- commandRef CommandRef, --- ref SNSAP-CR.&mxref({SN-Command}), --- command-param SNSAP-CR.&MXParam({SN-Command}{@ref}) --- } --- SN-Command SNSAP-CR::={, ...} - - --- SN-SAP Command.confirm -- - --- activate the following once an SN-CmdConfirm is defined --- SNSAP-CC::=MXSERV --- --- SN-Command-confirm::=SEQUENCE{ --- commandRef CommandRef, --- ref SNSAP-CC.&mxref({SN-CmdConfirm}), --- cmdConfirm-param SNSAP-CC.&MXParam({SN-CmdConfirm}{@ref}), --- errStatus ErrStatus --- } --- --- SN-CmdConfirm SNSAP-CC::={, ...} - - --- SN-SAP Request.request -- - --- activate the following once an SN-Request is defined --- SNSAP-RR::=MXSERV --- --- SN-Request-request::=SEQUENCE{ --- commandRef CommandRef, --- ref SNSAP-RR.&mxref({SN-Request}), --- request-param SNSAP-RR.&MXParam({SN-Request}{@ref}) --- } --- --- SN-Request SNSAP-RR::={, ...} - - --- SN-SAP Request.confirm -- - --- activate the following once an SN-ReqConfirm is defined --- SNSAP-RC::=MXSERV --- --- SN-Request-confirm::=SEQUENCE{ --- commandRef CommandRef, --- ref SNSAP-RC.&mxref({SN-ReqConfirm}), --- reqConfirm-param SNSAP-RC.&MXParam({SN-ReqConfirm}{@ref}), --- errStatus ErrStatus --- } --- --- SN-ReqConfirm SNSAP-RC::={, ...} - - --- SI-SAP Service primitives -- --- SI-SAP Command.request -- - --- activate the following once an SI-Command is defined --- SISAP-CR::=MXSERV --- --- SI-Command-request::=SEQUENCE{ --- linkID Link-ID, --- commandRef CommandRef, --- ref SISAP-CR.&mxref({SI-Command}), --- command-param SISAP-CR.&MXParam({SI-Command}{@ref}) --- } --- --- SI-Command SISAP-CR::={, ...} - --- SI-SAP Command.confirm -- - --- activate the following once an SI-CmdConfirm is defined --- SISAP-CC::=MXSERV --- --- SI-Command-confirm::=SEQUENCE{ --- linkID Link-ID, --- commandRef CommandRef, --- ref SISAP-CC.&mxref({SI-CmdConfirm}), --- cmdConfirm-param SISAP-CC.&MXParam({SI-CmdConfirm}{@ref}), --- errStatus ErrStatus --- } --- --- SI-CmdConfirm SISAP-CC::={, ...} - - --- SI-SAP Request.request -- - --- activate the following once an SI-Request is defined --- SISAP-RR::=MXSERV --- --- SI-Request-request::=SEQUENCE{ --- linkID Link-ID, --- commandRef CommandRef, --- ref SISAP-RR.&mxref({SI-Request}), --- request-param SISAP-RR.&MXParam({SI-Request}{@ref}) --- } --- --- SI-Request SISAP-RR::={, ...} - - --- SI-SAP Request.confirm -- - --- activate the following once an SI-CRqConfirm is defined --- SISAP-RC::=MXSERV --- --- SI-Request-confirm::=SEQUENCE{ --- linkID Link-ID, --- commandRef CommandRef, --- ref SISAP-RC.&mxref({SI-CmdConfirm}), --- reqConfirm-param SISAP-RC.&MXParam({SI-CmdConfirm}{@ref}), --- errStatus ErrStatus --- } --- --- SI-ReqConfirm SISAP-RC::={, ...} - - --- MS-SAP Service primitives -- --- MS-SAP Command.request -- - -MSSAP-CR::=MXSERV - -MS-Command-request::=SEQUENCE{ - commandRef CommandRef, - ref MSSAP-CR.&mxref({MS-Command}), - command-param MSSAP-CR.&MXParam({MS-Command}{@ref}) - } - -MS-Command MSSAP-CR::={testMS, ...} - -testMS MSSAP-CR::={&mxref 255, &MXParam OCTET STRING (SIZE(0..255))} - --- MS-SAP Command.confirm -- - -MSSAP-CC::=MXSERV - -MS-Command-confirm::=SEQUENCE{ - commandRef CommandRef, - ref MSSAP-CC.&mxref({MS-CmdConfirm}), - cmdConfirm-param MSSAP-CC.&MXParam({MS-CmdConfirm}{@ref}), - errStatus ErrStatus - } - -MS-CmdConfirm MSSAP-CC::={testMSConf, ...} - -testMSConf MSSAP-CC::={&mxref 255, &MXParam NULL} - --- MS-SAP Request.request -- - -MSSAP-RR::=MXSERV - -MS-Request-request::=SEQUENCE{ - commandRef CommandRef, - ref MSSAP-RR.&mxref({MS-Request}), - request-param MSSAP-RR.&MXParam({MS-Request}{@ref}) - } - -MS-Request MSSAP-RR::={iTS-S-Appl-ProcS-Reg | iTS-S-Appl-ProcS-ReqFinal | testMSecho, ...} - -iTS-S-Appl-ProcS-Reg MSSAP-RR::={&mxref 1, &MXParam ITS-S-Appl-Reg} -iTS-S-Appl-ProcS-ReqFinal MSSAP-RR::={&mxref 13, &MXParam ITS-S-Appl-RegFinal} -testMSecho MSSAP-RR::={&mxref 255, &MXParam TestMSecho} - -TestMSecho::=SEQUENCE{ - sap INTEGER{s (83)} (0..255), -- indicating MS-SAP - info OCTET STRING (SIZE(0..255)) - } - - --- MS-SAP Request.confirm -- - -MSSAP-RC::=MXSERV - -MS-Request-confirm::=SEQUENCE{ - commandRef CommandRef, - ref MSSAP-RC.&mxref({MS-ReqConfirm}), - reqConfirm-param MSSAP-RC.&MXParam({MS-ReqConfirm}{@ref}), - errStatus ErrStatus - } - -MS-ReqConfirm MSSAP-RC::={iTS-S-Appl-ProcS-RegConf | iTS-S-Appl-ProcS-ReqFinalConf | testMSechoConf, ...} - -iTS-S-Appl-ProcS-RegConf MSSAP-RR::={&mxref 1, &MXParam NULL} -iTS-S-Appl-ProcS-ReqFinalConf MSSAP-RR::={&mxref 13, &MXParam NULL} -testMSechoConf MSSAP-RR::={&mxref 255, &MXParam NULL} - - --- MA-SAP service primitives --- MA-SAP Command.request -- - -MASAP-CR::=MXSERV - -MA-Command-request::=SEQUENCE{ - commandRef CommandRef, - ref MASAP-CR.&mxref({MA-Command}), - command-param MASAP-CR.&MXParam({MA-Command}{@ref}) - } - -MA-Command MASAP-CR::={testMA, ...} - -testMA MASAP-CR::={&mxref 255, &MXParam OCTET STRING (SIZE(0..255))} - --- MA-SAP Command.confirm -- - -MASAP-CC::=MXSERV - -testMAConf MASAP-CC::={&mxref 255, &MXParam NULL} - -MA-Command-confirm::=SEQUENCE{ - commandRef CommandRef, - ref MASAP-CC.&mxref({MA-CmdConfirm}), - cmdConfirm-param MASAP-CC.&MXParam({MA-CmdConfirm}{@ref}), - errStatus ErrStatus - } - -MA-CmdConfirm MASAP-CC::={testMAConf, ...} - --- MA-SAP Request.request -- - -MASAP-RR::=MXSERV - -MA-Request-request::=SEQUENCE{ - commandRef CommandRef, - ref MASAP-RR.&mxref({MA-Request}), - request-param MASAP-RR.&MXParam({MA-Request}{@ref}) - } - -MA-Request MASAP-RR::={iTS-S-Appl-Proc-Reg | iTS-S-Appl-Proc-ReqFinal | testMAecho, ...} - -iTS-S-Appl-Proc-Reg MASAP-RR::={&mxref 1, &MXParam ITS-S-Appl-Reg} -iTS-S-Appl-Proc-ReqFinal MASAP-RR::={&mxref 13, &MXParam ITS-S-Appl-RegFinal} -testMAecho MASAP-RR::={&mxref 255, &MXParam TestMAecho} - -TestMAecho::=SEQUENCE{ - sap INTEGER{a (65)} (0..255), -- indicating MA-SAP - info OCTET STRING (SIZE(0..255)) - } - --- MA-SAP Request.confirm -- - -MASAP-RC::=MXSERV - -MA-Request-confirm::=SEQUENCE{ - commandRef CommandRef, - ref MASAP-RC.&mxref({MA-ReqConfirm}), - reqConfirm-param MASAP-RC.&MXParam({MA-ReqConfirm}{@ref}), - errStatus ErrStatus - } - -MA-ReqConfirm MASAP-RC::={iTS-S-Appl-Proc-RegConf | iTS-S-Appl-Proc-ReqFinalConf | testMAechoConf, ...} - -iTS-S-Appl-Proc-RegConf MASAP-RC::={&mxref 1, &MXParam ITS-S-Appl-RegConf} -iTS-S-Appl-Proc-ReqFinalConf MASAP-RC::={&mxref 13, &MXParam NULL} -testMAechoConf MASAP-RC::={&mxref 255, &MXParam NULL} - - - --- SA-SAP service primitives --- SA-SAP Command.request -- - --- activate the following once an SA-Command is defined --- SASAP-CR::=MXSERV --- --- SA-Command-request::=SEQUENCE{ --- commandRef CommandRef, --- ref SASAP-CR.&mxref({SA-Command}), --- command-param SASAP-CR.&MXParam({SA-Command}{@ref}) --- } --- --- SA-Command SASAP-CR::={, ...} - - --- SA-SAP Command.confirm -- - --- activate the following once an SA-CmdConfirm is defined --- SASAP-CC::=MXSERV --- --- SA-Command-confirm::=SEQUENCE{ --- commandRef CommandRef, --- ref SASAP-CC.&mxref({SA-CmdConfirm}), --- cmdConfirm-param SASAP-CC.&MXParam({SA-CmdConfirm}{@ref}), --- errStatus ErrStatus --- } --- --- SA-CmdConfirm SASAP-CC::={, ...} - - --- SA-SAP Request.request -- - --- activate the following once an SA-Request is defined --- SASAP-RR::=MXSERV --- --- SA-Request-request::=SEQUENCE{ --- commandRef CommandRef, --- ref SASAP-RR.&mxref({SA-Request}), --- request-param SASAP-RR.&MXParam({SA-Request}{@ref}) --- } --- --- SA-Request MASAP-RR::={, ...} - - --- SA-SAP Request.confirm -- - --- activate the following once an SA-ReqConfirm is defined --- SASAP-RC::=MXSERV --- --- SA-Request-confirm::=SEQUENCE{ --- commandRef CommandRef, --- ref SASAP-RC.&mxref({SA-Request-confirm}), --- reqConfirm-param SASAP-RC.&MXParam({SA-Request-confirm}{@ref}), --- errStatus ErrStatus --- } --- --- SA-ReqConfirm SASAP-RC::={, ...} - - - --- General types -- - -ErrStatus::=INTEGER{ - success (0), - unspecFailure (1), -- unspecified failure - invalParamNo (2), -- invalid param no. - invalParamVal (3), -- invalid param value - riViolation (4), -- RI violation - cmdReqNo (5), -- invalid cmd/req no. - cmdReqVal (6), -- invalid cmd/req value - accessViolation (7), -- access violation - invalidType (8), -- invalid cmd/req type - sequenceError (9), -- cmd/req not applicable in the given context - nonavailValue (10), -- value required in cmd/req is not available - hardwareFailure (255) -- unspecified hardware failure - } (0..255) - -CommandRef::=INTEGER(0..65535) - - --- Values - - - -/* - The ASN.1 specification has been checked for conformance to the ASN.1 - standards by OSS ASN.1 Syntax Checker, and by OSS ASN-1STEP -*/ - -END - -- GitLab From 4e18f38cbcf840e67f5c0fb552222139e2a58f24 Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 20 Apr 2020 15:37:48 +0200 Subject: [PATCH 242/320] Remove useless ASN.1 files --- asn1/CITSapplMgmt/CITSapplMgmtApplReg.asn | 413 ---------------------- asn1/CITSapplMgmt/CITSapplMgmtComm.asn | 28 -- asn1/CITSapplMgmt/CITSapplMgmtIDs.asn | 47 --- asn1/CITSapplReq/CITSapplReq.asn | 351 ------------------ 4 files changed, 839 deletions(-) delete mode 100644 asn1/CITSapplMgmt/CITSapplMgmtApplReg.asn delete mode 100644 asn1/CITSapplMgmt/CITSapplMgmtComm.asn delete mode 100644 asn1/CITSapplMgmt/CITSapplMgmtIDs.asn delete mode 100644 asn1/CITSapplReq/CITSapplReq.asn diff --git a/asn1/CITSapplMgmt/CITSapplMgmtApplReg.asn b/asn1/CITSapplMgmt/CITSapplMgmtApplReg.asn deleted file mode 100644 index ed7f715d..00000000 --- a/asn1/CITSapplMgmt/CITSapplMgmtApplReg.asn +++ /dev/null @@ -1,413 +0,0 @@ -CITSapplMgmtApplReg {iso(1) standard(0) cits-applMgmt (17419) applRegistry (2) version1 (1) } -DEFINITIONS AUTOMATIC TAGS::=BEGIN - --- Warning: Module is still under development - -IMPORTS -VarLengthNumber, VarLengthNumber2 FROM CITSapplMgmtIDs {iso(1) standard(0) cits-applMgmt (17419) ids (1)} - - -LogicalChannelType FROM CITSapplMgmtComm {iso(1) standard(0) cits-applMgmt (17419) comm (3)} - -ITSSappRxTxPortNo, ITSSappCPReqReg FROM CITSapplReq {iso(1) standard(0) cits-applReq (17423) asnm-1(1)} - -Lon, Lat, UserPriority FROM CALMllsap {iso(1) standard(0) calm-ll-sap(21218) asnm-1(1)} - -PortNumber FROM CALMfntp { iso (1) standard (0) calm-nonip(29281) fntp(1) asnm-1 (1)} - -; - --- End of IMPORTS - --- Types - --- registration information records for several ITS application objects - - --- ITS application object registration ITS-AID - - --- registry record for the whole set of registration information -ITSapObRegistry::=SEQUENCE OF ITSapOb - --- for a single ITS application object (ITSapOb) -ITSapOb::=SEQUENCE { - iTSaid ITSaid, -- ITS-AID - iTSapObName ITSObName, -- name of ITS application object - iTSapObType ITSapObType, -- class or application - iTSapObOwner ITSObOwner, -- owner of the ITS application - iTSapObCert ITSapObCertificate, -- information on certificate - iTSapObPorts ITSapObPorts - } - -ITSapObPorts::=SEQUENCE OF SEQUENCE{ - portNo ITSSappRxTxPortNo, - rules SEQUENCE OF ITSapObPort -- Information per source, see CEN/ISO TS 17423 - } - -ITSapObPort::= SEQUENCE OF ITSapObPortRule -- all rules shall be used at least once per source! - -ITSAPOBSR::=CLASS { - &ruleRef INTEGER(0..255), - &Rule - } - -ITSapObPortRule::=SEQUENCE{ - ruleNo ITSAPOBSR.&ruleRef({ITSapObPortRules}), - rule ITSAPOBSR.&Rule({ITSapObPortRules}{@ruleNo}) - } - -ITSapObPortRules ITSAPOBSR::={iTSapObRxTx | iTSapObLch | iTSapObPn, ...} - -iTSapObRxTx ITSAPOBSR::={&ruleRef 0, &Rule PortRxTx} -- RX or TX port -iTSapObLch ITSAPOBSR::={&ruleRef 1, &Rule LogicalChannelPrio} -- TX LCH allowed -iTSapObPn ITSAPOBSR::={&ruleRef 2, &Rule PortNumber} -- well-known PortNumber - -PortRxTx::=INTEGER{ - rxPort (0), - txPort (255) - } (0..255) - -LogicalChannelPrio::=SEQUENCE{ - lch LogicalChannelType, - prio UserPriority - } -- priority of messages of a source may depend on the LCH. - - -ITSObName::=OCTET STRING (SIZE(0..255)) - -ITSapObType::=INTEGER { - appClass (0), - application (1) - } (0..255) - -ITSObOwner::=SEQUENCE{ - ownerName ITSObOwnerName, - ownerType ITSObOwnerType, - ownerOID OBJECT IDENTIFIER - } - -ITSObOwnerName::=OCTET STRING (SIZE(0..255)) - -ITSObOwnerType::=INTEGER{ - standard (0), - private (1) - } (0..255) - -ITSapObPriority::=UserPriority - -ITSapObCertificate::=SEQUENCE { - issuingSA IssuingSA, - startDate CertStartDate, - endDate CertEndDate, - status CertStatus - } - -IssuingSA::=SEQUENCE { - name SAname, - saOID OBJECT IDENTIFIER - } - -SAname::=OCTET STRING (SIZE(0..255)) - -CertStartDate::=SEQUENCE{ - fill BIT STRING (SIZE(7)), -- set to zero - csd CHOICE { - inactive [0] NULL, -- indicates that certificate is not issued - date [1] NumericString (SIZE(8)) -- yyyymmdd - } - } - -CertEndDate::=SEQUENCE{ - fill BIT STRING (SIZE(6)), -- set to zero - ced CHOICE { - inactive [0] NULL, -- this shall apply if StartDate is set to [0] - date [1] NumericString (SIZE(8)), -- yyyymmdd - never [2] NULL -- indicates that there is no end date - } - } - -CertStatus::=SEQUENCE{ - fill BIT STRING (SIZE(6)), -- set to zero - cs CHOICE { - active [0] NULL, -- certificate is issued - inactive [1] NULL, -- certificate is not issued - testActiv [2] NULL, -- ITS application object is in test phase - blocked [3] CertBlocked -- issued certificate is blocked - } - } - -CertBlocked::=SEQUENCE { - date NumericString (SIZE(8)), -- yyyymmdd - issuingSA IssuingSA -- SA who performed black-listing of an ITS-AID - } - - --- ITS message set registration ITS-MsgSetID - - --- registry record for the whole set of registration information -ITSmsgSetRegistry::=SEQUENCE OF ITSmsgSet - --- for a single ITS message set (ITSmsgSet) -ITSmsgSet::=SEQUENCE { - iTSmsID ITSmsgSetID, -- ITS-MsgSetID - iTSmsName ITSObName, -- human-readable name of ITS message set - iTSmsOwner ITSObOwner -- owner of the ITS message set - } - - --- ITS regulatory region registration - - --- registry record for the whole set of registration information -ITSregRegionRegistry::=SEQUENCE OF ITSregRegion --- for a single regulatory region -ITSregRegion::=SEQUENCE{ - regID ITSrrID, - regAuthority ITS-RegPolicyAuthority, - fill BIT STRING (SIZE(7)), - regArea ITS-RParea - } - -ITS-RegPolicyAuthority::=SEQUENCE{ - name ITSObOwnerName, - url URLreg - } - -URLreg::=OCTET STRING (SIZE(0..256)) - -ITSRPAREA::=CLASS{ - &areaRef INTEGER(0..255), - &Area - } - -ITS-RParea::=SEQUENCE{ - areaTypeNo ITSRPAREA.&areaRef({ITS-RPareaTypes}), - areaType ITSRPAREA.&Area({ITS-RPareaTypes}) - } - -ITS-RPareaTypes ITSRPAREA::={rpAreaCountryCode | rpAreaGeoPolygon,...} - -rpAreaCountryCode ITSRPAREA::={&areaRef 0, &Area CountryCode} -rpAreaGeoPolygon ITSRPAREA::={&areaRef 1, &Area GeoPolygon} - -GeoPolygon::=SEQUENCE (SIZE(0..65535)) OF GeoCoordinates - -GeoCoordinates::=SEQUENCE{ - lat Lat, -- from ISO 21218 - long Lon -- from ISO 21218 - } - -CountryCode::=OCTET STRING (SIZE(3)) -- ISO 3166 Alpha-3 code - - --- ITS policy region registration - - --- registry record for the whole set of registration information -ITSpolRegionRegistry::=SEQUENCE OF ITSpolRegion --- for a single policy region -ITSpolRegion::=SEQUENCE{ - polID ITSprID, - polAuthority ITS-RegPolicyAuthority, - fill BIT STRING (SIZE(7)), - polArea ITS-RParea - } - - --- ITS port number registration - --- registry record for the whole set of registration information -ITSportNumberRegistry::=SEQUENCE OF ITSportNumber --- for a single port number -ITSportNumber::=SEQUENCE{ - pn PortNumber, -- PN used by transport protocol - ntProt NTprotocol, -- transport protocol identifier - itssAp ItsAppInfo -- RxTx port (sink/source) of ITS application object - } - - -ItsAppInfo::=SEQUENCE{ - itsAid ITSaid, - rxTxPortNo ITSSappRxTxPortNo - } - -NTprotocol::=SEQUENCE{ - name OCTET STRING (SIZE(0..255)), - protRef ProtocolReference - } - -ProtocolReference::=SEQUENCE{ - sdo OCTET STRING (SIZE(0..255)), - docNo OCTET STRING (SIZE(0..255)) - } - --- ITS flow type registration - --- registry record for the whole set of registration information -ITSflowTypeRegistry::=SEQUENCE OF ITSflowType --- for a single flow type -ITSflowType::=SEQUENCE{ - id FlowTypeID, -- Flow type identifier (well-known Flow type) - req ITSSappCPReqReg -- list of requirements - } - -FlowTypeID::=VarLengthNumber2 - - - --- ITS logical channel registration - - --- registry record for the whole set of registration information -ITSlchRegistry::=SEQUENCE OF ITSlch --- for a single LCH -ITSlch::=SEQUENCE{ - lchID LogicalChannelType, -- reference ID of LCH - lchPurpose OCTET STRING (SIZE(0..255)) -- Purpose of LCH - } - - - - --- ITS station unit registration - - --- registry record for the whole set of registration information -ITSsuRegistry::=SEQUENCE OF ITSsu --- for a single ITS-SU -ITSsu::=SEQUENCE{ - itssuID ITSsuID - } - - - --- ITS station communication unit registration - - --- registry record for the whole set of registration information -ITSscuRegistry::=SEQUENCE OF ITSscu --- for a single ITS-SCU -ITSscu::=SEQUENCE{ - itsscuID ITSscuID - } - - --- ITS-S application process provisioner registration - - --- registry record for the whole set of registration information -ITSSappRegistry::=SEQUENCE OF ITSSapPrPr --- for a single ITS-S-APP -ITSSapPrPr::=SEQUENCE{ - itssappID ITSSappid, - itssapProv RegEntryOwner - } - -RegEntryOwner::=SEQUENCE{ - ownerName OCTET STRING (SIZE(0..255)), - ownerAddress OCTET STRING (SIZE(0..255)), - ownerURL URLreg - } - - --- ITS equipment manufacturer registration - - --- registry record for the whole set of registration information -ITSemRegistry::=SEQUENCE OF ITSem --- for a single ITS equipment manufacturer -ITSem::=SEQUENCE{ - itsemID ITSemID, - equipManu RegEntryOwner - } - - --- ITS application object owner registration - - --- registry record for the whole set of registration information -ITSaooRegistry::=SEQUENCE OF ITSaoo --- for a single ITS application object owner -ITSaoo::=SEQUENCE{ - itsaooID ITSaooID, - aoo RegEntryOwner - } - - --- ITS message set owner registration - - --- registry record for the whole set of registration information -Registry::=SEQUENCE OF ITSmso --- for a single ITS message set owner -ITSmso::=SEQUENCE{ - iTSmsoID ITSmsoID, - mso RegEntryOwner - } - - --- ITS-S application process developer registration - - --- registry record for the whole set of registration information -ITSSapdRegistry::=SEQUENCE OF ITSSapd --- for a single ITS-S application process developer -ITSSapd::=SEQUENCE{ - itssapdID ITSSapdID, - ad RegEntryOwner - } - - --- ID types -- - -ITSaid::=VarLengthNumber -- used in 24102-5 - -ITSmsgSetID::=VarLengthNumber - -ITSemID::=VarLengthNumber2 - -ITSsuID::=SEQUENCE{ - suID VarLengthNumber, - scuID ITSscuID - } - -ITSscuID::=SEQUENCE{ - emID ITSemID, -- manufacturer ID - serialNo VarLengthNumber -- serial number - } - -ITSSappid::=VarLengthNumber - -ITSrrID::=VarLengthNumber - -ITSprID::=VarLengthNumber - -ITSaooID::=VarLengthNumber - -ITSmsoID::=VarLengthNumber2 - -ITSSapdID::=VarLengthNumber - - --- Values - --- OIDs of standards organizations --- ISO -oidISO OBJECT IDENTIFIER::={iso(1) standard(0)} --- ETSI -oidETSI OBJECT IDENTIFIER::={itu-t(0) identified-organization(4) etsi(0)} --- IEEE -oidIEEE OBJECT IDENTIFIER::={iso(1) identified-organization(3) ieee(3)} --- CEN -oidCEN OBJECT IDENTIFIER::={iso(1) identified-organization(3) cen(162)} - -fntpRefNo OCTET STRING(SIZE(0..255))::='49534F2032393238312D31'H --"ISO 29281-1" - - --- version of this module -version INTEGER(0..255)::=1 - - -END diff --git a/asn1/CITSapplMgmt/CITSapplMgmtComm.asn b/asn1/CITSapplMgmt/CITSapplMgmtComm.asn deleted file mode 100644 index ef829a60..00000000 --- a/asn1/CITSapplMgmt/CITSapplMgmtComm.asn +++ /dev/null @@ -1,28 +0,0 @@ -CITSapplMgmtComm {iso(1) standard(0) cits-applMgmt (17419) comm (3)} -DEFINITIONS AUTOMATIC TAGS::=BEGIN - --- Warning: Module is still under development - -IMPORTS -VarLengthNumber, VarLengthNumber2 FROM CITSapplMgmtIDs {iso(1) standard(0) cits-applMgmt (17419) ids (1)} - -; - --- End of IMPORTS - --- Types - -LogicalChannelType::=VarLengthNumber2 -- used in 17423, 21218, 24102-1 - -MCgroup::= VarLengthNumber -- used in 17423 - -ITSprotocolStackID::= VarLengthNumber -- used in 17423 - - - --- Values - -version INTEGER(0..255)::=1 -- version of this module - - -END diff --git a/asn1/CITSapplMgmt/CITSapplMgmtIDs.asn b/asn1/CITSapplMgmt/CITSapplMgmtIDs.asn deleted file mode 100644 index df372c41..00000000 --- a/asn1/CITSapplMgmt/CITSapplMgmtIDs.asn +++ /dev/null @@ -1,47 +0,0 @@ -CITSapplMgmtIDs {iso(1) standard(0) cits-applMgmt (17419) ids (1)} -DEFINITIONS AUTOMATIC TAGS::=BEGIN - --- Warning: Module is still under development - -IMPORTS - -; - --- End of IMPORTS - --- Types - --- Variable length data types - -VarLengthNumber::=CHOICE{ - content [0] INTEGER(0..127), -- one octet length - extension [1] Ext1 - } - -Ext1::=CHOICE{ - content [0] INTEGER(128..16511), -- two octets length - extension [1] Ext2 -} - -Ext2::=CHOICE{ - content [0] INTEGER(16512..2113663), -- three octets length - extension [1] Ext3 - } - -Ext3::=INTEGER(211664..270549119,...) -- four and more octets length - - -VarLengthNumber2::=CHOICE{ - shortNo [0] INTEGER(0..127), - longNo [1] INTEGER(0..32767) - } - - --- Values - -version INTEGER(0..255)::=1 -- version of this module - - - -END - diff --git a/asn1/CITSapplReq/CITSapplReq.asn b/asn1/CITSapplReq/CITSapplReq.asn deleted file mode 100644 index 5a2c8ff0..00000000 --- a/asn1/CITSapplReq/CITSapplReq.asn +++ /dev/null @@ -1,351 +0,0 @@ ----- - -CITSapplReq {iso(1) standard(0) cits-applReq (17423) asnm-1 (1)} - -DEFINITIONS AUTOMATIC TAGS::=BEGIN - --- Warning: Module is still under development - -IMPORTS -DataRate, Directivity, TimeUnit FROM CALMllsap {iso(1) standard(0) calm-ll-sap(21218) asnm-1(1)} - -VarLengthNumber2 FROM CITSapplMgmtIDs {iso(1) standard(0) cits-applMgmt (17419) ids (1)} - -ITSaid , FlowTypeID FROM CITSapplMgmtApplReg {iso(1) standard(0) cits-applMgmt (17419) applRegistry (2)} - -LogicalChannelType, MCgroup, ITSprotocolStackID FROM CITSapplMgmtComm {iso(1) standard(0) cits-applMgmt (17419) comm (3)} - -ApplicationID FROM CALMmanagement { iso (1) standard (0) calm-management (24102) local (1) asnm-1 (1)} -; - --- End of IMPORTS - --- Types - --- Communication Requirement per communication source identified by FlowNo - --- Used in REQUEST.request service primitive - -ITSSappCPReqReg::=SEQUENCE{ - applicationID ApplicationID, ---ID of ITS-S application process unique in an ITS-SCU - rxTxPort ITSSappRxTxPort, - requirements ITSSappReq - } - -ITSSappRxTxPort::=SEQUENCE{ - portNo ITSSappRxTxPortNo, - portType ITSSappRxTxPortType - } - -ITSSappRxTxPortNo::=VarLengthNumber2 - -ITSSappRxTxPortType::=INTEGER{ - rxPort (0), - txPort (255) - } (0..255) - -ServiceRef::=SEQUENCE{ - itsaid ITSaid, - instance INTEGER(0..255), -- allows for 256 instances of this app - flowNo FlowNo - } - -FlowNo::=INTEGER(0..255) -- allows for 256 different flows per app - - --- Used in REQUEST.confirm service primitive -ITSSappCPReqConf::=SEQUENCE{ - applicationID ApplicationID, - rxTxPort ITSSappRxTxPort, - confDetails ITSSappReqConf - } - --- Confirmation of presented requirements -REQSCP::=CLASS { - &ref INTEGER(0..255), - &ReqParam - } - -ITSSappReq::=SEQUENCE OF SEQUENCE{ - refNo REQSCP.&ref({Req-SCP}), - param REQSCP.&ReqParam({Req-SCP}{@refNo}) - } - -REQSCPCONF::=CLASS { - &ref INTEGER(0..255), - &ReqConfParam - } - -ITSSappReqConf::=SEQUENCE OF SEQUENCE{ - refNo REQSCPCONF.&ref({ReqConf-SCP}), -- same as in request - param REQSCPCONF.&ReqConfParam({ReqConf-SCP}{@refNo}) - } - --- Notification of final decision of ITS-S application process -ITSSappCPFinal::=SEQUENCE{ - applicationID ApplicationID, -- same as in .request - final Logic - } - - --- Requirements - - -Req-SCP REQSCP::={logChannel | destType | destDomain | maxAPDU | contConnect | nxRepeat | storeForward | flowType | commDistance | directivity | multiHop | reduntOp | minThP | maxLat | protocolReq | dataConfidentiality | dataIntegrity | nonReputability | dataAuthentication, ...} - --- Mandatory requirements (only odd ref numbers) -logChannel REQSCP::={&ref 0, &ReqParam LogicalChannelType} -destType REQSCP::={&ref 2, &ReqParam DestinationType} -destDomain REQSCP::={&ref 4, &ReqParam DestDomain} -maxAPDU REQSCP::={&ref 6, &ReqParam MaxADU} - -DestinationType::=SEQUENCE{ - fill BIT STRING (SIZE(7)), -- all bits set to zero - type DestType - } - -DestType::=CHOICE{ - addressType [0] AddressBasedType, - geoLocType [1] GeoLocationBasedType - } - -AddressBasedType::=SEQUENCE{ - type INTEGER{ - broadCast (0), - multiCast (1), - unicast (2) - }(0..127), - mcGroups SEQUENCE (SIZE(0..255)) OF MCgroup OPTIONAL - } - -GeoLocationBasedType::=SEQUENCE{ - type INTEGER{ - geoUnicast (0), - geoAnycast (1), - geoMulticast (2), - geoBroadcast (4) - } (0..127), - mcGroups SEQUENCE (SIZE(0..255)) OF MCgroup OPTIONAL - } - -DestDomain::=INTEGER{ - stationInternal (0), - linkLocal (1), - siteLocal (2), - itsNWlocal (4), - global (8) - } (0..255) - -MaxADU::=INTEGER(0..65535) -- multiples of 100 byte - - --- Optional requirements (only even ref numbers) -contConnect REQSCP::={&ref 1, &ReqParam ContConnect} -nxRepeat REQSCP::={&ref 3, &ReqParam NxRepeat} -storeForward REQSCP::={&ref 5, &ReqParam StoreForward} -flowType REQSCP::={&ref 7, &ReqParam FlowTypeID} -commDistance REQSCP::={&ref 9, &ReqParam CommDistance} -directivity REQSCP::={&ref 11, &ReqParam Directivity} -multiHop REQSCP::={&ref 13, &ReqParam MultiHop} -reduntOp REQSCP::={&ref 15, &ReqParam Resilience} -minThP REQSCP::={&ref 17, &ReqParam MinThP} -maxLat REQSCP::={&ref 19, &ReqParam MaxLat} -protocolReq REQSCP::={&ref 21, &ReqParam ProtocolReq} -dataConfidentiality REQSCP::={&ref 23, &ReqParam DataConfidentiality} -dataIntegrity REQSCP::={&ref 25, &ReqParam DataIntegrity} -nonReputability REQSCP::={&ref 27, &ReqParam ReqNonrepudiation} -dataAuthentication REQSCP::={&ref 29, &ReqParam DataAuthentication} - -ContConnect::=SEQUENCE{ - duration TimDurationValue, - interrupt Logic -- true: session may be interrupted - } -- three octets in PER - -TimDurationValue::=SEQUENCE { - value INTEGER(0..1023), -- valid parameter number (10 bits in PER) - unit TimeUnit - } -- 16 bits in PER - -NxRepeat::=SEQUENCE{ - repeat INTEGER(0..255), -- 0 no repetition, 255 no stop until flow ends - interval TimDurationValue - } - -StoreForward::=TimDurationValue - -CommDistance::=SEQUENCE{ - minDistance INTEGER(0..65535), -- m - cost CostObjective - } - -MultiHop::=SEQUENCE{ - hops INTEGER(0..255), - cost CostObjective - } - -Resilience::=CostObjective -- true: resilience requested - -MinThP::=SEQUENCE{ - minThP DataRate, - cost CostObjective - } - -MaxLat::=SEQUENCE{ - lat INTEGER{ - unknown (0), -- unknown latency - any (1), -- any latency - not further specified - ms (2), -- response within less than 10 ms - ms10 (4), -- response within less than 100 ms - ms100 (8), -- response within less than 1 second - sec (16), -- response within less than 10 seconds - sec10 (32), -- response within less than 1 minute - min (64), -- response within less than 10 minutes - min10 (128) -- response within less than 1 hour - } (0..255), - cost CostObjective - } - -ProtocolReq::=ITSprotocolStackID -- this type must be octet aligned. - -DataConfidentiality::=ConfValue - -DataIntegrity::=ConfValue - -ReqNonrepudiation::=ConfValue - -DataAuthentication::=ConfValue - - --- Confirmation requirements and objectives requested - -ReqConf-SCP REQSCPCONF::={logChannelConf | destTypeConf | destDomainConf | maxAPDUConf | contConnectConf | nxRepeatConf | storeForwardConf | flowTypeConf | commDistanceConf | directivityConf | multiHopConf | reduntOpConf | minThPConf | maxLatConf | protocolReqConf | dataConfidentialityConf | dataIntegrityConf | nonReputabilityConf | dataAuthenticationConf, ...} - --- Mandatory (only odd ref numbers): ok (TRUE) / nok or possible values -logChannelConf REQSCPCONF::={&ref 0, &ReqConfParam Logic} -destTypeConf REQSCPCONF::={&ref 2, &ReqConfParam Logic} -destDomainConf REQSCPCONF::={&ref 4, &ReqConfParam Logic} -maxAPDUConf REQSCPCONF::={&ref 6, &ReqConfParam MaxADU} --- Optional (only even ref numbers): ok (TRUE) / nok or possible values -contConnectConf REQSCPCONF::={&ref 1, &ReqConfParam ContConnect} -nxRepeatConf REQSCPCONF::={&ref 3, &ReqConfParam Logic} -storeForwardConf REQSCPCONF::={&ref 5, &ReqConfParam Logic} -flowTypeConf REQSCPCONF::={&ref 7, &ReqConfParam Logic} -commDistanceConf REQSCPCONF::={&ref 9, &ReqConfParam CommDistance} -directivityConf REQSCPCONF::={&ref 11, &ReqConfParam Directivity} -multiHopConf REQSCPCONF::={&ref 13, &ReqConfParam Logic} -reduntOpConf REQSCPCONF::={&ref 15, &ReqConfParam Logic} -minThPConf REQSCPCONF::={&ref 17, &ReqConfParam MinThP} -maxLatConf REQSCPCONF::={&ref 19, &ReqConfParam MaxLat} -protocolReqConf REQSCPCONF::={&ref 21, &ReqConfParam Logic} -dataConfidentialityConf REQSCPCONF::={&ref 23, &ReqConfParam Logic} -dataIntegrityConf REQSCPCONF::={&ref 25, &ReqConfParam Logic} -nonReputabilityConf REQSCPCONF::={&ref 27, &ReqConfParam Logic} -dataAuthenticationConf REQSCPCONF::={&ref 29, &ReqConfParam Logic} - - --- Policies - -POLICYC::=CLASS { - &ref INTEGER(0..255), - &PolParam - } - -Policies::=SEQUENCE OF SEQUENCE{ - refNo POLICYC.&ref({Policy}), - param POLICYC.&PolParam({Policy}{@refNo}) - } - -Policy POLICYC::={mediumCost | locPrivacy | anonymity, ...} - -mediumCost POLICYC::={&ref 0, &PolParam MediumCost} -locPrivacy POLICYC::={&ref 1, &PolParam LocPrivacy} -anonymity POLICYC::={&ref 2, &PolParam Anonymity} - - --- Financial policies - -MediumCost::=SEQUENCE{ - fill BIT STRING (SIZE(2)), -- bits set to zero - costClass CostClass, -- uses 3 bits - costAmount CostAmount OPTIONAL, - timeUnit CostTimeUnit OPTIONAL, - amountUnit CostAmountUnit OPTIONAL - } - -CostClass::=INTEGER{ - tempUnavailable (0), - noCharge (1), - flatRate (2), - perTime (3), - perAmount (4), - perConnection (5) - } (0..7) - -CostAmount::=SEQUENCE{ - currency INTEGER(0..1023), -- ISO 4217 three digit numeric code - value CostValue - } -- presented in 4 octets - -CostValue::=SEQUENCE{ - main INTEGER(0..4095), -- in currency unit - fraction INTEGER(0..1023) -- in 1/1000 of currency unit - } - -CostTimeUnit::=SEQUENCE{ - value INTEGER(0..1023), -- valid parameter number (10 bits in PER) - fill BIT STRING (SIZE(1)), -- set to zero, extends TimeUnit size. - unit TimeUnit -- presented in 5 bits - } -- 2 octets in PER - -CostAmountUnit::=INTEGER{ - tempUnavailable (0), - kbyte (1), - tkbyte (2), - hkbyte (4), - mbyte (8), - tmbyte (16), - hmbyte (32), - gbyte (64), - tgbyte (128) - } (0..255) - --- Security -LocPrivacy::=ConfValue - -Anonymity::=ConfValue - --- MA-SAP / MF-SAP / MS-SAP functions --- Some functions are used in these three SAPs - - -ITS-S-Appl-Reg::= SEQUENCE OF ITSSappCPReqReg -- used in 24102-3 - -ITS-S-Appl-RegConf::= SEQUENCE OF ITSSappCPReqConf -- used in 24102-3 - -ITS-S-Appl-RegFinal::=ITSSappCPFinal - --- General -Logic::=INTEGER{ - false (0), - true (255) - } (0..255) - -ConfValue::=INTEGER{ - ok (0), - alternative (1), - nok (2) - } (0..255) - -CostObjective::=INTEGER(0..255) - --- values - - - - - -END - - - -- GitLab From 26b8f58bf5d2d4a09b9e63061a6d871a927f8985 Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 22 May 2020 16:59:40 +0200 Subject: [PATCH 243/320] Bug fixed in AtsGeoNetworking: Some tests cases were missing --- .../LibItsGeoNetworking_Functions.ttcn | 137 +++++++-------- .../LibItsGeoNetworking_Pics.ttcn | 166 ++++++++++-------- .../LibItsGeoNetworking_TypesAndValues.ttcn | 4 +- 3 files changed, 157 insertions(+), 150 deletions(-) diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn index c7389292..fb7082c3 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn @@ -199,7 +199,7 @@ module LibItsGeoNetworking_Functions { // Disconnect f_disconnect4SelfOrClientSync(); - } // end f_cf01Down + } // End of function f_cf01Down /** * @desc This configuration features: @@ -270,7 +270,7 @@ module LibItsGeoNetworking_Functions { } } - } // end f_cf02Up + } // End of group f_cf02Up /** * @desc Deletes configuration cf02 @@ -293,7 +293,7 @@ module LibItsGeoNetworking_Functions { unmap(self:utPort, system:utPort); disconnect(self:syncPort, mtc:syncPort); - } // end f_cf02Down + } // End of group f_cf02Down /** * @desc This configuration features: @@ -364,7 +364,7 @@ module LibItsGeoNetworking_Functions { } } - } // end f_cf03Up + } // End of group f_cf03Up /** * @desc Deletes configuration cf03 @@ -387,7 +387,7 @@ module LibItsGeoNetworking_Functions { unmap(self:utPort, system:utPort); disconnect(self:syncPort, mtc:syncPort); - } // end f_cf03Down + } // End of group f_cf03Down /** * @desc This configuration features: @@ -460,7 +460,7 @@ module LibItsGeoNetworking_Functions { } } - } // end f_cf04Up + } // End of group f_cf04Up /** * @desc Deletes configuration cf04 @@ -483,7 +483,7 @@ module LibItsGeoNetworking_Functions { unmap(self:utPort, system:utPort); disconnect(self:syncPort, mtc:syncPort); - } // end f_cf04Down + } // End of group f_cf04Down /** * @desc This configuration features: @@ -574,7 +574,7 @@ module LibItsGeoNetworking_Functions { unmap(self:utPort, system:utPort); disconnect(self:syncPort, mtc:syncPort); - } // end f_cf05Down + } // End of group f_cf05Down /** * @desc This configuration features: @@ -666,7 +666,7 @@ module LibItsGeoNetworking_Functions { unmap(self:utPort, system:utPort); disconnect(self:syncPort, mtc:syncPort); - } // end f_cf06Down + } // End of group f_cf06Down /** * @desc This configuration features: @@ -757,7 +757,7 @@ module LibItsGeoNetworking_Functions { unmap(self:utPort, system:utPort); disconnect(self:syncPort, mtc:syncPort); - } // end f_cf07Down + } // End of group f_cf07Down /** * @desc Behavior function for initializing component's variables and tables @@ -778,7 +778,7 @@ module LibItsGeoNetworking_Functions { vc_localSeqNumber := f_getInitialSequenceNumber(); vc_multipleMessagesCount := f_getMessageCount(); - } // end f_initialiseComponent + } // End of function f_initialiseComponent /** * @desc Makes the simulated ITS node behave as a neighbour of IUT @@ -788,7 +788,7 @@ module LibItsGeoNetworking_Functions { vc_neighbourDefault := activate(a_neighbourDefault()); f_acTriggerEvent(m_startBeaconing(m_beaconHeader(f_getPosition(vc_componentName)).beaconHeader)); f_sleepIgnoreDef(PX_NEIGHBOUR_DISCOVERY_DELAY); - } // end f_startBeingNeighbour + } // End of function f_startBeingNeighbour /** * @desc Makes the simulated ITS node behave as not being a neighbour of IUT @@ -799,7 +799,7 @@ module LibItsGeoNetworking_Functions { if (PICS_GN_SECURITY == true) { deactivate(vc_neighbourDefault); } - } // end f_stopBeingNeighbour + } // End of function f_stopBeingNeighbour /** * @desc Initialise secure mode if required @@ -834,7 +834,7 @@ module LibItsGeoNetworking_Functions { } } // End of function f_uninitialiseSecuredMode() - } // end geoConfigurationFunctions + } // End of group geoConfigurationFunctions group componentFunctions { /** @@ -1201,7 +1201,7 @@ module LibItsGeoNetworking_Functions { return fx_computeDistance(p_pointA.latitude, p_pointA.longitude, p_pointB.latitude, p_pointB.longitude); } - } // end geoPositionFunctions + } // End of group geoPositionFunctions group geoAltsteps { @@ -1397,7 +1397,7 @@ module LibItsGeoNetworking_Functions { [vc_gnDefaultActive] a_receiveGeoUnicast(?, ?) {} } - } // end geoGeoUnicastAltsteps + } // End of group geoGeoUnicastAltsteps group geoGeoBroadcastAltsteps { @@ -1466,7 +1466,7 @@ module LibItsGeoNetworking_Functions { } } - } // end geoGeoBroadcastAltsteps + } // End of group geoGeoBroadcastAltsteps group geoGeoAnycastAltsteps { @@ -1537,7 +1537,7 @@ module LibItsGeoNetworking_Functions { } } - } // end geoGeoAnycastAltsteps + } // End of group geoGeoAnycastAltsteps group geoLocationServiceAltsteps { @@ -1610,10 +1610,10 @@ module LibItsGeoNetworking_Functions { } } - } // end geoLocationServiceAltsteps + } // End of group geoLocationServiceAltsteps - } // end geoAltsteps + } // End of group geoAltsteps group preambles { @@ -1739,7 +1739,7 @@ module LibItsGeoNetworking_Functions { return v_ret; } - } // end preambles + } // End of group preambles group postambles { @@ -1758,7 +1758,7 @@ module LibItsGeoNetworking_Functions { f_poDefault(); } - } // end postambles + } // End of group postambles group adapterControl { @@ -1918,7 +1918,7 @@ module LibItsGeoNetworking_Functions { if (PX_GNSS_SCENARIO_SUPPORT==true) { f_acTriggerGnssEvent(m_loadScenario(p_scenario)); } - } // end f_acLoadScenario + } // End of function f_acLoadScenario /** * @desc Starts a loaded scenario @@ -1929,7 +1929,7 @@ module LibItsGeoNetworking_Functions { f_acTriggerGnssEvent(m_startScenario); vc_scenarioStarted := true; } - } // end f_acStartScenario + } // End of function f_acStartScenario /** * @desc Stops a loaded scenario @@ -1940,7 +1940,7 @@ module LibItsGeoNetworking_Functions { f_acTriggerGnssEvent(m_stopScenario); vc_scenarioStarted := false; } - } // end f_acStopScenario + } // End of function f_acStopScenario function f_acAwaitTimeInRunningScenario(integer p_time) runs on ItsBaseGeoNetworking return FncRetCode { var FncRetCode v_ret := e_success; @@ -1966,9 +1966,9 @@ module LibItsGeoNetworking_Functions { } return v_ret; - } // end f_acAwaitTimeInRunningScenario + } // End of function f_acAwaitTimeInRunningScenario - } // end adapterControl + } // End of group adapterControl group commonFunctions { @@ -2009,7 +2009,7 @@ module LibItsGeoNetworking_Functions { return v_timestamp; } - } // end commonFunctions + } // End of group commonFunctions group testerFunctions { @@ -2120,7 +2120,7 @@ module LibItsGeoNetworking_Functions { return PX_MESSAGE_COUNT; } - } // end testerFunctions + } // End of group testerFunctions group iutFunctions { @@ -2155,19 +2155,19 @@ module LibItsGeoNetworking_Functions { /** * @desc Gets the GeoUnicast forwarding algorithm * @return IUT's GeoUnicast forwarding algorithm - * @see PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM + * @see PICS_GN_NON_AREA_FORWARDING_ALGORITHM */ - function f_getGeoUnicastForwardingAlgorithm() return GeoUnicastForwardingAlgorithm { - return PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM; + function f_getNonAreaForwardingAlgorithm() return NonAreaForwardingAlgorithm { + return PICS_GN_NON_AREA_FORWARDING_ALGORITHM; } /** * @desc Gets the GeoBroadcast forwarding algorithm * @return IUT's GeoBroadcast forwarding algorithm - * @see PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM + * @see PICS_GN_AREA_FORWARDING_ALGORITHM */ - function f_getGeoBroadcastForwardingAlgorithm() return GeoBroadcastForwardingAlgorithm { - return PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM; + function f_getAreaForwardingAlgorithm() return AreaForwardingAlgorithm { + return PICS_GN_AREA_FORWARDING_ALGORITHM; } /** @@ -2288,7 +2288,7 @@ module LibItsGeoNetworking_Functions { var integer v_itsGnLocationServicePacketBufferSize := PICS_GN_LOCATION_SERVICE_PACKET_BUFFER_SIZE; return v_itsGnLocationServicePacketBufferSize; - } // end f_getLsPacketBufferSize + } // End of function f_getLsPacketBufferSize /** * @desc Gets the UC forwarding packet buffer size. @@ -2299,7 +2299,7 @@ module LibItsGeoNetworking_Functions { var integer v_itsGnUcForwardingPacketBufferSize := PICS_GN_UC_FORWARDING_PACKET_BUFFER_SIZE; return v_itsGnUcForwardingPacketBufferSize * 1024; - } // end f_getUcForwardingPacketBufferSize + } // End of function f_getUcForwardingPacketBufferSize /** * @desc Gets the BC forwarding packet buffer size. @@ -2310,7 +2310,7 @@ module LibItsGeoNetworking_Functions { var integer v_itsGnBcForwardingPacketBufferSize := PICS_GN_BC_FORWARDING_PACKET_BUFFER_SIZE; return v_itsGnBcForwardingPacketBufferSize * 1024; - } // end f_getBcForwardingPacketBufferSize + } // End of function f_getBcForwardingPacketBufferSize /** * @desc Gets the maximum lifetime of a packet. @@ -2392,7 +2392,7 @@ module LibItsGeoNetworking_Functions { var float v_itsGnLifetimeLocTableEntry := int2float(PICS_GN_LIFETIME_LOC_TE); return v_itsGnLifetimeLocTableEntry; - } // end f_getLifetimeLocTableEntry + } // End of function f_getLifetimeLocTableEntry /** * @desc Gets the maximum communication range for CBF algorithm @@ -2403,37 +2403,25 @@ module LibItsGeoNetworking_Functions { var integer v_maxCommunicationRange := PICS_GN_DEFAULT_MAX_COMMUNICATION_RANGE; return v_maxCommunicationRange; - } // end f_getCbfMaxCommunicationRange + } // End of function f_getCbfMaxCommunicationRange - function f_getGeoUnicastCbfMaxTime() return integer { - var integer v_cbfMaxTime := PICS_GN_GEOUNICAST_CBF_MAX_TIME; + function f_getCbfMaxTime() return integer { + var integer v_cbfMaxTime := PICS_GN_CBF_MAX_TIME; - return v_cbfMaxTime; - } // end f_getGeoUnicastCbfMaxTime + return v_cbfMaxTime; + } // End of function f_getCbfMaxTime - function f_getGeoUnicastCbfMinTime() return integer { - var integer v_cbfMinTime := PICS_GN_GEOUNICAST_CBF_MIN_TIME; + function f_getCbfMinTime() return integer { + var integer v_cbfMinTime := PICS_GN_CBF_MIN_TIME; - return v_cbfMinTime; - } // end f_getGeoUnicastCbfMinTime - - function f_getGeoBroadcastCbfMaxTime() return integer { - var integer v_cbfMaxTime := PICS_GN_GEOBROADCAST_CBF_MAX_TIME; - - return v_cbfMaxTime; - } // end f_getGeoBroadcastCbfMaxTime - - function f_getGeoBroadcastCbfMinTime() return integer { - var integer v_cbfMinTime := PICS_GN_GEOBROADCAST_CBF_MIN_TIME; - - return v_cbfMinTime; - } // end f_getGeoBroadcastCbfMinTime + return v_cbfMinTime; + } // End of function f_getCbfMinTime function f_getGnMaxAreaSize() return float { var float v_maxAreaSize := PICS_GN_MAX_GEO_AREA_SIZE; return v_maxAreaSize; - } // end f_getGnMaxAreaSize + } // End of function f_getGnMaxAreaSize function f_getAdvancedGbcForwardingMaxCounter() return integer { var integer v_maxCounter := PICS_GN_ADVANCED_BC_FORWARDING_MAX_COUNTER; @@ -2450,7 +2438,7 @@ module LibItsGeoNetworking_Functions { f_acStartBeaconingMultipleNeighbour(v_nrNeighbour); - } // end f_setNrNeighbourLocTableDefault + } // End of function f_setNrNeighbourLocTableDefault /** * @desc Set the number of neighbour in the Location Table (medium). @@ -2462,7 +2450,7 @@ module LibItsGeoNetworking_Functions { f_acStartBeaconingMultipleNeighbour(v_nrNeighbour); - } // end f_setNrNeighbourLocTableMedium + } // End of function f_setNrNeighbourLocTableMedium /** * @desc Set the number of neighbour in the Location Table (maximum). @@ -2474,9 +2462,9 @@ module LibItsGeoNetworking_Functions { f_acStartBeaconingMultipleNeighbour(v_nrNeighbour); - } // end f_setNrNeighbourLocTableMaximum + } // End of function f_setNrNeighbourLocTableMaximum - } // end iutFunctions + } // End of group iutFunctions group posVectorFunctions { @@ -2539,7 +2527,7 @@ module LibItsGeoNetworking_Functions { return v_result; } - } // end posVectorFunctions + } // End of group posVectorFunctions group externalFunctions { @@ -2594,7 +2582,7 @@ module LibItsGeoNetworking_Functions { ) { // Nothing to do } - } // End of altstep a_securedMessageWithCertificate + } // End of 'altstep' a_securedMessageWithCertificate /** * @desc Receive GN message with security containing digest as a signer info @@ -2652,9 +2640,9 @@ module LibItsGeoNetworking_Functions { * @desc Ask for the certificate chain and wait for GN message with security containing certificate chain as a signer info * @return the certificate chain used for sign received message */ - function f_askForCertificateChain (in template(value) octetstring p_CamPayload) - runs on ItsGeoNetworking - return boolean { + function f_askForCertificateChain( + in template(value) octetstring p_CamPayload + ) runs on ItsGeoNetworking return boolean { var EtsiTs103097Data v_recv; var boolean v_ret := false; @@ -2772,7 +2760,7 @@ module LibItsGeoNetworking_Functions { m_geoNwSecPdu( v_gnNonSecuredPacket, v_securedMessage - ) // End of template m_geoNwSecPdu + ) )); // End of template m_geoNwReq_linkLayerBroadcast // Send Message @@ -2834,11 +2822,12 @@ module LibItsGeoNetworking_Functions { * @param p_msg GeoNetworking packet * @return the EtsiTs103097Data if any */ - function f_getSecuredMessage(in GeoNetworkingPdu p_msg) - return EtsiTs103097Data { + function f_getSecuredMessage( + in GeoNetworkingPdu p_msg + ) return EtsiTs103097Data { return p_msg.gnPacket.securedMsg; } } -} // end LibItsGeoNetworking_Functions +} // End of module LibItsGeoNetworking_Functions diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Pics.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Pics.ttcn index 44d39750..716a43ca 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Pics.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Pics.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/GeoNetworking/LibItsGeoNetworking_Pics.ttcn $ - * $Id: LibItsGeoNetworking_Pics.ttcn,v 1.4 2018/05/31 15:57:10 dte Exp $ + * @version $URL$ + * $Id$ * @desc GeoNetworking PICS * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. @@ -23,7 +23,7 @@ module LibItsGeoNetworking_Pics { /** * @desc GeoNetworking address of the GeoAdhoc router - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar GN_Address PICS_GN_LOCAL_GN_ADDR := { typeOfAddress := e_manual, @@ -34,43 +34,43 @@ module LibItsGeoNetworking_Pics { /** * @desc Is address manually configured - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar GnAddressConfigurationMethod PICS_GN_LOCAL_ADDR_CONF_METHOD := e_anonymous; /** * @desc Is the IUT mobile? - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar boolean PICS_GN_IS_MOBILE := true; /** * @desc Minimum update frequency of local position vector (LPV) in ms - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar integer PICS_GN_MINIMUM_UPDATE_FREQUENCY_LPV := 1000; /** * @desc Maximum size of GN-SDU [bytes] - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar integer PICS_GN_MAX_SDU_SIZE := 1398; /** * @desc GN_MAX: Maximum size of GeoNetworking header [bytes] - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar integer PICS_GN_MAX_GN_HEADER_SIZE := 88; /** * @desc Lifetime of location table entry [s] - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar integer PICS_GN_LIFETIME_LOC_TE := 20; /** * @desc GN Security support enabled or disabled - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 * @remark This PIC is different than PICS_IS_IUT_SECURED. * When set to true, this PIC indicates that the GeoNetworking is running with security ATS * UtInitialse shall indicate which certificate the IUT shall use @@ -79,271 +79,289 @@ module LibItsGeoNetworking_Pics { /** * @desc Maximum number of retransmissions of LS_REQUEST packets - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar integer PICS_GN_LOCATION_SERVICE_MAX_RETRANS := 10; /** * @desc Duration of Location service retransmit timer [ms] - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar integer PICS_GN_LOCATION_SERVICE_RETRANSMIT_TIMER := 1000; /** * @desc Size of Location service packet buffer [Byte] - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar integer PICS_GN_LOCATION_SERVICE_PACKET_BUFFER_SIZE := 1024; /** * @desc Duration of Beacon service retransmit timer [ms] - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar integer PICS_GN_BEACON_SERVICE_RETRANSMIT_TIMER := 3000; /** * @desc Maximum beacon jitter [ms] - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar integer PICS_GN_BEACON_SERVICE_MAX_JITTER := 750; /** * @desc Default hop limit indicating the maximum number of hops a packet travels - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar UInt8 PICS_GN_DEFAULT_HOP_LIMIT := 10; /** * @desc Upper limit of the maximum lifetime [s] - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar integer PICS_GN_MAX_PACKET_LIFETIME := 600; /** * @desc Lower limit of the packet repetition interval [km^2] - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar float PICS_GN_MAX_GEO_AREA_SIZE:= 10.0; /** * @desc Lower limit of the packet repetition interval [ms] - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar integer PICS_GN_MIN_PACKET_REPETITION_INTERVAL := 100; /** - * @desc Default GeoUnicast forwarding algorithm - * @see ETSI TS 102 871-2 Table 4 + * @desc Default NON-AREA forwarding algorithm + * @see ETSI TS 102 871-1 Table 1 */ - modulepar GeoUnicastForwardingAlgorithm PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM := e_greedy; + modulepar NonAreaForwardingAlgorithm PICS_GN_NON_AREA_FORWARDING_ALGORITHM := e_greedy; /** - * @desc Default GeoBroadcast forwarding algorithm - * @see ETSI TS 102 871-2 Table 4 + * @desc Default AREA forwarding algorithm + * @see ETSI TS 102 871-1 Table 1 */ - modulepar GeoBroadcastForwardingAlgorithm PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM := e_advanced; + modulepar AreaForwardingAlgorithm PICS_GN_AREA_FORWARDING_ALGORITHM := e_cbf; /** - * @desc Minimum duration a GUC shall be buffered in the CBF packet buffer [ms] - * @see ETSI TS 102 871-2 Table 4 + * @desc Minimum duration a packet shall be buffered in the CBF packet buffer [ms] + * @see ETSI TS 102 871-1 Table 1 */ - modulepar integer PICS_GN_GEOUNICAST_CBF_MIN_TIME := 1; + modulepar integer PICS_GN_CBF_MIN_TIME := 1; /** - * @desc Maximum duration a GUC shall be buffered in the CBF packet buffer [ms] - * @see ETSI TS 102 871-2 Table 4 + * @desc Maximum duration a packet shall be buffered in the CBF packet buffer [ms] + * @see ETSI TS 102 871-1 Table 1 */ - modulepar integer PICS_GN_GEOUNICAST_CBF_MAX_TIME := 100; + modulepar integer PICS_GN_CBF_MAX_TIME := 100; - /** - * @desc Minimum duration a GBC shall be buffered in the CBF packet buffer [ms] - * @see ETSI TS 102 871-2 Table 4 - */ - modulepar integer PICS_GN_GEOBROADCAST_CBF_MIN_TIME := 1; - - /** - * @desc Maximum duration a GBC shall be buffered in the CBF packet buffer [ms] - * @see ETSI TS 102 871-2 Table 4 - */ - modulepar integer PICS_GN_GEOBROADCAST_CBF_MAX_TIME := 100; - /** * @desc Default theoretical maximum communication range [m] - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar integer PICS_GN_DEFAULT_MAX_COMMUNICATION_RANGE := 1000; /** * @desc Size of UC forwarding packet buffer [Kbytes] - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar integer PICS_GN_UC_FORWARDING_PACKET_BUFFER_SIZE := 256; /** * @desc Size of BC forwarding packet buffer [Kbytes] - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar integer PICS_GN_BC_FORWARDING_PACKET_BUFFER_SIZE := 1024; /** * @desc Support for Basic header - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar boolean PICS_GN_BASIC_HEADER := true; /** * @desc Support for Common header - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar boolean PICS_GN_COMMON_HEADER := true; /** * @desc Support for Beacon source operations - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar boolean PICS_GN_BEACON_SRC := true; /** * @desc Support for Beacon destination operations - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar boolean PICS_GN_BEACON_DST := true; + /** + * @desc Support for GUC operations + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_GUC := true; + /** * @desc Support for GUC source operations - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar boolean PICS_GN_GUC_SRC := true; /** * @desc Support for GUC destination operations - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar boolean PICS_GN_GUC_DST := true; /** * @desc Support for GUC forwarding - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar boolean PICS_GN_GUC_FWD := true; + /** + * @desc Support for GBC operations + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_GBC := true; + /** * @desc Support for GBC source operations - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar boolean PICS_GN_GBC_SRC := true; /** * @desc Support for GBC destination operations - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar boolean PICS_GN_GBC_DST := true; /** * @desc Support for GBC forwarding - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar boolean PICS_GN_GBC_FWD := true; + /** + * @desc Support for GAC operations + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_GAC := true; + /** * @desc Support for GAC source operations - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar boolean PICS_GN_GAC_SRC := true; /** * @desc Support for GAC destination operations - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar boolean PICS_GN_GAC_DST := true; /** * @desc Support for GAC forwarding - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar boolean PICS_GN_GAC_FWD := true; + /** + * @desc Support for SHB operations + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_SHB := true; + /** * @desc Support for SHB source operations - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar boolean PICS_GN_SHB_SRC := true; /** * @desc Support for SHB destination operations - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar boolean PICS_GN_SHB_DST := true; + /** + * @desc Support for TSB operations + * @see ETSI TS 102 871-1 Table 1 + */ + modulepar boolean PICS_GN_TSB := true; + /** * @desc Support for TSB source operations - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar boolean PICS_GN_TSB_SRC := true; /** * @desc Support for TSB destination operations - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar boolean PICS_GN_TSB_DST := true; /** * @desc Support for TSB forwarding - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar boolean PICS_GN_TSB_FWD := true; /** * @desc Support for LS Request source operations - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar boolean PICS_GN_LS_REQ_SRC := true; /** * @desc Support for LS Request retransmission - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar boolean PICS_GN_LS_REQ_RETRANSMISSION := true; /** * @desc Support for LS Request destination operations - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar boolean PICS_GN_LS_REQ_DST := true; /** * @desc Support for LS Reply destination operations - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar boolean PICS_GN_LS_REP_DST := true; /** * @desc Support for LS forwarding - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar boolean PICS_GN_LS_FWD := true; /** * @desc Support for automatic address - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar boolean PICS_GN_ADDR_AUTO := true; /** * @desc Support for Managed address - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar boolean PICS_GN_ADDR_MANAGED := true; /** * @desc Support for Anonymous address - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar boolean PICS_GN_ADDR_ANONYMOUS := true; /** * @desc Support for DAD - * @see ETSI TS 102 871-2 Table 4 + * @see ETSI TS 102 871-1 Table 1 */ modulepar boolean PICS_GN_DAD := true; @@ -368,4 +386,4 @@ module LibItsGeoNetworking_Pics { */ modulepar boolean PICS_IS_IUT_SECURED := false; -} // end LibItsGeoNetworking_Pics \ No newline at end of file +} // End of module LibItsGeoNetworking_Pics diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn index aadc30dd..b52d18af 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn @@ -881,7 +881,7 @@ module LibItsGeoNetworking_TypesAndValues { /** * @desc The GeoUnicast forwarding algorithm. */ - type enumerated GeoUnicastForwardingAlgorithm { + type enumerated NonAreaForwardingAlgorithm { e_unspecified(0), e_greedy(1), e_cbf(2) @@ -890,7 +890,7 @@ module LibItsGeoNetworking_TypesAndValues { /** * @desc The GeoBroadcast forwarding algorithm. */ - type enumerated GeoBroadcastForwardingAlgorithm { + type enumerated AreaForwardingAlgorithm { e_unspecified(0), e_simple(1), e_cbf(2), -- GitLab From 8fb3758701b5268c91b21bf87a1f68ae4387a108 Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Thu, 25 Jun 2020 16:06:48 +0200 Subject: [PATCH 244/320] Bug report from MEC-NFV plugtest --- ttcn/Http/LibItsHttp_Functions.ttcn | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ttcn/Http/LibItsHttp_Functions.ttcn b/ttcn/Http/LibItsHttp_Functions.ttcn index 0761d7c5..a2a70803 100644 --- a/ttcn/Http/LibItsHttp_Functions.ttcn +++ b/ttcn/Http/LibItsHttp_Functions.ttcn @@ -92,10 +92,11 @@ module LibItsHttp_Functions { p_headers[v_jdx].header_value := { p_headers_value[v_idx] }; // NOTE Codec won't encode it break; } - if (v_jdx == lengthof(p_headers)) { - p_headers[v_jdx].header_value := { p_headers_value[v_jdx] }; - } } // End of 'for' statement + if (v_jdx == lengthof(p_headers)) { + p_headers[v_jdx].header_name := p_headers_to_set[v_idx]; + p_headers[v_jdx].header_value := { p_headers_value[v_idx] }; + } } // End of 'for' statement } // End of function f_set_headers_list -- GitLab From 5d19fb4603b8895d36b6fd2531a9a957790ade2b Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Thu, 2 Jul 2020 15:13:23 +0200 Subject: [PATCH 245/320] Add send templates for DC behavior --- ttcn/Pki/LibItsPki_Functions.ttcn | 58 +++++++++++++++++++++++--- ttcn/Pki/LibItsPki_Templates.ttcn | 58 +++++++++++++++++++++++++- ttcn/Pki/LibItsPki_TypesAndValues.ttcn | 7 +++- 3 files changed, 116 insertions(+), 7 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 756af4f3..61526783 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -2940,6 +2940,52 @@ module LibItsPki_Functions { } // End of group authorization_validation_xxx + group dc { + + function f_build_dc_ctl( + in charstring p_ea_certificate_id, + in charstring p_aa_certificate_id, + in charstring p_rca_certificate_id + ) { + // Local variables + var EtsiTs103097Certificate v_ea_certificate; + var EtsiTs103097Certificate v_aa_certificate; + var EtsiTs103097Certificate v_rca_certificate; + var CtlCommands v_ctl_commands; + var ToBeSignedRcaCtl v_to_be_signed_rca_ctl; + var EtsiTs102941Data v_etsi_ts_102941_data; + var octetstring p_pki_message; + var ToBeSignedData v_tbs; + + // Load certificates + f_readCertificate(p_ea_certificate_id, v_ea_certificate); + f_readCertificate(p_aa_certificate_id, v_aa_certificate); + f_readCertificate(p_rca_certificate_id, v_rca_certificate); + // Create ctrlCommnand list + v_ctl_commands := { + { add := { rca := valueof(m_root_ca_entry(v_rca_certificate)) } }, + { add := { aa := valueof(m_aa_entry(v_aa_certificate, "http://www.etsi.org")) } }, + { add := { ea := valueof(m_ea_entry(v_ea_certificate, "http://www.etsi.org")) } } + }; + // Build the main data structure + v_to_be_signed_rca_ctl := valueof(m_to_be_signed_rca_full_ctl(1000, 1, v_ctl_commands)); + // Encode the main data structure + v_etsi_ts_102941_data := valueof(m_etsiTs102941Data_to_be_signed_rca_ctl(v_to_be_signed_rca_ctl)); + p_pki_message := bit2oct(encvalue(v_etsi_ts_102941_data)); + // Signed the encoded PKI message + v_tbs := valueof( + m_toBeSignedData( + m_signedDataPayload( + m_etsiTs103097Data_unsecured(p_pki_message) + ), + m_headerInfo_inner_pki_response(-, (f_getCurrentTime() * 1000)/*us*/) + ) + ); + + } // End of function f_build_dc_ctl + + } // End of group dc + group rca { function f_verify_rca_ctl_response_message( @@ -2951,7 +2997,7 @@ module LibItsPki_Functions { var bitstring v_tbs; var Certificate v_certificate; var charstring v_certificate_id; - var Oct32 v_issuer; + var octetstring v_issuer; var EtsiTs102941Data v_etsi_ts_102941_data; log(">>> f_verify_rca_ctl_response_message: p_ieee1609dot2_signed_data= ", p_ieee1609dot2_signed_data); @@ -2964,8 +3010,9 @@ module LibItsPki_Functions { return false; } } - f_getCertificateHash256(v_certificate_id, v_issuer); + f_getCertificateHash(v_certificate_id, v_issuer); if (f_verifyEcdsa(bit2oct(v_tbs), v_issuer, p_ieee1609dot2_signed_data.content.signedData.signature_, v_certificate.toBeSigned.verifyKeyIndicator.verificationKey) == false) { + log("f_verify_rca_ctl_response_message: Failed to verify signature"); if (p_check_security == true) { return false; } @@ -3002,7 +3049,7 @@ module LibItsPki_Functions { var bitstring v_tbs; var Certificate v_certificate; var charstring v_certificate_id; - var Oct32 v_issuer; + var octetstring v_issuer; var EtsiTs102941Data v_etsi_ts_102941_data; log(">>> f_verify_rca_crl_response_message: p_ieee1609dot2_signed_data= ", p_ieee1609dot2_signed_data); @@ -3015,8 +3062,9 @@ module LibItsPki_Functions { return false; } } - f_getCertificateHash256(v_certificate_id, v_issuer); + f_getCertificateHash(v_certificate_id, v_issuer); if (f_verifyEcdsa(bit2oct(v_tbs), v_issuer, p_ieee1609dot2_signed_data.content.signedData.signature_, v_certificate.toBeSigned.verifyKeyIndicator.verificationKey) == false) { + log("f_verify_rca_crl_response_message: Failed to verify signature"); if (p_check_security == true) { return false; } @@ -3853,7 +3901,7 @@ module LibItsPki_Functions { m_etsiTs103097Data_unsecured(p_pki_message) ), m_headerInfo_inner_pki_response(-, (f_getCurrentTime() * 1000)/*us*/) - ); + ); if (ischosen(p_signer_identifier.self_)) { v_tbs_signed := f_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), int2oct(0, 32), p_private_key); } else { diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn index 285c0f8f..2839ba6d 100644 --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ b/ttcn/Pki/LibItsPki_Templates.ttcn @@ -151,6 +151,15 @@ module LibItsPki_Templates { ) modifies mw_etsiTs103097Data_encrypted := { } // End of template mw_authorizationResponseMessage + template (value) EtsiTs102941Data m_etsiTs102941Data_to_be_signed_rca_ctl( + in template (value) ToBeSignedRcaCtl p_to_be_signed_rca_ctl + ) := { + version := PkiProtocolVersion, + content := { + certificateTrustListRca := p_to_be_signed_rca_ctl + } + } // End of template m_etsiTs102941Data_to_be_signed_rca_ctl + template (present) EtsiTs102941Data mw_etsiTs102941Data_to_be_signed_rca_ctl( template (present) ToBeSignedRcaCtl p_to_be_signed_rca_ctl := ? ) := { @@ -548,6 +557,18 @@ module LibItsPki_Templates { certIssuePermissions := p_certIssuePermissions } // End of template mw_certificate_subject_attributes + template (value) ToBeSignedRcaCtl m_to_be_signed_rca_full_ctl( + in Time32 p_next_update, + in UInt8 p_ctl_sequence, + in CtlCommands p_ctl_commands +) := { + version := 1, + nextUpdate := p_next_update, + isFullCtl := true, + ctlSequence := p_ctl_sequence, + ctlCommands := p_ctl_commands + } // End of template m_to_be_signed_rca_ful_ctl + template (present) ToBeSignedRcaCtl mw_to_be_signed_rca_full_ctl := { version := 1, nextUpdate := ?, @@ -564,6 +585,17 @@ module LibItsPki_Templates { ctlCommands := ? } // End of template mw_to_be_signed_rca_delta_ctl + template (value) ToBeSignedCrl m_to_be_signed_crl( + in Time32 p_this_update, + in Time32 p_next_update, + in CrlEntries p_entries + ) := { + version := 1, + thisUpdate := p_this_update, + nextUpdate := p_next_update, + entries := p_entries + } // End of template m_to_be_signed_crl + template (present) ToBeSignedCrl mw_to_be_signed_crl := { version := 1, thisUpdate := ?, @@ -580,6 +612,13 @@ module LibItsPki_Templates { accessPoint := p_accessPoint } // End of template mw_tlm_entry + template (value) RootCaEntry m_root_ca_entry( + in template (value) EtsiTs103097Certificate p_selfsignedRootCa + ) := { + selfsignedRootCa := p_selfsignedRootCa, + linkRootCaCertificate := omit + } // End of template m_root_ca_entry + template (present) RootCaEntry mw_root_ca_entry( template (present) EtsiTs103097Certificate p_selfsignedRootCa := ? ) := { @@ -587,6 +626,15 @@ module LibItsPki_Templates { linkRootCaCertificate := * } // End of template mw_root_ca_entry + template (value) EaEntry m_ea_entry( + in template (value) EtsiTs103097Certificate p_eaCertificate, + in template (value) Url p_aaAccessPoint + ) := { + eaCertificate := p_eaCertificate, + aaAccessPoint := p_aaAccessPoint, + itsAccessPoint := omit + } // End of template m_ea_entry + template (present) EaEntry mw_ea_entry( template (present) EtsiTs103097Certificate p_eaCertificate := ?, template (present) Url p_aaAccessPoint := ? @@ -594,7 +642,15 @@ module LibItsPki_Templates { eaCertificate := p_eaCertificate, aaAccessPoint := p_aaAccessPoint, itsAccessPoint := * - } // End of linkRootCaCertificate mw_ea_entry + } // End of template mw_ea_entry + + template (value) AaEntry m_aa_entry( + in template (value) EtsiTs103097Certificate p_aaCertificate, + in template (value) Url p_accessPoint + ) := { + aaCertificate := p_aaCertificate, + accessPoint := p_accessPoint + } // End of template m_aa_entry template (present) AaEntry mw_aa_entry( template (present) EtsiTs103097Certificate p_aaCertificate := ?, diff --git a/ttcn/Pki/LibItsPki_TypesAndValues.ttcn b/ttcn/Pki/LibItsPki_TypesAndValues.ttcn index b1bc07e3..0266e6ce 100644 --- a/ttcn/Pki/LibItsPki_TypesAndValues.ttcn +++ b/ttcn/Pki/LibItsPki_TypesAndValues.ttcn @@ -17,6 +17,7 @@ module LibItsPki_TypesAndValues { // LibIts import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; + import from EtsiTs102941TrustLists language "ASN.1:1997" all; group constants { @@ -135,7 +136,11 @@ module LibItsPki_TypesAndValues { octetstring hashed_id8, EtsiTs103097Certificate at_certificate } // End of type InfoPortData - + + type record of CrlEntry CrlEntries; + + type record of CtlCommand CtlCommands; + } with { variant "" -- GitLab From 41d34340bc58d754f0c6fe6dfc2e60fc5e4fed87 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 2 Jul 2020 16:42:32 +0200 Subject: [PATCH 246/320] Align ASN.1 file with ETSI Forge ITS ASN.1 repository --- .../CAM/{CAM.asn => CAM-PDU-Descriptions.asn} | 262 ++--- .../{DENM.asn => DENM-PDU-Descriptions.asn} | 214 ++-- ...ptions.asn => EV-RSR-PDU-Descriptions.asn} | 2 +- ...iptions.asn => EVCSN-PDU-Descriptions.asn} | 2 +- .../{ITS_Container.asn => ITS-Container.asn} | 1014 +++++++++-------- asn1/Security/1609Dot2/IEEE1609dot2.asn | 6 +- .../1609Dot2/IEEE1609dot2BaseTypes.asn | 1 + asn1/Security/EtsiTs103097Module.asn | 6 +- .../TS102921/EtsiTs102941BaseTypes.asn | 34 +- .../TS102921/EtsiTs102941MessagesCA.asn | 14 +- ...iTs102941MessagesItss-OptionalPrivacy.asn} | 150 +-- .../TS102921/EtsiTs102941MessagesItss.asn | 10 +- .../TS102921/EtsiTs102941TrustLists.asn | 4 +- .../EtsiTs102941TypesAuthorization.asn | 14 +- ...siTs102941TypesAuthorizationValidation.asn | 16 +- .../EtsiTs102941TypesCaManagement.asn | 4 +- .../TS102921/EtsiTs102941TypesEnrolment.asn | 10 +- 17 files changed, 889 insertions(+), 874 deletions(-) rename asn1/CAM/{CAM.asn => CAM-PDU-Descriptions.asn} (96%) rename asn1/DENM/{DENM.asn => DENM-PDU-Descriptions.asn} (97%) rename asn1/EV-RSR/{EV_RechargingSpotReservation_PDU_Descriptions.asn => EV-RSR-PDU-Descriptions.asn} (99%) rename asn1/EVCSN/{EVCSN_PDU_Descriptions.asn => EVCSN-PDU-Descriptions.asn} (98%) rename asn1/ITS-Container/{ITS_Container.asn => ITS-Container.asn} (95%) rename asn1/Security/TS102921/{EtsiTs102941MessagesItss_OptionalPrivacy.asn => EtsiTs102941MessagesItss-OptionalPrivacy.asn} (92%) diff --git a/asn1/CAM/CAM.asn b/asn1/CAM/CAM-PDU-Descriptions.asn similarity index 96% rename from asn1/CAM/CAM.asn rename to asn1/CAM/CAM-PDU-Descriptions.asn index 13e1488a..a13a9fac 100644 --- a/asn1/CAM/CAM.asn +++ b/asn1/CAM/CAM-PDU-Descriptions.asn @@ -1,132 +1,132 @@ -CAM-PDU-Descriptions { -itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) en (302637) cam (2) version (2) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS -ItsPduHeader, CauseCode, ReferencePosition, AccelerationControl, Curvature, CurvatureCalculationMode, Heading, LanePosition, EmergencyPriority, EmbarkationStatus, Speed, DriveDirection, LongitudinalAcceleration, LateralAcceleration, VerticalAcceleration, StationType, ExteriorLights, DangerousGoodsBasic, SpecialTransportType, LightBarSirenInUse, VehicleRole, VehicleLength, VehicleWidth, PathHistory, RoadworksSubCauseCode, ClosedLanes, TrafficRule, SpeedLimit, SteeringWheelAngle, PerformanceClass, YawRate, ProtectedCommunicationZone, PtActivation, Latitude, Longitude, ProtectedCommunicationZonesRSU, CenDsrcTollingZone FROM ITS-Container { -itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) -}; - - --- The root data frame for cooperative awareness messages - -CAM ::= SEQUENCE { - header ItsPduHeader, - cam CoopAwareness -} - -CoopAwareness ::= SEQUENCE { - generationDeltaTime GenerationDeltaTime, - camParameters CamParameters -} - -CamParameters ::= SEQUENCE { - basicContainer BasicContainer, - highFrequencyContainer HighFrequencyContainer, - lowFrequencyContainer LowFrequencyContainer OPTIONAL, - specialVehicleContainer SpecialVehicleContainer OPTIONAL, - ... -} - -HighFrequencyContainer ::= CHOICE { - basicVehicleContainerHighFrequency BasicVehicleContainerHighFrequency, - rsuContainerHighFrequency RSUContainerHighFrequency, - ... -} - - LowFrequencyContainer ::= CHOICE { - basicVehicleContainerLowFrequency BasicVehicleContainerLowFrequency, - ... -} - -SpecialVehicleContainer ::= CHOICE { - publicTransportContainer PublicTransportContainer, - specialTransportContainer SpecialTransportContainer, - dangerousGoodsContainer DangerousGoodsContainer, - roadWorksContainerBasic RoadWorksContainerBasic, - rescueContainer RescueContainer, - emergencyContainer EmergencyContainer, - safetyCarContainer SafetyCarContainer, - ... -} - -BasicContainer ::= SEQUENCE { - stationType StationType, - referencePosition ReferencePosition, - ... -} - -BasicVehicleContainerHighFrequency ::= SEQUENCE { - heading Heading, - speed Speed, - driveDirection DriveDirection, - vehicleLength VehicleLength, - vehicleWidth VehicleWidth, - longitudinalAcceleration LongitudinalAcceleration, - curvature Curvature, - curvatureCalculationMode CurvatureCalculationMode, - yawRate YawRate, - accelerationControl AccelerationControl OPTIONAL, - lanePosition LanePosition OPTIONAL, - steeringWheelAngle SteeringWheelAngle OPTIONAL, - lateralAcceleration LateralAcceleration OPTIONAL, - verticalAcceleration VerticalAcceleration OPTIONAL, - performanceClass PerformanceClass OPTIONAL, - cenDsrcTollingZone CenDsrcTollingZone OPTIONAL -} - -BasicVehicleContainerLowFrequency ::= SEQUENCE { - vehicleRole VehicleRole, - exteriorLights ExteriorLights, - pathHistory PathHistory -} - -PublicTransportContainer ::= SEQUENCE { - embarkationStatus EmbarkationStatus, - ptActivation PtActivation OPTIONAL -} - -SpecialTransportContainer ::= SEQUENCE { - specialTransportType SpecialTransportType, - lightBarSirenInUse LightBarSirenInUse -} - - DangerousGoodsContainer ::= SEQUENCE { - dangerousGoodsBasic DangerousGoodsBasic - } - - RoadWorksContainerBasic ::= SEQUENCE { - roadworksSubCauseCode RoadworksSubCauseCode OPTIONAL, - lightBarSirenInUse LightBarSirenInUse, - closedLanes ClosedLanes OPTIONAL - } - -RescueContainer ::= SEQUENCE { - lightBarSirenInUse LightBarSirenInUse -} - -EmergencyContainer ::= SEQUENCE { - lightBarSirenInUse LightBarSirenInUse, - incidentIndication CauseCode OPTIONAL, - emergencyPriority EmergencyPriority OPTIONAL -} - -SafetyCarContainer ::= SEQUENCE { - lightBarSirenInUse LightBarSirenInUse, - incidentIndication CauseCode OPTIONAL, - trafficRule TrafficRule OPTIONAL, - speedLimit SpeedLimit OPTIONAL -} - -RSUContainerHighFrequency ::= SEQUENCE { - protectedCommunicationZonesRSU ProtectedCommunicationZonesRSU OPTIONAL, - ... -} - -GenerationDeltaTime ::= INTEGER { oneMilliSec(1) } (0..65535) - +CAM-PDU-Descriptions { +itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) en (302637) cam (2) version (2) +} + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +IMPORTS +ItsPduHeader, CauseCode, ReferencePosition, AccelerationControl, Curvature, CurvatureCalculationMode, Heading, LanePosition, EmergencyPriority, EmbarkationStatus, Speed, DriveDirection, LongitudinalAcceleration, LateralAcceleration, VerticalAcceleration, StationType, ExteriorLights, DangerousGoodsBasic, SpecialTransportType, LightBarSirenInUse, VehicleRole, VehicleLength, VehicleWidth, PathHistory, RoadworksSubCauseCode, ClosedLanes, TrafficRule, SpeedLimit, SteeringWheelAngle, PerformanceClass, YawRate, ProtectedCommunicationZone, PtActivation, Latitude, Longitude, ProtectedCommunicationZonesRSU, CenDsrcTollingZone FROM ITS-Container { +itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) +}; + + +-- The root data frame for cooperative awareness messages + +CAM ::= SEQUENCE { + header ItsPduHeader, + cam CoopAwareness +} + +CoopAwareness ::= SEQUENCE { + generationDeltaTime GenerationDeltaTime, + camParameters CamParameters +} + +CamParameters ::= SEQUENCE { + basicContainer BasicContainer, + highFrequencyContainer HighFrequencyContainer, + lowFrequencyContainer LowFrequencyContainer OPTIONAL, + specialVehicleContainer SpecialVehicleContainer OPTIONAL, + ... +} + +HighFrequencyContainer ::= CHOICE { + basicVehicleContainerHighFrequency BasicVehicleContainerHighFrequency, + rsuContainerHighFrequency RSUContainerHighFrequency, + ... +} + + LowFrequencyContainer ::= CHOICE { + basicVehicleContainerLowFrequency BasicVehicleContainerLowFrequency, + ... +} + +SpecialVehicleContainer ::= CHOICE { + publicTransportContainer PublicTransportContainer, + specialTransportContainer SpecialTransportContainer, + dangerousGoodsContainer DangerousGoodsContainer, + roadWorksContainerBasic RoadWorksContainerBasic, + rescueContainer RescueContainer, + emergencyContainer EmergencyContainer, + safetyCarContainer SafetyCarContainer, + ... +} + +BasicContainer ::= SEQUENCE { + stationType StationType, + referencePosition ReferencePosition, + ... +} + +BasicVehicleContainerHighFrequency ::= SEQUENCE { + heading Heading, + speed Speed, + driveDirection DriveDirection, + vehicleLength VehicleLength, + vehicleWidth VehicleWidth, + longitudinalAcceleration LongitudinalAcceleration, + curvature Curvature, + curvatureCalculationMode CurvatureCalculationMode, + yawRate YawRate, + accelerationControl AccelerationControl OPTIONAL, + lanePosition LanePosition OPTIONAL, + steeringWheelAngle SteeringWheelAngle OPTIONAL, + lateralAcceleration LateralAcceleration OPTIONAL, + verticalAcceleration VerticalAcceleration OPTIONAL, + performanceClass PerformanceClass OPTIONAL, + cenDsrcTollingZone CenDsrcTollingZone OPTIONAL +} + +BasicVehicleContainerLowFrequency ::= SEQUENCE { + vehicleRole VehicleRole, + exteriorLights ExteriorLights, + pathHistory PathHistory +} + +PublicTransportContainer ::= SEQUENCE { + embarkationStatus EmbarkationStatus, + ptActivation PtActivation OPTIONAL +} + +SpecialTransportContainer ::= SEQUENCE { + specialTransportType SpecialTransportType, + lightBarSirenInUse LightBarSirenInUse +} + + DangerousGoodsContainer ::= SEQUENCE { + dangerousGoodsBasic DangerousGoodsBasic + } + + RoadWorksContainerBasic ::= SEQUENCE { + roadworksSubCauseCode RoadworksSubCauseCode OPTIONAL, + lightBarSirenInUse LightBarSirenInUse, + closedLanes ClosedLanes OPTIONAL + } + +RescueContainer ::= SEQUENCE { + lightBarSirenInUse LightBarSirenInUse +} + +EmergencyContainer ::= SEQUENCE { + lightBarSirenInUse LightBarSirenInUse, + incidentIndication CauseCode OPTIONAL, + emergencyPriority EmergencyPriority OPTIONAL +} + +SafetyCarContainer ::= SEQUENCE { + lightBarSirenInUse LightBarSirenInUse, + incidentIndication CauseCode OPTIONAL, + trafficRule TrafficRule OPTIONAL, + speedLimit SpeedLimit OPTIONAL +} + +RSUContainerHighFrequency ::= SEQUENCE { + protectedCommunicationZonesRSU ProtectedCommunicationZonesRSU OPTIONAL, + ... +} + +GenerationDeltaTime ::= INTEGER { oneMilliSec(1) } (0..65535) + END \ No newline at end of file diff --git a/asn1/DENM/DENM.asn b/asn1/DENM/DENM-PDU-Descriptions.asn similarity index 97% rename from asn1/DENM/DENM.asn rename to asn1/DENM/DENM-PDU-Descriptions.asn index 8bfee2d1..fa4ea6d7 100644 --- a/asn1/DENM/DENM.asn +++ b/asn1/DENM/DENM-PDU-Descriptions.asn @@ -1,108 +1,108 @@ -DENM-PDU-Descriptions {itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) en (302637) denm (1) version (2) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS -ItsPduHeader, CauseCode, Speed, InformationQuality, ReferencePosition, ClosedLanes, DangerousGoodsExtended, Heading, LanePosition, LightBarSirenInUse, RoadType, HeightLonCarr, PosLonCarr, PosCentMass, PositioningSolutionType, RequestResponseIndication, StationType, SpeedLimit, StationarySince, TimestampIts, WheelBaseVehicle, TurningRadius, PosFrontAx, PositionOfOccupants, Temperature, VehicleMass, VehicleIdentification, EnergyStorageType, ActionID, ItineraryPath, NumberOfOccupants, PositionOfPillars, RelevanceTrafficDirection, RestrictedTypes, Traces, TransmissionInterval, ValidityDuration, RelevanceDistance, EventHistory, TrafficRule, DeltaReferencePosition FROM ITS-Container { -itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) -}; - - -DENM ::= SEQUENCE { - header ItsPduHeader, - denm DecentralizedEnvironmentalNotificationMessage -} - -DecentralizedEnvironmentalNotificationMessage ::= SEQUENCE { - management ManagementContainer, - situation SituationContainer OPTIONAL, - location LocationContainer OPTIONAL, - alacarte AlacarteContainer OPTIONAL -} - -ManagementContainer ::= SEQUENCE { - actionID ActionID, - detectionTime TimestampIts, - referenceTime TimestampIts, - termination Termination OPTIONAL, - eventPosition ReferencePosition, - relevanceDistance RelevanceDistance OPTIONAL, - relevanceTrafficDirection RelevanceTrafficDirection OPTIONAL, - validityDuration ValidityDuration DEFAULT defaultValidity, - transmissionInterval TransmissionInterval OPTIONAL, - stationType StationType, - ... -} - -SituationContainer ::= SEQUENCE { - informationQuality InformationQuality, - eventType CauseCode, - linkedCause CauseCode OPTIONAL, - eventHistory EventHistory OPTIONAL, - ... -} - -LocationContainer ::= SEQUENCE { - eventSpeed Speed OPTIONAL, - eventPositionHeading Heading OPTIONAL, - traces Traces, - roadType RoadType OPTIONAL, - ... -} - -ImpactReductionContainer ::= SEQUENCE { - heightLonCarrLeft HeightLonCarr, - heightLonCarrRight HeightLonCarr, - posLonCarrLeft PosLonCarr, - posLonCarrRight PosLonCarr, - positionOfPillars PositionOfPillars, - posCentMass PosCentMass, - wheelBaseVehicle WheelBaseVehicle, - turningRadius TurningRadius, - posFrontAx PosFrontAx, - positionOfOccupants PositionOfOccupants, - vehicleMass VehicleMass, - requestResponseIndication RequestResponseIndication -} - -RoadWorksContainerExtended ::= SEQUENCE { - lightBarSirenInUse LightBarSirenInUse OPTIONAL, - closedLanes ClosedLanes OPTIONAL, - restriction RestrictedTypes OPTIONAL, - speedLimit SpeedLimit OPTIONAL, - incidentIndication CauseCode OPTIONAL, - recommendedPath ItineraryPath OPTIONAL, - startingPointSpeedLimit DeltaReferencePosition OPTIONAL, - trafficFlowRule TrafficRule OPTIONAL, - referenceDenms ReferenceDenms OPTIONAL - } - -StationaryVehicleContainer ::= SEQUENCE { - stationarySince StationarySince OPTIONAL, - stationaryCause CauseCode OPTIONAL, - carryingDangerousGoods DangerousGoodsExtended OPTIONAL, - numberOfOccupants NumberOfOccupants OPTIONAL, - vehicleIdentification VehicleIdentification OPTIONAL, - energyStorageType EnergyStorageType OPTIONAL -} - -AlacarteContainer ::= SEQUENCE { - lanePosition LanePosition OPTIONAL, - impactReduction ImpactReductionContainer OPTIONAL, - externalTemperature Temperature OPTIONAL, - roadWorks RoadWorksContainerExtended OPTIONAL, - positioningSolution PositioningSolutionType OPTIONAL, - stationaryVehicle StationaryVehicleContainer OPTIONAL, - ... -} - -defaultValidity INTEGER ::= 600 - -Termination ::= ENUMERATED {isCancellation(0), isNegation (1)} - -ReferenceDenms ::= SEQUENCE (SIZE(1..8, ...)) OF ActionID - +DENM-PDU-Descriptions {itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) en (302637) denm (1) version (2) +} + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +IMPORTS +ItsPduHeader, CauseCode, Speed, InformationQuality, ReferencePosition, ClosedLanes, DangerousGoodsExtended, Heading, LanePosition, LightBarSirenInUse, RoadType, HeightLonCarr, PosLonCarr, PosCentMass, PositioningSolutionType, RequestResponseIndication, StationType, SpeedLimit, StationarySince, TimestampIts, WheelBaseVehicle, TurningRadius, PosFrontAx, PositionOfOccupants, Temperature, VehicleMass, VehicleIdentification, EnergyStorageType, ActionID, ItineraryPath, NumberOfOccupants, PositionOfPillars, RelevanceTrafficDirection, RestrictedTypes, Traces, TransmissionInterval, ValidityDuration, RelevanceDistance, EventHistory, TrafficRule, DeltaReferencePosition FROM ITS-Container { +itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) +}; + + +DENM ::= SEQUENCE { + header ItsPduHeader, + denm DecentralizedEnvironmentalNotificationMessage +} + +DecentralizedEnvironmentalNotificationMessage ::= SEQUENCE { + management ManagementContainer, + situation SituationContainer OPTIONAL, + location LocationContainer OPTIONAL, + alacarte AlacarteContainer OPTIONAL +} + +ManagementContainer ::= SEQUENCE { + actionID ActionID, + detectionTime TimestampIts, + referenceTime TimestampIts, + termination Termination OPTIONAL, + eventPosition ReferencePosition, + relevanceDistance RelevanceDistance OPTIONAL, + relevanceTrafficDirection RelevanceTrafficDirection OPTIONAL, + validityDuration ValidityDuration DEFAULT defaultValidity, + transmissionInterval TransmissionInterval OPTIONAL, + stationType StationType, + ... +} + +SituationContainer ::= SEQUENCE { + informationQuality InformationQuality, + eventType CauseCode, + linkedCause CauseCode OPTIONAL, + eventHistory EventHistory OPTIONAL, + ... +} + +LocationContainer ::= SEQUENCE { + eventSpeed Speed OPTIONAL, + eventPositionHeading Heading OPTIONAL, + traces Traces, + roadType RoadType OPTIONAL, + ... +} + +ImpactReductionContainer ::= SEQUENCE { + heightLonCarrLeft HeightLonCarr, + heightLonCarrRight HeightLonCarr, + posLonCarrLeft PosLonCarr, + posLonCarrRight PosLonCarr, + positionOfPillars PositionOfPillars, + posCentMass PosCentMass, + wheelBaseVehicle WheelBaseVehicle, + turningRadius TurningRadius, + posFrontAx PosFrontAx, + positionOfOccupants PositionOfOccupants, + vehicleMass VehicleMass, + requestResponseIndication RequestResponseIndication +} + +RoadWorksContainerExtended ::= SEQUENCE { + lightBarSirenInUse LightBarSirenInUse OPTIONAL, + closedLanes ClosedLanes OPTIONAL, + restriction RestrictedTypes OPTIONAL, + speedLimit SpeedLimit OPTIONAL, + incidentIndication CauseCode OPTIONAL, + recommendedPath ItineraryPath OPTIONAL, + startingPointSpeedLimit DeltaReferencePosition OPTIONAL, + trafficFlowRule TrafficRule OPTIONAL, + referenceDenms ReferenceDenms OPTIONAL + } + +StationaryVehicleContainer ::= SEQUENCE { + stationarySince StationarySince OPTIONAL, + stationaryCause CauseCode OPTIONAL, + carryingDangerousGoods DangerousGoodsExtended OPTIONAL, + numberOfOccupants NumberOfOccupants OPTIONAL, + vehicleIdentification VehicleIdentification OPTIONAL, + energyStorageType EnergyStorageType OPTIONAL +} + +AlacarteContainer ::= SEQUENCE { + lanePosition LanePosition OPTIONAL, + impactReduction ImpactReductionContainer OPTIONAL, + externalTemperature Temperature OPTIONAL, + roadWorks RoadWorksContainerExtended OPTIONAL, + positioningSolution PositioningSolutionType OPTIONAL, + stationaryVehicle StationaryVehicleContainer OPTIONAL, + ... +} + +defaultValidity INTEGER ::= 600 + +Termination ::= ENUMERATED {isCancellation(0), isNegation (1)} + +ReferenceDenms ::= SEQUENCE (SIZE(1..8, ...)) OF ActionID + END \ No newline at end of file diff --git a/asn1/EV-RSR/EV_RechargingSpotReservation_PDU_Descriptions.asn b/asn1/EV-RSR/EV-RSR-PDU-Descriptions.asn similarity index 99% rename from asn1/EV-RSR/EV_RechargingSpotReservation_PDU_Descriptions.asn rename to asn1/EV-RSR/EV-RSR-PDU-Descriptions.asn index 8a61a6e4..1455feed 100644 --- a/asn1/EV-RSR/EV_RechargingSpotReservation_PDU_Descriptions.asn +++ b/asn1/EV-RSR/EV-RSR-PDU-Descriptions.asn @@ -8,7 +8,7 @@ BEGIN IMPORTS ItsPduHeader FROM ITS-Container { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) + itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) }; EV-RSR ::= SEQUENCE { diff --git a/asn1/EVCSN/EVCSN_PDU_Descriptions.asn b/asn1/EVCSN/EVCSN-PDU-Descriptions.asn similarity index 98% rename from asn1/EVCSN/EVCSN_PDU_Descriptions.asn rename to asn1/EVCSN/EVCSN-PDU-Descriptions.asn index a8ffa3c6..b86fbb19 100644 --- a/asn1/EVCSN/EVCSN_PDU_Descriptions.asn +++ b/asn1/EVCSN/EVCSN-PDU-Descriptions.asn @@ -18,7 +18,7 @@ IMPORTS TimestampIts, ReferencePosition FROM ITS-Container { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) + itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) }; -- Root Message PDU: EvcsnPdu diff --git a/asn1/ITS-Container/ITS_Container.asn b/asn1/ITS-Container/ITS-Container.asn similarity index 95% rename from asn1/ITS-Container/ITS_Container.asn rename to asn1/ITS-Container/ITS-Container.asn index 39f66f5c..8b6874e0 100644 --- a/asn1/ITS-Container/ITS_Container.asn +++ b/asn1/ITS-Container/ITS-Container.asn @@ -1,506 +1,508 @@ -ITS-Container { -itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS; - -ItsPduHeader ::= SEQUENCE { - protocolVersion INTEGER (0..255), - messageID INTEGER{ denm(1), cam(2), poi(3), spatem(4), mapem(5), ivim(6), ev-rsr(7), tistpgtransaction(8), srem(9), ssem(10), evcsn(11), saem(12), rtcmem(13) } (0..255), -- Mantis #7209, #7005 - stationID StationID -} - -StationID ::= INTEGER(0..4294967295) - -ReferencePosition ::= SEQUENCE { - latitude Latitude, - longitude Longitude, - positionConfidenceEllipse PosConfidenceEllipse , - altitude Altitude -} - -DeltaReferencePosition ::= SEQUENCE { - deltaLatitude DeltaLatitude, - deltaLongitude DeltaLongitude, - deltaAltitude DeltaAltitude -} - -Longitude ::= INTEGER {oneMicrodegreeEast (10), oneMicrodegreeWest (-10), unavailable(1800000001)} (-1800000000..1800000001) - -Latitude ::= INTEGER {oneMicrodegreeNorth (10), oneMicrodegreeSouth (-10), unavailable(900000001)} (-900000000..900000001) - -Altitude ::= SEQUENCE { - altitudeValue AltitudeValue, - altitudeConfidence AltitudeConfidence -} - -AltitudeValue ::= INTEGER {referenceEllipsoidSurface(0), oneCentimeter(1), unavailable(800001)} (-100000..800001) - -AltitudeConfidence ::= ENUMERATED { - alt-000-01 (0), - alt-000-02 (1), - alt-000-05 (2), - alt-000-10 (3), - alt-000-20 (4), - alt-000-50 (5), - alt-001-00 (6), - alt-002-00 (7), - alt-005-00 (8), - alt-010-00 (9), - alt-020-00 (10), - alt-050-00 (11), - alt-100-00 (12), - alt-200-00 (13), - outOfRange (14), - unavailable (15) -} - -DeltaLongitude ::= INTEGER {oneMicrodegreeEast (10), oneMicrodegreeWest (-10), unavailable(131072)} (-131071..131072) - -DeltaLatitude ::= INTEGER {oneMicrodegreeNorth (10), oneMicrodegreeSouth (-10) , unavailable(131072)} (-131071..131072) - -DeltaAltitude ::= INTEGER {oneCentimeterUp (1), oneCentimeterDown (-1), unavailable(12800)} (-12700..12800) - -PosConfidenceEllipse ::= SEQUENCE { - semiMajorConfidence SemiAxisLength, - semiMinorConfidence SemiAxisLength, - semiMajorOrientation HeadingValue -} - -PathPoint ::= SEQUENCE { - pathPosition DeltaReferencePosition, - pathDeltaTime PathDeltaTime OPTIONAL -} - -PathDeltaTime ::= INTEGER {tenMilliSecondsInPast(1)} (1..65535, ...) - -PtActivation ::= SEQUENCE { - ptActivationType PtActivationType, - ptActivationData PtActivationData -} - -PtActivationType ::= INTEGER {undefinedCodingType(0), r09-16CodingType(1), vdv-50149CodingType(2)} (0..255) - -PtActivationData ::= OCTET STRING (SIZE(1..20)) - -AccelerationControl ::= BIT STRING { - brakePedalEngaged (0), - gasPedalEngaged (1), - emergencyBrakeEngaged (2), - collisionWarningEngaged (3), - accEngaged (4), - cruiseControlEngaged (5), - speedLimiterEngaged (6) -} (SIZE(7)) - -SemiAxisLength ::= INTEGER{oneCentimeter(1), outOfRange(4094), unavailable(4095)} (0..4095) - -CauseCode ::= SEQUENCE { - causeCode CauseCodeType, - subCauseCode SubCauseCodeType, - ... -} - -CauseCodeType ::= INTEGER { - reserved (0), - trafficCondition (1), - accident (2), - roadworks (3), - impassability (5), - adverseWeatherCondition-Adhesion (6), - aquaplannning (7), - hazardousLocation-SurfaceCondition (9), - hazardousLocation-ObstacleOnTheRoad (10), - hazardousLocation-AnimalOnTheRoad (11), - humanPresenceOnTheRoad (12), - wrongWayDriving (14), - rescueAndRecoveryWorkInProgress (15), - adverseWeatherCondition-ExtremeWeatherCondition (17), - adverseWeatherCondition-Visibility (18), - adverseWeatherCondition-Precipitation (19), - slowVehicle (26), - dangerousEndOfQueue (27), - vehicleBreakdown (91), - postCrash (92), - humanProblem (93), - stationaryVehicle (94), - emergencyVehicleApproaching (95), - hazardousLocation-DangerousCurve (96), - collisionRisk (97), - signalViolation (98), - dangerousSituation (99) -} (0..255) - -SubCauseCodeType ::= INTEGER (0..255) - -TrafficConditionSubCauseCode ::= INTEGER {unavailable(0), increasedVolumeOfTraffic(1), trafficJamSlowlyIncreasing(2), trafficJamIncreasing(3), trafficJamStronglyIncreasing(4), trafficStationary(5), trafficJamSlightlyDecreasing(6), trafficJamDecreasing(7), trafficJamStronglyDecreasing(8)} (0..255) - -AccidentSubCauseCode ::= INTEGER {unavailable(0), multiVehicleAccident(1), heavyAccident(2), accidentInvolvingLorry(3), accidentInvolvingBus(4), accidentInvolvingHazardousMaterials(5), accidentOnOppositeLane(6), unsecuredAccident(7), assistanceRequested(8)} (0..255) - -RoadworksSubCauseCode ::= INTEGER {unavailable(0), majorRoadworks(1), roadMarkingWork(2), slowMovingRoadMaintenance(3), shortTermStationaryRoadworks(4), streetCleaning(5), winterService(6)} (0..255) - -HumanPresenceOnTheRoadSubCauseCode ::= INTEGER {unavailable(0), childrenOnRoadway(1), cyclistOnRoadway(2), motorcyclistOnRoadway(3)} (0..255) - -WrongWayDrivingSubCauseCode ::= INTEGER {unavailable(0), wrongLane(1), wrongDirection(2)} (0..255) - -AdverseWeatherCondition-ExtremeWeatherConditionSubCauseCode ::= INTEGER {unavailable(0), strongWinds(1), damagingHail(2), hurricane(3), thunderstorm(4), tornado(5), blizzard(6)} (0..255) - -AdverseWeatherCondition-AdhesionSubCauseCode ::= INTEGER {unavailable(0), heavyFrostOnRoad(1), fuelOnRoad(2), mudOnRoad(3), snowOnRoad(4), iceOnRoad(5), blackIceOnRoad(6), oilOnRoad(7), looseChippings(8), instantBlackIce(9), roadsSalted(10)} (0..255) - -AdverseWeatherCondition-VisibilitySubCauseCode ::= INTEGER {unavailable(0), fog(1), smoke(2), heavySnowfall(3), heavyRain(4), heavyHail(5), lowSunGlare(6), sandstorms(7), swarmsOfInsects(8)} (0..255) - -AdverseWeatherCondition-PrecipitationSubCauseCode ::= INTEGER {unavailable(0), heavyRain(1), heavySnowfall(2), softHail(3)} (0..255) - -SlowVehicleSubCauseCode ::= INTEGER {unavailable(0), maintenanceVehicle(1), vehiclesSlowingToLookAtAccident(2), abnormalLoad(3), abnormalWideLoad(4), convoy(5), snowplough(6), deicing(7), saltingVehicles(8)} (0..255) - -StationaryVehicleSubCauseCode ::= INTEGER {unavailable(0), humanProblem(1), vehicleBreakdown(2), postCrash(3), publicTransportStop(4), carryingDangerousGoods(5)} (0..255) - -HumanProblemSubCauseCode ::= INTEGER {unavailable(0), glycemiaProblem(1), heartProblem(2)} (0..255) - -EmergencyVehicleApproachingSubCauseCode ::= INTEGER {unavailable(0), emergencyVehicleApproaching(1), prioritizedVehicleApproaching(2)} (0..255) - -HazardousLocation-DangerousCurveSubCauseCode ::= INTEGER {unavailable(0), dangerousLeftTurnCurve(1), dangerousRightTurnCurve(2), multipleCurvesStartingWithUnknownTurningDirection(3), multipleCurvesStartingWithLeftTurn(4), multipleCurvesStartingWithRightTurn(5)} (0..255) - -HazardousLocation-SurfaceConditionSubCauseCode ::= INTEGER {unavailable(0), rockfalls(1), earthquakeDamage(2), sewerCollapse(3), subsidence(4), snowDrifts(5), stormDamage(6), burstPipe(7), volcanoEruption(8), fallingIce(9)} (0..255) - -HazardousLocation-ObstacleOnTheRoadSubCauseCode ::= INTEGER {unavailable(0), shedLoad(1), partsOfVehicles(2), partsOfTyres(3), bigObjects(4), fallenTrees(5), hubCaps(6), waitingVehicles(7)} (0..255) - -HazardousLocation-AnimalOnTheRoadSubCauseCode ::= INTEGER {unavailable(0), wildAnimals(1), herdOfAnimals(2), smallAnimals(3), largeAnimals(4)} (0..255) - -CollisionRiskSubCauseCode ::= INTEGER {unavailable(0), longitudinalCollisionRisk(1), crossingCollisionRisk(2), lateralCollisionRisk(3), vulnerableRoadUser(4)} (0..255) - -SignalViolationSubCauseCode ::= INTEGER {unavailable(0), stopSignViolation(1), trafficLightViolation(2), turningRegulationViolation(3)} (0..255) - -RescueAndRecoveryWorkInProgressSubCauseCode ::= INTEGER {unavailable(0), emergencyVehicles(1), rescueHelicopterLanding(2), policeActivityOngoing(3), medicalEmergencyOngoing(4), childAbductionInProgress(5)} (0..255) - -DangerousEndOfQueueSubCauseCode ::= INTEGER {unavailable(0), suddenEndOfQueue(1), queueOverHill(2), queueAroundBend(3), queueInTunnel(4)} (0..255) - -DangerousSituationSubCauseCode ::= INTEGER {unavailable(0), emergencyElectronicBrakeEngaged(1), preCrashSystemEngaged(2), espEngaged(3), absEngaged(4), aebEngaged(5), brakeWarningEngaged(6), collisionRiskWarningEngaged(7)} (0..255) - -VehicleBreakdownSubCauseCode ::= INTEGER {unavailable(0), lackOfFuel (1), lackOfBatteryPower (2), engineProblem(3), transmissionProblem(4), engineCoolingProblem(5), brakingSystemProblem(6), steeringProblem(7), tyrePuncture(8), tyrePressureProblem(9)} (0..255) - -PostCrashSubCauseCode ::= INTEGER {unavailable(0), accidentWithoutECallTriggered (1), accidentWithECallManuallyTriggered (2), accidentWithECallAutomaticallyTriggered (3), accidentWithECallTriggeredWithoutAccessToCellularNetwork(4)} (0..255) - -Curvature ::= SEQUENCE { - curvatureValue CurvatureValue, - curvatureConfidence CurvatureConfidence -} - -CurvatureValue ::= INTEGER {straight(0), unavailable(1023)} (-1023..1023) - -CurvatureConfidence ::= ENUMERATED { - onePerMeter-0-00002 (0), - onePerMeter-0-0001 (1), - onePerMeter-0-0005 (2), - onePerMeter-0-002 (3), - onePerMeter-0-01 (4), - onePerMeter-0-1 (5), - outOfRange (6), - unavailable (7) -} - -CurvatureCalculationMode ::= ENUMERATED {yawRateUsed(0), yawRateNotUsed(1), unavailable(2), ...} - -Heading ::= SEQUENCE { - headingValue HeadingValue, - headingConfidence HeadingConfidence -} - -HeadingValue ::= INTEGER {wgs84North(0), wgs84East(900), wgs84South(1800), wgs84West(2700), unavailable(3601)} (0..3601) - -HeadingConfidence ::= INTEGER {equalOrWithinZeroPointOneDegree (1), equalOrWithinOneDegree (10), outOfRange(126), unavailable(127)} (1..127) -LanePosition::= INTEGER {offTheRoad(-1), innerHardShoulder(0), innermostDrivingLane(1), secondLaneFromInside(2), outerHardShoulder(14)} (-1..14) - -ClosedLanes ::= SEQUENCE { - innerhardShoulderStatus HardShoulderStatus OPTIONAL, - outerhardShoulderStatus HardShoulderStatus OPTIONAL, - drivingLaneStatus DrivingLaneStatus OPTIONAL, - ... -} - -HardShoulderStatus ::= ENUMERATED {availableForStopping(0), closed(1), availableForDriving(2)} - -DrivingLaneStatus ::= BIT STRING (SIZE (1..13)) - -PerformanceClass ::= INTEGER {unavailable(0), performanceClassA(1), performanceClassB(2)} (0..7) - -SpeedValue ::= INTEGER {standstill(0), oneCentimeterPerSec(1), unavailable(16383)} (0..16383) - -SpeedConfidence ::= INTEGER {equalOrWithinOneCentimeterPerSec(1), equalOrWithinOneMeterPerSec(100), outOfRange(126), unavailable(127)} (1..127) - -VehicleMass ::= INTEGER {hundredKg(1), unavailable(1024)} (1..1024) - -Speed ::= SEQUENCE { - speedValue SpeedValue, - speedConfidence SpeedConfidence -} - -DriveDirection ::= ENUMERATED {forward (0), backward (1), unavailable (2)} - -EmbarkationStatus ::= BOOLEAN - -LongitudinalAcceleration ::= SEQUENCE { - longitudinalAccelerationValue LongitudinalAccelerationValue, - longitudinalAccelerationConfidence AccelerationConfidence -} - -LongitudinalAccelerationValue ::= INTEGER {pointOneMeterPerSecSquaredForward(1), pointOneMeterPerSecSquaredBackward(-1), unavailable(161)} (-160 .. 161) - -AccelerationConfidence ::= INTEGER {pointOneMeterPerSecSquared(1), outOfRange(101), unavailable(102)} (0 .. 102) - -LateralAcceleration ::= SEQUENCE { - lateralAccelerationValue LateralAccelerationValue, - lateralAccelerationConfidence AccelerationConfidence -} - -LateralAccelerationValue ::= INTEGER {pointOneMeterPerSecSquaredToRight(-1), pointOneMeterPerSecSquaredToLeft(1), unavailable(161)} (-160 .. 161) - -VerticalAcceleration ::= SEQUENCE { - verticalAccelerationValue VerticalAccelerationValue, - verticalAccelerationConfidence AccelerationConfidence -} - -VerticalAccelerationValue ::= INTEGER {pointOneMeterPerSecSquaredUp(1), pointOneMeterPerSecSquaredDown(-1), unavailable(161)} (-160 .. 161) - -StationType ::= INTEGER {unknown(0), pedestrian(1), cyclist(2), moped(3), motorcycle(4), passengerCar(5), bus(6), lightTruck(7), heavyTruck(8), trailer(9), specialVehicles(10), tram(11), roadSideUnit(15)} (0..255) - -ExteriorLights ::= BIT STRING { - lowBeamHeadlightsOn (0), - highBeamHeadlightsOn (1), - leftTurnSignalOn (2), - rightTurnSignalOn (3), - daytimeRunningLightsOn (4), - reverseLightOn (5), - fogLightOn (6), - parkingLightsOn (7) -} (SIZE(8)) - -DangerousGoodsBasic::= ENUMERATED { - explosives1(0), - explosives2(1), - explosives3(2), - explosives4(3), - explosives5(4), - explosives6(5), - flammableGases(6), - nonFlammableGases(7), - toxicGases(8), - flammableLiquids(9), - flammableSolids(10), - substancesLiableToSpontaneousCombustion(11), - substancesEmittingFlammableGasesUponContactWithWater(12), - oxidizingSubstances(13), - organicPeroxides(14), - toxicSubstances(15), - infectiousSubstances(16), - radioactiveMaterial(17), - corrosiveSubstances(18), - miscellaneousDangerousSubstances(19) -} - -DangerousGoodsExtended ::= SEQUENCE { - dangerousGoodsType DangerousGoodsBasic, - unNumber INTEGER (0..9999), - elevatedTemperature BOOLEAN, - tunnelsRestricted BOOLEAN, - limitedQuantity BOOLEAN, - emergencyActionCode IA5String (SIZE (1..24)) OPTIONAL, - phoneNumber PhoneNumber OPTIONAL, - companyName UTF8String (SIZE (1..24)) OPTIONAL, - ... -} - -SpecialTransportType ::= BIT STRING {heavyLoad(0), excessWidth(1), excessLength(2), excessHeight(3)} (SIZE(4)) - -LightBarSirenInUse ::= BIT STRING { - lightBarActivated (0), - sirenActivated (1) -} (SIZE(2)) - -HeightLonCarr ::= INTEGER {oneCentimeter(1), unavailable(100)} (1..100) - -PosLonCarr ::= INTEGER {oneCentimeter(1), unavailable(127)} (1..127) - -PosPillar ::= INTEGER {tenCentimeters(1), unavailable(30)} (1..30) - -PosCentMass ::= INTEGER {tenCentimeters(1), unavailable(63)} (1..63) - -RequestResponseIndication ::= ENUMERATED {request(0), response(1)} - -SpeedLimit ::= INTEGER {oneKmPerHour(1)} (1..255) - -StationarySince ::= ENUMERATED {lessThan1Minute(0), lessThan2Minutes(1), lessThan15Minutes(2), equalOrGreater15Minutes(3)} - -Temperature ::= INTEGER {equalOrSmallerThanMinus60Deg (-60), oneDegreeCelsius(1), equalOrGreaterThan67Deg(67)} (-60..67) - -TrafficRule ::= ENUMERATED {noPassing(0), noPassingForTrucks(1), passToRight(2), passToLeft(3), ... } - -WheelBaseVehicle ::= INTEGER {tenCentimeters(1), unavailable(127)} (1..127) - -TurningRadius ::= INTEGER {point4Meters(1), unavailable(255)} (1..255) - -PosFrontAx ::= INTEGER {tenCentimeters(1), unavailable(20)} (1..20) - -PositionOfOccupants ::= BIT STRING { - row1LeftOccupied (0), - row1RightOccupied (1), - row1MidOccupied (2), - row1NotDetectable (3), - row1NotPresent (4), - row2LeftOccupied (5), - row2RightOccupied (6), - row2MidOccupied (7), - row2NotDetectable (8), - row2NotPresent (9), - row3LeftOccupied (10), - row3RightOccupied (11), - row3MidOccupied (12), - row3NotDetectable (13), - row3NotPresent (14), - row4LeftOccupied (15), - row4RightOccupied (16), - row4MidOccupied (17), - row4NotDetectable (18), - row4NotPresent (19) -} (SIZE(20)) - -PositioningSolutionType ::= ENUMERATED {noPositioningSolution(0), sGNSS(1), dGNSS(2), sGNSSplusDR(3), dGNSSplusDR(4), dR(5), ...} - -VehicleIdentification ::= SEQUENCE { - wMInumber WMInumber OPTIONAL, - vDS VDS OPTIONAL, - ... -} - -WMInumber ::= IA5String (SIZE(1..3)) - -VDS ::= IA5String (SIZE(6)) - -EnergyStorageType ::= BIT STRING {hydrogenStorage(0), electricEnergyStorage(1), liquidPropaneGas(2), compressedNaturalGas(3), diesel(4), gasoline(5), ammonia(6)} (SIZE(7)) - -VehicleLength ::= SEQUENCE { - vehicleLengthValue VehicleLengthValue, - vehicleLengthConfidenceIndication VehicleLengthConfidenceIndication -} - -VehicleLengthValue ::= INTEGER {tenCentimeters(1), outOfRange(1022), unavailable(1023)} (1..1023) - -VehicleLengthConfidenceIndication ::= ENUMERATED {noTrailerPresent(0), trailerPresentWithKnownLength(1), trailerPresentWithUnknownLength(2), trailerPresenceIsUnknown(3), unavailable(4)} - -VehicleWidth ::= INTEGER {tenCentimeters(1), outOfRange(61), unavailable(62)} (1..62) - -PathHistory::= SEQUENCE (SIZE(0..40)) OF PathPoint - -EmergencyPriority ::= BIT STRING {requestForRightOfWay(0), requestForFreeCrossingAtATrafficLight(1)} (SIZE(2)) - -InformationQuality ::= INTEGER {unavailable(0), lowest(1), highest(7)} (0..7) - -RoadType ::= ENUMERATED { - urban-NoStructuralSeparationToOppositeLanes(0), - urban-WithStructuralSeparationToOppositeLanes(1), - nonUrban-NoStructuralSeparationToOppositeLanes(2), - nonUrban-WithStructuralSeparationToOppositeLanes(3) -} - -SteeringWheelAngle ::= SEQUENCE { - steeringWheelAngleValue SteeringWheelAngleValue, - steeringWheelAngleConfidence SteeringWheelAngleConfidence -} - -SteeringWheelAngleValue ::= INTEGER {straight(0), onePointFiveDegreesToRight(-1), onePointFiveDegreesToLeft(1), unavailable(512)} (-511..512) - -SteeringWheelAngleConfidence ::= INTEGER {equalOrWithinOnePointFiveDegree (1), outOfRange(126), unavailable(127)} (1..127) - -TimestampIts ::= INTEGER {utcStartOf2004(0), oneMillisecAfterUTCStartOf2004(1)} (0..4398046511103) - -VehicleRole ::= ENUMERATED {default(0), publicTransport(1), specialTransport(2), dangerousGoods(3), roadWork(4), rescue(5), emergency(6), safetyCar(7), agriculture(8), commercial(9), military(10), roadOperator(11), taxi(12), reserved1(13), reserved2(14), reserved3(15)} - -YawRate::= SEQUENCE { - yawRateValue YawRateValue, - yawRateConfidence YawRateConfidence -} - -YawRateValue ::= INTEGER {straight(0), degSec-000-01ToRight(-1), degSec-000-01ToLeft(1), unavailable(32767)} (-32766..32767) - -YawRateConfidence ::= ENUMERATED { - degSec-000-01 (0), - degSec-000-05 (1), - degSec-000-10 (2), - degSec-001-00 (3), - degSec-005-00 (4), - degSec-010-00 (5), - degSec-100-00 (6), - outOfRange (7), - unavailable (8) -} - -ProtectedZoneType::= ENUMERATED { permanentCenDsrcTolling (0), ..., temporaryCenDsrcTolling (1) } - -RelevanceDistance ::= ENUMERATED {lessThan50m(0), lessThan100m(1), lessThan200m(2), lessThan500m(3), lessThan1000m(4), lessThan5km(5), lessThan10km(6), over10km(7)} - -RelevanceTrafficDirection ::= ENUMERATED {allTrafficDirections(0), upstreamTraffic(1), downstreamTraffic(2), oppositeTraffic(3)} - -TransmissionInterval ::= INTEGER {oneMilliSecond(1), tenSeconds(10000)} (1..10000) - -ValidityDuration ::= INTEGER {timeOfDetection(0), oneSecondAfterDetection(1)} (0..86400) - -ActionID ::= SEQUENCE { - originatingStationID StationID, - sequenceNumber SequenceNumber -} - -ItineraryPath ::= SEQUENCE SIZE(1..40) OF ReferencePosition - -ProtectedCommunicationZone ::= SEQUENCE { - protectedZoneType ProtectedZoneType, - expiryTime TimestampIts OPTIONAL, - protectedZoneLatitude Latitude, - protectedZoneLongitude Longitude, - protectedZoneRadius ProtectedZoneRadius OPTIONAL, - protectedZoneID ProtectedZoneID OPTIONAL, - ... -} - -Traces ::= SEQUENCE SIZE(1..7) OF PathHistory - -NumberOfOccupants ::= INTEGER {oneOccupant (1), unavailable(127)} (0 .. 127) - -SequenceNumber ::= INTEGER (0..65535) - -PositionOfPillars ::= SEQUENCE (SIZE(1..3, ...)) OF PosPillar - -RestrictedTypes ::= SEQUENCE (SIZE(1..3, ...)) OF StationType - -EventHistory::= SEQUENCE (SIZE(1..23)) OF EventPoint - -EventPoint ::= SEQUENCE { - eventPosition DeltaReferencePosition, - eventDeltaTime PathDeltaTime OPTIONAL, - informationQuality InformationQuality -} - -ProtectedCommunicationZonesRSU ::= SEQUENCE (SIZE(1..16)) OF ProtectedCommunicationZone - -CenDsrcTollingZone ::= SEQUENCE { - protectedZoneLatitude Latitude, - protectedZoneLongitude Longitude, - cenDsrcTollingZoneID CenDsrcTollingZoneID OPTIONAL, - ... -} - -ProtectedZoneRadius ::= INTEGER {oneMeter(1)} (1..255,...) - -ProtectedZoneID ::= INTEGER (0.. 134217727) - -CenDsrcTollingZoneID ::= ProtectedZoneID - -DigitalMap ::= SEQUENCE (SIZE(1..256)) OF ReferencePosition - -OpeningDaysHours ::= UTF8String - -PhoneNumber ::= NumericString (SIZE(1..16)) -END +ITS-Container { +itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) +} + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +IMPORTS; + +ItsPduHeader ::= SEQUENCE { + protocolVersion INTEGER (0..255), + messageID INTEGER{ denm(1), cam(2), poi(3), spatem(4), mapem(5), ivim(6), ev-rsr(7), tistpgtransaction(8), srem(9), ssem(10), evcsn(11), saem(12), rtcmem(13) } (0..255), -- Mantis #7209, #7005 + stationID StationID +} + +StationID ::= INTEGER(0..4294967295) + +ReferencePosition ::= SEQUENCE { + latitude Latitude, + longitude Longitude, + positionConfidenceEllipse PosConfidenceEllipse , + altitude Altitude +} + +DeltaReferencePosition ::= SEQUENCE { + deltaLatitude DeltaLatitude, + deltaLongitude DeltaLongitude, + deltaAltitude DeltaAltitude +} + +Longitude ::= INTEGER {oneMicrodegreeEast (10), oneMicrodegreeWest (-10), unavailable(1800000001)} (-1800000000..1800000001) + +Latitude ::= INTEGER {oneMicrodegreeNorth (10), oneMicrodegreeSouth (-10), unavailable(900000001)} (-900000000..900000001) + +Altitude ::= SEQUENCE { + altitudeValue AltitudeValue, + altitudeConfidence AltitudeConfidence +} + +AltitudeValue ::= INTEGER {referenceEllipsoidSurface(0), oneCentimeter(1), unavailable(800001)} (-100000..800001) + +AltitudeConfidence ::= ENUMERATED { + alt-000-01 (0), + alt-000-02 (1), + alt-000-05 (2), + alt-000-10 (3), + alt-000-20 (4), + alt-000-50 (5), + alt-001-00 (6), + alt-002-00 (7), + alt-005-00 (8), + alt-010-00 (9), + alt-020-00 (10), + alt-050-00 (11), + alt-100-00 (12), + alt-200-00 (13), + outOfRange (14), + unavailable (15) +} + +DeltaLongitude ::= INTEGER {oneMicrodegreeEast (10), oneMicrodegreeWest (-10), unavailable(131072)} (-131071..131072) + +DeltaLatitude ::= INTEGER {oneMicrodegreeNorth (10), oneMicrodegreeSouth (-10) , unavailable(131072)} (-131071..131072) + +DeltaAltitude ::= INTEGER {oneCentimeterUp (1), oneCentimeterDown (-1), unavailable(12800)} (-12700..12800) + +PosConfidenceEllipse ::= SEQUENCE { + semiMajorConfidence SemiAxisLength, + semiMinorConfidence SemiAxisLength, + semiMajorOrientation HeadingValue +} + +PathPoint ::= SEQUENCE { + pathPosition DeltaReferencePosition, + pathDeltaTime PathDeltaTime OPTIONAL +} + +PathDeltaTime ::= INTEGER {tenMilliSecondsInPast(1)} (1..65535, ...) + +PtActivation ::= SEQUENCE { + ptActivationType PtActivationType, + ptActivationData PtActivationData +} + +PtActivationType ::= INTEGER {undefinedCodingType(0), r09-16CodingType(1), vdv-50149CodingType(2)} (0..255) + +PtActivationData ::= OCTET STRING (SIZE(1..20)) + +AccelerationControl ::= BIT STRING { + brakePedalEngaged (0), + gasPedalEngaged (1), + emergencyBrakeEngaged (2), + collisionWarningEngaged (3), + accEngaged (4), + cruiseControlEngaged (5), + speedLimiterEngaged (6) +} (SIZE(7)) + +SemiAxisLength ::= INTEGER{oneCentimeter(1), outOfRange(4094), unavailable(4095)} (0..4095) + +CauseCode ::= SEQUENCE { + causeCode CauseCodeType, + subCauseCode SubCauseCodeType, + ... +} + +CauseCodeType ::= INTEGER { + reserved (0), + trafficCondition (1), + accident (2), + roadworks (3), + impassability (5), + adverseWeatherCondition-Adhesion (6), + aquaplannning (7), + hazardousLocation-SurfaceCondition (9), + hazardousLocation-ObstacleOnTheRoad (10), + hazardousLocation-AnimalOnTheRoad (11), + humanPresenceOnTheRoad (12), + wrongWayDriving (14), + rescueAndRecoveryWorkInProgress (15), + adverseWeatherCondition-ExtremeWeatherCondition (17), + adverseWeatherCondition-Visibility (18), + adverseWeatherCondition-Precipitation (19), + slowVehicle (26), + dangerousEndOfQueue (27), + vehicleBreakdown (91), + postCrash (92), + humanProblem (93), + stationaryVehicle (94), + emergencyVehicleApproaching (95), + hazardousLocation-DangerousCurve (96), + collisionRisk (97), + signalViolation (98), + dangerousSituation (99) +} (0..255) + +SubCauseCodeType ::= INTEGER (0..255) + +TrafficConditionSubCauseCode ::= INTEGER {unavailable(0), increasedVolumeOfTraffic(1), trafficJamSlowlyIncreasing(2), trafficJamIncreasing(3), trafficJamStronglyIncreasing(4), trafficStationary(5), trafficJamSlightlyDecreasing(6), trafficJamDecreasing(7), trafficJamStronglyDecreasing(8)} (0..255) + +AccidentSubCauseCode ::= INTEGER {unavailable(0), multiVehicleAccident(1), heavyAccident(2), accidentInvolvingLorry(3), accidentInvolvingBus(4), accidentInvolvingHazardousMaterials(5), accidentOnOppositeLane(6), unsecuredAccident(7), assistanceRequested(8)} (0..255) + +RoadworksSubCauseCode ::= INTEGER {unavailable(0), majorRoadworks(1), roadMarkingWork(2), slowMovingRoadMaintenance(3), shortTermStationaryRoadworks(4), streetCleaning(5), winterService(6)} (0..255) + +HumanPresenceOnTheRoadSubCauseCode ::= INTEGER {unavailable(0), childrenOnRoadway(1), cyclistOnRoadway(2), motorcyclistOnRoadway(3)} (0..255) + +WrongWayDrivingSubCauseCode ::= INTEGER {unavailable(0), wrongLane(1), wrongDirection(2)} (0..255) + +AdverseWeatherCondition-ExtremeWeatherConditionSubCauseCode ::= INTEGER {unavailable(0), strongWinds(1), damagingHail(2), hurricane(3), thunderstorm(4), tornado(5), blizzard(6)} (0..255) + +AdverseWeatherCondition-AdhesionSubCauseCode ::= INTEGER {unavailable(0), heavyFrostOnRoad(1), fuelOnRoad(2), mudOnRoad(3), snowOnRoad(4), iceOnRoad(5), blackIceOnRoad(6), oilOnRoad(7), looseChippings(8), instantBlackIce(9), roadsSalted(10)} (0..255) + +AdverseWeatherCondition-VisibilitySubCauseCode ::= INTEGER {unavailable(0), fog(1), smoke(2), heavySnowfall(3), heavyRain(4), heavyHail(5), lowSunGlare(6), sandstorms(7), swarmsOfInsects(8)} (0..255) + +AdverseWeatherCondition-PrecipitationSubCauseCode ::= INTEGER {unavailable(0), heavyRain(1), heavySnowfall(2), softHail(3)} (0..255) + +SlowVehicleSubCauseCode ::= INTEGER {unavailable(0), maintenanceVehicle(1), vehiclesSlowingToLookAtAccident(2), abnormalLoad(3), abnormalWideLoad(4), convoy(5), snowplough(6), deicing(7), saltingVehicles(8)} (0..255) + +StationaryVehicleSubCauseCode ::= INTEGER {unavailable(0), humanProblem(1), vehicleBreakdown(2), postCrash(3), publicTransportStop(4), carryingDangerousGoods(5)} (0..255) + +HumanProblemSubCauseCode ::= INTEGER {unavailable(0), glycemiaProblem(1), heartProblem(2)} (0..255) + +EmergencyVehicleApproachingSubCauseCode ::= INTEGER {unavailable(0), emergencyVehicleApproaching(1), prioritizedVehicleApproaching(2)} (0..255) + +HazardousLocation-DangerousCurveSubCauseCode ::= INTEGER {unavailable(0), dangerousLeftTurnCurve(1), dangerousRightTurnCurve(2), multipleCurvesStartingWithUnknownTurningDirection(3), multipleCurvesStartingWithLeftTurn(4), multipleCurvesStartingWithRightTurn(5)} (0..255) + +HazardousLocation-SurfaceConditionSubCauseCode ::= INTEGER {unavailable(0), rockfalls(1), earthquakeDamage(2), sewerCollapse(3), subsidence(4), snowDrifts(5), stormDamage(6), burstPipe(7), volcanoEruption(8), fallingIce(9)} (0..255) + +HazardousLocation-ObstacleOnTheRoadSubCauseCode ::= INTEGER {unavailable(0), shedLoad(1), partsOfVehicles(2), partsOfTyres(3), bigObjects(4), fallenTrees(5), hubCaps(6), waitingVehicles(7)} (0..255) + +HazardousLocation-AnimalOnTheRoadSubCauseCode ::= INTEGER {unavailable(0), wildAnimals(1), herdOfAnimals(2), smallAnimals(3), largeAnimals(4)} (0..255) + +CollisionRiskSubCauseCode ::= INTEGER {unavailable(0), longitudinalCollisionRisk(1), crossingCollisionRisk(2), lateralCollisionRisk(3), vulnerableRoadUser(4)} (0..255) + +SignalViolationSubCauseCode ::= INTEGER {unavailable(0), stopSignViolation(1), trafficLightViolation(2), turningRegulationViolation(3)} (0..255) + +RescueAndRecoveryWorkInProgressSubCauseCode ::= INTEGER {unavailable(0), emergencyVehicles(1), rescueHelicopterLanding(2), policeActivityOngoing(3), medicalEmergencyOngoing(4), childAbductionInProgress(5)} (0..255) + +DangerousEndOfQueueSubCauseCode ::= INTEGER {unavailable(0), suddenEndOfQueue(1), queueOverHill(2), queueAroundBend(3), queueInTunnel(4)} (0..255) + +DangerousSituationSubCauseCode ::= INTEGER {unavailable(0), emergencyElectronicBrakeEngaged(1), preCrashSystemEngaged(2), espEngaged(3), absEngaged(4), aebEngaged(5), brakeWarningEngaged(6), collisionRiskWarningEngaged(7)} (0..255) + +VehicleBreakdownSubCauseCode ::= INTEGER {unavailable(0), lackOfFuel (1), lackOfBatteryPower (2), engineProblem(3), transmissionProblem(4), engineCoolingProblem(5), brakingSystemProblem(6), steeringProblem(7), tyrePuncture(8), tyrePressureProblem(9)} (0..255) + +PostCrashSubCauseCode ::= INTEGER {unavailable(0), accidentWithoutECallTriggered (1), accidentWithECallManuallyTriggered (2), accidentWithECallAutomaticallyTriggered (3), accidentWithECallTriggeredWithoutAccessToCellularNetwork(4)} (0..255) + +Curvature ::= SEQUENCE { + curvatureValue CurvatureValue, + curvatureConfidence CurvatureConfidence +} + +CurvatureValue ::= INTEGER {straight(0), unavailable(1023)} (-1023..1023) + +CurvatureConfidence ::= ENUMERATED { + onePerMeter-0-00002 (0), + onePerMeter-0-0001 (1), + onePerMeter-0-0005 (2), + onePerMeter-0-002 (3), + onePerMeter-0-01 (4), + onePerMeter-0-1 (5), + outOfRange (6), + unavailable (7) +} + +CurvatureCalculationMode ::= ENUMERATED {yawRateUsed(0), yawRateNotUsed(1), unavailable(2), ...} + +Heading ::= SEQUENCE { + headingValue HeadingValue, + headingConfidence HeadingConfidence +} + +HeadingValue ::= INTEGER {wgs84North(0), wgs84East(900), wgs84South(1800), wgs84West(2700), unavailable(3601)} (0..3601) + +HeadingConfidence ::= INTEGER {equalOrWithinZeroPointOneDegree (1), equalOrWithinOneDegree (10), outOfRange(126), unavailable(127)} (1..127) + +LanePosition ::= INTEGER {offTheRoad(-1), innerHardShoulder(0), +innermostDrivingLane(1), secondLaneFromInside(2), outerHardShoulder(14) } (-1..14) + +ClosedLanes ::= SEQUENCE { + innerhardShoulderStatus HardShoulderStatus OPTIONAL, + outerhardShoulderStatus HardShoulderStatus OPTIONAL, + drivingLaneStatus DrivingLaneStatus OPTIONAL, + ... +} + +HardShoulderStatus ::= ENUMERATED {availableForStopping(0), closed(1), availableForDriving(2)} + +DrivingLaneStatus ::= BIT STRING (SIZE (1..13)) + +PerformanceClass ::= INTEGER {unavailable(0), performanceClassA(1), performanceClassB(2)} (0..7) + +SpeedValue ::= INTEGER {standstill(0), oneCentimeterPerSec(1), unavailable(16383)} (0..16383) + +SpeedConfidence ::= INTEGER {equalOrWithinOneCentimeterPerSec(1), equalOrWithinOneMeterPerSec(100), outOfRange(126), unavailable(127)} (1..127) + +VehicleMass ::= INTEGER {hundredKg(1), unavailable(1024)} (1..1024) + +Speed ::= SEQUENCE { + speedValue SpeedValue, + speedConfidence SpeedConfidence +} + +DriveDirection ::= ENUMERATED {forward (0), backward (1), unavailable (2)} + +EmbarkationStatus ::= BOOLEAN + +LongitudinalAcceleration ::= SEQUENCE { + longitudinalAccelerationValue LongitudinalAccelerationValue, + longitudinalAccelerationConfidence AccelerationConfidence +} + +LongitudinalAccelerationValue ::= INTEGER {pointOneMeterPerSecSquaredForward(1), pointOneMeterPerSecSquaredBackward(-1), unavailable(161)} (-160 .. 161) + +AccelerationConfidence ::= INTEGER {pointOneMeterPerSecSquared(1), outOfRange(101), unavailable(102)} (0 .. 102) + +LateralAcceleration ::= SEQUENCE { + lateralAccelerationValue LateralAccelerationValue, + lateralAccelerationConfidence AccelerationConfidence +} + +LateralAccelerationValue ::= INTEGER {pointOneMeterPerSecSquaredToRight(-1), pointOneMeterPerSecSquaredToLeft(1), unavailable(161)} (-160 .. 161) + +VerticalAcceleration ::= SEQUENCE { + verticalAccelerationValue VerticalAccelerationValue, + verticalAccelerationConfidence AccelerationConfidence +} + +VerticalAccelerationValue ::= INTEGER {pointOneMeterPerSecSquaredUp(1), pointOneMeterPerSecSquaredDown(-1), unavailable(161)} (-160 .. 161) + +StationType ::= INTEGER {unknown(0), pedestrian(1), cyclist(2), moped(3), motorcycle(4), passengerCar(5), bus(6), +lightTruck(7), heavyTruck(8), trailer(9), specialVehicles(10), tram(11), roadSideUnit(15)} (0..255) + +ExteriorLights ::= BIT STRING { + lowBeamHeadlightsOn (0), + highBeamHeadlightsOn (1), + leftTurnSignalOn (2), + rightTurnSignalOn (3), + daytimeRunningLightsOn (4), + reverseLightOn (5), + fogLightOn (6), + parkingLightsOn (7) +} (SIZE(8)) + +DangerousGoodsBasic::= ENUMERATED { + explosives1(0), + explosives2(1), + explosives3(2), + explosives4(3), + explosives5(4), + explosives6(5), + flammableGases(6), + nonFlammableGases(7), + toxicGases(8), + flammableLiquids(9), + flammableSolids(10), + substancesLiableToSpontaneousCombustion(11), + substancesEmittingFlammableGasesUponContactWithWater(12), + oxidizingSubstances(13), + organicPeroxides(14), + toxicSubstances(15), + infectiousSubstances(16), + radioactiveMaterial(17), + corrosiveSubstances(18), + miscellaneousDangerousSubstances(19) +} + +DangerousGoodsExtended ::= SEQUENCE { + dangerousGoodsType DangerousGoodsBasic, + unNumber INTEGER (0..9999), + elevatedTemperature BOOLEAN, + tunnelsRestricted BOOLEAN, + limitedQuantity BOOLEAN, + emergencyActionCode IA5String (SIZE (1..24)) OPTIONAL, + phoneNumber PhoneNumber OPTIONAL, + companyName UTF8String (SIZE (1..24)) OPTIONAL, + ... +} + +SpecialTransportType ::= BIT STRING {heavyLoad(0), excessWidth(1), excessLength(2), excessHeight(3)} (SIZE(4)) + +LightBarSirenInUse ::= BIT STRING { + lightBarActivated (0), + sirenActivated (1) +} (SIZE(2)) + +HeightLonCarr ::= INTEGER {oneCentimeter(1), unavailable(100)} (1..100) + +PosLonCarr ::= INTEGER {oneCentimeter(1), unavailable(127)} (1..127) + +PosPillar ::= INTEGER {tenCentimeters(1), unavailable(30)} (1..30) + +PosCentMass ::= INTEGER {tenCentimeters(1), unavailable(63)} (1..63) + +RequestResponseIndication ::= ENUMERATED {request(0), response(1)} + +SpeedLimit ::= INTEGER {oneKmPerHour(1)} (1..255) + +StationarySince ::= ENUMERATED {lessThan1Minute(0), lessThan2Minutes(1), lessThan15Minutes(2), equalOrGreater15Minutes(3)} + +Temperature ::= INTEGER {equalOrSmallerThanMinus60Deg (-60), oneDegreeCelsius(1), equalOrGreaterThan67Deg(67)} (-60..67) + +TrafficRule ::= ENUMERATED {noPassing(0), noPassingForTrucks(1), passToRight(2), passToLeft(3), ... +} + +WheelBaseVehicle ::= INTEGER {tenCentimeters(1), unavailable(127)} (1..127) + +TurningRadius ::= INTEGER {point4Meters(1), unavailable(255)} (1..255) + +PosFrontAx ::= INTEGER {tenCentimeters(1), unavailable(20)} (1..20) + +PositionOfOccupants ::= BIT STRING { + row1LeftOccupied (0), + row1RightOccupied (1), + row1MidOccupied (2), + row1NotDetectable (3), + row1NotPresent (4), + row2LeftOccupied (5), + row2RightOccupied (6), + row2MidOccupied (7), + row2NotDetectable (8), + row2NotPresent (9), + row3LeftOccupied (10), + row3RightOccupied (11), + row3MidOccupied (12), + row3NotDetectable (13), + row3NotPresent (14), + row4LeftOccupied (15), + row4RightOccupied (16), + row4MidOccupied (17), + row4NotDetectable (18), + row4NotPresent (19)} (SIZE(20)) + +PositioningSolutionType ::= ENUMERATED {noPositioningSolution(0), sGNSS(1), dGNSS(2), sGNSSplusDR(3), dGNSSplusDR(4), dR(5), ...} + +VehicleIdentification ::= SEQUENCE { + wMInumber WMInumber OPTIONAL, + vDS VDS OPTIONAL, + ... +} + +WMInumber ::= IA5String (SIZE(1..3)) + +VDS ::= IA5String (SIZE(6)) + +EnergyStorageType ::= BIT STRING {hydrogenStorage(0), electricEnergyStorage(1), liquidPropaneGas(2), compressedNaturalGas(3), diesel(4), gasoline(5), ammonia(6)} (SIZE(7)) + +VehicleLength ::= SEQUENCE { + vehicleLengthValue VehicleLengthValue, + vehicleLengthConfidenceIndication VehicleLengthConfidenceIndication +} + +VehicleLengthValue ::= INTEGER {tenCentimeters(1), outOfRange(1022), unavailable(1023)} (1..1023) + +VehicleLengthConfidenceIndication ::= ENUMERATED {noTrailerPresent(0), trailerPresentWithKnownLength(1), trailerPresentWithUnknownLength(2), trailerPresenceIsUnknown(3), unavailable(4)} + +VehicleWidth ::= INTEGER {tenCentimeters(1), outOfRange(61), unavailable(62)} (1..62) + +PathHistory::= SEQUENCE (SIZE(0..40)) OF PathPoint + +EmergencyPriority ::= BIT STRING {requestForRightOfWay(0), requestForFreeCrossingAtATrafficLight(1)} (SIZE(2)) + +InformationQuality ::= INTEGER {unavailable(0), lowest(1), highest(7)} (0..7) + +RoadType ::= ENUMERATED { + urban-NoStructuralSeparationToOppositeLanes(0), + urban-WithStructuralSeparationToOppositeLanes(1), + nonUrban-NoStructuralSeparationToOppositeLanes(2), + nonUrban-WithStructuralSeparationToOppositeLanes(3)} + +SteeringWheelAngle ::= SEQUENCE { + steeringWheelAngleValue SteeringWheelAngleValue, + steeringWheelAngleConfidence SteeringWheelAngleConfidence +} + +SteeringWheelAngleValue ::= INTEGER {straight(0), onePointFiveDegreesToRight(-1), onePointFiveDegreesToLeft(1), unavailable(512)} (-511..512) + +SteeringWheelAngleConfidence ::= INTEGER {equalOrWithinOnePointFiveDegree (1), outOfRange(126), unavailable(127)} (1..127) + +TimestampIts ::= INTEGER {utcStartOf2004(0), oneMillisecAfterUTCStartOf2004(1)} (0..4398046511103) + +VehicleRole ::= ENUMERATED {default(0), publicTransport(1), specialTransport(2), dangerousGoods(3), roadWork(4), rescue(5), emergency(6), safetyCar(7), agriculture(8), commercial(9), military(10), roadOperator(11), taxi(12), reserved1(13), reserved2(14), reserved3(15)} + +YawRate::= SEQUENCE { + yawRateValue YawRateValue, + yawRateConfidence YawRateConfidence +} + +YawRateValue ::= INTEGER {straight(0), degSec-000-01ToRight(-1), degSec-000-01ToLeft(1), unavailable(32767)} (-32766..32767) + +YawRateConfidence ::= ENUMERATED { + degSec-000-01 (0), + degSec-000-05 (1), + degSec-000-10 (2), + degSec-001-00 (3), + degSec-005-00 (4), + degSec-010-00 (5), + degSec-100-00 (6), + outOfRange (7), + unavailable (8) +} + +ProtectedZoneType::= ENUMERATED { permanentCenDsrcTolling (0), ..., temporaryCenDsrcTolling (1) } + +RelevanceDistance ::= ENUMERATED {lessThan50m(0), lessThan100m(1), lessThan200m(2), lessThan500m(3), lessThan1000m(4), lessThan5km(5), lessThan10km(6), over10km(7)} + +RelevanceTrafficDirection ::= ENUMERATED {allTrafficDirections(0), upstreamTraffic(1), downstreamTraffic(2), oppositeTraffic(3)} + +TransmissionInterval ::= INTEGER {oneMilliSecond(1), tenSeconds(10000)} (1..10000) + +ValidityDuration ::= INTEGER {timeOfDetection(0), oneSecondAfterDetection(1)} (0..86400) + +ActionID ::= SEQUENCE { + originatingStationID StationID, + sequenceNumber SequenceNumber +} + +ItineraryPath ::= SEQUENCE SIZE(1..40) OF ReferencePosition + +ProtectedCommunicationZone ::= SEQUENCE { + protectedZoneType ProtectedZoneType, + expiryTime TimestampIts OPTIONAL, + protectedZoneLatitude Latitude, + protectedZoneLongitude Longitude, + protectedZoneRadius ProtectedZoneRadius OPTIONAL, + protectedZoneID ProtectedZoneID OPTIONAL, + ... +} + +Traces ::= SEQUENCE SIZE(1..7) OF PathHistory + +NumberOfOccupants ::= INTEGER {oneOccupant (1), unavailable(127)} (0 .. 127) + +SequenceNumber ::= INTEGER (0..65535) + +PositionOfPillars ::= SEQUENCE (SIZE(1..3, ...)) OF PosPillar + +RestrictedTypes ::= SEQUENCE (SIZE(1..3, ...)) OF StationType + +EventHistory::= SEQUENCE (SIZE(1..23)) OF EventPoint + +EventPoint ::= SEQUENCE { + eventPosition DeltaReferencePosition, + eventDeltaTime PathDeltaTime OPTIONAL, + informationQuality InformationQuality +} + +ProtectedCommunicationZonesRSU ::= SEQUENCE (SIZE(1..16)) OF ProtectedCommunicationZone + +CenDsrcTollingZone ::= SEQUENCE { + protectedZoneLatitude Latitude, + protectedZoneLongitude Longitude, + cenDsrcTollingZoneID CenDsrcTollingZoneID OPTIONAL, + ... +} + +ProtectedZoneRadius ::= INTEGER {oneMeter(1)} (1..255,...) + +ProtectedZoneID ::= INTEGER (0.. 134217727) + +CenDsrcTollingZoneID ::= ProtectedZoneID + +DigitalMap ::= SEQUENCE (SIZE(1..256)) OF ReferencePosition + +OpeningDaysHours ::= UTF8String + +PhoneNumber ::= NumericString (SIZE(1..16)) +END diff --git a/asn1/Security/1609Dot2/IEEE1609dot2.asn b/asn1/Security/1609Dot2/IEEE1609dot2.asn index 18293c86..43967635 100644 --- a/asn1/Security/1609Dot2/IEEE1609dot2.asn +++ b/asn1/Security/1609Dot2/IEEE1609dot2.asn @@ -2,6 +2,7 @@ IEEE1609dot2 {iso(1) identified-organization(3) ieee(111) standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) base (1) schema (1) major-version-2(2)} +-- Minor version: 1 --****************************************************************************** -- -- IEEE P1609.2 Data Types @@ -282,14 +283,13 @@ LinkageData ::= SEQUENCE { group-linkage-value GroupLinkageValue OPTIONAL } ---EndEntityType ::= BIT STRING {app (0), enrol (1) } (SIZE (8)) (ALL EXCEPT {}) -EndEntityType ::= BIT STRING {app (0), enrol (1) } (SIZE (8)) +EndEntityType ::= BIT STRING {app (0), enrol (1) } (SIZE (8)) (ALL EXCEPT {}) PsidGroupPermissions ::= SEQUENCE { subjectPermissions SubjectPermissions, minChainLength INTEGER DEFAULT 1, chainLengthRange INTEGER DEFAULT 0, - eeType EndEntityType DEFAULT '80'H + eeType EndEntityType DEFAULT {app} } SequenceOfPsidGroupPermissions ::= SEQUENCE OF PsidGroupPermissions diff --git a/asn1/Security/1609Dot2/IEEE1609dot2BaseTypes.asn b/asn1/Security/1609Dot2/IEEE1609dot2BaseTypes.asn index 700f7b9b..59ed4217 100644 --- a/asn1/Security/1609Dot2/IEEE1609dot2BaseTypes.asn +++ b/asn1/Security/1609Dot2/IEEE1609dot2BaseTypes.asn @@ -2,6 +2,7 @@ IEEE1609dot2BaseTypes {iso(1) identified-organization(3) ieee(111) standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) base(1) base-types(2) major-version-2(2)} +-- Minor version: 1 -- --******************************************************************** -- IEEE P1609.2 Base Data Types diff --git a/asn1/Security/EtsiTs103097Module.asn b/asn1/Security/EtsiTs103097Module.asn index 88ed76a6..59d8aa93 100644 --- a/asn1/Security/EtsiTs103097Module.asn +++ b/asn1/Security/EtsiTs103097Module.asn @@ -13,8 +13,7 @@ IEEE1609dot2 {iso(1) identified-organization(3) ieee(111) standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) base (1) schema (1) major-version-2(2)}; -EtsiTs103097Certificate::= ExplicitCertificate - (WITH COMPONENTS{..., +EtsiTs103097Certificate::= ExplicitCertificate (WITH COMPONENTS{..., toBeSigned (WITH COMPONENTS{..., id (WITH COMPONENTS{..., linkageData ABSENT, @@ -41,13 +40,12 @@ EtsiTs103097Data::=Ieee1609Dot2Data (WITH COMPONENTS {..., }) }), signer (WITH COMPONENTS {..., --constraints on the certificate - certificate (SIZE(1)) + certificate (WITH COMPONENT (SingleEtsiTs103097Certificate)) }) }), encryptedData (WITH COMPONENTS {..., -- constraints on encrypted data headers recipients (WITH COMPONENT ( (WITH COMPONENTS {..., - pskRecipInfo ABSENT, symmRecipInfo ABSENT, rekRecipInfo ABSENT }) diff --git a/asn1/Security/TS102921/EtsiTs102941BaseTypes.asn b/asn1/Security/TS102921/EtsiTs102941BaseTypes.asn index b741b39d..466fcf8b 100644 --- a/asn1/Security/TS102921/EtsiTs102941BaseTypes.asn +++ b/asn1/Security/TS102921/EtsiTs102941BaseTypes.asn @@ -1,5 +1,5 @@ EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1) } +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version2(2) } DEFINITIONS AUTOMATIC TAGS ::= BEGIN @@ -11,15 +11,16 @@ IEEE1609dot2BaseTypes {iso(1) identified-organization(3) ieee(111) standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) base(1) base-types(2) major-version-2(2)} -CertificateId, SubjectAssurance, SequenceOfPsidSsp, SequenceOfPsidGroupPermissions, ValidityPeriod, GeographicRegion + CertificateId, SubjectAssurance, SequenceOfPsidSsp, SequenceOfPsidGroupPermissions, + ValidityPeriod, GeographicRegion FROM IEEE1609dot2 {iso(1) identified-organization(3) ieee(111) -standards-association-numbered-series-standards(2) wave-stds(1609) -dot2(2) base (1) schema (1) major-version-2(2)} +standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) base (1) schema (1) major-version-2(2)} -EtsiTs103097Data-Encrypted, EtsiTs103097Data-Signed, EtsiTs103097Data-SignedExternalPayload -FROM EtsiTs103097Module -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} + EtsiTs103097Data, EtsiTs103097Data-Encrypted, EtsiTs103097Data-Signed, +EtsiTs103097Data-SignedExternalPayload +FROM + EtsiTs103097Module { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} ; CertificateFormat::= INTEGER { @@ -47,9 +48,15 @@ PublicKeys ::= SEQUENCE { encryptionKey PublicEncryptionKey OPTIONAL } - Version ::= INTEGER {v1(1)} +Version ::= INTEGER {v1(1)}(1..255) -EtsiTs103097Data-Encrypted-Unicast {ToBeEncryptedDataContent} ::= EtsiTs103097Data-Encrypted {ToBeEncryptedDataContent} +EtsiTs103097Data-Unsecured {ToBeSentDataContent} ::= EtsiTs103097Data (WITH COMPONENTS {..., + content (WITH COMPONENTS { + unsecuredData (CONTAINING ToBeSentDataContent) + }) +}) + +EtsiTs103097Data-Encrypted-Unicast {ToBeEncryptedDataContent} ::= EtsiTs103097Data-Encrypted { EtsiTs103097Data-Unsecured{ToBeEncryptedDataContent}} (WITH COMPONENTS {..., content (WITH COMPONENTS { encryptedData (WITH COMPONENTS {..., @@ -58,6 +65,13 @@ EtsiTs103097Data-Encrypted-Unicast {ToBeEncryptedDataContent} ::= EtsiTs103097Da }) }) -EtsiTs103097Data-SignedAndEncrypted-Unicast {ToBesignedAndEncryptedDataContent} ::= EtsiTs103097Data-Encrypted-Unicast {EtsiTs103097Data-Signed {ToBesignedAndEncryptedDataContent}} +EtsiTs103097Data-SignedAndEncrypted-Unicast {ToBesignedAndEncryptedDataContent} ::= EtsiTs103097Data-Encrypted {EtsiTs103097Data-Signed {ToBesignedAndEncryptedDataContent}} +(WITH COMPONENTS {..., + content (WITH COMPONENTS { + encryptedData (WITH COMPONENTS {..., + recipients (SIZE(1)) + }) + }) +}) END diff --git a/asn1/Security/TS102921/EtsiTs102941MessagesCA.asn b/asn1/Security/TS102921/EtsiTs102941MessagesCA.asn index c7b2d400..c91705fe 100644 --- a/asn1/Security/TS102921/EtsiTs102941MessagesCA.asn +++ b/asn1/Security/TS102921/EtsiTs102941MessagesCA.asn @@ -3,7 +3,7 @@ It should be used when all PKI messages needs to be implemented (for example, for CA development) **************************************************************************************/ EtsiTs102941MessagesCa - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) messagesCa(0) version1(1)} + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) messagesCa(0) version2(2)} DEFINITIONS AUTOMATIC TAGS ::= BEGIN @@ -21,27 +21,27 @@ Version, EtsiTs103097Data-Encrypted-Unicast, EtsiTs103097Data-SignedAndEncrypted-Unicast FROM EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1) } +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version2(2) } InnerEcRequestSignedForPop, InnerEcResponse FROM EtsiTs102941TypesEnrolment -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) enrolment(4) version1(1) } +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) enrolment(4) version2(2) } InnerAtRequest, InnerAtResponse FROM EtsiTs102941TypesAuthorization -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version1(1) } +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version2(2) } ToBeSignedCrl, ToBeSignedTlmCtl, ToBeSignedRcaCtl FROM EtsiTs102941TrustLists -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) trustLists(6) version1(1) } +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) trustLists(6) version2(2) } AuthorizationValidationRequest, AuthorizationValidationResponse FROM EtsiTs102941TypesAuthorizationValidation -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authValidation(7) version1(1) } +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authValidation(7) version2(2) } CaCertificateRequest FROM EtsiTs102941TypesCaManagement -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) caManagement(8) version1(1) } +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) caManagement(8) version2(2) } ; diff --git a/asn1/Security/TS102921/EtsiTs102941MessagesItss_OptionalPrivacy.asn b/asn1/Security/TS102921/EtsiTs102941MessagesItss-OptionalPrivacy.asn similarity index 92% rename from asn1/Security/TS102921/EtsiTs102941MessagesItss_OptionalPrivacy.asn rename to asn1/Security/TS102921/EtsiTs102941MessagesItss-OptionalPrivacy.asn index cd63d350..f8ecb3c9 100644 --- a/asn1/Security/TS102921/EtsiTs102941MessagesItss_OptionalPrivacy.asn +++ b/asn1/Security/TS102921/EtsiTs102941MessagesItss-OptionalPrivacy.asn @@ -1,75 +1,75 @@ -/************************************************************************************* - This file contains the EtsiTs102941MessagesItss-OptionalPrivacy module providing the - same subset of messages as the EtsiTs102941MessagesItss module. - It should never be used together with the EtsiTs102941MessagesCA and EtsiTs102941MessagesItss - - This module allows the usage of unencrypted EC signature for AA requests. -**************************************************************************************/ -EtsiTs102941MessagesItss-OptionalPrivacy - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) messagesItssOp(2) version1(1)} - -DEFINITIONS AUTOMATIC TAGS ::= -BEGIN - -IMPORTS - -EtsiTs103097Data-Signed ---EtsiTs103097Data-Encrypted, ---EtsiTs103097Data-SignedAndEncrypted -FROM EtsiTs103097Module -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0) } - -EtsiTs103097Data-Encrypted-Unicast, -EtsiTs103097Data-SignedAndEncrypted-Unicast, -Version -FROM EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1) } - -InnerEcRequestSignedForPop, InnerEcResponse -FROM EtsiTs102941TypesEnrolment -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) enrolment(4) version1(1) } - -InnerAtRequest, InnerAtResponse -FROM EtsiTs102941TypesAuthorization -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version1(1) } - -ToBeSignedCrl, ToBeSignedTlmCtl, ToBeSignedRcaCtl -FROM EtsiTs102941TrustLists -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) trustLists(6) version1(1) } - -; - -/************ --- Messages -************/ - -EnrolmentRequestMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentRequest PRESENT})})} -EnrolmentResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentResponse PRESENT})})} -AuthorizationRequestMessage ::= EtsiTs103097Data-Encrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} -AuthorizationRequestMessageWithPop ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} -AuthorizationResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationResponse PRESENT})})} -CertificateRevocationListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateRevocationList PRESENT})})} -TlmCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListTlm PRESENT})})} -RcaCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListRca PRESENT})})} - -/************ --- EtsiTs102941Data -************/ - -EtsiTs102941Data::= SEQUENCE { - version INTEGER { v1(1) }(1..255), - content EtsiTs102941DataContent - } - -EtsiTs102941DataContent ::= CHOICE { - enrolmentRequest InnerEcRequestSignedForPop, - enrolmentResponse InnerEcResponse, - authorizationRequest InnerAtRequest, - authorizationResponse InnerAtResponse, - certificateRevocationList ToBeSignedCrl, - certificateTrustListTlm ToBeSignedTlmCtl, - certificateTrustListRca ToBeSignedRcaCtl, - ... - } - -END +/************************************************************************************* + This file contains the EtsiTs102941MessagesItss-OptionalPrivacy module providing the + same subset of messages as the EtsiTs102941MessagesItss module. + It should never be used together with the EtsiTs102941MessagesCA and EtsiTs102941MessagesItss + + This module allows the usage of unencrypted EC signature for AA requests. +**************************************************************************************/ +EtsiTs102941MessagesItss-OptionalPrivacy + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) messagesItssOp(2) version2(2)} + +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +IMPORTS + +EtsiTs103097Data-Signed +--EtsiTs103097Data-Encrypted, +--EtsiTs103097Data-SignedAndEncrypted +FROM EtsiTs103097Module +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0) } + +EtsiTs103097Data-Encrypted-Unicast, +EtsiTs103097Data-SignedAndEncrypted-Unicast, +Version +FROM EtsiTs102941BaseTypes +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version2(2) } + +InnerEcRequestSignedForPop, InnerEcResponse +FROM EtsiTs102941TypesEnrolment +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) enrolment(4) version2(2) } + +InnerAtRequest, InnerAtResponse +FROM EtsiTs102941TypesAuthorization +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version2(2) } + +ToBeSignedCrl, ToBeSignedTlmCtl, ToBeSignedRcaCtl +FROM EtsiTs102941TrustLists +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) trustLists(6) version2(2) } + +; + +/************ +-- Messages +************/ + +EnrolmentRequestMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentRequest PRESENT})})} +EnrolmentResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentResponse PRESENT})})} +AuthorizationRequestMessage ::= EtsiTs103097Data-Encrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} +AuthorizationRequestMessageWithPop ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} +AuthorizationResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationResponse PRESENT})})} +CertificateRevocationListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateRevocationList PRESENT})})} +TlmCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListTlm PRESENT})})} +RcaCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListRca PRESENT})})} + +/************ +-- EtsiTs102941Data +************/ + +EtsiTs102941Data::= SEQUENCE { + version INTEGER { v1(1) }(1..255), + content EtsiTs102941DataContent + } + +EtsiTs102941DataContent ::= CHOICE { + enrolmentRequest InnerEcRequestSignedForPop, + enrolmentResponse InnerEcResponse, + authorizationRequest InnerAtRequest, + authorizationResponse InnerAtResponse, + certificateRevocationList ToBeSignedCrl, + certificateTrustListTlm ToBeSignedTlmCtl, + certificateTrustListRca ToBeSignedRcaCtl, + ... + } + +END diff --git a/asn1/Security/TS102921/EtsiTs102941MessagesItss.asn b/asn1/Security/TS102921/EtsiTs102941MessagesItss.asn index 1c67c1c9..47ebe37d 100644 --- a/asn1/Security/TS102921/EtsiTs102941MessagesItss.asn +++ b/asn1/Security/TS102921/EtsiTs102941MessagesItss.asn @@ -7,7 +7,7 @@ This module blocks the usage of unencrypted EC signature for AA requests. **************************************************************************************/ EtsiTs102941MessagesItss - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) messagesItss(1) version1(1)} + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) messagesItss(1) version2(2)} DEFINITIONS AUTOMATIC TAGS ::= BEGIN @@ -24,19 +24,19 @@ EtsiTs103097Data-Encrypted-Unicast, EtsiTs103097Data-SignedAndEncrypted-Unicast, Version FROM EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1) } +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version2(2) } InnerEcRequestSignedForPop, InnerEcResponse FROM EtsiTs102941TypesEnrolment -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) enrolment(4) version1(1) } +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) enrolment(4) version2(2) } InnerAtRequest, InnerAtResponse FROM EtsiTs102941TypesAuthorization -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version1(1) } +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version2(2) } ToBeSignedCrl, ToBeSignedTlmCtl, ToBeSignedRcaCtl FROM EtsiTs102941TrustLists -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) trustLists(6) version1(1) } +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) trustLists(6) version2(2) } ; diff --git a/asn1/Security/TS102921/EtsiTs102941TrustLists.asn b/asn1/Security/TS102921/EtsiTs102941TrustLists.asn index c180a6bf..35b70cb0 100644 --- a/asn1/Security/TS102921/EtsiTs102941TrustLists.asn +++ b/asn1/Security/TS102921/EtsiTs102941TrustLists.asn @@ -1,5 +1,5 @@ EtsiTs102941TrustLists - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) trustLists(6) version1(1)} + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) trustLists(6) version2(2)} DEFINITIONS AUTOMATIC TAGS ::= BEGIN @@ -13,7 +13,7 @@ EtsiTs103097Module HashedId8, Time32, Version --, CertificateAuthorityConstraints FROM EtsiTs102941BaseTypes -{itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1)} +{itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version2(2)} ; diff --git a/asn1/Security/TS102921/EtsiTs102941TypesAuthorization.asn b/asn1/Security/TS102921/EtsiTs102941TypesAuthorization.asn index f119b24a..3ea56ef7 100644 --- a/asn1/Security/TS102921/EtsiTs102941TypesAuthorization.asn +++ b/asn1/Security/TS102921/EtsiTs102941TypesAuthorization.asn @@ -1,5 +1,5 @@ EtsiTs102941TypesAuthorization - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version1(1)} + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version2(2)} DEFINITIONS AUTOMATIC TAGS ::= BEGIN @@ -13,7 +13,7 @@ FROM EtsiTs103097Module CertificateFormat, CertificateSubjectAttributes, EcSignature, HashedId8, PublicKeys, Version FROM EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1) } +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version2(2) } ; @@ -26,7 +26,7 @@ AuthorizationResponseCode ::= ENUMERATED { -- ITS->AA its-aa-cantparse, -- valid for any structure its-aa-badcontenttype, -- not encrypted, not signed, not authorizationrequest - its-aa-imnottherecipient, -- the “recipients” of the outermost encrypted data doesn’t include me + its-aa-imnottherecipient, -- the "recipients" of the outermost encrypted data doesn't include me its-aa-unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm its-aa-decryptionfailed, -- works for ECIES-HMAC and AES-CCM its-aa-keysdontmatch, -- HMAC keyTag verification fails @@ -41,14 +41,14 @@ AuthorizationResponseCode ::= ENUMERATED { -- EA->AA ea-aa-cantparse, -- valid for any structure ea-aa-badcontenttype, -- not encrypted, not signed, not authorizationrequest - ea-aa-imnottherecipient, -- the “recipients” of the outermost encrypted data doesn’t include me + ea-aa-imnottherecipient, -- the "recipients" of the outermost encrypted data doesn't include me ea-aa-unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm ea-aa-decryptionfailed, -- works for ECIES-HMAC and AES-CCM -- TODO: to be continued... invalidaa, -- the AA certificate presented is invalid/revoked/whatever - invalidaasignature, -- the AA certificate presented can’t validate the request signature - wrongea, -- the encrypted signature doesn’t designate me as the EA - unknownits, -- can’t retrieve the EC/ITS in my DB + invalidaasignature, -- the AA certificate presented can't validate the request signature + wrongea, -- the encrypted signature doesn't designate me as the EA + unknownits, -- can't retrieve the EC/ITS in my DB invalidsignature, -- signature verification of the request by the EC fails invalidencryptionkey, -- signature is good, but the key is bad deniedpermissions, -- permissions not granted diff --git a/asn1/Security/TS102921/EtsiTs102941TypesAuthorizationValidation.asn b/asn1/Security/TS102921/EtsiTs102941TypesAuthorizationValidation.asn index 81d353cd..e73dcdca 100644 --- a/asn1/Security/TS102921/EtsiTs102941TypesAuthorizationValidation.asn +++ b/asn1/Security/TS102921/EtsiTs102941TypesAuthorizationValidation.asn @@ -1,5 +1,5 @@ EtsiTs102941TypesAuthorizationValidation - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authValidation(7) version1(1)} + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authValidation(7) version2(2)} DEFINITIONS AUTOMATIC TAGS ::= BEGIN @@ -12,11 +12,11 @@ FROM EtsiTs103097Module CertificateFormat, CertificateSubjectAttributes,EcSignature, HashedId8, PublicKeys, Version FROM EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1) } +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version2(2) } SharedAtRequest FROM EtsiTs102941TypesAuthorization -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version1(1)} +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version2(2)} ; @@ -28,13 +28,13 @@ AuthorizationValidationResponseCode ::= ENUMERATED { ok(0), cantparse, -- valid for any structure badcontenttype, -- not encrypted, not signed, not permissionsverificationrequest - imnottherecipient, -- the “recipients” of the outermost encrypted data doesn’t include me + imnottherecipient, -- the "recipients" of the outermost encrypted data doesn't include me unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm decryptionfailed, -- works for ECIES-HMAC and AES-CCM invalidaa, -- the AA certificate presented is invalid/revoked/whatever - invalidaasignature, -- the AA certificate presented can’t validate the request signature - wrongea, -- the encrypted signature doesn’t designate me as the EA - unknownits, -- can’t retrieve the EC/ITS in my DB + invalidaasignature, -- the AA certificate presented can't validate the request signature + wrongea, -- the encrypted signature doesn't designate me as the EA + unknownits, -- can't retrieve the EC/ITS in my DB invalidsignature, -- signature verification of the request by the EC fails invalidencryptionkey, -- signature is good, but the responseEncryptionKey is bad deniedpermissions, -- requested permissions not granted @@ -51,7 +51,7 @@ AuthorizationValidationRequest ::= SEQUENCE { AuthorizationValidationResponse ::= SEQUENCE { requestHash OCTET STRING (SIZE(16)), responseCode AuthorizationValidationResponseCode, - confirmedSubjectAttributes CertificateSubjectAttributes (WITH COMPONENTS{certIssuePermissions ABSENT}) OPTIONAL, + confirmedSubjectAttributes CertificateSubjectAttributes (WITH COMPONENTS{..., certIssuePermissions ABSENT}) OPTIONAL, ... } (WITH COMPONENTS { responseCode (ok), confirmedSubjectAttributes PRESENT } diff --git a/asn1/Security/TS102921/EtsiTs102941TypesCaManagement.asn b/asn1/Security/TS102921/EtsiTs102941TypesCaManagement.asn index 1b31af63..135f99be 100644 --- a/asn1/Security/TS102921/EtsiTs102941TypesCaManagement.asn +++ b/asn1/Security/TS102921/EtsiTs102941TypesCaManagement.asn @@ -1,5 +1,5 @@ EtsiTs102941TypesCaManagement - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) caManagement(8) version1(1)} + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) caManagement(8) version2(2)} DEFINITIONS AUTOMATIC TAGS ::= BEGIN @@ -13,7 +13,7 @@ EtsiTs103097Module PublicKeys, CertificateSubjectAttributes FROM EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1)} +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version2(2)} ; diff --git a/asn1/Security/TS102921/EtsiTs102941TypesEnrolment.asn b/asn1/Security/TS102921/EtsiTs102941TypesEnrolment.asn index 42a73c01..a538bcdb 100644 --- a/asn1/Security/TS102921/EtsiTs102941TypesEnrolment.asn +++ b/asn1/Security/TS102921/EtsiTs102941TypesEnrolment.asn @@ -1,5 +1,5 @@ EtsiTs102941TypesEnrolment - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) enrolment(4) version1(1)} + { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) enrolment(4) version2(2)} DEFINITIONS AUTOMATIC TAGS ::= BEGIN @@ -13,7 +13,7 @@ FROM EtsiTs103097Module CertificateFormat, CertificateSubjectAttributes, EcSignature, HashedId8, PublicKeys, Version FROM EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version1(1) } +{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version2(2) } ; @@ -25,10 +25,10 @@ EnrolmentResponseCode ::= ENUMERATED { ok(0), cantparse, -- valid for any structure badcontenttype, -- not encrypted, not signed, not enrolmentrequest - imnottherecipient, -- the “recipients†doesn’t include me + imnottherecipient, -- the "recipients" doesn't include me unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm decryptionfailed, -- works for ECIES-HMAC and AES-CCM - unknownits, -- can’t retrieve the ITS from the itsId + unknownits, -- can't retrieve the ITS from the itsId invalidsignature, -- signature verification of the request fails invalidencryptionkey, -- signature is good, but the responseEncryptionKey is bad baditsstatus, -- revoked, not yet active @@ -44,7 +44,7 @@ InnerEcRequest ::= SEQUENCE { itsId OCTET STRING, certificateFormat CertificateFormat, publicKeys PublicKeys, - requestedSubjectAttributes CertificateSubjectAttributes (WITH COMPONENTS{certIssuePermissions ABSENT}), + requestedSubjectAttributes CertificateSubjectAttributes (WITH COMPONENTS{..., certIssuePermissions ABSENT}), ... } -- GitLab From 594fb7768eeab565fddac09e4111f230673da5bd Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Mon, 6 Jul 2020 09:21:40 +0200 Subject: [PATCH 247/320] Remove TITAN unsupported constraint --- asn1/Security/EtsiTs103097Module.asn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asn1/Security/EtsiTs103097Module.asn b/asn1/Security/EtsiTs103097Module.asn index 59d8aa93..7b000601 100644 --- a/asn1/Security/EtsiTs103097Module.asn +++ b/asn1/Security/EtsiTs103097Module.asn @@ -40,7 +40,7 @@ EtsiTs103097Data::=Ieee1609Dot2Data (WITH COMPONENTS {..., }) }), signer (WITH COMPONENTS {..., --constraints on the certificate - certificate (WITH COMPONENT (SingleEtsiTs103097Certificate)) + certificate --(WITH COMPONENT (SingleEtsiTs103097Certificate)) }) }), encryptedData (WITH COMPONENTS {..., -- constraints on encrypted data headers -- GitLab From 77d9323b8629de157cfe576aeebfadb8fe740773 Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 6 Jul 2020 09:26:51 +0200 Subject: [PATCH 248/320] Add missing varaint --- ttcn/Pki/LibItsPki_TestSystem.ttcn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index 33518c28..d043c9c9 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -53,6 +53,8 @@ module LibItsPki_TestSystem { type port InfoPort message { inout InfoPortData + } with { + extension "internal" } // End of InfoPort } // End of group portDefinitions -- GitLab From 9ed0fa56317435ad7ccd04ce36d2588d7206982a Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Thu, 9 Jul 2020 17:47:06 +0200 Subject: [PATCH 249/320] Realign ASN.1 files for Security --- .../TS102921/EtsiTs102941BaseTypes.asn | 2 +- .../TS102921/EtsiTs102941MessagesCA.asn | 2 +- ...siTs102941MessagesItss-OptionalPrivacy.asn | 2 +- .../TS102921/EtsiTs102941MessagesItss.asn | 2 +- .../TS102921/EtsiTs102941TrustLists.asn | 2 +- ttcn/CAM/LibItsCam_Pics.ttcn | 13 +- ttcn/DENM/LibItsDenm_Templates.ttcn | 2 +- .../LibItsGeoNetworking_Functions.ttcn | 2 +- .../LibItsGeoNetworking_Pics.ttcn | 2 +- .../LibItsGeoNetworking_Pixits.ttcn | 12 +- .../LibItsGeoNetworking_Templates.ttcn | 12 +- .../LibItsGeoNetworking_TypesAndValues.ttcn | 2 +- ttcn/Pki/LibItsPki_Functions.ttcn | 137 ++++++++++++++---- 13 files changed, 132 insertions(+), 60 deletions(-) diff --git a/asn1/Security/TS102921/EtsiTs102941BaseTypes.asn b/asn1/Security/TS102921/EtsiTs102941BaseTypes.asn index 466fcf8b..20eacfa8 100644 --- a/asn1/Security/TS102921/EtsiTs102941BaseTypes.asn +++ b/asn1/Security/TS102921/EtsiTs102941BaseTypes.asn @@ -48,7 +48,7 @@ PublicKeys ::= SEQUENCE { encryptionKey PublicEncryptionKey OPTIONAL } -Version ::= INTEGER {v1(1)}(1..255) +Version ::= INTEGER {v1(1)} EtsiTs103097Data-Unsecured {ToBeSentDataContent} ::= EtsiTs103097Data (WITH COMPONENTS {..., content (WITH COMPONENTS { diff --git a/asn1/Security/TS102921/EtsiTs102941MessagesCA.asn b/asn1/Security/TS102921/EtsiTs102941MessagesCA.asn index c91705fe..6c4df67b 100644 --- a/asn1/Security/TS102921/EtsiTs102941MessagesCA.asn +++ b/asn1/Security/TS102921/EtsiTs102941MessagesCA.asn @@ -66,7 +66,7 @@ CaCertificateRekeyingMessage ::= EtsiTs103097Data-Signed {EtsiTs103097Data-Signe ************/ EtsiTs102941Data::= SEQUENCE { - version INTEGER { v1(1) }(1..255), + version Version (v1), --(1..255) Required for TITAN content EtsiTs102941DataContent } diff --git a/asn1/Security/TS102921/EtsiTs102941MessagesItss-OptionalPrivacy.asn b/asn1/Security/TS102921/EtsiTs102941MessagesItss-OptionalPrivacy.asn index f8ecb3c9..cffcef73 100644 --- a/asn1/Security/TS102921/EtsiTs102941MessagesItss-OptionalPrivacy.asn +++ b/asn1/Security/TS102921/EtsiTs102941MessagesItss-OptionalPrivacy.asn @@ -57,7 +57,7 @@ RcaCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WIT ************/ EtsiTs102941Data::= SEQUENCE { - version INTEGER { v1(1) }(1..255), + version Version (v1), --(1..255) Required for TITAN content EtsiTs102941DataContent } diff --git a/asn1/Security/TS102921/EtsiTs102941MessagesItss.asn b/asn1/Security/TS102921/EtsiTs102941MessagesItss.asn index 47ebe37d..1ff502bb 100644 --- a/asn1/Security/TS102921/EtsiTs102941MessagesItss.asn +++ b/asn1/Security/TS102921/EtsiTs102941MessagesItss.asn @@ -58,7 +58,7 @@ RcaCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WIT ************/ EtsiTs102941Data::= SEQUENCE { - version INTEGER { v1(1) }(1..255), + version Version, content EtsiTs102941DataContent } diff --git a/asn1/Security/TS102921/EtsiTs102941TrustLists.asn b/asn1/Security/TS102921/EtsiTs102941TrustLists.asn index 35b70cb0..1f7469dd 100644 --- a/asn1/Security/TS102921/EtsiTs102941TrustLists.asn +++ b/asn1/Security/TS102921/EtsiTs102941TrustLists.asn @@ -21,7 +21,7 @@ FROM EtsiTs102941BaseTypes -- CRL ************/ ToBeSignedCrl ::= SEQUENCE { - version INTEGER { v1(1) }(1..255), + version Version, thisUpdate Time32, nextUpdate Time32, entries SEQUENCE OF CrlEntry, diff --git a/ttcn/CAM/LibItsCam_Pics.ttcn b/ttcn/CAM/LibItsCam_Pics.ttcn index 20235010..b32e1885 100644 --- a/ttcn/CAM/LibItsCam_Pics.ttcn +++ b/ttcn/CAM/LibItsCam_Pics.ttcn @@ -115,17 +115,16 @@ module LibItsCam_Pics { group radioComm { + type enumerated RadioAccess { + e_its_g5, + e_lte_cv2x + } + /** * @desc Does radio communication use G5? * @see ETSI TS 102 868-1 Table A.3 */ - modulepar boolean PICS_G5_RADIO_COMM := true; - - /** - * @desc Does radio communication use LTE-V2X? - * @see ETSI TS 102 868-1 Table A.3 - */ - modulepar boolean PICS_CV2X_RADIO_COMM := false; + modulepar RadioAccess PICS_RADIO_COMM := e_its_g5; } // End of group radioComm } // end LibItsCam_Pics diff --git a/ttcn/DENM/LibItsDenm_Templates.ttcn b/ttcn/DENM/LibItsDenm_Templates.ttcn index 9e591264..2c529e99 100644 --- a/ttcn/DENM/LibItsDenm_Templates.ttcn +++ b/ttcn/DENM/LibItsDenm_Templates.ttcn @@ -578,7 +578,7 @@ module LibItsDenm_Templates { eventPosition := ?, relevanceDistance := *, relevanceTrafficDirection := *, - validityDuration := ?, // It seems that a default value can be omitted (asn1studio) + validityDuration := ?, transmissionInterval := *, stationType := ? } diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn index fb7082c3..ca0eaae8 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn @@ -185,7 +185,7 @@ module LibItsGeoNetworking_Functions { f_initialiseComponent(v_positionTable, v_areaTable, c_compNodeB); - } // end f_cf01Up + } // End of group f_cf01Up function f_cf01Down() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Pics.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Pics.ttcn index 716a43ca..16d13115 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Pics.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Pics.ttcn @@ -28,7 +28,7 @@ module LibItsGeoNetworking_Pics { modulepar GN_Address PICS_GN_LOCAL_GN_ADDR := { typeOfAddress := e_manual, stationType := e_passengerCar, - stationCountryCode := c_uInt10Zero, + reserved := c_uInt10Zero, mid := c_6ZeroBytes }; diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Pixits.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Pixits.ttcn index b0e8d756..768ee778 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Pixits.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Pixits.ttcn @@ -29,7 +29,7 @@ module LibItsGeoNetworking_Pixits { modulepar GN_Address PX_TS_NODE_A_LOCAL_GN_ADDR := { typeOfAddress := e_manual, stationType := e_passengerCar, - stationCountryCode := c_uInt10Zero, + reserved := c_uInt10Zero, mid := int2oct(10,6) }; @@ -40,7 +40,7 @@ module LibItsGeoNetworking_Pixits { modulepar GN_Address PX_TS_NODE_B_LOCAL_GN_ADDR := { typeOfAddress := e_manual, stationType := e_passengerCar, - stationCountryCode := c_uInt10Zero, + reserved := c_uInt10Zero, mid := int2oct(11,6) }; @@ -51,7 +51,7 @@ module LibItsGeoNetworking_Pixits { modulepar GN_Address PX_TS_NODE_C_LOCAL_GN_ADDR := { typeOfAddress := e_manual, stationType := e_passengerCar, - stationCountryCode := c_uInt10Zero, + reserved := c_uInt10Zero, mid := int2oct(12,6) }; @@ -62,7 +62,7 @@ module LibItsGeoNetworking_Pixits { modulepar GN_Address PX_TS_NODE_D_LOCAL_GN_ADDR := { typeOfAddress := e_manual, stationType := e_passengerCar, - stationCountryCode := c_uInt10Zero, + reserved := c_uInt10Zero, mid := int2oct(13,6) }; @@ -73,7 +73,7 @@ module LibItsGeoNetworking_Pixits { modulepar GN_Address PX_TS_NODE_E_LOCAL_GN_ADDR := { typeOfAddress := e_manual, stationType := e_passengerCar, - stationCountryCode := c_uInt10Zero, + reserved := c_uInt10Zero, mid := int2oct(14,6) }; @@ -84,7 +84,7 @@ module LibItsGeoNetworking_Pixits { modulepar GN_Address PX_TS_NODE_F_LOCAL_GN_ADDR := { typeOfAddress := e_manual, stationType := e_passengerCar, - stationCountryCode := c_uInt10Zero, + reserved := c_uInt10Zero, mid := int2oct(15,6) }; diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn index fba7d697..440339eb 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn @@ -1590,22 +1590,22 @@ module LibItsGeoNetworking_Templates { template GN_Address mw_gnAddressAny := { typeOfAddress := ?, stationType := ?, - stationCountryCode := ?, + reserved := ?, mid := ? } /** * @desc Receive template for GN_Address * @param p_stationType Station's type - * @param p_stationCountryCode Station's country code + * @param p_reserved Station's country code */ template GN_Address mw_gnAddress( template (present) StationType p_stationType, - template (present) UInt10 p_stationCountryCode + template (present) UInt10 p_reserved ) := { typeOfAddress := ?, stationType := p_stationType, - stationCountryCode := p_stationCountryCode, + reserved := p_reserved, mid := ? } @@ -2265,7 +2265,7 @@ module LibItsGeoNetworking_Templates { ) := { typeOfAddress := ?, stationType := ?, - stationCountryCode := ?, + reserved := ?, mid := p_mid } @@ -2277,7 +2277,7 @@ module LibItsGeoNetworking_Templates { template (value) GN_Address m_dummyGnAddr := { typeOfAddress := e_manual, stationType := e_passengerCar, - stationCountryCode := c_uInt10Zero, + reserved := c_uInt10Zero, mid := c_6ZeroBytes } diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn index b52d18af..928fce7f 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn @@ -826,7 +826,7 @@ module LibItsGeoNetworking_TypesAndValues { type record GN_Address { TypeOfAddress typeOfAddress, StationType stationType, - UInt10 stationCountryCode, + UInt10 reserved, Oct6 mid } with { variant "FIELDORDER(msb)" diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 61526783..532b1599 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -2351,7 +2351,7 @@ module LibItsPki_Functions { m_signedData( v_hashId, v_tbs, - m_signerIdentifier_digest(v_ec_hashed_id8), // Signer is thehasheId8 of the EC certificate obtained from Enrolment request + m_signerIdentifier_digest(v_ec_hashed_id8), // Signer is the hasheId8 of the EC certificate obtained from Enrolment request v_signature ) ) @@ -2943,9 +2943,12 @@ module LibItsPki_Functions { group dc { function f_build_dc_ctl( + in octetstring p_private_key, + in octetstring p_issuer, in charstring p_ea_certificate_id, in charstring p_aa_certificate_id, - in charstring p_rca_certificate_id + in charstring p_rca_certificate_id, + out Ieee1609Dot2Data p_ieee_1609Dot2_data ) { // Local variables var EtsiTs103097Certificate v_ea_certificate; @@ -2956,7 +2959,12 @@ module LibItsPki_Functions { var EtsiTs102941Data v_etsi_ts_102941_data; var octetstring p_pki_message; var ToBeSignedData v_tbs; + var bitstring v_tbs_encoded; + var octetstring v_sig; + var Signature v_signature; + log(">>> f_build_dc_ctl"); + // Load certificates f_readCertificate(p_ea_certificate_id, v_ea_certificate); f_readCertificate(p_aa_certificate_id, v_aa_certificate); @@ -2981,7 +2989,52 @@ module LibItsPki_Functions { m_headerInfo_inner_pki_response(-, (f_getCurrentTime() * 1000)/*us*/) ) ); - + v_tbs_encoded := encvalue(v_tbs); + // Sign the certificate + v_sig := f_signWithEcdsa(bit2oct(v_tbs_encoded), p_issuer, p_private_key); + if ((PX_VE_ALG == e_nist_p256) or (PX_VE_ALG == e_brainpool_p256_r1)) { + v_signature := valueof( + m_signature_ecdsaNistP256( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only( + substr(v_sig, 0, 32) + ), + substr(v_sig, 32, 32) + ) + )); + p_ieee_1609Dot2_data := valueof( + m_etsiTs103097Data_signed( + m_signedData( + sha256, + v_tbs, + m_signerIdentifier_digest(p_issuer), + v_signature + ) + ) + ); + } else if (PX_VE_ALG == e_brainpool_p384_r1) { + v_signature := valueof( + m_signature_ecdsaBrainpoolP384r1( + m_ecdsaP384Signature( + m_eccP384CurvePoint_x_only( + substr(v_sig, 0, 48) + ), + substr(v_sig, 48, 48) + ) + )); + p_ieee_1609Dot2_data := valueof( + m_etsiTs103097Data_signed( + m_signedData( + sha384, + v_tbs, + m_signerIdentifier_digest(p_issuer), + v_signature + ) + ) + ); + } + log("f_build_dc_ctl: p_ieee_1609Dot2_data= ", p_ieee_1609Dot2_data); + } // End of function f_build_dc_ctl } // End of group dc @@ -2989,7 +3042,7 @@ module LibItsPki_Functions { group rca { function f_verify_rca_ctl_response_message( - in Ieee1609Dot2Data p_ieee1609dot2_signed_data, + in EtsiTs103097Data p_etsi_ts_103097_signed_data, in boolean p_check_security := true, out ToBeSignedRcaCtl p_to_be_signed_rca_ctl ) return boolean { @@ -3000,24 +3053,25 @@ module LibItsPki_Functions { var octetstring v_issuer; var EtsiTs102941Data v_etsi_ts_102941_data; - log(">>> f_verify_rca_ctl_response_message: p_ieee1609dot2_signed_data= ", p_ieee1609dot2_signed_data); + log(">>> f_verify_rca_ctl_response_message: p_etsi_ts_103097_signed_data= ", p_etsi_ts_103097_signed_data); // 1. Verify signature - log("f_verify_rca_ctl_response_message: p_ieee1609dot2_signed_data.content.signedData.tbsData= ", p_ieee1609dot2_signed_data.content.signedData.tbsData); - v_tbs := encvalue(p_ieee1609dot2_signed_data.content.signedData.tbsData); - if (f_getCertificateFromDigest(p_ieee1609dot2_signed_data.content.signedData.signer.digest, v_certificate, v_certificate_id) == false) { + log("f_verify_rca_ctl_response_message: p_etsi_ts_103097_signed_data.content.signedData.tbsData= ", p_etsi_ts_103097_signed_data.content.signedData.tbsData); + v_tbs := encvalue(p_etsi_ts_103097_signed_data.content.signedData.tbsData); + if (f_getCertificateFromDigest(p_etsi_ts_103097_signed_data.content.signedData.signer.digest, v_certificate, v_certificate_id) == false) { + log("f_verify_rca_ctl_response_message: Failed to retrieve certificate from ", p_etsi_ts_103097_signed_data.content.signedData.signer.digest); if (p_check_security == true) { return false; } } f_getCertificateHash(v_certificate_id, v_issuer); - if (f_verifyEcdsa(bit2oct(v_tbs), v_issuer, p_ieee1609dot2_signed_data.content.signedData.signature_, v_certificate.toBeSigned.verifyKeyIndicator.verificationKey) == false) { + if (f_verifyEcdsa(bit2oct(v_tbs), v_issuer, p_etsi_ts_103097_signed_data.content.signedData.signature_, v_certificate.toBeSigned.verifyKeyIndicator.verificationKey) == false) { log("f_verify_rca_ctl_response_message: Failed to verify signature"); if (p_check_security == true) { return false; } } - v_etsi_ts_102941_data_msg := oct2bit(p_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); + v_etsi_ts_102941_data_msg := oct2bit(p_etsi_ts_103097_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); if (decvalue(v_etsi_ts_102941_data_msg, v_etsi_ts_102941_data) != 0) { log("f_verify_rca_ctl_response_message: Failed to decode EtsiTs102941Data"); return false; @@ -3028,10 +3082,11 @@ module LibItsPki_Functions { log("f_verify_rca_ctl_response_message: Failed to decode certificateTrustListRca"); return false; } else { + var Time32 v_time := (f_getCurrentTime()/* - 1072915200000*/) / 1000; p_to_be_signed_rca_ctl := v_etsi_ts_102941_data.content.certificateTrustListRca; log("f_verify_rca_ctl_response_message: p_to_be_signed_rca_ctl= ", p_to_be_signed_rca_ctl); - if (p_to_be_signed_rca_ctl.nextUpdate <= f_getCurrentTime() / 1000) { - log("f_verify_rca_ctl_response_message: Invalid nextUpdate value: compared values=", p_to_be_signed_rca_ctl.nextUpdate, "/", f_getCurrentTime() / 1000); + if (p_to_be_signed_rca_ctl.nextUpdate <= v_time) { + log("f_verify_rca_ctl_response_message: Invalid nextUpdate value: compared values=", p_to_be_signed_rca_ctl.nextUpdate, "/", v_time); return false; } } @@ -3041,7 +3096,7 @@ module LibItsPki_Functions { } function f_verify_rca_crl_response_message( - in Ieee1609Dot2Data p_ieee1609dot2_signed_data, + in EtsiTs103097Data p_etsi_ts_103097_signed_data, in boolean p_check_security := true, out ToBeSignedCrl p_to_be_signed_crl ) return boolean { @@ -3052,24 +3107,25 @@ module LibItsPki_Functions { var octetstring v_issuer; var EtsiTs102941Data v_etsi_ts_102941_data; - log(">>> f_verify_rca_crl_response_message: p_ieee1609dot2_signed_data= ", p_ieee1609dot2_signed_data); + log(">>> f_verify_rca_crl_response_message: p_etsi_ts_103097_signed_data= ", p_etsi_ts_103097_signed_data); // 1. Verify signature - log("f_verify_rca_crl_response_message: p_ieee1609dot2_signed_data.content.signedData.tbsData= ", p_ieee1609dot2_signed_data.content.signedData.tbsData); - v_tbs := encvalue(p_ieee1609dot2_signed_data.content.signedData.tbsData); - if (f_getCertificateFromDigest(p_ieee1609dot2_signed_data.content.signedData.signer.digest, v_certificate, v_certificate_id) == false) { + log("f_verify_rca_crl_response_message: p_etsi_ts_103097_signed_data.content.signedData.tbsData= ", p_etsi_ts_103097_signed_data.content.signedData.tbsData); + v_tbs := encvalue(p_etsi_ts_103097_signed_data.content.signedData.tbsData); + if (f_getCertificateFromDigest(p_etsi_ts_103097_signed_data.content.signedData.signer.digest, v_certificate, v_certificate_id) == false) { + log("f_verify_rca_crl_response_message: Failed to retrieve certificate from ", p_etsi_ts_103097_signed_data.content.signedData.signer.digest); if (p_check_security == true) { return false; } } f_getCertificateHash(v_certificate_id, v_issuer); - if (f_verifyEcdsa(bit2oct(v_tbs), v_issuer, p_ieee1609dot2_signed_data.content.signedData.signature_, v_certificate.toBeSigned.verifyKeyIndicator.verificationKey) == false) { + if (f_verifyEcdsa(bit2oct(v_tbs), v_issuer, p_etsi_ts_103097_signed_data.content.signedData.signature_, v_certificate.toBeSigned.verifyKeyIndicator.verificationKey) == false) { log("f_verify_rca_crl_response_message: Failed to verify signature"); if (p_check_security == true) { return false; } } - v_etsi_ts_102941_data_msg := oct2bit(p_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); + v_etsi_ts_102941_data_msg := oct2bit(p_etsi_ts_103097_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); if (decvalue(v_etsi_ts_102941_data_msg, v_etsi_ts_102941_data) != 0) { log("f_verify_rca_crl_response_message: Failed to decode EtsiTs102941Data"); return false; @@ -3080,7 +3136,7 @@ module LibItsPki_Functions { log("f_verify_rca_crl_response_message: Failed to decode certificateRevocationList"); return false; } else { - var Time32 v_time := f_getCurrentTime() / 1000; + var Time32 v_time := (f_getCurrentTime()/* - 1072915200000*/) / 1000; p_to_be_signed_crl := v_etsi_ts_102941_data.content.certificateRevocationList; log("f_verify_rca_crl_response_message: p_to_be_signed_crl= ", p_to_be_signed_crl); if (p_to_be_signed_crl.thisUpdate >= v_time) { @@ -3224,6 +3280,12 @@ module LibItsPki_Functions { } else { // TODO Verify selsigned certificate } + } else if (ischosen(p_ctl_entry.dc)) { + if (match(p_ctl_entry.dc, mw_dc_entry) == false) { + return false; + } else { + // TODO Verify RCA certificate & signature + } } else if (ischosen(p_ctl_entry.rca)) { if (match(p_ctl_entry.rca, mw_root_ca_entry(mw_etsiTs103097Certificate)) == false) { return false; @@ -3242,7 +3304,7 @@ module LibItsPki_Functions { group tlm { function f_verify_tlm_ectl_response_message( - in Ieee1609Dot2Data p_ieee1609dot2_signed_data, + in EtsiTs103097Data p_etsi_ts_103097_signed_data, in boolean p_check_security := true, out ToBeSignedTlmCtl p_to_be_signed_tlm_ectl ) return boolean { @@ -3250,26 +3312,36 @@ module LibItsPki_Functions { var bitstring v_tbs; var Certificate v_certificate; var boolean v_result; - var Oct32 v_issuer; var EtsiTs102941Data v_etsi_ts_102941_data; - log(">>> f_verify_tlm_ectl_response_message: p_ieee1609dot2_signed_data= ", p_ieee1609dot2_signed_data); + log(">>> f_verify_tlm_ectl_response_message: p_etsi_ts_103097_signed_data= ", p_etsi_ts_103097_signed_data); // 1. Verify signature - log("f_verify_tlm_ectl_response_message: p_ieee1609dot2_signed_data.content.signedData.tbsData= ", p_ieee1609dot2_signed_data.content.signedData.tbsData); - v_tbs := encvalue(p_ieee1609dot2_signed_data.content.signedData.tbsData); - v_certificate := p_ieee1609dot2_signed_data.content.signedData.signer.certificate[0]; - if (ischosen(p_ieee1609dot2_signed_data.content.signedData.signature_.ecdsaBrainpoolP384r1Signature)) { - v_result := f_verifyEcdsa(bit2oct(v_tbs), int2oct(0, 48), p_ieee1609dot2_signed_data.content.signedData.signature_, v_certificate.toBeSigned.verifyKeyIndicator.verificationKey); + log("f_verify_tlm_ectl_response_message: p_etsi_ts_103097_signed_data.content.signedData.tbsData= ", p_etsi_ts_103097_signed_data.content.signedData.tbsData); + v_tbs := encvalue(p_etsi_ts_103097_signed_data.content.signedData.tbsData); + if (ischosen(p_etsi_ts_103097_signed_data.content.signedData.signer.certificate)) { + v_certificate := p_etsi_ts_103097_signed_data.content.signedData.signer.certificate[0]; + } else { + var charstring v_certificate_id; + if (f_getCertificateFromDigest(p_etsi_ts_103097_signed_data.content.signedData.signer.digest, v_certificate, v_certificate_id) == false) { + log("f_verify_tlm_ectl_response_message: Failed to retrieve certificate from digest ", p_etsi_ts_103097_signed_data.content.signedData.signer.digest); + if (p_check_security == true) { + return false; + } + } + } + if (ischosen(p_etsi_ts_103097_signed_data.content.signedData.signature_.ecdsaBrainpoolP384r1Signature)) { + v_result := f_verifyEcdsa(bit2oct(v_tbs), int2oct(0, 48), p_etsi_ts_103097_signed_data.content.signedData.signature_, v_certificate.toBeSigned.verifyKeyIndicator.verificationKey); } else { - v_result := f_verifyEcdsa(bit2oct(v_tbs), int2oct(0, 32), p_ieee1609dot2_signed_data.content.signedData.signature_, v_certificate.toBeSigned.verifyKeyIndicator.verificationKey); + v_result := f_verifyEcdsa(bit2oct(v_tbs), int2oct(0, 32), p_etsi_ts_103097_signed_data.content.signedData.signature_, v_certificate.toBeSigned.verifyKeyIndicator.verificationKey); } if (v_result == false) { + log("f_verify_tlm_ectl_response_message: Failed to verify signature"); if (p_check_security == true) { return false; } } - v_etsi_ts_102941_data_msg := oct2bit(p_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); + v_etsi_ts_102941_data_msg := oct2bit(p_etsi_ts_103097_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); if (decvalue(v_etsi_ts_102941_data_msg, v_etsi_ts_102941_data) != 0) { log("f_verify_tlm_ectl_response_message: Failed to decode EtsiTs102941Data"); return false; @@ -3280,10 +3352,11 @@ module LibItsPki_Functions { log("f_verify_tlm_ectl_response_message: Failed to decode certificateTrustListTlm"); return false; } else { + var Time32 v_time := (f_getCurrentTime()/* - 1072915200000*/) / 1000; p_to_be_signed_tlm_ectl := v_etsi_ts_102941_data.content.certificateTrustListTlm; log("f_verify_tlm_ectl_response_message: p_to_be_signed_tlm_ectl= ", p_to_be_signed_tlm_ectl); - if (p_to_be_signed_tlm_ectl.nextUpdate <= f_getCurrentTime() / 1000) { - log("f_verify_tlm_ectl_response_message: Invalid nextUpdate value: compared values=", p_to_be_signed_tlm_ectl.nextUpdate, "/", f_getCurrentTime() / 1000); + if (p_to_be_signed_tlm_ectl.nextUpdate <= v_time) { + log("f_verify_tlm_ectl_response_message: Invalid nextUpdate value: compared values=", p_to_be_signed_tlm_ectl.nextUpdate, "/", v_time); return false; } // TODO Verify RCA certificate & signature -- GitLab From 1085f670832f2aece2c5c98c6820940616ce017a Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Mon, 27 Jul 2020 15:11:17 +0200 Subject: [PATCH 250/320] Big fixes and enhancements from CV2X#2 Plugtest --- ttcn/Pki/LibItsPki_Functions.ttcn | 375 +++++++++++++++----- ttcn/Pki/LibItsPki_Pics.ttcn | 23 +- ttcn/Pki/LibItsPki_Templates.ttcn | 58 +-- ttcn/Pki/LibItsPki_TestSystem.ttcn | 7 + ttcn/Pki/LibItsPki_TypesAndValues.ttcn | 5 + ttcn/Security/LibItsSecurity_Functions.ttcn | 6 +- 6 files changed, 351 insertions(+), 123 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 532b1599..29183d47 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -70,7 +70,7 @@ module LibItsPki_Functions { out ItsPkiItss p_itss, out ItsPkiHttp p_pki ) runs on ItsMtc { - p_itss := ItsPkiItss.create("ITSS") alive; + p_itss := ItsPkiItss.create("ITS-S") alive; p_pki := ItsPkiHttp.create("PKI") alive; connect(self:syncPort, mtc:syncPort); @@ -112,6 +112,8 @@ module LibItsPki_Functions { f_initialiseSecuredMode(p_ea_certificate_id, p_aa_certificate_id); // TODO To be removed??? + // TODO Duplicate code, use a function + // Setup EA certificate shared with PKI EA entity f_readCertificate(p_ea_certificate_id, vc_eaCertificate); f_readSigningKey(p_ea_certificate_id, vc_eaPrivateKey); // TODO To be removed @@ -138,6 +140,14 @@ module LibItsPki_Functions { log("f_cfHttpUp: vc_aaWholeHash= ", vc_aaWholeHash); log("f_cfHttpUp: vc_aaWholeHash256= ", vc_aaWholeHash256); + // Storage of enrolment keys in case of re-enrolment + vc_ec_keys_counter := 0; + vc_ec_private_keys := {}; + vc_ec_public_compressed_key := {}; + vc_ec_compressed_modes := {}; + vc_ec_hashed_id8 := {}; + vc_ec_certificates := {}; + if (PICS_MULTIPLE_END_POINT == false) { activate(a_default_pki_http()); } else { @@ -206,16 +216,20 @@ module LibItsPki_Functions { f_initialiseSecuredMode(p_ea_certificate_id, p_aa_certificate_id); // TODO To be removed??? + // TODO Duplicate code, use a function + // Setup EA certificate shared with PKI EA entity f_readCertificate(p_ea_certificate_id, vc_eaCertificate); f_readSigningKey(p_ea_certificate_id, vc_eaPrivateKey); // TODO To be removed f_readEncryptingKey(p_ea_certificate_id, vc_eaPrivateEncKey); f_getCertificateDigest(p_ea_certificate_id, vc_eaHashedId8); f_getCertificateHash(p_ea_certificate_id, vc_eaWholeHash); + f_getCertificateHash256(p_ea_certificate_id, vc_eaWholeHash256); log("f_cfHttpUp_itss: vc_eaPrivateKey= ", vc_eaPrivateKey); log("f_cfHttpUp_itss: vc_eaPrivateEncKey= ", vc_eaPrivateEncKey); log("f_cfHttpUp_itss: vc_eaHashedId8= ", vc_eaHashedId8); log("f_cfHttpUp_itss: vc_eaWholeHash= ", vc_eaWholeHash); + log("f_cfHttpUp: vc_eaWholeHash256= ", vc_eaWholeHash256); // Setup AA certificate shared with PKI AA entity f_readCertificate(p_aa_certificate_id, vc_aaCertificate); @@ -223,10 +237,20 @@ module LibItsPki_Functions { f_readEncryptingKey(p_aa_certificate_id, vc_aaPrivateEncKey); f_getCertificateDigest(p_aa_certificate_id, vc_aaHashedId8); f_getCertificateHash(p_aa_certificate_id, vc_aaWholeHash); + f_getCertificateHash256(p_aa_certificate_id, vc_aaWholeHash256); log("f_cfHttpUp_itss: vc_aaPrivateKey= ", vc_aaPrivateKey); log("f_cfHttpUp_itss: vc_aaPrivateEncKey= ", vc_aaPrivateEncKey); log("f_cfHttpUp_itss: vc_aaHashedId8= ", vc_aaHashedId8); log("f_cfHttpUp_itss: vc_aaWholeHash= ", vc_aaWholeHash); + log("f_cfHttpUp: vc_eaWholeHash256= ", vc_aaWholeHash256); + + // Storage of enrolment keys in case of re-enrolment + vc_ec_keys_counter := 0; + vc_ec_private_keys := {}; + vc_ec_public_compressed_key := {}; + vc_ec_compressed_modes := {}; + vc_ec_hashed_id8 := {}; + vc_ec_certificates := {}; if (PICS_MULTIPLE_END_POINT == false) { activate(a_default_pki_http()); @@ -252,16 +276,20 @@ module LibItsPki_Functions { f_initialiseSecuredMode(p_ea_certificate_id, p_aa_certificate_id); // TODO To be removed??? + // TODO Duplicate code, use a function + // Setup EA certificate shared with PKI EA entity f_readCertificate(p_ea_certificate_id, vc_eaCertificate); f_readSigningKey(p_ea_certificate_id, vc_eaPrivateKey); // TODO To be removed f_readEncryptingKey(p_ea_certificate_id, vc_eaPrivateEncKey); f_getCertificateDigest(p_ea_certificate_id, vc_eaHashedId8); f_getCertificateHash(p_ea_certificate_id, vc_eaWholeHash); + f_getCertificateHash256(p_aa_certificate_id, vc_eaWholeHash256); log("f_cfHttpUp_ea: vc_eaPrivateKey= ", vc_eaPrivateKey); log("f_cfHttpUp_ea: vc_eaPrivateEncKey= ", vc_eaPrivateEncKey); log("f_cfHttpUp_ea: vc_eaHashedId8= ", vc_eaHashedId8); log("f_cfHttpUp_ea: vc_eaWholeHash= ", vc_eaWholeHash); + log("f_cfHttpUp: vc_aaWholeHash256= ", vc_eaWholeHash256); // Setup AA certificate shared with PKI AA entity f_readCertificate(p_aa_certificate_id, vc_aaCertificate); @@ -269,10 +297,20 @@ module LibItsPki_Functions { f_readEncryptingKey(p_aa_certificate_id, vc_aaPrivateEncKey); f_getCertificateDigest(p_aa_certificate_id, vc_aaHashedId8); f_getCertificateHash(p_aa_certificate_id, vc_aaWholeHash); + f_getCertificateHash256(p_aa_certificate_id, vc_aaWholeHash256); log("f_cfHttpUp_ea: vc_aaPrivateKey= ", vc_aaPrivateKey); log("f_cfHttpUp_ea: vc_aaPrivateEncKey= ", vc_aaPrivateEncKey); log("f_cfHttpUp_ea: vc_aaHashedId8= ", vc_aaHashedId8); log("f_cfHttpUp_ea: vc_aaWholeHash= ", vc_aaWholeHash); + log("f_cfHttpUp: vc_aaWholeHash256= ", vc_aaWholeHash256); + + // Storage of enrolment keys in case of re-enrolment + vc_ec_keys_counter := 0; + vc_ec_private_keys := {}; + vc_ec_public_compressed_key := {}; + vc_ec_compressed_modes := {}; + vc_ec_hashed_id8 := {}; + vc_ec_certificates := {}; if (PICS_MULTIPLE_END_POINT == false) { activate(a_default_pki_http()); @@ -832,15 +870,20 @@ module LibItsPki_Functions { log("*** f_http_build_inner_ec_request: ERROR: Failed to generate InnerEcRequest ***"); f_selfOrClientSyncAndVerdict("error", e_error); } - log ("f_http_build_enrolment_request: ==> EC verification private key: ", p_private_key); - log ("f_http_build_enrolment_request: ==> EC verification public compressed key: ", p_public_key_compressed); - log ("f_http_build_enrolment_request: ==> EC verification public compressed mode: ", p_compressed_mode); + log ("f_http_build_inner_ec_request: ==> EC verification private key: ", p_private_key); + log ("f_http_build_inner_ec_request: ==> EC verification public compressed key: ", p_public_key_compressed); + log ("f_http_build_inner_ec_request: ==> EC verification public compressed mode: ", p_compressed_mode); + // TODO Store enrolment keys for re-enrolment + vc_ec_private_keys[vc_ec_keys_counter] := p_private_key; + vc_ec_public_compressed_key[vc_ec_keys_counter] := p_public_key_compressed; + vc_ec_compressed_modes[vc_ec_keys_counter] := p_compressed_mode; + vc_ec_keys_counter := vc_ec_keys_counter + 1; // Generate InnerEcRequestSignedForPoP if (f_generate_inner_ec_request_signed_for_pop(p_private_key, v_inner_ec_request, v_inner_ec_request_signed_for_pop) == false) { log("*** f_http_build_inner_ec_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); f_selfOrClientSyncAndVerdict("error", e_error); } - log("f_http_build_enrolment_request: v_inner_ec_request_signed_for_pop= ", v_inner_ec_request_signed_for_pop); + log("f_http_build_inner_ec_request: v_inner_ec_request_signed_for_pop= ", v_inner_ec_request_signed_for_pop); // Secure InnerEcRequestSignedForPoP message if (f_extract_enc_key(vc_eaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { @@ -850,13 +893,23 @@ module LibItsPki_Functions { log("f_http_build_inner_ec_request: Public encryption key: ", v_public_enc_key); log("f_http_build_inner_ec_request: Public encryption key comp: ", v_compressed_enc_key_mode); p_salt := vc_eaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. - if (PICS_SECPKI_REENROLMENT == false) { // This is the first enrolment, we used Factory keys - v_result := f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); + if ((PICS_SECPKI_REENROLMENT == false) or (vc_ec_keys_counter == 1)) { // This is the first enrolment, we used Factory keys + var octetstring v_private_key; + if (PX_VE_ALG == e_nist_p256) { + v_private_key := PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY; + } else if (PX_VE_ALG == e_brainpool_p256_r1) { + v_private_key := PICS_ITS_S_SIGN_BRAINPOOLP256r1_PRIVATE_KEY; + } else { + v_private_key := PICS_ITS_S_SIGN_BRAINPOOLP384r1_PRIVATE_KEY; + } + v_result := f_build_pki_secured_request_message_signed_with_pop(v_private_key, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } else { // We use last valid EC certificate // TODO Retrieve EC certificate from the first enrolment instead of PX - log("f_http_build_inner_ec_request: v_ec_private_key: ", PX_EC_PRIVATE_KEY); + log("f_http_build_inner_ec_request: v_ec_private_key: ", vc_ec_private_keys[vc_ec_keys_counter - 1]); + log("f_http_build_inner_ec_request: v_ec_public_compressed_key: ", vc_ec_public_compressed_key[vc_ec_keys_counter - 1]); + log("f_http_build_inner_ec_request: v_ec_compressed_modes: ", vc_ec_compressed_modes[vc_ec_keys_counter - 1]); log("f_http_build_inner_ec_request: v_ec_hashed_id8: ", PX_EC_HASHED_ID8); - v_result := f_build_pki_secured_request_message_signed_with_pop(PX_EC_PRIVATE_KEY, valueof(m_signerIdentifier_digest(PX_EC_HASHED_ID8)), PX_EC_HASHED_ID8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); + v_result := f_build_pki_secured_request_message_signed_with_pop(vc_ec_private_keys[vc_ec_keys_counter - 1], valueof(m_signerIdentifier_digest(PX_EC_HASHED_ID8)), PX_EC_HASHED_ID8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } if (v_result == false) { log("*** f_http_build_inner_ec_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); @@ -895,9 +948,9 @@ module LibItsPki_Functions { log("*** f_http_build_inner_ec_request_with_wrong_parameters: ERROR: Failed to generate InnerEcRequest ***"); f_selfOrClientSyncAndVerdict("error", e_error); } - log ("f_http_build_enrolment_request: ==> EC verification private key: ", p_private_key); - log ("f_http_build_enrolment_request: ==> EC verification public compressed key: ", p_public_key_compressed); - log ("f_http_build_enrolment_request: ==> EC verification public compressed mode: ", p_compressed_mode); + log ("f_http_build_inner_ec_request_with_wrong_parameters: ==> EC verification private key: ", p_private_key); + log ("f_http_build_inner_ec_request_with_wrong_parameters: ==> EC verification public compressed key: ", p_public_key_compressed); + log ("f_http_build_inner_ec_request_with_wrong_parameters: ==> EC verification public compressed mode: ", p_compressed_mode); // Generate InnerEcRequestSignedForPoP if (f_generate_inner_ec_request_signed_for_pop(p_private_key, v_inner_ec_request, v_inner_ec_request_signed_for_pop) == false) { log("*** f_http_build_inner_ec_request_with_wrong_parameters: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); @@ -914,7 +967,15 @@ module LibItsPki_Functions { log("f_http_build_inner_ec_request_with_wrong_parameters: Public encryption key comp: ", v_compressed_enc_key_mode); p_salt := vc_eaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. if (PICS_SECPKI_REENROLMENT == false) { // This is the first enrolment, we used Factory keys - v_result := f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); + var octetstring v_private_key; + if (PX_VE_ALG == e_nist_p256) { + v_private_key := PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY; + } else if (PX_VE_ALG == e_brainpool_p256_r1) { + v_private_key := PICS_ITS_S_SIGN_BRAINPOOLP256r1_PRIVATE_KEY; + } else { + v_private_key := PICS_ITS_S_SIGN_BRAINPOOLP384r1_PRIVATE_KEY; + } + v_result := f_build_pki_secured_request_message_signed_with_pop(v_private_key, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } else { // We use last valid EC certificate // TODO Retrieve EC certificate from the first enrolment instead of PX log("f_http_build_inner_ec_request_with_wrong_parameters: v_ec_private_key: ", PX_EC_PRIVATE_KEY); @@ -979,7 +1040,15 @@ module LibItsPki_Functions { log("*** f_http_build_invalid_enrolment_request: Public encryption key comp: ", v_compressed_enc_key_mode); p_salt := vc_eaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. if (PICS_SECPKI_REENROLMENT == false) { // This is the first enrolment, we used Factory keys - v_ret_code := f_build_pki_secured_request_message_signed_with_pop(PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); + var octetstring v_private_key; + if (PX_VE_ALG == e_nist_p256) { + v_private_key := PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY; + } else if (PX_VE_ALG == e_brainpool_p256_r1) { + v_private_key := PICS_ITS_S_SIGN_BRAINPOOLP256r1_PRIVATE_KEY; + } else { + v_private_key := PICS_ITS_S_SIGN_BRAINPOOLP384r1_PRIVATE_KEY; + } + v_ret_code := f_build_pki_secured_request_message_signed_with_pop(v_private_key, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); } else { // We use last valid EC certificate // TODO Retrieve EC certificate from the first enrolment instead of PX log("f_http_build_inner_ec_request: v_ec_private_key: ", PX_EC_PRIVATE_KEY); @@ -1540,6 +1609,22 @@ module LibItsPki_Functions { return p_result; } // End of function f_http_build_authorization_validation_response + function f_http_build_dc_request( // TODO Cleanup parameters + in charstring p_ea_certificate_id, + in charstring p_aa_certificate_id, + in charstring p_rca_certificate_id, + out octetstring p_private_key, + out octetstring p_public_key_compressed, + out integer p_compressed_mode, + out Oct16 p_aes_sym_key, + out Oct16 p_encrypted_sym_key, + out Oct16 p_authentication_vector, + out Oct12 p_nonce, + out octetstring p_salt, + out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, + out Oct32 p_request_hash + ) runs on ItsPkiHttp { + } // End of function } // End of group http group generate_certificates { @@ -1640,27 +1725,32 @@ module LibItsPki_Functions { p_ec_certificate := valueof(v_cert); return true; } // End of function f_generate_ec_certificate - function f_generate_ec_certificate_for_inner_ec_response( in InnerEcRequest p_inner_ec_request, in octetstring p_private_key, in octetstring p_digest, out EtsiTs103097Certificate p_ec_certificate ) return boolean { + var CertificateId v_certificate_id; var EtsiTs103097Certificate v_cert; var IssuerIdentifier v_issuer; var bitstring v_tbs; var octetstring v_sig; - log(">>> f_generate_ec_certificate_for_inner_ec_response: p_inner_ec_request", p_inner_ec_request); - log(">>> f_generate_ec_certificate_for_inner_ec_response: p_digest", p_digest); + log(">>> f_generate_ec_certificate_for_inner_ec_response: p_inner_ec_request: ", p_inner_ec_request); + log(">>> f_generate_ec_certificate_for_inner_ec_response: p_digest: ", p_digest); v_issuer := valueof(m_issuerIdentifier_sha256AndDigest(f_hashedId8FromSha256(p_digest))); // TODO Check sha256/384 f_hashedId8FromSha384 + if (not(ispresent(p_inner_ec_request.requestedSubjectAttributes.id))) { + v_certificate_id := { none_ := NULL }; + } else { + v_certificate_id := p_inner_ec_request.requestedSubjectAttributes.id; + } v_cert := valueof( m_etsiTs103097Certificate( v_issuer, m_toBeSignedCertificate_ec( - p_inner_ec_request.requestedSubjectAttributes.id, + v_certificate_id, p_inner_ec_request.requestedSubjectAttributes.appPermissions, m_verificationKeyIndicator_verificationKey( p_inner_ec_request.publicKeys.verificationKey @@ -1911,30 +2001,58 @@ module LibItsPki_Functions { } v_public_verification_key := valueof(m_publicVerificationKey_ecdsaBrainpoolP384r1(v_eccP384_curve_point)); } - p_inner_ec_request := valueof( - m_innerEcRequest( - PICS_ITS_S_CANONICAL_ID, - m_publicKeys( - v_public_verification_key - ), - m_certificateSubjectAttributes_id_none( - { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs - valueof(m_appPermissions(c_its_aid_SCR, { bitmapSsp := PX_INNER_EC_CERTFICATE_BITMAP_SSP_SCR })) - }, - m_validityPeriod( - f_getCurrentTime() / 1000, - m_duration_in_hours(PX_GENERATED_CERTIFICATE_DURATION) - ), - m_geographicRegion_identifiedRegion( - { - m_identifiedRegion_country_only(PX_GENERATED_CERTIFICATE_REGION_COUNTRY_1), - m_identifiedRegion_country_only(PX_GENERATED_CERTIFICATE_REGION_COUNTRY_2) - } - ), - PX_GENERATED_CERTIFICATE_SUBJECT_ASSURENCE_LEVEL - ) - ) - ); + if (PICS_EC_SUBJECT_ATTRIBUT_ID) { + p_inner_ec_request := valueof( + m_innerEcRequest( + PICS_ITS_S_CANONICAL_ID, + m_publicKeys( + v_public_verification_key + ), + m_certificateSubjectAttributes_id_name( + oct2char(PICS_ITS_S_CANONICAL_ID) & int2str(f_getCurrentTime()), // ETSI TS 103 097 V1.3.1 (2017-10) Clause 7.2.2 Enrolment credential + { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs + valueof(m_appPermissions(c_its_aid_SCR, { bitmapSsp := PX_INNER_EC_CERTFICATE_BITMAP_SSP_SCR })) + }, + m_validityPeriod( + f_getCurrentTime() / 1000, + m_duration_in_hours(PX_GENERATED_CERTIFICATE_DURATION) + ), + m_geographicRegion_identifiedRegion( + { + m_identifiedRegion_country_only(PX_GENERATED_CERTIFICATE_REGION_COUNTRY_1), + m_identifiedRegion_country_only(PX_GENERATED_CERTIFICATE_REGION_COUNTRY_2) + } + ), + PX_GENERATED_CERTIFICATE_SUBJECT_ASSURENCE_LEVEL + ) + ) + ); + } else { + p_inner_ec_request := valueof( + m_innerEcRequest( + PICS_ITS_S_CANONICAL_ID, + m_publicKeys( + v_public_verification_key + ), + m_certificateSubjectAttributes_id_omit( // ETSI TS 103 097 V1.3.1 (2017-10) Clause 7.2.2 Enrolment credential + { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs + valueof(m_appPermissions(c_its_aid_SCR, { bitmapSsp := PX_INNER_EC_CERTFICATE_BITMAP_SSP_SCR })) + }, + m_validityPeriod( + f_getCurrentTime() / 1000, + m_duration_in_hours(PX_GENERATED_CERTIFICATE_DURATION) + ), + m_geographicRegion_identifiedRegion( + { + m_identifiedRegion_country_only(PX_GENERATED_CERTIFICATE_REGION_COUNTRY_1), + m_identifiedRegion_country_only(PX_GENERATED_CERTIFICATE_REGION_COUNTRY_2) + } + ), + PX_GENERATED_CERTIFICATE_SUBJECT_ASSURENCE_LEVEL + ) + ) + ); + } if (PICS_SECPKI_REENROLMENT) { // This is a re-enrolment, the identifier of its current valid Enrolment Credential log("f_generate_inner_ec_request: This is a re-enrolment"); p_inner_ec_request.itsId := PX_EC_HASHED_ID8; @@ -2943,12 +3061,10 @@ module LibItsPki_Functions { group dc { function f_build_dc_ctl( - in octetstring p_private_key, - in octetstring p_issuer, in charstring p_ea_certificate_id, in charstring p_aa_certificate_id, in charstring p_rca_certificate_id, - out Ieee1609Dot2Data p_ieee_1609Dot2_data + out ToBeSignedRcaCtl p_to_be_signed_rca_ctl ) { // Local variables var EtsiTs103097Certificate v_ea_certificate; @@ -2956,13 +3072,7 @@ module LibItsPki_Functions { var EtsiTs103097Certificate v_rca_certificate; var CtlCommands v_ctl_commands; var ToBeSignedRcaCtl v_to_be_signed_rca_ctl; - var EtsiTs102941Data v_etsi_ts_102941_data; - var octetstring p_pki_message; - var ToBeSignedData v_tbs; - var bitstring v_tbs_encoded; - var octetstring v_sig; - var Signature v_signature; - + log(">>> f_build_dc_ctl"); // Load certificates @@ -2975,23 +3085,49 @@ module LibItsPki_Functions { { add := { aa := valueof(m_aa_entry(v_aa_certificate, "http://www.etsi.org")) } }, { add := { ea := valueof(m_ea_entry(v_ea_certificate, "http://www.etsi.org")) } } }; + log("f_build_dc_ctl: v_ctl_commands= ", v_ctl_commands); // Build the main data structure - v_to_be_signed_rca_ctl := valueof(m_to_be_signed_rca_full_ctl(1000, 1, v_ctl_commands)); + p_to_be_signed_rca_ctl := valueof(m_to_be_signed_rca_full_ctl(1000, 1, v_ctl_commands)); + + log("<<< f_build_dc_ctl: p_to_be_signed_rca_ctl= ", p_to_be_signed_rca_ctl); + } // End of function f_build_dc_ctl + + function f_sign_dc_ctl( + in charstring p_issuer_certificate_id, + in ToBeSignedRcaCtl p_to_be_signed_rca_ctl, + out Ieee1609Dot2Data p_ieee_1609Dot2_signed_data + ) { + // Local variables + var EtsiTs103097Certificate v_certificate; + var EtsiTs102941Data v_etsi_ts_102941_data; + var octetstring v_pki_message; + var ToBeSignedData v_tbs; + var octetstring v_private_key; + var octetstring v_issuer; + var bitstring v_tbs_encoded; + var octetstring v_sig; + var Signature v_signature; + + log(">>> f_sign_dc_ctl"); + + f_readSigningKey(p_issuer_certificate_id, v_private_key) + f_getCertificateHash(p_issuer_certificate_id, v_issuer); + // Encode the main data structure - v_etsi_ts_102941_data := valueof(m_etsiTs102941Data_to_be_signed_rca_ctl(v_to_be_signed_rca_ctl)); - p_pki_message := bit2oct(encvalue(v_etsi_ts_102941_data)); + v_etsi_ts_102941_data := valueof(m_etsiTs102941Data_to_be_signed_rca_ctl(p_to_be_signed_rca_ctl)); + v_pki_message := bit2oct(encvalue(v_etsi_ts_102941_data)); // Signed the encoded PKI message v_tbs := valueof( m_toBeSignedData( m_signedDataPayload( - m_etsiTs103097Data_unsecured(p_pki_message) + m_etsiTs103097Data_unsecured(v_pki_message) ), m_headerInfo_inner_pki_response(-, (f_getCurrentTime() * 1000)/*us*/) ) ); v_tbs_encoded := encvalue(v_tbs); // Sign the certificate - v_sig := f_signWithEcdsa(bit2oct(v_tbs_encoded), p_issuer, p_private_key); + v_sig := f_signWithEcdsa(bit2oct(v_tbs_encoded), v_issuer, v_private_key); if ((PX_VE_ALG == e_nist_p256) or (PX_VE_ALG == e_brainpool_p256_r1)) { v_signature := valueof( m_signature_ecdsaNistP256( @@ -3002,16 +3138,16 @@ module LibItsPki_Functions { substr(v_sig, 32, 32) ) )); - p_ieee_1609Dot2_data := valueof( - m_etsiTs103097Data_signed( - m_signedData( - sha256, - v_tbs, - m_signerIdentifier_digest(p_issuer), - v_signature - ) - ) - ); + p_ieee_1609Dot2_signed_data := valueof( + m_etsiTs103097Data_signed( + m_signedData( + sha256, + v_tbs, + m_signerIdentifier_digest(v_issuer), + v_signature + ) + ) + ); } else if (PX_VE_ALG == e_brainpool_p384_r1) { v_signature := valueof( m_signature_ecdsaBrainpoolP384r1( @@ -3022,20 +3158,19 @@ module LibItsPki_Functions { substr(v_sig, 48, 48) ) )); - p_ieee_1609Dot2_data := valueof( - m_etsiTs103097Data_signed( - m_signedData( - sha384, - v_tbs, - m_signerIdentifier_digest(p_issuer), - v_signature - ) - ) - ); - } - log("f_build_dc_ctl: p_ieee_1609Dot2_data= ", p_ieee_1609Dot2_data); - - } // End of function f_build_dc_ctl + p_ieee_1609Dot2_signed_data := valueof( + m_etsiTs103097Data_signed( + m_signedData( + sha384, + v_tbs, + m_signerIdentifier_digest(v_issuer), + v_signature + ) + ) + ); + } + log("<<< f_sign_dc_ctl: p_ieee_1609Dot2_signed_data= ", p_ieee_1609Dot2_signed_data); + } // End of function f_sign_dc_ctl } // End of group dc @@ -3429,14 +3564,14 @@ module LibItsPki_Functions { log("f_await_http_inner_ec_request_response: Receive ", v_etsi_ts_102941_data, " ***"); // Verify the received EC certificate log("f_await_http_inner_ec_request_response: match ", match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(substr(v_request_hash, 0, 16), mw_etsiTs103097Certificate(-, mw_toBeSignedCertificate_ec)))), " ***"); // TODO In TITAN, this is the only way to get the unmatching in log - if (match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(substr(v_request_hash, 0, 16), mw_etsiTs103097Certificate(-, mw_toBeSignedCertificate_ec)))) == false) { + if (match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(?/*FIXME YANN Blackberry substr(v_request_hash, 0, 16)*/, mw_etsiTs103097Certificate(-, mw_toBeSignedCertificate_ec)))) == false) { log("f_await_http_inner_ec_request_response: Unexpected message received ***"); if (p_strict_checks) { return false; } } if (ischosen(v_etsi_ts_102941_data.content.enrolmentResponse) and ispresent(v_etsi_ts_102941_data.content.enrolmentResponse.certificate)) { - if (f_verify_ec_certificate(v_etsi_ts_102941_data.content.enrolmentResponse.certificate, vc_eaCertificate, p_compressed_public_key, p_compressed_mode) == false) { + if (f_verify_ec_certificate(v_etsi_ts_102941_data.content.enrolmentResponse.certificate, vc_eaCertificate, vc_eaHashedId8, p_compressed_public_key, p_compressed_mode) == false) { log("f_await_http_inner_ec_request_response: Cannot verify EC certificate signature ***"); if (p_strict_checks) { return false; @@ -3521,6 +3656,57 @@ module LibItsPki_Functions { return v_result; } // End of function f_await_ec_request_send_response + function f_await_dc_request_send_response( + in charstring p_rca_certificate_id, + in charstring p_aa_certificate_id, + in charstring p_ea_certificate_id, + out ToBeSignedRcaCtl p_ctl + ) runs on ItsPkiHttp return boolean { + var HttpMessage v_request; + var boolean v_result := false; + + log(">>> f_await_dc_request_send_response"); + + tc_ac.start; + alt { + [] a_await_dc_http_request_from_iut( + mw_http_request( + mw_http_request_post( + PICS_HTTP_POST_URI_DC + )), + v_request + ) { + var Ieee1609Dot2Data v_ieee1609dot2_signed_and_encrypted_data; + var ToBeSignedRcaCtl p_to_be_signed_rca_ctl; + var EtsiTs102941Data v_etsi_ts_102941_data; + var Oct16 v_request_hash; + var Oct16 v_aes_enc_key; + var template (value) HttpMessage v_response; + var Headers v_headers; + tc_ac.stop; + + f_init_default_headers_list(-, "inner_dc_response", v_headers); + + // Send message + f_build_dc_ctl( + p_rca_certificate_id, + p_aa_certificate_id, + p_ea_certificate_id, + p_to_be_signed_rca_ctl + ); + f_sign_dc_ctl(p_rca_certificate_id, p_to_be_signed_rca_ctl, v_ieee1609dot2_signed_and_encrypted_data); + v_response := m_http_response(m_http_response_ok(m_http_message_body_binary(m_binary_body_ieee1609dot2_data(v_ieee1609dot2_signed_and_encrypted_data)), v_headers)); + f_http_send(v_headers, v_response); + v_result := true; + } + [] tc_ac.timeout { + log("f_await_dc_request_send_response: Expected message not received ***"); + } + } // End of 'alt' statement + + return v_result; + } // End of function f_await_dc_request_send_response + } // End of group awaiting_messages group pki_functions { @@ -3591,6 +3777,8 @@ module LibItsPki_Functions { } else { var charstring v_certificate_id; var octetstring v_hash; + // FIXME Huge issue, certificate is BP256 and PX_VE_ALG is e_brainpool_p384_r1, so v_hash & p_private_key are 32 bytes length not 48 + // ==> Need to sign with v_certificate_id capabilities not with PX_VE_ALG :( fx_readCertificateFromDigest(p_signer_identifier.digest, v_certificate_id); // TODO Add a wrapper function f_getCertificateHash(v_certificate_id, v_hash); v_tbs_signed := f_signWithEcdsa(bit2oct(encvalue(v_tbs)), v_hash, p_private_key); @@ -4272,6 +4460,7 @@ module LibItsPki_Functions { function f_verify_ec_certificate( in Certificate p_ec_certificate, in Certificate p_ea_certificate, + in HashedId8 p_ea_hashed_id8, in octetstring p_public_key_compressed, in integer p_compressed_mode ) return boolean { @@ -4287,8 +4476,12 @@ module LibItsPki_Functions { log("f_verify_ec_certificate: ==> EC certificate HashedId8: ", v_ec_cert_hashed_id8); // Check the signer - log("f_verify_ec_certificate: ", match(p_ec_certificate.issuer, mw_issuerIdentifier_sha256AndDigest)); - if (match(p_ec_certificate.issuer, mw_issuerIdentifier_sha256AndDigest) == false) { + log("f_verify_ec_certificate: Check the signer: ", match(p_ec_certificate.issuer, m_issuerIdentifier_sha256AndDigest(p_ea_hashed_id8))); + log("f_verify_ec_certificate: Check the signer: ", match(p_ec_certificate.issuer, m_issuerIdentifier_sha384AndDigest(p_ea_hashed_id8))); + if ( + (match(p_ec_certificate.issuer, m_issuerIdentifier_sha256AndDigest(p_ea_hashed_id8)) == false) and + (match(p_ec_certificate.issuer, m_issuerIdentifier_sha384AndDigest(p_ea_hashed_id8)) == false) + ) { log("f_verify_ec_certificate: Wrong issuer"); return false; } @@ -4644,6 +4837,18 @@ module LibItsPki_Functions { } } // End of altstep a_await_atv_http_response_from_iut + altstep a_await_dc_http_request_from_iut( + template HttpMessage p_http_message, + out HttpMessage p_response + ) runs on ItsPkiHttp { + [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_response { + log("a_await_dc_http_request_from_iut: Received message on httpPort"); + } + [PICS_MULTIPLE_END_POINT] httpEcPort.receive(p_http_message) -> value p_response { + log("a_await_dc_http_request_from_iut: Received message on httpEcPort"); + } + } // End of altstep a_await_dc_http_request_from_iut + } // End of group altsteps } // End of module LibItsPki_Functions diff --git a/ttcn/Pki/LibItsPki_Pics.ttcn b/ttcn/Pki/LibItsPki_Pics.ttcn index 5da7709c..8c683b80 100644 --- a/ttcn/Pki/LibItsPki_Pics.ttcn +++ b/ttcn/Pki/LibItsPki_Pics.ttcn @@ -119,6 +119,11 @@ module LibItsPki_Pics { * @desc End point for the TLM */ modulepar charstring PICS_HEADER_HOST_TLM := "www.its.tlm.org"; + + /** + * @desc + */ + modulepar charstring PICS_HTTP_POST_URI_DC := "www.its.ec.org"; /** * @desc Certificate used by the Test System @@ -204,12 +209,12 @@ module LibItsPki_Pics { /** * @desc Factory private key for verification Brainpool P256 r1 */ - modulepar octetstring PICS_ITS_S_SIGN_BRAINPOOLP256r1_PRIVATE_KEY := '6D585B716D06F75EC2B8A8ADEBFCE6ED35B0640C2AFBFF25FE48FC81A6732D4F'O; + modulepar octetstring PICS_ITS_S_SIGN_BRAINPOOLP256r1_PRIVATE_KEY := '2CCBC88C6AD0FBB78AE50DA63366E64445F069369CED4605485442F524A0791E'O; /** * @desc Factory compressed public key for verification Brainpool P256 r1 */ - modulepar octetstring PICS_ITS_S_SIGN_BRAINPOOLP256r1_PUBLIC_KEY := '02A92BA3B770B040B8D958D5BD2CC9B537212D6963F50EA3E4784FEFA5D0454C12'O; + modulepar octetstring PICS_ITS_S_SIGN_BRAINPOOLP256r1_PUBLIC_KEY := '02A7A21F8FEE8DF454B7AF80A7C78CBC506C16F491C72BDC54F0CE98F20C15C59B'O; /** * @desc Factory private key for encryption Brainpool P384 r1 @@ -219,21 +224,27 @@ module LibItsPki_Pics { /** * @desc Factory private key for verification Brainpool P384 r1 */ - modulepar octetstring PICS_ITS_S_SIGN_BRAINPOOLP384r1_PRIVATE_KEY := '3CD977195A579787C84D5900F4CB6341E0C3D2750B140C5380E6F03CE3FBA0022F7541DEABDCED4790D313ED8F56ACA8'O; + modulepar octetstring PICS_ITS_S_SIGN_BRAINPOOLP384r1_PRIVATE_KEY := '0F94E957F915B39E545FE845A8B4681D52F9D144353FFE36879F3DC9AFDE4001EDE55D5234EB977425E44D95BD6D3328'O; /** * @desc Factory compressed public key for verification Brainpool P384 r1 */ - modulepar octetstring PICS_ITS_S_SIGN_BRAINPOOLP384r1_PUBLIC_KEY := '0243FF5C96984C2C3F5FD5C5F6551C90F5FAEE1E5E8301763E4AF1E9D627F3474E554B82EE98EC4B49808DFF61B35F8313'O; + modulepar octetstring PICS_ITS_S_SIGN_BRAINPOOLP384r1_PUBLIC_KEY := '0210E2B13DCC736F22A1E9C6E156177BD0CB106D34897EF8D596CF3A7AC4034003AD2BB3FA4F65C723F665BEF089858C4F'O; /** * @desc Canonical ITSS-S identifier */ - modulepar octetstring PICS_ITS_S_CANONICAL_ID := '1B4CA1210123AE900BBE6C3EBAE7E87DA20DBDAB1E7B2EC0691C51C1021900AA'O; + modulepar octetstring PICS_ITS_S_CANONICAL_ID := '455453492D4954532D303031'O; /** * @desc Invalid Canonical ITSS-S identifier */ - modulepar octetstring PICS_INVALID_ITS_S_CANONICAL_ID := 'BABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABA'O; + modulepar octetstring PICS_INVALID_ITS_S_CANONICAL_ID := '455453492D4954532D30303145454545'O; + + /** + * @desc Set to true if the IUT support CertificateId shall be set to the choice name + * @see ETSI TS 103 097 Clause 7.2.2 Enrolment credential + */ + modulepar boolean PICS_EC_SUBJECT_ATTRIBUT_ID := false; } // End of module LibItsPki_Pics diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn index 2839ba6d..e8f3cb63 100644 --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ b/ttcn/Pki/LibItsPki_Templates.ttcn @@ -290,16 +290,16 @@ module LibItsPki_Templates { in template (value) PublicVerificationKey p_verificationKey, in template (omit) PublicEncryptionKey p_encryptionKey := omit ) := { - verificationKey := p_verificationKey, - encryptionKey := p_encryptionKey + verificationKey := p_verificationKey, + encryptionKey := p_encryptionKey } // End of template m_publicKeys template PublicKeys mw_publicKeys( template (present) PublicVerificationKey p_verificationKey := ?, template PublicEncryptionKey p_encryptionKey := * ) := { - verificationKey := p_verificationKey, - encryptionKey := p_encryptionKey + verificationKey := p_verificationKey, + encryptionKey := p_encryptionKey } // End of template mw_publicKeys template (omit) CertificateSubjectAttributes m_certificateSubjectAttributes_id_none( @@ -308,12 +308,12 @@ module LibItsPki_Templates { in template (omit) GeographicRegion p_region := omit, in template (omit) SubjectAssurance p_assuranceLevel := omit ) := { - id := { none_ := NULL }, - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := omit + id := { none_ := NULL }, + validityPeriod := p_validityPeriod, + region := p_region, + assuranceLevel := p_assuranceLevel, + appPermissions := p_appPermissions, + certIssuePermissions := omit } // End of template m_certificateSubjectAttributes_id_none template (omit) CertificateSubjectAttributes m_certificateSubjectAttributes_id_omit( @@ -322,7 +322,7 @@ module LibItsPki_Templates { in template (omit) GeographicRegion p_region := omit, in template (omit) SubjectAssurance p_assuranceLevel := omit ) modifies m_certificateSubjectAttributes_id_none := { - id := omit + id := omit } // End of template m_certificateSubjectAttributes_id_omit template (omit) CertificateSubjectAttributes m_certificateSubjectAttributes_id_name( @@ -332,39 +332,39 @@ module LibItsPki_Templates { in template (omit) GeographicRegion p_region := omit, in template (omit) SubjectAssurance p_assuranceLevel := omit ) := { - id := { name := p_name }, - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := omit + id := { name := p_name }, + validityPeriod := p_validityPeriod, + region := p_region, + assuranceLevel := p_assuranceLevel, + appPermissions := p_appPermissions, + certIssuePermissions := omit } // End of template m_certificateSubjectAttributes_id_name template (value) InnerEcResponse m_innerEcResponse_ok( in template (value) Oct16 p_requestHash, in template (value) EtsiTs103097Certificate p_certificate ) := { - requestHash := p_requestHash, - responseCode := ok, - certificate := p_certificate + requestHash := p_requestHash, + responseCode := ok, + certificate := p_certificate } // End of template m_innerEcResponse_ok template (present) InnerEcResponse mw_innerEcResponse_ok( template (present) Oct16 p_requestHash := ?, template (present) EtsiTs103097Certificate p_certificate := ? ) := { - requestHash := p_requestHash, - responseCode := ok, - certificate := p_certificate + requestHash := p_requestHash, + responseCode := ok, + certificate := p_certificate } // End of template mw_innerEcResponse_ok template (value) InnerEcResponse m_innerEcResponse_ko( in template (value) Oct16 p_requestHash, in template (value) EnrolmentResponseCode p_responseCode ) := { - requestHash := p_requestHash, - responseCode := p_responseCode, - certificate := omit + requestHash := p_requestHash, + responseCode := p_responseCode, + certificate := omit } // End of template m_innerEcResponse_ko template (present) InnerEcResponse mw_innerEcResponse_ko( @@ -380,9 +380,9 @@ module LibItsPki_Templates { in template (value) Oct16 p_requestHash, in template (value) EtsiTs103097Certificate p_certificate ) := { - requestHash := p_requestHash, - responseCode := ok, - certificate := p_certificate + requestHash := p_requestHash, + responseCode := ok, + certificate := p_certificate } // End of template m_innerAtResponse_ok template (present) InnerAtResponse mw_innerAtResponse_ok( diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn index ff34ae5b..f6a7f354 100644 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ b/ttcn/Pki/LibItsPki_TestSystem.ttcn @@ -102,6 +102,13 @@ module LibItsPki_TestSystem { var HashedId8 vc_aaHashedId8; /** Test Adapter AA HashedId8 for decryption of IUT's response */ var octetstring vc_aaWholeHash; /** Test Adapter AA whole-hash for signature check */ var octetstring vc_aaWholeHash256; /** Test Adapter AA whole-hash using SHA 256 for encryption because of encryption key size == 32 */ + + var PrivateEcKeys vc_ec_private_keys; + var PublicCompressedEcKeys vc_ec_public_compressed_key; + var EcCompressedModes vc_ec_compressed_modes; + var EcHashedId8 vc_ec_hashed_id8; + var EcCertificates vc_ec_certificates; + var integer vc_ec_keys_counter; } // End of component ItsPkiHttp /** diff --git a/ttcn/Pki/LibItsPki_TypesAndValues.ttcn b/ttcn/Pki/LibItsPki_TypesAndValues.ttcn index 0266e6ce..0d602c05 100644 --- a/ttcn/Pki/LibItsPki_TypesAndValues.ttcn +++ b/ttcn/Pki/LibItsPki_TypesAndValues.ttcn @@ -141,6 +141,11 @@ module LibItsPki_TypesAndValues { type record of CtlCommand CtlCommands; + type record of octetstring PrivateEcKeys; + type record of octetstring PublicCompressedEcKeys; + type record of integer EcCompressedModes; + type record of HashedId8 EcHashedId8; + type record of EtsiTs103097Certificate EcCertificates; } with { variant "" diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 3bd00481..b42ff886 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -2270,9 +2270,9 @@ module LibItsSecurity_Functions { * @return true on success, false otherwise */ function f_getCertificateHash( - in charstring p_certificate_id, - out octetstring p_hash - ) return boolean { + in charstring p_certificate_id, + out octetstring p_hash + ) return boolean { log(">>> f_getCertificateHash: ", p_certificate_id); if (not fx_readCertificateHash(p_certificate_id, p_hash)){ -- GitLab From 2d0b7d3bc373823087bae4a84c7529966490cff4 Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Wed, 29 Jul 2020 09:33:29 +0200 Subject: [PATCH 251/320] Update certificates for AtsSecurity --- ttcn/Pki/LibItsPki_Functions.ttcn | 2 +- .../LibItsSecurity_TypesAndValues.ttcn | 68 ++++++++++--------- 2 files changed, 37 insertions(+), 33 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 29183d47..eb80921e 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -3110,7 +3110,7 @@ module LibItsPki_Functions { log(">>> f_sign_dc_ctl"); - f_readSigningKey(p_issuer_certificate_id, v_private_key) + f_readSigningKey(p_issuer_certificate_id, v_private_key); f_getCertificateHash(p_issuer_certificate_id, v_issuer); // Encode the main data structure diff --git a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn index 53c98285..098e7aef 100644 --- a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn +++ b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn @@ -14,7 +14,7 @@ module LibItsSecurity_TypesAndValues { // LibCommon import from LibCommon_BasicTypesAndValues all; import from LibCommon_DataStrings all; - + // LibItsCommon import from LibItsCommon_Pixits all; @@ -22,24 +22,23 @@ module LibItsSecurity_TypesAndValues { import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; import from IEEE1609dot2 language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; - + /** * @desc Sequence of HashedId8 */ type record of HashedId8 HashedId8s; - // Test Adapter certificates & private keys - Valid behavior const charstring cc_taCert_A := PX_CERT_FOR_TS; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_A_AA := "CERT_TS_A_AA"; const charstring cc_taCert_A_EA := "CERT_TS_A_EA"; - const charstring cc_taCert_A1 := "CERT_TS_A_A1_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_A2 := "CERT_TS_A_A2_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_A3 := "CERT_TS_A_A3_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_B := "CERT_TS_B_AT"; /** Default certificate, with circular region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_B1 := "CERT_TS_B_1_AT"; + const charstring cc_taCert_A1 := "CERT_TS_A_A1_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_A2 := "CERT_TS_A_A2_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_A3 := "CERT_TS_A_A3_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_B := "CERT_TS_B_AT"; /** Default certificate, with circular region, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_B1 := "CERT_TS_B_1_AT"; const charstring cc_taCert_B_AA := "CERT_TS_B_1_AA"; - const charstring cc_taCert_C := "CERT_TS_C_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_C1 := "CERT_TS_C1_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_C := "CERT_TS_C_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ + const charstring cc_taCert_C1 := "CERT_TS_C1_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_CA1 := "CERT_TS_CA1_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_D := "CERT_TS_D_AT"; /** Certificate with a polygonal region, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_E := "CERT_TS_E_AT"; /** Certificate with a region identifier, to be used when secured messages are sent from TA to IUT */ @@ -142,18 +141,28 @@ module LibItsSecurity_TypesAndValues { const charstring cc_taCert1901_BO := "CERT_TS_19_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the reserved region type has been used in region validity restriction of the AT certificate */ // IUT certificates & private keys - const charstring cc_taCert_CA2 := "CERT_IUT_CA2_AT"; - const charstring cc_taCert_CA3 := "CERT_IUT_CA3_AT"; - const charstring cc_taCert_CC_AA := "CERT_IUT_CC_AA"; - const charstring cc_iutCert_A := "CERT_IUT_A_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_A_AA := "CERT_IUT_A_AA"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT - NistP256*/ - const charstring cc_iutCert_A_B := "CERT_IUT_A_B_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT - BrainpoolP256r1*/ - const charstring cc_iutCert_A_B3 := "CERT_IUT_A_B3_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT - BrainpoolP384r1*/ - const charstring cc_iutCert_B := "CERT_IUT_B_AT"; /** Default certificate, with circular region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_C := "CERT_IUT_C_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_D := "CERT_IUT_D_AT"; /** Certificate with a polygonal region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_E := "CERT_IUT_E_AT"; /** Certificate with a region identifier, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_F := "CERT_IUT_F_AT"; /** Certificate with a subject type indicating 'enrolment_credentials', to be used when secured messages are sent from TA to IUT */ + const charstring cc_iutCert_C1 := "CERT_IUT_C1_AT"; + const charstring cc_iutCert_CA2 := "CERT_IUT_CA2_AT"; + const charstring cc_iutCert_C3 := "CERT_IUT_C3_AA"; + const charstring cc_iutCert_CA3 := "CERT_IUT_CA3_AT"; + const charstring cc_iutCert_CA_AA := "CERT_IUT_CA_AA"; + const charstring cc_iutCert_CC_AA := "CERT_IUT_CC_AA"; + const charstring cc_iutCert_A := "CERT_IUT_A_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ + const charstring cc_iutCert_A1 := "CERT_IUT_A1_AT"; + const charstring cc_iutCert_A2 := "CERT_IUT_A2_AT"; + const charstring cc_iutCert_A3 := "CERT_IUT_A3_AT"; + const charstring cc_iutCert_A4 := "CERT_IUT_A4_AT"; + const charstring cc_iutCert_A_AA := "CERT_IUT_A_AA"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT - NistP256*/ + const charstring cc_iutCert_A_N := "CERT_IUT_A_N_AT"; + const charstring cc_iutCert_A_B_N := "CERT_IUT_A_B_N_AT"; + const charstring cc_iutCert_A_B := "CERT_IUT_A_B_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT - BrainpoolP256r1*/ + const charstring cc_iutCert_A_B3 := "CERT_IUT_A_B3_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT - BrainpoolP384r1*/ + const charstring cc_iutCert_A_B3_N := "CERT_IUT_A_B3_N_AT"; + const charstring cc_iutCert_B := "CERT_IUT_B_AT"; /** Default certificate, with circular region, to be used when secured messages are sent from TA to IUT */ + const charstring cc_iutCert_C := "CERT_IUT_C_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ + const charstring cc_iutCert_D := "CERT_IUT_D_AT"; /** Certificate with a polygonal region, to be used when secured messages are sent from TA to IUT */ + const charstring cc_iutCert_E := "CERT_IUT_E_AT"; /** Certificate with a region identifier, to be used when secured messages are sent from TA to IUT */ + const charstring cc_iutCert_F := "CERT_IUT_F_AT"; /** Certificate with a subject type indicating 'enrolment_credentials', to be used when secured messages are sent from TA to IUT */ /** * @desc Specification of basic format elements @@ -181,8 +190,6 @@ module LibItsSecurity_TypesAndValues { Bit1 noPassingForTrucks, Bit1 speedLimit, Bit18 reserved - } with { - variant "FIELDORDER(msb)" } // End of type SspCAM /** @@ -240,8 +247,6 @@ module LibItsSecurity_TypesAndValues { Bit1 signalViolation, Bit1 dangerousSituation, Bit8 reserved - } with { - variant "FIELDORDER(msb)" } // End of type SspDENM } // End of group certificateSpecification @@ -253,7 +258,7 @@ module LibItsSecurity_TypesAndValues { group profileCertificates { type record CertificatesCachingItem { - HashedId8 hashedId8, + HashedId8 hashedId8, EtsiTs103097Certificate certificate } type record of CertificatesCachingItem CertificatesCaching; @@ -265,7 +270,7 @@ module LibItsSecurity_TypesAndValues { e_brainpool_256, e_brainpool_384 } - + group taConfiguration { /** @@ -278,12 +283,12 @@ module LibItsSecurity_TypesAndValues { * @member location 3D location associated to each configuration */ /*type record TaConfig { - Oct32 signingPrivateKey, - Oct32 encryptPrivateKey, + Oct32 signingPrivateKey, + Oct32 encryptPrivateKey, EtsiTs103097Certificate caCertificate, EtsiTs103097Certificate aaCertificate, EtsiTs103097Certificate atCertificate, - ThreeDLocation location + ThreeDLocation location }*/ // End of type TaConfig /** @@ -301,6 +306,5 @@ module LibItsSecurity_TypesAndValues { } // End of group utPrimitives } with { - variant "" encode "LibItsSecurity" } // End of module LibItsSecurity_TypesAndValues -- GitLab From e7bd645473c61baabc7918f46998202c7c3ee92b Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Wed, 29 Jul 2020 10:38:17 +0200 Subject: [PATCH 252/320] Update certificates for AtsSecurity --- ttcn/Security/LibItsSecurity_TypesAndValues.ttcn | 1 + 1 file changed, 1 insertion(+) diff --git a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn index 098e7aef..65123d88 100644 --- a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn +++ b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn @@ -142,6 +142,7 @@ module LibItsSecurity_TypesAndValues { // IUT certificates & private keys const charstring cc_iutCert_C1 := "CERT_IUT_C1_AT"; + const charstring cc_iutCert_CA1 := "CERT_IUT_CA1_AT"; const charstring cc_iutCert_CA2 := "CERT_IUT_CA2_AT"; const charstring cc_iutCert_C3 := "CERT_IUT_C3_AA"; const charstring cc_iutCert_CA3 := "CERT_IUT_CA3_AT"; -- GitLab From c14b2e57a35a8376aa44dbf53c33ecf330380794 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 29 Jul 2020 10:42:09 +0200 Subject: [PATCH 253/320] Merge with TTworkbench verion --- ttcn/CAM/LibItsCam_Pics.ttcn | 2 +- .../GeoNetworking/LibItsGeoNetworking_Functions.ttcn | 4 ++-- ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn | 4 ++-- ttcn/Pki/LibItsPki_Functions.ttcn | 12 +++++++----- ttcn/Security/LibItsSecurity_TypesAndValues.ttcn | 2 ++ 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/ttcn/CAM/LibItsCam_Pics.ttcn b/ttcn/CAM/LibItsCam_Pics.ttcn index b32e1885..95028e84 100644 --- a/ttcn/CAM/LibItsCam_Pics.ttcn +++ b/ttcn/CAM/LibItsCam_Pics.ttcn @@ -121,7 +121,7 @@ module LibItsCam_Pics { } /** - * @desc Does radio communication use G5? + * @desc Does radio communication use ITS-G5 or LTE-V2X? * @see ETSI TS 102 868-1 Table A.3 */ modulepar RadioAccess PICS_RADIO_COMM := e_its_g5; diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn index ca0eaae8..b28cc04e 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn @@ -1,5 +1,5 @@ /** - * @author ETSI / STF405 / STF449 / STF484 / STF517 + * @author ETSI / STF405 / STF449 / STF484 / STF517 / STF 538 * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn $ * $Id: LibItsGeoNetworking_Functions.ttcn 1329 2017-02-21 14:48:18Z berge $ * @desc Module containing functions for GeoNetworking @@ -2805,7 +2805,7 @@ module LibItsGeoNetworking_Functions { m_geoNwSecPdu( v_gnNonSecuredPacket, v_securedMessage - ) // End of template m_geoNwSecPdu + ) )); // End of template m_geoNwReq_linkLayerBroadcast // Send Message diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn index 801c8635..518ff033 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn @@ -388,7 +388,7 @@ module LibItsMapemSpatem_Templates { /** * @desc Receive template for MAPEM Message */ - template (value) MapData m_mapem( + template (omit) MapData m_mapem( in template (value) MsgCount p_msgIssueRevision, in template (omit) IntersectionGeometryList p_intersectionGeometryList := omit, in template (omit) RoadSegmentList p_roadSegments := omit @@ -577,7 +577,7 @@ module LibItsMapemSpatem_Templates { template (value) IntersectionStateList m_intersections := { m_intersection }; - template (omit) IntersectionState m_intersection := { + template (value) IntersectionState m_intersection := { name := omit, // Human readable name for intersection to be used only in debug mode id := m_intersectionReferenceID, // A globally unique value set, consisting of a regionID and // intersection ID assignment provides a unique mapping to the intersection MAP in question which provides complete location and approach/move/lane data diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 29183d47..31be48d8 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -1725,6 +1725,7 @@ module LibItsPki_Functions { p_ec_certificate := valueof(v_cert); return true; } // End of function f_generate_ec_certificate + function f_generate_ec_certificate_for_inner_ec_response( in InnerEcRequest p_inner_ec_request, in octetstring p_private_key, @@ -2009,7 +2010,7 @@ module LibItsPki_Functions { v_public_verification_key ), m_certificateSubjectAttributes_id_name( - oct2char(PICS_ITS_S_CANONICAL_ID) & int2str(f_getCurrentTime()), // ETSI TS 103 097 V1.3.1 (2017-10) Clause 7.2.2 Enrolment credential + oct2char(PICS_ITS_S_CANONICAL_ID) & int2str(f_getCurrentTime()), // ETSI TS 103 097 Clause 7.2.2 Enrolment credential { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs valueof(m_appPermissions(c_its_aid_SCR, { bitmapSsp := PX_INNER_EC_CERTFICATE_BITMAP_SSP_SCR })) }, @@ -2034,7 +2035,7 @@ module LibItsPki_Functions { m_publicKeys( v_public_verification_key ), - m_certificateSubjectAttributes_id_omit( // ETSI TS 103 097 V1.3.1 (2017-10) Clause 7.2.2 Enrolment credential + m_certificateSubjectAttributes_id_omit( // ETSI TS 103 097 Clause 7.2.2 Enrolment credential { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs valueof(m_appPermissions(c_its_aid_SCR, { bitmapSsp := PX_INNER_EC_CERTFICATE_BITMAP_SSP_SCR })) }, @@ -2386,7 +2387,7 @@ module LibItsPki_Functions { m_certificate_subject_attributes( // FIXME Review subjectPermissions v_appPermissions, p_ec_certificate.toBeSigned.certRequestPermissions, - { none_ := NULL },//p_ec_certificate.toBeSigned.id, + -,//{ none_ := NULL },//p_ec_certificate.toBeSigned.id, p_ec_certificate.toBeSigned.validityPeriod, p_ec_certificate.toBeSigned.region, p_ec_certificate.toBeSigned.assuranceLevel @@ -3224,6 +3225,7 @@ module LibItsPki_Functions { log("f_verify_rca_ctl_response_message: Invalid nextUpdate value: compared values=", p_to_be_signed_rca_ctl.nextUpdate, "/", v_time); return false; } + // TODO Verify RCA certificate & signature } } @@ -3413,7 +3415,7 @@ module LibItsPki_Functions { if (match(p_ctl_entry.tlm, mw_tlm_entry(mw_etsiTs103097Certificate)) == false) { return false; } else { - // TODO Verify selsigned certificate + // TODO Verify RCA certificate & signature } } else if (ischosen(p_ctl_entry.dc)) { if (match(p_ctl_entry.dc, mw_dc_entry) == false) { @@ -4254,7 +4256,7 @@ module LibItsPki_Functions { v_msg := bit2oct(encvalue(p_ieee1609dot2_encrypted_and_signed_data)); log("f_verify_pki_request_message: Encoded request: ", v_msg); p_request_hash := substr(f_hashWithSha256(v_msg), 0, 16); - log("f_verify_pki_request_message: v_request_hash= ", p_request_hash); + log("f_verify_pki_request_message: p_request_hash= ", p_request_hash); // 2. Decrypt the InnerEcRequest log("f_verify_pki_request_message: p_private_enc_key= ", p_private_enc_key); diff --git a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn index 53c98285..8435edfd 100644 --- a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn +++ b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn @@ -147,6 +147,8 @@ module LibItsSecurity_TypesAndValues { const charstring cc_taCert_CC_AA := "CERT_IUT_CC_AA"; const charstring cc_iutCert_A := "CERT_IUT_A_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ const charstring cc_iutCert_A_AA := "CERT_IUT_A_AA"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT - NistP256*/ + const charstring cc_iutCert_A_N := "CERT_IUT_A_N_AT"; + const charstring cc_iutCert_A_B_N := "CERT_IUT_A_B_N_AT"; const charstring cc_iutCert_A_B := "CERT_IUT_A_B_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT - BrainpoolP256r1*/ const charstring cc_iutCert_A_B3 := "CERT_IUT_A_B3_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT - BrainpoolP384r1*/ const charstring cc_iutCert_B := "CERT_IUT_B_AT"; /** Default certificate, with circular region, to be used when secured messages are sent from TA to IUT */ -- GitLab From cdd2cf4a11ef4096dee4ebd25353fc770366c252 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 13 Aug 2020 07:53:33 +0200 Subject: [PATCH 254/320] Add GPC TTCN-3 library --- ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn | 342 ++++++++++++++++++ ttcn/Rtcmem/LibItsRtcmem_Pics.ttcn | 24 ++ ttcn/Rtcmem/LibItsRtcmem_Pixits.ttcn | 3 + ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn | 240 ++++++++++++ ttcn/Rtcmem/LibItsRtcmem_TestSystem.ttcn | 126 +++++++ ttcn/Rtcmem/LibItsRtcmem_TypesAndValues.ttcn | 89 +++++ ttcn/SremSsem/LibItsSremSsem_Functions.ttcn | 4 +- ttcn/SremSsem/LibItsSremSsem_Pics.ttcn | 2 +- .../LibItsSremSsem_TypesAndValues.ttcn | 10 +- 9 files changed, 830 insertions(+), 10 deletions(-) create mode 100644 ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn create mode 100644 ttcn/Rtcmem/LibItsRtcmem_Pics.ttcn create mode 100644 ttcn/Rtcmem/LibItsRtcmem_Pixits.ttcn create mode 100644 ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn create mode 100644 ttcn/Rtcmem/LibItsRtcmem_TestSystem.ttcn create mode 100644 ttcn/Rtcmem/LibItsRtcmem_TypesAndValues.ttcn diff --git a/ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn b/ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn new file mode 100644 index 00000000..bb8e5f66 --- /dev/null +++ b/ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn @@ -0,0 +1,342 @@ +module LibItsRtcmem_Functions { + + // LibCommon + import from LibCommon_Sync all; + import from LibCommon_Time all; + import from LibCommon_VerdictControl all; + + // LibIts + import from ITS_Container language "ASN.1:1997" all; + import from RTCMEM_PDU_Descriptions language "ASN.1:1997" all; + + // LibItsCommon + import from LibItsCommon_TypesAndValues all; + import from LibItsCommon_Templates all; + import from LibItsCommon_Functions all; + import from LibItsCommon_Pixits all; + + // LibItsRtcmem + import from LibItsRtcmem_TestSystem all; + import from LibItsRtcmem_TypesAndValues all; + import from LibItsRtcmem_Templates all; + import from LibItsRtcmem_Pics all; + import from LibItsRtcmem_Pixits all; + + group utFuntions { + + /** + * @desc Requests to bring the IUT in an initial state + * @param p_init The initialisation to trigger. + */ + function f_utInitializeIut(template (value) UtRtcmemInitialize p_init) runs on ItsRtcmem { + + //deactivate rtcmemPort default alts + vc_rtcmemDefaultActive := false; + + utPort.send(p_init); + tc_wait.start; + alt { + [] utPort.receive(UtRtcmemResults: { utRtcmemInitializeResult := true }) { + tc_wait.stop; + log("*** " & testcasename() & ": INFO: IUT initialized ***"); + } + [] tc_wait.timeout { + log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } + + //deactivate rtcmemPort default alts + vc_rtcmemDefaultActive := true; + } + + /** + * @desc Triggers an event from the application layer + * @param p_event The event to trigger. + */ + function f_utTriggerEvent( + in template (value) UtRtcmemTrigger p_event + ) runs on ItsRtcmem { + + //deactivate rtcmemPort default alts + vc_rtcmemDefaultActive := false; + + utPort.send ( p_event ); + tc_wait.start; + alt { + [] utPort.receive ( UtRtcmemResults: { utRtcmemTriggerResult := true }) { + tc_wait.stop; + } + [] utPort.receive ( UtRtcmemResults: { utRtcmemTriggerResult := false }) { + tc_wait.stop; + f_selfOrClientSyncAndVerdict("SREM Trigger failed", e_error); + } + [] tc_wait.timeout { + log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + [else] { // Shortcut defaults + //f_sleep(0.050); // 50 ms + repeat; + } + } + + return; + } + + /** + * @desc Updates an event from the application layer + * @param p_event The event to trigger. + */ + function f_utUpdateEvent( + in template (value) UtRtcmemUpdate p_event + ) runs on ItsRtcmem { + + utPort.send ( p_event ); + tc_wait.start; + alt { + [] utPort.receive ( UtRtcmemResults: { utRtcmemUpdateResult := true }) { + tc_wait.stop; + } + [] utPort.receive ( UtRtcmemResults: { utRtcmemUpdateResult := false }) { + tc_wait.stop; + f_selfOrClientSyncAndVerdict("SREM Update failed", e_error); + } + [] tc_wait.timeout { + log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } + + //activate rtcmemPort default alts + vc_rtcmemDefaultActive := true; + + return; + } + + } // End of group utFuntions + + group adapterControl { + + /** + * @desc Initialise secure mode if required + */ + function f_initialiseSecuredMode( + in charstring p_certificateId := PX_CERT_FOR_TS + ) runs on ItsRtcmem { + + if (PICS_IS_IUT_SECURED == true) { + + if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificateId))) { + log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); + stop; + } + } + + } // End of function f_initialiseSecuredMode() + + function f_uninitialiseSecuredMode() runs on ItsRtcmem { + + if (PICS_IS_IUT_SECURED == true) { + f_acTriggerSecEvent(m_acDisableSecurity); + } + + } // End of function f_initialiseSecuredMode() + + /** + * @desc Triggers event in the test system adaptation. + * @param p_event The event to trigger + * @return FncRetCode + */ + function f_acTriggerSecEvent(template (value) AcSecPrimitive p_event) runs on ItsRtcmem return FncRetCode { + var FncRetCode v_ret := e_success; + + acPort.send(p_event); + tc_ac.start; + alt { + [] acPort.receive(m_acSecResponseSuccess) { + tc_ac.stop; + } + [] acPort.receive { + tc_ac.stop; + log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] tc_ac.timeout { + log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for adapter control event result ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } + + return v_ret; + } + + } // End of group adapterControl + + group altsteps { + + /** + * @desc Default handling cf01 de-initialisation. + */ + altstep a_cf01Down() runs on ItsRtcmem { + [] a_shutdown() { + f_poDefault(); + f_cfDown(); + log("*** a_cf01Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } + } + + /** + * @desc The base default. + */ + altstep a_default() runs on ItsRtcmem { + [vc_rtcmemDefaultActive] rtcmemPort.receive(mw_rtcmemInd(mw_rtcmemPdu(mw_defaultRtcmem))) { + log("*** " & testcasename() & ": INFO: SREMM received in default ***"); + vc_rtcmemReceived := true; + repeat; + } + [vc_rtcmemDefaultActive] rtcmemPort.receive { + log("*** " & testcasename() & ": ERROR: Received an unexpected message ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] any timer.timeout { + log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + [] a_shutdown() { + f_poDefault(); + f_cfDown(); + log("*** " & testcasename() & ": INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } + } + + /** + * @desc The default for handling upper tester messages. + */ + altstep a_utDefault() runs on ItsRtcmem { + var UtRtcmemEventInd v_rtcmemevent; + + [] utPort.receive(UtRtcmemEventInd:?) -> value v_rtcmemevent { + //store every upper tester indication received + vc_utRtcmemEvents[lengthof(vc_utRtcmemEvents)] := v_rtcmemevent; + repeat; + } + [] utPort.receive { + log("*** " & testcasename() & ": INFO: Received unhandled/unknown UT message from IUT ***"); + repeat; + } + } + + } // End of group altsteps + + group rtcmemSsemConfigurationFunctions { + + /** + * @desc Setups default configuration + * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT + */ + function f_cfUp( + in charstring p_certificateId := PX_CERT_FOR_TS + ) runs on ItsRtcmem system ItsRtcmemSystem { + + map(self:acPort, system:acPort); + map(self:utPort, system:utPort); + map(self:rtcmemPort, system:rtcmemPort); + + // Connect + f_connect4SelfOrClientSync(); + activate(a_cf01Down()); + + // Initialise secured mode + f_initialiseSecuredMode(p_certificateId); + + //Initialze the IUT + f_prInitialState(); + + } // End of f_cfUp + + /** + * @desc Deletes default configuration + */ + function f_cfDown() runs on ItsRtcmem system ItsRtcmemSystem { + + // Initialise secured mode + f_uninitialiseSecuredMode(); + + unmap(self:utPort, system:utPort); + unmap(self:acPort, system:acPort); + unmap(self:rtcmemPort, system:rtcmemPort); + + f_disconnect4SelfOrClientSync(); + } // End of f_cfDown + + } // End of of rtcmemSsemConfigurationFunctions + + group preambles { + + /** + * @desc The default preamble. + */ + function f_prDefault() runs on ItsRtcmem { + vc_default := activate(a_default()); + activate(a_utDefault()); + } + + /** + * @desc Brings the IUT into an initial state. + * @return FncRetCode + */ + function f_prInitialState() runs on ItsRtcmem return FncRetCode { + var FncRetCode v_ret := e_success; + + f_utInitializeIut(m_rtcmemInitialize); + f_prDefault(); + return v_ret; + } + + } // End of group preambles + + group postambles { + + /** + * @desc The default postamble. + */ + function f_poDefault() runs on ItsRtcmem { + //empty + } + + } // End of group postambles + + group sendFunctions { + + } // End of group sendFunctions + + group receiveFunctions { + + /** + * @desc Awaits a SREM and returns it + * @param p_rcvMsg The expected message to be received. + * @param p_rcvdMsg The received message - OUT. + */ + function f_awaitRtcmeMessage( + in template (present) RtcmemInd p_rcvMsg, + out RtcmemInd p_rcvdMsg + ) runs on ItsRtcmem { + + tc_ac.start; + alt { + [] rtcmemPort.receive(p_rcvMsg) -> value p_rcvdMsg { + tc_ac.stop; + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INFO: Timeout while awaiting the reception of a message ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } + } + + } // End of group receiveFunctions + +} // End of module LibItsRtcmem_Functions diff --git a/ttcn/Rtcmem/LibItsRtcmem_Pics.ttcn b/ttcn/Rtcmem/LibItsRtcmem_Pics.ttcn new file mode 100644 index 00000000..6819803b --- /dev/null +++ b/ttcn/Rtcmem/LibItsRtcmem_Pics.ttcn @@ -0,0 +1,24 @@ +module LibItsRtcmem_Pics { + + // LibCommon + import from LibCommon_BasicTypesAndValues all; + + /** + * @desc Is the IUT running in secured mode? + * @see ETSI TS 103 191-1 Table A.1 + */ + modulepar boolean PICS_IS_IUT_SECURED := false; + + /** + * @desc Support for RTCMEM generation + * @see ETSI TS 103 191-1 Table A.5 + */ + modulepar boolean PICS_RTCMEM_GENERATION := true; + + /** + * @desc Support for RTCMEM reception + * @see ETSI TS 103 191-1 Table A.5 + */ + modulepar boolean PICS_RTCMEM_RECEPTION := true; + +} // End of module LibItsRtcmem_Pics diff --git a/ttcn/Rtcmem/LibItsRtcmem_Pixits.ttcn b/ttcn/Rtcmem/LibItsRtcmem_Pixits.ttcn new file mode 100644 index 00000000..f4018e8a --- /dev/null +++ b/ttcn/Rtcmem/LibItsRtcmem_Pixits.ttcn @@ -0,0 +1,3 @@ +module LibItsRtcmem_Pixits { + +} // End of module LibItsRtcmem_Pixits diff --git a/ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn b/ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn new file mode 100644 index 00000000..ad2bce55 --- /dev/null +++ b/ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn @@ -0,0 +1,240 @@ +module LibItsRtcmem_Templates { + + // LibCommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; + + // LibIts + import from ITS_Container language "ASN.1:1997" all; + import from RTCMEM_PDU_Descriptions language "ASN.1:1997" all; + import from DSRC language "ASN.1:1997" all; + + // LibItsCommon + import from LibItsCommon_TypesAndValues all; + import from LibItsCommon_Functions all; + import from LibItsCommon_ASN1_NamedNumbers all; + + // LibItsRtcmemSsem + import from LibItsRtcmem_TestSystem all; + import from LibItsRtcmem_TypesAndValues all; + import from LibItsRtcmem_Pixits all; + + group primitivesTemplates { + + /** + * @desc Send template for RTCMEM Message (RtcmemSsemPort Primitive) + * @param p_rtcmemMsg The RTCMEM Message to be sent + */ + template (value) RtcmemReq m_rtcmemReq( + in template (value) RTCMEM p_rtcmemMsg + ) := { + msgOut := p_rtcmemMsg + } + + /** + * @desc Receive template for RTCMEM Message (RtcmemSsemPort Primitive) + * @param p_rtcmemMsg The expected RTCMEM Message + */ + template (present) RtcmemInd mw_rtcmemInd( + template (present) RTCMEM p_rtcmemMsg + ) := { + msgIn := p_rtcmemMsg, + gnNextHeader := *, + gnHeaderType := *, + gnHeaderSubtype := *, + gnLifetime := *, + gnTrafficClass := *, + btpDestinationPort := *, + btpInfo := *, + ssp := *, + its_aid := * + } + + /** + * @desc Receive template for RTCMEM Message (RtcmemSsemPort Primitive) + * @param p_rtcmemMsg The expected RTCMEM Message + * @param p_gnNextHeader GN next header value + * @param p_gnHeaderType GN header type value + * @param p_gnHeaderSubtype GN header subtype value + * @param p_gnLifetime GN packet lifetime value (ms) + * @param p_gnTrafficClass GN traffic class value + */ + template (present) RtcmemInd mw_rtcmemIndWithGnParameters( + template (present) RTCMEM p_rtcmemMsg, + in template UInt8 p_gnNextHeader := *, + in template UInt8 p_gnHeaderType := *, + in template UInt8 p_gnHeaderSubtype := *, + in template UInt32 p_gnLifetime := *, + in template UInt8 p_gnTrafficClass := * + ) modifies mw_rtcmemInd := { + gnNextHeader := p_gnNextHeader, + gnHeaderType := p_gnHeaderType, + gnHeaderSubtype := p_gnHeaderSubtype, + gnLifetime := p_gnLifetime, + gnTrafficClass := p_gnTrafficClass + } + + /** + * @desc Receive template for RTCMEM Message (RtcmemSsemPort Primitive) + * @param p_rtcmemMsg Expected RTCMEM Message + * @param p_btpDestinationPort BTP destination port value + * @param p_btpInfo BTP destination port info value (if BTP-B) or BTP source port value (if BTP-A) + */ + template (present) RtcmemInd mw_rtcmemIndWithBtpParameters( + template (present) RTCMEM p_rtcmemMsg, + template UInt16 p_btpDestinationPort := *, + template UInt16 p_btpInfo := * + ) modifies mw_rtcmemInd := { + btpDestinationPort := p_btpDestinationPort, + btpInfo := p_btpInfo + }; + + /** + * @desc Receive template for RTCMEM Message (RtcmemSsemPort Primitive) + * @param p_rtcmemMsg The expected RTCMEM Message + * @param p_ssp SSP value + * @param p_its_aid ITS-AID value + */ + template (present) RtcmemInd mw_rtcmemIndWithSecurityParameters( + template (present) RTCMEM p_rtcmemMsg, + template Bit256 p_ssp := *, + template UInt32 p_its_aid := * + ) modifies mw_rtcmemInd := { + ssp := p_ssp, + its_aid := p_its_aid + } + + } + + group utPrimitives { + + /** + * @desc Send template for Upper Tester event initialization + * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use + */ + template (value) UtRtcmemInitialize m_rtcmemInitialize := { + hashedId8 := '0000000000000000'O + } + + /** + * @desc Send template for Upper Tester Trigger event + */ + template (omit) UtRtcmemTrigger m_utTriggerEvent( + in MsgCount p_msgCnt, + in RTCM_Revision p_rev := rtcmRev3, + in RTCMmessageList p_msgs, + in template (omit) MinuteOfTheYear p_timeStamp := omit, + in template (omit) FullPositionVector p_anchorPoint := omit, + in template (omit) RTCMheader p_rtcmHeader := omit + ) := { + msgCnt := p_msgCnt, + rev := p_rev, + msgs := p_msgs, + timeStamp := p_timeStamp, + anchorPoint := p_anchorPoint, + rtcmHeader := p_rtcmHeader + } + + } + + group rtcmemPduTemplates { + + /** + * @desc Send template for RTCMEM PDU + * @param p_map The RTCMEM Message + */ + template (value) RTCMEM m_rtcmemPdu( + in template (value) RTCMcorrections p_rtcmc + ) := { + header := m_itsPduHeader( - , - ,LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_rtcem_), + rtcmc := p_rtcmc + } + + /** + * @desc Receive template for RTCMEM PDU + * @param p_rtcmc The RTCMEM Message + */ + template (present) RTCMEM mw_rtcmemPdu( + template (present) RTCMcorrections p_rtcmc := ? + ) := { + header := mw_itsPduHeaderRtcmem, + rtcmc := p_rtcmc + } + + } // End of group rtcmemPduTemplates + + group headerTemplates { + + /** + * @desc Default send template for ITS PDU header + * @param p_stationID The source station ID (Default: test system station id) + * @param p_protocolVersion The protocol version (Default: current RTCMEM protocol version) + * @param p_messageID The message Id (Default: RTCMEM id) + */ + template (value) ItsPduHeader m_itsPduHeader( + in template (value) StationID p_stationID := f_getTsStationId(), + in template (value) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, + in template (value) ItsPduHeader.messageID p_messageID + ) := { + protocolVersion := p_protocolVersion, + messageID := p_messageID, + stationID := p_stationID + } + + /** + * @desc Default receive template for ITS PDU header + * @param p_stationID The expected station id (Default: any) + * @param p_protocolVersion The expected protocol version (Default: current RTCMEM protocol version) + * @param p_messageID The expected message id (Default: RTCMEM message id) + */ + template ItsPduHeader mw_itsPduHeader( + template (present) StationID p_stationID := ?, + template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, + template (present) ItsPduHeader.messageID p_messageID := ? + ) := { + protocolVersion := p_protocolVersion, + messageID := p_messageID, + stationID := p_stationID + } + + /** + * @desc Default receive template for ITS PDU header + * @param p_stationID The expected station id (Default: any) + * @param p_protocolVersion The expected protocol version (Default: current RTCMEM protocol version) + * @param p_messageID The expected message id (Default: SREM id) + */ + template ItsPduHeader mw_itsPduHeaderRtcmem( + template (present) StationID p_stationID := ?, + template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, + template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_srem_ + ) := { + protocolVersion := p_protocolVersion, + messageID := p_messageID, + stationID := p_stationID + } + + /** + * @desc Default receive template for the station id + */ + template (present) StationID mw_anyStationId := ?; + + } // End of group headerTemplates + + group rtcmemTemplatesRecv { + + /** + * @desc Receive template for RTCMEM Message + */ + template (present) RTCMcorrections mw_defaultRtcmem := { + msgCnt := ?, + rev := ?, + timeStamp := *, + anchorPoint := *, + rtcmHeader := *, + msgs := ?, + regional := * + } + + } // End of group rtcmemTemplatesRecv + +} // End of module LibItsRtcmem_Templates diff --git a/ttcn/Rtcmem/LibItsRtcmem_TestSystem.ttcn b/ttcn/Rtcmem/LibItsRtcmem_TestSystem.ttcn new file mode 100644 index 00000000..fa25cba0 --- /dev/null +++ b/ttcn/Rtcmem/LibItsRtcmem_TestSystem.ttcn @@ -0,0 +1,126 @@ +module LibItsRtcmem_TestSystem { + + // LibCommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_Time all; + import from LibCommon_Sync all; + import from LibCommon_DataStrings all; + + // LibIts + import from ITS_Container language "ASN.1:1997" all; + import from RTCMEM_PDU_Descriptions language "ASN.1:1997" all; + import from EfcDsrcGeneric language "ASN.1:1997" all; + + // LibItsCommon + import from LibItsCommon_TestSystem all; + import from LibItsCommon_TypesAndValues all; + + // LibItsRtcmem + import from LibItsRtcmem_TypesAndValues all; + + group portDefinitions { + + /** + * @desc Adapter control port + */ + type port AdapterControlPort message { + out + AcSecPrimitive; + in + AdapterControlResults; + } // end AdapterControlPort + + /** + * @desc Upper Tester port + */ + type port UpperTesterPort message { + out + UtRtcmemInitialize, UtRtcmemTrigger, UtRtcmemUpdate; + in + UtRtcmemResults, UtRtcmemEventInd; + } // end UpperTesterPort + + } // end portDefinitions + + group interfacePorts { + + /** + * @desc Application MapSpat Port + */ + type port RtcmemPort message { + in RtcmemInd; + out RtcmemReq + } + + } // End of group interfacePorts + + /** + * @desc ITS System Adapter + */ + type component ItsRtcmemSystem { + + port AdapterControlPort acPort; + port UpperTesterPort utPort; + port RtcmemPort rtcmemPort; + + } // End of component ITS System Adapter + + /** + * @desc Test component for ITS SREM-SSEM application layer + */ + type component ItsRtcmem extends ItsBaseComponent { + + port AdapterControlPort acPort; + port UpperTesterPort utPort; + port RtcmemPort rtcmemPort; + //timers + + //component variables + var RtcmemInd vc_mapMsg; + var UtRtcmemEventIndList vc_utRtcmemEvents := {}; + + //default + var default vc_default := null; + + //global variables + var boolean vc_rtcmemReceived := false; + + var boolean vc_rtcmemDefaultActive := true; + } // End of component ItsRtcmem + + group ApplPrimitives { + + type record RtcmemInd { + RTCMEM msgIn, + UInt8 gnNextHeader optional, + UInt8 gnHeaderType optional, + UInt8 gnHeaderSubtype optional, + UInt32 gnLifetime optional, + UInt8 gnTrafficClass optional, + UInt16 btpDestinationPort optional, + UInt16 btpInfo optional, + Bit256 ssp optional, + UInt32 its_aid optional + } + with { + encode (msgIn) "PER" + } + + type record of RtcmemInd RtcmemInds; + + /** + * @desc Appl SREM and SSEM Request Primitive + */ + type record RtcmemReq { + RTCMEM msgOut + } + with { + encode (msgOut) "PER" + } + + } with { + variant "" + encode "LibIts_Interface" + } // End of group ApplPrimitives + +} // End of module LibItsRtcmem_TestSystem diff --git a/ttcn/Rtcmem/LibItsRtcmem_TypesAndValues.ttcn b/ttcn/Rtcmem/LibItsRtcmem_TypesAndValues.ttcn new file mode 100644 index 00000000..fd8ec3d0 --- /dev/null +++ b/ttcn/Rtcmem/LibItsRtcmem_TypesAndValues.ttcn @@ -0,0 +1,89 @@ +module LibItsRtcmem_TypesAndValues { + + // LibCommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; + + // LibIts + import from ITS_Container language "ASN.1:1997" all; + import from RTCMEM_PDU_Descriptions language "ASN.1:1997" all; + import from DSRC language "ASN.1:1997" all; + + // LibItsCommon + import from LibItsCommon_TypesAndValues all; + + group utPrimitives { + + /** + * @desc Upper Tester message to initialize IUT + * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use + */ + type record UtRtcmemInitialize { + Oct8 hashedId8 + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Upper Tester results message of the Rtcmem/Ssem IUT + * @member utRtcmemInitialize - + * @member utRtcmemTriggerResult - + * @member utAutoInteropTriggerResult - + * @member utRtcmemChangePositionResult - + */ + type union UtRtcmemResults { + boolean utRtcmemInitializeResult, + boolean utRtcmemTriggerResult, + boolean utRtcmemUpdateResult + } with { + variant "" + } // End of type UtRtcmemResults + + /** + * @desc Upper Tester message to request triggering of an event at IUT + */ + type record UtRtcmemTrigger { + MsgCount msgCnt, + RTCM_Revision rev, + RTCMmessageList msgs, + MinuteOfTheYear timeStamp optional, + FullPositionVector anchorPoint optional, + RTCMheader rtcmHeader optional + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Upper Tester message to request updating of an event at IUT + */ + type record UtRtcmemUpdate { + RTCMmessageList msgs, + MinuteOfTheYear timeStamp optional, + FullPositionVector anchorPoint optional, + RTCMheader rtcmHeader optional + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Upper Tester message to check event/status at IUT + */ + type record UtRtcmemEventInd { + RTCMEM rtcmeMsg + } with { + encode (rtcmeMsg) "LibItsRtcmem_asn1" + } + + /** + * @desc List of Upper Tester messages to check event/status on RTCMEM IUT + */ + type record of UtRtcmemEventInd UtRtcmemEventIndList; + + } with { + encode "UpperTester" + variant "" + } + +} with { + encode "LibItsRtcmem" +} // End of module LibItsRtcmem_TypesAndValues diff --git a/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn b/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn index 7a007672..c1de03a4 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn @@ -252,7 +252,7 @@ module LibItsSremSsem_Functions { } // End of group altsteps - group mapSpatConfigurationFunctions { + group sremSsemConfigurationFunctions { /** * @desc Setups default configuration @@ -293,7 +293,7 @@ module LibItsSremSsem_Functions { f_disconnect4SelfOrClientSync(); } // End of f_cfDown - } // End of of mapSpatConfigurationFunctions + } // End of of sremSsemConfigurationFunctions group preambles { diff --git a/ttcn/SremSsem/LibItsSremSsem_Pics.ttcn b/ttcn/SremSsem/LibItsSremSsem_Pics.ttcn index 8d9e91e0..b2438a5d 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Pics.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Pics.ttcn @@ -44,4 +44,4 @@ module LibItsSremSsem_Pics { */ modulepar boolean PICS_SSEM_RECEPTION := true; -} // end LibItsMapemSpatem_Pics +} // end LibItsSremSsem_Pics diff --git a/ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn b/ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn index e2439758..897a1ac4 100644 --- a/ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn @@ -24,14 +24,10 @@ module LibItsSremSsem_TypesAndValues { // LibItsCommon import from LibItsCommon_TypesAndValues all; - group mapSpatConstants { - - } // end group mapSpatConstants - group utPrimitives { /** - * @desc Upper Tester mes`sage to initialize IUT + * @desc Upper Tester message to initialize IUT * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use */ type record UtSremInitialize { @@ -97,12 +93,12 @@ module LibItsSremSsem_TypesAndValues { } /** - * @desc List of Upper Tester messages to check event/status on MAPEM SPATEM IUT + * @desc List of Upper Tester messages to check event/status on SREM IUT */ type record of UtSremEventInd UtSremEventIndList; /** - * @desc List of Upper Tester messages to check event/status on MAPEM SPATEM IUT + * @desc List of Upper Tester messages to check event/status on SSEM IUT */ type record of UtSsemEventInd UtSsemEventIndList; -- GitLab From a5e1ab80add66b05a967925f79948b05b5f7b058 Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 14 Aug 2020 15:54:22 +0200 Subject: [PATCH 255/320] Start implemantation of RTCMEM TPs --- asn1/CAM/CAM_PDU_Descriptions.asn | 132 ++++++ asn1/DENM/DENM_PDU_Descriptions.asn | 108 +++++ asn1/EV-RSR/EV_RSR_PDU_Descriptions.asn | 157 ++++++++ asn1/EVCSN/EVCSN_PDU_Descriptions.asn | 102 +++++ asn1/ITS-Container/ITS_Container.asn | 508 ++++++++++++++++++++++++ 5 files changed, 1007 insertions(+) create mode 100644 asn1/CAM/CAM_PDU_Descriptions.asn create mode 100644 asn1/DENM/DENM_PDU_Descriptions.asn create mode 100644 asn1/EV-RSR/EV_RSR_PDU_Descriptions.asn create mode 100644 asn1/EVCSN/EVCSN_PDU_Descriptions.asn create mode 100644 asn1/ITS-Container/ITS_Container.asn diff --git a/asn1/CAM/CAM_PDU_Descriptions.asn b/asn1/CAM/CAM_PDU_Descriptions.asn new file mode 100644 index 00000000..a13a9fac --- /dev/null +++ b/asn1/CAM/CAM_PDU_Descriptions.asn @@ -0,0 +1,132 @@ +CAM-PDU-Descriptions { +itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) en (302637) cam (2) version (2) +} + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +IMPORTS +ItsPduHeader, CauseCode, ReferencePosition, AccelerationControl, Curvature, CurvatureCalculationMode, Heading, LanePosition, EmergencyPriority, EmbarkationStatus, Speed, DriveDirection, LongitudinalAcceleration, LateralAcceleration, VerticalAcceleration, StationType, ExteriorLights, DangerousGoodsBasic, SpecialTransportType, LightBarSirenInUse, VehicleRole, VehicleLength, VehicleWidth, PathHistory, RoadworksSubCauseCode, ClosedLanes, TrafficRule, SpeedLimit, SteeringWheelAngle, PerformanceClass, YawRate, ProtectedCommunicationZone, PtActivation, Latitude, Longitude, ProtectedCommunicationZonesRSU, CenDsrcTollingZone FROM ITS-Container { +itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) +}; + + +-- The root data frame for cooperative awareness messages + +CAM ::= SEQUENCE { + header ItsPduHeader, + cam CoopAwareness +} + +CoopAwareness ::= SEQUENCE { + generationDeltaTime GenerationDeltaTime, + camParameters CamParameters +} + +CamParameters ::= SEQUENCE { + basicContainer BasicContainer, + highFrequencyContainer HighFrequencyContainer, + lowFrequencyContainer LowFrequencyContainer OPTIONAL, + specialVehicleContainer SpecialVehicleContainer OPTIONAL, + ... +} + +HighFrequencyContainer ::= CHOICE { + basicVehicleContainerHighFrequency BasicVehicleContainerHighFrequency, + rsuContainerHighFrequency RSUContainerHighFrequency, + ... +} + + LowFrequencyContainer ::= CHOICE { + basicVehicleContainerLowFrequency BasicVehicleContainerLowFrequency, + ... +} + +SpecialVehicleContainer ::= CHOICE { + publicTransportContainer PublicTransportContainer, + specialTransportContainer SpecialTransportContainer, + dangerousGoodsContainer DangerousGoodsContainer, + roadWorksContainerBasic RoadWorksContainerBasic, + rescueContainer RescueContainer, + emergencyContainer EmergencyContainer, + safetyCarContainer SafetyCarContainer, + ... +} + +BasicContainer ::= SEQUENCE { + stationType StationType, + referencePosition ReferencePosition, + ... +} + +BasicVehicleContainerHighFrequency ::= SEQUENCE { + heading Heading, + speed Speed, + driveDirection DriveDirection, + vehicleLength VehicleLength, + vehicleWidth VehicleWidth, + longitudinalAcceleration LongitudinalAcceleration, + curvature Curvature, + curvatureCalculationMode CurvatureCalculationMode, + yawRate YawRate, + accelerationControl AccelerationControl OPTIONAL, + lanePosition LanePosition OPTIONAL, + steeringWheelAngle SteeringWheelAngle OPTIONAL, + lateralAcceleration LateralAcceleration OPTIONAL, + verticalAcceleration VerticalAcceleration OPTIONAL, + performanceClass PerformanceClass OPTIONAL, + cenDsrcTollingZone CenDsrcTollingZone OPTIONAL +} + +BasicVehicleContainerLowFrequency ::= SEQUENCE { + vehicleRole VehicleRole, + exteriorLights ExteriorLights, + pathHistory PathHistory +} + +PublicTransportContainer ::= SEQUENCE { + embarkationStatus EmbarkationStatus, + ptActivation PtActivation OPTIONAL +} + +SpecialTransportContainer ::= SEQUENCE { + specialTransportType SpecialTransportType, + lightBarSirenInUse LightBarSirenInUse +} + + DangerousGoodsContainer ::= SEQUENCE { + dangerousGoodsBasic DangerousGoodsBasic + } + + RoadWorksContainerBasic ::= SEQUENCE { + roadworksSubCauseCode RoadworksSubCauseCode OPTIONAL, + lightBarSirenInUse LightBarSirenInUse, + closedLanes ClosedLanes OPTIONAL + } + +RescueContainer ::= SEQUENCE { + lightBarSirenInUse LightBarSirenInUse +} + +EmergencyContainer ::= SEQUENCE { + lightBarSirenInUse LightBarSirenInUse, + incidentIndication CauseCode OPTIONAL, + emergencyPriority EmergencyPriority OPTIONAL +} + +SafetyCarContainer ::= SEQUENCE { + lightBarSirenInUse LightBarSirenInUse, + incidentIndication CauseCode OPTIONAL, + trafficRule TrafficRule OPTIONAL, + speedLimit SpeedLimit OPTIONAL +} + +RSUContainerHighFrequency ::= SEQUENCE { + protectedCommunicationZonesRSU ProtectedCommunicationZonesRSU OPTIONAL, + ... +} + +GenerationDeltaTime ::= INTEGER { oneMilliSec(1) } (0..65535) + +END \ No newline at end of file diff --git a/asn1/DENM/DENM_PDU_Descriptions.asn b/asn1/DENM/DENM_PDU_Descriptions.asn new file mode 100644 index 00000000..fa4ea6d7 --- /dev/null +++ b/asn1/DENM/DENM_PDU_Descriptions.asn @@ -0,0 +1,108 @@ +DENM-PDU-Descriptions {itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) en (302637) denm (1) version (2) +} + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +IMPORTS +ItsPduHeader, CauseCode, Speed, InformationQuality, ReferencePosition, ClosedLanes, DangerousGoodsExtended, Heading, LanePosition, LightBarSirenInUse, RoadType, HeightLonCarr, PosLonCarr, PosCentMass, PositioningSolutionType, RequestResponseIndication, StationType, SpeedLimit, StationarySince, TimestampIts, WheelBaseVehicle, TurningRadius, PosFrontAx, PositionOfOccupants, Temperature, VehicleMass, VehicleIdentification, EnergyStorageType, ActionID, ItineraryPath, NumberOfOccupants, PositionOfPillars, RelevanceTrafficDirection, RestrictedTypes, Traces, TransmissionInterval, ValidityDuration, RelevanceDistance, EventHistory, TrafficRule, DeltaReferencePosition FROM ITS-Container { +itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) +}; + + +DENM ::= SEQUENCE { + header ItsPduHeader, + denm DecentralizedEnvironmentalNotificationMessage +} + +DecentralizedEnvironmentalNotificationMessage ::= SEQUENCE { + management ManagementContainer, + situation SituationContainer OPTIONAL, + location LocationContainer OPTIONAL, + alacarte AlacarteContainer OPTIONAL +} + +ManagementContainer ::= SEQUENCE { + actionID ActionID, + detectionTime TimestampIts, + referenceTime TimestampIts, + termination Termination OPTIONAL, + eventPosition ReferencePosition, + relevanceDistance RelevanceDistance OPTIONAL, + relevanceTrafficDirection RelevanceTrafficDirection OPTIONAL, + validityDuration ValidityDuration DEFAULT defaultValidity, + transmissionInterval TransmissionInterval OPTIONAL, + stationType StationType, + ... +} + +SituationContainer ::= SEQUENCE { + informationQuality InformationQuality, + eventType CauseCode, + linkedCause CauseCode OPTIONAL, + eventHistory EventHistory OPTIONAL, + ... +} + +LocationContainer ::= SEQUENCE { + eventSpeed Speed OPTIONAL, + eventPositionHeading Heading OPTIONAL, + traces Traces, + roadType RoadType OPTIONAL, + ... +} + +ImpactReductionContainer ::= SEQUENCE { + heightLonCarrLeft HeightLonCarr, + heightLonCarrRight HeightLonCarr, + posLonCarrLeft PosLonCarr, + posLonCarrRight PosLonCarr, + positionOfPillars PositionOfPillars, + posCentMass PosCentMass, + wheelBaseVehicle WheelBaseVehicle, + turningRadius TurningRadius, + posFrontAx PosFrontAx, + positionOfOccupants PositionOfOccupants, + vehicleMass VehicleMass, + requestResponseIndication RequestResponseIndication +} + +RoadWorksContainerExtended ::= SEQUENCE { + lightBarSirenInUse LightBarSirenInUse OPTIONAL, + closedLanes ClosedLanes OPTIONAL, + restriction RestrictedTypes OPTIONAL, + speedLimit SpeedLimit OPTIONAL, + incidentIndication CauseCode OPTIONAL, + recommendedPath ItineraryPath OPTIONAL, + startingPointSpeedLimit DeltaReferencePosition OPTIONAL, + trafficFlowRule TrafficRule OPTIONAL, + referenceDenms ReferenceDenms OPTIONAL + } + +StationaryVehicleContainer ::= SEQUENCE { + stationarySince StationarySince OPTIONAL, + stationaryCause CauseCode OPTIONAL, + carryingDangerousGoods DangerousGoodsExtended OPTIONAL, + numberOfOccupants NumberOfOccupants OPTIONAL, + vehicleIdentification VehicleIdentification OPTIONAL, + energyStorageType EnergyStorageType OPTIONAL +} + +AlacarteContainer ::= SEQUENCE { + lanePosition LanePosition OPTIONAL, + impactReduction ImpactReductionContainer OPTIONAL, + externalTemperature Temperature OPTIONAL, + roadWorks RoadWorksContainerExtended OPTIONAL, + positioningSolution PositioningSolutionType OPTIONAL, + stationaryVehicle StationaryVehicleContainer OPTIONAL, + ... +} + +defaultValidity INTEGER ::= 600 + +Termination ::= ENUMERATED {isCancellation(0), isNegation (1)} + +ReferenceDenms ::= SEQUENCE (SIZE(1..8, ...)) OF ActionID + +END \ No newline at end of file diff --git a/asn1/EV-RSR/EV_RSR_PDU_Descriptions.asn b/asn1/EV-RSR/EV_RSR_PDU_Descriptions.asn new file mode 100644 index 00000000..1455feed --- /dev/null +++ b/asn1/EV-RSR/EV_RSR_PDU_Descriptions.asn @@ -0,0 +1,157 @@ +EV-RechargingSpotReservation-PDU-Descriptions { + itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (101556) ev-rsr (4) version (1) +} + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +IMPORTS + ItsPduHeader FROM ITS-Container { + itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) +}; + +EV-RSR ::= SEQUENCE { + header ItsPduHeader, + messageBody EV-RSR-MessageBody +} + +EV-RSR-MessageBody ::= CHOICE { + preReservationRequestMessage PreReservationRequestMessage, + preReservationResponseMessage PreReservationResponseMessage, + reservationRequestMessage ReservationRequestMessage, + reservationResponseMessage ReservationResponseMessage, + cancellationRequestMessage CancellationRequestMessage, + cancellationResponseMessage CancellationResponseMessage, + updateRequestMessage UpdateRequestMessage, + updateResponseMessage UpdateResponseMessage, +... +} + +PreReservationRequestMessage ::= SEQUENCE { + evse-ID EVSE-ID, + arrivalTime TimestampUTC, + departureTime TimestampUTC OPTIONAL, + rechargingType RechargingType, + batteryType BatteryType OPTIONAL, + ... +} + +PreReservationResponseMessage ::= SEQUENCE { + preReservation-ID PreReservation-ID, + availabilityStatus AvailabilityStatus, + preReservationExpirationTime TimestampUTC, + supportedPaymentTypes SupportedPaymentTypes, + ... +} + +ReservationRequestMessage ::= SEQUENCE { + currentTime TimestampUTC, + preReservation-ID PreReservation-ID, + arrivalTime TimestampUTC, + departureTime TimestampUTC OPTIONAL, + eAmount EAmount, + eAmountMin EAmount, + paymentType PaymentType, + payment-ID Payment-ID, + secondPayment-ID Payment-ID OPTIONAL, + pairing-ID Pairing-ID OPTIONAL, + ... +} + +ReservationResponseMessage ::= SEQUENCE { + reservationResponseCode ReservationResponseCode, + reservation-ID Reservation-ID OPTIONAL, + reservation-Password Reservation-Password OPTIONAL, + stationDetails StationDetails OPTIONAL, + chargingSpotLabel ChargingSpotLabel OPTIONAL, + expirationTime TimestampUTC, + freeCancelTimeLimit TimestampUTC OPTIONAL, + ... +} + +CancellationRequestMessage ::= SEQUENCE { + reservation-ID Reservation-ID, + reservation-Password Reservation-Password, + currentTime TimestampUTC, + ... +} + +CancellationResponseMessage ::= SEQUENCE { + reservation-ID Reservation-ID, + cancellationResponseCode CancellationResponseCode, + ... +} + +UpdateRequestMessage ::= SEQUENCE { + reservation-ID Reservation-ID, + reservation-Password Reservation-Password, + updatedArrivalTime TimestampUTC, + updatedDepartureTime TimestampUTC, + ... +} + +UpdateResponseMessage ::= SEQUENCE { + reservation-ID Reservation-ID, + updateResponseCode UpdateResponseCode, + chargingSpotLabel ChargingSpotLabel OPTIONAL, + ... +} + + + +AvailabilityStatus ::= ENUMERATED { available, no-free-capacity } + +BatteryType ::= UTF8String (SIZE(1..16)) + +CancellationResponseCode ::= ENUMERATED { ok, unknown-Reservation-ID, mismatching-Reservation-Password } + +ChargingSpotLabel ::= UTF8String (SIZE(1..4)) + +ContractID ::= UTF8String (SIZE(1..24)) + +EAmount ::= INTEGER { oneWh(1) } (1..500000) + +ChargingPower ::= INTEGER { oneW(1) } (1..200000) + +EVSE-ID ::= OCTET STRING (SIZE(1..32)) + +ExternalIdentificationMeans ::= UTF8String (SIZE(1..24)) + +Pairing-ID ::= VisibleString (SIZE(1..64)) + +PaymentType ::= ENUMERATED {contract, externalIdentification} + +Payment-ID ::= CHOICE { + contractID ContractID, + externalIdentificationMeans ExternalIdentificationMeans +} + +RechargingType ::= SEQUENCE { + rechargingMode RechargingMode, + powerSource PowerSource +} + +RechargingMode ::= INTEGER { mode1(0), mode2(1), mode3(2), mode4(3), quickDrop(8), inductiveChargingWhileStationary(12), inductiveChargingWhileDriving(14) } (0..15) + +PowerSource::= INTEGER { notApplicable(0), ac1Phase(1), ac2Phase(2), ac3Phase(3), dcc(4), chaDeMo(5) } (0..7) +ReservationResponseCode ::= ENUMERATED {ok, invalid-EVSE-ID, payment-type-not-supported, payment-error, authentication-error, insufficient-power-availability } + +Reservation-ID ::= VisibleString (SIZE(8)) + +PreReservation-ID ::= Reservation-ID + +Reservation-Password ::= VisibleString (SIZE(8)) + + +StationDetails ::= UTF8String (SIZE(1..32)) + +SupportedPaymentTypes ::= BIT STRING { contract(0), externalIdentification (1) } (SIZE(2)) + +TimestampUTC ::= INTEGER { utcStartOf2013(0), oneSecondAfterUTCStartOf2013(1) } + +UpdateResponseCode ::= ENUMERATED { ok, unknown-Reservation-ID, mismatching-Reservation-Password, invalid-Arrival-Time, invalid-Departure-Time } + +StatusResponseCode ::= ENUMERATED { charging-Spot-Occupied, charging-Spot-Unoccupied, charging-Ongoing, reservation-Limit-Exceeded, reservation-Cancelled, unknown-Reservation-ID, expired-Reservation-ID } + +END diff --git a/asn1/EVCSN/EVCSN_PDU_Descriptions.asn b/asn1/EVCSN/EVCSN_PDU_Descriptions.asn new file mode 100644 index 00000000..b86fbb19 --- /dev/null +++ b/asn1/EVCSN/EVCSN_PDU_Descriptions.asn @@ -0,0 +1,102 @@ +-- Point of Interest (POI) notification for charging spot +-- for electric vehicle +-- EVCSN Message definition +-- ASN.1 Start Definition + +EVCSN-PDU-Descriptions { +itu-t (0) identified-organization (4) etsi (0) itsDomain (5) +wg1 (1) ts (101556) evcsn (1) version (1) +} + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +IMPORTS + ItsPduHeader, + StationID, + TimestampIts, + ReferencePosition +FROM ITS-Container { + itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) +}; + +-- Root Message PDU: EvcsnPdu + +EvcsnPdu ::= SEQUENCE { + header ItsPduHeader, + evcsn EVChargingSpotNotificationPOIMessage +} + +EVChargingSpotNotificationPOIMessage ::= SEQUENCE { + poiHeader ItsPOIHeader, -- Specific POI Message Header + evcsnData ItsEVCSNData -- Electric Vehicle Charging Spot Data Elements +} + +ItsPOIHeader ::= SEQUENCE { + poiType POIType, -- set to "EV charging station POI ID = 1" + timeStamp TimestampIts, + relayCapable BOOLEAN +} + + +ItsEVCSNData ::= SEQUENCE { + totalNumberOfStations NumberStations, + chargingStationsData SEQUENCE (SIZE(1..256)) OF ItsChargingStationData +} + +ItsChargingStationData ::= SEQUENCE { + chargingStationID StationID, + utilityDistributorId UTF8String (SIZE(1..32)) OPTIONAL, + providerID UTF8String (SIZE(1..32)) OPTIONAL, + chargingStationLocation ReferencePosition, + address UTF8String OPTIONAL, + phoneNumber NumericString (SIZE(1..16)) OPTIONAL, + accessibility UTF8String (SIZE(1..32)), + digitalMap DigitalMap OPTIONAL, + openingDaysHours UTF8String, + pricing UTF8String, + bookingContactInfo UTF8String OPTIONAL, + payment UTF8String OPTIONAL, + chargingSpotsAvailable ItsChargingSpots, + ... +} + + +ItsChargingSpots ::= SEQUENCE (SIZE(1..16)) OF ItsChargingSpotDataElements + + +ItsChargingSpotDataElements ::= SEQUENCE { + type ChargingSpotType, + evEquipmentID UTF8String OPTIONAL, + typeOfReceptacle TypeOfReceptacle, + energyAvailability UTF8String, + parkingPlacesData ParkingPlacesData OPTIONAL +} + +DigitalMap ::= SEQUENCE (SIZE(1..256)) OF ReferencePosition + +ChargingSpotType ::= BIT STRING { + standardChargeMode1(0), + standardChargeMode2(1), + standardOrFastChargeMode3(2), + fastChargeWithExternalCharger(3), + quickDrop(8), + inductiveChargeWhileStationary(12), + inductiveChargeWhileDriving(14) +} + +TypeOfReceptacle ::= BIT STRING + +ParkingPlacesData ::= SEQUENCE (SIZE(1..4)) OF SpotAvailability + +SpotAvailability ::= SEQUENCE { + maxWaitingTimeMinutes INTEGER (0..1400), -- 0 if available or max waiting + -- time (minutes) + blocking BOOLEAN -- true if the spot can be blocked +} + +POIType ::= INTEGER(0..65535) +NumberStations ::= INTEGER(1..256) + +END diff --git a/asn1/ITS-Container/ITS_Container.asn b/asn1/ITS-Container/ITS_Container.asn new file mode 100644 index 00000000..8b6874e0 --- /dev/null +++ b/asn1/ITS-Container/ITS_Container.asn @@ -0,0 +1,508 @@ +ITS-Container { +itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) +} + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +IMPORTS; + +ItsPduHeader ::= SEQUENCE { + protocolVersion INTEGER (0..255), + messageID INTEGER{ denm(1), cam(2), poi(3), spatem(4), mapem(5), ivim(6), ev-rsr(7), tistpgtransaction(8), srem(9), ssem(10), evcsn(11), saem(12), rtcmem(13) } (0..255), -- Mantis #7209, #7005 + stationID StationID +} + +StationID ::= INTEGER(0..4294967295) + +ReferencePosition ::= SEQUENCE { + latitude Latitude, + longitude Longitude, + positionConfidenceEllipse PosConfidenceEllipse , + altitude Altitude +} + +DeltaReferencePosition ::= SEQUENCE { + deltaLatitude DeltaLatitude, + deltaLongitude DeltaLongitude, + deltaAltitude DeltaAltitude +} + +Longitude ::= INTEGER {oneMicrodegreeEast (10), oneMicrodegreeWest (-10), unavailable(1800000001)} (-1800000000..1800000001) + +Latitude ::= INTEGER {oneMicrodegreeNorth (10), oneMicrodegreeSouth (-10), unavailable(900000001)} (-900000000..900000001) + +Altitude ::= SEQUENCE { + altitudeValue AltitudeValue, + altitudeConfidence AltitudeConfidence +} + +AltitudeValue ::= INTEGER {referenceEllipsoidSurface(0), oneCentimeter(1), unavailable(800001)} (-100000..800001) + +AltitudeConfidence ::= ENUMERATED { + alt-000-01 (0), + alt-000-02 (1), + alt-000-05 (2), + alt-000-10 (3), + alt-000-20 (4), + alt-000-50 (5), + alt-001-00 (6), + alt-002-00 (7), + alt-005-00 (8), + alt-010-00 (9), + alt-020-00 (10), + alt-050-00 (11), + alt-100-00 (12), + alt-200-00 (13), + outOfRange (14), + unavailable (15) +} + +DeltaLongitude ::= INTEGER {oneMicrodegreeEast (10), oneMicrodegreeWest (-10), unavailable(131072)} (-131071..131072) + +DeltaLatitude ::= INTEGER {oneMicrodegreeNorth (10), oneMicrodegreeSouth (-10) , unavailable(131072)} (-131071..131072) + +DeltaAltitude ::= INTEGER {oneCentimeterUp (1), oneCentimeterDown (-1), unavailable(12800)} (-12700..12800) + +PosConfidenceEllipse ::= SEQUENCE { + semiMajorConfidence SemiAxisLength, + semiMinorConfidence SemiAxisLength, + semiMajorOrientation HeadingValue +} + +PathPoint ::= SEQUENCE { + pathPosition DeltaReferencePosition, + pathDeltaTime PathDeltaTime OPTIONAL +} + +PathDeltaTime ::= INTEGER {tenMilliSecondsInPast(1)} (1..65535, ...) + +PtActivation ::= SEQUENCE { + ptActivationType PtActivationType, + ptActivationData PtActivationData +} + +PtActivationType ::= INTEGER {undefinedCodingType(0), r09-16CodingType(1), vdv-50149CodingType(2)} (0..255) + +PtActivationData ::= OCTET STRING (SIZE(1..20)) + +AccelerationControl ::= BIT STRING { + brakePedalEngaged (0), + gasPedalEngaged (1), + emergencyBrakeEngaged (2), + collisionWarningEngaged (3), + accEngaged (4), + cruiseControlEngaged (5), + speedLimiterEngaged (6) +} (SIZE(7)) + +SemiAxisLength ::= INTEGER{oneCentimeter(1), outOfRange(4094), unavailable(4095)} (0..4095) + +CauseCode ::= SEQUENCE { + causeCode CauseCodeType, + subCauseCode SubCauseCodeType, + ... +} + +CauseCodeType ::= INTEGER { + reserved (0), + trafficCondition (1), + accident (2), + roadworks (3), + impassability (5), + adverseWeatherCondition-Adhesion (6), + aquaplannning (7), + hazardousLocation-SurfaceCondition (9), + hazardousLocation-ObstacleOnTheRoad (10), + hazardousLocation-AnimalOnTheRoad (11), + humanPresenceOnTheRoad (12), + wrongWayDriving (14), + rescueAndRecoveryWorkInProgress (15), + adverseWeatherCondition-ExtremeWeatherCondition (17), + adverseWeatherCondition-Visibility (18), + adverseWeatherCondition-Precipitation (19), + slowVehicle (26), + dangerousEndOfQueue (27), + vehicleBreakdown (91), + postCrash (92), + humanProblem (93), + stationaryVehicle (94), + emergencyVehicleApproaching (95), + hazardousLocation-DangerousCurve (96), + collisionRisk (97), + signalViolation (98), + dangerousSituation (99) +} (0..255) + +SubCauseCodeType ::= INTEGER (0..255) + +TrafficConditionSubCauseCode ::= INTEGER {unavailable(0), increasedVolumeOfTraffic(1), trafficJamSlowlyIncreasing(2), trafficJamIncreasing(3), trafficJamStronglyIncreasing(4), trafficStationary(5), trafficJamSlightlyDecreasing(6), trafficJamDecreasing(7), trafficJamStronglyDecreasing(8)} (0..255) + +AccidentSubCauseCode ::= INTEGER {unavailable(0), multiVehicleAccident(1), heavyAccident(2), accidentInvolvingLorry(3), accidentInvolvingBus(4), accidentInvolvingHazardousMaterials(5), accidentOnOppositeLane(6), unsecuredAccident(7), assistanceRequested(8)} (0..255) + +RoadworksSubCauseCode ::= INTEGER {unavailable(0), majorRoadworks(1), roadMarkingWork(2), slowMovingRoadMaintenance(3), shortTermStationaryRoadworks(4), streetCleaning(5), winterService(6)} (0..255) + +HumanPresenceOnTheRoadSubCauseCode ::= INTEGER {unavailable(0), childrenOnRoadway(1), cyclistOnRoadway(2), motorcyclistOnRoadway(3)} (0..255) + +WrongWayDrivingSubCauseCode ::= INTEGER {unavailable(0), wrongLane(1), wrongDirection(2)} (0..255) + +AdverseWeatherCondition-ExtremeWeatherConditionSubCauseCode ::= INTEGER {unavailable(0), strongWinds(1), damagingHail(2), hurricane(3), thunderstorm(4), tornado(5), blizzard(6)} (0..255) + +AdverseWeatherCondition-AdhesionSubCauseCode ::= INTEGER {unavailable(0), heavyFrostOnRoad(1), fuelOnRoad(2), mudOnRoad(3), snowOnRoad(4), iceOnRoad(5), blackIceOnRoad(6), oilOnRoad(7), looseChippings(8), instantBlackIce(9), roadsSalted(10)} (0..255) + +AdverseWeatherCondition-VisibilitySubCauseCode ::= INTEGER {unavailable(0), fog(1), smoke(2), heavySnowfall(3), heavyRain(4), heavyHail(5), lowSunGlare(6), sandstorms(7), swarmsOfInsects(8)} (0..255) + +AdverseWeatherCondition-PrecipitationSubCauseCode ::= INTEGER {unavailable(0), heavyRain(1), heavySnowfall(2), softHail(3)} (0..255) + +SlowVehicleSubCauseCode ::= INTEGER {unavailable(0), maintenanceVehicle(1), vehiclesSlowingToLookAtAccident(2), abnormalLoad(3), abnormalWideLoad(4), convoy(5), snowplough(6), deicing(7), saltingVehicles(8)} (0..255) + +StationaryVehicleSubCauseCode ::= INTEGER {unavailable(0), humanProblem(1), vehicleBreakdown(2), postCrash(3), publicTransportStop(4), carryingDangerousGoods(5)} (0..255) + +HumanProblemSubCauseCode ::= INTEGER {unavailable(0), glycemiaProblem(1), heartProblem(2)} (0..255) + +EmergencyVehicleApproachingSubCauseCode ::= INTEGER {unavailable(0), emergencyVehicleApproaching(1), prioritizedVehicleApproaching(2)} (0..255) + +HazardousLocation-DangerousCurveSubCauseCode ::= INTEGER {unavailable(0), dangerousLeftTurnCurve(1), dangerousRightTurnCurve(2), multipleCurvesStartingWithUnknownTurningDirection(3), multipleCurvesStartingWithLeftTurn(4), multipleCurvesStartingWithRightTurn(5)} (0..255) + +HazardousLocation-SurfaceConditionSubCauseCode ::= INTEGER {unavailable(0), rockfalls(1), earthquakeDamage(2), sewerCollapse(3), subsidence(4), snowDrifts(5), stormDamage(6), burstPipe(7), volcanoEruption(8), fallingIce(9)} (0..255) + +HazardousLocation-ObstacleOnTheRoadSubCauseCode ::= INTEGER {unavailable(0), shedLoad(1), partsOfVehicles(2), partsOfTyres(3), bigObjects(4), fallenTrees(5), hubCaps(6), waitingVehicles(7)} (0..255) + +HazardousLocation-AnimalOnTheRoadSubCauseCode ::= INTEGER {unavailable(0), wildAnimals(1), herdOfAnimals(2), smallAnimals(3), largeAnimals(4)} (0..255) + +CollisionRiskSubCauseCode ::= INTEGER {unavailable(0), longitudinalCollisionRisk(1), crossingCollisionRisk(2), lateralCollisionRisk(3), vulnerableRoadUser(4)} (0..255) + +SignalViolationSubCauseCode ::= INTEGER {unavailable(0), stopSignViolation(1), trafficLightViolation(2), turningRegulationViolation(3)} (0..255) + +RescueAndRecoveryWorkInProgressSubCauseCode ::= INTEGER {unavailable(0), emergencyVehicles(1), rescueHelicopterLanding(2), policeActivityOngoing(3), medicalEmergencyOngoing(4), childAbductionInProgress(5)} (0..255) + +DangerousEndOfQueueSubCauseCode ::= INTEGER {unavailable(0), suddenEndOfQueue(1), queueOverHill(2), queueAroundBend(3), queueInTunnel(4)} (0..255) + +DangerousSituationSubCauseCode ::= INTEGER {unavailable(0), emergencyElectronicBrakeEngaged(1), preCrashSystemEngaged(2), espEngaged(3), absEngaged(4), aebEngaged(5), brakeWarningEngaged(6), collisionRiskWarningEngaged(7)} (0..255) + +VehicleBreakdownSubCauseCode ::= INTEGER {unavailable(0), lackOfFuel (1), lackOfBatteryPower (2), engineProblem(3), transmissionProblem(4), engineCoolingProblem(5), brakingSystemProblem(6), steeringProblem(7), tyrePuncture(8), tyrePressureProblem(9)} (0..255) + +PostCrashSubCauseCode ::= INTEGER {unavailable(0), accidentWithoutECallTriggered (1), accidentWithECallManuallyTriggered (2), accidentWithECallAutomaticallyTriggered (3), accidentWithECallTriggeredWithoutAccessToCellularNetwork(4)} (0..255) + +Curvature ::= SEQUENCE { + curvatureValue CurvatureValue, + curvatureConfidence CurvatureConfidence +} + +CurvatureValue ::= INTEGER {straight(0), unavailable(1023)} (-1023..1023) + +CurvatureConfidence ::= ENUMERATED { + onePerMeter-0-00002 (0), + onePerMeter-0-0001 (1), + onePerMeter-0-0005 (2), + onePerMeter-0-002 (3), + onePerMeter-0-01 (4), + onePerMeter-0-1 (5), + outOfRange (6), + unavailable (7) +} + +CurvatureCalculationMode ::= ENUMERATED {yawRateUsed(0), yawRateNotUsed(1), unavailable(2), ...} + +Heading ::= SEQUENCE { + headingValue HeadingValue, + headingConfidence HeadingConfidence +} + +HeadingValue ::= INTEGER {wgs84North(0), wgs84East(900), wgs84South(1800), wgs84West(2700), unavailable(3601)} (0..3601) + +HeadingConfidence ::= INTEGER {equalOrWithinZeroPointOneDegree (1), equalOrWithinOneDegree (10), outOfRange(126), unavailable(127)} (1..127) + +LanePosition ::= INTEGER {offTheRoad(-1), innerHardShoulder(0), +innermostDrivingLane(1), secondLaneFromInside(2), outerHardShoulder(14) } (-1..14) + +ClosedLanes ::= SEQUENCE { + innerhardShoulderStatus HardShoulderStatus OPTIONAL, + outerhardShoulderStatus HardShoulderStatus OPTIONAL, + drivingLaneStatus DrivingLaneStatus OPTIONAL, + ... +} + +HardShoulderStatus ::= ENUMERATED {availableForStopping(0), closed(1), availableForDriving(2)} + +DrivingLaneStatus ::= BIT STRING (SIZE (1..13)) + +PerformanceClass ::= INTEGER {unavailable(0), performanceClassA(1), performanceClassB(2)} (0..7) + +SpeedValue ::= INTEGER {standstill(0), oneCentimeterPerSec(1), unavailable(16383)} (0..16383) + +SpeedConfidence ::= INTEGER {equalOrWithinOneCentimeterPerSec(1), equalOrWithinOneMeterPerSec(100), outOfRange(126), unavailable(127)} (1..127) + +VehicleMass ::= INTEGER {hundredKg(1), unavailable(1024)} (1..1024) + +Speed ::= SEQUENCE { + speedValue SpeedValue, + speedConfidence SpeedConfidence +} + +DriveDirection ::= ENUMERATED {forward (0), backward (1), unavailable (2)} + +EmbarkationStatus ::= BOOLEAN + +LongitudinalAcceleration ::= SEQUENCE { + longitudinalAccelerationValue LongitudinalAccelerationValue, + longitudinalAccelerationConfidence AccelerationConfidence +} + +LongitudinalAccelerationValue ::= INTEGER {pointOneMeterPerSecSquaredForward(1), pointOneMeterPerSecSquaredBackward(-1), unavailable(161)} (-160 .. 161) + +AccelerationConfidence ::= INTEGER {pointOneMeterPerSecSquared(1), outOfRange(101), unavailable(102)} (0 .. 102) + +LateralAcceleration ::= SEQUENCE { + lateralAccelerationValue LateralAccelerationValue, + lateralAccelerationConfidence AccelerationConfidence +} + +LateralAccelerationValue ::= INTEGER {pointOneMeterPerSecSquaredToRight(-1), pointOneMeterPerSecSquaredToLeft(1), unavailable(161)} (-160 .. 161) + +VerticalAcceleration ::= SEQUENCE { + verticalAccelerationValue VerticalAccelerationValue, + verticalAccelerationConfidence AccelerationConfidence +} + +VerticalAccelerationValue ::= INTEGER {pointOneMeterPerSecSquaredUp(1), pointOneMeterPerSecSquaredDown(-1), unavailable(161)} (-160 .. 161) + +StationType ::= INTEGER {unknown(0), pedestrian(1), cyclist(2), moped(3), motorcycle(4), passengerCar(5), bus(6), +lightTruck(7), heavyTruck(8), trailer(9), specialVehicles(10), tram(11), roadSideUnit(15)} (0..255) + +ExteriorLights ::= BIT STRING { + lowBeamHeadlightsOn (0), + highBeamHeadlightsOn (1), + leftTurnSignalOn (2), + rightTurnSignalOn (3), + daytimeRunningLightsOn (4), + reverseLightOn (5), + fogLightOn (6), + parkingLightsOn (7) +} (SIZE(8)) + +DangerousGoodsBasic::= ENUMERATED { + explosives1(0), + explosives2(1), + explosives3(2), + explosives4(3), + explosives5(4), + explosives6(5), + flammableGases(6), + nonFlammableGases(7), + toxicGases(8), + flammableLiquids(9), + flammableSolids(10), + substancesLiableToSpontaneousCombustion(11), + substancesEmittingFlammableGasesUponContactWithWater(12), + oxidizingSubstances(13), + organicPeroxides(14), + toxicSubstances(15), + infectiousSubstances(16), + radioactiveMaterial(17), + corrosiveSubstances(18), + miscellaneousDangerousSubstances(19) +} + +DangerousGoodsExtended ::= SEQUENCE { + dangerousGoodsType DangerousGoodsBasic, + unNumber INTEGER (0..9999), + elevatedTemperature BOOLEAN, + tunnelsRestricted BOOLEAN, + limitedQuantity BOOLEAN, + emergencyActionCode IA5String (SIZE (1..24)) OPTIONAL, + phoneNumber PhoneNumber OPTIONAL, + companyName UTF8String (SIZE (1..24)) OPTIONAL, + ... +} + +SpecialTransportType ::= BIT STRING {heavyLoad(0), excessWidth(1), excessLength(2), excessHeight(3)} (SIZE(4)) + +LightBarSirenInUse ::= BIT STRING { + lightBarActivated (0), + sirenActivated (1) +} (SIZE(2)) + +HeightLonCarr ::= INTEGER {oneCentimeter(1), unavailable(100)} (1..100) + +PosLonCarr ::= INTEGER {oneCentimeter(1), unavailable(127)} (1..127) + +PosPillar ::= INTEGER {tenCentimeters(1), unavailable(30)} (1..30) + +PosCentMass ::= INTEGER {tenCentimeters(1), unavailable(63)} (1..63) + +RequestResponseIndication ::= ENUMERATED {request(0), response(1)} + +SpeedLimit ::= INTEGER {oneKmPerHour(1)} (1..255) + +StationarySince ::= ENUMERATED {lessThan1Minute(0), lessThan2Minutes(1), lessThan15Minutes(2), equalOrGreater15Minutes(3)} + +Temperature ::= INTEGER {equalOrSmallerThanMinus60Deg (-60), oneDegreeCelsius(1), equalOrGreaterThan67Deg(67)} (-60..67) + +TrafficRule ::= ENUMERATED {noPassing(0), noPassingForTrucks(1), passToRight(2), passToLeft(3), ... +} + +WheelBaseVehicle ::= INTEGER {tenCentimeters(1), unavailable(127)} (1..127) + +TurningRadius ::= INTEGER {point4Meters(1), unavailable(255)} (1..255) + +PosFrontAx ::= INTEGER {tenCentimeters(1), unavailable(20)} (1..20) + +PositionOfOccupants ::= BIT STRING { + row1LeftOccupied (0), + row1RightOccupied (1), + row1MidOccupied (2), + row1NotDetectable (3), + row1NotPresent (4), + row2LeftOccupied (5), + row2RightOccupied (6), + row2MidOccupied (7), + row2NotDetectable (8), + row2NotPresent (9), + row3LeftOccupied (10), + row3RightOccupied (11), + row3MidOccupied (12), + row3NotDetectable (13), + row3NotPresent (14), + row4LeftOccupied (15), + row4RightOccupied (16), + row4MidOccupied (17), + row4NotDetectable (18), + row4NotPresent (19)} (SIZE(20)) + +PositioningSolutionType ::= ENUMERATED {noPositioningSolution(0), sGNSS(1), dGNSS(2), sGNSSplusDR(3), dGNSSplusDR(4), dR(5), ...} + +VehicleIdentification ::= SEQUENCE { + wMInumber WMInumber OPTIONAL, + vDS VDS OPTIONAL, + ... +} + +WMInumber ::= IA5String (SIZE(1..3)) + +VDS ::= IA5String (SIZE(6)) + +EnergyStorageType ::= BIT STRING {hydrogenStorage(0), electricEnergyStorage(1), liquidPropaneGas(2), compressedNaturalGas(3), diesel(4), gasoline(5), ammonia(6)} (SIZE(7)) + +VehicleLength ::= SEQUENCE { + vehicleLengthValue VehicleLengthValue, + vehicleLengthConfidenceIndication VehicleLengthConfidenceIndication +} + +VehicleLengthValue ::= INTEGER {tenCentimeters(1), outOfRange(1022), unavailable(1023)} (1..1023) + +VehicleLengthConfidenceIndication ::= ENUMERATED {noTrailerPresent(0), trailerPresentWithKnownLength(1), trailerPresentWithUnknownLength(2), trailerPresenceIsUnknown(3), unavailable(4)} + +VehicleWidth ::= INTEGER {tenCentimeters(1), outOfRange(61), unavailable(62)} (1..62) + +PathHistory::= SEQUENCE (SIZE(0..40)) OF PathPoint + +EmergencyPriority ::= BIT STRING {requestForRightOfWay(0), requestForFreeCrossingAtATrafficLight(1)} (SIZE(2)) + +InformationQuality ::= INTEGER {unavailable(0), lowest(1), highest(7)} (0..7) + +RoadType ::= ENUMERATED { + urban-NoStructuralSeparationToOppositeLanes(0), + urban-WithStructuralSeparationToOppositeLanes(1), + nonUrban-NoStructuralSeparationToOppositeLanes(2), + nonUrban-WithStructuralSeparationToOppositeLanes(3)} + +SteeringWheelAngle ::= SEQUENCE { + steeringWheelAngleValue SteeringWheelAngleValue, + steeringWheelAngleConfidence SteeringWheelAngleConfidence +} + +SteeringWheelAngleValue ::= INTEGER {straight(0), onePointFiveDegreesToRight(-1), onePointFiveDegreesToLeft(1), unavailable(512)} (-511..512) + +SteeringWheelAngleConfidence ::= INTEGER {equalOrWithinOnePointFiveDegree (1), outOfRange(126), unavailable(127)} (1..127) + +TimestampIts ::= INTEGER {utcStartOf2004(0), oneMillisecAfterUTCStartOf2004(1)} (0..4398046511103) + +VehicleRole ::= ENUMERATED {default(0), publicTransport(1), specialTransport(2), dangerousGoods(3), roadWork(4), rescue(5), emergency(6), safetyCar(7), agriculture(8), commercial(9), military(10), roadOperator(11), taxi(12), reserved1(13), reserved2(14), reserved3(15)} + +YawRate::= SEQUENCE { + yawRateValue YawRateValue, + yawRateConfidence YawRateConfidence +} + +YawRateValue ::= INTEGER {straight(0), degSec-000-01ToRight(-1), degSec-000-01ToLeft(1), unavailable(32767)} (-32766..32767) + +YawRateConfidence ::= ENUMERATED { + degSec-000-01 (0), + degSec-000-05 (1), + degSec-000-10 (2), + degSec-001-00 (3), + degSec-005-00 (4), + degSec-010-00 (5), + degSec-100-00 (6), + outOfRange (7), + unavailable (8) +} + +ProtectedZoneType::= ENUMERATED { permanentCenDsrcTolling (0), ..., temporaryCenDsrcTolling (1) } + +RelevanceDistance ::= ENUMERATED {lessThan50m(0), lessThan100m(1), lessThan200m(2), lessThan500m(3), lessThan1000m(4), lessThan5km(5), lessThan10km(6), over10km(7)} + +RelevanceTrafficDirection ::= ENUMERATED {allTrafficDirections(0), upstreamTraffic(1), downstreamTraffic(2), oppositeTraffic(3)} + +TransmissionInterval ::= INTEGER {oneMilliSecond(1), tenSeconds(10000)} (1..10000) + +ValidityDuration ::= INTEGER {timeOfDetection(0), oneSecondAfterDetection(1)} (0..86400) + +ActionID ::= SEQUENCE { + originatingStationID StationID, + sequenceNumber SequenceNumber +} + +ItineraryPath ::= SEQUENCE SIZE(1..40) OF ReferencePosition + +ProtectedCommunicationZone ::= SEQUENCE { + protectedZoneType ProtectedZoneType, + expiryTime TimestampIts OPTIONAL, + protectedZoneLatitude Latitude, + protectedZoneLongitude Longitude, + protectedZoneRadius ProtectedZoneRadius OPTIONAL, + protectedZoneID ProtectedZoneID OPTIONAL, + ... +} + +Traces ::= SEQUENCE SIZE(1..7) OF PathHistory + +NumberOfOccupants ::= INTEGER {oneOccupant (1), unavailable(127)} (0 .. 127) + +SequenceNumber ::= INTEGER (0..65535) + +PositionOfPillars ::= SEQUENCE (SIZE(1..3, ...)) OF PosPillar + +RestrictedTypes ::= SEQUENCE (SIZE(1..3, ...)) OF StationType + +EventHistory::= SEQUENCE (SIZE(1..23)) OF EventPoint + +EventPoint ::= SEQUENCE { + eventPosition DeltaReferencePosition, + eventDeltaTime PathDeltaTime OPTIONAL, + informationQuality InformationQuality +} + +ProtectedCommunicationZonesRSU ::= SEQUENCE (SIZE(1..16)) OF ProtectedCommunicationZone + +CenDsrcTollingZone ::= SEQUENCE { + protectedZoneLatitude Latitude, + protectedZoneLongitude Longitude, + cenDsrcTollingZoneID CenDsrcTollingZoneID OPTIONAL, + ... +} + +ProtectedZoneRadius ::= INTEGER {oneMeter(1)} (1..255,...) + +ProtectedZoneID ::= INTEGER (0.. 134217727) + +CenDsrcTollingZoneID ::= ProtectedZoneID + +DigitalMap ::= SEQUENCE (SIZE(1..256)) OF ReferencePosition + +OpeningDaysHours ::= UTF8String + +PhoneNumber ::= NumericString (SIZE(1..16)) +END -- GitLab From 094113c7bb96d4d10d61024f8ac2aaff15f47928 Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 14 Aug 2020 16:15:12 +0200 Subject: [PATCH 256/320] Start implemantation of RTCMEM TPs --- asn1/CAM/CAM-PDU-Descriptions.asn | 132 ----- asn1/DENM/DENM-PDU-Descriptions.asn | 108 ---- asn1/EV-RSR/EV-RSR-PDU-Descriptions.asn | 157 ------ asn1/EVCSN/EVCSN-PDU-Descriptions.asn | 102 ---- asn1/ITS-Container/ITS-Container.asn | 508 ------------------- ttcn/Common/LibItsCommon_TypesAndValues.ttcn | 1 + ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn | 35 +- ttcn/Rtcmem/LibItsRtcmem_Pics.ttcn | 6 + ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn | 51 +- ttcn/Rtcmem/LibItsRtcmem_TestSystem.ttcn | 6 +- ttcn/Rtcmem/LibItsRtcmem_TypesAndValues.ttcn | 16 +- 11 files changed, 97 insertions(+), 1025 deletions(-) delete mode 100644 asn1/CAM/CAM-PDU-Descriptions.asn delete mode 100644 asn1/DENM/DENM-PDU-Descriptions.asn delete mode 100644 asn1/EV-RSR/EV-RSR-PDU-Descriptions.asn delete mode 100644 asn1/EVCSN/EVCSN-PDU-Descriptions.asn delete mode 100644 asn1/ITS-Container/ITS-Container.asn diff --git a/asn1/CAM/CAM-PDU-Descriptions.asn b/asn1/CAM/CAM-PDU-Descriptions.asn deleted file mode 100644 index a13a9fac..00000000 --- a/asn1/CAM/CAM-PDU-Descriptions.asn +++ /dev/null @@ -1,132 +0,0 @@ -CAM-PDU-Descriptions { -itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) en (302637) cam (2) version (2) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS -ItsPduHeader, CauseCode, ReferencePosition, AccelerationControl, Curvature, CurvatureCalculationMode, Heading, LanePosition, EmergencyPriority, EmbarkationStatus, Speed, DriveDirection, LongitudinalAcceleration, LateralAcceleration, VerticalAcceleration, StationType, ExteriorLights, DangerousGoodsBasic, SpecialTransportType, LightBarSirenInUse, VehicleRole, VehicleLength, VehicleWidth, PathHistory, RoadworksSubCauseCode, ClosedLanes, TrafficRule, SpeedLimit, SteeringWheelAngle, PerformanceClass, YawRate, ProtectedCommunicationZone, PtActivation, Latitude, Longitude, ProtectedCommunicationZonesRSU, CenDsrcTollingZone FROM ITS-Container { -itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) -}; - - --- The root data frame for cooperative awareness messages - -CAM ::= SEQUENCE { - header ItsPduHeader, - cam CoopAwareness -} - -CoopAwareness ::= SEQUENCE { - generationDeltaTime GenerationDeltaTime, - camParameters CamParameters -} - -CamParameters ::= SEQUENCE { - basicContainer BasicContainer, - highFrequencyContainer HighFrequencyContainer, - lowFrequencyContainer LowFrequencyContainer OPTIONAL, - specialVehicleContainer SpecialVehicleContainer OPTIONAL, - ... -} - -HighFrequencyContainer ::= CHOICE { - basicVehicleContainerHighFrequency BasicVehicleContainerHighFrequency, - rsuContainerHighFrequency RSUContainerHighFrequency, - ... -} - - LowFrequencyContainer ::= CHOICE { - basicVehicleContainerLowFrequency BasicVehicleContainerLowFrequency, - ... -} - -SpecialVehicleContainer ::= CHOICE { - publicTransportContainer PublicTransportContainer, - specialTransportContainer SpecialTransportContainer, - dangerousGoodsContainer DangerousGoodsContainer, - roadWorksContainerBasic RoadWorksContainerBasic, - rescueContainer RescueContainer, - emergencyContainer EmergencyContainer, - safetyCarContainer SafetyCarContainer, - ... -} - -BasicContainer ::= SEQUENCE { - stationType StationType, - referencePosition ReferencePosition, - ... -} - -BasicVehicleContainerHighFrequency ::= SEQUENCE { - heading Heading, - speed Speed, - driveDirection DriveDirection, - vehicleLength VehicleLength, - vehicleWidth VehicleWidth, - longitudinalAcceleration LongitudinalAcceleration, - curvature Curvature, - curvatureCalculationMode CurvatureCalculationMode, - yawRate YawRate, - accelerationControl AccelerationControl OPTIONAL, - lanePosition LanePosition OPTIONAL, - steeringWheelAngle SteeringWheelAngle OPTIONAL, - lateralAcceleration LateralAcceleration OPTIONAL, - verticalAcceleration VerticalAcceleration OPTIONAL, - performanceClass PerformanceClass OPTIONAL, - cenDsrcTollingZone CenDsrcTollingZone OPTIONAL -} - -BasicVehicleContainerLowFrequency ::= SEQUENCE { - vehicleRole VehicleRole, - exteriorLights ExteriorLights, - pathHistory PathHistory -} - -PublicTransportContainer ::= SEQUENCE { - embarkationStatus EmbarkationStatus, - ptActivation PtActivation OPTIONAL -} - -SpecialTransportContainer ::= SEQUENCE { - specialTransportType SpecialTransportType, - lightBarSirenInUse LightBarSirenInUse -} - - DangerousGoodsContainer ::= SEQUENCE { - dangerousGoodsBasic DangerousGoodsBasic - } - - RoadWorksContainerBasic ::= SEQUENCE { - roadworksSubCauseCode RoadworksSubCauseCode OPTIONAL, - lightBarSirenInUse LightBarSirenInUse, - closedLanes ClosedLanes OPTIONAL - } - -RescueContainer ::= SEQUENCE { - lightBarSirenInUse LightBarSirenInUse -} - -EmergencyContainer ::= SEQUENCE { - lightBarSirenInUse LightBarSirenInUse, - incidentIndication CauseCode OPTIONAL, - emergencyPriority EmergencyPriority OPTIONAL -} - -SafetyCarContainer ::= SEQUENCE { - lightBarSirenInUse LightBarSirenInUse, - incidentIndication CauseCode OPTIONAL, - trafficRule TrafficRule OPTIONAL, - speedLimit SpeedLimit OPTIONAL -} - -RSUContainerHighFrequency ::= SEQUENCE { - protectedCommunicationZonesRSU ProtectedCommunicationZonesRSU OPTIONAL, - ... -} - -GenerationDeltaTime ::= INTEGER { oneMilliSec(1) } (0..65535) - -END \ No newline at end of file diff --git a/asn1/DENM/DENM-PDU-Descriptions.asn b/asn1/DENM/DENM-PDU-Descriptions.asn deleted file mode 100644 index fa4ea6d7..00000000 --- a/asn1/DENM/DENM-PDU-Descriptions.asn +++ /dev/null @@ -1,108 +0,0 @@ -DENM-PDU-Descriptions {itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) en (302637) denm (1) version (2) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS -ItsPduHeader, CauseCode, Speed, InformationQuality, ReferencePosition, ClosedLanes, DangerousGoodsExtended, Heading, LanePosition, LightBarSirenInUse, RoadType, HeightLonCarr, PosLonCarr, PosCentMass, PositioningSolutionType, RequestResponseIndication, StationType, SpeedLimit, StationarySince, TimestampIts, WheelBaseVehicle, TurningRadius, PosFrontAx, PositionOfOccupants, Temperature, VehicleMass, VehicleIdentification, EnergyStorageType, ActionID, ItineraryPath, NumberOfOccupants, PositionOfPillars, RelevanceTrafficDirection, RestrictedTypes, Traces, TransmissionInterval, ValidityDuration, RelevanceDistance, EventHistory, TrafficRule, DeltaReferencePosition FROM ITS-Container { -itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) -}; - - -DENM ::= SEQUENCE { - header ItsPduHeader, - denm DecentralizedEnvironmentalNotificationMessage -} - -DecentralizedEnvironmentalNotificationMessage ::= SEQUENCE { - management ManagementContainer, - situation SituationContainer OPTIONAL, - location LocationContainer OPTIONAL, - alacarte AlacarteContainer OPTIONAL -} - -ManagementContainer ::= SEQUENCE { - actionID ActionID, - detectionTime TimestampIts, - referenceTime TimestampIts, - termination Termination OPTIONAL, - eventPosition ReferencePosition, - relevanceDistance RelevanceDistance OPTIONAL, - relevanceTrafficDirection RelevanceTrafficDirection OPTIONAL, - validityDuration ValidityDuration DEFAULT defaultValidity, - transmissionInterval TransmissionInterval OPTIONAL, - stationType StationType, - ... -} - -SituationContainer ::= SEQUENCE { - informationQuality InformationQuality, - eventType CauseCode, - linkedCause CauseCode OPTIONAL, - eventHistory EventHistory OPTIONAL, - ... -} - -LocationContainer ::= SEQUENCE { - eventSpeed Speed OPTIONAL, - eventPositionHeading Heading OPTIONAL, - traces Traces, - roadType RoadType OPTIONAL, - ... -} - -ImpactReductionContainer ::= SEQUENCE { - heightLonCarrLeft HeightLonCarr, - heightLonCarrRight HeightLonCarr, - posLonCarrLeft PosLonCarr, - posLonCarrRight PosLonCarr, - positionOfPillars PositionOfPillars, - posCentMass PosCentMass, - wheelBaseVehicle WheelBaseVehicle, - turningRadius TurningRadius, - posFrontAx PosFrontAx, - positionOfOccupants PositionOfOccupants, - vehicleMass VehicleMass, - requestResponseIndication RequestResponseIndication -} - -RoadWorksContainerExtended ::= SEQUENCE { - lightBarSirenInUse LightBarSirenInUse OPTIONAL, - closedLanes ClosedLanes OPTIONAL, - restriction RestrictedTypes OPTIONAL, - speedLimit SpeedLimit OPTIONAL, - incidentIndication CauseCode OPTIONAL, - recommendedPath ItineraryPath OPTIONAL, - startingPointSpeedLimit DeltaReferencePosition OPTIONAL, - trafficFlowRule TrafficRule OPTIONAL, - referenceDenms ReferenceDenms OPTIONAL - } - -StationaryVehicleContainer ::= SEQUENCE { - stationarySince StationarySince OPTIONAL, - stationaryCause CauseCode OPTIONAL, - carryingDangerousGoods DangerousGoodsExtended OPTIONAL, - numberOfOccupants NumberOfOccupants OPTIONAL, - vehicleIdentification VehicleIdentification OPTIONAL, - energyStorageType EnergyStorageType OPTIONAL -} - -AlacarteContainer ::= SEQUENCE { - lanePosition LanePosition OPTIONAL, - impactReduction ImpactReductionContainer OPTIONAL, - externalTemperature Temperature OPTIONAL, - roadWorks RoadWorksContainerExtended OPTIONAL, - positioningSolution PositioningSolutionType OPTIONAL, - stationaryVehicle StationaryVehicleContainer OPTIONAL, - ... -} - -defaultValidity INTEGER ::= 600 - -Termination ::= ENUMERATED {isCancellation(0), isNegation (1)} - -ReferenceDenms ::= SEQUENCE (SIZE(1..8, ...)) OF ActionID - -END \ No newline at end of file diff --git a/asn1/EV-RSR/EV-RSR-PDU-Descriptions.asn b/asn1/EV-RSR/EV-RSR-PDU-Descriptions.asn deleted file mode 100644 index 1455feed..00000000 --- a/asn1/EV-RSR/EV-RSR-PDU-Descriptions.asn +++ /dev/null @@ -1,157 +0,0 @@ -EV-RechargingSpotReservation-PDU-Descriptions { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (101556) ev-rsr (4) version (1) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS - ItsPduHeader FROM ITS-Container { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) -}; - -EV-RSR ::= SEQUENCE { - header ItsPduHeader, - messageBody EV-RSR-MessageBody -} - -EV-RSR-MessageBody ::= CHOICE { - preReservationRequestMessage PreReservationRequestMessage, - preReservationResponseMessage PreReservationResponseMessage, - reservationRequestMessage ReservationRequestMessage, - reservationResponseMessage ReservationResponseMessage, - cancellationRequestMessage CancellationRequestMessage, - cancellationResponseMessage CancellationResponseMessage, - updateRequestMessage UpdateRequestMessage, - updateResponseMessage UpdateResponseMessage, -... -} - -PreReservationRequestMessage ::= SEQUENCE { - evse-ID EVSE-ID, - arrivalTime TimestampUTC, - departureTime TimestampUTC OPTIONAL, - rechargingType RechargingType, - batteryType BatteryType OPTIONAL, - ... -} - -PreReservationResponseMessage ::= SEQUENCE { - preReservation-ID PreReservation-ID, - availabilityStatus AvailabilityStatus, - preReservationExpirationTime TimestampUTC, - supportedPaymentTypes SupportedPaymentTypes, - ... -} - -ReservationRequestMessage ::= SEQUENCE { - currentTime TimestampUTC, - preReservation-ID PreReservation-ID, - arrivalTime TimestampUTC, - departureTime TimestampUTC OPTIONAL, - eAmount EAmount, - eAmountMin EAmount, - paymentType PaymentType, - payment-ID Payment-ID, - secondPayment-ID Payment-ID OPTIONAL, - pairing-ID Pairing-ID OPTIONAL, - ... -} - -ReservationResponseMessage ::= SEQUENCE { - reservationResponseCode ReservationResponseCode, - reservation-ID Reservation-ID OPTIONAL, - reservation-Password Reservation-Password OPTIONAL, - stationDetails StationDetails OPTIONAL, - chargingSpotLabel ChargingSpotLabel OPTIONAL, - expirationTime TimestampUTC, - freeCancelTimeLimit TimestampUTC OPTIONAL, - ... -} - -CancellationRequestMessage ::= SEQUENCE { - reservation-ID Reservation-ID, - reservation-Password Reservation-Password, - currentTime TimestampUTC, - ... -} - -CancellationResponseMessage ::= SEQUENCE { - reservation-ID Reservation-ID, - cancellationResponseCode CancellationResponseCode, - ... -} - -UpdateRequestMessage ::= SEQUENCE { - reservation-ID Reservation-ID, - reservation-Password Reservation-Password, - updatedArrivalTime TimestampUTC, - updatedDepartureTime TimestampUTC, - ... -} - -UpdateResponseMessage ::= SEQUENCE { - reservation-ID Reservation-ID, - updateResponseCode UpdateResponseCode, - chargingSpotLabel ChargingSpotLabel OPTIONAL, - ... -} - - - -AvailabilityStatus ::= ENUMERATED { available, no-free-capacity } - -BatteryType ::= UTF8String (SIZE(1..16)) - -CancellationResponseCode ::= ENUMERATED { ok, unknown-Reservation-ID, mismatching-Reservation-Password } - -ChargingSpotLabel ::= UTF8String (SIZE(1..4)) - -ContractID ::= UTF8String (SIZE(1..24)) - -EAmount ::= INTEGER { oneWh(1) } (1..500000) - -ChargingPower ::= INTEGER { oneW(1) } (1..200000) - -EVSE-ID ::= OCTET STRING (SIZE(1..32)) - -ExternalIdentificationMeans ::= UTF8String (SIZE(1..24)) - -Pairing-ID ::= VisibleString (SIZE(1..64)) - -PaymentType ::= ENUMERATED {contract, externalIdentification} - -Payment-ID ::= CHOICE { - contractID ContractID, - externalIdentificationMeans ExternalIdentificationMeans -} - -RechargingType ::= SEQUENCE { - rechargingMode RechargingMode, - powerSource PowerSource -} - -RechargingMode ::= INTEGER { mode1(0), mode2(1), mode3(2), mode4(3), quickDrop(8), inductiveChargingWhileStationary(12), inductiveChargingWhileDriving(14) } (0..15) - -PowerSource::= INTEGER { notApplicable(0), ac1Phase(1), ac2Phase(2), ac3Phase(3), dcc(4), chaDeMo(5) } (0..7) -ReservationResponseCode ::= ENUMERATED {ok, invalid-EVSE-ID, payment-type-not-supported, payment-error, authentication-error, insufficient-power-availability } - -Reservation-ID ::= VisibleString (SIZE(8)) - -PreReservation-ID ::= Reservation-ID - -Reservation-Password ::= VisibleString (SIZE(8)) - - -StationDetails ::= UTF8String (SIZE(1..32)) - -SupportedPaymentTypes ::= BIT STRING { contract(0), externalIdentification (1) } (SIZE(2)) - -TimestampUTC ::= INTEGER { utcStartOf2013(0), oneSecondAfterUTCStartOf2013(1) } - -UpdateResponseCode ::= ENUMERATED { ok, unknown-Reservation-ID, mismatching-Reservation-Password, invalid-Arrival-Time, invalid-Departure-Time } - -StatusResponseCode ::= ENUMERATED { charging-Spot-Occupied, charging-Spot-Unoccupied, charging-Ongoing, reservation-Limit-Exceeded, reservation-Cancelled, unknown-Reservation-ID, expired-Reservation-ID } - -END diff --git a/asn1/EVCSN/EVCSN-PDU-Descriptions.asn b/asn1/EVCSN/EVCSN-PDU-Descriptions.asn deleted file mode 100644 index b86fbb19..00000000 --- a/asn1/EVCSN/EVCSN-PDU-Descriptions.asn +++ /dev/null @@ -1,102 +0,0 @@ --- Point of Interest (POI) notification for charging spot --- for electric vehicle --- EVCSN Message definition --- ASN.1 Start Definition - -EVCSN-PDU-Descriptions { -itu-t (0) identified-organization (4) etsi (0) itsDomain (5) -wg1 (1) ts (101556) evcsn (1) version (1) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS - ItsPduHeader, - StationID, - TimestampIts, - ReferencePosition -FROM ITS-Container { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) -}; - --- Root Message PDU: EvcsnPdu - -EvcsnPdu ::= SEQUENCE { - header ItsPduHeader, - evcsn EVChargingSpotNotificationPOIMessage -} - -EVChargingSpotNotificationPOIMessage ::= SEQUENCE { - poiHeader ItsPOIHeader, -- Specific POI Message Header - evcsnData ItsEVCSNData -- Electric Vehicle Charging Spot Data Elements -} - -ItsPOIHeader ::= SEQUENCE { - poiType POIType, -- set to "EV charging station POI ID = 1" - timeStamp TimestampIts, - relayCapable BOOLEAN -} - - -ItsEVCSNData ::= SEQUENCE { - totalNumberOfStations NumberStations, - chargingStationsData SEQUENCE (SIZE(1..256)) OF ItsChargingStationData -} - -ItsChargingStationData ::= SEQUENCE { - chargingStationID StationID, - utilityDistributorId UTF8String (SIZE(1..32)) OPTIONAL, - providerID UTF8String (SIZE(1..32)) OPTIONAL, - chargingStationLocation ReferencePosition, - address UTF8String OPTIONAL, - phoneNumber NumericString (SIZE(1..16)) OPTIONAL, - accessibility UTF8String (SIZE(1..32)), - digitalMap DigitalMap OPTIONAL, - openingDaysHours UTF8String, - pricing UTF8String, - bookingContactInfo UTF8String OPTIONAL, - payment UTF8String OPTIONAL, - chargingSpotsAvailable ItsChargingSpots, - ... -} - - -ItsChargingSpots ::= SEQUENCE (SIZE(1..16)) OF ItsChargingSpotDataElements - - -ItsChargingSpotDataElements ::= SEQUENCE { - type ChargingSpotType, - evEquipmentID UTF8String OPTIONAL, - typeOfReceptacle TypeOfReceptacle, - energyAvailability UTF8String, - parkingPlacesData ParkingPlacesData OPTIONAL -} - -DigitalMap ::= SEQUENCE (SIZE(1..256)) OF ReferencePosition - -ChargingSpotType ::= BIT STRING { - standardChargeMode1(0), - standardChargeMode2(1), - standardOrFastChargeMode3(2), - fastChargeWithExternalCharger(3), - quickDrop(8), - inductiveChargeWhileStationary(12), - inductiveChargeWhileDriving(14) -} - -TypeOfReceptacle ::= BIT STRING - -ParkingPlacesData ::= SEQUENCE (SIZE(1..4)) OF SpotAvailability - -SpotAvailability ::= SEQUENCE { - maxWaitingTimeMinutes INTEGER (0..1400), -- 0 if available or max waiting - -- time (minutes) - blocking BOOLEAN -- true if the spot can be blocked -} - -POIType ::= INTEGER(0..65535) -NumberStations ::= INTEGER(1..256) - -END diff --git a/asn1/ITS-Container/ITS-Container.asn b/asn1/ITS-Container/ITS-Container.asn deleted file mode 100644 index 8b6874e0..00000000 --- a/asn1/ITS-Container/ITS-Container.asn +++ /dev/null @@ -1,508 +0,0 @@ -ITS-Container { -itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS; - -ItsPduHeader ::= SEQUENCE { - protocolVersion INTEGER (0..255), - messageID INTEGER{ denm(1), cam(2), poi(3), spatem(4), mapem(5), ivim(6), ev-rsr(7), tistpgtransaction(8), srem(9), ssem(10), evcsn(11), saem(12), rtcmem(13) } (0..255), -- Mantis #7209, #7005 - stationID StationID -} - -StationID ::= INTEGER(0..4294967295) - -ReferencePosition ::= SEQUENCE { - latitude Latitude, - longitude Longitude, - positionConfidenceEllipse PosConfidenceEllipse , - altitude Altitude -} - -DeltaReferencePosition ::= SEQUENCE { - deltaLatitude DeltaLatitude, - deltaLongitude DeltaLongitude, - deltaAltitude DeltaAltitude -} - -Longitude ::= INTEGER {oneMicrodegreeEast (10), oneMicrodegreeWest (-10), unavailable(1800000001)} (-1800000000..1800000001) - -Latitude ::= INTEGER {oneMicrodegreeNorth (10), oneMicrodegreeSouth (-10), unavailable(900000001)} (-900000000..900000001) - -Altitude ::= SEQUENCE { - altitudeValue AltitudeValue, - altitudeConfidence AltitudeConfidence -} - -AltitudeValue ::= INTEGER {referenceEllipsoidSurface(0), oneCentimeter(1), unavailable(800001)} (-100000..800001) - -AltitudeConfidence ::= ENUMERATED { - alt-000-01 (0), - alt-000-02 (1), - alt-000-05 (2), - alt-000-10 (3), - alt-000-20 (4), - alt-000-50 (5), - alt-001-00 (6), - alt-002-00 (7), - alt-005-00 (8), - alt-010-00 (9), - alt-020-00 (10), - alt-050-00 (11), - alt-100-00 (12), - alt-200-00 (13), - outOfRange (14), - unavailable (15) -} - -DeltaLongitude ::= INTEGER {oneMicrodegreeEast (10), oneMicrodegreeWest (-10), unavailable(131072)} (-131071..131072) - -DeltaLatitude ::= INTEGER {oneMicrodegreeNorth (10), oneMicrodegreeSouth (-10) , unavailable(131072)} (-131071..131072) - -DeltaAltitude ::= INTEGER {oneCentimeterUp (1), oneCentimeterDown (-1), unavailable(12800)} (-12700..12800) - -PosConfidenceEllipse ::= SEQUENCE { - semiMajorConfidence SemiAxisLength, - semiMinorConfidence SemiAxisLength, - semiMajorOrientation HeadingValue -} - -PathPoint ::= SEQUENCE { - pathPosition DeltaReferencePosition, - pathDeltaTime PathDeltaTime OPTIONAL -} - -PathDeltaTime ::= INTEGER {tenMilliSecondsInPast(1)} (1..65535, ...) - -PtActivation ::= SEQUENCE { - ptActivationType PtActivationType, - ptActivationData PtActivationData -} - -PtActivationType ::= INTEGER {undefinedCodingType(0), r09-16CodingType(1), vdv-50149CodingType(2)} (0..255) - -PtActivationData ::= OCTET STRING (SIZE(1..20)) - -AccelerationControl ::= BIT STRING { - brakePedalEngaged (0), - gasPedalEngaged (1), - emergencyBrakeEngaged (2), - collisionWarningEngaged (3), - accEngaged (4), - cruiseControlEngaged (5), - speedLimiterEngaged (6) -} (SIZE(7)) - -SemiAxisLength ::= INTEGER{oneCentimeter(1), outOfRange(4094), unavailable(4095)} (0..4095) - -CauseCode ::= SEQUENCE { - causeCode CauseCodeType, - subCauseCode SubCauseCodeType, - ... -} - -CauseCodeType ::= INTEGER { - reserved (0), - trafficCondition (1), - accident (2), - roadworks (3), - impassability (5), - adverseWeatherCondition-Adhesion (6), - aquaplannning (7), - hazardousLocation-SurfaceCondition (9), - hazardousLocation-ObstacleOnTheRoad (10), - hazardousLocation-AnimalOnTheRoad (11), - humanPresenceOnTheRoad (12), - wrongWayDriving (14), - rescueAndRecoveryWorkInProgress (15), - adverseWeatherCondition-ExtremeWeatherCondition (17), - adverseWeatherCondition-Visibility (18), - adverseWeatherCondition-Precipitation (19), - slowVehicle (26), - dangerousEndOfQueue (27), - vehicleBreakdown (91), - postCrash (92), - humanProblem (93), - stationaryVehicle (94), - emergencyVehicleApproaching (95), - hazardousLocation-DangerousCurve (96), - collisionRisk (97), - signalViolation (98), - dangerousSituation (99) -} (0..255) - -SubCauseCodeType ::= INTEGER (0..255) - -TrafficConditionSubCauseCode ::= INTEGER {unavailable(0), increasedVolumeOfTraffic(1), trafficJamSlowlyIncreasing(2), trafficJamIncreasing(3), trafficJamStronglyIncreasing(4), trafficStationary(5), trafficJamSlightlyDecreasing(6), trafficJamDecreasing(7), trafficJamStronglyDecreasing(8)} (0..255) - -AccidentSubCauseCode ::= INTEGER {unavailable(0), multiVehicleAccident(1), heavyAccident(2), accidentInvolvingLorry(3), accidentInvolvingBus(4), accidentInvolvingHazardousMaterials(5), accidentOnOppositeLane(6), unsecuredAccident(7), assistanceRequested(8)} (0..255) - -RoadworksSubCauseCode ::= INTEGER {unavailable(0), majorRoadworks(1), roadMarkingWork(2), slowMovingRoadMaintenance(3), shortTermStationaryRoadworks(4), streetCleaning(5), winterService(6)} (0..255) - -HumanPresenceOnTheRoadSubCauseCode ::= INTEGER {unavailable(0), childrenOnRoadway(1), cyclistOnRoadway(2), motorcyclistOnRoadway(3)} (0..255) - -WrongWayDrivingSubCauseCode ::= INTEGER {unavailable(0), wrongLane(1), wrongDirection(2)} (0..255) - -AdverseWeatherCondition-ExtremeWeatherConditionSubCauseCode ::= INTEGER {unavailable(0), strongWinds(1), damagingHail(2), hurricane(3), thunderstorm(4), tornado(5), blizzard(6)} (0..255) - -AdverseWeatherCondition-AdhesionSubCauseCode ::= INTEGER {unavailable(0), heavyFrostOnRoad(1), fuelOnRoad(2), mudOnRoad(3), snowOnRoad(4), iceOnRoad(5), blackIceOnRoad(6), oilOnRoad(7), looseChippings(8), instantBlackIce(9), roadsSalted(10)} (0..255) - -AdverseWeatherCondition-VisibilitySubCauseCode ::= INTEGER {unavailable(0), fog(1), smoke(2), heavySnowfall(3), heavyRain(4), heavyHail(5), lowSunGlare(6), sandstorms(7), swarmsOfInsects(8)} (0..255) - -AdverseWeatherCondition-PrecipitationSubCauseCode ::= INTEGER {unavailable(0), heavyRain(1), heavySnowfall(2), softHail(3)} (0..255) - -SlowVehicleSubCauseCode ::= INTEGER {unavailable(0), maintenanceVehicle(1), vehiclesSlowingToLookAtAccident(2), abnormalLoad(3), abnormalWideLoad(4), convoy(5), snowplough(6), deicing(7), saltingVehicles(8)} (0..255) - -StationaryVehicleSubCauseCode ::= INTEGER {unavailable(0), humanProblem(1), vehicleBreakdown(2), postCrash(3), publicTransportStop(4), carryingDangerousGoods(5)} (0..255) - -HumanProblemSubCauseCode ::= INTEGER {unavailable(0), glycemiaProblem(1), heartProblem(2)} (0..255) - -EmergencyVehicleApproachingSubCauseCode ::= INTEGER {unavailable(0), emergencyVehicleApproaching(1), prioritizedVehicleApproaching(2)} (0..255) - -HazardousLocation-DangerousCurveSubCauseCode ::= INTEGER {unavailable(0), dangerousLeftTurnCurve(1), dangerousRightTurnCurve(2), multipleCurvesStartingWithUnknownTurningDirection(3), multipleCurvesStartingWithLeftTurn(4), multipleCurvesStartingWithRightTurn(5)} (0..255) - -HazardousLocation-SurfaceConditionSubCauseCode ::= INTEGER {unavailable(0), rockfalls(1), earthquakeDamage(2), sewerCollapse(3), subsidence(4), snowDrifts(5), stormDamage(6), burstPipe(7), volcanoEruption(8), fallingIce(9)} (0..255) - -HazardousLocation-ObstacleOnTheRoadSubCauseCode ::= INTEGER {unavailable(0), shedLoad(1), partsOfVehicles(2), partsOfTyres(3), bigObjects(4), fallenTrees(5), hubCaps(6), waitingVehicles(7)} (0..255) - -HazardousLocation-AnimalOnTheRoadSubCauseCode ::= INTEGER {unavailable(0), wildAnimals(1), herdOfAnimals(2), smallAnimals(3), largeAnimals(4)} (0..255) - -CollisionRiskSubCauseCode ::= INTEGER {unavailable(0), longitudinalCollisionRisk(1), crossingCollisionRisk(2), lateralCollisionRisk(3), vulnerableRoadUser(4)} (0..255) - -SignalViolationSubCauseCode ::= INTEGER {unavailable(0), stopSignViolation(1), trafficLightViolation(2), turningRegulationViolation(3)} (0..255) - -RescueAndRecoveryWorkInProgressSubCauseCode ::= INTEGER {unavailable(0), emergencyVehicles(1), rescueHelicopterLanding(2), policeActivityOngoing(3), medicalEmergencyOngoing(4), childAbductionInProgress(5)} (0..255) - -DangerousEndOfQueueSubCauseCode ::= INTEGER {unavailable(0), suddenEndOfQueue(1), queueOverHill(2), queueAroundBend(3), queueInTunnel(4)} (0..255) - -DangerousSituationSubCauseCode ::= INTEGER {unavailable(0), emergencyElectronicBrakeEngaged(1), preCrashSystemEngaged(2), espEngaged(3), absEngaged(4), aebEngaged(5), brakeWarningEngaged(6), collisionRiskWarningEngaged(7)} (0..255) - -VehicleBreakdownSubCauseCode ::= INTEGER {unavailable(0), lackOfFuel (1), lackOfBatteryPower (2), engineProblem(3), transmissionProblem(4), engineCoolingProblem(5), brakingSystemProblem(6), steeringProblem(7), tyrePuncture(8), tyrePressureProblem(9)} (0..255) - -PostCrashSubCauseCode ::= INTEGER {unavailable(0), accidentWithoutECallTriggered (1), accidentWithECallManuallyTriggered (2), accidentWithECallAutomaticallyTriggered (3), accidentWithECallTriggeredWithoutAccessToCellularNetwork(4)} (0..255) - -Curvature ::= SEQUENCE { - curvatureValue CurvatureValue, - curvatureConfidence CurvatureConfidence -} - -CurvatureValue ::= INTEGER {straight(0), unavailable(1023)} (-1023..1023) - -CurvatureConfidence ::= ENUMERATED { - onePerMeter-0-00002 (0), - onePerMeter-0-0001 (1), - onePerMeter-0-0005 (2), - onePerMeter-0-002 (3), - onePerMeter-0-01 (4), - onePerMeter-0-1 (5), - outOfRange (6), - unavailable (7) -} - -CurvatureCalculationMode ::= ENUMERATED {yawRateUsed(0), yawRateNotUsed(1), unavailable(2), ...} - -Heading ::= SEQUENCE { - headingValue HeadingValue, - headingConfidence HeadingConfidence -} - -HeadingValue ::= INTEGER {wgs84North(0), wgs84East(900), wgs84South(1800), wgs84West(2700), unavailable(3601)} (0..3601) - -HeadingConfidence ::= INTEGER {equalOrWithinZeroPointOneDegree (1), equalOrWithinOneDegree (10), outOfRange(126), unavailable(127)} (1..127) - -LanePosition ::= INTEGER {offTheRoad(-1), innerHardShoulder(0), -innermostDrivingLane(1), secondLaneFromInside(2), outerHardShoulder(14) } (-1..14) - -ClosedLanes ::= SEQUENCE { - innerhardShoulderStatus HardShoulderStatus OPTIONAL, - outerhardShoulderStatus HardShoulderStatus OPTIONAL, - drivingLaneStatus DrivingLaneStatus OPTIONAL, - ... -} - -HardShoulderStatus ::= ENUMERATED {availableForStopping(0), closed(1), availableForDriving(2)} - -DrivingLaneStatus ::= BIT STRING (SIZE (1..13)) - -PerformanceClass ::= INTEGER {unavailable(0), performanceClassA(1), performanceClassB(2)} (0..7) - -SpeedValue ::= INTEGER {standstill(0), oneCentimeterPerSec(1), unavailable(16383)} (0..16383) - -SpeedConfidence ::= INTEGER {equalOrWithinOneCentimeterPerSec(1), equalOrWithinOneMeterPerSec(100), outOfRange(126), unavailable(127)} (1..127) - -VehicleMass ::= INTEGER {hundredKg(1), unavailable(1024)} (1..1024) - -Speed ::= SEQUENCE { - speedValue SpeedValue, - speedConfidence SpeedConfidence -} - -DriveDirection ::= ENUMERATED {forward (0), backward (1), unavailable (2)} - -EmbarkationStatus ::= BOOLEAN - -LongitudinalAcceleration ::= SEQUENCE { - longitudinalAccelerationValue LongitudinalAccelerationValue, - longitudinalAccelerationConfidence AccelerationConfidence -} - -LongitudinalAccelerationValue ::= INTEGER {pointOneMeterPerSecSquaredForward(1), pointOneMeterPerSecSquaredBackward(-1), unavailable(161)} (-160 .. 161) - -AccelerationConfidence ::= INTEGER {pointOneMeterPerSecSquared(1), outOfRange(101), unavailable(102)} (0 .. 102) - -LateralAcceleration ::= SEQUENCE { - lateralAccelerationValue LateralAccelerationValue, - lateralAccelerationConfidence AccelerationConfidence -} - -LateralAccelerationValue ::= INTEGER {pointOneMeterPerSecSquaredToRight(-1), pointOneMeterPerSecSquaredToLeft(1), unavailable(161)} (-160 .. 161) - -VerticalAcceleration ::= SEQUENCE { - verticalAccelerationValue VerticalAccelerationValue, - verticalAccelerationConfidence AccelerationConfidence -} - -VerticalAccelerationValue ::= INTEGER {pointOneMeterPerSecSquaredUp(1), pointOneMeterPerSecSquaredDown(-1), unavailable(161)} (-160 .. 161) - -StationType ::= INTEGER {unknown(0), pedestrian(1), cyclist(2), moped(3), motorcycle(4), passengerCar(5), bus(6), -lightTruck(7), heavyTruck(8), trailer(9), specialVehicles(10), tram(11), roadSideUnit(15)} (0..255) - -ExteriorLights ::= BIT STRING { - lowBeamHeadlightsOn (0), - highBeamHeadlightsOn (1), - leftTurnSignalOn (2), - rightTurnSignalOn (3), - daytimeRunningLightsOn (4), - reverseLightOn (5), - fogLightOn (6), - parkingLightsOn (7) -} (SIZE(8)) - -DangerousGoodsBasic::= ENUMERATED { - explosives1(0), - explosives2(1), - explosives3(2), - explosives4(3), - explosives5(4), - explosives6(5), - flammableGases(6), - nonFlammableGases(7), - toxicGases(8), - flammableLiquids(9), - flammableSolids(10), - substancesLiableToSpontaneousCombustion(11), - substancesEmittingFlammableGasesUponContactWithWater(12), - oxidizingSubstances(13), - organicPeroxides(14), - toxicSubstances(15), - infectiousSubstances(16), - radioactiveMaterial(17), - corrosiveSubstances(18), - miscellaneousDangerousSubstances(19) -} - -DangerousGoodsExtended ::= SEQUENCE { - dangerousGoodsType DangerousGoodsBasic, - unNumber INTEGER (0..9999), - elevatedTemperature BOOLEAN, - tunnelsRestricted BOOLEAN, - limitedQuantity BOOLEAN, - emergencyActionCode IA5String (SIZE (1..24)) OPTIONAL, - phoneNumber PhoneNumber OPTIONAL, - companyName UTF8String (SIZE (1..24)) OPTIONAL, - ... -} - -SpecialTransportType ::= BIT STRING {heavyLoad(0), excessWidth(1), excessLength(2), excessHeight(3)} (SIZE(4)) - -LightBarSirenInUse ::= BIT STRING { - lightBarActivated (0), - sirenActivated (1) -} (SIZE(2)) - -HeightLonCarr ::= INTEGER {oneCentimeter(1), unavailable(100)} (1..100) - -PosLonCarr ::= INTEGER {oneCentimeter(1), unavailable(127)} (1..127) - -PosPillar ::= INTEGER {tenCentimeters(1), unavailable(30)} (1..30) - -PosCentMass ::= INTEGER {tenCentimeters(1), unavailable(63)} (1..63) - -RequestResponseIndication ::= ENUMERATED {request(0), response(1)} - -SpeedLimit ::= INTEGER {oneKmPerHour(1)} (1..255) - -StationarySince ::= ENUMERATED {lessThan1Minute(0), lessThan2Minutes(1), lessThan15Minutes(2), equalOrGreater15Minutes(3)} - -Temperature ::= INTEGER {equalOrSmallerThanMinus60Deg (-60), oneDegreeCelsius(1), equalOrGreaterThan67Deg(67)} (-60..67) - -TrafficRule ::= ENUMERATED {noPassing(0), noPassingForTrucks(1), passToRight(2), passToLeft(3), ... -} - -WheelBaseVehicle ::= INTEGER {tenCentimeters(1), unavailable(127)} (1..127) - -TurningRadius ::= INTEGER {point4Meters(1), unavailable(255)} (1..255) - -PosFrontAx ::= INTEGER {tenCentimeters(1), unavailable(20)} (1..20) - -PositionOfOccupants ::= BIT STRING { - row1LeftOccupied (0), - row1RightOccupied (1), - row1MidOccupied (2), - row1NotDetectable (3), - row1NotPresent (4), - row2LeftOccupied (5), - row2RightOccupied (6), - row2MidOccupied (7), - row2NotDetectable (8), - row2NotPresent (9), - row3LeftOccupied (10), - row3RightOccupied (11), - row3MidOccupied (12), - row3NotDetectable (13), - row3NotPresent (14), - row4LeftOccupied (15), - row4RightOccupied (16), - row4MidOccupied (17), - row4NotDetectable (18), - row4NotPresent (19)} (SIZE(20)) - -PositioningSolutionType ::= ENUMERATED {noPositioningSolution(0), sGNSS(1), dGNSS(2), sGNSSplusDR(3), dGNSSplusDR(4), dR(5), ...} - -VehicleIdentification ::= SEQUENCE { - wMInumber WMInumber OPTIONAL, - vDS VDS OPTIONAL, - ... -} - -WMInumber ::= IA5String (SIZE(1..3)) - -VDS ::= IA5String (SIZE(6)) - -EnergyStorageType ::= BIT STRING {hydrogenStorage(0), electricEnergyStorage(1), liquidPropaneGas(2), compressedNaturalGas(3), diesel(4), gasoline(5), ammonia(6)} (SIZE(7)) - -VehicleLength ::= SEQUENCE { - vehicleLengthValue VehicleLengthValue, - vehicleLengthConfidenceIndication VehicleLengthConfidenceIndication -} - -VehicleLengthValue ::= INTEGER {tenCentimeters(1), outOfRange(1022), unavailable(1023)} (1..1023) - -VehicleLengthConfidenceIndication ::= ENUMERATED {noTrailerPresent(0), trailerPresentWithKnownLength(1), trailerPresentWithUnknownLength(2), trailerPresenceIsUnknown(3), unavailable(4)} - -VehicleWidth ::= INTEGER {tenCentimeters(1), outOfRange(61), unavailable(62)} (1..62) - -PathHistory::= SEQUENCE (SIZE(0..40)) OF PathPoint - -EmergencyPriority ::= BIT STRING {requestForRightOfWay(0), requestForFreeCrossingAtATrafficLight(1)} (SIZE(2)) - -InformationQuality ::= INTEGER {unavailable(0), lowest(1), highest(7)} (0..7) - -RoadType ::= ENUMERATED { - urban-NoStructuralSeparationToOppositeLanes(0), - urban-WithStructuralSeparationToOppositeLanes(1), - nonUrban-NoStructuralSeparationToOppositeLanes(2), - nonUrban-WithStructuralSeparationToOppositeLanes(3)} - -SteeringWheelAngle ::= SEQUENCE { - steeringWheelAngleValue SteeringWheelAngleValue, - steeringWheelAngleConfidence SteeringWheelAngleConfidence -} - -SteeringWheelAngleValue ::= INTEGER {straight(0), onePointFiveDegreesToRight(-1), onePointFiveDegreesToLeft(1), unavailable(512)} (-511..512) - -SteeringWheelAngleConfidence ::= INTEGER {equalOrWithinOnePointFiveDegree (1), outOfRange(126), unavailable(127)} (1..127) - -TimestampIts ::= INTEGER {utcStartOf2004(0), oneMillisecAfterUTCStartOf2004(1)} (0..4398046511103) - -VehicleRole ::= ENUMERATED {default(0), publicTransport(1), specialTransport(2), dangerousGoods(3), roadWork(4), rescue(5), emergency(6), safetyCar(7), agriculture(8), commercial(9), military(10), roadOperator(11), taxi(12), reserved1(13), reserved2(14), reserved3(15)} - -YawRate::= SEQUENCE { - yawRateValue YawRateValue, - yawRateConfidence YawRateConfidence -} - -YawRateValue ::= INTEGER {straight(0), degSec-000-01ToRight(-1), degSec-000-01ToLeft(1), unavailable(32767)} (-32766..32767) - -YawRateConfidence ::= ENUMERATED { - degSec-000-01 (0), - degSec-000-05 (1), - degSec-000-10 (2), - degSec-001-00 (3), - degSec-005-00 (4), - degSec-010-00 (5), - degSec-100-00 (6), - outOfRange (7), - unavailable (8) -} - -ProtectedZoneType::= ENUMERATED { permanentCenDsrcTolling (0), ..., temporaryCenDsrcTolling (1) } - -RelevanceDistance ::= ENUMERATED {lessThan50m(0), lessThan100m(1), lessThan200m(2), lessThan500m(3), lessThan1000m(4), lessThan5km(5), lessThan10km(6), over10km(7)} - -RelevanceTrafficDirection ::= ENUMERATED {allTrafficDirections(0), upstreamTraffic(1), downstreamTraffic(2), oppositeTraffic(3)} - -TransmissionInterval ::= INTEGER {oneMilliSecond(1), tenSeconds(10000)} (1..10000) - -ValidityDuration ::= INTEGER {timeOfDetection(0), oneSecondAfterDetection(1)} (0..86400) - -ActionID ::= SEQUENCE { - originatingStationID StationID, - sequenceNumber SequenceNumber -} - -ItineraryPath ::= SEQUENCE SIZE(1..40) OF ReferencePosition - -ProtectedCommunicationZone ::= SEQUENCE { - protectedZoneType ProtectedZoneType, - expiryTime TimestampIts OPTIONAL, - protectedZoneLatitude Latitude, - protectedZoneLongitude Longitude, - protectedZoneRadius ProtectedZoneRadius OPTIONAL, - protectedZoneID ProtectedZoneID OPTIONAL, - ... -} - -Traces ::= SEQUENCE SIZE(1..7) OF PathHistory - -NumberOfOccupants ::= INTEGER {oneOccupant (1), unavailable(127)} (0 .. 127) - -SequenceNumber ::= INTEGER (0..65535) - -PositionOfPillars ::= SEQUENCE (SIZE(1..3, ...)) OF PosPillar - -RestrictedTypes ::= SEQUENCE (SIZE(1..3, ...)) OF StationType - -EventHistory::= SEQUENCE (SIZE(1..23)) OF EventPoint - -EventPoint ::= SEQUENCE { - eventPosition DeltaReferencePosition, - eventDeltaTime PathDeltaTime OPTIONAL, - informationQuality InformationQuality -} - -ProtectedCommunicationZonesRSU ::= SEQUENCE (SIZE(1..16)) OF ProtectedCommunicationZone - -CenDsrcTollingZone ::= SEQUENCE { - protectedZoneLatitude Latitude, - protectedZoneLongitude Longitude, - cenDsrcTollingZoneID CenDsrcTollingZoneID OPTIONAL, - ... -} - -ProtectedZoneRadius ::= INTEGER {oneMeter(1)} (1..255,...) - -ProtectedZoneID ::= INTEGER (0.. 134217727) - -CenDsrcTollingZoneID ::= ProtectedZoneID - -DigitalMap ::= SEQUENCE (SIZE(1..256)) OF ReferencePosition - -OpeningDaysHours ::= UTF8String - -PhoneNumber ::= NumericString (SIZE(1..16)) -END diff --git a/ttcn/Common/LibItsCommon_TypesAndValues.ttcn b/ttcn/Common/LibItsCommon_TypesAndValues.ttcn index 86c570d4..f40485b7 100644 --- a/ttcn/Common/LibItsCommon_TypesAndValues.ttcn +++ b/ttcn/Common/LibItsCommon_TypesAndValues.ttcn @@ -198,6 +198,7 @@ module LibItsCommon_TypesAndValues { const integer c_its_aid_SPAT := 137; const integer c_its_aid_MAP := 138; const integer c_its_aid_IVI := 139; + const integer c_its_aid_GPC := 140; const integer c_its_aid_TLC := 140; const integer c_its_aid_GN := 141; const integer c_its_aid_SCR := 623; // Secured Certificate Request, https://standards.ieee.org/products-services/regauth/psid/public.html diff --git a/ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn b/ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn index bb8e5f66..bfc9c92e 100644 --- a/ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn +++ b/ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn @@ -114,6 +114,35 @@ module LibItsRtcmem_Functions { return; } + /** + * @desc Terminates an event at the application layer + * @param p_event The event to terminate. + */ + function f_utTerminateEvent(template (value) UtRtcmemTermination p_event) runs on ItsRtcmem { + + //deactivate rtcmemPort default alts + vc_rtcmemDefaultActive := false; + + utPort.send(p_event); + tc_wait.start; + alt { + [] utPort.receive(UtRtcmemResults: { utRtcmemTerminationResult := ?}) { + tc_wait.stop; + } + [] tc_wait.timeout { + log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + [] a_utDefault() { + //empty on purpose + } + } + + //activate rtcmemPort default alts + vc_rtcmemDefaultActive := true; + + } + } // End of group utFuntions group adapterControl { @@ -220,7 +249,7 @@ module LibItsRtcmem_Functions { [] utPort.receive(UtRtcmemEventInd:?) -> value v_rtcmemevent { //store every upper tester indication received - vc_utRtcmemEvents[lengthof(vc_utRtcmemEvents)] := v_rtcmemevent; + vc_utEvents[lengthof(vc_utEvents)] := v_rtcmemevent; repeat; } [] utPort.receive { @@ -231,7 +260,7 @@ module LibItsRtcmem_Functions { } // End of group altsteps - group rtcmemSsemConfigurationFunctions { + group rtcmemConfigurationFunctions { /** * @desc Setups default configuration @@ -272,7 +301,7 @@ module LibItsRtcmem_Functions { f_disconnect4SelfOrClientSync(); } // End of f_cfDown - } // End of of rtcmemSsemConfigurationFunctions + } // End of of rtcmemConfigurationFunctions group preambles { diff --git a/ttcn/Rtcmem/LibItsRtcmem_Pics.ttcn b/ttcn/Rtcmem/LibItsRtcmem_Pics.ttcn index 6819803b..448f32b2 100644 --- a/ttcn/Rtcmem/LibItsRtcmem_Pics.ttcn +++ b/ttcn/Rtcmem/LibItsRtcmem_Pics.ttcn @@ -20,5 +20,11 @@ module LibItsRtcmem_Pics { * @see ETSI TS 103 191-1 Table A.5 */ modulepar boolean PICS_RTCMEM_RECEPTION := true; + + /** + * @desc Does IUT support GeoNetworking short range? + * @see ETSI TS 103 191-1 Table A.5 + */ + modulepar boolean PICS_SHORT_RANGE := true; } // End of module LibItsRtcmem_Pics diff --git a/ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn b/ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn index ad2bce55..3522d53e 100644 --- a/ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn +++ b/ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn @@ -14,7 +14,7 @@ module LibItsRtcmem_Templates { import from LibItsCommon_Functions all; import from LibItsCommon_ASN1_NamedNumbers all; - // LibItsRtcmemSsem + // LibItsRtcmem import from LibItsRtcmem_TestSystem all; import from LibItsRtcmem_TypesAndValues all; import from LibItsRtcmem_Pixits all; @@ -22,7 +22,7 @@ module LibItsRtcmem_Templates { group primitivesTemplates { /** - * @desc Send template for RTCMEM Message (RtcmemSsemPort Primitive) + * @desc Send template for RTCMEM Message (RtcmemPort Primitive) * @param p_rtcmemMsg The RTCMEM Message to be sent */ template (value) RtcmemReq m_rtcmemReq( @@ -32,7 +32,7 @@ module LibItsRtcmem_Templates { } /** - * @desc Receive template for RTCMEM Message (RtcmemSsemPort Primitive) + * @desc Receive template for RTCMEM Message (RtcmemPort Primitive) * @param p_rtcmemMsg The expected RTCMEM Message */ template (present) RtcmemInd mw_rtcmemInd( @@ -51,7 +51,7 @@ module LibItsRtcmem_Templates { } /** - * @desc Receive template for RTCMEM Message (RtcmemSsemPort Primitive) + * @desc Receive template for RTCMEM Message (RtcmemPort Primitive) * @param p_rtcmemMsg The expected RTCMEM Message * @param p_gnNextHeader GN next header value * @param p_gnHeaderType GN header type value @@ -75,7 +75,7 @@ module LibItsRtcmem_Templates { } /** - * @desc Receive template for RTCMEM Message (RtcmemSsemPort Primitive) + * @desc Receive template for RTCMEM Message (RtcmemPort Primitive) * @param p_rtcmemMsg Expected RTCMEM Message * @param p_btpDestinationPort BTP destination port value * @param p_btpInfo BTP destination port info value (if BTP-B) or BTP source port value (if BTP-A) @@ -90,14 +90,14 @@ module LibItsRtcmem_Templates { }; /** - * @desc Receive template for RTCMEM Message (RtcmemSsemPort Primitive) + * @desc Receive template for RTCMEM Message (RtcmemPort Primitive) * @param p_rtcmemMsg The expected RTCMEM Message * @param p_ssp SSP value * @param p_its_aid ITS-AID value */ template (present) RtcmemInd mw_rtcmemIndWithSecurityParameters( template (present) RTCMEM p_rtcmemMsg, - template Bit256 p_ssp := *, + template Bit24 p_ssp := *, template UInt32 p_its_aid := * ) modifies mw_rtcmemInd := { ssp := p_ssp, @@ -117,8 +117,8 @@ module LibItsRtcmem_Templates { } /** - * @desc Send template for Upper Tester Trigger event - */ + * @desc Send template for Upper Tester Trigger event + */ template (omit) UtRtcmemTrigger m_utTriggerEvent( in MsgCount p_msgCnt, in RTCM_Revision p_rev := rtcmRev3, @@ -135,6 +135,15 @@ module LibItsRtcmem_Templates { rtcmHeader := p_rtcmHeader } + /** + * @desc Send template for Upper Tester Trigger event + */ + template (omit) UtRtcmemTermination m_utTriggerTermination( + in MsgCount p_msgCnt + ) := { + msgCnt := p_msgCnt + } + } group rtcmemPduTemplates { @@ -220,6 +229,30 @@ module LibItsRtcmem_Templates { } // End of group headerTemplates + group rtcmemTemplatesSend { + + /** + * @desc Receive template for RTCMEM Message + */ + template (value) RTCMcorrections m_defaultRtcmem( + in MsgCount p_msgCnt, + in RTCM_Revision p_rev := rtcmRev3, + in RTCMmessageList p_msgs, + in template (omit) MinuteOfTheYear p_timeStamp := omit, + in template (omit) FullPositionVector p_anchorPoint := omit, + in template (omit) RTCMheader p_rtcmHeader := omit + ) := { + msgCnt := p_msgCnt, + rev := p_rev, + timeStamp := p_timeStamp, + anchorPoint := p_anchorPoint, + rtcmHeader := p_rtcmHeader, + msgs := p_msgs, + regional := omit + } // End of template m_defaultRtcmem + + } // End of group rtcmemTemplatesSend + group rtcmemTemplatesRecv { /** diff --git a/ttcn/Rtcmem/LibItsRtcmem_TestSystem.ttcn b/ttcn/Rtcmem/LibItsRtcmem_TestSystem.ttcn index fa25cba0..eec9cf9e 100644 --- a/ttcn/Rtcmem/LibItsRtcmem_TestSystem.ttcn +++ b/ttcn/Rtcmem/LibItsRtcmem_TestSystem.ttcn @@ -35,7 +35,7 @@ module LibItsRtcmem_TestSystem { */ type port UpperTesterPort message { out - UtRtcmemInitialize, UtRtcmemTrigger, UtRtcmemUpdate; + UtRtcmemInitialize, UtRtcmemTrigger, UtRtcmemUpdate, UtRtcmemTermination; in UtRtcmemResults, UtRtcmemEventInd; } // end UpperTesterPort @@ -77,7 +77,7 @@ module LibItsRtcmem_TestSystem { //component variables var RtcmemInd vc_mapMsg; - var UtRtcmemEventIndList vc_utRtcmemEvents := {}; + var UtRtcmemEventIndList vc_utEvents := {}; //default var default vc_default := null; @@ -99,7 +99,7 @@ module LibItsRtcmem_TestSystem { UInt8 gnTrafficClass optional, UInt16 btpDestinationPort optional, UInt16 btpInfo optional, - Bit256 ssp optional, + Bit24 ssp optional, UInt32 its_aid optional } with { diff --git a/ttcn/Rtcmem/LibItsRtcmem_TypesAndValues.ttcn b/ttcn/Rtcmem/LibItsRtcmem_TypesAndValues.ttcn index fd8ec3d0..2d82cb9e 100644 --- a/ttcn/Rtcmem/LibItsRtcmem_TypesAndValues.ttcn +++ b/ttcn/Rtcmem/LibItsRtcmem_TypesAndValues.ttcn @@ -34,7 +34,8 @@ module LibItsRtcmem_TypesAndValues { type union UtRtcmemResults { boolean utRtcmemInitializeResult, boolean utRtcmemTriggerResult, - boolean utRtcmemUpdateResult + boolean utRtcmemUpdateResult, + boolean utRtcmemTerminationResult } with { variant "" } // End of type UtRtcmemResults @@ -65,13 +66,22 @@ module LibItsRtcmem_TypesAndValues { variant "FIELDORDER(msb)" } + /** + * @desc Upper Tester message to request termination of an event at IUT + */ + type record UtRtcmemTermination { + MsgCount msgCnt + } with { + variant "FIELDORDER(msb)" + } + /** * @desc Upper Tester message to check event/status at IUT */ type record UtRtcmemEventInd { - RTCMEM rtcmeMsg + RTCMEM rtcmemMsg } with { - encode (rtcmeMsg) "LibItsRtcmem_asn1" + encode (rtcmemMsg) "LibItsRtcmem_asn1" } /** -- GitLab From 5d0d6eb75b6604a3ee58c98889994a3906e1dc44 Mon Sep 17 00:00:00 2001 From: pintar Date: Mon, 24 Aug 2020 14:55:39 +0200 Subject: [PATCH 257/320] New IVI PICS added. --- ttcn/IVIM/LibItsIvim_Pics.ttcn | 55 +++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/ttcn/IVIM/LibItsIvim_Pics.ttcn b/ttcn/IVIM/LibItsIvim_Pics.ttcn index c0f0c0b9..35006485 100644 --- a/ttcn/IVIM/LibItsIvim_Pics.ttcn +++ b/ttcn/IVIM/LibItsIvim_Pics.ttcn @@ -1,5 +1,5 @@ /** - * @author ETSI / STF517 + * @author ETSI / STF517 / TTF002 * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/IVIM/LibItsIvim_Pics.ttcn $ * $Id: LibItsIvim_Pics.ttcn 1312 2016-12-14 09:21:45Z garciay $ * @desc IVIM PICS @@ -60,5 +60,58 @@ module LibItsIvim_Pics { * @see ETSI TS 103 191-1 Table A.4 */ modulepar float PICS_T_GENIVIMMAX := 10.000; + /** + * @desc Support for IVIM fragmentation + * @see TODO + */ + modulepar boolean PICS_IVIM_FRAGMENTATION := false; + + /** + * @desc Support for IVIM general container + * @see TODO + */ + modulepar boolean PICS_IVIM_HAS_GENERAL_CONTAINER := false; + + /** + * @desc Support for IVIM has layout container + * @see TODO + */ + modulepar boolean PICS_IVIM_HAS_LAYOUT_CONTAINER := false; + + /** + * @desc Support for IVIM has road cfg container + * @see TODO + */ + modulepar boolean PICS_IVIM_HAS_ROAD_CFG_CONTAINER := false; + + /** + * @desc Support for IVIM has text container + * @see TODO + */ + modulepar boolean PICS_IVIM_HAS_TEXT_CONTAINER := false; + + /** + * @desc Support for IVIM rscode viennaconv + * @see TODO + */ + modulepar boolean PICS_IVIM_RSCODE_VIENNACONV := false; + + /** + * @desc Support for IVIM rscode ISO14823 + * @see TODO + */ + modulepar boolean PICS_IVIM_RSCODE_ISO14823 := false; + + /** + * @desc Support for IVIM rscode saej2540 + * @see TODO + */ + modulepar boolean PICS_IVIM_RSCODE_SAEJ2540 := false; + + /** + * @desc Support for IVIM rscode anz catalogue + * @see TODO + */ + modulepar boolean PICS_IVIM_RSCODE_ANY_CATALOGUE := false; } // End of module LibItsIvim_Pics \ No newline at end of file -- GitLab From 1e8f15194073ce9a60ba0d2fd28a0ba8fe6d3cb8 Mon Sep 17 00:00:00 2001 From: pintar Date: Tue, 25 Aug 2020 08:22:20 +0200 Subject: [PATCH 258/320] New IVI PICS added. --- ttcn/IVIM/LibItsIvim_Pics.ttcn | 1 + 1 file changed, 1 insertion(+) diff --git a/ttcn/IVIM/LibItsIvim_Pics.ttcn b/ttcn/IVIM/LibItsIvim_Pics.ttcn index 35006485..9508c5fc 100644 --- a/ttcn/IVIM/LibItsIvim_Pics.ttcn +++ b/ttcn/IVIM/LibItsIvim_Pics.ttcn @@ -60,6 +60,7 @@ module LibItsIvim_Pics { * @see ETSI TS 103 191-1 Table A.4 */ modulepar float PICS_T_GENIVIMMAX := 10.000; + /** * @desc Support for IVIM fragmentation * @see TODO -- GitLab From 6731ae2bc1cb0ccbb53beab8f92433c307a8aa3d Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 25 Aug 2020 15:59:39 +0200 Subject: [PATCH 259/320] Align ASN.1 files with 'ASN1/IS TS 103 301' Branch devel_v2.0.1 --- .../ETSI_TS_103301/IVIM_PDU_Descriptions.asn | 16 +- .../ETSI_TS_103301/MAPEM_PDU_Descriptions.asn | 14 +- .../ETSI_TS_103301/RTCM_PDU_Descriptions.asn | 14 +- .../SPATEM_PDU_Descriptions.asn | 32 +- .../ETSI_TS_103301/SREM_PDU_Descriptions.asn | 14 +- .../ETSI_TS_103301/SSEM_PDU_Descriptions.asn | 13 +- asn1/IS/ISO_TS_14823/GDD.asn | 232 ++++++++ asn1/IS/ISO_TS_14906/EfcDsrcApplication.asn | 532 +++++++++++++++++- asn1/IS/ISO_TS_14906/EfcDsrcGeneric.asn | 14 +- asn1/IS/ISO_TS_19321/IVI.asn | 6 +- ...trationIdentificationVehicleDataModule.asn | 5 +- 11 files changed, 792 insertions(+), 100 deletions(-) create mode 100644 asn1/IS/ISO_TS_14823/GDD.asn diff --git a/asn1/IS/ETSI_TS_103301/IVIM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/IVIM_PDU_Descriptions.asn index 62cb689d..319c1522 100644 --- a/asn1/IS/ETSI_TS_103301/IVIM_PDU_Descriptions.asn +++ b/asn1/IS/ETSI_TS_103301/IVIM_PDU_Descriptions.asn @@ -1,11 +1,8 @@ --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --- --- module: IVI-MESSAGE-PDU-Descriptions --- --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +-- @brief Specification of the In vehicle information Message ETSI TS 103 301 +-- Latest version available at @url https://forge.etsi.org/rep/ITS/asn1/is_ts103301.git IVIM-PDU-Descriptions { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) en (103301) ivim (2) version2 (2) + itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts103301 (103301) ivim (2) version2 (2) } DEFINITIONS AUTOMATIC TAGS ::= @@ -13,11 +10,8 @@ DEFINITIONS AUTOMATIC TAGS ::= BEGIN IMPORTS -IviStructure FROM IVI {iso (1) standard (0) ivi (19321) version1 (1)} -ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2)} - -; --- End of IMPORTS +IviStructure FROM IVI { iso (1) standard (0) ivi (19321) version2 (2) } +ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2)}; IVIM ::= SEQUENCE { header ItsPduHeader, diff --git a/asn1/IS/ETSI_TS_103301/MAPEM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/MAPEM_PDU_Descriptions.asn index bb173416..9496e553 100644 --- a/asn1/IS/ETSI_TS_103301/MAPEM_PDU_Descriptions.asn +++ b/asn1/IS/ETSI_TS_103301/MAPEM_PDU_Descriptions.asn @@ -1,11 +1,8 @@ --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --- --- module: MAP-MESSAGE-PDU-Descriptions --- --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +-- @brief Specification of the Map (lane topology) extended Message ETSI TS 103 301 +-- Latest version available at @url https://forge.etsi.org/rep/ITS/asn1/is_ts103301.git MAPEM-PDU-Descriptions { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) en (103301) mapem (1) version2 (2) + itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts103301 (103301) mapem (1) version2 (2) } DEFINITIONS AUTOMATIC TAGS ::= @@ -14,10 +11,7 @@ BEGIN IMPORTS MapData FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) } -ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2)} - -; --- End of IMPORTS +ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2)}; MAPEM ::= SEQUENCE { header ItsPduHeader, diff --git a/asn1/IS/ETSI_TS_103301/RTCM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/RTCM_PDU_Descriptions.asn index d55d840b..1c0ea624 100644 --- a/asn1/IS/ETSI_TS_103301/RTCM_PDU_Descriptions.asn +++ b/asn1/IS/ETSI_TS_103301/RTCM_PDU_Descriptions.asn @@ -1,11 +1,8 @@ --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --- --- module: RTCM corrections extended message --- --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +-- @brief Specification of the RTCM corrections extended Message ETSI TS 103 301 +-- Latest version available at @url https://forge.etsi.org/rep/ITS/asn1/is_ts103301.git RTCMEM-PDU-Descriptions { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) en (103301) rtcmem (5) version1 (1) + itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts103301 (103301) rtcmem (5) version1 (1) } DEFINITIONS AUTOMATIC TAGS ::= @@ -14,10 +11,7 @@ BEGIN IMPORTS RTCMcorrections FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) } -ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2)} - -; --- End of IMPORTS +ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2)}; RTCMEM ::= SEQUENCE { header ItsPduHeader, diff --git a/asn1/IS/ETSI_TS_103301/SPATEM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/SPATEM_PDU_Descriptions.asn index 9de013fa..dbad8257 100644 --- a/asn1/IS/ETSI_TS_103301/SPATEM_PDU_Descriptions.asn +++ b/asn1/IS/ETSI_TS_103301/SPATEM_PDU_Descriptions.asn @@ -1,13 +1,8 @@ --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --- --- module: SPAT-MESSAGE-PDU-Descriptions --- --- This ASN.1 was created: 30.08.2016 --- --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +-- @brief Specification of the Signal phase and timing extended Message ETSI TS 103 301 +-- Latest version available at @url https://forge.etsi.org/rep/ITS/asn1/is_ts103301.git SPATEM-PDU-Descriptions { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) en (103301) spatem (0) version2 (2) + itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts103301 (103301) spatem (0) version2 (2) } DEFINITIONS AUTOMATIC TAGS ::= @@ -15,13 +10,26 @@ DEFINITIONS AUTOMATIC TAGS ::= BEGIN IMPORTS -SPAT FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) } -ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) } +-- @brief Include ISO 19091 +-- Include references from @url https://standards.iso.org/iso/ts/19091/ed-2/en/ISO-TS-19091-addgrp-C-2018.asn +SPAT +FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) } -; --- End of IMPORTS +-- @brief Include ETSI TS 102 894-2 +-- Include references from @url https://forge.etsi.org/rep/ITS/ITS_ASN1/blob/master/CDD_TS102894-2/ITS-Container.asn +ItsPduHeader +FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) }; +-- Signal phase and timing extended Message + +-- @brief Signal phase and timing extended Message Root +-- This DF includes DEs for the SPATEM protocolVersion, the SPAT message type identifier _messageID_ and +-- the station identifier _stationID_ of the originating ITS-S. SPATEM ::= SEQUENCE { + -- @details header + -- The DE _protocolVersion_ is used to select the appropriate protocol decoder at the receiving ITS-S. + -- It shall be set to 2. + -- The DE _messageID_ shall be spatem(4). header ItsPduHeader, spat SPAT } diff --git a/asn1/IS/ETSI_TS_103301/SREM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/SREM_PDU_Descriptions.asn index d0d1b1c3..a96af0e5 100644 --- a/asn1/IS/ETSI_TS_103301/SREM_PDU_Descriptions.asn +++ b/asn1/IS/ETSI_TS_103301/SREM_PDU_Descriptions.asn @@ -1,11 +1,8 @@ --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --- --- module: SRM-MESSAGE-PDU-Descriptions --- --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +-- @brief Specification of the Signal request extended Message ETSI TS 103 301 +-- Latest version available at @url https://forge.etsi.org/rep/ITS/asn1/is_ts103301.git SREM-PDU-Descriptions { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) en (103301) srem (3) version2 (2) + itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts103301 (103301) srem (3) version2 (2) } DEFINITIONS AUTOMATIC TAGS ::= @@ -14,10 +11,7 @@ BEGIN IMPORTS SignalRequestMessage FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) } -ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2)} - -; --- End of IMPORTS +ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2)}; SREM ::= SEQUENCE { header ItsPduHeader, diff --git a/asn1/IS/ETSI_TS_103301/SSEM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/SSEM_PDU_Descriptions.asn index f3f1199d..7c3069be 100644 --- a/asn1/IS/ETSI_TS_103301/SSEM_PDU_Descriptions.asn +++ b/asn1/IS/ETSI_TS_103301/SSEM_PDU_Descriptions.asn @@ -1,11 +1,8 @@ --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --- --- module: SSM-MESSAGE-PDU-Descriptions --- --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- +-- @brief Specification of the Signal status extended Message ETSI TS 103 301 +-- Latest version available at @url https://forge.etsi.org/rep/ITS/asn1/is_ts103301.git SSEM-PDU-Descriptions { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) en (103301) ssem (4) version2 (2) + itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts103301 (103301) ssem (4) version2 (2) } DEFINITIONS AUTOMATIC TAGS ::= @@ -14,10 +11,8 @@ BEGIN IMPORTS SignalStatusMessage FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) } -ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2)} +ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2)}; -; --- End of IMPORTS SSEM ::= SEQUENCE { header ItsPduHeader, diff --git a/asn1/IS/ISO_TS_14823/GDD.asn b/asn1/IS/ISO_TS_14823/GDD.asn new file mode 100644 index 00000000..60db2d49 --- /dev/null +++ b/asn1/IS/ISO_TS_14823/GDD.asn @@ -0,0 +1,232 @@ +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- ISO TS 14823 +-- +-- This ASN.1 was generated: 30.08.2016 +-- +-- This document contains only the data element needed for the encoding of an IVI message +-- as defined in ISO TS 19321(2020) +-- +-- Published version location (yet missing there): +-- https://standards.iso.org/iso/ts/14823/ +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +GDD {iso (1) standard (0) gdd(14823) version1 (0)} + +DEFINITIONS AUTOMATIC TAGS::= +BEGIN + +--Definition of GDD Structure + +GddStructure::= SEQUENCE{ + pictogramCode SEQUENCE { + countryCode OCTET STRING (SIZE (2)) OPTIONAL, + serviceCategoryCode CHOICE { + trafficSignPictogram ENUMERATED {dangerWarning, regulatory, informative,...}, + publicFacilitiesPictogram ENUMERATED {publicFacilities, ...}, + ambientOrRoadConditionPictogram ENUMERATED {ambientCondition, roadCondition,...}, + ...}, + pictogramCategoryCode SEQUENCE { + nature INTEGER (1..9), + serialNumber INTEGER (0..99) +}}, + attributes GddAttributes OPTIONAL +} + +-- Definition of the single ISO 14823 Attributes +GddAttributes::= SEQUENCE (SIZE(1..8),...) OF GddAttribute + +GddAttribute::= CHOICE{ + dtm InternationalSign-applicablePeriod, -- Date/Time/Period + edt InternationalSign-exemptedApplicablePeriod,-- Exemption status of Date/Time/Period + dfl InternationalSign-directionalFlowOfLane,-- Directional Flow of Lane + ved InternationalSign-applicableVehicleDimensions,-- Vehicle Dimensions + spe InternationalSign-speedLimits,-- Speed + roi InternationalSign-rateOfIncline,-- Rate of Incline + dbv InternationalSign-distanceBetweenVehicles,-- Distance Between Vehicles + ddd InternationalSign-destinationInformation,-- Destination/Direction/Distance + set InternationalSign-section, -- Section + nol InternationalSign-numberOfLane -- Number of Lanes + } + +InternationalSign-applicablePeriod::= SEQUENCE { + year SEQUENCE { -- contains yearRangeStartYear and yearRangeEndYear + yearRangeStartYear INTEGER(2000..2127,...), + yearRangeEndYear INTEGER(2000..2127,...) + } OPTIONAL, + month-day SEQUENCE { -- contains dateRangeStartMonth&Date and dateRangeEndMonth&Date + dateRangeStartMonthDay MonthDay, + dateRangeEndMonthDay MonthDay + } OPTIONAL, + repeatingPeriodDayTypes RepeatingPeriodDayTypes OPTIONAL, + hourMinutes SEQUENCE { -- contains timeRangeStartTime and timeRangeEndTime + timeRangeStartTime HoursMinutes, + timeRangeEndTime HoursMinutes + } OPTIONAL, + dateRangeOfWeek DayOfWeek OPTIONAL, + durationHourMinute HoursMinutes OPTIONAL +} + +InternationalSign-exemptedApplicablePeriod::= InternationalSign-applicablePeriod + +InternationalSign-directionalFlowOfLane::= INTEGER { + sDL (1),-- Straight Direction Only + sLT (2),-- Straight and Left Turn Only + sRT (3),-- Straight and Right Turn Only + lTO (4),-- Left Turn Only + rTO (5),-- Right Turn Only + cLL (6),-- Convergence from the Left Lane + cRI (7),-- Convergence from the Right Lane + oVL (8) -- Oncoming Vehicles Lane + } (1..8) + +InternationalSign-applicableVehicleDimensions::= SEQUENCE{ + vehicleHeight Distance OPTIONAL, + vehicleWidth Distance OPTIONAL, + vehicleLength Distance OPTIONAL, + vehicleWeight Weight OPTIONAL + } + +InternationalSign-speedLimits::= SEQUENCE{ + speedLimitMax INTEGER(0..250) OPTIONAL, + speedLimitMin INTEGER(0..250) OPTIONAL, + unit Code-Units (0..1) + } + +InternationalSign-rateOfIncline::= INTEGER(1..32) + +InternationalSign-distanceBetweenVehicles::= Distance + +InternationalSign-destinationInformation::= SEQUENCE{ + junctionDirection INTEGER(1..128) OPTIONAL, + roundaboutCwDirection INTEGER(1..128)OPTIONAL, + roundaboutCcwDirection INTEGER(1..128)OPTIONAL, + ioList DDD-IO-LIST + } + +InternationalSign-section::= SEQUENCE{ + startingPointLength Distance OPTIONAL, + continuityLength Distance OPTIONAL + } + +InternationalSign-numberOfLane::= INTEGER(0..99) + +-- Definition of data elements used in ISO 14823 attributes + +Code-Units::= INTEGER { + kmperh (0), + milesperh (1), + kilometre (2), + metre (3), + decimetre (4), + centimetre (5), + mile (6), + yard (7), + foot (8), + minutesOfTime (9), + tonnes (10),--1000 kg, not Ton! + hundredkg (11), + pound (12),--lbs + rateOfIncline (13), + durationinminutes (14) + -- value 15 reserved for future use + } (0..15) + +DayOfWeek::= BIT STRING {unused(0), monday(1), tuesday(2), wednesday(3), thursday(4), friday(5), saturday(6), sunday(7)} (SIZE (8)) + +DDD-IO-LIST ::= SEQUENCE (SIZE (1..8,...)) OF DDD-IO + +DDD-IO::= SEQUENCE{ + arrowDirection INTEGER(0..7), + destPlace DestinationPlaces OPTIONAL, + destRoad DestinationRoads OPTIONAL, + roadNumberIdentifier INTEGER(1..999) OPTIONAL, + streetName INTEGER(1..999) OPTIONAL, + streetNameText UTF8String OPTIONAL, + distanceToDivergingPoint DistanceOrDuration OPTIONAL, + distanceToDestinationPlace DistanceOrDuration OPTIONAL + } + +DestinationPlace::= SEQUENCE{ + destType DestinationType, + destRSCode GddStructure (WITH COMPONENTS {..., attributes ABSENT}) OPTIONAL, + destBlob OCTET STRING OPTIONAL, + placeNameIdentification INTEGER(1..999) OPTIONAL, + placeNameText UTF8String OPTIONAL + } + +DestinationPlaces ::= SEQUENCE (SIZE (1..4,...)) OF DestinationPlace + +DestinationRoad::= SEQUENCE{ + derType DestinationRoadType, + roadNumberIdentifier INTEGER(1..999) OPTIONAL, + roadNumberText UTF8String OPTIONAL + } + +DestinationRoads ::= SEQUENCE (SIZE (1..4,...)) OF DestinationRoad + +DestinationRoadType::= INTEGER { + none (0), + nationalHighway (1), + localHighway (2), + tollExpresswayMotorway (3), + internationalHighway (4), + highway (5), + expressway (6), + nationalRoad (7), + regionalProvincialRoad (8), + localRoad (9), + motorwayJunction (10), + diversion (11), + rfu1 (12), + rfu2 (13), + rfu3 (14), + rfu4 (15) + } (0..15, ...) + +DestinationType::= INTEGER { + none (0), + importantArea (1), + principalArea (2), + generalArea (3), + wellKnownPoint (4), + country (5), + city (6), + street (7), + industrialArea (8), + historicArea (9), + touristicArea (10), + culturalArea (11), + touristicRoute (12), + recommendedRoute (13), + touristicAttraction (14), + geographicArea (15) + } (0..15, ...) + +Distance::= SEQUENCE{ + value INTEGER(1..16384), + unit Code-Units(2..4|6..8) + } + +DistanceOrDuration::= SEQUENCE { + value INTEGER(1..16384), + unit Code-Units (2..9) + } + +HoursMinutes::= SEQUENCE { + hours INTEGER (0..23),-- number of hours after midnight + mins INTEGER (0..59) -- number of minutes after the hour + } + +MonthDay::= SEQUENCE { + month INTEGER (1..12), + day INTEGER (1..31) + } + +RepeatingPeriodDayTypes::= BIT STRING {national-holiday (0), even-days(1), odd-days(2), market-day(3) } (SIZE (4)) + +Weight::= SEQUENCE { + value INTEGER(1..16384), + unit Code-Units (10..12) + } + +END diff --git a/asn1/IS/ISO_TS_14906/EfcDsrcApplication.asn b/asn1/IS/ISO_TS_14906/EfcDsrcApplication.asn index 67b999cf..c4c8dd48 100644 --- a/asn1/IS/ISO_TS_14906/EfcDsrcApplication.asn +++ b/asn1/IS/ISO_TS_14906/EfcDsrcApplication.asn @@ -1,17 +1,15 @@ -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- ISO TS 14906 Application +-- ISO TS 14906 App -- --- This ASN.1 was generateds: 30.08.2016 +-- This ASN.1 was generated: 30.08.2016 -- --- This document contains only the data element needed for the encoding of an IVI message --- as defined in ISO TS 19321(2015) +-- This document contains a compile clean version of EfcDsrcApplication module -- -- Published version location: --- http://standards.iso.org/iso/14906 +-- https://standards.iso.org/iso/14906/ed-3/en/ISO14906(2018)EfcDsrcApplicationv6.asn -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -EfcDsrcApplication { iso(1) standard(0) 14906 application(0) version5(5) } - +EfcDsrcApplication {iso(1) standard(0) 14906 application(0) version6(6)} DEFINITIONS AUTOMATIC TAGS ::= BEGIN EXPORTS ALL; IMPORTS @@ -19,13 +17,10 @@ CountryCode, CS5, AVIAEIIssuerIdentifier FROM AVIAEINumberingAndDataStructures {iso(1) standard(0) iso14816(14816) asnm1(1) version1(1)} -- defined in ISO 14816 -- AttributeIdList, Attributes{}, AttributeList{} -FROM EfcDsrcGeneric {iso(1) standard(0) 14906 generic(1) version5(5)} +FROM EfcDsrcGeneric {iso(1) standard(0) 14906 generic(1) version7(7)}; -- NOTE: The following are the definitions of the action and response -- parameters - -; --- End of IMPORTS - +ActualNumberOfPassengers ::= Int1 AxleWeightLimits ::= SEQUENCE { maxLadenweightOnAxle1 Int2, maxLadenweightOnAxle2 Int2, @@ -33,13 +28,192 @@ AxleWeightLimits ::= SEQUENCE { maxLadenweightOnAxle4 Int2, maxLadenweightOnAxle5 Int2 } - +AddRq::= SEQUENCE { +attributeId INTEGER(0..127,...), +value INTEGER +} +ChannelId::= INTEGER { +obu (0), +sam1 (1), -- secure application module +sam2 (2), +icc (3), -- integrated circuit(s) card +display (4), +buzzer (5), +printer (6), +serialInterface (7), -- serial interface: eg. RS232 and RS485 +parallelInterface (8), +gPS (9), +tachograph (10), +privateUse1 (11), -- free for proprietary use +privateUse2 (12), -- free for proprietary use +privateUse3 (13), -- free for proprietary use +privateUse4 (14), -- free for proprietary use +privateUse5 (15), -- free for proprietary use +bluetooth (16) +-- (17-255) are reserved for future CEN use +} (0..255) +ChannelRq::= SEQUENCE{ +channelId ChannelId, +apdu OCTET STRING +-- format according to the interface +-- of the channelId +} +ChannelRs::= SEQUENCE{ +channelId ChannelId, +apdu OCTET STRING +-- format according to the interface +-- of the channelId +} +CopyRq::= SEQUENCE { +destinationEID INTEGER(0..127,...), +attributeIdList AttributeIdList +} +CreditRq::= SEQUENCE { +refund PaymentFee, +nonce OCTET STRING, +key INTEGER(0..255) +} +CreditRs ::= SEQUENCE { +creditResult ResultFin, +creditAuthenticator OCTET STRING +} +DebitRq::= SEQUENCE { +debitPaymentFee PaymentFee, +nonce OCTET STRING, +keyRef INTEGER(0..255) +} +DebitRs ::= SEQUENCE { +debitResult ResultFin, +debitAuthenticator OCTET STRING +} +GetInstanceRq ::= SEQUENCE { +posOfFirstInstance INTEGER(0..255), -- position of first instance to be retrieved +posOfLastInstance INTEGER(0..255), -- position last instance to be retrieved +attributeIdList AttributeIdList -- Ids of attributes to be retrieved +} +GetInstanceRs{Container}::= SEQUENCE (SIZE (0..127,...)) OF SEQUENCE { +attributeId INTEGER(0..127,...), +-- number of instances retrieved +attributeValues Container (WITH COMPONENTS {octetstring PRESENT}) +-- The octetstring shall contain the contatenation of +-- the unaligned PER encodings of the values of the +-- instances, with each encoding padded to an integral +-- of octets as specified for a top-level type in +-- ISO/IEC 8825-2 +} +GetStampedRq::= SEQUENCE { +attributeIdList AttributeIdList, +nonce OCTET STRING, -- e.g. a random number +keyRef INTEGER(0..255) +} +GetStampedRs{Container}::= SEQUENCE { +attributeList AttributeList{Container}, +authenticator OCTET STRING +} +SetInstanceRq{Container} ::= SEQUENCE { +posOfInstance INTEGER(0..255), +attribute Attributes{Container} +} +SetMMIRq::= INTEGER { +ok (0), -- operation / transaction successfully completed +nok (1), -- operation / transaction not successfully completed +contactOperator (2), -- e.g. due to low balance or battery +noSignalling (255) -- no signalling +-- (3-127) are reserved for future CEN use +-- (128-254) are reserved for private use +} (0..255) +SetStampedRq{Container}::= SEQUENCE { +attributeList AttributeList{Container}, +nonce OCTET STRING, +keyRef INTEGER(0..255) +} +SubRq::= SEQUENCE { +attributeId INTEGER(0..127,...), +value INTEGER +} +-- NOTE: The following are the definitions of EFC attributes +CO2EmissionValue ::= Int2 +ContractSerialNumber ::= Int4 +ContractAuthenticator ::= OCTET STRING +ContractValidity ::= SEQUENCE { +contractRestrictions OCTET STRING (SIZE(4)), +contractExpiryDate DateCompact +} -- intended to support ISO/TR 1998 implemented systems +ContractVehicle ::= LPN +DateCompact::= SEQUENCE { +year INTEGER (1990..2117), +month INTEGER (0..12), -- Value zero shall not be used +-- except with 1990 - see below. +day INTEGER (0..31) -- Value zero shall not be used +-- except with 1990 � see below. +} +-- The value "{year 1990, month 0, day 0}" is a 16-bit all-zero +-- encoding, and is used to represent "no date". +DescriptiveCharacteristics ::= INTEGER { +noEntry (0), +vehicleShape1 (1), +vehicleShape2 (2), +vehicleShape3 (3), +vehicleShape4 (4), +vehicleShape5 (5), +vehicleShape6 (6), +vehicleShape7 (7), +vehicleShape8 (8), +vehicleShape9 (9), +vehicleShape10 (10), +vehicleShape11 (11), +vehicleShape12 (12), +vehicleShape13 (13), +vehicleShape14 (14), +vehicleShape15 (15), +vehicleShape16 (16), +vehicleShape17 (17), +vehicleShape18 (18), +vehicleShape19 (19), +vehicleShape20 (20), +vehicleShape21 (21), +vehicleShape22 (22), +vehicleShape23 (23), +vehicleShape24 (24), +vehicleShape25 (25), +vehicleShape26 (26), +vehicleShape27 (27), +vehicleShape28 (28), +vehicleShape29 (29), +vehicleShape30 (30), +vehicleShape31 (31), +vehicleShape32 (32), +vehicleShape33 (33), +vehicleShape34 (34), +vehicleShape35 (35), +vehicleShape36 (36), +vehicleShape37 (37), +vehicleShape38 (38), +vehicleShape39 (39), +vehicleShape40 (40), +vehicleShape41 (41), +vehicleShape42 (42), +vehicleShape43 (43), +vehicleShape44 (44), +vehicleShape45 (45), +vehicleShape46 (46), +vehicleShape47 (47), +vehicleShape48 (48), +vehicleShape49 (49), +vehicleShape50 (50) +-- (1..50) are reserved for future CEN use +-- (51..255) are reserved for private use +} (0..255) DieselEmissionValues::= SEQUENCE { particulate SEQUENCE { unitType UnitType, value INTEGER (0..32767) }, - absorptionCoeff Int2 +absorptionCoeff Int2 } +EFC-ContextMark ::= SEQUENCE { +contractProvider Provider, +typeOfContract OCTET STRING (SIZE(2)), +contextVersion INTEGER(0..127,...) } EnvironmentalCharacteristics::= SEQUENCE { @@ -64,10 +238,10 @@ EuroValue::= ENUMERATED { reservedForUse7 (13), reservedForUse8 (14), eev (15) -} -- 4 bits, EURO-Clases as defined in EC directive 88/77/EEC, annex 1 +} -- 4 bits, EURO-Classes as defined in EC directive 88/77/EEC, annex 1 -- and in 91/542/EEC, 96/1/EC, 1999/96/EC, 2001/27/EC, regulation No 595/2009 -- and for EEV in Section 6.2.1 of Annex I in EC directive 2005/55/EC - +-- EUR-Class VI as defined in Regulation (EC) No 595/2009 CopValue::= ENUMERATED { noEntry (0), co2class1 (1), -- below 101 g/km @@ -94,7 +268,12 @@ EngineCharacteristics::= INTEGER { hydrogen (9) -- (10-255) are reserved for future CEN use } (0..255) - +Engine ::= SEQUENCE{ +engineCapacity Int2, +enginePower Int2 +} +EquipmentOBUId ::= OCTET STRING +EquipmentStatus ::= BIT STRING (SIZE(16)) ExhaustEmissionValues ::= SEQUENCE { unitType UnitType, emissionCO INTEGER (0..32767), @@ -102,38 +281,343 @@ ExhaustEmissionValues ::= SEQUENCE { emissionNOX Int2, emissionHCNOX Int2 } - - +FutureCharacteristics ::= INTEGER { +noEntry (0), +airSuspension (1) +-- (2..255) are reserved for future CEN use +} (0..255) +ICC-Id ::= OCTET STRING Int1 ::= INTEGER(0..255) Int2 ::= INTEGER(0..65535) - +Int3 ::= INTEGER(0..16777215) +Int4 ::= INTEGER(0..4294967295) +LPN::= SEQUENCE { +countryCode CountryCode, +alphabetIndicator ENUMERATED { +latinAlphabetNo1 (1), -- encoded as 00 00 00'B +latinAlphabetNo2 (2), -- encoded as 00 00 01'B etc +latinAlphabetNo3 (3), +latinAlphabetNo4 (4), +latinCyrillicAlphabet (5), +latinArabicAlphabet (6), +latinGreekAlphabet (7), +latinHebrewAlphabet (8), +latinAlphabetNo5 (9), +latinAlphabetNo6 (10), +twoOctetBMP (11), +fourOctetCanonical (12), +reservedForUse1 (13), +reservedForUse2 (14), +reservedForUse3 (15), +reservedForUse4 (16), +reservedForUse5 (17), +reservedForUse6 (18), +reservedForUse7 (19), +reservedForUse8 (20), +reservedForUse9 (21), +reservedForUse10 (22), +reservedForUse11 (23), +reservedForUse12 (24), +reservedForUse13 (25), +reservedForUse14 (26), +reservedForUse15 (27), +reservedForUse16 (28), +reservedForUse17 (29), +reservedForUse18 (30), +reservedForUse19 (31), +reservedForUse20 (32), +reservedForUse21 (33) +} -- 6 bits, latinAlphabetNo1 recommended -- , +-- refer to Annex E for conversion from LatinAlphabetNo 2 +-- and 5 to Latin AlphabetNo1 +licencePlateNumber OCTET STRING +} PassengerCapacity ::= SEQUENCE{ numberOfSeats Int1, numberOfStandingPlaces Int1 } +PaymentFee ::= SEQUENCE { +-- The fee (toll, charge or fare) which is requested by the +-- service provider for the service provided or to be provided. +paymentFeeAmount Int2, +-- paymentFeeAmount is the value of the fee being charged for the +-- service. If no unit (payment fee unit) is specified, then +-- it is known by default. +paymentFeeUnit PayUnit +-- paymentFeeUnit is the unit in which the fee is expressed. +} +PaymentMeans ::= SEQUENCE { +personalAccountNumber PersonalAccountNumber, +paymentMeansExpiryDate DateCompact, +pamentMeansUsageControl OCTET STRING(SIZE(2)) +-- issuer's specified restrictions, on the geographic usage +-- and services allowed for the applications +} +PaymentMeansBalance ::= SignedValue +SignedValue ::= CHOICE { +positive INTEGER (0..8388607), +negative INTEGER (-8388608..-1) +} +-- corresponds to a �3 octets Signed Integer�, associated with the following +-- examples of line codes: +-- -8'388'608 : 80 00 00'H +-- -1 : FF FF FF'H +-- 0 : 00 00 00'H +-- 1 : 00 00 01�H +-- 8'388'607 : 7F FF FF'H +PaymentMeansUnit ::= PayUnit +PaymentSecurityData ::= OCTET STRING +PayUnit ::= OCTET STRING (SIZE(2)) +-- The unique designation of a Currency as defined in ISO 4217 +-- using the ISO numeric binary coded decimal representation. +-- The code can also express a company specific token or a +-- "charging unit code" as used in the freight.unit in which +-- the fee is expressed. +-- Value Assignment : +-- '0xxx'H Currency in main units +-- '1xxx'H Currency in minor units of 10 :1 ('dime') +-- '2xxx'H Currency in minor units of 100 :1 ('cents') +-- '3xxx'H Currency in minor units of 1000 :1 +-- '4xxx'H Currency in 'major' units / 10 +-- (e.g. 10 Belgian Francs) +-- '5xxx'H Currency in 'major' units / 100 +-- (e.g. 100 Italian Lire) +-- '6xxx'H Currency in 'major' units / 1000 +-- '7xxx'H Currency in 'major' units / 10000 +-- '8xxx'H Currency in 'major' units / 100000 +-- where xxx is the BCD representation of "Currency" +-- as defined in ISO 4217 +-- '9xxx'H Tokens +-- where xxx is Purse Provider specific coding. +-- 'Axxx'H Charging Unit Codes, +-- denoting quantification of the service provided +-- (e.g. man-hours) +PersonalAccountNumber ::= OCTET STRING (SIZE(10)) +-- Personal account number structure � according to ISO/IEC 7812-1 +-- Issuer identifier number (�BIN�) +-- Major industry identifier (MII, 1 binary coded decimal, BCD) +-- 0 : reserved for future use by ISO/TC68 +-- 1 : airline sector +-- 2 : extended airline sector +-- 3 : travel and tourism sector +-- 4 : financial banking sector +-- 5 : financial banking sector +-- 6 : commerce and banking sector +-- 7 : petrol industry sector +-- 8 : telecommunication sector +-- 9 : reserved for national use +-- Issuer identifier (5 BCD in the second edition of ISO/IEC 7812-1) +-- Account number (max 12 BCD) +-- Control digit (1 BCD) +-- Padding bits, set to 1'B, in order to accomplish a +-- total length of 10 octets. Provider ::= SEQUENCE { countryCode CountryCode, - providerIdentifier AVIAEIIssuerIdentifier +providerIdentifier AVIAEIIssuerIdentifier +} +PurseBalance ::= SEQUENCE { +-- The balance on the (electronic) purse, consisting of +-- the value and the unit in which it is expressed. +purseValue SignedValue, +-- The size of a balance expressed in a currency. +-- This may be positive or negative. +purseUnit PayUnit +} +ReceiptContract ::= SEQUENCE { +sessionContractProvider Provider, +sessionTypeOfContract OCTET STRING(SIZE(2)), +sessionContractSerialNumber Int4 +} +ReceiptData1 ::= ReceiptData +ReceiptData2 ::= ReceiptData +ReceiptData ::= SEQUENCE { +sessionTime DateAndTime, +sessionServiceProvider Provider, +locationOfStation Int2, +sessionLocation SessionLocation, +sessionType Int1, +sessionResult ResultOp, +sessionTariffClass Int1, +sessionClaimedClass Int1, +sessionFee PaymentFee, +sessionContractProvider Provider, +sessionTypeOfContract OCTET STRING (SIZE(2)), +sessionContextVersion INTEGER (0..127,...), +receiptDataAuthenticator OCTET STRING(SIZE(4)) +} +ReceiptDistance ::= Int3 +ReceiptFinancialPart ::= SEQUENCE { +personalAccountNumber PersonalAccountNumber, +sessionPaymentFee PaymentFee, +sessionCurrentBalance PurseBalance, +receiptFinancialSerialNumber Int4 +} +ReceiptICC-Id ::= ICC-Id +ReceiptOBUId ::= OCTET STRING +ReceiptServicePart ::= SEQUENCE { +sessionTime DateAndTime, +sessionServiceProvider Provider, +stationLocation INTEGER(0..1048575), +sessionLocation BIT STRING (SIZE(8)), +typeOfSession EFC-StationType, +sessionResultOperational ResultOp, +sessionResultFinancial ResultFin +} +ReceiptServiceSerialNumber ::= Int3 +ReceiptAuthenticator ::= OCTET STRING +ReceiptText ::= OCTET STRING +ResultFin ::= OCTET STRING (SIZE(1)) +-- A code designating whether a card transaction was completed successfully +-- or not. Value Assignment : Hexadecimal +-- Most significant 4 bits: 0 OK : +-- '0x'H OK +-- Most significant 4 bits > 0 Not OK : +-- '1x'H Not OK, not specified further +-- '2x'H Not OK, Abnormal (First or Previous) Event +-- '3x'H Not OK, Contract not accepted +-- '4x'H Not OK, Account or Purse not accepted +-- 'x0'H not specified further +-- 'x1'H Balance close to zero +-- 'x2'H Balance now negative +-- 'x3'H Balance Overflow +-- 'x4'H Provider not accepted +-- 'x5'H Authentication failure +-- x6'H Vehicle Class incorrect +ResultOp ::= INTEGER { +correctTransaction (0), -- transaction correct +obeStatusNotAccepted (1), +equipmentStatusNotAccepted (2), +contractNotInWhiteList (3), +-- VST contract data not in white list +contractIdentifierInBlackList (4), +contractIdentifierNotCorrect (5), +-- Luhn algorithm verification failure +expiredContract (6), -- contract expired +contractRestrictionsNotFulfilled (7), +claimedVehicleCharacteristicsNotValid (8), +vehicleClassAuthenticationFailed (9), +entryVehicleClassDifferentFromExitVehicleClass (10), +entryReceiptMissing (11), +entryReceiptNotValid (12), +entryTollStationNotValid (13), +equipmentNotCertified (14), +-- manufacturer or EquipClass not recognised +timeDifference (15), +-- problem with the time diff of the two latest receipts +accessCredentialsNotAccepted (16), +contractAuthenticatorNotAccepted (17), +receiptAuthenticatorNotAccepted (18), +claimedVehicleCharacteristicsMissing (19), +paymentMeansNotAccepted (20), +paymentAuthenticatorNotAccepted (21), +paymentMeansInBlackList (22), +paymentMeansNotCorrect (23), +-- Luhn algorithm verification failure +expiredPaymentMeans (24), +-- PaymentMeans expired +paymentMeansRestrictionsNotFulfilled (25) +-- (26-255) are reserved for future CEN use +} (0..255) +SessionClass ::= SEQUENCE { +sessionTariffClass Int1, +sessionClaimedClass Int1 +} +SessionLocation ::= SEQUENCE { +ascendingKilometrage BOOLEAN, -- travel direction indicator +laneCodeNumber INTEGER(0..127) -- lane code number +} +EFC-StationType ::= ENUMERATED { +unspecified (0), +closedEntryWithPayment (1), +closedEntryWithoutPayment (2), +closedTransit (3), +closedExit (4), +closedCredit (5), +mixed (6), +passage (7), -- open exit +checkpoint (8), +reload (9), +reservedForFutureCENUse1 (10), +reservedForFutureCENUse2 (11), +reservedForFutureCENUse3 (12), +reservedForFutureCENUse4 (13), +privateUse5 (14), +privateUse6 (15) +} +DateAndTime ::= SEQUENCE { +timeDate DateCompact, +timeCompact SEQUENCE { -- expresses time of the day in hours, min, and sec +hours INTEGER (0..23), -- number of hours after midnight +mins INTEGER (0..59), -- number of minutes after the hour +double-secs INTEGER (0..30) -- number of two-seconds after the minute +} +-- Midnight at the start of a day cannot be represented. +-- Midnight at the end of a day is represented by +-- {hours 23, mins 59, double-secs 30} +-- The 16 bit zero value {hours 0, mins 0, double-secs 0} +-- denotes "no time" } SoundLevel ::= SEQUENCE{ soundstationary Int1, sounddriveby Int1 } - +TrailerDetails::= SEQUENCE { +trailerType INTEGER{ +notPresent (0), -- trailer not attached or only one trailer attached, see +-- VehicleAxlesNumber for more information +trailer (1), -- also known as pull-bar trailer +semitrailer (2) -- also known as articulate trailer +-- (3..31) reserved for future CEN/ISO use +} (0..31), +trailerAxles TrailerAxles +} +TrailerLicencePlateNumber ::= LPN UnitType::= ENUMERATED { mg-km (0), mg-kWh (1) } - +ValidityOfContract ::= SEQUENCE { +issuerRestrictions OCTET STRING (SIZE(2)), +contractExpiryDate DateCompact +} +VehicleAuthenticator ::= OCTET STRING +VehicleAxles ::= SEQUENCE { +vehicleFirstAxleHeight Int1, +vehicleAxlesNumber SEQUENCE { +tyreType ENUMERATED{ +notSpecified (0), +singleTyre (1), -- single tyre on all axles +dualTyres (2), -- dual tyres on at least one axle +reservedForUse (3) -- reserved for future CEN use +}, +numberOfAxles SEQUENCE { +trailerAxles TrailerAxles, +tractorAxles TractorAxles +} +} +} +TrailerAxles ::= INTEGER (0..7) -- number of axles of the trailer when available +TractorAxles ::= INTEGER (0..7) -- number of axles of the tractor +VehicleClass ::= Int1 VehicleDimensions ::= SEQUENCE { vehicleLengthOverall Int1, vehicleHeigthOverall Int1, vehicleWidthOverall Int1 } - +VehicleLicencePlateNumber ::= LPN +VehicleIdentificationNumber ::= CS5 +VehicleSpecificCharacteristics ::= SEQUENCE { +environmentalCharacteristics EnvironmentalCharacteristics, +engineCharacteristics EngineCharacteristics, +descriptiveCharacteristics DescriptiveCharacteristics, +futureCharacteristics FutureCharacteristics +} +VehicleTotalDistance ::= Int4 +VehicleWeightLaden ::= Int2 +VehicleCurrentMaxTrainWeight ::= Int2 VehicleWeightLimits ::= SEQUENCE { vehicleMaxLadenWeight Int2, vehicleTrainMaximumWeight Int2, diff --git a/asn1/IS/ISO_TS_14906/EfcDsrcGeneric.asn b/asn1/IS/ISO_TS_14906/EfcDsrcGeneric.asn index d2d1e619..610bb4f8 100644 --- a/asn1/IS/ISO_TS_14906/EfcDsrcGeneric.asn +++ b/asn1/IS/ISO_TS_14906/EfcDsrcGeneric.asn @@ -1,20 +1,18 @@ -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- ISO TS 14906 Generic -- --- This ASN.1 was generateds: 30.08.2016 +-- This ASN.1 was generated: 30.08.2016 -- -- This document contains only the data element needed for the encoding of an IVI message --- as defined in ISO TS 19321(2015) +-- as defined in ISO TS 19321(2020) -- -- Published version location: --- http://standards.iso.org/iso/14906 +-- https://standards.iso.org/iso/14906/ed-3/en/ISO14906(2018)EfcDsrcGenericv7.asn -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -EfcDsrcGeneric { iso(1) standard(0) 14906 generic(1) version5(5) } - -DEFINITIONS AUTOMATIC TAGS ::= BEGIN -EXPORTS ALL; -IMPORTS; +EfcDsrcGeneric {iso(1) standard(0) 14906 generic(1) version7(7)} +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN AttributeIdList ::= SEQUENCE (SIZE(0.. 127,...)) OF INTEGER(0..127,...) diff --git a/asn1/IS/ISO_TS_19321/IVI.asn b/asn1/IS/ISO_TS_19321/IVI.asn index 0299d718..4dccc9b1 100644 --- a/asn1/IS/ISO_TS_19321/IVI.asn +++ b/asn1/IS/ISO_TS_19321/IVI.asn @@ -10,16 +10,16 @@ -- http://standards.iso.org/iso/ts/19321 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -IVI {iso (1) standard (0) ivi (19321) version1 (1)} +IVI {iso (1) standard (0) ivi (19321) version2 (2)} DEFINITIONS AUTOMATIC TAGS ::= BEGIN IMPORTS ItsPduHeader, Altitude, DangerousGoodsBasic , DeltaLatitude, DeltaLongitude, DeltaReferencePosition, Heading, HeadingValue, Latitude, LanePosition, Longitude, ReferencePosition, RoadType, SpecialTransportType, Speed, StationType, TimestampIts, VehicleRole -FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) } +FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) } AxleWeightLimits, DieselEmissionValues, ExhaustEmissionValues, EngineCharacteristics, EnvironmentalCharacteristics, PassengerCapacity , Provider, SoundLevel, VehicleDimensions, VehicleWeightLimits -FROM EfcDsrcApplication {iso(1) standard(0) 14906 application(0) version5(5)} +FROM EfcDsrcApplication {iso(1) standard(0) 14906 application(0) version6(6)} EuVehicleCategoryCode, Iso3833VehicleType FROM ElectronicRegistrationIdentificationVehicleDataModule {iso(1) standard(0) iso24534 (24534) vehicleData (1) version1 (1)} diff --git a/asn1/IS/ISO_TS_24534-3/ElectronicRegistrationIdentificationVehicleDataModule.asn b/asn1/IS/ISO_TS_24534-3/ElectronicRegistrationIdentificationVehicleDataModule.asn index d097fd7c..1d5d8855 100644 --- a/asn1/IS/ISO_TS_24534-3/ElectronicRegistrationIdentificationVehicleDataModule.asn +++ b/asn1/IS/ISO_TS_24534-3/ElectronicRegistrationIdentificationVehicleDataModule.asn @@ -4,10 +4,10 @@ -- This ASN.1 was generateds: 30.08.2016 -- -- This document contains only the data element needed for the encoding of an IVI message --- as defined in ISO TS 19321(2015) +-- as defined in ISO TS 19321(2020) -- -- Published version location: --- http://standards.iso.org/iso/24534/-3/ +-- https://standards.iso.org/iso/24534/-3/ISO%2024534-3%20ASN.1%20repository/ -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- ISO 24534-3:2015 @@ -18,7 +18,6 @@ ElectronicRegistrationIdentificationVehicleDataModule {iso(1) standard(0) iso245 DEFINITIONS AUTOMATIC TAGS ::= BEGIN -IMPORTS; -- Electronic Registration Identification (ERI)- Vehicle Data -- GitLab From 5d290dcc204ab8dd4bae235df4e554d1ffd1ab1e Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Wed, 26 Aug 2020 08:45:44 +0200 Subject: [PATCH 260/320] Add GDD ASN.1 module in libasn1c --- asn1/IS/ISO_TS_14823/GDD.asn | 64 ++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/asn1/IS/ISO_TS_14823/GDD.asn b/asn1/IS/ISO_TS_14823/GDD.asn index 60db2d49..229bbe44 100644 --- a/asn1/IS/ISO_TS_14823/GDD.asn +++ b/asn1/IS/ISO_TS_14823/GDD.asn @@ -54,16 +54,16 @@ InternationalSign-applicablePeriod::= SEQUENCE { yearRangeEndYear INTEGER(2000..2127,...) } OPTIONAL, month-day SEQUENCE { -- contains dateRangeStartMonth&Date and dateRangeEndMonth&Date - dateRangeStartMonthDay MonthDay, - dateRangeEndMonthDay MonthDay + dateRangeStartGDD-MonthDay GDD-MonthDay, + dateRangeEndGDD-MonthDay GDD-MonthDay } OPTIONAL, repeatingPeriodDayTypes RepeatingPeriodDayTypes OPTIONAL, hourMinutes SEQUENCE { -- contains timeRangeStartTime and timeRangeEndTime - timeRangeStartTime HoursMinutes, - timeRangeEndTime HoursMinutes + timeRangeStartTime GDD-HoursMinutes, + timeRangeEndTime GDD-HoursMinutes } OPTIONAL, - dateRangeOfWeek DayOfWeek OPTIONAL, - durationHourMinute HoursMinutes OPTIONAL + dateRangeOfWeek GDD-DayOfWeek OPTIONAL, + durationHourMinute GDD-HoursMinutes OPTIONAL } InternationalSign-exemptedApplicablePeriod::= InternationalSign-applicablePeriod @@ -80,10 +80,10 @@ InternationalSign-directionalFlowOfLane::= INTEGER { } (1..8) InternationalSign-applicableVehicleDimensions::= SEQUENCE{ - vehicleHeight Distance OPTIONAL, - vehicleWidth Distance OPTIONAL, - vehicleLength Distance OPTIONAL, - vehicleWeight Weight OPTIONAL + vehicleHeight GDD-Distance OPTIONAL, + vehicleWidth GDD-Distance OPTIONAL, + vehicleLength GDD-Distance OPTIONAL, + vehicleGDD-Weight GDD-Weight OPTIONAL } InternationalSign-speedLimits::= SEQUENCE{ @@ -94,18 +94,18 @@ InternationalSign-speedLimits::= SEQUENCE{ InternationalSign-rateOfIncline::= INTEGER(1..32) -InternationalSign-distanceBetweenVehicles::= Distance +InternationalSign-distanceBetweenVehicles::= GDD-Distance InternationalSign-destinationInformation::= SEQUENCE{ junctionDirection INTEGER(1..128) OPTIONAL, roundaboutCwDirection INTEGER(1..128)OPTIONAL, roundaboutCcwDirection INTEGER(1..128)OPTIONAL, - ioList DDD-IO-LIST + ioList GDD-DDD-IO-LIST } InternationalSign-section::= SEQUENCE{ - startingPointLength Distance OPTIONAL, - continuityLength Distance OPTIONAL + startingPointLength GDD-Distance OPTIONAL, + continuityLength GDD-Distance OPTIONAL } InternationalSign-numberOfLane::= INTEGER(0..99) @@ -131,22 +131,22 @@ Code-Units::= INTEGER { -- value 15 reserved for future use } (0..15) -DayOfWeek::= BIT STRING {unused(0), monday(1), tuesday(2), wednesday(3), thursday(4), friday(5), saturday(6), sunday(7)} (SIZE (8)) +GDD-DayOfWeek::= BIT STRING {unused(0), monday(1), tuesday(2), wednesday(3), thursday(4), friday(5), saturday(6), sunday(7)} (SIZE (8)) -DDD-IO-LIST ::= SEQUENCE (SIZE (1..8,...)) OF DDD-IO +GDD-DDD-IO-LIST ::= SEQUENCE (SIZE (1..8,...)) OF GDD-DDD-IO -DDD-IO::= SEQUENCE{ +GDD-DDD-IO::= SEQUENCE{ arrowDirection INTEGER(0..7), - destPlace DestinationPlaces OPTIONAL, - destRoad DestinationRoads OPTIONAL, + destPlace GDD-DestinationPlaces OPTIONAL, + destRoad GDD-DestinationRoads OPTIONAL, roadNumberIdentifier INTEGER(1..999) OPTIONAL, streetName INTEGER(1..999) OPTIONAL, streetNameText UTF8String OPTIONAL, - distanceToDivergingPoint DistanceOrDuration OPTIONAL, - distanceToDestinationPlace DistanceOrDuration OPTIONAL + distanceToDivergingPoint GDD-DistanceOrDuration OPTIONAL, + distanceToGDD-DestinationPlace GDD-DistanceOrDuration OPTIONAL } -DestinationPlace::= SEQUENCE{ +GDD-DestinationPlace::= SEQUENCE{ destType DestinationType, destRSCode GddStructure (WITH COMPONENTS {..., attributes ABSENT}) OPTIONAL, destBlob OCTET STRING OPTIONAL, @@ -154,17 +154,17 @@ DestinationPlace::= SEQUENCE{ placeNameText UTF8String OPTIONAL } -DestinationPlaces ::= SEQUENCE (SIZE (1..4,...)) OF DestinationPlace +GDD-DestinationPlaces ::= SEQUENCE (SIZE (1..4,...)) OF GDD-DestinationPlace -DestinationRoad::= SEQUENCE{ - derType DestinationRoadType, +GDD-DestinationRoad::= SEQUENCE{ + derType GDD-DestinationRoadType, roadNumberIdentifier INTEGER(1..999) OPTIONAL, roadNumberText UTF8String OPTIONAL } -DestinationRoads ::= SEQUENCE (SIZE (1..4,...)) OF DestinationRoad +GDD-DestinationRoads ::= SEQUENCE (SIZE (1..4,...)) OF GDD-DestinationRoad -DestinationRoadType::= INTEGER { +GDD-DestinationRoadType::= INTEGER { none (0), nationalHighway (1), localHighway (2), @@ -202,29 +202,29 @@ DestinationType::= INTEGER { geographicArea (15) } (0..15, ...) -Distance::= SEQUENCE{ +GDD-Distance::= SEQUENCE{ value INTEGER(1..16384), unit Code-Units(2..4|6..8) } -DistanceOrDuration::= SEQUENCE { +GDD-DistanceOrDuration::= SEQUENCE { value INTEGER(1..16384), unit Code-Units (2..9) } -HoursMinutes::= SEQUENCE { +GDD-HoursMinutes::= SEQUENCE { hours INTEGER (0..23),-- number of hours after midnight mins INTEGER (0..59) -- number of minutes after the hour } -MonthDay::= SEQUENCE { +GDD-MonthDay::= SEQUENCE { month INTEGER (1..12), day INTEGER (1..31) } RepeatingPeriodDayTypes::= BIT STRING {national-holiday (0), even-days(1), odd-days(2), market-day(3) } (SIZE (4)) -Weight::= SEQUENCE { +GDD-Weight::= SEQUENCE { value INTEGER(1..16384), unit Code-Units (10..12) } -- GitLab From 2e91342b50d743e7f34c716c1e57dfd16aa33c8c Mon Sep 17 00:00:00 2001 From: pintar Date: Fri, 28 Aug 2020 09:50:39 +0200 Subject: [PATCH 261/320] New MAPEM & SPATEM PICS added. --- ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn | 86 +++++++++++++++++++- 1 file changed, 85 insertions(+), 1 deletion(-) diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn index 2d8b9640..56ef2c0c 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn @@ -16,10 +16,22 @@ module LibItsMapemSpatem_Pics { /** * @desc Is the IUT running in secured mode? - * @see ETSI TS 103 191-1 Table A.1 + * @see ETSI TS 103 191-1 Table A.1.1 */ modulepar boolean PICS_IS_IUT_SECURED := false; + /** + * @desc Support for MAPEM reception + * @see ETSI TS 103 191-1 Table A.1.2 + */ + modulepar boolean PICS_ETSI_STRICT := false; + + /** + * @desc Support for MAPEM reception + * @see ETSI TS 103 191-1 Table A.1.3 + */ + modulepar boolean PICS_SHORT_RANGE := false; + /** * @desc Support for MAPEM generation * @see ETSI TS 103 191-1 Table A.2 @@ -32,6 +44,24 @@ module LibItsMapemSpatem_Pics { */ modulepar boolean PICS_MAPEM_RECEPTION := true; + /** + * @desc Support for MAPEM reception + * @see TODO + */ + modulepar boolean PICS_MAPEM_HAS_LANE_WIDTH := false; + + /** + * @desc Support for MAPEM reception + * @see TODO + */ + modulepar boolean PICS_MAPEM_TRANSMISSION_RATE := false; + + /** + * @desc Support for MAPEM reception + * @see TODO + */ + modulepar boolean PICS_SPECIALIZED_CARS_MANOEUVRES := false; + /** * @desc Support for SPATEM generation * @see ETSI TS 103 191-1 Table A.2 @@ -44,4 +74,58 @@ module LibItsMapemSpatem_Pics { */ modulepar boolean PICS_SPATEM_RECEPTION := true; + /** + * @desc Support for SPATEM reception + * @see TODO + */ + modulepar boolean PICS_SPATEM_PEDESTRIAN_MANOEUVRES := false; + + /** + * @desc Support for SPATEM reception + * @see TODO + */ + modulepar boolean PICS_SPATEM_SPECIALIZED_MANOEUVRES := false; + + /** + * @desc Support for SPATEM reception + * @see TODO + */ + modulepar boolean PICS_SPATEM_HAS_TIMING := false; + + /** + * @desc Support for SPATEM reception + * @see TODO + */ + modulepar boolean PICS_SPATEM_PRIORITIZATION := false; + + /** + * @desc Support for SPATEM reception + * @see TODO + */ + modulepar boolean PICS_SPATEM_PEDESTRIAN_MAOEUVRES := false; + + /** + * @desc Support for SPATEM reception + * @see TODO + */ + modulepar boolean PICS_SPATEM_HAS_OPTIMAL_SPEED := false; + + /** + * @desc Support for SPATEM reception + * @see TODO + */ + modulepar boolean PICS_SPATEM_HAS_SIGNAL_PROGRESSION_SPEED := false; + + /** + * @desc Support for SPATEM reception + * @see TODO + */ + modulepar boolean PICS_SPATEM_HAS_EGRESS_QUEUE := false; + + /** + * @desc Support for SPATEM reception + * @see TODO + */ + modulepar boolean PICS_SPATEM_TRANSMISSION_RATE := false; + } // end LibItsSremSsem_Pics -- GitLab From afdbfe748fb35247d41944bfdebd9c8a50980dc5 Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Mon, 31 Aug 2020 15:04:49 +0200 Subject: [PATCH 262/320] Remove duplicate types from IVI, Editorial update of IVI --- asn1/IS/ISO_TS_14823/GDD.asn | 128 +++++------------------------------ asn1/IS/ISO_TS_19321/IVI.asn | 22 +++--- 2 files changed, 31 insertions(+), 119 deletions(-) diff --git a/asn1/IS/ISO_TS_14823/GDD.asn b/asn1/IS/ISO_TS_14823/GDD.asn index 229bbe44..681858c1 100644 --- a/asn1/IS/ISO_TS_14823/GDD.asn +++ b/asn1/IS/ISO_TS_14823/GDD.asn @@ -15,6 +15,10 @@ GDD {iso (1) standard (0) gdd(14823) version1 (0)} DEFINITIONS AUTOMATIC TAGS::= BEGIN +IMPORTS +Distance, DistanceOrDuration, DestinationPlace, DestinationPlaces, DestinationRoad, DestinationRoads, MonthDay, HoursMinutes, DayOfWeek, Weight, DDD-IO, DDD-IO-LIST +FROM IVI {iso (1) standard (0) ivi (19321) version2 (2)}; + --Definition of GDD Structure GddStructure::= SEQUENCE{ @@ -54,16 +58,16 @@ InternationalSign-applicablePeriod::= SEQUENCE { yearRangeEndYear INTEGER(2000..2127,...) } OPTIONAL, month-day SEQUENCE { -- contains dateRangeStartMonth&Date and dateRangeEndMonth&Date - dateRangeStartGDD-MonthDay GDD-MonthDay, - dateRangeEndGDD-MonthDay GDD-MonthDay + dateRangeStartMonthDay MonthDay, + dateRangeEndMonthDay MonthDay } OPTIONAL, repeatingPeriodDayTypes RepeatingPeriodDayTypes OPTIONAL, hourMinutes SEQUENCE { -- contains timeRangeStartTime and timeRangeEndTime - timeRangeStartTime GDD-HoursMinutes, - timeRangeEndTime GDD-HoursMinutes + timeRangeStartTime HoursMinutes, + timeRangeEndTime HoursMinutes } OPTIONAL, - dateRangeOfWeek GDD-DayOfWeek OPTIONAL, - durationHourMinute GDD-HoursMinutes OPTIONAL + dateRangeOfWeek DayOfWeek OPTIONAL, + durationHourMinute HoursMinutes OPTIONAL } InternationalSign-exemptedApplicablePeriod::= InternationalSign-applicablePeriod @@ -80,10 +84,10 @@ InternationalSign-directionalFlowOfLane::= INTEGER { } (1..8) InternationalSign-applicableVehicleDimensions::= SEQUENCE{ - vehicleHeight GDD-Distance OPTIONAL, - vehicleWidth GDD-Distance OPTIONAL, - vehicleLength GDD-Distance OPTIONAL, - vehicleGDD-Weight GDD-Weight OPTIONAL + vehicleHeight Distance OPTIONAL, + vehicleWidth Distance OPTIONAL, + vehicleLength Distance OPTIONAL, + vehicleWeight Weight OPTIONAL } InternationalSign-speedLimits::= SEQUENCE{ @@ -94,18 +98,18 @@ InternationalSign-speedLimits::= SEQUENCE{ InternationalSign-rateOfIncline::= INTEGER(1..32) -InternationalSign-distanceBetweenVehicles::= GDD-Distance +InternationalSign-distanceBetweenVehicles::= Distance InternationalSign-destinationInformation::= SEQUENCE{ junctionDirection INTEGER(1..128) OPTIONAL, roundaboutCwDirection INTEGER(1..128)OPTIONAL, roundaboutCcwDirection INTEGER(1..128)OPTIONAL, - ioList GDD-DDD-IO-LIST + ioList DDD-IO-LIST } InternationalSign-section::= SEQUENCE{ - startingPointLength GDD-Distance OPTIONAL, - continuityLength GDD-Distance OPTIONAL + startingPointLength Distance OPTIONAL, + continuityLength Distance OPTIONAL } InternationalSign-numberOfLane::= INTEGER(0..99) @@ -131,102 +135,6 @@ Code-Units::= INTEGER { -- value 15 reserved for future use } (0..15) -GDD-DayOfWeek::= BIT STRING {unused(0), monday(1), tuesday(2), wednesday(3), thursday(4), friday(5), saturday(6), sunday(7)} (SIZE (8)) - -GDD-DDD-IO-LIST ::= SEQUENCE (SIZE (1..8,...)) OF GDD-DDD-IO - -GDD-DDD-IO::= SEQUENCE{ - arrowDirection INTEGER(0..7), - destPlace GDD-DestinationPlaces OPTIONAL, - destRoad GDD-DestinationRoads OPTIONAL, - roadNumberIdentifier INTEGER(1..999) OPTIONAL, - streetName INTEGER(1..999) OPTIONAL, - streetNameText UTF8String OPTIONAL, - distanceToDivergingPoint GDD-DistanceOrDuration OPTIONAL, - distanceToGDD-DestinationPlace GDD-DistanceOrDuration OPTIONAL - } - -GDD-DestinationPlace::= SEQUENCE{ - destType DestinationType, - destRSCode GddStructure (WITH COMPONENTS {..., attributes ABSENT}) OPTIONAL, - destBlob OCTET STRING OPTIONAL, - placeNameIdentification INTEGER(1..999) OPTIONAL, - placeNameText UTF8String OPTIONAL - } - -GDD-DestinationPlaces ::= SEQUENCE (SIZE (1..4,...)) OF GDD-DestinationPlace - -GDD-DestinationRoad::= SEQUENCE{ - derType GDD-DestinationRoadType, - roadNumberIdentifier INTEGER(1..999) OPTIONAL, - roadNumberText UTF8String OPTIONAL - } - -GDD-DestinationRoads ::= SEQUENCE (SIZE (1..4,...)) OF GDD-DestinationRoad - -GDD-DestinationRoadType::= INTEGER { - none (0), - nationalHighway (1), - localHighway (2), - tollExpresswayMotorway (3), - internationalHighway (4), - highway (5), - expressway (6), - nationalRoad (7), - regionalProvincialRoad (8), - localRoad (9), - motorwayJunction (10), - diversion (11), - rfu1 (12), - rfu2 (13), - rfu3 (14), - rfu4 (15) - } (0..15, ...) - -DestinationType::= INTEGER { - none (0), - importantArea (1), - principalArea (2), - generalArea (3), - wellKnownPoint (4), - country (5), - city (6), - street (7), - industrialArea (8), - historicArea (9), - touristicArea (10), - culturalArea (11), - touristicRoute (12), - recommendedRoute (13), - touristicAttraction (14), - geographicArea (15) - } (0..15, ...) - -GDD-Distance::= SEQUENCE{ - value INTEGER(1..16384), - unit Code-Units(2..4|6..8) - } - -GDD-DistanceOrDuration::= SEQUENCE { - value INTEGER(1..16384), - unit Code-Units (2..9) - } - -GDD-HoursMinutes::= SEQUENCE { - hours INTEGER (0..23),-- number of hours after midnight - mins INTEGER (0..59) -- number of minutes after the hour - } - -GDD-MonthDay::= SEQUENCE { - month INTEGER (1..12), - day INTEGER (1..31) - } - RepeatingPeriodDayTypes::= BIT STRING {national-holiday (0), even-days(1), odd-days(2), market-day(3) } (SIZE (4)) -GDD-Weight::= SEQUENCE { - value INTEGER(1..16384), - unit Code-Units (10..12) - } - END diff --git a/asn1/IS/ISO_TS_19321/IVI.asn b/asn1/IS/ISO_TS_19321/IVI.asn index 4dccc9b1..21cb22f1 100644 --- a/asn1/IS/ISO_TS_19321/IVI.asn +++ b/asn1/IS/ISO_TS_19321/IVI.asn @@ -556,15 +556,17 @@ DDD::= SEQUENCE{ } -- changes: from DDD_IO to DDD-IO DDD-IO::= SEQUENCE{ - drn INTEGER(0..7), - dp SEQUENCE (SIZE (1..4,...)) OF DestinationPlace OPTIONAL, - dr SEQUENCE (SIZE (1..4,...)) OF DestinationRoad OPTIONAL, - rne INTEGER(1..999) OPTIONAL, - stnId INTEGER(1..999) OPTIONAL, - stnText UTF8String OPTIONAL, - dcp DistanceOrDuration OPTIONAL, - ddp DistanceOrDuration OPTIONAL + arrowDirection INTEGER(0..7), + destPlace DestinationPlaces OPTIONAL, + destRoad DestinationRoads OPTIONAL, + roadNumberIdentifier INTEGER(1..999) OPTIONAL, + streetName INTEGER(1..999) OPTIONAL, + streetNameText UTF8String OPTIONAL, + distanceToDivergingPoint DistanceOrDuration OPTIONAL, + distanceToDestinationPlace DistanceOrDuration OPTIONAL } +DDD-IO-LIST ::= SEQUENCE (SIZE (1..8,...)) OF DDD-IO + -- changes: from DDD_DEP to DDD-DEP DestinationPlace::= SEQUENCE{ depType DDD-DEP, @@ -574,13 +576,15 @@ DestinationPlace::= SEQUENCE{ depBlob OCTET STRING OPTIONAL, plnId INTEGER(1..999) OPTIONAL, plnText UTF8String OPTIONAL - } + } +DestinationPlaces ::= SEQUENCE (SIZE (1..4,...)) OF DestinationPlace -- changes: from DDD_DER to DDD-DER DestinationRoad::=SEQUENCE{ derType DDD-DER, ronId INTEGER(1..999) OPTIONAL, ronText UTF8String OPTIONAL } +DestinationRoads ::= SEQUENCE (SIZE (1..4,...)) OF DestinationRoad -- changes: from DDD_DER to DDD-DER DDD-DER::= INTEGER { none (0), -- GitLab From 4f86f098be02362e09674a86387bb8ced00a767f Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 1 Sep 2020 17:44:50 +0200 Subject: [PATCH 263/320] Start implementation of TCs for TLC --- ttcn/SremSsem/LibItsSremSsem_Pics.ttcn | 12 +++++ ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn | 2 +- ttcn/SremSsem/LibItsSremSsem_Templates.ttcn | 59 ++++++++++++++++++--- 3 files changed, 66 insertions(+), 7 deletions(-) diff --git a/ttcn/SremSsem/LibItsSremSsem_Pics.ttcn b/ttcn/SremSsem/LibItsSremSsem_Pics.ttcn index b2438a5d..bde4e249 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Pics.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Pics.ttcn @@ -44,4 +44,16 @@ module LibItsSremSsem_Pics { */ modulepar boolean PICS_SSEM_RECEPTION := true; + /** + * @desc Support for public transport vehicle + * @see ETSI TS 103 191-1 Table TODO + */ + modulepar boolean PICS_PUBLIC_TRANSPORT := true; + + /** + * @desc Support for TODO + * @see ETSI TS 103 191-1 Table TODO + */ + modulepar boolean PICS_SREM_HAS_TIMING := true; + } // end LibItsSremSsem_Pics diff --git a/ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn b/ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn index 00f03ddf..c630d0b0 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn @@ -22,7 +22,7 @@ module LibItsSremSsem_Pixits { import from LibItsSremSsem_TypesAndValues all; /** - * @desc MsgCount for MAPEM sending + * @desc MsgCount for SREM sending * @see ETSI TS 103 191-3 Table B.9 */ modulepar BasicVehicleRole PX_BASICVEHICLEROLE := emergency; diff --git a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn index c32c4e69..349c3bfa 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn @@ -467,23 +467,70 @@ module LibItsSremSsem_Templates { requests := *, requestor := ?, regional := * - } + } // End of template mw_defaultSrem /** * @desc Receive template for SREM Message with no LayerType */ - template (present) SignalRequestMessage mw_sremWellFormatted modifies mw_defaultSrem := { - } + template (present) SignalRequestMessage mw_sremWellFormatted( + template (present) RequestorDescription p_requestor := ?, + template MinuteOfTheYear p_timeStamp := *, + template DSecond p_second := * + ) modifies mw_defaultSrem := { + timeStamp := p_timeStamp, + second := p_second, + requestor := p_requestor + } // End of template mw_sremWellFormatted template (present) SignalRequestMessage mw_srem_sequenceNumber( - in MsgCount p_sequenceNumber + template (present) MsgCount p_sequenceNumber := ? ) - modifies mw_sremWellFormatted := { + modifies mw_defaultSrem := { sequenceNumber := p_sequenceNumber - } + } // End of template mw_srem_sequenceNumber } // End of group sremTemplatesRecv + template (present) RequestorDescription mw_requestorDescription( + template (present) VehicleID p_id := ?, + template RequestorType p_type := *, + template RequestorPositionVector p_position := *, + template TransitVehicleStatus p_transitStatus := *, + template TransitVehicleOccupancy p_transitOccupancy := *, + template DeltaTime p_transitSchedule := * + ) := { + id := p_id, // The ID used in the BSM or CAM of the requestor + type_ := p_type, // Information regarding all type and class data about the requesting vehicle + position := p_position, // The location of the requesting vehicle + name := *, // A human readable name for debugging use + routeName := *, // A string for transit operations use + transitStatus := p_transitStatus, // current vehicle state (loading, etc.) + transitOccupancy := p_transitOccupancy, // current vehicle occupancy + transitSchedule := p_transitSchedule, // current vehicle schedule adherence + regional := * + } // End of template mw_requestorDescription + + template (present) RequestorPositionVector mw_requestor_position( + template (present) Position3D p_position := ? + ) := { + position := p_position, + heading := *, + speed := * + } // End of template mw_requestor_position + + template RequestorType mw_requestorType( + template (present) BasicVehicleRole p_role := ?, + template RequestSubRole p_subrole := *, + template RequestImportanceLevel p_request := * + ) := { + role := p_role, // Basic role of this user at this time + subrole := p_subrole, // A local list with role based items + request := p_request, // A local list with request items + iso3883 := *, + hpmsType := *, // HPMS classification types + regional := * + } // End of template mw_requestorType + } // End of group sremTemplates group ssemTemplates { -- GitLab From 4bec9668fd0075b8973872a2706563aaddc1a3a9 Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Wed, 2 Sep 2020 14:44:31 +0200 Subject: [PATCH 264/320] Add RTCMEM encoding --- .../LibItsCommon_ASN1_NamedNumbers.ttcn | 2 +- .../LibItsRtcmem_EncdecDeclarations.ttcn | 43 +++++++++++++++++++ ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn | 2 +- 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 ttcn/Rtcmem/LibItsRtcmem_EncdecDeclarations.ttcn diff --git a/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn b/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn index 4b666de2..16c2cc71 100644 --- a/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn +++ b/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn @@ -57,7 +57,7 @@ module LibItsCommon_ASN1_NamedNumbers { const ItsPduHeader.messageID ItsPduHeader_messageID_ssem_ := 10; const ItsPduHeader.messageID ItsPduHeader_messageID_evcsn_ := 11; const ItsPduHeader.messageID ItsPduHeader_messageID_saem_ := 12; - const ItsPduHeader.messageID ItsPduHeader_messageID_rtcem_ := 13; + const ItsPduHeader.messageID ItsPduHeader_messageID_rtcmem_ := 13; const LongitudinalAccelerationValue LongitudinalAccelerationValue_unavailable_ := 161; diff --git a/ttcn/Rtcmem/LibItsRtcmem_EncdecDeclarations.ttcn b/ttcn/Rtcmem/LibItsRtcmem_EncdecDeclarations.ttcn new file mode 100644 index 00000000..3573ca22 --- /dev/null +++ b/ttcn/Rtcmem/LibItsRtcmem_EncdecDeclarations.ttcn @@ -0,0 +1,43 @@ +module LibItsRtcmem_EncdecDeclarations { + + // LibIts + import from RTCMEM_PDU_Descriptions language "ASN.1:1997" all; + + // LibItsRtcmem + import from LibItsRtcmem_TypesAndValues all; + import from LibItsRtcmem_TestSystem all; + + external function fx_enc_RtcmemReq (RtcmemReq p) return bitstring + with {extension "prototype(convert) encode(LibIts_Interface)"} + + external function fx_dec_RtcmemReq (inout bitstring b, out RtcmemReq p) return integer + with {extension "prototype(sliding) decode(LibIts_Interface)"} + + external function fx_dec_RtcmemInd (inout bitstring b, out RtcmemInd p) return integer + with {extension "prototype(sliding) decode(LibIts_Interface)"} + + external function fx_enc_RTCMEM (RTCMEM p) return bitstring + with {extension "prototype(convert) encode(PER)"} + + external function fx_dec_RTCMEM (inout bitstring b, out RTCMEM p) return integer + with {extension "prototype(sliding) decode(PER)"} + + external function fx_enc_UtRtcmemInitialize (UtRtcmemInitialize p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + + external function fx_enc_UtRtcmemTrigger (UtRtcmemTrigger p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + + external function fx_enc_UtRtcmemUpdate (UtRtcmemUpdate p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + + external function fx_enc_UtRtcmemTermination (UtRtcmemTermination p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + + external function fx_dec_UtRtcmemResults (inout bitstring b, out UtRtcmemResults p) return integer + with {extension "prototype(sliding) decode(UpperTester)"} + + external function fx_dec_UtRtcmemEventInd (inout bitstring b, out UtRtcmemEventInd p) return integer + with {extension "prototype(sliding) decode(UpperTester)"} + +} // End of module LibItsRtcmem_EncdecDeclarations diff --git a/ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn b/ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn index 3522d53e..fc67e98e 100644 --- a/ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn +++ b/ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn @@ -155,7 +155,7 @@ module LibItsRtcmem_Templates { template (value) RTCMEM m_rtcmemPdu( in template (value) RTCMcorrections p_rtcmc ) := { - header := m_itsPduHeader( - , - ,LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_rtcem_), + header := m_itsPduHeader( - , - ,LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_rtcmem_), rtcmc := p_rtcmc } -- GitLab From 5a7e5d2542b8e90582bc3e42d6b316a7669c09b3 Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 4 Sep 2020 11:08:14 +0200 Subject: [PATCH 265/320] Update implementation of TCs for TLC --- ttcn/SremSsem/LibItsSremSsem_Functions.ttcn | 32 +++- ttcn/SremSsem/LibItsSremSsem_Pics.ttcn | 12 ++ ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn | 5 +- ttcn/SremSsem/LibItsSremSsem_Templates.ttcn | 144 +++++++++++------- ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn | 6 +- .../LibItsSremSsem_TypesAndValues.ttcn | 24 ++- 6 files changed, 159 insertions(+), 64 deletions(-) diff --git a/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn b/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn index c1de03a4..8da3c896 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn @@ -125,6 +125,36 @@ module LibItsSremSsem_Functions { return; } + /** + * @desc Updates an event from the application layer + * @param p_event The event to trigger. + */ + function f_utCancelationEvent( + in template (value) UtSremCancelation p_event + ) runs on ItsSremSsem { + + utPort.send ( p_event ); + tc_wait.start; + alt { + [] utPort.receive ( UtSremResults: { utSremCancelationResult := true }) { + tc_wait.stop; + } + [] utPort.receive ( UtSremResults: { utSremCancelationResult := false }) { + tc_wait.stop; + f_selfOrClientSyncAndVerdict("SREM cancelation failed", e_error); + } + [] tc_wait.timeout { + log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } + + //activate sremSsemPort default alts + vc_sremSsemDefaultActive := true; + + return; + } + } // End of group utFuntions group adapterControl { @@ -333,7 +363,7 @@ module LibItsSremSsem_Functions { group sendFunctions { /** - * @desc Sends a IVI message + * @desc Sends a SSEM message * @param p_sendMsg The IVI message to send. * @param p_overrideSeqNo Overrides the sequence number with the stored one. */ diff --git a/ttcn/SremSsem/LibItsSremSsem_Pics.ttcn b/ttcn/SremSsem/LibItsSremSsem_Pics.ttcn index bde4e249..076b770b 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Pics.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Pics.ttcn @@ -26,6 +26,12 @@ module LibItsSremSsem_Pics { */ modulepar boolean PICS_SREM_GENERATION := true; + /** + * @desc Support for SREM cancelation + * @see ETSI TS 103 191-1 Table A.5 + */ + modulepar boolean PICS_SREM_CANCELATION := true; + /** * @desc Support for SREM reception * @see ETSI TS 103 191-1 Table A.5 @@ -44,6 +50,12 @@ module LibItsSremSsem_Pics { */ modulepar boolean PICS_SSEM_RECEPTION := true; + /** + * @desc Support for Short Range communication + * @see ETSI TS 103 191-1 Table A.5 + */ + modulepar boolean PICS_SHORT_RANGE := true; + /** * @desc Support for public transport vehicle * @see ETSI TS 103 191-1 Table TODO diff --git a/ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn b/ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn index c630d0b0..4d853bcb 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn @@ -17,6 +17,7 @@ module LibItsSremSsem_Pixits { // LibIts import from DSRC language "ASN.1:1997" all; + import from DSRC_REGION_noCircular language "ASN.1:1997" all; // LibItsSremSsem import from LibItsSremSsem_TypesAndValues all; @@ -31,7 +32,9 @@ module LibItsSremSsem_Pixits { * @desc Used by tester in SREM trigger request * @see ETSI TS 103 191-3 Table B.9 */ - modulepar RequestImportanceLevel PX_REQUESTIMPORTANCELEVEL := requestImportanceLevel13; + modulepar RequestImportanceLevel PX_REQUESTIMPORTANCELEVEL := requestImportanceLevel3; + + modulepar IntersectionID PX_INTERSECTION_ID := 123; /** * @desc Used by tester in SREM trigger request diff --git a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn index 349c3bfa..6167316d 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn @@ -110,7 +110,7 @@ module LibItsSremSsem_Templates { */ template (present) SremInd mw_sremIndWithSecurityParameters( template (present) SREM p_sremMsg, - template Bit256 p_ssp := *, + template Bit24 p_ssp := *, template UInt32 p_its_aid := * ) modifies mw_sremInd := { ssp := p_ssp, @@ -193,7 +193,7 @@ module LibItsSremSsem_Templates { */ template (present) SsemInd mw_ssemIndWithSecurityParameters( template (present) SSEM p_ssemMsg, - template Bit256 p_ssp := *, + template Bit24 p_ssp := *, template UInt32 p_its_aid := * ) modifies mw_ssemInd := { ssp := p_ssp, @@ -217,10 +217,12 @@ module LibItsSremSsem_Templates { */ template (value) UtSremTrigger m_utTriggerEvent( in template (value) BasicVehicleRole p_basicVehicleRole, - in template (value) RequestImportanceLevel p_requestImportanceLevel + in template (value) RequestImportanceLevel p_requestImportanceLevel, + in template (value) IntersectionID p_intersectionId ) := { basicVehicleRole := p_basicVehicleRole, - requestImportanceLevel := p_requestImportanceLevel + requestImportanceLevel := p_requestImportanceLevel, + intersectionId := p_intersectionId } template (value) UtSremUpdate m_utUpdateEvent( @@ -233,6 +235,12 @@ module LibItsSremSsem_Templates { requestImportanceLevel := p_requestImportanceLevel } + template (value) UtSremCancelation m_UtSremCancelationEvent( + in template (value) RequestID p_requestID + ) := { + requestID := p_requestID + } + } group sremSsemPduTemplates { @@ -366,6 +374,14 @@ module LibItsSremSsem_Templates { id := p_intersectionID // a unique mapping to the intersection in question within the above region of use } + template IntersectionReferenceID mw_intersectionReferenceID( + template (present) IntersectionID p_intersectionID := ?, + template RoadRegulatorID p_roadRegulatorID := * + ) := { + region := p_roadRegulatorID, // a globally unique regional assignment value typical assigned to a regional DOT authority the value zero shall be used for testing needs + id := p_intersectionID // a unique mapping to the intersection in question within the above region of use + } + group sremTemplates { group sremTemplatesSend { @@ -474,63 +490,85 @@ module LibItsSremSsem_Templates { */ template (present) SignalRequestMessage mw_sremWellFormatted( template (present) RequestorDescription p_requestor := ?, + template (present) SignalRequestList p_requests := ?, + template (present) MsgCount p_sequenceNumber := ?, template MinuteOfTheYear p_timeStamp := *, template DSecond p_second := * ) modifies mw_defaultSrem := { - timeStamp := p_timeStamp, - second := p_second, - requestor := p_requestor + timeStamp := p_timeStamp, + second := p_second, + sequenceNumber := p_sequenceNumber, + requests := p_requests, + requestor := p_requestor } // End of template mw_sremWellFormatted - template (present) SignalRequestMessage mw_srem_sequenceNumber( - template (present) MsgCount p_sequenceNumber := ? - ) - modifies mw_defaultSrem := { - sequenceNumber := p_sequenceNumber - } // End of template mw_srem_sequenceNumber + template (present) SignalRequestPackage mw_signalRequestPackage( + template (present) SignalRequest p_request := ? + ) := { + request := p_request, + minute := *, + second := *, + duration := *, + regional := * + } + + template SignalRequest mw_signalRequest( + template (present) IntersectionReferenceID p_id := ?, + template (present) RequestID p_requestID := ?, + template (present) PriorityRequestType p_requestType := priorityRequest, + template (present) IntersectionAccessPoint p_inBoundLane := ?, + template IntersectionAccessPoint p_outBoundLane := * + ) := { + id := p_id, + requestID := p_requestID, + requestType := p_requestType, + inBoundLane := p_inBoundLane, + outBoundLane := p_outBoundLane, + regional := * + } + + template (present) RequestorDescription mw_requestorDescription( + template (present) VehicleID p_id := ?, + template RequestorType p_type := *, + template RequestorPositionVector p_position := *, + template TransitVehicleStatus p_transitStatus := *, + template TransitVehicleOccupancy p_transitOccupancy := *, + template DeltaTime p_transitSchedule := * + ) := { + id := p_id, // The ID used in the BSM or CAM of the requestor + type_ := p_type, // Information regarding all type and class data about the requesting vehicle + position := p_position, // The location of the requesting vehicle + name := *, // A human readable name for debugging use + routeName := *, // A string for transit operations use + transitStatus := p_transitStatus, // current vehicle state (loading, etc.) + transitOccupancy := p_transitOccupancy, // current vehicle occupancy + transitSchedule := p_transitSchedule, // current vehicle schedule adherence + regional := * + } // End of template mw_requestorDescription + + template (present) RequestorPositionVector mw_requestor_position( + template (present) Position3D p_position := ? + ) := { + position := p_position, + heading := *, + speed := * + } // End of template mw_requestor_position + + template RequestorType mw_requestorType( + template (present) BasicVehicleRole p_role := ?, + template RequestSubRole p_subrole := *, + template RequestImportanceLevel p_request := * + ) := { + role := p_role, // Basic role of this user at this time + subrole := p_subrole, // A local list with role based items + request := p_request, // A local list with request items + iso3883 := *, + hpmsType := *, // HPMS classification types + regional := * + } // End of template mw_requestorType } // End of group sremTemplatesRecv - template (present) RequestorDescription mw_requestorDescription( - template (present) VehicleID p_id := ?, - template RequestorType p_type := *, - template RequestorPositionVector p_position := *, - template TransitVehicleStatus p_transitStatus := *, - template TransitVehicleOccupancy p_transitOccupancy := *, - template DeltaTime p_transitSchedule := * - ) := { - id := p_id, // The ID used in the BSM or CAM of the requestor - type_ := p_type, // Information regarding all type and class data about the requesting vehicle - position := p_position, // The location of the requesting vehicle - name := *, // A human readable name for debugging use - routeName := *, // A string for transit operations use - transitStatus := p_transitStatus, // current vehicle state (loading, etc.) - transitOccupancy := p_transitOccupancy, // current vehicle occupancy - transitSchedule := p_transitSchedule, // current vehicle schedule adherence - regional := * - } // End of template mw_requestorDescription - - template (present) RequestorPositionVector mw_requestor_position( - template (present) Position3D p_position := ? - ) := { - position := p_position, - heading := *, - speed := * - } // End of template mw_requestor_position - - template RequestorType mw_requestorType( - template (present) BasicVehicleRole p_role := ?, - template RequestSubRole p_subrole := *, - template RequestImportanceLevel p_request := * - ) := { - role := p_role, // Basic role of this user at this time - subrole := p_subrole, // A local list with role based items - request := p_request, // A local list with request items - iso3883 := *, - hpmsType := *, // HPMS classification types - regional := * - } // End of template mw_requestorType - } // End of group sremTemplates group ssemTemplates { diff --git a/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn b/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn index 829fd72e..bf93c5a7 100644 --- a/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn @@ -47,7 +47,7 @@ module LibItsSremSsem_TestSystem { */ type port UpperTesterPort message { out - UtSremInitialize, UtSremTrigger, UtSremUpdate; + UtSremInitialize, UtSremTrigger, UtSremUpdate, UtSremCancelation; in UtSremResults, UtSremEventInd , UtSsemEventInd; } // end UpperTesterPort @@ -111,7 +111,7 @@ module LibItsSremSsem_TestSystem { UInt8 gnTrafficClass optional, UInt16 btpDestinationPort optional, UInt16 btpInfo optional, - Bit256 ssp optional, + Bit24 ssp optional, UInt32 its_aid optional } with { @@ -129,7 +129,7 @@ module LibItsSremSsem_TestSystem { UInt8 gnTrafficClass optional, UInt16 btpDestinationPort optional, UInt16 btpInfo optional, - Bit256 ssp optional, + Bit24 ssp optional, UInt32 its_aid optional } with { diff --git a/ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn b/ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn index 897a1ac4..136c3740 100644 --- a/ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn @@ -20,6 +20,7 @@ module LibItsSremSsem_TypesAndValues { import from SREM_PDU_Descriptions language "ASN.1:1997" all; import from SSEM_PDU_Descriptions language "ASN.1:1997" all; import from DSRC language "ASN.1:1997" all; + import from DSRC_REGION_noCircular language "ASN.1:1997" all; // LibItsCommon import from LibItsCommon_TypesAndValues all; @@ -38,15 +39,16 @@ module LibItsSremSsem_TypesAndValues { /** * @desc Upper Tester results message of the Srem/Ssem IUT - * @member utSremInitialize - - * @member utSremTriggerResult - - * @member utAutoInteropTriggerResult - - * @member utSremChangePositionResult - + * @member utSremInitialize + * @member utSremTriggerResult + * @member utSremUpdateResult + * @member utSremCancelationResult */ type union UtSremResults { boolean utSremInitializeResult, boolean utSremTriggerResult, - boolean utSremUpdateResult + boolean utSremUpdateResult, + boolean utSremCancelationResult } with { variant "" } // End of type UtSremResults @@ -56,7 +58,8 @@ module LibItsSremSsem_TypesAndValues { */ type record UtSremTrigger { BasicVehicleRole basicVehicleRole, - RequestImportanceLevel requestImportanceLevel + RequestImportanceLevel requestImportanceLevel, + IntersectionID intersectionId } with { variant "FIELDORDER(msb)" } @@ -74,6 +77,15 @@ module LibItsSremSsem_TypesAndValues { variant "FIELDORDER(msb)" } + /** + * @desc Upper Tester message to request cancelation of an event at IUT + */ + type record UtSremCancelation { + RequestID requestID + } with { + variant "FIELDORDER(msb)" + } + /** * @desc Upper Tester message to check event/status at IUT */ -- GitLab From ab1501391eb77c8bb66f3dbf43c07881cfa509a2 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 10 Sep 2020 07:17:33 +0200 Subject: [PATCH 266/320] Finalizee implementation of SREM Generation TCs --- ttcn/SremSsem/LibItsSremSsem_Functions.ttcn | 23 ++++++++++++++++++-- ttcn/SremSsem/LibItsSremSsem_Pics.ttcn | 12 +++++++++-- ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn | 6 +++++- ttcn/SremSsem/LibItsSremSsem_Templates.ttcn | 24 ++++++++++++++++----- 4 files changed, 55 insertions(+), 10 deletions(-) diff --git a/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn b/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn index 8da3c896..d6079c1c 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn @@ -19,6 +19,7 @@ module LibItsSremSsem_Functions { // LibIts import from ITS_Container language "ASN.1:1997" all; import from DSRC language "ASN.1:1997" all; + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; // LibItsCommon import from LibItsCommon_TypesAndValues all; @@ -26,6 +27,9 @@ module LibItsSremSsem_Functions { import from LibItsCommon_Functions all; import from LibItsCommon_Pixits all; + // LibItsSecurity + import from LibItsSecurity_Functions all; + // LibItsSremSsem import from LibItsSremSsem_TestSystem all; import from LibItsSremSsem_TypesAndValues all; @@ -339,10 +343,25 @@ module LibItsSremSsem_Functions { * @desc Brings the IUT into an initial state. * @return FncRetCode */ - function f_prInitialState() runs on ItsSremSsem return FncRetCode { + function f_prInitialState( + in charstring p_certificate_id := "" + ) runs on ItsSremSsem return FncRetCode { var FncRetCode v_ret := e_success; - f_utInitializeIut(m_sremSsemInitialize); + // Initialize IUT with given certificate + if (p_certificate_id != "") { // Initialize IUT with given certificate + var HashedId8 v_hashedId8 := '0000000000000000'O; + + fx_readCertificateDigest("CERT_SRM_SSP_NONE", v_hashedId8); + if ('0000000000000000'O == v_hashedId8) { + // Certificate not found + log("*** " & testcasename() & ": Required IUT certificate is not found on the test system ***"); + return e_timeout; + } + f_utInitializeIut(m_sremSsemInitialize(v_hashedId8)); + } else { + f_utInitializeIut(m_sremSsemInitialize); + } f_prDefault(); return v_ret; } diff --git a/ttcn/SremSsem/LibItsSremSsem_Pics.ttcn b/ttcn/SremSsem/LibItsSremSsem_Pics.ttcn index 076b770b..c4aa8f0f 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Pics.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Pics.ttcn @@ -25,7 +25,13 @@ module LibItsSremSsem_Pics { * @see ETSI TS 103 191-1 Table A.5 */ modulepar boolean PICS_SREM_GENERATION := true; - + + /** + * @desc Support for SREM generation + * @see ETSI TS 103 191-1 Table A.5 + */ + modulepar boolean PICS_SREM_TRANSMISSION_RATE := true; + /** * @desc Support for SREM cancelation * @see ETSI TS 103 191-1 Table A.5 @@ -55,7 +61,9 @@ module LibItsSremSsem_Pics { * @see ETSI TS 103 191-1 Table A.5 */ modulepar boolean PICS_SHORT_RANGE := true; - + + modulepar float PICS_T_GENSREMMIN := 0.5; + /** * @desc Support for public transport vehicle * @see ETSI TS 103 191-1 Table TODO diff --git a/ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn b/ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn index 4d853bcb..c8cd4d13 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn @@ -26,7 +26,7 @@ module LibItsSremSsem_Pixits { * @desc MsgCount for SREM sending * @see ETSI TS 103 191-3 Table B.9 */ - modulepar BasicVehicleRole PX_BASICVEHICLEROLE := emergency; + modulepar BasicVehicleRole PX_BASICVEHICLEROLE := basicVehicle; /** * @desc Used by tester in SREM trigger request @@ -51,4 +51,8 @@ module LibItsSremSsem_Pixits { id := 0 }; + modulepar charstring PX_SREM_CERTIFICATE_X := "CERT_IUT_SREM_SSP_01"; + modulepar octetstring PX_SREM_CERTIFICATE_X_SSP := '024000'O; + modulepar BasicVehicleRole PX_SREM_CERTIFICATE_X_ROLE := publicTransport; + } // end LibItsSremSsem_Pixits diff --git a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn index 6167316d..0cc79fbe 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn @@ -21,6 +21,7 @@ module LibItsSremSsem_Templates { import from SSEM_PDU_Descriptions language "ASN.1:1997" all; import from DSRC language "ASN.1:1997" all; import from DSRC_REGION_noCircular language "ASN.1:1997" all; + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; // LibItsCommon import from LibItsCommon_TypesAndValues all; @@ -208,8 +209,10 @@ module LibItsSremSsem_Templates { * @desc Send template for Upper Tester event initialization * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use */ - template (value) UtSremInitialize m_sremSsemInitialize := { - hashedId8 := '0000000000000000'O + template (value) UtSremInitialize m_sremSsemInitialize( + in HashedId8 p_hashedId8 := '0000000000000000'O + ) := { + hashedId8 := p_hashedId8 } /** @@ -347,9 +350,9 @@ module LibItsSremSsem_Templates { * @param p_protocolVersion The expected protocol version (Default: current SREM SSEM protocol version) * @param p_messageID The expected message id (Default: SSEM id) */ - template ItsPduHeader mw_itsPduHeaderSsem( - template (present) StationID p_stationID := ?, - template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, + template (present) ItsPduHeader mw_itsPduHeaderSsem( + template (present) StationID p_stationID := ?, + template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_ssem_ ) := { protocolVersion := p_protocolVersion, @@ -407,6 +410,17 @@ module LibItsSremSsem_Templates { regional := omit } + /** + * @desc Send template for SREM Message + */ + template (omit) SignalRequestMessage m_srem( + in template (value) RequestorDescription p_requestorDescription, + in template (omit) SignalRequestList p_requests := omit + ) modifies m_defaultSrem := { + requests := p_requests, + requestor := p_requestorDescription + } + template (value) SignalRequestPackage m_signalRequestPackage( in template (value) SignalRequest p_request ) := { -- GitLab From 4756c3b8f4f37aba93c07bd0fae17eb429544532 Mon Sep 17 00:00:00 2001 From: pintar Date: Mon, 14 Sep 2020 15:56:56 +0200 Subject: [PATCH 267/320] New PIXITS, Templates and Types are defined related to TP_IS_IVI_GEN_LOC_BV_01 --- ttcn/IVIM/LibItsIvim_Pixits.ttcn | 15 +++++++++++++++ ttcn/IVIM/LibItsIvim_Templates.ttcn | 12 ++++++------ ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn | 11 ++++++++--- 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/ttcn/IVIM/LibItsIvim_Pixits.ttcn b/ttcn/IVIM/LibItsIvim_Pixits.ttcn index 38e4a173..9768365e 100644 --- a/ttcn/IVIM/LibItsIvim_Pixits.ttcn +++ b/ttcn/IVIM/LibItsIvim_Pixits.ttcn @@ -14,6 +14,7 @@ module LibItsIvim_Pixits { // LibIts import from EfcDsrcGeneric language "ASN.1:1997" all; import from EfcDsrcApplication language "ASN.1:1997" all; + import from IVI language "ASN.1:1997" all; /** * @desc IUT Provider identifier @@ -25,4 +26,18 @@ module LibItsIvim_Pixits { providerIdentifier := 0 } + /** + * @desc IUT ZoneId 1 identifier + * ZoneId 1 used in IVIM messages sent by the tester + * @see ETSI TS 103 191-3 Table B.8 + */ + modulepar Zid PX_ZONEID_1 := 1 + + /** + * @desc IUT ZoneId 2 identifier + * ZoneId 2 used in IVIM messages sent by the tester + * @see ETSI TS 103 191-3 Table B.8 + */ + modulepar Zid PX_ZONEID_2 := 2 + } // End of module LibItsIvim_Pixits \ No newline at end of file diff --git a/ttcn/IVIM/LibItsIvim_Templates.ttcn b/ttcn/IVIM/LibItsIvim_Templates.ttcn index 07caf115..1e5c2cbd 100644 --- a/ttcn/IVIM/LibItsIvim_Templates.ttcn +++ b/ttcn/IVIM/LibItsIvim_Templates.ttcn @@ -142,15 +142,15 @@ module LibItsIvim_Templates { template (value) UtIvimTrigger m_utTriggerEvent( template (omit) TimestampIts p_repetitionInterval := c_duration_4sec, template (omit) TimestampIts p_validFrom := omit, - template (omit) TimestampIts p_validTo := omit/*, - template (omit) IVIManagementContainer.connectedIviStructures p_connectedIviStructures := omit, - template (omit) IviStructure.optional_ p_optional_ := omit*/ + template (omit) TimestampIts p_validTo := omit, + template (omit) ZidList p_zoneIds := omit, + template (omit) LanePosition p_laneNumber := omit ) := { validFrom := p_validFrom, validTo := p_validTo, - repetitionInterval := p_repetitionInterval/*, - connectedIviStructures := p_connectedIviStructures, - optional_ := p_optional_*/ + repetitionInterval := p_repetitionInterval, + zoneIds := p_zoneIds, + laneNumber := p_laneNumber } // End of template m_utTriggerEvent /** diff --git a/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn b/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn index e87fe0be..ad866f21 100644 --- a/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn +++ b/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn @@ -54,6 +54,11 @@ module LibItsIvim_TypesAndValues { */ type record of IviIdentificationNumber IviIdentificationNumberList; + /** + * @desc List of ZoneIds + */ + type record of Zid ZidList; + } group utPrimitives { @@ -91,9 +96,9 @@ module LibItsIvim_TypesAndValues { type record UtIvimTrigger { TimestampIts validFrom optional, TimestampIts validTo optional, - TimestampIts repetitionInterval optional/*, - IVIManagementContainer.connectedIviStructures connectedIviStructures optional, - IviStructure.optional_ optional_ optional*/ + TimestampIts repetitionInterval optional, + ZidList zoneIds optional, + LanePosition laneNumber optional } with { variant "FIELDORDER(msb)" } -- GitLab From aa0623871a0425224c9c7d494cdf17775c32af18 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 16 Sep 2020 08:42:50 +0200 Subject: [PATCH 268/320] Update SSEM implementation of TCs --- ttcn/Common/LibItsCommon_TypesAndValues.ttcn | 1 + ttcn/SremSsem/LibItsSremSsem_Functions.ttcn | 6 +- ttcn/SremSsem/LibItsSremSsem_Pics.ttcn | 20 +++- ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn | 6 +- ttcn/SremSsem/LibItsSremSsem_Templates.ttcn | 106 ++++++++++++------ ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn | 2 +- .../LibItsSremSsem_TypesAndValues.ttcn | 2 +- 7 files changed, 103 insertions(+), 40 deletions(-) diff --git a/ttcn/Common/LibItsCommon_TypesAndValues.ttcn b/ttcn/Common/LibItsCommon_TypesAndValues.ttcn index f40485b7..ac56c0fd 100644 --- a/ttcn/Common/LibItsCommon_TypesAndValues.ttcn +++ b/ttcn/Common/LibItsCommon_TypesAndValues.ttcn @@ -200,6 +200,7 @@ module LibItsCommon_TypesAndValues { const integer c_its_aid_IVI := 139; const integer c_its_aid_GPC := 140; const integer c_its_aid_TLC := 140; + const integer c_its_aid_TLS := 140; const integer c_its_aid_GN := 141; const integer c_its_aid_SCR := 623; // Secured Certificate Request, https://standards.ieee.org/products-services/regauth/psid/public.html } diff --git a/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn b/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn index d6079c1c..d6d58bdf 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn @@ -1,5 +1,5 @@ /** - * @author ETSI / STF517 + * @author ETSI STF517 / STF581 / TTF002 * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn $ * $Id: LibItsSremSsem_Functions.ttcn,v 1.2 2018/05/31 15:57:11 dte Exp $ * @desc Module containing common functions for ITS SREMM SSEM @@ -236,12 +236,12 @@ module LibItsSremSsem_Functions { * @desc The base default. */ altstep a_default() runs on ItsSremSsem { - [vc_sremSsemDefaultActive] sremSsemPort.receive(mw_sremInd(mw_sremPdu(mw_defaultSrem))) { + [vc_sremSsemDefaultActive] sremSsemPort.receive(mw_sremInd(mw_sremPdu)) { log("*** " & testcasename() & ": INFO: SREMM received in default ***"); vc_sremReceived := true; repeat; } - [vc_sremSsemDefaultActive] sremSsemPort.receive(mw_ssemInd(mw_ssemPdu(mw_defaultSsem))) { + [vc_sremSsemDefaultActive] sremSsemPort.receive(mw_ssemInd(mw_ssemPdu)) { log("*** " & testcasename() & ": INFO: SREMM received in default ***"); vc_ssemReceived := true; repeat; diff --git a/ttcn/SremSsem/LibItsSremSsem_Pics.ttcn b/ttcn/SremSsem/LibItsSremSsem_Pics.ttcn index c4aa8f0f..f6d2b0cc 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Pics.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Pics.ttcn @@ -75,5 +75,23 @@ module LibItsSremSsem_Pics { * @see ETSI TS 103 191-1 Table TODO */ modulepar boolean PICS_SREM_HAS_TIMING := true; - + + /** + * @desc Support for TODO + * @see ETSI TS 103 191-1 Table TODO + */ + modulepar boolean PICS_SSEM_TRATEMENT_DELAY := true; + + modulepar float PICS_T_DELAY_GENSSEMMIN := 0.1; + + /** + * @desc Support for TODO + * @see ETSI TS 103 191-1 Table TODO + */ + modulepar boolean PICS_SSEM_TRANSMISSION_RATE := true; + + modulepar float PICS_T_RATE_GENSSEMMIN := 0.1; + + modulepar float PICS_T_RATE_GENSSEMMAX := 2.0; + } // end LibItsSremSsem_Pics diff --git a/ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn b/ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn index c8cd4d13..0ab21535 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn @@ -1,5 +1,5 @@ /** - * @author ETSI / STF517 + * @author ETSI STF517 / STF581 / TTF002 * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn $ * $Id: LibItsSremSsem_Pixits.ttcn 1315 2016-12-15 13:25:41Z garciay $ * @desc MAPEM SPATEM PIXIT @@ -42,6 +42,10 @@ module LibItsSremSsem_Pixits { */ modulepar DSecond PX_SECOND := 0; + modulepar MsgCount PX_SEQUENCE_NUMBER := 10; + + modulepar RequestID PX_REQUEST_ID := 5; + /** * @desc Used in SREM and SSEM sent by tester * @see ETSI TS 103 191-3 Table B.9 diff --git a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn index 0cc79fbe..26c2254a 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn @@ -1,5 +1,5 @@ /** - * @author ETSI / STF517 + * @author ETSI STF517 * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn $ * $Id: LibItsSremSsem_Templates.ttcn 1312 2016-12-14 09:21:45Z garciay $ * @desc Module containing base template definitions for SREM SSEM @@ -395,14 +395,14 @@ module LibItsSremSsem_Templates { template (value) SignalRequestMessage m_defaultSrem := { timeStamp := omit, second := PX_SECOND, - sequenceNumber := omit, + sequenceNumber := PX_SEQUENCE_NUMBER, requests := { valueof( m_signalRequestPackage( valueof( m_signalRequest( m_intersectionReferenceID, - 1, + PX_REQUEST_ID, priorityRequestTypeReserved, { lane := 1 } )))) }, @@ -594,7 +594,7 @@ module LibItsSremSsem_Templates { timeStamp := omit, second := PX_SECOND, sequenceNumber := omit, - status := { m_signalStatus(PX_STATUS) }, + status := { m_signalStatus(PX_SEQUENCE_NUMBER, PX_STATUS) }, regional := omit } @@ -605,23 +605,75 @@ module LibItsSremSsem_Templates { in SignalRequestMessage p_signalRequestMessage ) modifies m_defaultSsem := { second := p_signalRequestMessage.second, - status := { m_signalStatus(p_signalRequestMessage.requests[0].request.id) }, + status := { m_signalStatus(p_signalRequestMessage.sequenceNumber, p_signalRequestMessage.requests[0].request.id) }, regional := omit } + /** + * @desc Receive template for SSEM Message + */ + template (present) SignalStatusMessage mw_ssemWellFormatted( + template (present) MsgCount p_sequenceNumber := ?, + template (present) SignalStatus p_status := ? + ) := { + timeStamp := *, + second := ?, + sequenceNumber := p_sequenceNumber, + status := { p_status }, + regional := * + } template (value) SignalStatus m_signalStatus( - in IntersectionReferenceID p_id + in template (value) MsgCount p_sequenceNumber, + in template (value) IntersectionReferenceID p_id ) := { - sequenceNumber := 1, // FIXME To be reviewed + sequenceNumber := p_sequenceNumber, id := p_id, - sigStatus := { m_signalStatusPackage }, + sigStatus := { m_signalStatusPackage(m_requester(m_vehicleID(f_getIutStationId()), 4, 6, basicVehicle)) }, regional := omit } - template (value) SignalStatusPackage m_signalStatusPackage - := { - requester := omit, + template (present) SignalStatus mw_signalStatus( + template (present) MsgCount p_sequenceNumber := ?, + template (present) IntersectionReferenceID p_id := ?, + template (present) SignalStatusPackage p_sigStatus := ? + ) := { + sequenceNumber := p_sequenceNumber, + id := p_id, + sigStatus := { p_sigStatus }, + regional := * + } + + template (omit) SignalRequesterInfo m_requester( + in template (value) VehicleID p_id, + in template (value) RequestID p_request, + in template (value) MsgCount p_sequenceNumber, + in template (omit) BasicVehicleRole role := omit + ) := { + id := p_id, + request := p_request, + sequenceNumber := p_sequenceNumber, + role := omit, + typeData := omit + } + + template SignalRequesterInfo mw_requester( + template (present) VehicleID p_id := ?, + template (present) RequestID p_request := ?, + template (present) MsgCount p_sequenceNumber := ?, + template BasicVehicleRole role := * + ) := { + id := p_id, + request := p_request, + sequenceNumber := p_sequenceNumber, + role := *, + typeData := * + } + + template (value) SignalStatusPackage m_signalStatusPackage( + in template (value) SignalRequesterInfo p_requester + ) := { + requester := p_requester, inboundOn := { approach := 0 }, @@ -633,29 +685,17 @@ module LibItsSremSsem_Templates { regional := omit } - /** - * @desc Receive template for SSEM Message - */ - template (present) SignalStatusMessage mw_defaultSsem( - template (present) MsgCount p_sequenceNumber := ? + template SignalStatusPackage mw_signalStatusPackage( + template (present) SignalRequesterInfo p_requester := ? ) := { - timeStamp := *, - second := ?, - sequenceNumber := p_sequenceNumber, - status := ?, - regional := * - } - - template (present) SignalStatusMessage mw_ssemWellFormatted( - template (present) MsgCount p_sequenceNumber := ? - ) modifies mw_defaultSsem := { - } - - template (present) SignalStatusMessage mw_ssem_with_region_id( - template (present) MsgCount p_sequenceNumber := ?, - template (present) SignalStatusMessage.regional p_regional := ? - ) modifies mw_defaultSsem := { - regional := p_regional + requester := p_requester, + inboundOn := ?, + outboundOn := *, + minute := *, + second := *, + duration := *, + status := ?, + regional := * } } // End of group ssemTemplates diff --git a/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn b/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn index bf93c5a7..e3c9b787 100644 --- a/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn @@ -1,5 +1,5 @@ /** - * @author ETSI / STF517 + * @author ETSI STF517 / STF581 / TTF002 * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn $ * $Id: LibItsSremSsem_TestSystem.ttcn,v 1.2 2018/05/31 15:57:11 dte Exp $ * @desc Test System module for ITS SREM SSEM diff --git a/ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn b/ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn index 136c3740..21bf7d0b 100644 --- a/ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn @@ -1,5 +1,5 @@ /** - * @author ETSI / STF517 + * @author ETSI STF517 / STF581 / TTF002 * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn $ * $Id: LibItsSremSsem_TypesAndValues.ttcn 1307 2016-12-13 07:51:14Z garciay $ * @desc Module containing types and values for SREM SSEM -- GitLab From 87f21214054eb1b8ba7217d80acb53aa259d9155 Mon Sep 17 00:00:00 2001 From: pintar Date: Tue, 22 Sep 2020 11:06:31 +0200 Subject: [PATCH 269/320] New TP functions related to TP_IS_IVI_GEN_GENAPP_BV_01 and 06 --- ttcn/IVIM/LibItsIvim_Pixits.ttcn | 36 ++++++++ ttcn/IVIM/LibItsIvim_Templates.ttcn | 101 ++++++++++++++++++++++- ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn | 24 +++++- 3 files changed, 158 insertions(+), 3 deletions(-) diff --git a/ttcn/IVIM/LibItsIvim_Pixits.ttcn b/ttcn/IVIM/LibItsIvim_Pixits.ttcn index 9768365e..9dde885e 100644 --- a/ttcn/IVIM/LibItsIvim_Pixits.ttcn +++ b/ttcn/IVIM/LibItsIvim_Pixits.ttcn @@ -15,6 +15,7 @@ module LibItsIvim_Pixits { import from EfcDsrcGeneric language "ASN.1:1997" all; import from EfcDsrcApplication language "ASN.1:1997" all; import from IVI language "ASN.1:1997" all; + import from ITS_Container language "ASN.1:1997" all; /** * @desc IUT Provider identifier @@ -40,4 +41,39 @@ module LibItsIvim_Pixits { */ modulepar Zid PX_ZONEID_2 := 2 + /** + * @desc IUT LaneId identifier + * LaneId used in IVIM messages sent by the tester + * @see ETSI TS 103 191-3 Table B.8 + */ + modulepar LanePosition PX_LANE := 1 //innermostDrivingLane(1) + + /** + * @desc IUT RelavanceZoneId identifier + * RelavanceZoneId used in IVIM messages sent by the tester + * @see ETSI TS 103 191-3 Table B.8 + */ + modulepar Zid PX_RELAVANCE_ZONEID := 1 + + /** + * @desc IUT DetectionZoneId identifier + * DetectionZoneId used in IVIM messages sent by the tester + * @see ETSI TS 103 191-3 Table B.8 + */ + modulepar Zid PX_DETECTION_ZONEID := 1 + + /** + * @desc IUT DriverAwarenesZoneId identifier + * DriverAwarenesZoneId used in IVIM messages sent by the tester + * @see ETSI TS 103 191-3 Table B.8 + */ + modulepar Zid PX_DRIVER_AWARENES_ZONEID := 1 + + /** + * @desc IUT LayoutId identifier + * LayoutId used in IVIM messages sent by the tester + * @see ETSI TS 103 191-3 Table B.8 + */ + modulepar integer PX_LAYOUTID := 1 + } // End of module LibItsIvim_Pixits \ No newline at end of file diff --git a/ttcn/IVIM/LibItsIvim_Templates.ttcn b/ttcn/IVIM/LibItsIvim_Templates.ttcn index 1e5c2cbd..fcdd21dc 100644 --- a/ttcn/IVIM/LibItsIvim_Templates.ttcn +++ b/ttcn/IVIM/LibItsIvim_Templates.ttcn @@ -21,6 +21,7 @@ module LibItsIvim_Templates { import from IVI language "ASN.1:1997" all; import from EfcDsrcApplication language "ASN.1:1997" all; import from AVIAEINumberingAndDataStructures language "ASN.1:1997" all; + import from CITSapplMgmtIDs language "ASN.1:1997" all; // LibItsCommon import from LibItsCommon_TypesAndValues all; @@ -144,13 +145,25 @@ module LibItsIvim_Templates { template (omit) TimestampIts p_validFrom := omit, template (omit) TimestampIts p_validTo := omit, template (omit) ZidList p_zoneIds := omit, - template (omit) LanePosition p_laneNumber := omit + template (omit) LanePosition p_laneNumber := omit, + template (omit) RelavanceZidList p_relavanceZoneIds := omit, + template (omit) DetectionZidList p_detectionZoneIds := omit, + template (omit) DriverAwarenesZidList p_driverAwarenesZoneIds := omit, + template (omit) VarLengthNumber p_itsRrid := omit, + template (omit) Direction p_directionGic := omit, + template (omit) integer p_layoutId := omit ) := { validFrom := p_validFrom, validTo := p_validTo, repetitionInterval := p_repetitionInterval, zoneIds := p_zoneIds, - laneNumber := p_laneNumber + laneNumber := p_laneNumber, + relavanceZoneIds := p_relavanceZoneIds, + detectionZoneIds := p_detectionZoneIds, + driverAwarenesZoneIds := p_driverAwarenesZoneIds, + itsRrid := p_itsRrid, + directionGic := p_directionGic, + layoutId := p_layoutId } // End of template m_utTriggerEvent /** @@ -407,6 +420,22 @@ module LibItsIvim_Templates { validFrom := p_validFrom } // End of template mw_iviManagementContainer_validFrom + /** + * @desc Receive template for IVIManagement container + * @param p_serviceProviderId The IUT provider description + * @param p_iviIdentificationNumber The IVIM identification number + * @param p_iviStatus The IVIM status + * @param p_connectedIviStructures The IVIM connectedIviStructures + */ + template (present) IVIManagementContainer mw_iviManagementContainer_connectedIviStructures( + template (present) Provider p_serviceProviderId := ?, + template (present) IviIdentificationNumber p_iviIdentificationNumber := ?, + template (present) IviStatus p_iviStatus := ?, + template (present) IVIManagementContainer.connectedIviStructures p_connectedIviStructures := ? + ) modifies mw_iviManagementContainer := { + connectedIviStructures := p_connectedIviStructures + } // End of template mw_iviManagementContainer + /** * @desc Receive template for Porvide identifier * @param p_countryCode Country code value @@ -566,6 +595,74 @@ module LibItsIvim_Templates { extraText := * } // End of template mw_gicPart + template (present) GicPart mw_gicPart_layoutId( + template (present) IviType p_iviType := ?, + template (present) GicPart.roadSignCodes p_roadSignCodes := ?, + template (present) integer p_layoutId := ? + ) modifies mw_gicPart_basic := { + layoutId := p_layoutId + } // End of template mw_gicPart_layoutId + + template (present) GicPart mw_gicPart_allZoneIdsAndItsRridAndDirection( + template (present) IviType p_iviType := ?, + template (present) GicPart.roadSignCodes p_roadSignCodes := ?, + template GicPart.detectionZoneIds p_detectionZoneIds := *, + template VarLengthNumber p_varLengthNumber := *, + template GicPart.relevanceZoneIds p_relevanceZoneIds := *, + template Direction p_direction := *, + template GicPart.driverAwarenessZoneIds p_driverAwarenessZoneIds := * + ) modifies mw_gicPart_basic := { + detectionZoneIds := p_detectionZoneIds, + its_Rrid := p_varLengthNumber, + relevanceZoneIds := p_relevanceZoneIds, + direction := p_direction, + driverAwarenessZoneIds := p_driverAwarenessZoneIds + } // End of template mw_gicPart + + template (present) RSCode mw_rSCode( + template (present) RSCode.layoutComponentId p_layoutComponentId := ?, + template (present) RSCode.code p_code := ? + ) := { + layoutComponentId := p_layoutComponentId, + code := p_code + } // End of template mw_rSCode + + template (present) RSCode mw_rSCode_viennaConvention( + template (present) RSCode.layoutComponentId p_layoutComponentId := ? + ) := { + layoutComponentId := p_layoutComponentId, + code := { + viennaConvention := ? + } + } // End of template mw_rSCode_viennaConvention + + template (present) RSCode mw_rSCode_iso14823( + template (present) RSCode.layoutComponentId p_layoutComponentId := ? + ) := { + layoutComponentId := p_layoutComponentId, + code := { + iso14823 := ? + } + } // End of template mw_rSCode_iso14823 + + template (present) RSCode mw_rSCode_itisCodes( + template (present) RSCode.layoutComponentId p_layoutComponentId := ? + ) := { + layoutComponentId := p_layoutComponentId, + code := { + itisCodes := ? + } + } // End of template mw_rSCode_itisCodes + + template (present) RSCode mw_rSCode_anyCatalogue( + template (present) RSCode.layoutComponentId p_layoutComponentId := ? + ) := { + layoutComponentId := p_layoutComponentId, + code := { + anyCatalogue := ? + } + } // End of template mw_rSCode_anyCatalogue + } // End of group generalIviContainerGroup group roadConfigurationContainerGroup { diff --git a/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn b/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn index ad866f21..bd60aec4 100644 --- a/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn +++ b/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn @@ -19,6 +19,7 @@ module LibItsIvim_TypesAndValues { import from IVIM_PDU_Descriptions language "ASN.1:1997" all; import from IVI language "ASN.1:1997" all; import from ITS_Container language "ASN.1:1997" all; + import from CITSapplMgmtIDs language "ASN.1:1997" all; group actionTypes { @@ -59,6 +60,21 @@ module LibItsIvim_TypesAndValues { */ type record of Zid ZidList; + /** + * @desc List of RelavanceZoneIds + */ + type record of Zid RelavanceZidList; + + /** + * @desc List of DetectionZoneIds + */ + type record of Zid DetectionZidList; + + /** + * @desc List of DriverAwarenesZoneIds + */ + type record of Zid DriverAwarenesZidList; + } group utPrimitives { @@ -98,7 +114,13 @@ module LibItsIvim_TypesAndValues { TimestampIts validTo optional, TimestampIts repetitionInterval optional, ZidList zoneIds optional, - LanePosition laneNumber optional + LanePosition laneNumber optional, + RelavanceZidList relavanceZoneIds optional, + DetectionZidList detectionZoneIds optional, + DriverAwarenesZidList driverAwarenesZoneIds optional, + VarLengthNumber itsRrid optional, + Direction directionGic optional, + integer layoutId optional } with { variant "FIELDORDER(msb)" } -- GitLab From 09a190d8c689f46e8d78fc1878171b905aa4a6c9 Mon Sep 17 00:00:00 2001 From: pintar Date: Fri, 25 Sep 2020 19:52:18 +0200 Subject: [PATCH 270/320] New TP functions related to TP_IS_IVI_GEN_TEXT and RCC groups. --- ttcn/IVIM/LibItsIvim_Templates.ttcn | 103 +++++++++++++++++++++++++++- 1 file changed, 102 insertions(+), 1 deletion(-) diff --git a/ttcn/IVIM/LibItsIvim_Templates.ttcn b/ttcn/IVIM/LibItsIvim_Templates.ttcn index fcdd21dc..6a195b5d 100644 --- a/ttcn/IVIM/LibItsIvim_Templates.ttcn +++ b/ttcn/IVIM/LibItsIvim_Templates.ttcn @@ -493,6 +493,18 @@ module LibItsIvim_Templates { rcc := p_rcc } // End of template mw_iviContainer_roadConfigurationContainer + template (value) IviContainer m_iviContainer_textContainer( + in template (value) TextContainer p_tc + ) := { + tc := p_tc + } // End of template m_iviContainer_textContainer + + template (present) IviContainer mw_iviContainer_textContainer( + template (present) TextContainer p_tc := ? + ) := { + tc := p_tc + } // End of template mw_iviContainer_textContainer + } // End of group iviContainerGroup group geographicLocationContainerGroup { @@ -684,11 +696,100 @@ module LibItsIvim_Templates { ) := { zoneIds := p_zoneIds, roadType := p_roadType, - laneConfiguration := p_laneConfiguration + laneConfiguration := p_laneConfiguration } // End of template mw_rccPart + template (present) LaneInformation mw_laneInformation( + template (present) LanePosition p_lanePosition := ?, + template (present) LaneType p_laneType := ?, + template (present) LaneStatus p_laneStatus := ? + ) := { + laneNumber := p_lanePosition, + validity := *, //DTM + laneType := p_laneType, + laneTypeQualifier := *, //CompleteVehicleCharacteristics + laneStatus := p_laneStatus, + laneWidth := * //IVILaneWidth + } + } // End of group roadConfigurationContainerGroup + group textContainerGroup { + + template (value) TcPart m_tcPart_basic( + in template (value) TcPart.relevanceZoneIds p_relevanceZoneIds, + in template (value) TcPart.data p_data + ) := { + detectionZoneIds := omit, + relevanceZoneIds := p_relevanceZoneIds, + direction := omit, + driverAwarenessZoneIds := omit, + minimumAwarenessTime := omit, + applicableLanes := omit, + layoutId := omit, + preStoredlayoutId := omit, + text := omit, + data := p_data + } // End of template m_tcPart_basic + + template (present) TcPart mw_tcPart_basic( + template (present) TcPart.relevanceZoneIds p_relevanceZoneIds := ?, + template (present) TcPart.data p_data := ? + ) := { + detectionZoneIds := *, + relevanceZoneIds := p_relevanceZoneIds, + direction := *, + driverAwarenessZoneIds := *, + minimumAwarenessTime := *, + applicableLanes := *, + layoutId := *, + preStoredlayoutId := *, + text := *, + data := p_data + } // End of template mw_tcPart_basic + + template (present) TcPart mw_tcPart_allZoneIds( + template (present) TcPart.relevanceZoneIds p_relevanceZoneIds := ?, + template (present) TcPart.data p_data := ?, + template (present) TcPart.detectionZoneIds p_detectionZoneIds := ?, + template (present) TcPart.driverAwarenessZoneIds p_driverAwarenessZoneIds := ? + ) modifies mw_tcPart_basic := { + detectionZoneIds := p_detectionZoneIds, + driverAwarenessZoneIds := p_driverAwarenessZoneIds + } // End of template mw_tcPart_allZoneIds + + template (present) TcPart mw_tcPart_direction( + template (present) TcPart.relevanceZoneIds p_relevanceZoneIds := ?, + template (present) TcPart.data p_data := ?, + template (present) TcPart.direction p_direction := ? + ) modifies mw_tcPart_basic := { + relevanceZoneIds := p_relevanceZoneIds + } // End of template mw_tcPart_direction + + template (present) TcPart mw_tcPart_text( + template (present) TcPart.relevanceZoneIds p_relevanceZoneIds := ?, + template (present) TcPart.data p_data := ?, + template (present) TcPart.text p_text := ? + ) modifies mw_tcPart_basic := { + text := p_text + } // End of template mw_tcPart_text + + template (present) TcPart mw_tcPart_layoutId( + template (present) TcPart.relevanceZoneIds p_relevanceZoneIds := ?, + template (present) TcPart.data p_data := ?, + template (present) TcPart.layoutId p_layoutId := ? + ) modifies mw_tcPart_basic := { + layoutId := p_layoutId + } // End of template mw_tcPart_layoutId + + template (present) Text mw_text := { + layoutComponentId := *, + language_ := ?, + textContent := ? + } + + } // End of group textContainerGroup + group itsFunction { /** -- GitLab From 335560434cc5a3167b6eb6c0881b6b469f471710 Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Thu, 1 Oct 2020 07:59:09 +0200 Subject: [PATCH 271/320] Upgrade Test System for TLC --- ttcn/Common/LibItsCommon_TypesAndValues.ttcn | 13 +++-- .../LibItsSremSsem_EncdecDeclarations.ttcn | 57 ++++++++++++++++++- ttcn/SremSsem/LibItsSremSsem_Templates.ttcn | 15 ++--- 3 files changed, 69 insertions(+), 16 deletions(-) diff --git a/ttcn/Common/LibItsCommon_TypesAndValues.ttcn b/ttcn/Common/LibItsCommon_TypesAndValues.ttcn index ac56c0fd..4bf65e49 100644 --- a/ttcn/Common/LibItsCommon_TypesAndValues.ttcn +++ b/ttcn/Common/LibItsCommon_TypesAndValues.ttcn @@ -191,14 +191,15 @@ module LibItsCommon_TypesAndValues { /** * @see ETSI TS 102 965 Intelligent Transport Systems (ITS); Application Object Identifier (ITS-AID); Registration list ETSI ITS registration list + * @see https://standards.iso.org/iso/ts/17419/TS17419%20Assigned%20Numbers/TS17419_ITS-AID_AssignedNumbers.pdf */ group securityConstants { - const integer c_its_aid_CAM := 36; - const integer c_its_aid_DENM := 37; - const integer c_its_aid_SPAT := 137; - const integer c_its_aid_MAP := 138; - const integer c_its_aid_IVI := 139; - const integer c_its_aid_GPC := 140; + const integer c_its_aid_CAM := 36; + const integer c_its_aid_DENM := 37; + const integer c_its_aid_GPC := 128; + const integer c_its_aid_SPAT := 137; + const integer c_its_aid_MAP := 138; + const integer c_its_aid_IVI := 139; const integer c_its_aid_TLC := 140; const integer c_its_aid_TLS := 140; const integer c_its_aid_GN := 141; diff --git a/ttcn/SremSsem/LibItsSremSsem_EncdecDeclarations.ttcn b/ttcn/SremSsem/LibItsSremSsem_EncdecDeclarations.ttcn index 010bf24f..36df987b 100644 --- a/ttcn/SremSsem/LibItsSremSsem_EncdecDeclarations.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_EncdecDeclarations.ttcn @@ -1,8 +1,59 @@ module LibItsSremSsem_EncdecDeclarations { -import from DSRC language "ASN.1:1997" all; + // LibItsSremSsem + import from ITS_Container language "ASN.1:1997" all; + import from SREM_PDU_Descriptions language "ASN.1:1997" all; + import from SSEM_PDU_Descriptions language "ASN.1:1997" all; + import from DSRC language "ASN.1:1997" all; -external function fx_enc_SSM (SignalStatusMessage p) return octetstring - with {extension "prototype(convert) encode(BER:BER_ENCODE_CER)"} + import from LibItsSremSsem_TypesAndValues all; + import from LibItsSremSsem_TestSystem all; + external function fx_enc_SremReq (SremReq p) return bitstring + with {extension "prototype(convert) encode(LibIts_Interface)"} + + external function fx_dec_SremReq (inout bitstring b, out SremReq p) return integer + with {extension "prototype(sliding) decode(LibIts_Interface)"} + + external function fx_enc_SremInd (SremInd p) return bitstring + with {extension "prototype(convert) encode(LibIts_Interface)"} + + external function fx_dec_SremInd (inout bitstring b, out SremInd p) return integer + with {extension "prototype(sliding) decode(LibIts_Interface)"} + + external function fx_enc_SsemReq (SsemReq p) return bitstring + with {extension "prototype(convert) encode(LibIts_Interface)"} + + external function fx_dec_SsemReq (inout bitstring b, out SsemReq p) return integer + with {extension "prototype(sliding) decode(LibIts_Interface)"} + + external function fx_enc_SsemInd (SsemInd p) return bitstring + with {extension "prototype(convert) encode(LibIts_Interface)"} + + external function fx_dec_SsemInd (inout bitstring b, out SsemInd p) return integer + with {extension "prototype(sliding) decode(LibIts_Interface)"} + + external function fx_enc_SREM (SREM p) return bitstring + with {extension "prototype(convert) encode(PER)"} + + external function fx_dec_SREM (inout bitstring b, out SREM p) return integer + with {extension "prototype(sliding) decode(PER)"} + + external function fx_enc_SSEM (SSEM p) return bitstring + with {extension "prototype(convert) encode(PER)"} + + external function fx_dec_SSEM (inout bitstring b, out SSEM p) return integer + with {extension "prototype(sliding) decode(PER)"} + + /*external function fx_enc_SRM (SignalRequestMessage p) return bitstring + with {extension "prototype(convert) encode(PER)"} + + external function fx_dec_SRM (inout bitstring b, out SignalRequestMessage p) return integer + with {extension "prototype(sliding) decode(PER)"} + + external function fx_enc_SSM (SignalStatusMessage p) return bitstring + with {extension "prototype(convert) encode(PER)"} + + external function fx_dec_SSM (inout bitstring b, out SignalStatusMessage p) return integer + with {extension "prototype(sliding) decode(PER)"}*/ } diff --git a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn index 26c2254a..762832a2 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn @@ -594,7 +594,7 @@ module LibItsSremSsem_Templates { timeStamp := omit, second := PX_SECOND, sequenceNumber := omit, - status := { m_signalStatus(PX_SEQUENCE_NUMBER, PX_STATUS) }, + status := { m_signalStatus(PX_SEQUENCE_NUMBER, m_requestorDescription(m_vehicleID(f_getIutStationId())), m_signalRequest(m_intersectionReferenceID, 17, priorityRequestTypeReserved, { lane := 2 } )) }, regional := omit } @@ -605,7 +605,7 @@ module LibItsSremSsem_Templates { in SignalRequestMessage p_signalRequestMessage ) modifies m_defaultSsem := { second := p_signalRequestMessage.second, - status := { m_signalStatus(p_signalRequestMessage.sequenceNumber, p_signalRequestMessage.requests[0].request.id) }, + status := { m_signalStatus(p_signalRequestMessage.sequenceNumber, p_signalRequestMessage.requestor, p_signalRequestMessage.requests[0].request) }, regional := omit } @@ -625,11 +625,12 @@ module LibItsSremSsem_Templates { template (value) SignalStatus m_signalStatus( in template (value) MsgCount p_sequenceNumber, - in template (value) IntersectionReferenceID p_id + in template (value) RequestorDescription p_requestor, + in template (value) SignalRequest p_signalRequest ) := { sequenceNumber := p_sequenceNumber, - id := p_id, - sigStatus := { m_signalStatusPackage(m_requester(m_vehicleID(f_getIutStationId()), 4, 6, basicVehicle)) }, + id := p_signalRequest.id, + sigStatus := { m_signalStatusPackage(m_requester(p_requestor.id, p_signalRequest.requestID, p_sequenceNumber, p_requestor.type_.role)) }, regional := omit } @@ -648,12 +649,12 @@ module LibItsSremSsem_Templates { in template (value) VehicleID p_id, in template (value) RequestID p_request, in template (value) MsgCount p_sequenceNumber, - in template (omit) BasicVehicleRole role := omit + in template (omit) BasicVehicleRole p_role := omit ) := { id := p_id, request := p_request, sequenceNumber := p_sequenceNumber, - role := omit, + role := p_role, typeData := omit } -- GitLab From 4276dfb2da56fa348a2abbad9d4fee7924fa2c2d Mon Sep 17 00:00:00 2001 From: pintar Date: Fri, 2 Oct 2020 14:21:17 +0200 Subject: [PATCH 272/320] New TP functions related to TP_IS_IVI --- .../IVIM/LibItsIvim_ASN1_IVInamedNumbers.ttcn | 6 ++ ttcn/IVIM/LibItsIvim_Pixits.ttcn | 7 ++ ttcn/IVIM/LibItsIvim_Templates.ttcn | 65 ++++++++++++++++--- 3 files changed, 70 insertions(+), 8 deletions(-) diff --git a/ttcn/IVIM/LibItsIvim_ASN1_IVInamedNumbers.ttcn b/ttcn/IVIM/LibItsIvim_ASN1_IVInamedNumbers.ttcn index 86cea969..51b64997 100644 --- a/ttcn/IVIM/LibItsIvim_ASN1_IVInamedNumbers.ttcn +++ b/ttcn/IVIM/LibItsIvim_ASN1_IVInamedNumbers.ttcn @@ -10,6 +10,12 @@ import from IVI language "ASN.1:1997" all; const IviStatus IviStatus_update_ := 1; const IviStatus IviStatus_cancellation_ := 2; const IviStatus IviStatus_negation_ := 3; + + const IviType IviType_immediateDangerWarningMessages_ := 0; + const IviType IviType_regulatoryMessages_ := 1; + const IviType IviType_trafficRelatedInformationMessages_ := 2; + const IviType IviType_pollutionMessages_ := 3; + const IviType IviType_notTrafficRelatedInformationMessages_ := 4; } // end IVI_constants diff --git a/ttcn/IVIM/LibItsIvim_Pixits.ttcn b/ttcn/IVIM/LibItsIvim_Pixits.ttcn index 9dde885e..370c9e00 100644 --- a/ttcn/IVIM/LibItsIvim_Pixits.ttcn +++ b/ttcn/IVIM/LibItsIvim_Pixits.ttcn @@ -27,6 +27,13 @@ module LibItsIvim_Pixits { providerIdentifier := 0 } + /** + * @desc IUT IVI identifier + * IVI identification number + * @see ETSI TS 103 191-3 Table B.8 + */ + modulepar integer PX_IVI_ID := 2; + /** * @desc IUT ZoneId 1 identifier * ZoneId 1 used in IVIM messages sent by the tester diff --git a/ttcn/IVIM/LibItsIvim_Templates.ttcn b/ttcn/IVIM/LibItsIvim_Templates.ttcn index 6a195b5d..1c3ff829 100644 --- a/ttcn/IVIM/LibItsIvim_Templates.ttcn +++ b/ttcn/IVIM/LibItsIvim_Templates.ttcn @@ -341,11 +341,12 @@ module LibItsIvim_Templates { in template (value) Provider p_serviceProviderId, in template (value) IviIdentificationNumber p_iviIdentificationNumber, in template (value) IviStatus p_iviStatus, - in template (omit) IVIManagementContainer.connectedIviStructures p_connectedIviStructures := omit + in template (omit) IVIManagementContainer.connectedIviStructures p_connectedIviStructures := omit, + in template (omit) IVIManagementContainer.timeStamp p_timeStamp := f_getCurrentTime() ) := { serviceProviderId := p_serviceProviderId, iviIdentificationNumber := p_iviIdentificationNumber, - timeStamp := f_getCurrentTime(), + timeStamp := p_timeStamp, validFrom := omit, validTo := omit, connectedIviStructures := p_connectedIviStructures, @@ -559,6 +560,37 @@ module LibItsIvim_Templates { zone := p_zone } // End of template mw_glcPart + template (value) ReferencePosition m_referencePosition( + in template (value) Latitude p_latitude := 10000, + in template (value) Longitude p_longitude := 10000, + in template (value) PosConfidenceEllipse p_position, + in template (value) Altitude p_altitude + ) := { + latitude := p_latitude, + longitude := p_longitude, + positionConfidenceEllipse := p_position, + altitude := p_altitude + } // End of template m_referencePosition + + template (value) ReferencePosition m_referencePosition_sample( + in template (value) Latitude p_latitude := 10000, + in template (value) Longitude p_longitude := 10000 + ) := { + latitude := p_latitude, + longitude := p_longitude, + positionConfidenceEllipse := + { + semiMajorConfidence := 1000, + semiMinorConfidence := 1000, + semiMajorOrientation := 1000 + }, + altitude := + { + altitudeValue := 10000, + altitudeConfidence := alt_000_01//unavailable + } + } // End of template m_referencePosition + } // End of group geographicLocationContainerGroup group generalIviContainerGroup { @@ -583,7 +615,17 @@ module LibItsIvim_Templates { preStoredlayoutId := omit, roadSignCodes := p_roadSignCodes, extraText := omit - } // End of template m_gicPart + } // End of template m_gicPart_basic + + template (value) GicPart m_gicPart_relavanceZoneId( + in template (value) IviType p_iviType := IviType_regulatoryMessages_, + in template (value) GicPart.roadSignCodes p_roadSignCodes := {m_rSCode_itisCodes}, + in template (value) GicPart.relevanceZoneIds p_relevanceZoneIds := {PX_RELAVANCE_ZONEID} + ) modifies m_gicPart_basic:= { + relevanceZoneIds := p_relevanceZoneIds, + iviType := p_iviType, + roadSignCodes := p_roadSignCodes + } // End of template m_gicPart_relavanceZoneId template (present) GicPart mw_gicPart_basic( template (present) IviType p_iviType := ?, @@ -632,7 +674,7 @@ module LibItsIvim_Templates { } // End of template mw_gicPart template (present) RSCode mw_rSCode( - template (present) RSCode.layoutComponentId p_layoutComponentId := ?, + template RSCode.layoutComponentId p_layoutComponentId := *, template (present) RSCode.code p_code := ? ) := { layoutComponentId := p_layoutComponentId, @@ -640,7 +682,7 @@ module LibItsIvim_Templates { } // End of template mw_rSCode template (present) RSCode mw_rSCode_viennaConvention( - template (present) RSCode.layoutComponentId p_layoutComponentId := ? + template RSCode.layoutComponentId p_layoutComponentId := * ) := { layoutComponentId := p_layoutComponentId, code := { @@ -649,7 +691,7 @@ module LibItsIvim_Templates { } // End of template mw_rSCode_viennaConvention template (present) RSCode mw_rSCode_iso14823( - template (present) RSCode.layoutComponentId p_layoutComponentId := ? + template RSCode.layoutComponentId p_layoutComponentId := * ) := { layoutComponentId := p_layoutComponentId, code := { @@ -658,7 +700,7 @@ module LibItsIvim_Templates { } // End of template mw_rSCode_iso14823 template (present) RSCode mw_rSCode_itisCodes( - template (present) RSCode.layoutComponentId p_layoutComponentId := ? + template RSCode.layoutComponentId p_layoutComponentId := * ) := { layoutComponentId := p_layoutComponentId, code := { @@ -667,7 +709,7 @@ module LibItsIvim_Templates { } // End of template mw_rSCode_itisCodes template (present) RSCode mw_rSCode_anyCatalogue( - template (present) RSCode.layoutComponentId p_layoutComponentId := ? + template RSCode.layoutComponentId p_layoutComponentId := * ) := { layoutComponentId := p_layoutComponentId, code := { @@ -675,6 +717,13 @@ module LibItsIvim_Templates { } } // End of template mw_rSCode_anyCatalogue + template (value) RSCode m_rSCode_itisCodes := { + layoutComponentId := omit, + code := { + itisCodes := 100 + } + } // End of template m_rSCode_itisCodes + } // End of group generalIviContainerGroup group roadConfigurationContainerGroup { -- GitLab From 00456b45e784e0e35cb3e68aca92553ea1e9accb Mon Sep 17 00:00:00 2001 From: pintar Date: Mon, 5 Oct 2020 07:54:43 +0200 Subject: [PATCH 273/320] New TP templates related to TP_IS_TLM --- .../LibItsMapemSpatem_Templates.ttcn | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn index 518ff033..9dcac871 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn @@ -685,6 +685,54 @@ module LibItsMapemSpatem_Templates { regional := p_regional } + template (present) SPAT mw_spatem_intersections( + template (present) SPAT.intersections p_intersections := ? + ) modifies mw_defaultSpatem := { + intersections := p_intersections + } + + template (present) IntersectionState mw_IntersectionState( + template (present) IntersectionState.id p_id := ?, + template (present) IntersectionState.revision p_revision := ?, + template (present) IntersectionState.status p_status := ?, + template (present) IntersectionState.states p_states := ? + ) := { + name := *, + id := p_id, + revision := p_revision, + status := p_status, + moy := *, + timeStamp := *, + enabledLanes := *, + states := p_states, + maneuverAssistList := *, + regional := * + } // end mw_IntersectionState + + template (present) IntersectionState mw_IntersectionState_moyAndTimeStamp( + template (present) IntersectionState.id p_id := ?, + template (present) IntersectionState.revision p_revision := ?, + template (present) IntersectionState.status p_status := ?, + template (present) IntersectionState.states p_states := ?, + template (present) IntersectionState.moy p_moy := ?, + template (present) IntersectionState.timeStamp p_timeStamp := ? + ) modifies mw_IntersectionState:= { + moy := p_moy, + timeStamp := p_timeStamp + }// end mw_IntersectionState_moyAndTimeStamp + + template (present) MovementState mw_movementState ( + template (present) MovementState.signalGroup p_signalGroup := ?, + template (present) MovementState.state_time_speed p_state_time_speed := ? + ):= { + movementName := *, //DescriptiveName OPTIONAL, + signalGroup := p_signalGroup, //SignalGroupID, + state_time_speed := p_state_time_speed, //MovementEventList, + maneuverAssistList := *, //ManeuverAssistList OPTIONAL, + regional := * //RegionalExtension {{Reg-MovementState}} OPTIONAL + } + + } // End of group spatemTemplates } // End of group spatemTemplatesRecv -- GitLab From b877232dd61b5a9749703263274aa9af708ac63d Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 5 Oct 2020 10:23:48 +0200 Subject: [PATCH 274/320] RLT implementation --- .../MapemSpatem/LibItsMapemSpatem_Pixits.ttcn | 9 +- .../LibItsMapemSpatem_Templates.ttcn | 101 +++++++++++++++--- .../LibItsMapemSpatem_TypesAndValues.ttcn | 56 +++++----- 3 files changed, 125 insertions(+), 41 deletions(-) diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Pixits.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Pixits.ttcn index a28bd440..db041201 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Pixits.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Pixits.ttcn @@ -16,6 +16,7 @@ module LibItsMapemSpatem_Pixits { import from LibCommon_BasicTypesAndValues all; // LibIts + import from ITS_Container language "ASN.1:1997" all; import from DSRC language "ASN.1:1997" all; import from DSRC_REGION_noCircular language "ASN.1:1997" all; @@ -38,7 +39,7 @@ module LibItsMapemSpatem_Pixits { * @desc Id for IntersectionReferenceID DF sending * @see ETSI TS 103 191-3 Table B.7 */ - modulepar IntersectionID PX_INTERSECTION_ID := 1500; + modulepar IntersectionID PX_INTERSECTION_ID := 7; /** * @desc SignalGroup for MovementState DF sending @@ -46,4 +47,10 @@ module LibItsMapemSpatem_Pixits { */ modulepar SignalGroupID PX_SIGNAL_GROUP_ID := 128; + /** + * @desc 3D Reference point latitude + * @see ETSI TS 103 191-3 Table B.7 + */ + modulepar Latitude PX_3D_REF_POINT_LATITUDE := 0; + } // end LibItsMapemSpatem_Pixits diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn index 518ff033..8a7d65f8 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn @@ -214,10 +214,18 @@ module LibItsMapemSpatem_Templates { } /** - * @desc Send template for Upper Tester Trigger event - */ - template (value) UtMapemSpatemTrigger m_utTriggerEvent ( Event p_event ) := { - event := p_event + * @desc Send template for Upper Tester Trigger event + */ + template (omit) UtMapemSpatemTrigger m_utTriggerEvent( + in Event p_event, + in template (omit) IntersectionID p_intersectionID := omit, + in template (omit) RegulatorySpeedLimit p_regulatorySpeedLimit := omit, + in template (omit) Latitude p_latitude := omit + ) := { + event := p_event, + intersectionID := p_intersectionID, + regulatorySpeedLimit := p_regulatorySpeedLimit, + latitude := p_latitude } } @@ -310,9 +318,9 @@ module LibItsMapemSpatem_Templates { * @param p_messageID The expected message id (Default: MAPEM id) */ template (present) ItsPduHeader mw_itsPduHeaderMapem( - template (present) StationID p_stationID := ?, - template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, - template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_mapem_ + template (present) StationID p_stationID := ?, + template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, + template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_mapem_ ) := { protocolVersion := p_protocolVersion, messageID := p_messageID, @@ -326,9 +334,9 @@ module LibItsMapemSpatem_Templates { * @param p_messageID The expected message id (Default: SPATEM id) */ template (present) ItsPduHeader mw_itsPduHeaderSpatem( - template (present) StationID p_stationID := ?, - template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, - template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_spatem_ + template (present) StationID p_stationID := ?, + template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, + template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_spatem_ ) := { protocolVersion := p_protocolVersion, messageID := p_messageID, @@ -487,7 +495,7 @@ module LibItsMapemSpatem_Templates { layerType := *, layerID := *, intersections := *, - roadSegments := *, + roadSegments := ?, dataParameters := *, restrictionList := *, regional := * @@ -496,17 +504,32 @@ module LibItsMapemSpatem_Templates { /** * @desc Receive template for MAPEM Message with no LayerType */ - template (present) MapData mw_mapemWellFormatted modifies mw_defaultMapem := { + template (present) MapData mw_mapem( + template (present) IntersectionGeometryList p_intersections := ?, + template (present) RoadSegmentList p_roadSegments := ? + ) modifies mw_defaultMapem := { layerType := omit, - layerID := omit + layerID := omit, + intersections := p_intersections, + roadSegments := p_roadSegments + } + + template (present) IntersectionReferenceID mw_intersectionReferenceID( + template (present) IntersectionID p_intersectionID := ?, + template RoadRegulatorID p_roadRegulatorID := * + ) := { + region := p_roadRegulatorID, // a globally unique regional assignment value typical assigned to a regional DOT authority the value zero shall be used for testing needs + id := p_intersectionID // a unique mapping to the intersection in question within the above region of use } /** * @desc Receive template for MAPEM Message with no LayerType */ template (present) MapData mw_mapemLayerType( - in template (present) LayerID p_layerID := ? - ) modifies mw_mapemWellFormatted := { + template (present) IntersectionGeometryList p_intersections := ?, + template (present) RoadSegmentList p_roadSegments := ?, + template (present) LayerID p_layerID := ? + ) modifies mw_mapem := { layerType := ?, layerID := p_layerID } @@ -528,6 +551,17 @@ module LibItsMapemSpatem_Templates { regional := * } + template (present) Position3D mw_position3D( + template (present) Latitude p_latitude := ?, + template (present) Longitude p_longitude := ?, + template Position3D.regional p_regional := * + ) := { + lat := p_latitude, // in 1/10th micro degrees + long := p_longitude, // in 1/10th micro degrees + elevation := omit, // in 10 cm units + regional := p_regional + } + template (present) RoadSegment mw_roadSegment( template (present) RoadSegmentReferenceID p_id := ?, template (present) MsgCount p_revision := ?, @@ -544,8 +578,45 @@ module LibItsMapemSpatem_Templates { regional := * } + template (present) GenericLane mw_roadLane( + template (present) LaneID p_laneID := ?, + template (present) LaneAttributes p_laneAttributes := ?, + template ApproachID p_ingressApproach := *, + template ApproachID p_egressApproach := *, + template ConnectsToList p_connectsTo := * + ) := { + laneID := p_laneID, + name := *, + ingressApproach := p_ingressApproach, + egressApproach := p_egressApproach, + laneAttributes := p_laneAttributes, + maneuvers := *, + nodeList := ?, + connectsTo := p_connectsTo, + overlays := *, + regional := * + } + } // End of group mapemTemplatesRecv + template (present) NodeXY mw_nodeXY( + template (present) NodeOffsetPointXY p_delta := ?, + template (present) NodeAttributeSetXY p_attributes := ? + ) := { + delta := p_delta, + attributes := p_attributes + } + + template (present) NodeAttributeSetXY mw_nodeAttributeSetXY_default := { + localNode := *, + disabled := *, + enabled := *, + data := *, + dWidth := ?, + dElevation := *, + regional := * + } + } // End of group mapemTemplates group spatemTemplates { diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn index b4a79631..8823a551 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn @@ -19,6 +19,8 @@ module LibItsMapemSpatem_TypesAndValues { import from ITS_Container language "ASN.1:1997" all; import from MAPEM_PDU_Descriptions language "ASN.1:1997" all; import from SPATEM_PDU_Descriptions language "ASN.1:1997" all; + import from DSRC language "ASN.1:1997" all; + import from DSRC_REGION_noCircular language "ASN.1:1997" all; import from EfcDsrcGeneric language "ASN.1:1997" all; // LibItsCommon @@ -30,35 +32,39 @@ module LibItsMapemSpatem_TypesAndValues { group utPrimitives { - /** - * @desc Upper Tester message to initialize IUT - * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use - */ - type record UtMapemSpatemInitialize { - Oct8 hashedId8 - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester results message of the MAPEM/SPATEM IUT - * @member utMapemSpatemInitialize - - * @member utMapemSpatemTriggerResult - - */ - type union UtMapemSpatemResults { - boolean utMapemSpatemInitializeResult, - boolean utMapemSpatemTriggerResult - } with { - variant "" - } // End of type UtMapemSpatemResults - + /** + * @desc Upper Tester message to initialize IUT + * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use + */ + type record UtMapemSpatemInitialize { + Oct8 hashedId8 + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Upper Tester results message of the MAPEM/SPATEM IUT + * @member utMapemSpatemInitialize - + * @member utMapemSpatemTriggerResult - + */ + type union UtMapemSpatemResults { + boolean utMapemSpatemInitializeResult, + boolean utMapemSpatemTriggerResult + } with { + variant "" + } // End of type UtMapemSpatemResults + /** * @desc Upper Tester message to request triggering of an event at IUT */ type record UtMapemSpatemTrigger { - Event event - } with { - variant "FIELDORDER(msb)" + Event event, + IntersectionID intersectionID, + RegulatorySpeedLimit regulatorySpeedLimit, + Latitude latitude + + } with { + variant "FIELDORDER(msb)" } type enumerated Event { -- GitLab From 4db73ea0ff282cdeef844f349f990c08d0f33376 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 7 Oct 2020 16:39:13 +0200 Subject: [PATCH 275/320] Validate SREM ATS --- ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn | 2 ++ ttcn/SremSsem/LibItsSremSsem_Templates.ttcn | 32 ++++++++++++++------- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn b/ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn index 0ab21535..4a9e7a9a 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn @@ -56,7 +56,9 @@ module LibItsSremSsem_Pixits { }; modulepar charstring PX_SREM_CERTIFICATE_X := "CERT_IUT_SREM_SSP_01"; + modulepar octetstring PX_SREM_CERTIFICATE_X_SSP := '024000'O; + modulepar BasicVehicleRole PX_SREM_CERTIFICATE_X_ROLE := publicTransport; } // end LibItsSremSsem_Pixits diff --git a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn index 762832a2..d6d0c4ed 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn @@ -594,7 +594,20 @@ module LibItsSremSsem_Templates { timeStamp := omit, second := PX_SECOND, sequenceNumber := omit, - status := { m_signalStatus(PX_SEQUENCE_NUMBER, m_requestorDescription(m_vehicleID(f_getIutStationId())), m_signalRequest(m_intersectionReferenceID, 17, priorityRequestTypeReserved, { lane := 2 } )) }, + status := { + m_signalStatus( + PX_SEQUENCE_NUMBER, + m_requestorDescription( + m_vehicleID(f_getIutStationId() + )), + m_signalRequest( + m_intersectionReferenceID, + PX_REQUEST_ID, + priorityRequestTypeReserved, + { lane := 1 } + ) + ) + }, regional := omit } @@ -630,7 +643,7 @@ module LibItsSremSsem_Templates { ) := { sequenceNumber := p_sequenceNumber, id := p_signalRequest.id, - sigStatus := { m_signalStatusPackage(m_requester(p_requestor.id, p_signalRequest.requestID, p_sequenceNumber, p_requestor.type_.role)) }, + sigStatus := { m_signalStatusPackage(m_requester(p_requestor, p_signalRequest.requestID, p_sequenceNumber)) }, regional := omit } @@ -645,17 +658,16 @@ module LibItsSremSsem_Templates { regional := * } - template (omit) SignalRequesterInfo m_requester( - in template (value) VehicleID p_id, - in template (value) RequestID p_request, - in template (value) MsgCount p_sequenceNumber, - in template (omit) BasicVehicleRole p_role := omit + template (value) SignalRequesterInfo m_requester( + in template (value) RequestorDescription p_requestor, + in template (value) RequestID p_request, + in template (value) MsgCount p_sequenceNumber ) := { - id := p_id, + id := p_requestor.id, request := p_request, sequenceNumber := p_sequenceNumber, - role := p_role, - typeData := omit + role := omit,//p_requestor.type_.role, + typeData := p_requestor.type_ } template SignalRequesterInfo mw_requester( -- GitLab From 10e146e99a9933a3797f12682b94d595e79c9933 Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Thu, 8 Oct 2020 16:25:30 +0200 Subject: [PATCH 276/320] Validate RTCMEM ATS --- ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn b/ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn index fc67e98e..62d015d1 100644 --- a/ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn +++ b/ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn @@ -215,7 +215,7 @@ module LibItsRtcmem_Templates { template ItsPduHeader mw_itsPduHeaderRtcmem( template (present) StationID p_stationID := ?, template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, - template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_srem_ + template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_rtcmem_ ) := { protocolVersion := p_protocolVersion, messageID := p_messageID, -- GitLab From f52dd161042aced82b12114250faec68dcfadde0 Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 12 Oct 2020 10:26:30 +0200 Subject: [PATCH 277/320] Continue RLT implementation --- .../LibItsMapemSpatem_Functions.ttcn | 23 +++++++- ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn | 14 +++-- .../LibItsMapemSpatem_Templates.ttcn | 55 ++++++++++--------- .../LibItsMapemSpatem_TestSystem.ttcn | 4 +- ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn | 23 +++++++- ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn | 11 ++-- ttcn/SremSsem/LibItsSremSsem_Templates.ttcn | 8 +-- 7 files changed, 94 insertions(+), 44 deletions(-) diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn index 26ab01c2..5426b5ba 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn @@ -19,6 +19,7 @@ module LibItsMapemSpatem_Functions { // LibIts import from ITS_Container language "ASN.1:1997" all; import from DSRC language "ASN.1:1997" all; + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; // LibItsCommon import from LibItsCommon_TypesAndValues all; @@ -26,6 +27,9 @@ module LibItsMapemSpatem_Functions { import from LibItsCommon_Functions all; import from LibItsCommon_Pixits all; + // LibItsSecurity + import from LibItsSecurity_Functions all; + // LibItsMapemSpatem import from LibItsMapemSpatem_TestSystem all; import from LibItsMapemSpatem_TypesAndValues all; @@ -274,10 +278,25 @@ module LibItsMapemSpatem_Functions { * @desc Brings the IUT into an initial state. * @return FncRetCode */ - function f_prInitialState() runs on ItsMapemSpatem return FncRetCode { + function f_prInitialState( + in charstring p_certificate_id := "" + ) runs on ItsMapemSpatem return FncRetCode { var FncRetCode v_ret := e_success; - f_utInitializeIut(m_mapemSpatemInitialize); + // Initialize IUT with given certificate + if (p_certificate_id != "") { // Initialize IUT with given certificate + var HashedId8 v_hashedId8 := '0000000000000000'O; + + fx_readCertificateDigest("CERT_SRM_SSP_NONE", v_hashedId8); + if ('0000000000000000'O == v_hashedId8) { + // Certificate not found + log("*** " & testcasename() & ": Required IUT certificate is not found on the test system ***"); + return e_timeout; + } + f_utInitializeIut(m_mapemSpatemInitialize(v_hashedId8)); + } else { + f_utInitializeIut(m_mapemSpatemInitialize); + } f_prDefault(); return v_ret; } diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn index 56ef2c0c..1529ce6f 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn @@ -48,20 +48,26 @@ module LibItsMapemSpatem_Pics { * @desc Support for MAPEM reception * @see TODO */ - modulepar boolean PICS_MAPEM_HAS_LANE_WIDTH := false; + modulepar boolean PICS_MAPEM_TRANSMISSION_RATE := false; /** - * @desc Support for MAPEM reception + * @desc Support for MAPEM pedestrians manoeuvres * @see TODO */ - modulepar boolean PICS_MAPEM_TRANSMISSION_RATE := false; + modulepar boolean PICS_PEDESTRIAN_MANOEUVRES := false; /** - * @desc Support for MAPEM reception + * @desc Support for MAPEM cars manoeuvres * @see TODO */ modulepar boolean PICS_SPECIALIZED_CARS_MANOEUVRES := false; + /** + * @desc Support for MAPEM width attribut + * @see TODO + */ + modulepar boolean PICS_MAPEM_HAS_LANE_WIDTH := false; + /** * @desc Support for SPATEM generation * @see ETSI TS 103 191-1 Table A.2 diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn index c4ecebb5..eb6a7e5b 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn @@ -21,6 +21,7 @@ module LibItsMapemSpatem_Templates { import from SPATEM_PDU_Descriptions language "ASN.1:1997" all; import from DSRC language "ASN.1:1997" all; import from DSRC_REGION_noCircular language "ASN.1:1997" all; + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; // LibItsCommon import from LibItsCommon_Functions all; @@ -111,8 +112,8 @@ module LibItsMapemSpatem_Templates { */ template (present) MapemInd mw_mapemIndWithSecurityParameters( template (present) MAPEM p_mapemMsg, - template Bit256 p_ssp := *, - template UInt32 p_its_aid := * + template (present) Bit24 p_ssp := ?, + template (present) UInt32 p_its_aid := ? ) modifies mw_mapemInd := { ssp := p_ssp, its_aid := p_its_aid @@ -194,8 +195,8 @@ module LibItsMapemSpatem_Templates { */ template (present) SpatemInd mw_spatemIndWithSecurityParameters( template (present) SPATEM p_spatemMsg, - template Bit256 p_ssp := *, - template UInt32 p_its_aid := * + template (present) Bit24 p_ssp := ?, + template (present) UInt32 p_its_aid := ? ) modifies mw_spatemInd := { ssp := p_ssp, its_aid := p_its_aid @@ -209,8 +210,10 @@ module LibItsMapemSpatem_Templates { * @desc Send template for Upper Tester event initialization * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use */ - template (value) UtMapemSpatemInitialize m_mapemSpatemInitialize := { - hashedId8 := '0000000000000000'O + template (value) UtMapemSpatemInitialize m_mapemSpatemInitialize( + in HashedId8 p_hashedId8 := '0000000000000000'O + ) := { + hashedId8 := p_hashedId8 } /** @@ -448,7 +451,7 @@ module LibItsMapemSpatem_Templates { ingressApproach := p_ingressApproach, // inbound Approach IDs to which this lane belongs egressApproach := p_egressApproach, // outbound Approach IDs to which this lane belongs laneAttributes := p_laneAttributes, // All Attribute information about the basic selected lane type - maneuvers := p_allowedManeuvers, // the permitted maneuvers for this lane + maneuvers := omit, // the permitted maneuvers for this lane nodeList := p_nodeListXY, // Lane spatial path information as well as various Attribute information along the node path // Attributes found here are more general and may come and go over the length of the lane. connectsTo := p_connectsToList, // a list of other lanes and their signal group IDs each connecting lane and its signal group ID is given, therefore this element provides the information formerly in "signalGroups" in prior editions. @@ -492,11 +495,11 @@ module LibItsMapemSpatem_Templates { template (present) MapData mw_defaultMapem := { timeStamp := *, msgIssueRevision := ?, - layerType := *, - layerID := *, + layerType := omit, + layerID := omit, intersections := *, - roadSegments := ?, - dataParameters := *, + roadSegments := omit, + dataParameters := omit, restrictionList := *, regional := * } @@ -522,18 +525,6 @@ module LibItsMapemSpatem_Templates { id := p_intersectionID // a unique mapping to the intersection in question within the above region of use } - /** - * @desc Receive template for MAPEM Message with no LayerType - */ - template (present) MapData mw_mapemLayerType( - template (present) IntersectionGeometryList p_intersections := ?, - template (present) RoadSegmentList p_roadSegments := ?, - template (present) LayerID p_layerID := ? - ) modifies mw_mapem := { - layerType := ?, - layerID := p_layerID - } - template (present) IntersectionGeometry mw_intersectionGeometry( template (present) IntersectionReferenceID p_id := ?, template (present) MsgCount p_revision := ?, @@ -547,7 +538,7 @@ module LibItsMapemSpatem_Templates { laneWidth := *, // Reference width used by all subsequent lanes unless a new width is given speedLimits := *, laneSet := p_laneList, // Data about one or more lanes (all lane data is found here) - preemptPriorityData := *, // data about one or more regional preempt or priority zones + preemptPriorityData := omit, // data about one or more regional preempt or priority zones regional := * } @@ -590,13 +581,25 @@ module LibItsMapemSpatem_Templates { ingressApproach := p_ingressApproach, egressApproach := p_egressApproach, laneAttributes := p_laneAttributes, - maneuvers := *, + maneuvers := omit, nodeList := ?, connectsTo := p_connectsTo, - overlays := *, + overlays := omit, regional := * } + /** + * @desc Receive template for MAPEM Message with no LayerType + */ + template (present) MapData mw_mapemLayerType( + template (present) IntersectionGeometryList p_intersections := ?, + template (present) RoadSegmentList p_roadSegments := ?, + template (present) LayerID p_layerID := ? + ) modifies mw_mapem := { + layerType := omit, + layerID := p_layerID + } + } // End of group mapemTemplatesRecv template (present) NodeXY mw_nodeXY( diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_TestSystem.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_TestSystem.ttcn index a93e7e5a..3d1ccb8b 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_TestSystem.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_TestSystem.ttcn @@ -111,7 +111,7 @@ module LibItsMapemSpatem_TestSystem { UInt8 gnTrafficClass optional, UInt16 btpDestinationPort optional, UInt16 btpInfo optional, - Bit256 ssp optional, + Bit24 ssp optional, UInt32 its_aid optional } with { @@ -127,7 +127,7 @@ module LibItsMapemSpatem_TestSystem { UInt8 gnTrafficClass optional, UInt16 btpDestinationPort optional, UInt16 btpInfo optional, - Bit256 ssp optional, + Bit24 ssp optional, UInt32 its_aid optional } with { diff --git a/ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn b/ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn index bfc9c92e..bf3c12d3 100644 --- a/ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn +++ b/ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn @@ -8,6 +8,7 @@ module LibItsRtcmem_Functions { // LibIts import from ITS_Container language "ASN.1:1997" all; import from RTCMEM_PDU_Descriptions language "ASN.1:1997" all; + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; // LibItsCommon import from LibItsCommon_TypesAndValues all; @@ -15,6 +16,9 @@ module LibItsRtcmem_Functions { import from LibItsCommon_Functions all; import from LibItsCommon_Pixits all; + // LibItsSecurity + import from LibItsSecurity_Functions all; + // LibItsRtcmem import from LibItsRtcmem_TestSystem all; import from LibItsRtcmem_TypesAndValues all; @@ -317,10 +321,25 @@ module LibItsRtcmem_Functions { * @desc Brings the IUT into an initial state. * @return FncRetCode */ - function f_prInitialState() runs on ItsRtcmem return FncRetCode { + function f_prInitialState( + in charstring p_certificate_id := "" + ) runs on ItsRtcmem return FncRetCode { var FncRetCode v_ret := e_success; - f_utInitializeIut(m_rtcmemInitialize); + // Initialize IUT with given certificate + if (p_certificate_id != "") { // Initialize IUT with given certificate + var HashedId8 v_hashedId8 := '0000000000000000'O; + + fx_readCertificateDigest("CERT_SRM_SSP_NONE", v_hashedId8); + if ('0000000000000000'O == v_hashedId8) { + // Certificate not found + log("*** " & testcasename() & ": Required IUT certificate is not found on the test system ***"); + return e_timeout; + } + f_utInitializeIut(m_rtcmemInitialize(v_hashedId8)); + } else { + f_utInitializeIut(m_rtcmemInitialize); + } f_prDefault(); return v_ret; } diff --git a/ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn b/ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn index 62d015d1..65372610 100644 --- a/ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn +++ b/ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn @@ -8,6 +8,7 @@ module LibItsRtcmem_Templates { import from ITS_Container language "ASN.1:1997" all; import from RTCMEM_PDU_Descriptions language "ASN.1:1997" all; import from DSRC language "ASN.1:1997" all; + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; // LibItsCommon import from LibItsCommon_TypesAndValues all; @@ -97,8 +98,8 @@ module LibItsRtcmem_Templates { */ template (present) RtcmemInd mw_rtcmemIndWithSecurityParameters( template (present) RTCMEM p_rtcmemMsg, - template Bit24 p_ssp := *, - template UInt32 p_its_aid := * + template (present) Bit24 p_ssp := ?, + template (present) UInt32 p_its_aid := ? ) modifies mw_rtcmemInd := { ssp := p_ssp, its_aid := p_its_aid @@ -112,8 +113,10 @@ module LibItsRtcmem_Templates { * @desc Send template for Upper Tester event initialization * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use */ - template (value) UtRtcmemInitialize m_rtcmemInitialize := { - hashedId8 := '0000000000000000'O + template (value) UtRtcmemInitialize m_rtcmemInitialize( + in HashedId8 p_hashedId8 := '0000000000000000'O + ) := { + hashedId8 := p_hashedId8 } /** diff --git a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn index d6d0c4ed..2ab2745f 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn @@ -111,8 +111,8 @@ module LibItsSremSsem_Templates { */ template (present) SremInd mw_sremIndWithSecurityParameters( template (present) SREM p_sremMsg, - template Bit24 p_ssp := *, - template UInt32 p_its_aid := * + template (present) Bit24 p_ssp := ?, + template (present) UInt32 p_its_aid := ? ) modifies mw_sremInd := { ssp := p_ssp, its_aid := p_its_aid @@ -194,8 +194,8 @@ module LibItsSremSsem_Templates { */ template (present) SsemInd mw_ssemIndWithSecurityParameters( template (present) SSEM p_ssemMsg, - template Bit24 p_ssp := *, - template UInt32 p_its_aid := * + template (present) Bit24 p_ssp := ?, + template (present) UInt32 p_its_aid := ? ) modifies mw_ssemInd := { ssp := p_ssp, its_aid := p_its_aid -- GitLab From 8806668fd8e2b238e3b6f6aaf826c0cae94f1b13 Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Wed, 14 Oct 2020 11:31:31 +0200 Subject: [PATCH 278/320] Validate IVIM & MAPEM ATS --- ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn | 4 ++-- .../LibItsMapemSpatem_EncdecDeclarations.ttcn | 16 ++++++++-------- .../MapemSpatem/LibItsMapemSpatem_Functions.ttcn | 2 ++ .../MapemSpatem/LibItsMapemSpatem_Templates.ttcn | 6 +++--- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn b/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn index 16c2cc71..8c82d759 100644 --- a/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn +++ b/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn @@ -48,8 +48,8 @@ module LibItsCommon_ASN1_NamedNumbers { const ItsPduHeader.messageID ItsPduHeader_messageID_denm_ := 1; const ItsPduHeader.messageID ItsPduHeader_messageID_cam_ := 2; const ItsPduHeader.messageID ItsPduHeader_messageID_poi_ := 3; - const ItsPduHeader.messageID ItsPduHeader_messageID_spatem_ := 4; - const ItsPduHeader.messageID ItsPduHeader_messageID_mapem_ := 5; + const ItsPduHeader.messageID ItsPduHeader_messageID_mapem_ := 4; + const ItsPduHeader.messageID ItsPduHeader_messageID_spatem_ := 5; const ItsPduHeader.messageID ItsPduHeader_messageID_ivim_ := 6; const ItsPduHeader.messageID ItsPduHeader_messageID_ev_rsr_ := 7; const ItsPduHeader.messageID ItsPduHeader_messageID_tistpgtransaction_ := 8; diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_EncdecDeclarations.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_EncdecDeclarations.ttcn index 7f8620ab..6177edd0 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_EncdecDeclarations.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_EncdecDeclarations.ttcn @@ -4,16 +4,16 @@ module LibItsMapemSpatem_EncdecDeclarations { import from MAPEM_PDU_Descriptions language "ASN.1:1997" all; import from SPATEM_PDU_Descriptions language "ASN.1:1997" all; - external function fx_enc_MAPEM (MAPEM pdu) return octetstring - with {extension "prototype(convert) encode(BER:BER_ENCODE_CER)"} + external function fx_enc_MAPEM (MAPEM pdu) return bitstring + with {extension "prototype(convert) encode(PER)"} - external function fx_dec_MAPEM (octetstring stream) return MAPEM - with {extension "prototype(convert) decode(BER:BER_ACCEPT_ALL)"} + external function fx_dec_MAPEM (inout bitstring b, out MAPEM p) return integer + with {extension "prototype(sliding) decode(PER)"} - external function fx_enc_SPATEM (SPATEM pdu) return octetstring - with {extension "prototype(convert) encode(BER:BER_ENCODE_CER)"} + external function fx_enc_SPATEM (SPATEM pdu) return bitstring + with {extension "prototype(convert) encode(PER)"} - external function fx_dec_SPATEM (octetstring stream) return SPATEM - with {extension "prototype(convert) decode(BER:BER_ACCEPT_ALL)"} + external function fx_dec_SPATEM (inout bitstring b, out SPATEM p) return integer + with {extension "prototype(sliding) decode(PER)"} } // End of module LibItsMapemSpatem_EncdecDeclarations diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn index 5426b5ba..88cc06e9 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn @@ -208,11 +208,13 @@ module LibItsMapemSpatem_Functions { var UtSpatemEventInd v_spatemevent; [] utPort.receive(UtMapemEventInd:?) -> value v_mapemevent { //store every upper tester indication received + log("*** " & testcasename() & ": INFO: Store UtMapemEventInd messge ***"); vc_utMapemEvents[lengthof(vc_utMapemEvents)] := v_mapemevent; repeat; } [] utPort.receive(UtSpatemEventInd:?) -> value v_spatemevent { //store every upper tester indication received + log("*** " & testcasename() & ": INFO: Store UtSpatemEventInd messge ***"); vc_utSpatemEvents[lengthof(vc_utSpatemEvents)] := v_spatemevent; repeat; } diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn index eb6a7e5b..331f7dae 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn @@ -400,9 +400,9 @@ module LibItsMapemSpatem_Templates { * @desc Receive template for MAPEM Message */ template (omit) MapData m_mapem( - in template (value) MsgCount p_msgIssueRevision, - in template (omit) IntersectionGeometryList p_intersectionGeometryList := omit, - in template (omit) RoadSegmentList p_roadSegments := omit + in template (value) MsgCount p_msgIssueRevision, + in template (omit) IntersectionGeometryList p_intersectionGeometryList := omit, + in template (omit) RoadSegmentList p_roadSegments := omit ) modifies m_defaultMapem := { msgIssueRevision := p_msgIssueRevision, intersections := p_intersectionGeometryList, -- GitLab From 628fdb38f20d8333d0190d77043421fd1b06afb4 Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 23 Oct 2020 11:38:21 +0200 Subject: [PATCH 279/320] Add Timers PICS --- ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn | 278 ++++++++++--------- 1 file changed, 141 insertions(+), 137 deletions(-) diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn index 1529ce6f..fb3e1941 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn @@ -1,137 +1,141 @@ -/** - * @author ETSI / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn $ - * $Id: LibItsMapemSpatem_Pics.ttcn 1312 2016-12-14 09:21:45Z garciay $ - * @desc MAPEM SPATEM PICS - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsMapemSpatem_Pics { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - - /** - * @desc Is the IUT running in secured mode? - * @see ETSI TS 103 191-1 Table A.1.1 - */ - modulepar boolean PICS_IS_IUT_SECURED := false; - - /** - * @desc Support for MAPEM reception - * @see ETSI TS 103 191-1 Table A.1.2 - */ - modulepar boolean PICS_ETSI_STRICT := false; - - /** - * @desc Support for MAPEM reception - * @see ETSI TS 103 191-1 Table A.1.3 - */ - modulepar boolean PICS_SHORT_RANGE := false; - - /** - * @desc Support for MAPEM generation - * @see ETSI TS 103 191-1 Table A.2 - */ - modulepar boolean PICS_MAPEM_GENERATION := true; - - /** - * @desc Support for MAPEM reception - * @see ETSI TS 103 191-1 Table A.2 - */ - modulepar boolean PICS_MAPEM_RECEPTION := true; - - /** - * @desc Support for MAPEM reception - * @see TODO - */ - modulepar boolean PICS_MAPEM_TRANSMISSION_RATE := false; - - /** - * @desc Support for MAPEM pedestrians manoeuvres - * @see TODO - */ - modulepar boolean PICS_PEDESTRIAN_MANOEUVRES := false; - - /** - * @desc Support for MAPEM cars manoeuvres - * @see TODO - */ - modulepar boolean PICS_SPECIALIZED_CARS_MANOEUVRES := false; - - /** - * @desc Support for MAPEM width attribut - * @see TODO - */ - modulepar boolean PICS_MAPEM_HAS_LANE_WIDTH := false; - - /** - * @desc Support for SPATEM generation - * @see ETSI TS 103 191-1 Table A.2 - */ - modulepar boolean PICS_SPATEM_GENERATION := true; - - /** - * @desc Support for SPATEM reception - * @see ETSI TS 103 191-1 Table A.2 - */ - modulepar boolean PICS_SPATEM_RECEPTION := true; - - /** - * @desc Support for SPATEM reception - * @see TODO - */ - modulepar boolean PICS_SPATEM_PEDESTRIAN_MANOEUVRES := false; - - /** - * @desc Support for SPATEM reception - * @see TODO - */ - modulepar boolean PICS_SPATEM_SPECIALIZED_MANOEUVRES := false; - - /** - * @desc Support for SPATEM reception - * @see TODO - */ - modulepar boolean PICS_SPATEM_HAS_TIMING := false; - - /** - * @desc Support for SPATEM reception - * @see TODO - */ - modulepar boolean PICS_SPATEM_PRIORITIZATION := false; - - /** - * @desc Support for SPATEM reception - * @see TODO - */ - modulepar boolean PICS_SPATEM_PEDESTRIAN_MAOEUVRES := false; - - /** - * @desc Support for SPATEM reception - * @see TODO - */ - modulepar boolean PICS_SPATEM_HAS_OPTIMAL_SPEED := false; - - /** - * @desc Support for SPATEM reception - * @see TODO - */ - modulepar boolean PICS_SPATEM_HAS_SIGNAL_PROGRESSION_SPEED := false; - - /** - * @desc Support for SPATEM reception - * @see TODO - */ - modulepar boolean PICS_SPATEM_HAS_EGRESS_QUEUE := false; - - /** - * @desc Support for SPATEM reception - * @see TODO - */ - modulepar boolean PICS_SPATEM_TRANSMISSION_RATE := false; - -} // end LibItsSremSsem_Pics +/** + * @author ETSI / STF517 + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn $ + * $Id: LibItsMapemSpatem_Pics.ttcn 1312 2016-12-14 09:21:45Z garciay $ + * @desc MAPEM SPATEM PICS + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * + */ +module LibItsMapemSpatem_Pics { + + // LibCommon + import from LibCommon_BasicTypesAndValues all; + + /** + * @desc Is the IUT running in secured mode? + * @see ETSI TS 103 191-1 Table A.1.1 + */ + modulepar boolean PICS_IS_IUT_SECURED := false; + + /** + * @desc Support for MAPEM reception + * @see ETSI TS 103 191-1 Table A.1.2 + */ + modulepar boolean PICS_ETSI_STRICT := false; + + /** + * @desc Support for MAPEM reception + * @see ETSI TS 103 191-1 Table A.1.3 + */ + modulepar boolean PICS_SHORT_RANGE := false; + + /** + * @desc Support for MAPEM generation + * @see ETSI TS 103 191-1 Table A.2 + */ + modulepar boolean PICS_MAPEM_GENERATION := true; + + /** + * @desc Support for MAPEM reception + * @see ETSI TS 103 191-1 Table A.2 + */ + modulepar boolean PICS_MAPEM_RECEPTION := true; + + /** + * @desc Support for MAPEM reception + * @see TODO + */ + modulepar boolean PICS_MAPEM_TRANSMISSION_RATE := false; + + /** + * @desc Support for MAPEM pedestrians manoeuvres + * @see TODO + */ + modulepar boolean PICS_PEDESTRIAN_MANOEUVRES := false; + + /** + * @desc Support for MAPEM cars manoeuvres + * @see TODO + */ + modulepar boolean PICS_SPECIALIZED_CARS_MANOEUVRES := false; + + /** + * @desc Support for MAPEM width attribut + * @see TODO + */ + modulepar boolean PICS_MAPEM_HAS_LANE_WIDTH := false; + + modulepar float PICS_T_GENMAPEMMIN := 0.5; + + modulepar float PICS_T_GENMAPEMMAX := 2.0; + + /** + * @desc Support for SPATEM generation + * @see ETSI TS 103 191-1 Table A.2 + */ + modulepar boolean PICS_SPATEM_GENERATION := true; + + /** + * @desc Support for SPATEM reception + * @see ETSI TS 103 191-1 Table A.2 + */ + modulepar boolean PICS_SPATEM_RECEPTION := true; + + /** + * @desc Support for SPATEM reception + * @see TODO + */ + modulepar boolean PICS_SPATEM_PEDESTRIAN_MANOEUVRES := false; + + /** + * @desc Support for SPATEM reception + * @see TODO + */ + modulepar boolean PICS_SPATEM_SPECIALIZED_MANOEUVRES := false; + + /** + * @desc Support for SPATEM reception + * @see TODO + */ + modulepar boolean PICS_SPATEM_HAS_TIMING := false; + + /** + * @desc Support for SPATEM reception + * @see TODO + */ + modulepar boolean PICS_SPATEM_PRIORITIZATION := false; + + /** + * @desc Support for SPATEM reception + * @see TODO + */ + modulepar boolean PICS_SPATEM_PEDESTRIAN_MAOEUVRES := false; + + /** + * @desc Support for SPATEM reception + * @see TODO + */ + modulepar boolean PICS_SPATEM_HAS_OPTIMAL_SPEED := false; + + /** + * @desc Support for SPATEM reception + * @see TODO + */ + modulepar boolean PICS_SPATEM_HAS_SIGNAL_PROGRESSION_SPEED := false; + + /** + * @desc Support for SPATEM reception + * @see TODO + */ + modulepar boolean PICS_SPATEM_HAS_EGRESS_QUEUE := false; + + /** + * @desc Support for SPATEM reception + * @see TODO + */ + modulepar boolean PICS_SPATEM_TRANSMISSION_RATE := false; + +} // end LibItsSremSsem_Pics -- GitLab From bfa0371b25ae6b9d3f90e67448aff223efacd058 Mon Sep 17 00:00:00 2001 From: pintar Date: Thu, 12 Nov 2020 15:32:06 +0100 Subject: [PATCH 280/320] Updates due to new IVI tests --- .../LibItsCommon_ASN1_NamedNumbers.ttcn | 3 + .../IVIM/LibItsIvim_ASN1_IVInamedNumbers.ttcn | 35 ++- ttcn/IVIM/LibItsIvim_Functions.ttcn | 36 ++- ttcn/IVIM/LibItsIvim_Pixits.ttcn | 11 +- ttcn/IVIM/LibItsIvim_Templates.ttcn | 237 +++++++++++++++++- ttcn/IVIM/LibItsIvim_TestSystem.ttcn | 2 +- 6 files changed, 314 insertions(+), 10 deletions(-) diff --git a/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn b/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn index 8c82d759..f0b554f6 100644 --- a/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn +++ b/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn @@ -58,6 +58,9 @@ module LibItsCommon_ASN1_NamedNumbers { const ItsPduHeader.messageID ItsPduHeader_messageID_evcsn_ := 11; const ItsPduHeader.messageID ItsPduHeader_messageID_saem_ := 12; const ItsPduHeader.messageID ItsPduHeader_messageID_rtcmem_ := 13; + + const LanePosition LanePosition_offTheRoad_ := -1; + const LanePosition LanePosition_innerHardShoulder_ := 0; const LongitudinalAccelerationValue LongitudinalAccelerationValue_unavailable_ := 161; diff --git a/ttcn/IVIM/LibItsIvim_ASN1_IVInamedNumbers.ttcn b/ttcn/IVIM/LibItsIvim_ASN1_IVInamedNumbers.ttcn index 51b64997..390e262f 100644 --- a/ttcn/IVIM/LibItsIvim_ASN1_IVInamedNumbers.ttcn +++ b/ttcn/IVIM/LibItsIvim_ASN1_IVInamedNumbers.ttcn @@ -5,6 +5,11 @@ module LibItsIvim_ASN1_IVInamedNumbers { import from IVI language "ASN.1:1997" all; group IVI_constants { + + const Direction Direction_sameDirection_ := 0; + const Direction Direction_oppositeDirection_ := 1; + const Direction Direction_bothDirections_ := 2; + const Direction Direction_valueNotUsed_ := 3; const IviStatus IviStatus_new_ := 0; const IviStatus IviStatus_update_ := 1; @@ -16,7 +21,35 @@ import from IVI language "ASN.1:1997" all; const IviType IviType_trafficRelatedInformationMessages_ := 2; const IviType IviType_pollutionMessages_ := 3; const IviType IviType_notTrafficRelatedInformationMessages_ := 4; - + + const LaneType LaneType_traffic_ := 0; + const LaneType LaneType_through_ := 1; + const LaneType LaneType_reversible_ := 2; + const LaneType LaneType_acceleration_ := 3; + const LaneType LaneType_deceleration_ := 4; + const LaneType LaneType_leftHandTurning_ := 5; + const LaneType LaneType_rightHandTurning_ := 6; + const LaneType LaneType_dedicatedVehicle_ := 7; + const LaneType LaneType_bus_ := 8; + const LaneType LaneType_taxi_ := 9; + const LaneType LaneType_hov_ := 10; + const LaneType LaneType_hot_ := 11; + const LaneType LaneType_pedestrian_ := 12; + const LaneType LaneType_bikeLane_ := 13; + const LaneType LaneType_median_ := 14; + const LaneType LaneType_striping_ := 15; + const LaneType LaneType_trackedVehicle_ := 16; + const LaneType LaneType_parking_ := 17; + const LaneType LaneType_emergency_ := 18; + const LaneType LaneType_verge_ := 19; + + const LaneStatus LaneStatus_open_ := 0; + const LaneStatus LaneStatus_closed_ := 1; + const LaneStatus LaneStatus_mergeR_ := 2; + const LaneStatus LaneStatus_mergeL_ := 3; + const LaneStatus LaneStatus_mergeLR_ := 4; + const LaneStatus LaneStatus_provisionallyOpen_ := 5; + const LaneStatus LaneStatus_diverging_ := 6; } // end IVI_constants diff --git a/ttcn/IVIM/LibItsIvim_Functions.ttcn b/ttcn/IVIM/LibItsIvim_Functions.ttcn index e236b5eb..2c2f25fa 100644 --- a/ttcn/IVIM/LibItsIvim_Functions.ttcn +++ b/ttcn/IVIM/LibItsIvim_Functions.ttcn @@ -1,5 +1,5 @@ /** - * @author ETSI / STF517 + * @author ETSI / STF517 / TTF002 * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/IVIM/LibItsIvim_Functions.ttcn $ * $Id: LibItsIvim_Functions.ttcn,v 1.2 2018/05/31 15:57:12 dte Exp $ * @desc Module containing functions for IVIM @@ -28,6 +28,10 @@ module LibItsIvim_Functions { import from IVI language "ASN.1:1997" all; import from EfcDsrcGeneric language "ASN.1:1997" all; import from EfcDsrcApplication language "ASN.1:1997" all; + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + + // LibItsSecurity + import from LibItsSecurity_Functions all; // LibItsIvim import from LibItsIvim_TestSystem all; @@ -334,13 +338,35 @@ module LibItsIvim_Functions { * @desc Brings the IUT into an initial state. * @return FncRetCode */ - function f_prInitialState(Scenario p_scenario := e_staticPosition) runs on ItsIvim return FncRetCode { +// function f_prInitialState(Scenario p_scenario := e_staticPosition) runs on ItsIvim return FncRetCode { +// var FncRetCode v_ret := e_success; +// +// f_utInitializeIut(m_ivimStructureInitialize); +// +// f_prDefault(); +// +// return v_ret; +// } + function f_prInitialState(Scenario p_scenario := e_staticPosition, + in charstring p_certificate_id := "" + ) runs on ItsIvim return FncRetCode { var FncRetCode v_ret := e_success; - f_utInitializeIut(m_ivimStructureInitialize); - + // Initialize IUT with given certificate + if (p_certificate_id != "") { // Initialize IUT with given certificate + var HashedId8 v_hashedId8 := '0000000000000000'O; + + fx_readCertificateDigest("CERT_IVI_SSP_NONE", v_hashedId8); + if ('0000000000000000'O == v_hashedId8) { + // Certificate not found + log("*** " & testcasename() & ": Required IUT certificate is not found on the test system ***"); + return e_timeout; + } + f_utInitializeIut(m_ivimStructureInitialize(v_hashedId8)); + } else { + f_utInitializeIut(m_ivimStructureInitialize); + } f_prDefault(); - return v_ret; } diff --git a/ttcn/IVIM/LibItsIvim_Pixits.ttcn b/ttcn/IVIM/LibItsIvim_Pixits.ttcn index 370c9e00..b27c4aff 100644 --- a/ttcn/IVIM/LibItsIvim_Pixits.ttcn +++ b/ttcn/IVIM/LibItsIvim_Pixits.ttcn @@ -1,5 +1,5 @@ /** - * @author ETSI / STF517 + * @author ETSI / STF517 / TTF002 * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/IVIM/LibItsIvim_Pixits.ttcn $ * $Id: LibItsIvim_Pixits.ttcn 1315 2016-12-15 13:25:41Z garciay $ * @desc IVIM PIXITS @@ -83,4 +83,13 @@ module LibItsIvim_Pixits { */ modulepar integer PX_LAYOUTID := 1 + /** + * @desc IUT RScode integer variant + * see TpFunction to set the correct value + * used in f_IS_IVI_RCV_SSP_BO_03 and f_IS_IVI_RCV_SSP_BO_04 + * //add others if needed + * @see ETSI TS 103 191-3 Table B.8 + */ + modulepar integer PX_RSCODE_VA := 1 + } // End of module LibItsIvim_Pixits \ No newline at end of file diff --git a/ttcn/IVIM/LibItsIvim_Templates.ttcn b/ttcn/IVIM/LibItsIvim_Templates.ttcn index 1c3ff829..ed752b41 100644 --- a/ttcn/IVIM/LibItsIvim_Templates.ttcn +++ b/ttcn/IVIM/LibItsIvim_Templates.ttcn @@ -1,5 +1,5 @@ /** - * @author ETSI / STF517 + * @author ETSI / STF517 / TTF002 * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/IVIM/LibItsIvim_Templates.ttcn $ * $Id: LibItsIvim_Templates.ttcn 1316 2017-01-03 09:03:43Z garciay $ * @desc Module containing base template definitions for IVIM @@ -22,6 +22,7 @@ module LibItsIvim_Templates { import from EfcDsrcApplication language "ASN.1:1997" all; import from AVIAEINumberingAndDataStructures language "ASN.1:1997" all; import from CITSapplMgmtIDs language "ASN.1:1997" all; + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; // LibItsCommon import from LibItsCommon_TypesAndValues all; @@ -68,6 +69,25 @@ module LibItsIvim_Templates { ssp := *, its_aid := * } // End of template mw_ivimInd + + /** + * @desc Send template for IVI Message (IvimPort Primitive) + * @param p_iviMsg The expected IVI Message + */ + template (value) IvimInd m_ivimInd( + template (value) IVIM p_iviMsg + ) := { + msgIn := p_iviMsg, + gnNextHeader := omit, + gnHeaderType := omit, + gnHeaderSubtype := omit, + gnLifetime := omit, + gnTrafficClass := omit, + btpDestinationPort := omit, + btpInfo := omit, + ssp := omit, + its_aid := omit + } // End of template m_ivimInd /** * @desc Receive template for IVI Message (IvimPort Primitive) @@ -123,12 +143,29 @@ module LibItsIvim_Templates { its_aid := p_its_aid } // End of template mw_ivimIndWithSecurityParameters + /** + * @desc Send template for IVI Message (IvimPort Primitive) + * @param p_iviMsg The expected IVI Message + * @param p_ssp SSP security parameter + * @param p_its_aid ITS-AID value + */ + template IvimInd m_ivimIndWithSecurityParameters( + template (value) IVIM p_iviMsg, + template Bit256 p_ssp := omit, + template UInt32 p_its_aid := omit + ) modifies m_ivimInd := { + ssp := p_ssp, + its_aid := p_its_aid + } // End of template mw_ivimIndWithSecurityParameters + group utPrimitives { /** * @desc Send template for Upper Tester event initialization */ - template (value) UtIvimInitialize m_ivimStructureInitialize := { + template (value) UtIvimInitialize m_ivimStructureInitialize( + in HashedId8 p_hashedId8 := '0000000000000000'O + ) := { hashedId8 := '0000000000000000'O } // End of template m_ivimStructureInitialize @@ -506,6 +543,18 @@ module LibItsIvim_Templates { tc := p_tc } // End of template mw_iviContainer_textContainer + template (value) IviContainer m_iviContainer_layoutContainer( + in template (value) LayoutContainer p_lac + ) := { + lac := p_lac + } // End of template m_iviContainer_layoutContainer + + template (present) IviContainer mw_iviContainer_layoutContainer( + template (present) LayoutContainer p_lac := ? + ) := { + lac := p_lac + } // End of template mw_iviContainer_layoutContainer + } // End of group iviContainerGroup group geographicLocationContainerGroup { @@ -591,6 +640,42 @@ module LibItsIvim_Templates { } } // End of template m_referencePosition + template Zone m_zone_segment( + template (value) Segment p_segment := m_segment + ) := { + segment := p_segment + } // End of template m_zone_segment + + template Zone m_zone_polygonalLine( + template (value) PolygonalLine p_area := m_polygonalLine_deltaPositions + ) := { + area := p_area + } // End of template m_zone_polygonalLine + + template Segment m_segment( + template (value) PolygonalLine p_line := m_polygonalLine_deltaPositions, + template (omit) IVILaneWidth p_laneWidth := omit + ) := { + line := p_line, + laneWidth := p_laneWidth + } // End of template m_segment + + template PolygonalLine m_polygonalLine_deltaPositions( + template (value) PolygonalLine.deltaPositions p_deltaPositions := {m_deltaPosition} + ) := { + deltaPositions := p_deltaPositions + } // End of template m_segment + + template DeltaPosition m_deltaPosition( + template (value) DeltaLatitude p_deltaLatitude := 9997, + template (value) DeltaLongitude p_deltaLongitude := 9998 + ) := { + deltaLatitude := p_deltaLatitude, + deltaLongitude := p_deltaLongitude + } // End of template m_segment + + + } // End of group geographicLocationContainerGroup group generalIviContainerGroup { @@ -627,6 +712,30 @@ module LibItsIvim_Templates { roadSignCodes := p_roadSignCodes } // End of template m_gicPart_relavanceZoneId + template (value) GicPart m_gicPart_relavanceZoneId_detectionZoneId_direction( + in template (value) IviType p_iviType := IviType_regulatoryMessages_, + in template (value) GicPart.roadSignCodes p_roadSignCodes := {m_rSCode_itisCodes}, + in template (value) GicPart.relevanceZoneIds p_relevanceZoneIds := {PX_RELAVANCE_ZONEID}, + in template (value) GicPart.detectionZoneIds p_detectionZoneIds := {PX_DETECTION_ZONEID}, + in template (value) GicPart.direction p_direction := Direction_sameDirection_ + ) modifies m_gicPart_basic:= { + detectionZoneIds := p_detectionZoneIds, + relevanceZoneIds := p_relevanceZoneIds, + direction := p_direction, + iviType := p_iviType, + roadSignCodes := p_roadSignCodes + } // End of template m_gicPart_relavanceZoneId_detectionZoneId_direction + + template (value) GicPart m_gicPart_laneStatus( + in template (value) IviType p_iviType := IviType_regulatoryMessages_, + in template (value) GicPart.roadSignCodes p_roadSignCodes := {m_rSCode_itisCodes}, + in template (value) GicPart.laneStatus p_laneStatus := LaneStatus_open_ + ) modifies m_gicPart_basic:= { + iviType := p_iviType, + laneStatus := p_laneStatus, + roadSignCodes := p_roadSignCodes + } // End of template m_gicPart_relavanceZoneId + template (present) GicPart mw_gicPart_basic( template (present) IviType p_iviType := ?, template (present) GicPart.roadSignCodes p_roadSignCodes := ? @@ -724,8 +833,115 @@ module LibItsIvim_Templates { } } // End of template m_rSCode_itisCodes + template (value) RSCode m_rSCode_viennaConvention := { + layoutComponentId := omit, + code := { + viennaConvention := + { + roadSignClass := 1, // classB (1), + roadSignCode := 2, //INTEGER (1..64), + vcOption := 1, //a(1), + validity := omit, + value_ := omit, + unit := omit + } + } + } // End of template m_rSCode_viennaConvention + + template (value) RSCode m_rSCode_iso14823_trafficSignPictogram ( + template (value) RSCode.code.iso14823.pictogramCode.serviceCategoryCode.trafficSignPictogram p_trafficSignPictogram := dangerWarning + ):= { + layoutComponentId := omit, + code := { + iso14823 := { + pictogramCode := { + countryCode := omit, + serviceCategoryCode := { + trafficSignPictogram := p_trafficSignPictogram + }, + pictogramCategoryCode := { + nature := 2, + serialNumber := 3 + } + }, + attributes := omit + } + } + } // End of template m_rSCode_iso14823_trafficSignPictogram + + template (value) RSCode m_rSCode_iso14823_publicFacilitiesPictogram := { + layoutComponentId := omit, + code := { + iso14823 := { + pictogramCode := { + countryCode := omit, + serviceCategoryCode := { + publicFacilitiesPictogram := publicFacilities + }, + pictogramCategoryCode := { + nature := 2, + serialNumber := 3 + } + }, + attributes := omit + } + } + } // End of template m_rSCode_iso14823_publicFacilitiesPictogram + + template (value) RSCode m_rSCode_iso14823_ambientOrRoadConditionPictogram ( + template (value) RSCode.code.iso14823.pictogramCode.serviceCategoryCode.ambientOrRoadConditionPictogram p_ambientOrRoadConditionPictogram := ambientCondition + ):= { + layoutComponentId := omit, + code := { + iso14823 := { + pictogramCode := { + countryCode := omit, + serviceCategoryCode := { + ambientOrRoadConditionPictogram := p_ambientOrRoadConditionPictogram + }, + pictogramCategoryCode := { + nature := 2, + serialNumber := 3 + } + }, + attributes := omit + } + } + } // End of template m_rSCode_iso14823_ambientOrRoadConditionPictogram + } // End of group generalIviContainerGroup + group layoutContainerGroup { + + template (value) LayoutContainer m_layoutContainer( + in template (value) LayoutContainer.layoutComponents p_layoutComponents := {m_layoutComponent} + ) := { + layoutId := 1, + height := omit, + width := omit, + layoutComponents := p_layoutComponents + } // End of template m_tcPart_basic + + template (present) LayoutContainer mw_layoutContainer( + template (present) LayoutContainer.layoutComponents p_layoutComponents := ? + ) := { + layoutId := ?, + height := *, + width := *, + layoutComponents := p_layoutComponents + } // End of template mw_tcPart_basic + + template (value) LayoutComponent m_layoutComponent := { + layoutComponentId := 1, + height := 10, + width := 11, + x := 12, + y := 13, + textScripting := 1 + } // End of template m_layoutComponent + + } //end group layoutContainerGroup + group roadConfigurationContainerGroup { template (value) RccPart m_rccPart( @@ -750,10 +966,12 @@ module LibItsIvim_Templates { template (present) LaneInformation mw_laneInformation( template (present) LanePosition p_lanePosition := ?, + template (present) Direction p_direction := ?, template (present) LaneType p_laneType := ?, template (present) LaneStatus p_laneStatus := ? ) := { laneNumber := p_lanePosition, + direction := p_direction, validity := *, //DTM laneType := p_laneType, laneTypeQualifier := *, //CompleteVehicleCharacteristics @@ -761,6 +979,21 @@ module LibItsIvim_Templates { laneWidth := * //IVILaneWidth } + template (value) LaneInformation m_laneInformation( + template (value) LanePosition p_lanePosition := LanePosition_innerHardShoulder_, + template (value) Direction p_direction := Direction_sameDirection_, + template (value) LaneType p_laneType := LaneType_traffic_, + template (value) LaneStatus p_laneStatus := LaneStatus_open_ + ) := { + laneNumber := p_lanePosition, + direction := p_direction, + validity := omit, //DTM + laneType := p_laneType, + laneTypeQualifier := omit, //CompleteVehicleCharacteristics + laneStatus := p_laneStatus, + laneWidth := omit //IVILaneWidth + } + } // End of group roadConfigurationContainerGroup group textContainerGroup { diff --git a/ttcn/IVIM/LibItsIvim_TestSystem.ttcn b/ttcn/IVIM/LibItsIvim_TestSystem.ttcn index 0bcb6439..1d91cc27 100644 --- a/ttcn/IVIM/LibItsIvim_TestSystem.ttcn +++ b/ttcn/IVIM/LibItsIvim_TestSystem.ttcn @@ -61,7 +61,7 @@ module LibItsIvim_TestSystem { * @desc FA1 IVIM Port (IVIM/BTP/GeoNet/G5) */ type port IvimPort message { - in IvimInd; + inout IvimInd; //changed form in to inout in TTF002 due to TP_IS_IVI_RCV_SSP_* tests out IvimReq; } // End of port IvimPort -- GitLab From 12e18a7cf845de04442bb717e4663ac976c5815c Mon Sep 17 00:00:00 2001 From: pintar Date: Fri, 13 Nov 2020 09:23:38 +0100 Subject: [PATCH 281/320] Update of the last IVIM tests --- ttcn/IVIM/LibItsIvim_TestSystem.ttcn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ttcn/IVIM/LibItsIvim_TestSystem.ttcn b/ttcn/IVIM/LibItsIvim_TestSystem.ttcn index 1d91cc27..0bcb6439 100644 --- a/ttcn/IVIM/LibItsIvim_TestSystem.ttcn +++ b/ttcn/IVIM/LibItsIvim_TestSystem.ttcn @@ -61,7 +61,7 @@ module LibItsIvim_TestSystem { * @desc FA1 IVIM Port (IVIM/BTP/GeoNet/G5) */ type port IvimPort message { - inout IvimInd; //changed form in to inout in TTF002 due to TP_IS_IVI_RCV_SSP_* tests + in IvimInd; out IvimReq; } // End of port IvimPort -- GitLab From 32853fcb57a745c96b345697f83ae76bd41a7193 Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Mon, 30 Nov 2020 07:39:54 +0100 Subject: [PATCH 282/320] Validate AtsRtcmem against TTwb 1.1.30 --- ttcn/IVIM/LibItsIvim_Functions.ttcn | 2 +- ttcn/IVIM/LibItsIvim_Pixits.ttcn | 18 +++++++++--------- ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn | 8 ++++---- ttcn/Rtcmem/LibItsRtcmem_TypesAndValues.ttcn | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/ttcn/IVIM/LibItsIvim_Functions.ttcn b/ttcn/IVIM/LibItsIvim_Functions.ttcn index 2c2f25fa..45de2ac8 100644 --- a/ttcn/IVIM/LibItsIvim_Functions.ttcn +++ b/ttcn/IVIM/LibItsIvim_Functions.ttcn @@ -347,7 +347,7 @@ module LibItsIvim_Functions { // // return v_ret; // } - function f_prInitialState(Scenario p_scenario := e_staticPosition, + function f_prInitialState(Scenario p_scenario := e_staticPosition, // TODO: To be removed, not used in IVIM (RSU) in charstring p_certificate_id := "" ) runs on ItsIvim return FncRetCode { var FncRetCode v_ret := e_success; diff --git a/ttcn/IVIM/LibItsIvim_Pixits.ttcn b/ttcn/IVIM/LibItsIvim_Pixits.ttcn index b27c4aff..3f592dd4 100644 --- a/ttcn/IVIM/LibItsIvim_Pixits.ttcn +++ b/ttcn/IVIM/LibItsIvim_Pixits.ttcn @@ -39,49 +39,49 @@ module LibItsIvim_Pixits { * ZoneId 1 used in IVIM messages sent by the tester * @see ETSI TS 103 191-3 Table B.8 */ - modulepar Zid PX_ZONEID_1 := 1 + modulepar Zid PX_ZONEID_1 := 1; /** * @desc IUT ZoneId 2 identifier * ZoneId 2 used in IVIM messages sent by the tester * @see ETSI TS 103 191-3 Table B.8 */ - modulepar Zid PX_ZONEID_2 := 2 + modulepar Zid PX_ZONEID_2 := 2; /** * @desc IUT LaneId identifier * LaneId used in IVIM messages sent by the tester * @see ETSI TS 103 191-3 Table B.8 */ - modulepar LanePosition PX_LANE := 1 //innermostDrivingLane(1) + modulepar LanePosition PX_LANE := 1; //innermostDrivingLane(1) /** * @desc IUT RelavanceZoneId identifier * RelavanceZoneId used in IVIM messages sent by the tester * @see ETSI TS 103 191-3 Table B.8 */ - modulepar Zid PX_RELAVANCE_ZONEID := 1 + modulepar Zid PX_RELAVANCE_ZONEID := 1; /** * @desc IUT DetectionZoneId identifier * DetectionZoneId used in IVIM messages sent by the tester * @see ETSI TS 103 191-3 Table B.8 */ - modulepar Zid PX_DETECTION_ZONEID := 1 + modulepar Zid PX_DETECTION_ZONEID := 1; /** * @desc IUT DriverAwarenesZoneId identifier * DriverAwarenesZoneId used in IVIM messages sent by the tester * @see ETSI TS 103 191-3 Table B.8 */ - modulepar Zid PX_DRIVER_AWARENES_ZONEID := 1 + modulepar Zid PX_DRIVER_AWARENES_ZONEID := 1; /** * @desc IUT LayoutId identifier * LayoutId used in IVIM messages sent by the tester * @see ETSI TS 103 191-3 Table B.8 */ - modulepar integer PX_LAYOUTID := 1 + modulepar integer PX_LAYOUTID := 1; /** * @desc IUT RScode integer variant @@ -90,6 +90,6 @@ module LibItsIvim_Pixits { * //add others if needed * @see ETSI TS 103 191-3 Table B.8 */ - modulepar integer PX_RSCODE_VA := 1 + modulepar integer PX_RSCODE_VA := 1; -} // End of module LibItsIvim_Pixits \ No newline at end of file +} // End of module LibItsIvim_Pixits diff --git a/ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn b/ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn index bf3c12d3..c5ed2fce 100644 --- a/ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn +++ b/ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn @@ -73,7 +73,7 @@ module LibItsRtcmem_Functions { } [] utPort.receive ( UtRtcmemResults: { utRtcmemTriggerResult := false }) { tc_wait.stop; - f_selfOrClientSyncAndVerdict("SREM Trigger failed", e_error); + f_selfOrClientSyncAndVerdict("RTCMEM Trigger failed", e_error); } [] tc_wait.timeout { log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); @@ -104,7 +104,7 @@ module LibItsRtcmem_Functions { } [] utPort.receive ( UtRtcmemResults: { utRtcmemUpdateResult := false }) { tc_wait.stop; - f_selfOrClientSyncAndVerdict("SREM Update failed", e_error); + f_selfOrClientSyncAndVerdict("RTCMEM Update failed", e_error); } [] tc_wait.timeout { log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); @@ -225,7 +225,7 @@ module LibItsRtcmem_Functions { */ altstep a_default() runs on ItsRtcmem { [vc_rtcmemDefaultActive] rtcmemPort.receive(mw_rtcmemInd(mw_rtcmemPdu(mw_defaultRtcmem))) { - log("*** " & testcasename() & ": INFO: SREMM received in default ***"); + log("*** " & testcasename() & ": INFO: RTCMEMM received in default ***"); vc_rtcmemReceived := true; repeat; } @@ -364,7 +364,7 @@ module LibItsRtcmem_Functions { group receiveFunctions { /** - * @desc Awaits a SREM and returns it + * @desc Awaits a RTCMEM and returns it * @param p_rcvMsg The expected message to be received. * @param p_rcvdMsg The received message - OUT. */ diff --git a/ttcn/Rtcmem/LibItsRtcmem_TypesAndValues.ttcn b/ttcn/Rtcmem/LibItsRtcmem_TypesAndValues.ttcn index 2d82cb9e..2b383e76 100644 --- a/ttcn/Rtcmem/LibItsRtcmem_TypesAndValues.ttcn +++ b/ttcn/Rtcmem/LibItsRtcmem_TypesAndValues.ttcn @@ -28,8 +28,8 @@ module LibItsRtcmem_TypesAndValues { * @desc Upper Tester results message of the Rtcmem/Ssem IUT * @member utRtcmemInitialize - * @member utRtcmemTriggerResult - - * @member utAutoInteropTriggerResult - - * @member utRtcmemChangePositionResult - + * @member utRtcmemUpdateResult - + * @member utRtcmemTerminationResult - */ type union UtRtcmemResults { boolean utRtcmemInitializeResult, -- GitLab From 7f92ea7a9eadd582ceb5add648bdbc3d220c7edb Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 30 Nov 2020 09:13:10 +0100 Subject: [PATCH 283/320] Add received timestamp into Indication message sub-layer info --- ttcn/CAM/LibItsCam_Templates.ttcn | 1 + ttcn/CAM/LibItsCam_TestSystem.ttcn | 1 + ttcn/DENM/LibItsDenm_Templates.ttcn | 1 + ttcn/DENM/LibItsDenm_TestSystem.ttcn | 1 + ttcn/IVIM/LibItsIvim_Templates.ttcn | 2 ++ ttcn/IVIM/LibItsIvim_TestSystem.ttcn | 1 + ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn | 2 ++ ttcn/MapemSpatem/LibItsMapemSpatem_TestSystem.ttcn | 2 ++ ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn | 1 + ttcn/Rtcmem/LibItsRtcmem_TestSystem.ttcn | 1 + ttcn/SremSsem/LibItsSremSsem_Templates.ttcn | 1 + ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn | 1 + 12 files changed, 15 insertions(+) diff --git a/ttcn/CAM/LibItsCam_Templates.ttcn b/ttcn/CAM/LibItsCam_Templates.ttcn index 684832bf..5e79e265 100644 --- a/ttcn/CAM/LibItsCam_Templates.ttcn +++ b/ttcn/CAM/LibItsCam_Templates.ttcn @@ -39,6 +39,7 @@ module LibItsCam_Templates { in template (present) CAM p_camMsg ) := { msgIn := p_camMsg, + recvTime := *, gnNextHeader := *, gnHeaderType := *, gnHeaderSubtype := *, diff --git a/ttcn/CAM/LibItsCam_TestSystem.ttcn b/ttcn/CAM/LibItsCam_TestSystem.ttcn index 6f02c224..af53d5b9 100644 --- a/ttcn/CAM/LibItsCam_TestSystem.ttcn +++ b/ttcn/CAM/LibItsCam_TestSystem.ttcn @@ -126,6 +126,7 @@ module LibItsCam_TestSystem language "TTCN-3:2010 Real Time and Performance Test */ type record CamInd { CAM msgIn, + UInt64 recvTime optional, UInt8 gnNextHeader optional, UInt8 gnHeaderType optional, UInt8 gnHeaderSubtype optional, diff --git a/ttcn/DENM/LibItsDenm_Templates.ttcn b/ttcn/DENM/LibItsDenm_Templates.ttcn index 2c529e99..33c14ab3 100644 --- a/ttcn/DENM/LibItsDenm_Templates.ttcn +++ b/ttcn/DENM/LibItsDenm_Templates.ttcn @@ -64,6 +64,7 @@ module LibItsDenm_Templates { template (present) DENM p_denMsg ) := { msgIn := p_denMsg, + recvTime := *, gnNextHeader := *, gnHeaderType := *, gnHeaderSubtype := *, diff --git a/ttcn/DENM/LibItsDenm_TestSystem.ttcn b/ttcn/DENM/LibItsDenm_TestSystem.ttcn index 036800dd..d0a28de1 100644 --- a/ttcn/DENM/LibItsDenm_TestSystem.ttcn +++ b/ttcn/DENM/LibItsDenm_TestSystem.ttcn @@ -130,6 +130,7 @@ module LibItsDenm_TestSystem { */ type record DenmInd { DENM msgIn, + UInt64 recvTime optional, UInt8 gnNextHeader optional, UInt8 gnHeaderType optional, UInt8 gnHeaderSubtype optional, diff --git a/ttcn/IVIM/LibItsIvim_Templates.ttcn b/ttcn/IVIM/LibItsIvim_Templates.ttcn index ed752b41..4f88b221 100644 --- a/ttcn/IVIM/LibItsIvim_Templates.ttcn +++ b/ttcn/IVIM/LibItsIvim_Templates.ttcn @@ -59,6 +59,7 @@ module LibItsIvim_Templates { template (present) IVIM p_iviMsg := ? ) := { msgIn := p_iviMsg, + recvTime := *, gnNextHeader := *, gnHeaderType := *, gnHeaderSubtype := *, @@ -78,6 +79,7 @@ module LibItsIvim_Templates { template (value) IVIM p_iviMsg ) := { msgIn := p_iviMsg, + recvTime := omit, gnNextHeader := omit, gnHeaderType := omit, gnHeaderSubtype := omit, diff --git a/ttcn/IVIM/LibItsIvim_TestSystem.ttcn b/ttcn/IVIM/LibItsIvim_TestSystem.ttcn index 0bcb6439..c3ba931c 100644 --- a/ttcn/IVIM/LibItsIvim_TestSystem.ttcn +++ b/ttcn/IVIM/LibItsIvim_TestSystem.ttcn @@ -126,6 +126,7 @@ module LibItsIvim_TestSystem { */ type record IvimInd { IVIM msgIn, + UInt64 recvTime optional, UInt8 gnNextHeader optional, UInt8 gnHeaderType optional, UInt8 gnHeaderSubtype optional, diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn index 331f7dae..df2a6e24 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn @@ -54,6 +54,7 @@ module LibItsMapemSpatem_Templates { template (present) MAPEM p_mapemMsg ) := { msgIn := p_mapemMsg, + recvTime := *, gnNextHeader := *, gnHeaderType := *, gnHeaderSubtype := *, @@ -137,6 +138,7 @@ module LibItsMapemSpatem_Templates { template (present) SPATEM p_spatemMsg ) := { msgIn := p_spatemMsg, + recvTime := *, gnNextHeader := *, gnHeaderType := *, gnHeaderSubtype := *, diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_TestSystem.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_TestSystem.ttcn index 3d1ccb8b..400360c4 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_TestSystem.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_TestSystem.ttcn @@ -104,6 +104,7 @@ module LibItsMapemSpatem_TestSystem { type record MapemInd { MAPEM msgIn, + UInt64 recvTime optional, UInt8 gnNextHeader optional, UInt8 gnHeaderType optional, UInt8 gnHeaderSubtype optional, @@ -120,6 +121,7 @@ module LibItsMapemSpatem_TestSystem { type record SpatemInd { SPATEM msgIn, + UInt64 recvTime optional, UInt8 gnNextHeader optional, UInt8 gnHeaderType optional, UInt8 gnHeaderSubtype optional, diff --git a/ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn b/ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn index 65372610..02b2b7c8 100644 --- a/ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn +++ b/ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn @@ -40,6 +40,7 @@ module LibItsRtcmem_Templates { template (present) RTCMEM p_rtcmemMsg ) := { msgIn := p_rtcmemMsg, + recvTime := *, gnNextHeader := *, gnHeaderType := *, gnHeaderSubtype := *, diff --git a/ttcn/Rtcmem/LibItsRtcmem_TestSystem.ttcn b/ttcn/Rtcmem/LibItsRtcmem_TestSystem.ttcn index eec9cf9e..5aedcce1 100644 --- a/ttcn/Rtcmem/LibItsRtcmem_TestSystem.ttcn +++ b/ttcn/Rtcmem/LibItsRtcmem_TestSystem.ttcn @@ -92,6 +92,7 @@ module LibItsRtcmem_TestSystem { type record RtcmemInd { RTCMEM msgIn, + UInt64 recvTime optional, UInt8 gnNextHeader optional, UInt8 gnHeaderType optional, UInt8 gnHeaderSubtype optional, diff --git a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn index 2ab2745f..207436bd 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn @@ -53,6 +53,7 @@ module LibItsSremSsem_Templates { template (present) SREM p_sremMsg ) := { msgIn := p_sremMsg, + recvTime := *, gnNextHeader := *, gnHeaderType := *, gnHeaderSubtype := *, diff --git a/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn b/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn index e3c9b787..930edff9 100644 --- a/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn @@ -104,6 +104,7 @@ module LibItsSremSsem_TestSystem { type record SremInd { SREM msgIn, + UInt64 recvTime optional, UInt8 gnNextHeader optional, UInt8 gnHeaderType optional, UInt8 gnHeaderSubtype optional, -- GitLab From 23166202ef8455c1fd60ed24c12e201cdea8892f Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Mon, 30 Nov 2020 15:28:58 +0100 Subject: [PATCH 284/320] Bugs fiexed in AtsSremSsem --- ttcn/SremSsem/LibItsSremSsem_Templates.ttcn | 5 +++-- ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn index 207436bd..2497af28 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn @@ -137,6 +137,7 @@ module LibItsSremSsem_Templates { template (present) SSEM p_ssemMsg := ? ) := { msgIn := p_ssemMsg, + recvTime := *, gnNextHeader := *, gnHeaderType := *, gnHeaderSubtype := *, @@ -507,8 +508,8 @@ module LibItsSremSsem_Templates { template (present) RequestorDescription p_requestor := ?, template (present) SignalRequestList p_requests := ?, template (present) MsgCount p_sequenceNumber := ?, - template MinuteOfTheYear p_timeStamp := *, - template DSecond p_second := * + template (present) DSecond p_second := ?, + template MinuteOfTheYear p_timeStamp := * ) modifies mw_defaultSrem := { timeStamp := p_timeStamp, second := p_second, diff --git a/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn b/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn index 930edff9..44d96919 100644 --- a/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn @@ -123,6 +123,7 @@ module LibItsSremSsem_TestSystem { type record SsemInd { SSEM msgIn, + UInt64 recvTime optional, UInt8 gnNextHeader optional, UInt8 gnHeaderType optional, UInt8 gnHeaderSubtype optional, -- GitLab From b31a70948047ca16fa99b700fdc9cfb2d64f8a51 Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 30 Nov 2020 16:15:55 +0100 Subject: [PATCH 285/320] Merging Titan/TTwb branches --- ttcn/IVIM/LibItsIvim_Templates.ttcn | 6 +++--- ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn | 2 +- ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn | 4 ++-- ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn | 8 ++++++-- ttcn/Rtcmem/LibItsRtcmem_TypesAndValues.ttcn | 2 +- ttcn/SremSsem/LibItsSremSsem_Functions.ttcn | 5 +++-- ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn | 2 +- ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn | 4 ++-- 8 files changed, 19 insertions(+), 14 deletions(-) diff --git a/ttcn/IVIM/LibItsIvim_Templates.ttcn b/ttcn/IVIM/LibItsIvim_Templates.ttcn index 4f88b221..0a1136ec 100644 --- a/ttcn/IVIM/LibItsIvim_Templates.ttcn +++ b/ttcn/IVIM/LibItsIvim_Templates.ttcn @@ -76,7 +76,7 @@ module LibItsIvim_Templates { * @param p_iviMsg The expected IVI Message */ template (value) IvimInd m_ivimInd( - template (value) IVIM p_iviMsg + in template (value) IVIM p_iviMsg ) := { msgIn := p_iviMsg, recvTime := omit, @@ -166,9 +166,9 @@ module LibItsIvim_Templates { * @desc Send template for Upper Tester event initialization */ template (value) UtIvimInitialize m_ivimStructureInitialize( - in HashedId8 p_hashedId8 := '0000000000000000'O + in HashedId8 p_hashedId8 := '0000000000000000'O ) := { - hashedId8 := '0000000000000000'O + hashedId8 := p_hashedId8 } // End of template m_ivimStructureInitialize /** diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn index df2a6e24..43eb17d7 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn @@ -453,7 +453,7 @@ module LibItsMapemSpatem_Templates { ingressApproach := p_ingressApproach, // inbound Approach IDs to which this lane belongs egressApproach := p_egressApproach, // outbound Approach IDs to which this lane belongs laneAttributes := p_laneAttributes, // All Attribute information about the basic selected lane type - maneuvers := omit, // the permitted maneuvers for this lane + maneuvers := p_allowedManeuvers, // the permitted maneuvers for this lane nodeList := p_nodeListXY, // Lane spatial path information as well as various Attribute information along the node path // Attributes found here are more general and may come and go over the length of the lane. connectsTo := p_connectsToList, // a list of other lanes and their signal group IDs each connecting lane and its signal group ID is given, therefore this element provides the information formerly in "signalGroups" in prior editions. diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn index 8823a551..6fb1c210 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI / STF484 / STF517 - * @version $URL$ - * $Id$ + * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn $ + * $Id: LibItsMapemSpatem_TypesAndValues.ttcn 1307 2016-12-13 07:51:14Z garciay $ * @desc Module containing types and values for MAPEM SPATEM * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. diff --git a/ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn b/ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn index c5ed2fce..d24c6271 100644 --- a/ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn +++ b/ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn @@ -130,9 +130,13 @@ module LibItsRtcmem_Functions { utPort.send(p_event); tc_wait.start; alt { - [] utPort.receive(UtRtcmemResults: { utRtcmemTerminationResult := ?}) { + [] utPort.receive(UtRtcmemResults: { utRtcmemTerminationResult := true}) { tc_wait.stop; } + [] utPort.receive(UtRtcmemResults: { utRtcmemTerminationResult := false}) { + tc_wait.stop; + f_selfOrClientSyncAndVerdict("RTCMEM Termination failed", e_error); + } [] tc_wait.timeout { log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); f_selfOrClientSyncAndVerdict("error", e_timeout); @@ -225,7 +229,7 @@ module LibItsRtcmem_Functions { */ altstep a_default() runs on ItsRtcmem { [vc_rtcmemDefaultActive] rtcmemPort.receive(mw_rtcmemInd(mw_rtcmemPdu(mw_defaultRtcmem))) { - log("*** " & testcasename() & ": INFO: RTCMEMM received in default ***"); + log("*** " & testcasename() & ": INFO: RTCMEM received in default ***"); vc_rtcmemReceived := true; repeat; } diff --git a/ttcn/Rtcmem/LibItsRtcmem_TypesAndValues.ttcn b/ttcn/Rtcmem/LibItsRtcmem_TypesAndValues.ttcn index 2b383e76..6ccfed04 100644 --- a/ttcn/Rtcmem/LibItsRtcmem_TypesAndValues.ttcn +++ b/ttcn/Rtcmem/LibItsRtcmem_TypesAndValues.ttcn @@ -81,7 +81,7 @@ module LibItsRtcmem_TypesAndValues { type record UtRtcmemEventInd { RTCMEM rtcmemMsg } with { - encode (rtcmemMsg) "LibItsRtcmem_asn1" + encode (rtcmemMsg) "PER" } /** diff --git a/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn b/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn index d6d58bdf..41b3bc8d 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn @@ -293,7 +293,8 @@ module LibItsSremSsem_Functions { * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT */ function f_cfUp( - in charstring p_certificateId := PX_CERT_FOR_TS + in charstring p_certificateId := PX_CERT_FOR_TS, + in charstring p_iutCertificateId := "" ) runs on ItsSremSsem system ItsSremSsemSystem { map(self:acPort, system:acPort); @@ -308,7 +309,7 @@ module LibItsSremSsem_Functions { f_initialiseSecuredMode(p_certificateId); //Initialze the IUT - f_prInitialState(); + f_prInitialState(p_iutCertificateId); } // End of f_cfUp diff --git a/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn b/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn index 44d96919..8d252856 100644 --- a/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn @@ -116,7 +116,7 @@ module LibItsSremSsem_TestSystem { UInt32 its_aid optional } with { - encode (msgIn) "PER" + encode (msgIn) "LibItsSremSsem_asn1" } type record of SremInd SremInds; diff --git a/ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn b/ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn index 21bf7d0b..1fd49971 100644 --- a/ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn @@ -92,7 +92,7 @@ module LibItsSremSsem_TypesAndValues { type record UtSremEventInd { SREM sreMsg } with { - encode (sreMsg) "LibItsSremSsem_asn1" + encode (sreMsg) "PER" } /** @@ -101,7 +101,7 @@ module LibItsSremSsem_TypesAndValues { type record UtSsemEventInd { SSEM sseMsg } with { - encode (sseMsg) "LibItsSremSsem_asn1" + encode (sseMsg) "PER" } /** -- GitLab From b9f7e1c8270dd6894f20e460d3e9db0426af16d0 Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Wed, 2 Dec 2020 09:08:44 +0100 Subject: [PATCH 286/320] Validate AtsSrem against TTwb 1.1.30 --- ...LibItsCommon_ASN1_ISDSRC_NamedNumbers.ttcn | 85 ++++++++++--------- ttcn/SremSsem/LibItsSremSsem_Templates.ttcn | 18 ++++ 2 files changed, 62 insertions(+), 41 deletions(-) diff --git a/ttcn/Common/LibItsCommon_ASN1_ISDSRC_NamedNumbers.ttcn b/ttcn/Common/LibItsCommon_ASN1_ISDSRC_NamedNumbers.ttcn index 1f9002b4..1132f612 100644 --- a/ttcn/Common/LibItsCommon_ASN1_ISDSRC_NamedNumbers.ttcn +++ b/ttcn/Common/LibItsCommon_ASN1_ISDSRC_NamedNumbers.ttcn @@ -4,46 +4,49 @@ module LibItsCommon_ASN1_ISDSRC_NamedNumbers { import from DSRC language "ASN.1:1997" all; - group IS_DSCR_constants { - group LaneParameter_constants { - const LaneAttributes_Barrier LaneAttributes_Barrier_median_RevocableLane_ := '0000000000000000'B; + group IS_DSCR_constants { + + group LaneParameter_constants { + + const LaneAttributes_Barrier LaneAttributes_Barrier_median_RevocableLane_ := '0000000000000000'B; + const LaneAttributes_Bike LaneAttributes_Bike_bikeRevocableLane_ := '0000000000000000'B; + const LaneAttributes_Crosswalk LaneAttributes_Crosswalk_crosswalkRevocableLane_ := '0000000000000000'B; + const LaneAttributes_Parking LaneAttributes_Parking_parkingRevocableLane_ := '0000000000000000'B; + const LaneAttributes_Sidewalk LaneAttributes_Sidewalk_sidewalk_RevocableLane_ := '0000000000000000'B; + const LaneAttributes_Striping LaneAttributes_Striping_stripeToConnectingLanesRevocableLane_ := '0000000000000000'B; + const LaneAttributes_TrackedVehicle LaneAttributes_TrackedVehicle_spec_RevocableLane_ := '0000000000000000'B; + const LaneAttributes_Vehicle LaneAttributes_Vehicle_isVehicleRevocableLane_ := '00000000'B; + const LaneDirection LaneDirection_ingressPath_ := '00'B; + const LaneDirection LaneDirection_egressPath_ := '01'B; + } //end LaneParameter_constants + + group Intersection_constants { + const IntersectionStatusObject IntersectionStatusObject_manualControlIsEnabled_ := '0000000000000000'B; + const IntersectionStatusObject IntersectionStatusObject_stopTimeIsActivated_ := '0000000000000001'B; + const IntersectionStatusObject IntersectionStatusObject_failureFlash_ := '0000000000000010'B; + const IntersectionStatusObject IntersectionStatusObject_preemptIsActive_ := '0000000000000011'B; + const IntersectionStatusObject IntersectionStatusObject_signalPriorityIsActive_ := '0000000000000100'B; + const IntersectionStatusObject IntersectionStatusObject_fixedTimeOperation_ := '0000000000000101'B; + const IntersectionStatusObject IntersectionStatusObject_trafficDependentOperation_ := '0000000000000110'B; + const IntersectionStatusObject IntersectionStatusObject_standbyOperation_ := '0000000000000111'B; + const IntersectionStatusObject IntersectionStatusObject_failureMode_ := '0000000000001000'B; + const IntersectionStatusObject IntersectionStatusObject_off_ := '0000000000001001'B; + const IntersectionStatusObject IntersectionStatusObject_recentMAPmessageUpdate_ := '0000000000001010'B; + const IntersectionStatusObject IntersectionStatusObject_recentChangeInMAPassignedLanesIDsUsed_ := '0000000000001011'B; + const IntersectionStatusObject IntersectionStatusObject_noValidMAPisAvailableAtThisTime_ := '0000000000001100'B; + const IntersectionStatusObject IntersectionStatusObject_noValidSPATisAvailableAtThisTime_ := '0000000000001101'B; + } // End of group Intersection_constants + + group requestor_description { + const TransitVehicleStatus TransitVehicleStatus_loading_ := '10000000'B; + const TransitVehicleStatus TransitVehicleStatus_anADAuse_ := '01000000'B; + const TransitVehicleStatus TransitVehicleStatus_aBikeLoad_ := '00100000'B; + const TransitVehicleStatus TransitVehicleStatus_doorOpen_ := '00010000'B; + const TransitVehicleStatus TransitVehicleStatus_charging_ := '00001000'B; + const TransitVehicleStatus TransitVehicleStatus_atStopLine_ := '00000100'B; + + } // End of of group requestor_description + + } // End of group IS_DSCR_constants - const LaneAttributes_Bike LaneAttributes_Bike_bikeRevocableLane_ := '0000000000000000'B; - - const LaneAttributes_Crosswalk LaneAttributes_Crosswalk_crosswalkRevocableLane_ := '0000000000000000'B; - - const LaneAttributes_Parking LaneAttributes_Parking_parkingRevocableLane_ := '0000000000000000'B; - - const LaneAttributes_Sidewalk LaneAttributes_Sidewalk_sidewalk_RevocableLane_ := '0000000000000000'B; - - const LaneAttributes_Striping LaneAttributes_Striping_stripeToConnectingLanesRevocableLane_ := '0000000000000000'B; - - const LaneAttributes_TrackedVehicle LaneAttributes_TrackedVehicle_spec_RevocableLane_ := '0000000000000000'B; - - const LaneAttributes_Vehicle LaneAttributes_Vehicle_isVehicleRevocableLane_ := '00000000'B; - - const LaneDirection LaneDirection_ingressPath_ := '00'B; - const LaneDirection LaneDirection_egressPath_ := '01'B; - - } //end LaneParameter_constants - - group Intersection_constants { - const IntersectionStatusObject IntersectionStatusObject_manualControlIsEnabled_ := '0000000000000000'B; - const IntersectionStatusObject IntersectionStatusObject_stopTimeIsActivated_ := '0000000000000001'B; - const IntersectionStatusObject IntersectionStatusObject_failureFlash_ := '0000000000000010'B; - const IntersectionStatusObject IntersectionStatusObject_preemptIsActive_ := '0000000000000011'B; - const IntersectionStatusObject IntersectionStatusObject_signalPriorityIsActive_ := '0000000000000100'B; - const IntersectionStatusObject IntersectionStatusObject_fixedTimeOperation_ := '0000000000000101'B; - const IntersectionStatusObject IntersectionStatusObject_trafficDependentOperation_ := '0000000000000110'B; - const IntersectionStatusObject IntersectionStatusObject_standbyOperation_ := '0000000000000111'B; - const IntersectionStatusObject IntersectionStatusObject_failureMode_ := '0000000000001000'B; - const IntersectionStatusObject IntersectionStatusObject_off_ := '0000000000001001'B; - const IntersectionStatusObject IntersectionStatusObject_recentMAPmessageUpdate_ := '0000000000001010'B; - const IntersectionStatusObject IntersectionStatusObject_recentChangeInMAPassignedLanesIDsUsed_ := '0000000000001011'B; - const IntersectionStatusObject IntersectionStatusObject_noValidMAPisAvailableAtThisTime_ := '0000000000001100'B; - const IntersectionStatusObject IntersectionStatusObject_noValidSPATisAvailableAtThisTime_ := '0000000000001101'B; - - } //end Intersection_constants - } // end IS_DSCR_constants - } // End of module LibItsCommon_ASN1_ISDSRC_NamedNumbers diff --git a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn index 2497af28..7c002469 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn @@ -485,6 +485,24 @@ module LibItsSremSsem_Templates { regional := omit } + template (value) RequestorPositionVector m_requestor_position( + in template (value) Position3D p_position + ) := { + position := p_position, + heading := omit, + speed := omit + } // End of template m_requestor_position + + template (value) Position3D m_position3D( + in template (value) Latitude p_latitude, + in template (value) Longitude p_longitude + ) := { + lat := p_latitude, // in 1/10th micro degrees + long := p_longitude, // in 1/10th micro degrees + elevation := omit, // in 10 cm units + regional := omit + } + } // End of group sremTemplatesSend group sremTemplatesRecv { -- GitLab From 382d54ca68382fa5397af41eb363096da6e0d4e9 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 2 Dec 2020 09:31:45 +0100 Subject: [PATCH 287/320] Merging Titan/TTwb branches --- ttcn/CAM/LibItsCam_Templates.ttcn | 2 +- ttcn/CAM/LibItsCam_TestSystem.ttcn | 2 +- ttcn/DENM/LibItsDenm_Templates.ttcn | 2 +- ttcn/DENM/LibItsDenm_TestSystem.ttcn | 2 +- ttcn/DENM/LibItsDenm_TypesAndValues.ttcn | 1 - .../LibItsGeoNetworking_Functions.ttcn | 20 +++++------ ttcn/IVIM/LibItsIvim_Templates.ttcn | 2 +- ttcn/IVIM/LibItsIvim_TestSystem.ttcn | 2 +- .../LibItsMapemSpatem_Templates.ttcn | 4 +-- .../LibItsMapemSpatem_TestSystem.ttcn | 4 +-- ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn | 2 +- ttcn/Rtcmem/LibItsRtcmem_TestSystem.ttcn | 2 +- ttcn/SremSsem/LibItsSremSsem_Functions.ttcn | 33 +++++++++++++++++++ ttcn/SremSsem/LibItsSremSsem_Templates.ttcn | 4 +-- ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn | 4 +-- 15 files changed, 59 insertions(+), 27 deletions(-) diff --git a/ttcn/CAM/LibItsCam_Templates.ttcn b/ttcn/CAM/LibItsCam_Templates.ttcn index 5e79e265..f1dbab60 100644 --- a/ttcn/CAM/LibItsCam_Templates.ttcn +++ b/ttcn/CAM/LibItsCam_Templates.ttcn @@ -39,7 +39,7 @@ module LibItsCam_Templates { in template (present) CAM p_camMsg ) := { msgIn := p_camMsg, - recvTime := *, + recvTime := ?, gnNextHeader := *, gnHeaderType := *, gnHeaderSubtype := *, diff --git a/ttcn/CAM/LibItsCam_TestSystem.ttcn b/ttcn/CAM/LibItsCam_TestSystem.ttcn index af53d5b9..fd3727e8 100644 --- a/ttcn/CAM/LibItsCam_TestSystem.ttcn +++ b/ttcn/CAM/LibItsCam_TestSystem.ttcn @@ -126,7 +126,7 @@ module LibItsCam_TestSystem language "TTCN-3:2010 Real Time and Performance Test */ type record CamInd { CAM msgIn, - UInt64 recvTime optional, + UInt64 recvTime, UInt8 gnNextHeader optional, UInt8 gnHeaderType optional, UInt8 gnHeaderSubtype optional, diff --git a/ttcn/DENM/LibItsDenm_Templates.ttcn b/ttcn/DENM/LibItsDenm_Templates.ttcn index 33c14ab3..e20714b3 100644 --- a/ttcn/DENM/LibItsDenm_Templates.ttcn +++ b/ttcn/DENM/LibItsDenm_Templates.ttcn @@ -64,7 +64,7 @@ module LibItsDenm_Templates { template (present) DENM p_denMsg ) := { msgIn := p_denMsg, - recvTime := *, + recvTime := ?, gnNextHeader := *, gnHeaderType := *, gnHeaderSubtype := *, diff --git a/ttcn/DENM/LibItsDenm_TestSystem.ttcn b/ttcn/DENM/LibItsDenm_TestSystem.ttcn index d0a28de1..8a7cc869 100644 --- a/ttcn/DENM/LibItsDenm_TestSystem.ttcn +++ b/ttcn/DENM/LibItsDenm_TestSystem.ttcn @@ -130,7 +130,7 @@ module LibItsDenm_TestSystem { */ type record DenmInd { DENM msgIn, - UInt64 recvTime optional, + UInt64 recvTime, UInt8 gnNextHeader optional, UInt8 gnHeaderType optional, UInt8 gnHeaderSubtype optional, diff --git a/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn b/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn index e083fe27..c37ea80f 100644 --- a/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn +++ b/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn @@ -9,7 +9,6 @@ module LibItsDenm_TypesAndValues { //LibCommon import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; // LibIts import from DENM_PDU_Descriptions language "ASN.1:1997" all; diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn index b28cc04e..8381f44f 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn @@ -185,7 +185,7 @@ module LibItsGeoNetworking_Functions { f_initialiseComponent(v_positionTable, v_areaTable, c_compNodeB); - } // End of group f_cf01Up + } // End of function f_cf01Up function f_cf01Down() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { @@ -270,7 +270,7 @@ module LibItsGeoNetworking_Functions { } } - } // End of group f_cf02Up + } // End of function f_cf02Up /** * @desc Deletes configuration cf02 @@ -293,7 +293,7 @@ module LibItsGeoNetworking_Functions { unmap(self:utPort, system:utPort); disconnect(self:syncPort, mtc:syncPort); - } // End of group f_cf02Down + } // End of function f_cf02Down /** * @desc This configuration features: @@ -364,7 +364,7 @@ module LibItsGeoNetworking_Functions { } } - } // End of group f_cf03Up + } // End of function f_cf03Up /** * @desc Deletes configuration cf03 @@ -387,7 +387,7 @@ module LibItsGeoNetworking_Functions { unmap(self:utPort, system:utPort); disconnect(self:syncPort, mtc:syncPort); - } // End of group f_cf03Down + } // End of function f_cf03Down /** * @desc This configuration features: @@ -460,7 +460,7 @@ module LibItsGeoNetworking_Functions { } } - } // End of group f_cf04Up + } // End of function f_cf04Up /** * @desc Deletes configuration cf04 @@ -483,7 +483,7 @@ module LibItsGeoNetworking_Functions { unmap(self:utPort, system:utPort); disconnect(self:syncPort, mtc:syncPort); - } // End of group f_cf04Down + } // End of function f_cf04Down /** * @desc This configuration features: @@ -574,7 +574,7 @@ module LibItsGeoNetworking_Functions { unmap(self:utPort, system:utPort); disconnect(self:syncPort, mtc:syncPort); - } // End of group f_cf05Down + } // End of function f_cf05Down /** * @desc This configuration features: @@ -666,7 +666,7 @@ module LibItsGeoNetworking_Functions { unmap(self:utPort, system:utPort); disconnect(self:syncPort, mtc:syncPort); - } // End of group f_cf06Down + } // End of function f_cf06Down /** * @desc This configuration features: @@ -757,7 +757,7 @@ module LibItsGeoNetworking_Functions { unmap(self:utPort, system:utPort); disconnect(self:syncPort, mtc:syncPort); - } // End of group f_cf07Down + } // End of function f_cf07Down /** * @desc Behavior function for initializing component's variables and tables diff --git a/ttcn/IVIM/LibItsIvim_Templates.ttcn b/ttcn/IVIM/LibItsIvim_Templates.ttcn index 0a1136ec..5b441684 100644 --- a/ttcn/IVIM/LibItsIvim_Templates.ttcn +++ b/ttcn/IVIM/LibItsIvim_Templates.ttcn @@ -59,7 +59,7 @@ module LibItsIvim_Templates { template (present) IVIM p_iviMsg := ? ) := { msgIn := p_iviMsg, - recvTime := *, + recvTime := ?, gnNextHeader := *, gnHeaderType := *, gnHeaderSubtype := *, diff --git a/ttcn/IVIM/LibItsIvim_TestSystem.ttcn b/ttcn/IVIM/LibItsIvim_TestSystem.ttcn index c3ba931c..1808ecf9 100644 --- a/ttcn/IVIM/LibItsIvim_TestSystem.ttcn +++ b/ttcn/IVIM/LibItsIvim_TestSystem.ttcn @@ -126,7 +126,7 @@ module LibItsIvim_TestSystem { */ type record IvimInd { IVIM msgIn, - UInt64 recvTime optional, + UInt64 recvTime, UInt8 gnNextHeader optional, UInt8 gnHeaderType optional, UInt8 gnHeaderSubtype optional, diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn index 43eb17d7..9801e92a 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn @@ -54,7 +54,7 @@ module LibItsMapemSpatem_Templates { template (present) MAPEM p_mapemMsg ) := { msgIn := p_mapemMsg, - recvTime := *, + recvTime := ?, gnNextHeader := *, gnHeaderType := *, gnHeaderSubtype := *, @@ -138,7 +138,7 @@ module LibItsMapemSpatem_Templates { template (present) SPATEM p_spatemMsg ) := { msgIn := p_spatemMsg, - recvTime := *, + recvTime := ?, gnNextHeader := *, gnHeaderType := *, gnHeaderSubtype := *, diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_TestSystem.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_TestSystem.ttcn index 400360c4..b67482b1 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_TestSystem.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_TestSystem.ttcn @@ -104,7 +104,7 @@ module LibItsMapemSpatem_TestSystem { type record MapemInd { MAPEM msgIn, - UInt64 recvTime optional, + UInt64 recvTime, UInt8 gnNextHeader optional, UInt8 gnHeaderType optional, UInt8 gnHeaderSubtype optional, @@ -121,7 +121,7 @@ module LibItsMapemSpatem_TestSystem { type record SpatemInd { SPATEM msgIn, - UInt64 recvTime optional, + UInt64 recvTime, UInt8 gnNextHeader optional, UInt8 gnHeaderType optional, UInt8 gnHeaderSubtype optional, diff --git a/ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn b/ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn index 02b2b7c8..49f30843 100644 --- a/ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn +++ b/ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn @@ -40,7 +40,7 @@ module LibItsRtcmem_Templates { template (present) RTCMEM p_rtcmemMsg ) := { msgIn := p_rtcmemMsg, - recvTime := *, + recvTime := ?, gnNextHeader := *, gnHeaderType := *, gnHeaderSubtype := *, diff --git a/ttcn/Rtcmem/LibItsRtcmem_TestSystem.ttcn b/ttcn/Rtcmem/LibItsRtcmem_TestSystem.ttcn index 5aedcce1..674d3de0 100644 --- a/ttcn/Rtcmem/LibItsRtcmem_TestSystem.ttcn +++ b/ttcn/Rtcmem/LibItsRtcmem_TestSystem.ttcn @@ -92,7 +92,7 @@ module LibItsRtcmem_TestSystem { type record RtcmemInd { RTCMEM msgIn, - UInt64 recvTime optional, + UInt64 recvTime, UInt8 gnNextHeader optional, UInt8 gnHeaderType optional, UInt8 gnHeaderSubtype optional, diff --git a/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn b/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn index 41b3bc8d..9b1db56c 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn @@ -424,6 +424,39 @@ module LibItsSremSsem_Functions { } } + /** + * @desc Awaits a SREM and returns it + * @param p_rcvMsg The expected message to be received. + */ + function f_awaitSreMessageCancellation( + template (present) RequestID p_requestID := ? + ) runs on ItsSremSsem { + tc_ac.start; + alt { + [] sremSsemPort.receive( + mw_sremInd( + mw_sremPdu( + mw_sremWellFormatted( + mw_requestorDescription, + { + mw_signalRequestPackage( + mw_signalRequest( + ?, + p_requestID, + priorityCancellation + )) + }, + ? + )))) { + tc_ac.stop; + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INFO: Timeout while awaiting the reception of a message ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } + } + } // End of group receiveFunctions group miscellaneousFunctions { diff --git a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn index 7c002469..cafb5ee6 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn @@ -53,7 +53,7 @@ module LibItsSremSsem_Templates { template (present) SREM p_sremMsg ) := { msgIn := p_sremMsg, - recvTime := *, + recvTime := ?, gnNextHeader := *, gnHeaderType := *, gnHeaderSubtype := *, @@ -137,7 +137,7 @@ module LibItsSremSsem_Templates { template (present) SSEM p_ssemMsg := ? ) := { msgIn := p_ssemMsg, - recvTime := *, + recvTime := ?, gnNextHeader := *, gnHeaderType := *, gnHeaderSubtype := *, diff --git a/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn b/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn index 8d252856..48daa6c1 100644 --- a/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn @@ -104,7 +104,7 @@ module LibItsSremSsem_TestSystem { type record SremInd { SREM msgIn, - UInt64 recvTime optional, + UInt64 recvTime, UInt8 gnNextHeader optional, UInt8 gnHeaderType optional, UInt8 gnHeaderSubtype optional, @@ -123,7 +123,7 @@ module LibItsSremSsem_TestSystem { type record SsemInd { SSEM msgIn, - UInt64 recvTime optional, + UInt64 recvTime, UInt8 gnNextHeader optional, UInt8 gnHeaderType optional, UInt8 gnHeaderSubtype optional, -- GitLab From 55bc6020addea5a936c418e0e4c708ca12bb5978 Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Thu, 3 Dec 2020 14:39:59 +0100 Subject: [PATCH 288/320] Validate AtsSsem against TTwb 1.1.30 --- ttcn/DENM/LibItsDenm_TypesAndValues.ttcn | 3 +- ttcn/IVIM/LibItsIvim_Templates.ttcn | 34 ---------------- .../LibItsSremSsem_EncdecDeclarations.ttcn | 2 +- ttcn/SremSsem/LibItsSremSsem_Functions.ttcn | 39 +++++++++++++++++++ 4 files changed, 42 insertions(+), 36 deletions(-) diff --git a/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn b/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn index c37ea80f..5a5b1eb5 100644 --- a/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn +++ b/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn @@ -9,7 +9,8 @@ module LibItsDenm_TypesAndValues { //LibCommon import from LibCommon_BasicTypesAndValues all; - + import from LibCommon_DataStrings all; + // LibIts import from DENM_PDU_Descriptions language "ASN.1:1997" all; import from ITS_Container language "ASN.1:1997" all; diff --git a/ttcn/IVIM/LibItsIvim_Templates.ttcn b/ttcn/IVIM/LibItsIvim_Templates.ttcn index 5b441684..66a9252d 100644 --- a/ttcn/IVIM/LibItsIvim_Templates.ttcn +++ b/ttcn/IVIM/LibItsIvim_Templates.ttcn @@ -71,25 +71,6 @@ module LibItsIvim_Templates { its_aid := * } // End of template mw_ivimInd - /** - * @desc Send template for IVI Message (IvimPort Primitive) - * @param p_iviMsg The expected IVI Message - */ - template (value) IvimInd m_ivimInd( - in template (value) IVIM p_iviMsg - ) := { - msgIn := p_iviMsg, - recvTime := omit, - gnNextHeader := omit, - gnHeaderType := omit, - gnHeaderSubtype := omit, - gnLifetime := omit, - gnTrafficClass := omit, - btpDestinationPort := omit, - btpInfo := omit, - ssp := omit, - its_aid := omit - } // End of template m_ivimInd /** * @desc Receive template for IVI Message (IvimPort Primitive) @@ -145,21 +126,6 @@ module LibItsIvim_Templates { its_aid := p_its_aid } // End of template mw_ivimIndWithSecurityParameters - /** - * @desc Send template for IVI Message (IvimPort Primitive) - * @param p_iviMsg The expected IVI Message - * @param p_ssp SSP security parameter - * @param p_its_aid ITS-AID value - */ - template IvimInd m_ivimIndWithSecurityParameters( - template (value) IVIM p_iviMsg, - template Bit256 p_ssp := omit, - template UInt32 p_its_aid := omit - ) modifies m_ivimInd := { - ssp := p_ssp, - its_aid := p_its_aid - } // End of template mw_ivimIndWithSecurityParameters - group utPrimitives { /** diff --git a/ttcn/SremSsem/LibItsSremSsem_EncdecDeclarations.ttcn b/ttcn/SremSsem/LibItsSremSsem_EncdecDeclarations.ttcn index 36df987b..d8699dda 100644 --- a/ttcn/SremSsem/LibItsSremSsem_EncdecDeclarations.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_EncdecDeclarations.ttcn @@ -55,5 +55,5 @@ module LibItsSremSsem_EncdecDeclarations { with {extension "prototype(convert) encode(PER)"} external function fx_dec_SSM (inout bitstring b, out SignalStatusMessage p) return integer - with {extension "prototype(sliding) decode(PER)"}*/ + with {extension "prototype(sliding) decode(PER)"}*/ } diff --git a/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn b/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn index 9b1db56c..7f5302a3 100644 --- a/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn +++ b/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn @@ -382,6 +382,45 @@ module LibItsSremSsem_Functions { group sendFunctions { + /** + * @desc Sends a SREM message for cancellation + */ + function f_sendSreMessageForCancellation() runs on ItsSremSsem { + // Send SREM cancellation + sremSsemPort.send( + m_sremReq( + m_sremPdu( + m_srem( + m_requestorDescription( + m_vehicleID( + f_getIutStationId() + ), + m_requestorType( + basicVehicle + ) + ), + { + m_signalRequestPackage( + m_signalRequest( + m_intersectionReferenceID, + 17, + priorityCancellation, + { lane := 2 } + ) + ) + })))); + tc_noac.start; + alt { + [] sremSsemPort.receive(mw_ssemInd) { + tc_noac.stop; + log("*** " & testcasename() & ": INCONC: Received SSEM PDU after cancellation. ***"); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: No more SSEM PDU received after cancellation. ***"); + } + } + } + /** * @desc Sends a SSEM message * @param p_sendMsg The IVI message to send. -- GitLab From 7484e42e47f32555eebd2af4f27ead826e75c348 Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Wed, 9 Dec 2020 10:18:59 +0100 Subject: [PATCH 289/320] Validate AtsIvim --- ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn | 1 + ttcn/IVIM/LibItsIvim_Templates.ttcn | 7 ++----- ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn | 6 ++---- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn index 5f0d22bd..4b46b328 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn @@ -14,6 +14,7 @@ module LibItsGeoNetworking_TestSystem { // LibCommon import from LibCommon_BasicTypesAndValues all; import from LibCommon_DataStrings all; + import from LibCommon_Sync all; // LibItsCommon import from LibItsCommon_TestSystem all; diff --git a/ttcn/IVIM/LibItsIvim_Templates.ttcn b/ttcn/IVIM/LibItsIvim_Templates.ttcn index 66a9252d..6d959fba 100644 --- a/ttcn/IVIM/LibItsIvim_Templates.ttcn +++ b/ttcn/IVIM/LibItsIvim_Templates.ttcn @@ -178,22 +178,19 @@ module LibItsIvim_Templates { * @param p_validFrom Valid From value (Default: omit) * @param p_validTo Valid To value (Default: omit) * @param p_connectedIviStructures List of ConnectedIviStructure (Default: omit) - * @param p_optional_ Optional field (Default: omit) */ template (omit) UtIvimUpdate m_utIvimUpdateEvent( template (value) IviIdentificationNumber p_iviIdentificationNumber, template (omit) TimestampIts p_timeStamp := c_duration_2sec, template (omit) TimestampIts p_validFrom := omit, template (omit) TimestampIts p_validTo := omit, - template (omit) IVIManagementContainer.connectedIviStructures p_connectedIviStructures := omit, - template (omit) IviStructure.optional_ p_optional_ := omit + template (omit) IVIManagementContainer.connectedIviStructures p_connectedIviStructures := omit ) := { iviIdentificationNumber := p_iviIdentificationNumber, validFrom := p_validFrom, validTo := p_validTo, timeStamp := p_timeStamp, - connectedIviStructures := p_connectedIviStructures, - optional_ := p_optional_ + connectedIviStructures := p_connectedIviStructures } // End of template m_utIvimUpdateEvent /** diff --git a/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn b/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn index bd60aec4..cdf02c9c 100644 --- a/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn +++ b/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn @@ -94,8 +94,7 @@ module LibItsIvim_TypesAndValues { * @member utIvimInitialize - * @member utIvimTriggerResult - * @member utIvimUpdateResult, - - * @member utIvimChangePositionResult - - * @member utIvimChangePseudonymResult - + * @member utIvimTerminationResult - */ type union UtIvimResults { boolean utIvimInitializeResult, @@ -143,8 +142,7 @@ module LibItsIvim_TypesAndValues { TimestampIts validFrom optional, TimestampIts validTo optional, TimestampIts timeStamp optional, - IVIManagementContainer.connectedIviStructures connectedIviStructures optional, - IviStructure.optional_ optional_ optional + IVIManagementContainer.connectedIviStructures connectedIviStructures optional } with { variant "FIELDORDER(msb)" } -- GitLab From 2edfaf564426d4636ca954e157de3bdce0923fe8 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 9 Dec 2020 10:48:52 +0100 Subject: [PATCH 290/320] Merge Titan & TTwb branches --- ttcn/Pki/LibItsPki_Pixits.ttcn | 8 ++++++++ ttcn/Security/LibItsSecurity_Functions.ttcn | 22 +++++++++++++++++++++ ttcn/Security/LibItsSecurity_Pixits.ttcn | 22 ++------------------- 3 files changed, 32 insertions(+), 20 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Pixits.ttcn b/ttcn/Pki/LibItsPki_Pixits.ttcn index 12daf8ed..8db552eb 100644 --- a/ttcn/Pki/LibItsPki_Pixits.ttcn +++ b/ttcn/Pki/LibItsPki_Pixits.ttcn @@ -52,6 +52,14 @@ module LibItsPki_Pixits { */ modulepar SecurityAlg PX_VE_ALG := e_nist_p256; + modulepar Int16 PX_GENERATED_CERTIFICATE_DURATION := 120; + + modulepar SubjectAssurance PX_GENERATED_CERTIFICATE_SUBJECT_ASSURENCE_LEVEL := '00'O; + + modulepar CountryOnly PX_GENERATED_CERTIFICATE_REGION_COUNTRY_1 := 250; + + modulepar CountryOnly PX_GENERATED_CERTIFICATE_REGION_COUNTRY_2 := 380; + modulepar octetstring PX_INNER_EC_CERTFICATE_BITMAP_SSP_SCR := '01C0'O; modulepar octetstring PX_INNER_EC_CERTFICATE_INCORRECT_BITMAP_SSP_SCR := '01FF'O; diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index b42ff886..7234bf7e 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -2331,6 +2331,28 @@ module LibItsSecurity_Functions { return true; } // End of function f_getCertificateFromHashedId3 + function f_getCertificateIssuer( + in IssuerIdentifier p_issuer + ) return HashedId8 { + if (ischosen(p_issuer.sha256AndDigest)) { + return p_issuer.sha256AndDigest; + } else if (ischosen(p_issuer.sha256AndDigest)) { + return p_issuer.sha256AndDigest; + } + return int2oct(0, 8); + } + + function f_getHashAlgorithm( + in IssuerIdentifier p_issuer + ) return HashAlgorithm { + if (ischosen(p_issuer.sha256AndDigest)) { + return sha256; + } else if (ischosen(p_issuer.sha256AndDigest)) { + return sha384; + } + return p_issuer.self_; + } + /** * @desc Read the signing private key for the specified certificate * @param p_keysId the keys identifier diff --git a/ttcn/Security/LibItsSecurity_Pixits.ttcn b/ttcn/Security/LibItsSecurity_Pixits.ttcn index 93ba77b7..04ddc28a 100644 --- a/ttcn/Security/LibItsSecurity_Pixits.ttcn +++ b/ttcn/Security/LibItsSecurity_Pixits.ttcn @@ -42,9 +42,9 @@ module LibItsSecurity_Pixits { modulepar Psid PX_OTHER_ITS_AID := 141; // Assign to GN-MGMT, Other than CA, DEN, MAP, SPAT, IVI, SRE, SSE & GN-MGMT: 38 /** - * @desc Invalid protocol version. Default: 2 + * @desc Invalid protocol version. Default: 3 */ - modulepar UInt8 PX_WRONG_PROTOCOL_VERSION := 2; + modulepar UInt8 PX_WRONG_PROTOCOL_VERSION := 3; /** * @desc Invalid WGS longitude @@ -56,22 +56,4 @@ module LibItsSecurity_Pixits { */ modulepar SecLatitude PX_WGSLATITUDE := 0; - /** - * @desc Invalid digest. Default: 1 - */ - modulepar HashedId8 PX_OTHER_CERT_DIGEST := '0000000000000000'O; - - /** - * @desc AES-128-CCM nonce public key - */ - modulepar Oct12 PX_ENCRYPTIONPARAMETERS_AES_128_CCM_NONCE := 'C0FFEEDECAC0FFEEDECA0000'O; - - modulepar CountryOnly PX_GENERATED_CERTIFICATE_REGION_COUNTRY_1 := 250; - - modulepar CountryOnly PX_GENERATED_CERTIFICATE_REGION_COUNTRY_2 := 380; - - modulepar Int16 PX_GENERATED_CERTIFICATE_DURATION := 120; - - modulepar SubjectAssurance PX_GENERATED_CERTIFICATE_SUBJECT_ASSURENCE_LEVEL := '00'O; - } // End of module LibItsSecurity_Pixits -- GitLab From dc79687ea9ae78303b63b2f63016b8019b99667d Mon Sep 17 00:00:00 2001 From: pintar Date: Thu, 10 Dec 2020 13:35:42 +0100 Subject: [PATCH 291/320] Spatem update to support 2PTC --- .../LibItsMapemSpatem_Functions.ttcn | 100 ++++++++++++++++++ .../LibItsMapemSpatem_TestSystem.ttcn | 18 ++++ .../LibItsMapemSpatem_TypesAndValues.ttcn | 5 + 3 files changed, 123 insertions(+) diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn index 88cc06e9..e00f6aa8 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn @@ -170,6 +170,17 @@ module LibItsMapemSpatem_Functions { } } + /** + * @desc Default handling cf02 de-initialisation. + */ + altstep a_cf02Down() runs on ItsMtc { + [] a_shutdown() { + f_cf02Down(); + log("*** a_cf02Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } + } + /** * @desc The base default. */ @@ -264,6 +275,66 @@ module LibItsMapemSpatem_Functions { f_disconnect4SelfOrClientSync(); } // End of f_cfDown + /** + * @desc Setups default configuration + * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT + */ + function f_cf02Up(in charstring p_certificateId := PX_CERT_FOR_TS + ) runs on ItsMtc mtc ItsMtc system ItsMapemSpatemSystem { + + // Variables + var integer i; + + // Select components + vc_componentTable := {{c_compMap, omit}, {c_compSpat, omit}}; + + // Create components + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + vc_componentTable[i].msComponent := ItsMapemSpatem.create(vc_componentTable[i].componentName) alive; + } + + // Map & Connect + map(self:acPort, system:acPort); + map(self:utPort, system:utPort); + connect(self:syncPort, mtc:syncPort); + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + map(vc_componentTable[i].msComponent:acPort, system:acPort); + map(vc_componentTable[i].msComponent:utPort, system:utPort); + map(vc_componentTable[i].msComponent:mapemSpatemPort, system:mapemSpatemPort); + connect(vc_componentTable[i].msComponent:syncPort, self:syncPort); + } + + activate(a_cf02Down()); + + // Initialise secured mode + f_initialiseSecuredMode(p_certificateId); + + } // End of f_cf02Up + + /** + * @desc Deletes default configuration + */ + function f_cf02Down() runs on ItsMtc mtc ItsMtc system ItsMapemSpatemSystem { + + // Local variables + var integer i; + + f_uninitialiseSecuredMode(); + + // Unmap & Disconnect + for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { + unmap(vc_componentTable[i].msComponent:utPort, system:utPort); + unmap(vc_componentTable[i].msComponent:acPort, system:acPort); + unmap(vc_componentTable[i].msComponent:mapemSpatemPort, system:mapemSpatemPort); + disconnect(vc_componentTable[i].msComponent:syncPort, self:syncPort); + } + unmap(self:acPort, system:acPort); + unmap(self:utPort, system:utPort); + disconnect(self:syncPort, mtc:syncPort); + + + } // End of f_cf02Down + } // End of of mapSpatConfigurationFunctions group preambles { @@ -358,4 +429,33 @@ module LibItsMapemSpatem_Functions { } // End of group receiveFunctions + group componentFunctions { + /** + * @desc Get the component corresponding to a key + * @param p_componentName Name searched component + * @return ItsGeoNetworking - The searched position vector + */ + function f_getComponent( + in charstring p_componentName + ) runs on ItsMtc + return ItsMapemSpatem { + + var ItsMapemSpatem v_return := null; + var integer i := 0; + + for (i:=0; i Date: Wed, 16 Dec 2020 08:53:49 +0100 Subject: [PATCH 292/320] Spatem templates --- .../LibItsMapemSpatem_Templates.ttcn | 85 ++++++++++++++++++- 1 file changed, 84 insertions(+), 1 deletion(-) diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn index 9801e92a..79cebb96 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn @@ -785,6 +785,26 @@ module LibItsMapemSpatem_Templates { regional := * } // end mw_IntersectionState + template (present) IntersectionState mw_IntersectionState_regional ( + template (present) IntersectionState.id p_id := ?, + template (present) IntersectionState.revision p_revision := ?, + template (present) IntersectionState.status p_status := ?, + template (present) IntersectionState.states p_states := ?, + template (present) IntersectionState.regional p_regional := ? + ) modifies mw_IntersectionState := { + regional := p_regional + } // end mw_IntersectionState + + template (present) IntersectionState mw_IntersectionState_maneuverAssistList ( + template (present) IntersectionState.id p_id := ?, + template (present) IntersectionState.revision p_revision := ?, + template (present) IntersectionState.status p_status := ?, + template (present) IntersectionState.states p_states := ?, + template (present) IntersectionState.maneuverAssistList p_maneuverAssistList := ? + ) modifies mw_IntersectionState := { + maneuverAssistList := p_maneuverAssistList + } // end mw_IntersectionState + template (present) IntersectionState mw_IntersectionState_moyAndTimeStamp( template (present) IntersectionState.id p_id := ?, template (present) IntersectionState.revision p_revision := ?, @@ -807,7 +827,70 @@ module LibItsMapemSpatem_Templates { maneuverAssistList := *, //ManeuverAssistList OPTIONAL, regional := * //RegionalExtension {{Reg-MovementState}} OPTIONAL } - + + template (present) MovementEvent mw_movementEvent( + in template (present) MovementPhaseState p_eventState := ?, + in template TimeChangeDetails p_timing := *, + in template MovementEvent.speeds p_speeds := * + ) := { + eventState := stop_Then_Proceed, // Consisting of: Phase state (the basic 11 states) and Directional, protected, or permissive state + timing := p_timing, // Timing Data in UTC time stamps for event includes start and min/max end times of phase confidence and estimated next occurrence + speeds := p_speeds, // Various speed advisories for use by general and specific types of vehicles supporting green-wave and other flow needs + regional := * + } + + template (present) TimeChangeDetails mw_timeChangeDetails( + in template (present) TimeMark p_minEndTime := ?, + in template TimeMark p_startTime := *, + in template TimeMark p_nextTime := * + ) := { + startTime := p_startTime, + minEndTime := p_minEndTime, + maxEndTime := *, + likelyTime := *, + confidence := *, + nextTime := p_nextTime + } + + template (present) ConnectionManeuverAssist mw_connectionManeuverAssist( + in template (present) LaneConnectionID p_connectionID := ?, + in template PedestrianBicycleDetect p_pedBicycleDetect := ? + ) := { + connectionID := p_connectionID, + queueLength := *, + availableStorageLength := *, + waitOnStop := *, + pedBicycleDetect := p_pedBicycleDetect, + regional := * + } + + template (present) ConnectionManeuverAssist mw_connectionManeuverAssist_queueAndAvailableStorageLength( + in template (present) LaneConnectionID p_connectionID := ?, + in template ZoneLength p_queueLength := ?, + in template ZoneLength p_availableStorageLength := ? + ) := { + connectionID := p_connectionID, + queueLength := p_queueLength, + availableStorageLength := p_availableStorageLength, + waitOnStop := *, + pedBicycleDetect := *, + regional := * + } + + template (present) AdvisorySpeed mw_advisorySpeed( + in template (present) AdvisorySpeedType p_type, + in template SpeedAdvice p_speed := *, + in template SpeedConfidenceDSRC p_confidence := *, + in template ZoneLength p_distance := *, + in template RestrictionClassID p_class := * + ) := { + type_ := p_type, // The type of advisory which this is. + speed := p_speed, + confidence := p_confidence, // A confidence value for the above speed + distance := p_distance, // The distance indicates the region for which the advised speed is recommended, it is specified upstream from the stop bar along the connected egressing lane + class := p_class, // The vehicle types to which it applies when absent, the AdvisorySpeed applies to all motor vehicle types + regional := * + } } // End of group spatemTemplates -- GitLab From 2760db003d3d184072a1e3818867799606abb596 Mon Sep 17 00:00:00 2001 From: pintar Date: Wed, 16 Dec 2020 16:08:47 +0100 Subject: [PATCH 293/320] New templates and PICS added --- ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn | 4 +++ .../LibItsMapemSpatem_Templates.ttcn | 34 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn index fb3e1941..5a4cc390 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn @@ -138,4 +138,8 @@ module LibItsMapemSpatem_Pics { */ modulepar boolean PICS_SPATEM_TRANSMISSION_RATE := false; + modulepar float PICS_T_GEN_SPATEM_MIN := 0.1; + + modulepar float PICS_T_GEN_SPATEM_MAX := 2.0; + } // end LibItsSremSsem_Pics diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn index 79cebb96..39c9393b 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn @@ -668,6 +668,40 @@ module LibItsMapemSpatem_Templates { regional := omit } + template (value) IntersectionState m_intersection_regional ( + in template (omit) IntersectionState.regional p_regional := omit + ) modifies m_intersection := { + name := omit, // Human readable name for intersection to be used only in debug mode + id := m_intersectionReferenceID, // A globally unique value set, consisting of a regionID and + // intersection ID assignment provides a unique mapping to the intersection MAP in question which provides complete location and approach/move/lane data + revision := PX_INTERSECTIONSTATE_REVISION, + status := IntersectionStatusObject_manualControlIsEnabled_, + // General status of the controller(s) + moy := omit, // Minute of current UTC year used only with messages to be archived + timeStamp := omit, // The mSec point in the current UTC minute that this message was constructed + enabledLanes := { 1, 2 }, // A list of lanes where the RevocableLane bit has been set which are now active andtherefore part of the current intersection + states := m_movements, // Each Movement is given in turn and contains its signal phase state, mapping to the lanes it applies to, and point in time it will end, and it may contain both active and future states + maneuverAssistList := omit, // Assist data + regional := p_regional + } + + template (value) IntersectionState m_intersection_maneuverAssistList ( + in template (omit) IntersectionState.maneuverAssistList p_maneuverAssistList := omit + ) modifies m_intersection := { + name := omit, // Human readable name for intersection to be used only in debug mode + id := m_intersectionReferenceID, // A globally unique value set, consisting of a regionID and + // intersection ID assignment provides a unique mapping to the intersection MAP in question which provides complete location and approach/move/lane data + revision := PX_INTERSECTIONSTATE_REVISION, + status := IntersectionStatusObject_manualControlIsEnabled_, + // General status of the controller(s) + moy := omit, // Minute of current UTC year used only with messages to be archived + timeStamp := omit, // The mSec point in the current UTC minute that this message was constructed + enabledLanes := { 1, 2 }, // A list of lanes where the RevocableLane bit has been set which are now active andtherefore part of the current intersection + states := m_movements, // Each Movement is given in turn and contains its signal phase state, mapping to the lanes it applies to, and point in time it will end, and it may contain both active and future states + maneuverAssistList := p_maneuverAssistList, // Assist data + regional := omit + } + template (value) MovementList m_movements := { m_movement }; template (omit) MovementState m_movement := { -- GitLab From 77630300c5f2ec1e6684c0eda036e4abd76b8b6e Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Thu, 17 Dec 2020 07:45:04 +0100 Subject: [PATCH 294/320] Start validate AtsMapem --- ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn | 4 ++-- ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn | 2 +- ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn | 4 ++-- ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn | 4 +++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn b/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn index f0b554f6..1f3d7bfe 100644 --- a/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn +++ b/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn @@ -48,8 +48,8 @@ module LibItsCommon_ASN1_NamedNumbers { const ItsPduHeader.messageID ItsPduHeader_messageID_denm_ := 1; const ItsPduHeader.messageID ItsPduHeader_messageID_cam_ := 2; const ItsPduHeader.messageID ItsPduHeader_messageID_poi_ := 3; - const ItsPduHeader.messageID ItsPduHeader_messageID_mapem_ := 4; - const ItsPduHeader.messageID ItsPduHeader_messageID_spatem_ := 5; + const ItsPduHeader.messageID ItsPduHeader_messageID_spatem_ := 4; + const ItsPduHeader.messageID ItsPduHeader_messageID_mapem_ := 5; const ItsPduHeader.messageID ItsPduHeader_messageID_ivim_ := 6; const ItsPduHeader.messageID ItsPduHeader_messageID_ev_rsr_ := 7; const ItsPduHeader.messageID ItsPduHeader_messageID_tistpgtransaction_ := 8; diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn index 88cc06e9..f717b597 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn @@ -72,7 +72,7 @@ module LibItsMapemSpatem_Functions { function f_utTriggerEvent( in template (value) UtMapemSpatemTrigger p_event ) runs on ItsMapemSpatem { - + //deactivate mapemSpatemPort default alts vc_mapemSpatemDefaultActive := false; diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn index 9801e92a..7be55c13 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn @@ -511,7 +511,7 @@ module LibItsMapemSpatem_Templates { */ template (present) MapData mw_mapem( template (present) IntersectionGeometryList p_intersections := ?, - template (present) RoadSegmentList p_roadSegments := ? + template RoadSegmentList p_roadSegments := * ) modifies mw_defaultMapem := { layerType := omit, layerID := omit, @@ -595,7 +595,7 @@ module LibItsMapemSpatem_Templates { */ template (present) MapData mw_mapemLayerType( template (present) IntersectionGeometryList p_intersections := ?, - template (present) RoadSegmentList p_roadSegments := ?, + template RoadSegmentList p_roadSegments := *, template (present) LayerID p_layerID := ? ) modifies mw_mapem := { layerType := omit, diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn index 6fb1c210..c0f3eb32 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn @@ -61,7 +61,7 @@ module LibItsMapemSpatem_TypesAndValues { Event event, IntersectionID intersectionID, RegulatorySpeedLimit regulatorySpeedLimit, - Latitude latitude + Latitude latitude optional } with { variant "FIELDORDER(msb)" @@ -75,6 +75,8 @@ module LibItsMapemSpatem_TypesAndValues { spatemNewContent (4), mapemRepL10s (5), mapemRepG10s (6) + } with { + variant "FIELDLENGTH(8)" } /** -- GitLab From b6204cd7b6c8deae071e042a2fc384ecf09b7c3d Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Fri, 18 Dec 2020 15:23:45 +0100 Subject: [PATCH 295/320] Start validate AtsSpatem --- .../LibItsMapemSpatem_TypesAndValues.ttcn | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn index f73d9f6d..ca988767 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn @@ -64,8 +64,8 @@ module LibItsMapemSpatem_TypesAndValues { */ type record UtMapemSpatemTrigger { Event event, - IntersectionID intersectionID, - RegulatorySpeedLimit regulatorySpeedLimit, + IntersectionID intersectionID optional, + RegulatorySpeedLimit regulatorySpeedLimit optional, Latitude latitude optional } with { @@ -73,13 +73,10 @@ module LibItsMapemSpatem_TypesAndValues { } type enumerated Event { - startTLMService (0), - stopTLMService (1), - mapemNewContent (2), - mapemNewContentWithFragmentation (3), - spatemNewContent (4), - mapemRepL10s (5), - mapemRepG10s (6) + mapProfile0 (0), + mapProfile1 (1), + mapProfile2 (2), + spatProfile0 (3) } with { variant "FIELDLENGTH(8)" } -- GitLab From 18a7b38a2780dcf27f55c06b3756ea8fc222ebf5 Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Thu, 14 Jan 2021 15:04:40 +0100 Subject: [PATCH 296/320] Start validate AtsSpatem --- .../LibItsMapemSpatem_Templates.ttcn | 71 +++++++++++-------- 1 file changed, 43 insertions(+), 28 deletions(-) diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn index 92f4050d..cb2e0fa6 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn @@ -589,6 +589,21 @@ module LibItsMapemSpatem_Templates { overlays := omit, regional := * } + + template (present) LaneAttributes mw_laneAttributes := { + directionalUse := ?, + sharedWith := ?, + laneType := ?, + regional := * + } + + template (present) LaneAttributes mw_laneAttributes_crosswak( + template (present) LaneAttributes_Crosswalk p_crosswalk := ? + ) modifies mw_laneAttributes := { + laneType := { + crosswalk := p_crosswalk + } + } /** * @desc Receive template for MAPEM Message with no LayerType @@ -796,17 +811,17 @@ module LibItsMapemSpatem_Templates { } template (present) SPAT mw_spatem_intersections( - template (present) SPAT.intersections p_intersections := ? + template (present) SPAT.intersections p_intersections := ? ) modifies mw_defaultSpatem := { intersections := p_intersections } template (present) IntersectionState mw_IntersectionState( - template (present) IntersectionState.id p_id := ?, - template (present) IntersectionState.revision p_revision := ?, - template (present) IntersectionState.status p_status := ?, - template (present) IntersectionState.states p_states := ? - ) := { + template (present) IntersectionState.id p_id := ?, + template (present) IntersectionState.revision p_revision := ?, + template (present) IntersectionState.status p_status := ?, + template (present) IntersectionState.states p_states := ? + ) := { name := *, id := p_id, revision := p_revision, @@ -819,34 +834,34 @@ module LibItsMapemSpatem_Templates { regional := * } // end mw_IntersectionState - template (present) IntersectionState mw_IntersectionState_regional ( - template (present) IntersectionState.id p_id := ?, - template (present) IntersectionState.revision p_revision := ?, - template (present) IntersectionState.status p_status := ?, - template (present) IntersectionState.states p_states := ?, - template (present) IntersectionState.regional p_regional := ? - ) modifies mw_IntersectionState := { - regional := p_regional + template (present) IntersectionState mw_IntersectionState_regional( + template (present) IntersectionState.id p_id := ?, + template (present) IntersectionState.revision p_revision := ?, + template (present) IntersectionState.status p_status := ?, + template (present) IntersectionState.states p_states := ?, + template (present) IntersectionState.regional p_regional := ? + ) modifies mw_IntersectionState := { + regional := p_regional } // end mw_IntersectionState - template (present) IntersectionState mw_IntersectionState_maneuverAssistList ( - template (present) IntersectionState.id p_id := ?, - template (present) IntersectionState.revision p_revision := ?, - template (present) IntersectionState.status p_status := ?, - template (present) IntersectionState.states p_states := ?, - template (present) IntersectionState.maneuverAssistList p_maneuverAssistList := ? - ) modifies mw_IntersectionState := { + template (present) IntersectionState mw_IntersectionState_maneuverAssistList( + template (present) IntersectionState.id p_id := ?, + template (present) IntersectionState.revision p_revision := ?, + template (present) IntersectionState.status p_status := ?, + template (present) IntersectionState.states p_states := ?, + template (present) IntersectionState.maneuverAssistList p_maneuverAssistList := ? + ) modifies mw_IntersectionState := { maneuverAssistList := p_maneuverAssistList } // end mw_IntersectionState template (present) IntersectionState mw_IntersectionState_moyAndTimeStamp( - template (present) IntersectionState.id p_id := ?, - template (present) IntersectionState.revision p_revision := ?, - template (present) IntersectionState.status p_status := ?, - template (present) IntersectionState.states p_states := ?, - template (present) IntersectionState.moy p_moy := ?, - template (present) IntersectionState.timeStamp p_timeStamp := ? - ) modifies mw_IntersectionState:= { + template (present) IntersectionState.id p_id := ?, + template (present) IntersectionState.revision p_revision := ?, + template (present) IntersectionState.status p_status := ?, + template (present) IntersectionState.states p_states := ?, + template (present) IntersectionState.moy p_moy := ?, + template (present) IntersectionState.timeStamp p_timeStamp := ? + ) modifies mw_IntersectionState:= { moy := p_moy, timeStamp := p_timeStamp }// end mw_IntersectionState_moyAndTimeStamp -- GitLab From 6923d0bb14bcf3bf4dd32d830a9989820fddb0ee Mon Sep 17 00:00:00 2001 From: Yann Garcia Date: Wed, 27 Jan 2021 11:22:04 +0100 Subject: [PATCH 297/320] Validate AtsSpatem --- ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn | 18 ++++------- .../LibItsMapemSpatem_Templates.ttcn | 30 +++++++++---------- .../LibItsMapemSpatem_TypesAndValues.ttcn | 13 +++++--- 3 files changed, 30 insertions(+), 31 deletions(-) diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn index 5a4cc390..01ca020d 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn @@ -88,13 +88,13 @@ module LibItsMapemSpatem_Pics { * @desc Support for SPATEM reception * @see TODO */ - modulepar boolean PICS_SPATEM_PEDESTRIAN_MANOEUVRES := false; + modulepar boolean PICS_SPATEM_PEDESTRIAN_MANOEUVRES := true; /** * @desc Support for SPATEM reception * @see TODO */ - modulepar boolean PICS_SPATEM_SPECIALIZED_MANOEUVRES := false; + modulepar boolean PICS_SPATEM_SPECIALIZED_MANOEUVRES := true; /** * @desc Support for SPATEM reception @@ -112,31 +112,25 @@ module LibItsMapemSpatem_Pics { * @desc Support for SPATEM reception * @see TODO */ - modulepar boolean PICS_SPATEM_PEDESTRIAN_MAOEUVRES := false; + modulepar boolean PICS_SPATEM_HAS_OPTIMAL_SPEED := true; /** * @desc Support for SPATEM reception * @see TODO */ - modulepar boolean PICS_SPATEM_HAS_OPTIMAL_SPEED := false; + modulepar boolean PICS_SPATEM_HAS_SIGNAL_PROGRESSION_SPEED := true; /** * @desc Support for SPATEM reception * @see TODO */ - modulepar boolean PICS_SPATEM_HAS_SIGNAL_PROGRESSION_SPEED := false; + modulepar boolean PICS_SPATEM_HAS_EGRESS_QUEUE := true; /** * @desc Support for SPATEM reception * @see TODO */ - modulepar boolean PICS_SPATEM_HAS_EGRESS_QUEUE := false; - - /** - * @desc Support for SPATEM reception - * @see TODO - */ - modulepar boolean PICS_SPATEM_TRANSMISSION_RATE := false; + modulepar boolean PICS_SPATEM_TRANSMISSION_RATE := true; modulepar float PICS_T_GEN_SPATEM_MIN := 0.1; diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn index cb2e0fa6..83b25dcc 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn @@ -878,20 +878,20 @@ module LibItsMapemSpatem_Templates { } template (present) MovementEvent mw_movementEvent( - in template (present) MovementPhaseState p_eventState := ?, - in template TimeChangeDetails p_timing := *, - in template MovementEvent.speeds p_speeds := * + template (present) MovementPhaseState p_eventState := ?, + template TimeChangeDetails p_timing := *, + template MovementEvent.speeds p_speeds := * ) := { - eventState := stop_Then_Proceed, // Consisting of: Phase state (the basic 11 states) and Directional, protected, or permissive state - timing := p_timing, // Timing Data in UTC time stamps for event includes start and min/max end times of phase confidence and estimated next occurrence - speeds := p_speeds, // Various speed advisories for use by general and specific types of vehicles supporting green-wave and other flow needs - regional := * + eventState := p_eventState, // Consisting of: Phase state (the basic 11 states) and Directional, protected, or permissive state + timing := p_timing, // Timing Data in UTC time stamps for event includes start and min/max end times of phase confidence and estimated next occurrence + speeds := p_speeds, // Various speed advisories for use by general and specific types of vehicles supporting green-wave and other flow needs + regional := * } template (present) TimeChangeDetails mw_timeChangeDetails( - in template (present) TimeMark p_minEndTime := ?, - in template TimeMark p_startTime := *, - in template TimeMark p_nextTime := * + template (present) TimeMark p_minEndTime := ?, + template TimeMark p_startTime := *, + template TimeMark p_nextTime := * ) := { startTime := p_startTime, minEndTime := p_minEndTime, @@ -902,8 +902,8 @@ module LibItsMapemSpatem_Templates { } template (present) ConnectionManeuverAssist mw_connectionManeuverAssist( - in template (present) LaneConnectionID p_connectionID := ?, - in template PedestrianBicycleDetect p_pedBicycleDetect := ? + template (present) LaneConnectionID p_connectionID := ?, + template (present) PedestrianBicycleDetect p_pedBicycleDetect := ? ) := { connectionID := p_connectionID, queueLength := *, @@ -914,9 +914,9 @@ module LibItsMapemSpatem_Templates { } template (present) ConnectionManeuverAssist mw_connectionManeuverAssist_queueAndAvailableStorageLength( - in template (present) LaneConnectionID p_connectionID := ?, - in template ZoneLength p_queueLength := ?, - in template ZoneLength p_availableStorageLength := ? + template (present) LaneConnectionID p_connectionID := ?, + template (present) ZoneLength p_queueLength := ?, + template (present) ZoneLength p_availableStorageLength := ? ) := { connectionID := p_connectionID, queueLength := p_queueLength, diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn index ca988767..75cac063 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn @@ -73,10 +73,15 @@ module LibItsMapemSpatem_TypesAndValues { } type enumerated Event { - mapProfile0 (0), - mapProfile1 (1), - mapProfile2 (2), - spatProfile0 (3) + mapProfile0 (0), + mapProfile1 (1), + mapProfile2 (2), + spatProfile0 (3), + spatProfile1 (4), + spatProfile2 (5), + spatProfile3 (6), + tlmPedestrianDetected (10), + stopTLMService (20) } with { variant "FIELDLENGTH(8)" } -- GitLab From 390119fceb9f3235ea89b790dfd202d80085206c Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 8 Mar 2021 07:49:14 +0100 Subject: [PATCH 298/320] Merge with current cygwin version into TTF0002 branch --- asn1/CAM/module.mk | 2 ++ asn1/DENM/module.mk | 2 ++ .../RTCMEM_PDU_Descriptions.asn | 22 +++++++++++++++++++ asn1/IS/ISO_TS_19091/AddGrpC.asn | 3 ++- asn1/IS/ISO_TS_19091/AddGrpC_noCircular.asn | 11 ++++++---- asn1/IS/ISO_TS_19091/DSRC.asn | 10 +++++---- .../ISO_TS_19091/DSRC_REGION_noCircular.asn | 2 +- asn1/IS/ISO_TS_19091/REGION.asn | 6 +++-- asn1/IS/module.mk | 19 ++++++++++++++++ asn1/ITS-Container/module.mk | 1 + asn1/Security/module.mk | 12 ++++++++++ module.mk | 13 +++++++++++ ttcn/BTP/module.mk | 6 +++++ ttcn/CAM/module.mk | 8 +++++++ ttcn/Common/module.mk | 8 +++++++ ttcn/DENM/module.mk | 7 ++++++ ttcn/GeoNetworking/module.mk | 8 +++++++ ttcn/Http/module.mk | 16 ++++++++++++++ ttcn/IVIM/module.mk | 8 +++++++ ttcn/Ipv6OverGeoNetworking/module.mk | 8 +++++++ ttcn/MapemSpatem/module.mk | 7 ++++++ ttcn/Pki/module.mk | 7 ++++++ ttcn/Rtcmem/module.mk | 8 +++++++ ttcn/Security/module.mk | 8 +++++++ ttcn/SremSsem/module.mk | 7 ++++++ 25 files changed, 197 insertions(+), 12 deletions(-) create mode 100644 asn1/CAM/module.mk create mode 100644 asn1/DENM/module.mk create mode 100644 asn1/IS/ETSI_TS_103301/RTCMEM_PDU_Descriptions.asn create mode 100644 asn1/IS/module.mk create mode 100644 asn1/ITS-Container/module.mk create mode 100644 asn1/Security/module.mk create mode 100644 module.mk create mode 100644 ttcn/BTP/module.mk create mode 100644 ttcn/CAM/module.mk create mode 100644 ttcn/Common/module.mk create mode 100644 ttcn/DENM/module.mk create mode 100644 ttcn/GeoNetworking/module.mk create mode 100644 ttcn/Http/module.mk create mode 100644 ttcn/IVIM/module.mk create mode 100644 ttcn/Ipv6OverGeoNetworking/module.mk create mode 100644 ttcn/MapemSpatem/module.mk create mode 100644 ttcn/Pki/module.mk create mode 100644 ttcn/Rtcmem/module.mk create mode 100644 ttcn/Security/module.mk create mode 100644 ttcn/SremSsem/module.mk diff --git a/asn1/CAM/module.mk b/asn1/CAM/module.mk new file mode 100644 index 00000000..bc9e3447 --- /dev/null +++ b/asn1/CAM/module.mk @@ -0,0 +1,2 @@ +sources := CAM_PDU_Descriptions.asn + diff --git a/asn1/DENM/module.mk b/asn1/DENM/module.mk new file mode 100644 index 00000000..16c39c94 --- /dev/null +++ b/asn1/DENM/module.mk @@ -0,0 +1,2 @@ +sources := DENM_PDU_Descriptions.asn + diff --git a/asn1/IS/ETSI_TS_103301/RTCMEM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/RTCMEM_PDU_Descriptions.asn new file mode 100644 index 00000000..1c0ea624 --- /dev/null +++ b/asn1/IS/ETSI_TS_103301/RTCMEM_PDU_Descriptions.asn @@ -0,0 +1,22 @@ +-- @brief Specification of the RTCM corrections extended Message ETSI TS 103 301 +-- Latest version available at @url https://forge.etsi.org/rep/ITS/asn1/is_ts103301.git + +RTCMEM-PDU-Descriptions { + itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts103301 (103301) rtcmem (5) version1 (1) +} + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +IMPORTS +RTCMcorrections FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) } +ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2)}; + +RTCMEM ::= SEQUENCE { + header ItsPduHeader, + rtcmc RTCMcorrections +} + +END + diff --git a/asn1/IS/ISO_TS_19091/AddGrpC.asn b/asn1/IS/ISO_TS_19091/AddGrpC.asn index 06315625..1fda164b 100644 --- a/asn1/IS/ISO_TS_19091/AddGrpC.asn +++ b/asn1/IS/ISO_TS_19091/AddGrpC.asn @@ -26,7 +26,8 @@ DEFINITIONS AUTOMATIC TAGS::= BEGIN IMPORTS --FIXME RGY all definitions are moved to IS-DSRC-noCircular to cut circular import loop --DeltaTime, FuelType, IntersectionID, LaneConnectionID, LaneID, NodeOffsetPointXY, NodeSetXY, PrioritizationResponseStatus, SignalGroupID, VehicleHeight FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) } -NodeOffsetPointXY, NodeSetXY, PrioritizationResponseStatus, SignalGroupID, DeltaTime, LaneID, LaneConnectionID, FuelType, VehicleHeight FROM DSRC-REGION-noCircular +NodeOffsetPointXY, NodeSetXY, PrioritizationResponseStatus, SignalGroupID, DeltaTime, LaneID, LaneConnectionID, FuelType, VehicleHeight +FROM DSRC-REGION-noCircular { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc-reg (3) version (2) } Altitude, StationID, DeltaAltitude, VehicleMass FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) }; diff --git a/asn1/IS/ISO_TS_19091/AddGrpC_noCircular.asn b/asn1/IS/ISO_TS_19091/AddGrpC_noCircular.asn index 905659ee..0ffbe694 100644 --- a/asn1/IS/ISO_TS_19091/AddGrpC_noCircular.asn +++ b/asn1/IS/ISO_TS_19091/AddGrpC_noCircular.asn @@ -7,17 +7,20 @@ -- -- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --FIXME RGY definitions are moved here from AddGrpC; created to cut circular import loops amongst ASN.1 files -AddGrpC-noCircular { iso (1) standard (0) signalizedIntersection (19091) profilec(2) addgrpc (0) version (1) } +AddGrpC-noCircular { iso (1) standard (0) signalizedIntersection (19091) profilec(2) addgrpc (1) version (1) } DEFINITIONS AUTOMATIC TAGS::= BEGIN -IMPORTS; +IMPORTS +PtvRequestType +FROM DSRC-REGION-noCircular { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc-reg (3) version (2) } +; Control-addGrpC ::= SEQUENCE { ptvRequest PtvRequestType, ... } - +/* PtvRequestType ::= ENUMERATED { preRequest, mainRequest, @@ -26,5 +29,5 @@ PtvRequestType ::= ENUMERATED { emergencyRequest, ... } - +*/ END diff --git a/asn1/IS/ISO_TS_19091/DSRC.asn b/asn1/IS/ISO_TS_19091/DSRC.asn index 65a0ddb8..c071c86d 100644 --- a/asn1/IS/ISO_TS_19091/DSRC.asn +++ b/asn1/IS/ISO_TS_19091/DSRC.asn @@ -25,10 +25,13 @@ IMPORTS Reg-SPAT,Reg-SignalRequestMessage, Reg-SignalStatusMessage, Reg-MapData, Reg-AdvisorySpeed, Reg-ComputedLane, Reg-ConnectionManeuverAssist, Reg-GenericLane, Reg-IntersectionGeometry, Reg-IntersectionState, Reg-LaneAttributes, /*Reg-LaneDataAttribute,*/ Reg-MovementEvent, Reg-MovementState, /*Reg-NodeAttributeSetXY, Reg-NodeOffsetPointXY,*/ Reg-Position3D, Reg-RequestorDescription, Reg-RequestorType, Reg-RestrictionUserType, Reg-RoadSegment, -Reg-SignalControlZone, Reg-SignalRequestPackage, Reg-SignalRequest, Reg-SignalStatusPackage, Reg-SignalStatus, Reg-RTCMcorrections FROM REGION {iso (1) standard (0) signalizedIntersection (19091) profilec (2) region (1) version2 (2)} +Reg-SignalControlZone, Reg-SignalRequestPackage, Reg-SignalRequest, Reg-SignalStatusPackage, Reg-SignalStatus, Reg-RTCMcorrections +FROM REGION {iso (1) standard (0) signalizedIntersection (19091) profilec (2) region (1) version2 (2)} --FIXME RGY definitions moved to DSRC-REGION-noCircular but also refernced here are re-imported -DeltaAngle, DeltaTime, LaneID, LaneConnectionID, IntersectionID, NodeSetXY, PrioritizationResponseStatus, RegionalExtension, SignalGroupID, SpeedLimitList, Velocity, NodeOffsetPointXY, NodeAttributeXY, Reg-LaneDataAttribute, Reg-NodeAttributeSetXY, Reg-NodeOffsetPointXY, Offset-B12, Offset-B09, Offset-B10 FROM DSRC-REGION-noCircular +DeltaAngle, DeltaTime, LaneID, LaneConnectionID, IntersectionID, NodeSetXY, PrioritizationResponseStatus, RegionalExtension, SignalGroupID, SpeedLimitList, +Velocity, NodeOffsetPointXY, NodeAttributeXY, Reg-LaneDataAttribute, Reg-NodeAttributeSetXY, Reg-NodeOffsetPointXY, Offset-B12, Offset-B09, Offset-B10, Node-LLmD-64b, NodeAttributeXYList +FROM DSRC-REGION-noCircular { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc-reg (3) version (2) } Iso3833VehicleType FROM ElectronicRegistrationIdentificationVehicleDataModule {iso(1) standard(0) iso24534 (24534) vehicleData (1) version1 (1)} @@ -403,17 +406,16 @@ NodeAttributeXY ::= ENUMERATED { hydrantPresent, ... } -*/ NodeAttributeXYList ::= SEQUENCE (SIZE(1..8)) OF NodeAttributeXY +FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop Node-LLmD-64b ::= SEQUENCE { lon Longitude, lat Latitude } -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop Node-XY-20b ::= SEQUENCE { x Offset-B10, y Offset-B10 diff --git a/asn1/IS/ISO_TS_19091/DSRC_REGION_noCircular.asn b/asn1/IS/ISO_TS_19091/DSRC_REGION_noCircular.asn index 080e5150..fe9c3f4f 100644 --- a/asn1/IS/ISO_TS_19091/DSRC_REGION_noCircular.asn +++ b/asn1/IS/ISO_TS_19091/DSRC_REGION_noCircular.asn @@ -5,7 +5,7 @@ -- -- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --FIXME RGY definitions are moved here from IS-DSRC and IS-REGION; created to cut circular import loops amongst ASN.1 files -DSRC-REGION-noCircular { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version (2) } +DSRC-REGION-noCircular { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc-reg (3) version (2) } DEFINITIONS AUTOMATIC TAGS::= BEGIN diff --git a/asn1/IS/ISO_TS_19091/REGION.asn b/asn1/IS/ISO_TS_19091/REGION.asn index 6a480ad7..44ec2009 100644 --- a/asn1/IS/ISO_TS_19091/REGION.asn +++ b/asn1/IS/ISO_TS_19091/REGION.asn @@ -21,11 +21,13 @@ DEFINITIONS AUTOMATIC TAGS::= BEGIN IMPORTS --FIXME RGY definitions moved to non-circularity module --addGrpC, REG-EXT-ID-AND-TYPE FROM DSRC -NodeAttributeSet-addGrpC, addGrpC, REG-EXT-ID-AND-TYPE FROM DSRC-REGION-noCircular +NodeAttributeSet-addGrpC, addGrpC, REG-EXT-ID-AND-TYPE +FROM DSRC-REGION-noCircular { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc-reg (3) version (2) } --FIXME RGY NodeAttributeSet-addGrpC has been moved to a non-circularity module --NodeAttributeSet-addGrpC FROM AddGrpC-noCircular ConnectionManeuverAssist-addGrpC, ConnectionTrajectory-addGrpC, IntersectionState-addGrpC, /*NodeAttributeSet-addGrpC,*/ Position3D-addGrpC, RestrictionUserType-addGrpC, LaneAttributes-addGrpC, MovementEvent-addGrpC, RequestorDescription-addGrpC, -SignalStatusPackage-addGrpC, MapData-addGrpC FROM AddGrpC {iso (1) standard (0) signalizedIntersection (19091) profilec (2) addgrpc (0) version2 (2)}; +SignalStatusPackage-addGrpC, MapData-addGrpC +FROM AddGrpC {iso (1) standard (0) signalizedIntersection (19091) profilec (2) addgrpc (0) version2 (2)}; Reg-AdvisorySpeed REG-EXT-ID-AND-TYPE ::= { ... } diff --git a/asn1/IS/module.mk b/asn1/IS/module.mk new file mode 100644 index 00000000..6e4474f9 --- /dev/null +++ b/asn1/IS/module.mk @@ -0,0 +1,19 @@ +sources := \ + ETSI_TS_103301/IVIM_PDU_Descriptions.asn \ + ETSI_TS_103301/MAPEM_PDU_Descriptions.asn \ + ETSI_TS_103301/RTCMEM_PDU_Descriptions.asn \ + ETSI_TS_103301/SPATEM_PDU_Descriptions.asn\ + ETSI_TS_103301/SREM_PDU_Descriptions.asn \ + ETSI_TS_103301/SSEM_PDU_Descriptions.asn \ + ISO_TS_14816/AVIAEINumberingAndDataStructures.asn \ + ISO_TS_14906/EfcDsrcApplication.asn \ + ISO_TS_14906/EfcDsrcGeneric.asn \ + ISO_TS_17419/CITSapplMgmtIDs.asn \ + ISO_TS_19091/AddGrpC.asn \ + ISO_TS_19091/AddGrpC_noCircular.asn \ + ISO_TS_19091/DSRC.asn \ + ISO_TS_19091/DSRC_REGION_noCircular.asn \ + ISO_TS_19091/REGION.asn \ + ISO_TS_19321/IVI.asn \ + ISO_TS_24534-3/ElectronicRegistrationIdentificationVehicleDataModule.asn + diff --git a/asn1/ITS-Container/module.mk b/asn1/ITS-Container/module.mk new file mode 100644 index 00000000..0b107446 --- /dev/null +++ b/asn1/ITS-Container/module.mk @@ -0,0 +1 @@ +sources := ITS_Container.asn \ No newline at end of file diff --git a/asn1/Security/module.mk b/asn1/Security/module.mk new file mode 100644 index 00000000..d3f7b469 --- /dev/null +++ b/asn1/Security/module.mk @@ -0,0 +1,12 @@ +sources := \ + ./1609Dot2/IEEE1609dot2.asn \ + ./1609Dot2/IEEE1609dot2BaseTypes.asn \ + ./EtsiTs103097Module.asn \ + ./TS102921/EtsiTs102941BaseTypes.asn \ + ./TS102921/EtsiTs102941MessagesCa.asn \ + ./TS102921/EtsiTs102941TrustLists.asn \ + ./TS102921/EtsiTs102941TypesAuthorization.asn \ + ./TS102921/EtsiTs102941TypesAuthorizationValidation.asn \ + ./TS102921/EtsiTs102941TypesCaManagement.asn \ + ./TS102921/EtsiTs102941TypesEnrolment.asn \ + diff --git a/module.mk b/module.mk new file mode 100644 index 00000000..62797bb3 --- /dev/null +++ b/module.mk @@ -0,0 +1,13 @@ +modules := ttcn/Common \ + asn1/ITS-Container \ + +# asn1/IS \ +# asn1/Security \ +# asn1/DENM \ +# asn1/CAM \ +# ttcn/DENM \ +# ttcn/IVIM \ +# ttcn/MapemSpatem \ +# ttcn/Pki \ +# ttcn/SremSsem \ +# ttcn/Http \ diff --git a/ttcn/BTP/module.mk b/ttcn/BTP/module.mk new file mode 100644 index 00000000..f1c9679f --- /dev/null +++ b/ttcn/BTP/module.mk @@ -0,0 +1,6 @@ +sources := LibItsBtp_EncdecDeclarations.ttcn \ + LibItsBtp_Functions.ttcn \ + LibItsBtp_Pixits.ttcn \ + LibItsBtp_Templates.ttcn \ + LibItsBtp_TestSystem.ttcn \ + LibItsBtp_TypesAndValues.ttcn diff --git a/ttcn/CAM/module.mk b/ttcn/CAM/module.mk new file mode 100644 index 00000000..52c19ced --- /dev/null +++ b/ttcn/CAM/module.mk @@ -0,0 +1,8 @@ +sources := \ + LibItsCam_EncdecDeclarations.ttcn \ + LibItsCam_Functions.ttcn \ + LibItsCam_Pics.ttcn \ + LibItsCam_Pixits.ttcn \ + LibItsCam_Templates.ttcn \ + LibItsCam_TestSystem.ttcn \ + LibItsCam_TypesAndValues.ttcn diff --git a/ttcn/Common/module.mk b/ttcn/Common/module.mk new file mode 100644 index 00000000..85e1185c --- /dev/null +++ b/ttcn/Common/module.mk @@ -0,0 +1,8 @@ +sources := LibItsCommon_ASN1_ISDSRC_NamedNumbers.ttcn \ + LibItsCommon_ASN1_NamedNumbers.ttcn \ + LibItsCommon_Functions.ttcn \ + LibItsCommon_Pixits.ttcn \ + LibItsCommon_Templates.ttcn \ + LibItsCommon_TestSystem.ttcn \ + LibItsCommon_TypesAndValues.ttcn \ + LibItsExternal_TypesAndValues.ttcn \ No newline at end of file diff --git a/ttcn/DENM/module.mk b/ttcn/DENM/module.mk new file mode 100644 index 00000000..643df797 --- /dev/null +++ b/ttcn/DENM/module.mk @@ -0,0 +1,7 @@ +sources := LibItsDenm_EncdecDeclarations.ttcn \ + LibItsDenm_Functions.ttcn \ + LibItsDenm_Pics.ttcn \ + LibItsDenm_Pixits.ttcn \ + LibItsDenm_Templates.ttcn \ + LibItsDenm_TestSystem.ttcn \ + LibItsDenm_TypesAndValues.ttcn \ No newline at end of file diff --git a/ttcn/GeoNetworking/module.mk b/ttcn/GeoNetworking/module.mk new file mode 100644 index 00000000..2db9447c --- /dev/null +++ b/ttcn/GeoNetworking/module.mk @@ -0,0 +1,8 @@ +sources := \ + LibItsGeoNetworking_EncdecDeclarations.ttcn \ + LibItsGeoNetworking_Functions.ttcn \ + LibItsGeoNetworking_Pics.ttcn \ + LibItsGeoNetworking_Pixits.ttcn \ + LibItsGeoNetworking_Templates.ttcn \ + LibItsGeoNetworking_TestSystem.ttcn \ + LibItsGeoNetworking_TypesAndValues.ttcn \ diff --git a/ttcn/Http/module.mk b/ttcn/Http/module.mk new file mode 100644 index 00000000..9ac4f5b9 --- /dev/null +++ b/ttcn/Http/module.mk @@ -0,0 +1,16 @@ +sources := LibItsHttp_BinaryMessageBodyTypes.ttcn \ + LibItsHttp_BinaryTemplates.ttcn \ + LibItsHttp_BinaryTypes.ttcn \ + LibItsHttp_EncdecDeclarations.ttcn \ + LibItsHttp_Functions.ttcn \ + LibItsHttp_JSONTypes.ttcn \ + LibItsHttp_JsonMessageBodyTypes.ttcn \ + LibItsHttp_JsonTemplates.ttcn \ + LibItsHttp_MessageBodyTypes.ttcn \ + LibItsHttp_Pics.ttcn \ + LibItsHttp_Templates.ttcn \ + LibItsHttp_TestSystem.ttcn \ + LibItsHttp_TypesAndValues.ttcn \ + LibItsHttp_XMLTypes.ttcn \ + LibItsHttp_XmlMessageBodyTypes.ttcn \ + LibItsHttp_XmlTemplates.ttcn diff --git a/ttcn/IVIM/module.mk b/ttcn/IVIM/module.mk new file mode 100644 index 00000000..72982712 --- /dev/null +++ b/ttcn/IVIM/module.mk @@ -0,0 +1,8 @@ +sources := LibItsIvim_ASN1_IVInamedNumbers.ttcn \ + LibItsIvim_EncdecDeclarations.ttcn \ + LibItsIvim_Functions.ttcn \ + LibItsIvim_Pics.ttcn \ + LibItsIvim_Pixits.ttcn \ + LibItsIvim_Templates.ttcn \ + LibItsIvim_TestSystem.ttcn \ + LibItsIvim_TypesAndValues.ttcn diff --git a/ttcn/Ipv6OverGeoNetworking/module.mk b/ttcn/Ipv6OverGeoNetworking/module.mk new file mode 100644 index 00000000..bc70007d --- /dev/null +++ b/ttcn/Ipv6OverGeoNetworking/module.mk @@ -0,0 +1,8 @@ +sources := \ +LibItsIpv6OverGeoNetworking_EncdecDeclarations.ttcn \ +LibItsIpv6OverGeoNetworking_Functions.ttcn \ +LibItsIpv6OverGeoNetworking_Pics.ttcn \ +LibItsIpv6OverGeoNetworking_Pixits.ttcn \ +LibItsIpv6OverGeoNetworking_Templates.ttcn \ +LibItsIpv6OverGeoNetworking_TestSystem.ttcn \ +LibItsIpv6OverGeoNetworking_TypesAndValues.ttcn \ No newline at end of file diff --git a/ttcn/MapemSpatem/module.mk b/ttcn/MapemSpatem/module.mk new file mode 100644 index 00000000..b922c554 --- /dev/null +++ b/ttcn/MapemSpatem/module.mk @@ -0,0 +1,7 @@ +sources := LibItsMapemSpatem_EncdecDeclarations.ttcn \ + LibItsMapemSpatem_Functions.ttcn \ + LibItsMapemSpatem_Pics.ttcn \ + LibItsMapemSpatem_Pixits.ttcn \ + LibItsMapemSpatem_Templates.ttcn \ + LibItsMapemSpatem_TestSystem.ttcn \ + LibItsMapemSpatem_TypesAndValues.ttcn diff --git a/ttcn/Pki/module.mk b/ttcn/Pki/module.mk new file mode 100644 index 00000000..24fe315b --- /dev/null +++ b/ttcn/Pki/module.mk @@ -0,0 +1,7 @@ +sources := LibItsPki_EncdecDeclarations.ttcn \ + LibItsPki_Functions.ttcn \ + LibItsPki_Pics.ttcn \ + LibItsPki_Pixits.ttcn \ + LibItsPki_Templates.ttcn \ + LibItsPki_TestSystem.ttcn \ + LibItsPki_TypesAndValues.ttcn diff --git a/ttcn/Rtcmem/module.mk b/ttcn/Rtcmem/module.mk new file mode 100644 index 00000000..1afd06be --- /dev/null +++ b/ttcn/Rtcmem/module.mk @@ -0,0 +1,8 @@ +sources := \ +LibItsRtcmem_EncdecDeclarations.ttcn \ +LibItsRtcmem_Functions.ttcn \ +LibItsRtcmem_Pics.ttcn \ +LibItsRtcmem_Pixits.ttcn \ +LibItsRtcmem_Templates.ttcn \ +LibItsRtcmem_TestSystem.ttcn \ +LibItsRtcmem_TypesAndValues.ttcn diff --git a/ttcn/Security/module.mk b/ttcn/Security/module.mk new file mode 100644 index 00000000..12e4cc43 --- /dev/null +++ b/ttcn/Security/module.mk @@ -0,0 +1,8 @@ +sources := \ + LibItsSecurity_EncdecDeclarations.ttcn \ + LibItsSecurity_Functions.ttcn \ + LibItsSecurity_Pics.ttcn \ + LibItsSecurity_Pixits.ttcn \ + LibItsSecurity_Templates.ttcn \ + LibItsSecurity_TestSystem.ttcn \ + LibItsSecurity_TypesAndValues.ttcn \ diff --git a/ttcn/SremSsem/module.mk b/ttcn/SremSsem/module.mk new file mode 100644 index 00000000..b74c0602 --- /dev/null +++ b/ttcn/SremSsem/module.mk @@ -0,0 +1,7 @@ +sources := LibItsSremSsem_EncdecDeclarations.ttcn \ + LibItsSremSsem_Functions.ttcn \ + LibItsSremSsem_Pics.ttcn \ + LibItsSremSsem_Pixits.ttcn \ + LibItsSremSsem_Templates.ttcn \ + LibItsSremSsem_TestSystem.ttcn \ + LibItsSremSsem_TypesAndValues.ttcn -- GitLab From 03707ab7809aa21ed74dce51d3cf33cf053d4a5f Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Mon, 8 Mar 2021 07:58:49 +0100 Subject: [PATCH 299/320] Merge cygwin branch into TTF0002 --- .../{EtsiTs102941MessagesCA.asn => EtsiTs102941MessagesCa.asn} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename asn1/Security/TS102921/{EtsiTs102941MessagesCA.asn => EtsiTs102941MessagesCa.asn} (100%) diff --git a/asn1/Security/TS102921/EtsiTs102941MessagesCA.asn b/asn1/Security/TS102921/EtsiTs102941MessagesCa.asn similarity index 100% rename from asn1/Security/TS102921/EtsiTs102941MessagesCA.asn rename to asn1/Security/TS102921/EtsiTs102941MessagesCa.asn -- GitLab From c5c42ae79dd406c8a9fd204a4adad1b3463dceb0 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Tue, 9 Mar 2021 09:16:09 +0100 Subject: [PATCH 300/320] Fixed merge issue (duplicate files) --- .../ETSI_TS_103301/RTCM_PDU_Descriptions.asn | 22 ------------------- 1 file changed, 22 deletions(-) delete mode 100644 asn1/IS/ETSI_TS_103301/RTCM_PDU_Descriptions.asn diff --git a/asn1/IS/ETSI_TS_103301/RTCM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/RTCM_PDU_Descriptions.asn deleted file mode 100644 index 1c0ea624..00000000 --- a/asn1/IS/ETSI_TS_103301/RTCM_PDU_Descriptions.asn +++ /dev/null @@ -1,22 +0,0 @@ --- @brief Specification of the RTCM corrections extended Message ETSI TS 103 301 --- Latest version available at @url https://forge.etsi.org/rep/ITS/asn1/is_ts103301.git - -RTCMEM-PDU-Descriptions { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts103301 (103301) rtcmem (5) version1 (1) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS -RTCMcorrections FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) } -ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2)}; - -RTCMEM ::= SEQUENCE { - header ItsPduHeader, - rtcmc RTCMcorrections -} - -END - -- GitLab From c60111cffd1f7222785329c5273b46534a8b878f Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Mon, 10 May 2021 18:40:14 +0200 Subject: [PATCH 301/320] Validation of IVIM ATS againt CNIT --- .../LibItsGeoNetworking_Functions.ttcn | 3 + ttcn/IVIM/LibItsIvim_Templates.ttcn | 52 ++++---- ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn | 4 +- .../LibItsMapemSpatem_Functions.ttcn | 2 +- .../LibItsMapemSpatem_Templates.ttcn | 8 +- .../LibItsMapemSpatem_TypesAndValues.ttcn | 5 +- ttcn/Security/LibItsSecurity_Functions.ttcn | 112 ++++++++++++++---- 7 files changed, 127 insertions(+), 59 deletions(-) diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn index 8381f44f..29fee471 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn @@ -1275,6 +1275,9 @@ module LibItsGeoNetworking_Functions { var UtGnEventInd v_ind; [vc_utDefaultActive] utPort.receive(UtGnEventInd:?) -> value v_ind { //store every upper tester indication received + log("################# v_ind: ", v_ind); + log("################# vc_utInds: ", vc_utInds); + log("################# lengthof(vc_utInds): ", lengthof(vc_utInds)); vc_utInds[lengthof(vc_utInds)] := v_ind; repeat; } diff --git a/ttcn/IVIM/LibItsIvim_Templates.ttcn b/ttcn/IVIM/LibItsIvim_Templates.ttcn index 6d959fba..fcc8bb0e 100644 --- a/ttcn/IVIM/LibItsIvim_Templates.ttcn +++ b/ttcn/IVIM/LibItsIvim_Templates.ttcn @@ -47,7 +47,7 @@ module LibItsIvim_Templates { */ template (value) IvimReq m_ivimReq( in template (value) IVIM p_iviMsg - ) := { + ) := { msgOut := p_iviMsg } // End of template m_ivimReq @@ -57,7 +57,7 @@ module LibItsIvim_Templates { */ template (present) IvimInd mw_ivimInd( template (present) IVIM p_iviMsg := ? - ) := { + ) := { msgIn := p_iviMsg, recvTime := ?, gnNextHeader := *, @@ -83,12 +83,12 @@ module LibItsIvim_Templates { */ template IvimInd mw_ivimIndWithGnParameters( template (present) IVIM p_iviMsg := ?, - in template UInt8 p_gnNextHeader := *, - in template UInt8 p_gnHeaderType := *, - in template UInt8 p_gnHeaderSubtype := *, - in template UInt32 p_gnLifetime := *, - in template UInt8 p_gnTrafficClass := * - ) modifies mw_ivimInd := { + template UInt8 p_gnNextHeader := *, + template UInt8 p_gnHeaderType := *, + template UInt8 p_gnHeaderSubtype := *, + template UInt32 p_gnLifetime := *, + template UInt8 p_gnTrafficClass := * + ) modifies mw_ivimInd := { gnNextHeader := p_gnNextHeader, gnHeaderType := p_gnHeaderType, gnHeaderSubtype := p_gnHeaderSubtype, @@ -104,9 +104,9 @@ module LibItsIvim_Templates { */ template IvimInd mw_ivimIndWithBtpParameters( template (present) IVIM p_iviMsg := ?, - template UInt16 p_btpDestinationPort := *, - template UInt16 p_btpInfo := * - ) modifies mw_ivimInd := { + template UInt16 p_btpDestinationPort := *, + template UInt16 p_btpInfo := * + ) modifies mw_ivimInd := { btpDestinationPort := p_btpDestinationPort, btpInfo := p_btpInfo } // End of template mw_ivimIndWithBtpParameters @@ -119,9 +119,9 @@ module LibItsIvim_Templates { */ template IvimInd mw_ivimIndWithSecurityParameters( template (present) IVIM p_iviMsg := ?, - template Bit256 p_ssp := *, - template UInt32 p_its_aid := * - ) modifies mw_ivimInd := { + template Bit256 p_ssp := *, + template UInt32 p_its_aid := * + ) modifies mw_ivimInd := { ssp := p_ssp, its_aid := p_its_aid } // End of template mw_ivimIndWithSecurityParameters @@ -133,7 +133,7 @@ module LibItsIvim_Templates { */ template (value) UtIvimInitialize m_ivimStructureInitialize( in HashedId8 p_hashedId8 := '0000000000000000'O - ) := { + ) := { hashedId8 := p_hashedId8 } // End of template m_ivimStructureInitialize @@ -146,7 +146,7 @@ module LibItsIvim_Templates { * @param p_optional_ Optional field (Default: omit) */ template (value) UtIvimTrigger m_utTriggerEvent( - template (omit) TimestampIts p_repetitionInterval := c_duration_4sec, + template (omit) TimestampIts p_repetitionInterval := c_duration_4sec * 1000, // TimeStampIts in millseconds template (omit) TimestampIts p_validFrom := omit, template (omit) TimestampIts p_validTo := omit, template (omit) ZidList p_zoneIds := omit, @@ -157,7 +157,7 @@ module LibItsIvim_Templates { template (omit) VarLengthNumber p_itsRrid := omit, template (omit) Direction p_directionGic := omit, template (omit) integer p_layoutId := omit - ) := { + ) := { validFrom := p_validFrom, validTo := p_validTo, repetitionInterval := p_repetitionInterval, @@ -180,12 +180,12 @@ module LibItsIvim_Templates { * @param p_connectedIviStructures List of ConnectedIviStructure (Default: omit) */ template (omit) UtIvimUpdate m_utIvimUpdateEvent( - template (value) IviIdentificationNumber p_iviIdentificationNumber, - template (omit) TimestampIts p_timeStamp := c_duration_2sec, - template (omit) TimestampIts p_validFrom := omit, - template (omit) TimestampIts p_validTo := omit, - template (omit) IVIManagementContainer.connectedIviStructures p_connectedIviStructures := omit - ) := { + template (value) IviIdentificationNumber p_iviIdentificationNumber, + template (omit) TimestampIts p_timeStamp := c_duration_2sec * 1000, // TimeStampIts in millseconds + template (omit) TimestampIts p_validFrom := omit, + template (omit) TimestampIts p_validTo := omit, + template (omit) IVIManagementContainer.connectedIviStructures p_connectedIviStructures := omit + ) := { iviIdentificationNumber := p_iviIdentificationNumber, validFrom := p_validFrom, validTo := p_validTo, @@ -232,9 +232,9 @@ module LibItsIvim_Templates { * @param p_messageID The expected message id (Default: IVI message id) */ template (present) ItsPduHeader mw_itsPduHeader( - template (present) StationID p_stationID := ?, - template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, - template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_ivim_ + template (present) StationID p_stationID := ?, + template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, + template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_ivim_ ) := { protocolVersion := p_protocolVersion, messageID := p_messageID, diff --git a/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn b/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn index cdf02c9c..cb16e7f9 100644 --- a/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn +++ b/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn @@ -36,7 +36,7 @@ module LibItsIvim_TypesAndValues { group ivimConstants { const TimestampIts c_repetition_interval_deactivated := 0; - const TimestampIts c_duration_2sec := 2; + const TimestampIts c_duration_2sec := 2; // FIXME Change them into milliseconds and remove *1000 factor in Tp & Template (default values) const TimestampIts c_duration_4sec := 4; const TimestampIts c_duration_6sec := 6; @@ -141,7 +141,7 @@ module LibItsIvim_TypesAndValues { IviIdentificationNumber iviIdentificationNumber, TimestampIts validFrom optional, TimestampIts validTo optional, - TimestampIts timeStamp optional, + TimestampIts timeStamp optional, // FIXME Rename timeStamp into repetitionInterval as described in ETSI TR 103 099 Clause C.9.2 UpdateIvimEvent IVIManagementContainer.connectedIviStructures connectedIviStructures optional } with { variant "FIELDORDER(msb)" diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn index db0e803e..1f31709f 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn @@ -75,7 +75,7 @@ module LibItsMapemSpatem_Functions { //deactivate mapemSpatemPort default alts vc_mapemSpatemDefaultActive := false; - + utPort.send ( p_event ); tc_wait.start; alt { diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn index 83b25dcc..3d1449a1 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn @@ -224,13 +224,13 @@ module LibItsMapemSpatem_Templates { template (omit) UtMapemSpatemTrigger m_utTriggerEvent( in Event p_event, in template (omit) IntersectionID p_intersectionID := omit, - in template (omit) RegulatorySpeedLimit p_regulatorySpeedLimit := omit, - in template (omit) Latitude p_latitude := omit + in template (omit) RegulatorySpeedLimit p_regulatorySpeedLimit := omit/*, + in template (omit) Latitude p_latitude := omit*/ ) := { event := p_event, intersectionID := p_intersectionID, - regulatorySpeedLimit := p_regulatorySpeedLimit, - latitude := p_latitude + regulatorySpeedLimit := p_regulatorySpeedLimit/*, + latitude := p_latitude*/ } } diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn index 75cac063..46a97d4a 100644 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn +++ b/ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn @@ -65,9 +65,8 @@ module LibItsMapemSpatem_TypesAndValues { type record UtMapemSpatemTrigger { Event event, IntersectionID intersectionID optional, - RegulatorySpeedLimit regulatorySpeedLimit optional, - Latitude latitude optional - + RegulatorySpeedLimit regulatorySpeedLimit optional/*, + Latitude latitude optional*/ } with { variant "FIELDORDER(msb)" } diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 7234bf7e..5f558947 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -1178,17 +1178,10 @@ module LibItsSecurity_Functions { /** * @desc This function build and sign the SecureMessage part covered by the signature process including wrong elements of protocols. It is used for BO test cases * @param p_securedMessage The signed SecureMessage part - * @param p_protocolVersion The protocol version to be set. Default: 2 - * @param p_trailerStatus The Traile behaviour: - *
  • 0 for no trailer
  • - *
  • 1 for invalid trailer
  • - *
  • 2 for duplicated trailer
  • - * @param p_payloadField Payloads to be included in the message - * @param p_signerIdentifierType Add digest or AT certificate or certificate chain - * @param p_threeDLocation The 3D location - * @param p_headerInfo HeaderInfo to be inserted in the message + * @param p_signerIdentifierType Add digest or AT certificate or certificate chain * @param p_certificateName The certificate identifier to be used. Default: TA_CERT_A - * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerInfo + * @param p_protocolVersion The protocol version to be set. Default: 2 + * @param p_alterIssuerIdentifier Set to true to alter IssuerIdentifier * @param p_alterATCertificateSignature Set to true to alter the AT certificate signature * @param p_alterAACertificateSignature Set to true to alter the AA certificate signature * @return true on success, false otherwise @@ -1196,16 +1189,14 @@ module LibItsSecurity_Functions { * @see Draft ETSI TS 103 097 V1.1.14 Clause 7.1 Security profile for CAMs */ function f_buildGnSecuredCam_Bo( - inout EtsiTs103097Data p_securedMessage, - in UInt8 p_protocolVersion := c_protocol_version, - in integer p_trailerStatus := 0, + out EtsiTs103097Data p_securedMessage, in ToBeSignedData p_payloadField, in SignerIdentifier p_signerIdentifierType, // FIXME To be reviewed - in template (omit) HeaderInfo p_headerInfo := omit, - in charstring p_certificateName := "", - in boolean p_addMissingHeaders := true, - in boolean p_alterATCertificateSignature := false, - in boolean p_alterAACertificateSignature := false + in charstring p_certificateName, + in UInt8 p_protocolVersion, + in boolean p_alterIssuerIdentifier, + in boolean p_alterATCertificateSignature, + in boolean p_alterAACertificateSignature ) runs on ItsSecurityBaseComponent return boolean { // Local variables @@ -1218,14 +1209,89 @@ module LibItsSecurity_Functions { return false; } - if (p_alterATCertificateSignature == true) { + // Fill the structure with default values, these values will be updated later + p_securedMessage := valueof(m_etsiTs103097Data_signed( + m_signedData( + sha256, + p_payloadField, + m_signerIdentifier_self, + m_signature_ecdsaNistP256( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only(int2oct(0, 32)), + int2oct(0, 32) + ) + ) + ) + )); + // Prepare mandatory headers + //log("f_buildGnSecuredCam: p_signerIdentifierType=", p_signerIdentifierType); + if (ischosen(p_signerIdentifierType.certificate)) { // Add the AT certificate + log("*** " & testcasename() & "f_buildGnSecuredCam: TODO ***"); + stop; + /* TODO + * v_signerInfo := valueof( + m_header_info_signer_info( + m_signerIdentifier_certificate( + v_atCertificate + ))); + } else if (valueof(p_signerIdentifierType) == e_certificate_chain) { // Add the AT certificate + AA EtsiTs103097Certificate + v_signerInfo := valueof( + m_header_info_signer_info( + m_signerIdentifier_certificates( + { + v_aaCertificate, + v_atCertificate + } + ) + ));*/ + } else if (ischosen(p_signerIdentifierType.digest)) { // Add the AT certificate digest + if (ischosen(v_atCertificate.issuer.sha256AndDigest)) { + p_securedMessage.content.signedData.hashId := sha256; + p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_digest( + f_calculateDigestSha256FromCertificate(v_atCertificate) + )); + } else if (ischosen(v_atCertificate.issuer.sha384AndDigest)) { + p_securedMessage.content.signedData.hashId := sha384; + p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_digest( + f_calculateDigestSha384FromCertificate(v_atCertificate) + )); + } + } else { + log("*** " & testcasename() & "f_buildGnSecuredCam: TODO ***"); + stop; + } + if (ispresent(v_atCertificate.signature_)) { + if (ischosen(v_atCertificate.signature_.ecdsaBrainpoolP256r1Signature)) { + p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP256r1( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only(int2oct(0, 32)), + int2oct(0, 32) + ) + )); + } else if (ischosen(v_atCertificate.signature_.ecdsaBrainpoolP384r1Signature)) { + p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP384r1( + m_ecdsaP384Signature( + m_eccP384CurvePoint_x_only(int2oct(0, 48)), + int2oct(0, 48) + ) + )); + } // else, m_signature_ecdsaNistP256 already chosen by default + } + log("f_buildGnSecuredCam_Bo: p_securedMessage = ", p_securedMessage); + + // Alter protocolVersion + p_securedMessage.protocolVersion := p_protocolVersion; + + return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField); + + /*if (p_alterATCertificateSignature == true) { v_atCertificate.signature_.ecdsaNistP256Signature.sSig := not4b(v_atCertificate.signature_.ecdsaNistP256Signature.sSig); } if (p_alterAACertificateSignature == true) { v_aaCertificate.signature_.ecdsaNistP256Signature.sSig := not4b(v_aaCertificate.signature_.ecdsaNistP256Signature.sSig); - } - + }*/ + /* FIXME To be reviewed if (p_addMissingHeaders == true) { // Prepare mandatory headers if (valueof(p_signerIdentifierType) == e_certificate) { // Add the AT certificate @@ -1256,9 +1322,9 @@ module LibItsSecurity_Functions { valueof(m_header_info_generation_time(1000 * f_getCurrentTime())), // In us valueof(m_header_info_its_aid(c_its_aid_CAM)) } - }*/ + } - return f_buildGnSecuredMessage_Bo(p_securedMessage, p_certificateName, p_protocolVersion, p_trailerStatus, p_payloadField, v_mandatoryHeaders, p_headerInfo); + return f_buildGnSecuredMessage_Bo(p_securedMessage, p_certificateName, p_protocolVersion, p_trailerStatus, p_payloadField, v_mandatoryHeaders, p_headerInfo);*/ } // End of function f_buildGnSecuredCam_Bo -- GitLab From b5194ecd3c2b5252daf13a3d394685d6db727524 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Wed, 12 May 2021 14:41:08 +0200 Subject: [PATCH 302/320] Update response template for DELETE --- ttcn/Http/LibItsHttp_Templates.ttcn | 39 +++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/ttcn/Http/LibItsHttp_Templates.ttcn b/ttcn/Http/LibItsHttp_Templates.ttcn index 44dafe1b..a8c27d76 100644 --- a/ttcn/Http/LibItsHttp_Templates.ttcn +++ b/ttcn/Http/LibItsHttp_Templates.ttcn @@ -49,8 +49,8 @@ module LibItsHttp_Templates { group http_headers { template (value) Header m_header_line( - in template (value) charstring p_header_name, - in template (value) charstring_list p_header_value + in template (value) charstring p_header_name, + in template (value) charstring_list p_header_value ) := { header_name := p_header_name, header_value := p_header_value @@ -177,6 +177,17 @@ module LibItsHttp_Templates { body := omit } // End of template m_http_response_ok_no_body + template (present) Response mw_http_response_ok_no_body( + template (present) Headers p_header := ? + ) := { + version_major := 1, + version_minor := 1, + statuscode := 200, + statustext := "OK", + header := p_header, + body := omit + } // End of template mw_http_response_ok_no_body + template (value) Response m_http_response_204_no_content( in template (value) Headers p_header ) modifies m_http_response_ok_no_body := { @@ -202,7 +213,7 @@ module LibItsHttp_Templates { ) modifies mw_http_response_ok := { statuscode := 201, statustext := "Created" - } // End of template mw_http_response_ok + } // End of template mw_http_response_201_created template (present) Response mw_http_response_202_accepted( template (present) HttpMessageBody p_body := ?, @@ -210,15 +221,14 @@ module LibItsHttp_Templates { ) modifies mw_http_response_ok := { statuscode := 202, statustext := "Accepted" - } // End of template mw_http_response_ok + } // End of template mw_http_response_202_accepted template (present) Response mw_http_response_204_no_content( - template (present) HttpMessageBody p_body := ?, - template (present) Headers p_header := ? - ) modifies mw_http_response_ok := { + template (present) Headers p_header := ? + ) modifies mw_http_response_ok_no_body := { statuscode := 204, statustext := "No Content" - } // End of template mw_http_response_ok + } // End of template mw_http_response_204_no_content template (value) Response m_http_response_ko( in template (value) HttpMessageBody p_body, @@ -247,6 +257,19 @@ module LibItsHttp_Templates { body := omit } // End of template m_http_response_ko_no_body + template (present) Response mw_http_response_ko_no_body( + template (present) Headers p_header := ?, + template (present) integer p_statuscode := 404, + template (present) charstring p_statustext := "Not found" + ) := { + version_major := 1, + version_minor := 1, + statuscode := p_statuscode, + statustext := p_statustext, + header := p_header, + body := omit + } // End of template mw_http_response_ko_no_body + template Response mw_http_response_ko( template HttpMessageBody p_body := *, template (present) Headers p_header := ? -- GitLab From 5d8bcbabe26ff9042bc3b38accaacd1a033c5ec7 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Mon, 17 May 2021 16:41:30 +0200 Subject: [PATCH 303/320] STF594: Add new CAM tests --- .../LibItsGeoNetworking_Functions.ttcn | 6 +- ttcn/Security/LibItsSecurity_Functions.ttcn | 87 ++++++++----------- ttcn/Security/LibItsSecurity_Pixits.ttcn | 8 +- .../LibItsSecurity_TypesAndValues.ttcn | 1 + 4 files changed, 45 insertions(+), 57 deletions(-) diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn index 29fee471..79bb7cf5 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn @@ -1275,10 +1275,10 @@ module LibItsGeoNetworking_Functions { var UtGnEventInd v_ind; [vc_utDefaultActive] utPort.receive(UtGnEventInd:?) -> value v_ind { //store every upper tester indication received - log("################# v_ind: ", v_ind); - log("################# vc_utInds: ", vc_utInds); - log("################# lengthof(vc_utInds): ", lengthof(vc_utInds)); + //log("################# v_ind: ", v_ind); vc_utInds[lengthof(vc_utInds)] := v_ind; + //log("################# vc_utInds: ", vc_utInds); + //log("################# lengthof(vc_utInds): ", lengthof(vc_utInds)); repeat; } [vc_utDefaultActive] utPort.receive { diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 5f558947..1db2c476 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -21,7 +21,7 @@ module LibItsSecurity_Functions { import from EtsiTs103097Module language "ASN.1:1997" all; // LibItsCommon - //import from LibItsCommon_Functions all; + import from LibItsCommon_Functions all; //import from LibItsCommon_TypesAndValues all; import from LibItsCommon_Pixits all; @@ -1086,8 +1086,7 @@ module LibItsSecurity_Functions { out EtsiTs103097Data p_securedMessage, in ToBeSignedData p_payloadField, in SignerIdentifier p_signerIdentifierType, - in charstring p_certificateName := ""/*, - in boolean p_addMissingHeaders := true*/ + in charstring p_certificateName := "" ) runs on ItsSecurityBaseComponent return boolean { // Local variables var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; @@ -1116,27 +1115,8 @@ module LibItsSecurity_Functions { ) )); // Prepare mandatory headers - //log("f_buildGnSecuredCam: p_signerIdentifierType=", p_signerIdentifierType); - if (ischosen(p_signerIdentifierType.certificate)) { // Add the AT certificate - log("*** " & testcasename() & "f_buildGnSecuredCam: TODO ***"); - stop; - /* TODO - * v_signerInfo := valueof( - m_header_info_signer_info( - m_signerIdentifier_certificate( - v_atCertificate - ))); - } else if (valueof(p_signerIdentifierType) == e_certificate_chain) { // Add the AT certificate + AA EtsiTs103097Certificate - v_signerInfo := valueof( - m_header_info_signer_info( - m_signerIdentifier_certificates( - { - v_aaCertificate, - v_atCertificate - } - ) - ));*/ - } else if (ischosen(p_signerIdentifierType.digest)) { // Add the AT certificate digest + log("f_buildGnSecuredCam: p_signerIdentifierType=", p_signerIdentifierType); + if (ischosen(p_signerIdentifierType.digest)) { // Add the AT certificate digest if (ischosen(v_atCertificate.issuer.sha256AndDigest)) { p_securedMessage.content.signedData.hashId := sha256; p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_digest( @@ -1148,9 +1128,6 @@ module LibItsSecurity_Functions { f_calculateDigestSha384FromCertificate(v_atCertificate) )); } - } else { - log("*** " & testcasename() & "f_buildGnSecuredCam: TODO ***"); - stop; } if (ispresent(v_atCertificate.signature_)) { if (ischosen(v_atCertificate.signature_.ecdsaBrainpoolP256r1Signature)) { @@ -1167,9 +1144,9 @@ module LibItsSecurity_Functions { int2oct(0, 48) ) )); - } // else, m_signature_ecdsaNistP256 already chosen by default + } // else, m_signature_ecdsaNistP256 already chosen by default } - //log("f_buildGnSecuredCam: p_securedMessage = ", p_securedMessage); + log("f_buildGnSecuredCam: p_securedMessage = ", p_securedMessage); return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField/*, v_mandatoryHeaders*/); @@ -1194,6 +1171,12 @@ module LibItsSecurity_Functions { in SignerIdentifier p_signerIdentifierType, // FIXME To be reviewed in charstring p_certificateName, in UInt8 p_protocolVersion, + in boolean p_alter_psid, + in boolean p_add_generation_location, + in boolean p_add_expiry_time, + in boolean p_add_p2pcd_learning_request, + in boolean p_add_missing_crl_identifier, + in boolean p_add_encryption_key, in boolean p_alterIssuerIdentifier, in boolean p_alterATCertificateSignature, in boolean p_alterAACertificateSignature @@ -1225,26 +1208,7 @@ module LibItsSecurity_Functions { )); // Prepare mandatory headers //log("f_buildGnSecuredCam: p_signerIdentifierType=", p_signerIdentifierType); - if (ischosen(p_signerIdentifierType.certificate)) { // Add the AT certificate - log("*** " & testcasename() & "f_buildGnSecuredCam: TODO ***"); - stop; - /* TODO - * v_signerInfo := valueof( - m_header_info_signer_info( - m_signerIdentifier_certificate( - v_atCertificate - ))); - } else if (valueof(p_signerIdentifierType) == e_certificate_chain) { // Add the AT certificate + AA EtsiTs103097Certificate - v_signerInfo := valueof( - m_header_info_signer_info( - m_signerIdentifier_certificates( - { - v_aaCertificate, - v_atCertificate - } - ) - ));*/ - } else if (ischosen(p_signerIdentifierType.digest)) { // Add the AT certificate digest + if (ischosen(p_signerIdentifierType.digest)) { // Add the AT certificate digest if (ischosen(v_atCertificate.issuer.sha256AndDigest)) { p_securedMessage.content.signedData.hashId := sha256; p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_digest( @@ -1256,9 +1220,6 @@ module LibItsSecurity_Functions { f_calculateDigestSha384FromCertificate(v_atCertificate) )); } - } else { - log("*** " & testcasename() & "f_buildGnSecuredCam: TODO ***"); - stop; } if (ispresent(v_atCertificate.signature_)) { if (ischosen(v_atCertificate.signature_.ecdsaBrainpoolP256r1Signature)) { @@ -1281,7 +1242,27 @@ module LibItsSecurity_Functions { // Alter protocolVersion p_securedMessage.protocolVersion := p_protocolVersion; - + // Alter psid + if (p_alter_psid == true) { + p_securedMessage.content.signedData.tbsData.headerInfo.psid := 99; + } + // Add generationLocation + if (p_add_generation_location == true) { + p_securedMessage.content.signedData.tbsData.headerInfo.generationLocation := valueof(m_threeDLocation(PX_WGSLATITUDE, PX_WGSLONGITUDE, 0)); + } + if (p_add_expiry_time == true) { + p_securedMessage.content.signedData.tbsData.headerInfo.expiryTime := f_getCurrentTimeUtc() + 3600; + } + if (p_add_p2pcd_learning_request == true) { + //TODO + } + if (p_add_missing_crl_identifier == true) { + //TODO + } + if (p_add_encryption_key == true) { + //TODO + } + return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField); /*if (p_alterATCertificateSignature == true) { diff --git a/ttcn/Security/LibItsSecurity_Pixits.ttcn b/ttcn/Security/LibItsSecurity_Pixits.ttcn index 04ddc28a..c25a11e1 100644 --- a/ttcn/Security/LibItsSecurity_Pixits.ttcn +++ b/ttcn/Security/LibItsSecurity_Pixits.ttcn @@ -36,6 +36,12 @@ module LibItsSecurity_Pixits { */ modulepar charstring PX_IUT_DEFAULT_CERTIFICATE := "CERT_IUT_A_AT"; + /** + * @desc The certficate the IUT should use. Default: CERT_TS_B_AT + * @remark Possible values: CERT_TS_C_AT, CERT_TS_D_AT, or CERT_TS_E_AT + */ + modulepar charstring PX_AT_CERTIFICATE := "CERT_TS_B_AT"; + /** * @desc ITS-AID value for other profile. Default: 38 */ @@ -44,7 +50,7 @@ module LibItsSecurity_Pixits { /** * @desc Invalid protocol version. Default: 3 */ - modulepar UInt8 PX_WRONG_PROTOCOL_VERSION := 3; + modulepar UInt8 PX_WRONG_PROTOCOL_VERSION := 4; /** * @desc Invalid WGS longitude diff --git a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn index 65123d88..1291a419 100644 --- a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn +++ b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn @@ -37,6 +37,7 @@ module LibItsSecurity_TypesAndValues { const charstring cc_taCert_B := "CERT_TS_B_AT"; /** Default certificate, with circular region, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_B1 := "CERT_TS_B_1_AT"; const charstring cc_taCert_B_AA := "CERT_TS_B_1_AA"; + const charstring cc_taCert_A_B := "CERT_TS_A_B_AT"; const charstring cc_taCert_C := "CERT_TS_C_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_C1 := "CERT_TS_C1_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_CA1 := "CERT_TS_CA1_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ -- GitLab From ee4cd9311ad07a6d5f4f8d4d10e206b1fe0f4cde Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Mon, 31 May 2021 17:42:13 +0200 Subject: [PATCH 304/320] STF594: Add new CAM & DENM tests --- ttcn/Security/LibItsSecurity_Functions.ttcn | 324 +++++++++++++----- ttcn/Security/LibItsSecurity_Templates.ttcn | 14 +- .../LibItsSecurity_TypesAndValues.ttcn | 1 + 3 files changed, 245 insertions(+), 94 deletions(-) diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 1db2c476..8f046b6e 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -1087,7 +1087,7 @@ module LibItsSecurity_Functions { in ToBeSignedData p_payloadField, in SignerIdentifier p_signerIdentifierType, in charstring p_certificateName := "" - ) runs on ItsSecurityBaseComponent return boolean { + ) runs on ItsSecurityBaseComponent return boolean { // Local variables var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; @@ -1177,10 +1177,12 @@ module LibItsSecurity_Functions { in boolean p_add_p2pcd_learning_request, in boolean p_add_missing_crl_identifier, in boolean p_add_encryption_key, + in boolean p_alter_signature_algorithm, + in boolean p_alter_signer_identifier, in boolean p_alterIssuerIdentifier, in boolean p_alterATCertificateSignature, in boolean p_alterAACertificateSignature - ) runs on ItsSecurityBaseComponent return boolean { + ) runs on ItsSecurityBaseComponent return boolean { // Local variables var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; @@ -1254,21 +1256,63 @@ module LibItsSecurity_Functions { p_securedMessage.content.signedData.tbsData.headerInfo.expiryTime := f_getCurrentTimeUtc() + 3600; } if (p_add_p2pcd_learning_request == true) { - //TODO + p_securedMessage.content.signedData.tbsData.headerInfo.p2pcdLearningRequest := 'CAFEDE'O; } if (p_add_missing_crl_identifier == true) { - //TODO + p_securedMessage.content.signedData.tbsData.headerInfo.missingCrlIdentifier := { + cracaId := 'CAFEDE'O, + crlSeries := 0 + }; } if (p_add_encryption_key == true) { - //TODO + p_securedMessage.content.signedData.tbsData.headerInfo.encryptionKey := valueof( + m_encryptionKey_public( + m_encryptionKey( + -, + m_publicEncryptionKey_eciesNistP256( + m_eccP256CurvePoint_x_only(int2oct(5096, 32)) + )))); + } + if (p_alter_signature_algorithm == true) { + if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature)) { + // Change it in to Brainpool P256r1 + p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature := valueof(m_ecdsaSignature( + p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig, + p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig + )); + } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { + // Change it in to NistP256 + p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature := valueof(m_ecdsaSignature( + p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.rSig, + p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig + )); + } else { + var EccP256CurvePoint r_sig; + // Change it in to Brainpool P256r1 + if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.compressed_y_0)) { + r_sig := valueof(m_eccP256CurvePoint_compressed_y_0(str2oct(substr(oct2str(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.compressed_y_0), 0, 32 * 2)))); + } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.compressed_y_1)) { + r_sig := valueof(m_eccP256CurvePoint_compressed_y_1(str2oct(substr(oct2str(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.compressed_y_1), 0, 32 * 2)))); + } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only)) { + r_sig := valueof(m_eccP256CurvePoint_x_only(str2oct(substr(oct2str(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only), 0, 32 * 2)))); + } else { + // TODO + log("f_buildGnSecuredCam_Bo: Unsupported signature variant"); + } + p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature := valueof(m_ecdsaSignature( + r_sig, + str2oct(substr(oct2str(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig), 0, 32 * 2)) + )); + } + } + if (p_alter_signer_identifier == true) { + p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_self); } return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField); - /*if (p_alterATCertificateSignature == true) { v_atCertificate.signature_.ecdsaNistP256Signature.sSig := not4b(v_atCertificate.signature_.ecdsaNistP256Signature.sSig); } - if (p_alterAACertificateSignature == true) { v_aaCertificate.signature_.ecdsaNistP256Signature.sSig := not4b(v_aaCertificate.signature_.ecdsaNistP256Signature.sSig); }*/ @@ -1321,62 +1365,71 @@ module LibItsSecurity_Functions { * @return true on success, false otherwise */ function f_buildGnSecuredDenm( - inout EtsiTs103097Data p_securedMessage, + out EtsiTs103097Data p_securedMessage, in ToBeSignedData p_payloadField, in SignerIdentifier p_signerIdentifierType, - in ThreeDLocation p_threeDLocation, - in template (omit) HeaderInfo p_headerInfo := omit, - in charstring p_certificateName := "", - in boolean p_addMissingHeaders := true - ) runs on ItsSecurityBaseComponent return boolean { - + in charstring p_certificateName := "" + ) runs on ItsSecurityBaseComponent return boolean { // Local variables var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; - var HeaderInfo v_mandatoryHeaders := valueof(m_ieee1609Dot2_headerInfo(0)); - var HeaderInfo v_signerInfo; + log(">>> f_buildGnSecuredDenm: p_securedMessage= ", p_securedMessage); + log(">>> f_buildGnSecuredDenm: p_payloadField= ", p_payloadField); + // Load certificates if required if (f_prepareCertificates(p_certificateName, v_aaCertificate, v_atCertificate) == false) { return false; } + //log("f_buildGnSecuredDenm: v_atCertificate = ", v_atCertificate); - // Add additional headers if required - /* FIXME To be reviewed if (p_addMissingHeaders == true) { - // Prepare mandatory headers - if (valueof(p_signerIdentifierType) == e_certificate) { // Add the AT certificate - v_signerInfo := valueof( - m_header_info_signer_info( - m_signerIdentifier_certificate( - v_atCertificate - ))); - } else if (valueof(p_signerIdentifierType) == e_certificate_chain) { // Add the AT certificate + AA EtsiTs103097Certificate - v_signerInfo := valueof( - m_header_info_signer_info( - m_signerIdentifier_certificates( - { - v_aaCertificate, - v_atCertificate - } - ) - )); - } else if (valueof(p_signerIdentifierType) == e_certificate_digest_with_sha256) { // Add the AT certificate digest - v_signerInfo := valueof( - m_header_info_signer_info( - m_issuerIdentifier_sha256AndDigest( - v_atCertificate.cracaId - ))); - } - v_mandatoryHeaders := { - v_signerInfo, - valueof(m_header_info_generation_time(1000 * f_getCurrentTime())), // In us - valueof(m_header_info_generation_location(p_threeDLocation)), - valueof(m_header_info_its_aid(c_its_aid_DENM)) + p_securedMessage := valueof(m_etsiTs103097Data_signed( + m_signedData( + sha256, + p_payloadField, + m_signerIdentifier_self, + m_signature_ecdsaNistP256( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only(int2oct(0, 32)), + int2oct(0, 32) + ) + ) + ) + )); + // Prepare mandatory headers + log("f_buildGnSecuredDenm: p_signerIdentifierType=", p_signerIdentifierType); + if (ischosen(p_signerIdentifierType.digest)) { // Add the AT certificate digest + if (ischosen(v_atCertificate.issuer.sha256AndDigest)) { + p_securedMessage.content.signedData.hashId := sha256; + p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_digest( + f_calculateDigestSha256FromCertificate(v_atCertificate) + )); + } else if (ischosen(v_atCertificate.issuer.sha384AndDigest)) { + p_securedMessage.content.signedData.hashId := sha384; + p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_digest( + f_calculateDigestSha384FromCertificate(v_atCertificate) + )); } - }*/ + } + if (ispresent(v_atCertificate.signature_)) { + if (ischosen(v_atCertificate.signature_.ecdsaBrainpoolP256r1Signature)) { + p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP256r1( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only(int2oct(0, 32)), + int2oct(0, 32) + ) + )); + } else if (ischosen(v_atCertificate.signature_.ecdsaBrainpoolP384r1Signature)) { + p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP384r1( + m_ecdsaP384Signature( + m_eccP384CurvePoint_x_only(int2oct(0, 48)), + int2oct(0, 48) + ) + )); + } // else, m_signature_ecdsaNistP256 already chosen by default + } + log("f_buildGnSecuredDenm: p_securedMessage = ", p_securedMessage); - // Build the secured message and return it return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField/*, v_mandatoryHeaders*/); - } // End of function f_buildGnSecuredDenm /** @@ -1396,17 +1449,23 @@ module LibItsSecurity_Functions { * @return true on success, false otherwise */ function f_buildGnSecuredDenm_Bo( - inout EtsiTs103097Data p_securedMessage, - in UInt8 p_protocolVersion := c_protocol_version, - in integer p_trailerStatus := 0, + out EtsiTs103097Data p_securedMessage, in ToBeSignedData p_payloadField, in SignerIdentifier p_signerIdentifierType, // FIXME To be reviewed - in ThreeDLocation p_threeDLocation, - in template (omit) HeaderInfo p_headerInfo := omit, - in charstring p_certificateName := "", - in boolean p_addMissingHeaders := true - ) runs on ItsSecurityBaseComponent return boolean { - + in charstring p_certificateName, + in UInt8 p_protocolVersion, + in boolean p_alter_psid, + in boolean p_remove_generation_location := true, // Shall be present for DENM + in boolean p_add_expiry_time, + in boolean p_add_p2pcd_learning_request, + in boolean p_add_missing_crl_identifier, + in boolean p_add_encryption_key, + in boolean p_alter_signature_algorithm, + in boolean p_alter_signer_identifier, + in boolean p_alterIssuerIdentifier, + in boolean p_alterATCertificateSignature, + in boolean p_alterAACertificateSignature + ) runs on ItsSecurityBaseComponent return boolean { // Local variables var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; var HeaderInfo v_mandatoryHeaders := valueof(m_ieee1609Dot2_headerInfo(0)); @@ -1417,43 +1476,122 @@ module LibItsSecurity_Functions { return false; } - // Add additional headers if required - /* FIXME To be reviewed if (p_addMissingHeaders == true) { - // Prepare mandatory headers - if (valueof(p_signerIdentifierType) == e_certificate) { // Add the AT certificate - v_signerInfo := valueof( - m_header_info_signer_info( - m_signerIdentifier_certificate( - v_atCertificate - ))); - } else if (valueof(p_signerIdentifierType) == e_certificate_chain) { // Add the AT certificate + AA EtsiTs103097Certificate - v_signerInfo := valueof( - m_header_info_signer_info( - m_signerIdentifier_certificates( - { - v_aaCertificate, - v_atCertificate - } - ) - )); - } else if (valueof(p_signerIdentifierType) == e_certificate_digest_with_sha256) { // Add the AT certificate digest - v_signerInfo := valueof( - m_header_info_signer_info( - m_issuerIdentifier_sha256AndDigest( - v_atCertificate.cracaId - ))); + // Fill the structure with default values, these values will be updated later + p_securedMessage := valueof(m_etsiTs103097Data_signed( + m_signedData( + sha256, + p_payloadField, + m_signerIdentifier_self, + m_signature_ecdsaNistP256( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only(int2oct(0, 32)), + int2oct(0, 32) + ) + ) + ) + )); + // Prepare mandatory headers + //log("f_buildGnSecuredCam: p_signerIdentifierType=", p_signerIdentifierType); + if (ischosen(p_signerIdentifierType.digest)) { // Add the AT certificate digest + if (ischosen(v_atCertificate.issuer.sha256AndDigest)) { + p_securedMessage.content.signedData.hashId := sha256; + p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_digest( + f_calculateDigestSha256FromCertificate(v_atCertificate) + )); + } else if (ischosen(v_atCertificate.issuer.sha384AndDigest)) { + p_securedMessage.content.signedData.hashId := sha384; + p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_digest( + f_calculateDigestSha384FromCertificate(v_atCertificate) + )); } - v_mandatoryHeaders := { - v_signerInfo, - valueof(m_header_info_generation_time(1000 * f_getCurrentTime())), // In us - valueof(m_header_info_generation_location(p_threeDLocation)), - valueof(m_header_info_its_aid(c_its_aid_DENM)) + } + if (ispresent(v_atCertificate.signature_)) { + if (ischosen(v_atCertificate.signature_.ecdsaBrainpoolP256r1Signature)) { + p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP256r1( + m_ecdsaP256Signature( + m_eccP256CurvePoint_x_only(int2oct(0, 32)), + int2oct(0, 32) + ) + )); + } else if (ischosen(v_atCertificate.signature_.ecdsaBrainpoolP384r1Signature)) { + p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP384r1( + m_ecdsaP384Signature( + m_eccP384CurvePoint_x_only(int2oct(0, 48)), + int2oct(0, 48) + ) + )); + } // else, m_signature_ecdsaNistP256 already chosen by default + } + log("f_buildGnSecuredDenm_Bo: p_securedMessage = ", p_securedMessage); + + // Alter protocolVersion + p_securedMessage.protocolVersion := p_protocolVersion; + // Alter psid + if (p_alter_psid == true) { + p_securedMessage.content.signedData.tbsData.headerInfo.psid := 99; + } + // Remove generationLocation + if (p_remove_generation_location == true) { + p_securedMessage.content.signedData.tbsData.headerInfo.generationLocation := omit; + } + if (p_add_expiry_time == true) { + p_securedMessage.content.signedData.tbsData.headerInfo.expiryTime := f_getCurrentTimeUtc() + 3600; + } + if (p_add_p2pcd_learning_request == true) { + p_securedMessage.content.signedData.tbsData.headerInfo.p2pcdLearningRequest := 'CAFEDE'O; + } + if (p_add_missing_crl_identifier == true) { + p_securedMessage.content.signedData.tbsData.headerInfo.missingCrlIdentifier := { + cracaId := 'CAFEDE'O, + crlSeries := 0 + }; + } + if (p_add_encryption_key == true) { + p_securedMessage.content.signedData.tbsData.headerInfo.encryptionKey := valueof( + m_encryptionKey_public( + m_encryptionKey( + -, + m_publicEncryptionKey_eciesNistP256( + m_eccP256CurvePoint_x_only(int2oct(5096, 32)) + )))); + } + if (p_alter_signature_algorithm == true) { + if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature)) { + // Change it in to Brainpool P256r1 + p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature := valueof(m_ecdsaSignature( + p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig, + p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig + )); + } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { + // Change it in to NistP256 + p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature := valueof(m_ecdsaSignature( + p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.rSig, + p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig + )); + } else { + var EccP256CurvePoint r_sig; + // Change it in to Brainpool P256r1 + if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.compressed_y_0)) { + r_sig := valueof(m_eccP256CurvePoint_compressed_y_0(str2oct(substr(oct2str(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.compressed_y_0), 0, 32 * 2)))); + } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.compressed_y_1)) { + r_sig := valueof(m_eccP256CurvePoint_compressed_y_1(str2oct(substr(oct2str(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.compressed_y_1), 0, 32 * 2)))); + } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only)) { + r_sig := valueof(m_eccP256CurvePoint_x_only(str2oct(substr(oct2str(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only), 0, 32 * 2)))); + } else { + // TODO + log("f_buildGnSecuredCam_Bo: Unsupported signature variant"); } - }*/ - - // Build the secured message and return it - return f_buildGnSecuredMessage_Bo(p_securedMessage, p_certificateName, p_protocolVersion, p_trailerStatus, p_payloadField, v_mandatoryHeaders, p_headerInfo); + p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature := valueof(m_ecdsaSignature( + r_sig, + str2oct(substr(oct2str(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig), 0, 32 * 2)) + )); + } + } + if (p_alter_signer_identifier == true) { + p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_self); + } + return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField); } // End of function f_buildGnSecuredDenm_Bo /** diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index ef6df220..d40792a9 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -1660,7 +1660,19 @@ module LibItsSecurity_Templates { } // End of group verificationKeys group encryptionKey { - + + template (value) EncryptionKey m_encryptionKey_public( + in template (value) PublicEncryptionKey p_encryptionKey + ) := { + public_ := p_encryptionKey + } + + template (present) EncryptionKey mw_encryptionKey_public( + template (present) PublicEncryptionKey p_encryptionKey := ? + ) := { + public_ := p_encryptionKey + } + template (value) PublicEncryptionKey m_encryptionKey( in template (value) SymmAlgorithm p_supportedSymmAlg := aes128Ccm, in template (value) BasePublicEncryptionKey p_publicKey diff --git a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn index 1291a419..26eeb4ea 100644 --- a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn +++ b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn @@ -38,6 +38,7 @@ module LibItsSecurity_TypesAndValues { const charstring cc_taCert_B1 := "CERT_TS_B_1_AT"; const charstring cc_taCert_B_AA := "CERT_TS_B_1_AA"; const charstring cc_taCert_A_B := "CERT_TS_A_B_AT"; + const charstring cc_taCert_A_B3 := "CERT_TS_A_B3_AT"; const charstring cc_taCert_C := "CERT_TS_C_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_C1 := "CERT_TS_C1_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_CA1 := "CERT_TS_CA1_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ -- GitLab From 9d2bfee0580d61d30847f64731f9f74fa3ab83e0 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Tue, 1 Jun 2021 15:28:03 +0200 Subject: [PATCH 305/320] STF594: Finalyse new CAM & DENM tests --- ttcn/Security/LibItsSecurity_Functions.ttcn | 31 +++++++++++++++------ 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 8f046b6e..84af841a 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -1,5 +1,5 @@ /** - * @author ETSI / STF481 / STF507 / STF517 / STF538 / STF545 + * @Author ETSI / STF481 / STF507 / STF517 / STF538 / STF545 * @version $Url$ * $Id$ * @desc Module containing functions for Security Protocol @@ -1179,9 +1179,7 @@ module LibItsSecurity_Functions { in boolean p_add_encryption_key, in boolean p_alter_signature_algorithm, in boolean p_alter_signer_identifier, - in boolean p_alterIssuerIdentifier, - in boolean p_alterATCertificateSignature, - in boolean p_alterAACertificateSignature + in boolean p_alter_signature ) runs on ItsSecurityBaseComponent return boolean { // Local variables @@ -1308,6 +1306,15 @@ module LibItsSecurity_Functions { if (p_alter_signer_identifier == true) { p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_self); } + if (p_alter_signature == true) { + if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature)) { + p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig := not4b(valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig)); + } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { + p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig := not4b(valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig)); + } else { + p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig := not4b(valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig)); + } + } return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField); /*if (p_alterATCertificateSignature == true) { @@ -1462,9 +1469,7 @@ module LibItsSecurity_Functions { in boolean p_add_encryption_key, in boolean p_alter_signature_algorithm, in boolean p_alter_signer_identifier, - in boolean p_alterIssuerIdentifier, - in boolean p_alterATCertificateSignature, - in boolean p_alterAACertificateSignature + in boolean p_alter_signature ) runs on ItsSecurityBaseComponent return boolean { // Local variables var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; @@ -1579,7 +1584,7 @@ module LibItsSecurity_Functions { r_sig := valueof(m_eccP256CurvePoint_x_only(str2oct(substr(oct2str(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only), 0, 32 * 2)))); } else { // TODO - log("f_buildGnSecuredCam_Bo: Unsupported signature variant"); + log("f_buildGnSecuredDenm_Bo: Unsupported signature variant"); } p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature := valueof(m_ecdsaSignature( r_sig, @@ -1590,7 +1595,15 @@ module LibItsSecurity_Functions { if (p_alter_signer_identifier == true) { p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_self); } - + if (p_alter_signature == true) { + if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature)) { + p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig := not4b(valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig)); + } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { + p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig := not4b(valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig)); + } else { + p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig := not4b(valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig)); + } + } return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField); } // End of function f_buildGnSecuredDenm_Bo -- GitLab From 7f970bee2828c0ebb4ab70ad6dcad539563ec088 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Wed, 23 Jun 2021 11:13:07 +0200 Subject: [PATCH 306/320] Validation against Yogoko --- ttcn/Security/LibItsSecurity_TypesAndValues.ttcn | 1 + 1 file changed, 1 insertion(+) diff --git a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn index 26eeb4ea..aec0f498 100644 --- a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn +++ b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn @@ -45,6 +45,7 @@ module LibItsSecurity_TypesAndValues { const charstring cc_taCert_D := "CERT_TS_D_AT"; /** Certificate with a polygonal region, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_E := "CERT_TS_E_AT"; /** Certificate with a region identifier, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_F := "CERT_TS_F_AT"; /** Certificate that can be used as an unknown certificate for IUT. */ + const charstring cc_taCert_F3 := "CERT_TS_F3_AT"; /** Certificate that can be used as an unknown certificate for IUT. */ const charstring cc_taCert_G := "CERT_TS_G_AT"; /** to be defined */ const charstring cc_taCert_EC := "CERT_TS_A_EC"; /** Certificate with a subject type indicating 'enrolment_credentials', to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_AA := "CERT_TS_A_AA"; /** Certificate with a subject type indicating 'authorisation_authority', to be used when secured messages are sent from TA to IUT */ -- GitLab From b0832442fc3b47c7c75fd01ec4dd8d7bde0d29bf Mon Sep 17 00:00:00 2001 From: Denis Filatov Date: Thu, 24 Jun 2021 16:58:25 +0200 Subject: [PATCH 307/320] add CERT_TS_F3_AT --- ttcn/Security/LibItsSecurity_TypesAndValues.ttcn | 1 + 1 file changed, 1 insertion(+) diff --git a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn index 26eeb4ea..fb2bcefb 100644 --- a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn +++ b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn @@ -45,6 +45,7 @@ module LibItsSecurity_TypesAndValues { const charstring cc_taCert_D := "CERT_TS_D_AT"; /** Certificate with a polygonal region, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_E := "CERT_TS_E_AT"; /** Certificate with a region identifier, to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_F := "CERT_TS_F_AT"; /** Certificate that can be used as an unknown certificate for IUT. */ + const charstring cc_taCert_F3 := "CERT_TS_F3_AT"; /** Certificate that can be used as an unknown certificate for IUT with BrainpoolP384 curve. */ const charstring cc_taCert_G := "CERT_TS_G_AT"; /** to be defined */ const charstring cc_taCert_EC := "CERT_TS_A_EC"; /** Certificate with a subject type indicating 'enrolment_credentials', to be used when secured messages are sent from TA to IUT */ const charstring cc_taCert_AA := "CERT_TS_A_AA"; /** Certificate with a subject type indicating 'authorisation_authority', to be used when secured messages are sent from TA to IUT */ -- GitLab From 1fe4c0067e4f5ba975a9d399789774c2b5e22bd5 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Mon, 5 Jul 2021 15:33:24 +0200 Subject: [PATCH 308/320] Implementing SECPKI_CA_CERTGEN TPs --- ttcn/Pki/LibItsPki_Functions.ttcn | 204 +++++++++++++++++++- ttcn/Pki/LibItsPki_Pics.ttcn | 11 +- ttcn/Security/LibItsSecurity_Functions.ttcn | 95 +++++---- ttcn/Security/LibItsSecurity_Templates.ttcn | 16 +- 4 files changed, 275 insertions(+), 51 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 7e5f8705..410c6554 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -3176,7 +3176,7 @@ module LibItsPki_Functions { } // End of group dc group rca { - + function f_verify_rca_ctl_response_message( in EtsiTs103097Data p_etsi_ts_103097_signed_data, in boolean p_check_security := true, @@ -3436,6 +3436,208 @@ module LibItsPki_Functions { return true; } + /** + * @desc this function is used to retrieve the root certificate from SubCA entity + * @param p_certificate The root certificate + * @return 0 on success, -1 otherwise + */ + external function fx_get_root_ca_certificate( + in charstring p_iut_certificate := "CERT_IUT_A_RCA",//"CERT_IUT_A_CA", + in boolean p_explicit_type := false, + out octetstring p_certificate + ) return integer; + + function f_get_root_ca_certificate( + in charstring p_iut_certificate := "CERT_IUT_A_CA", + in boolean p_explicit_type := false, + out Certificate p_certificate + ) return integer { + var octetstring v_os; + var bitstring v_msg_bit; + + log(">>> f_get_root_ca_certificate"); + + // Get root certificate + if (fx_get_root_ca_certificate(p_iut_certificate, p_explicit_type, v_os) != 0) { + log("f_get_root_ca_certificate: fail to get certificate"); + return -1; + } + log("f_get_root_ca_certificate: v_os=", v_os); + // Decode it + v_msg_bit := oct2bit(v_os); + if (decvalue(v_msg_bit, p_certificate) != 0) { + log("f_get_root_ca_certificate: fail to decode certificate"); + return -1; + } + log("<<< f_get_root_ca_certificate: ", p_certificate); + return 0; + } + + function f_verify_rca_certificate( + in charstring p_authorized_certificate := "CERT_IUT_A_RCA",//"CERT_IUT_A_RCA", + in Certificate p_certificate, + in boolean p_check_implicit := false, + in boolean p_check_reconstruction_value := false, + in boolean p_check_no_signature := false, + in boolean p_check_region_restriction := false, + in boolean p_check_signature_content := false + ) return boolean { + var CertificateType v_type_ := explicit; + var template Signature v_signature_ := ?; + var template IssuerIdentifier v_issuer := ?; + var template PublicVerificationKey v_public_verification_key := ?; + + log(">>> f_verify_rca_certificate: p_authorized_certificate= ", p_authorized_certificate); + log(">>> f_verify_rca_certificate: p_certificate= ", p_certificate); + + if (p_check_implicit == true) { + v_type_ := implicit; + } + if (p_check_no_signature == true) { + v_signature_ := omit; + } + if (match(p_certificate, mw_etsiTs103097Certificate(-, -, v_signature_, v_type_)) == false) { + log("f_verify_rca_certificate: version/explicit mismatch"); + return false; + } + if (p_check_reconstruction_value == false) { + if (match(p_certificate, mw_etsiTs103097Certificate( + -, + mw_toBeSignedCertificate_ca( + (mw_certificateId_none, mw_certificateId_name), + -, + -, + mw_verificationKeyIndicator_verificationKey + ), + v_signature_ + )) == false) { + log("f_verify_rca_certificate: verificationKey mismatch"); + return false; + } + if (p_check_signature_content) { + var template PublicVerificationKey v_publicVerificationKey; + + if (PICS_SEC_SHA256) { + v_signature_ := mw_signature_ecdsaNistP256; + v_issuer := (mw_issuerIdentifier_self(sha256), mw_issuerIdentifier_sha256AndDigest); + v_public_verification_key := mw_publicVerificationKey_ecdsaNistP256; + } else if (PICS_SEC_BRAINPOOL_P256R1) { + v_signature_ := mw_signature_ecdsaBrainpoolP256r1; + v_issuer := (mw_issuerIdentifier_self(sha256), mw_issuerIdentifier_sha256AndDigest); + v_public_verification_key := mw_publicVerificationKey_ecdsaBrainpoolP256r1; + } else if (PICS_SEC_BRAINPOOL_P384R1) { + v_signature_ := mw_signature_ecdsaBrainpoolP384r1; + v_issuer := (mw_issuerIdentifier_self(sha384), mw_issuerIdentifier_sha384AndDigest); + v_public_verification_key := mw_publicVerificationKey_ecdsaBrainpoolP384r1; + } + if (match(p_certificate, mw_etsiTs103097Certificate( + v_issuer, + mw_toBeSignedCertificate_ca( + (mw_certificateId_none, mw_certificateId_name), + -, + -, + mw_verificationKeyIndicator_verificationKey(v_public_verification_key), + -, -, -, -, + -//mw_encryptionKey + ), + v_signature_ + )) == false) { + log("f_verify_rca_certificate: signature mismatch"); + return false; + } + // Verify Signature + if (ischosen(p_certificate.issuer.self_)) { + v_publicVerificationKey := p_certificate.toBeSigned.verifyKeyIndicator.verificationKey; + } else { + var HashedId8 v_digest; + var Certificate v_authorized_certificate; + var charstring v_cert; + + if (ischosen(p_certificate.issuer.sha256AndDigest)) { + v_digest := p_certificate.issuer.sha256AndDigest; + } else if (ischosen(p_certificate.issuer.sha384AndDigest)) { + v_digest := p_certificate.issuer.sha384AndDigest; + } else { + log("f_verify_rca_certificate: Invalid certificate issuer ", p_certificate.issuer); + return false; + } + if (f_getCertificateFromDigest(v_digest, v_authorized_certificate, v_cert) == false) { + log("f_verify_rca_certificate: Fail to load p_authorized_certificate"); + return false; + } + v_publicVerificationKey := v_authorized_certificate.toBeSigned.verifyKeyIndicator.verificationKey + } + log("f_verify_rca_certificate: v_publicVerificationKey= ", v_publicVerificationKey); + if (f_verifyCertificateSignatureWithPublicKey(p_certificate, v_publicVerificationKey) == false) { + log("f_verify_rca_certificate: signature not verified"); + return false; + } + } + } else { + if (match(p_certificate, mw_etsiTs103097Certificate( + -, + mw_toBeSignedCertificate_ca( + (mw_certificateId_none, mw_certificateId_name), + -, + -, + mw_verificationKeyIndicator_reconstructionValue + ), + v_signature_ + )) == false) { + log("f_verify_rca_certificate: verificationKey mismatch"); + return false; + } + // TODO Verify Signature + } + + if (p_check_region_restriction == true) { + var Certificate v_authorized_certificate; + var template GeographicRegion v_geographic_region := ?; + + if (f_readCertificate(p_authorized_certificate, v_authorized_certificate) == false) { + log("f_verify_rca_certificate: Fail to load p_authorized_certificate"); + return false; + } + log("f_verify_rca_certificate: v_authorized_certificate=", v_authorized_certificate); + + if (PICS_SEC_CIRCULAR_REGION == true) { + v_geographic_region := mw_geographicRegion_circle; + } else if (PICS_SEC_RECTANGULAR_REGION == true) { + v_geographic_region := mw_geographicRegion_rectangular; + } else if (PICS_SEC_POLYGONAL_REGION == true) { + v_geographic_region := mw_geographicRegion_polygonal; + } else if (PICS_SEC_IDENTIFIED_REGION == true) { + v_geographic_region := mw_geographicRegion_identified( + { + (mw_identifiedRegion_country_only, mw_identifiedRegion_country_and_region) + } + ); + } + if (match(p_certificate, mw_etsiTs103097Certificate( + -, + mw_toBeSignedCertificate_ca( + -, + -, + -, + -, + -, + -, + v_geographic_region + ) + )) == false) { + log("f_verify_rca_certificate: Geographical region mismatch"); + return false; + } + // Check interception of area + if (f_checkRegionValidityRestiction(v_authorized_certificate, p_certificate) == false) { + log("f_verify_rca_certificate: Geographical region intersection mismatch"); + return false; + } + } + + return true; + } + } // End of group rca group tlm { diff --git a/ttcn/Pki/LibItsPki_Pics.ttcn b/ttcn/Pki/LibItsPki_Pics.ttcn index 8c683b80..c03ef560 100644 --- a/ttcn/Pki/LibItsPki_Pics.ttcn +++ b/ttcn/Pki/LibItsPki_Pics.ttcn @@ -161,6 +161,11 @@ module LibItsPki_Pics { */ modulepar charstring PICS_HTTP_POST_URI_ATV := "/authorize_validate"; + /** + * @desc HTTP GET URI for Certificate Trusted List + */ + modulepar charstring PICS_HTTP_GET_URI_CA := "/dc/getctl"; + /** * @desc HTTP GET URI for Certificate Trusted List */ @@ -246,5 +251,9 @@ module LibItsPki_Pics { * @see ETSI TS 103 097 Clause 7.2.2 Enrolment credential */ modulepar boolean PICS_EC_SUBJECT_ATTRIBUT_ID := false; - + + modulepar boolean PICS_SEC_IMPLICIT_CERTIFICATES := false; + + modulepar boolean PICS_SEC_EXPLICIT_CERTIFICATES := true; + } // End of module LibItsPki_Pics diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn index 84af841a..2865ca82 100644 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ b/ttcn/Security/LibItsSecurity_Functions.ttcn @@ -3076,37 +3076,45 @@ module LibItsSecurity_Functions { in EtsiTs103097Certificate p_cert, in EtsiTs103097Certificate p_cert_issuer ) return boolean { - var ValidityPeriod v_cert_region, v_cert_issuer_region; + var GeographicRegion v_cert_region, v_cert_issuer_region; var boolean v_cert_issuer_region_result; - /* FIXME To be reviewed v_cert_issuer_region_result := f_getCertificateValidityRestriction(p_cert_issuer, e_region, v_cert_issuer_region); - if (f_getCertificateValidityRestriction(p_cert, e_region, v_cert_region) == false) { - if (v_cert_issuer_region_result == true) { - if (v_cert_issuer_region.validity.region.region_type != e_none) { - return false; - } - } - } else if ( - (v_cert_issuer_region_result == true) and - (v_cert_issuer_region.validity.region.region_type != e_none) - ) { - if (v_cert_region.validity.region.region_type == e_circle) { - if (v_cert_issuer_region.validity.region.region_type == e_circle) { - // Check v_cert_region 'circle' is inside v_cert_issuer_region 'circle' - if (f_areCirclesInside(v_cert_region.validity.region.region.circular_region, v_cert_issuer_region.validity.region.region.circular_region) == false) { - log("*** " & testcasename() & ": FAIL: Issuer and issuing certificates circle area does not match ***"); - return false; - } - } - } else if (v_cert_region.validity.region.region_type == e_rectangle) { - if (v_cert_issuer_region.validity.region.region_type == e_rectangle) { - // Check v_cert_region 'rectangle' is inside v_cert_issuer_region 'rectangle' - if (f_areRectanglesInside(v_cert_region.validity.region.region.rectangular_region, v_cert_issuer_region.validity.region.region.rectangular_region) == false) { - log("*** " & testcasename() & ": FAIL: Issuer and issuing certificates rectangle area does not match ***"); - return false; - } - } - } else if (v_cert_region.validity.region.region_type == e_polygon) { + // FIXME To be reviewed + + // Sanity checks + if (ispresent(p_cert.toBeSigned.region) == false) { + log("f_checkRegionValidityRestiction: GeographicRegion missig into certificate"); + return false; + } + if (ispresent(p_cert_issuer.toBeSigned.region) == false) { + // No greographical constraints + return true; + } + v_cert_region := p_cert.toBeSigned.region; + v_cert_issuer_region := p_cert_issuer.toBeSigned.region; + if (ispresent(v_cert_region.circularRegion) and ispresent(v_cert_issuer_region.circularRegion)) { + // Check v_cert_region 'circle' is inside v_cert_issuer_region 'circle' + if (f_areCirclesInside(valueof(v_cert_region.circularRegion), valueof(v_cert_issuer_region.circularRegion)) == false) { + log("f_checkRegionValidityRestiction: FAIL: Issuer and issuing certificates circle area does not match"); + return false; + } + } else if (ispresent(v_cert_region.rectangularRegion) and ispresent(v_cert_issuer_region.rectangularRegion)) { + // Check v_cert_region 'rectangle' is inside v_cert_issuer_region 'rectangle' + if (f_isRectangularRegionsIntersected(v_cert_region.rectangularRegion, v_cert_issuer_region.rectangularRegion) == false) { + log("f_checkRegionValidityRestiction: FAIL: Issuer and issuing certificates rectangle area does not match"); + return false; + } + } else if (ispresent(v_cert_region.polygonalRegion) and ispresent(v_cert_issuer_region.polygonalRegion)) { + // Check v_cert_region 'polygon' is inside v_cert_issuer_region 'polygon' + log("f_checkRegionValidityRestiction: FAIL: Not implemented"); + // TODO + return false; + } else if (ispresent(v_cert_region.identifiedRegion) and ispresent(v_cert_issuer_region.identifiedRegion)) { + log("f_checkRegionValidityRestiction: FAIL: Not implemented"); + // Check id_region + // TODO + } + /*if (v_cert_region.validity.region.region_type == e_polygon) { if (v_cert_issuer_region.validity.region.region_type == e_polygon) { // Check v_cert_region 'polygon' is inside v_cert_issuer_region 'polygon' if (f_arePolygonsInside(v_cert_region.validity.region.region.polygonal_region, v_cert_issuer_region.validity.region.region.polygonal_region) == false) { @@ -3215,20 +3223,23 @@ module LibItsSecurity_Functions { * @return true on success, false otherwise */ function f_isRectangularRegionsIntersected( - in template (value) RectangularRegion p_r1, - in template (value) RectangularRegion p_r2 + in template (value) SequenceOfRectangularRegion p_r1, + in template (value) SequenceOfRectangularRegion p_r2 ) return boolean { - return not ( -//FIXME RGY Titan doesn't support dot notation after valueof at the moment -// valueof(p_r2).northWest.longitude > valueof(p_r1).southEast.longitude or -// valueof(p_r2).southEast.longitude < valueof(p_r1).northWest.longitude or -// valueof(p_r2).southEast.latitude > valueof(p_r1).northWest.latitude or -// valueof(p_r2).northWest.latitude < valueof(p_r1).southEast.latitude - valueof(p_r2.northWest.longitude) > valueof(p_r1.southEast.longitude) or - valueof(p_r2.southEast.longitude) < valueof(p_r1.northWest.longitude) or - valueof(p_r2.southEast.latitude) > valueof(p_r1.northWest.latitude) or - valueof(p_r2.northWest.latitude) < valueof(p_r1.southEast.latitude) - ); + var integer v_min := f_min(lengthof(p_r1), lengthof(p_r2)); + + for (var integer i := 0; i < v_min; i := i + 1) { + if (not ( + valueof(p_r2[i].northWest.longitude) > valueof(p_r1[i].southEast.longitude) or + valueof(p_r2[i].southEast.longitude) < valueof(p_r1[i].northWest.longitude) or + valueof(p_r2[i].southEast.latitude) > valueof(p_r1[i].northWest.latitude) or + valueof(p_r2[i].northWest.latitude) < valueof(p_r1[i].southEast.latitude) + )) { + return false; + } + } // End of 'for' statement + + return true; } // End of function f_isRectangularRegionsIntersected function f_isContinuousRectangularRegions( diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index d40792a9..8fa9157c 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -1242,10 +1242,11 @@ module LibItsSecurity_Templates { template (omit) EtsiTs103097Certificate m_etsiTs103097Certificate( in template (value) IssuerIdentifier p_issuer, in template (value) ToBeSignedCertificate p_toBeSigned, - in template (omit) Signature p_signature_ := omit + in template (omit) Signature p_signature_ := omit, + in template (value) CertificateType p_type_ := explicit ) := { version := c_certificate_version, - type_ := explicit, + type_ := p_type_, issuer := p_issuer, toBeSigned := p_toBeSigned, signature_ := p_signature_ @@ -1263,10 +1264,11 @@ module LibItsSecurity_Templates { template (present) EtsiTs103097Certificate mw_etsiTs103097Certificate( template (present) IssuerIdentifier p_issuer := ?, template (present) ToBeSignedCertificate p_toBeSigned := ?, - template (present) Signature p_signature_ := ? + template Signature p_signature_ := ?, + template (present) CertificateType p_type_ := explicit ) := { version := c_certificate_version, - type_ := explicit, + type_ := p_type_, issuer := p_issuer, toBeSigned := p_toBeSigned, signature_ := p_signature_ @@ -1352,9 +1354,9 @@ module LibItsSecurity_Templates { template (present) CertificateId p_id := ?, template (present) SequenceOfPsidSsp p_appPermissions := ?, template (present) SequenceOfPsidGroupPermissions p_certIssuePermissions := ?, - template (present) SequenceOfPsidGroupPermissions p_certRequestPermissions := ?, template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, template (present) ValidityPeriod p_validityPeriod := ?, + template SequenceOfPsidGroupPermissions p_certRequestPermissions := *, template GeographicRegion p_region := *, template SubjectAssurance p_assuranceLevel := *, template PublicEncryptionKey p_encryptionKey := * @@ -1365,13 +1367,13 @@ module LibItsSecurity_Templates { validityPeriod := p_validityPeriod, region := p_region, assuranceLevel := p_assuranceLevel, - appPermissions := omit, + appPermissions := ?, certIssuePermissions := p_certIssuePermissions, certRequestPermissions := p_certRequestPermissions, canRequestRollover := omit, encryptionKey := p_encryptionKey, verifyKeyIndicator := p_verifyKeyIndicator - } // End of template mw_toBeSignedCertificate + } // End of template mw_toBeSignedCertificate_ca /** * @desc Send template for ToBeSignedCertificate with Enrolment credential restrictions -- GitLab From c9748c79d9651b8f2fcd9dab48e315b621a6939c Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Wed, 7 Jul 2021 09:11:39 +0200 Subject: [PATCH 309/320] Implementing SECPKI_CA_CERTGEN TPs --- ttcn/Pki/LibItsPki_Functions.ttcn | 52 ++++++++++++++++++++- ttcn/Security/LibItsSecurity_Templates.ttcn | 4 +- 2 files changed, 52 insertions(+), 4 deletions(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index 410c6554..f73c90b9 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -1,4 +1,4 @@ -/** +f_verify_rca_certificate/** * @author ETSI / STF544 * @version $Url$ * $Id$ @@ -3480,7 +3480,8 @@ module LibItsPki_Functions { in boolean p_check_reconstruction_value := false, in boolean p_check_no_signature := false, in boolean p_check_region_restriction := false, - in boolean p_check_signature_content := false + in boolean p_check_signature_content := false, + in boolean p_check_app_permissions := false ) return boolean { var CertificateType v_type_ := explicit; var template Signature v_signature_ := ?; @@ -3634,7 +3635,54 @@ module LibItsPki_Functions { return false; } } + // Check appPermissions + if (p_check_app_permissions == true) { + var integer v_idx, v_jdx; + var charstring v_psid := ""; // 'psid' currently processed + var charstring v_psidsFound := ";"; // Used to build the list of the 'psid' already processed + var template charstring m_found_pattern; // Used in regex to verify that 'psid' was not found before + var Certificate v_authorized_certificate; + + if (f_readCertificate(p_authorized_certificate, v_authorized_certificate) == false) { + log("f_verify_rca_certificate: Fail to load p_authorized_certificate"); + return false; + } + log("f_verify_rca_certificate: v_authorized_certificate=", v_authorized_certificate); + if (match(v_authorized_certificate.toBeSigned.certIssuePermissions, { mw_psidGroupPermissions }) == false) { + log("f_verify_rca_certificate: eeType mismatch"); + return false; + } + for (v_idx := 0; v_idx < lengthof(p_certificate.toBeSigned.appPermissions); v_idx := v_idx + 1) { + log("f_verify_rca_certificate: Processing ", p_certificate.toBeSigned.appPermissions[v_idx]); + if (match(p_certificate.toBeSigned.appPermissions[v_idx], mw_appPermissions) == false) { + log("f_verify_rca_certificate: PsidSsp mismatch"); + return false; + } + // Check uniqueness of PSIDs + v_psid := int2str(p_certificate.toBeSigned.appPermissions[v_idx].psid); + m_found_pattern := pattern "*({v_psid})*"; + if (regexp(v_psidsFound, m_found_pattern, 0) == v_psid) { + log("f_verify_rca_certificate: Psid uniqueness is not verified"); + return false; // v_psid exist at least 2 times, uniqueness is not verified + } + // v_psid non found, add it into the built list + v_psidsFound := v_psidsFound & v_psid & ";"; + // Check that 'psid' is in the certIssuePermissions component in the issuing certificate + if (match(v_authorized_certificate.toBeSigned.certIssuePermissions[0].subjectPermissions, mw_subjectPermissions_explicit) == false) { + for (v_jdx := 0; v_jdx < lengthof(v_authorized_certificate.toBeSigned.certIssuePermissions[0].subjectPermissions.explicit); v_jdx := v_jdx + 1) { + if (int2str(v_authorized_certificate.toBeSigned.certIssuePermissions[0].subjectPermissions.explicit[v_jdx].psid) == v_psid) { + break; + } + } // End of 'for'statement + if (v_jdx == lengthof(v_authorized_certificate.toBeSigned.certIssuePermissions[0].subjectPermissions.explicit)) { + log("f_verify_rca_certificate: Psid is not in the list of the issuing certificate"); + return false; + } + } + } // End of 'for'statement + } + return true; } diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn index 8fa9157c..32ef18a5 100644 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ b/ttcn/Security/LibItsSecurity_Templates.ttcn @@ -1728,8 +1728,8 @@ module LibItsSecurity_Templates { } // End of template m_appPermissions template PsidSsp mw_appPermissions( - template (present) Psid p_psid := ?, - template ServiceSpecificPermissions p_ssp := * + template (present) Psid p_psid := ?, + template ServiceSpecificPermissions p_ssp := * ) := { psid := p_psid, ssp := p_ssp -- GitLab From f9eefafe1ad2a4d2a743c1cf7bc52df1a37d6c97 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Wed, 21 Jul 2021 08:37:43 +0200 Subject: [PATCH 310/320] Replace references to G5 by RadioNetwork --- ttcn/BTP/LibItsBtp_TestSystem.ttcn | 2 +- ttcn/CAM/LibItsCam_TestSystem.ttcn | 2 +- ttcn/DENM/LibItsDenm_TestSystem.ttcn | 2 +- ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn | 2 +- ttcn/IVIM/LibItsIvim_TestSystem.ttcn | 2 +- .../LibItsIpv6OverGeoNetworking_TestSystem.ttcn | 2 +- ttcn/Pki/LibItsPki_Functions.ttcn | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ttcn/BTP/LibItsBtp_TestSystem.ttcn b/ttcn/BTP/LibItsBtp_TestSystem.ttcn index 39a3ca05..0579ce43 100644 --- a/ttcn/BTP/LibItsBtp_TestSystem.ttcn +++ b/ttcn/BTP/LibItsBtp_TestSystem.ttcn @@ -41,7 +41,7 @@ module LibItsBtp_TestSystem { group nt1Ports { /** - * @desc NT1 BTP Port (BTP/GeoNet/G5) + * @desc NT1 BTP Port (BTP/GeoNet/RadioNetwork) */ type port BtpPort message { in BtpInd; diff --git a/ttcn/CAM/LibItsCam_TestSystem.ttcn b/ttcn/CAM/LibItsCam_TestSystem.ttcn index fd3727e8..ce00ed93 100644 --- a/ttcn/CAM/LibItsCam_TestSystem.ttcn +++ b/ttcn/CAM/LibItsCam_TestSystem.ttcn @@ -59,7 +59,7 @@ module LibItsCam_TestSystem language "TTCN-3:2010 Real Time and Performance Test group fa1Ports { /** - * @desc FA1 CAM Port (CAM/BTP/GeoNet/G5) + * @desc FA1 CAM Port (CAM/BTP/GeoNet/RadioNetwork) */ type port CamPort message { in CamInd; diff --git a/ttcn/DENM/LibItsDenm_TestSystem.ttcn b/ttcn/DENM/LibItsDenm_TestSystem.ttcn index 8a7cc869..31a08f30 100644 --- a/ttcn/DENM/LibItsDenm_TestSystem.ttcn +++ b/ttcn/DENM/LibItsDenm_TestSystem.ttcn @@ -58,7 +58,7 @@ module LibItsDenm_TestSystem { group fa1Ports { /** - * @desc FA1 DENM Port (DENM/BTP/GeoNet/G5) + * @desc FA1 DENM Port (DENM/BTP/GeoNet/RadioNetwork) */ type port DenmPort message { in DenmInd; diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn index 4b46b328..7c5c958a 100644 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn +++ b/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn @@ -60,7 +60,7 @@ module LibItsGeoNetworking_TestSystem { group nt2Ports { /** - * @desc NT2 GeoNetworking Port (GeoNetworking/G5) + * @desc NT2 GeoNetworking Port (GeoNetworking/RadioNetwork) */ type port GeoNetworkingPort message { in GeoNetworkingInd; diff --git a/ttcn/IVIM/LibItsIvim_TestSystem.ttcn b/ttcn/IVIM/LibItsIvim_TestSystem.ttcn index 1808ecf9..acf35389 100644 --- a/ttcn/IVIM/LibItsIvim_TestSystem.ttcn +++ b/ttcn/IVIM/LibItsIvim_TestSystem.ttcn @@ -58,7 +58,7 @@ module LibItsIvim_TestSystem { group fa1Ports { /** - * @desc FA1 IVIM Port (IVIM/BTP/GeoNet/G5) + * @desc FA1 IVIM Port (IVIM/BTP/GeoNet/RadioNetwork) */ type port IvimPort message { in IvimInd; diff --git a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TestSystem.ttcn b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TestSystem.ttcn index 88b6998b..3348b56b 100644 --- a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TestSystem.ttcn +++ b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TestSystem.ttcn @@ -41,7 +41,7 @@ module LibItsIpv6OverGeoNetworking_TestSystem { group nt2Ports { /** - * @desc NT2 IPv6 over GeoNetworking Port (IPv6/GeoNetworking/G5) + * @desc NT2 IPv6 over GeoNetworking Port (IPv6/GeoNetworking/RadioNetwork) */ type port IPv6OverGeoNetworkingPort message { in IPv6OverGeoNetworkingInd; diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index f73c90b9..b5b7ca3b 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -1,4 +1,4 @@ -f_verify_rca_certificate/** +/** * @author ETSI / STF544 * @version $Url$ * $Id$ -- GitLab From 4edb6ec912770497eb6fc19cb6ea066914b443cf Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Thu, 22 Jul 2021 14:35:58 +0200 Subject: [PATCH 311/320] Add HTTP header extensions via Pixits --- ttcn/Http/LibItsHttp_Functions.ttcn | 4 ++++ ttcn/Http/LibItsHttp_Pixits.ttcn | 9 +++++++++ ttcn/Http/module.mk | 1 + 3 files changed, 14 insertions(+) create mode 100644 ttcn/Http/LibItsHttp_Pixits.ttcn diff --git a/ttcn/Http/LibItsHttp_Functions.ttcn b/ttcn/Http/LibItsHttp_Functions.ttcn index a2a70803..c1abcf32 100644 --- a/ttcn/Http/LibItsHttp_Functions.ttcn +++ b/ttcn/Http/LibItsHttp_Functions.ttcn @@ -8,6 +8,7 @@ module LibItsHttp_Functions { // LibHttp import from LibItsHttp_TypesAndValues all; import from LibItsHttp_Pics all; + import from LibItsHttp_Pixits all; import from LibItsHttp_TestSystem all; group http_preambles { @@ -71,6 +72,9 @@ module LibItsHttp_Functions { v_i := v_i + 1; } //p_headers[v_i] := { c_header_accept, { "application/x-its-response" } }; + if (lengthof(PX_ADDITIONAL_HTTP_HEADERS_KEYS) != 0) { + f_set_headers_list(PX_ADDITIONAL_HTTP_HEADERS_KEYS, PX_ADDITIONAL_HTTP_HEADERS_VALUES, p_headers); + } } // End of function f_init_default_headers_list function f_set_headers_list( diff --git a/ttcn/Http/LibItsHttp_Pixits.ttcn b/ttcn/Http/LibItsHttp_Pixits.ttcn new file mode 100644 index 00000000..037caf7e --- /dev/null +++ b/ttcn/Http/LibItsHttp_Pixits.ttcn @@ -0,0 +1,9 @@ +module LibItsHttp_Pixits { + + import from LibItsHttp_TypesAndValues all; + + modulepar charstring_list PX_ADDITIONAL_HTTP_HEADERS_KEYS := { }; + + modulepar charstring_list PX_ADDITIONAL_HTTP_HEADERS_VALUES := { }; + +} // End of module LibItsHttp_Pixits diff --git a/ttcn/Http/module.mk b/ttcn/Http/module.mk index 9ac4f5b9..0a2300e5 100644 --- a/ttcn/Http/module.mk +++ b/ttcn/Http/module.mk @@ -8,6 +8,7 @@ sources := LibItsHttp_BinaryMessageBodyTypes.ttcn \ LibItsHttp_JsonTemplates.ttcn \ LibItsHttp_MessageBodyTypes.ttcn \ LibItsHttp_Pics.ttcn \ + LibItsHttp_Pixits.ttcn \ LibItsHttp_Templates.ttcn \ LibItsHttp_TestSystem.ttcn \ LibItsHttp_TypesAndValues.ttcn \ -- GitLab From e9d58483f7f71fe7985880e9d9ab052b762da584 Mon Sep 17 00:00:00 2001 From: Denis Filatov Date: Fri, 23 Jul 2021 12:45:46 +0200 Subject: [PATCH 312/320] Initial --- .gitmodules | 4 ++++ asn1/cdd | 1 + module.mk | 14 +------------- ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn | 6 +++--- ttcn/Common/LibItsCommon_Functions.ttcn | 14 +++++++------- ttcn/Common/module.mk | 10 ++++++++-- ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn | 4 ++-- ttcn/Http/LibItsHttp_BinaryTemplates.ttcn | 4 ++-- 8 files changed, 28 insertions(+), 29 deletions(-) create mode 100644 .gitmodules create mode 160000 asn1/cdd diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..d4233787 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "asn1/cdd"] + path = asn1/cdd + url = https://forge.etsi.org/rep/ITS/asn1/cdd_ts102894_2.git + branch = testing diff --git a/asn1/cdd b/asn1/cdd new file mode 160000 index 00000000..cabf82ff --- /dev/null +++ b/asn1/cdd @@ -0,0 +1 @@ +Subproject commit cabf82ff5275e77dd427f5de86316bc3c198a32c diff --git a/module.mk b/module.mk index 62797bb3..cead6c13 100644 --- a/module.mk +++ b/module.mk @@ -1,13 +1 @@ -modules := ttcn/Common \ - asn1/ITS-Container \ - -# asn1/IS \ -# asn1/Security \ -# asn1/DENM \ -# asn1/CAM \ -# ttcn/DENM \ -# ttcn/IVIM \ -# ttcn/MapemSpatem \ -# ttcn/Pki \ -# ttcn/SremSsem \ -# ttcn/Http \ +modules := ttcn/Common diff --git a/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn b/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn index 1f3d7bfe..1a401f4b 100644 --- a/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn +++ b/ttcn/Common/LibItsCommon_ASN1_NamedNumbers.ttcn @@ -4,9 +4,9 @@ module LibItsCommon_ASN1_NamedNumbers { import from ITS_Container language "ASN.1:2008" all; - import from IVI language "ASN.1:1997" { - type IviStatus - } +// import from IVI language "ASN.1:1997" { +// type IviStatus +// } group commonConstants { diff --git a/ttcn/Common/LibItsCommon_Functions.ttcn b/ttcn/Common/LibItsCommon_Functions.ttcn index 6b03eaeb..9df9cb57 100644 --- a/ttcn/Common/LibItsCommon_Functions.ttcn +++ b/ttcn/Common/LibItsCommon_Functions.ttcn @@ -20,7 +20,7 @@ module LibItsCommon_Functions { // LibIts import from LibItsCommon_Pixits all; import from ITS_Container language "ASN.1:1997" all; - import from DSRC language "ASN.1:1997" all; +// import from DSRC language "ASN.1:1997" all; group generalFunctions { @@ -134,8 +134,8 @@ module LibItsCommon_Functions { * @desc Gets the current time since 01/01/2004 * @return TimeMark - tenths of a second in the current or next hour in units of 1/10th second from UTC time */ - function f_getCurrentTimeMark() return TimeMark { - var TimeMark v_timeMark := 0; + function f_getCurrentTimeMark() return UInt32 { + var UInt32 v_timeMark := 0; // log("*** f_getCurrentTimeMark: INFO: calling fx_getCurrentTimeMark() ***"); v_timeMark := fx_getCurrentTimeMark(); @@ -147,8 +147,8 @@ module LibItsCommon_Functions { * @desc Gets the Minute of current UTC year * @return MinuteOfTheYear - tenths of a second in the current or next hour in units of 1/10th second from UTC time */ - function f_getMinuteOfTheYear() return MinuteOfTheYear { - var MinuteOfTheYear v_minuteOfTheYear := 0; + function f_getMinuteOfTheYear() return UInt16 { + var UInt16 v_minuteOfTheYear := 0; // log("*** f_getMinuteOfTheYear: INFO: calling fx_getMinuteOfTheYear() ***"); v_minuteOfTheYear := fx_getMinuteOfTheYear(); @@ -160,8 +160,8 @@ module LibItsCommon_Functions { * @desc Gets the milliseconds point in the current UTC minute * @return DSecond - The milliseconds point in the current UTC minute (0..60000) */ - function f_getDSecond() return DSecond { - var DSecond v_dSecond := 0; + function f_getDSecond() return UInt16 { + var UInt16 v_dSecond := 0; // log("*** f_getDSecond: INFO: calling fx_getDSecond() ***"); v_dSecond := fx_getDSecond(); diff --git a/ttcn/Common/module.mk b/ttcn/Common/module.mk index 85e1185c..343d2f12 100644 --- a/ttcn/Common/module.mk +++ b/ttcn/Common/module.mk @@ -1,8 +1,14 @@ -sources := LibItsCommon_ASN1_ISDSRC_NamedNumbers.ttcn \ +sources := \ LibItsCommon_ASN1_NamedNumbers.ttcn \ LibItsCommon_Functions.ttcn \ LibItsCommon_Pixits.ttcn \ LibItsCommon_Templates.ttcn \ LibItsCommon_TestSystem.ttcn \ LibItsCommon_TypesAndValues.ttcn \ - LibItsExternal_TypesAndValues.ttcn \ No newline at end of file + LibItsExternal_TypesAndValues.ttcn \ +# LibItsCommon_ASN1_ISDSRC_NamedNumbers.ttcn \ + +ifeq (,$(ITS_CONTAINER)) + ITS_CONTAINER := defined + sources += ../../asn1/cdd/ITS_Container.asn +endif diff --git a/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn b/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn index c7650134..8b2b26d0 100644 --- a/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn +++ b/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn @@ -16,8 +16,8 @@ module LibItsHttp_BinaryMessageBodyTypes { */ // TODO Add here your custom binary import // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; + import from Ieee1609Dot2BaseTypes language "ASN.1:1997" all; + import from Ieee1609Dot2 language "ASN.1:1997" all; import from EtsiTs102941BaseTypes language "ASN.1:1997" all; import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; import from EtsiTs102941MessagesCa language "ASN.1:1997" all; diff --git a/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn b/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn index 45c6df15..d988cfad 100644 --- a/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn +++ b/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn @@ -15,8 +15,8 @@ module LibItsHttp_BinaryTemplates { // TODO Add here your custom binary import // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; + import from Ieee1609Dot2BaseTypes language "ASN.1:1997" all; + import from Ieee1609Dot2 language "ASN.1:1997" all; import from EtsiTs102941BaseTypes language "ASN.1:1997" all; import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; import from EtsiTs102941MessagesCa language "ASN.1:1997" all; -- GitLab From c17c78b974373442b1e1f5ebe17779d1440b8155 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Fri, 13 Aug 2021 10:45:51 +0200 Subject: [PATCH 313/320] Finalyze implementation of new TPs from ETSI TS 103 525-2 V1.2.4 (2021-10) --- ttcn/Pki/LibItsPki_Functions.ttcn | 92 ++++++++++++++++++++++++++++++- 1 file changed, 91 insertions(+), 1 deletion(-) diff --git a/ttcn/Pki/LibItsPki_Functions.ttcn b/ttcn/Pki/LibItsPki_Functions.ttcn index b5b7ca3b..f96dadbd 100644 --- a/ttcn/Pki/LibItsPki_Functions.ttcn +++ b/ttcn/Pki/LibItsPki_Functions.ttcn @@ -3481,7 +3481,9 @@ module LibItsPki_Functions { in boolean p_check_no_signature := false, in boolean p_check_region_restriction := false, in boolean p_check_signature_content := false, - in boolean p_check_app_permissions := false + in boolean p_check_app_permissions := false, + in boolean p_check_app_ssps := false, + in boolean p_check_app_validity_period := false ) return boolean { var CertificateType v_type_ := explicit; var template Signature v_signature_ := ?; @@ -3682,10 +3684,98 @@ module LibItsPki_Functions { } } // End of 'for'statement } + + if (p_check_app_ssps == true) { + var integer v_idx, v_jdx; + var Certificate v_authorized_certificate; + + if (f_readCertificate(p_authorized_certificate, v_authorized_certificate) == false) { + log("f_verify_rca_certificate: Fail to load p_authorized_certificate"); + return false; + } + log("f_verify_rca_certificate: v_authorized_certificate=", v_authorized_certificate); + for (v_idx := 0; v_idx < lengthof(p_certificate.toBeSigned.appPermissions); v_idx := v_idx + 1) { + log("f_verify_rca_certificate: Processing ", p_certificate.toBeSigned.appPermissions[v_idx]); + if (match(p_certificate.toBeSigned.appPermissions[v_idx], mw_appPermissions(-, ?)) == false) { + log("f_verify_rca_certificate: appPermissions mismatch"); + return false; + } + // Check that 'ssp' is in the certIssuePermissions component in the issuing certificate + for (v_jdx := 0; v_jdx < lengthof(v_authorized_certificate.toBeSigned.certIssuePermissions[0].subjectPermissions.explicit); v_jdx := v_jdx + 1) { + log("f_verify_rca_certificate: compare psid ", v_authorized_certificate.toBeSigned.certIssuePermissions[0].subjectPermissions.explicit[v_jdx].psid, " - ", p_certificate.toBeSigned.appPermissions[v_idx].psid); + if (v_authorized_certificate.toBeSigned.certIssuePermissions[0].subjectPermissions.explicit[v_jdx].psid == p_certificate.toBeSigned.appPermissions[v_idx].psid) { + break; + } + } // End of 'for'statement + if (v_jdx == lengthof(v_authorized_certificate.toBeSigned.certIssuePermissions[0].subjectPermissions.explicit)) { + log("f_verify_rca_certificate: Psid is not in the list of the issuing certificate"); + return false; + } else { + var BitmapSsp v_ssp_ca := substr(v_authorized_certificate.toBeSigned.certIssuePermissions[0].subjectPermissions.explicit[v_jdx].sspRange.bitmapSspRange.sspValue, 1, -1 + lengthof(v_authorized_certificate.toBeSigned.certIssuePermissions[0].subjectPermissions.explicit[v_jdx].sspRange.bitmapSspRange.sspValue)); + log("f_verify_rca_certificate: v_ssp_ca= ", v_ssp_ca, " - ssp= ", p_certificate.toBeSigned.appPermissions[v_idx].ssp.bitmapSsp); + if (v_ssp_ca != p_certificate.toBeSigned.appPermissions[v_idx].ssp.bitmapSsp) { + log("f_verify_rca_certificate: SSPs mismatch: CA"); + return false; + } + } + } // End of 'for'statement + } + + if (p_check_app_validity_period == true) { + var integer v_idx, v_jdx; + var Certificate v_authorized_certificate; + var UInt32 v_duration, v_duration_ca; + + if (f_readCertificate(p_authorized_certificate, v_authorized_certificate) == false) { + log("f_verify_rca_certificate: Fail to load p_authorized_certificate"); + return false; + } + log("f_verify_rca_certificate: v_authorized_certificate=", v_authorized_certificate); + // Check start date (indicating X_START_VALIDITY ( X_START_VALIDITY >= X_START_VALIDITY_CA )) + if (p_certificate.toBeSigned.validityPeriod.start_ < v_authorized_certificate.toBeSigned.validityPeriod.start_) { + log("f_verify_rca_certificate: validityPeriod.start_ mismatch"); + return false; + } + // Check duration (value <= X_START_VALIDITY_CA + X_DURATION_CA - X_START_VALIDITY) + v_duration := duration_to_uint32(p_certificate.toBeSigned.validityPeriod.duration); + v_duration_ca := duration_to_uint32(v_authorized_certificate.toBeSigned.validityPeriod.duration); + if (v_duration > (v_authorized_certificate.toBeSigned.validityPeriod.start_ + v_duration_ca - p_certificate.toBeSigned.validityPeriod.start_)) { + log("f_verify_rca_certificate: validityPeriod.duration mismatch"); + return false; + } + } return true; } + function duration_to_uint32( + in Duration p_duration + ) return UInt32 { + if (ischosen(p_duration.microseconds)) { + return p_duration.microseconds * 1000000; + } + else if (ischosen(p_duration.milliseconds)) { + return p_duration.milliseconds * 1000; + } + else if (ischosen(p_duration.seconds)) { + return p_duration.seconds; + } + else if (ischosen(p_duration.minutes)) { + return p_duration.minutes * 60; + } + else if (ischosen(p_duration.hours)) { + return p_duration.hours * 3600; + } + else if (ischosen(p_duration.sixtyHours)) { + return p_duration.sixtyHours * 60 * 3600; + } + else if (ischosen(p_duration.sixtyHours)) { + return p_duration.sixtyHours * 60 * 3600; + } + // No choice! + return p_duration.years * 31536000; // One calendar common year has 365 days + } + } // End of group rca group tlm { -- GitLab From 093a675dd4e727992c9bb71e13d182bdc78414db Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Thu, 28 Oct 2021 10:25:26 +0200 Subject: [PATCH 314/320] Merging TTF002 in TTF011 - Phase1: AtsCAM, AtsDENM, AtsGeoNetworking, AtsSecurity, AtsPki --- asn1/CAM/CAM_PDU_Descriptions.asn | 132 - asn1/CAM/module.mk | 2 - asn1/DENM/DENM_PDU_Descriptions.asn | 108 - asn1/DENM/module.mk | 2 - asn1/DSRCData/DSRCData.asn | 267 - asn1/DSRCData/DSRCtransferData.asn | 7 - asn1/EV-RSR/EV_RSR_PDU_Descriptions.asn | 157 - asn1/EVCSN/EVCSN_PDU_Descriptions.asn | 102 - .../ETSI_TS_103301/IVIM_PDU_Descriptions.asn | 22 - .../ETSI_TS_103301/MAPEM_PDU_Descriptions.asn | 21 - .../RTCMEM_PDU_Descriptions.asn | 22 - .../SPATEM_PDU_Descriptions.asn | 37 - .../ETSI_TS_103301/SREM_PDU_Descriptions.asn | 21 - .../ETSI_TS_103301/SSEM_PDU_Descriptions.asn | 22 - .../AVIAEINumberingAndDataStructures.asn | 29 - asn1/IS/ISO_TS_14823/GDD.asn | 140 - asn1/IS/ISO_TS_14906/EfcDsrcApplication.asn | 627 -- asn1/IS/ISO_TS_14906/EfcDsrcGeneric.asn | 27 - asn1/IS/ISO_TS_17419/CITSapplMgmtIDs.asn | 44 - asn1/IS/ISO_TS_19091/AddGrpC.asn | 209 - asn1/IS/ISO_TS_19091/AddGrpC_noCircular.asn | 33 - asn1/IS/ISO_TS_19091/DSRC.asn | 1317 ----- .../ISO_TS_19091/DSRC_REGION_noCircular.asn | 461 -- asn1/IS/ISO_TS_19091/REGION.asn | 130 - asn1/IS/ISO_TS_19091/original/AddGrpC.asn | 211 - asn1/IS/ISO_TS_19091/original/DSRC.asn | 1257 ---- asn1/IS/ISO_TS_19091/original/REGION.asn | 115 - asn1/IS/ISO_TS_19321/IVI.asn | 630 -- ...trationIdentificationVehicleDataModule.asn | 85 - asn1/IS/module.mk | 19 - asn1/ITS-Container/ITS_Container.asn | 508 -- asn1/ITS-Container/module.mk | 1 - .../ProtocolManagementInformation.asn | 181 - asn1/Security/1609Dot2/IEEE1609dot2.asn | 310 - .../1609Dot2/IEEE1609dot2BaseTypes.asn | 334 -- asn1/Security/EtsiTs103097Module.asn | 103 - .../TS102921/EtsiTs102941BaseTypes.asn | 77 - .../TS102921/EtsiTs102941MessagesCa.asn | 87 - ...siTs102941MessagesItss-OptionalPrivacy.asn | 75 - .../TS102921/EtsiTs102941MessagesItss.asn | 82 - .../TS102921/EtsiTs102941TrustLists.asn | 142 - .../EtsiTs102941TypesAuthorization.asn | 91 - ...siTs102941TypesAuthorizationValidation.asn | 67 - .../EtsiTs102941TypesCaManagement.asn | 31 - .../TS102921/EtsiTs102941TypesEnrolment.asn | 67 - asn1/Security/module.mk | 12 - .../TransportAddressMib.asn | 12 - asn1/cdd | 1 - ttcn/BTP/LibItsBtp_EncdecDeclarations.ttcn | 30 - ttcn/BTP/LibItsBtp_Functions.ttcn | 237 - ttcn/BTP/LibItsBtp_Pixits.ttcn | 49 - ttcn/BTP/LibItsBtp_Templates.ttcn | 204 - ttcn/BTP/LibItsBtp_TestSystem.ttcn | 117 - ttcn/BTP/LibItsBtp_TypesAndValues.ttcn | 178 - ttcn/BTP/module.mk | 6 - ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn | 40 - ttcn/CAM/LibItsCam_Functions.ttcn | 614 -- ttcn/CAM/LibItsCam_Pics.ttcn | 130 - ttcn/CAM/LibItsCam_Pixits.ttcn | 21 - ttcn/CAM/LibItsCam_Templates.ttcn | 879 --- ttcn/CAM/LibItsCam_TestSystem.ttcn | 162 - ttcn/CAM/LibItsCam_TypesAndValues.ttcn | 184 - ttcn/CAM/module.mk | 8 - ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn | 49 - ttcn/DENM/LibItsDenm_Functions.ttcn | 669 --- ttcn/DENM/LibItsDenm_Pics.ttcn | 72 - ttcn/DENM/LibItsDenm_Pixits.ttcn | 21 - ttcn/DENM/LibItsDenm_Templates.ttcn | 824 --- ttcn/DENM/LibItsDenm_TestSystem.ttcn | 168 - ttcn/DENM/LibItsDenm_TypesAndValues.ttcn | 207 - ttcn/DENM/module.mk | 7 - ...ibItsGeoNetworking_EncdecDeclarations.ttcn | 47 - .../LibItsGeoNetworking_Functions.ttcn | 2836 --------- .../LibItsGeoNetworking_Pics.ttcn | 389 -- .../LibItsGeoNetworking_Pixits.ttcn | 207 - .../LibItsGeoNetworking_Templates.ttcn | 2320 -------- .../LibItsGeoNetworking_TestSystem.ttcn | 180 - .../LibItsGeoNetworking_TypesAndValues.ttcn | 1182 ---- ttcn/GeoNetworking/module.mk | 8 - .../LibItsHttp_BinaryMessageBodyTypes.ttcn | 4 +- ttcn/Http/LibItsHttp_BinaryTemplates.ttcn | 4 +- ttcn/Http/LibItsHttp_Functions.ttcn | 4 + ttcn/Http/LibItsHttp_Pixits.ttcn | 9 + ttcn/Http/module.mk | 1 + .../IVIM/LibItsIvim_ASN1_IVInamedNumbers.ttcn | 56 - ttcn/IVIM/LibItsIvim_EncdecDeclarations.ttcn | 50 - ttcn/IVIM/LibItsIvim_Functions.ttcn | 473 -- ttcn/IVIM/LibItsIvim_Pics.ttcn | 118 - ttcn/IVIM/LibItsIvim_Pixits.ttcn | 95 - ttcn/IVIM/LibItsIvim_Templates.ttcn | 1056 ---- ttcn/IVIM/LibItsIvim_TestSystem.ttcn | 166 - ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn | 203 - ttcn/IVIM/module.mk | 8 - ...6OverGeoNetworking_EncdecDeclarations.ttcn | 11 - ...LibItsIpv6OverGeoNetworking_Functions.ttcn | 761 --- .../LibItsIpv6OverGeoNetworking_Pics.ttcn | 34 - .../LibItsIpv6OverGeoNetworking_Pixits.ttcn | 66 - ...LibItsIpv6OverGeoNetworking_Templates.ttcn | 292 - ...ibItsIpv6OverGeoNetworking_TestSystem.ttcn | 105 - ...sIpv6OverGeoNetworking_TypesAndValues.ttcn | 315 - ttcn/Ipv6OverGeoNetworking/module.mk | 8 - .../LibItsMapemSpatem_EncdecDeclarations.ttcn | 19 - .../LibItsMapemSpatem_Functions.ttcn | 461 -- ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn | 139 - .../MapemSpatem/LibItsMapemSpatem_Pixits.ttcn | 56 - .../LibItsMapemSpatem_Templates.ttcn | 950 --- .../LibItsMapemSpatem_TestSystem.ttcn | 178 - .../LibItsMapemSpatem_TypesAndValues.ttcn | 121 - ttcn/MapemSpatem/module.mk | 7 - ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn | 138 - ttcn/Pki/LibItsPki_Functions.ttcn | 5106 ----------------- ttcn/Pki/LibItsPki_Pics.ttcn | 259 - ttcn/Pki/LibItsPki_Pixits.ttcn | 79 - ttcn/Pki/LibItsPki_Templates.ttcn | 671 --- ttcn/Pki/LibItsPki_TestSystem.ttcn | 124 - ttcn/Pki/LibItsPki_TypesAndValues.ttcn | 153 - ttcn/Pki/module.mk | 7 - .../LibItsRtcmem_EncdecDeclarations.ttcn | 43 - ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn | 394 -- ttcn/Rtcmem/LibItsRtcmem_Pics.ttcn | 30 - ttcn/Rtcmem/LibItsRtcmem_Pixits.ttcn | 3 - ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn | 277 - ttcn/Rtcmem/LibItsRtcmem_TestSystem.ttcn | 127 - ttcn/Rtcmem/LibItsRtcmem_TypesAndValues.ttcn | 99 - ttcn/Rtcmem/module.mk | 8 - .../LibItsSecurity_EncdecDeclarations.ttcn | 58 - ttcn/Security/LibItsSecurity_Functions.ttcn | 3557 ------------ ttcn/Security/LibItsSecurity_Pics.ttcn | 97 - ttcn/Security/LibItsSecurity_Pixits.ttcn | 65 - ttcn/Security/LibItsSecurity_Templates.ttcn | 2101 ------- ttcn/Security/LibItsSecurity_TestSystem.ttcn | 50 - .../LibItsSecurity_TypesAndValues.ttcn | 314 - ttcn/Security/module.mk | 8 - .../LibItsSremSsem_EncdecDeclarations.ttcn | 59 - ttcn/SremSsem/LibItsSremSsem_Functions.ttcn | 518 -- ttcn/SremSsem/LibItsSremSsem_Pics.ttcn | 97 - ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn | 64 - ttcn/SremSsem/LibItsSremSsem_Templates.ttcn | 738 --- ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn | 162 - .../LibItsSremSsem_TypesAndValues.ttcn | 126 - ttcn/SremSsem/module.mk | 7 - 141 files changed, 18 insertions(+), 41773 deletions(-) delete mode 100644 asn1/CAM/CAM_PDU_Descriptions.asn delete mode 100644 asn1/CAM/module.mk delete mode 100644 asn1/DENM/DENM_PDU_Descriptions.asn delete mode 100644 asn1/DENM/module.mk delete mode 100644 asn1/DSRCData/DSRCData.asn delete mode 100644 asn1/DSRCData/DSRCtransferData.asn delete mode 100644 asn1/EV-RSR/EV_RSR_PDU_Descriptions.asn delete mode 100644 asn1/EVCSN/EVCSN_PDU_Descriptions.asn delete mode 100644 asn1/IS/ETSI_TS_103301/IVIM_PDU_Descriptions.asn delete mode 100644 asn1/IS/ETSI_TS_103301/MAPEM_PDU_Descriptions.asn delete mode 100644 asn1/IS/ETSI_TS_103301/RTCMEM_PDU_Descriptions.asn delete mode 100644 asn1/IS/ETSI_TS_103301/SPATEM_PDU_Descriptions.asn delete mode 100644 asn1/IS/ETSI_TS_103301/SREM_PDU_Descriptions.asn delete mode 100644 asn1/IS/ETSI_TS_103301/SSEM_PDU_Descriptions.asn delete mode 100644 asn1/IS/ISO_TS_14816/AVIAEINumberingAndDataStructures.asn delete mode 100644 asn1/IS/ISO_TS_14823/GDD.asn delete mode 100644 asn1/IS/ISO_TS_14906/EfcDsrcApplication.asn delete mode 100644 asn1/IS/ISO_TS_14906/EfcDsrcGeneric.asn delete mode 100644 asn1/IS/ISO_TS_17419/CITSapplMgmtIDs.asn delete mode 100644 asn1/IS/ISO_TS_19091/AddGrpC.asn delete mode 100644 asn1/IS/ISO_TS_19091/AddGrpC_noCircular.asn delete mode 100644 asn1/IS/ISO_TS_19091/DSRC.asn delete mode 100644 asn1/IS/ISO_TS_19091/DSRC_REGION_noCircular.asn delete mode 100644 asn1/IS/ISO_TS_19091/REGION.asn delete mode 100644 asn1/IS/ISO_TS_19091/original/AddGrpC.asn delete mode 100644 asn1/IS/ISO_TS_19091/original/DSRC.asn delete mode 100644 asn1/IS/ISO_TS_19091/original/REGION.asn delete mode 100644 asn1/IS/ISO_TS_19321/IVI.asn delete mode 100644 asn1/IS/ISO_TS_24534-3/ElectronicRegistrationIdentificationVehicleDataModule.asn delete mode 100644 asn1/IS/module.mk delete mode 100644 asn1/ITS-Container/ITS_Container.asn delete mode 100644 asn1/ITS-Container/module.mk delete mode 100644 asn1/ProtocolManagementInformation/ProtocolManagementInformation.asn delete mode 100644 asn1/Security/1609Dot2/IEEE1609dot2.asn delete mode 100644 asn1/Security/1609Dot2/IEEE1609dot2BaseTypes.asn delete mode 100644 asn1/Security/EtsiTs103097Module.asn delete mode 100644 asn1/Security/TS102921/EtsiTs102941BaseTypes.asn delete mode 100644 asn1/Security/TS102921/EtsiTs102941MessagesCa.asn delete mode 100644 asn1/Security/TS102921/EtsiTs102941MessagesItss-OptionalPrivacy.asn delete mode 100644 asn1/Security/TS102921/EtsiTs102941MessagesItss.asn delete mode 100644 asn1/Security/TS102921/EtsiTs102941TrustLists.asn delete mode 100644 asn1/Security/TS102921/EtsiTs102941TypesAuthorization.asn delete mode 100644 asn1/Security/TS102921/EtsiTs102941TypesAuthorizationValidation.asn delete mode 100644 asn1/Security/TS102921/EtsiTs102941TypesCaManagement.asn delete mode 100644 asn1/Security/TS102921/EtsiTs102941TypesEnrolment.asn delete mode 100644 asn1/Security/module.mk delete mode 100644 asn1/TransportAddressMib/TransportAddressMib.asn delete mode 160000 asn1/cdd delete mode 100644 ttcn/BTP/LibItsBtp_EncdecDeclarations.ttcn delete mode 100644 ttcn/BTP/LibItsBtp_Functions.ttcn delete mode 100644 ttcn/BTP/LibItsBtp_Pixits.ttcn delete mode 100644 ttcn/BTP/LibItsBtp_Templates.ttcn delete mode 100644 ttcn/BTP/LibItsBtp_TestSystem.ttcn delete mode 100644 ttcn/BTP/LibItsBtp_TypesAndValues.ttcn delete mode 100644 ttcn/BTP/module.mk delete mode 100644 ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn delete mode 100644 ttcn/CAM/LibItsCam_Functions.ttcn delete mode 100644 ttcn/CAM/LibItsCam_Pics.ttcn delete mode 100644 ttcn/CAM/LibItsCam_Pixits.ttcn delete mode 100644 ttcn/CAM/LibItsCam_Templates.ttcn delete mode 100644 ttcn/CAM/LibItsCam_TestSystem.ttcn delete mode 100644 ttcn/CAM/LibItsCam_TypesAndValues.ttcn delete mode 100644 ttcn/CAM/module.mk delete mode 100644 ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn delete mode 100644 ttcn/DENM/LibItsDenm_Functions.ttcn delete mode 100644 ttcn/DENM/LibItsDenm_Pics.ttcn delete mode 100644 ttcn/DENM/LibItsDenm_Pixits.ttcn delete mode 100644 ttcn/DENM/LibItsDenm_Templates.ttcn delete mode 100644 ttcn/DENM/LibItsDenm_TestSystem.ttcn delete mode 100644 ttcn/DENM/LibItsDenm_TypesAndValues.ttcn delete mode 100644 ttcn/DENM/module.mk delete mode 100644 ttcn/GeoNetworking/LibItsGeoNetworking_EncdecDeclarations.ttcn delete mode 100644 ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn delete mode 100644 ttcn/GeoNetworking/LibItsGeoNetworking_Pics.ttcn delete mode 100644 ttcn/GeoNetworking/LibItsGeoNetworking_Pixits.ttcn delete mode 100644 ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn delete mode 100644 ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn delete mode 100644 ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn delete mode 100644 ttcn/GeoNetworking/module.mk create mode 100644 ttcn/Http/LibItsHttp_Pixits.ttcn delete mode 100644 ttcn/IVIM/LibItsIvim_ASN1_IVInamedNumbers.ttcn delete mode 100644 ttcn/IVIM/LibItsIvim_EncdecDeclarations.ttcn delete mode 100644 ttcn/IVIM/LibItsIvim_Functions.ttcn delete mode 100644 ttcn/IVIM/LibItsIvim_Pics.ttcn delete mode 100644 ttcn/IVIM/LibItsIvim_Pixits.ttcn delete mode 100644 ttcn/IVIM/LibItsIvim_Templates.ttcn delete mode 100644 ttcn/IVIM/LibItsIvim_TestSystem.ttcn delete mode 100644 ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn delete mode 100644 ttcn/IVIM/module.mk delete mode 100644 ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_EncdecDeclarations.ttcn delete mode 100644 ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Functions.ttcn delete mode 100644 ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Pics.ttcn delete mode 100644 ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Pixits.ttcn delete mode 100644 ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Templates.ttcn delete mode 100644 ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TestSystem.ttcn delete mode 100644 ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TypesAndValues.ttcn delete mode 100644 ttcn/Ipv6OverGeoNetworking/module.mk delete mode 100644 ttcn/MapemSpatem/LibItsMapemSpatem_EncdecDeclarations.ttcn delete mode 100644 ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn delete mode 100644 ttcn/MapemSpatem/LibItsMapemSpatem_Pics.ttcn delete mode 100644 ttcn/MapemSpatem/LibItsMapemSpatem_Pixits.ttcn delete mode 100644 ttcn/MapemSpatem/LibItsMapemSpatem_Templates.ttcn delete mode 100644 ttcn/MapemSpatem/LibItsMapemSpatem_TestSystem.ttcn delete mode 100644 ttcn/MapemSpatem/LibItsMapemSpatem_TypesAndValues.ttcn delete mode 100644 ttcn/MapemSpatem/module.mk delete mode 100644 ttcn/Pki/LibItsPki_EncdecDeclarations.ttcn delete mode 100644 ttcn/Pki/LibItsPki_Functions.ttcn delete mode 100644 ttcn/Pki/LibItsPki_Pics.ttcn delete mode 100644 ttcn/Pki/LibItsPki_Pixits.ttcn delete mode 100644 ttcn/Pki/LibItsPki_Templates.ttcn delete mode 100644 ttcn/Pki/LibItsPki_TestSystem.ttcn delete mode 100644 ttcn/Pki/LibItsPki_TypesAndValues.ttcn delete mode 100644 ttcn/Pki/module.mk delete mode 100644 ttcn/Rtcmem/LibItsRtcmem_EncdecDeclarations.ttcn delete mode 100644 ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn delete mode 100644 ttcn/Rtcmem/LibItsRtcmem_Pics.ttcn delete mode 100644 ttcn/Rtcmem/LibItsRtcmem_Pixits.ttcn delete mode 100644 ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn delete mode 100644 ttcn/Rtcmem/LibItsRtcmem_TestSystem.ttcn delete mode 100644 ttcn/Rtcmem/LibItsRtcmem_TypesAndValues.ttcn delete mode 100644 ttcn/Rtcmem/module.mk delete mode 100644 ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn delete mode 100644 ttcn/Security/LibItsSecurity_Functions.ttcn delete mode 100644 ttcn/Security/LibItsSecurity_Pics.ttcn delete mode 100644 ttcn/Security/LibItsSecurity_Pixits.ttcn delete mode 100644 ttcn/Security/LibItsSecurity_Templates.ttcn delete mode 100644 ttcn/Security/LibItsSecurity_TestSystem.ttcn delete mode 100644 ttcn/Security/LibItsSecurity_TypesAndValues.ttcn delete mode 100644 ttcn/Security/module.mk delete mode 100644 ttcn/SremSsem/LibItsSremSsem_EncdecDeclarations.ttcn delete mode 100644 ttcn/SremSsem/LibItsSremSsem_Functions.ttcn delete mode 100644 ttcn/SremSsem/LibItsSremSsem_Pics.ttcn delete mode 100644 ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn delete mode 100644 ttcn/SremSsem/LibItsSremSsem_Templates.ttcn delete mode 100644 ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn delete mode 100644 ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn delete mode 100644 ttcn/SremSsem/module.mk diff --git a/asn1/CAM/CAM_PDU_Descriptions.asn b/asn1/CAM/CAM_PDU_Descriptions.asn deleted file mode 100644 index a13a9fac..00000000 --- a/asn1/CAM/CAM_PDU_Descriptions.asn +++ /dev/null @@ -1,132 +0,0 @@ -CAM-PDU-Descriptions { -itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) en (302637) cam (2) version (2) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS -ItsPduHeader, CauseCode, ReferencePosition, AccelerationControl, Curvature, CurvatureCalculationMode, Heading, LanePosition, EmergencyPriority, EmbarkationStatus, Speed, DriveDirection, LongitudinalAcceleration, LateralAcceleration, VerticalAcceleration, StationType, ExteriorLights, DangerousGoodsBasic, SpecialTransportType, LightBarSirenInUse, VehicleRole, VehicleLength, VehicleWidth, PathHistory, RoadworksSubCauseCode, ClosedLanes, TrafficRule, SpeedLimit, SteeringWheelAngle, PerformanceClass, YawRate, ProtectedCommunicationZone, PtActivation, Latitude, Longitude, ProtectedCommunicationZonesRSU, CenDsrcTollingZone FROM ITS-Container { -itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) -}; - - --- The root data frame for cooperative awareness messages - -CAM ::= SEQUENCE { - header ItsPduHeader, - cam CoopAwareness -} - -CoopAwareness ::= SEQUENCE { - generationDeltaTime GenerationDeltaTime, - camParameters CamParameters -} - -CamParameters ::= SEQUENCE { - basicContainer BasicContainer, - highFrequencyContainer HighFrequencyContainer, - lowFrequencyContainer LowFrequencyContainer OPTIONAL, - specialVehicleContainer SpecialVehicleContainer OPTIONAL, - ... -} - -HighFrequencyContainer ::= CHOICE { - basicVehicleContainerHighFrequency BasicVehicleContainerHighFrequency, - rsuContainerHighFrequency RSUContainerHighFrequency, - ... -} - - LowFrequencyContainer ::= CHOICE { - basicVehicleContainerLowFrequency BasicVehicleContainerLowFrequency, - ... -} - -SpecialVehicleContainer ::= CHOICE { - publicTransportContainer PublicTransportContainer, - specialTransportContainer SpecialTransportContainer, - dangerousGoodsContainer DangerousGoodsContainer, - roadWorksContainerBasic RoadWorksContainerBasic, - rescueContainer RescueContainer, - emergencyContainer EmergencyContainer, - safetyCarContainer SafetyCarContainer, - ... -} - -BasicContainer ::= SEQUENCE { - stationType StationType, - referencePosition ReferencePosition, - ... -} - -BasicVehicleContainerHighFrequency ::= SEQUENCE { - heading Heading, - speed Speed, - driveDirection DriveDirection, - vehicleLength VehicleLength, - vehicleWidth VehicleWidth, - longitudinalAcceleration LongitudinalAcceleration, - curvature Curvature, - curvatureCalculationMode CurvatureCalculationMode, - yawRate YawRate, - accelerationControl AccelerationControl OPTIONAL, - lanePosition LanePosition OPTIONAL, - steeringWheelAngle SteeringWheelAngle OPTIONAL, - lateralAcceleration LateralAcceleration OPTIONAL, - verticalAcceleration VerticalAcceleration OPTIONAL, - performanceClass PerformanceClass OPTIONAL, - cenDsrcTollingZone CenDsrcTollingZone OPTIONAL -} - -BasicVehicleContainerLowFrequency ::= SEQUENCE { - vehicleRole VehicleRole, - exteriorLights ExteriorLights, - pathHistory PathHistory -} - -PublicTransportContainer ::= SEQUENCE { - embarkationStatus EmbarkationStatus, - ptActivation PtActivation OPTIONAL -} - -SpecialTransportContainer ::= SEQUENCE { - specialTransportType SpecialTransportType, - lightBarSirenInUse LightBarSirenInUse -} - - DangerousGoodsContainer ::= SEQUENCE { - dangerousGoodsBasic DangerousGoodsBasic - } - - RoadWorksContainerBasic ::= SEQUENCE { - roadworksSubCauseCode RoadworksSubCauseCode OPTIONAL, - lightBarSirenInUse LightBarSirenInUse, - closedLanes ClosedLanes OPTIONAL - } - -RescueContainer ::= SEQUENCE { - lightBarSirenInUse LightBarSirenInUse -} - -EmergencyContainer ::= SEQUENCE { - lightBarSirenInUse LightBarSirenInUse, - incidentIndication CauseCode OPTIONAL, - emergencyPriority EmergencyPriority OPTIONAL -} - -SafetyCarContainer ::= SEQUENCE { - lightBarSirenInUse LightBarSirenInUse, - incidentIndication CauseCode OPTIONAL, - trafficRule TrafficRule OPTIONAL, - speedLimit SpeedLimit OPTIONAL -} - -RSUContainerHighFrequency ::= SEQUENCE { - protectedCommunicationZonesRSU ProtectedCommunicationZonesRSU OPTIONAL, - ... -} - -GenerationDeltaTime ::= INTEGER { oneMilliSec(1) } (0..65535) - -END \ No newline at end of file diff --git a/asn1/CAM/module.mk b/asn1/CAM/module.mk deleted file mode 100644 index bc9e3447..00000000 --- a/asn1/CAM/module.mk +++ /dev/null @@ -1,2 +0,0 @@ -sources := CAM_PDU_Descriptions.asn - diff --git a/asn1/DENM/DENM_PDU_Descriptions.asn b/asn1/DENM/DENM_PDU_Descriptions.asn deleted file mode 100644 index fa4ea6d7..00000000 --- a/asn1/DENM/DENM_PDU_Descriptions.asn +++ /dev/null @@ -1,108 +0,0 @@ -DENM-PDU-Descriptions {itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) en (302637) denm (1) version (2) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS -ItsPduHeader, CauseCode, Speed, InformationQuality, ReferencePosition, ClosedLanes, DangerousGoodsExtended, Heading, LanePosition, LightBarSirenInUse, RoadType, HeightLonCarr, PosLonCarr, PosCentMass, PositioningSolutionType, RequestResponseIndication, StationType, SpeedLimit, StationarySince, TimestampIts, WheelBaseVehicle, TurningRadius, PosFrontAx, PositionOfOccupants, Temperature, VehicleMass, VehicleIdentification, EnergyStorageType, ActionID, ItineraryPath, NumberOfOccupants, PositionOfPillars, RelevanceTrafficDirection, RestrictedTypes, Traces, TransmissionInterval, ValidityDuration, RelevanceDistance, EventHistory, TrafficRule, DeltaReferencePosition FROM ITS-Container { -itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) -}; - - -DENM ::= SEQUENCE { - header ItsPduHeader, - denm DecentralizedEnvironmentalNotificationMessage -} - -DecentralizedEnvironmentalNotificationMessage ::= SEQUENCE { - management ManagementContainer, - situation SituationContainer OPTIONAL, - location LocationContainer OPTIONAL, - alacarte AlacarteContainer OPTIONAL -} - -ManagementContainer ::= SEQUENCE { - actionID ActionID, - detectionTime TimestampIts, - referenceTime TimestampIts, - termination Termination OPTIONAL, - eventPosition ReferencePosition, - relevanceDistance RelevanceDistance OPTIONAL, - relevanceTrafficDirection RelevanceTrafficDirection OPTIONAL, - validityDuration ValidityDuration DEFAULT defaultValidity, - transmissionInterval TransmissionInterval OPTIONAL, - stationType StationType, - ... -} - -SituationContainer ::= SEQUENCE { - informationQuality InformationQuality, - eventType CauseCode, - linkedCause CauseCode OPTIONAL, - eventHistory EventHistory OPTIONAL, - ... -} - -LocationContainer ::= SEQUENCE { - eventSpeed Speed OPTIONAL, - eventPositionHeading Heading OPTIONAL, - traces Traces, - roadType RoadType OPTIONAL, - ... -} - -ImpactReductionContainer ::= SEQUENCE { - heightLonCarrLeft HeightLonCarr, - heightLonCarrRight HeightLonCarr, - posLonCarrLeft PosLonCarr, - posLonCarrRight PosLonCarr, - positionOfPillars PositionOfPillars, - posCentMass PosCentMass, - wheelBaseVehicle WheelBaseVehicle, - turningRadius TurningRadius, - posFrontAx PosFrontAx, - positionOfOccupants PositionOfOccupants, - vehicleMass VehicleMass, - requestResponseIndication RequestResponseIndication -} - -RoadWorksContainerExtended ::= SEQUENCE { - lightBarSirenInUse LightBarSirenInUse OPTIONAL, - closedLanes ClosedLanes OPTIONAL, - restriction RestrictedTypes OPTIONAL, - speedLimit SpeedLimit OPTIONAL, - incidentIndication CauseCode OPTIONAL, - recommendedPath ItineraryPath OPTIONAL, - startingPointSpeedLimit DeltaReferencePosition OPTIONAL, - trafficFlowRule TrafficRule OPTIONAL, - referenceDenms ReferenceDenms OPTIONAL - } - -StationaryVehicleContainer ::= SEQUENCE { - stationarySince StationarySince OPTIONAL, - stationaryCause CauseCode OPTIONAL, - carryingDangerousGoods DangerousGoodsExtended OPTIONAL, - numberOfOccupants NumberOfOccupants OPTIONAL, - vehicleIdentification VehicleIdentification OPTIONAL, - energyStorageType EnergyStorageType OPTIONAL -} - -AlacarteContainer ::= SEQUENCE { - lanePosition LanePosition OPTIONAL, - impactReduction ImpactReductionContainer OPTIONAL, - externalTemperature Temperature OPTIONAL, - roadWorks RoadWorksContainerExtended OPTIONAL, - positioningSolution PositioningSolutionType OPTIONAL, - stationaryVehicle StationaryVehicleContainer OPTIONAL, - ... -} - -defaultValidity INTEGER ::= 600 - -Termination ::= ENUMERATED {isCancellation(0), isNegation (1)} - -ReferenceDenms ::= SEQUENCE (SIZE(1..8, ...)) OF ActionID - -END \ No newline at end of file diff --git a/asn1/DENM/module.mk b/asn1/DENM/module.mk deleted file mode 100644 index 16c39c94..00000000 --- a/asn1/DENM/module.mk +++ /dev/null @@ -1,2 +0,0 @@ -sources := DENM_PDU_Descriptions.asn - diff --git a/asn1/DSRCData/DSRCData.asn b/asn1/DSRCData/DSRCData.asn deleted file mode 100644 index 1af274d7..00000000 --- a/asn1/DSRCData/DSRCData.asn +++ /dev/null @@ -1,267 +0,0 @@ -DSRCData {iso(1) standard(0) dsrc(15628) dsrcData(0) version (1)} -DEFINITIONS AUTOMATIC TAGS::= BEGIN --- IMPORTS --- New type definitions shall be imported from other ASN.1 modules as follows: --- Type1, Type2 FROM ModuleA; --- were: --- - Type1 and Type2 shall be replaced with the names of the types to be imported. --- - ModuleA shall be replaced the name of the exporting ASN.1 module --- EXPORTS everything; -Action-Request::=SEQUENCE{ - mode BOOLEAN, - eid Dsrc-EID, - actionType ActionType, - accessCredentials OCTET STRING (SIZE (0..127,...)) OPTIONAL, - actionParameter Container OPTIONAL, - iid Dsrc-EID OPTIONAL - } - -Action-Response::=SEQUENCE{ - fill BIT STRING (SIZE(1)), - eid Dsrc-EID, - iid Dsrc-EID OPTIONAL, - responseParameter Container OPTIONAL, - ret ReturnStatus OPTIONAL - } - -ActionType::=INTEGER(0..127,...) --- (0..118) Reserved for ISO/CEN use. --- Below ActionTypes defined in ISO FDIS 14906 --- 0 : getStamped --- 1 : setStamped --- 2 : getSecure --- 3 : setSecure --- 4 : getInstance --- 5 : setInstance --- 6 : getNonce --- 7 : setNonce --- 8 : transferChannel --- 9 : copy --- 10 : setMMI --- 11 : substract --- 12 : add --- 13 : debit --- 14 : credit --- 15 : echo --- (119-127) Reserved for private use - -ApplicationContextMark::=Container -- OCTET STRING (SIZE(0..127,...)) --- Illustration of an ApplicationContextMark example --- can be found in ISO 14906, referred to as an EFC-ContextMark - -ApplicationList::=SEQUENCE (SIZE (0..127,...)) OF SEQUENCE { - aid DSRCApplicationEntityID, - eid Dsrc-EID OPTIONAL, - parameter ApplicationContextMark OPTIONAL - } - -AttributeIdList::=SEQUENCE (SIZE(0.. 127,...)) OF INTEGER(0..127,...) - -AttributeList::=SEQUENCE (SIZE(0..127,...)) OF Attributes - -Attributes::=SEQUENCE{ - attributeId INTEGER (0..127,...), - attributeValue Container - } - -BeaconID::=SEQUENCE{ - manufacturerid INTEGER(0..65535), - individualid INTEGER(0..134217727) - } -- for registration of manufacturerid see www.nen.nl/cen278 - -BroadcastPool::=SEQUENCE{ - directoryvalue Directory, - content SEQUENCE (SIZE(0..127,...)) OF File - } - -BST::=SEQUENCE{ - rsu BeaconID, - time Time, - profile Profile, - mandApplications ApplicationList, - nonmandApplications ApplicationList OPTIONAL, - profileList SEQUENCE (SIZE(0..127,...)) OF Profile - } - -Container::=CHOICE{ - integer [0] INTEGER, - bitstring [1] BIT STRING, - octetstring [2] OCTET STRING (SIZE (0..127, ...)), - universalString [3] UniversalString, - beaconId [4] BeaconID, - t-apdu [5] T-APDUs, - dsrcApplicationEntityId[6] DSRCApplicationEntityID, - dsrc-Ase-Id [7] Dsrc-EID, - attrIdList [8] AttributeIdList, - attrList [9] AttributeList, - broadcastPool [10] BroadcastPool, - directory [11] Directory, - file [12] File, - fileType [13] FileType, - record [14] Record, - time [15] Time, - vector [16] SEQUENCE (SIZE(0..255)) OF INTEGER(0..127,...), --- tags [17..69] are defined in ISO 14906 for CEN DSRC application use --- tags [70..86] are reserved for ISO/CEN DSRC application use --- tags [87..127] are reserved for private use and intended for the --- addressing of the corresponding private attribute identifiers. - ... -- extension marker --- New attributes shall be inserted as: --- componentName1 [i] ModuleA.Type1 --- were --- - componentName1 is a name unique within the Container definition --- - "i" is the registered tag chosen from the ranges as specified above. --- - Type1 is the name of an imported type and --- - ModuleA is the name of the module the type Type1 is imported from. --- The prefix “ModuleA.†is only required in case of a name conflict, --- if the name “Type1†is not also defined in the DSRCData module and not --- imported from another module the prefix “ModuleA†should be ommitted. - } - -Directory::=SEQUENCE (SIZE(0..127,...)) OF FileName - -Dsrc-EID::=INTEGER(0..127, ...) - -DSRCApplicationEntityID::=INTEGER{ - system (0), - electronic-fee-collection (1), - freight-fleet-management (2), - public-transport (3), - traffic-traveller-information (4), - traffic-control (5), - parking-management (6), - geographic-road-database (7), - medium-range-preinformation (8), - man-machine-interface (9), - intersystem-interface (10), - automatic-vehicle-identification (11), - emergency-warning (12), - private (13), - multi-purpose-payment (14), - dsrc-resource-manager (15), - after-theft-systems (16), - cruise-assist-highway-system (17), - multi-purpose-information-system (18), - multi-mobile-information-system (19) - -- (20..28) are reserved for ISO/CEN-dsrc-applications - -- (29..30) are reserved for private use - -- 31 is reserved for ISO/CEN-dsrc-applications - }(0..31,...) --- For the latest standard use of application definition, --- refer to Clause 9 --- As an example, the application "electronic-fee-collection (1)" --- is standardised by ISO 14906 - -Event-Report-Request::=SEQUENCE{ - mode BOOLEAN, - eid Dsrc-EID, - eventType EventType, - accessCredentials OCTET STRING (SIZE(0..127,...)) OPTIONAL, - eventParameter Container OPTIONAL, - iid Dsrc-EID OPTIONAL - } - -Event-Report-Response::=SEQUENCE{ - fill BIT STRING (SIZE(2)), - eid Dsrc-EID, - iid Dsrc-EID OPTIONAL, - ret ReturnStatus OPTIONAL - } - -EventType::=INTEGER{ - release (0) - -- (1..118) are reserved for ISO/CEN use - -- (119..127) are reserved for private use - }(0..127,...) - -File::=SEQUENCE (SIZE(0..127,...)) OF Record - -FileName::=SEQUENCE{ - aseID Dsrc-EID, - fileID INTEGER(0..127,...) - } - -FileType::=NULL --- Not defined. This might be defined in future version. - -Get-Request::=SEQUENCE{ - fill BIT STRING (SIZE(1)), - eid Dsrc-EID, - accessCredentials OCTET STRING (SIZE(0..127,...)) OPTIONAL, - iid Dsrc-EID OPTIONAL, - attrIdList AttributeIdList OPTIONAL - } - -Get-Response::=SEQUENCE{ -fill BIT STRING (SIZE(1)), -eid Dsrc-EID, -iid Dsrc-EID OPTIONAL, -attributelist AttributeList OPTIONAL, -ret ReturnStatus OPTIONAL -} -Initialisation-Request::=BST -Initialisation-Response::=VST -NamedFile::=SEQUENCE{ -name FileName, -file File -} --- NamedFile will be used in T-Kernel with GetBroadcastData-Request, --- that might be specified in T-APDU in future version. -ObeConfiguration::=SEQUENCE{ -equipmentClass INTEGER(0..32767), -manufacturerID INTEGER(0..65535), -obeStatus INTEGER(0..65535) OPTIONAL -} -Profile::=INTEGER (0..127,...) --- (0..118) are reserved for ISO/CEN use, --- (119..127) are reserved for private use -Record::=CHOICE{ simple VisibleString, -... -} -ReturnStatus::=INTEGER{ -noError (0), -accessDenied (1), -argumentError (2), -complexityLimitation (3), -processingFailure (4), -processing (5), -chainingError (6) --- (7..99) are reserved for future ISO/CEN use, --- (100..127) are reserved for private use -}(0..127,...) -Set-Request::=SEQUENCE{ -fill BIT STRING (SIZE(1)), -mode BOOLEAN, -eid Dsrc-EID, -accessCredentials OCTET STRING (SIZE(0..127,...)) OPTIONAL, -attrList AttributeList, -iid Dsrc-EID OPTIONAL -} -Set-Response::=SEQUENCE{ -fill BIT STRING (SIZE(2)), -eid Dsrc-EID, -iid Dsrc-EID OPTIONAL, -ret ReturnStatus OPTIONAL -} -Time::=INTEGER(0..4294967295) --- The number of seconds passed since --- 1st January 1970, 00:00 (UTC) -T-APDUs::=CHOICE{ -action-request [0] Action-Request, -action-response [1] Action-Response, -event-report-request [2] Event-Report-Request, -event-report-response [3] Event-Report-Response, -set-request [4] Set-Request, -set-response [5] Set-Response, -get-request [6] Get-Request, -get-response [7] Get-Response, -initialisation-request [8] Initialisation-Request, -initialisation-response [9] Initialisation-Response -} -VST::=SEQUENCE{ -fill BIT STRING (SIZE(4)), -profile Profile, -applications ApplicationList, -obeConfiguration ObeConfiguration -} -END diff --git a/asn1/DSRCData/DSRCtransferData.asn b/asn1/DSRCData/DSRCtransferData.asn deleted file mode 100644 index cb052eaa..00000000 --- a/asn1/DSRCData/DSRCtransferData.asn +++ /dev/null @@ -1,7 +0,0 @@ -DSRCtransferData {iso(1) standard(0) dsrc(15628) dsrctransferData(1) version (1)} -DEFINITIONS::= BEGIN -IMPORTS T-APDUs -FROM DSRCData {iso(1) standard(0) dsrc(15628) dsrcData(0) version (1)}; --- EXPORTS everything; -Message::= T-APDUs -- Message is transferred over the DSRC link; -END diff --git a/asn1/EV-RSR/EV_RSR_PDU_Descriptions.asn b/asn1/EV-RSR/EV_RSR_PDU_Descriptions.asn deleted file mode 100644 index 1455feed..00000000 --- a/asn1/EV-RSR/EV_RSR_PDU_Descriptions.asn +++ /dev/null @@ -1,157 +0,0 @@ -EV-RechargingSpotReservation-PDU-Descriptions { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (101556) ev-rsr (4) version (1) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS - ItsPduHeader FROM ITS-Container { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) -}; - -EV-RSR ::= SEQUENCE { - header ItsPduHeader, - messageBody EV-RSR-MessageBody -} - -EV-RSR-MessageBody ::= CHOICE { - preReservationRequestMessage PreReservationRequestMessage, - preReservationResponseMessage PreReservationResponseMessage, - reservationRequestMessage ReservationRequestMessage, - reservationResponseMessage ReservationResponseMessage, - cancellationRequestMessage CancellationRequestMessage, - cancellationResponseMessage CancellationResponseMessage, - updateRequestMessage UpdateRequestMessage, - updateResponseMessage UpdateResponseMessage, -... -} - -PreReservationRequestMessage ::= SEQUENCE { - evse-ID EVSE-ID, - arrivalTime TimestampUTC, - departureTime TimestampUTC OPTIONAL, - rechargingType RechargingType, - batteryType BatteryType OPTIONAL, - ... -} - -PreReservationResponseMessage ::= SEQUENCE { - preReservation-ID PreReservation-ID, - availabilityStatus AvailabilityStatus, - preReservationExpirationTime TimestampUTC, - supportedPaymentTypes SupportedPaymentTypes, - ... -} - -ReservationRequestMessage ::= SEQUENCE { - currentTime TimestampUTC, - preReservation-ID PreReservation-ID, - arrivalTime TimestampUTC, - departureTime TimestampUTC OPTIONAL, - eAmount EAmount, - eAmountMin EAmount, - paymentType PaymentType, - payment-ID Payment-ID, - secondPayment-ID Payment-ID OPTIONAL, - pairing-ID Pairing-ID OPTIONAL, - ... -} - -ReservationResponseMessage ::= SEQUENCE { - reservationResponseCode ReservationResponseCode, - reservation-ID Reservation-ID OPTIONAL, - reservation-Password Reservation-Password OPTIONAL, - stationDetails StationDetails OPTIONAL, - chargingSpotLabel ChargingSpotLabel OPTIONAL, - expirationTime TimestampUTC, - freeCancelTimeLimit TimestampUTC OPTIONAL, - ... -} - -CancellationRequestMessage ::= SEQUENCE { - reservation-ID Reservation-ID, - reservation-Password Reservation-Password, - currentTime TimestampUTC, - ... -} - -CancellationResponseMessage ::= SEQUENCE { - reservation-ID Reservation-ID, - cancellationResponseCode CancellationResponseCode, - ... -} - -UpdateRequestMessage ::= SEQUENCE { - reservation-ID Reservation-ID, - reservation-Password Reservation-Password, - updatedArrivalTime TimestampUTC, - updatedDepartureTime TimestampUTC, - ... -} - -UpdateResponseMessage ::= SEQUENCE { - reservation-ID Reservation-ID, - updateResponseCode UpdateResponseCode, - chargingSpotLabel ChargingSpotLabel OPTIONAL, - ... -} - - - -AvailabilityStatus ::= ENUMERATED { available, no-free-capacity } - -BatteryType ::= UTF8String (SIZE(1..16)) - -CancellationResponseCode ::= ENUMERATED { ok, unknown-Reservation-ID, mismatching-Reservation-Password } - -ChargingSpotLabel ::= UTF8String (SIZE(1..4)) - -ContractID ::= UTF8String (SIZE(1..24)) - -EAmount ::= INTEGER { oneWh(1) } (1..500000) - -ChargingPower ::= INTEGER { oneW(1) } (1..200000) - -EVSE-ID ::= OCTET STRING (SIZE(1..32)) - -ExternalIdentificationMeans ::= UTF8String (SIZE(1..24)) - -Pairing-ID ::= VisibleString (SIZE(1..64)) - -PaymentType ::= ENUMERATED {contract, externalIdentification} - -Payment-ID ::= CHOICE { - contractID ContractID, - externalIdentificationMeans ExternalIdentificationMeans -} - -RechargingType ::= SEQUENCE { - rechargingMode RechargingMode, - powerSource PowerSource -} - -RechargingMode ::= INTEGER { mode1(0), mode2(1), mode3(2), mode4(3), quickDrop(8), inductiveChargingWhileStationary(12), inductiveChargingWhileDriving(14) } (0..15) - -PowerSource::= INTEGER { notApplicable(0), ac1Phase(1), ac2Phase(2), ac3Phase(3), dcc(4), chaDeMo(5) } (0..7) -ReservationResponseCode ::= ENUMERATED {ok, invalid-EVSE-ID, payment-type-not-supported, payment-error, authentication-error, insufficient-power-availability } - -Reservation-ID ::= VisibleString (SIZE(8)) - -PreReservation-ID ::= Reservation-ID - -Reservation-Password ::= VisibleString (SIZE(8)) - - -StationDetails ::= UTF8String (SIZE(1..32)) - -SupportedPaymentTypes ::= BIT STRING { contract(0), externalIdentification (1) } (SIZE(2)) - -TimestampUTC ::= INTEGER { utcStartOf2013(0), oneSecondAfterUTCStartOf2013(1) } - -UpdateResponseCode ::= ENUMERATED { ok, unknown-Reservation-ID, mismatching-Reservation-Password, invalid-Arrival-Time, invalid-Departure-Time } - -StatusResponseCode ::= ENUMERATED { charging-Spot-Occupied, charging-Spot-Unoccupied, charging-Ongoing, reservation-Limit-Exceeded, reservation-Cancelled, unknown-Reservation-ID, expired-Reservation-ID } - -END diff --git a/asn1/EVCSN/EVCSN_PDU_Descriptions.asn b/asn1/EVCSN/EVCSN_PDU_Descriptions.asn deleted file mode 100644 index b86fbb19..00000000 --- a/asn1/EVCSN/EVCSN_PDU_Descriptions.asn +++ /dev/null @@ -1,102 +0,0 @@ --- Point of Interest (POI) notification for charging spot --- for electric vehicle --- EVCSN Message definition --- ASN.1 Start Definition - -EVCSN-PDU-Descriptions { -itu-t (0) identified-organization (4) etsi (0) itsDomain (5) -wg1 (1) ts (101556) evcsn (1) version (1) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS - ItsPduHeader, - StationID, - TimestampIts, - ReferencePosition -FROM ITS-Container { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1) -}; - --- Root Message PDU: EvcsnPdu - -EvcsnPdu ::= SEQUENCE { - header ItsPduHeader, - evcsn EVChargingSpotNotificationPOIMessage -} - -EVChargingSpotNotificationPOIMessage ::= SEQUENCE { - poiHeader ItsPOIHeader, -- Specific POI Message Header - evcsnData ItsEVCSNData -- Electric Vehicle Charging Spot Data Elements -} - -ItsPOIHeader ::= SEQUENCE { - poiType POIType, -- set to "EV charging station POI ID = 1" - timeStamp TimestampIts, - relayCapable BOOLEAN -} - - -ItsEVCSNData ::= SEQUENCE { - totalNumberOfStations NumberStations, - chargingStationsData SEQUENCE (SIZE(1..256)) OF ItsChargingStationData -} - -ItsChargingStationData ::= SEQUENCE { - chargingStationID StationID, - utilityDistributorId UTF8String (SIZE(1..32)) OPTIONAL, - providerID UTF8String (SIZE(1..32)) OPTIONAL, - chargingStationLocation ReferencePosition, - address UTF8String OPTIONAL, - phoneNumber NumericString (SIZE(1..16)) OPTIONAL, - accessibility UTF8String (SIZE(1..32)), - digitalMap DigitalMap OPTIONAL, - openingDaysHours UTF8String, - pricing UTF8String, - bookingContactInfo UTF8String OPTIONAL, - payment UTF8String OPTIONAL, - chargingSpotsAvailable ItsChargingSpots, - ... -} - - -ItsChargingSpots ::= SEQUENCE (SIZE(1..16)) OF ItsChargingSpotDataElements - - -ItsChargingSpotDataElements ::= SEQUENCE { - type ChargingSpotType, - evEquipmentID UTF8String OPTIONAL, - typeOfReceptacle TypeOfReceptacle, - energyAvailability UTF8String, - parkingPlacesData ParkingPlacesData OPTIONAL -} - -DigitalMap ::= SEQUENCE (SIZE(1..256)) OF ReferencePosition - -ChargingSpotType ::= BIT STRING { - standardChargeMode1(0), - standardChargeMode2(1), - standardOrFastChargeMode3(2), - fastChargeWithExternalCharger(3), - quickDrop(8), - inductiveChargeWhileStationary(12), - inductiveChargeWhileDriving(14) -} - -TypeOfReceptacle ::= BIT STRING - -ParkingPlacesData ::= SEQUENCE (SIZE(1..4)) OF SpotAvailability - -SpotAvailability ::= SEQUENCE { - maxWaitingTimeMinutes INTEGER (0..1400), -- 0 if available or max waiting - -- time (minutes) - blocking BOOLEAN -- true if the spot can be blocked -} - -POIType ::= INTEGER(0..65535) -NumberStations ::= INTEGER(1..256) - -END diff --git a/asn1/IS/ETSI_TS_103301/IVIM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/IVIM_PDU_Descriptions.asn deleted file mode 100644 index 319c1522..00000000 --- a/asn1/IS/ETSI_TS_103301/IVIM_PDU_Descriptions.asn +++ /dev/null @@ -1,22 +0,0 @@ --- @brief Specification of the In vehicle information Message ETSI TS 103 301 --- Latest version available at @url https://forge.etsi.org/rep/ITS/asn1/is_ts103301.git - -IVIM-PDU-Descriptions { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts103301 (103301) ivim (2) version2 (2) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS -IviStructure FROM IVI { iso (1) standard (0) ivi (19321) version2 (2) } -ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2)}; - -IVIM ::= SEQUENCE { - header ItsPduHeader, - ivi IviStructure -} - -END - diff --git a/asn1/IS/ETSI_TS_103301/MAPEM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/MAPEM_PDU_Descriptions.asn deleted file mode 100644 index 9496e553..00000000 --- a/asn1/IS/ETSI_TS_103301/MAPEM_PDU_Descriptions.asn +++ /dev/null @@ -1,21 +0,0 @@ --- @brief Specification of the Map (lane topology) extended Message ETSI TS 103 301 --- Latest version available at @url https://forge.etsi.org/rep/ITS/asn1/is_ts103301.git - -MAPEM-PDU-Descriptions { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts103301 (103301) mapem (1) version2 (2) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS -MapData FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) } -ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2)}; - -MAPEM ::= SEQUENCE { - header ItsPduHeader, - map MapData -} - -END diff --git a/asn1/IS/ETSI_TS_103301/RTCMEM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/RTCMEM_PDU_Descriptions.asn deleted file mode 100644 index 1c0ea624..00000000 --- a/asn1/IS/ETSI_TS_103301/RTCMEM_PDU_Descriptions.asn +++ /dev/null @@ -1,22 +0,0 @@ --- @brief Specification of the RTCM corrections extended Message ETSI TS 103 301 --- Latest version available at @url https://forge.etsi.org/rep/ITS/asn1/is_ts103301.git - -RTCMEM-PDU-Descriptions { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts103301 (103301) rtcmem (5) version1 (1) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS -RTCMcorrections FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) } -ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2)}; - -RTCMEM ::= SEQUENCE { - header ItsPduHeader, - rtcmc RTCMcorrections -} - -END - diff --git a/asn1/IS/ETSI_TS_103301/SPATEM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/SPATEM_PDU_Descriptions.asn deleted file mode 100644 index dbad8257..00000000 --- a/asn1/IS/ETSI_TS_103301/SPATEM_PDU_Descriptions.asn +++ /dev/null @@ -1,37 +0,0 @@ --- @brief Specification of the Signal phase and timing extended Message ETSI TS 103 301 --- Latest version available at @url https://forge.etsi.org/rep/ITS/asn1/is_ts103301.git - -SPATEM-PDU-Descriptions { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts103301 (103301) spatem (0) version2 (2) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS --- @brief Include ISO 19091 --- Include references from @url https://standards.iso.org/iso/ts/19091/ed-2/en/ISO-TS-19091-addgrp-C-2018.asn -SPAT -FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) } - --- @brief Include ETSI TS 102 894-2 --- Include references from @url https://forge.etsi.org/rep/ITS/ITS_ASN1/blob/master/CDD_TS102894-2/ITS-Container.asn -ItsPduHeader -FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) }; - --- Signal phase and timing extended Message - --- @brief Signal phase and timing extended Message Root --- This DF includes DEs for the SPATEM protocolVersion, the SPAT message type identifier _messageID_ and --- the station identifier _stationID_ of the originating ITS-S. -SPATEM ::= SEQUENCE { - -- @details header - -- The DE _protocolVersion_ is used to select the appropriate protocol decoder at the receiving ITS-S. - -- It shall be set to 2. - -- The DE _messageID_ shall be spatem(4). - header ItsPduHeader, - spat SPAT -} - -END diff --git a/asn1/IS/ETSI_TS_103301/SREM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/SREM_PDU_Descriptions.asn deleted file mode 100644 index a96af0e5..00000000 --- a/asn1/IS/ETSI_TS_103301/SREM_PDU_Descriptions.asn +++ /dev/null @@ -1,21 +0,0 @@ --- @brief Specification of the Signal request extended Message ETSI TS 103 301 --- Latest version available at @url https://forge.etsi.org/rep/ITS/asn1/is_ts103301.git - -SREM-PDU-Descriptions { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts103301 (103301) srem (3) version2 (2) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS -SignalRequestMessage FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) } -ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2)}; - -SREM ::= SEQUENCE { - header ItsPduHeader, - srm SignalRequestMessage -} - -END diff --git a/asn1/IS/ETSI_TS_103301/SSEM_PDU_Descriptions.asn b/asn1/IS/ETSI_TS_103301/SSEM_PDU_Descriptions.asn deleted file mode 100644 index 7c3069be..00000000 --- a/asn1/IS/ETSI_TS_103301/SSEM_PDU_Descriptions.asn +++ /dev/null @@ -1,22 +0,0 @@ --- @brief Specification of the Signal status extended Message ETSI TS 103 301 --- Latest version available at @url https://forge.etsi.org/rep/ITS/asn1/is_ts103301.git - -SSEM-PDU-Descriptions { - itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts103301 (103301) ssem (4) version2 (2) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS -SignalStatusMessage FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) } -ItsPduHeader FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2)}; - - -SSEM ::= SEQUENCE { - header ItsPduHeader, - ssm SignalStatusMessage -} - -END diff --git a/asn1/IS/ISO_TS_14816/AVIAEINumberingAndDataStructures.asn b/asn1/IS/ISO_TS_14816/AVIAEINumberingAndDataStructures.asn deleted file mode 100644 index 9fd119ba..00000000 --- a/asn1/IS/ISO_TS_14816/AVIAEINumberingAndDataStructures.asn +++ /dev/null @@ -1,29 +0,0 @@ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- ISO TS 14816 --- --- This ASN.1 was generateds: 30.08.2016 --- --- This document contains only the data element needed for the encoding of an IVI message --- as defined in ISO TS 19321(2015) --- --- Published version location: --- http://standards.iso.org/iso/14816/ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -AVIAEINumberingAndDataStructures {iso(1) standard(0) iso14816(14816) asnm1(1) version1(1)} - -DEFINITIONS AUTOMATIC TAGS::= BEGIN -IMPORTS; - -CS5::= SEQUENCE { - vin VisibleString, -- 17 characters VIN - fill BIT STRING (SIZE(9)) -- set to '000000000' -} - - - -CountryCode::= BIT STRING(SIZE(10)) - -AVIAEIIssuerIdentifier::= INTEGER(0 .. 16383) - -END diff --git a/asn1/IS/ISO_TS_14823/GDD.asn b/asn1/IS/ISO_TS_14823/GDD.asn deleted file mode 100644 index 681858c1..00000000 --- a/asn1/IS/ISO_TS_14823/GDD.asn +++ /dev/null @@ -1,140 +0,0 @@ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- ISO TS 14823 --- --- This ASN.1 was generated: 30.08.2016 --- --- This document contains only the data element needed for the encoding of an IVI message --- as defined in ISO TS 19321(2020) --- --- Published version location (yet missing there): --- https://standards.iso.org/iso/ts/14823/ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -GDD {iso (1) standard (0) gdd(14823) version1 (0)} - -DEFINITIONS AUTOMATIC TAGS::= -BEGIN - -IMPORTS -Distance, DistanceOrDuration, DestinationPlace, DestinationPlaces, DestinationRoad, DestinationRoads, MonthDay, HoursMinutes, DayOfWeek, Weight, DDD-IO, DDD-IO-LIST -FROM IVI {iso (1) standard (0) ivi (19321) version2 (2)}; - ---Definition of GDD Structure - -GddStructure::= SEQUENCE{ - pictogramCode SEQUENCE { - countryCode OCTET STRING (SIZE (2)) OPTIONAL, - serviceCategoryCode CHOICE { - trafficSignPictogram ENUMERATED {dangerWarning, regulatory, informative,...}, - publicFacilitiesPictogram ENUMERATED {publicFacilities, ...}, - ambientOrRoadConditionPictogram ENUMERATED {ambientCondition, roadCondition,...}, - ...}, - pictogramCategoryCode SEQUENCE { - nature INTEGER (1..9), - serialNumber INTEGER (0..99) -}}, - attributes GddAttributes OPTIONAL -} - --- Definition of the single ISO 14823 Attributes -GddAttributes::= SEQUENCE (SIZE(1..8),...) OF GddAttribute - -GddAttribute::= CHOICE{ - dtm InternationalSign-applicablePeriod, -- Date/Time/Period - edt InternationalSign-exemptedApplicablePeriod,-- Exemption status of Date/Time/Period - dfl InternationalSign-directionalFlowOfLane,-- Directional Flow of Lane - ved InternationalSign-applicableVehicleDimensions,-- Vehicle Dimensions - spe InternationalSign-speedLimits,-- Speed - roi InternationalSign-rateOfIncline,-- Rate of Incline - dbv InternationalSign-distanceBetweenVehicles,-- Distance Between Vehicles - ddd InternationalSign-destinationInformation,-- Destination/Direction/Distance - set InternationalSign-section, -- Section - nol InternationalSign-numberOfLane -- Number of Lanes - } - -InternationalSign-applicablePeriod::= SEQUENCE { - year SEQUENCE { -- contains yearRangeStartYear and yearRangeEndYear - yearRangeStartYear INTEGER(2000..2127,...), - yearRangeEndYear INTEGER(2000..2127,...) - } OPTIONAL, - month-day SEQUENCE { -- contains dateRangeStartMonth&Date and dateRangeEndMonth&Date - dateRangeStartMonthDay MonthDay, - dateRangeEndMonthDay MonthDay - } OPTIONAL, - repeatingPeriodDayTypes RepeatingPeriodDayTypes OPTIONAL, - hourMinutes SEQUENCE { -- contains timeRangeStartTime and timeRangeEndTime - timeRangeStartTime HoursMinutes, - timeRangeEndTime HoursMinutes - } OPTIONAL, - dateRangeOfWeek DayOfWeek OPTIONAL, - durationHourMinute HoursMinutes OPTIONAL -} - -InternationalSign-exemptedApplicablePeriod::= InternationalSign-applicablePeriod - -InternationalSign-directionalFlowOfLane::= INTEGER { - sDL (1),-- Straight Direction Only - sLT (2),-- Straight and Left Turn Only - sRT (3),-- Straight and Right Turn Only - lTO (4),-- Left Turn Only - rTO (5),-- Right Turn Only - cLL (6),-- Convergence from the Left Lane - cRI (7),-- Convergence from the Right Lane - oVL (8) -- Oncoming Vehicles Lane - } (1..8) - -InternationalSign-applicableVehicleDimensions::= SEQUENCE{ - vehicleHeight Distance OPTIONAL, - vehicleWidth Distance OPTIONAL, - vehicleLength Distance OPTIONAL, - vehicleWeight Weight OPTIONAL - } - -InternationalSign-speedLimits::= SEQUENCE{ - speedLimitMax INTEGER(0..250) OPTIONAL, - speedLimitMin INTEGER(0..250) OPTIONAL, - unit Code-Units (0..1) - } - -InternationalSign-rateOfIncline::= INTEGER(1..32) - -InternationalSign-distanceBetweenVehicles::= Distance - -InternationalSign-destinationInformation::= SEQUENCE{ - junctionDirection INTEGER(1..128) OPTIONAL, - roundaboutCwDirection INTEGER(1..128)OPTIONAL, - roundaboutCcwDirection INTEGER(1..128)OPTIONAL, - ioList DDD-IO-LIST - } - -InternationalSign-section::= SEQUENCE{ - startingPointLength Distance OPTIONAL, - continuityLength Distance OPTIONAL - } - -InternationalSign-numberOfLane::= INTEGER(0..99) - --- Definition of data elements used in ISO 14823 attributes - -Code-Units::= INTEGER { - kmperh (0), - milesperh (1), - kilometre (2), - metre (3), - decimetre (4), - centimetre (5), - mile (6), - yard (7), - foot (8), - minutesOfTime (9), - tonnes (10),--1000 kg, not Ton! - hundredkg (11), - pound (12),--lbs - rateOfIncline (13), - durationinminutes (14) - -- value 15 reserved for future use - } (0..15) - -RepeatingPeriodDayTypes::= BIT STRING {national-holiday (0), even-days(1), odd-days(2), market-day(3) } (SIZE (4)) - -END diff --git a/asn1/IS/ISO_TS_14906/EfcDsrcApplication.asn b/asn1/IS/ISO_TS_14906/EfcDsrcApplication.asn deleted file mode 100644 index c4c8dd48..00000000 --- a/asn1/IS/ISO_TS_14906/EfcDsrcApplication.asn +++ /dev/null @@ -1,627 +0,0 @@ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- ISO TS 14906 App --- --- This ASN.1 was generated: 30.08.2016 --- --- This document contains a compile clean version of EfcDsrcApplication module --- --- Published version location: --- https://standards.iso.org/iso/14906/ed-3/en/ISO14906(2018)EfcDsrcApplicationv6.asn --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -EfcDsrcApplication {iso(1) standard(0) 14906 application(0) version6(6)} -DEFINITIONS AUTOMATIC TAGS ::= BEGIN -EXPORTS ALL; -IMPORTS -CountryCode, CS5, AVIAEIIssuerIdentifier -FROM AVIAEINumberingAndDataStructures {iso(1) standard(0) iso14816(14816) asnm1(1) version1(1)} --- defined in ISO 14816 -- -AttributeIdList, Attributes{}, AttributeList{} -FROM EfcDsrcGeneric {iso(1) standard(0) 14906 generic(1) version7(7)}; --- NOTE: The following are the definitions of the action and response --- parameters -ActualNumberOfPassengers ::= Int1 -AxleWeightLimits ::= SEQUENCE { - maxLadenweightOnAxle1 Int2, - maxLadenweightOnAxle2 Int2, - maxLadenweightOnAxle3 Int2, - maxLadenweightOnAxle4 Int2, - maxLadenweightOnAxle5 Int2 -} -AddRq::= SEQUENCE { -attributeId INTEGER(0..127,...), -value INTEGER -} -ChannelId::= INTEGER { -obu (0), -sam1 (1), -- secure application module -sam2 (2), -icc (3), -- integrated circuit(s) card -display (4), -buzzer (5), -printer (6), -serialInterface (7), -- serial interface: eg. RS232 and RS485 -parallelInterface (8), -gPS (9), -tachograph (10), -privateUse1 (11), -- free for proprietary use -privateUse2 (12), -- free for proprietary use -privateUse3 (13), -- free for proprietary use -privateUse4 (14), -- free for proprietary use -privateUse5 (15), -- free for proprietary use -bluetooth (16) --- (17-255) are reserved for future CEN use -} (0..255) -ChannelRq::= SEQUENCE{ -channelId ChannelId, -apdu OCTET STRING --- format according to the interface --- of the channelId -} -ChannelRs::= SEQUENCE{ -channelId ChannelId, -apdu OCTET STRING --- format according to the interface --- of the channelId -} -CopyRq::= SEQUENCE { -destinationEID INTEGER(0..127,...), -attributeIdList AttributeIdList -} -CreditRq::= SEQUENCE { -refund PaymentFee, -nonce OCTET STRING, -key INTEGER(0..255) -} -CreditRs ::= SEQUENCE { -creditResult ResultFin, -creditAuthenticator OCTET STRING -} -DebitRq::= SEQUENCE { -debitPaymentFee PaymentFee, -nonce OCTET STRING, -keyRef INTEGER(0..255) -} -DebitRs ::= SEQUENCE { -debitResult ResultFin, -debitAuthenticator OCTET STRING -} -GetInstanceRq ::= SEQUENCE { -posOfFirstInstance INTEGER(0..255), -- position of first instance to be retrieved -posOfLastInstance INTEGER(0..255), -- position last instance to be retrieved -attributeIdList AttributeIdList -- Ids of attributes to be retrieved -} -GetInstanceRs{Container}::= SEQUENCE (SIZE (0..127,...)) OF SEQUENCE { -attributeId INTEGER(0..127,...), --- number of instances retrieved -attributeValues Container (WITH COMPONENTS {octetstring PRESENT}) --- The octetstring shall contain the contatenation of --- the unaligned PER encodings of the values of the --- instances, with each encoding padded to an integral --- of octets as specified for a top-level type in --- ISO/IEC 8825-2 -} -GetStampedRq::= SEQUENCE { -attributeIdList AttributeIdList, -nonce OCTET STRING, -- e.g. a random number -keyRef INTEGER(0..255) -} -GetStampedRs{Container}::= SEQUENCE { -attributeList AttributeList{Container}, -authenticator OCTET STRING -} -SetInstanceRq{Container} ::= SEQUENCE { -posOfInstance INTEGER(0..255), -attribute Attributes{Container} -} -SetMMIRq::= INTEGER { -ok (0), -- operation / transaction successfully completed -nok (1), -- operation / transaction not successfully completed -contactOperator (2), -- e.g. due to low balance or battery -noSignalling (255) -- no signalling --- (3-127) are reserved for future CEN use --- (128-254) are reserved for private use -} (0..255) -SetStampedRq{Container}::= SEQUENCE { -attributeList AttributeList{Container}, -nonce OCTET STRING, -keyRef INTEGER(0..255) -} -SubRq::= SEQUENCE { -attributeId INTEGER(0..127,...), -value INTEGER -} --- NOTE: The following are the definitions of EFC attributes -CO2EmissionValue ::= Int2 -ContractSerialNumber ::= Int4 -ContractAuthenticator ::= OCTET STRING -ContractValidity ::= SEQUENCE { -contractRestrictions OCTET STRING (SIZE(4)), -contractExpiryDate DateCompact -} -- intended to support ISO/TR 1998 implemented systems -ContractVehicle ::= LPN -DateCompact::= SEQUENCE { -year INTEGER (1990..2117), -month INTEGER (0..12), -- Value zero shall not be used --- except with 1990 - see below. -day INTEGER (0..31) -- Value zero shall not be used --- except with 1990 � see below. -} --- The value "{year 1990, month 0, day 0}" is a 16-bit all-zero --- encoding, and is used to represent "no date". -DescriptiveCharacteristics ::= INTEGER { -noEntry (0), -vehicleShape1 (1), -vehicleShape2 (2), -vehicleShape3 (3), -vehicleShape4 (4), -vehicleShape5 (5), -vehicleShape6 (6), -vehicleShape7 (7), -vehicleShape8 (8), -vehicleShape9 (9), -vehicleShape10 (10), -vehicleShape11 (11), -vehicleShape12 (12), -vehicleShape13 (13), -vehicleShape14 (14), -vehicleShape15 (15), -vehicleShape16 (16), -vehicleShape17 (17), -vehicleShape18 (18), -vehicleShape19 (19), -vehicleShape20 (20), -vehicleShape21 (21), -vehicleShape22 (22), -vehicleShape23 (23), -vehicleShape24 (24), -vehicleShape25 (25), -vehicleShape26 (26), -vehicleShape27 (27), -vehicleShape28 (28), -vehicleShape29 (29), -vehicleShape30 (30), -vehicleShape31 (31), -vehicleShape32 (32), -vehicleShape33 (33), -vehicleShape34 (34), -vehicleShape35 (35), -vehicleShape36 (36), -vehicleShape37 (37), -vehicleShape38 (38), -vehicleShape39 (39), -vehicleShape40 (40), -vehicleShape41 (41), -vehicleShape42 (42), -vehicleShape43 (43), -vehicleShape44 (44), -vehicleShape45 (45), -vehicleShape46 (46), -vehicleShape47 (47), -vehicleShape48 (48), -vehicleShape49 (49), -vehicleShape50 (50) --- (1..50) are reserved for future CEN use --- (51..255) are reserved for private use -} (0..255) -DieselEmissionValues::= SEQUENCE { - particulate SEQUENCE { - unitType UnitType, - value INTEGER (0..32767) - }, -absorptionCoeff Int2 } -EFC-ContextMark ::= SEQUENCE { -contractProvider Provider, -typeOfContract OCTET STRING (SIZE(2)), -contextVersion INTEGER(0..127,...) -} - -EnvironmentalCharacteristics::= SEQUENCE { - euroValue EuroValue, - copValue CopValue -} - -EuroValue::= ENUMERATED { - noEntry (0), - euro-1 (1), - euro-2 (2), - euro-3 (3), - euro-4 (4), - euro-5 (5), - euro-6 (6), - reservedForUse1 (7), - reservedForUse2 (8), - reservedForUse3 (9), - reservedForUse4 (10), - reservedForUse5 (11), - reservedForUse6 (12), - reservedForUse7 (13), - reservedForUse8 (14), - eev (15) -} -- 4 bits, EURO-Classes as defined in EC directive 88/77/EEC, annex 1 --- and in 91/542/EEC, 96/1/EC, 1999/96/EC, 2001/27/EC, regulation No 595/2009 --- and for EEV in Section 6.2.1 of Annex I in EC directive 2005/55/EC --- EUR-Class VI as defined in Regulation (EC) No 595/2009 -CopValue::= ENUMERATED { - noEntry (0), - co2class1 (1), -- below 101 g/km - co2class2 (2), -- 101 to 120 g/km - co2class3 (3), -- 121 to 140 g/km - co2class4 (4), -- 141 to 160 g/km - co2class5 (5), -- 161 to 200 g/km - co2class6 (6), -- 201 to 250 g/km - co2class7 (7), -- above 250 g/km - reservedforUse (8) -- reserved for future CEN and ISO use -} -- 4 bits, reserved for carbon dioxide pollution values as defined in --- EC directive 2003/127/EC' - -EngineCharacteristics::= INTEGER { - noEntry (0), - noEngine (1), - petrolUnleaded (2), - petrolLeaded (3), - diesel (4), - lPG (5), - battery (6), - solar (7), - hybrid (8), - hydrogen (9) - -- (10-255) are reserved for future CEN use -} (0..255) -Engine ::= SEQUENCE{ -engineCapacity Int2, -enginePower Int2 -} -EquipmentOBUId ::= OCTET STRING -EquipmentStatus ::= BIT STRING (SIZE(16)) -ExhaustEmissionValues ::= SEQUENCE { - unitType UnitType, - emissionCO INTEGER (0..32767), - emissionHC Int2, - emissionNOX Int2, - emissionHCNOX Int2 -} -FutureCharacteristics ::= INTEGER { -noEntry (0), -airSuspension (1) --- (2..255) are reserved for future CEN use -} (0..255) -ICC-Id ::= OCTET STRING -Int1 ::= INTEGER(0..255) - -Int2 ::= INTEGER(0..65535) -Int3 ::= INTEGER(0..16777215) -Int4 ::= INTEGER(0..4294967295) -LPN::= SEQUENCE { -countryCode CountryCode, -alphabetIndicator ENUMERATED { -latinAlphabetNo1 (1), -- encoded as 00 00 00'B -latinAlphabetNo2 (2), -- encoded as 00 00 01'B etc -latinAlphabetNo3 (3), -latinAlphabetNo4 (4), -latinCyrillicAlphabet (5), -latinArabicAlphabet (6), -latinGreekAlphabet (7), -latinHebrewAlphabet (8), -latinAlphabetNo5 (9), -latinAlphabetNo6 (10), -twoOctetBMP (11), -fourOctetCanonical (12), -reservedForUse1 (13), -reservedForUse2 (14), -reservedForUse3 (15), -reservedForUse4 (16), -reservedForUse5 (17), -reservedForUse6 (18), -reservedForUse7 (19), -reservedForUse8 (20), -reservedForUse9 (21), -reservedForUse10 (22), -reservedForUse11 (23), -reservedForUse12 (24), -reservedForUse13 (25), -reservedForUse14 (26), -reservedForUse15 (27), -reservedForUse16 (28), -reservedForUse17 (29), -reservedForUse18 (30), -reservedForUse19 (31), -reservedForUse20 (32), -reservedForUse21 (33) -} -- 6 bits, latinAlphabetNo1 recommended -- , --- refer to Annex E for conversion from LatinAlphabetNo 2 --- and 5 to Latin AlphabetNo1 -licencePlateNumber OCTET STRING -} -PassengerCapacity ::= SEQUENCE{ - numberOfSeats Int1, - numberOfStandingPlaces Int1 -} -PaymentFee ::= SEQUENCE { --- The fee (toll, charge or fare) which is requested by the --- service provider for the service provided or to be provided. -paymentFeeAmount Int2, --- paymentFeeAmount is the value of the fee being charged for the --- service. If no unit (payment fee unit) is specified, then --- it is known by default. -paymentFeeUnit PayUnit --- paymentFeeUnit is the unit in which the fee is expressed. -} -PaymentMeans ::= SEQUENCE { -personalAccountNumber PersonalAccountNumber, -paymentMeansExpiryDate DateCompact, -pamentMeansUsageControl OCTET STRING(SIZE(2)) --- issuer's specified restrictions, on the geographic usage --- and services allowed for the applications -} -PaymentMeansBalance ::= SignedValue -SignedValue ::= CHOICE { -positive INTEGER (0..8388607), -negative INTEGER (-8388608..-1) -} --- corresponds to a �3 octets Signed Integer�, associated with the following --- examples of line codes: --- -8'388'608 : 80 00 00'H --- -1 : FF FF FF'H --- 0 : 00 00 00'H --- 1 : 00 00 01�H --- 8'388'607 : 7F FF FF'H -PaymentMeansUnit ::= PayUnit -PaymentSecurityData ::= OCTET STRING -PayUnit ::= OCTET STRING (SIZE(2)) --- The unique designation of a Currency as defined in ISO 4217 --- using the ISO numeric binary coded decimal representation. --- The code can also express a company specific token or a --- "charging unit code" as used in the freight.unit in which --- the fee is expressed. --- Value Assignment : --- '0xxx'H Currency in main units --- '1xxx'H Currency in minor units of 10 :1 ('dime') --- '2xxx'H Currency in minor units of 100 :1 ('cents') --- '3xxx'H Currency in minor units of 1000 :1 --- '4xxx'H Currency in 'major' units / 10 --- (e.g. 10 Belgian Francs) --- '5xxx'H Currency in 'major' units / 100 --- (e.g. 100 Italian Lire) --- '6xxx'H Currency in 'major' units / 1000 --- '7xxx'H Currency in 'major' units / 10000 --- '8xxx'H Currency in 'major' units / 100000 --- where xxx is the BCD representation of "Currency" --- as defined in ISO 4217 --- '9xxx'H Tokens --- where xxx is Purse Provider specific coding. --- 'Axxx'H Charging Unit Codes, --- denoting quantification of the service provided --- (e.g. man-hours) -PersonalAccountNumber ::= OCTET STRING (SIZE(10)) --- Personal account number structure � according to ISO/IEC 7812-1 --- Issuer identifier number (�BIN�) --- Major industry identifier (MII, 1 binary coded decimal, BCD) --- 0 : reserved for future use by ISO/TC68 --- 1 : airline sector --- 2 : extended airline sector --- 3 : travel and tourism sector --- 4 : financial banking sector --- 5 : financial banking sector --- 6 : commerce and banking sector --- 7 : petrol industry sector --- 8 : telecommunication sector --- 9 : reserved for national use --- Issuer identifier (5 BCD in the second edition of ISO/IEC 7812-1) --- Account number (max 12 BCD) --- Control digit (1 BCD) --- Padding bits, set to 1'B, in order to accomplish a --- total length of 10 octets. - -Provider ::= SEQUENCE { - countryCode CountryCode, -providerIdentifier AVIAEIIssuerIdentifier -} -PurseBalance ::= SEQUENCE { --- The balance on the (electronic) purse, consisting of --- the value and the unit in which it is expressed. -purseValue SignedValue, --- The size of a balance expressed in a currency. --- This may be positive or negative. -purseUnit PayUnit -} -ReceiptContract ::= SEQUENCE { -sessionContractProvider Provider, -sessionTypeOfContract OCTET STRING(SIZE(2)), -sessionContractSerialNumber Int4 -} -ReceiptData1 ::= ReceiptData -ReceiptData2 ::= ReceiptData -ReceiptData ::= SEQUENCE { -sessionTime DateAndTime, -sessionServiceProvider Provider, -locationOfStation Int2, -sessionLocation SessionLocation, -sessionType Int1, -sessionResult ResultOp, -sessionTariffClass Int1, -sessionClaimedClass Int1, -sessionFee PaymentFee, -sessionContractProvider Provider, -sessionTypeOfContract OCTET STRING (SIZE(2)), -sessionContextVersion INTEGER (0..127,...), -receiptDataAuthenticator OCTET STRING(SIZE(4)) -} -ReceiptDistance ::= Int3 -ReceiptFinancialPart ::= SEQUENCE { -personalAccountNumber PersonalAccountNumber, -sessionPaymentFee PaymentFee, -sessionCurrentBalance PurseBalance, -receiptFinancialSerialNumber Int4 -} -ReceiptICC-Id ::= ICC-Id -ReceiptOBUId ::= OCTET STRING -ReceiptServicePart ::= SEQUENCE { -sessionTime DateAndTime, -sessionServiceProvider Provider, -stationLocation INTEGER(0..1048575), -sessionLocation BIT STRING (SIZE(8)), -typeOfSession EFC-StationType, -sessionResultOperational ResultOp, -sessionResultFinancial ResultFin -} -ReceiptServiceSerialNumber ::= Int3 -ReceiptAuthenticator ::= OCTET STRING -ReceiptText ::= OCTET STRING -ResultFin ::= OCTET STRING (SIZE(1)) --- A code designating whether a card transaction was completed successfully --- or not. Value Assignment : Hexadecimal --- Most significant 4 bits: 0 OK : --- '0x'H OK --- Most significant 4 bits > 0 Not OK : --- '1x'H Not OK, not specified further --- '2x'H Not OK, Abnormal (First or Previous) Event --- '3x'H Not OK, Contract not accepted --- '4x'H Not OK, Account or Purse not accepted --- 'x0'H not specified further --- 'x1'H Balance close to zero --- 'x2'H Balance now negative --- 'x3'H Balance Overflow --- 'x4'H Provider not accepted --- 'x5'H Authentication failure --- x6'H Vehicle Class incorrect -ResultOp ::= INTEGER { -correctTransaction (0), -- transaction correct -obeStatusNotAccepted (1), -equipmentStatusNotAccepted (2), -contractNotInWhiteList (3), --- VST contract data not in white list -contractIdentifierInBlackList (4), -contractIdentifierNotCorrect (5), --- Luhn algorithm verification failure -expiredContract (6), -- contract expired -contractRestrictionsNotFulfilled (7), -claimedVehicleCharacteristicsNotValid (8), -vehicleClassAuthenticationFailed (9), -entryVehicleClassDifferentFromExitVehicleClass (10), -entryReceiptMissing (11), -entryReceiptNotValid (12), -entryTollStationNotValid (13), -equipmentNotCertified (14), --- manufacturer or EquipClass not recognised -timeDifference (15), --- problem with the time diff of the two latest receipts -accessCredentialsNotAccepted (16), -contractAuthenticatorNotAccepted (17), -receiptAuthenticatorNotAccepted (18), -claimedVehicleCharacteristicsMissing (19), -paymentMeansNotAccepted (20), -paymentAuthenticatorNotAccepted (21), -paymentMeansInBlackList (22), -paymentMeansNotCorrect (23), --- Luhn algorithm verification failure -expiredPaymentMeans (24), --- PaymentMeans expired -paymentMeansRestrictionsNotFulfilled (25) --- (26-255) are reserved for future CEN use -} (0..255) -SessionClass ::= SEQUENCE { -sessionTariffClass Int1, -sessionClaimedClass Int1 -} -SessionLocation ::= SEQUENCE { -ascendingKilometrage BOOLEAN, -- travel direction indicator -laneCodeNumber INTEGER(0..127) -- lane code number -} -EFC-StationType ::= ENUMERATED { -unspecified (0), -closedEntryWithPayment (1), -closedEntryWithoutPayment (2), -closedTransit (3), -closedExit (4), -closedCredit (5), -mixed (6), -passage (7), -- open exit -checkpoint (8), -reload (9), -reservedForFutureCENUse1 (10), -reservedForFutureCENUse2 (11), -reservedForFutureCENUse3 (12), -reservedForFutureCENUse4 (13), -privateUse5 (14), -privateUse6 (15) -} -DateAndTime ::= SEQUENCE { -timeDate DateCompact, -timeCompact SEQUENCE { -- expresses time of the day in hours, min, and sec -hours INTEGER (0..23), -- number of hours after midnight -mins INTEGER (0..59), -- number of minutes after the hour -double-secs INTEGER (0..30) -- number of two-seconds after the minute -} --- Midnight at the start of a day cannot be represented. --- Midnight at the end of a day is represented by --- {hours 23, mins 59, double-secs 30} --- The 16 bit zero value {hours 0, mins 0, double-secs 0} --- denotes "no time" -} - -SoundLevel ::= SEQUENCE{ - soundstationary Int1, - sounddriveby Int1 -} -TrailerDetails::= SEQUENCE { -trailerType INTEGER{ -notPresent (0), -- trailer not attached or only one trailer attached, see --- VehicleAxlesNumber for more information -trailer (1), -- also known as pull-bar trailer -semitrailer (2) -- also known as articulate trailer --- (3..31) reserved for future CEN/ISO use -} (0..31), -trailerAxles TrailerAxles -} -TrailerLicencePlateNumber ::= LPN -UnitType::= ENUMERATED { - mg-km (0), - mg-kWh (1) -} -ValidityOfContract ::= SEQUENCE { -issuerRestrictions OCTET STRING (SIZE(2)), -contractExpiryDate DateCompact -} -VehicleAuthenticator ::= OCTET STRING -VehicleAxles ::= SEQUENCE { -vehicleFirstAxleHeight Int1, -vehicleAxlesNumber SEQUENCE { -tyreType ENUMERATED{ -notSpecified (0), -singleTyre (1), -- single tyre on all axles -dualTyres (2), -- dual tyres on at least one axle -reservedForUse (3) -- reserved for future CEN use -}, -numberOfAxles SEQUENCE { -trailerAxles TrailerAxles, -tractorAxles TractorAxles -} -} -} -TrailerAxles ::= INTEGER (0..7) -- number of axles of the trailer when available -TractorAxles ::= INTEGER (0..7) -- number of axles of the tractor -VehicleClass ::= Int1 -VehicleDimensions ::= SEQUENCE { - vehicleLengthOverall Int1, - vehicleHeigthOverall Int1, - vehicleWidthOverall Int1 -} -VehicleLicencePlateNumber ::= LPN -VehicleIdentificationNumber ::= CS5 -VehicleSpecificCharacteristics ::= SEQUENCE { -environmentalCharacteristics EnvironmentalCharacteristics, -engineCharacteristics EngineCharacteristics, -descriptiveCharacteristics DescriptiveCharacteristics, -futureCharacteristics FutureCharacteristics -} -VehicleTotalDistance ::= Int4 -VehicleWeightLaden ::= Int2 -VehicleCurrentMaxTrainWeight ::= Int2 -VehicleWeightLimits ::= SEQUENCE { - vehicleMaxLadenWeight Int2, - vehicleTrainMaximumWeight Int2, - vehicleWeightUnladen Int2 -} - -END diff --git a/asn1/IS/ISO_TS_14906/EfcDsrcGeneric.asn b/asn1/IS/ISO_TS_14906/EfcDsrcGeneric.asn deleted file mode 100644 index 610bb4f8..00000000 --- a/asn1/IS/ISO_TS_14906/EfcDsrcGeneric.asn +++ /dev/null @@ -1,27 +0,0 @@ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- ISO TS 14906 Generic --- --- This ASN.1 was generated: 30.08.2016 --- --- This document contains only the data element needed for the encoding of an IVI message --- as defined in ISO TS 19321(2020) --- --- Published version location: --- https://standards.iso.org/iso/14906/ed-3/en/ISO14906(2018)EfcDsrcGenericv7.asn --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -EfcDsrcGeneric {iso(1) standard(0) 14906 generic(1) version7(7)} -DEFINITIONS AUTOMATIC TAGS ::= -BEGIN - -AttributeIdList ::= SEQUENCE (SIZE(0.. 127,...)) OF INTEGER(0..127,...) - -AttributeList{Container} ::= SEQUENCE (SIZE(0..127,...)) OF Attributes{Container} - -Attributes{Container} ::= SEQUENCE { - attributeId INTEGER (0..127,...), - attributeValue Container -} - - -END \ No newline at end of file diff --git a/asn1/IS/ISO_TS_17419/CITSapplMgmtIDs.asn b/asn1/IS/ISO_TS_17419/CITSapplMgmtIDs.asn deleted file mode 100644 index edeab5bd..00000000 --- a/asn1/IS/ISO_TS_17419/CITSapplMgmtIDs.asn +++ /dev/null @@ -1,44 +0,0 @@ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- ISO TS 17419 --- --- This ASN.1 was generateds: 30.08.2016 --- --- This document contains only the data element needed for the encoding of an IVI message --- as defined in ISO TS 19321(2015) --- --- Published version location: --- http://standards.iso.org/iso/ts/17419/ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -CITSapplMgmtIDs {iso(1) standard(0) cits-applMgmt (17419) ids (1) version1 (1)} - -DEFINITIONS AUTOMATIC TAGS::=BEGIN - -IMPORTS - -; - --- End of IMPORTS - --- Types - --- Variable length data types - -VarLengthNumber::=CHOICE{ - content [0] INTEGER(0..127), -- one octet length - extension [1] Ext1 - } - -Ext1::=CHOICE{ - content [0] INTEGER(128..16511), -- two octets length - extension [1] Ext2 -} - -Ext2::=CHOICE{ - content [0] INTEGER(16512..2113663), -- three octets length - extension [1] Ext3 - } - -Ext3::=INTEGER(2113664..270549119,...) -- four and more octets length - -END diff --git a/asn1/IS/ISO_TS_19091/AddGrpC.asn b/asn1/IS/ISO_TS_19091/AddGrpC.asn deleted file mode 100644 index 1fda164b..00000000 --- a/asn1/IS/ISO_TS_19091/AddGrpC.asn +++ /dev/null @@ -1,209 +0,0 @@ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- ISO TS 19091 --- --- This ASN.1 was generated: 30.08.2016 --- --- This document contains the addendunm extensions for Addgrp-C (e.g. Europe) --- --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --- --- module: AddGrpC --- ISO TS 19091 30.08.2016 - --- --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- - -AddGrpC { - iso (1) standard (0) signalizedIntersection (19091) profilec (2) addgrpc (0) - version2 (2) - } - - -DEFINITIONS AUTOMATIC TAGS::= BEGIN - -IMPORTS ---FIXME RGY all definitions are moved to IS-DSRC-noCircular to cut circular import loop ---DeltaTime, FuelType, IntersectionID, LaneConnectionID, LaneID, NodeOffsetPointXY, NodeSetXY, PrioritizationResponseStatus, SignalGroupID, VehicleHeight FROM DSRC { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) } -NodeOffsetPointXY, NodeSetXY, PrioritizationResponseStatus, SignalGroupID, DeltaTime, LaneID, LaneConnectionID, FuelType, VehicleHeight -FROM DSRC-REGION-noCircular { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc-reg (3) version (2) } - -Altitude, StationID, DeltaAltitude, VehicleMass FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) }; - - -ConnectionManeuverAssist-addGrpC ::= SEQUENCE { - itsStationPosition ItsStationPositionList OPTIONAL, - ... -} - -ConnectionTrajectory-addGrpC ::= SEQUENCE { - nodes NodeSetXY, - connectionID LaneConnectionID, - ... -} - -IntersectionState-addGrpC ::= SEQUENCE { - activePrioritizations PrioritizationResponseList OPTIONAL, - ... -} - -LaneAttributes-addGrpC ::= SEQUENCE { - maxVehicleHeight VehicleHeight OPTIONAL, - maxVehicleWeight VehicleMass OPTIONAL, - ... -} -MapData-addGrpC ::= SEQUENCE { - signalHeadLocations SignalHeadLocationList OPTIONAL, - ... -} - -MovementEvent-addGrpC ::= SEQUENCE { - stateChangeReason ExceptionalCondition OPTIONAL, - ... -} - -/*FIXME RGY moved to AddGrpC-noCircular to cut circular import loop -NodeAttributeSet-addGrpC ::= SEQUENCE { - ptvRequest PtvRequestType OPTIONAL, - nodeLink NodeLink OPTIONAL, - node Node OPTIONAL, - ... -} -*/ - - -Position3D-addGrpC ::= SEQUENCE { - altitude Altitude, - ... -} - -RestrictionUserType-addGrpC ::= SEQUENCE { - emission EmissionType OPTIONAL, - fuel FuelType OPTIONAL, - ... -} - -RequestorDescription-addGrpC ::= SEQUENCE { - fuel FuelType OPTIONAL, - batteryStatus BatteryStatus OPTIONAL, - ... -} - -SignalStatusPackage-addGrpC ::= SEQUENCE { - synchToSchedule DeltaTime OPTIONAL, - rejectedReason RejectedReason OPTIONAL, - ... -} - - --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- Data frames --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -ItsStationPosition ::= SEQUENCE { - stationID StationID, - laneID LaneID OPTIONAL, - nodeXY NodeOffsetPointXY OPTIONAL, - timeReference TimeReference OPTIONAL, - ... -} - -ItsStationPositionList ::= SEQUENCE SIZE(1..5) OF ItsStationPosition - -/*FIXME YGA Moved to DSRC-REGION_noCircular to cut circular import loop -Node ::= SEQUENCE { - id INTEGER, - lane LaneID OPTIONAL, - connectionID LaneConnectionID OPTIONAL, - intersectionID IntersectionID OPTIONAL, - ... -} - -NodeLink ::= SEQUENCE SIZE (1..5) OF Node -*/ - -PrioritizationResponse ::= SEQUENCE { - stationID StationID, - priorState PrioritizationResponseStatus, - signalGroup SignalGroupID, - ... -} - -PrioritizationResponseList ::= SEQUENCE SIZE(1..10) OF PrioritizationResponse - -SignalHeadLocation ::= SEQUENCE { - nodeXY NodeOffsetPointXY, - nodeZ DeltaAltitude, - signalGroupID SignalGroupID, - ... -} - -SignalHeadLocationList ::= SEQUENCE (SIZE(1..64)) OF SignalHeadLocation - - --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- Data elements --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -BatteryStatus ::= ENUMERATED { - unknown, - critical, - low, - good, - ... -} - -EmissionType ::= ENUMERATED { - euro1, - euro2, - euro3, - euro4, - euro5, - euro6, - ... -} - -ExceptionalCondition ::= ENUMERATED { - unknown, - publicTransportPriority, - emergencyVehiclePriority, - trainPriority, - bridgeOpen, - vehicleHeight, - weather, - trafficJam, - tunnelClosure, - meteringActive, - truckPriority, - bicyclePlatoonPriority, - vehiclePlatoonPriority, - ... -} - -/*FIXME RGY moved to AddGrpC-noCircular to cut circular import loop -PtvRequestType ::= ENUMERATED { - preRequest, - mainRequest, - doorCloseRequest, - cancelRequest, - emergencyRequest, - ... -} -*/ - -RejectedReason ::= ENUMERATED { - unknown, - exceptionalCondition, - maxWaitingTimeExceeded, - ptPriorityDisabled, - higherPTPriorityGranted, - vehicleTrackingUnknown, - ... -} - -TimeReference ::= INTEGER { oneMilliSec(1) } (0..60000) - - - -END diff --git a/asn1/IS/ISO_TS_19091/AddGrpC_noCircular.asn b/asn1/IS/ISO_TS_19091/AddGrpC_noCircular.asn deleted file mode 100644 index 0ffbe694..00000000 --- a/asn1/IS/ISO_TS_19091/AddGrpC_noCircular.asn +++ /dev/null @@ -1,33 +0,0 @@ ---FIXME RGY moved here from file SPAT_MAP_ISO_TS_19091.asn - --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --- --- module: AddGrpC --- ISO TS 19091 30.08.2016 --- --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- ---FIXME RGY definitions are moved here from AddGrpC; created to cut circular import loops amongst ASN.1 files -AddGrpC-noCircular { iso (1) standard (0) signalizedIntersection (19091) profilec(2) addgrpc (1) version (1) } - - -DEFINITIONS AUTOMATIC TAGS::= BEGIN -IMPORTS -PtvRequestType -FROM DSRC-REGION-noCircular { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc-reg (3) version (2) } -; - -Control-addGrpC ::= SEQUENCE { - ptvRequest PtvRequestType, - ... -} -/* -PtvRequestType ::= ENUMERATED { - preRequest, - mainRequest, - doorCloseRequest, - cancelRequest, - emergencyRequest, - ... -} -*/ -END diff --git a/asn1/IS/ISO_TS_19091/DSRC.asn b/asn1/IS/ISO_TS_19091/DSRC.asn deleted file mode 100644 index c071c86d..00000000 --- a/asn1/IS/ISO_TS_19091/DSRC.asn +++ /dev/null @@ -1,1317 +0,0 @@ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- ISO TS 19091 --- --- This ASN.1 was generated: 30.08.2016 --- --- This document contains the data element needed for the encoding the SPAT, MapData, SignalRequestMessage, SignalStatusMessage message --- as defined in ISO TS 19091 and SAEJ2735 --- --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --- --- module: DSRC --- --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- - -DSRC { - iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) -} - -DEFINITIONS AUTOMATIC TAGS::= BEGIN - -IMPORTS ---FIXME RGY definitions moved to module DSRC-REGION-noCircular are commented our below -Reg-SPAT,Reg-SignalRequestMessage, Reg-SignalStatusMessage, Reg-MapData, Reg-AdvisorySpeed, Reg-ComputedLane, Reg-ConnectionManeuverAssist, -Reg-GenericLane, Reg-IntersectionGeometry, Reg-IntersectionState, Reg-LaneAttributes, /*Reg-LaneDataAttribute,*/ Reg-MovementEvent, Reg-MovementState, -/*Reg-NodeAttributeSetXY, Reg-NodeOffsetPointXY,*/ Reg-Position3D, Reg-RequestorDescription, Reg-RequestorType, Reg-RestrictionUserType, Reg-RoadSegment, -Reg-SignalControlZone, Reg-SignalRequestPackage, Reg-SignalRequest, Reg-SignalStatusPackage, Reg-SignalStatus, Reg-RTCMcorrections -FROM REGION {iso (1) standard (0) signalizedIntersection (19091) profilec (2) region (1) version2 (2)} - ---FIXME RGY definitions moved to DSRC-REGION-noCircular but also refernced here are re-imported -DeltaAngle, DeltaTime, LaneID, LaneConnectionID, IntersectionID, NodeSetXY, PrioritizationResponseStatus, RegionalExtension, SignalGroupID, SpeedLimitList, -Velocity, NodeOffsetPointXY, NodeAttributeXY, Reg-LaneDataAttribute, Reg-NodeAttributeSetXY, Reg-NodeOffsetPointXY, Offset-B12, Offset-B09, Offset-B10, Node-LLmD-64b, NodeAttributeXYList -FROM DSRC-REGION-noCircular { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc-reg (3) version (2) } - -Iso3833VehicleType FROM ElectronicRegistrationIdentificationVehicleDataModule {iso(1) standard(0) iso24534 (24534) vehicleData (1) version1 (1)} - -Longitude, Latitude, StationID FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) } -; - --- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ --- --- Start of entries from table Messages... --- This table typicaly contains message entries. --- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ --- - -MessageFrame ::= SEQUENCE { - messageId MESSAGE-ID-AND-TYPE.&id({MessageTypes}), - value MESSAGE-ID-AND-TYPE.&Type({MessageTypes}{@.messageId}), - ... - } - -MESSAGE-ID-AND-TYPE ::= CLASS { - &id DSRCmsgID UNIQUE, - &Type - } WITH SYNTAX {&Type IDENTIFIED BY &id} - -MessageTypes MESSAGE-ID-AND-TYPE ::= { - { MapData IDENTIFIED BY mapData } | - { SPAT IDENTIFIED BY signalPhaseAndTimingMessage } | - { SignalRequestMessage IDENTIFIED BY signalRequestMessage } | - { SignalStatusMessage IDENTIFIED BY signalStatusMessage }, - ... -- Expansion to be used only by the SAE J2735 DSRC TC - } - - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop --- Regional extensions support -REG-EXT-ID-AND-TYPE ::= CLASS { - &id RegionId UNIQUE, - &Type - } WITH SYNTAX {&Type IDENTIFIED BY &id} - -RegionalExtension {REG-EXT-ID-AND-TYPE : Set} ::= SEQUENCE { - regionId REG-EXT-ID-AND-TYPE.&id( {Set} ), - regExtValue REG-EXT-ID-AND-TYPE.&Type( {Set}{@regionId} ) - } -*/ - -MapData ::= SEQUENCE { - timeStamp MinuteOfTheYear OPTIONAL, - msgIssueRevision MsgCount, - layerType LayerType OPTIONAL, - layerID LayerID OPTIONAL, - intersections IntersectionGeometryList OPTIONAL, - roadSegments RoadSegmentList OPTIONAL, - dataParameters DataParameters OPTIONAL, - restrictionList RestrictionClassList OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-MapData}} OPTIONAL, - ... -} - -RTCMcorrections ::= SEQUENCE { - msgCnt MsgCount, - rev RTCM-Revision, - timeStamp MinuteOfTheYear OPTIONAL, - anchorPoint FullPositionVector OPTIONAL, - rtcmHeader RTCMheader OPTIONAL, - msgs RTCMmessageList, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-RTCMcorrections}} OPTIONAL, - ... -} - -SPAT ::= SEQUENCE { - timeStamp MinuteOfTheYear OPTIONAL, - name DescriptiveName OPTIONAL, - intersections IntersectionStateList, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SPAT}} OPTIONAL, - ... - } - -SignalRequestMessage ::= SEQUENCE { - timeStamp MinuteOfTheYear OPTIONAL, - second DSecond, - sequenceNumber MsgCount OPTIONAL, - - requests SignalRequestList OPTIONAL, - requestor RequestorDescription, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalRequestMessage}} OPTIONAL, - ... -} - -SignalStatusMessage ::= SEQUENCE { - timeStamp MinuteOfTheYear OPTIONAL, - second DSecond, - sequenceNumber MsgCount OPTIONAL, - status SignalStatusList, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalStatusMessage}} OPTIONAL, - ... -} - - - - --- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ --- Start of entries from table Data_Frames... --- Data frames --- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ - -AdvisorySpeed ::= SEQUENCE { - type AdvisorySpeedType, - speed SpeedAdvice OPTIONAL, - confidence SpeedConfidenceDSRC OPTIONAL, - distance ZoneLength OPTIONAL, - class RestrictionClassID OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-AdvisorySpeed}} OPTIONAL, - ... - } - -AdvisorySpeedList ::= SEQUENCE (SIZE(1..16)) OF AdvisorySpeed - -AntennaOffsetSet ::= SEQUENCE { - antOffsetX Offset-B12, - antOffsetY Offset-B09, - antOffsetZ Offset-B10 - } - -ComputedLane ::= SEQUENCE { - referenceLaneId LaneID, - offsetXaxis CHOICE { - small DrivenLineOffsetSm, - large DrivenLineOffsetLg - }, - offsetYaxis CHOICE { - small DrivenLineOffsetSm, - large DrivenLineOffsetLg - }, - rotateXY Angle OPTIONAL, - scaleXaxis Scale-B12 OPTIONAL, - scaleYaxis Scale-B12 OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-ComputedLane}} OPTIONAL, - ... - } -ConnectsToList ::= SEQUENCE (SIZE(1..16)) OF Connection - -ConnectingLane ::= SEQUENCE { - lane LaneID, - maneuver AllowedManeuvers OPTIONAL - } - - -Connection ::= SEQUENCE { - connectingLane ConnectingLane, - remoteIntersection IntersectionReferenceID OPTIONAL, - signalGroup SignalGroupID OPTIONAL, - userClass RestrictionClassID OPTIONAL, - connectionID LaneConnectionID OPTIONAL - } - - -ConnectionManeuverAssist ::= SEQUENCE { - connectionID LaneConnectionID, - queueLength ZoneLength OPTIONAL, - availableStorageLength ZoneLength OPTIONAL, - waitOnStop WaitOnStopline OPTIONAL, - pedBicycleDetect PedestrianBicycleDetect OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-ConnectionManeuverAssist}} OPTIONAL, - ... - } - -DataParameters ::= SEQUENCE { - processMethod IA5String(SIZE(1..255)) OPTIONAL, - processAgency IA5String(SIZE(1..255)) OPTIONAL, - lastCheckedDate IA5String(SIZE(1..255)) OPTIONAL, - geoidUsed IA5String(SIZE(1..255)) OPTIONAL, - ... - } - - -DDateTime ::= SEQUENCE { - year DYear OPTIONAL, - month DMonth OPTIONAL, - day DDay OPTIONAL, - hour DHour OPTIONAL, - minute DMinute OPTIONAL, - second DSecond OPTIONAL, - offset DOffset OPTIONAL - } - -EnabledLaneList ::= SEQUENCE (SIZE(1..16)) OF LaneID - -FullPositionVector ::= SEQUENCE { - utcTime DDateTime OPTIONAL, -- time with mSec precision - long Longitude, - lat Latitude, - elevation Elevation OPTIONAL, - heading HeadingDSRC OPTIONAL, - speed TransmissionAndSpeed OPTIONAL, - posAccuracy PositionalAccuracy OPTIONAL, - timeConfidence TimeConfidence OPTIONAL, - posConfidence PositionConfidenceSet OPTIONAL, - speedConfidence SpeedandHeadingandThrottleConfidence OPTIONAL, - ... - } - - -GenericLane ::= SEQUENCE { - laneID LaneID, - name DescriptiveName OPTIONAL, - ingressApproach ApproachID OPTIONAL, - egressApproach ApproachID OPTIONAL, - laneAttributes LaneAttributes, - maneuvers AllowedManeuvers OPTIONAL, - nodeList NodeListXY, - connectsTo ConnectsToList OPTIONAL, - overlays OverlayLaneList OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-GenericLane}} OPTIONAL, - ... - } - -IntersectionAccessPoint ::= CHOICE { - lane LaneID, - approach ApproachID, - connection LaneConnectionID, - ... - } - -IntersectionGeometry ::= SEQUENCE { - name DescriptiveName OPTIONAL, - id IntersectionReferenceID, - revision MsgCount, - refPoint Position3D, - laneWidth LaneWidth OPTIONAL, - speedLimits SpeedLimitList OPTIONAL, - laneSet LaneList, - preemptPriorityData PreemptPriorityList OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-IntersectionGeometry}} OPTIONAL, - ... - } - -IntersectionGeometryList ::= SEQUENCE (SIZE(1..32)) OF IntersectionGeometry - -IntersectionReferenceID ::= SEQUENCE { - region RoadRegulatorID OPTIONAL, - id IntersectionID - } - -IntersectionState ::= SEQUENCE { - name DescriptiveName OPTIONAL, - id IntersectionReferenceID, - revision MsgCount, - status IntersectionStatusObject, - moy MinuteOfTheYear OPTIONAL, - timeStamp DSecond OPTIONAL, - enabledLanes EnabledLaneList OPTIONAL, - states MovementList, - maneuverAssistList ManeuverAssistList OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-IntersectionState}} OPTIONAL, - ... - } - -IntersectionStateList ::= SEQUENCE (SIZE(1..32)) OF IntersectionState - -LaneAttributes ::= SEQUENCE { - directionalUse LaneDirection, - sharedWith LaneSharing, - laneType LaneTypeAttributes, - regional RegionalExtension {{Reg-LaneAttributes}} OPTIONAL - } - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -LaneDataAttribute ::= CHOICE { - pathEndPointAngle DeltaAngle, - laneCrownPointCenter RoadwayCrownAngle, - laneCrownPointLeft RoadwayCrownAngle, - laneCrownPointRight RoadwayCrownAngle, - laneAngle MergeDivergeNodeAngle, - speedLimits SpeedLimitList, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-LaneDataAttribute}}, - ... - } - -LaneDataAttributeList ::= SEQUENCE (SIZE(1..8)) OF LaneDataAttribute -*/ - -LaneList ::= SEQUENCE (SIZE(1..255)) OF GenericLane - -LaneSharing ::= BIT STRING { - overlappingLaneDescriptionProvided (0), - multipleLanesTreatedAsOneLane (1), - otherNonMotorizedTrafficTypes (2), - individualMotorizedVehicleTraffic (3), - busVehicleTraffic (4), - taxiVehicleTraffic (5), - pedestriansTraffic (6), - cyclistVehicleTraffic (7), - trackedVehicleTraffic (8), - pedestrianTraffic (9) - } (SIZE (10)) - -LaneTypeAttributes ::= CHOICE { - vehicle LaneAttributes-Vehicle, - crosswalk LaneAttributes-Crosswalk, - bikeLane LaneAttributes-Bike, - sidewalk LaneAttributes-Sidewalk, - median LaneAttributes-Barrier, - striping LaneAttributes-Striping, - trackedVehicle LaneAttributes-TrackedVehicle, - parking LaneAttributes-Parking, - ... - } - -ManeuverAssistList ::= SEQUENCE (SIZE(1..16)) OF ConnectionManeuverAssist - -MovementEvent ::= SEQUENCE { - eventState MovementPhaseState, - timing TimeChangeDetails OPTIONAL, - speeds AdvisorySpeedList OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-MovementEvent}} OPTIONAL, - ... - } - -MovementEventList ::= SEQUENCE (SIZE(1..16)) OF MovementEvent - -MovementList ::= SEQUENCE (SIZE(1..255)) OF MovementState - -MovementState ::= SEQUENCE { - movementName DescriptiveName OPTIONAL, - signalGroup SignalGroupID, - state-time-speed MovementEventList, - maneuverAssistList ManeuverAssistList OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-MovementState}} OPTIONAL, - ... - } - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -NodeAttributeSetXY ::= SEQUENCE { - localNode NodeAttributeXYList OPTIONAL, - disabled SegmentAttributeXYList OPTIONAL, - enabled SegmentAttributeXYList OPTIONAL, - data LaneDataAttributeList OPTIONAL, - dWidth Offset-B10 OPTIONAL, - dElevation Offset-B10 OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-NodeAttributeSetXY}} OPTIONAL, - ... - } - -NodeAttributeXY ::= ENUMERATED { - reserved, - stopLine, - roundedCapStyleA, - roundedCapStyleB, - mergePoint, - divergePoint, - downstreamStopLine, - downstreamStartNode, - closedToTraffic, - safeIsland, - curbPresentAtStepOff, - hydrantPresent, - ... - } - -NodeAttributeXYList ::= SEQUENCE (SIZE(1..8)) OF NodeAttributeXY - -FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -Node-LLmD-64b ::= SEQUENCE { - lon Longitude, - lat Latitude - } - - - Node-XY-20b ::= SEQUENCE { - x Offset-B10, - y Offset-B10 - } - -Node-XY-22b ::= SEQUENCE { - x Offset-B11, - y Offset-B11 - } - - -Node-XY-24b ::= SEQUENCE { - x Offset-B12, - y Offset-B12 - } - - -Node-XY-26b ::= SEQUENCE { - x Offset-B13, - y Offset-B13 - } - - -Node-XY-28b ::= SEQUENCE { - x Offset-B14, - y Offset-B14 - } - - -Node-XY-32b ::= SEQUENCE { - x Offset-B16, - y Offset-B16 - } -*/ - -NodeListXY ::= CHOICE { - nodes NodeSetXY, - computed ComputedLane, - ... - } - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -NodeOffsetPointXY ::= CHOICE { - node-XY1 Node-XY-20b, - node-XY2 Node-XY-22b, - node-XY3 Node-XY-24b, - node-XY4 Node-XY-26b, - node-XY5 Node-XY-28b, - node-XY6 Node-XY-32b, - node-LatLon Node-LLmD-64b, - regional RegionalExtension {{Reg-NodeOffsetPointXY}} - } - -NodeXY ::= SEQUENCE { - delta NodeOffsetPointXY, - attributes NodeAttributeSetXY OPTIONAL, - ... -} - -NodeSetXY ::= SEQUENCE (SIZE(2..63)) OF NodeXY -*/ - -OverlayLaneList ::= SEQUENCE (SIZE(1..5)) OF LaneID - -PositionalAccuracy ::= SEQUENCE { - semiMajor SemiMajorAxisAccuracy, - semiMinor SemiMinorAxisAccuracy, - orientation SemiMajorAxisOrientation -} - -PositionConfidenceSet ::= SEQUENCE { - pos PositionConfidence, -- for both horizontal directions - elevation ElevationConfidence - } - - -Position3D ::= SEQUENCE { - lat Latitude, - long Longitude, - elevation Elevation OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-Position3D}} OPTIONAL, - ... - } - -PreemptPriorityList ::= SEQUENCE (SIZE(1..32)) OF SignalControlZone - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -RegulatorySpeedLimit ::= SEQUENCE { - type SpeedLimitType, - speed Velocity - } -*/ - -RequestorDescription ::= SEQUENCE { - id VehicleID, - type RequestorType OPTIONAL, - position RequestorPositionVector OPTIONAL, - name DescriptiveName OPTIONAL, - routeName DescriptiveName OPTIONAL, - transitStatus TransitVehicleStatus OPTIONAL, - transitOccupancy TransitVehicleOccupancy OPTIONAL, - transitSchedule DeltaTime OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-RequestorDescription}} OPTIONAL, - ... - } - -RequestorPositionVector ::= SEQUENCE { - position Position3D, - heading Angle OPTIONAL, - speed TransmissionAndSpeed OPTIONAL, - ... - } - -RequestorType ::= SEQUENCE { - role BasicVehicleRole, - subrole RequestSubRole OPTIONAL, - request RequestImportanceLevel OPTIONAL, - iso3883 Iso3833VehicleType OPTIONAL, - hpmsType VehicleType OPTIONAL, - regional RegionalExtension {{Reg-RequestorType}} OPTIONAL, - ... - } - -RestrictionClassAssignment ::= SEQUENCE { - id RestrictionClassID, - users RestrictionUserTypeList - } - -RestrictionClassList ::= SEQUENCE (SIZE(1..254)) OF RestrictionClassAssignment - -RestrictionUserType ::= CHOICE { - basicType RestrictionAppliesTo, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-RestrictionUserType}}, - ... - } - -RestrictionUserTypeList ::= SEQUENCE (SIZE(1..16)) OF RestrictionUserType - -RoadLaneSetList ::= SEQUENCE (SIZE(1..255)) OF GenericLane - -RoadSegmentReferenceID ::= SEQUENCE { - region RoadRegulatorID OPTIONAL, - id RoadSegmentID - } - -RoadSegment ::= SEQUENCE { - name DescriptiveName OPTIONAL, - id RoadSegmentReferenceID, - revision MsgCount, - refPoint Position3D, - laneWidth LaneWidth OPTIONAL, - speedLimits SpeedLimitList OPTIONAL, - roadLaneSet RoadLaneSetList, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-RoadSegment}} OPTIONAL, - ... - } - -RoadSegmentList ::= SEQUENCE (SIZE(1..32)) OF RoadSegment - -RTCMheader ::= SEQUENCE { - status GNSSstatus, - offsetSet AntennaOffsetSet - } - -RTCMmessageList ::= SEQUENCE (SIZE(1..5)) OF RTCMmessage - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -SegmentAttributeXYList ::= SEQUENCE (SIZE(1..8)) OF SegmentAttributeXY -*/ - -SignalControlZone ::= SEQUENCE { - zone RegionalExtension {{Reg-SignalControlZone}}, - ... - } - -SignalRequesterInfo ::= SEQUENCE { - id VehicleID, - request RequestID, - sequenceNumber MsgCount, - role BasicVehicleRole OPTIONAL, - typeData RequestorType OPTIONAL, - ... -} - -SignalRequest ::= SEQUENCE { - id IntersectionReferenceID, - requestID RequestID, - requestType PriorityRequestType, - inBoundLane IntersectionAccessPoint, - outBoundLane IntersectionAccessPoint OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalRequest}} OPTIONAL, - ... - } - -SignalRequestList ::= SEQUENCE (SIZE(1..32)) OF SignalRequestPackage - -SignalRequestPackage ::= SEQUENCE { - request SignalRequest, - minute MinuteOfTheYear OPTIONAL, - second DSecond OPTIONAL, - duration DSecond OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalRequestPackage}} OPTIONAL, - ... - } - -SignalStatus ::= SEQUENCE { - sequenceNumber MsgCount, - id IntersectionReferenceID, - sigStatus SignalStatusPackageList, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalStatus}} OPTIONAL, - ... - } - -SignalStatusList ::= SEQUENCE (SIZE(1..32)) OF SignalStatus - -SignalStatusPackageList ::= SEQUENCE (SIZE(1..32)) OF SignalStatusPackage - -SignalStatusPackage ::= SEQUENCE { - requester SignalRequesterInfo OPTIONAL, - inboundOn IntersectionAccessPoint, - outboundOn IntersectionAccessPoint OPTIONAL, - - minute MinuteOfTheYear OPTIONAL, - second DSecond OPTIONAL, - duration DSecond OPTIONAL, - status PrioritizationResponseStatus, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalStatusPackage}} OPTIONAL, - ... - } - -SpeedandHeadingandThrottleConfidence ::= SEQUENCE { - heading HeadingConfidenceDSRC, - speed SpeedConfidenceDSRC, - throttle ThrottleConfidence - } - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -SpeedLimitList ::= SEQUENCE (SIZE(1..9)) OF RegulatorySpeedLimit - -SpeedLimitType ::= ENUMERATED { - unknown, - maxSpeedInSchoolZone, - maxSpeedInSchoolZoneWhenChildrenArePresent, - maxSpeedInConstructionZone, - vehicleMinSpeed, - vehicleMaxSpeed, - vehicleNightMaxSpeed, - - truckMinSpeed, - truckMaxSpeed, - truckNightMaxSpeed, - - vehiclesWithTrailersMinSpeed, - vehiclesWithTrailersMaxSpeed, - vehiclesWithTrailersNightMaxSpeed, - ... - } -*/ - -TimeChangeDetails ::= SEQUENCE { - startTime TimeMark OPTIONAL, - minEndTime TimeMark, - maxEndTime TimeMark OPTIONAL, - likelyTime TimeMark OPTIONAL, - confidence TimeIntervalConfidence OPTIONAL, - nextTime TimeMark OPTIONAL - } - -TimeMark ::= INTEGER (0..36001) - -TransmissionAndSpeed ::= SEQUENCE { - transmisson TransmissionState, - speed Velocity - } - -VehicleID ::= CHOICE { - entityID TemporaryID, - stationID StationID - } - - --- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ --- data elements --- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ - -AdvisorySpeedType ::= ENUMERATED { - none (0), - greenwave (1), - ecoDrive (2), - transit (3), - ... -} - -AllowedManeuvers ::= BIT STRING { - maneuverStraightAllowed (0), - maneuverLeftAllowed (1), - maneuverRightAllowed (2), - maneuverUTurnAllowed (3), - maneuverLeftTurnOnRedAllowed (4), - maneuverRightTurnOnRedAllowed (5), - maneuverLaneChangeAllowed (6), - maneuverNoStoppingAllowed (7), - yieldAllwaysRequired (8), - goWithHalt (9), - caution (10), - reserved1 (11) - } (SIZE(12)) - -Angle ::= INTEGER (0..28800) - -ApproachID ::= INTEGER (0..15) - -BasicVehicleRole ::= ENUMERATED { - basicVehicle (0), - publicTransport (1), - specialTransport (2), - dangerousGoods (3), - roadWork (4), - roadRescue (5), - emergency (6), - safetyCar (7), - none-unknown (8), - truck (9), - motorcycle (10), - roadSideSource (11), - police (12), - fire (13), - ambulance (14), - dot (15), - transit (16), - slowMoving (17), - stopNgo (18), - cyclist (19), - pedestrian (20), - nonMotorized (21), - military (22), - ... - } - -DDay ::= INTEGER (0..31) - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -DeltaAngle ::= INTEGER (-150..150) - -DeltaTime ::= INTEGER (-122 .. 121) -*/ - -DescriptiveName ::= IA5String (SIZE(1..63)) - -DHour ::= INTEGER (0..31) - -DMinute ::= INTEGER (0..60) - -DMonth ::= INTEGER (0..12) - -DOffset ::= INTEGER (-840..840) - -DrivenLineOffsetLg ::= INTEGER (-32767..32767) - -DrivenLineOffsetSm ::= INTEGER (-2047..2047) - -DSecond ::= INTEGER (0..65535) - -DSRCmsgID ::= INTEGER (0..32767) - mapData DSRCmsgID ::= 18 - rtcmCorrections DSRCmsgID ::= 28 - signalPhaseAndTimingMessage DSRCmsgID ::= 19 - signalRequestMessage DSRCmsgID ::= 29 - signalStatusMessage DSRCmsgID ::= 30 - -DYear ::= INTEGER (0..4095) - -Elevation ::= INTEGER (-4096..61439) - -ElevationConfidence ::= ENUMERATED { - unavailable (0), - elev-500-00 (1), - elev-200-00 (2), - elev-100-00 (3), - elev-050-00 (4), - elev-020-00 (5), - elev-010-00 (6), - elev-005-00 (7), - elev-002-00 (8), - elev-001-00 (9), - elev-000-50 (10), - elev-000-20 (11), - elev-000-10 (12), - elev-000-05 (13), - elev-000-02 (14), - elev-000-01 (15) - } - - -GNSSstatus ::= BIT STRING { - unavailable (0), - isHealthy (1), - isMonitored (2), - baseStationType (3), - aPDOPofUnder5 (4), - inViewOfUnder5 (5), - localCorrectionsPresent (6), - networkCorrectionsPresent (7) - } (SIZE(8)) - -HeadingConfidenceDSRC ::= ENUMERATED { - unavailable (0), - prec10deg (1), - prec05deg (2), - prec01deg (3), - prec0-1deg (4), - prec0-05deg (5), - prec0-01deg (6), - prec0-0125deg (7) - } - -HeadingDSRC ::= INTEGER (0..28800) - -IntersectionStatusObject ::= BIT STRING { - manualControlIsEnabled (0), - stopTimeIsActivated (1), - failureFlash (2), - preemptIsActive (3), - signalPriorityIsActive (4), - fixedTimeOperation (5), - trafficDependentOperation (6), - standbyOperation (7), - failureMode (8), - off (9), - recentMAPmessageUpdate (10), - recentChangeInMAPassignedLanesIDsUsed (11), - noValidMAPisAvailableAtThisTime (12), - noValidSPATisAvailableAtThisTime (13) - } (SIZE(16)) - - -LaneAttributes-Barrier ::= BIT STRING { - median-RevocableLane (0), - median (1), - whiteLineHashing (2), - stripedLines (3), - doubleStripedLines (4), - trafficCones (5), - constructionBarrier (6), - trafficChannels (7), - lowCurbs (8), - highCurbs (9) - } (SIZE (16)) - -LaneAttributes-Bike ::= BIT STRING { - bikeRevocableLane (0), - pedestrianUseAllowed (1), - isBikeFlyOverLane (2), - fixedCycleTime (3), - biDirectionalCycleTimes (4), - isolatedByBarrier (5), - unsignalizedSegmentsPresent (6) - } (SIZE (16)) - -LaneAttributes-Crosswalk ::= BIT STRING { - crosswalkRevocableLane (0), - bicyleUseAllowed (1), - isXwalkFlyOverLane (2), - fixedCycleTime (3), - biDirectionalCycleTimes (4), - hasPushToWalkButton (5), - audioSupport (6), - rfSignalRequestPresent (7), - unsignalizedSegmentsPresent (8) - } (SIZE (16)) - -LaneAttributes-Parking ::= BIT STRING { - parkingRevocableLane (0), - parallelParkingInUse (1), - headInParkingInUse (2), - doNotParkZone (3), - parkingForBusUse (4), - parkingForTaxiUse (5), - noPublicParkingUse (6) - } (SIZE (16)) - -LaneAttributes-Sidewalk ::= BIT STRING { - sidewalk-RevocableLane (0), - bicyleUseAllowed (1), - isSidewalkFlyOverLane (2), - walkBikes (3) - } (SIZE (16)) - - -LaneAttributes-Striping ::= BIT STRING { - stripeToConnectingLanesRevocableLane (0), - stripeDrawOnLeft (1), - stripeDrawOnRight (2), - stripeToConnectingLanesLeft (3), - stripeToConnectingLanesRight (4), - stripeToConnectingLanesAhead (5) - } (SIZE (16)) - - -LaneAttributes-TrackedVehicle ::= BIT STRING { - spec-RevocableLane (0), - spec-commuterRailRoadTrack (1), - spec-lightRailRoadTrack (2), - spec-heavyRailRoadTrack (3), - spec-otherRailType (4) - } (SIZE (16)) - - -LaneAttributes-Vehicle ::= BIT STRING { - isVehicleRevocableLane (0), - isVehicleFlyOverLane (1), - hovLaneUseOnly (2), - restrictedToBusUse (3), - restrictedToTaxiUse (4), - restrictedFromPublicUse (5), - hasIRbeaconCoverage (6), - permissionOnRequest (7) - } (SIZE (8,...)) - -LaneDirection ::= BIT STRING { - ingressPath (0), - egressPath (1) - } (SIZE (2)) - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -LaneID ::= INTEGER (0..255) -*/ - -LayerID ::= INTEGER (0..100) - -LayerType ::= ENUMERATED { - none, - mixedContent, - generalMapData, - intersectionData, - curveData, - roadwaySectionData, - parkingAreaData, - sharedLaneData, - ... - } - -LaneWidth ::= INTEGER (0..32767) - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -MergeDivergeNodeAngle ::= INTEGER (-180..180) -*/ - -MinuteOfTheYear ::= INTEGER (0..527040) - -MovementPhaseState ::= ENUMERATED { - unavailable (0), - dark (1), - stop-Then-Proceed (2), - stop-And-Remain (3), - pre-Movement (4), - permissive-Movement-Allowed (5), - protected-Movement-Allowed (6), - permissive-clearance (7), - protected-clearance (8), - caution-Conflicting-Traffic (9) - } - -MsgCount ::= INTEGER (0..127) - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -Offset-B10 ::= INTEGER (-512..511) - -Offset-B11 ::= INTEGER (-1024..1023) - -Offset-B12 ::= INTEGER (-2048..2047) - -Offset-B13 ::= INTEGER (-4096..4095) - -Offset-B14 ::= INTEGER (-8192..8191) - -Offset-B16 ::= INTEGER (-32768..32767) -*/ - -PedestrianBicycleDetect ::= BOOLEAN - -PositionConfidence ::= ENUMERATED { - unavailable (0), - a500m (1), - a200m (2), - a100m (3), - a50m (4), - a20m (5), - a10m (6), - a5m (7), - a2m (8), - a1m (9), - a50cm (10), - a20cm (11), - a10cm (12), - a5cm (13), - a2cm (14), - a1cm (15) - } - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -PrioritizationResponseStatus ::= ENUMERATED { - unknown (0), - requested (1), - processing (2), - watchOtherTraffic (3), - granted (4), - rejected (5), - maxPresence (6), - reserviceLocked (7), - ... -} -*/ - -PriorityRequestType ::= ENUMERATED { - priorityRequestTypeReserved (0), - priorityRequest (1), - priorityRequestUpdate (2), - priorityCancellation (3), - ... - } - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -RegionId ::= INTEGER (0..255) - noRegion RegionId ::= 0 - addGrpA RegionId ::= 1 - addGrpB RegionId ::= 2 - addGrpC RegionId ::= 3 -*/ - -RequestID ::= INTEGER (0..255) - -RequestImportanceLevel ::= ENUMERATED { - requestImportanceLevelUnKnown (0), - requestImportanceLevel1 (1), - requestImportanceLevel2 (2), - requestImportanceLevel3 (3), - requestImportanceLevel4 (4), - requestImportanceLevel5 (5), - requestImportanceLevel6 (6), - requestImportanceLevel7 (7), - requestImportanceLevel8 (8), - requestImportanceLevel9 (9), - requestImportanceLevel10 (10), - requestImportanceLevel11 (11), - requestImportanceLevel12 (12), - requestImportanceLevel13 (13), - requestImportanceLevel14 (14), - requestImportanceReserved (15) - } - -RequestSubRole ::= ENUMERATED { - requestSubRoleUnKnown (0), - requestSubRole1 (1), - requestSubRole2 (2), - requestSubRole3 (3), - requestSubRole4 (4), - requestSubRole5 (5), - requestSubRole6 (6), - requestSubRole7 (7), - requestSubRole8 (8), - requestSubRole9 (9), - requestSubRole10 (10), - requestSubRole11 (11), - requestSubRole12 (12), - requestSubRole13 (13), - requestSubRole14 (14), - requestSubRoleReserved (15) - } - -RestrictionAppliesTo ::= ENUMERATED { - none, - equippedTransit, - equippedTaxis, - equippedOther, - emissionCompliant, - equippedBicycle, - weightCompliant, - heightCompliant, - pedestrians, - slowMovingPersons, - wheelchairUsers, - visualDisabilities, - audioDisabilities, - otherUnknownDisabilities, - ... - } - -RestrictionClassID ::= INTEGER (0..255) - -RoadRegulatorID ::= INTEGER (0..65535) - -RoadSegmentID ::= INTEGER (0..65535) - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -RoadwayCrownAngle ::= INTEGER (-128..127) -*/ - -RTCMmessage ::= OCTET STRING (SIZE(1..1023)) - -RTCM-Revision ::= ENUMERATED { - unknown (0), - rtcmRev2 (1), -- Std 10402.x et al - rtcmRev3 (2), -- Std 10403.x et al - reserved (3), - ... -} - -Scale-B12 ::= INTEGER (-2048..2047) - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -SignalGroupID ::= INTEGER (0..255) -*/ - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -SegmentAttributeXY ::= ENUMERATED { - reserved , - doNotBlock , - whiteLine , - mergingLaneLeft , - mergingLaneRight , - curbOnLeft , - curbOnRight , - loadingzoneOnLeft , - loadingzoneOnRight , - turnOutPointOnLeft , - turnOutPointOnRight , - adjacentParkingOnLeft , - adjacentParkingOnRight , - adjacentBikeLaneOnLeft , - adjacentBikeLaneOnRight , - sharedBikeLane , - bikeBoxInFront , - transitStopOnLeft , - transitStopOnRight , - transitStopInLane , - sharedWithTrackedVehicle , - safeIsland , - lowCurbsPresent , - rumbleStripPresent , - audibleSignalingPresent , - adaptiveTimingPresent , - rfSignalRequestPresent , - partialCurbIntrusion , - taperToLeft , - taperToRight , - taperToCenterLine , - parallelParking , - headInParking , - freeParking , - timeRestrictionsOnParking , - costToPark , - midBlockCurbPresent , - unEvenPavementPresent , - ... - } -*/ - -SemiMajorAxisAccuracy ::= INTEGER (0..255) - -SemiMajorAxisOrientation ::= INTEGER (0..65535) - -SemiMinorAxisAccuracy ::= INTEGER (0..255) - -SpeedAdvice ::= INTEGER (0..500) - -SpeedConfidenceDSRC ::= ENUMERATED { - unavailable (0), -- Not Equipped or unavailable - prec100ms (1), -- 100 meters / sec - prec10ms (2), -- 10 meters / sec - prec5ms (3), -- 5 meters / sec - prec1ms (4), -- 1 meters / sec - prec0-1ms (5), -- 0.1 meters / sec - prec0-05ms (6), -- 0.05 meters / sec - prec0-01ms (7) -- 0.01 meters / sec - } - -TemporaryID ::= OCTET STRING (SIZE(4)) - -ThrottleConfidence ::= ENUMERATED { - unavailable (0), - prec10percent (1), - prec1percent (2), - prec0-5percent (3) - } - -TimeConfidence ::= ENUMERATED { - unavailable (0), - time-100-000 (1), - time-050-000 (2), - time-020-000 (3), - time-010-000 (4), - time-002-000 (5), - time-001-000 (6), - time-000-500 (7), - time-000-200 (8), - time-000-100 (9), - time-000-050 (10), - time-000-020 (11), - time-000-010 (12), - time-000-005 (13), - time-000-002 (14), - time-000-001 (15), - time-000-000-5 (16), - time-000-000-2 (17), - time-000-000-1 (18), - time-000-000-05 (19), - time-000-000-02 (20), - time-000-000-01 (21), - time-000-000-005 (22), - time-000-000-002 (23), - time-000-000-001 (24), - time-000-000-000-5 (25), - time-000-000-000-2 (26), - time-000-000-000-1 (27), - time-000-000-000-05 (28), - time-000-000-000-02 (29), - time-000-000-000-01 (30), - time-000-000-000-005 (31), - time-000-000-000-002 (32), - time-000-000-000-001 (33), - time-000-000-000-000-5 (34), - time-000-000-000-000-2 (35), - time-000-000-000-000-1 (36), - time-000-000-000-000-05 (37), - time-000-000-000-000-02 (38), - time-000-000-000-000-01 (39) -} - -TimeIntervalConfidence ::= INTEGER (0..15) - -TransitVehicleOccupancy ::= ENUMERATED { - occupancyUnknown (0), - occupancyEmpty (1), - occupancyVeryLow (2), - occupancyLow (3), - occupancyMed (4), - occupancyHigh (5), - occupancyNearlyFull (6), - occupancyFull (7) - } - -TransitVehicleStatus ::= BIT STRING { - loading (0), - anADAuse (1), - aBikeLoad (2), - doorOpen (3), - charging (4), - atStopLine (5) - } (SIZE(8)) - -TransmissionState ::= ENUMERATED { - neutral (0), - park (1), - forwardGears (2), - reverseGears (3), - reserved1 (4), - reserved2 (5), - reserved3 (6), - unavailable (7) - } - -VehicleType ::= ENUMERATED { - none (0), - unknown (1), - special (2), - moto (3), - car (4), - carOther (5), - bus (6), - axleCnt2 (7), - axleCnt3 (8), - axleCnt4 (9), - axleCnt4Trailer (10), - axleCnt5Trailer (11), - axleCnt6Trailer (12), - axleCnt5MultiTrailer (13), - axleCnt6MultiTrailer (14), - axleCnt7MultiTrailer (15), - ... - } - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -Velocity ::= INTEGER (0..8191) -*/ - -WaitOnStopline ::= BOOLEAN - -ZoneLength ::= INTEGER (0..10000) - -END diff --git a/asn1/IS/ISO_TS_19091/DSRC_REGION_noCircular.asn b/asn1/IS/ISO_TS_19091/DSRC_REGION_noCircular.asn deleted file mode 100644 index fe9c3f4f..00000000 --- a/asn1/IS/ISO_TS_19091/DSRC_REGION_noCircular.asn +++ /dev/null @@ -1,461 +0,0 @@ --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --- --- module: DSRC --- ISO TS 19091 30.08.2016 --- --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- ---FIXME RGY definitions are moved here from IS-DSRC and IS-REGION; created to cut circular import loops amongst ASN.1 files -DSRC-REGION-noCircular { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc-reg (3) version (2) } - -DEFINITIONS AUTOMATIC TAGS::= BEGIN - -IMPORTS -Longitude, Latitude FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) } - ---NodeAttributeSet-addGrpC, LaneID FROM AddGrpC-noCircular { iso (1) standard (0) signalizedIntersection (19091) profilec(2) addgrpc (0) version (1) } -; - ------------------------------------------------------- ---FIXME RGY BELOW ARE DEFINITIONS MOVED FROM DSRC ------------------------------------------------------- - -FuelType ::= INTEGER (0..15) - unknownFuel FuelType ::= 0 - gasoline FuelType ::= 1 - ethanol FuelType ::= 2 - diesel FuelType ::= 3 - electric FuelType ::= 4 - hybrid FuelType ::= 5 - hydrogen FuelType ::= 6 - natGasLiquid FuelType ::= 7 - natGasComp FuelType ::= 8 - propane FuelType ::= 9 - -VehicleHeight ::= INTEGER (0..127) - -LaneID ::= INTEGER (0..255) - -LaneConnectionID ::= INTEGER (0..255) - -IntersectionID ::= INTEGER (0..65535) - -Node ::= SEQUENCE { - id INTEGER, - lane LaneID OPTIONAL, - connectionID LaneConnectionID OPTIONAL, - intersectionID IntersectionID OPTIONAL, - ... -} - -NodeLink ::= SEQUENCE SIZE (1..5) OF Node - -NodeAttributeSet-addGrpC ::= SEQUENCE { - ptvRequest PtvRequestType OPTIONAL, - nodeLink NodeLink OPTIONAL, - node Node OPTIONAL, - ... -} - -PtvRequestType ::= ENUMERATED { - preRequest, - mainRequest, - doorCloseRequest, - cancelRequest, - emergencyRequest, - ... -} - -DeltaAngle ::= INTEGER (-150..150) - -- With an angle range from - -- negative 150 to positive 150 - -- in one degree steps where zero is directly - -- along the axis or the lane center line as defined by the - -- two closest points - -DeltaTime ::= INTEGER (-122 .. 121) - -- Supporting a range of +/- 20 minute in steps of 10 seconds - -- the value of -121 shall be used when more than -20 minutes - -- the value of +120 shall be used when more than +20 minutes - -- the value -122 shall be used when the value is unavailable - -LaneDataAttribute ::= CHOICE { - -- Segment attribute types and the data needed for each - pathEndPointAngle DeltaAngle, - -- adjusts final point/width slant - -- of the lane to align with the stop line - laneCrownPointCenter RoadwayCrownAngle, - -- sets the canter of the road bed - -- from centerline point - laneCrownPointLeft RoadwayCrownAngle, - -- sets the canter of the road bed - -- from left edge - laneCrownPointRight RoadwayCrownAngle, - -- sets the canter of the road bed - -- from right edge - laneAngle MergeDivergeNodeAngle, - -- the angle or direction of another lane - -- this is required to support Japan style - -- when a merge point angle is required - speedLimits SpeedLimitList, - -- Reference regulatory speed limits - -- used by all segments - - -- Add others as needed, in regional space - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-LaneDataAttribute}}, - ... - } - -LaneDataAttributeList ::= SEQUENCE (SIZE(1..8)) OF LaneDataAttribute - -MergeDivergeNodeAngle ::= INTEGER (-180..180) - -- In units of 1.5 degrees from north - -- the value -180 shall be used to represent - -- data is not available or unknown - -NodeOffsetPointXY ::= CHOICE { - -- Nodes with X,Y content - node-XY1 Node-XY-20b, -- node is within 5.11m of last node - node-XY2 Node-XY-22b, -- node is within 10.23m of last node - node-XY3 Node-XY-24b, -- node is within 20.47m of last node - node-XY4 Node-XY-26b, -- node is within 40.96m of last node - node-XY5 Node-XY-28b, -- node is within 81.91m of last node - node-XY6 Node-XY-32b, -- node is within 327.67m of last node - node-LatLon Node-LLmD-64b, -- node is a full 32b Lat/Lon range - regional RegionalExtension {{Reg-NodeOffsetPointXY}} - -- node which follows is of a - -- regional definition type - } - -Node-LLmD-64b ::= SEQUENCE { - lon Longitude, - lat Latitude - } - - -Node-XY-20b ::= SEQUENCE { - x Offset-B10, - y Offset-B10 - } - -Node-XY-22b ::= SEQUENCE { - x Offset-B11, - y Offset-B11 - } - - -Node-XY-24b ::= SEQUENCE { - x Offset-B12, - y Offset-B12 - } - - -Node-XY-26b ::= SEQUENCE { - x Offset-B13, - y Offset-B13 - } - - -Node-XY-28b ::= SEQUENCE { - x Offset-B14, - y Offset-B14 - } - - -Node-XY-32b ::= SEQUENCE { - x Offset-B16, - y Offset-B16 - } - -NodeSetXY ::= SEQUENCE (SIZE(2..63)) OF NodeXY - -NodeXY ::= SEQUENCE { - delta NodeOffsetPointXY, - -- A choice of which X,Y offset value to use - -- this includes various delta values as well a regional choices - attributes NodeAttributeSetXY OPTIONAL, - -- Any optional Attributes which are needed - -- This includes changes to the current lane width and elevation - ... -} - -NodeAttributeSetXY ::= SEQUENCE { - localNode NodeAttributeXYList OPTIONAL, - -- Attribute states which pertain to this node point - disabled SegmentAttributeXYList OPTIONAL, - -- Attribute states which are disabled at this node point - enabled SegmentAttributeXYList OPTIONAL, - -- Attribute states which are enabled at this node point - -- and which remain enabled until disabled or the lane ends - data LaneDataAttributeList OPTIONAL, - -- Attributes which require an additional data values - -- some of these are local to the node point, while others - -- persist with the provided values until changed - -- and this is indicated in each entry - dWidth Offset-B10 OPTIONAL, - -- A value added to the current lane width - -- at this node and from this node onwards, in 1cm steps - -- lane width between nodes are a linear taper between pts - -- the value of zero shall not be sent here - dElevation Offset-B10 OPTIONAL, - -- A value added to the current Elevation - -- at this node from this node onwards, in 10cm steps - -- elevations between nodes are a linear taper between pts - -- the value of zero shall not be sent here - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-NodeAttributeSetXY}} OPTIONAL, - ... - } - -NodeAttributeXYList ::= SEQUENCE (SIZE(1..8)) OF NodeAttributeXY - -NodeAttributeXY ::= ENUMERATED { - -- Various values which pertain only to the current node point - - -- General Items - reserved, - stopLine, -- point where a mid-path stop line exists - -- See also 'do not block' for segments - - -- Path finish details - roundedCapStyleA, -- Used to control final path rounded end shape - -- with edge of curve at final point in a circle - roundedCapStyleB, -- Used to control final path rounded end shape - -- with edge of curve extending 50% of width past - -- final point in a circle - - -- Topography Points (items with no concept of a distance along the path) - mergePoint, -- Japan merge with 1 or more lanes - divergePoint, -- Japan diverge with 1 or more lanes - downstreamStopLine, -- Japan style downstream intersection - -- (a 2nd intersection) stop line - downstreamStartNode, -- Japan style downstream intersection - -- (a 2nd intersection) start node - - -- Pedestrian Support Attributes - closedToTraffic, -- where a pedestrian may NOT go - -- to be used during construction events - safeIsland, -- a pedestrian safe stopping point - -- also called a traffic island - -- This usage described a point feature on a path, - -- other entries can describe a path - curbPresentAtStepOff, -- the sidewalk to street curb is NOT - -- angled where it meets the edge of the - -- roadway (user must step up/down) - - -- Lane geometry details (see standard for defined shapes) - hydrantPresent, -- Or other services access - ... - } - -Offset-B09 ::= INTEGER (-256..255) - -Offset-B10 ::= INTEGER (-512..511) - -- a range of +- 5.11 meters - -Offset-B11 ::= INTEGER (-1024..1023) - -- a range of +- 10.23 meters - -Offset-B12 ::= INTEGER (-2048..2047) - -- a range of +- 20.47 meters - -Offset-B13 ::= INTEGER (-4096..4095) - -- a range of +- 40.95 meters - -Offset-B14 ::= INTEGER (-8192..8191) - -- a range of +- 81.91 meters - -Offset-B16 ::= INTEGER (-32768..32767) - -- a range of +- 327.68 meters - -PrioritizationResponseStatus ::= ENUMERATED { - unknown (0), - -- Unknown state - requested (1), - -- This prioritization request was detected - -- by the traffic controller - processing (2), - -- Checking request - -- (request is in queue, other requests are prior) - watchOtherTraffic (3), - -- Cannot give full permission, - -- therefore watch for other traffic - -- Note that other requests may be present - granted (4), - -- Intervention was successful - -- and now prioritization is active - rejected (5), - -- The prioritization or preemption request was - -- rejected by the traffic controller - maxPresence (6), - -- The Request has exceeded maxPresence time - -- Used when the controller has determined that - -- the requester should then back off and - -- request an alternative. - reserviceLocked (7), - -- Prior conditions have resulted in a reservice - -- locked event: the controller requires the - -- passage of time before another similar request - -- will be accepted - ... -} - -RegionId ::= INTEGER (0..255) - noRegion RegionId ::= 0 -- Use default supplied stubs - addGrpA RegionId ::= 1 -- USA - addGrpB RegionId ::= 2 -- Japan - addGrpC RegionId ::= 3 -- EU - -- NOTE: new registered regional IDs will be added here - -- The values 128 and above are for local region use - --- Regional extensions support -REG-EXT-ID-AND-TYPE ::= CLASS { - &id RegionId UNIQUE, - &Type - } WITH SYNTAX {&Type IDENTIFIED BY &id} - -RegionalExtension {REG-EXT-ID-AND-TYPE : Set} ::= SEQUENCE { - regionId REG-EXT-ID-AND-TYPE.&id( {Set} ), - regExtValue REG-EXT-ID-AND-TYPE.&Type( {Set}{@regionId} ) - } - -RegulatorySpeedLimit ::= SEQUENCE { - type SpeedLimitType, - -- The type of regulatory speed which follows - speed Velocity - -- The speed in units of 0.02 m/s - -- See Section 11 for converting and translating - -- speed expressed in mph into units of m/s - } - -RoadwayCrownAngle ::= INTEGER (-128..127) - -- In LSB units of 0.3 degrees of angle - -- over a range of -38.1 to + 38.1 degrees - -- The value -128 shall be used for unknown - -- The value zero shall be used for angles - -- which are between -0.15 and +0.15 - - -SegmentAttributeXYList ::= SEQUENCE (SIZE(1..8)) OF SegmentAttributeXY - -SegmentAttributeXY ::= ENUMERATED { - -- Various values which can be Enabled and Disabled for a lane segment - - -- General Items - reserved , - doNotBlock , -- segment where a vehicle - -- may not come to a stop - whiteLine , -- segment where lane crossing not allowed - -- such as the final few meters of a lane - - -- Porous Lane states, merging, turn outs, parking etc. - - mergingLaneLeft , -- indicates porous lanes - mergingLaneRight , - - curbOnLeft , -- indicates presence of curbs - curbOnRight , - - loadingzoneOnLeft , -- loading or drop off zones - loadingzoneOnRight , - - turnOutPointOnLeft , -- opening to adjacent street/alley/road - turnOutPointOnRight , - - adjacentParkingOnLeft , -- side of road parking - adjacentParkingOnRight , - - -- Bike Lane Needs - adjacentBikeLaneOnLeft , -- presence of marked bike lanes - adjacentBikeLaneOnRight , - sharedBikeLane , -- right of way is shared with bikes - -- who may occupy entire lane width - bikeBoxInFront , - - -- Transit Needs - transitStopOnLeft , -- any form of bus/transit loading - -- with pull in-out access to lane on left - transitStopOnRight , -- any form of bus/transit loading - -- with pull in-out access to lane on right - transitStopInLane , -- any form of bus/transit loading - -- in mid path of the lane - sharedWithTrackedVehicle , -- lane is shared with train or trolley - -- not used for crossing tracks - - - -- Pedestrian Support Attributes - safeIsland , -- begin/end a safety island in path - lowCurbsPresent , -- for ADA support - rumbleStripPresent , -- for ADA support - audibleSignalingPresent , -- for ADA support - adaptiveTimingPresent , -- for ADA support - rfSignalRequestPresent , -- Supports RF push to walk technologies - partialCurbIntrusion , -- path is blocked by a median or curb - -- but at least 1 meter remains open for use - -- and at-grade passage - - -- Lane geometry details (see standard for defined shapes) - taperToLeft , -- Used to control final path shape - taperToRight , -- Used to control final path shape - taperToCenterLine , -- Used to control final path shape - - -- Parking Lane and Curb Attributes - parallelParking , -- - headInParking , -- Parking at an angle with the street - freeParking , -- no restriction on use of parking - timeRestrictionsOnParking , -- Parking is not permitted at all times - -- typically used when the 'parking' lane - -- becomes a driving lane at times - costToPark , -- Used where parking has a cost - midBlockCurbPresent , -- a protruding curb near lane edge - unEvenPavementPresent , -- a disjoint height at lane edge - ... - } - -SignalGroupID ::= INTEGER (0..255) - -- The value 0 shall be used when the ID is - -- not available or not known - -- the value 255 is reserved to indicate a - -- permanent green movement state - -- therefore a simple 8 phase signal controller - -- device might use 1..9 as its groupIDs - -SpeedLimitList ::= SEQUENCE (SIZE(1..9)) OF RegulatorySpeedLimit - -SpeedLimitType ::= ENUMERATED { - unknown, -- Speed limit type not available - maxSpeedInSchoolZone, -- Only sent when the limit is active - maxSpeedInSchoolZoneWhenChildrenArePresent, -- Sent at any time - maxSpeedInConstructionZone, -- Used for work zones, incident zones, etc. - -- where a reduced speed is present - vehicleMinSpeed, - vehicleMaxSpeed, -- Regulatory speed limit for general traffic - vehicleNightMaxSpeed, - - truckMinSpeed, - truckMaxSpeed, - truckNightMaxSpeed, - - vehiclesWithTrailersMinSpeed, - vehiclesWithTrailersMaxSpeed, - vehiclesWithTrailersNightMaxSpeed, - ... - } - -Velocity ::= INTEGER (0..8191) -- Units of 0.02 m/s - -- The value 8191 indicates that - -- velocity is unavailable - ------------------------------------------------------- ---FIXME RGY BELOW ARE DEFINITIONS MOVED FROM IS-REGION ------------------------------------------------------- - -Reg-LaneDataAttribute REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-NodeOffsetPointXY REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-NodeAttributeSetXY REG-EXT-ID-AND-TYPE ::= { - {NodeAttributeSet-addGrpC IDENTIFIED BY addGrpC} , - ... -} -END diff --git a/asn1/IS/ISO_TS_19091/REGION.asn b/asn1/IS/ISO_TS_19091/REGION.asn deleted file mode 100644 index 44ec2009..00000000 --- a/asn1/IS/ISO_TS_19091/REGION.asn +++ /dev/null @@ -1,130 +0,0 @@ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- ISO TS 19091 --- --- This ASN.1 was generated: 30.08.2016 --- --- This document contains the data element needed for the encoding the SPAT, MapData, SignalRequestMessage, SignalStatusMessage message --- as defined in ISO TS 19091 and SAEJ2735 --- --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --- --- module: REGION --- --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- - -REGION {iso (1) standard (0) signalizedIntersection (19091) profilec (2) region (1) version2 (2)} - -DEFINITIONS AUTOMATIC TAGS::= BEGIN - -IMPORTS ---FIXME RGY definitions moved to non-circularity module ---addGrpC, REG-EXT-ID-AND-TYPE FROM DSRC -NodeAttributeSet-addGrpC, addGrpC, REG-EXT-ID-AND-TYPE -FROM DSRC-REGION-noCircular { iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc-reg (3) version (2) } ---FIXME RGY NodeAttributeSet-addGrpC has been moved to a non-circularity module ---NodeAttributeSet-addGrpC FROM AddGrpC-noCircular -ConnectionManeuverAssist-addGrpC, ConnectionTrajectory-addGrpC, IntersectionState-addGrpC, /*NodeAttributeSet-addGrpC,*/ Position3D-addGrpC, RestrictionUserType-addGrpC, LaneAttributes-addGrpC, MovementEvent-addGrpC, RequestorDescription-addGrpC, -SignalStatusPackage-addGrpC, MapData-addGrpC -FROM AddGrpC {iso (1) standard (0) signalizedIntersection (19091) profilec (2) addgrpc (0) version2 (2)}; - - -Reg-AdvisorySpeed REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-ComputedLane REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-ConnectionManeuverAssist REG-EXT-ID-AND-TYPE ::= { - {ConnectionManeuverAssist-addGrpC IDENTIFIED BY addGrpC} , - ... -} - -Reg-GenericLane REG-EXT-ID-AND-TYPE ::= { - {ConnectionTrajectory-addGrpC IDENTIFIED BY addGrpC} , - ... -} - -Reg-IntersectionGeometry REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-IntersectionState REG-EXT-ID-AND-TYPE ::= { - {IntersectionState-addGrpC IDENTIFIED BY addGrpC} , - ... -} - -Reg-LaneAttributes REG-EXT-ID-AND-TYPE ::= { - {LaneAttributes-addGrpC IDENTIFIED BY addGrpC} , - ... -} - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -Reg-LaneDataAttribute REG-EXT-ID-AND-TYPE ::= { ... } -*/ - -Reg-MapData REG-EXT-ID-AND-TYPE ::= { - {MapData-addGrpC IDENTIFIED BY addGrpC}, - ... -} - -Reg-MovementEvent REG-EXT-ID-AND-TYPE ::= { - {MovementEvent-addGrpC IDENTIFIED BY addGrpC} , - ... -} - -Reg-MovementState REG-EXT-ID-AND-TYPE ::= { ... } - --- Reg-NodeAttributeSetLL REG-EXT-ID-AND-TYPE ::= { ... } - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -Reg-NodeAttributeSetXY REG-EXT-ID-AND-TYPE ::= { - {NodeAttributeSet-addGrpC IDENTIFIED BY addGrpC} , - ... -} -*/ - --- Reg-NodeOffsetPointLL REG-EXT-ID-AND-TYPE ::= { ... } - -/*FIXME RGY moved to IS-DSRC-REGION-noCircular to cut circular import loop -Reg-NodeOffsetPointXY REG-EXT-ID-AND-TYPE ::= { ... } -*/ - -Reg-Position3D REG-EXT-ID-AND-TYPE ::= { - {Position3D-addGrpC IDENTIFIED BY addGrpC} , - ... -} - -Reg-RequestorDescription REG-EXT-ID-AND-TYPE ::= { - { RequestorDescription-addGrpC IDENTIFIED BY addGrpC} , - ... -} - -Reg-RequestorType REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-RestrictionUserType REG-EXT-ID-AND-TYPE ::= { - {RestrictionUserType-addGrpC IDENTIFIED BY addGrpC} , - ... -} - -Reg-RoadSegment REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-RTCMcorrections REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalControlZone REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalRequest REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalRequestMessage REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalRequestPackage REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalStatus REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalStatusMessage REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalStatusPackage REG-EXT-ID-AND-TYPE ::= { - { SignalStatusPackage-addGrpC IDENTIFIED BY addGrpC} , - ... -} - -Reg-SPAT REG-EXT-ID-AND-TYPE ::= { ... } - -END diff --git a/asn1/IS/ISO_TS_19091/original/AddGrpC.asn b/asn1/IS/ISO_TS_19091/original/AddGrpC.asn deleted file mode 100644 index 1183f8fa..00000000 --- a/asn1/IS/ISO_TS_19091/original/AddGrpC.asn +++ /dev/null @@ -1,211 +0,0 @@ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- ISO TS 19091 2018 --- --- This document includes three ASN.1 modules --- AddGrpC --- REGION --- DSRC --- --- This document contains the data element needed for the encoding the SPAT, MapData, SignalRequestMessage, SignalStatusMessage, RTCMcorrections --- as defined in ISO TS 19091 and basic data element referenced to SAEJ2735 --- --- It includes the addendum extensions for Addgrp-C (e.g. Europe) --- --- ISO Standards maintenance Portal: --- http://standards.iso.org/iso/ts/19091/addgrp_c/ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --- --- module: AddGrpC --- --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- -AddGrpC { - iso (1) standard (0) signalizedIntersection (19091) profilec (2) addgrpc (0) - version2 (2) - } - -DEFINITIONS AUTOMATIC TAGS::= BEGIN - -IMPORTS - -DeltaTime, FuelType, IntersectionID, LaneConnectionID, LaneID, NodeOffsetPointXY, NodeSetXY, PrioritizationResponseStatus, SignalGroupID, VehicleHeight -FROM DSRC { - iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) -} - - -Altitude, DeltaAltitude, StationID, VehicleMass -FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) }; - --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- AddGrpC data dictionary extensions to SAEJ2735 --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -ConnectionManeuverAssist-addGrpC ::= SEQUENCE { - itsStationPosition ItsStationPositionList OPTIONAL, - ... -} - -ConnectionTrajectory-addGrpC ::= SEQUENCE { - nodes NodeSetXY, - connectionID LaneConnectionID, - ... -} - -IntersectionState-addGrpC ::= SEQUENCE { - activePrioritizations PrioritizationResponseList OPTIONAL, - ... -} - -LaneAttributes-addGrpC ::= SEQUENCE { - maxVehicleHeight VehicleHeight OPTIONAL, - maxVehicleWeight VehicleMass OPTIONAL, - ... -} - -MapData-addGrpC ::= SEQUENCE { - signalHeadLocations SignalHeadLocationList OPTIONAL, - ... -} - -MovementEvent-addGrpC ::= SEQUENCE { - stateChangeReason ExceptionalCondition OPTIONAL, - ... -} - -NodeAttributeSet-addGrpC ::= SEQUENCE { - ptvRequest PtvRequestType OPTIONAL, - nodeLink NodeLink OPTIONAL, - node Node OPTIONAL, - ... -} - -Position3D-addGrpC ::= SEQUENCE { - altitude Altitude, - ... -} - -RestrictionUserType-addGrpC ::= SEQUENCE { - emission EmissionType OPTIONAL, - fuel FuelType OPTIONAL, - ... -} - -RequestorDescription-addGrpC ::= SEQUENCE { - fuel FuelType OPTIONAL, - batteryStatus BatteryStatus OPTIONAL, - ... -} - -SignalStatusPackage-addGrpC ::= SEQUENCE { - synchToSchedule DeltaTime OPTIONAL, - rejectedReason RejectedReason OPTIONAL, - ... -} - - --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- Data frames --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -ItsStationPosition ::= SEQUENCE { - stationID StationID, - laneID LaneID OPTIONAL, - nodeXY NodeOffsetPointXY OPTIONAL, - timeReference TimeReference OPTIONAL, - ... -} - -ItsStationPositionList ::= SEQUENCE SIZE(1..5) OF ItsStationPosition - -Node ::= SEQUENCE { - id INTEGER, - lane LaneID OPTIONAL, - connectionID LaneConnectionID OPTIONAL, - intersectionID IntersectionID OPTIONAL, - ... -} - -NodeLink ::= SEQUENCE SIZE (1..5) OF Node - -PrioritizationResponse ::= SEQUENCE { - stationID StationID, - priorState PrioritizationResponseStatus, - signalGroup SignalGroupID, - ... -} - -PrioritizationResponseList ::= SEQUENCE SIZE(1..10) OF PrioritizationResponse - -SignalHeadLocation ::= SEQUENCE { - nodeXY NodeOffsetPointXY, - nodeZ DeltaAltitude, - signalGroupID SignalGroupID, - ... -} - -SignalHeadLocationList ::= SEQUENCE (SIZE(1..64)) OF SignalHeadLocation - - --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- Data elements --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -BatteryStatus ::= ENUMERATED { - unknown, - critical, - low, - good, - ... -} - -EmissionType ::= ENUMERATED { - euro1, - euro2, - euro3, - euro4, - euro5, - euro6, - ... -} - -ExceptionalCondition ::= ENUMERATED { - unknown, - publicTransportPriority, - emergencyVehiclePriority, - trainPriority, - bridgeOpen, - vehicleHeight, - weather, - trafficJam, - tunnelClosure, - meteringActive, - truckPriority, - bicyclePlatoonPriority, - vehiclePlatoonPriority, - ... -} - -PtvRequestType ::= ENUMERATED { - preRequest, - mainRequest, - doorCloseRequest, - cancelRequest, - emergencyRequest, - ... -} - -RejectedReason ::= ENUMERATED { - unknown, - exceptionalCondition, - maxWaitingTimeExceeded, - ptPriorityDisabled, - higherPTPriorityGranted, - vehicleTrackingUnknown, - ... -} - -TimeReference ::= INTEGER { oneMilliSec(1) } (0..60000) - -END diff --git a/asn1/IS/ISO_TS_19091/original/DSRC.asn b/asn1/IS/ISO_TS_19091/original/DSRC.asn deleted file mode 100644 index 0f231d31..00000000 --- a/asn1/IS/ISO_TS_19091/original/DSRC.asn +++ /dev/null @@ -1,1257 +0,0 @@ --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --- --- module: DSRC --- Some Types renamed (added xxxDSRC) to avoid name-clashes with CDD --- --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- - -DSRC { - iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) -} - -DEFINITIONS AUTOMATIC TAGS::= BEGIN - -IMPORTS - -Longitude, Latitude, StationID -FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) } - -Reg-AdvisorySpeed, Reg-ComputedLane, Reg-ConnectionManeuverAssist, Reg-GenericLane, -Reg-IntersectionGeometry, Reg-IntersectionState, Reg-LaneAttributes, Reg-MapData, -Reg-LaneDataAttribute, Reg-MovementEvent, Reg-MovementState, -Reg-NodeAttributeSetXY, Reg-NodeOffsetPointXY, Reg-Position3D, Reg-RequestorDescription, Reg-RequestorType, Reg-RestrictionUserType, Reg-RoadSegment, -Reg-RTCMcorrections, Reg-SignalControlZone, Reg-SignalRequestPackage, Reg-SignalRequest, Reg-SignalStatus, Reg-SignalStatusPackage, Reg-SignalRequestMessage, -Reg-SignalStatusMessage, Reg-SPAT -FROM REGION {iso (1) standard (0) signalizedIntersection (19091) profilec(2) region (1) version2 (2)} - - -Iso3833VehicleType -FROM ElectronicRegistrationIdentificationVehicleDataModule { iso(1) standard(0) iso24534 (24534) vehicleData (1) version1 (1) }; - --- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ --- Messages --- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ - -REG-EXT-ID-AND-TYPE ::= CLASS { - &id RegionId UNIQUE, - &Type -} WITH SYNTAX {&Type IDENTIFIED BY &id} - -RegionalExtension {REG-EXT-ID-AND-TYPE : Set} ::= SEQUENCE { - regionId REG-EXT-ID-AND-TYPE.&id( {Set} ), - regExtValue REG-EXT-ID-AND-TYPE.&Type( {Set}{@regionId} ) -} - -MapData ::= SEQUENCE { - timeStamp MinuteOfTheYear OPTIONAL, - msgIssueRevision MsgCount, - layerType LayerType OPTIONAL, - layerID LayerID OPTIONAL, - intersections IntersectionGeometryList OPTIONAL, - roadSegments RoadSegmentList OPTIONAL, - dataParameters DataParameters OPTIONAL, - restrictionList RestrictionClassList OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-MapData}} OPTIONAL, - ... -} - -RTCMcorrections ::= SEQUENCE { - msgCnt MsgCount, - rev RTCM-Revision, - timeStamp MinuteOfTheYear OPTIONAL, - anchorPoint FullPositionVector OPTIONAL, - rtcmHeader RTCMheader OPTIONAL, - msgs RTCMmessageList, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-RTCMcorrections}} OPTIONAL, - ... -} - -SPAT ::= SEQUENCE { - timeStamp MinuteOfTheYear OPTIONAL, - name DescriptiveName OPTIONAL, - intersections IntersectionStateList, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SPAT}} OPTIONAL, - ... -} - -SignalRequestMessage ::= SEQUENCE { - timeStamp MinuteOfTheYear OPTIONAL, - second DSecond, - sequenceNumber MsgCount OPTIONAL, - requests SignalRequestList OPTIONAL, - requestor RequestorDescription, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalRequestMessage}} OPTIONAL, - ... -} - -SignalStatusMessage ::= SEQUENCE { - timeStamp MinuteOfTheYear OPTIONAL, - second DSecond, - sequenceNumber MsgCount OPTIONAL, - status SignalStatusList, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalStatusMessage}} OPTIONAL, - ... -} - - - - --- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ --- Start of entries from table Data_Frames... --- Data frames --- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ - -AdvisorySpeed ::= SEQUENCE { - type AdvisorySpeedType, - speed SpeedAdvice OPTIONAL, - confidence SpeedConfidenceDSRC OPTIONAL, - distance ZoneLength OPTIONAL, - class RestrictionClassID OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-AdvisorySpeed}} OPTIONAL, - ... -} - -AdvisorySpeedList ::= SEQUENCE (SIZE(1..16)) OF AdvisorySpeed - -AntennaOffsetSet ::= SEQUENCE { - antOffsetX Offset-B12, - antOffsetY Offset-B09, - antOffsetZ Offset-B10 - } - -ComputedLane ::= SEQUENCE { - referenceLaneId LaneID, - offsetXaxis CHOICE { - small DrivenLineOffsetSm, - large DrivenLineOffsetLg - }, - offsetYaxis CHOICE { - small DrivenLineOffsetSm, - large DrivenLineOffsetLg - }, - rotateXY Angle OPTIONAL, - scaleXaxis Scale-B12 OPTIONAL, - scaleYaxis Scale-B12 OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-ComputedLane}} OPTIONAL, - ... -} - -ConnectsToList ::= SEQUENCE (SIZE(1..16)) OF Connection - -ConnectingLane ::= SEQUENCE { - lane LaneID, - maneuver AllowedManeuvers OPTIONAL -} - -Connection ::= SEQUENCE { - connectingLane ConnectingLane, - remoteIntersection IntersectionReferenceID OPTIONAL, - signalGroup SignalGroupID OPTIONAL, - userClass RestrictionClassID OPTIONAL, - connectionID LaneConnectionID OPTIONAL -} - -ConnectionManeuverAssist ::= SEQUENCE { - connectionID LaneConnectionID, - queueLength ZoneLength OPTIONAL, - availableStorageLength ZoneLength OPTIONAL, - waitOnStop WaitOnStopline OPTIONAL, - pedBicycleDetect PedestrianBicycleDetect OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-ConnectionManeuverAssist}} OPTIONAL, - ... -} - -DataParameters ::= SEQUENCE { - processMethod IA5String(SIZE(1..255)) OPTIONAL, - processAgency IA5String(SIZE(1..255)) OPTIONAL, - lastCheckedDate IA5String(SIZE(1..255)) OPTIONAL, - geoidUsed IA5String(SIZE(1..255)) OPTIONAL, - ... -} - - -DDateTime ::= SEQUENCE { - year DYear OPTIONAL, - month DMonth OPTIONAL, - day DDay OPTIONAL, - hour DHour OPTIONAL, - minute DMinute OPTIONAL, - second DSecond OPTIONAL, - offset DOffset OPTIONAL - } - -EnabledLaneList ::= SEQUENCE (SIZE(1..16)) OF LaneID - -FullPositionVector ::= SEQUENCE { - utcTime DDateTime OPTIONAL, -- time with mSec precision - long Longitude, - lat Latitude, - elevation Elevation OPTIONAL, - heading HeadingDSRC OPTIONAL, - speed TransmissionAndSpeed OPTIONAL, - posAccuracy PositionalAccuracy OPTIONAL, - timeConfidence TimeConfidence OPTIONAL, - posConfidence PositionConfidenceSet OPTIONAL, - speedConfidence SpeedandHeadingandThrottleConfidence OPTIONAL, - ... - } - - -GenericLane ::= SEQUENCE { - laneID LaneID, - name DescriptiveName OPTIONAL, - ingressApproach ApproachID OPTIONAL, - egressApproach ApproachID OPTIONAL, - laneAttributes LaneAttributes, - maneuvers AllowedManeuvers OPTIONAL, - nodeList NodeListXY, - connectsTo ConnectsToList OPTIONAL, - overlays OverlayLaneList OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-GenericLane}} OPTIONAL, - ... -} - -IntersectionAccessPoint ::= CHOICE { - lane LaneID, - approach ApproachID, - connection LaneConnectionID, - ... -} - -IntersectionGeometry ::= SEQUENCE { - name DescriptiveName OPTIONAL, - id IntersectionReferenceID, - revision MsgCount, - refPoint Position3D, - laneWidth LaneWidth OPTIONAL, - speedLimits SpeedLimitList OPTIONAL, - laneSet LaneList, - preemptPriorityData PreemptPriorityList OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-IntersectionGeometry}} OPTIONAL, - ... -} - -IntersectionGeometryList ::= SEQUENCE (SIZE(1..32)) OF IntersectionGeometry - -IntersectionReferenceID ::= SEQUENCE { - region RoadRegulatorID OPTIONAL, - id IntersectionID -} - -IntersectionState ::= SEQUENCE { - name DescriptiveName OPTIONAL, - id IntersectionReferenceID, - revision MsgCount, - status IntersectionStatusObject, - moy MinuteOfTheYear OPTIONAL, - timeStamp DSecond OPTIONAL, - enabledLanes EnabledLaneList OPTIONAL, - states MovementList, - maneuverAssistList ManeuverAssistList OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-IntersectionState}} OPTIONAL, - ... -} - -IntersectionStateList ::= SEQUENCE (SIZE(1..32)) OF IntersectionState - -LaneAttributes ::= SEQUENCE { - directionalUse LaneDirection, - sharedWith LaneSharing, - laneType LaneTypeAttributes, - regional RegionalExtension {{Reg-LaneAttributes}} OPTIONAL -} - -LaneDataAttribute ::= CHOICE { - pathEndPointAngle DeltaAngle, - laneCrownPointCenter RoadwayCrownAngle, - laneCrownPointLeft RoadwayCrownAngle, - laneCrownPointRight RoadwayCrownAngle, - laneAngle MergeDivergeNodeAngle, - speedLimits SpeedLimitList, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-LaneDataAttribute}}, - ... -} - -LaneDataAttributeList ::= SEQUENCE (SIZE(1..8)) OF LaneDataAttribute - -LaneList ::= SEQUENCE (SIZE(1..255)) OF GenericLane - -LaneSharing ::= BIT STRING { - overlappingLaneDescriptionProvided (0), - multipleLanesTreatedAsOneLane (1), - otherNonMotorizedTrafficTypes (2), - individualMotorizedVehicleTraffic (3), - busVehicleTraffic (4), - taxiVehicleTraffic (5), - pedestriansTraffic (6), - cyclistVehicleTraffic (7), - trackedVehicleTraffic (8), - pedestrianTraffic (9) -} (SIZE (10)) - -LaneTypeAttributes ::= CHOICE { - vehicle LaneAttributes-Vehicle, - crosswalk LaneAttributes-Crosswalk, - bikeLane LaneAttributes-Bike, - sidewalk LaneAttributes-Sidewalk, - median LaneAttributes-Barrier, - striping LaneAttributes-Striping, - trackedVehicle LaneAttributes-TrackedVehicle, - parking LaneAttributes-Parking, - ... -} - -ManeuverAssistList ::= SEQUENCE (SIZE(1..16)) OF ConnectionManeuverAssist - -MovementEvent ::= SEQUENCE { - eventState MovementPhaseState, - timing TimeChangeDetails OPTIONAL, - speeds AdvisorySpeedList OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-MovementEvent}} OPTIONAL, - ... -} - -MovementEventList ::= SEQUENCE (SIZE(1..16)) OF MovementEvent - -MovementList ::= SEQUENCE (SIZE(1..255)) OF MovementState - -MovementState ::= SEQUENCE { - movementName DescriptiveName OPTIONAL, - signalGroup SignalGroupID, - state-time-speed MovementEventList, - maneuverAssistList ManeuverAssistList OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-MovementState}} OPTIONAL, - ... -} - -NodeAttributeSetXY ::= SEQUENCE { - localNode NodeAttributeXYList OPTIONAL, - disabled SegmentAttributeXYList OPTIONAL, - enabled SegmentAttributeXYList OPTIONAL, - data LaneDataAttributeList OPTIONAL, - dWidth Offset-B10 OPTIONAL, - dElevation Offset-B10 OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-NodeAttributeSetXY}} OPTIONAL, - ... -} - -NodeAttributeXY ::= ENUMERATED { - reserved, - stopLine, - roundedCapStyleA, - roundedCapStyleB, - mergePoint, - divergePoint, - downstreamStopLine, - downstreamStartNode, - closedToTraffic, - safeIsland, - curbPresentAtStepOff, - hydrantPresent, - ... -} - -NodeAttributeXYList ::= SEQUENCE (SIZE(1..8)) OF NodeAttributeXY - -Node-LLmD-64b ::= SEQUENCE { - lon Longitude, - lat Latitude -} - -Node-XY-20b ::= SEQUENCE { - x Offset-B10, - y Offset-B10 -} - -Node-XY-22b ::= SEQUENCE { - x Offset-B11, - y Offset-B11 -} - -Node-XY-24b ::= SEQUENCE { - x Offset-B12, - y Offset-B12 -} - -Node-XY-26b ::= SEQUENCE { - x Offset-B13, - y Offset-B13 -} - -Node-XY-28b ::= SEQUENCE { - x Offset-B14, - y Offset-B14 -} - -Node-XY-32b ::= SEQUENCE { - x Offset-B16, - y Offset-B16 -} - -NodeListXY ::= CHOICE { - nodes NodeSetXY, - computed ComputedLane, - ... -} - -NodeOffsetPointXY ::= CHOICE { - node-XY1 Node-XY-20b, - node-XY2 Node-XY-22b, - node-XY3 Node-XY-24b, - node-XY4 Node-XY-26b, - node-XY5 Node-XY-28b, - node-XY6 Node-XY-32b, - node-LatLon Node-LLmD-64b, - regional RegionalExtension {{Reg-NodeOffsetPointXY}} -} - -NodeXY ::= SEQUENCE { - delta NodeOffsetPointXY, - attributes NodeAttributeSetXY OPTIONAL, - ... -} - -NodeSetXY ::= SEQUENCE (SIZE(2..63)) OF NodeXY - -OverlayLaneList ::= SEQUENCE (SIZE(1..5)) OF LaneID - -PositionalAccuracy ::= SEQUENCE { - semiMajor SemiMajorAxisAccuracy, - semiMinor SemiMinorAxisAccuracy, - orientation SemiMajorAxisOrientation -} - -PositionConfidenceSet ::= SEQUENCE { - pos PositionConfidence, -- for both horizontal directions - elevation ElevationConfidence - } - - -Position3D ::= SEQUENCE { - lat Latitude, - long Longitude, - elevation Elevation OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-Position3D}} OPTIONAL, - ... -} - -PreemptPriorityList ::= SEQUENCE (SIZE(1..32)) OF SignalControlZone - -RegulatorySpeedLimit ::= SEQUENCE { - type SpeedLimitType, - speed Velocity -} - -RequestorDescription ::= SEQUENCE { - id VehicleID, - type RequestorType OPTIONAL, - position RequestorPositionVector OPTIONAL, - name DescriptiveName OPTIONAL, - routeName DescriptiveName OPTIONAL, - transitStatus TransitVehicleStatus OPTIONAL, - transitOccupancy TransitVehicleOccupancy OPTIONAL, - transitSchedule DeltaTime OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-RequestorDescription}} OPTIONAL, - ... -} - -RequestorPositionVector ::= SEQUENCE { - position Position3D, - heading Angle OPTIONAL, - speed TransmissionAndSpeed OPTIONAL, - ... -} - -RequestorType ::= SEQUENCE { - role BasicVehicleRole, - subrole RequestSubRole OPTIONAL, - request RequestImportanceLevel OPTIONAL, - iso3883 Iso3833VehicleType OPTIONAL, - hpmsType VehicleType OPTIONAL, - regional RegionalExtension {{Reg-RequestorType}} OPTIONAL, - ... -} - -RestrictionClassAssignment ::= SEQUENCE { - id RestrictionClassID, - users RestrictionUserTypeList -} - -RestrictionClassList ::= SEQUENCE (SIZE(1..254)) OF RestrictionClassAssignment - -RestrictionUserType ::= CHOICE { - basicType RestrictionAppliesTo, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-RestrictionUserType}}, - ... -} - -RestrictionUserTypeList ::= SEQUENCE (SIZE(1..16)) OF RestrictionUserType - -RoadLaneSetList ::= SEQUENCE (SIZE(1..255)) OF GenericLane - -RoadSegmentReferenceID ::= SEQUENCE { - region RoadRegulatorID OPTIONAL, - id RoadSegmentID -} - -RoadSegment ::= SEQUENCE { - name DescriptiveName OPTIONAL, - id RoadSegmentReferenceID, - revision MsgCount, - refPoint Position3D, - laneWidth LaneWidth OPTIONAL, - speedLimits SpeedLimitList OPTIONAL, - roadLaneSet RoadLaneSetList, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-RoadSegment}} OPTIONAL, - ... -} - -RoadSegmentList ::= SEQUENCE (SIZE(1..32)) OF RoadSegment - -RTCMheader ::= SEQUENCE { - status GNSSstatus, - offsetSet AntennaOffsetSet - } - -RTCMmessageList ::= SEQUENCE (SIZE(1..5)) OF RTCMmessage - -SegmentAttributeXYList ::= SEQUENCE (SIZE(1..8)) OF SegmentAttributeXY - -SignalControlZone ::= SEQUENCE { - zone RegionalExtension {{Reg-SignalControlZone}}, - ... -} - -SignalRequesterInfo ::= SEQUENCE { - id VehicleID, - request RequestID, - sequenceNumber MsgCount, - role BasicVehicleRole OPTIONAL, - typeData RequestorType OPTIONAL, - ... -} - -SignalRequest ::= SEQUENCE { - id IntersectionReferenceID, - requestID RequestID, - requestType PriorityRequestType, - inBoundLane IntersectionAccessPoint, - outBoundLane IntersectionAccessPoint OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalRequest}} OPTIONAL, - ... -} - -SignalRequestList ::= SEQUENCE (SIZE(1..32)) OF SignalRequestPackage - -SignalRequestPackage ::= SEQUENCE { - request SignalRequest, - minute MinuteOfTheYear OPTIONAL, - second DSecond OPTIONAL, - duration DSecond OPTIONAL, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalRequestPackage}} OPTIONAL, - ... -} - -SignalStatus ::= SEQUENCE { - sequenceNumber MsgCount, - id IntersectionReferenceID, - sigStatus SignalStatusPackageList, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalStatus}} OPTIONAL, - ... -} - -SignalStatusList ::= SEQUENCE (SIZE(1..32)) OF SignalStatus - -SignalStatusPackageList ::= SEQUENCE (SIZE(1..32)) OF SignalStatusPackage - -SignalStatusPackage ::= SEQUENCE { - requester SignalRequesterInfo OPTIONAL, - inboundOn IntersectionAccessPoint, - outboundOn IntersectionAccessPoint OPTIONAL, - - minute MinuteOfTheYear OPTIONAL, - second DSecond OPTIONAL, - duration DSecond OPTIONAL, - status PrioritizationResponseStatus, - regional SEQUENCE (SIZE(1..4)) OF - RegionalExtension {{Reg-SignalStatusPackage}} OPTIONAL, - ... -} - -SpeedandHeadingandThrottleConfidence ::= SEQUENCE { - heading HeadingConfidenceDSRC, - speed SpeedConfidenceDSRC, - throttle ThrottleConfidence - } - - -SpeedLimitList ::= SEQUENCE (SIZE(1..9)) OF RegulatorySpeedLimit - -SpeedLimitType ::= ENUMERATED { - unknown, - maxSpeedInSchoolZone, - maxSpeedInSchoolZoneWhenChildrenArePresent, - maxSpeedInConstructionZone, - vehicleMinSpeed, - vehicleMaxSpeed, - vehicleNightMaxSpeed, - truckMinSpeed, - truckMaxSpeed, - truckNightMaxSpeed, - vehiclesWithTrailersMinSpeed, - vehiclesWithTrailersMaxSpeed, - vehiclesWithTrailersNightMaxSpeed, - ... -} - -TimeChangeDetails ::= SEQUENCE { - startTime TimeMark OPTIONAL, - minEndTime TimeMark, - maxEndTime TimeMark OPTIONAL, - likelyTime TimeMark OPTIONAL, - confidence TimeIntervalConfidence OPTIONAL, - nextTime TimeMark OPTIONAL -} - -TimeMark ::= INTEGER (0..36001) - -TransmissionAndSpeed ::= SEQUENCE { - transmisson TransmissionState, - speed Velocity -} - -VehicleID ::= CHOICE { - entityID TemporaryID, - stationID StationID -} - - --- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ --- data elements --- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ - -AdvisorySpeedType ::= ENUMERATED { - none (0), - greenwave (1), - ecoDrive (2), - transit (3), - ... -} - -AllowedManeuvers ::= BIT STRING { - maneuverStraightAllowed (0), - maneuverLeftAllowed (1), - maneuverRightAllowed (2), - maneuverUTurnAllowed (3), - maneuverLeftTurnOnRedAllowed (4), - maneuverRightTurnOnRedAllowed (5), - maneuverLaneChangeAllowed (6), - maneuverNoStoppingAllowed (7), - yieldAllwaysRequired (8), - goWithHalt (9), - caution (10), - reserved1 (11) -} (SIZE(12)) - -Angle ::= INTEGER (0..28800) - -ApproachID ::= INTEGER (0..15) - -BasicVehicleRole ::= ENUMERATED { - basicVehicle (0), - publicTransport (1), - specialTransport (2), - dangerousGoods (3), - roadWork (4), - roadRescue (5), - emergency (6), - safetyCar (7), - none-unknown (8), - truck (9), - motorcycle (10), - roadSideSource (11), - police (12), - fire (13), - ambulance (14), - dot (15), - transit (16), - slowMoving (17), - stopNgo (18), - cyclist (19), - pedestrian (20), - nonMotorized (21), - military (22), - ... -} - -DDay ::= INTEGER (0..31) - -DeltaAngle ::= INTEGER (-150..150) - -DeltaTime ::= INTEGER (-122 .. 121) - -DescriptiveName ::= IA5String (SIZE(1..63)) - -DHour ::= INTEGER (0..31) - -DMinute ::= INTEGER (0..60) - -DMonth ::= INTEGER (0..12) - -DOffset ::= INTEGER (-840..840) - -DrivenLineOffsetLg ::= INTEGER (-32767..32767) - -DrivenLineOffsetSm ::= INTEGER (-2047..2047) - -DSecond ::= INTEGER (0..65535) - -DSRCmsgID ::= INTEGER (0..32767) - mapData DSRCmsgID ::= 18 - rtcmCorrections DSRCmsgID ::= 28 - signalPhaseAndTimingMessage DSRCmsgID ::= 19 - signalRequestMessage DSRCmsgID ::= 29 - signalStatusMessage DSRCmsgID ::= 30 - -DYear ::= INTEGER (0..4095) - -Elevation ::= INTEGER (-4096..61439) - -ElevationConfidence ::= ENUMERATED { - unavailable (0), - elev-500-00 (1), - elev-200-00 (2), - elev-100-00 (3), - elev-050-00 (4), - elev-020-00 (5), - elev-010-00 (6), - elev-005-00 (7), - elev-002-00 (8), - elev-001-00 (9), - elev-000-50 (10), - elev-000-20 (11), - elev-000-10 (12), - elev-000-05 (13), - elev-000-02 (14), - elev-000-01 (15) - } - - -FuelType ::= INTEGER (0..15) - unknownFuel FuelType ::= 0 - gasoline FuelType ::= 1 - ethanol FuelType ::= 2 - diesel FuelType ::= 3 - electric FuelType ::= 4 - hybrid FuelType ::= 5 - hydrogen FuelType ::= 6 - natGasLiquid FuelType ::= 7 - natGasComp FuelType ::= 8 - propane FuelType ::= 9 - -GNSSstatus ::= BIT STRING { - unavailable (0), - isHealthy (1), - isMonitored (2), - baseStationType (3), - aPDOPofUnder5 (4), - inViewOfUnder5 (5), - localCorrectionsPresent (6), - networkCorrectionsPresent (7) - } (SIZE(8)) - -HeadingConfidenceDSRC ::= ENUMERATED { - unavailable (0), - prec10deg (1), - prec05deg (2), - prec01deg (3), - prec0-1deg (4), - prec0-05deg (5), - prec0-01deg (6), - prec0-0125deg (7) - } - -HeadingDSRC ::= INTEGER (0..28800) - -IntersectionID ::= INTEGER (0..65535) - -IntersectionStatusObject ::= BIT STRING { - manualControlIsEnabled (0), - stopTimeIsActivated (1), - failureFlash (2), - preemptIsActive (3), - signalPriorityIsActive (4), - fixedTimeOperation (5), - trafficDependentOperation (6), - standbyOperation (7), - failureMode (8), - off (9), - recentMAPmessageUpdate (10), - recentChangeInMAPassignedLanesIDsUsed (11), - noValidMAPisAvailableAtThisTime (12), - noValidSPATisAvailableAtThisTime (13) -} (SIZE(16)) - -LaneAttributes-Barrier ::= BIT STRING { - median-RevocableLane (0), - median (1), - whiteLineHashing (2), - stripedLines (3), - doubleStripedLines (4), - trafficCones (5), - constructionBarrier (6), - trafficChannels (7), - lowCurbs (8), - highCurbs (9) -} (SIZE (16)) - -LaneAttributes-Bike ::= BIT STRING { - bikeRevocableLane (0), - pedestrianUseAllowed (1), - isBikeFlyOverLane (2), - fixedCycleTime (3), - biDirectionalCycleTimes (4), - isolatedByBarrier (5), - unsignalizedSegmentsPresent (6) -} (SIZE (16)) - -LaneAttributes-Crosswalk ::= BIT STRING { - crosswalkRevocableLane (0), - bicyleUseAllowed (1), - isXwalkFlyOverLane (2), - fixedCycleTime (3), - biDirectionalCycleTimes (4), - hasPushToWalkButton (5), - audioSupport (6), - rfSignalRequestPresent (7), - unsignalizedSegmentsPresent (8) -} (SIZE (16)) - -LaneAttributes-Parking ::= BIT STRING { - parkingRevocableLane (0), - parallelParkingInUse (1), - headInParkingInUse (2), - doNotParkZone (3), - parkingForBusUse (4), - parkingForTaxiUse (5), - noPublicParkingUse (6) -} (SIZE (16)) - -LaneAttributes-Sidewalk ::= BIT STRING { - sidewalk-RevocableLane (0), - bicyleUseAllowed (1), - isSidewalkFlyOverLane (2), - walkBikes (3) -} (SIZE (16)) - -LaneAttributes-Striping ::= BIT STRING { - stripeToConnectingLanesRevocableLane (0), - stripeDrawOnLeft (1), - stripeDrawOnRight (2), - stripeToConnectingLanesLeft (3), - stripeToConnectingLanesRight (4), - stripeToConnectingLanesAhead (5) -} (SIZE (16)) - -LaneAttributes-TrackedVehicle ::= BIT STRING { - spec-RevocableLane (0), - spec-commuterRailRoadTrack (1), - spec-lightRailRoadTrack (2), - spec-heavyRailRoadTrack (3), - spec-otherRailType (4) -} (SIZE (16)) - - -LaneAttributes-Vehicle ::= BIT STRING { - isVehicleRevocableLane (0), - isVehicleFlyOverLane (1), - hovLaneUseOnly (2), - restrictedToBusUse (3), - restrictedToTaxiUse (4), - restrictedFromPublicUse (5), - hasIRbeaconCoverage (6), - permissionOnRequest (7) -} (SIZE (8,...)) - -LaneConnectionID ::= INTEGER (0..255) - -LaneDirection ::= BIT STRING { - ingressPath (0), - egressPath (1) -} (SIZE (2)) - -LaneID ::= INTEGER (0..255) - -LayerID ::= INTEGER (0..100) - -LayerType ::= ENUMERATED { - none, - mixedContent, - generalMapData, - intersectionData, - curveData, - roadwaySectionData, - parkingAreaData, - sharedLaneData, - ... -} - -LaneWidth ::= INTEGER (0..32767) - -MergeDivergeNodeAngle ::= INTEGER (-180..180) - -MinuteOfTheYear ::= INTEGER (0..527040) - -MovementPhaseState ::= ENUMERATED { - unavailable (0), - dark (1), - stop-Then-Proceed (2), - stop-And-Remain (3), - pre-Movement (4), - permissive-Movement-Allowed (5), - protected-Movement-Allowed (6), - permissive-clearance (7), - protected-clearance (8), - caution-Conflicting-Traffic (9) -} - -MsgCount ::= INTEGER (0..127) - -Offset-B09 ::= INTEGER (-256..255) - -Offset-B10 ::= INTEGER (-512..511) - -Offset-B11 ::= INTEGER (-1024..1023) - -Offset-B12 ::= INTEGER (-2048..2047) - -Offset-B13 ::= INTEGER (-4096..4095) - -Offset-B14 ::= INTEGER (-8192..8191) - -Offset-B16 ::= INTEGER (-32768..32767) - -PedestrianBicycleDetect ::= BOOLEAN - -PositionConfidence ::= ENUMERATED { - unavailable (0), - a500m (1), - a200m (2), - a100m (3), - a50m (4), - a20m (5), - a10m (6), - a5m (7), - a2m (8), - a1m (9), - a50cm (10), - a20cm (11), - a10cm (12), - a5cm (13), - a2cm (14), - a1cm (15) - } - -PrioritizationResponseStatus ::= ENUMERATED { - unknown (0), - requested (1), - processing (2), - watchOtherTraffic (3), - granted (4), - rejected (5), - maxPresence (6), - reserviceLocked (7), - ... -} - -PriorityRequestType ::= ENUMERATED { - priorityRequestTypeReserved (0), - priorityRequest (1), - priorityRequestUpdate (2), - priorityCancellation (3), - ... -} - -RegionId ::= INTEGER (0..255) - noRegion RegionId ::= 0 - addGrpA RegionId ::= 1 - addGrpB RegionId ::= 2 - addGrpC RegionId ::= 3 - -RequestID ::= INTEGER (0..255) - -RequestImportanceLevel ::= ENUMERATED { - requestImportanceLevelUnKnown (0), - requestImportanceLevel1 (1), - requestImportanceLevel2 (2), - requestImportanceLevel3 (3), - requestImportanceLevel4 (4), - requestImportanceLevel5 (5), - requestImportanceLevel6 (6), - requestImportanceLevel7 (7), - requestImportanceLevel8 (8), - requestImportanceLevel9 (9), - requestImportanceLevel10 (10), - requestImportanceLevel11 (11), - requestImportanceLevel12 (12), - requestImportanceLevel13 (13), - requestImportanceLevel14 (14), - requestImportanceReserved (15) -} - -RequestSubRole ::= ENUMERATED { - requestSubRoleUnKnown (0), - requestSubRole1 (1), - requestSubRole2 (2), - requestSubRole3 (3), - requestSubRole4 (4), - requestSubRole5 (5), - requestSubRole6 (6), - requestSubRole7 (7), - requestSubRole8 (8), - requestSubRole9 (9), - requestSubRole10 (10), - requestSubRole11 (11), - requestSubRole12 (12), - requestSubRole13 (13), - requestSubRole14 (14), - requestSubRoleReserved (15) -} - -RestrictionAppliesTo ::= ENUMERATED { - none, - equippedTransit, - equippedTaxis, - equippedOther, - emissionCompliant, - equippedBicycle, - weightCompliant, - heightCompliant, - pedestrians, - slowMovingPersons, - wheelchairUsers, - visualDisabilities, - audioDisabilities, - otherUnknownDisabilities, - ... -} - -RestrictionClassID ::= INTEGER (0..255) - -RoadRegulatorID ::= INTEGER (0..65535) - -RoadSegmentID ::= INTEGER (0..65535) - -RoadwayCrownAngle ::= INTEGER (-128..127) - -RTCMmessage ::= OCTET STRING (SIZE(1..1023)) - -RTCM-Revision ::= ENUMERATED { - unknown (0), - rtcmRev2 (1), -- Std 10402.x et al - rtcmRev3 (2), -- Std 10403.x et al - reserved (3), - ... -} - -Scale-B12 ::= INTEGER (-2048..2047) - -SignalGroupID ::= INTEGER (0..255) - -SegmentAttributeXY ::= ENUMERATED { - reserved , - doNotBlock , - whiteLine , - mergingLaneLeft , - mergingLaneRight , - curbOnLeft , - curbOnRight , - loadingzoneOnLeft , - loadingzoneOnRight , - turnOutPointOnLeft , - turnOutPointOnRight , - adjacentParkingOnLeft , - adjacentParkingOnRight , - adjacentBikeLaneOnLeft , - adjacentBikeLaneOnRight , - sharedBikeLane , - bikeBoxInFront , - transitStopOnLeft , - transitStopOnRight , - transitStopInLane , - sharedWithTrackedVehicle , - safeIsland , - lowCurbsPresent , - rumbleStripPresent , - audibleSignalingPresent , - adaptiveTimingPresent , - rfSignalRequestPresent , - partialCurbIntrusion , - taperToLeft , - taperToRight , - taperToCenterLine , - parallelParking , - headInParking , - freeParking , - timeRestrictionsOnParking , - costToPark , - midBlockCurbPresent , - unEvenPavementPresent , - ... -} - -SemiMajorAxisAccuracy ::= INTEGER (0..255) - -SemiMajorAxisOrientation ::= INTEGER (0..65535) - -SemiMinorAxisAccuracy ::= INTEGER (0..255) - -SpeedAdvice ::= INTEGER (0..500) - -SpeedConfidenceDSRC ::= ENUMERATED { - unavailable (0), -- Not Equipped or unavailable - prec100ms (1), -- 100 meters / sec - prec10ms (2), -- 10 meters / sec - prec5ms (3), -- 5 meters / sec - prec1ms (4), -- 1 meters / sec - prec0-1ms (5), -- 0.1 meters / sec - prec0-05ms (6), -- 0.05 meters / sec - prec0-01ms (7) -- 0.01 meters / sec - } - -TemporaryID ::= OCTET STRING (SIZE(4)) - -ThrottleConfidence ::= ENUMERATED { - unavailable (0), - prec10percent (1), - prec1percent (2), - prec0-5percent (3) - } - -TimeConfidence ::= ENUMERATED { - unavailable (0), - time-100-000 (1), - time-050-000 (2), - time-020-000 (3), - time-010-000 (4), - time-002-000 (5), - time-001-000 (6), - time-000-500 (7), - time-000-200 (8), - time-000-100 (9), - time-000-050 (10), - time-000-020 (11), - time-000-010 (12), - time-000-005 (13), - time-000-002 (14), - time-000-001 (15), - time-000-000-5 (16), - time-000-000-2 (17), - time-000-000-1 (18), - time-000-000-05 (19), - time-000-000-02 (20), - time-000-000-01 (21), - time-000-000-005 (22), - time-000-000-002 (23), - time-000-000-001 (24), - time-000-000-000-5 (25), - time-000-000-000-2 (26), - time-000-000-000-1 (27), - time-000-000-000-05 (28), - time-000-000-000-02 (29), - time-000-000-000-01 (30), - time-000-000-000-005 (31), - time-000-000-000-002 (32), - time-000-000-000-001 (33), - time-000-000-000-000-5 (34), - time-000-000-000-000-2 (35), - time-000-000-000-000-1 (36), - time-000-000-000-000-05 (37), - time-000-000-000-000-02 (38), - time-000-000-000-000-01 (39) -} - -TimeIntervalConfidence ::= INTEGER (0..15) - -TransitVehicleOccupancy ::= ENUMERATED { - occupancyUnknown (0), - occupancyEmpty (1), - occupancyVeryLow (2), - occupancyLow (3), - occupancyMed (4), - occupancyHigh (5), - occupancyNearlyFull (6), - occupancyFull (7) -} - -TransitVehicleStatus ::= BIT STRING { - loading (0), - anADAuse (1), - aBikeLoad (2), - doorOpen (3), - charging (4), - atStopLine (5) -} (SIZE(8)) - -TransmissionState ::= ENUMERATED { - neutral (0), - park (1), - forwardGears (2), - reverseGears (3), - reserved1 (4), - reserved2 (5), - reserved3 (6), - unavailable (7) -} - -VehicleHeight ::= INTEGER (0..127) - -VehicleType ::= ENUMERATED { - none (0), - unknown (1), - special (2), - moto (3), - car (4), - carOther (5), - bus (6), - axleCnt2 (7), - axleCnt3 (8), - axleCnt4 (9), - axleCnt4Trailer (10), - axleCnt5Trailer (11), - axleCnt6Trailer (12), - axleCnt5MultiTrailer (13), - axleCnt6MultiTrailer (14), - axleCnt7MultiTrailer (15), - ... -} - -Velocity ::= INTEGER (0..8191) - -WaitOnStopline ::= BOOLEAN - -ZoneLength ::= INTEGER (0..10000) - -END diff --git a/asn1/IS/ISO_TS_19091/original/REGION.asn b/asn1/IS/ISO_TS_19091/original/REGION.asn deleted file mode 100644 index df216bf1..00000000 --- a/asn1/IS/ISO_TS_19091/original/REGION.asn +++ /dev/null @@ -1,115 +0,0 @@ --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- --- --- module: REGION --- --- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^- - -REGION { - iso (1) standard (0) signalizedIntersection (19091) profilec (2) region (1) - version2 (2) -} - -DEFINITIONS AUTOMATIC TAGS::= BEGIN - -IMPORTS - -addGrpC, REG-EXT-ID-AND-TYPE -FROM DSRC { - iso (1) standard (0) signalizedIntersection (19091) profilec(2) dsrc (2) version2 (2) -} - -ConnectionManeuverAssist-addGrpC, ConnectionTrajectory-addGrpC, -IntersectionState-addGrpC, LaneAttributes-addGrpC, MapData-addGrpC, -MovementEvent-addGrpC, NodeAttributeSet-addGrpC, Position3D-addGrpC, RequestorDescription-addGrpC, RestrictionUserType-addGrpC, SignalStatusPackage-addGrpC -FROM AddGrpC {iso (1) standard (0) signalizedIntersection (19091) profilec(2) addgrpc (0) version2 (2)}; - -Reg-AdvisorySpeed REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-ComputedLane REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-ConnectionManeuverAssist REG-EXT-ID-AND-TYPE ::= { - {ConnectionManeuverAssist-addGrpC IDENTIFIED BY addGrpC}, - ... -} - -Reg-GenericLane REG-EXT-ID-AND-TYPE ::= { - {ConnectionTrajectory-addGrpC IDENTIFIED BY addGrpC} , - ... -} - -Reg-IntersectionGeometry REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-IntersectionState REG-EXT-ID-AND-TYPE ::= { - {IntersectionState-addGrpC IDENTIFIED BY addGrpC}, - ... -} - -Reg-LaneAttributes REG-EXT-ID-AND-TYPE ::= { - {LaneAttributes-addGrpC IDENTIFIED BY addGrpC} , - ... -} -Reg-LaneDataAttribute REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-MapData REG-EXT-ID-AND-TYPE ::= { - {MapData-addGrpC IDENTIFIED BY addGrpC}, - ... -} - -Reg-MovementEvent REG-EXT-ID-AND-TYPE ::= { - {MovementEvent-addGrpC IDENTIFIED BY addGrpC} , - ... -} -Reg-MovementState REG-EXT-ID-AND-TYPE ::= { ... } - --- Reg-NodeAttributeSetLL REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-NodeAttributeSetXY REG-EXT-ID-AND-TYPE ::= { - {NodeAttributeSet-addGrpC IDENTIFIED BY addGrpC}, - ... -} - --- Reg-NodeOffsetPointLL REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-NodeOffsetPointXY REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-Position3D REG-EXT-ID-AND-TYPE ::= { - {Position3D-addGrpC IDENTIFIED BY addGrpC} , - ... -} - -Reg-RequestorDescription REG-EXT-ID-AND-TYPE ::= { - { RequestorDescription-addGrpC IDENTIFIED BY addGrpC} , - ... -} - -Reg-RequestorType REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-RestrictionUserType REG-EXT-ID-AND-TYPE ::= { - {RestrictionUserType-addGrpC IDENTIFIED BY addGrpC} , - ... -} - -Reg-RoadSegment REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-RTCMcorrections REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalControlZone REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalRequest REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalRequestMessage REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalRequestPackage REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalStatus REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalStatusMessage REG-EXT-ID-AND-TYPE ::= { ... } - -Reg-SignalStatusPackage REG-EXT-ID-AND-TYPE ::= { - { SignalStatusPackage-addGrpC IDENTIFIED BY addGrpC }, - ... -} - -Reg-SPAT REG-EXT-ID-AND-TYPE ::= { ... } - -END diff --git a/asn1/IS/ISO_TS_19321/IVI.asn b/asn1/IS/ISO_TS_19321/IVI.asn deleted file mode 100644 index 21cb22f1..00000000 --- a/asn1/IS/ISO_TS_19321/IVI.asn +++ /dev/null @@ -1,630 +0,0 @@ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- ISO TS 19321 --- --- This ASN.1 was generateds: 30.08.2016 --- --- Due to typos in the published version, --- small ASN.1 syntax adaptations have been executed --- --- Published version location: --- http://standards.iso.org/iso/ts/19321 --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -IVI {iso (1) standard (0) ivi (19321) version2 (2)} - -DEFINITIONS AUTOMATIC TAGS ::= -BEGIN -IMPORTS -ItsPduHeader, Altitude, DangerousGoodsBasic , DeltaLatitude, DeltaLongitude, DeltaReferencePosition, Heading, HeadingValue, Latitude, LanePosition, Longitude, ReferencePosition, RoadType, SpecialTransportType, Speed, StationType, TimestampIts, VehicleRole -FROM ITS-Container { itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) } - -AxleWeightLimits, DieselEmissionValues, ExhaustEmissionValues, EngineCharacteristics, EnvironmentalCharacteristics, PassengerCapacity , Provider, SoundLevel, VehicleDimensions, VehicleWeightLimits -FROM EfcDsrcApplication {iso(1) standard(0) 14906 application(0) version6(6)} - -EuVehicleCategoryCode, Iso3833VehicleType -FROM ElectronicRegistrationIdentificationVehicleDataModule {iso(1) standard(0) iso24534 (24534) vehicleData (1) version1 (1)} - - -VarLengthNumber -FROM CITSapplMgmtIDs {iso(1) standard(0) cits-applMgmt (17419) ids (1) version1 (1)} - -; --- End of IMPORTS - - ---Definition of IVI message to be send over the air is outside of the scope and given for information only: - -IVI::= SEQUENCE { - header ItsPduHeader, - ivi IviStructure -} - ---Definition of IVI Structure - - - -IviStructure::= SEQUENCE{ - mandatory IVIManagementContainer, - optional SEQUENCE (SIZE (1..8,...)) OF IviContainer OPTIONAL - } - ---Definition of Containers - -IviContainer::= CHOICE { - glc GeographicLocationContainer, - giv GeneralIviContainer, - rcc RoadConfigurationContainer, - tc TextContainer, - lac LayoutContainer, - ... -- extension for future containers - } - --- Prefix IVI added due to naming collision with data element ManagementContainer of Module DENM-PDU-Descriptions -IVIManagementContainer::= SEQUENCE { - serviceProviderId Provider, - iviIdentificationNumber IviIdentificationNumber, - timeStamp TimestampIts OPTIONAL, - validFrom TimestampIts OPTIONAL, - validTo TimestampIts OPTIONAL, - connectedIviStructures SEQUENCE (SIZE(1..8)) OF IviIdentificationNumber OPTIONAL, - iviStatus IviStatus, - ... - } - -GeographicLocationContainer::= SEQUENCE { - referencePosition ReferencePosition, - referencePositionTime TimestampIts OPTIONAL, - referencePositionHeading Heading OPTIONAL, - referencePositionSpeed Speed OPTIONAL, - parts SEQUENCE (SIZE (1..16,...)) OF GlcPart, - ... - } - -GlcPart::= SEQUENCE { - zoneId Zid, - laneNumber LanePosition OPTIONAL, - zoneExtension INTEGER (0..255) OPTIONAL, - zoneHeading HeadingValue OPTIONAL, - zone Zone OPTIONAL, - ... - } - -GeneralIviContainer::= SEQUENCE (SIZE (1..16,...)) OF GicPart - -GicPart::= SEQUENCE { - detectionZoneIds SEQUENCE (SIZE (1..8,...)) OF Zid OPTIONAL, - its-Rrid VarLengthNumber OPTIONAL, - relevanceZoneIds SEQUENCE (SIZE (1..8,...)) OF Zid OPTIONAL, - direction Direction OPTIONAL, - driverAwarenessZoneIds SEQUENCE (SIZE (1..8,...)) OF Zid OPTIONAL, - minimumAwarenessTime INTEGER (0..255) OPTIONAL, - applicableLanes SEQUENCE (SIZE (1..8,...)) OF LanePosition OPTIONAL, - iviType IviType, - iviPurpose IviPurpose OPTIONAL, - laneStatus LaneStatus OPTIONAL, - vehicleCharacteristics SEQUENCE (SIZE (1..8, ...)) OF CompleteVehicleCharacteristics OPTIONAL, - driverCharacteristics DriverCharacteristics OPTIONAL, - layoutId INTEGER(1..4,...) OPTIONAL, - preStoredlayoutId INTEGER(1..64,...) OPTIONAL, - roadSignCodes SEQUENCE (SIZE (1..4,...)) OF RSCode, - extraText SEQUENCE (SIZE (1..4,...)) OF Text (WITH COMPONENTS {layoutComponentId, language, textContent (SIZE(1..32))}) OPTIONAL, - ... - } - -RoadConfigurationContainer::= SEQUENCE (SIZE (1..16,...)) OF RccPart - -RccPart::= SEQUENCE{ - zoneIds SEQUENCE (SIZE (1..8,...)) OF Zid, - roadType RoadType, - laneConfiguration SEQUENCE (SIZE (1..16,...)) OF LaneInformation, - ... - } - -TextContainer::= SEQUENCE (SIZE (1..16,...)) OF TcPart - -TcPart::= SEQUENCE { - detectionZoneIds SEQUENCE (SIZE (1..8,...)) OF Zid OPTIONAL, - relevanceZoneIds SEQUENCE (SIZE (1..8,...)) OF Zid, - direction Direction OPTIONAL, - driverAwarenessZoneIds SEQUENCE (SIZE (1..8,...)) OF Zid OPTIONAL, - minimumAwarenessTime INTEGER (0..255) OPTIONAL, - applicableLanes SEQUENCE (SIZE (1..8,...)) OF LanePosition OPTIONAL, - layoutId INTEGER(1..4,...) OPTIONAL, - preStoredlayoutId INTEGER(1..64,...) OPTIONAL, - text SEQUENCE (SIZE (1..4,...)) OF Text OPTIONAL, - data OCTET STRING, - ... - } - -LayoutContainer::=SEQUENCE{ - layoutId INTEGER(1..4,...), - height INTEGER(10..73) OPTIONAL, - width INTEGER(10..265) OPTIONAL, - layoutComponents SEQUENCE SIZE (1..4,...) OF LayoutComponent, - ... - } - --- Definition of Data Frames & Elements - -AbsolutePosition::= SEQUENCE{ - latitude Latitude, - longitude Longitude - } - -AbsolutePositionWAltitude::= SEQUENCE{ - latitude Latitude, - longitude Longitude, - altitude Altitude - } - -AnyCatalogue::=SEQUENCE{ - owner Provider, - version INTEGER(0..255), - pictogramCode INTEGER(0..65535), - value INTEGER (0..65535) OPTIONAL, - unit RSCUnit OPTIONAL, - attributes ISO14823Attributes OPTIONAL - } - -ComparisonOperator ::= INTEGER { - greaterThan (0), - greaterThanOrEqualTo (1), - lessThan (2), - lessThanOrEqualTo (3) -} (0..3) - -CompleteVehicleCharacteristics::= SEQUENCE{ - tractor TractorCharacteristics OPTIONAL, - trailer SEQUENCE (SIZE (1..3)) OF TrailerCharacteristics OPTIONAL, - train TrainCharacteristics OPTIONAL - } - -ComputedSegment::= SEQUENCE { - zoneId Zid, - laneNumber LanePosition, - laneWidth IVILaneWidth, - offsetDistance INTEGER (-32768..32767) OPTIONAL, - offsetPosition DeltaReferencePosition OPTIONAL - } - -DeltaPosition::=SEQUENCE{ - deltaLatitude DeltaLatitude, - deltaLongitude DeltaLongitude - } - -Direction::= INTEGER{ - sameDirection (0), - oppositeDirection (1), - bothDirections (2), - valueNotUsed (3) - } (0..3) - -Distance::= SEQUENCE { - value INTEGER(1..16384), - unit RSCUnit (2..4|6..8) - } - -DistanceOrDuration::= SEQUENCE { - value INTEGER(1..16384), - unit RSCUnit (2..9) - } - -DriverCharacteristics::= INTEGER{ - unexperiencedDrivers (0), - experiencedDrivers (1), - rfu1 (2), - rfu2 (3) - } (0..3) - -GoodsType::= INTEGER { - ammunition (0), - chemicals (1), - empty (2), - fuel (3), - glass (4), - dangerous (5), - liquid (6), - liveStock (7), - dangerousForPeople (8), - dangerousForTheEnvironment (9), - dangerousForWater (10), - perishableProducts (11), - pharmaceutical (12), - vehicles (13) - -- other values reserved for future use - } (0..15,...) - - -ISO14823Attributes::= SEQUENCE (SIZE(1..8,...)) OF CHOICE{ - dtm DTM, -- Date/Time/Period - edt EDT, -- Exemption status of Date/Time/Period - dfl DFL, -- Directional Flow of Lane - ved VED, -- Vehicle Dimensions - spe SPE, -- Speed - roi ROI, -- Rate of Incline - dbv DBV, -- Distance Between Vehicles - ddd DDD -- Destination/Direction/Distance - } - -ISO14823Code ::= SEQUENCE{ - pictogramCode SEQUENCE { - countryCode OCTET STRING (SIZE (2)) OPTIONAL, - serviceCategoryCode CHOICE { - trafficSignPictogram ENUMERATED {dangerWarning, regulatory, informative,...}, - publicFacilitiesPictogram ENUMERATED {publicFacilities, ...}, - ambientOrRoadConditionPictogram ENUMERATED {ambientCondition, roadCondition,...}, - ...}, - pictogramCategoryCode SEQUENCE { - nature INTEGER (1..9), - serialNumber INTEGER (0..99) - }}, - attributes ISO14823Attributes OPTIONAL - } - -IviIdentificationNumber::= INTEGER(1..32767,...) - -IviPurpose::= INTEGER { - safety (0), - environmental (1), - trafficOptimisation (2) - } (0..3) - -IviStatus::= INTEGER { - new (0), - update (1), - cancellation (2), - negation (3) - -- other values reserved for future use - }(0..7) - -IviType::= INTEGER { - immediateDangerWarningMessages (0), - regulatoryMessages (1), - trafficRelatedInformationMessages (2), - pollutionMessages (3), - notTrafficRelatedInformationMessages (4) - -- other values reserved for future use - } (0..7) - -LaneInformation::= SEQUENCE{ - laneNumber LanePosition, - direction Direction, - validity DTM OPTIONAL, - laneType LaneType, - laneTypeQualifier CompleteVehicleCharacteristics OPTIONAL, - laneStatus LaneStatus, - laneWidth IVILaneWidth OPTIONAL, - ... - } - -LaneStatus::= INTEGER { - open (0), - closed (1), - mergeR (2), - mergeL (3), - mergeLR (4), - provisionallyOpen (5), - diverging (6) - -- value 7 reserved for future use -} (0..7, ...) - -LaneType::= INTEGER{ - traffic (0), - through (1), - reversible (2), - acceleration (3), - deceleration (4), - leftHandTurning (5), - rightHandTurning (6), - dedicatedVehicle (7), - bus (8), - taxi (9), - hov (10), - hot (11), - pedestrian (12), - bikeLane (13), - median (14), - striping (15), - trackedVehicle (16), - parking (17), - emergency (18), - verge (19) --- values 20 to 31 reserved for future use - }(0..31) - --- Prefix IVI added due to naming collision with data element LaneWidth of Module DSRC -IVILaneWidth::= INTEGER (0..1023) - -LayoutComponent::=SEQUENCE{ - layoutComponentId INTEGER(1..8,...), - height INTEGER(10..73), - width INTEGER(10..265), - x INTEGER(10..265), - y INTEGER(10..73), - textScripting INTEGER {horizontal (0), vertical (1)}(0..1) - } - -LoadType::= SEQUENCE{ - goodsType GoodsType, - dangerousGoodsType DangerousGoodsBasic, - specialTransportType SpecialTransportType - } - -PolygonalLine::= CHOICE { - deltaPositions SEQUENCE (SIZE (1..32,...)) OF DeltaPosition, - deltaPositionsWithAltitude SEQUENCE (SIZE (1..32,...)) OF DeltaReferencePosition, - absolutePositions SEQUENCE (SIZE (1..8,...)) OF AbsolutePosition, - absolutePositionsWithAltitude SEQUENCE (SIZE (1..8,...)) OF AbsolutePositionWAltitude, - ... - } - -RSCode::= SEQUENCE{ - layoutComponentId INTEGER(1..4,...) OPTIONAL, - code CHOICE { - viennaConvention VcCode, -- see Vienna Convention Annex A - iso14823 ISO14823Code, - itisCodes INTEGER (0..65535), -- see SAE J2540 - anyCatalogue AnyCatalogue, - ... - }} - -RSCUnit::= INTEGER { - kmperh (0), - milesperh (1), - kilometer (2), - meter (3), - decimeter (4), - centimeter (5), - mile (6), - yard (7), - foot (8), - minutesOfTime (9), - tonnes (10), --1000 kg, not Ton! - hundredkg (11), - pound (12), --lbs - rateOfIncline (13) - -- other value reserved for future use - } (0..15) - - -Segment::= SEQUENCE { - line PolygonalLine, - laneWidth IVILaneWidth OPTIONAL - } - -Text::= SEQUENCE { - layoutComponentId INTEGER(1..4,...) OPTIONAL, - language BIT STRING (SIZE(10)), - textContent UTF8String - } - -TractorCharacteristics::=SEQUENCE{ - equalTo SEQUENCE (SIZE (1..4,...)) OF VehicleCharacteristicsFixValues OPTIONAL, - notEqualTo SEQUENCE (SIZE (1..4,...)) OF VehicleCharacteristicsFixValues OPTIONAL, - ranges SEQUENCE (SIZE (1..4,...)) OF VehicleCharacteristicsRanges OPTIONAL -} - -TrailerCharacteristics::=SEQUENCE{ - equalTo SEQUENCE (SIZE (1..4,...)) OF VehicleCharacteristicsFixValues (WITH COMPONENTS {..., euroAndCo2value ABSENT, engineCharacteristics ABSENT}) OPTIONAL, - notEqualTo SEQUENCE (SIZE (1..4,...)) OF VehicleCharacteristicsFixValues (WITH COMPONENTS {..., euroAndCo2value ABSENT, engineCharacteristics ABSENT}) OPTIONAL, - ranges SEQUENCE (SIZE (1..4,...)) OF VehicleCharacteristicsRanges (WITH COMPONENTS {comparisonOperator, limits (WITH COMPONENTS {..., exhaustEmissionValues ABSENT, dieselEmissionValues ABSENT, soundLevel ABSENT})}) OPTIONAL - } - -TrainCharacteristics::= TractorCharacteristics - -VcClass::= INTEGER { - classA (0), - classB (1), - classC (2), - classD (3), - classE (4), - classF (5), - classG (6), - classH (7) - } (0..7) - -VcCode::= SEQUENCE { - roadSignClass VcClass, -- see Vienna Convention - roadSignCode INTEGER (1..64), - vcOption VcOption, -- e.g. the "a" in H, 3a - validity SEQUENCE (SIZE (1..8,...)) OF DTM OPTIONAL, - value INTEGER (0..65535) OPTIONAL, - unit RSCUnit OPTIONAL - } - -VcOption::= INTEGER { - none (0), - a (1), - b (2), - c (3), - d (4), - e (5), - f (6), - g (7) - } (0..7) - -VehicleCharacteristicsFixValues::= CHOICE{ - simpleVehicleType StationType, - euVehicleCategoryCode EuVehicleCategoryCode, - iso3833VehicleType Iso3833VehicleType, - euroAndCo2value EnvironmentalCharacteristics, - engineCharacteristics EngineCharacteristics, - loadType LoadType, - usage VehicleRole, - ...} - -VehicleCharacteristicsRanges::= SEQUENCE{ - comparisonOperator ComparisonOperator, - limits CHOICE{ - numberOfAxles INTEGER(0..7), - vehicleDimensions VehicleDimensions, - vehicleWeightLimits VehicleWeightLimits, - axleWeightLimits AxleWeightLimits, - passengerCapacity PassengerCapacity, - exhaustEmissionValues ExhaustEmissionValues, - dieselEmissionValues DieselEmissionValues, - soundLevel SoundLevel, - ...}} - -Weight::= SEQUENCE { - value INTEGER(1..16384), - unit RSCUnit (10..12) - } - -Zid::= INTEGER (1..32,...) - -Zone::= CHOICE { - segment Segment, - area PolygonalLine, - computedSegment ComputedSegment, - ... - } - --- Definition of the single ISO 14823 Attributes - - -DTM ::= SEQUENCE { - year SEQUENCE { -- contains SYR and EYR - syr INTEGER(2000..2127,...), - eyr INTEGER(2000..2127,...) - } OPTIONAL, - month-day SEQUENCE { -- contains SMD and EMD - smd MonthDay, - emd MonthDay - } OPTIONAL, - pmd PMD OPTIONAL, - hourMinutes SEQUENCE { -- contains SHM and EHM - shm HoursMinutes, - ehm HoursMinutes - } OPTIONAL, - dayOfWeek DayOfWeek OPTIONAL, -- corresponds to SDY and EDY - period HoursMinutes OPTIONAL -- corresponds to LDM -} - -MonthDay ::= SEQUENCE { - month INTEGER (1..12), - day INTEGER (1..31) -} - -PMD::= BIT STRING {national-holiday (0), even-days(1), odd-days(2), market-day(3) } (SIZE (4)) - -HoursMinutes ::= SEQUENCE { - hours INTEGER (0..23), -- number of hours after midnight - mins INTEGER (0..59) -- number of minutes after the hour - } - --- Prefix IVI added due to naming collision with data element DayOfWeek of Module DSRC -DayOfWeek ::= BIT STRING {unused(0), monday(1), tuesday(2), wednesday(3), thursday(4), friday(5), saturday(6), sunday(7)} (SIZE (8)) - -EDT ::= DTM - - - -DFL::= INTEGER { - sDL (1) , -- Straight Direction Only - sLT (2) , -- Straight and Left Turn Only - sRT (3) , -- Straight and Right Turn Only - lTO (4) , -- Left Turn Only - rTO (5) , -- Right Turn Only - cLL (6) , -- Convergence from the Left Lane - cRI (7) , -- Convergence from the Right Lane - oVL (8) -- Oncoming Vehicles Lane - } (1..8) - -VED::=SEQUENCE{ - hei Distance OPTIONAL, - wid Distance OPTIONAL, - vln Distance OPTIONAL, - wei Weight OPTIONAL - } - -SPE::=SEQUENCE{ - spm INTEGER(0..250) OPTIONAL, - mns INTEGER(0..250) OPTIONAL, - unit RSCUnit(0..1) - } - -ROI::= INTEGER(1..32) - -DBV::= Distance --- changes: from DDD_IO to DDD-IO -DDD::= SEQUENCE{ - dcj INTEGER(1..128) OPTIONAL, - dcr INTEGER(1..128)OPTIONAL, - tpl INTEGER(1..128)OPTIONAL, - ioList SEQUENCE (SIZE (1..8,...)) OF DDD-IO - } --- changes: from DDD_IO to DDD-IO -DDD-IO::= SEQUENCE{ - arrowDirection INTEGER(0..7), - destPlace DestinationPlaces OPTIONAL, - destRoad DestinationRoads OPTIONAL, - roadNumberIdentifier INTEGER(1..999) OPTIONAL, - streetName INTEGER(1..999) OPTIONAL, - streetNameText UTF8String OPTIONAL, - distanceToDivergingPoint DistanceOrDuration OPTIONAL, - distanceToDestinationPlace DistanceOrDuration OPTIONAL - } -DDD-IO-LIST ::= SEQUENCE (SIZE (1..8,...)) OF DDD-IO - --- changes: from DDD_DEP to DDD-DEP -DestinationPlace::= SEQUENCE{ - depType DDD-DEP, - -- Encoding problem: to be checked if the statement is ASN.1 compatible - -- depRSCode ISO14823Code (WITH COMPONENTS {..., attributes ABSENT}) OPTIONAL, - depRSCode ISO14823Code OPTIONAL, - depBlob OCTET STRING OPTIONAL, - plnId INTEGER(1..999) OPTIONAL, - plnText UTF8String OPTIONAL - } -DestinationPlaces ::= SEQUENCE (SIZE (1..4,...)) OF DestinationPlace --- changes: from DDD_DER to DDD-DER -DestinationRoad::=SEQUENCE{ - derType DDD-DER, - ronId INTEGER(1..999) OPTIONAL, - ronText UTF8String OPTIONAL - } -DestinationRoads ::= SEQUENCE (SIZE (1..4,...)) OF DestinationRoad --- changes: from DDD_DER to DDD-DER -DDD-DER::= INTEGER { - none (0), - nationalHighway (1), - localHighway (2), - tollExpresswayMotorway (3), - internationalHighway (4), - highway (5), - expressway (6), - nationalRoad (7), - regionalProvincialRoad (8), - localRoad (9), - motorwayJunction (10), - diversion (11), - rfu1 (12), - rfu2 (13), - rfu3 (14), - rfu4 (15) - } (0..15, ...) --- changes: from DDD_DEP to DDD-DEP -DDD-DEP::= INTEGER { - none (0), - importantArea (1), - principalArea (2), - generalArea (3), - wellKnownPoint (4), - country (5), - city (6), - street (7), - industrialArea (8), - historicArea (9), - touristicArea (10), - culturalArea (11), - touristicRoute (12), - recommendedRoute (13), - touristicAttraction (14), - geographicArea (15) - } (0..15, ...) - - - -END - diff --git a/asn1/IS/ISO_TS_24534-3/ElectronicRegistrationIdentificationVehicleDataModule.asn b/asn1/IS/ISO_TS_24534-3/ElectronicRegistrationIdentificationVehicleDataModule.asn deleted file mode 100644 index 1d5d8855..00000000 --- a/asn1/IS/ISO_TS_24534-3/ElectronicRegistrationIdentificationVehicleDataModule.asn +++ /dev/null @@ -1,85 +0,0 @@ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- ISO TS 24534-3:2015 --- --- This ASN.1 was generateds: 30.08.2016 --- --- This document contains only the data element needed for the encoding of an IVI message --- as defined in ISO TS 19321(2020) --- --- Published version location: --- https://standards.iso.org/iso/24534/-3/ISO%2024534-3%20ASN.1%20repository/ --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - --- ISO 24534-3:2015 --- Version 29.4.2015 - - -ElectronicRegistrationIdentificationVehicleDataModule {iso(1) standard(0) iso24534 (24534) vehicleData (1) version1 (1)} - - -DEFINITIONS AUTOMATIC TAGS ::= BEGIN - --- Electronic Registration Identification (ERI)- Vehicle Data - -EuVehicleCategoryCode ::= CHOICE { - euVehicleCategoryL EuVehicleCategoryL, -- conforms to EU 2002/24 and UNECE 1999 - euVehicleCategoryM EuVehicleCategoryM, -- conforms to EU 2001/116 and UNECE 1999 - euVehicleCategoryN EuVehicleCategoryN, -- conforms to EU 2001/116 and UNECE 1999 - euVehicleCategoryO EuVehicleCategoryO, -- conforms to EU 2001/116 and UNECE 1999 - euVehilcleCategoryT NULL, -- conforms to UNECE 1999 - euVehilcleCategoryG NULL -- conforms to EU 2001/116 and UNECE 1999 - } - -EuVehicleCategoryL ::= ENUMERATED { l1, l2, l3, l4, l5, l6, l7 } - -EuVehicleCategoryM ::= ENUMERATED {m1, m2, m3} - -EuVehicleCategoryN ::= ENUMERATED {n1, n2, n3} - -EuVehicleCategoryO ::= ENUMERATED {o1, o2, o3, o4} - -Iso3833VehicleType ::= INTEGER { - passengerCar (0), -- term No 3.1.1 - saloon (1), -- term No 3.1.1.1 (sedan) - convertibleSaloon (2), -- term No 3.1.1.2 - pullmanSaloon (3), -- term No 3.1.1.3 - stationWagon (4), -- term No 3.1.1.4 - truckStationWagon (5), -- term No 3.1.1.4.1 - coupe (6), -- term No 3.1.1.5 (coupé) - convertible (7), -- term No 3.1.1.6 (open tourer, roadstar, spider) - multipurposePassengerCar (8), -- term No 3.1.1.7 - forwardControlPassengerCar (9), -- term No 3.1.1.8 - specialPassengerCar (10), -- term No 3.1.1.9 - bus (11), -- term No 3.1.2 - minibus (12), -- term No 3.1.2.1 - urbanBus (13), -- term No 3.1.2.2 - interurbanCoach (14), -- term No 3.1.2.3 - longDistanceCoach (15), -- term No 3.1.2.4 - articulatedBus (16), -- term No 3.1.2.5 - trolleyBus (17), -- term No 3.1.2.6 - specialBus (18), -- term No 3.1.2.7 - commercialVehicle (19), -- term No 3.1.3 - specialCommercialVehicle (20), -- term No 3.1.3.1 - specialVehicle (21), -- term No 3.1.4 - trailingTowingVehicle (22), -- term No 3.1.5 (draw-bar tractor) - semiTrailerTowingVehicle (23), -- term No 3.1.6 (fifth wheel tractor) - trailer (24), -- term No 3.2.1 - busTrailer (25), -- term No 3.2.1.1 - generalPurposeTrailer (26), -- term No 3.2.1.2 - caravan (27), -- term No 3.2.1.3 - specialTrailer (28), -- term No 3.2.1.4 - semiTrailer (29), -- term No 3.2.2 - busSemiTrailer (30), -- term No 3.2.2.1 - generalPurposeSemiTrailer (31), -- term No 3.2.2.2 - specialSemiTrailer (32), -- term No 3.2.2.3 - roadTrain (33), -- term No 3.3.1 - passengerRoadTrain (34), -- term No 3.3.2 - articulatedRoadTrain (35), -- term No 3.3.3 - doubleRoadTrain (36), -- term No 3.3.4 - compositeRoadTrain (37), -- term No 3.3.5 - specialRoadTrain (38), -- term No 3.3.6 - moped (39), -- term No 3.4 - motorCycle (40) -- term No 3.5 - } (0..255) - -END diff --git a/asn1/IS/module.mk b/asn1/IS/module.mk deleted file mode 100644 index 6e4474f9..00000000 --- a/asn1/IS/module.mk +++ /dev/null @@ -1,19 +0,0 @@ -sources := \ - ETSI_TS_103301/IVIM_PDU_Descriptions.asn \ - ETSI_TS_103301/MAPEM_PDU_Descriptions.asn \ - ETSI_TS_103301/RTCMEM_PDU_Descriptions.asn \ - ETSI_TS_103301/SPATEM_PDU_Descriptions.asn\ - ETSI_TS_103301/SREM_PDU_Descriptions.asn \ - ETSI_TS_103301/SSEM_PDU_Descriptions.asn \ - ISO_TS_14816/AVIAEINumberingAndDataStructures.asn \ - ISO_TS_14906/EfcDsrcApplication.asn \ - ISO_TS_14906/EfcDsrcGeneric.asn \ - ISO_TS_17419/CITSapplMgmtIDs.asn \ - ISO_TS_19091/AddGrpC.asn \ - ISO_TS_19091/AddGrpC_noCircular.asn \ - ISO_TS_19091/DSRC.asn \ - ISO_TS_19091/DSRC_REGION_noCircular.asn \ - ISO_TS_19091/REGION.asn \ - ISO_TS_19321/IVI.asn \ - ISO_TS_24534-3/ElectronicRegistrationIdentificationVehicleDataModule.asn - diff --git a/asn1/ITS-Container/ITS_Container.asn b/asn1/ITS-Container/ITS_Container.asn deleted file mode 100644 index 8b6874e0..00000000 --- a/asn1/ITS-Container/ITS_Container.asn +++ /dev/null @@ -1,508 +0,0 @@ -ITS-Container { -itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (2) -} - -DEFINITIONS AUTOMATIC TAGS ::= - -BEGIN - -IMPORTS; - -ItsPduHeader ::= SEQUENCE { - protocolVersion INTEGER (0..255), - messageID INTEGER{ denm(1), cam(2), poi(3), spatem(4), mapem(5), ivim(6), ev-rsr(7), tistpgtransaction(8), srem(9), ssem(10), evcsn(11), saem(12), rtcmem(13) } (0..255), -- Mantis #7209, #7005 - stationID StationID -} - -StationID ::= INTEGER(0..4294967295) - -ReferencePosition ::= SEQUENCE { - latitude Latitude, - longitude Longitude, - positionConfidenceEllipse PosConfidenceEllipse , - altitude Altitude -} - -DeltaReferencePosition ::= SEQUENCE { - deltaLatitude DeltaLatitude, - deltaLongitude DeltaLongitude, - deltaAltitude DeltaAltitude -} - -Longitude ::= INTEGER {oneMicrodegreeEast (10), oneMicrodegreeWest (-10), unavailable(1800000001)} (-1800000000..1800000001) - -Latitude ::= INTEGER {oneMicrodegreeNorth (10), oneMicrodegreeSouth (-10), unavailable(900000001)} (-900000000..900000001) - -Altitude ::= SEQUENCE { - altitudeValue AltitudeValue, - altitudeConfidence AltitudeConfidence -} - -AltitudeValue ::= INTEGER {referenceEllipsoidSurface(0), oneCentimeter(1), unavailable(800001)} (-100000..800001) - -AltitudeConfidence ::= ENUMERATED { - alt-000-01 (0), - alt-000-02 (1), - alt-000-05 (2), - alt-000-10 (3), - alt-000-20 (4), - alt-000-50 (5), - alt-001-00 (6), - alt-002-00 (7), - alt-005-00 (8), - alt-010-00 (9), - alt-020-00 (10), - alt-050-00 (11), - alt-100-00 (12), - alt-200-00 (13), - outOfRange (14), - unavailable (15) -} - -DeltaLongitude ::= INTEGER {oneMicrodegreeEast (10), oneMicrodegreeWest (-10), unavailable(131072)} (-131071..131072) - -DeltaLatitude ::= INTEGER {oneMicrodegreeNorth (10), oneMicrodegreeSouth (-10) , unavailable(131072)} (-131071..131072) - -DeltaAltitude ::= INTEGER {oneCentimeterUp (1), oneCentimeterDown (-1), unavailable(12800)} (-12700..12800) - -PosConfidenceEllipse ::= SEQUENCE { - semiMajorConfidence SemiAxisLength, - semiMinorConfidence SemiAxisLength, - semiMajorOrientation HeadingValue -} - -PathPoint ::= SEQUENCE { - pathPosition DeltaReferencePosition, - pathDeltaTime PathDeltaTime OPTIONAL -} - -PathDeltaTime ::= INTEGER {tenMilliSecondsInPast(1)} (1..65535, ...) - -PtActivation ::= SEQUENCE { - ptActivationType PtActivationType, - ptActivationData PtActivationData -} - -PtActivationType ::= INTEGER {undefinedCodingType(0), r09-16CodingType(1), vdv-50149CodingType(2)} (0..255) - -PtActivationData ::= OCTET STRING (SIZE(1..20)) - -AccelerationControl ::= BIT STRING { - brakePedalEngaged (0), - gasPedalEngaged (1), - emergencyBrakeEngaged (2), - collisionWarningEngaged (3), - accEngaged (4), - cruiseControlEngaged (5), - speedLimiterEngaged (6) -} (SIZE(7)) - -SemiAxisLength ::= INTEGER{oneCentimeter(1), outOfRange(4094), unavailable(4095)} (0..4095) - -CauseCode ::= SEQUENCE { - causeCode CauseCodeType, - subCauseCode SubCauseCodeType, - ... -} - -CauseCodeType ::= INTEGER { - reserved (0), - trafficCondition (1), - accident (2), - roadworks (3), - impassability (5), - adverseWeatherCondition-Adhesion (6), - aquaplannning (7), - hazardousLocation-SurfaceCondition (9), - hazardousLocation-ObstacleOnTheRoad (10), - hazardousLocation-AnimalOnTheRoad (11), - humanPresenceOnTheRoad (12), - wrongWayDriving (14), - rescueAndRecoveryWorkInProgress (15), - adverseWeatherCondition-ExtremeWeatherCondition (17), - adverseWeatherCondition-Visibility (18), - adverseWeatherCondition-Precipitation (19), - slowVehicle (26), - dangerousEndOfQueue (27), - vehicleBreakdown (91), - postCrash (92), - humanProblem (93), - stationaryVehicle (94), - emergencyVehicleApproaching (95), - hazardousLocation-DangerousCurve (96), - collisionRisk (97), - signalViolation (98), - dangerousSituation (99) -} (0..255) - -SubCauseCodeType ::= INTEGER (0..255) - -TrafficConditionSubCauseCode ::= INTEGER {unavailable(0), increasedVolumeOfTraffic(1), trafficJamSlowlyIncreasing(2), trafficJamIncreasing(3), trafficJamStronglyIncreasing(4), trafficStationary(5), trafficJamSlightlyDecreasing(6), trafficJamDecreasing(7), trafficJamStronglyDecreasing(8)} (0..255) - -AccidentSubCauseCode ::= INTEGER {unavailable(0), multiVehicleAccident(1), heavyAccident(2), accidentInvolvingLorry(3), accidentInvolvingBus(4), accidentInvolvingHazardousMaterials(5), accidentOnOppositeLane(6), unsecuredAccident(7), assistanceRequested(8)} (0..255) - -RoadworksSubCauseCode ::= INTEGER {unavailable(0), majorRoadworks(1), roadMarkingWork(2), slowMovingRoadMaintenance(3), shortTermStationaryRoadworks(4), streetCleaning(5), winterService(6)} (0..255) - -HumanPresenceOnTheRoadSubCauseCode ::= INTEGER {unavailable(0), childrenOnRoadway(1), cyclistOnRoadway(2), motorcyclistOnRoadway(3)} (0..255) - -WrongWayDrivingSubCauseCode ::= INTEGER {unavailable(0), wrongLane(1), wrongDirection(2)} (0..255) - -AdverseWeatherCondition-ExtremeWeatherConditionSubCauseCode ::= INTEGER {unavailable(0), strongWinds(1), damagingHail(2), hurricane(3), thunderstorm(4), tornado(5), blizzard(6)} (0..255) - -AdverseWeatherCondition-AdhesionSubCauseCode ::= INTEGER {unavailable(0), heavyFrostOnRoad(1), fuelOnRoad(2), mudOnRoad(3), snowOnRoad(4), iceOnRoad(5), blackIceOnRoad(6), oilOnRoad(7), looseChippings(8), instantBlackIce(9), roadsSalted(10)} (0..255) - -AdverseWeatherCondition-VisibilitySubCauseCode ::= INTEGER {unavailable(0), fog(1), smoke(2), heavySnowfall(3), heavyRain(4), heavyHail(5), lowSunGlare(6), sandstorms(7), swarmsOfInsects(8)} (0..255) - -AdverseWeatherCondition-PrecipitationSubCauseCode ::= INTEGER {unavailable(0), heavyRain(1), heavySnowfall(2), softHail(3)} (0..255) - -SlowVehicleSubCauseCode ::= INTEGER {unavailable(0), maintenanceVehicle(1), vehiclesSlowingToLookAtAccident(2), abnormalLoad(3), abnormalWideLoad(4), convoy(5), snowplough(6), deicing(7), saltingVehicles(8)} (0..255) - -StationaryVehicleSubCauseCode ::= INTEGER {unavailable(0), humanProblem(1), vehicleBreakdown(2), postCrash(3), publicTransportStop(4), carryingDangerousGoods(5)} (0..255) - -HumanProblemSubCauseCode ::= INTEGER {unavailable(0), glycemiaProblem(1), heartProblem(2)} (0..255) - -EmergencyVehicleApproachingSubCauseCode ::= INTEGER {unavailable(0), emergencyVehicleApproaching(1), prioritizedVehicleApproaching(2)} (0..255) - -HazardousLocation-DangerousCurveSubCauseCode ::= INTEGER {unavailable(0), dangerousLeftTurnCurve(1), dangerousRightTurnCurve(2), multipleCurvesStartingWithUnknownTurningDirection(3), multipleCurvesStartingWithLeftTurn(4), multipleCurvesStartingWithRightTurn(5)} (0..255) - -HazardousLocation-SurfaceConditionSubCauseCode ::= INTEGER {unavailable(0), rockfalls(1), earthquakeDamage(2), sewerCollapse(3), subsidence(4), snowDrifts(5), stormDamage(6), burstPipe(7), volcanoEruption(8), fallingIce(9)} (0..255) - -HazardousLocation-ObstacleOnTheRoadSubCauseCode ::= INTEGER {unavailable(0), shedLoad(1), partsOfVehicles(2), partsOfTyres(3), bigObjects(4), fallenTrees(5), hubCaps(6), waitingVehicles(7)} (0..255) - -HazardousLocation-AnimalOnTheRoadSubCauseCode ::= INTEGER {unavailable(0), wildAnimals(1), herdOfAnimals(2), smallAnimals(3), largeAnimals(4)} (0..255) - -CollisionRiskSubCauseCode ::= INTEGER {unavailable(0), longitudinalCollisionRisk(1), crossingCollisionRisk(2), lateralCollisionRisk(3), vulnerableRoadUser(4)} (0..255) - -SignalViolationSubCauseCode ::= INTEGER {unavailable(0), stopSignViolation(1), trafficLightViolation(2), turningRegulationViolation(3)} (0..255) - -RescueAndRecoveryWorkInProgressSubCauseCode ::= INTEGER {unavailable(0), emergencyVehicles(1), rescueHelicopterLanding(2), policeActivityOngoing(3), medicalEmergencyOngoing(4), childAbductionInProgress(5)} (0..255) - -DangerousEndOfQueueSubCauseCode ::= INTEGER {unavailable(0), suddenEndOfQueue(1), queueOverHill(2), queueAroundBend(3), queueInTunnel(4)} (0..255) - -DangerousSituationSubCauseCode ::= INTEGER {unavailable(0), emergencyElectronicBrakeEngaged(1), preCrashSystemEngaged(2), espEngaged(3), absEngaged(4), aebEngaged(5), brakeWarningEngaged(6), collisionRiskWarningEngaged(7)} (0..255) - -VehicleBreakdownSubCauseCode ::= INTEGER {unavailable(0), lackOfFuel (1), lackOfBatteryPower (2), engineProblem(3), transmissionProblem(4), engineCoolingProblem(5), brakingSystemProblem(6), steeringProblem(7), tyrePuncture(8), tyrePressureProblem(9)} (0..255) - -PostCrashSubCauseCode ::= INTEGER {unavailable(0), accidentWithoutECallTriggered (1), accidentWithECallManuallyTriggered (2), accidentWithECallAutomaticallyTriggered (3), accidentWithECallTriggeredWithoutAccessToCellularNetwork(4)} (0..255) - -Curvature ::= SEQUENCE { - curvatureValue CurvatureValue, - curvatureConfidence CurvatureConfidence -} - -CurvatureValue ::= INTEGER {straight(0), unavailable(1023)} (-1023..1023) - -CurvatureConfidence ::= ENUMERATED { - onePerMeter-0-00002 (0), - onePerMeter-0-0001 (1), - onePerMeter-0-0005 (2), - onePerMeter-0-002 (3), - onePerMeter-0-01 (4), - onePerMeter-0-1 (5), - outOfRange (6), - unavailable (7) -} - -CurvatureCalculationMode ::= ENUMERATED {yawRateUsed(0), yawRateNotUsed(1), unavailable(2), ...} - -Heading ::= SEQUENCE { - headingValue HeadingValue, - headingConfidence HeadingConfidence -} - -HeadingValue ::= INTEGER {wgs84North(0), wgs84East(900), wgs84South(1800), wgs84West(2700), unavailable(3601)} (0..3601) - -HeadingConfidence ::= INTEGER {equalOrWithinZeroPointOneDegree (1), equalOrWithinOneDegree (10), outOfRange(126), unavailable(127)} (1..127) - -LanePosition ::= INTEGER {offTheRoad(-1), innerHardShoulder(0), -innermostDrivingLane(1), secondLaneFromInside(2), outerHardShoulder(14) } (-1..14) - -ClosedLanes ::= SEQUENCE { - innerhardShoulderStatus HardShoulderStatus OPTIONAL, - outerhardShoulderStatus HardShoulderStatus OPTIONAL, - drivingLaneStatus DrivingLaneStatus OPTIONAL, - ... -} - -HardShoulderStatus ::= ENUMERATED {availableForStopping(0), closed(1), availableForDriving(2)} - -DrivingLaneStatus ::= BIT STRING (SIZE (1..13)) - -PerformanceClass ::= INTEGER {unavailable(0), performanceClassA(1), performanceClassB(2)} (0..7) - -SpeedValue ::= INTEGER {standstill(0), oneCentimeterPerSec(1), unavailable(16383)} (0..16383) - -SpeedConfidence ::= INTEGER {equalOrWithinOneCentimeterPerSec(1), equalOrWithinOneMeterPerSec(100), outOfRange(126), unavailable(127)} (1..127) - -VehicleMass ::= INTEGER {hundredKg(1), unavailable(1024)} (1..1024) - -Speed ::= SEQUENCE { - speedValue SpeedValue, - speedConfidence SpeedConfidence -} - -DriveDirection ::= ENUMERATED {forward (0), backward (1), unavailable (2)} - -EmbarkationStatus ::= BOOLEAN - -LongitudinalAcceleration ::= SEQUENCE { - longitudinalAccelerationValue LongitudinalAccelerationValue, - longitudinalAccelerationConfidence AccelerationConfidence -} - -LongitudinalAccelerationValue ::= INTEGER {pointOneMeterPerSecSquaredForward(1), pointOneMeterPerSecSquaredBackward(-1), unavailable(161)} (-160 .. 161) - -AccelerationConfidence ::= INTEGER {pointOneMeterPerSecSquared(1), outOfRange(101), unavailable(102)} (0 .. 102) - -LateralAcceleration ::= SEQUENCE { - lateralAccelerationValue LateralAccelerationValue, - lateralAccelerationConfidence AccelerationConfidence -} - -LateralAccelerationValue ::= INTEGER {pointOneMeterPerSecSquaredToRight(-1), pointOneMeterPerSecSquaredToLeft(1), unavailable(161)} (-160 .. 161) - -VerticalAcceleration ::= SEQUENCE { - verticalAccelerationValue VerticalAccelerationValue, - verticalAccelerationConfidence AccelerationConfidence -} - -VerticalAccelerationValue ::= INTEGER {pointOneMeterPerSecSquaredUp(1), pointOneMeterPerSecSquaredDown(-1), unavailable(161)} (-160 .. 161) - -StationType ::= INTEGER {unknown(0), pedestrian(1), cyclist(2), moped(3), motorcycle(4), passengerCar(5), bus(6), -lightTruck(7), heavyTruck(8), trailer(9), specialVehicles(10), tram(11), roadSideUnit(15)} (0..255) - -ExteriorLights ::= BIT STRING { - lowBeamHeadlightsOn (0), - highBeamHeadlightsOn (1), - leftTurnSignalOn (2), - rightTurnSignalOn (3), - daytimeRunningLightsOn (4), - reverseLightOn (5), - fogLightOn (6), - parkingLightsOn (7) -} (SIZE(8)) - -DangerousGoodsBasic::= ENUMERATED { - explosives1(0), - explosives2(1), - explosives3(2), - explosives4(3), - explosives5(4), - explosives6(5), - flammableGases(6), - nonFlammableGases(7), - toxicGases(8), - flammableLiquids(9), - flammableSolids(10), - substancesLiableToSpontaneousCombustion(11), - substancesEmittingFlammableGasesUponContactWithWater(12), - oxidizingSubstances(13), - organicPeroxides(14), - toxicSubstances(15), - infectiousSubstances(16), - radioactiveMaterial(17), - corrosiveSubstances(18), - miscellaneousDangerousSubstances(19) -} - -DangerousGoodsExtended ::= SEQUENCE { - dangerousGoodsType DangerousGoodsBasic, - unNumber INTEGER (0..9999), - elevatedTemperature BOOLEAN, - tunnelsRestricted BOOLEAN, - limitedQuantity BOOLEAN, - emergencyActionCode IA5String (SIZE (1..24)) OPTIONAL, - phoneNumber PhoneNumber OPTIONAL, - companyName UTF8String (SIZE (1..24)) OPTIONAL, - ... -} - -SpecialTransportType ::= BIT STRING {heavyLoad(0), excessWidth(1), excessLength(2), excessHeight(3)} (SIZE(4)) - -LightBarSirenInUse ::= BIT STRING { - lightBarActivated (0), - sirenActivated (1) -} (SIZE(2)) - -HeightLonCarr ::= INTEGER {oneCentimeter(1), unavailable(100)} (1..100) - -PosLonCarr ::= INTEGER {oneCentimeter(1), unavailable(127)} (1..127) - -PosPillar ::= INTEGER {tenCentimeters(1), unavailable(30)} (1..30) - -PosCentMass ::= INTEGER {tenCentimeters(1), unavailable(63)} (1..63) - -RequestResponseIndication ::= ENUMERATED {request(0), response(1)} - -SpeedLimit ::= INTEGER {oneKmPerHour(1)} (1..255) - -StationarySince ::= ENUMERATED {lessThan1Minute(0), lessThan2Minutes(1), lessThan15Minutes(2), equalOrGreater15Minutes(3)} - -Temperature ::= INTEGER {equalOrSmallerThanMinus60Deg (-60), oneDegreeCelsius(1), equalOrGreaterThan67Deg(67)} (-60..67) - -TrafficRule ::= ENUMERATED {noPassing(0), noPassingForTrucks(1), passToRight(2), passToLeft(3), ... -} - -WheelBaseVehicle ::= INTEGER {tenCentimeters(1), unavailable(127)} (1..127) - -TurningRadius ::= INTEGER {point4Meters(1), unavailable(255)} (1..255) - -PosFrontAx ::= INTEGER {tenCentimeters(1), unavailable(20)} (1..20) - -PositionOfOccupants ::= BIT STRING { - row1LeftOccupied (0), - row1RightOccupied (1), - row1MidOccupied (2), - row1NotDetectable (3), - row1NotPresent (4), - row2LeftOccupied (5), - row2RightOccupied (6), - row2MidOccupied (7), - row2NotDetectable (8), - row2NotPresent (9), - row3LeftOccupied (10), - row3RightOccupied (11), - row3MidOccupied (12), - row3NotDetectable (13), - row3NotPresent (14), - row4LeftOccupied (15), - row4RightOccupied (16), - row4MidOccupied (17), - row4NotDetectable (18), - row4NotPresent (19)} (SIZE(20)) - -PositioningSolutionType ::= ENUMERATED {noPositioningSolution(0), sGNSS(1), dGNSS(2), sGNSSplusDR(3), dGNSSplusDR(4), dR(5), ...} - -VehicleIdentification ::= SEQUENCE { - wMInumber WMInumber OPTIONAL, - vDS VDS OPTIONAL, - ... -} - -WMInumber ::= IA5String (SIZE(1..3)) - -VDS ::= IA5String (SIZE(6)) - -EnergyStorageType ::= BIT STRING {hydrogenStorage(0), electricEnergyStorage(1), liquidPropaneGas(2), compressedNaturalGas(3), diesel(4), gasoline(5), ammonia(6)} (SIZE(7)) - -VehicleLength ::= SEQUENCE { - vehicleLengthValue VehicleLengthValue, - vehicleLengthConfidenceIndication VehicleLengthConfidenceIndication -} - -VehicleLengthValue ::= INTEGER {tenCentimeters(1), outOfRange(1022), unavailable(1023)} (1..1023) - -VehicleLengthConfidenceIndication ::= ENUMERATED {noTrailerPresent(0), trailerPresentWithKnownLength(1), trailerPresentWithUnknownLength(2), trailerPresenceIsUnknown(3), unavailable(4)} - -VehicleWidth ::= INTEGER {tenCentimeters(1), outOfRange(61), unavailable(62)} (1..62) - -PathHistory::= SEQUENCE (SIZE(0..40)) OF PathPoint - -EmergencyPriority ::= BIT STRING {requestForRightOfWay(0), requestForFreeCrossingAtATrafficLight(1)} (SIZE(2)) - -InformationQuality ::= INTEGER {unavailable(0), lowest(1), highest(7)} (0..7) - -RoadType ::= ENUMERATED { - urban-NoStructuralSeparationToOppositeLanes(0), - urban-WithStructuralSeparationToOppositeLanes(1), - nonUrban-NoStructuralSeparationToOppositeLanes(2), - nonUrban-WithStructuralSeparationToOppositeLanes(3)} - -SteeringWheelAngle ::= SEQUENCE { - steeringWheelAngleValue SteeringWheelAngleValue, - steeringWheelAngleConfidence SteeringWheelAngleConfidence -} - -SteeringWheelAngleValue ::= INTEGER {straight(0), onePointFiveDegreesToRight(-1), onePointFiveDegreesToLeft(1), unavailable(512)} (-511..512) - -SteeringWheelAngleConfidence ::= INTEGER {equalOrWithinOnePointFiveDegree (1), outOfRange(126), unavailable(127)} (1..127) - -TimestampIts ::= INTEGER {utcStartOf2004(0), oneMillisecAfterUTCStartOf2004(1)} (0..4398046511103) - -VehicleRole ::= ENUMERATED {default(0), publicTransport(1), specialTransport(2), dangerousGoods(3), roadWork(4), rescue(5), emergency(6), safetyCar(7), agriculture(8), commercial(9), military(10), roadOperator(11), taxi(12), reserved1(13), reserved2(14), reserved3(15)} - -YawRate::= SEQUENCE { - yawRateValue YawRateValue, - yawRateConfidence YawRateConfidence -} - -YawRateValue ::= INTEGER {straight(0), degSec-000-01ToRight(-1), degSec-000-01ToLeft(1), unavailable(32767)} (-32766..32767) - -YawRateConfidence ::= ENUMERATED { - degSec-000-01 (0), - degSec-000-05 (1), - degSec-000-10 (2), - degSec-001-00 (3), - degSec-005-00 (4), - degSec-010-00 (5), - degSec-100-00 (6), - outOfRange (7), - unavailable (8) -} - -ProtectedZoneType::= ENUMERATED { permanentCenDsrcTolling (0), ..., temporaryCenDsrcTolling (1) } - -RelevanceDistance ::= ENUMERATED {lessThan50m(0), lessThan100m(1), lessThan200m(2), lessThan500m(3), lessThan1000m(4), lessThan5km(5), lessThan10km(6), over10km(7)} - -RelevanceTrafficDirection ::= ENUMERATED {allTrafficDirections(0), upstreamTraffic(1), downstreamTraffic(2), oppositeTraffic(3)} - -TransmissionInterval ::= INTEGER {oneMilliSecond(1), tenSeconds(10000)} (1..10000) - -ValidityDuration ::= INTEGER {timeOfDetection(0), oneSecondAfterDetection(1)} (0..86400) - -ActionID ::= SEQUENCE { - originatingStationID StationID, - sequenceNumber SequenceNumber -} - -ItineraryPath ::= SEQUENCE SIZE(1..40) OF ReferencePosition - -ProtectedCommunicationZone ::= SEQUENCE { - protectedZoneType ProtectedZoneType, - expiryTime TimestampIts OPTIONAL, - protectedZoneLatitude Latitude, - protectedZoneLongitude Longitude, - protectedZoneRadius ProtectedZoneRadius OPTIONAL, - protectedZoneID ProtectedZoneID OPTIONAL, - ... -} - -Traces ::= SEQUENCE SIZE(1..7) OF PathHistory - -NumberOfOccupants ::= INTEGER {oneOccupant (1), unavailable(127)} (0 .. 127) - -SequenceNumber ::= INTEGER (0..65535) - -PositionOfPillars ::= SEQUENCE (SIZE(1..3, ...)) OF PosPillar - -RestrictedTypes ::= SEQUENCE (SIZE(1..3, ...)) OF StationType - -EventHistory::= SEQUENCE (SIZE(1..23)) OF EventPoint - -EventPoint ::= SEQUENCE { - eventPosition DeltaReferencePosition, - eventDeltaTime PathDeltaTime OPTIONAL, - informationQuality InformationQuality -} - -ProtectedCommunicationZonesRSU ::= SEQUENCE (SIZE(1..16)) OF ProtectedCommunicationZone - -CenDsrcTollingZone ::= SEQUENCE { - protectedZoneLatitude Latitude, - protectedZoneLongitude Longitude, - cenDsrcTollingZoneID CenDsrcTollingZoneID OPTIONAL, - ... -} - -ProtectedZoneRadius ::= INTEGER {oneMeter(1)} (1..255,...) - -ProtectedZoneID ::= INTEGER (0.. 134217727) - -CenDsrcTollingZoneID ::= ProtectedZoneID - -DigitalMap ::= SEQUENCE (SIZE(1..256)) OF ReferencePosition - -OpeningDaysHours ::= UTF8String - -PhoneNumber ::= NumericString (SIZE(1..16)) -END diff --git a/asn1/ITS-Container/module.mk b/asn1/ITS-Container/module.mk deleted file mode 100644 index 0b107446..00000000 --- a/asn1/ITS-Container/module.mk +++ /dev/null @@ -1 +0,0 @@ -sources := ITS_Container.asn \ No newline at end of file diff --git a/asn1/ProtocolManagementInformation/ProtocolManagementInformation.asn b/asn1/ProtocolManagementInformation/ProtocolManagementInformation.asn deleted file mode 100644 index 44a1050b..00000000 --- a/asn1/ProtocolManagementInformation/ProtocolManagementInformation.asn +++ /dev/null @@ -1,181 +0,0 @@ -ProtocolManagementInformation {iso(1) standard(0) iso15662(15662) protocolManagementInformation(1)} DEFINITIONS AUTOMATIC TAGS ::= BEGIN - -ProtocolManagementInformation ::= SEQUENCE{ - selectionOfCommunicationSysyem SelectionOfCommunicationSystem OPTIONAL, - applicationIdentifiers ApplicationIdentifiers OPTIONAL, - address Address OPTIONAL, - priority Priority OPTIONAL, - security Security OPTIONAL, - applicationExecution ApplicationExecution OPTIONAL - } - -SelectionOfCommunicationSystem ::= SEQUENCE{ --see 4.1 - responsiveness Responsiveness OPTIONAL, - directionality Directionality OPTIONAL, - usageEnvironment UsageEnvironment OPTIONAL, - serviceArea ServiceArea OPTIONAL, - serviceTime ServiceTime OPTIONAL, - bandwidth Bandwidth OPTIONAL, - connectionCost ConnectionCost OPTIONAL - } - -ApplicationIdentifiers ::= SEQUENCE{ --see 4.2 - messageIdentifier EXTERNAL OPTIONAL, - messageNumber INTEGER OPTIONAL, - timeOfMessageTransmission GeneralizedTime OPTIONAL - } - -Address ::= SEQUENCE{ --see 4.3 - addressOfOrigin EXTERNAL OPTIONAL, - addressOfDestination EXTERNAL OPTIONAL - } - -Priority ::= SEQUENCE{ --see 4.4 - interruptHandling INTEGER{ - undefined (0), - lowPriority (1), - middlePriority (2), - highPriority (3)}, - interruptHandlingLevel INTEGER OPTIONAL, - queueControl INTEGER{ - undefined-FIFO (0), - lIFO (1), - random (2), - re-try (3), - errorNotification (4) - } - } - -Security ::= BIT STRING { --see 4.5 - userAuthentication (0), - terminalAuthentication (1), - dataAuthentication (2), - consealment (3) - } - -ApplicationExecution ::= SEQUENCE{ --see 4.6 - validTime ValidTime, - timeStamp GeneralizedTime, - targetArea TargetArea - } - -Responsiveness ::= SEQUENCE{ --see 4.1.1 - responsivenessCode INTEGER{ - undefined (0), - within1Sec (1), - within30Sec (2), - oneMinute (3), - fifteenMinute (4), - other (5), - error (6) - }, - responsivenessValue UTCTime OPTIONAL - } - -Directionality ::= INTEGER{ --see 4.1.2 - undefined (0), - unidirectional (1), - bidirectional-Symmetric (2), - bidirectional-UpLarger (3), - bidirectional-DownLarger (4) - } - -UsageEnvironment ::= SEQUENCE { --see 4.1.3 - meansOfTransportation BIT STRING{ - undefined (0), - vehicle (1), - publicTransport (2), - foot (3), - bicycle (4), - motorCycle (5), - moped (6), - car (7), - truck (8), - emergencyVehicle (9), - buss (10), - tram (11), - train (12), - ferry (13), - taxi (14), - other (15) - }, - speed INTEGER{ - undefined (0), - fast (1), - middle (2), - slow (3), - stopped (4), - other (5) - }, - speedValue EXTERNAL OPTIONAL - } - -ServiceArea ::= SEQUENCE{ --see 4.1.4 - serviceAreaCode INTEGER{ - undefined (0), - continuous (1), - non-continuous (2) - }, - serviceAreaValue EXTERNAL OPTIONAL - } - -ServiceTime ::= SEQUENCE{ --see 4.1.5 - serviceTimeCode INTEGER{ - undefined (0), - start-StopTime (1), - startTime (2), - stopTime (3), - continuous (4) - }, - serviceTimeValue EXTERNAL OPTIONAL - } - -Bandwidth ::= SEQUENCE{ --see 4.1.6 - capacityOfTransmissionValue INTEGER OPTIONAL, - dataExpressionCode BIT STRING{ - undefined (0), - text (1), - audio (2), - simpleGraphic (3), - stillImage (4), - video (5), - other (6) - } - } - -ConnectionCost ::= SEQUENCE{ --see 4.1.7 - maximumCostRequirement INTEGER{ - undefined (0), - totalCost (1), - timeUnitPrice (2), - bitUnitPrice (3), - other (4) - }, - maximumCostValue EXTERNAL OPTIONAL - } - -ValidTime ::= SEQUENCE{ --see 4.6.1 - validTimeCode INTEGER{ - undefined (0), - duringReceptionOnly (1), - timeDesignated (2), - untilUpdated (3), - other (4) - }, - validTimeValue EXTERNAL OPTIONAL - } - -TargetArea ::= SEQUENCE{ --see 4.6.3 - targetAreaCode INTEGER{ - undefined (0), - spot (1), - zone (2), - interval (3), - region (4), - wideArea (5), - other (6) - }, - targetAreaValue EXTERNAL OPTIONAL - } - -END diff --git a/asn1/Security/1609Dot2/IEEE1609dot2.asn b/asn1/Security/1609Dot2/IEEE1609dot2.asn deleted file mode 100644 index 43967635..00000000 --- a/asn1/Security/1609Dot2/IEEE1609dot2.asn +++ /dev/null @@ -1,310 +0,0 @@ -IEEE1609dot2 {iso(1) identified-organization(3) ieee(111) -standards-association-numbered-series-standards(2) wave-stds(1609) -dot2(2) base (1) schema (1) major-version-2(2)} - --- Minor version: 1 ---****************************************************************************** --- --- IEEE P1609.2 Data Types --- ---****************************************************************************** - -DEFINITIONS AUTOMATIC TAGS ::= BEGIN - -EXPORTS ALL; - -IMPORTS - CrlSeries, - EccP256CurvePoint, - EciesP256EncryptedKey, - EncryptionKey, - GeographicRegion, - GroupLinkageValue, - HashAlgorithm, - HashedId3, - HashedId8, - Hostname, - IValue, - LinkageValue, - Opaque, - Psid, - PsidSsp, - PsidSspRange, - PublicEncryptionKey, - PublicVerificationKey, - SequenceOfHashedId3, - SequenceOfPsidSsp, - SequenceOfPsidSspRange, - ServiceSpecificPermissions, - Signature, - SubjectAssurance, - SymmetricEncryptionKey, - ThreeDLocation, - Time64, - Uint3, - Uint8, - Uint16, - Uint32, - ValidityPeriod -FROM IEEE1609dot2BaseTypes {iso(1) identified-organization(3) ieee(111) - standards-association-numbered-series-standards(2) wave-stds(1609) - dot2(2) base(1) base-types(2) major-version-2 (2)} - -; - --- ---********************************************************************* --- --- Structures for describing secured data --- ---********************************************************************* - --- Necessary to get certain tools to generate sample PDUs --- TestIeee1609Dot2Data ::= Ieee1609Dot2Data --- TestCertificate ::= Certificate - --- this structure belongs later in the file but putting it here avoids --- compiler errors with certain tools -SignedDataPayload ::= SEQUENCE { - data Ieee1609Dot2Data OPTIONAL, - extDataHash HashedData OPTIONAL, - ... -} - (WITH COMPONENTS {..., data PRESENT} | - WITH COMPONENTS {..., extDataHash PRESENT}) - -Ieee1609Dot2Data ::= SEQUENCE { - protocolVersion Uint8(3), - content Ieee1609Dot2Content -} - -Ieee1609Dot2Content ::= CHOICE { - unsecuredData Opaque, - signedData SignedData, - encryptedData EncryptedData, - signedCertificateRequest Opaque, - ... -} - -SignedData ::= SEQUENCE { - hashId HashAlgorithm, - tbsData ToBeSignedData, - signer SignerIdentifier, - signature Signature -} - -SignerIdentifier ::= CHOICE { - digest HashedId8, - certificate SequenceOfCertificate, - self NULL, - ... -} - -ToBeSignedData ::= SEQUENCE { - payload SignedDataPayload, - headerInfo HeaderInfo -} - -HashedData::= CHOICE { - sha256HashedData OCTET STRING (SIZE(32)), - ... -} - -HeaderInfo ::= SEQUENCE { - psid Psid, - generationTime Time64 OPTIONAL, - expiryTime Time64 OPTIONAL, - generationLocation ThreeDLocation OPTIONAL, - p2pcdLearningRequest HashedId3 OPTIONAL, - missingCrlIdentifier MissingCrlIdentifier OPTIONAL, - encryptionKey EncryptionKey OPTIONAL, - ..., - inlineP2pcdRequest SequenceOfHashedId3 OPTIONAL, - requestedCertificate Certificate OPTIONAL -} - -MissingCrlIdentifier ::= SEQUENCE { - cracaId HashedId3, - crlSeries CrlSeries, - ... -} - -Countersignature ::= Ieee1609Dot2Data (WITH COMPONENTS {..., - content (WITH COMPONENTS {..., - signedData (WITH COMPONENTS {..., - tbsData (WITH COMPONENTS {..., - payload (WITH COMPONENTS {..., - data ABSENT, - extDataHash PRESENT - }), - headerInfo(WITH COMPONENTS {..., - generationTime PRESENT, - expiryTime ABSENT, - generationLocation ABSENT, - p2pcdLearningRequest ABSENT, - missingCrlIdentifier ABSENT, - encryptionKey ABSENT - }) - }) - }) - }) -}) - ---********************************************************************** --- --- Structures for describing encrypted data --- ---********************************************************************** - - -EncryptedData ::= SEQUENCE { - recipients SequenceOfRecipientInfo, - ciphertext SymmetricCiphertext -} -RecipientInfo ::= CHOICE { - pskRecipInfo PreSharedKeyRecipientInfo, - symmRecipInfo SymmRecipientInfo, - certRecipInfo PKRecipientInfo, - signedDataRecipInfo PKRecipientInfo, - rekRecipInfo PKRecipientInfo -} - -SequenceOfRecipientInfo ::= SEQUENCE OF RecipientInfo - -PreSharedKeyRecipientInfo ::= HashedId8 -SymmRecipientInfo ::= SEQUENCE { - recipientId HashedId8, - encKey SymmetricCiphertext -} - -PKRecipientInfo ::= SEQUENCE { - recipientId HashedId8, - encKey EncryptedDataEncryptionKey -} - -EncryptedDataEncryptionKey ::= CHOICE { - eciesNistP256 EciesP256EncryptedKey, - eciesBrainpoolP256r1 EciesP256EncryptedKey, - ... -} - -SymmetricCiphertext ::= CHOICE { - aes128ccm AesCcmCiphertext, - ... -} - -AesCcmCiphertext ::= SEQUENCE { - nonce OCTET STRING (SIZE (12)), - ccmCiphertext Opaque -- 16 bytes longer than plaintext -} - - ---********************************************************************** --- --- Certificates and other security management data structures --- ---********************************************************************** - --- Certificates are implicit (type = implicit, toBeSigned includes --- reconstruction value, signature absent) or explicit (type = explicit, --- toBeSigned includes verification key, signature present). - -Certificate ::= CertificateBase (ImplicitCertificate | ExplicitCertificate) - -SequenceOfCertificate ::= SEQUENCE OF Certificate - -CertificateBase ::= SEQUENCE { - version Uint8(3), - type CertificateType, - issuer IssuerIdentifier, - toBeSigned ToBeSignedCertificate, - signature Signature OPTIONAL -} - -CertificateType ::= ENUMERATED { - explicit, - implicit, - ... -} - -ImplicitCertificate ::= CertificateBase (WITH COMPONENTS {..., - type(implicit), - toBeSigned(WITH COMPONENTS {..., - verifyKeyIndicator(WITH COMPONENTS {reconstructionValue}) - }), - signature ABSENT - }) - -ExplicitCertificate ::= CertificateBase (WITH COMPONENTS {..., - type(explicit), - toBeSigned(WITH COMPONENTS {..., - verifyKeyIndicator(WITH COMPONENTS {verificationKey}) - }), - signature PRESENT - }) - -IssuerIdentifier ::= CHOICE { - sha256AndDigest HashedId8, - self HashAlgorithm, - ..., - sha384AndDigest HashedId8 -} - -ToBeSignedCertificate ::= SEQUENCE { - id CertificateId, - cracaId HashedId3, - crlSeries CrlSeries, - validityPeriod ValidityPeriod, - region GeographicRegion OPTIONAL, - assuranceLevel SubjectAssurance OPTIONAL, - appPermissions SequenceOfPsidSsp OPTIONAL, - certIssuePermissions SequenceOfPsidGroupPermissions OPTIONAL, - certRequestPermissions SequenceOfPsidGroupPermissions OPTIONAL, - canRequestRollover NULL OPTIONAL, - encryptionKey PublicEncryptionKey OPTIONAL, - verifyKeyIndicator VerificationKeyIndicator, - ... -} -(WITH COMPONENTS { ..., appPermissions PRESENT} | - WITH COMPONENTS { ..., certIssuePermissions PRESENT} | - WITH COMPONENTS { ..., certRequestPermissions PRESENT}) - -CertificateId ::= CHOICE { - linkageData LinkageData, - name Hostname, - binaryId OCTET STRING(SIZE(1..64)), - none NULL, - ... -} - -LinkageData ::= SEQUENCE { - iCert IValue, - linkage-value LinkageValue, - group-linkage-value GroupLinkageValue OPTIONAL -} - -EndEntityType ::= BIT STRING {app (0), enrol (1) } (SIZE (8)) (ALL EXCEPT {}) - -PsidGroupPermissions ::= SEQUENCE { - subjectPermissions SubjectPermissions, - minChainLength INTEGER DEFAULT 1, - chainLengthRange INTEGER DEFAULT 0, - eeType EndEntityType DEFAULT {app} -} - -SequenceOfPsidGroupPermissions ::= SEQUENCE OF PsidGroupPermissions - -SubjectPermissions ::= CHOICE { - explicit SequenceOfPsidSspRange, - all NULL, - ... -} - -VerificationKeyIndicator ::= CHOICE { - verificationKey PublicVerificationKey, - reconstructionValue EccP256CurvePoint, - ... -} - -END - diff --git a/asn1/Security/1609Dot2/IEEE1609dot2BaseTypes.asn b/asn1/Security/1609Dot2/IEEE1609dot2BaseTypes.asn deleted file mode 100644 index 59ed4217..00000000 --- a/asn1/Security/1609Dot2/IEEE1609dot2BaseTypes.asn +++ /dev/null @@ -1,334 +0,0 @@ -IEEE1609dot2BaseTypes {iso(1) identified-organization(3) ieee(111) -standards-association-numbered-series-standards(2) wave-stds(1609) -dot2(2) base(1) base-types(2) major-version-2(2)} - --- Minor version: 1 --- ---******************************************************************** --- IEEE P1609.2 Base Data Types --- ---******************************************************************** - -DEFINITIONS AUTOMATIC TAGS ::= BEGIN - -EXPORTS ALL; - - --- ------------------------------------------------------------------ --- --- Integers --- --- ------------------------------------------------------------------ - - -Uint3 ::= INTEGER (0..7) -- (hex) 07 -Uint8 ::= INTEGER (0..255) -- (hex) ff -Uint16 ::= INTEGER (0..65535) -- (hex) ff ff -Uint32 ::= INTEGER (0..4294967295)---- -- (hex) ff ff ff ff -Uint64 ::= INTEGER (0..18446744073709551615) -- (hex) ff ff ff ff ff ff ff ff - -SequenceOfUint8 ::= SEQUENCE OF Uint8 -SequenceOfUint16 ::= SEQUENCE OF Uint16 - --- ------------------------------------------------------------------ --- --- OCTET STRING types --- --- ------------------------------------------------------------------ - - -Opaque ::= OCTET STRING - - -HashedId10 ::= OCTET STRING (SIZE(10)) -HashedId8 ::= OCTET STRING (SIZE(8)) -HashedId3 ::= OCTET STRING (SIZE(3)) -SequenceOfHashedId3 ::= SEQUENCE OF HashedId3 - - --- ------------------------------------------------------------------ --- --- Time --- --- ------------------------------------------------------------------ - -Time32 ::= Uint32 -Time64 ::= Uint64 - -ValidityPeriod ::= SEQUENCE { - start Time32, - duration Duration -} - -Duration ::= CHOICE { - microseconds Uint16, - milliseconds Uint16, - seconds Uint16, - minutes Uint16, - hours Uint16, - sixtyHours Uint16, - years Uint16 -} - --- ------------------------------------------------------------------ --- --- Location --- --- ------------------------------------------------------------------ - - -GeographicRegion ::= CHOICE { - circularRegion CircularRegion, - rectangularRegion SequenceOfRectangularRegion, - polygonalRegion PolygonalRegion, - identifiedRegion SequenceOfIdentifiedRegion, - ... -} - -CircularRegion ::= SEQUENCE { - center TwoDLocation, - radius Uint16 -} - -RectangularRegion ::= SEQUENCE { - northWest TwoDLocation, - southEast TwoDLocation -} - -SequenceOfRectangularRegion ::= SEQUENCE OF RectangularRegion - -PolygonalRegion ::= SEQUENCE SIZE(3..MAX) OF TwoDLocation - -TwoDLocation ::= SEQUENCE { - latitude SecLatitude, - longitude SecLongitude -} - -IdentifiedRegion ::= CHOICE { - countryOnly CountryOnly, - countryAndRegions CountryAndRegions, - countryAndSubregions CountryAndSubregions, - ... -} - -SequenceOfIdentifiedRegion ::= SEQUENCE OF IdentifiedRegion - -CountryOnly ::= Uint16 - -CountryAndRegions ::= SEQUENCE { - countryOnly CountryOnly, - regions SequenceOfUint8 -} - -CountryAndSubregions ::= SEQUENCE { - country CountryOnly, - regionAndSubregions SequenceOfRegionAndSubregions -} - -RegionAndSubregions ::= SEQUENCE { - region Uint8, - subregions SequenceOfUint16 -} - -SequenceOfRegionAndSubregions ::= SEQUENCE OF RegionAndSubregions - -ThreeDLocation ::= SEQUENCE { - latitude SecLatitude, - longitude SecLongitude, - elevation SecElevation -} - -SecLatitude ::= NinetyDegreeInt -SecLongitude ::= OneEightyDegreeInt -SecElevation ::= ElevInt - -NinetyDegreeInt ::= INTEGER { - min (-900000000), - max (900000000), - unknown (900000001) -} (-900000000..900000001) - -KnownLatitude ::= NinetyDegreeInt (min..max) -- Minus 90deg to +90deg in microdegree intervals -UnknownLatitude ::= NinetyDegreeInt (unknown) - -OneEightyDegreeInt ::= INTEGER { - min (-1799999999), - max (1800000000), - unknown (1800000001) -} (-1799999999..1800000001) - -KnownLongitude ::= OneEightyDegreeInt (min..max) -UnknownLongitude ::= OneEightyDegreeInt (unknown) - -ElevInt ::= Uint16 -- Range is from -4096 to 61439 in units of one-tenth of a meter - --- ------------------------------------------------------------------ --- --- Crypto --- --- ------------------------------------------------------------------ - -Signature ::= CHOICE { - ecdsaNistP256Signature EcdsaP256Signature, - ecdsaBrainpoolP256r1Signature EcdsaP256Signature, - ..., - ecdsaBrainpoolP384r1Signature EcdsaP384Signature -} - -EcdsaP256Signature ::= SEQUENCE { - rSig EccP256CurvePoint, - sSig OCTET STRING (SIZE (32)) -} - -EcdsaP384Signature ::= SEQUENCE { - rSig EccP384CurvePoint, - sSig OCTET STRING (SIZE (48)) -} - -EccP256CurvePoint ::= CHOICE { - x-only OCTET STRING (SIZE (32)), - fill NULL, -- consistency with 1363 / X9.62 - compressed-y-0 OCTET STRING (SIZE (32)), - compressed-y-1 OCTET STRING (SIZE (32)), - uncompressedP256 SEQUENCE { - x OCTET STRING (SIZE (32)), - y OCTET STRING (SIZE (32)) - } -} - -EccP384CurvePoint::= CHOICE { - x-only OCTET STRING (SIZE (48)), - fill NULL, -- consistency w 1363 / X9.62 - compressed-y-0 OCTET STRING (SIZE (48)), - compressed-y-1 OCTET STRING (SIZE (48)), - uncompressedP384 SEQUENCE { - x OCTET STRING (SIZE (48)), - y OCTET STRING (SIZE (48)) - } -} - - -SymmAlgorithm ::= ENUMERATED { - aes128Ccm, - ... -} - -HashAlgorithm ::= ENUMERATED { - sha256, - ..., - sha384 -} - -EciesP256EncryptedKey ::= SEQUENCE { - v EccP256CurvePoint, - c OCTET STRING (SIZE (16)), - t OCTET STRING (SIZE (16)) -} - -EncryptionKey ::= CHOICE { - public PublicEncryptionKey, - symmetric SymmetricEncryptionKey -} - -PublicEncryptionKey ::= SEQUENCE { - supportedSymmAlg SymmAlgorithm, - publicKey BasePublicEncryptionKey -} - -BasePublicEncryptionKey ::= CHOICE { - eciesNistP256 EccP256CurvePoint, - eciesBrainpoolP256r1 EccP256CurvePoint, - ... -} - -PublicVerificationKey ::= CHOICE { - ecdsaNistP256 EccP256CurvePoint, - ecdsaBrainpoolP256r1 EccP256CurvePoint, - ..., - ecdsaBrainpoolP384r1 EccP384CurvePoint -} - -SymmetricEncryptionKey ::= CHOICE { - aes128Ccm OCTET STRING(SIZE(16)), - ... -} - --- ------------------------------------------------------------------ --- --- PSID / ITS-AID --- --- ------------------------------------------------------------------ - - -PsidSsp ::= SEQUENCE { - psid Psid, - ssp ServiceSpecificPermissions OPTIONAL -} - -SequenceOfPsidSsp ::= SEQUENCE OF PsidSsp - -Psid ::= INTEGER (0..MAX) - -SequenceOfPsid ::= SEQUENCE OF Psid - -ServiceSpecificPermissions ::= CHOICE { - opaque OCTET STRING (SIZE(0..MAX)), - ..., - bitmapSsp BitmapSsp -} - -BitmapSsp ::= OCTET STRING (SIZE(0..31)) - -PsidSspRange ::= SEQUENCE { - psid Psid, - sspRange SspRange OPTIONAL -} - -SequenceOfPsidSspRange ::= SEQUENCE OF PsidSspRange - -SspRange ::= CHOICE { - opaque SequenceOfOctetString, - all NULL, - ... , - bitmapSspRange BitmapSspRange -} - -BitmapSspRange ::= SEQUENCE { - sspValue OCTET STRING (SIZE(1..32)), - sspBitmask OCTET STRING (SIZE(1..32)) -} - -SequenceOfOctetString ::= SEQUENCE (SIZE (0..MAX)) OF - OCTET STRING (SIZE(0..MAX)) - - --- ------------------------------------------------------------------ --- --- Goes in certs --- --- ------------------------------------------------------------------ - -SubjectAssurance ::= OCTET STRING (SIZE(1)) - -CrlSeries ::= Uint16 - - --- ------------------------------------------------------------------ --- --- Pseudonym Linkage --- --- ------------------------------------------------------------------ - -IValue ::= Uint16 -Hostname ::= UTF8String (SIZE(0..255)) -LinkageValue ::= OCTET STRING (SIZE(9)) -GroupLinkageValue ::= SEQUENCE { - jValue OCTET STRING (SIZE(4)), - value OCTET STRING (SIZE(9)) -} - -LaId ::= OCTET STRING (SIZE(2)) -LinkageSeed ::= OCTET STRING (SIZE(16)) - -END - diff --git a/asn1/Security/EtsiTs103097Module.asn b/asn1/Security/EtsiTs103097Module.asn deleted file mode 100644 index 7b000601..00000000 --- a/asn1/Security/EtsiTs103097Module.asn +++ /dev/null @@ -1,103 +0,0 @@ -EtsiTs103097Module -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) v1(0) } - -DEFINITIONS AUTOMATIC TAGS ::= BEGIN - -IMPORTS - -Ieee1609Dot2Data, ExplicitCertificate - -FROM - -IEEE1609dot2 {iso(1) identified-organization(3) ieee(111) -standards-association-numbered-series-standards(2) wave-stds(1609) -dot2(2) base (1) schema (1) major-version-2(2)}; - -EtsiTs103097Certificate::= ExplicitCertificate (WITH COMPONENTS{..., - toBeSigned (WITH COMPONENTS{..., - id (WITH COMPONENTS{..., - linkageData ABSENT, - binaryId ABSENT - }), - certRequestPermissions ABSENT, - canRequestRollover ABSENT - }) - }) - -SingleEtsiTs103097Certificate ::= SEQUENCE { - only EtsiTs103097Certificate -} - - -EtsiTs103097Data::=Ieee1609Dot2Data (WITH COMPONENTS {..., - content (WITH COMPONENTS {..., - signedData (WITH COMPONENTS {..., -- constraints on signed data headers - tbsData (WITH COMPONENTS { - headerInfo (WITH COMPONENTS {..., - generationTime PRESENT, - p2pcdLearningRequest ABSENT, - missingCrlIdentifier ABSENT - }) - }), - signer (WITH COMPONENTS {..., --constraints on the certificate - certificate --(WITH COMPONENT (SingleEtsiTs103097Certificate)) - }) - }), - encryptedData (WITH COMPONENTS {..., -- constraints on encrypted data headers - recipients (WITH COMPONENT ( - (WITH COMPONENTS {..., - symmRecipInfo ABSENT, - rekRecipInfo ABSENT - }) - )) - }), - signedCertificateRequest ABSENT - }) -}) - -EtsiTs103097Data-Signed {ToBeSignedDataContent} ::= EtsiTs103097Data (WITH COMPONENTS {..., - content (WITH COMPONENTS { - signedData (WITH COMPONENTS {..., - tbsData (WITH COMPONENTS { - payload (WITH COMPONENTS { - data (WITH COMPONENTS {..., - content (WITH COMPONENTS { - unsecuredData (CONTAINING ToBeSignedDataContent) - }) - }) PRESENT - }) - }) - }) - }) -}) - -EtsiTs103097Data-SignedExternalPayload ::= EtsiTs103097Data (WITH COMPONENTS {..., - content (WITH COMPONENTS { - signedData (WITH COMPONENTS {..., - tbsData (WITH COMPONENTS { - payload (WITH COMPONENTS { - extDataHash (WITH COMPONENTS { - sha256HashedData PRESENT - }) PRESENT - }) - }) - }) - }) -}) - -EtsiTs103097Data-Encrypted {ToBeEncryptedDataContent} ::= EtsiTs103097Data (WITH COMPONENTS {..., - content (WITH COMPONENTS { - encryptedData (WITH COMPONENTS {..., - ciphertext (WITH COMPONENTS {..., - aes128ccm (WITH COMPONENTS {..., - ccmCiphertext (CONSTRAINED BY {-- ccm encryption of -- ToBeEncryptedDataContent}) - }) - }) - }) - }) -}) - - -EtsiTs103097Data-SignedAndEncrypted {ToBesignedAndEncryptedDataContent} ::= EtsiTs103097Data-Encrypted {EtsiTs103097Data-Signed {ToBesignedAndEncryptedDataContent}} - -END diff --git a/asn1/Security/TS102921/EtsiTs102941BaseTypes.asn b/asn1/Security/TS102921/EtsiTs102941BaseTypes.asn deleted file mode 100644 index 20eacfa8..00000000 --- a/asn1/Security/TS102921/EtsiTs102941BaseTypes.asn +++ /dev/null @@ -1,77 +0,0 @@ -EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version2(2) } - -DEFINITIONS AUTOMATIC TAGS ::= -BEGIN - -IMPORTS -HashedId8, Time32, PublicEncryptionKey, PublicVerificationKey, Signature -FROM -IEEE1609dot2BaseTypes {iso(1) identified-organization(3) ieee(111) -standards-association-numbered-series-standards(2) wave-stds(1609) -dot2(2) base(1) base-types(2) major-version-2(2)} - - CertificateId, SubjectAssurance, SequenceOfPsidSsp, SequenceOfPsidGroupPermissions, - ValidityPeriod, GeographicRegion -FROM -IEEE1609dot2 {iso(1) identified-organization(3) ieee(111) -standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) base (1) schema (1) major-version-2(2)} - - EtsiTs103097Data, EtsiTs103097Data-Encrypted, EtsiTs103097Data-Signed, -EtsiTs103097Data-SignedExternalPayload -FROM - EtsiTs103097Module { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} -; - -CertificateFormat::= INTEGER { - ts103097v131 (1) - }(1..255) - -CertificateSubjectAttributes ::= SEQUENCE { - id CertificateId OPTIONAL, - validityPeriod ValidityPeriod OPTIONAL, - region GeographicRegion OPTIONAL, - assuranceLevel SubjectAssurance OPTIONAL, - appPermissions SequenceOfPsidSsp OPTIONAL, - certIssuePermissions SequenceOfPsidGroupPermissions OPTIONAL, - ... - }(WITH COMPONENTS { ..., appPermissions PRESENT} | - WITH COMPONENTS { ..., certIssuePermissions PRESENT}) - -EcSignature::= CHOICE { - encryptedEcSignature EtsiTs103097Data-Encrypted{EtsiTs103097Data-SignedExternalPayload}, - ecSignature EtsiTs103097Data-SignedExternalPayload - } - -PublicKeys ::= SEQUENCE { - verificationKey PublicVerificationKey, - encryptionKey PublicEncryptionKey OPTIONAL - } - -Version ::= INTEGER {v1(1)} - -EtsiTs103097Data-Unsecured {ToBeSentDataContent} ::= EtsiTs103097Data (WITH COMPONENTS {..., - content (WITH COMPONENTS { - unsecuredData (CONTAINING ToBeSentDataContent) - }) -}) - -EtsiTs103097Data-Encrypted-Unicast {ToBeEncryptedDataContent} ::= EtsiTs103097Data-Encrypted { EtsiTs103097Data-Unsecured{ToBeEncryptedDataContent}} -(WITH COMPONENTS {..., - content (WITH COMPONENTS { - encryptedData (WITH COMPONENTS {..., - recipients (SIZE(1)) - }) - }) -}) - -EtsiTs103097Data-SignedAndEncrypted-Unicast {ToBesignedAndEncryptedDataContent} ::= EtsiTs103097Data-Encrypted {EtsiTs103097Data-Signed {ToBesignedAndEncryptedDataContent}} -(WITH COMPONENTS {..., - content (WITH COMPONENTS { - encryptedData (WITH COMPONENTS {..., - recipients (SIZE(1)) - }) - }) -}) - -END diff --git a/asn1/Security/TS102921/EtsiTs102941MessagesCa.asn b/asn1/Security/TS102921/EtsiTs102941MessagesCa.asn deleted file mode 100644 index 6c4df67b..00000000 --- a/asn1/Security/TS102921/EtsiTs102941MessagesCa.asn +++ /dev/null @@ -1,87 +0,0 @@ -/************************************************************************************* - This file contains the EtsiTs102941Messages module containing all possible PKI messages. - It should be used when all PKI messages needs to be implemented (for example, for CA development) -**************************************************************************************/ -EtsiTs102941MessagesCa - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) messagesCa(0) version2(2)} - -DEFINITIONS AUTOMATIC TAGS ::= -BEGIN - -IMPORTS - -EtsiTs103097Data-Signed, ---EtsiTs103097Data-Encrypted, -EtsiTs103097Data-SignedExternalPayload ---EtsiTs103097Data-SignedAndEncrypted -FROM EtsiTs103097Module -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} - -Version, -EtsiTs103097Data-Encrypted-Unicast, -EtsiTs103097Data-SignedAndEncrypted-Unicast -FROM EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version2(2) } - -InnerEcRequestSignedForPop, InnerEcResponse -FROM EtsiTs102941TypesEnrolment -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) enrolment(4) version2(2) } - -InnerAtRequest, InnerAtResponse -FROM EtsiTs102941TypesAuthorization -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version2(2) } - -ToBeSignedCrl, ToBeSignedTlmCtl, ToBeSignedRcaCtl -FROM EtsiTs102941TrustLists -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) trustLists(6) version2(2) } - -AuthorizationValidationRequest, AuthorizationValidationResponse -FROM EtsiTs102941TypesAuthorizationValidation -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authValidation(7) version2(2) } - -CaCertificateRequest -FROM EtsiTs102941TypesCaManagement -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) caManagement(8) version2(2) } - -; - -/************ --- Messages -************/ -EnrolmentRequestMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentRequest PRESENT})})} -EnrolmentResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentResponse PRESENT})})} -AuthorizationRequestMessage ::= EtsiTs103097Data-Encrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} -AuthorizationRequestMessageWithPop ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} -AuthorizationResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationResponse PRESENT})})} -CertificateRevocationListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateRevocationList PRESENT})})} -TlmCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListTlm PRESENT})})} -RcaCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListRca PRESENT})})} -AuthorizationValidationRequestMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationValidationRequest PRESENT})})} -AuthorizationValidationResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationValidationResponse PRESENT})})} -CaCertificateRequestMessage ::= EtsiTs103097Data-Signed {EtsiTs102941Data(WITH COMPONENTS{..., content (WITH COMPONENTS{caCertificateRequest PRESENT})})} -CaCertificateRekeyingMessage ::= EtsiTs103097Data-Signed {EtsiTs103097Data-Signed {EtsiTs102941Data(WITH COMPONENTS{..., content (WITH COMPONENTS{caCertificateRequest PRESENT})})}} - -/************ --- EtsiTs102941Data -************/ - -EtsiTs102941Data::= SEQUENCE { - version Version (v1), --(1..255) Required for TITAN - content EtsiTs102941DataContent - } - -EtsiTs102941DataContent ::= CHOICE { - enrolmentRequest InnerEcRequestSignedForPop, - enrolmentResponse InnerEcResponse, - authorizationRequest InnerAtRequest, - authorizationResponse InnerAtResponse, - certificateRevocationList ToBeSignedCrl, - certificateTrustListTlm ToBeSignedTlmCtl, - certificateTrustListRca ToBeSignedRcaCtl, - authorizationValidationRequest AuthorizationValidationRequest, - authorizationValidationResponse AuthorizationValidationResponse, - caCertificateRequest CaCertificateRequest, - ... - } - -END diff --git a/asn1/Security/TS102921/EtsiTs102941MessagesItss-OptionalPrivacy.asn b/asn1/Security/TS102921/EtsiTs102941MessagesItss-OptionalPrivacy.asn deleted file mode 100644 index cffcef73..00000000 --- a/asn1/Security/TS102921/EtsiTs102941MessagesItss-OptionalPrivacy.asn +++ /dev/null @@ -1,75 +0,0 @@ -/************************************************************************************* - This file contains the EtsiTs102941MessagesItss-OptionalPrivacy module providing the - same subset of messages as the EtsiTs102941MessagesItss module. - It should never be used together with the EtsiTs102941MessagesCA and EtsiTs102941MessagesItss - - This module allows the usage of unencrypted EC signature for AA requests. -**************************************************************************************/ -EtsiTs102941MessagesItss-OptionalPrivacy - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) messagesItssOp(2) version2(2)} - -DEFINITIONS AUTOMATIC TAGS ::= -BEGIN - -IMPORTS - -EtsiTs103097Data-Signed ---EtsiTs103097Data-Encrypted, ---EtsiTs103097Data-SignedAndEncrypted -FROM EtsiTs103097Module -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0) } - -EtsiTs103097Data-Encrypted-Unicast, -EtsiTs103097Data-SignedAndEncrypted-Unicast, -Version -FROM EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version2(2) } - -InnerEcRequestSignedForPop, InnerEcResponse -FROM EtsiTs102941TypesEnrolment -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) enrolment(4) version2(2) } - -InnerAtRequest, InnerAtResponse -FROM EtsiTs102941TypesAuthorization -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version2(2) } - -ToBeSignedCrl, ToBeSignedTlmCtl, ToBeSignedRcaCtl -FROM EtsiTs102941TrustLists -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) trustLists(6) version2(2) } - -; - -/************ --- Messages -************/ - -EnrolmentRequestMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentRequest PRESENT})})} -EnrolmentResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentResponse PRESENT})})} -AuthorizationRequestMessage ::= EtsiTs103097Data-Encrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} -AuthorizationRequestMessageWithPop ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} -AuthorizationResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationResponse PRESENT})})} -CertificateRevocationListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateRevocationList PRESENT})})} -TlmCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListTlm PRESENT})})} -RcaCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListRca PRESENT})})} - -/************ --- EtsiTs102941Data -************/ - -EtsiTs102941Data::= SEQUENCE { - version Version (v1), --(1..255) Required for TITAN - content EtsiTs102941DataContent - } - -EtsiTs102941DataContent ::= CHOICE { - enrolmentRequest InnerEcRequestSignedForPop, - enrolmentResponse InnerEcResponse, - authorizationRequest InnerAtRequest, - authorizationResponse InnerAtResponse, - certificateRevocationList ToBeSignedCrl, - certificateTrustListTlm ToBeSignedTlmCtl, - certificateTrustListRca ToBeSignedRcaCtl, - ... - } - -END diff --git a/asn1/Security/TS102921/EtsiTs102941MessagesItss.asn b/asn1/Security/TS102921/EtsiTs102941MessagesItss.asn deleted file mode 100644 index 1ff502bb..00000000 --- a/asn1/Security/TS102921/EtsiTs102941MessagesItss.asn +++ /dev/null @@ -1,82 +0,0 @@ -/************************************************************************************* - This file contains the EtsiTs102941MessagesItss module providing the ITS-S subset - of messages defined in the module EtsiTs102941MessagesCA - It should never be imported together with the module EtsiTs102941MessagesCA. - Use the EtsiTs102941MessagesCA if all possible PKI message types are needed. - - This module blocks the usage of unencrypted EC signature for AA requests. -**************************************************************************************/ -EtsiTs102941MessagesItss - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) messagesItss(1) version2(2)} - -DEFINITIONS AUTOMATIC TAGS ::= -BEGIN - -IMPORTS - -EtsiTs103097Data-Signed ---EtsiTs103097Data-Encrypted, ---EtsiTs103097Data-SignedAndEncrypted -FROM EtsiTs103097Module -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0) } - -EtsiTs103097Data-Encrypted-Unicast, -EtsiTs103097Data-SignedAndEncrypted-Unicast, -Version -FROM EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version2(2) } - -InnerEcRequestSignedForPop, InnerEcResponse -FROM EtsiTs102941TypesEnrolment -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) enrolment(4) version2(2) } - -InnerAtRequest, InnerAtResponse -FROM EtsiTs102941TypesAuthorization -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version2(2) } - -ToBeSignedCrl, ToBeSignedTlmCtl, ToBeSignedRcaCtl -FROM EtsiTs102941TrustLists -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) trustLists(6) version2(2) } - -; - -/************ --- Messages -************/ - -EnrolmentRequestMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentRequest PRESENT})})} -EnrolmentResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{enrolmentResponse PRESENT})})} -AuthorizationRequestMessage ::= EtsiTs103097Data-Encrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} -AuthorizationRequestMessageWithPop ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationRequest PRESENT})})} -AuthorizationResponseMessage ::= EtsiTs103097Data-SignedAndEncrypted-Unicast {EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{authorizationResponse PRESENT})})} -CertificateRevocationListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateRevocationList PRESENT})})} -TlmCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListTlm PRESENT})})} -RcaCertificateTrustListMessage ::= EtsiTs103097Data-Signed{EtsiTs102941Data (WITH COMPONENTS{..., content (WITH COMPONENTS{certificateTrustListRca PRESENT})})} - -/************ --- EtsiTs102941Data -************/ - -EtsiTs102941Data::= SEQUENCE { - version Version, - content EtsiTs102941DataContent - } - -EtsiTs102941DataContent ::= CHOICE { - enrolmentRequest InnerEcRequestSignedForPop, - enrolmentResponse InnerEcResponse, - authorizationRequest InnerAtRequest, - authorizationResponse InnerAtResponse, - certificateRevocationList ToBeSignedCrl, - certificateTrustListTlm ToBeSignedTlmCtl, - certificateTrustListRca ToBeSignedRcaCtl, - ... - } (WITH COMPONENTS{..., - authorizationRequest (WITH COMPONENTS{..., - ecSignature (WITH COMPONENTS{..., - encryptedEcSignature PRESENT - }) - }) - }) - -END diff --git a/asn1/Security/TS102921/EtsiTs102941TrustLists.asn b/asn1/Security/TS102921/EtsiTs102941TrustLists.asn deleted file mode 100644 index 1f7469dd..00000000 --- a/asn1/Security/TS102921/EtsiTs102941TrustLists.asn +++ /dev/null @@ -1,142 +0,0 @@ -EtsiTs102941TrustLists - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) trustLists(6) version2(2)} - -DEFINITIONS AUTOMATIC TAGS ::= -BEGIN - -IMPORTS - -EtsiTs103097Certificate, EtsiTs103097Data-SignedAndEncrypted, EtsiTs103097Data-Signed -FROM -EtsiTs103097Module -{itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} - -HashedId8, Time32, Version --, CertificateAuthorityConstraints -FROM EtsiTs102941BaseTypes -{itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version2(2)} - -; - -/************ --- CRL -************/ -ToBeSignedCrl ::= SEQUENCE { - version Version, - thisUpdate Time32, - nextUpdate Time32, - entries SEQUENCE OF CrlEntry, - ... -} - -CrlEntry ::= HashedId8 - -/************ --- TLM CTL -************/ - -ToBeSignedTlmCtl ::= CtlFormat (FullCtl | DeltaCtl) (WITH COMPONENTS {..., - ctlCommands ( WITH COMPONENT( - ( WITH COMPONENTS {..., - add ( WITH COMPONENTS {..., - ea ABSENT, - aa ABSENT - }) - }) - )) -}) - -/************ --- RCA CTL -************/ - -ToBeSignedRcaCtl ::= CtlFormat (FullCtl | DeltaCtl) ( WITH COMPONENTS {..., - ctlCommands ( WITH COMPONENT( - ( WITH COMPONENTS {..., - add ( WITH COMPONENTS {..., - rca ABSENT, - tlm ABSENT - }) - }) - )) -}) - -/************ --- CTL -************/ - -FullCtl::= CtlFormat ( WITH COMPONENTS {..., - isFullCtl ( TRUE ), - ctlCommands ( WITH COMPONENT( - ( WITH COMPONENTS {..., - delete ABSENT - }) - )) -}) - -DeltaCtl::= CtlFormat (WITH COMPONENTS {..., - isFullCtl(FALSE) -}) - - -CtlFormat ::= SEQUENCE { - version Version, - nextUpdate Time32, - isFullCtl BOOLEAN, - ctlSequence INTEGER (0..255), - ctlCommands SEQUENCE OF CtlCommand, - ... -} - -CtlCommand ::= CHOICE { - add CtlEntry, - delete CtlDelete, - ... -} - -CtlEntry ::= CHOICE { - rca RootCaEntry, - ea EaEntry, - aa AaEntry, - dc DcEntry, - tlm TlmEntry, - ... -} - -CtlDelete ::= CHOICE { - cert HashedId8, - dc DcDelete, - ... -} - -TlmEntry::= SEQUENCE { - selfSignedTLMCertificate EtsiTs103097Certificate, - linkTLMCertificate EtsiTs103097Certificate OPTIONAL, - accessPoint Url -} - -RootCaEntry ::= SEQUENCE { - selfsignedRootCa EtsiTs103097Certificate, - linkRootCaCertificate EtsiTs103097Certificate OPTIONAL -} - -EaEntry ::= SEQUENCE { - eaCertificate EtsiTs103097Certificate, - aaAccessPoint Url, - itsAccessPoint Url OPTIONAL -} - -AaEntry ::= SEQUENCE { - aaCertificate EtsiTs103097Certificate, - accessPoint Url -} - -DcEntry ::= SEQUENCE { - url Url, - cert SEQUENCE OF HashedId8 -} - -DcDelete ::= Url - -Url::= IA5String - -END diff --git a/asn1/Security/TS102921/EtsiTs102941TypesAuthorization.asn b/asn1/Security/TS102921/EtsiTs102941TypesAuthorization.asn deleted file mode 100644 index 3ea56ef7..00000000 --- a/asn1/Security/TS102921/EtsiTs102941TypesAuthorization.asn +++ /dev/null @@ -1,91 +0,0 @@ -EtsiTs102941TypesAuthorization - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version2(2)} - -DEFINITIONS AUTOMATIC TAGS ::= -BEGIN - -IMPORTS - -EtsiTs103097Certificate, -EtsiTs103097Data-Signed -FROM EtsiTs103097Module -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} - -CertificateFormat, CertificateSubjectAttributes, EcSignature, HashedId8, PublicKeys, Version -FROM EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version2(2) } - -; - -/************ --- AuthorizationRequest/Response -************/ - -AuthorizationResponseCode ::= ENUMERATED { - ok(0), - -- ITS->AA - its-aa-cantparse, -- valid for any structure - its-aa-badcontenttype, -- not encrypted, not signed, not authorizationrequest - its-aa-imnottherecipient, -- the "recipients" of the outermost encrypted data doesn't include me - its-aa-unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm - its-aa-decryptionfailed, -- works for ECIES-HMAC and AES-CCM - its-aa-keysdontmatch, -- HMAC keyTag verification fails - its-aa-incompleterequest, -- some elements are missing - its-aa-invalidencryptionkey, -- the responseEncryptionKey is bad - its-aa-outofsyncrequest, -- signingTime is outside acceptable limits - its-aa-unknownea, -- the EA identified by eaId is unknown to me - its-aa-invalidea, -- the EA certificate is revoked - its-aa-deniedpermissions, -- I, the AA, deny the requested permissions - -- AA->EA - aa-ea-cantreachea, -- the EA is unreachable (network error?) - -- EA->AA - ea-aa-cantparse, -- valid for any structure - ea-aa-badcontenttype, -- not encrypted, not signed, not authorizationrequest - ea-aa-imnottherecipient, -- the "recipients" of the outermost encrypted data doesn't include me - ea-aa-unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm - ea-aa-decryptionfailed, -- works for ECIES-HMAC and AES-CCM - -- TODO: to be continued... - invalidaa, -- the AA certificate presented is invalid/revoked/whatever - invalidaasignature, -- the AA certificate presented can't validate the request signature - wrongea, -- the encrypted signature doesn't designate me as the EA - unknownits, -- can't retrieve the EC/ITS in my DB - invalidsignature, -- signature verification of the request by the EC fails - invalidencryptionkey, -- signature is good, but the key is bad - deniedpermissions, -- permissions not granted - deniedtoomanycerts, -- parallel limit - ... } - - -InnerAtRequest ::= SEQUENCE { - publicKeys PublicKeys, - hmacKey OCTET STRING (SIZE(32)), - sharedAtRequest SharedAtRequest, - ecSignature EcSignature, - ... - } - -SharedAtRequest ::= SEQUENCE { - eaId HashedId8, - keyTag OCTET STRING (SIZE(16)), - certificateFormat CertificateFormat, - requestedSubjectAttributes CertificateSubjectAttributes (WITH COMPONENTS{...,certIssuePermissions ABSENT}), - ... - } - -InnerAtResponse ::= SEQUENCE { - requestHash OCTET STRING (SIZE(16)), - responseCode AuthorizationResponseCode, - certificate EtsiTs103097Certificate OPTIONAL, - ... - } - (WITH COMPONENTS { responseCode (ok), certificate PRESENT } - | WITH COMPONENTS { responseCode (ALL EXCEPT ok), certificate ABSENT } - ) - -END - - - - - - diff --git a/asn1/Security/TS102921/EtsiTs102941TypesAuthorizationValidation.asn b/asn1/Security/TS102921/EtsiTs102941TypesAuthorizationValidation.asn deleted file mode 100644 index e73dcdca..00000000 --- a/asn1/Security/TS102921/EtsiTs102941TypesAuthorizationValidation.asn +++ /dev/null @@ -1,67 +0,0 @@ -EtsiTs102941TypesAuthorizationValidation - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authValidation(7) version2(2)} - -DEFINITIONS AUTOMATIC TAGS ::= -BEGIN - -IMPORTS - -EtsiTs103097Certificate -FROM EtsiTs103097Module -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} - -CertificateFormat, CertificateSubjectAttributes,EcSignature, HashedId8, PublicKeys, Version -FROM EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version2(2) } - -SharedAtRequest -FROM EtsiTs102941TypesAuthorization -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) authorization(5) version2(2)} - -; - -/************ --- AuthorizationValidationRequest/Response -************/ - -AuthorizationValidationResponseCode ::= ENUMERATED { - ok(0), - cantparse, -- valid for any structure - badcontenttype, -- not encrypted, not signed, not permissionsverificationrequest - imnottherecipient, -- the "recipients" of the outermost encrypted data doesn't include me - unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm - decryptionfailed, -- works for ECIES-HMAC and AES-CCM - invalidaa, -- the AA certificate presented is invalid/revoked/whatever - invalidaasignature, -- the AA certificate presented can't validate the request signature - wrongea, -- the encrypted signature doesn't designate me as the EA - unknownits, -- can't retrieve the EC/ITS in my DB - invalidsignature, -- signature verification of the request by the EC fails - invalidencryptionkey, -- signature is good, but the responseEncryptionKey is bad - deniedpermissions, -- requested permissions not granted - deniedtoomanycerts, -- parallel limit - deniedrequest, -- any other reason? - ... } - -AuthorizationValidationRequest ::= SEQUENCE { - sharedAtRequest SharedAtRequest, - ecSignature EcSignature, - ... - } - -AuthorizationValidationResponse ::= SEQUENCE { - requestHash OCTET STRING (SIZE(16)), - responseCode AuthorizationValidationResponseCode, - confirmedSubjectAttributes CertificateSubjectAttributes (WITH COMPONENTS{..., certIssuePermissions ABSENT}) OPTIONAL, - ... - } - (WITH COMPONENTS { responseCode (ok), confirmedSubjectAttributes PRESENT } - | WITH COMPONENTS { responseCode (ALL EXCEPT ok), confirmedSubjectAttributes ABSENT } - ) - -END - - - - - - diff --git a/asn1/Security/TS102921/EtsiTs102941TypesCaManagement.asn b/asn1/Security/TS102921/EtsiTs102941TypesCaManagement.asn deleted file mode 100644 index 135f99be..00000000 --- a/asn1/Security/TS102921/EtsiTs102941TypesCaManagement.asn +++ /dev/null @@ -1,31 +0,0 @@ -EtsiTs102941TypesCaManagement - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) caManagement(8) version2(2)} - -DEFINITIONS AUTOMATIC TAGS ::= -BEGIN - -IMPORTS - -EtsiTs103097Certificate, EtsiTs103097Data-Signed -FROM -EtsiTs103097Module -{itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} - -PublicKeys, CertificateSubjectAttributes -FROM EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version2(2)} - -; - -/************ --- CA certificate request -************/ - -CaCertificateRequest ::= SEQUENCE { - publicKeys PublicKeys, - requestedSubjectAttributes CertificateSubjectAttributes, - ... -} - -END - diff --git a/asn1/Security/TS102921/EtsiTs102941TypesEnrolment.asn b/asn1/Security/TS102921/EtsiTs102941TypesEnrolment.asn deleted file mode 100644 index a538bcdb..00000000 --- a/asn1/Security/TS102921/EtsiTs102941TypesEnrolment.asn +++ /dev/null @@ -1,67 +0,0 @@ -EtsiTs102941TypesEnrolment - { itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) enrolment(4) version2(2)} - -DEFINITIONS AUTOMATIC TAGS ::= -BEGIN - -IMPORTS - -EtsiTs103097Certificate, -EtsiTs103097Data-Signed -FROM EtsiTs103097Module -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(103097) securedMessageV1(0)} - -CertificateFormat, CertificateSubjectAttributes, EcSignature, HashedId8, PublicKeys, Version -FROM EtsiTs102941BaseTypes -{ itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg5(5) ts(102941) baseTypes(3) version2(2) } - -; - -/************ --- EnrolmentRequest/Response -************/ - -EnrolmentResponseCode ::= ENUMERATED { - ok(0), - cantparse, -- valid for any structure - badcontenttype, -- not encrypted, not signed, not enrolmentrequest - imnottherecipient, -- the "recipients" doesn't include me - unknownencryptionalgorithm, -- either kexalg or contentencryptionalgorithm - decryptionfailed, -- works for ECIES-HMAC and AES-CCM - unknownits, -- can't retrieve the ITS from the itsId - invalidsignature, -- signature verification of the request fails - invalidencryptionkey, -- signature is good, but the responseEncryptionKey is bad - baditsstatus, -- revoked, not yet active - incompleterequest, -- some elements are missing - deniedpermissions, -- requested permissions are not granted - invalidkeys, -- either the verification_key of the encryption_key is bad - deniedrequest, -- any other reason? - ... } - -InnerEcRequestSignedForPop::= EtsiTs103097Data-Signed{InnerEcRequest} - -InnerEcRequest ::= SEQUENCE { - itsId OCTET STRING, - certificateFormat CertificateFormat, - publicKeys PublicKeys, - requestedSubjectAttributes CertificateSubjectAttributes (WITH COMPONENTS{..., certIssuePermissions ABSENT}), - ... - } - -InnerEcResponse ::= SEQUENCE { - requestHash OCTET STRING (SIZE(16)), - responseCode EnrolmentResponseCode, - certificate EtsiTs103097Certificate OPTIONAL, - ... - } - (WITH COMPONENTS { responseCode (ok), certificate PRESENT } - | WITH COMPONENTS { responseCode (ALL EXCEPT ok), certificate ABSENT } - ) - -END - - - - - - diff --git a/asn1/Security/module.mk b/asn1/Security/module.mk deleted file mode 100644 index d3f7b469..00000000 --- a/asn1/Security/module.mk +++ /dev/null @@ -1,12 +0,0 @@ -sources := \ - ./1609Dot2/IEEE1609dot2.asn \ - ./1609Dot2/IEEE1609dot2BaseTypes.asn \ - ./EtsiTs103097Module.asn \ - ./TS102921/EtsiTs102941BaseTypes.asn \ - ./TS102921/EtsiTs102941MessagesCa.asn \ - ./TS102921/EtsiTs102941TrustLists.asn \ - ./TS102921/EtsiTs102941TypesAuthorization.asn \ - ./TS102921/EtsiTs102941TypesAuthorizationValidation.asn \ - ./TS102921/EtsiTs102941TypesCaManagement.asn \ - ./TS102921/EtsiTs102941TypesEnrolment.asn \ - diff --git a/asn1/TransportAddressMib/TransportAddressMib.asn b/asn1/TransportAddressMib/TransportAddressMib.asn deleted file mode 100644 index 82740380..00000000 --- a/asn1/TransportAddressMib/TransportAddressMib.asn +++ /dev/null @@ -1,12 +0,0 @@ -TRANSPORT-ADDRESS-MIB - -DEFINITIONS AUTOMATIC TAGS ::= BEGIN - --- this is only a dummy module to resolve the two elements in IMPORT statements of other modules - -TransportAddressType ::= OCTET STRING (SIZE(6)) - -TransportAddress ::= OCTET STRING (SIZE(6)) - -END - diff --git a/asn1/cdd b/asn1/cdd deleted file mode 160000 index cabf82ff..00000000 --- a/asn1/cdd +++ /dev/null @@ -1 +0,0 @@ -Subproject commit cabf82ff5275e77dd427f5de86316bc3c198a32c diff --git a/ttcn/BTP/LibItsBtp_EncdecDeclarations.ttcn b/ttcn/BTP/LibItsBtp_EncdecDeclarations.ttcn deleted file mode 100644 index e4f6332e..00000000 --- a/ttcn/BTP/LibItsBtp_EncdecDeclarations.ttcn +++ /dev/null @@ -1,30 +0,0 @@ -module LibItsBtp_EncdecDeclarations { - - // LibItsBtp - import from LibItsBtp_TypesAndValues all; - import from LibItsBtp_TestSystem all; - - /* TODO RGy function not implemented! (decvalue() not used by test suite @29-06-2016) - external function fx_dec_BtpPayload (inout bitstring b, out BtpPayload p) return integer - with {extension "prototype(sliding) decode(LibItsBtp)"} - */ - - external function fx_enc_BtpReq (BtpReq p) return bitstring - with {extension "prototype(convert) encode(LibIts_Interface)"} - - external function fx_enc_BtpInd (BtpInd p) return bitstring - with {extension "prototype(convert) encode(LibIts_Interface)"} - - external function fx_dec_BtpInd (inout bitstring b, out BtpInd p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_dec_BtpReq (inout bitstring b, out BtpReq p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_enc_BtpPacket (BtpPacket p) return bitstring - with {extension "prototype(convert) encode(LibIts_Interface)"} - - external function fx_dec_BtpPacket (inout bitstring b, out BtpPacket p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - -} // End of module LibItsBtp_EncdecDeclarations diff --git a/ttcn/BTP/LibItsBtp_Functions.ttcn b/ttcn/BTP/LibItsBtp_Functions.ttcn deleted file mode 100644 index fab68591..00000000 --- a/ttcn/BTP/LibItsBtp_Functions.ttcn +++ /dev/null @@ -1,237 +0,0 @@ -/** - * @author ETSI / STF405 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/BTP/LibItsBtp_Functions.ttcn $ - * $Id: LibItsBtp_Functions.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Module containing functions for basic Transport Protocol - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ - - module LibItsBtp_Functions { - - // LibCommon - import from LibCommon_Sync all; - - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - - // LibItsBtp - import from LibItsBtp_TestSystem all; - import from LibItsBtp_TypesAndValues all; - import from LibItsBtp_Templates all; - import from LibItsBtp_Pixits all; - - group utFuntions { - - /** - * @desc Requests to bring the IUT in an initial state - * @param p_init The initialisation to trigger. - */ - function f_utInitializeIut(template (value) UtBtpInitialize p_init) runs on ItsBtp { - - //deactivate btpPort default alts - vc_btpDefaultActive := false; - - utPort.send(p_init); - tc_wait.start; - alt { - [] utPort.receive(UtBtpResults: { utBtpInitializeResult := true}) { - tc_wait.stop; - log("*** f_utInitializeIut: INFO: IUT initialized ***"); - } - [] utPort.receive { - tc_wait.stop; - log("*** f_utInitializeIut: INFO: IUT could not be initialized ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_wait.timeout { - log("*** f_utInitializeIut: INFO: IUT could not be initialized in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //activate btpPort default alts - vc_btpDefaultActive := true; - - } - - /** - * @desc Triggers event from the application layer - * @param p_event The event to trigger. - */ - function f_utTriggerEvent(template (value) UtBtpTrigger p_event) runs on ItsBtp { - - //deactivate btpPort default alts - vc_btpDefaultActive := false; - - utPort.send(p_event); - alt { - [] utPort.receive(UtBtpResults: { utBtpTriggerResult := true }) { - tc_wait.stop; - } - [] utPort.receive { - tc_wait.stop; - } - [] tc_wait.timeout { - } - } - - //activate btpPort default alts - vc_btpDefaultActive := true; - - } - - } // End of group utFunctions - - group configurationFunctions { - - /** - * @desc Setups default configuration - */ - function f_cfUp() runs on ItsBtp system ItsBtpSystem { - - map(self:utPort, system:utPort); - map(self:btpPort, system:btpPort); - f_connect4SelfOrClientSync(); - - } // end f_cfUp - - /** - * @desc Deletes default configuration - */ - function f_cfDown() runs on ItsBtp system ItsBtpSystem { - - unmap(self:utPort, system:utPort); - unmap(self:btpPort, system:btpPort); - f_disconnect4SelfOrClientSync(); - - } // end f_cfDown - - } // end configurationFunctions - - group btpAltsteps { - - /** - * @desc The base default. - */ - altstep a_default() runs on ItsBtp { - - [vc_btpDefaultActive] btpPort.receive { - log("*** a_default: ERROR: Received an unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_wait.timeout { - log("*** a_default: INCONC: Timeout while awaiting reaction of the IUT prior to Upper Tester action ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] tc_ac.timeout { - log("*** a_default: INCONC: Timeout while awaiting the reception of a message ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] a_shutdown() { - f_poDefault(); - f_cfDown(); - log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc The default for handling upper tester messages. - */ - altstep a_utDefault() runs on ItsBtp { - var UtBtpEventInd v_ind; - [vc_utDefaultActive] utPort.receive(UtBtpEventInd:?) -> value v_ind { - //store every upper tester indication received - vc_utEvents[lengthof(vc_utEvents)] := v_ind; - repeat; - } - [vc_utDefaultActive] utPort.receive { - log("*** " & testcasename() & ": INFO: Received unhandled/unknown UT message from IUT ***"); - repeat; - } - } - - } //end btpAltsteps - - group preambles { - - /** - * @desc The default preamble. - */ - function f_prDefault() runs on ItsBtp { - activate(a_default()); - activate(a_utDefault()); - } - - /** - * @desc Brings the IUT into an initial state. - */ - function f_prInitialState() runs on ItsBtp { - - f_utInitializeIut(m_btpInitialize); - f_prDefault(); - - } - - } // end of group preambles - - - group postambles { - - /** - * @desc The default postamble. - */ - function f_poDefault() runs on ItsBtp { - //empty - } - - } // end postambles - - group getFunctions { - - /** - * @desc Gets the BTP source port of the IUT. - * @return BTP source port ID - */ - function f_getBtpSrcPort() return BtpPortId { - return PX_SOURCE_PORT; - } - - /** - * @desc Gets the BTP destination port of the IUT. - * @return BTP destination port ID - */ - function f_getBtpDstPort() return BtpPortId { - return PX_DESTINATION_PORT; - } - - /** - * @desc Gets a unknown BTP destination port of the IUT. - * @return Unknown BTP destination port ID - */ - function f_getBtpUnknownDstPort() return BtpPortId { - return PX_UNKNOWN_DESTINATION_PORT; - } - - /** - * @desc Gets the BTP destination port info of the IUT. - * @return BTP destination port info - */ - function f_getBtpDstPortInfo() return BtpPortId { - return PX_DESTINATION_PORT_INFO; - } - - /** - * @desc Gets the BTP payload to use. - * @return BTP payload - */ - function f_getBtpPayload() return BtpRawPayload { - return PX_PAYLOAD; - } - - } // end getFunctions -} // end LibItsBtp_Functions diff --git a/ttcn/BTP/LibItsBtp_Pixits.ttcn b/ttcn/BTP/LibItsBtp_Pixits.ttcn deleted file mode 100644 index cd8dfc1c..00000000 --- a/ttcn/BTP/LibItsBtp_Pixits.ttcn +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @author ETSI / STF405 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/BTP/LibItsBtp_Pixits.ttcn $ - * $Id: LibItsBtp_Pixits.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Basic Transport Protocol Templates - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsBtp_Pixits { - - // LibIts - import from LibItsBtp_TypesAndValues all; - - - /** - * @desc BTP source port of the IUT - * - */ - modulepar BtpPortId PX_SOURCE_PORT := 0; - - /** - * @desc BTP Destination port of the IUT - * - */ - modulepar BtpPortId PX_DESTINATION_PORT := 0; - - /** - * @desc BTP Unknown Destination port of the IUT - * - */ - modulepar BtpPortId PX_UNKNOWN_DESTINATION_PORT := 0; - - /** - * @desc BTP Destination port Info of the IUT - * - */ - modulepar BtpPortId PX_DESTINATION_PORT_INFO := 0; - - /** - * @desc Payload to be sent to the IUT for testing matter - * - */ - modulepar BtpRawPayload PX_PAYLOAD := '0102030405'O ; - - -} // end LibItsBtp_Pixits \ No newline at end of file diff --git a/ttcn/BTP/LibItsBtp_Templates.ttcn b/ttcn/BTP/LibItsBtp_Templates.ttcn deleted file mode 100644 index fe930380..00000000 --- a/ttcn/BTP/LibItsBtp_Templates.ttcn +++ /dev/null @@ -1,204 +0,0 @@ -/** - * @author ETSI / STF405 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/BTP/LibItsBtp_Templates.ttcn $ - * $Id: LibItsBtp_Templates.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Basic Transport Protocol Templates - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsBtp_Templates { - - // LibIts - import from LibItsBtp_TestSystem all; - import from LibItsBtp_TypesAndValues all; - import from LibItsBtp_Pixits all; - import from LibItsCommon_TypesAndValues all; - - group btpPrimitivesTemplates { - - /** - * @desc Send template for BTP packet (BtpPort Primitive) - * @param p_btpPkt BTP Packet to be sent - */ - template (value) BtpReq m_btpReq( - template (value) BtpPacket p_btpPkt - ) := { - msgOut := p_btpPkt - } - - /** - * @desc Receive template for BTP packet (BtpPort Primitive) - * @param p_btpPkt BTP Packet to be received - */ - template BtpInd mw_btpInd( - template (present) BtpPacket p_btpPkt - ) := { - msgIn := p_btpPkt - } - - group utPrimitives { - - /** - * @desc Initializes the BTP IUT. - */ - template (value) UtBtpInitialize m_btpInitialize := { - hashedId8 := '0000000000000000'O - } - - /** - * @desc Generate a BTP A packet - * @param p_destPort The destination port - * @param p_srcPort The source port - */ - template (value) UtBtpTrigger m_generateBtpA(in BtpPortId p_destPort, in BtpPortId p_srcPort) := { - btpA := { - btpAHeader := { - destinationPort := p_destPort, - sourcePort := p_srcPort - } - } - } - - /** - * @desc Generate a BTP B packet - * @param p_destPort The destination port - * @param p_destPortInfo The destination port information - */ - template (value) UtBtpTrigger m_generateBtpB(in BtpPortId p_destPort, in BtpPortInfo p_destPortInfo) := { - btpB := { - btpBHeader := { - destinationPort := p_destPort, - destinationPortInfo := p_destPortInfo - } - } - } - - } // end utPrimitives - - } // btpPrimitivesTemplates - - group btpPduTemplates { - - /** - * @desc Send template for BTP-A packet - * @param p_destPort Destination port - * @param p_srcPort Source port - * @param p_payload Payload - */ - template (value) BtpPacket m_btpA ( - template (value) BtpRawPayload p_payload - ):= { - header := { - btpAHeader := { - destinationPort := PX_DESTINATION_PORT, - sourcePort := PX_SOURCE_PORT - } - }, - payload := p_payload - } - - /** - * @desc Send template for BTP-B packet - * @param p_destPort Destination port - * @param p_destPortInfo Destination port information - * @param p_payload Payload - */ - template( value) BtpPacket m_btpB ( - template (value) BtpRawPayload p_payload - ) := { - header := { - btpBHeader := { - destinationPort := PX_DESTINATION_PORT, - destinationPortInfo := 0 - } - }, - payload := p_payload - } - - /** - * @desc Send template for BTP-A packet with port parameters - * @param p_destPort Destination port - * @param p_srcPort Source port - * @param p_payload Payload - */ - template (value) BtpPacket m_btpAWithPorts ( - template (value) BtpPortId p_destPort, - template (value) BtpPortId p_srcPort, - template (value) BtpRawPayload p_payload - ):= { - header := { - btpAHeader := { - destinationPort := p_destPort, - sourcePort := p_srcPort - } - }, - payload := p_payload - } - - /** - * @desc Send template for BTP-B packet with port parameters - * @param p_destPort Destination port - * @param p_destPortInfo Destination port information - * @param p_payload Payload - */ - template( value) BtpPacket m_btpBWithPorts ( - template (value) BtpPortId p_destPort, - template (value) BtpPortInfo p_destPortInfo, - template (value) BtpRawPayload p_payload - ) := { - header := { - btpBHeader := { - destinationPort := p_destPort, - destinationPortInfo := p_destPortInfo - } - }, - payload := p_payload - } - - /** - * @desc Receive template for BTP-A packet - * @param p_destPort Destination port - * @param p_srcPort Source port - * @param p_payload Payload - */ - template BtpPacket mw_btpA ( - template (present) BtpPortId p_destPort, - template (present) BtpPortId p_srcPort, - template BtpRawPayload p_payload - ) := { - header := { - btpAHeader := { - destinationPort := p_destPort, - sourcePort := p_srcPort - } - }, - payload := p_payload - } - - /** - * @desc Receive template for BTP-B packet - * @param p_destPort Destination port - * @param p_destPortInfo Destination port information - * @param p_payload Payload - */ - template BtpPacket mw_btpB ( - template (present) BtpPortId p_destPort, - template (present) BtpPortInfo p_destPortInfo, - template BtpRawPayload p_payload - ) := { - header := { - btpBHeader := { - destinationPort := p_destPort, - destinationPortInfo := p_destPortInfo - } - }, - payload := p_payload - } - - } // end btpPduTemplates - - -} // end LibItsBtp_Templates diff --git a/ttcn/BTP/LibItsBtp_TestSystem.ttcn b/ttcn/BTP/LibItsBtp_TestSystem.ttcn deleted file mode 100644 index 39a3ca05..00000000 --- a/ttcn/BTP/LibItsBtp_TestSystem.ttcn +++ /dev/null @@ -1,117 +0,0 @@ -/** - * @author ETSI / STF405 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/BTP/LibItsBtp_TestSystem.ttcn $ - * $Id: LibItsBtp_TestSystem.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Test System module for ITS BTP - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsBtp_TestSystem { - - // LibCommon -// import from LibCommon_Time {modulepar all}; -// import from LibCommon_Sync all; - - // LibIts - import from LibItsCommon_TestSystem all; - import from LibItsCommon_TypesAndValues all; - import from LibItsBtp_TypesAndValues all; - - group portDefinitions { - - /** - * @desc Upper Tester port - */ - type port UpperTesterPort message { - out - UtBtpInitialize, UtBtpTrigger; - in - UtBtpResults, UtBtpEventInd; - } // end UpperTesterPort - - } // end portDefinitions - - group interfacePorts { - - group networkAndTransportPorts { - - group nt1Ports { - - /** - * @desc NT1 BTP Port (BTP/GeoNet/G5) - */ - type port BtpPort message { - in BtpInd; - out BtpReq; - } // end BtpPort - - } // End of group nt1Ports - - } // End of group networkAndTransportPorts - - } // End of group interfacePorts - - group componentDefinitions { - - /** - * @desc ITS System Adapter - */ - type component ItsBtpSystem { - - port UpperTesterPort utPort; - - // NT1 ports - port BtpPort btpPort; - - } // end component ItsAdapter - - } // End of group componentDefinitions - - /** - * @desc Test component for ITS Network and Transport layer - */ - type component ItsBtp extends ItsBaseComponent { - - port UpperTesterPort utPort; - - // NT1 ports - port BtpPort btpPort; - - // timers - - var UtBtpEventIndList vc_utEvents := {}; - - var boolean vc_utDefaultActive := true; - var boolean vc_btpDefaultActive := true; - - } // End of component ItsBtp - - group networkAndTransportPrimitives { - - group nt1Primitives { - - /** - * @desc NT1 BTP Indication Primitive - */ - type record BtpInd { - BtpPacket msgIn - } - - /** - * @desc NT1 BTP Request Primitive - */ - type record BtpReq { - BtpPacket msgOut - } - - } // end nt1Primitives - - } // End of group networkAndTransportPrimitives - with { - encode "LibIts_Interface" - } // end interfacePrimitives - -} // End of module LibItsBtp_TestSystem diff --git a/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn b/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn deleted file mode 100644 index 7be36267..00000000 --- a/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn +++ /dev/null @@ -1,178 +0,0 @@ -/** - * @author ETSI / STF405 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/BTP/LibItsBtp_TypesAndValues.ttcn $ - * $Id: LibItsBtp_TypesAndValues.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Module containing types and values for Basic Transport Protocol - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsBtp_TypesAndValues { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - type octetstring BtpRawPayload; - - group btpPdus { - - /** - * @desc BTP Packet - * @see ETSI TS 102 636-5-1 chapter 6 - * @member header - * @member payload - */ - type record BtpPacket { - BtpHeader header, - BtpRawPayload payload optional - } - with { - encode "LibIts_Interface" - variant "FIELDORDER(msb)" - } - - } // end btpPdus - - group btpHeaders { - - /** - * @desc BTP Header - * @see ETSI TS 102 636-5-1 chapter 7.1 - * @member btpAHeader - * @member btpBHeader - */ - type union BtpHeader { - BtpAHeader btpAHeader, - BtpBHeader btpBHeader - } with { - variant "FIELDORDER(msb)" - } - - - /** - * @desc BTP-A Header - * @see ETSI TS 102 636-5-1 chapter 7.2 - * @member destinationPort - * @member sourcePort - */ - type record BtpAHeader { - BtpPortId destinationPort, - BtpPortId sourcePort - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc BTP-B Header - * @see ETSI TS 102 636-5-1 chapter 7.3 - * @member destinationPort - * @member destinationPortInfo - */ - type record BtpBHeader { - BtpPortId destinationPort, - BtpPortInfo destinationPortInfo - } with { - variant "FIELDORDER(msb)" - } - - - /** - * @desc BTP Port ID - * @see ETSI TS 102 636-5-1 chapter 7.3.2 - */ - type UInt16 BtpPortId; - - /** - * @desc BTP-B Port info - * @see ETSI TS 102 636-5-1 chapter 7.3.2 - */ - type UInt16 BtpPortInfo; - - } // end btpHeaders - - group utPrimitives { - - group utCommonPrimitives { - - /** - * @desc Upper Tester message to initialize IUT - * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use - */ - type record UtBtpInitialize { - Oct8 hashedId8 - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester results message of the Btp IUT - * @member utBtpInitialize - - * @member utBtpTriggerResult - - */ - type union UtBtpResults { - boolean utBtpInitializeResult, - boolean utBtpTriggerResult - } with { - variant "" - } - - /** - * @desc UT primitives for BTP - * @member btpA - - * @member btpB - - */ - type union UtBtpTrigger { - GenerateBtpA btpA, - GenerateBtpB btpB - } with { - variant "" - } - - /** - * @desc Upper Tester message to request triggering of an BTPA message at IUT - */ - type record GenerateBtpA { - BtpAHeader btpAHeader - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to request triggering of an BTPB message at IUT - */ - type record GenerateBtpB { - BtpBHeader btpBHeader - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to check event/status on BTP IUT - */ - type record UtBtpEventInd { - BtpRawPayload rawPayload - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc List of Upper Tester messages to check event/status on CAM IUT - */ - type record of UtBtpEventInd UtBtpEventIndList; - - } - - } // end utPrimitives - with { - variant "" - encode "UpperTester" - } - -} with { - variant "" - encode "LibItsBtp" -} - diff --git a/ttcn/BTP/module.mk b/ttcn/BTP/module.mk deleted file mode 100644 index f1c9679f..00000000 --- a/ttcn/BTP/module.mk +++ /dev/null @@ -1,6 +0,0 @@ -sources := LibItsBtp_EncdecDeclarations.ttcn \ - LibItsBtp_Functions.ttcn \ - LibItsBtp_Pixits.ttcn \ - LibItsBtp_Templates.ttcn \ - LibItsBtp_TestSystem.ttcn \ - LibItsBtp_TypesAndValues.ttcn diff --git a/ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn b/ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn deleted file mode 100644 index 9d37043d..00000000 --- a/ttcn/CAM/LibItsCam_EncdecDeclarations.ttcn +++ /dev/null @@ -1,40 +0,0 @@ -module LibItsCam_EncdecDeclarations { - - // LibIts - import from CAM_PDU_Descriptions language "ASN.1:1997" all; - - // LibItsCam - import from LibItsCam_TypesAndValues all; - import from LibItsCam_TestSystem all; - - external function fx_enc_CamReq (CamReq p) return bitstring - with {extension "prototype(convert) encode(LibIts_Interface)"} - - external function fx_dec_CamReq (inout bitstring b, out CamReq p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_dec_CamInd (inout bitstring b, out CamInd p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_enc_CAM (CAM p) return bitstring - with {extension "prototype(convert) encode(PER)"} - - external function fx_dec_CAM (inout bitstring b, out CAM p) return integer - with {extension "prototype(sliding) decode(PER)"} - - external function fx_enc_UtCamInitialize (UtCamInitialize p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtCamChangePosition (UtCamChangePosition p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtCamTrigger (UtCamTrigger p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_dec_UtCamResults (inout bitstring b, out UtCamResults p) return integer - with {extension "prototype(sliding) decode(UpperTester)"} - - external function fx_dec_UtCamEventInd (inout bitstring b, out UtCamEventInd p) return integer - with {extension "prototype(sliding) decode(UpperTester)"} - -} // End of module LibItsCam_EncdecDeclarations diff --git a/ttcn/CAM/LibItsCam_Functions.ttcn b/ttcn/CAM/LibItsCam_Functions.ttcn deleted file mode 100644 index 204b0356..00000000 --- a/ttcn/CAM/LibItsCam_Functions.ttcn +++ /dev/null @@ -1,614 +0,0 @@ -/** - * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/CAM/LibItsCam_Functions.ttcn $ - * $Id: LibItsCam_Functions.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Module containing common functions for ITS CAM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsCam_Functions { - - // LibCommon - import from LibCommon_Time all; - import from LibCommon_VerdictControl all; - import from LibCommon_Sync all; - - // LibIts - import from ITS_Container language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_Pixits all; - import from LibItsCommon_Templates all; - import from LibItsCommon_Functions all; - import from LibItsCommon_TypesAndValues all; - - // LibItsCam - import from LibItsCam_TestSystem all; - import from LibItsCam_Templates all; - import from LibItsCam_TypesAndValues all; - import from LibItsCam_Pics all; - import from LibItsCam_Pixits all; - - group utFuntions { - - /** - * @desc Requests to bring the IUT in an initial state - * @param p_init The initialisation to trigger. - */ - function f_utInitializeIut(template (value) UtCamInitialize p_init) runs on ItsCam { - - //deactivate camPort default alts - vc_camDefaultActive := false; - - utPort.send(p_init); - tc_wait.start; - alt { - [] utPort.receive(UtCamResults: { utCamInitializeResult := true }) { - tc_wait.stop; - log("*** f_utInitializeIut: INFO: IUT initialized ***"); - } - [] utPort.receive { - tc_wait.stop; - log("*** f_utInitializeIut: INFO: IUT could not be initialized ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_wait.timeout { - log("*** f_utInitializeIut: INFO: IUT could not be initialized in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //activate camPort default alts - vc_camDefaultActive := true; - - } - - /** - * @desc Triggers event from the application layer - * @param p_event The event to trigger. - */ - function f_utTriggerEvent(template (value) UtCamTrigger p_event) runs on ItsCam { - - //deactivate camPort default alts - vc_camDefaultActive := false; - - utPort.send(p_event); - tc_wait.start; - alt { - [] utPort.receive(UtCamResults: { utCamTriggerResult := true }) { - tc_wait.stop; - } - [] utPort.receive { - tc_wait.stop; - } - [] tc_wait.timeout { - } - } - - //activate camPort default alts - vc_camDefaultActive := true; - - } - - /** - * @desc Changes the position of the IUT - * @param p_position - */ - function f_utChangePosition(template (value) UtCamChangePosition p_position) runs on ItsCam { - - //deactivate camPort default alts - vc_camDefaultActive := false; - - utPort.send(p_position); - alt { - [] utPort.receive(UtCamResults: { utCamChangePositionResult := true}) { - tc_wait.stop; - } - [] utPort.receive(UtCamResults: { utCamChangePositionResult := ? }) { - tc_wait.stop; - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //activate camPort default alts - vc_camDefaultActive := true; - - } - - } // End of group utFunctions - - group adapterControl { - - /** - * @desc Initialise secure mode if required - */ - function f_initialiseSecuredMode( - in charstring p_certificateId := PX_CERT_FOR_TS - ) runs on ItsCam { - - if (PICS_IS_IUT_SECURED == true) { - - if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificateId))) { - log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); - stop; - } - } - - } // End of function f_initialiseSecuredMode() - - function f_uninitialiseSecuredMode() runs on ItsCam { - - if (PICS_IS_IUT_SECURED == true) { - f_acTriggerSecEvent(m_acDisableSecurity); - } - - } // End of function f_initialiseSecuredMode() - - /** - * @desc Triggers event in the test system adaptation. - * @param p_event The event to trigger - * @return FncRetCode - */ - function f_acTriggerSecEvent(template (value) AcSecPrimitive p_event) runs on ItsCam return FncRetCode { - var FncRetCode v_ret := e_success; - - acPort.send(p_event); - tc_ac.start; - alt { - [] acPort.receive(m_acSecResponseSuccess) { - tc_ac.stop; - } - [] acPort.receive { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - return v_ret; - } - - /** - * @desc Triggers event in the test system adaptation. - * @param p_event The event to trigger - * @return FncRetCode - */ - function f_acTriggerGnssEvent(template (value) AcGnssPrimitive p_event) runs on ItsCam return FncRetCode { - var FncRetCode v_ret := e_success; - - acPort.send(p_event); - tc_ac.start; - alt { - [] acPort.receive(m_acGnssResponseSuccess) { - tc_ac.stop; - } - [] acPort.receive(m_acGnssResponseError) { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - return v_ret; - } - - /** - * @desc Loads the given scenario - * - * @param p_scenario The scenario to load. - */ - function f_acLoadScenario(in Scenario p_scenario) runs on ItsCam { - - if (PX_GNSS_SCENARIO_SUPPORT==true) { - f_acTriggerGnssEvent(m_loadScenario(p_scenario)); - } - } // End of function f_acLoadScenario - - /** - * @desc Starts a loaded scenario - */ - function f_acStartScenario() runs on ItsCam { - - if (PX_GNSS_SCENARIO_SUPPORT==true) { - f_acTriggerGnssEvent(m_startScenario); - vc_scenarioStarted := true; - } - } // End of function f_acStartScenario - - /** - * @desc Stops a loaded scenario - */ - function f_acStopScenario() runs on ItsCam { - - if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { - f_acTriggerGnssEvent(m_stopScenario); - vc_scenarioStarted := false; - } - } // End of function f_acStopScenario - - function f_acAwaitDistanceCovered(float p_distanceToCover) runs on ItsCam return FncRetCode { - var FncRetCode v_ret := e_success; - - if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { - f_acTriggerGnssEvent(m_distanceToCover(p_distanceToCover)); - - tc_ac.start(PX_T_GNSS_AWAIT_DISTANCE_COVERED); - alt { - [] acPort.receive(m_acGnssDistanceCoveredSuccess) { - tc_ac.stop; - } - [] acPort.receive(m_acGnssDistanceCoveredError) { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for covered distance indication ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - } - return v_ret; - } // End of function f_acAwaitDistanceCovered - - function f_acAwaitSpeed( - float p_speed, - SpeedTrend p_speedTrend := e_accelerate, - boolean p_stopCamPort := true, - boolean p_deactivateCamDefault := false - ) runs on ItsCam system ItsCamSystem return FncRetCode { - var FncRetCode v_ret := e_success; - - if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { - - if (p_stopCamPort) { - unmap(self:camPort, system:camPort); - } - - if (p_deactivateCamDefault) { - vc_camDefaultActive := false; - } - - f_acTriggerGnssEvent(m_awaitSpeed(p_speed, p_speedTrend)); - - tc_ac.start(PX_T_GNSS_AWAIT_SPEED_REACHED); - alt { - [] acPort.receive(m_acGnssSpeedReachedSuccess) { - tc_ac.stop; - } - [] acPort.receive(m_acGnssSpeedReachedError) { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for covered distance indication ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - if (p_stopCamPort) { - map(self:camPort, system:camPort); - } - - if (p_deactivateCamDefault) { - vc_camDefaultActive := true; - } - } - return v_ret; - } // End of function f_acAwaitSpeed - - function f_acChangeSpeed(SpeedValue p_deltaSpeedValue) runs on ItsCam { - - if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { -// f_acTriggerGnssEvent(m_changeScenarioSpeed(p_deltaSpeedValue)); - } - } // End of function f_acChangeSpeed - - function f_acChangeHeading(HeadingValue p_deltaHeadingValue) runs on ItsCam { - - if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { - f_acTriggerGnssEvent(m_changeScenarioHeading(p_deltaHeadingValue)); - } - } // End of function f_acChangeHeading - - function f_acAwaitTimeInRunningScenario( - integer p_time, - boolean p_stopOnCamMessage := true - ) runs on ItsCam return FncRetCode { - var FncRetCode v_ret := e_success; - - if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { - - f_acTriggerGnssEvent(m_timeInRunningScenario(p_time)); - - tc_ac.start(int2float(p_time)*1.1); - alt { - [p_stopOnCamMessage] camPort.check(receive(mw_camInd ( mw_camMsg_any ))) { - tc_ac.stop; - } - [] acPort.receive(m_acGnssTimeReachedSuccess) { - tc_ac.stop; - } - [] acPort.receive(m_acGnssTimeReachedError) { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for time reached indication ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - } - return v_ret; - } // end f_acAwaitTimeInRunningScenario - - } // End of group adapterControl - - group camConfigurationFunctions { - - /** - * @desc Setups default configuration - * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT - */ - function f_cfUp( - in charstring p_certificateId := PX_CERT_FOR_TS - ) runs on ItsCam system ItsCamSystem { - - map(self:utPort, system:utPort); - map(self:acPort, system:acPort); - map(self:camPort, system:camPort); - f_connect4SelfOrClientSync(); - - // Initialise secured mode - f_initialiseSecuredMode(p_certificateId); - - } // End of function f_cfUp - - /** - * @desc Deletes default configuration - */ - function f_cfDown() runs on ItsCam system ItsCamSystem { - - // Initialise secured mode - f_uninitialiseSecuredMode(); - - unmap(self:camPort, system:camPort); - - f_acStopScenario(); - unmap(self:utPort, system:utPort); - unmap(self:acPort, system:acPort); - f_disconnect4SelfOrClientSync(); - - } // End of function f_cfDown - - } // End of camConfigurationFunctions - - group defaults { - - /** - * @desc basic default behaviour handling - */ - altstep a_default() runs on ItsCam { - - [vc_camDefaultActive] camPort.receive(mw_camInd ( mw_camMsg_any )){ - log("*** a_default: INFO: CAM message received in default ***"); - vc_camReceived := true; - repeat; - } - [vc_camDefaultActive] camPort.receive { - log("*** a_default: ERROR: event received on CAM port in default ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] acPort.receive(AdapterControlResults: { acGnssTimeReached := ? }) { - log("*** a_default: INFO: TimeReached event received on AC port in default ***"); - repeat; - } - [] acPort.receive(AdapterControlResults: { acGnssSpeedReached := ? }) { - log("*** a_default: INFO: SpeedReached event received on AC port in default ***"); - repeat; - } - [] acPort.receive(AdapterControlResults: { acGnssDistanceCovered := ? }) { - log("*** a_default: INFO: DistanceCovered event received on AC port in default ***"); - repeat; - } - [] acPort.receive { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] any timer.timeout { - log("*** a_default: INCONC: a timer expired in default ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] a_shutdown() { - f_poDefault(); - f_cfDown(); - log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - }//end altstep a_basicDefault - - /** - * @desc The default for handling upper tester messages. - */ - altstep a_utDefault() runs on ItsCam { - var UtCamEventInd v_event; - [] utPort.receive(UtCamEventInd:?) -> value v_event { - //store every upper tester indication received - vc_utEvents[lengthof(vc_utEvents)] := v_event; - repeat; - } - [] utPort.receive { - log("*** " & testcasename() & ": INFO: Received unhandled/unknown UT message from IUT ***"); - repeat; - } - } - - } // End of defaults - - group preambles { - - /** - * @desc The default preamble. - */ - function f_prDefault() runs on ItsCam { - vc_default := activate(a_default()); - activate(a_utDefault()); - } - - /** - * @desc Initialize the IUT - * @remark No specific actions specified in the base standard - */ - function f_prInitialState( - in Scenario p_scenario := e_staticPosition, - in boolean p_awaitInitialCAM := true, - in template (value) UtCamInitialize p_camInitialize := m_camInitialize, - in boolean p_awaitTimeInRunningScenario := true - ) runs on ItsCam { - - f_utInitializeIut(p_camInitialize); - - f_prDefault(); - - f_acLoadScenario(p_scenario); - - //Allow burst mode at the beginning - f_sleep(1.0); - - camPort.clear; - - f_acStartScenario(); - if (p_awaitTimeInRunningScenario) { - f_acAwaitTimeInRunningScenario(f_getTimeForGpsFix()); - } - - if (p_awaitInitialCAM) { - tc_ac.start; - alt { - [] camPort.receive(mw_camInd ( mw_camMsg_any )){ - tc_ac.stop; - log("*** " & testcasename() & ": INFO: Received initial CAM ***"); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: Initial CAM not received ***"); - f_selfOrClientSyncAndVerdictPreamble("error", e_timeout); - } - } // End of 'alt' statement - } - - } // End of function f_prInitialState - - } // End of preambles - - group postambles { - - /** - * @desc The default postamble. - */ - function f_poDefault() runs on ItsCam { - } - - } // End of group postambles - - group camPositionFunctions { - - /** - * @desc Compute a position using a reference position, a distance - * and an orientation - * - * @param p_referencePosition The base reference position. - * @param p_offSet Distance to the reference position (in meter). - * - * @return The new reference position. - */ - function f_computePositionUsingDistance(in ReferencePosition p_referencePosition, in float p_offSet) return ReferencePosition { - var ReferencePosition v_referencePosition := p_referencePosition; - - log("*** f_computePositionUsingDistance: INFO: calling fx_computePositionUsingDistance() ***"); - fx_computePositionUsingDistance( - p_referencePosition.latitude, - p_referencePosition.longitude, - p_offSet, - p_referencePosition.positionConfidenceEllipse.semiMajorOrientation, - v_referencePosition.latitude, - v_referencePosition.longitude - ); - return v_referencePosition; - } - - /** - * @desc Compute distance between two points - * @param p_pointA First point - * @param p_pointB Second point - * @return Computed distance in meters - * @see fx_computeDistance - */ - function f_distance( - in ReferencePosition p_pointA, - in ReferencePosition p_pointB - ) return float { - return fx_computeDistance(p_pointA.latitude, p_pointA.longitude, p_pointB.latitude, p_pointB.longitude); - } - - } // end group camPositionFunctions - - group camAuxilaryFunctions { - - function f_changeSpeed(SpeedValue p_deltaSpeedValue) runs on ItsCam { - if (PX_GNSS_SCENARIO_SUPPORT == false) { - f_utTriggerEvent(m_changeSpeed(p_deltaSpeedValue)); - } - else { - f_acChangeSpeed(p_deltaSpeedValue); - } - } - - function f_changeHeading(HeadingValue p_deltaHeadingValue) runs on ItsCam { - if (PX_GNSS_SCENARIO_SUPPORT == false) { - f_utTriggerEvent(m_changeHeading(p_deltaHeadingValue)); - } - else { - f_acChangeHeading(p_deltaHeadingValue); - } - } - - } // End group camAuxilaryFunctions - - group camGenerators { - function f_generateDefaultCam() - return octetstring { - return bit2oct( - encvalue( - m_camReq( - m_camMsg_vehicle( - f_getTsStationId(), - f_getCurrentTime() mod 65536, // See ETSI EN 302 637-2 V1.3.0 - Clause B.3 generationDelatTime - m_tsPosition - ) - ) - ) - ); - } - } // End of group camGenerators - -} // End of LibItsCam_Functions diff --git a/ttcn/CAM/LibItsCam_Pics.ttcn b/ttcn/CAM/LibItsCam_Pics.ttcn deleted file mode 100644 index 95028e84..00000000 --- a/ttcn/CAM/LibItsCam_Pics.ttcn +++ /dev/null @@ -1,130 +0,0 @@ -/** - * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/CAM/LibItsCam_Pics.ttcn $ - * $Id: LibItsCam_Pics.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc CAM PICS - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsCam_Pics { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - - group camPics { - - /** - * @desc Is the IUT RSU? - * @see ETSI TS 102 868-1 Table A.1 - */ - modulepar boolean PICS_RSU := false; - - /** - * @desc Is the IUT running in secured mode? - * @see ETSI TS 102 868-1 Table A.1 - */ - modulepar boolean PICS_IS_IUT_SECURED := false; - - /** - * @desc Is IUT a public transport vehicle - * @see ETSI TS 102 868-1 Table A.2 - */ - modulepar boolean PICS_PUBLICTRANS := false; - - /** - * @desc Is IUT a special transport vehicle - * @see ETSI TS 102 868-1 Table A.2 - */ - modulepar boolean PICS_SPECIALTRANS := false; - - /** - * @desc Is IUT a dangerous goods vehicle - * @see ETSI TS 102 868-1 Table A.2 - */ - modulepar boolean PICS_DANGEROUSGOODS := false; - - /** - * @desc Is IUT a road works vehicle - * @see ETSI TS 102 868-1 Table A.2 - */ - modulepar boolean PICS_ROADWORKS := false; - - /** - * @desc Is IUT a rescue vehicle - * @see ETSI TS 102 868-1 Table A.2 - */ - modulepar boolean PICS_RESCUE := false; - - /** - * @desc Is IUT an emergency vehicle - * @see ETSI TS 102 868-1 Table A.2 - */ - modulepar boolean PICS_EMERGENCY := false; - - /** - * @desc Is IUT a safety car vehicle - * @see ETSI TS 102 868-1 Table A.2 - */ - modulepar boolean PICS_SAFETY_CAR := false; - - /** - * @desc Does IUT support 'specialVehicleContainer' in CamParameters? - * @see ETSI TS 102 868-1 Table A.2 - */ - modulepar boolean PICS_SPECIALVEHICLECONTAINER := true; - - /** - * @desc Maximum time interval between CAM generations (in seconds). - * Default value, as per base standard: 1.0s - * @see ETSI TS 102 868-1 Table A.5 - */ - modulepar float PICS_T_GENCAMMAX := 1.000; - - /** - * @desc Minimum time interval between CAM generations (in seconds). - * Default value, as per base standard: 0.1s - * @see ETSI TS 102 868-1 Table A.5 - */ - modulepar float PICS_T_GENCAMMIN := 0.100; - - /** - * @desc Minimum time interval between CAM generations (in seconds) - * according to the requirements of the - * Decentralized Congestion Control(DCC). - * Default value, as per base standard: 0.1s - * @see ETSI TS 102 868-1 Table A.5 - */ - modulepar float PICS_T_GENCAMDCC := 0.100; - - /** - * @desc Support for CAM generation - * @see ETSI TS 102 868-1 Table A.3 - */ - modulepar boolean PICS_CAM_GENERATION := true; - - /** - * @desc Support for CAM reception - * @see ETSI TS 102 868-1 Table A.3 - */ - modulepar boolean PICS_CAM_RECEPTION := true; - - } // end camPics - - group radioComm { - - type enumerated RadioAccess { - e_its_g5, - e_lte_cv2x - } - - /** - * @desc Does radio communication use ITS-G5 or LTE-V2X? - * @see ETSI TS 102 868-1 Table A.3 - */ - modulepar RadioAccess PICS_RADIO_COMM := e_its_g5; - - } // End of group radioComm -} // end LibItsCam_Pics diff --git a/ttcn/CAM/LibItsCam_Pixits.ttcn b/ttcn/CAM/LibItsCam_Pixits.ttcn deleted file mode 100644 index 59ccb581..00000000 --- a/ttcn/CAM/LibItsCam_Pixits.ttcn +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/CAM/LibItsCam_Pixits.ttcn $ - * $Id: LibItsCam_Pixits.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Module containing Pixits for CAM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsCam_Pixits { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibItsSecurity - import from LibItsSecurity_TypesAndValues all; - -} // End of module LibItsSecurity_Pixits \ No newline at end of file diff --git a/ttcn/CAM/LibItsCam_Templates.ttcn b/ttcn/CAM/LibItsCam_Templates.ttcn deleted file mode 100644 index f1dbab60..00000000 --- a/ttcn/CAM/LibItsCam_Templates.ttcn +++ /dev/null @@ -1,879 +0,0 @@ -/** - * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/CAM/LibItsCam_Templates.ttcn $ - * $Id: LibItsCam_Templates.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Module containing base template definitions for CAM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsCam_Templates { - - // LibCommon - 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; -// import from DENM_PDU_Descriptions language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_Functions all; - import from LibItsCommon_TypesAndValues all; - import from LibItsCommon_ASN1_NamedNumbers all; - - // LibItsCam - import from LibItsCam_TestSystem all; - import from LibItsCam_TypesAndValues all; - - group camPrimitives { - - /** - * @desc Receive template for CAM Message (CamPort Primitive) - * @param p_camMsg Expected CAM Message - */ - template CamInd mw_camInd ( - in template (present) CAM p_camMsg - ) := { - msgIn := p_camMsg, - recvTime := ?, - gnNextHeader := *, - gnHeaderType := *, - gnHeaderSubtype := *, - gnLifetime := *, - gnTrafficClass := *, - btpDestinationPort := *, - btpInfo := *, - ssp := *, - its_aid := * - }; - - /** - * @desc Receive template for CAM Message (CamPort Primitive) - * @param p_camMsg Expected CAM Message - * @param p_gnNextHeader GN next header value - * @param p_gnHeaderType GN header type value - * @param p_gnHeaderSubtype GN header subtype value - * @param p_gnLifetime GN packet lifetime value (ms) - * @param p_gnTrafficClass GN traffic class value - */ - template CamInd mw_camIndWithGnParameters ( - in template (present) CAM p_camMsg, - in template UInt8 p_gnNextHeader := *, - in template UInt8 p_gnHeaderType := *, - in template UInt8 p_gnHeaderSubtype := *, - in template UInt32 p_gnLifetime := *, - in template UInt8 p_gnTrafficClass := * - ) modifies mw_camInd := { - gnNextHeader := p_gnNextHeader, - gnHeaderType := p_gnHeaderType, - gnHeaderSubtype := p_gnHeaderSubtype, - gnLifetime := p_gnLifetime, - gnTrafficClass := p_gnTrafficClass - }; - - /** - * @desc Receive template for CA Message (DenmPort Primitive) - * @param p_caMsg The expected CA Message - * @param p_ssp SSP security parameter - * @param p_its_aid ITS-AID value - */ - template CamInd mw_camIndWithSecurityParameters( - template (present) CAM p_camMsg, - template Bit256 p_ssp := *, - template UInt32 p_its_aid := c_its_aid_CAM - ) modifies mw_camInd := { - ssp := p_ssp, - its_aid := p_its_aid - }; - - /** - * @desc Receive template for CAM Message (CamPort Primitive) - * @param p_camMsg Expected CAM Message - * @param p_btpDestinationPort BTP destination port value - * @param p_btpInfo BTP destination port info value (if BTP-B) or BTP source port value (if BTP-A) - */ - template CamInd mw_camIndWithBtpParameters ( - in template (present) CAM p_camMsg, - in template UInt16 p_btpDestinationPort := *, - in template UInt16 p_btpInfo := * - ) modifies mw_camInd := { - btpDestinationPort := p_btpDestinationPort, - btpInfo := p_btpInfo - }; - - /** - * @desc Send template for CAM Message (CamPort Primitive) - * @param p_camMsg CAM Message to be received - */ - template (value) CamReq m_camReq ( - in template (value) CAM p_camMsg - ) := { - msgOut := p_camMsg - }; - - group camUtPrimitives { - - /** - * @desc Initializes the CAM IUT. - */ - template (value) UtCamInitialize m_camInitialize := { - hashedId8 := '0000000000000000'O - } - - /** - * @desc Change the curvature - * @param p_offset The curvature value offset - */ - template (value) UtCamTrigger m_changeCurvature(CurvatureValue p_changeCurvature) := { - changeCurvature := p_changeCurvature - } - - /** - * @desc Change the speed - * @param p_offset The speed value offset - */ - template (value) UtCamTrigger m_changeSpeed(Int16 p_changeSpeed) := { - changeSpeed := p_changeSpeed - } - - /** - * @desc Set the acceleration control status - * @param p_status The status to set - */ - template (value) UtCamTrigger m_setAccelerationControlStatus(AccelerationControl p_status) := { - setAccelerationControlStatus := p_status - } - - /** - * @desc Set the exterior lights status - * @param p_status The status to set - */ - template (value) UtCamTrigger m_setExteriorLightsStatus(ExteriorLights p_status) := { - setExteriorLightsStatus := p_status - } - - /** - * @desc Change the heading - * @param p_offset The heading value offset - */ - template (value) UtCamTrigger m_changeHeading(HeadingValue p_changeHeading) := { - changeHeading := p_changeHeading - } - - /** - * @desc Set the drive direction - * @param p_driveDirection The drive direction - */ - template (value) UtCamTrigger m_setDriveDirection(DriveDirection p_driveDirection) := { - setDriveDirection := p_driveDirection - } - - /** - * @desc Change the yaw rate - * @param p_offset The yaw rate value offset - */ - template (value) UtCamTrigger m_changeYawRate(YawRateValue p_changeYawRate) := { - changeYawRate := p_changeYawRate - } - - /** - * @desc Set the vehicle role - * @param p_vehicleRole The vehicle role - */ - template (value) UtCamTrigger m_setVehicleRole(VehicleRole p_vehicleRole) := { - setVehicleRole := p_vehicleRole - } - - /** - * @desc Set the dangerous good description - * @param p_dangerousGoods The dangerous good description - */ - template (value) UtCamTrigger m_setDangerousGoods(DangerousGoodsBasic p_dangerousGoods) := { - setDangerousGoods := p_dangerousGoods - } - - } // end utPrimitives - - } // end group Primitives - - group positionTemplates { - - /** - * @desc The test system reference position. - */ - template (value) ReferencePosition m_tsPosition := { - latitude := f_integer2Latitude(f_getTsLatitude()), - longitude := f_integer2Longitude(f_getTsLongitude()), - positionConfidenceEllipse := { - semiMajorConfidence := LibItsCommon_ASN1_NamedNumbers.SemiAxisLength_oneCentimeter_, - semiMinorConfidence := LibItsCommon_ASN1_NamedNumbers.SemiAxisLength_oneCentimeter_, - semiMajorOrientation := LibItsCommon_ASN1_NamedNumbers.HeadingValue_wgs84North_ - }, - altitude := { - altitudeValue := LibItsCommon_ASN1_NamedNumbers.AltitudeValue_referenceEllipsoidSurface_, - altitudeConfidence := unavailable - } - } - - /** - * @desc Reference position for given latitude and longitude. - */ - template (present) ReferencePosition mw_refPositionWithDelta( - in ReferencePosition p_origRefPos, - in integer p_jitter := 100 - ) := { - latitude := (p_origRefPos.latitude - p_jitter..p_origRefPos.latitude + p_jitter), - longitude := (p_origRefPos.longitude - p_jitter..p_origRefPos.longitude + p_jitter), - positionConfidenceEllipse := p_origRefPos.positionConfidenceEllipse, - altitude := p_origRefPos.altitude - } - - } // end positionTemplates - - /** - * @desc Default Receive template for CAM PDU - */ - template (present) CAM mw_camMsg_any := { - header := { - protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, - messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_cam_, - stationID := ? - }, - cam := { - generationDeltaTime := ?, - camParameters := ? - } - } - - group camBasicContainer { - - /** - * @desc - * Receive template for CAM PDU including basic container with - * given reference position - * @param p_referencePosition The reference position - */ - template (present) CAM mw_camMsg_BC_refPos( - in template(present) ReferencePosition p_referencePosition - ) modifies mw_camMsg_any := { - cam := { - camParameters := { - basicContainer := { - stationType := ?, - referencePosition := p_referencePosition - }, - highFrequencyContainer := ?, - lowFrequencyContainer := *, - specialVehicleContainer := * - } - } - } - - } // end group camBasicContainer - - group camHighFrequencyContainer { - - /** - * @desc - * Receive template for CAM PDU including specific basic vehicle container - * @param p_basicVehicleContainer The including basic vehicle container - */ - template (present) CAM mw_camMsg_HF_BV( - in template(present) BasicVehicleContainerHighFrequency p_basicVehicleContainer - ) modifies mw_camMsg_any := { - cam := { - camParameters := { - basicContainer := ?, - highFrequencyContainer := { - basicVehicleContainerHighFrequency := p_basicVehicleContainer - }, - lowFrequencyContainer := *, - specialVehicleContainer := * - } - } - } - - /** - * @desc Default Receive template for basic vehicle container in - * the high frequency container - */ - template (present) BasicVehicleContainerHighFrequency mw_HF_BV_any := { - heading := ?, - speed := ?, - driveDirection := ?, - vehicleLength := ?, - vehicleWidth := ?, - longitudinalAcceleration := ?, - curvature := ?, - curvatureCalculationMode := ?, - yawRate := ?, - accelerationControl := *, - lanePosition := *, - steeringWheelAngle := *, - lateralAcceleration := *, - verticalAcceleration := *, - performanceClass := *, - cenDsrcTollingZone := * - } - - /** - * @desc - * Receive template for CAM PDU including specific basic vehicle container - * @param p_curvatureValue The curvature - */ - template(present) BasicVehicleContainerHighFrequency mw_HF_BV_curvature( - in template(present) CurvatureValue p_curvatureValue - ) modifies mw_HF_BV_any := - { - curvature := { - curvatureValue := p_curvatureValue, - curvatureConfidence := ? - } - } - - /** - * @desc - * Receive template for CAM PDU including specific basic vehicle container - * @param p_accCtrl The acceleration control - */ - template(present) BasicVehicleContainerHighFrequency mw_HF_BV_accCtrl( - in template AccelerationControl p_accCtrl - ) modifies mw_HF_BV_any := - { - accelerationControl := p_accCtrl - } - - /** - * @desc - * Receive template for CAM PDU including specific basic vehicle container - * @param p_headingValue The heading - */ - template(present) BasicVehicleContainerHighFrequency mw_HF_BV_heading( - in template(present) HeadingValue p_headingValue - ) modifies mw_HF_BV_any := - { - heading := { - headingValue := p_headingValue, - headingConfidence := ? - } - } - - /** - * @desc - * Receive template for CAM PDU including specific basic vehicle container - * @param p_speedValue The speed - */ - template(present) BasicVehicleContainerHighFrequency mw_HF_BV_speed( - in template(present) SpeedValue p_speedValue - ) modifies mw_HF_BV_any := - { - speed := { - speedValue := p_speedValue, - speedConfidence := ? - } - } - - /** - * @desc - * Receive template for CAM PDU including specific basic vehicle container - * @param p_driveDirection The drive direction - */ - template(present) BasicVehicleContainerHighFrequency mw_HF_BV_driveDirection( - in template(present) DriveDirection p_driveDirection - ) modifies mw_HF_BV_any := - { - driveDirection := p_driveDirection - } - - /** - * @desc - * Receive template for CAM PDU including specific basic vehicle container - * @param p_yawRateValue The yaw rate - */ - template(present) BasicVehicleContainerHighFrequency mw_HF_BV_yawRate( - in template(present) YawRateValue p_yawRateValue - ) modifies mw_HF_BV_any := - { - yawRate := { - yawRateValue := p_yawRateValue, - yawRateConfidence := ? - } - } - - } // end group camHighFrequencyContainer - - group camLowFrequencyContainer { - - /** - * @desc Default Receive template for CAM PDU including - * optional lowFrequencyContainer - */ - template (present) CAM mw_camMsg_LF_any modifies mw_camMsg_any := { - cam := { - camParameters := { - basicContainer := ?, - highFrequencyContainer := ?, - lowFrequencyContainer := ?, - specialVehicleContainer := * - } - } - } - - /** - * @desc - * Receive template for CAM PDU including specific basic vehicle container - * @param p_basicVehicleContainer The including basic vehicle container - */ - template (present) CAM mw_camMsg_LF_BV( - in template(present) BasicVehicleContainerLowFrequency p_basicVehicleContainer := ? - ) modifies mw_camMsg_any := { - cam := { - camParameters := { - basicContainer := ?, - highFrequencyContainer := ?, - lowFrequencyContainer := { - basicVehicleContainerLowFrequency := p_basicVehicleContainer - }, - specialVehicleContainer := * - } - } - } - - /** - * @desc Default Receive template for basic vehicle container in - * the low frequency container - */ - template (present) BasicVehicleContainerLowFrequency mw_LF_BV_any := { - vehicleRole := ?, - exteriorLights := ?, - pathHistory := ? - } - - /** - * @desc - * Receive template for CAM PDU including specific basic vehicle container - * @param p_extLights The exterior lights - */ - template(present) BasicVehicleContainerLowFrequency mw_LF_BV_extLights( - in template (present) ExteriorLights p_extLights - ) modifies mw_LF_BV_any := - { - exteriorLights := p_extLights - } - - } // end group camLowFrequencyContainer - - group camSpecialVehicleContainer { - - /** - * @desc Default Receive template for CAM PDU including - * optional specialVehicleContainer - */ - template (present) CAM mw_camMsg_SVC_any modifies mw_camMsg_any := { - cam := { - camParameters := { - basicContainer := ?, - highFrequencyContainer := ?, - lowFrequencyContainer := *, - specialVehicleContainer := ? - } - } - } - - /** - * @desc Receive template for CAM PDU including optional specialVehicleContainer - * @param p_specialVehicleContainer The expected specialVehicleContainer - */ - template (present) CAM mw_camMsg_SVC( - in template (present) SpecialVehicleContainer p_specialVehicleContainer - ) modifies mw_camMsg_SVC_any := { - cam := { - camParameters := { - specialVehicleContainer := p_specialVehicleContainer - } - } - } - - /** - * @desc Receive template for specialVehicleContainer public transport - */ - template (present) SpecialVehicleContainer mw_publicTransport_any := { - publicTransportContainer := ? - } - - /** - * @desc Receive template for specialVehicleContainer special transport - */ - template (present) SpecialVehicleContainer mw_specialTransport_any := { - specialTransportContainer := ? - } - - /** - * @desc Receive template for specialVehicleContainer dangerous goods - */ - template (present) SpecialVehicleContainer mw_dangerousGoods_any := { - dangerousGoodsContainer := ? - } - - /** - * @desc Receive template for specialVehicleContainer road works - */ - template (present) SpecialVehicleContainer mw_roadWorks_any := { - roadWorksContainerBasic := ? - } - - /** - * @desc Receive template for specialVehicleContainer rescue - */ - template (present) SpecialVehicleContainer mw_rescue_any := { - rescueContainer := ? - } - - /** - * @desc Receive template for specialVehicleContainer emergency - */ - template (present) SpecialVehicleContainer mw_emergency_any := { - emergencyContainer := ? - } - - /** - * @desc Receive template for specialVehicleContainer safety car - */ - template (present) SpecialVehicleContainer mw_safetyCar_any := { - safetyCarContainer := ? - } - - } //end group camSpecialVehicleContainer - - group camAnyVehicle { - - /** - * @desc Send template for Vehicle CAM PDU - * @param p_stationId Station ID of the source - * @param p_generationTime Timestamp of the generated message - * @param p_referencePosition Position of the sending station - */ - template (value) CAM m_camMsg_vehicle_HF_BV( - StationID p_stationId, - GenerationDeltaTime p_generationTime, - template (value) ReferencePosition p_referencePosition - ) := { - header := { - protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, - messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_cam_, - stationID := p_stationId - }, - cam := { - generationDeltaTime := p_generationTime, - camParameters := { - basicContainer := { - stationType := LibItsCommon_ASN1_NamedNumbers.StationType_passengerCar_, - referencePosition := p_referencePosition - }, - highFrequencyContainer := { - basicVehicleContainerHighFrequency := { - heading := { - headingValue := LibItsCommon_ASN1_NamedNumbers.HeadingValue_wgs84North_, //0 - headingConfidence := 10 - }, - speed := { - speedValue := 45, - speedConfidence := 5 - }, - driveDirection := forward, - vehicleLength := { - vehicleLengthValue := 50, - vehicleLengthConfidenceIndication := noTrailerPresent - }, - vehicleWidth := 21, - longitudinalAcceleration := { - longitudinalAccelerationValue := LibItsCommon_ASN1_NamedNumbers.LongitudinalAccelerationValue_unavailable_, - longitudinalAccelerationConfidence := LibItsCommon_ASN1_NamedNumbers.AccelerationConfidence_unavailable_ - }, - curvature := { - curvatureValue := LibItsCommon_ASN1_NamedNumbers.CurvatureValue_straight_, - curvatureConfidence := unavailable - }, - curvatureCalculationMode := yawRateUsed, - yawRate := { - yawRateValue := LibItsCommon_ASN1_NamedNumbers.YawRateValue_straight_, - yawRateConfidence := unavailable - }, - accelerationControl := omit, - lanePosition := omit, - steeringWheelAngle := omit, - lateralAcceleration := omit, - verticalAcceleration := omit, - performanceClass := omit, - cenDsrcTollingZone := omit - } - }, - lowFrequencyContainer := omit, - specialVehicleContainer := omit - } - } - }; // End of template m_camMsg_vehicle_HF_BV - - /** - * @desc Send template for Vehicle CAM PDU - * @param p_stationId Station ID of the source - * @param p_generationTime Timestamp of the generated message - * @param p_referencePosition Position of the sending station - */ - template (value) CAM m_camMsg_vehicle( - StationID p_stationId, - GenerationDeltaTime p_generationTime, - template (value) ReferencePosition p_referencePosition - ) modifies m_camMsg_vehicle_HF_BV := { - cam := { - camParameters := { - lowFrequencyContainer := { - basicVehicleContainerLowFrequency := { - vehicleRole := default_, - exteriorLights := LibItsCommon_ASN1_NamedNumbers.ExteriorLights_daytimeRunningLightsOn_, - pathHistory := {} - } - } - } - } - }; - - template (value) CAM m_camMsg_publicTransport( - StationID p_stationId, - GenerationDeltaTime p_generationTime, - template (value) ReferencePosition p_referencePosition - ) modifies m_camMsg_vehicle := { - cam := { - camParameters := { - lowFrequencyContainer := { - basicVehicleContainerLowFrequency := { - vehicleRole := publicTransport - } - }, - specialVehicleContainer := { - publicTransportContainer := { - embarkationStatus := true, - ptActivation := omit - } - } - } - } - }; - - template (value) CAM m_camMsg_specialTransport( - StationID p_stationId, - GenerationDeltaTime p_generationTime, - template (value) ReferencePosition p_referencePosition - ) modifies m_camMsg_vehicle := { - cam := { - camParameters := { - lowFrequencyContainer := { - basicVehicleContainerLowFrequency := { - vehicleRole := specialTransport - } - }, - specialVehicleContainer := { - specialTransportContainer := { - specialTransportType := '1000'B/* length(4)*/, // heavyLoad - lightBarSirenInUse := '11'B/* length(2)*/ // siren and lightBar - } - } - } - } - }; - } // end camAnyVehicle - - group camAccelerationControlTemplates { - - /** - * @desc Receive template for acceleration control with brake padel active on - */ - template AccelerationControl mw_brakePedalActive_On := '1*'B length(7); - - /** - * @desc Receive template for acceleration control with brake padel active off - */ - template AccelerationControl mw_brakePedalActive_Off := '0*'B length(7); - - /** - * @desc Receive template for acceleration control with gas padel active on - */ - template AccelerationControl mw_gasPedalActive_On := '?1*'B length(7); - - /** - * @desc Receive template for acceleration control with gas padel active off - */ - template AccelerationControl mw_gasPedalActive_Off := '?0*'B length(7); - - /** - * @desc Receive template for acceleration control with emergency brake active on - */ - template AccelerationControl mw_emergencyBrakeActive_On := '??1*'B length(7); - - /** - * @desc Receive template for acceleration control with emergency brake active off - */ - template AccelerationControl mw_emergencyBrakeActive_Off := '??0*'B length(7); - - /** - * @desc Receive template for acceleration control with collision warning active on - */ - template AccelerationControl mw_collisionWarningActive_On := '???1*'B length(7); - - /** - * @desc Receive template for acceleration control with collision warning active off - */ - template AccelerationControl mw_collisionWarningActive_Off := '???0*'B length(7); - - /** - * @desc Receive template for acceleration control with adaptive cruise control active on - */ - template AccelerationControl mw_accActive_On := '????1*'B length(7); - - /** - * @desc Receive template for acceleration control with adaptive cruise control active off - */ - template AccelerationControl mw_accActive_Off := '????0*'B length(7); - - /** - * @desc Receive template for acceleration control with cruise control active on - */ - template AccelerationControl mw_cruiseControl_On := '?????1*'B length(7); - - /** - * @desc Receive template for acceleration control with cruise control active off - */ - template AccelerationControl mw_cruiseControl_Off := '?????0*'B length(7); - - /** - * @desc Receive template for acceleration control with speed limiter active on - */ - template AccelerationControl mw_speedLimiterActive_On := '*1'B length(7); - - /** - * @desc Receive template for acceleration control with speed limiter active off - */ - template AccelerationControl mw_speedLimiterActive_Off := '*0'B length(7); - - } // end group camAccelerationControlTemplates - - group camExteriorLightsTemplates { - - /** - * @desc Receive template for exterior lights with low beam lights off - */ - template ExteriorLights mw_lowBeamLightsOff := '0*'B length (8); - - /** - * @desc Receive template for exterior lights with low beam lights on - */ - template ExteriorLights mw_lowBeamLightsOn := '1*'B length(8); - - /** - * @desc Receive template for exterior lights with high beam lights off - */ - template ExteriorLights mw_highBeamLightsOff := '?0*'B length(8); - - /** - * @desc Receive template for exterior lights with high beam lights on - */ - template ExteriorLights mw_highBeamLightsOn := '?1*'B length(8); - - /** - * @desc Receive template for exterior lights with left turn signal off - */ - template ExteriorLights mw_leftTurnSignalOff := '??0*'B length(8); - - /** - * @desc Receive template for exterior lights with left turn signal on - */ - template ExteriorLights mw_leftTurnSignalOn := '??1*'B length(8); - - /** - * @desc Receive template for exterior lights with right turn signal off - */ - template ExteriorLights mw_rightTurnSignalOff := '???0*'B length(8); - /** - * @desc Receive template for exterior lights with right turn signal on - */ - template ExteriorLights mw_rightTurnSignalOn := '???1*'B length(8); - - /** - * @desc Receive template for exterior lights with day time running lights off - */ - template ExteriorLights mw_daytimeRunningLightsOff := '????0*'B length(8); - /** - * @desc Receive template for exterior lights with day time running lights on - */ - template ExteriorLights mw_daytimeRunningLightsOn := '????1*'B length(8); - - /** - * @desc Receive template for exterior lights with reverse light off - */ - template ExteriorLights mw_reverseLightOff := '?????0*'B length(8); - - /** - * @desc Receive template for exterior lights with reverse light on - */ - template ExteriorLights mw_reverseLightOn := '?????1*'B length(8); - - /** - * @desc Receive template for exterior lights with fog light off - */ - template ExteriorLights mw_fogLightOff := '??????0*'B length(8); - - /** - * @desc Receive template for exterior lights with fog light on - */ - template ExteriorLights mw_fogLightOn := '??????1*'B length(8); - - /** - * @desc Receive template for exterior lights with parking lights off - */ - template ExteriorLights mw_parkingLightsOff := '*0'B length(8); - - /** - * @desc Receive template for exterior lights with parking lights on - */ - template ExteriorLights mw_parkingLightsOn := '*1'B length(8); - - /** - * @desc Receive template for exterior lights with hazard lights on - */ - template ExteriorLights mw_hazardConditionOn := '??11*'B length(8); - - } // end group exteriorLights - - group camTemplateFunctions { - - /** - * @desc Converts an integer to Longitude - * @param p_longitude The integer value - * @return The longitude value - */ - function f_integer2Longitude(in integer p_longitude) return Longitude { - - var Longitude v_longitude := f_abs(p_longitude); - - return v_longitude; - } - - /** - * @desc Converts an integer to Latitude - * @param p_latitude The integer value - * @return The latitude value - */ - function f_integer2Latitude(in integer p_latitude) return Latitude { - - var Latitude v_latitude := f_abs(p_latitude); - - return v_latitude; - } - - } // end camTemplateFunctions - -} // end LibItsCam_Templates diff --git a/ttcn/CAM/LibItsCam_TestSystem.ttcn b/ttcn/CAM/LibItsCam_TestSystem.ttcn deleted file mode 100644 index fd3727e8..00000000 --- a/ttcn/CAM/LibItsCam_TestSystem.ttcn +++ /dev/null @@ -1,162 +0,0 @@ -/** - * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/CAM/LibItsCam_TestSystem.ttcn $ - * $Id: LibItsCam_TestSystem.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Test System module for ITS CAM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsCam_TestSystem language "TTCN-3:2010 Real Time and Performance Testing" { - - // LibCommon -// import from LibCommon_Time {modulepar all}; -// import from LibCommon_Sync all; - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from CAM_PDU_Descriptions language "ASN.1:1997" all; -// import from DENM_PDU_Descriptions language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TestSystem all; - import from LibItsCommon_TypesAndValues all; - - // LibItsCam - import from LibItsCam_TypesAndValues all; - - group portDefinitions { - - /** - * @desc Adapter control port - */ - type port AdapterControlPort message { - out - AcGnssPrimitive, AcSecPrimitive; - in - AdapterControlResults; - } // end AdapterControlPort - - /** - * @desc Upper Tester port - */ - type port UpperTesterPort message { - out - UtCamInitialize, UtCamTrigger, UtCamChangePosition, UtActivatePositionTime, UtDeactivatePositionTime; - in - UtCamResults, UtCamEventInd; - } // end UpperTesterPort - - } // end portDefinitions - - group interfacePorts { - - group facilityPorts { - - group fa1Ports { - - /** - * @desc FA1 CAM Port (CAM/BTP/GeoNet/G5) - */ - type port CamPort message { - in CamInd; - out CamReq; - } // End of port CamPort - - } // end fa1Ports - - } // End of group facilityPorts - - } // End of group interfacePorts - - group componentDefinitions { - - /** - * @desc ITS System Adapter - */ - type component ItsCamSystem { - - port UpperTesterPort utPort; - port AdapterControlPort acPort; - - // FA1 ports - port CamPort camPort; - - } // end component ItsAdapter - - } // End of group componentDefinitions - - /** - * @desc Test component for ITS Facility layer - */ - type component ItsCam extends ItsBaseComponent { - - port UpperTesterPort utPort; - port AdapterControlPort acPort; - - // FA1 ports - port CamPort camPort; - //timers - - //component variables - var CamInd vc_camMsg; - - //default - var default vc_default := null; - - //global variables - var boolean vc_camReceived := false; - - var UtCamEventIndList vc_utEvents := {}; - - var boolean vc_utDefaultActive := true; - var boolean vc_camDefaultActive := true; - - } // End of component ItsCam - - group facilityPrimitives { - - group fa1Primitives { - - /** - * @desc FA1 CAM Indication Primitive - */ - type record CamInd { - CAM msgIn, - UInt64 recvTime, - UInt8 gnNextHeader optional, - UInt8 gnHeaderType optional, - UInt8 gnHeaderSubtype optional, - UInt32 gnLifetime optional, - UInt8 gnTrafficClass optional, - UInt16 btpDestinationPort optional, - UInt16 btpInfo optional, - Bit256 ssp optional, - UInt32 its_aid optional - } - with { - encode (msgIn) "PER" - } - - /** - * @desc FA1 CAM Request Primitive - */ - type record CamReq { - CAM msgOut - } - with { - encode (msgOut) "PER" - } - - } // end fa1Primitives - - } // End of group facilityPrimitives - with { - variant "" - encode "LibIts_Interface" - } // end interfacePrimitives - -} // End of module LibItsCam_TestSystem diff --git a/ttcn/CAM/LibItsCam_TypesAndValues.ttcn b/ttcn/CAM/LibItsCam_TypesAndValues.ttcn deleted file mode 100644 index d78ddde8..00000000 --- a/ttcn/CAM/LibItsCam_TypesAndValues.ttcn +++ /dev/null @@ -1,184 +0,0 @@ -/** - * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/CAM/LibItsCam_TypesAndValues.ttcn $ - * $Id: LibItsCam_TypesAndValues.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Module containing types and values for CAM Protocol - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsCam_TypesAndValues { - - // LibCommon - 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; - // import from DENM_PDU_Descriptions language "ASN.1:1997" all; - - group camValues { - - const float c_lowFrequencyGenerationTime := 0.5; //500 ms - const float c_specialVehicleGenerationTime := 0.5; //500 ms - - const AccelerationControl c_accCtrlIdle := '0000000'B; - - const ExteriorLights c_elAllLightsOff := '00000000'B; - - const VehicleRole c_vehicleRole_publicTransport := publicTransport; - const VehicleRole c_vehicleRole_specialTransport := specialTransport; - const VehicleRole c_vehicleRole_dangerousGoods := dangerousGoods; - const VehicleRole c_vehicleRole_roadWork := roadWork; - const VehicleRole c_vehicleRole_rescue := rescue; - const VehicleRole c_vehicleRole_emergency := emergency; - const VehicleRole c_vehicleRole_safetyCar := safetyCar; - - const DangerousGoodsBasic c_dangerousGoodsBasic_explosives1 := explosives1; - const DangerousGoodsBasic c_dangerousGoodsBasic_explosives2 := explosives2; - const DangerousGoodsBasic c_dangerousGoodsBasic_explosives3 := explosives3; - const DangerousGoodsBasic c_dangerousGoodsBasic_explosives4 := explosives4; - const DangerousGoodsBasic c_dangerousGoodsBasic_explosives5 := explosives5; - const DangerousGoodsBasic c_dangerousGoodsBasic_explosives6 := explosives6; - const DangerousGoodsBasic c_dangerousGoodsBasic_flammableGases := flammableGases; - const DangerousGoodsBasic c_dangerousGoodsBasic_nonFlammableGases := nonFlammableGases; - const DangerousGoodsBasic c_dangerousGoodsBasic_toxicGases := toxicGases; - const DangerousGoodsBasic c_dangerousGoodsBasic_flammableLiquids := flammableLiquids; - const DangerousGoodsBasic c_dangerousGoodsBasic_flammableSolids := flammableSolids; - const DangerousGoodsBasic c_dangerousGoodsBasic_substancesLiableToSpontaneousCombustion := substancesLiableToSpontaneousCombustion; - const DangerousGoodsBasic c_dangerousGoodsBasic_substancesEmittingFlammableGasesUponContactWithWater := substancesEmittingFlammableGasesUponContactWithWater; - const DangerousGoodsBasic c_dangerousGoodsBasic_oxidizingSubstances := oxidizingSubstances; - const DangerousGoodsBasic c_dangerousGoodsBasic_organicPeroxides := organicPeroxides; - const DangerousGoodsBasic c_dangerousGoodsBasic_toxicSubstances := toxicSubstances; - const DangerousGoodsBasic c_dangerousGoodsBasic_infectiousSubstances := infectiousSubstances; - const DangerousGoodsBasic c_dangerousGoodsBasic_radioactiveMaterial := radioactiveMaterial; - const DangerousGoodsBasic c_dangerousGoodsBasic_corrosiveSubstances := corrosiveSubstances; - const DangerousGoodsBasic c_dangerousGoodsBasic_miscellaneousDangerousSubstances := miscellaneousDangerousSubstances; - - } // end group camValues - - group certificates { - - const charstring PX_CERT_IUT_CAM_02 := "CERT_IUT_CAM_BO_02_AT"; - const charstring PX_CERT_IUT_CAM_03 := "CERT_IUT_CAM_BO_03_AT"; - - } - - group utPrimitives { - - /** - * @desc Upper Tester message to initialize IUT - * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use - */ - type record UtCamInitialize { - Oct8 hashedId8 - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester results message of the CAM IUT - * @member utCamInitialize - - * @member utCamTriggerResult - - * @member utCamChangePositionResult - - * @member utActivatePositionTimeResult - - * @member utDeactivatePositionTimeResult - - */ - type union UtCamResults { - boolean utCamInitializeResult, - boolean utCamTriggerResult, - boolean utCamChangePositionResult, - boolean utActivatePositionTimeResult, - boolean utDeactivatePositionTimeResult - } with { - variant "" - } // End of type UtCamResults - - /** - * @desc Upper Tester message to change the position of IUT. Values a relatives - */ - type record UtCamChangePosition { - Int32 latitude, - Int32 longitude, - Int32 elevation - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc - * @member changeCurvature Changes the curvature. - * @member changeSpeed Changes the speed in cm/s. - * @member setAccelerationControlStatus Sets the acceleration control status. - * @member setExteriorLightsStatus Sets the exterior lights status. - * @member changeHeading Changes the heading. - * @member setDriveDirection Sets the drive direction. - * @member setStationType - * @member setVehicleRole - * @member setEmbarkationStatus - * @member setPtActivation - * @member setDangerousGoods - * @member setLightBarSireneStatus - * @member changeYawRate Changes the yaw rate in offsets of 0.01 degrees per second. - */ - type union UtCamTrigger { - CurvatureValue changeCurvature, - Int16 changeSpeed, - AccelerationControl setAccelerationControlStatus, - ExteriorLights setExteriorLightsStatus, - HeadingValue changeHeading, - DriveDirection setDriveDirection, - YawRateValue changeYawRate, - StationType setStationType, - VehicleRole setVehicleRole, - EmbarkationStatus setEmbarkationStatus, - PtActivation setPtActivation, - DangerousGoodsBasic setDangerousGoods, - LightBarSirenInUse setLightBarSirene - } with { - variant "" - } - - /** - * @desc Upper Tester result message of request of triggering of an event at IUT - */ - type record UtActivatePositionTime { - // empty on purpose - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to deactivate position and/or time - */ - type record UtDeactivatePositionTime { - // empty on purpose - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to check event/status on CAM IUT - */ - type record UtCamEventInd { - CAM camMsg // TODO Rename into caMsg to be compliant with UtDenmEventInd - } with { - encode (camMsg) "LibItsCam_asn1" - } - - /** - * @desc List of Upper Tester messages to check event/status on CAM IUT - */ - type record of UtCamEventInd UtCamEventIndList; - - } with { - encode "UpperTester" - variant "" - } // end utPrimitives -} -with { - encode "LibItsCam" - } diff --git a/ttcn/CAM/module.mk b/ttcn/CAM/module.mk deleted file mode 100644 index 52c19ced..00000000 --- a/ttcn/CAM/module.mk +++ /dev/null @@ -1,8 +0,0 @@ -sources := \ - LibItsCam_EncdecDeclarations.ttcn \ - LibItsCam_Functions.ttcn \ - LibItsCam_Pics.ttcn \ - LibItsCam_Pixits.ttcn \ - LibItsCam_Templates.ttcn \ - LibItsCam_TestSystem.ttcn \ - LibItsCam_TypesAndValues.ttcn diff --git a/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn b/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn deleted file mode 100644 index 8a4b903e..00000000 --- a/ttcn/DENM/LibItsDenm_EncdecDeclarations.ttcn +++ /dev/null @@ -1,49 +0,0 @@ -module LibItsDenm_EncdecDeclarations { - - // LibIts - import from LibItsDenm_TypesAndValues all; - - // LibItsDenm - import from LibItsDenm_TestSystem all; - import from DENM_PDU_Descriptions language "ASN.1:1997" all; - - external function fx_enc_DenmReq (DenmReq p) return bitstring - with {extension "prototype(convert) encode(LibIts_Interface)"} - - external function fx_dec_DenmReq (inout bitstring b, out DenmReq p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_dec_DenmInd (inout bitstring b, out DenmInd p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_enc_DENM (DENM p) return bitstring - with {extension "prototype(convert) encode(PER)"} - - external function fx_dec_DENM (inout bitstring b, out DENM p) return integer - with {extension "prototype(sliding) decode(PER)"} - - external function fx_enc_UtDenmInitialize (UtDenmInitialize p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtDenmChangePosition (UtDenmChangePosition p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtDenmChangePseudonym (UtDenmChangePseudonym p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtDenmTrigger (UtDenmTrigger p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtDenmUpdate (UtDenmUpdate p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtDenmTermination (UtDenmTermination p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_dec_UtDenmResults (inout bitstring b, out UtDenmResults p) return integer - with {extension "prototype(sliding) decode(UpperTester)"} - - external function fx_dec_UtDenmEventInd (inout bitstring b, out UtDenmEventInd p) return integer - with {extension "prototype(sliding) decode(UpperTester)"} - -} // End of module LibItsDenm_EncdecDeclarations diff --git a/ttcn/DENM/LibItsDenm_Functions.ttcn b/ttcn/DENM/LibItsDenm_Functions.ttcn deleted file mode 100644 index bf04d058..00000000 --- a/ttcn/DENM/LibItsDenm_Functions.ttcn +++ /dev/null @@ -1,669 +0,0 @@ -/** - * @author ETSI / STF449 / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/DENM/LibItsDenm_Functions.ttcn $ - * $Id: LibItsDenm_Functions.ttcn,v 1.5 2018/05/31 15:57:07 dte Exp $ - * @desc Module containing functions for DENM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsDenm_Functions { - - // LibCommon - import from LibCommon_Sync all; - import from LibCommon_VerdictControl all; - import from LibCommon_Time { modulepar PX_TNOAC ; function f_sleep }; - - // LibIts - import from ITS_Container language "ASN.1:1997" all; - import from DENM_PDU_Descriptions language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_Templates all; - import from LibItsCommon_TypesAndValues all; - import from LibItsCommon_Functions all; - import from LibItsCommon_Pixits all; - - // LibIts - import from LibItsDenm_TestSystem all; - import from LibItsDenm_TypesAndValues all; - import from LibItsDenm_Templates all; -// import from LibItsDenm_Pixits all; - import from LibItsDenm_Pics all; - - group utFuntions { - - /** - * @desc Requests to bring the IUT in an initial state - * @param p_init The initialisation to trigger. - */ - function f_utInitializeIut(template (value) UtDenmInitialize p_init) runs on ItsDenm { - - //deactivate denmPort default alts - vc_denmDefaultActive := false; - - utPort.send(p_init); - tc_wait.start; - alt { - [] utPort.receive(UtDenmResults: { utDenmInitializeResult := true }) { - tc_wait.stop; - log("*** " & testcasename() & ": INFO: IUT initialized ***"); - } - [] a_utDefault() { - //empty on purpose - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //activate denmPort default alts - vc_denmDefaultActive := true; - - } - - /** - * @desc Requests to change the IUT with a new pseudonym - * @param p_change The change to trigger. - */ - function f_utChangePseudonym ( template (value) UtDenmChangePseudonym p_change ) runs on ItsDenm { - - //deactivate denmPort default alts - vc_denmDefaultActive := false; - - utPort.send(p_change); - tc_wait.start; - alt { - [] utPort.receive(UtDenmResults: { utDenmChangePseudonymResult := true}) { - tc_wait.stop; - log("*** " & testcasename() & ": INFO: IUT pseudonym changed ***"); - } - [] utPort.receive(UtDenmResults: { utDenmChangePseudonymResult := false}) { - tc_wait.stop; - log("*** " & testcasename() & ": INFO: IUT pseudonym unchanged ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] a_utDefault() { - //empty on purpose - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //activate denmPort default alts - vc_denmDefaultActive := true; - - } - - /** - * @desc Triggers an event from the application layer - * @param p_event The event to trigger. - */ - function f_utTriggerEvent(in template (value) UtDenmTrigger p_event) runs on ItsDenm return ActionID { - var ActionID v_actionId; - var UtDenmResults v_result; - - //deactivate denmPort default alts - vc_denmDefaultActive := false; - - utPort.send(p_event); - tc_wait.start; - alt { - [] utPort.receive(UtDenmResults: { utDenmTriggerResult := ? }) -> value v_result { - tc_wait.stop; - v_actionId := v_result.utDenmTriggerResult.actionId; - if ( not v_result.utDenmTriggerResult.result ) { - f_selfOrClientSyncAndVerdict("DENM Trigger failed", e_error); - } - } - [] a_utDefault() { - //empty on purpose - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //activate denmPort default alts - vc_denmDefaultActive := true; - - return v_actionId; - } - - /** - * @desc Updates an event at the application layer - * @param p_event The event to update. - */ - function f_utUpdateEvent(template (value) UtDenmUpdate p_event) runs on ItsDenm return ActionID { - var ActionID v_actionId; - var UtDenmResults v_result; - - //deactivate denmPort default alts - vc_denmDefaultActive := false; - - utPort.send(p_event); - tc_wait.start; - alt { - [] utPort.receive(UtDenmResults: { utDenmUpdateResult := ? }) -> value v_result { - tc_wait.stop; - v_actionId := v_result.utDenmUpdateResult.actionId; - } - [] a_utDefault() { - //empty on purpose - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //activate denmPort default alts - vc_denmDefaultActive := true; - - return v_actionId; - } - - /** - * @desc Terminates an event at the application layer - * @param p_event The event to terminate. - */ - function f_utTerminateEvent(template (value) UtDenmTermination p_event) runs on ItsDenm { - - //deactivate denmPort default alts - vc_denmDefaultActive := false; - - utPort.send(p_event); - tc_wait.start; - alt { - [] utPort.receive(UtDenmResults: { utDenmTerminationResult := ?}) { - tc_wait.stop; - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] a_utDefault() { - //empty on purpose - } - } - - //activate denmPort default alts - vc_denmDefaultActive := true; - - } - - /** - * @desc Changes the position of the IUT - * @param p_latitude - * @param p_longitude - * @param p_elevation - */ - function f_utChangePosition(template (value) UtDenmChangePosition p_position) runs on ItsDenm { - - //deactivate denmPort default alts - vc_denmDefaultActive := false; - - utPort.send(p_position); - tc_wait.start; - alt { - [] utPort.receive(UtDenmResults: { utDenmChangePositionResult := ? }) { - tc_wait.stop; - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] a_utDefault() { - //empty on purpose - } - } - - //activate denmPort default alts - vc_denmDefaultActive := true; - - } - - } // End of group utFunctions - - group adapterControl { - - /** - * @desc Initialise secure mode if required - */ - function f_initialiseSecuredMode( - in charstring p_certificateId := PX_CERT_FOR_TS - ) runs on ItsDenm { - - if (PICS_IS_IUT_SECURED == true) { - - if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificateId))) { - log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); - stop; - } - } - - } // End of function f_initialiseSecuredMode() - - function f_uninitialiseSecuredMode() runs on ItsDenm { - - if (PICS_IS_IUT_SECURED == true) { - f_acTriggerSecEvent(m_acDisableSecurity); - } - - } // End of function f_initialiseSecuredMode() - - /** - * @desc Triggers event in the test system adaptation. - * @param p_event The event to trigger - * @return FncRetCode - */ - function f_acTriggerSecEvent( - in template (value) AcSecPrimitive p_event - ) runs on ItsDenm return FncRetCode { - var FncRetCode v_ret := e_success; - - acPort.send(p_event); - tc_ac.start; - alt { - [] acPort.receive(m_acSecResponseSuccess) { - tc_ac.stop; - } - [] acPort.receive { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - return v_ret; - } - - /** - * @desc Triggers event in the test system adaptation. - * @param p_event The event to trigger - * @return FncRetCode - */ - function f_acTriggerGnssEvent(template (value) AcGnssPrimitive p_event) runs on ItsDenm return FncRetCode { - var FncRetCode v_ret := e_success; - - acPort.send(p_event); - tc_ac.start; - alt { - [] acPort.receive(m_acGnssResponseSuccess) { - tc_ac.stop; - } - [] acPort.receive { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - return v_ret; - } - - /** - * @desc Loads the given scenario - * - * @param p_scenario The scenario to load. - */ - function f_acLoadScenario(Scenario p_scenario) runs on ItsDenm { - - if (PX_GNSS_SCENARIO_SUPPORT==true) { - f_acTriggerGnssEvent(m_loadScenario(p_scenario)); - } - } // End of function f_acLoadScenario - - /** - * @desc Starts a loaded scenario - */ - function f_acStartScenario() runs on ItsDenm { - - if (PX_GNSS_SCENARIO_SUPPORT==true) { - f_acTriggerGnssEvent(m_startScenario); - vc_scenarioStarted := true; - } - } // End of function f_acStartScenario - - /** - * @desc Stops a loaded scenario - */ - function f_acStopScenario() runs on ItsDenm { - - if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { - f_acTriggerGnssEvent(m_stopScenario); - vc_scenarioStarted := false; - } - } // End of function f_acStopScenario - - function f_acAwaitDistanceCovered(float p_distanceToCover) runs on ItsDenm return FncRetCode { - var FncRetCode v_ret := e_success; - - if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { - f_acTriggerGnssEvent(m_distanceToCover(p_distanceToCover)); - - tc_ac.start(PX_T_GNSS_AWAIT_DISTANCE_COVERED); - alt { - [] acPort.receive(m_acGnssDistanceCoveredSuccess) { - tc_ac.stop; - } - [] acPort.receive(m_acGnssDistanceCoveredError) { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for covered distance indication ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - } - return v_ret; - } // End of function f_acAwaitDistanceCovered - - function f_acAwaitSpeed(float p_speed, SpeedTrend p_speedTrend := e_accelerate) runs on ItsDenm return FncRetCode { - var FncRetCode v_ret := e_success; - - if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { - f_acTriggerGnssEvent(m_awaitSpeed(p_speed, p_speedTrend)); - - tc_ac.start(PX_T_GNSS_AWAIT_SPEED_REACHED); - alt { - [] acPort.receive(m_acGnssSpeedReachedSuccess) { - tc_ac.stop; - } - [] acPort.receive(m_acGnssSpeedReachedError) { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for covered distance indication ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - } - return v_ret; - } // End of function f_acAwaitSpeed - - function f_acAwaitTimeInRunningScenario(integer p_time) runs on ItsDenm return FncRetCode { - var FncRetCode v_ret := e_success; - - if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { - f_acTriggerGnssEvent(m_timeInRunningScenario(p_time)); - - tc_ac.start(int2float(p_time)*1.1); - alt { - [] acPort.receive(m_acGnssTimeReachedSuccess) { - tc_ac.stop; - } - [] acPort.receive(m_acGnssTimeReachedError) { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for time reached indication ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - } - return v_ret; - } // end f_acAwaitTimeInRunningScenario - - } // End of group adapterControl - - group denmConfigurationFunctions { - - /** - * @desc Setups default configuration - * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT - */ - function f_cfUp( - in charstring p_certificateId := PX_CERT_FOR_TS - ) runs on ItsDenm system ItsDenmSystem { - - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - map(self:denmPort, system:denmPort); - f_connect4SelfOrClientSync(); - - // Initialise secured mode - f_initialiseSecuredMode(p_certificateId); - - } // End of function f_cfUp - - /** - * @desc Deletes default configuration - */ - function f_cfDown() runs on ItsDenm system ItsDenmSystem { - - // Initialise secured mode - f_uninitialiseSecuredMode(); - - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - unmap(self:denmPort, system:denmPort); - f_disconnect4SelfOrClientSync(); - - } // End of function f_cfDown - - } //end denmConfigurationFunctions - - group altsteps { - - /** - * @desc The base default. - */ - altstep a_default() runs on ItsDenm { - [vc_denmDefaultActive] denmPort.receive(mw_denmInd(mw_denmPdu(mw_anyDenm))) { - log("*** " & testcasename() & ": INFO: DENM message received in default ***"); - vc_denmReceived := true; - repeat; - } - [vc_denmDefaultActive] denmPort.receive { - log("*** " & testcasename() & ": ERROR: Received an unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] acPort.receive(AdapterControlResults: { acGnssTimeReached := ?}) { - log("*** a_default: INFO: event received on AC port in default ***"); - repeat; - } - [] acPort.receive(AdapterControlResults: { acGnssSpeedReached := ?}) { - log("*** a_default: INFO: event received on AC port in default ***"); - repeat; - } - [] acPort.receive(AdapterControlResults: { acGnssDistanceCovered := ?}) { - log("*** a_default: INFO: event received on AC port in default ***"); - repeat; - } - [] acPort.receive { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INCONC: Timeout while awaiting reaction of the IUT prior to Upper Tester action ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] a_shutdown() { - f_poDefault(); - f_cfDown(); - log("*** " & testcasename() & ": INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc The default for handling upper tester messages. - */ - altstep a_utDefault() runs on ItsDenm { - var UtDenmEventInd v_event; - [vc_utDefaultActive] utPort.receive(UtDenmEventInd:?) -> value v_event { - //store every upper tester indication received - vc_utEvents[lengthof(vc_utEvents)] := v_event; - repeat; - } - [vc_utDefaultActive] utPort.receive { - log("*** " & testcasename() & ": INFO: Received unhandled/unknown UT message from IUT ***"); - repeat; - } - } - - } // end group altsteps - - group preambles { - - /** - * @desc The default preamble. - */ - function f_prDefault() runs on ItsDenm { - vc_default := activate(a_default()); - activate(a_utDefault()); - } - - /** - * @desc Brings the IUT into an initial state. - * @return FncRetCode - */ - function f_prInitialState( - in Scenario p_scenario := e_staticPosition, - in template (value) UtDenmInitialize p_denmInitialize := m_denmInitialize, - in boolean p_awaitTimeInRunningScenario := true - ) runs on ItsDenm return FncRetCode { - var FncRetCode v_ret := e_success; - - f_utInitializeIut(p_denmInitialize); - - f_acLoadScenario(valueof(p_scenario)); - f_acStartScenario(); - if (p_awaitTimeInRunningScenario) { - f_acAwaitTimeInRunningScenario(f_getTimeForGpsFix()); - } - - f_prDefault(); - - return v_ret; - } - - } // end group preambles - - group postambles { - - /** - * @desc The default postamble. - */ - function f_poDefault() runs on ItsDenm { - var FncRetCode v_ret := e_success; - f_acStopScenario(); - } - - /** - * @desc Postamble including cancellation of an event. - * @param p_trigger Indicates if the cancellation have to be raised by the test system(e_ets) - * or at the application layer of the IUT(e_iut). - * @param p_actionId The action ID of the event to be cancelled - */ - function f_poCancelEvent(template (value) Trigger p_trigger, template (value) ActionID p_actionId) - runs on ItsDenm { - var FncRetCode v_ret := e_success; - - if (valueof(p_trigger) == e_ets) { - f_sendDenMessage( m_denmCancellation ( p_actionId , f_getTsStationType( ) ) ); - f_sleep(PX_TNOAC); - } - else { - f_utTerminateEvent(m_utEventCancellation(p_actionId)); - } - - f_poDefault(); - } - - } // end group postambles - - group sendFunctions { - - /** - * @desc Sends a DEN message - * @param p_sendMsg The DEN message to send. - * @param p_overrideSeqNo Overrides the sequence number with the stored one. - */ - function f_sendDenMessage(template (value) DecentralizedEnvironmentalNotificationMessage p_denm, boolean p_overrideSeqNo := true) runs on ItsDenm return ActionID { - - if (p_overrideSeqNo) { - p_denm.management.actionID.sequenceNumber := vc_sequenceNo; - } - - denmPort.send( - m_denmReq( - m_denmPdu( - p_denm - ) - ) - ); - - return valueof(p_denm.management.actionID); - } - - } // end sendFunctions - - group receiveFunctions { - - /** - * @desc Awaits a DEN message and returns it - * @param p_rcvMsg The expected message to be received. - * @param p_rcvdMsg The received message - OUT. - */ - function f_awaitDenMessage(in template (present) DenmInd p_rcvMsg, out DenmInd p_rcvdMsg) runs on ItsDenm { - - tc_ac.start; - alt { - [] denmPort.receive(p_rcvMsg) -> value p_rcvdMsg { - tc_ac.stop; - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INFO: Timeout while awaiting the reception of a message ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - } - - } // end receiveFunctions - - group miscellaneousFunctions { - - /** - * @desc Increases the sequence number and handles the special case where the - * sequence number reaches the limit of 65535 and will be reset to 0. - * @param p_sequenceNumber The sequence number to increase. - * @return The increased sequence number. - */ - function f_increaseSequenceNumber(in SequenceNumber p_sequenceNumber) return SequenceNumber { - // if maximum number of 65535 reached, reset it to 0 - return ((p_sequenceNumber + 1) mod 65536); - } - - } // end group miscellaneousFunctions - -} // end LibItsDenm_Functions diff --git a/ttcn/DENM/LibItsDenm_Pics.ttcn b/ttcn/DENM/LibItsDenm_Pics.ttcn deleted file mode 100644 index 42ec0240..00000000 --- a/ttcn/DENM/LibItsDenm_Pics.ttcn +++ /dev/null @@ -1,72 +0,0 @@ -/** - * @author ETSI / STF449 / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/DENM/LibItsDenm_Pics.ttcn $ - * $Id: LibItsDenm_Pics.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc DENM PICS - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsDenm_Pics { - - group denmPics { - - /** - * @desc Support for DENM generation - * @see ETSI TS 102 869-1 Table A.1 - */ - modulepar boolean PICS_DENM_GENERATION := true; - - /** - * @desc Support for DENM RECEPTION - * @see ETSI TS 102 869-1 Table A.1 - */ - modulepar boolean PICS_DENM_RECEPTION := true; - - /** - * @desc Support for DENM update - * @see ETSI TS 102 869-1 Table A.2 - */ - modulepar boolean PICS_DENM_UPDATE := true; - - /** - * @desc Support for DENM repetition - * @see ETSI TS 102 869-1 Table A.2 - */ - modulepar boolean PICS_DENM_REPETITION := true; - - /** - * @desc Support for DENM cancellation - * @see ETSI TS 102 869-1 Table A.2 - */ - modulepar boolean PICS_DENM_CANCELLATION := true; - - /** - * @desc Support for DENM NEGATION - * @see ETSI TS 102 869-1 Table A.2 - */ - modulepar boolean PICS_DENM_NEGATION := false; - - /** - * @desc Support for Keep-Alive Forwarding - * @see ETSI TS 102 869-1 Table A.2 - */ - modulepar boolean PICS_DENM_KAF := false; - - /** - * @desc Support for impact recuction - * @see ETSI TS 102 869-1 Table A.2 - */ - modulepar boolean PICS_IMPACT_REDUCTION := true; - - /** - * @desc Is the IUT running in secured mode? - * @see ETSI TS 102 869-1 Table A.3 - */ - modulepar boolean PICS_IS_IUT_SECURED := false; - - } // end denmPics - -} \ No newline at end of file diff --git a/ttcn/DENM/LibItsDenm_Pixits.ttcn b/ttcn/DENM/LibItsDenm_Pixits.ttcn deleted file mode 100644 index d9585adc..00000000 --- a/ttcn/DENM/LibItsDenm_Pixits.ttcn +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @author ETSI / STF449 / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/DENM/LibItsDenm_Pixits.ttcn $ - * $Id: LibItsDenm_Pixits.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Module containing Pixits for DENM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsDenm_Pixits { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibItsSecurity - import from LibItsSecurity_TypesAndValues all; - -} // End of module LibItsDenm_Pixits \ No newline at end of file diff --git a/ttcn/DENM/LibItsDenm_Templates.ttcn b/ttcn/DENM/LibItsDenm_Templates.ttcn deleted file mode 100644 index e20714b3..00000000 --- a/ttcn/DENM/LibItsDenm_Templates.ttcn +++ /dev/null @@ -1,824 +0,0 @@ -/** - * @author ETSI / STF449 / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/DENM/LibItsDenm_Templates.ttcn $ - * $Id: LibItsDenm_Templates.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Module containing base template definitions for DENM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsDenm_Templates { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from ITS_Container language "ASN.1:1997" all; - import from DENM_PDU_Descriptions language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - import from LibItsCommon_Functions all; - import from LibItsCommon_Pixits all; - import from LibItsCommon_ASN1_NamedNumbers all; - - // LibItsDenm - import from LibItsDenm_TestSystem all; - import from LibItsDenm_TypesAndValues all; - - group asn1Constants { - - const integer HeadingValue_wgs84North := 0; - const integer HeadingValue_wgs84East := 900; - const integer HeadingValue_wgs84South := 1800; - const integer HeadingValue_wgs84West := 2700; - const integer HeadingValue_unavailable := 3600; - - const integer HeadingConfidence_withinZeroPointOneDegree := 1; - const integer HeadingConfidence_withinOneDegree := 10; - const integer HeadingConfidence_outOfRange := 126; - const integer HeadingConfidence_unavailable := 127; - - } // End of group asn1Constants - - group primitivesTemplates { - - /** - * @desc Send template for DEN Message (DenmPort Primitive) - * @param p_denMsg The DEN Message to be sent - */ - template (value) DenmReq m_denmReq( - template (value) DENM p_denMsg - ) := { - msgOut := p_denMsg - } - - /** - * @desc Receive template for DEN Message (DenmPort Primitive) - * @param p_denMsg The expected DEN Message - */ - template (present) DenmInd mw_denmInd( - template (present) DENM p_denMsg - ) := { - msgIn := p_denMsg, - recvTime := ?, - gnNextHeader := *, - gnHeaderType := *, - gnHeaderSubtype := *, - gnLifetime := *, - gnTrafficClass := *, - btpDestinationPort := *, - btpInfo := *, - ssp := *, - its_aid := * - } - - /** - * @desc Receive template for DEN Message (DenmPort Primitive) - * @param p_denMsg The expected DEN Message - * @param p_gnNextHeader GN next header value - * @param p_gnHeaderType GN header type value - * @param p_gnHeaderSubtype GN header subtype value - * @param p_gnLifetime GN packet lifetime value (ms) - * @param p_gnTrafficClass GN traffic class value - */ - template(present) DenmInd mw_denmIndWithGnParameters ( - template (present) DENM p_denMsg, - in template UInt8 p_gnNextHeader := *, - in template UInt8 p_gnHeaderType := *, - in template UInt8 p_gnHeaderSubtype := *, - in template UInt32 p_gnLifetime := *, - in template UInt8 p_gnTrafficClass := * - ) modifies mw_denmInd := { - gnNextHeader := p_gnNextHeader, - gnHeaderType := p_gnHeaderType, - gnHeaderSubtype := p_gnHeaderSubtype, - gnLifetime := p_gnLifetime, - gnTrafficClass := p_gnTrafficClass - }; - - /** - * @desc Receive template for DEN Message (DenmPort Primitive) - * @param p_denMsg The expected DEN Message - * @param p_ssp SSP security parameter - * @param p_its_aid ITS-AID value - */ - template (present) DenmInd mw_denmIndWithSecurityParameters( - template (present) DENM p_denMsg, - template Bit256 p_ssp := *, - template UInt32 p_its_aid := c_its_aid_DENM - ) modifies mw_denmInd := { - ssp := p_ssp, - its_aid := p_its_aid - }; - - /** - * @desc Receive template for DEN Message (DenmPort Primitive) - * @param p_denMsg The expected DEN Message - * @param p_btpDestinationPort BTP destination port value - * @param p_btpInfo BTP destination port info value (if BTP-B) or BTP source port value (if BTP-A) - */ - template(present) DenmInd mw_denmIndWithBtpParameters ( - template (present) DENM p_denMsg, - in template UInt16 p_btpDestinationPort := *, - in template UInt16 p_btpInfo := * - ) modifies mw_denmInd := { - btpDestinationPort := p_btpDestinationPort, - btpInfo := p_btpInfo - }; - - group utPrimitives { - - /** - * @desc Send template for Upper Tester event initialization - */ - template (value) UtDenmInitialize m_denmInitialize := { - hashedId8 := '0000000000000000'O - } - - /** - * @desc Send template for Upper Tester event changePseudonym - */ - template (value) UtDenmChangePseudonym m_utDenmChangePseudonym := { - } - - /** - * @desc Send template for Upper Tester Trigger event - * @param p_situation The Situation Container - * @param p_location The Location Container - * @param p_validityDuration The validity duration (Default: omit) - * @param p_repetitionDuration The repetition duration (Default: omit) - * @param p_repetitionInterval The repetition interval (Default: omit) - * @param p_transmissionInterval The transmission interval (Default: omit) - * @param p_alacarte The Alacarte container (Default: omit) - */ - template (value) UtDenmTrigger m_utTriggerEvent( - template (value) SituationContainer p_situation, - template (omit) ValidityDuration p_validityDuration := c_duration_2sec, - template (omit) ValidityDuration p_repetitionDuration := omit, - template (omit) TransmissionInterval p_repetitionInterval := omit, - template (omit) TransmissionInterval p_transmissionInterval := omit, - template (omit) AlacarteContainer p_alacarte := omit - ) := { - detectionTime := f_getCurrentTime(), - validityDuration := p_validityDuration, - repetitionDuration := p_repetitionDuration, - situation := p_situation, - relevanceDistance := lessThan50m, - relevanceTrafficDirection := allTrafficDirections, - transmissionInterval := p_transmissionInterval, - repetitionInterval := p_repetitionInterval, - alacarte := p_alacarte - } - - /** - * @desc Send template for Upper Tester event update - * @param p_actionId The action id - * @param p_situation The Situation Container (Default: omit) - * @param p_location The Location Container (Default: omit) - * @param p_validityDuration The validity duration (Default: omit) - * @param p_relevanceDistance The relevance distance (Default: omit) - * @param p_relevanceTrafficDirection The relevance traffic direction (Default: omit) - * @param p_trafficClass The traffic class (Default: omit) - * @param p_repetitionInterval The repetition interval (Default: omit) - * @param p_transmissionInterval The transmission interval (Default: omit) - * @param p_alacarte The Alacarte Container (Default: omit) - */ - template (value) UtDenmUpdate m_utUpdateEvent( - template (value) ActionID p_actionId, - template (omit) SituationContainer p_situation := omit, - template (omit) LocationContainer p_location := omit, - template (omit) ValidityDuration p_validityDuration := omit, - template (omit) RelevanceDistance p_relevanceDistance := omit, - template (omit) RelevanceTrafficDirection p_relevanceTrafficDirection := omit, - template (omit) ValidityDuration p_repetitionDuration := omit, - template (omit) TransmissionInterval p_repetitionInterval := omit, - template (omit) TransmissionInterval p_transmissionInterval := omit, - template (omit) AlacarteContainer p_alacarte := omit - ) := { - actionId := p_actionId, - detectionTime := f_getCurrentTime(), - validityDuration := p_validityDuration, - situation := p_situation, - location := p_location, - relevanceDistance := p_relevanceDistance, - relevanceTrafficDirection := p_relevanceTrafficDirection, - transmissionInterval := p_transmissionInterval, - repetitionInterval := p_repetitionInterval, - alacarte := p_alacarte - } - - /** - * @desc Send template for Upper Tester event cancellation - * @param p_actionId The action id - */ - template (value) UtDenmTermination m_utEventCancellation( - template (value) ActionID p_actionId - ) := { - actionId := p_actionId - } - - /** - * @desc Send template for Upper Tester event change position - * @param p_latitude The new latitude - * @param p_longitude The new longitude - * @param p_elevation The new elevation (Default: 0) - */ - template (value) UtDenmChangePosition m_utDenmChangePosition( - template (value) integer p_latitude, - template (value) integer p_longitude, - template (value) integer p_elevation := 0 - ) := { - latitude := p_latitude, - longitude := p_longitude, - elevation := p_elevation - } - - } // end utPrimitives - - } // end primitives - - group denmPduTemplates { - - /** - * @desc Send template for DENM PDU - * @param p_denm The DEN Message - */ - template (value) DENM m_denmPdu( - template (value) DecentralizedEnvironmentalNotificationMessage p_denm - ) := { - header := m_itsPduHeader, - denm := p_denm - } - - /** - * @desc Default receive template for DENM PDU - * @param p_itsPduHeader The expected ITS PDU header (Default: any) - * @param p_denm The expected DEN Message (Default: any) - */ - template DENM mw_anyDenmPdu( - template (present) ItsPduHeader p_itsPduHeader := ?, - template (present) DecentralizedEnvironmentalNotificationMessage p_denm := ? - ) := { - header := p_itsPduHeader, - denm := p_denm - } - - /** - * @desc Receive template for DENM PDU - * @param p_denm The expected DEN Message - * @param p_stationID The expected station id (Default: any) - * @param p_protocolVersion The expected protocol version (Default: current DEN protocol version) - * @param p_messageID The expected message id (Default: DEN message id) - */ - template (present) DENM mw_denmPdu( - template (present) DecentralizedEnvironmentalNotificationMessage p_denm, - template (present) StationID p_stationID := ?, - template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, - template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_denm_ - ) := { - header := mw_itsPduHeader(p_stationID, p_protocolVersion, p_messageID), - denm := p_denm - } - - } // end denmPduTemplates - - group headerTemplates { - - /** - * @desc Default send template for ITS PDU header - * @param p_stationID The source station ID (Default: test system station id) - * @param p_protocolVersion The protocol version (Default: current DEN protocol version) - * @param p_messageID The message Id (Default: DEN message id) - */ - template (value) ItsPduHeader m_itsPduHeader( - template (value) StationID p_stationID := f_getTsStationId(), - template (value) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, - template (value) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_denm_ - ) := { - protocolVersion := p_protocolVersion, - messageID := p_messageID, - stationID := p_stationID - } - - /** - * @desc Default receive template for ITS PDU header - * @param p_stationID The expected station id (Default: any) - * @param p_protocolVersion The expected protocol version (Default: current DEN protocol version) - * @param p_messageID The expected message id (Default: DEN message id) - */ - template (present) ItsPduHeader mw_itsPduHeader( - template (present) StationID p_stationID := ?, - template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, - template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_denm_ - ) := { - protocolVersion := p_protocolVersion, - messageID := p_messageID, - stationID := p_stationID - } - - /** - * @desc Default receive template for the station id - */ - template (present) StationID mw_anyStationId := ?; - - } // end headerTemplates - - group timeTemplates { - - /** - * @desc Receive template for TimestampIts check with delta - * @param p_time The expected timestamp - */ - template TimestampIts mw_timestampIts_withDelta( - in template (value) TimestampIts p_time - ) := (valueof(p_time)-PX_TIME_DELTA .. valueof(p_time)+PX_TIME_DELTA); - - } // end timeTemplates - - group positionTemplates { - - /** - * @desc Send template for the test system position - * @param p_longitude The longitude (Default: Test system's longitude) - * @param p_latitude The latitude (Default: Test system's latitude) - * @see m_posConfidenceEllipse - * @see m_elevation - */ - template (value) ReferencePosition m_tsPosition( - template (value) Longitude p_longitude := f_getTsLongitude(), - template (value) Latitude p_latitude := f_getTsLatitude() - ) := { - latitude := p_latitude, - longitude := p_longitude, - positionConfidenceEllipse := m_posConfidenceEllipse, - altitude := m_altitude - } - - /** - * @desc Send template for the position confidence - * @param p_semiMajorConfidence The major confidence (Default: 1cm) - * @param p_semiMinorConfidence The minor confidence (Default: 1cm) - * @param p_semiMajorOrientation The major orientation (Default: HeadingValue_wgs84North) - */ - template (value) PosConfidenceEllipse m_posConfidenceEllipse( - template (value) SemiAxisLength p_semiMajorConfidence := LibItsCommon_ASN1_NamedNumbers.SemiAxisLength_oneCentimeter_, - template (value) SemiAxisLength p_semiMinorConfidence := LibItsCommon_ASN1_NamedNumbers.SemiAxisLength_oneCentimeter_, - template (value) HeadingValue p_semiMajorOrientation := LibItsCommon_ASN1_NamedNumbers.HeadingValue_wgs84North_ - ) := { - semiMajorConfidence := p_semiMajorConfidence, - semiMinorConfidence := p_semiMinorConfidence, - semiMajorOrientation := p_semiMajorOrientation - } - - /** - * @desc Send template for altitude - * @param p_altitudeValue The altitude (Default: Sea level) - * @param p_altitudeConfidence The confidence of the elevation (Default: within one meter) - */ - template (value) Altitude m_altitude( - template (value) AltitudeValue p_altitudeValue := LibItsCommon_ASN1_NamedNumbers.AltitudeValue_referenceEllipsoidSurface_, - template (value) AltitudeConfidence p_altitudeConfidence := alt_000_01 - ) := { - altitudeValue := p_altitudeValue, - altitudeConfidence := p_altitudeConfidence - } - - } // end positionTemplates - - group decentralizedEnvironmentalNotificationMessageTemplates { - - /** - * @desc Send template for DEN Message - * @param p_management The Management Container - * @param p_situation The Situation Container - * @param p_location The Location Container - * @param p_alacarte The Alacarte Container (Default: omit) - */ - template (value) DecentralizedEnvironmentalNotificationMessage m_denm( - template (value) ManagementContainer p_management, - template (omit) SituationContainer p_situation, - template (omit) LocationContainer p_location, - template (omit) AlacarteContainer p_alacarte := omit - ) := { - management := p_management, - situation := p_situation, - location := p_location, - alacarte := p_alacarte - } - - /** - * @desc Default receive template for DEN Message - */ - template (present) DecentralizedEnvironmentalNotificationMessage mw_anyDenm := { - management := ?, - situation := *, - location := *, - alacarte := * - } - - /** - * @desc Receive template for DEN Message - * @param p_management The expected Management Container (Default: any) - * @param p_situation The expected Situation Container (Default: any or omit) - * @param p_location The expected location Container (Default: any or omit) - * @param p_alacarte The expected Alacarte Container (Default: any or omit) - */ - template DecentralizedEnvironmentalNotificationMessage mw_denm( - template (present) ManagementContainer p_management := ?, - template SituationContainer p_situation := *, - template LocationContainer p_location := *, - template AlacarteContainer p_alacarte := * - ) modifies mw_anyDenm := { - management := p_management, - situation := p_situation, - location := p_location, - alacarte := p_alacarte - } - - /** - * @desc Send template for DEN Message for event termination. - * @param p_actionID The action id - */ - template (value) DecentralizedEnvironmentalNotificationMessage m_denmCancellation( - template (value) ActionID p_actionID, - template (value) StationType p_stationType - ) := { - management := m_denmMgmtConTermination(p_actionID, p_stationType, 1, -, -, -, isCancellation), - situation := omit, - location := omit, - alacarte := omit - } - - } // end group decentralizedEnvironmentalNotificationMessageTemplates - - group decentralizedManagementTemplates { - - /** - * @desc Send template for Management Container - * @param p_actionID The action id - * @param p_isNegation The negation flag (Default: false) - * @param p_validityDuration The validity duration (Default: omit) - * @param p_transmissionInterval The transmission interval (Default: omit) - * @param p_detectionTime The detection time (Default: current time) - * @param p_referenceTime The reference time (Default: current time) - */ - template (value) ManagementContainer m_denmMgmtCon( - template (value) ActionID p_actionID, - template (value) StationType p_stationType := f_getTsStationType(), - template (value) ValidityDuration p_validityDuration := defaultValidity, - template (omit) TransmissionInterval p_transmissionInterval := omit, - template (value) TimestampIts p_detectionTime := f_getCurrentTime(), - template (value) TimestampIts p_referenceTime := f_getCurrentTime() - ) := { - actionID := p_actionID, - detectionTime := p_detectionTime, - referenceTime := p_referenceTime, - termination := omit, - eventPosition := m_tsPosition, - relevanceDistance := lessThan50m, - relevanceTrafficDirection := allTrafficDirections, - validityDuration := p_validityDuration, - transmissionInterval := p_transmissionInterval, - stationType := p_stationType - } - - /** - * @desc Send template for Management Container - * @param p_actionID The action id - * @param p_isNegation The negation flag (Default: false) - * @param p_isCancellation The cancellation flag (Default: false) - * @param p_validityDuration The validity duration (Default: omit) - * @param p_transmissionInterval The transmission interval (Default: omit) - * @param p_detectionTime The detection time (Default: current time) - * @param p_referenceTime The reference time (Default: current time) - */ - template (omit) ManagementContainer m_denmMgmtConTermination ( - template (value) ActionID p_actionID, - template (value) StationType p_stationType := f_getTsStationType(), - template (value) ValidityDuration p_validityDuration := defaultValidity, - template (omit) TransmissionInterval p_transmissionInterval := omit, - template (value) TimestampIts p_detectionTime := f_getCurrentTime(), - template (value) TimestampIts p_referenceTime := f_getCurrentTime(), - template (value) Termination p_termination - ) modifies m_denmMgmtCon := { - termination := p_termination - } - - /** - * @desc Send template for Management Container - * @param p_actionID The action id - * @param p_isNegation The negation flag (Default: false) - * @param p_isCancellation The cancellation flag (Default: false) - * @param p_validityDuration The validity duration (Default: omit) - * @param p_transmissionInterval The transmission interval (Default: omit) - * @param p_detectionTime The detection time (Default: current time) - * @param p_referenceTime The reference time (Default: current time) - */ - template ManagementContainer mw_denmMgmtConTermination ( - template (present) ActionID p_actionID, - template (present) StationType p_stationType := f_getIutStationType(), - template (present) TimestampIts p_referenceTime := ?, - template ValidityDuration p_validityDuration := *, // In ASN.1, a DEFAULT value constraint could be replaced by an omit - template TransmissionInterval p_transmissionInterval := *, - template Termination p_termination := * - ) modifies mw_denmMgmtCon := { - termination := p_termination - } - - /** - * @desc Receive template for Management Container - * @param p_actionID The expected action id - * @param p_referenceTime The reference time (Default: any) - * @param p_isNegation The expected negation flag (Default: false) - * @param p_validityDuration The expected validity duration (Default: any or omit) - * @param p_transmissionInterval The expected transmission interval (Default: any or omit) - */ - template ManagementContainer mw_denmMgmtCon( - template (present) ActionID p_actionID, - template (present) StationType p_stationType := f_getIutStationType(), - template (present) TimestampIts p_referenceTime := ?, - template ValidityDuration p_validityDuration := *, // In ASN.1, a DEFAULT value constraint could be replaced by an omit - template TransmissionInterval p_transmissionInterval := *, - template Termination p_termination := * - ) := { - actionID := p_actionID, - detectionTime := ?, - referenceTime := p_referenceTime, - termination := p_termination, - eventPosition := ?, - relevanceDistance := *,//?, - relevanceTrafficDirection := *,//?, - validityDuration := p_validityDuration, - transmissionInterval := p_transmissionInterval, - stationType := p_stationType - } - - /** - * @desc Send template for Test system ActionID - * @param p_sequenceNumber The sequence number (Default: 0) - */ - template (value) ActionID m_tsActionId( - template (value) SequenceNumber p_sequenceNumber := 0 - ) := { - originatingStationID := f_getTsStationId(), - sequenceNumber := p_sequenceNumber - } - - /** - * @desc Default receive template for Management Container - */ - template (present) ManagementContainer mw_anyDenmMgmtCon := { - actionID := ?, - detectionTime := ?, - referenceTime := ?, - termination := *, - eventPosition := ?, - relevanceDistance := *, - relevanceTrafficDirection := *, - validityDuration := ?, - transmissionInterval := *, - stationType := ? - } - - /** - * @desc Receive template for Management Container with the given action id - * @param p_actionId The expected action id (Default: any) - */ - template (present) ManagementContainer mw_denmMgmtConWithActionID( - template (present) ActionID p_actionId := ? - ) modifies mw_anyDenmMgmtCon := { - actionID := p_actionId - } - - /** - * @desc Receive template for Management Container with the given data version - * @param p_referenceTime The expected reference time (Default: any) - */ - template (present) ManagementContainer mw_denmMgmtConWithReferenceTime( - template (present) TimestampIts p_referenceTime := ? - ) modifies mw_anyDenmMgmtCon := { - referenceTime := p_referenceTime - } - - /** - * @desc Send template for ActionID - * @param p_sequenceNumber The sequence number - * @param p_originatorStationID The originator station id (Default: IUT's station id) - */ - template (value) ActionID m_actionId( - template (value) SequenceNumber p_sequenceNumber, - template (value) ITS_Container.StationID p_originatorStationID := f_getIutStationId() - ) := { - originatingStationID := p_originatorStationID, - sequenceNumber := p_sequenceNumber - } - - /** - * @desc Receive template for ActionID - * @param p_originatorStationID The expected originator station id (Default: any) - * @param p_sequenceNumber The expected sequence number (Default: any) - */ - template (present) ActionID mw_actionId( - template (present) ITS_Container.StationID p_originatorStationID := ?, - template (present) SequenceNumber p_sequenceNumber := ? - ) := { - originatingStationID := p_originatorStationID, - sequenceNumber := p_sequenceNumber - } - - /** - * @desc Default receive template for any ActionID - */ - template (present) ActionID mw_anyActionId := ?; - - } // end group decentralizedManagementTemplates - - group decentralizedSituationTemplates { - - group situationTemplates { - - /** - * @desc Send template for Situation Container - * @param p_cause The cause code - * @param p_subCause The sub-cause code - * @param p_informationQuality The information quality (Default: 0) - */ - template (value) SituationContainer m_situation( - template (value) CauseCodeType p_cause, - template (value) SubCauseCodeType p_subCause, - template (value) InformationQuality p_informationQuality := 0 - ) := { - informationQuality := p_informationQuality, - eventType := { - causeCode := p_cause, - subCauseCode := p_subCause - }, - linkedCause := omit, - eventHistory := omit - } - - /** - * @desc Receive template for Situation Container - * @param p_cause The expected cause code - * @param p_subCause The expected sub-cause code - * @param p_informationQuality The expected information quality (Default: any) - */ - template (present) SituationContainer mw_situation( - template (present) CauseCodeType p_cause, - template (present) SubCauseCodeType p_subCause, - template (present) InformationQuality p_informationQuality := ? - ) := { - informationQuality := p_informationQuality, - eventType := { - causeCode := p_cause, - subCauseCode := p_subCause - }, - linkedCause := *, - eventHistory := * - } - - /** - * @desc Default receive template for Situation Container - */ - template (present) SituationContainer mw_anySitutation := ?; - - } // end group situationTemplates - - } // end group decentralizedSituationTemplates - - group decentralizedLocationTemplates { - - /** - * @desc Send template for Location Container where no delta is given - */ - template (value) LocationContainer m_denmLocation_zeroDelta := { - eventSpeed := omit, - eventPositionHeading := omit, - traces := { - { - { - pathPosition := { - deltaLatitude := 0, - deltaLongitude := 0, - deltaAltitude := 0 - }, - pathDeltaTime := 1 - } - } - }, - roadType := omit - } - - /** - * @desc Default receive template for Location Container - */ - template (present) LocationContainer mw_anyDenmLocation := { - eventSpeed := *, - eventPositionHeading := *, - traces := ?, - roadType := * - } - - /** - * @desc Receive template for Location Container with the given traces - * @param p_traces The expected traces. - */ - template (present) LocationContainer mw_denmLocationWithTrace( - template (present) Traces p_traces - ) := { - eventSpeed := *, - eventPositionHeading := *, - traces := p_traces, - roadType := * - } - - } // end group decentralizedLocationTemplates - - group alacarteTemplates { - - /** - * @desc Send template for Alacarte Container including lanePosition - */ - template (value) AlacarteContainer m_alacarteConLaneCount := { - lanePosition := 0, - impactReduction := omit, - externalTemperature := omit, - roadWorks := omit, - positioningSolution := omit, - stationaryVehicle := omit - } - - /** - * @desc Send template for Alacarte Container including impactReduction - */ - template (value) AlacarteContainer m_alacarteConImpactReduction := { - lanePosition := omit, - impactReduction := m_impactReduction, - externalTemperature := omit, - roadWorks := omit, - positioningSolution := omit, - stationaryVehicle := omit - } - - /** - * @desc Send template for ImpactReduction Container - */ - template (value) ImpactReductionContainer m_impactReduction := { - heightLonCarrLeft := 100, - heightLonCarrRight := 100, - posLonCarrLeft := 127, - posLonCarrRight := 127, - positionOfPillars := { 30 }, - posCentMass := 63, - wheelBaseVehicle := 127, - turningRadius := 255, - posFrontAx := 20, - positionOfOccupants := '00000000000000000000'B, - vehicleMass := 1024, - requestResponseIndication := request - } - - /** - * @desc Receive template for Alacarte Container including impactReduction - */ - template (present) AlacarteContainer mw_alacarteConImpactReduction := { - lanePosition := *, - impactReduction := mw_impactReduction, - externalTemperature := *, - roadWorks := *, - positioningSolution := *, - stationaryVehicle := * - } - - /** - * @desc Receive template for ImpactReductio nContainer - */ - template (present) ImpactReductionContainer mw_impactReduction := { - heightLonCarrLeft := ?, - heightLonCarrRight := ?, - posLonCarrLeft := ?, - posLonCarrRight := ?, - positionOfPillars := ?, - posCentMass := ?, - wheelBaseVehicle := ?, - turningRadius := ?, - posFrontAx := ?, - positionOfOccupants := ?, - vehicleMass := ?, - requestResponseIndication := response - } - - } // end alacarteTemplates - - group sspTemplates { - - template (present) bitstring mw_sspNoTrafficCondition := '*0'B; - template (present) bitstring mw_sspNoAccident := '*0?'B; - template (present) bitstring mw_sspNoRoadworks := '*0??'B; - } // end sspTemplates - -} // end LibItsDenmTemplates diff --git a/ttcn/DENM/LibItsDenm_TestSystem.ttcn b/ttcn/DENM/LibItsDenm_TestSystem.ttcn deleted file mode 100644 index 8a7cc869..00000000 --- a/ttcn/DENM/LibItsDenm_TestSystem.ttcn +++ /dev/null @@ -1,168 +0,0 @@ -/** - * @author ETSI / STF449 / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/DENM/LibItsDenm_TestSystem.ttcn $ - * $Id: LibItsDenm_TestSystem.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Test System module for ITS DENM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsDenm_TestSystem { - - // LibCommon -// import from LibCommon_Time {modulepar all}; -// import from LibCommon_Sync all; - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from DENM_PDU_Descriptions language "ASN.1:1997" all; - import from ITS_Container language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TestSystem all; - import from LibItsCommon_TypesAndValues all; - - // LibItsDenm - import from LibItsDenm_TypesAndValues all; - - group portDefinitions { - - /** - * @desc Adapter control port - */ - type port AdapterControlPort message { - out - AcGnssPrimitive, AcSecPrimitive; - in - AdapterControlResults - } // end AdapterControlPort - - /** - * @desc Upper Tester port - */ - type port UpperTesterPort message { - out - UtDenmInitialize, UtDenmTrigger, UtDenmUpdate, UtDenmTermination, UtDenmChangePosition, UtDenmChangePseudonym; - in - UtDenmResults, UtDenmEventInd; - } // end UpperTesterPort - - } // end portDefinitions - group interfacePorts { - - group facilityPorts { - - group fa1Ports { - - /** - * @desc FA1 DENM Port (DENM/BTP/GeoNet/G5) - */ - type port DenmPort message { - in DenmInd; - out DenmReq; - } // End of port DenmPort - - } // End of group fa1Ports - - } // End of group facilityPorts - - } // End of group interfacePorts - - group componentDefinitions { - - /** - * @desc ITS System Adapter - */ - type component ItsDenmSystem { - - port UpperTesterPort utPort; - port AdapterControlPort acPort; - - // FA1 ports - port DenmPort denmPort; - - } // end component ItsAdapter - - } // End of group componentDefinitions - - /** - * @desc Test component for ITS Facility layer - */ - type component ItsDenm extends ItsBaseComponent { - - port AdapterControlPort acPort; - port UpperTesterPort utPort; - - // FA1 ports - port DenmPort denmPort; - - //timers - - //component variables - - //default - var default vc_default := null; - - //global variables - var SequenceNumber vc_sequenceNo := 0; - var boolean vc_denmReceived := false; - - var UtDenmEventIndList vc_utEvents := {}; - - var UtDenmActionIDList vc_utActionIDs := {}; - - var boolean vc_utDefaultActive := true; - var boolean vc_denmDefaultActive := true; - - } // End of component ItsDenm - - group facilityPrimitives { - - group fa1Primitives { - - /** - * @desc FA1 DENM Indication Primitive - * - * @member denmMsg - */ - type record DenmInd { - DENM msgIn, - UInt64 recvTime, - UInt8 gnNextHeader optional, - UInt8 gnHeaderType optional, - UInt8 gnHeaderSubtype optional, - UInt32 gnLifetime optional, - UInt8 gnTrafficClass optional, - UInt16 btpDestinationPort optional, - UInt16 btpInfo optional, - Bit256 ssp optional, - UInt32 its_aid optional - } - with { - encode (msgIn) "PER" - } - - /** - * @desc FA1 DENM Request Primitive - * - * @member denmMsg - */ - type record DenmReq { - DENM msgOut - } - with { - encode (msgOut) "PER" - } - - } // End of group fa1Primitives - - } // End of group facilityPrimitives - with { - variant "" - encode "LibIts_Interface" - } // end interfacePrimitives - -} // End of module LibItsDenm_TestSystem diff --git a/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn b/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn deleted file mode 100644 index 5a5b1eb5..00000000 --- a/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn +++ /dev/null @@ -1,207 +0,0 @@ -/** - * @author ETSI / STF449 / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/DENM/LibItsDenm_TypesAndValues.ttcn $ - * $Id: LibItsDenm_TypesAndValues.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Module containing type and value definitions for DENM - * - */ -module LibItsDenm_TypesAndValues { - - //LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from DENM_PDU_Descriptions language "ASN.1:1997" all; - import from ITS_Container language "ASN.1:1997" all; - - group actionTypes { - - /** - * @desc Indication of whether event cancellation has to be raised by the test system or iut - */ - type enumerated Trigger { - e_ets(0), - e_iut(1) - } - - } // end group actionTypes - - group otherTypes { - - /** - * @desc List of SituationContainers used in behaviours - */ - type record of SituationContainer SituationContainerList; - - /** - * @desc List of ActionIDs used in behaviours - */ - type record of ActionID ActionIDList; - - } - - group denmConstants { - - const ValidityDuration c_duration_2sec := 2; - const ValidityDuration c_duration_5sec := 5; - const ValidityDuration c_duration_10sec := 10; - - const TransmissionInterval c_interval_1sec := 1000; - const TransmissionInterval c_interval_2sec := 2000; - const TransmissionInterval c_interval_4sec := 4000; - const TransmissionInterval c_interval_5sec := 5000; - const TransmissionInterval c_interval_10sec := 10000; - - } // end group denmConstants - - group certificates { - - const charstring PX_CERT_IUT_DENM_01 := "CERT_IUT_DENM_BO_01_AT"; - const charstring PX_CERT_IUT_DENM_02 := "CERT_IUT_DENM_BO_02_AT"; - - } - - group utPrimitives { - - /** - * @desc Upper Tester message to initialize IUT - * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use - */ - type record UtDenmInitialize { - Oct8 hashedId8 - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester results message of the DENM IUT - * @member utDenmInitialize - - * @member utDenmTriggerResult - - * @member utDenmUpdateResult, - - * @member utDenmChangePositionResult - - * @member utDenmChangePseudonymResult - - */ - type union UtDenmResults { - boolean utDenmInitializeResult, - UtDenmTriggerResult utDenmTriggerResult, - UtDenmUpdateResult utDenmUpdateResult, - boolean utDenmTerminationResult, - boolean utDenmChangePositionResult, - boolean utDenmChangePseudonymResult - } with { - variant "" - } // End of type UtDenmResults - - /** - * @desc Upper Tester message to request triggering of an event at IUT - */ - type record UtDenmTrigger { - TimestampIts detectionTime, - ValidityDuration validityDuration optional, - ValidityDuration repetitionDuration optional, - SituationContainer situation, - RelevanceDistance relevanceDistance, - RelevanceTrafficDirection relevanceTrafficDirection, - TransmissionInterval transmissionInterval optional, - TransmissionInterval repetitionInterval optional, - AlacarteContainer alacarte optional - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester result message of request of triggering of an event at IUT - */ - type record UtDenmTriggerResult { - boolean result, - ActionID actionId - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to update an event at IUT - */ - type record UtDenmUpdate { - ActionID actionId, - TimestampIts detectionTime, - ValidityDuration validityDuration optional, - SituationContainer situation optional, - LocationContainer location optional, - RelevanceDistance relevanceDistance optional, - RelevanceTrafficDirection relevanceTrafficDirection optional, - TransmissionInterval transmissionInterval optional, - TransmissionInterval repetitionInterval optional, - AlacarteContainer alacarte optional - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester result message of an update request of an event on DENM IUT - */ - type record UtDenmUpdateResult { - boolean result, - ActionID actionId - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to request the termination of an event at IUT - */ - type record UtDenmTermination { - ActionID actionId - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to change the position of IUT. Values a relatives - */ - type record UtDenmChangePosition { - Int32 latitude, - Int32 longitude, - Int32 elevation - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to change the pseudonym of the DENM IUT - */ - type record UtDenmChangePseudonym { - // empty on purpose - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to check event/status on DENM IUT - */ - type record UtDenmEventInd { - DENM denMsg - } with { - encode (denMsg) "LibItsDenm_asn1" - } - - /** - * @desc List of Upper Tester messages to check event/status on DENM IUT - */ - type record of UtDenmEventInd UtDenmEventIndList; - - /** - * @desc List of ActionID received in response to the Upper Tester triggered messages - */ - type record of ActionID UtDenmActionIDList; - - } - with { - encode "UpperTester" - variant "" - } -} -with { - encode "LibItsDenm" - } diff --git a/ttcn/DENM/module.mk b/ttcn/DENM/module.mk deleted file mode 100644 index 643df797..00000000 --- a/ttcn/DENM/module.mk +++ /dev/null @@ -1,7 +0,0 @@ -sources := LibItsDenm_EncdecDeclarations.ttcn \ - LibItsDenm_Functions.ttcn \ - LibItsDenm_Pics.ttcn \ - LibItsDenm_Pixits.ttcn \ - LibItsDenm_Templates.ttcn \ - LibItsDenm_TestSystem.ttcn \ - LibItsDenm_TypesAndValues.ttcn \ No newline at end of file diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_EncdecDeclarations.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_EncdecDeclarations.ttcn deleted file mode 100644 index 6ade6909..00000000 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_EncdecDeclarations.ttcn +++ /dev/null @@ -1,47 +0,0 @@ -module LibItsGeoNetworking_EncdecDeclarations { - - import from LibItsGeoNetworking_TypesAndValues all; - import from LibItsGeoNetworking_TestSystem all; - - external function fx_enc_GeoNetworkingReq (GeoNetworkingReq p) return bitstring - with {extension "prototype(convert) encode(LibIts_Interface)"} - - external function fx_dec_GeoNetworkingReq (inout bitstring b, out GeoNetworkingReq p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_enc_GeoNetworkingInd (GeoNetworkingInd p) return bitstring - with {extension "prototype(convert) encode(LibIts_Interface)"} - - external function fx_dec_GeoNetworkingInd (inout bitstring b, out GeoNetworkingInd p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_enc_GeoNetworkingPdu (GeoNetworkingPdu p) return bitstring - with {extension "prototype(convert) encode(LibItsGeoNetworking)"} - - external function fx_dec_GeoNetworkingPdu (inout bitstring b, out GeoNetworkingPdu p) return integer - with {extension "prototype(sliding) decode(LibItsGeoNetworking)"} - - external function fx_enc_GnNonSecuredPacket (GnNonSecuredPacket p) return bitstring - with {extension "prototype(convert) encode(LibItsGeoNetworking)"} - - external function fx_dec_GnNonSecuredPacket (inout bitstring b, out GnNonSecuredPacket p) return integer - with {extension "prototype(sliding) decode(LibItsGeoNetworking)"} - - /* - external function fx_enc_GeoSecuredMessage (GeoNetworkingPacket.securedMsg p) return bitstring - with {extension "prototype(convert) encode(LibItsSecurity)"} - - external function fx_dec_GeoSecuredMessage (inout bitstring b, out GeoNetworkingPacket.securedMsg p) return integer - with {extension "prototype(sliding) decode(LibItsSecurity)"} - */ - - external function fx_enc_UtGnInitialize (UtGnInitialize p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtGnChangePosition (UtGnChangePosition p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtGnTrigger (UtGnTrigger p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - -} // End of module LibItsGeoNetworking_EncdecDeclarations diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn deleted file mode 100644 index 79bb7cf5..00000000 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +++ /dev/null @@ -1,2836 +0,0 @@ -/** - * @author ETSI / STF405 / STF449 / STF484 / STF517 / STF 538 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn $ - * $Id: LibItsGeoNetworking_Functions.ttcn 1329 2017-02-21 14:48:18Z berge $ - * @desc Module containing functions for GeoNetworking - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsGeoNetworking_Functions { - - // Libcommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - import from LibCommon_VerdictControl all; - import from LibCommon_Sync all; - import from LibCommon_Time all; - - // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - import from LibItsExternal_TypesAndValues all; - import from LibItsCommon_Templates all; - import from LibItsCommon_Functions all; - import from LibItsCommon_Pixits all; - // import from LibItsCommon_TestSystem 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_TypesAndValues all; - import from LibItsGeoNetworking_Templates all; - import from LibItsGeoNetworking_Pixits all; - import from LibItsGeoNetworking_Pics all; - - group utFuntions { - - /** - * @desc Requests to bring the IUT in an initial state - * @param p_init The initialisation to trigger. - */ - function f_utInitializeIut(template (value) UtGnInitialize p_init) runs on ItsBaseGeoNetworking { - - //deactivate gnPort default alts - vc_gnDefaultActive := false; - - utPort.send(p_init); - tc_wait.start; - alt { - [] utPort.receive(UtGnResults: { utGnInitializeResult := true }) { - tc_wait.stop; - log("*** f_utInitializeIut: INFO: IUT initialized ***"); - } - [] utPort.receive { - tc_wait.stop; - log("*** f_utInitializeIut: INFO: IUT could not be initialized ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_wait.timeout { - log("*** f_utInitializeIut: INFO: IUT could not be initialized in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //activate gnPort default alts - vc_gnDefaultActive := true; - - } - - /** - * @desc Requests to change the position of the IUT - */ - function f_utChangePosition() runs on ItsBaseGeoNetworking { - - //deactivate gnPort default alts - vc_gnDefaultActive := false; - - utPort.send(m_changePosition); - tc_wait.start; - alt { - [] utPort.receive(UtGnResults: { utGnChangePositionResult := true} ) { - tc_wait.stop; - log("*** f_utChangePosition: INFO: IUT position changed ***"); - } - [] utPort.receive(UtGnResults: { utGnChangePositionResult := false }) { - tc_wait.stop; - log("*** f_utChangePosition: INFO: IUT position change was not successful ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] a_utDefault() { - } - [] tc_wait.timeout { - log("*** f_utChangePosition: INFO: IUT position not changed in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //activate gnPort default alts - vc_gnDefaultActive := true; - - } - - /** - * @desc Triggers event from the application layer - * @param p_event The event to trigger. - */ - function f_utTriggerEvent(template (value) UtGnTrigger p_event) runs on ItsBaseGeoNetworking return boolean { - - // Variables - var boolean v_return := true; - - //deactivate gnPort default alts - vc_gnDefaultActive := false; - - utPort.send(p_event); - tc_wait.start; - alt { - [] utPort.receive(UtGnResults: { utGnTriggerResult := true }) { - tc_wait.stop; - } - [] utPort.receive(UtGnResults: { utGnTriggerResult := false }) { - tc_wait.stop; - log("*** UtGnTriggerResult: INFO: UT trigger was not successful ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] a_utDefault() { - } - [] tc_wait.timeout { - v_return := false; - } - } - - //activate gnPort default alts - vc_gnDefaultActive := true; - - return v_return; - } - - } // End of group utFunctions - - group geoConfigurationFunctions { - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - two ITS nodes (nodeA, nodeB) - * - Area1 which only includes NodeB and IUT - * - Area2 which only includes NodeB - * NodeB being close to the area center - */ - function f_cf01Up(Scenario p_scenario := e_staticPosition) runs on ItsGeoNetworking system ItsGeoNetworkingSystem { - - // Variables - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - - // Map - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - map(self:geoNetworkingPort, system:geoNetworkingPort); - - // Connect - f_connect4SelfOrClientSync(); - activate(a_cf01Down()); - - // Initialise secured mode - f_initialiseSecuredMode(); - - //Initialze the IUT - f_initialState(p_scenario); - - // Positions & Areas - f_preparePositionsAndAreas(v_positionTable, v_areaTable); - - f_initialiseComponent(v_positionTable, v_areaTable, c_compNodeB); - - } // End of function f_cf01Up - - function f_cf01Down() runs on ItsGeoNetworking system ItsGeoNetworkingSystem { - - f_uninitialiseSecuredMode(); - - // Unmap - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - unmap(self:geoNetworkingPort, system:geoNetworkingPort); - - // Disconnect - f_disconnect4SelfOrClientSync(); - - } // End of function f_cf01Down - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - one ITS node (NodeB) - * - one ITS node (NodeD) - * - Area1 which only includes NodeB, NodeD and IUT - * - Area2 which only includes NodeB and NodeD - * NodeB being close to the area center - * - * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages - */ - function f_cf02Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Variables - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - var ItsGeoNetworking v_component; - var integer i; - - // Select components - vc_componentTable := {{c_compNodeB, omit}, {c_compNodeD, omit}}; - - // Create components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; - } - - // Map & Connect - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - connect(self:syncPort, mtc:syncPort); - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - map(vc_componentTable[i].gnComponent:acPort, system:acPort); - map(vc_componentTable[i].gnComponent:utPort, system:utPort); - map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - - activate(a_cf02Down()); - - //Initialze the IUT - if(p_mainUtComponent == c_compMTC) { - // Initialise secured mode - f_initialiseSecuredMode(); - - // MTC intializes IUT - f_initialState(p_scenario); - } - else { - v_component := f_getComponent(p_mainUtComponent); - v_component.start(f_initialState(p_scenario)); - v_component.done; - } - - // Positions & Areas - f_preparePositionsAndAreas(v_positionTable, v_areaTable); - - // Initialize components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); - } - } - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.done; - } - } - - } // End of function f_cf02Up - - /** - * @desc Deletes configuration cf02 - */ - function f_cf02Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Local variables - var integer i; - - f_uninitialiseSecuredMode(); - - // Unmap & Disconnect - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); - unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); - unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - disconnect(self:syncPort, mtc:syncPort); - - } // End of function f_cf02Down - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - one ITS node (NodeA) - * - one ITS node in direction of NodeA (NodeB) - * - one ITS node not in direction of NodeA (NodeC) - * - Area1 which only includes NodeB and IUT - * - Area2 which only includes NodeB - * NodeB being close to the area center - * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages - */ - function f_cf03Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Variables - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - var ItsGeoNetworking v_component; - var integer i; - - // Select components - vc_componentTable := {{c_compNodeB, omit}, {c_compNodeC, omit}}; - - // Create components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; - } - - // Map & Connect - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - connect(self:syncPort, mtc:syncPort); - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - map(vc_componentTable[i].gnComponent:acPort, system:acPort); - map(vc_componentTable[i].gnComponent:utPort, system:utPort); - map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - - activate(a_cf03Down()); - - //Initialze the IUT - if(p_mainUtComponent == c_compMTC) { - // Initialise secured mode - f_initialiseSecuredMode(); - - // MTC intializes IUT - f_initialState(p_scenario); - } - else { - v_component := f_getComponent(p_mainUtComponent); - v_component.start(f_initialState(p_scenario)); - v_component.done; - } - - // Positions & Areas - f_preparePositionsAndAreas(v_positionTable, v_areaTable); - - // Initialize components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); - } - } - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.done; - } - } - - } // End of function f_cf03Up - - /** - * @desc Deletes configuration cf03 - */ - function f_cf03Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Local variables - var integer i; - - f_uninitialiseSecuredMode(); - - // Unmap & Disconnect - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); - unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); - unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - disconnect(self:syncPort, mtc:syncPort); - - } // End of function f_cf03Down - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - one ITS node (NodeA) - * - one ITS node in direction of NodeA and having - * shortest distance to NodeA (NodeB) - * - one ITS node in direction of NodeA (NodeD) - * - one ITS node not in direction of NodeA (NodeC) - * - Area1 which only includes NodeB, NodeD and IUT - * - Area2 which only includes NodeA, NodeB and NodeD - * NodeB being close to the area center - * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages - */ - function f_cf04Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Variables - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - var ItsGeoNetworking v_component; - var integer i; - - // Select components - vc_componentTable := {{c_compNodeB, omit}, {c_compNodeC, omit}, {c_compNodeD, omit}}; - - // Create components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; - } - - // Map & Connect - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - connect(self:syncPort, mtc:syncPort); - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - map(vc_componentTable[i].gnComponent:acPort, system:acPort); - map(vc_componentTable[i].gnComponent:utPort, system:utPort); - map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - - activate(a_cf04Down()); - - //Initialze the IUT - if(p_mainUtComponent == c_compMTC) { - // Initialise secured mode - f_initialiseSecuredMode(); - - // MTC intializes IUT - f_initialState(p_scenario); - } - else { - v_component := f_getComponent(p_mainUtComponent); - v_component.start(f_initialState(p_scenario)); - v_component.done; - } - - // Positions & Areas - f_preparePositionsAndAreas(v_positionTable, v_areaTable); - - // Initialize components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); - } - } - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.done; - } - } - - } // End of function f_cf04Up - - /** - * @desc Deletes configuration cf04 - */ - function f_cf04Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Local variables - var integer i; - - f_uninitialiseSecuredMode(); - - // Unmap & Disconnect - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); - unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); - unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - disconnect(self:syncPort, mtc:syncPort); - - } // End of function f_cf04Down - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - one ITS node (NodeB) - * - one ITS node not in direction of NodeB and having - * longest distance to NodeB (NodeE) - * - Area1 which only includes NodeB, NodeD and IUT - * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages - */ - function f_cf05Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Variables - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - var ItsGeoNetworking v_component; - var integer i; - - // Select components - vc_componentTable := {{c_compNodeB, omit}, {c_compNodeE, omit}}; - - // Create components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; - } - - // Map & Connect - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - connect(self:syncPort, mtc:syncPort); - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - map(vc_componentTable[i].gnComponent:acPort, system:acPort); - map(vc_componentTable[i].gnComponent:utPort, system:utPort); - map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - - activate(a_cf05Down()); - - //Initialze the IUT - if(p_mainUtComponent == c_compMTC) { - // Initialise secured mode - f_initialiseSecuredMode(); - - // MTC intializes IUT - f_initialState(p_scenario); - } - else { - v_component := f_getComponent(p_mainUtComponent); - v_component.start(f_initialState(p_scenario)); - v_component.done; - } - - // Positions & Areas - f_preparePositionsAndAreas(v_positionTable, v_areaTable); - - // Initialize components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); - } - } - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.done; - } - } - } - - /** - * @desc Deletes configuration cf05 - */ - function f_cf05Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Local variables - var integer i; - - f_uninitialiseSecuredMode(); - - // Unmap & Disconnect - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); - unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); - unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - disconnect(self:syncPort, mtc:syncPort); - - } // End of function f_cf05Down - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - one ITS node (NodeB) - * - one ITS node not in direction of NodeB and having - * shortest distance to NodeB (NodeF) - * - Area1 which only includes NodeB, NodeD and IUT - * - IUT not in sectorial area of NodeB-NodeF - * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages - */ - function f_cf06Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Variables - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - var ItsGeoNetworking v_component; - var integer i; - - // Select components - vc_componentTable := {{c_compNodeB, omit}, {c_compNodeF, omit}}; - - // Create components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; - } - - // Map & Connect - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - connect(self:syncPort, mtc:syncPort); - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - map(vc_componentTable[i].gnComponent:acPort, system:acPort); - map(vc_componentTable[i].gnComponent:utPort, system:utPort); - map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - - activate(a_cf06Down()); - - //Initialze the IUT - if(p_mainUtComponent == c_compMTC) { - // Initialise secured mode - f_initialiseSecuredMode(); - - // MTC intializes IUT - f_initialState(p_scenario); - } - else { - v_component := f_getComponent(p_mainUtComponent); - v_component.start(f_initialState(p_scenario)); - v_component.done; - } - - // Positions & Areas - f_preparePositionsAndAreas(v_positionTable, v_areaTable); - - // Initialize components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); - } - } - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.done; - } - } - } - - /** - * @desc Deletes configuration cf06 - */ - function f_cf06Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Local variables - var integer i; - - f_uninitialiseSecuredMode(); - - // Unmap & Disconnect - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); - unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); - unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - disconnect(self:syncPort, mtc:syncPort); - - } // End of function f_cf06Down - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - one ITS node (NodeB) - * - one ITS node in direction of NodeB and having - * shortest distance to NodeB (NodeD) - * - Area1 which only includes NodeB, NodeD and IUT - * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages - */ - function f_cf07Up(in charstring p_mainUtComponent := c_compMTC, Scenario p_scenario := e_staticPosition) runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Variables - var PositionTable v_positionTable := {}; - var GeoAreaTable v_areaTable := {}; - var ItsGeoNetworking v_component; - var integer i; - - // Select components - vc_componentTable := {{c_compNodeB, omit}, {c_compNodeD, omit}}; - - // Create components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive; - } - - // Map & Connect - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - connect(self:syncPort, mtc:syncPort); - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - map(vc_componentTable[i].gnComponent:acPort, system:acPort); - map(vc_componentTable[i].gnComponent:utPort, system:utPort); - map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - - activate(a_cf07Down()); - - //Initialze the IUT - if(p_mainUtComponent == c_compMTC) { - // Initialise secured mode - f_initialiseSecuredMode(); - - // MTC intializes IUT - f_initialState(p_scenario); - } - else { - v_component := f_getComponent(p_mainUtComponent); - v_component.start(f_initialState(p_scenario)); - v_component.done; - } - - // Positions & Areas - f_preparePositionsAndAreas(v_positionTable, v_areaTable); - - // Initialize components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName)); - } - } - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - if (isvalue(vc_componentTable[i].gnComponent)) { - vc_componentTable[i].gnComponent.done; - } - } - } - - /** - * @desc Deletes configuration cf06 - */ - function f_cf07Down() runs on ItsMtc mtc ItsMtc system ItsGeoNetworkingSystem { - - // Local variables - var integer i; - - f_uninitialiseSecuredMode(); - - // Unmap & Disconnect - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - unmap(vc_componentTable[i].gnComponent:utPort, system:utPort); - unmap(vc_componentTable[i].gnComponent:acPort, system:acPort); - unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort); - disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort); - } - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - disconnect(self:syncPort, mtc:syncPort); - - } // End of function f_cf07Down - - /** - * @desc Behavior function for initializing component's variables and tables - * @param p_positionTable Table containing position vectors of all nodes - * @param p_areaTable Table containing all defined geoAreas - * @param p_componentName Name of the component - */ - function f_initialiseComponent( - in PositionTable p_positionTable, - in GeoAreaTable p_areaTable, - in charstring p_componentName) - runs on ItsGeoNetworking { - - vc_positionTable := p_positionTable; - vc_areaTable := p_areaTable; - vc_componentName := p_componentName; - - vc_localSeqNumber := f_getInitialSequenceNumber(); - vc_multipleMessagesCount := f_getMessageCount(); - - } // End of function f_initialiseComponent - - /** - * @desc Makes the simulated ITS node behave as a neighbour of IUT - */ - function f_startBeingNeighbour() runs on ItsGeoNetworking { - - vc_neighbourDefault := activate(a_neighbourDefault()); - f_acTriggerEvent(m_startBeaconing(m_beaconHeader(f_getPosition(vc_componentName)).beaconHeader)); - f_sleepIgnoreDef(PX_NEIGHBOUR_DISCOVERY_DELAY); - } // End of function f_startBeingNeighbour - - /** - * @desc Makes the simulated ITS node behave as not being a neighbour of IUT - */ - function f_stopBeingNeighbour() runs on ItsGeoNetworking { - - f_acTriggerEvent(m_stopBeaconing); - if (PICS_GN_SECURITY == true) { - deactivate(vc_neighbourDefault); - } - } // End of function f_stopBeingNeighbour - - /** - * @desc Initialise secure mode if required - */ - function f_initialiseSecuredMode() runs on ItsBaseGeoNetworking { - - // Local variables - - // Load certificates - if (PICS_GN_SECURITY == true) { - if( not f_loadCertificates(PX_IUT_SEC_CONFIG_NAME) ) { - log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); - stop; - } - - // Initialize vc_location - f_setGenerationLocation( - f_getTsLatitude(), - f_getTsLongitude() - ); - } else if (PICS_IS_IUT_SECURED == true) { - if(e_success != f_acEnableSecurity()){ - log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); - stop; - } - } - } // End of function f_initialiseSecuredMode() - - function f_uninitialiseSecuredMode() runs on ItsBaseGeoNetworking { - if ((PICS_GN_SECURITY == true) or (PICS_IS_IUT_SECURED == true)) { - f_acDisableSecurity(); - } - } // End of function f_uninitialiseSecuredMode() - - } // End of group geoConfigurationFunctions - - group componentFunctions { - /** - * @desc Get the component corresponding to a key - * @param p_componentName Name searched component - * @return ItsGeoNetworking - The searched position vector - */ - function f_getComponent( - in charstring p_componentName - ) runs on ItsMtc - return ItsGeoNetworking { - - var ItsGeoNetworking v_return := null; - var integer i := 0; - - for (i:=0; i value v_ind { - //store every upper tester indication received - //log("################# v_ind: ", v_ind); - vc_utInds[lengthof(vc_utInds)] := v_ind; - //log("################# vc_utInds: ", vc_utInds); - //log("################# lengthof(vc_utInds): ", lengthof(vc_utInds)); - repeat; - } - [vc_utDefaultActive] utPort.receive { - log("*** " & testcasename() & ": INFO: Received unexpected UT message from IUT ***"); - repeat; - } - } - - /** - * @desc Default handling cf01 de-initialisation. - */ - altstep a_cf01Down() runs on ItsGeoNetworking { - [] a_shutdown() { - f_poDefault(); - f_cf01Down(); - log("*** a_cf01Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc Default handling cf02 de-initialisation. - */ - altstep a_cf02Down() runs on ItsMtc { - [] a_shutdown() { - f_cf02Down(); - log("*** a_cf02Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc Default handling cf03 de-initialisation. - */ - altstep a_cf03Down() runs on ItsMtc { - [] a_shutdown() { - f_cf03Down(); - log("*** a_cf03Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc Default handling cf04 de-initialisation. - */ - altstep a_cf04Down() runs on ItsMtc { - [] a_shutdown() { - f_cf04Down(); - log("*** a_cf04Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc Default handling cf05 de-initialisation. - */ - altstep a_cf05Down() runs on ItsMtc { - [] a_shutdown() { - f_cf05Down(); - log("*** a_cf05Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc Default handling cf06 de-initialisation. - */ - altstep a_cf06Down() runs on ItsMtc { - [] a_shutdown() { - f_cf06Down(); - log("*** a_cf06Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc Default handling cf07 de-initialisation. - */ - altstep a_cf07Down() runs on ItsMtc { - [] a_shutdown() { - f_cf07Down(); - log("*** a_cf07Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - group geoGeoUnicastAltsteps { - - /** - * @desc Receive GeoUnicast packet - * @param p_sourceLongPosVec Expected source position vector - * @param p_destinationShortPosVec Expected destination position vector - * @param p_seqNumber Expected sequence number - */ - altstep a_receiveGeoUnicast( - in template (present) ShortPosVector p_destinationShortPosVec, - in template (present) UInt16 p_seqNumber - ) runs on ItsGeoNetworking { - - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwUnicastPacket( - p_destinationShortPosVec, - p_seqNumber)))) { - } - } - - /** - * @desc Receive GeoUnicast packet for specific destination - * @param p_destinationShortPosVec Expected destination position vector - */ - altstep a_receiveGeoUnicastWithDestination(in template (present) ShortPosVector p_destinationShortPosVec) runs on ItsGeoNetworking { - - [vc_gnDefaultActive] a_receiveGeoUnicast(p_destinationShortPosVec, ?) {} - } - - /** - * @desc Receive any GeoUnicast packet - */ - altstep a_receiveAnyGeoUnicast() runs on ItsGeoNetworking { - - [vc_gnDefaultActive] a_receiveGeoUnicast(?, ?) {} - } - - } // End of group geoGeoUnicastAltsteps - - group geoGeoBroadcastAltsteps { - - /** - * @desc Receive GeoBroadcast packet - * @param p_srcLongPosVec Expected source position vector - * @param p_seqNumber Expected sequence number - */ - altstep a_receiveGeoBroadcast( - in template (present) LongPosVector p_srcLongPosVec, - in template (present) UInt16 p_seqNumber - ) runs on ItsGeoNetworking { - - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacket( - p_srcLongPosVec, - p_seqNumber - )))) { - } - } - - /** - * @desc Receive GeoBroadcast packet with specific Area and HopLimit - * @param p_srcLongPosVec Expected source position vector - * @param p_seqNumber Expected sequence number - * @param p_broadcastArea Expected geoBroadcastArea - * @param p_routerHopLimit Expected router hop limit - * @param p_maxHopLimit Expected max hop limit (Default: ?) - */ - altstep a_receiveGeoBroadcastWithAreaWithHopLimit( - in template (present) LongPosVector p_srcLongPosVec, - in template (present) UInt16 p_seqNumber, - in template (present) GeoBroadcastArea p_broadcastArea, - in template (present) UInt8 p_routerHopLimit, - in template (present) UInt8 p_maxHopLimit := ? - ) runs on ItsGeoNetworking { - - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithAreaAndHl( - p_srcLongPosVec, - p_seqNumber, - p_broadcastArea, - p_maxHopLimit - ), - -, - p_routerHopLimit - ))) { - } - } - - /** - * @desc Receive GeoBroadcast packet for specific Geobroadcast Area - * @param p_srcLongPosVec Expected source position vector - * @param p_seqNumber Expected sequence number - * @param p_broadcastArea Expected geoBroadcastArea - */ - altstep a_receiveGeoBroadcastWithArea( - in template (present) LongPosVector p_srcLongPosVec, - in template (present) UInt16 p_seqNumber, - in template (present) GeoBroadcastArea p_broadcastArea - ) runs on ItsGeoNetworking { - - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea( - p_srcLongPosVec, - p_seqNumber, - p_broadcastArea - )))) { - } - } - - } // End of group geoGeoBroadcastAltsteps - - group geoGeoAnycastAltsteps { - - /** - * @desc Receive GeoAnycast packet - * @param p_srcLongPosVec Expected source position vector - * @param p_senderLongPosVec Expected sender position vector - * @param p_seqNumber Expected sequence number - */ - altstep a_receiveGeoAnycast( - in template (present) LongPosVector p_srcLongPosVec, - in template (present) LongPosVector p_senderLongPosVec, - in template (present) UInt16 p_seqNumber - ) runs on ItsGeoNetworking { - - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacket( - p_srcLongPosVec, - p_seqNumber - )))) { - } - } - - /** - * @desc Receive GeoAnycast packet with specific Area and HopLimit - * @param p_srcLongPosVec Expected source position vector - * @param p_senderLongPosVec Expected sender position vector - * @param p_seqNumber Expected sequence number - * @param p_anycastArea Expected geoAnycastArea - * @param p_hopLimit Expected hop limit - * @param p_maxHopLimit Expected max hop limit (Default: ?) - */ - altstep a_receiveGeoAnycastWithAreaWithHopLimit( - in template (present) LongPosVector p_srcLongPosVec, - in template (present) UInt16 p_seqNumber, - in template (present) GeoAnycastArea p_anycastArea, - in template (present) UInt8 p_hopLimit, - in template (present) UInt8 p_maxHopLimit := ? - ) runs on ItsGeoNetworking { - - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( - p_srcLongPosVec, - p_seqNumber, - p_anycastArea - ), - -, - p_hopLimit - ))) { - } - } - - /** - * @desc Receive GeoAnycast packet for specific GeoAnycast Area - * @param p_srcLongPosVec Expected source position vector - * @param p_seqNumber Expected sequence number - * @param p_anycastArea Expected geoAnycastArea - */ - altstep a_receiveGeoAnycastWithArea( - in template (present) LongPosVector p_srcLongPosVec, - in template (present) UInt16 p_seqNumber, - in template (present) GeoAnycastArea p_anycastArea - ) runs on ItsGeoNetworking { - - [vc_gnDefaultActive] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwAnycastPacketWithArea( - p_srcLongPosVec, - p_seqNumber, - p_anycastArea - )))) { - } - } - - } // End of group geoGeoAnycastAltsteps - - group geoLocationServiceAltsteps { - - /** - * @desc Receive Location Service Request - * @param p_seqNumber Expected sequence number of the received LS Request - * @param p_mid GN address expected in received LS Request - * @param p_reqSrcPosVector Expected source position vector of the received LS Request - */ - altstep a_receiveLsRequest( - in template (present) UInt16 p_seqNumber, - in template (present) GN_Address.mid p_mid, - out LongPosVector p_reqSrcPosVector - ) runs on ItsGeoNetworking { - var GeoNetworkingInd v_msg; - - [vc_gnDefaultActive] geoNetworkingPort.receive( - mw_geoNwInd( - mw_geoNwPdu( - mw_geoNwLsRequestPacket( - p_seqNumber, - p_mid - ) - ) - ) - ) -> value v_msg { - p_reqSrcPosVector := valueof(v_msg.msgIn.gnPacket.packet.extendedHeader.lsRequestHeader.srcPosVector); - } - } - - /** - * @desc Receive any Location Service Request - */ - altstep a_receiveAnyLsRequest() runs on ItsGeoNetworking { - var LongPosVector v_reqSrcPosVector; - - [vc_gnDefaultActive] a_receiveLsRequest(?, ?, v_reqSrcPosVector) {} - } - - /** - * @desc Receive any Location Service Reply - */ - altstep a_receiveAnyLsReply() runs on ItsGeoNetworking { - [vc_gnDefaultActive] geoNetworkingPort.receive( mw_geoNwInd( mw_geoNwPdu( mw_geoNwLsReplyPacket(?, ?) ))) { - //ignore and repeat - repeat; - } - } - - /** - * @desc Receive Location Service Request and send Location Service Reply - * @param p_reqSeqNumber Expected sequence number of the received LS Request - * @param p_gnAddress GN address expected in received LS Request - * @param p_repSrcPosVector Source position vector of the sent LS Response - */ - altstep a_receiveLsRequestAndReply( - in template (present) UInt16 p_reqSeqNumber, - in template (value) GN_Address.mid p_mid, - in template (value) LongPosVector p_repSrcPosVector - ) runs on ItsGeoNetworking { - var LongPosVector v_repDstPosVector; - - [vc_gnDefaultActive] a_receiveLsRequest(p_reqSeqNumber, p_mid, v_repDstPosVector) { - f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(m_geoNwPdu( - m_geoNwLsReplyPacket( - p_repSrcPosVector, - f_longPosVector2ShortPosVector(v_repDstPosVector), - vc_localSeqNumber - ))))); - } - } - - } // End of group geoLocationServiceAltsteps - - - } // End of group geoAltsteps - - group preambles { - - /** - * @desc The default preamble. - */ - function f_prDefault() runs on ItsGeoNetworking { - activate(a_default()); - activate(a_utDefault()); - } - - /** - * @desc Preamble for non-neighbour nodes - */ - function f_prNonNeighbour() runs on ItsGeoNetworking { - f_prDefault(); - } - - /** - * @desc Preamble for neighbour nodes - */ - function f_prNeighbour() runs on ItsGeoNetworking { - f_prDefault(); - f_startBeingNeighbour(); - f_sleep(0.5); - } - - /** - * @desc Brings the IUT into an initial state. - * @remark Component variable vc_hashedId8ToBeUsed shall be set with the IUT certificate to be used - */ - function f_initialState(Scenario p_scenario := e_staticPosition) runs on ItsBaseGeoNetworking { - - if (PICS_GN_SECURITY) { - var Oct8 v_hashedId8ToBeUsed := f_setupIutCertificate(vc_hashedId8ToBeUsed); - if (oct2int(v_hashedId8ToBeUsed) == 0) { - v_hashedId8ToBeUsed := 'FFFFFFFFFFFFFFFF'O; // Reset to unknown value, the IUT will use its own certificates - } - f_utInitializeIut(m_secGnInitialize(v_hashedId8ToBeUsed)); - } // else, default behavior - else { - f_utInitializeIut(m_gnInitialize); - } - f_sleep(PX_NEIGHBOUR_DISCOVERY_DELAY); - - f_acLoadScenario(p_scenario); - f_acStartScenario(); - f_acAwaitTimeInRunningScenario(f_getTimeForGpsFix()); - } - - /** - * @desc Receive and reply to LS Requests - * @param p_reqSeqNumber Expected sequence number of the received LS Request - * @param p_gnAddress GN address expected in received LS Request - * @param p_repSrcPosVector Source position vector of the sent LS Response - * @param p_repSenderPosVector Sender position vector of the sent LS Response - */ - function f_handleLocationService( - in template (present) UInt16 p_reqSeqNumber, - in template (value) GN_Address.mid p_mid, - in template (value) LongPosVector p_repSrcPosVector, - in template (value) LongPosVector p_repSenderPosVector - ) runs on ItsGeoNetworking { - - tc_ac.start; - alt { - [] a_receiveLsRequestAndReply(p_reqSeqNumber, p_mid, p_repSrcPosVector) {//Spirent removed, p_repSenderPosVector) { - tc_ac.stop; - } - } - - } - - /** - * @desc Send LS request and receive LS Reply - * @param p_reqSrcPosVector Source position vector of the sent LS Request - * @param p_reqSeqNumber Sequence number of the sent LS Request - * @param p_gnAddress GN address for which the LS Request is sent - * @param p_repSrcPosVector Expected source position vector in received LS Response - * @return FncRetCode - */ - function f_processLocationService( - in template (value) LongPosVector p_reqSrcPosVector, - in template (value) UInt16 p_reqSeqNumber, - in template (value) GN_Address p_gnAddress, - out LongPosVector p_repSrcPosVector - ) runs on ItsGeoNetworking return FncRetCode { - var FncRetCode v_ret := e_error; - var GeoNetworkingInd v_msg; - - f_sendGeoNetMessage( - valueof( - m_geoNwReq_linkLayerBroadcast( - m_geoNwPdu( - m_geoNwLsRequestPacket( - p_reqSrcPosVector, - p_reqSeqNumber, - p_gnAddress - ) - ) - ) - ) - ); - - tc_ac.start; - alt { - [] geoNetworkingPort.receive( - mw_geoNwInd( - mw_geoNwPdu( - mw_geoNwLsReplyPacket( - ?, - mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(valueof(p_reqSrcPosVector))) - ) - ) - ) - ) -> value v_msg { - tc_ac.stop; - p_repSrcPosVector := valueof(v_msg.msgIn.gnPacket.packet.extendedHeader.lsReplyHeader.srcPosVector); - v_ret := e_success; - } - } - - return v_ret; - } - - } // End of group preambles - - group postambles { - - /** - * @desc The default postamble. - */ - function f_poDefault() runs on ItsGeoNetworking { - f_acStopScenario(); - } - - /** - * @desc Postamble for neighbour nodes - */ - function f_poNeighbour() runs on ItsGeoNetworking { - f_stopBeingNeighbour(); - f_poDefault(); - } - - } // End of group postambles - - group adapterControl { - - /** - * @desc Triggers event in the test system adaptation. - * @param p_event The event to trigger - * @return FncRetCode - */ - function f_acTriggerEvent(template (value) AcGnPrimitive p_event) runs on ItsBaseGeoNetworking return FncRetCode { - var FncRetCode v_ret := e_success; - - acPort.send(p_event); - - return v_ret; - } - - /** - * @desc Get the position vector corresponding to a specific GN address - * @param p_gnAddress GN address for which the search is performed - * @return LongPosVector - IUT's position - */ - function f_acGetLongPosVector(GN_Address p_gnAddress) runs on ItsBaseGeoNetworking return LongPosVector { - var AcGnResponse v_result; - - f_acTriggerEvent(m_getLongPosVector(p_gnAddress)); - tc_ac.start; - alt { - [] acPort.receive(mw_getLongPosVectorAny(p_gnAddress)) -> value v_result { - tc_ac.stop; - } - [] acPort.receive { - tc_ac.stop; - log("*** f_acGetLongPosVector: ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** f_acGetLongPosVector: ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - return v_result.getLongPosVector; - } - - /** - * @desc Triggers test adapter to send beacons for multiple neighbours - * @param p_numberOfNeighbour Number of neighbours to simulate - * @return FncRetCode - */ - function f_acStartBeaconingMultipleNeighbour(in integer p_numberOfNeighbour) runs on ItsGeoNetworking return FncRetCode { - - return f_acTriggerEvent(m_startBeaconingMultipleNeighbour(m_beaconHeader(f_getPosition(vc_componentName)).beaconHeader, p_numberOfNeighbour)); - - } - - /** - * @desc Triggers test adapter to enable security support - * @return FncRetCode - */ - function f_acEnableSecurity() runs on ItsBaseGeoNetworking return FncRetCode { - - // Local variables - - // Load certificates - if (PICS_GN_SECURITY) { - if( not f_loadCertificates(PX_IUT_SEC_CONFIG_NAME) ) { - return e_error; - } - - // Initialize vc_location - f_setGenerationLocation( - f_getTsLatitude(), - f_getTsLongitude() - ); - return f_acTriggerSecEvent(m_acEnableSecurity(cc_taCert_A)); - } - return f_acTriggerSecEvent(m_acEnableSecurity(PX_CERT_FOR_TS)); - } - - /** - * @desc Triggers test adapter to disable security support - * @return FncRetCode - */ - function f_acDisableSecurity() runs on ItsBaseGeoNetworking return FncRetCode { - - f_unloadCertificates(); - - return f_acTriggerSecEvent(m_acDisableSecurity); - - } - - /** - * @desc Triggers event in the test system adaptation. - * @param p_event The event to trigger - * @return FncRetCode - */ - function f_acTriggerSecEvent( - in template (value) AcSecPrimitive p_event - ) runs on ItsBaseGeoNetworking return FncRetCode { - var FncRetCode v_ret := e_success; - - acPort.send(p_event); - tc_ac.start; - alt { - [] acPort.receive(m_acSecResponseSuccess) { - tc_ac.stop; - } - [] acPort.receive { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - return v_ret; - } - - /** - * @desc Triggers event in the test system adaptation. - * @param p_event The event to trigger - * @return FncRetCode - */ - function f_acTriggerGnssEvent(template (value) AcGnssPrimitive p_event) runs on ItsBaseGeoNetworking return FncRetCode { - var FncRetCode v_ret := e_success; - - acPort.send(p_event); - tc_ac.start; - alt { - [] acPort.receive(m_acGnssResponseSuccess) { - tc_ac.stop; - } - [] acPort.receive { - tc_ac.stop; - log("*** f_acTriggerGnssEvent: ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** f_acTriggerGnssEvent: ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - return v_ret; - } - - /** - * @desc Loads the given scenario - * - * @param p_scenario The scenario to load. - */ - function f_acLoadScenario(Scenario p_scenario) runs on ItsBaseGeoNetworking { - - if (PX_GNSS_SCENARIO_SUPPORT==true) { - f_acTriggerGnssEvent(m_loadScenario(p_scenario)); - } - } // End of function f_acLoadScenario - - /** - * @desc Starts a loaded scenario - */ - function f_acStartScenario() runs on ItsBaseGeoNetworking { - - if (PX_GNSS_SCENARIO_SUPPORT==true) { - f_acTriggerGnssEvent(m_startScenario); - vc_scenarioStarted := true; - } - } // End of function f_acStartScenario - - /** - * @desc Stops a loaded scenario - */ - function f_acStopScenario() runs on ItsBaseGeoNetworking { - - if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { - f_acTriggerGnssEvent(m_stopScenario); - vc_scenarioStarted := false; - } - } // End of function f_acStopScenario - - function f_acAwaitTimeInRunningScenario(integer p_time) runs on ItsBaseGeoNetworking return FncRetCode { - var FncRetCode v_ret := e_success; - - if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { - f_acTriggerGnssEvent(m_timeInRunningScenario(p_time)); - - tc_ac.start(int2float(p_time)*1.1); - alt { - [] acPort.receive(m_acGnssTimeReachedSuccess) { - tc_ac.stop; - } - [] acPort.receive(m_acGnssTimeReachedError) { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for time reached indication ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - } - return v_ret; - } // End of function f_acAwaitTimeInRunningScenario - - } // End of group adapterControl - - group commonFunctions { - - /** - * @desc Gets the value of the lifetime in seconds. - * @param p_lifetime Lifetime to be converted - * @return Lifetime in seconds - */ - function f_getLifetimeValue(in Lifetime p_lifetime) runs on ItsGeoNetworking return float { - var float v_lifetime := 0.0; - - select (p_lifetime.ltBase) { - case (e_50ms) { - v_lifetime := int2float(p_lifetime.multiplier) * 0.5; - } - case (e_1s) { - v_lifetime := int2float(p_lifetime.multiplier) * 1.0; - } - case (e_10s) { - v_lifetime := int2float(p_lifetime.multiplier) * 10.0; - } - case (e_100s) { - v_lifetime := int2float(p_lifetime.multiplier) * 100.0; - } - } - - return v_lifetime; - } - - /** - * @desc Computes GN timestamp based on current time - * @return Unix-Epoch-Time mod 2^32 - */ - function f_computeGnTimestamp() return UInt32 { - - // Timestamp is 1s older than current time to avoid sending beacons coming from the future (time sync between nodes) - var UInt32 v_timestamp := fx_computeGnTimestamp() - 1000; - return v_timestamp; - } - - } // End of group commonFunctions - - group testerFunctions { - - /** - * @desc Gets the tester GN local address for a specific node - * @param p_node Simulated node - * @return GN address of simulated node - */ - function f_getTsGnLocalAddress(in charstring p_node) return GN_Address { - var GN_Address v_gnAddr := valueof(m_dummyGnAddr); - - select (p_node) { - case (c_compNodeA) { - v_gnAddr := PX_TS_NODE_A_LOCAL_GN_ADDR; - } - case (c_compNodeB) { - v_gnAddr := PX_TS_NODE_B_LOCAL_GN_ADDR; - } - case (c_compNodeC) { - v_gnAddr := PX_TS_NODE_C_LOCAL_GN_ADDR; - } - case (c_compNodeD) { - v_gnAddr := PX_TS_NODE_D_LOCAL_GN_ADDR; - } - case (c_compNodeE) { - v_gnAddr := PX_TS_NODE_E_LOCAL_GN_ADDR; - } - case (c_compNodeF) { - v_gnAddr := PX_TS_NODE_F_LOCAL_GN_ADDR; - } - case else { - log("*** f_getTsGnLocalAddress: INFO: Unknown component " & p_node & " ***"); - } - } - - return v_gnAddr; - } - - /** - * @desc Sends a GeoNetworking message and in case of an included sequence number in the message the - * local sequence number will be increased by one. - * @param p_geoNetReq The message to send. - */ - function f_sendGeoNetMessage(in template (value) GeoNetworkingReq p_geoNetReq) runs on ItsGeoNetworking { - geoNetworkingPort.send(p_geoNetReq); - if (not (ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.shbHeader) - or ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.beaconHeader))) { - f_setLocalSequenceNumber(); - } - } - - /** - * @desc Sends a GeoNetworking message with a payload and in case of an included sequence number in the message the - * local sequence number will be increased by one. - * @param p_geoNetReq The message to send. - * @param p_payload The payload to include. - */ - function f_sendGeoNetMessageWithPayload( - in template (value) GeoNetworkingReq p_geoNetReq, - in template (value) GnRawPayload p_payload - ) runs on ItsGeoNetworking { - p_geoNetReq.msgOut.gnPacket.packet.payload := p_payload; - geoNetworkingPort.send(p_geoNetReq); - if (not (ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.shbHeader) - or ischosen(p_geoNetReq.msgOut.gnPacket.packet.extendedHeader.beaconHeader))) { - f_setLocalSequenceNumber(); - } - } - - /** - * @desc Receive a GeoNetworking message with a payload and in case of an included sequence number in the message the - * local sequence number will be increased by one. - * @param p_geoNetInd The message to receive. - * @param p_payload The payload to include. - */ - function f_receiveGeoNetMessageWithPayload( - in template (present) GeoNetworkingInd p_geoNetInd, - in template (present) GnRawPayload p_payload - ) return template (present) GeoNetworkingInd { - var template (present) GeoNetworkingInd v_geoNetInd := p_geoNetInd; - - v_geoNetInd.msgIn.gnPacket.packet.payload := p_payload; - - return v_geoNetInd; - } - - /** - * @desc Sets the value of the sequence number for the next event. - */ - function f_setLocalSequenceNumber() runs on ItsGeoNetworking { - vc_localSeqNumber := (vc_localSeqNumber + 1) mod c_uInt16Max; - } - - /** - * @desc Creates an initial seqence number - * @return Time based initial sequence number (increasing with time) - */ - function f_getInitialSequenceNumber() return UInt16 { - - return (f_computeGnTimestamp() / 1000) mod c_uInt16Max; - } - - /** - * @desc Number of messages to be sent - * @return Number of messages to be sent - */ - function f_getMessageCount() return integer { - return PX_MESSAGE_COUNT; - } - - } // End of group testerFunctions - - group iutFunctions { - - /** - * @desc Gets the IUT GN local address - * @return IUT's GN_Address - * @see PICS_GN_LOCAL_GN_ADDR - */ - function f_getIutGnLocalAddress() return GN_Address { - - return PICS_GN_LOCAL_GN_ADDR; - } - - /** - * @desc Gets the IUT GN local address configuration method - * @return GnAddressConfigurationMethod - IUT's GN local address configuration method - * @see PICS_GN_LOCAL_ADDR_CONF_METHOD - */ - function f_getIutGnLocalAddressConfigurationMethod() return GnAddressConfigurationMethod { - return PICS_GN_LOCAL_ADDR_CONF_METHOD; - } - - /** - * @desc Gets the IUT MAc address - * @return MacAddress - IUT's MAc Address - * @see PICS_IUT_MAC_ADDRESS - */ - function f_getIutMacAddress() return MacAddress { - return PICS_IUT_MAC_ADDRESS; - } - - /** - * @desc Gets the GeoUnicast forwarding algorithm - * @return IUT's GeoUnicast forwarding algorithm - * @see PICS_GN_NON_AREA_FORWARDING_ALGORITHM - */ - function f_getNonAreaForwardingAlgorithm() return NonAreaForwardingAlgorithm { - return PICS_GN_NON_AREA_FORWARDING_ALGORITHM; - } - - /** - * @desc Gets the GeoBroadcast forwarding algorithm - * @return IUT's GeoBroadcast forwarding algorithm - * @see PICS_GN_AREA_FORWARDING_ALGORITHM - */ - function f_getAreaForwardingAlgorithm() return AreaForwardingAlgorithm { - return PICS_GN_AREA_FORWARDING_ALGORITHM; - } - - /** - * @desc Gets the IUT default hop limit - * @return IUT's default hop limit - * @see PICS_GN_DEFAULT_HOP_LIMIT - */ - function f_getDefaultHopLimit() return UInt8 { - return PICS_GN_DEFAULT_HOP_LIMIT; - } - - /** - * @desc Is the ITS-S mobile or stationary? - * @return Flags indicating whether the ITS-S is mobile or stationary. - * @see PICS_GN_IS_MOBILE - */ - function f_isMobile() return Bit8 { - if (PICS_GN_IS_MOBILE) { - return '10000000'B; - } - return '00000000'B; - } - - /** - * @desc Gets the LS retransmission timer.. Valid for NetRepInterval = default (cong. ctrl). - * @return LS retransmission timer in seconds - * @see PICS_GN_LOCATION_SERVICE_RETRANSMIT_TIMER - */ - function f_getLsRetransmitTimer() return float { - var float v_itsGnLocationServiceRetransmitTimer := int2float(PICS_GN_LOCATION_SERVICE_RETRANSMIT_TIMER/1000); - - return v_itsGnLocationServiceRetransmitTimer; - } - - /** - * @desc Gets the LS retransmission timer for NetRepInterval = medium (cong. ctrl). - * @return LS retransmission timer (medium) in seconds - * @see PX_GN_LOCATION_SERVICE_TIMER_MEDIUM - */ - function f_getLsRetransmitTimerMedium() return float { - var float v_itsGnLocationServiceRetransmitTimerMedium := int2float(PX_GN_LOCATION_SERVICE_TIMER_MEDIUM/1000); - - return v_itsGnLocationServiceRetransmitTimerMedium; - } - - /** - * @desc Gets the LS retransmission timer for NetRepInterval = maximum (cong. ctrl). - * @return LS retransmission timer (maximum) in seconds - * @see PX_GN_LOCATION_SERVICE_TIMER_MAXIMUM - */ - function f_getLsRetransmitTimerMaximum() return float { - var float v_itsGnLocationServiceRetransmitTimerMaximum := int2float(PX_GN_LOCATION_SERVICE_TIMER_MAXIMUM/1000); - - return v_itsGnLocationServiceRetransmitTimerMaximum; - } - - /** - * @desc Gets the App retransmission timer. Valid for AppRepInterval = default (cong. ctrl). - * @return App retransmission timer in seconds - * @see PX_GN_APPLICATION_RETRANSMIT_TIMER - */ - function f_getAppRetransmitTimer() return float { - var float v_itsGnLocationApplicationRetransmitTimer := int2float(PX_GN_APPLICATION_RETRANSMIT_TIMER/1000); - - return v_itsGnLocationApplicationRetransmitTimer; - } - - /** - * @desc Gets the App retransmission timer for AppRepInterval = medium (cong. ctrl). - * @return App retransmission timer (medium) in seconds - * @see PX_GN_APPLICATION_RETRANSMIT_TIMER_MEDIUM - */ - function f_getAppRetransmitTimerMedium() return float { - var float v_itsGnLocationApplicationRetransmitTimerMedium := int2float(PX_GN_APPLICATION_RETRANSMIT_TIMER_MEDIUM/1000); - - return v_itsGnLocationApplicationRetransmitTimerMedium; - } - - /** - * @desc Gets the App retransmission timer for AppRepInterval = maximum (cong. ctrl). - * @return App retransmission timer (maximum) in seconds - * @see PX_GN_APPLICATION_RETRANSMIT_TIMER_MAXIMUM - */ - function f_getAppRetransmitTimerMaximum() return float { - var float v_itsGnLocationApplicationRetransmitTimerMaximum := int2float(PX_GN_APPLICATION_RETRANSMIT_TIMER_MAXIMUM/1000); - - return v_itsGnLocationApplicationRetransmitTimerMaximum; - } - - /** - * @desc Gets the LS maximum retransmission number. - * @return LS maximum retransmission number - * @see PICS_GN_LOCATION_SERVICE_MAX_RETRANS - */ - function f_getLsMaxRetrans() return integer { - var integer v_itsGnLocationServiceMaxRetrans := PICS_GN_LOCATION_SERVICE_MAX_RETRANS; - - return v_itsGnLocationServiceMaxRetrans; - } - - /** - * @desc Gets the Application maximum retransmission number. - * @return Application maximum retransmission number - * @see PX_GN_APPLICATION_MAX_RETRANS - */ - function f_getAppMaxRetrans() return integer { - var integer v_itsGnApplicationMaxRetrans := PX_GN_APPLICATION_MAX_RETRANS; - - return v_itsGnApplicationMaxRetrans; - } - - /** - * @desc Gets the Location Service packet buffer size. - * @return Location Service packet buffer size in Kbytes - * @see PICS_GN_LOCATION_SERVICE_PACKET_BUFFER_SIZE - */ - function f_getLsPacketBufferSize() return integer { - var integer v_itsGnLocationServicePacketBufferSize := PICS_GN_LOCATION_SERVICE_PACKET_BUFFER_SIZE; - - return v_itsGnLocationServicePacketBufferSize; - } // End of function f_getLsPacketBufferSize - - /** - * @desc Gets the UC forwarding packet buffer size. - * @return UC forwarding packet buffer size in bytes - * @see PICS_GN_UC_FORWARDING_PACKET_BUFFER_SIZE - */ - function f_getUcForwardingPacketBufferSize() return integer { - var integer v_itsGnUcForwardingPacketBufferSize := PICS_GN_UC_FORWARDING_PACKET_BUFFER_SIZE; - - return v_itsGnUcForwardingPacketBufferSize * 1024; - } // End of function f_getUcForwardingPacketBufferSize - - /** - * @desc Gets the BC forwarding packet buffer size. - * @return BC forwarding packet buffer size in bytes - * @see PICS_GN_BC_FORWARDING_PACKET_BUFFER_SIZE - */ - function f_getBcForwardingPacketBufferSize() return integer { - var integer v_itsGnBcForwardingPacketBufferSize := PICS_GN_BC_FORWARDING_PACKET_BUFFER_SIZE; - - return v_itsGnBcForwardingPacketBufferSize * 1024; - } // End of function f_getBcForwardingPacketBufferSize - - /** - * @desc Gets the maximum lifetime of a packet. - * @return Maximum lifetime of a packet in seconds - * @see PICS_GN_MAX_PACKET_LIFETIME - */ - function f_getMaxPacketLifeTime() return float { - var float v_itsGnMaxPacketLifetime := int2float(PICS_GN_MAX_PACKET_LIFETIME); - - return v_itsGnMaxPacketLifetime; - } - - /** - * @desc Gets delta for timers. - * @return Delta for timers in seconds - * @see PX_T_DELTA - */ - function f_getDeltaTimer() return float { - var float v_deltaTimer := PX_T_DELTA; - - return v_deltaTimer; - } - - /** - * @desc Gets the beacon service retransmit timer. - * @return Beacon service retransmit timer - */ - function f_getBsRetransmitTimer() return float { - var float v_itsGnBeaconServiceRetransmitTimer; - - v_itsGnBeaconServiceRetransmitTimer := int2float( - (PICS_GN_BEACON_SERVICE_RETRANSMIT_TIMER/1000)); - - return v_itsGnBeaconServiceRetransmitTimer; - } - - /** - * @desc Gets the beacon service retransmit timer for NetBeaconInterval = medium (cong. ctrl). - * @return Beacon service retransmit timer (medium) - */ - function f_getBsRetransmitTimerMedium() return float { - var float v_itsGnBeaconServiceRetransmitTimerMedium; // timer value increased (medium) - - v_itsGnBeaconServiceRetransmitTimerMedium := int2float( - (PX_GN_BEACON_SERVICE_TIMER_MEDIUM+float2int((f_getBsMaxJitter() - 0.0 +1.0)*rnd()) + 0)/1000); - - return v_itsGnBeaconServiceRetransmitTimerMedium; - } - - /** - * @desc Gets the beacon service retransmit timer for NetBeaconInterval = maximum (cong. ctrl). - * @return Beacon service retransmit timer (maximum) - */ - function f_getBsRetransmitTimerMaximum() return float { - var float v_itsGnBeaconServiceRetransmitTimerMaximum; // timer value increased (maximum) - - v_itsGnBeaconServiceRetransmitTimerMaximum := int2float( - (PX_GN_BEACON_SERVICE_TIMER_MAXIMUM+float2int((f_getBsMaxJitter() - 0.0 +1.0)*rnd()) + 0)/1000); - - return v_itsGnBeaconServiceRetransmitTimerMaximum; - } - - /** - * @desc Gets the maximum beacon service jitter. - * @return Maximum beacon service jitter - */ - function f_getBsMaxJitter() return float { - var float v_itsGnBeaconServiceMaxJitter := int2float(PICS_GN_BEACON_SERVICE_MAX_JITTER)/1000.0; - - return v_itsGnBeaconServiceMaxJitter; - } - - /** - * @desc Gets the Lifetime of a Location Table Entry. - * @return Lifetime of a Location Table Entry in seconds - * @see PICS_GN_LIFETIME_LOC_TE - */ - function f_getLifetimeLocTableEntry() return float { - var float v_itsGnLifetimeLocTableEntry := int2float(PICS_GN_LIFETIME_LOC_TE); - - return v_itsGnLifetimeLocTableEntry; - } // End of function f_getLifetimeLocTableEntry - - /** - * @desc Gets the maximum communication range for CBF algorithm - * @return Maximum communication range for CBF algorithm in meters - * @see PICS_GN_DEFAULT_MAX_COMMUNICATION_RANGE - */ - function f_getCbfMaxCommunicationRange() return integer { - var integer v_maxCommunicationRange := PICS_GN_DEFAULT_MAX_COMMUNICATION_RANGE; - - return v_maxCommunicationRange; - } // End of function f_getCbfMaxCommunicationRange - - function f_getCbfMaxTime() return integer { - var integer v_cbfMaxTime := PICS_GN_CBF_MAX_TIME; - - return v_cbfMaxTime; - } // End of function f_getCbfMaxTime - - function f_getCbfMinTime() return integer { - var integer v_cbfMinTime := PICS_GN_CBF_MIN_TIME; - - return v_cbfMinTime; - } // End of function f_getCbfMinTime - - function f_getGnMaxAreaSize() return float { - var float v_maxAreaSize := PICS_GN_MAX_GEO_AREA_SIZE; - - return v_maxAreaSize; - } // End of function f_getGnMaxAreaSize - - function f_getAdvancedGbcForwardingMaxCounter() return integer { - var integer v_maxCounter := PICS_GN_ADVANCED_BC_FORWARDING_MAX_COUNTER; - - return v_maxCounter; - } - - /** - * @desc Set the number of neighbour in the Location Table. - * @see PX_MIN_NR_NEIGHBOUR - */ - function f_setNrNeighbourLocTableDefault() runs on ItsGeoNetworking { - var integer v_nrNeighbour := f_random (0, PX_MIN_NR_NEIGHBOUR); - - f_acStartBeaconingMultipleNeighbour(v_nrNeighbour); - - } // End of function f_setNrNeighbourLocTableDefault - - /** - * @desc Set the number of neighbour in the Location Table (medium). - * @see PX_MIN_NR_NEIGHBOUR - * @see PX_MAX_NR_NEIGHBOUR - */ - function f_setNrNeighbourLocTableMedium() runs on ItsGeoNetworking { - var integer v_nrNeighbour := f_random (PX_MIN_NR_NEIGHBOUR, PX_MAX_NR_NEIGHBOUR); - - f_acStartBeaconingMultipleNeighbour(v_nrNeighbour); - - } // End of function f_setNrNeighbourLocTableMedium - - /** - * @desc Set the number of neighbour in the Location Table (maximum). - * @see PX_MAX_NR_NEIGHBOUR - * @see PX_MIN_NR_NEIGHBOUR - */ - function f_setNrNeighbourLocTableMaximum() runs on ItsGeoNetworking { - var integer v_nrNeighbour := f_random (PX_MAX_NR_NEIGHBOUR, (2*PX_MIN_NR_NEIGHBOUR)); - - f_acStartBeaconingMultipleNeighbour(v_nrNeighbour); - - } // End of function f_setNrNeighbourLocTableMaximum - - } // End of group iutFunctions - - group posVectorFunctions { - - /** - * @desc Convert long position vector to short position vector - * @param p_longPosVector Long position vector to be converted - * @return Short position vector - */ - function f_longPosVector2ShortPosVector(in LongPosVector p_longPosVector) return ShortPosVector { - var ShortPosVector v_shortPosVector; - - v_shortPosVector := { - gnAddr := p_longPosVector.gnAddr, - timestamp_ := p_longPosVector.timestamp_, - latitude := p_longPosVector.latitude, - longitude := p_longPosVector.longitude - }; - - return v_shortPosVector; - } - - /** - * @desc Get IUT's long position vector - * @return IUT's long position vector - */ - function f_getIutLongPosVector() runs on ItsBaseGeoNetworking return LongPosVector { - return f_acGetLongPosVector(f_getIutGnLocalAddress()); - } - function f_getIutLongPosVector_1(inout LongPosVector p_longPosVectorIut) runs on ItsGeoNetworking { - p_longPosVectorIut := f_acGetLongPosVector(f_getIutGnLocalAddress()); - } - - /** - * @desc Get IUT's short position vector - * @return IUT's short position vector - */ - function f_getIutShortPosVector() runs on ItsGeoNetworking return ShortPosVector { - var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut); - - if (not isbound(v_longPosVectorIut)) { - v_longPosVectorIut := f_getIutLongPosVector(); - } - return f_longPosVector2ShortPosVector(v_longPosVectorIut); - } - - /** - * @desc Compute a position using a reference position, a distance and an orientation - * @param p_iutLongPosVector Reference position - * @param p_distance Distance to the reference position (in meter) - * @param p_orientation direction of the computed position (0 to 359; 0 means North) - * @return LongPosVector - */ - function f_computePositionUsingDistance(in LongPosVector p_iutLongPosVector, in float p_distance, in integer p_orientation) - return LongPosVector { - var LongPosVector v_result := p_iutLongPosVector; - - log("*** f_computePositionUsingDistance: INFO: calling fx_computePositionUsingDistance() ***"); - fx_computePositionUsingDistance(p_iutLongPosVector.latitude, p_iutLongPosVector.longitude, p_distance, p_orientation, v_result.latitude, v_result.longitude); - - return v_result; - } - - } // End of group posVectorFunctions - - group externalFunctions { - - /** - * @desc External function to compute timestamp based on current time - * @return Unix-Epoch-Time mod 2^32 - */ - external function fx_computeGnTimestamp() return UInt32; - - } // End of group externalFunctions - - group security { - - /** - * @desc Waiting for the GN message with Security - * @param p_InSecMsg SecurityMessage template - * @param p_received returns received SecurityMessage - */ - altstep a_securedMessage ( - in template (present) EtsiTs103097Data p_InSecMsg, - out EtsiTs103097Data p_received - ) runs on ItsGeoNetworking { - var GeoNetworkingInd v_geoNw; - [] geoNetworkingPort.receive(mw_geoNwInd( - mw_geoNwSecPdu( - p_InSecMsg, - mw_geoNwAnyPacket_withPayload(?) - ))) -> value v_geoNw { - p_received := f_getSecuredMessage(v_geoNw.msgIn); - } - } // End of 'altstep' statement - - /** - * @desc Receive GN message with security containing certificate as a signer info - * @param p_cert returns the certificate used for sign received message - */ - altstep a_securedMessageWithCertificate( - out EtsiTs103097Data p_received - ) runs on ItsGeoNetworking { - - [] a_securedMessage ( - mw_etsiTs103097Data_signed( - mw_signedData( - -, - mw_toBeSignedData( - mw_signedDataPayload - ), - mw_signerIdentifier_certificate // containing certificate - ) - ), - p_received - ) { - // Nothing to do - } - } // End of 'altstep' a_securedMessageWithCertificate - - /** - * @desc Receive GN message with security containing digest as a signer info - * @param p_cert returns the certificate used for sign received message - */ - altstep a_securedMessageWithDigest( - out EtsiTs103097Data p_received - ) runs on ItsGeoNetworking { - [] a_securedMessage ( - mw_etsiTs103097Data_signed( - mw_signedData( - -, - mw_toBeSignedData( - mw_signedDataPayload - ), - mw_signerIdentifier_digest // containing digest - ) - ), - p_received - ) { - // Nothing to do - } - } // End of altstep a_securedMessageWithDigest - - } // End of group altSteps - - group waitingHelpers { - - /** - * @desc Wait for GN message with security containing certificate as a signer info - * @return the certificate used for sign received message - */ - function f_waitForCertificate( - out EtsiTs103097Certificate p_cert - ) runs on ItsGeoNetworking return boolean { - var EtsiTs103097Data v_recv; - var boolean v_ret := false; - - alt { - [] a_securedMessageWithCertificate(v_recv) { - var SignerIdentifier v_signerIdentifier; - if (f_getMsgSignerIdentifier(v_recv, v_signerIdentifier) == true) { - if (ischosen(v_signerIdentifier.certificate)) { - p_cert := v_signerIdentifier.certificate[0]; - v_ret := true; - } - } - } - } // End of 'alt' statement - - return v_ret; - } // End of function f_waitForCertificate - - /** - * @desc Ask for the certificate chain and wait for GN message with security containing certificate chain as a signer info - * @return the certificate chain used for sign received message - */ - function f_askForCertificateChain( - in template(value) octetstring p_CamPayload - ) runs on ItsGeoNetworking return boolean { - var EtsiTs103097Data v_recv; - var boolean v_ret := false; - - alt { - [] a_securedMessageWithCertificate(v_recv) { - var SignerIdentifier v_signerIdentifier; - if (f_getMsgSignerIdentifier(v_recv, v_signerIdentifier) == true) { // Get AT certificate - if(ischosen(v_signerIdentifier.digest)) { - f_sendCertificateRequest(v_signerIdentifier.digest, p_CamPayload); // Request issuer - if(tc_ac.running) { - tc_ac.stop; - tc_ac.start; - } - v_ret := true; - } - } - } - } - return v_ret; - } // End of function f_askForCertificateChain - - /** - * @desc Ask for the certificate chain and wait for GN message with security containing certificate chain as a signer info - * @return the certificate chain used for sign received message - */ - function f_askAndWaitForCertificateChain( - out SequenceOfCertificate p_chain, - in template(value) octetstring p_CamPayload - ) runs on ItsGeoNetworking return boolean { - // Local variables - var EtsiTs103097Data v_recv; - var SignerIdentifier v_signerIdentifier; - var boolean v_ret := false; - - f_askForCertificateChain(p_CamPayload); // Get AT certificate and request for the issuer - alt { - [] a_securedMessageWithCertificate(v_recv) { // Get AA certificate - tc_ac.stop; - - if (f_getMsgSignerIdentifier(v_recv, v_signerIdentifier) == true) { - p_chain := v_signerIdentifier.certificate; - } - } - } // End of 'alt' statement - - return v_ret; - } // End of function f_askAndWaitForCertificateChain - - /** - * @desc Send a CAM message with a certificate and wait the certificate chain request message - * @remark This function is used only for testing against another ATS - * @param p_certificate The certificate identifier - * @param p_CamPayload The CAM paylaod - * @return true on success, flase otherwise - */ - function f_sendCertificateAndWaitForCertificateChainRequest( - in charstring p_certificate, - in template(value) octetstring p_CamPayload - ) runs on ItsGeoNetworking return boolean { - // Local variables - var EtsiTs103097Data v_recv; - - f_sendCertificate(p_certificate, p_CamPayload); - /* FIXME To be reviewed alt { - [] a_securedMessage ( - mw_securedMessage( - superset( - mw_header_field_unrecognised_certificate - )), - v_recv - ) { - // Nothing to do - log("*** " & testcasename() & ": DEBUG: Receive certificate ***") - } - }*/ // End of 'alt' statement - - return true; - } // End of function f_sendCertificateAndWaitForCertificateChainRequest - - } // End of group waitingHelpers - - group CertRequests{ - - function f_sendCertificateRequest( - in template (value) HashedId8 p_digest, - in template (value) octetstring p_payload - ) runs on ItsGeoNetworking { - var GeoNetworkingReq v_gnReq; - var GnNonSecuredPacket v_gnNonSecuredPacket; - var template (value) ToBeSignedData v_toBeSignedData; - var template (value) EtsiTs103097Data v_securedMessage; - - // Build signed EtsiTs103097Data - v_gnNonSecuredPacket := valueof(m_geoNwShbPacket( - f_getPosition(c_compNodeC) // FIXME To be verified YANN - )); - // Add CAM payload - v_gnNonSecuredPacket.payload := valueof(p_payload); - - /* FIXME To be reviewed f_buildGnSecuredCam( - v_securedMessage, - m_payload_signed(bit2oct(encvalue(v_gnNonSecuredPacket))), - e_certificate, - { - m_header_field_unrecognised_certificate( - f_HashedId3FromHashedId8( - valueof(p_digest) - )) - }, - "" - ); - - // Build secured Gn packet - v_gnReq := valueof(m_geoNwReq_linkLayerBroadcast( - m_geoNwSecPdu( - v_gnNonSecuredPacket, - v_securedMessage - ) - )); // End of template m_geoNwReq_linkLayerBroadcast - - // Send Message - f_sendGeoNetMessage(v_gnReq);*/ - - } // End of function f_sendCertificateRequest - - /** - * @desc Send a CAM message with a certificate - * @remark This function is used only for testing against another ATS - * @param p_certificate The certificate identifier - * @param p_CamPayload The CAM paylaod - * @return true on success, flase otherwise - * @see f_sendCertificateAndWaitForCertificateChainRequest - */ - function f_sendCertificate( - in charstring p_certificate, - in template (value) octetstring p_payload - ) runs on ItsGeoNetworking { - var GeoNetworkingReq v_gnReq; - var GnNonSecuredPacket v_gnNonSecuredPacket; - var template (value) ToBeSignedData v_toBeSignedData; - var template (value) EtsiTs103097Data v_securedMessage; - - // Build signed EtsiTs103097Data - /* FIXME To be reviewed v_gnNonSecuredPacket := valueof(m_geoNwShbPacket( - f_getPosition(c_compNodeC) // FIXME To be verified YANN - )); - // Add CAM payload - v_gnNonSecuredPacket.payload := valueof(p_payload); - - f_buildGnSecuredCam( - v_securedMessage, - m_payload_signed(bit2oct(encvalue(v_gnNonSecuredPacket))), - e_certificate, - -, - p_certificate - ); - - // Build secured Gn packet - v_gnReq := valueof(m_geoNwReq_linkLayerBroadcast( - m_geoNwSecPdu( - v_gnNonSecuredPacket, - v_securedMessage - ) - )); // End of template m_geoNwReq_linkLayerBroadcast - - // Send Message - f_sendGeoNetMessage(v_gnReq);*/ - - } // End of function f_sendCertificate - - } // End of group CertRequests - - group messageGetters { - - /** - * @desc return EtsiTs103097Data field of GeoNetworking packet - * @param p_msg GeoNetworking packet - * @return the EtsiTs103097Data if any - */ - function f_getSecuredMessage( - in GeoNetworkingPdu p_msg - ) return EtsiTs103097Data { - return p_msg.gnPacket.securedMsg; - } - - } - -} // End of module LibItsGeoNetworking_Functions diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Pics.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Pics.ttcn deleted file mode 100644 index 16d13115..00000000 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Pics.ttcn +++ /dev/null @@ -1,389 +0,0 @@ -/** - * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $URL$ - * $Id$ - * @desc GeoNetworking PICS - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsGeoNetworking_Pics { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from LibItsGeoNetworking_TypesAndValues all; - import from LibItsExternal_TypesAndValues {type MacAddress}; - - group geoNwPics { - - /** - * @desc GeoNetworking address of the GeoAdhoc router - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar GN_Address PICS_GN_LOCAL_GN_ADDR := { - typeOfAddress := e_manual, - stationType := e_passengerCar, - reserved := c_uInt10Zero, - mid := c_6ZeroBytes - }; - - /** - * @desc Is address manually configured - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar GnAddressConfigurationMethod PICS_GN_LOCAL_ADDR_CONF_METHOD := e_anonymous; - - /** - * @desc Is the IUT mobile? - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_IS_MOBILE := true; - - /** - * @desc Minimum update frequency of local position vector (LPV) in ms - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar integer PICS_GN_MINIMUM_UPDATE_FREQUENCY_LPV := 1000; - - /** - * @desc Maximum size of GN-SDU [bytes] - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar integer PICS_GN_MAX_SDU_SIZE := 1398; - - /** - * @desc GN_MAX: Maximum size of GeoNetworking header [bytes] - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar integer PICS_GN_MAX_GN_HEADER_SIZE := 88; - - /** - * @desc Lifetime of location table entry [s] - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar integer PICS_GN_LIFETIME_LOC_TE := 20; - - /** - * @desc GN Security support enabled or disabled - * @see ETSI TS 102 871-1 Table 1 - * @remark This PIC is different than PICS_IS_IUT_SECURED. - * When set to true, this PIC indicates that the GeoNetworking is running with security ATS - * UtInitialse shall indicate which certificate the IUT shall use - */ - modulepar boolean PICS_GN_SECURITY := false; - - /** - * @desc Maximum number of retransmissions of LS_REQUEST packets - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar integer PICS_GN_LOCATION_SERVICE_MAX_RETRANS := 10; - - /** - * @desc Duration of Location service retransmit timer [ms] - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar integer PICS_GN_LOCATION_SERVICE_RETRANSMIT_TIMER := 1000; - - /** - * @desc Size of Location service packet buffer [Byte] - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar integer PICS_GN_LOCATION_SERVICE_PACKET_BUFFER_SIZE := 1024; - - /** - * @desc Duration of Beacon service retransmit timer [ms] - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar integer PICS_GN_BEACON_SERVICE_RETRANSMIT_TIMER := 3000; - - /** - * @desc Maximum beacon jitter [ms] - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar integer PICS_GN_BEACON_SERVICE_MAX_JITTER := 750; - - /** - * @desc Default hop limit indicating the maximum number of hops a packet travels - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar UInt8 PICS_GN_DEFAULT_HOP_LIMIT := 10; - - /** - * @desc Upper limit of the maximum lifetime [s] - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar integer PICS_GN_MAX_PACKET_LIFETIME := 600; - - /** - * @desc Lower limit of the packet repetition interval [km^2] - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar float PICS_GN_MAX_GEO_AREA_SIZE:= 10.0; - - /** - * @desc Lower limit of the packet repetition interval [ms] - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar integer PICS_GN_MIN_PACKET_REPETITION_INTERVAL := 100; - - /** - * @desc Default NON-AREA forwarding algorithm - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar NonAreaForwardingAlgorithm PICS_GN_NON_AREA_FORWARDING_ALGORITHM := e_greedy; - - /** - * @desc Default AREA forwarding algorithm - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar AreaForwardingAlgorithm PICS_GN_AREA_FORWARDING_ALGORITHM := e_cbf; - - /** - * @desc Minimum duration a packet shall be buffered in the CBF packet buffer [ms] - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar integer PICS_GN_CBF_MIN_TIME := 1; - - /** - * @desc Maximum duration a packet shall be buffered in the CBF packet buffer [ms] - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar integer PICS_GN_CBF_MAX_TIME := 100; - - /** - * @desc Default theoretical maximum communication range [m] - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar integer PICS_GN_DEFAULT_MAX_COMMUNICATION_RANGE := 1000; - - /** - * @desc Size of UC forwarding packet buffer [Kbytes] - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar integer PICS_GN_UC_FORWARDING_PACKET_BUFFER_SIZE := 256; - - /** - * @desc Size of BC forwarding packet buffer [Kbytes] - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar integer PICS_GN_BC_FORWARDING_PACKET_BUFFER_SIZE := 1024; - - /** - * @desc Support for Basic header - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_BASIC_HEADER := true; - - /** - * @desc Support for Common header - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_COMMON_HEADER := true; - - /** - * @desc Support for Beacon source operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_BEACON_SRC := true; - - /** - * @desc Support for Beacon destination operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_BEACON_DST := true; - - /** - * @desc Support for GUC operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_GUC := true; - - /** - * @desc Support for GUC source operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_GUC_SRC := true; - - /** - * @desc Support for GUC destination operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_GUC_DST := true; - - /** - * @desc Support for GUC forwarding - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_GUC_FWD := true; - - /** - * @desc Support for GBC operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_GBC := true; - - /** - * @desc Support for GBC source operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_GBC_SRC := true; - - /** - * @desc Support for GBC destination operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_GBC_DST := true; - - /** - * @desc Support for GBC forwarding - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_GBC_FWD := true; - - /** - * @desc Support for GAC operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_GAC := true; - - /** - * @desc Support for GAC source operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_GAC_SRC := true; - - /** - * @desc Support for GAC destination operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_GAC_DST := true; - - /** - * @desc Support for GAC forwarding - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_GAC_FWD := true; - - /** - * @desc Support for SHB operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_SHB := true; - - /** - * @desc Support for SHB source operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_SHB_SRC := true; - - /** - * @desc Support for SHB destination operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_SHB_DST := true; - - /** - * @desc Support for TSB operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_TSB := true; - - /** - * @desc Support for TSB source operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_TSB_SRC := true; - - /** - * @desc Support for TSB destination operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_TSB_DST := true; - - /** - * @desc Support for TSB forwarding - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_TSB_FWD := true; - - /** - * @desc Support for LS Request source operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_LS_REQ_SRC := true; - - /** - * @desc Support for LS Request retransmission - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_LS_REQ_RETRANSMISSION := true; - - /** - * @desc Support for LS Request destination operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_LS_REQ_DST := true; - - /** - * @desc Support for LS Reply destination operations - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_LS_REP_DST := true; - - /** - * @desc Support for LS forwarding - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_LS_FWD := true; - - /** - * @desc Support for automatic address - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_ADDR_AUTO := true; - - /** - * @desc Support for Managed address - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_ADDR_MANAGED := true; - - /** - * @desc Support for Anonymous address - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_ADDR_ANONYMOUS := true; - - /** - * @desc Support for DAD - * @see ETSI TS 102 871-1 Table 1 - */ - modulepar boolean PICS_GN_DAD := true; - - /** - * @desc MAX_COUNTER used in Advanced GBC forwarding - * @see FIXME: not defined as protocol constant in base spec - */ - modulepar integer PICS_GN_ADVANCED_BC_FORWARDING_MAX_COUNTER := 3; - - /** - * @desc IUT's Mac address - */ - modulepar MacAddress PICS_IUT_MAC_ADDRESS := 'FFFFFFFFFFFF'O; - - } // end geoNwPics - - /** - * @desc Is the IUT running in secured mode? - * @remark This PIC is different than PICS_GN_SECURITY. - * When set to true, this PIC indicates that the GeoNetworking is running without security against a secured device - * UtInitialse does not indicate any certificate - */ - modulepar boolean PICS_IS_IUT_SECURED := false; - -} // End of module LibItsGeoNetworking_Pics diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Pixits.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Pixits.ttcn deleted file mode 100644 index 768ee778..00000000 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Pixits.ttcn +++ /dev/null @@ -1,207 +0,0 @@ -/** - * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/GeoNetworking/LibItsGeoNetworking_Pixits.ttcn $ - * $Id: LibItsGeoNetworking_Pixits.ttcn,v 1.4 2018/05/31 15:57:10 dte Exp $ - * @desc GeoNetworking PICS - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsGeoNetworking_Pixits { - - // LibCommon -// import from LibCommon_DataStrings all; - import from LibCommon_BasicTypesAndValues all; - - // LibIts - import from LibItsGeoNetworking_TypesAndValues all; - - group geoNetworkingPixits { - - group gnAddresses { - - /** - * @desc GeoNetworking address of the GeoAdhoc router node A - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar GN_Address PX_TS_NODE_A_LOCAL_GN_ADDR := { - typeOfAddress := e_manual, - stationType := e_passengerCar, - reserved := c_uInt10Zero, - mid := int2oct(10,6) - }; - - /** - * @desc GeoNetworking address of the GeoAdhoc router node B - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar GN_Address PX_TS_NODE_B_LOCAL_GN_ADDR := { - typeOfAddress := e_manual, - stationType := e_passengerCar, - reserved := c_uInt10Zero, - mid := int2oct(11,6) - }; - - /** - * @desc GeoNetworking address of the GeoAdhoc router node C - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar GN_Address PX_TS_NODE_C_LOCAL_GN_ADDR := { - typeOfAddress := e_manual, - stationType := e_passengerCar, - reserved := c_uInt10Zero, - mid := int2oct(12,6) - }; - - /** - * @desc GeoNetworking address of the GeoAdhoc router node D - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar GN_Address PX_TS_NODE_D_LOCAL_GN_ADDR := { - typeOfAddress := e_manual, - stationType := e_passengerCar, - reserved := c_uInt10Zero, - mid := int2oct(13,6) - }; - - /** - * @desc GeoNetworking address of the GeoAdhoc router node E - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar GN_Address PX_TS_NODE_E_LOCAL_GN_ADDR := { - typeOfAddress := e_manual, - stationType := e_passengerCar, - reserved := c_uInt10Zero, - mid := int2oct(14,6) - }; - - /** - * @desc GeoNetworking address of the GeoAdhoc router node F - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar GN_Address PX_TS_NODE_F_LOCAL_GN_ADDR := { - typeOfAddress := e_manual, - stationType := e_passengerCar, - reserved := c_uInt10Zero, - mid := int2oct(15,6) - }; - - } // end gnAddresses - - group congestionControl { - - /** - * @desc Nr of neighbour limit to enter the "medium" congestion status value - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar integer PX_MIN_NR_NEIGHBOUR := 50; - - /** - * @desc Nr of neighbour limit to enter the "maximum" congestion status value - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar integer PX_MAX_NR_NEIGHBOUR := 50; - - /** - * @desc Maximum number of application retransmissions - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar integer PX_GN_APPLICATION_MAX_RETRANS := 10; - - } // end congestionControl - - group timers { - - /** - * @desc Delta for timers to reflect processing time - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar float PX_T_DELTA := 0.1; - - /** - * @desc Duration of Beacon service retransmit timer [ms] for NetBeaconInterval = medium (cong. ctrl) - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar integer PX_GN_BEACON_SERVICE_TIMER_MEDIUM := 5000; - - /** - * @desc Duration of Beacon service retransmit timer [ms] for NetBeaconInterval = maximum (cong. ctrl) - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar integer PX_GN_BEACON_SERVICE_TIMER_MAXIMUM := 8000; - - /** - * @desc Duration of Location service retransmit timer [ms] for NetRepInterval = medium (cong. ctrl) - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar integer PX_GN_LOCATION_SERVICE_TIMER_MEDIUM := 2000; - - /** - * @desc Duration of Location service retransmit timer [ms] for NetRepInterval = maximum (cong. ctrl) - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar integer PX_GN_LOCATION_SERVICE_TIMER_MAXIMUM := 3000; - - /** - * @desc Duration of Application retransmit timer [ms] - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar integer PX_GN_APPLICATION_RETRANSMIT_TIMER := 1000; - - /** - * @desc Duration of Application retransmit timer [ms] - medium - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar integer PX_GN_APPLICATION_RETRANSMIT_TIMER_MEDIUM := 2000; - - /** - * @desc Duration of Application retransmit timer [ms] - maximum - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar integer PX_GN_APPLICATION_RETRANSMIT_TIMER_MAXIMUM := 3000; - - /** - * @desc The allowed delta for position checking. - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar integer PX_POS_DELTA := 1; - } - - group upperLayer { - - /** - * @desc The IUT's upper layer - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar NextHeader PX_GN_UPPER_LAYER := e_any; - - /** - * @desc Is BTP header present in IUT's UT indication. Only applicable if PX_GN_UPPER_LAYER == e_btpA or e_btpB. - * @remark It may happen that IUT do not report BTP header in UT indications (due to GN/BTP merge) - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar boolean PX_BTP_IN_UT_IND := true; - - } - - group parametrisation { - - /** - * @desc Number of messages to be sent - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar integer PX_MESSAGE_COUNT := 5; - - /** - * @desc Time necessary for IUT to detect neighbours - * @see ETSI TS 102 871-3 Table B.7 - */ - modulepar float PX_NEIGHBOUR_DISCOVERY_DELAY := 1.0 - - } - - } // end geoNetworkingPixits - -} // end LibItsGeoNetworking_Pixits diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn deleted file mode 100644 index 440339eb..00000000 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn +++ /dev/null @@ -1,2320 +0,0 @@ -/** - * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn $ - * $Id: LibItsGeoNetworking_Templates.ttcn,v 1.5 2018/05/31 15:57:10 dte Exp $ - * @desc GeoNetworking Templates - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsGeoNetworking_Templates { - - // Libcommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from EtsiTs103097Module language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - import from LibItsExternal_TypesAndValues all; - - // LibItsBtp - // import from LibItsBtp_Templates all; -// import from LibItsBtp_EncdecDeclarations all; - - // LibItsSecurity - import from LibItsSecurity_TypesAndValues all; -// import from LibItsSecurity_Pixits all; - - // LibItsIpv6OverGeoNetworking - //import from LibItsIpv6OverGeoNetworking_TypesAndValues all; - //import from LibItsIpv6OverGeoNetworking_Templates all; - - // AtsGeoNetworking - import from LibItsGeoNetworking_TestSystem all; - import from LibItsGeoNetworking_TypesAndValues all; - import from LibItsGeoNetworking_Pixits all; -// import from LibItsGeoNetworking_EncdecDeclarations all; - - group geoNwPrimitivesTemplates { - - /** - * @desc Send template for GeoNetworking packet (GeonetworkingPort Primitive) - * @param p_geoNwMsg GeoNetworking packet to be sent - * @param p_its_aid ITS-AID used in secured mode. Default: 0, means unused - */ - template (value) GeoNetworkingReq m_geoNwReq_linkLayerBroadcast( - in template (value) GeoNetworkingPdu p_geoNwMsg, - in template (value) UInt32 p_its_aid := 0 - ) := { - msgOut := p_geoNwMsg, - macDestinationAddress := c_llBroadcast, - its_aid := p_its_aid - } - - /** - * @desc Send template for GeoNetworking packet (GeonetworkingPort Primitive) - * @param p_geoNwMsg GeoNetworking packet to be sent - * @param p_its_aid ITS-AID used in secured mode. Default: 0, means unused - * @param p_llDestinationAdress Link-layer destination address - */ - template (value) GeoNetworkingReq m_geoNwReq_withLinkLayerDestination( - in template (value) GeoNetworkingPdu p_geoNwMsg, - in template (value) UInt32 p_its_aid := 0, - in template (value) MacAddress p_llDestinationAdress - ) modifies m_geoNwReq_linkLayerBroadcast := { - macDestinationAddress := p_llDestinationAdress - } - - /** - * @desc Receive template for GeoNetworking packet (GeonetworkingPort Primitive) - * @param p_geoNwMsg GeoNetworking packet to be received - */ - template(present) GeoNetworkingInd mw_geoNwInd( - template (present) GeoNetworkingPdu p_geoNwMsg := ? - ) := { - msgIn := p_geoNwMsg, - macDestinationAddress := ?, - ssp := *, - its_aid := * - } - - /** - * @desc Receive template for GeoNetworking packet (GeonetworkingPort Primitive) - * @param p_geoNwMsg GeoNetworking packet to be received - * @param p_llDestinationAdress Link-layer destination address - */ - template (present) GeoNetworkingInd mw_geoNwInd_withLinkLayerDestination( - template (present) GeoNetworkingPdu p_geoNwMsg := ?, - template (present) MacAddress p_llDestinationAdress := ? - ) modifies mw_geoNwInd := { - macDestinationAddress := p_llDestinationAdress - } - - group utPrimitives { - - /** - * @desc Initializes the GN IUT. - */ - template (value) UtGnInitialize m_gnInitialize := { - hashedId8 := '0000000000000000'O - } - - /** - * @desc Request IUT to send a GeoUnicast message to a specific destination - * @param p_destinationGnAddr Destination of the GeoUnicast message - */ - template (value) UtGnTrigger m_generateGeoUnicastMessage(GN_Address p_destinationGnAddr) := { - geoUnicast := { - gnAddress := p_destinationGnAddr, - lifetime := c_lifetime, - trafficClass := valueof(m_trafficClass), - payload := ''O - } - } - - /** - * @desc Request IUT to send a GeoUnicast message to a specific destination with specific lifetime - * @param p_destinationGnAddr Destination of the GeoUnicast message - * @param p_trafficClass TrafficClass of the GeoUnicast message - * @see m_generateGeoUnicastMessage - */ - template (value) UtGnTrigger m_generateGeoUnicastMessageWithTrafficClass( - GN_Address p_destinationGnAddr, - TrafficClass p_trafficClass - ) modifies m_generateGeoUnicastMessage := { - geoUnicast := { - trafficClass := p_trafficClass - } - } - - /** - * @desc Request IUT to send a GeoUnicast message to a specific destination with specific lifetime - * @param p_destinationGnAddr Destination of the GeoUnicast message - * @param p_lifetime Lifetime of the GeoUnicast message - * @see m_generateGeoUnicastMessage - */ - template (value) UtGnTrigger m_generateGeoUnicastMessageWithLifetime( - GN_Address p_destinationGnAddr, - UInt16 p_lifetime - ) modifies m_generateGeoUnicastMessage := { - geoUnicast := { - lifetime := p_lifetime - } - } - - /** - * @desc Request IUT to send a GeoUnicast message to a specific destination with a payload - * @param p_destinationGnAddr Destination of the GeoUnicast message - * @param p_payload Payload of the GeoUnicast message - * @see m_generateGeoUnicastMessage - */ - template (value) UtGnTrigger m_generateGeoUnicastMessageWithPayload( - GN_Address p_destinationGnAddr, - octetstring p_payload - ) modifies m_generateGeoUnicastMessage := { - geoUnicast := { - payload := p_payload - } - } - - /** - * @desc Request IUT to send a GeoUnicast message to a specific destination with specific lifetime with specific payload - * @param p_destinationGnAddr Destination of the GeoUnicast message - * @param p_lifetime Lifetime of the GeoUnicast message - * @param p_payload Payload of the GeoUnicast message - * @see m_generateGeoUnicastMessage - */ - template (value) UtGnTrigger m_generateGeoUnicastMessageWithLifetimeWithPayload( - GN_Address p_destinationGnAddr, - UInt16 p_lifetime, - octetstring p_payload - ) modifies m_generateGeoUnicastMessageWithLifetime := { - geoUnicast := { - payload := p_payload - } - } - - /** - * @desc Request IUT to send a GeoBroadcast message to a specific area - * @param p_geoArea Destination area of the message - */ - template (value) UtGnTrigger m_generateGeoBroadcastMessage( - GeoArea p_geoArea - ) := { - geoBroadcast := { - shape := p_geoArea.shape, - lifetime := c_lifetime, - trafficClass := valueof(m_trafficClass), - reserved := c_uInt24Zero, - area := p_geoArea.area, - payload := ''O - } - } - - /** - * @desc Request IUT to send a GeoBroadcast message to a specific area - * @param p_geoArea Destination area of the message - * @param p_trafficClass TrafficClass of the GeoUnicast message - */ - template (value) UtGnTrigger m_generateGeoBroadcastMessageWithTrafficClass( - GeoArea p_geoArea, - TrafficClass p_trafficClass - ) modifies m_generateGeoBroadcastMessage := { - geoBroadcast := { - trafficClass := p_trafficClass - } - } - - /** - * @desc Request IUT to send a GeoBroadcast message to a specific area - * @param p_geoArea Destination area of the message - * @param p_lifetime Packet's lifetime - */ - template (value) UtGnTrigger m_generateGeoBroadcastMessageWithLifetime( - GeoArea p_geoArea, - UInt16 p_lifetime - ) modifies m_generateGeoBroadcastMessage := { - geoBroadcast := { - lifetime := p_lifetime - } - } - - /** - * @desc Request IUT to send a GeoBroadcast message to a specific area with a payload - * @param p_geoArea Destination area of the message - * @param p_payload Payload of the GeoBroadcast message - * @see m_generateGeoBroadcastMessage - */ - template (value) UtGnTrigger m_generateGeoBroadcastMessageWithPayload( - GeoArea p_geoArea, - octetstring p_payload - ) modifies m_generateGeoBroadcastMessage := { - geoBroadcast := { - payload := p_payload - } - } - - /** - * @desc Request IUT to send a GeoAnycast message to a specific area - * @param p_geoArea Destination area of the message - */ - template (value) UtGnTrigger m_generateGeoAnycastMessage( - GeoArea p_geoArea - ) := { - geoAnycast := { - shape := p_geoArea.shape, - lifetime := c_lifetime, - trafficClass := valueof(m_trafficClass), - reserved := c_uInt24Zero, - area := p_geoArea.area, - payload := ''O - } - } - - /** - * @desc Request IUT to send a GeoAnycast message to a specific area with a payload - * @param p_geoArea Destination area of the message - * @param p_trafficClass TrafficClass of the GeoUnicast message - * @see m_generateGeoAnycastMessage - */ - template (value) UtGnTrigger m_generateGeoAnycastMessageWithTrafficClass( - GeoArea p_geoArea, - TrafficClass p_trafficClass - ) modifies m_generateGeoAnycastMessage := { - geoAnycast := { - trafficClass := p_trafficClass - } - } - - /** - * @desc Request IUT to send a GeoAnycast message to a specific area with a payload - * @param p_geoArea Destination area of the message - * @param p_payload Payload of the GeoAnycast message - * @see m_generateGeoAnycastMessage - */ - template (value) UtGnTrigger m_generateGeoAnycastMessageWithPayload( - GeoArea p_geoArea, - octetstring p_payload - ) modifies m_generateGeoAnycastMessage := { - geoAnycast := { - payload := p_payload - } - } - - /** - * @desc Request IUT to send a SHB message - */ - template (value) UtGnTrigger m_generateShbMessage := { - shb := { - trafficClass := valueof(m_trafficClass), - payload := ''O - } - } - - /** - * @desc Request IUT to send a SHB message with a payload - * @param p_trafficClass TrafficClass of the GeoUnicast message - * @see m_generateShbMessage - */ - template (value) UtGnTrigger m_generateShbMessageWithTrafficClass( - TrafficClass p_trafficClass - ) modifies m_generateShbMessage := { - shb := { - trafficClass := p_trafficClass - } - } - - /** - * @desc Request IUT to send a SHB message with a payload - * @param p_payload Payload of the SHB message - * @see m_generateShbMessage - */ - template (value) UtGnTrigger m_generateShbMessageWithPayload( - octetstring p_payload - ) modifies m_generateShbMessage := { - shb := { - payload := p_payload - } - } - - /** - * @desc Request IUT to send a TSB message - */ - template (value) UtGnTrigger m_generateTsbMessage := { - tsb := { - nbHops := 10, - lifetime := c_lifetime, - trafficClass := valueof(m_trafficClass), - payload := ''O - } - } - - /** - * @desc Request IUT to send a TSB message - * @param p_lifetime Packet's lifetime - */ - template (value) UtGnTrigger m_generateTsbMessageWithLifetime( - UInt16 p_lifetime - ) modifies m_generateTsbMessage := { - tsb := { - lifetime := p_lifetime - } - } - - /** - * @desc Request IUT to send a TSB message - * @param p_trafficClass TrafficClass of the GeoUnicast message - */ - template (value) UtGnTrigger m_generateTsbMessageWithTrafficClass( - TrafficClass p_trafficClass - ) modifies m_generateTsbMessage := { - tsb := { - trafficClass := p_trafficClass - } - } - - /** - * @desc Request IUT to change its position - */ - template (value) UtGnChangePosition m_changePosition := { - latitude := 1000, - longitude := 0, - elevation := 0 - } - - } // end utPrimitives - - group taPrimitives { - - /** - * @desc Testsystem will start beaconing for the given neighbor - * @param p_beaconHeader The neighbor information - */ - template (value) AcGnPrimitive m_startBeaconing( - template (value) BeaconHeader p_beaconHeader - ) := { - startBeaconing := { - beaconPacket := m_geoNwPdu(valueof(m_geoNwBeaconPacket(valueof(p_beaconHeader.srcPosVector))), -, c_hopLimit1) - } - } - - /** - * @desc Testsystem will stop beaconing for the given neighbor - * @param p_compName The neighbor - */ - template AcGnPrimitive m_stopBeaconing := { - stopBeaconing:= { - } - } - - /** - * @desc Testsystem will pass received to the TTCN-3 - * @param p_beaconHeader The neighbor information - */ - template (value) AcGnPrimitive m_startPassBeaconing( - in template (value) BeaconHeader p_beaconHeader - ) := { - startPassBeaconing := { - beaconHeader := p_beaconHeader - } - } - - /** - * @desc Testsystem will stop passing beacon information to the TTCN-3 - */ - template (value) AcGnPrimitive m_stopPassBeaconing := { - stopPassBeaconing := { - } - } - - /** - * @desc Testsystem will start beaconing for multiple neighbors - * @param p_beaconHeader The neighbor information - * @param p_numberOfNeighbour The number of ITS stations for which TS will send beacons - */ - template (value) AcGnPrimitive m_startBeaconingMultipleNeighbour( - template (value) BeaconHeader p_beaconHeader, - integer p_numberOfNeighbour - ) := { - startBeaconingMultipleNeighbour := { - beaconPacket := m_geoNwPdu(valueof(m_geoNwBeaconPacket(valueof(p_beaconHeader.srcPosVector))), -, c_hopLimit1), - numberOfNeighbour := p_numberOfNeighbour - } - } - - /** - * @desc Testsystem will stop beaconing for multiple neighbors - * @param p_compName The neighbor - */ - template (value) AcGnPrimitive m_stopBeaconingMultipleNeighbour := { - stopBeaconingMultipleNeighbour:= { - } - } - - /** - * @desc Testsystem will reply the LongPosVector including the requested GN address - * found in received beacon information to the TTCN-3 - * @param p_gnAddress The GN address included in the LongPosVector - */ - template (value) AcGnPrimitive m_getLongPosVector(GN_Address p_gnAddress) := { - getLongPosVector := { - gnAddress := p_gnAddress - } - } - - /** - * @desc Receive template adapter control result for long position vector with specific GN_Address - * @param p_gnAddress GN_Address to be contained in the long position vector - */ - template AcGnResponse mw_getLongPosVectorAny(template (present) GN_Address p_gnAddress) := { - getLongPosVector := mw_longPosVectorAny(p_gnAddress) - } - - } // end taPrimitives - - } // geoNwPrimitivesTemplates - - group geoNwPduTemplates { - - /** - * @desc Send template for GeoNetworking PDU - * @param p_packet GnNonSecuredPacket of GeoNetworking message - * @param p_lifeTime Lifetime of GeoNetworking message (Default: m_defaultLifetime) - * @param p_hopLimit Router Hop limit of GeoNetworking message (Default: c_defaultHopLimit) - */ - template (value) GeoNetworkingPdu m_geoNwPdu( - in template (value) GnNonSecuredPacket p_packet, - in template (value) Lifetime p_lifeTime := m_defaultLifetime, - in template (value) UInt8 p_hopLimit := c_defaultHopLimit - ) := { - basicHeader := m_basicHeader(p_lifeTime, p_hopLimit), - gnPacket := { - packet := p_packet, - securedMsg := omit - } - } - - /** - * @desc Receive template for GeoNetworking PDU - * @param p_packet GnNonSecuredPacket of GeoNetworking message - * @param p_lifeTime Lifetime of GeoNetworking message (Default: ?) - * @param p_hopLimit Router Hop limit of GeoNetworking message (Default: ?) - */ - template (present) GeoNetworkingPdu mw_geoNwPdu( - template (present) GnNonSecuredPacket p_packet, - template (present) Lifetime p_lifeTime := ?, - template (present) UInt8 p_hopLimit := ? - ) := { - basicHeader := mw_basicHeader(p_lifeTime, p_hopLimit), - gnPacket := { - packet := p_packet, - securedMsg := * - } - } - - /** - * @desc Receive template for secured GeoNetworking PDU - * @param p_secMsg Secured message - * @param p_packet Clear-text version of the packet - */ - template (present) GeoNetworkingPdu mw_geoNwSecPdu( - template (present) EtsiTs103097Data p_secMsg, - template (present) GnNonSecuredPacket p_packet := ? - ) := { - basicHeader := mw_securedBasicHeader(), - gnPacket := { - packet := p_packet, - securedMsg := p_secMsg - } - } - - /** - * @desc Send template for secured GeoNetworking PDU - * @param p_packet Clear-text version of the packet - * @param p_secMsg Secured message - */ - template (value) GeoNetworkingPdu m_geoNwSecPdu( - in template (value) GnNonSecuredPacket p_packet, - in template (value) EtsiTs103097Data p_secMsg - ) := { - basicHeader := m_securedBasicHeader(), - gnPacket := { - packet := p_packet, - securedMsg := p_secMsg - } - } - - } // end geoNwPduTemplates - - group geoNwPacketTemplates { - - /** - * @desc Send template for GeoNetworking Packet - * @param p_basicHeader Common header of GeoNetworking packet - * @param p_extHeader Extended header of GeoNetworking packet - */ - template (value) GeoNetworkingPacket m_geoNwPacket( - in template (value) CommonHeader p_commonHeader, - in template (value) ExtendedHeader p_extHeader - ) := { - packet := { - commonHeader := valueof(p_commonHeader), - extendedHeader := valueof(p_extHeader), - payload := char2oct("DEFAULT_PAYLOAD") - }, - securedMsg := omit - } - - /** - * @desc Send template for GeoNetworking Packet with no payload - * @param p_basicHeader Common header of GeoNetworking packet - * @param p_extHeader Extended header of GeoNetworking packet - * - * @see m_geoNwPacket - */ - template (value) GeoNetworkingPacket m_geoNwPacketNoPayload( - in template (value) CommonHeader p_commonHeader, - in template (value) ExtendedHeader p_extHeader - ) modifies m_geoNwPacket := { - packet := { - payload := omit - } - } - - /** - * @desc Send template for GeoNetworking Packet with payload - * @param p_basicHeader Common header of GeoNetworking packet - * @param p_extHeader Extended header of GeoNetworking packet - * @param p_payload Payload - * - * @see m_geoNwPacket - */ - template (value) GeoNetworkingPacket m_geoNwPacketWithPayload( - in template (value) CommonHeader p_commonHeader, - in template (value) ExtendedHeader p_extHeader, - in template (value) GnRawPayload p_payload - ) modifies m_geoNwPacket := { - packet := { - payload := p_payload - } - } - - /** - * @desc Receive template for GeoNetworking Packet - * @param p_basicHeader Common header of GeoNetworking packet - * @param p_extHeader Extended header of GeoNetworking packet - */ - template (present) GeoNetworkingPacket mw_geoNwPacket( - template (present) CommonHeader p_commonHeader := ?, - template (present) ExtendedHeader p_extHeader := ? - ) := { - packet := { - commonHeader := p_commonHeader, - extendedHeader := p_extHeader, - payload := * - }, - securedMsg := * - } - - /** - * @desc Receive template for GeoNetworking Packet with any payload - * @param p_basicHeader Common header of GeoNetworking packet - * @param p_extHeader Extended header of GeoNetworking packet - * - * @see mw_geoNwPacket - */ - template(present) GeoNetworkingPacket mw_geoNwPduAnyPayload( - template (present) CommonHeader p_commonHeader := ?, - template (present) ExtendedHeader p_extHeader := ? - ) modifies mw_geoNwPacket := { - packet := { - payload := ? - } - } - - /** - * @desc Receive template for GeoNetworking PDU with octetstring payload - * @param p_basicHeader Common header of GeoNetworking packet - * @param p_extHeader Extended header of GeoNetworking packet - * @param p_payload Octetstring payload - * - * @see mw_geoNwPacket - */ - template(present) GeoNetworkingPacket mw_geoNwPduWithOctetstringPayload( - template (present) CommonHeader p_commonHeader := ?, - template (present) ExtendedHeader p_extHeader := ?, - template (present) octetstring p_payload := ? - ) modifies mw_geoNwPacket := { - packet := { - payload := p_payload - } - } - - /** - * @desc Receive template for GeoNetworking PDU with payload - * @param p_basicHeader Common header of GeoNetworking packet - * @param p_extHeader Extended header of GeoNetworking packet - * @param p_payload Payload - * - * @see mw_geoNwPacket - */ - template(present) GeoNetworkingPacket mw_geoNwPduWithPayload( - template (present) CommonHeader p_commonHeader := ?, - template (present) ExtendedHeader p_extHeader := ?, - template (present) GnRawPayload p_payload := ? - ) modifies mw_geoNwPacket := { - packet := { - payload := p_payload - } - } - - group geoNwPacketTemplates_ { - - /** - * @desc Receive template for any GeoNetworking Packet - */ - template (present) GnNonSecuredPacket mw_geoNwAnyPacket := { - commonHeader := mw_commonHeader( - ?, - ? - ), - extendedHeader := *, - payload := * - } - - /** - * @desc Receive template for any GeoNetworking Packet with Payload - * @param payload Expected GN payload - */ - template (present) GnNonSecuredPacket mw_geoNwAnyPacket_withPayload( - template (present) GnRawPayload p_payload := ? - ) := { - commonHeader := mw_commonHeader( - ?, - ? - ), - extendedHeader := *, - payload := p_payload - } - - } // end group geoNwPacketTemplates_ - - group geoNwPacketUnicastTemplates { - - /** - * @desc Send template for GeoNetworking Unicast Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_destinationShortPosVec Short position vector of destination - * @param p_seqNumber Sequence number of GeoUnicast packet - * @param p_hopLimit Maximum number of hops (Default: c_defaultHopLimit) - * @param p_trafficClass Traffic Class - */ - template (value) GnNonSecuredPacket m_geoNwUnicastPacket( - in template (value) LongPosVector p_sourceLongPosVec, - in template (value) ShortPosVector p_destinationShortPosVec, - in template (value) UInt16 p_seqNumber, - in template (value) UInt8 p_hopLimit := c_defaultHopLimit, - in template (value) TrafficClass p_trafficClass := m_trafficClass - ) := { - commonHeader := valueof(m_commonHeader( - PX_GN_UPPER_LAYER, - m_geoUnicastHeaderType, - p_trafficClass, - p_hopLimit - )), - extendedHeader := valueof(m_geoUnicastHeader( - p_sourceLongPosVec, - p_destinationShortPosVec, - p_seqNumber - )), - payload := valueof(char2oct("DEFAULT_PAYLOAD")) - } - - /** - * @desc Send template for GeoNetworking Unicast Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_destinationShortPosVec Short position vector of destination - * @param p_seqNumber Sequence number of GeoUnicast packet - * @param p_hopLimit Maximum number of hops (Default: c_defaultHopLimit) - * @param p_trafficClass Traffic Class - */ - template (value) GnNonSecuredPacket m_geoNwUnicastPacket_with_payload( - in template (value) LongPosVector p_sourceLongPosVec, - in template (value) ShortPosVector p_destinationShortPosVec, - in template (value) UInt16 p_seqNumber, - in template (value) UInt8 p_hopLimit := c_defaultHopLimit, - in template (value) TrafficClass p_trafficClass := m_trafficClass, - in template (value) GnRawPayload p_payload - ) := { - commonHeader := valueof(m_commonHeader( - PX_GN_UPPER_LAYER, - m_geoUnicastHeaderType, - p_trafficClass, - p_hopLimit - )), - extendedHeader := valueof(m_geoUnicastHeader( - p_sourceLongPosVec, - p_destinationShortPosVec, - p_seqNumber - )), - payload := valueof(p_payload) - } - - /** - * @desc Receive template for GeoNetworking Unicast Packet - * @param p_destinationShortPosVec Short position vector of destination - * @param p_seqNumber Sequence number of GeoUnicast packet - */ - template (present) GnNonSecuredPacket mw_geoNwUnicastPacket( - template (present) ShortPosVector p_destinationShortPosVec, - template (present) UInt16 p_seqNumber - ) := { - commonHeader := mw_commonHeader( - PX_GN_UPPER_LAYER, - mw_geoUnicastHeaderType - ), - extendedHeader := mw_geoUnicastHeader( - p_destinationShortPosVec, - p_seqNumber - ), - payload := * - } - - /** - * @desc Receive template for GeoNetworking Unicast Packet - * @param p_destinationShortPosVec Short position vector of destination - * @param p_seqNumber Sequence number of GeoUnicast packet - * @param p_hopLimit Maximum number of hops (Default: ?) - * @see mw_geoNwUnicastPacket - */ - template (present) GnNonSecuredPacket mw_geoNwUnicastPacketWithHl( - template (present) ShortPosVector p_destinationShortPosVec, - template (present) UInt16 p_seqNumber, - template (present) UInt8 p_hopLimit := ? - ) modifies mw_geoNwUnicastPacket := { - commonHeader := mw_commonHeaderWithHopLimit( - PX_GN_UPPER_LAYER, - mw_geoUnicastHeaderType, - p_hopLimit - ), - extendedHeader := mw_geoUnicastHeader( - p_destinationShortPosVec, - p_seqNumber - ), - payload := ? - } - - /** - * @desc Receive template for GeoNetworking Unicast Packet - * @param p_destinationShortPosVec Short position vector of destination - * @param p_seqNumber Sequence number of GeoUnicast packet - * @param p_srcLongPosVec Long position vector of source - */ - template (present) GnNonSecuredPacket mw_geoNwUnicastPacketWithSourcePv( - template (present) ShortPosVector p_destinationShortPosVec, - template (present) UInt16 p_seqNumber, - template (present) LongPosVector p_srcLongPosVec - ) modifies mw_geoNwUnicastPacket := { - extendedHeader := mw_geoUnicastHeaderWithSourcePv( - p_destinationShortPosVec, - p_seqNumber, - p_srcLongPosVec - ) - } - - /** - * @desc Receive template for GeoNetworking Unicast Packet - * @param p_destinationShortPosVec Short position vector of destination - * @param p_seqNumber Sequence number of GeoUnicast packet - * @param p_nextHeader Id of next header - */ - template (present) GnNonSecuredPacket mw_geoNwUnicastPacketWithNextHeader( - template (present) ShortPosVector p_destinationShortPosVec, - template (present) UInt16 p_seqNumber, - template (present) NextHeader p_nextHeader - ) modifies mw_geoNwUnicastPacket := { - commonHeader := { - nextHeader := p_nextHeader - } - } - - } // end group geoNwPacketUnicastTemplates - - group geoNwPacketAnycastTemplates { - - /** - * @desc Send template for GeoNetworking Anycast Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_seqNumber Sequence number of GeoAnycast packet - * @param p_anycastArea Destination GeoArea - * @param p_hopLimit Maximum number of hops (Default: c_defaultHopLimit) - * @param p_trafficClass Traffic Class - */ - template (value) GnNonSecuredPacket m_geoNwAnycastPacket( - in template (value) LongPosVector p_sourceLongPosVec, - in template (value) UInt16 p_seqNumber, - in template (value) GeoAnycastArea p_anycastArea, - in template (value) UInt8 p_hopLimit := c_defaultHopLimit, - in template (value) TrafficClass p_trafficClass := m_trafficClass - ) := { - commonHeader := valueof(m_commonHeader( - PX_GN_UPPER_LAYER, - m_geoAnycastHeaderType(valueof(p_anycastArea.geoAnycastSubType)), - p_trafficClass, - p_hopLimit - )), - extendedHeader := valueof(m_geoAnycastHeader( - p_sourceLongPosVec, - p_seqNumber, - p_anycastArea - )), - payload := valueof(char2oct("DEFAULT_PAYLOAD")) - } - - /** - * @desc Receive template for GeoNetworking Anycast Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_seqNumber Sequence number of GeoAnycast packet - */ - template (present) GnNonSecuredPacket mw_geoNwAnycastPacket( - template (present) LongPosVector p_sourceLongPosVec := ?, - template (present) UInt16 p_seqNumber := ? - ) := { - commonHeader := mw_commonHeader( - PX_GN_UPPER_LAYER, - mw_geoAnycastHeaderType - ), - extendedHeader := mw_geoAnycastHeader( - p_sourceLongPosVec, - p_seqNumber - ), - payload := ? - } - - /** - * @desc Receive template for GeoNetworking Anycast Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_seqNumber Sequence number of GeoAnycast packet - * @param p_anycastArea Destination GeoArea - */ - template (present) GnNonSecuredPacket mw_geoNwAnycastPacketWithArea( - template (present) LongPosVector p_sourceLongPosVec := ?, - template (present) UInt16 p_seqNumber := ?, - template (present) GeoAnycastArea p_anycastArea := ? - ) := { - commonHeader := mw_commonHeader( - PX_GN_UPPER_LAYER, - mw_geoAnycastHeaderTypeWithSubType(p_anycastArea.geoAnycastSubType) - ), - extendedHeader := mw_geoAnycastHeaderWithArea( - p_sourceLongPosVec, - p_seqNumber, - p_anycastArea - ), - payload := ? - } - - /** - * @desc Receive template for GeoNetworking Anycast Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_seqNumber Sequence number of GeoAnycast packet - * @param p_anycastArea Destination GeoArea - * @param p_maxHopLimit Maximum number of hops (Default := ?) - */ - template (present) GnNonSecuredPacket mw_geoNwAnycastPacketWithAreaAndHl( - template (present) LongPosVector p_sourceLongPosVec, - template (present) UInt16 p_seqNumber, - template (present) GeoAnycastArea p_anycastArea, - template (present) UInt8 p_maxHopLimit := ? - ) modifies mw_geoNwAnycastPacketWithArea := { - commonHeader := mw_commonHeaderWithHopLimit( - PX_GN_UPPER_LAYER, - mw_geoAnycastHeaderTypeWithSubType(p_anycastArea.geoAnycastSubType), - p_maxHopLimit - ) - } - - /** - * @desc Receive template for GeoNetworking Anycast Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_seqNumber Sequence number of GeoAnycast packet - * @param p_anycastArea Destination GeoArea - * @param p_nextHeader Id of next header - */ - template (present) GnNonSecuredPacket mw_geoNwAnycastPacketWithAreaWithNextHeader( - template (present) LongPosVector p_sourceLongPosVec, - template (present) UInt16 p_seqNumber, - template (present) GeoAnycastArea p_anycastArea, - template (present) NextHeader p_nextHeader - ) modifies mw_geoNwAnycastPacketWithArea := { - commonHeader := { - nextHeader := p_nextHeader - } - } - - } // end group geoNwPacketAnycastTemplates - - group geoNwPacketBroadcastTemplates { - - /** - * @desc Send template for GeoNetworking Broadcast Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_seqNumber Sequence number of GeoBroadcast packet - * @param p_broadcastArea Destination GeoArea - * @param p_hopLimit Maximum number of hops (Default: c_defaultHopLimit) - * @param p_trafficClass Traffic Class - */ - template (value) GnNonSecuredPacket m_geoNwBroadcastPacket( - in template (value) LongPosVector p_sourceLongPosVec, - in template (value) UInt16 p_seqNumber, - in template (value) GeoBroadcastArea p_broadcastArea, - in template (value) UInt8 p_hopLimit := c_defaultHopLimit, - in template (value) TrafficClass p_trafficClass := m_trafficClass - ) := { - commonHeader := valueof(m_commonHeader( - PX_GN_UPPER_LAYER, - m_geoBroadcastHeaderType(valueof(p_broadcastArea.geoBroadcastSubType)), - p_trafficClass, - p_hopLimit - )), - extendedHeader := valueof(m_geoBroadcastHeader( - p_sourceLongPosVec, - p_seqNumber, - p_broadcastArea - )), - payload := valueof(char2oct("DEFAULT_PAYLOAD")) - } - - /** - * @desc Receive template for GeoNetworking Broadcast Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_seqNumber Sequence number of GeoBroadcast packet - */ - template (present) GnNonSecuredPacket mw_geoNwBroadcastPacket( - template (present) LongPosVector p_sourceLongPosVec := ?, - template (present) UInt16 p_seqNumber := ? - ) := { - commonHeader := mw_commonHeader( - PX_GN_UPPER_LAYER, - mw_geoBroadcastHeaderType - ), - extendedHeader := mw_geoBroadcastHeader( - p_sourceLongPosVec, - p_seqNumber - ), - payload := * - } - - /** - * @desc Receive template for GeoNetworking Broadcast Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_seqNumber Sequence number of GeoBroadcast packet - * @param p_nextHeader Id of next header - */ - template (present) GnNonSecuredPacket mw_geoNwBroadcastPacketWithNextHeader( - template (present) LongPosVector p_sourceLongPosVec, - template (present) UInt16 p_seqNumber, - template (present) NextHeader p_nextHeader - ) modifies mw_geoNwBroadcastPacket := { - commonHeader := mw_commonHeader( - p_nextHeader, - mw_geoBroadcastHeaderType - ) - } - - /** - * @desc Receive template for GeoNetworking Broadcast Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_seqNumber Sequence number of GeoBroadcast packet - * @param p_nextHeader Id of next header - * @param p_payload payload - */ - template (present) GnNonSecuredPacket mw_geoNwBroadcastPacketWithNextHeaderAndPayload( - template (present) LongPosVector p_sourceLongPosVec, - template (present) UInt16 p_seqNumber, - template (present) NextHeader p_nextHeader, - template (present) GnRawPayload p_payload - ) modifies mw_geoNwBroadcastPacketWithNextHeader := { - payload := p_payload - } - - /** - * @desc Receive template for GeoNetworking Broadcast Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_seqNumber Sequence number of GeoBroadcast packet - * @param p_broadcastArea Destination GeoArea - */ - template (present) GnNonSecuredPacket mw_geoNwBroadcastPacketWithArea( - template (present) LongPosVector p_sourceLongPosVec, - template (present) UInt16 p_seqNumber, - template (present) GeoBroadcastArea p_broadcastArea - ) modifies mw_geoNwBroadcastPacket := { - commonHeader := mw_commonHeader( - PX_GN_UPPER_LAYER, - mw_geoBroadcastHeaderTypeWithSubType(p_broadcastArea.geoBroadcastSubType) - ), - extendedHeader := mw_geoBroadcastHeaderWithArea( - p_sourceLongPosVec, - p_seqNumber, - p_broadcastArea - ) - } - - /** - * @desc Receive template for GeoNetworking Broadcast Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_seqNumber Sequence number of GeoBroadcast packet - * @param p_broadcastArea Destination GeoArea - * @param p_maxHopLimit Maximum number of hops (Default := ?) - */ - template (present) GnNonSecuredPacket mw_geoNwBroadcastPacketWithAreaAndHl( - template (present) LongPosVector p_sourceLongPosVec, - template (present) UInt16 p_seqNumber, - template (present) GeoBroadcastArea p_broadcastArea, - template (present) UInt8 p_maxHopLimit := ? - ) modifies mw_geoNwBroadcastPacketWithArea := { - commonHeader := mw_commonHeaderWithHopLimit( - PX_GN_UPPER_LAYER, - mw_geoBroadcastHeaderTypeWithSubType(p_broadcastArea.geoBroadcastSubType), - p_maxHopLimit - ) - } - - /** - * @desc Receive template for GeoNetworking Broadcast Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_seqNumber Sequence number of GeoBroadcast packet (Default: ?) - * @param p_hopLimit Maximum number of hops (Default: ?) - * @param p_flags Flags in the common header (Default: ?) - */ - template (present) GnNonSecuredPacket mw_geoNwBroadcastPacketWithHlAndFlags( - template (present) LongPosVector p_sourceLongPosVec, - template (present) UInt16 p_seqNumber := ?, - template (present) UInt8 p_hopLimit := ?, - template (present) Bit8 p_flags := ? - ) modifies mw_geoNwBroadcastPacket := { - commonHeader := mw_commonHeaderWithHopLimitAndFlags( - PX_GN_UPPER_LAYER, - mw_geoBroadcastHeaderType, - p_hopLimit, - p_flags - ) - } - - /** - * @desc Receive template for GeoNetworking Broadcast Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_seqNumber Sequence number of GeoBroadcast packet - * @param p_broadcastArea Destination GeoArea - */ - template (present) GnNonSecuredPacket mw_geoNwBroadcastPacketWithAreaWithNextHeader( - template (present) LongPosVector p_sourceLongPosVec, - template (present) UInt16 p_seqNumber, - template (present) GeoBroadcastArea p_broadcastArea, - template (present) NextHeader p_nextHeader - ) modifies mw_geoNwBroadcastPacketWithArea := { - commonHeader := { - nextHeader := p_nextHeader - } - } - - } // end group geoNwPacketBroadcastTemplates - - group geoNwPacketLsTemplates { - - /** - * @desc Send template for GeoNetworking LS Request Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_seqNumber Sequence number of LS Request packet - * @param p_gnAddress Searched GN_Address - */ - template (value) GnNonSecuredPacket m_geoNwLsRequestPacket( - in template (value) LongPosVector p_sourceLongPosVec, - in template (value) UInt16 p_seqNumber, - in template (value) GN_Address p_gnAddress - ) := { - commonHeader := m_commonHeader( - e_any, - m_lsRequestHeaderType, - m_trafficClass, - c_defaultHopLimit - ), - extendedHeader := m_lsRequestHeader( - p_sourceLongPosVec, p_seqNumber, p_gnAddress - ), - payload := omit - } - - /** - * @desc Receive template for GeoNetworking LS Request Packet - * @param p_seqNumber Sequence number of LS Request packet - * @param p_mid Searched GN_Address MID - */ - template (present) GnNonSecuredPacket mw_geoNwLsRequestPacket( - template (present) UInt16 p_seqNumber := ?, - template (present) GN_Address.mid p_mid := ? - ) := { - commonHeader := mw_commonHeader( - e_any, - m_lsRequestHeaderType - ), - extendedHeader := mw_lsRequestHeader( - p_seqNumber, - p_mid - ), - payload := omit - } - - /** - * @desc Send template for GeoNetworking LS Reply Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_destinationLongPosVec Long position vector of destination - * @param p_seqNumber Sequence number of LS Reply packet - */ - template (value) GnNonSecuredPacket m_geoNwLsReplyPacket( - in template (value) LongPosVector p_sourceLongPosVec, - in template (value) ShortPosVector p_destinationLongPosVec, - in template (value) UInt16 p_seqNumber - ) := { - commonHeader := m_commonHeader( - e_any, - m_lsReplyHeaderType, - m_trafficClass, - c_defaultHopLimit - ), - extendedHeader := m_lsReplyHeader( - p_sourceLongPosVec, p_destinationLongPosVec, p_seqNumber - ), - payload := omit - } - - /** - * @desc Receive template for GeoNetworking LS Reply Packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_destinationLongPosVec Short position vector of destination - */ - template (present) GnNonSecuredPacket mw_geoNwLsReplyPacket( - template (present) LongPosVector p_sourceLongPosVec := ?, - template (present) ShortPosVector p_destinationLongPosVec := ? - ) := { - commonHeader := mw_commonHeader( - e_any, - m_lsReplyHeaderType - ), - extendedHeader := mw_lsReplyHeader( - p_sourceLongPosVec, p_destinationLongPosVec - ), - payload := omit - } - - } // end group geoNwPacketLsTemplates - - group geoNwPacketBeaconTemplates { - - /** - * @desc Send template for GeoNetworking Beacon Packet - * @param p_sourceLongPosVec Long position vector of source - */ - template (value) GnNonSecuredPacket m_geoNwBeaconPacket( - in template (value) LongPosVector p_sourceLongPosVec - ) := { - commonHeader := m_commonHeader( - e_any, - m_beaconHeaderType, - m_trafficClass, - c_hopLimit1 - ), - extendedHeader := m_beaconHeader( - p_sourceLongPosVec - ), - payload := omit - } - - /** - * @desc Receive template for GeoNetworking Beacon Packet - * - * @param p_sourceLongPosVec Long position vector of source (Default: ?) - * @param p_nextHeader Next header (Default: e_any) - */ - template (present) GnNonSecuredPacket mw_geoNwBeaconPacket( - template (present) LongPosVector p_sourceLongPosVec := ?, - template (present) NextHeader p_nextHeader := e_any - ) := { - commonHeader := mw_commonHeader_noPayload( - p_nextHeader, - m_beaconHeaderType - ), - extendedHeader := mw_beaconHeader(p_sourceLongPosVec), - payload := '00000000000000000000'O ifpresent //(*, '00000000000000000000'O) - } - - } // end group geoNwPacketBeaconTemplates - - group geoNwPacketShbTemplates { - - /** - * @desc Send template for GeoNetworking SHB Packet - * @param p_sourceLongPosVec Long position vector of source - */ - template (value) GnNonSecuredPacket m_geoNwShbPacket( - in template (value) LongPosVector p_sourceLongPosVec - ) := { - commonHeader := valueof(m_commonHeader( - PX_GN_UPPER_LAYER, - m_shbHeaderType, - m_trafficClass, - c_defaultHopLimit - )), - extendedHeader := valueof(m_shbHeader( - p_sourceLongPosVec - )), - payload := valueof(char2oct("DEFAULT_PAYLOAD")) - } - - /** - * @desc Receive template for GeoNetworking SHB Packet - * @param p_sourceLongPosVec Long position vector of source (Default: ?) - * @param p_hopLimit Maximum number of hops (Default: ?) - */ - template (present) GnNonSecuredPacket mw_geoNwShbPacket( - template (present) LongPosVector p_sourceLongPosVec := ?, - template (present) UInt8 p_hopLimit := ? - ) := { - commonHeader := mw_commonHeaderWithHopLimit( - PX_GN_UPPER_LAYER, - m_shbHeaderType, - p_hopLimit - ), - extendedHeader := mw_shbHeader(p_sourceLongPosVec), - payload := * - } - - } // end group geoNwPacketShbTemplates - - group geoNwPacketTsbTemplates { - - /** - * @desc Send template for GeoNetworking TSB Packet - * @param p_seqNumber Sequence number of TSB packet - * @param p_sourceLongPosVec Long position vector of source - * @param p_hopLimit The maximum number of hops (Default: c_defaultHopLimit) - */ - template (value) GnNonSecuredPacket m_geoNwTsbPacket( - in template (value) UInt16 p_seqNumber, - in template (value) LongPosVector p_sourceLongPosVec, - in template (value) UInt8 p_hopLimit := c_defaultHopLimit, - in template (value) TrafficClass p_trafficClass := m_trafficClass - ) := { - commonHeader := valueof(m_commonHeader( - PX_GN_UPPER_LAYER, - m_tsbHeaderType, - p_trafficClass, - p_hopLimit - )), - extendedHeader := valueof(m_tsbHeader( - p_seqNumber, - p_sourceLongPosVec - )), - payload := valueof(char2oct("DEFAULT_PAYLOAD")) - } - - /** - * @desc Receive template for GeoNetworking TSB Packet - * @param p_seqNumber Sequence number of TSB packet (Default: ?) - * @param p_sourceLongPosVec Long position vector of source (Default: ?) - */ - template (present) GnNonSecuredPacket mw_geoNwTsbPacket( - template (present) UInt16 p_seqNumber := ?, - template (present) LongPosVector p_sourceLongPosVec := ? - ) := { - commonHeader := mw_commonHeader( - PX_GN_UPPER_LAYER, - m_tsbHeaderType - ), - extendedHeader := mw_tsbHeader(p_seqNumber, p_sourceLongPosVec), - payload := * - } - - /** - * @desc Receive template for GeoNetworking TSB Packet - * @param p_seqNumber Sequence number of TSB packet (Default: ?) - * @param p_sourceLongPosVec Long position vector of source (Default: ?) - * @param p_hopLimit The maximum number of hops (Default: ?) - */ - template (present) GnNonSecuredPacket mw_geoNwTsbPacketWithHl( - template (present) UInt16 p_seqNumber := ?, - template (present) LongPosVector p_sourceLongPosVec := ?, - template (present) UInt8 p_hopLimit := ? - ) modifies mw_geoNwTsbPacket := { - commonHeader := mw_commonHeaderWithHopLimit( - PX_GN_UPPER_LAYER, - m_tsbHeaderType, - p_hopLimit - ) - } - - /** - * @desc Receive template for GeoNetworking TSB Packet - * @param p_seqNumber Sequence number of TSB packet (Default: ?) - * @param p_sourceLongPosVec Long position vector of source (Default: ?) - * @param p_nextHeader Id of next header - */ - template (present) GnNonSecuredPacket mw_geoNwTsbPacketWithNextHeader( - template (present) UInt16 p_seqNumber := ?, - template (present) LongPosVector p_sourceLongPosVec := ?, - in template (value) NextHeader p_nextHeader - ) modifies mw_geoNwTsbPacket := { - commonHeader := { - nextHeader := p_nextHeader - } - } - - } // end group geoNwPacketTsbTemplates - - } // end group geoNwPacketTemplates - - group geoNwHeadersTemplates { - - group geoNwBasicHeaderTemplates { - - /** - * @desc Send template for Basic header - * - * @param p_lifeTime Lifetime of GeoNetworking message - * @param p_hopLimit Router Hop limit of GeoNetworking message - */ - template (value) BasicHeader m_basicHeader( - in template (value) Lifetime p_lifeTime := m_defaultLifetime, - in template (value) UInt8 p_hopLimit := c_defaultHopLimit - ) := { - version := c_geoNwProtocolVersion, - nextHeader := e_commonHeader, - reserved := 0, - lifeTime := p_lifeTime, - routerHopLimit := p_hopLimit - } - - /** - * @desc Receive template for Basic header - * - * @param p_lifeTime Lifetime of GeoNetworking message - * @param p_hopLimit Router Hop limit of GeoNetworking message - */ - template (present) BasicHeader mw_basicHeader( - template (present) Lifetime p_lifeTime := ?, - template (present) UInt8 p_hopLimit := ? - ) := { - version := c_geoNwProtocolVersion, - nextHeader := ?, - reserved := ?, - lifeTime := p_lifeTime, - routerHopLimit := p_hopLimit - } - - /** - * @desc Send template for Secured Basic header - * - * @param p_lifeTime Lifetime of GeoNetworking message - * @param p_hopLimit Router Hop limit of GeoNetworking message - */ - template (value) BasicHeader m_securedBasicHeader( - in template (value) Lifetime p_lifeTime := { - multiplier := c_defaultLifetime, - ltBase := e_100s - }/*FIXME Bug TITAN ? m_defaultLifetime*/, - in template (value) UInt8 p_hopLimit := c_defaultHopLimit - ) := { - version := c_geoNwProtocolVersion, - nextHeader := e_securedPacket, - reserved := 0, - lifeTime := p_lifeTime, - routerHopLimit := p_hopLimit - } // End of template m_securedBasicHeader - - /** - * @desc Receive template for Secured Basic header - * - * @param p_lifeTime Lifetime of GeoNetworking message - * @param p_hopLimit Router Hop limit of GeoNetworking message - */ - template (present) BasicHeader mw_securedBasicHeader( - template (present) Lifetime p_lifeTime := ?, - template (present) UInt8 p_hopLimit := ? - ) := { - version := c_geoNwProtocolVersion, - nextHeader := e_securedPacket, - reserved := ?, - lifeTime := p_lifeTime, - routerHopLimit := p_hopLimit - } // End of template mw_securedBasicHeader - - /** - * @desc Default send template for Lifetime field - */ - template (value) Lifetime m_defaultLifetime := { - multiplier := c_defaultLifetime, - ltBase := e_100s - } - - /** - * @desc Send template for Lifetime field (Base = 1s) - */ - template (value) Lifetime m_lifetimeBase1s( - in template (value) UInt6 p_multiplier - ) := { - multiplier := p_multiplier, - ltBase := e_1s - } - - /** - * @desc Receive template for lifetime 0 - */ - template (present) Lifetime mw_lifetime0 := { - multiplier := 0, - ltBase := ? - } - - } //end group geoNwBasicHeaderTemplates - - group geoNwCommonHeaderTemplates { - - /** - * @desc Send template for Common header - * @param p_nextHeader Id of next header - * @param p_trafficClass Packet's traffic class - * @param p_headerTypeSubType Header's type and sub-type - * @param p_hopLimit Maximum number of hops - * @remark plLength field is set to 0 and has to be computed by codec - */ - template (value) CommonHeader m_commonHeader ( - in template (value) NextHeader p_nextHeader, - in template (value) HeaderTST p_headerTypeSubType, - in template (value) TrafficClass p_trafficClass, - in template (value) UInt8 p_hopLimit - ) := { - nextHeader := p_nextHeader, - reserved := c_uInt8Zero, - headerTST := p_headerTypeSubType, - trafficClass := p_trafficClass, - flags := c_8ZeroBits, - plLength := 0, // will be computed by Codec - maxHopLimit := p_hopLimit, - reserved2 := 0 - } - - /** - * @desc Receive template for Common header - * @param p_nextHeader Id of next header - * @param p_headerTypeSubType Header's type and sub-type - */ - template (present) CommonHeader mw_commonHeader ( - template (present) NextHeader p_nextHeader := ?, - template (present) HeaderTST p_headerTypeSubType := ? - ) := { - nextHeader := p_nextHeader, - reserved := ?, - headerTST := p_headerTypeSubType, - trafficClass := ?, - flags := ?, - plLength := ?, - maxHopLimit := ?, - reserved2 := ? - } - - /** - * @desc Receive template for Common header with no payload - * @param p_nextHeader Id of next header - * @param p_headerTypeSubType Header's type and sub-type - */ - template (present) CommonHeader mw_commonHeader_noPayload ( - template (present) NextHeader p_nextHeader := ?, - template (present) HeaderTST p_headerTypeSubType := ? - ) modifies mw_commonHeader := { - plLength := 0 - } - - /** - * @desc Receive template for Common header with specific Hop limit - * @param p_nextHeader Id of next header - * @param p_headerTypeSubType Header's type and sub-type - * @param p_hopLimit Maximum number of hops - * @see mw_commonHeader - */ - template (present) CommonHeader mw_commonHeaderWithHopLimit ( - template (present) NextHeader p_nextHeader := ?, - template (present) HeaderTST p_headerTypeSubType := ?, - template (present) UInt8 p_hopLimit := ? - ) modifies mw_commonHeader := { - maxHopLimit := p_hopLimit - } - - /** - * @desc Receive template for Common header with specific Hop limit - * @param p_senderLongPosVec Long position vector of sender - * @param p_nextHeader Id of next header - * @param p_headerTypeSubType Header's type and sub-type - * @param p_hopLimit Maximum number of hops - * @param p_flags Flags in the common header - * @see mw_commonHeaderWithHopLimit - */ - template (present) CommonHeader mw_commonHeaderWithHopLimitAndFlags ( - template (present) NextHeader p_nextHeader := ?, - template (present) HeaderTST p_headerTypeSubType := ?, - template (present) UInt8 p_hopLimit := ?, - template (present) Bit8 p_flags := ? - ) modifies mw_commonHeaderWithHopLimit := { - flags := p_flags - } - - /** - * @desc Receive template for Common header with specific Traffic Class - * @param p_senderLongPosVec Long position vector of sender - * @param p_nextHeader Id of next header - * @param p_headerTypeSubType Header's type and sub-type - * @param p_trafficClass Packet's traffic class - */ - template (present) CommonHeader mw_commonHeaderWithTrafficClass ( - template (present) NextHeader p_nextHeader := ?, - template (present) HeaderTST p_headerTypeSubType := ?, - template (present) TrafficClass p_trafficClass := ? - ) modifies mw_commonHeader := { - trafficClass := p_trafficClass - } - - /** - * @desc Default send template for traffic class - */ - template (value) TrafficClass m_trafficClass ( in SCF p_scf := e_scfEnabled, in ChannelOffload p_ChOff := e_choffDisabled ) := { - scf := p_scf, - channelOffload := p_ChOff, - tcId := 0 - } - - /** - * @desc Receive template for traffic class - */ - template TrafficClass mw_trafficClass ( in template(present) SCF p_scf := ?, in template(present) ChannelOffload p_ChOff := ? ) := { - scf := p_scf, - channelOffload := p_ChOff, - tcId := ? - } - - /** - * @desc Receive template for any GN_Address - */ - template GN_Address mw_gnAddressAny := { - typeOfAddress := ?, - stationType := ?, - reserved := ?, - mid := ? - } - - /** - * @desc Receive template for GN_Address - * @param p_stationType Station's type - * @param p_reserved Station's country code - */ - template GN_Address mw_gnAddress( - template (present) StationType p_stationType, - template (present) UInt10 p_reserved - ) := { - typeOfAddress := ?, - stationType := p_stationType, - reserved := p_reserved, - mid := ? - } - - /** - * @desc Receive template for long position vector with specific GN_Address - * @param p_gnAddress GN_Address to be contained in the long position vector - */ - template (present) LongPosVector mw_longPosVectorAny( - template (present) GN_Address p_gnAddress := ? - ) := { - gnAddr := p_gnAddress, - timestamp_ := ?, - latitude := ?, - longitude := ?, - pai := ?, - speed := ?, - heading := ? - } - - /** - * @desc Receive template for long position vector with strict position check - * @param p_longPosVector The base long position vector - */ - template (present) LongPosVector mw_longPosVectorPosition( - template (present) LongPosVector p_longPosVector := ? - ) := { - gnAddr := p_longPosVector.gnAddr, - timestamp_ := ?, - latitude := f_getDelta32(valueof(p_longPosVector.latitude), PX_POS_DELTA), - longitude := f_getDelta32(valueof(p_longPosVector.longitude), PX_POS_DELTA), - pai := ?, - //FIXME May the delta factor should be based on the actual speed value -> low speed=lower delta, high speed=higher delta - speed := f_getDelta15(valueof(p_longPosVector.speed), float2int(int2float(valueof(p_longPosVector.speed)) * 0.03)), - heading := p_longPosVector.heading - } - - /** - * @desc Receive template for short position vector with strict position check - * @param p_shortPosVector The base short position vector - */ - template (present) ShortPosVector mw_shortPosVectorPosition( - template (present) ShortPosVector p_shortPosVector := ? - ) := { - gnAddr := p_shortPosVector.gnAddr, - timestamp_ := ?, - latitude := f_getDelta32(valueof(p_shortPosVector.latitude), PX_POS_DELTA), - longitude := f_getDelta32(valueof(p_shortPosVector.longitude), PX_POS_DELTA) - } - - /** - * @desc Receive template for short position vector without position check - * @param p_shortPosVector The base short position vector - */ - template (present) ShortPosVector mw_shortPosVectorPosition_anyPos( - template (present) ShortPosVector p_shortPosVector := ? - ) modifies mw_shortPosVectorPosition := { - latitude := ?, - longitude := ? - } - - function f_getDelta32(Int32 p_value, integer p_delta) return template (present) Int32 { - if (p_value == c_int32Min) { - return (p_value .. p_value+p_delta); - } - if (p_value == c_int32Max) { - return (p_value-p_delta .. p_value); - } - return (p_value-p_delta .. p_value+p_delta); - } - - function f_getDelta15(Int32 p_value, integer p_delta) return template (present) Int15 { - log(">>> f_getDelta15: ", p_value, ", ", p_delta); - - if (p_value == c_int15Min) { - return (p_value .. p_value+p_delta); - } - if (p_value == c_int15Max) { - return (p_value-p_delta .. p_value); - } - return (p_value-p_delta .. p_value+p_delta); - } - - } // end geoNwCommonHeaderTemplates - - group geoUnicastHeaderTemplates { - - /** - * @desc Send template for GeoUnicast header - * @param p_sourceLongPosVec Long position vector of source - * @param p_destinationLongPosVec Long position vector of destination - * @param p_seqNumber Sequence number of GeoUnicast packet - */ - template (value) ExtendedHeader m_geoUnicastHeader( - in template (value) LongPosVector p_sourceLongPosVec, - in template (value) ShortPosVector p_destinationLongPosVec, - in template (value) UInt16 p_seqNumber - ) := { - geoUnicastHeader := { - seqNumber := p_seqNumber, - reserved := c_uInt8Zero, - srcPosVector := p_sourceLongPosVec, - dstPosVector := p_destinationLongPosVec - } - } - - /** - * @desc Receive template for GeoUnicast header - * @param p_senderLongPosVec Long position vector of sender - * @param p_destinationShortPosVec Long position vector of destination - * @param p_seqNumber Sequence number of GeoUnicast packet - */ - template (present) ExtendedHeader mw_geoUnicastHeader( - template (present) ShortPosVector p_destinationShortPosVec := ?, - template (present) UInt16 p_seqNumber := ? - ) := { - geoUnicastHeader := { - seqNumber := p_seqNumber, - reserved := ?, - srcPosVector := ?, - dstPosVector := p_destinationShortPosVec - } - } - - /** - * @desc Receive template for GeoUnicast header with source long position vector - * @param p_destinationShortPosVec Long position vector of destination - * @param p_seqNumber Sequence number of GeoUnicast packet - * @param p_srcLongPosVec Long position vector of source - * @see mw_geoUnicastHeader - */ - template (present) ExtendedHeader mw_geoUnicastHeaderWithSourcePv( - template (present) ShortPosVector p_destinationShortPosVec := ?, - template (present) UInt16 p_seqNumber := ?, - template (present) LongPosVector p_srcLongPosVec := ? - ) modifies mw_geoUnicastHeader := { - geoUnicastHeader := { - srcPosVector := p_srcLongPosVec - } - } - - /** - * @desc Send template for GeoUnicast header type - */ - template (value) HeaderTST m_geoUnicastHeaderType := { - geoUnicastHdr := { - headerType := e_geoUnicast, - headerSubType := c_uInt4Zero - } - } - - /** - * @desc Receive template for GeoUnicast header type - */ - template HeaderTST mw_geoUnicastHeaderType := { - geoUnicastHdr := { - headerType := e_geoUnicast, - headerSubType := c_uInt4Zero - } - } - - } // end geoUnicastHeaderTemplates - - group geoBroadcastHeaderTemplates { - - /** - * @desc Send template for GeoBroadcast header - * @param p_sourceLongPosVec Long position vector of source - * @param p_seqNumber Sequence number of GeoBroadcast packet - * @param p_broadcastArea Destination GeoArea - */ - template (value) ExtendedHeader m_geoBroadcastHeader( - in template (value) LongPosVector p_sourceLongPosVec, - in template (value) UInt16 p_seqNumber, - in template (value) GeoBroadcastArea p_broadcastArea - ) := { - geoBroadcastHeader := { - seqNumber := valueof(p_seqNumber), - reserved := c_uInt8Zero, - srcPosVector := valueof(p_sourceLongPosVec), - geoAreaPosLatitude := valueof(p_broadcastArea.geoBroadcastArea.geoAreaPosLatitude), - geoAreaPosLongitude := valueof(p_broadcastArea.geoBroadcastArea.geoAreaPosLongitude), - distanceA := valueof(p_broadcastArea.geoBroadcastArea.distanceA), - distanceB := valueof(p_broadcastArea.geoBroadcastArea.distanceB), - angle := valueof(p_broadcastArea.geoBroadcastArea.angle), - reserved2 := c_uInt24Zero - } - } - - /** - * @desc Receive template for GeoBroadcast header for any GeoArea - * @param p_sourceLongPosVec Long position vector of source - * @param p_senderLongPosVec Long position vector of sender - * @param p_seqNumber Sequence number of GeoBroadcast packet - */ - template (present) ExtendedHeader mw_geoBroadcastHeader( - template (present) LongPosVector p_sourceLongPosVec := ?, - template (present) UInt16 p_seqNumber := ? - ) := { - geoBroadcastHeader := { - seqNumber := p_seqNumber, - reserved := ?, - srcPosVector := p_sourceLongPosVec, - geoAreaPosLatitude := ?, - geoAreaPosLongitude := ?, - distanceA := ?, - distanceB := ?, - angle := ?, - reserved2 := ? - } - } - - /** - * @desc Receive template for GeoBroadcast header - * @param p_sourceLongPosVec Long position vector of source - * @param p_senderLongPosVec Long position vector of sender - * @param p_seqNumber Sequence number of GeoBroadcast packet - * @param p_broadcastArea Destination GeoArea - * @see mw_geoBroadcastHeader - */ - template (present) ExtendedHeader mw_geoBroadcastHeaderWithArea ( - template (present) LongPosVector p_sourceLongPosVec := ?, - template (present) UInt16 p_seqNumber := ?, - template (present) GeoBroadcastArea p_broadcastArea := ? - ) modifies mw_geoBroadcastHeader := { - geoBroadcastHeader := { - geoAreaPosLatitude := p_broadcastArea.geoBroadcastArea.geoAreaPosLatitude, - geoAreaPosLongitude := p_broadcastArea.geoBroadcastArea.geoAreaPosLongitude, - distanceA := p_broadcastArea.geoBroadcastArea.distanceA, - distanceB := p_broadcastArea.geoBroadcastArea.distanceB, - angle := p_broadcastArea.geoBroadcastArea.angle - } - } - - /** - * @desc Send template for GeoBroadcast header type - * @param p_headerSubType Packet's subtype - */ - template (value) HeaderTST m_geoBroadcastHeaderType( - in template (value) HeaderSubTypeGeoBroadcast p_headerSubType - ) := { - geoBroadcastHdr := { - headerType := e_geoBroadcast, - headerSubType := p_headerSubType - } - } - - /** - * @desc Receive template for GeoBroadcast header type - */ - template (present) HeaderTST mw_geoBroadcastHeaderType := { - geoBroadcastHdr := { - headerType := e_geoBroadcast, - headerSubType := ? - } - } - - /** - * @desc Receive template for GeoBroadcast header type with sub-type - * @param p_headerSubType Packet's subtype - * @see mw_geoBroadcastHeaderType - */ - template (present) HeaderTST mw_geoBroadcastHeaderTypeWithSubType( - template (present) HeaderSubTypeGeoBroadcast p_headerSubType := ? - ) modifies mw_geoBroadcastHeaderType := { - geoBroadcastHdr := { - headerSubType := p_headerSubType - } - } - - } // end geoBroadcastHeaderTemplates - - group geoAnycastHeaderTemplates { - - /** - * @desc Send template for GeoAnycast header - * @param p_sourceLongPosVec Long position vector of source - * @param p_seqNumber Sequence number of GeoAnycast packet - * @param p_anycastArea Destination GeoArea - */ - template (value) ExtendedHeader m_geoAnycastHeader( - in template (value) LongPosVector p_sourceLongPosVec, - in template (value) UInt16 p_seqNumber, - in template (value) GeoAnycastArea p_anycastArea - ) := { - geoAnycastHeader := { - seqNumber := valueof(p_seqNumber), - reserved := c_uInt8Zero, - srcPosVector := valueof(p_sourceLongPosVec), - geoAreaPosLatitude := valueof(p_anycastArea.geoAnycastArea.geoAreaPosLatitude), - geoAreaPosLongitude := valueof(p_anycastArea.geoAnycastArea.geoAreaPosLongitude), - distanceA := valueof(p_anycastArea.geoAnycastArea.distanceA), - distanceB := valueof(p_anycastArea.geoAnycastArea.distanceB), - angle := valueof(p_anycastArea.geoAnycastArea.angle), - reserved2 := c_uInt24Zero - } - } - - /** - * @desc Receive template for GeoAnycast header for any GeoArea - * @param p_sourceLongPosVec Long position vector of source - * @param p_senderLongPosVec Long position vector of sender - * @param p_seqNumber Sequence number of GeoAnycast packet - */ - template (present) ExtendedHeader mw_geoAnycastHeader( - template (present) LongPosVector p_sourceLongPosVec := ?, - template (present) UInt16 p_seqNumber := ? - ) := { - geoAnycastHeader := { - seqNumber := p_seqNumber, - reserved := ?, - srcPosVector := p_sourceLongPosVec, - geoAreaPosLatitude := ?, - geoAreaPosLongitude := ?, - distanceA := ?, - distanceB := ?, - angle := ?, - reserved2 := ? - } - } - - /** - * @desc Receive template for GeoAnycast header - * @param p_sourceLongPosVec Long position vector of source - * @param p_senderLongPosVec Long position vector of sender - * @param p_seqNumber Sequence number of GeoAnycast packet - * @param p_anycastArea Destination GeoArea - * @see mw_geoAnycastHeader - */ - template (present) ExtendedHeader mw_geoAnycastHeaderWithArea ( - template (present) LongPosVector p_sourceLongPosVec := ?, - template (present) UInt16 p_seqNumber := ?, - template (present) GeoAnycastArea p_anycastArea := ? - ) modifies mw_geoAnycastHeader := { - geoAnycastHeader := { - geoAreaPosLatitude := p_anycastArea.geoAnycastArea.geoAreaPosLatitude, - geoAreaPosLongitude := p_anycastArea.geoAnycastArea.geoAreaPosLongitude, - distanceA := p_anycastArea.geoAnycastArea.distanceA, - distanceB := p_anycastArea.geoAnycastArea.distanceB, - angle := p_anycastArea.geoAnycastArea.angle - } - } - - /** - * @desc Send template for GeoBroadcast header type with sub-type - * @param p_headerSubType Packet's subtype - */ - template (value) HeaderTST m_geoAnycastHeaderType( - in template (value) HeaderSubTypeGeoAnycast p_headerSubType - ) := { - geoAnycastHdr := { - headerType := e_geoAnycast, - headerSubType := p_headerSubType - } - } - - /** - * @desc Receive template for GeoAnycast header type with any sub-type - */ - template (present)HeaderTST mw_geoAnycastHeaderType := { - geoAnycastHdr := { - headerType := e_geoAnycast, - headerSubType := ? - } - } - - /** - * @desc Receive template for GeoAnycast header type with sub-type - * @param p_headerSubType Packet's subtype - * @see mw_geoAnycastHeaderType - */ - template (present) HeaderTST mw_geoAnycastHeaderTypeWithSubType( - template (present) HeaderSubTypeGeoAnycast p_headerSubType := ? - ) modifies mw_geoAnycastHeaderType := { - geoAnycastHdr := { - headerSubType := p_headerSubType - } - } - - } // end geoAnycastHeaderTemplates - - group lsRequestHeaderTemplates { - - /** - * @desc Send template for LS Request header - * @param p_sourceLongPosVec Long position vector of source - * @param p_seqNumber Sequence number of LS Request packet - * @param p_gnAddress Searched GN_Address - */ - template (value) ExtendedHeader m_lsRequestHeader( - in template (value) LongPosVector p_sourceLongPosVec, - in template (value) UInt16 p_seqNumber, - in template (value) GN_Address p_gnAddress - ) := { - lsRequestHeader := { - seqNumber := p_seqNumber, - reserved := c_uInt8Zero, - srcPosVector := p_sourceLongPosVec, - gnAddress := p_gnAddress - } - } - - /** - * @desc Receive template for LS Request header - * @param p_seqNumber Sequence number of LS Request packet - * @param p_mid Searched GN_Address MID - */ - template (present) ExtendedHeader mw_lsRequestHeader( - template (present) UInt16 p_seqNumber := ?, - template (present) GN_Address.mid p_mid := ? - ) := { - lsRequestHeader := { - seqNumber := p_seqNumber, - reserved := ?, - srcPosVector := ?, - gnAddress := mw_gnAddressMid(p_mid) - } - } - - /** - * @desc Send template for LS Request header type - */ - template (value) HeaderTST m_lsRequestHeaderType := { - lsHdr := { - headerType := e_locationService, - headerSubType := e_lsRequest - } - } - - /** - * @desc Receive template for LS Request header type - */ - template HeaderTST mw_lsRequestHeaderType := { - lsHdr := { - headerType := e_locationService, - headerSubType := e_lsRequest - } - } - - } // end lsRequestHeaderTemplates - - group lsReplyHeaderTemplates { - - /** - * @desc Send template for LS Reply header - * @param p_sourceLongPosVec Long position vector of source - * @param p_destinationLongPosVec Long position vector of destination - * @param p_seqNumber Sequence number of LS Reply packet - */ - template (value) ExtendedHeader m_lsReplyHeader( - in template (value) LongPosVector p_sourceLongPosVec, - in template (value) ShortPosVector p_destinationLongPosVec, - in template (value) UInt16 p_seqNumber - ) := { - lsReplyHeader := { - seqNumber := p_seqNumber, - reserved := c_uInt8Zero, - srcPosVector := p_sourceLongPosVec, - dstPosVector := p_destinationLongPosVec - } - } - - /** - * @desc Receive template for any LS Reply header - */ - template (present) ExtendedHeader mw_lsReplyHeaderAny := { - lsReplyHeader := { - seqNumber := ?, - reserved := ?, - srcPosVector := ?, - dstPosVector := ? - } - } - - /** - * @desc Receive template for LS Reply header - * @param p_sourceLongPosVec Long position vector of source - * @param p_destinationLongPosVec Short position vector of destination - * @see mw_lsReplyHeaderAny - */ - template (present) ExtendedHeader mw_lsReplyHeader( - template (present) LongPosVector p_sourceLongPosVec := ?, - template (present) ShortPosVector p_destinationLongPosVec := ? - ) modifies mw_lsReplyHeaderAny := { - lsReplyHeader := { - srcPosVector := p_sourceLongPosVec, - dstPosVector := p_destinationLongPosVec - } - } - - - /** - * @desc Send template for LS Reply header type - */ - template (value) HeaderTST m_lsReplyHeaderType := { - lsHdr := { - headerType := e_locationService, - headerSubType := e_lsReply - } - } - - } // end lsRequestHeaderTemplates - - group beaconHeaderTemplates { - - /** - * @desc Send template for Beacon header - * @param p_sourceLongPosVec Long position vector of source - */ - template (value) ExtendedHeader m_beaconHeader( - in template (value) LongPosVector p_sourceLongPosVec - ) := { - beaconHeader := { - srcPosVector := p_sourceLongPosVec - } - } - - /** - * @desc Receive template for Beacon header - * @param p_sourceLongPosVec Long position vector of source - */ - template (present) ExtendedHeader mw_beaconHeader( - template (present) LongPosVector p_sourceLongPosVec := ? - ) := { - beaconHeader := { - srcPosVector := p_sourceLongPosVec - } - } - - /** - * @desc Send template for Beacon header type - */ - template (value) HeaderTST m_beaconHeaderType := { - beaconHdr := { - headerType := e_beacon, - headerSubType := c_uInt4Zero - } - } - - /** - * @desc Receive template for Beacon header type - */ - template HeaderTST mw_beaconHeaderType := { - beaconHdr := { - headerType := e_beacon, - headerSubType := ? - } - } - - } // end beaconHeaderTemplates - - group shbHeaderTemplates { - - /** - * @desc Send template for SHB header - * @param p_sourceLongPosVec Long position vector of sender - */ - template (value) ExtendedHeader m_shbHeader( - in template (value) LongPosVector p_sourceLongPosVec - ) := { - shbHeader := { - srcPosVector := p_sourceLongPosVec, - reserved := 0 - } - } - - /** - * @desc Receive template for SHB header - * @param p_sourceLongPosVec Long position vector of sender - */ - template (present) ExtendedHeader mw_shbHeader( - template (present) LongPosVector p_sourceLongPosVec - ) := { - shbHeader := { - srcPosVector:= p_sourceLongPosVec, - reserved := ? - } - } - - /** - * @desc Send template for SHB header type - */ - template (value) HeaderTST m_shbHeaderType := { - tsbHdr := { - headerType := e_topologicallyScopedBroadcast, - headerSubType := e_singleHop - } - } - - } // end shbHeaderTemplates - - group tsbHeaderTemplates { - - /** - * @desc Send template for TSB header - * @param p_seqNumber Sequence number of TSB packet - * @param p_srcPosVector Long position vector of source - */ - template ExtendedHeader m_tsbHeader( - in template (value) UInt16 p_seqNumber, - in template (value) LongPosVector p_srcPosVector - ) := { - tsbHeader := { - seqNumber := p_seqNumber, - reserved := c_uInt8Zero, - srcPosVector := p_srcPosVector - } - } - - /** - * @desc Receive template for TSB header - * @param p_seqNumber Sequence number of TSB packet - * @param p_sourceLongPosVec Long position vector of source - */ - template (present) ExtendedHeader mw_tsbHeader( - template (present) UInt16 p_seqNumber, - template (present) LongPosVector p_sourceLongPosVec - ) := { - tsbHeader := { - seqNumber := p_seqNumber, - reserved := ?, - srcPosVector := p_sourceLongPosVec - } - } - - /** - * @desc Send template for TSB header type - */ - template (value) HeaderTST m_tsbHeaderType := { - tsbHdr := { - headerType := e_topologicallyScopedBroadcast, - headerSubType := e_multiHop - } - } - - /** - * @desc Receive template for TSB header type - */ - template (present) HeaderTST mw_tsbHeaderType := { - tsbHdr := { - headerType := e_topologicallyScopedBroadcast, - headerSubType := e_multiHop - } - } - - } // end tsbHeaderTemplates - - } // end geoNwHeadersTemplates - - group geoMiscTemplates { - - /** - * @desc Receive template for GN_Address. Only M_ID field is discriminent - * @param p_mid Expected GN Address MID - */ - template (present) GN_Address mw_gnAddressMid( - template (present) GN_Address.mid p_mid := ? - ) := { - typeOfAddress := ?, - stationType := ?, - reserved := ?, - mid := p_mid - } - - group geoDummyTemplates { - - /** - * @desc Dummy template for GN_Address - */ - template (value) GN_Address m_dummyGnAddr := { - typeOfAddress := e_manual, - stationType := e_passengerCar, - reserved := c_uInt10Zero, - mid := c_6ZeroBytes - } - - /** - * @desc Dummy template for long position vector - */ - template (value) LongPosVector m_dummyLongPosVector := { - gnAddr := m_dummyGnAddr, - timestamp_ := c_uInt32Zero, - latitude := c_uInt32Zero, - longitude := c_uInt32Zero, - pai := int2bit(1,1), - speed := c_uInt16Zero, - heading := c_uInt16Zero - } - - /** - * @desc Dummy template for Area - */ - template (value) Area m_dummyArea := { - geoAreaPosLatitude := c_uInt32Zero, - geoAreaPosLongitude := c_uInt32Zero, - distanceA := c_uInt16Zero, - distanceB := c_uInt16Zero, - angle := c_uInt16Zero - } - - /** - * @desc Dummy template for GeoBroadcastArea - */ - template (value) GeoBroadcastArea m_dummyGeoBroadcastArea := { - geoBroadcastSubType := e_geoBroadcastRect, - geoBroadcastArea := m_dummyArea - } - - } // end geoDummyTemplates - - } // end geoMiscTemplates - -} // end ItsGeoNetworking_Templates diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn deleted file mode 100644 index 4b46b328..00000000 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn +++ /dev/null @@ -1,180 +0,0 @@ -/** - * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/GeoNetworking/LibItsGeoNetworking_TestSystem.ttcn $ - * $Id: LibItsGeoNetworking_TestSystem.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Test System module for ITS GeoNetworking - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsGeoNetworking_TestSystem { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - import from LibCommon_Sync all; - - // LibItsCommon - import from LibItsCommon_TestSystem all; - import from LibItsCommon_TypesAndValues all; - import from LibItsExternal_TypesAndValues all; - - // LibItsGeoNetworking - import from LibItsGeoNetworking_TypesAndValues all; - - // LibItsSecurity - import from LibItsSecurity_TestSystem all; - - import from LibItsIpv6OverGeoNetworking_TypesAndValues all; - - group portDefinitions { - - /** - * @desc Adapter control port - */ - type port AdapterControlPort message { - out - AcGnPrimitive, AcGn6Primitive, AcGnssPrimitive, AcSecPrimitive; - in - AcGnResponse, AcGn6Response, AdapterControlResults; - } // end AdapterControlPort - - /** - * @desc Upper Tester port - */ - type port UpperTesterPort message { - out - UtGnInitialize, UtGnChangePosition, UtAutoInteropTrigger, UtGnTrigger; // FIXME Remove UtAutoInteropTrigger from GN component, create an AutoInterop component - in - UtGnResults, UtGnEventInd; - } // end UpperTesterPort - - } // end portDefinitions - - group interfacePorts { - - group networkAndTransportPorts { - - group nt2Ports { - - /** - * @desc NT2 GeoNetworking Port (GeoNetworking/G5) - */ - type port GeoNetworkingPort message { - in GeoNetworkingInd; - out GeoNetworkingReq; - } // end GeoNetworkingPort - - } // End of group nt2Ports - - } // End of group networkAndTransportPorts - - } // End of group interfacePorts - - group componentDefinitions { - - /** - * @desc ITS Main Test Component - */ - type component ItsMtc extends ItsBaseMtc, ItsBaseGeoNetworking { - var ComponentTable vc_componentTable := {}; - } // end ItsMtc - - /** - * @desc ITS System Adapter - */ - type component ItsGeoNetworkingSystem { - - port UpperTesterPort utPort; - port AdapterControlPort acPort; - - // NT2 ports - port GeoNetworkingPort geoNetworkingPort; - - } // end ItsGeoNetworkingSystem - - } // End of group componentDefinitions - - type component ItsBaseGeoNetworking extends ItsBaseComponent, ItsSecurityBaseComponent { - - port UpperTesterPort utPort; - port AdapterControlPort acPort; - - // UT indications - var UtGnEventIndList vc_utInds := {}; - - var boolean vc_utDefaultActive := true; - var boolean vc_acDefaultActive := true; - var boolean vc_gnDefaultActive := true; - - } - - /** - * @desc Test component for ITS Network and Transport layer - */ - type component ItsGeoNetworking extends ItsBaseGeoNetworking { - - // NT2 ports - port GeoNetworkingPort geoNetworkingPort; - - //variables for Gn - var UInt16 vc_localSeqNumber := 0; - var PositionTable vc_positionTable := {}; - var GeoAreaTable vc_areaTable := {}; - var charstring vc_componentName := ""; - var default vc_neighbourDefault; - var integer vc_multipleMessagesCount := 0; - - } // End of component ItsGeoNetworking - - group networkAndTransportPrimitives { - - group nt2Primitives { - - /** - * @desc NT2 GeoNetworking Indication Primitive - */ - type record GeoNetworkingInd { - GeoNetworkingPdu msgIn, - MacAddress macDestinationAddress, - Bit256 ssp optional, - UInt32 its_aid optional - } with { - //encode "RAW"; - variant "FIELDORDER(msb)" - } - - /** - * @desc NT2 GeoNetworking Request Primitive - */ - type record GeoNetworkingReq { - GeoNetworkingPdu msgOut, - MacAddress macDestinationAddress, - UInt32 its_aid - } with { - //encode "RAW"; - variant "FIELDORDER(msb)" - } - - } // end nt2Primitives - - } // End of group networkAndTransportPrimitives - with { - variant "" - encode "LibIts_Interface" - } // end interfacePrimitives - - group misc { - - type record ComponentEntry { - charstring componentName, - ItsGeoNetworking gnComponent optional - } - - type record of ComponentEntry ComponentTable; - - } // end misc - -} // End of module LibItsGeoNetworking_TestSystem diff --git a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn b/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn deleted file mode 100644 index 928fce7f..00000000 --- a/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn +++ /dev/null @@ -1,1182 +0,0 @@ -/** - * @author ETSI / STF405 / STF449 / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn $ - * $Id: LibItsGeoNetworking_TypesAndValues.ttcn,v 1.5 2018/06/26 13:54:21 dte Exp $ - * @desc Module containing types and values for GeoNetworking Protocol - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsGeoNetworking_TypesAndValues { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from EtsiTs103097Module language "ASN.1:1997" all; - - group geoConfigurationValues { - - const charstring c_compIut := "IUT"; - const charstring c_compMTC := "MTC"; - const charstring c_compNodeA := "NodeA"; - const charstring c_compNodeB := "NodeB"; - const charstring c_compNodeC := "NodeC"; - const charstring c_compNodeD := "NodeD"; - const charstring c_compNodeE := "NodeE"; - const charstring c_compNodeF := "NodeF"; - - const charstring c_area1 := "AREA1"; - const charstring c_area2 := "AREA2"; - - const integer c_latitudeFactorNodeA := 10; - const integer c_latitudeFactorNodeB := 2; - const integer c_latitudeFactorNodeC := -6; - const integer c_latitudeFactorNodeD := 1; - const integer c_latitudeFactorNodeE := -1; - const integer c_latitudeFactorNodeF := 2; - const integer c_longitudeFactorNodeA := 0; - const integer c_longitudeFactorNodeB := 0; - const integer c_longitudeFactorNodeC := 0; - const integer c_longitudeFactorNodeD := 0; - const integer c_longitudeFactorNodeE := 0; - const integer c_longitudeFactorNodeF := -3; - } // end geoConfigurationValues - - group geoSyncMessages { - - const charstring c_msgSent := "Message sent"; - - } // end geoSyncMessages - - group geoTestingConstants { - - const UInt6 c_defaultLifetime := 10; // in seconds - const UInt16 c_lifetime := 1000 * c_defaultLifetime; // in seconds - - } // end geoTestingConstants - - group units { - - const float c_squareKm := 1000000.0; - - } // end units - - group geoConfigurationTypes { - - /** - * @desc Entry of position table - * @member key Reference key of the entry - * @member position Position vector stored in the entry - */ - type record PositionEntry { - charstring key, - LongPosVector position - } - - /** - * @desc Table containing node positions - */ - type record of PositionEntry PositionTable; - - /** - * @desc Parameters of a geometric area - * @member geoAreaPosLatitude Latitude of area's center - * @member geoAreaPosLongitude Longitude of area's center - * @member distanceA Distance A - * @member distanceB Distance B - * @member angle Angle - */ - type record Area { - Int32 geoAreaPosLatitude, - Int32 geoAreaPosLongitude, - UInt16 distanceA, - UInt16 distanceB, - UInt16 angle - } - - /** - * @desc Compact definition of GeoBroadcastArea - * @member geoBroadcastSubType Type of GeoBroadcastArea (=shape) - * @member geoBroadcastArea Parameters of the geometric area - */ - type record GeoBroadcastArea { - HeaderSubTypeGeoBroadcast geoBroadcastSubType, - Area geoBroadcastArea - } - - /** - * @desc Compact definition of GeoAnycastArea - * @member geoAnycastSubType Type of GeoAnycastArea (=shape) - * @member geoAnycastArea Parameters of the geometric area - */ - type record GeoAnycastArea { - HeaderSubTypeGeoAnycast geoAnycastSubType, - Area geoAnycastArea - } - - /** - * @desc Compact definition of a GeoArea (either GeoBroadcastArea or GeoAnycastArea) - * @member shape Shape of the GeoArea - * @member area Parameters of the geometric area - */ - type record GeoArea { - GeoShape shape, - Area area - } - - /** - * @desc Geometric shapes used to define GeoAreas - */ - type enumerated GeoShape { - e_geoCircle(0), - e_geoRect(1), - e_geoElip(2), - e_reserved - } - - /** - * @desc Entry of GeoArea table - * @member key Reference key of the entry - * @member geoArea GeoArea stored in the entry - */ - type record GeoAreaEntry { - charstring key, - GeoArea geoArea - } - - /** - * @desc Table containing geoArea definitions - */ - type record of GeoAreaEntry GeoAreaTable; - - } // end geoConfigurationTypes - - group geoNwValues { - - group geoNwHeaderConstants { - - const UInt4 c_geoNwProtocolVersion := 1; - - const UInt8 c_hopLimit1 := 1; - const UInt8 c_defaultHopLimit := 10; - - } // end geoNwHeaderConstants - - } // end geoNwValues - - group geoNetworkingPdus { - - /** - * @desc GeoNetworking Packet - * - * @see ETSI EN 302 636-4-1 chapter 8.2, 8.3, 8.4 - * - * @member basicHeader - * @member gnPacket - */ - type record GeoNetworkingPdu { - BasicHeader basicHeader, - GeoNetworkingPacket gnPacket - } - - type record GeoNetworkingPacket { - GnNonSecuredPacket packet, - EtsiTs103097Data securedMsg optional - } with { - encode (securedMsg) "LibItsSecurity" - } - - type octetstring GnRawPayload; - - type record GnNonSecuredPacket { - CommonHeader commonHeader, - ExtendedHeader extendedHeader optional, - GnRawPayload payload optional - } - } // end group geoNetworkingPdus - - group geoNetworkingHeader { - - group geoNetworkingBasicHeader { - - /** - * @desc Basic Header - * - *
    -       *  0               1               2               3
    -       *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
    -       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -       * |   V   |  NH   |    Reserved   |      LT       |      RHL      |
    -       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -       * 
    - * - * @see ETSI EN 302 636-4-1 chapter 8.6.1 - * - * @member version - * @member nextHeader - * @member reserved - * @member lifeTime - * @member routerHopLimit - */ - type record BasicHeader { - UInt4 version, - BasicNextHeader nextHeader, - UInt8 reserved, - Lifetime lifeTime, - UInt8 routerHopLimit - } with { - variant "FIELDORDER(msb)" - } - - type enumerated BasicNextHeader { - e_any(0), - e_commonHeader(1), - e_securedPacket(2), - e_reserved - } with { - variant "FIELDLENGTH(4)" - } - - /** - * @desc Indicates the maximum tolerable time a packet can be buffered until it reaches its destination. - * @member multiplier - * @member ltBase - */ - type record Lifetime { - UInt6 multiplier, - LtBase ltBase - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc The base for the calculation of the lifetime. - */ - type enumerated LtBase { - e_50ms(0), - e_1s(1), - e_10s(2), - e_100s(3) - } with { - variant "FIELDLENGTH(2)" - } - - } // end group geoNetworkingBasicHeader - - group geoNetworkingCommonHeader { - - /** - * @desc Common header for GeoNetworking - * - *
    -       *  0               1               2               3
    -       *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
    -       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -       * |  NH   |   R   |  HT   |  HST  |      TC       |     Flags     |
    -       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -       * |              PL               |     MHL       |    Reserved   |
    -       * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -       * 
    - * - * @see ETSI EN 302 636-4-1 chapter 8.7.2 - * - * @member nextHeader - * @member reserved - * @member headerTST Header type + Header Sub Type - * @member trafficClass - * @member flags - * @member plLength - * @member maxHopLimit - * @member reserved2 - */ - type record CommonHeader { - NextHeader nextHeader, - UInt4 reserved, - HeaderTST headerTST, - TrafficClass trafficClass, - Bit8 flags, - UInt16 plLength, // The Codec shall set the length of the paylaod if present - UInt8 maxHopLimit, - UInt8 reserved2 - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the type of header immediately following the Common Header (4Bits). - */ - type enumerated NextHeader { - e_any(0), - e_btpA(1), - e_btpB(2), - e_ipv6(3), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } - - /** - * @desc TrafficClass - * - *
    -       *  0   1   2   3   4   5   6   7
    -       * +---+---+---+---+---+---+---+---+
    -       * |SCF|Ch.|         TC ID         |
    -       * |   |Off|                       |
    -       * +---+---+---+---+---+---+---+---+
    -       * 
    - * - * @see ETSI EN 302 636-4-1 chapter 8.7.5 - * - * @member scf - * @member channelOffload - * @member tcId - */ - type record TrafficClass { - SCF scf, - ChannelOffload channelOffload, - TcId tcId - } with { - variant "FIELDORDER(msb)" - } - - type enumerated SCF { - e_scfDisabled(0), - e_scfEnabled (1) - } with { - variant "FIELDLENGTH(1)" //variant "1 bit" - } - type enumerated ChannelOffload { - e_choffDisabled(0), - e_choffEnable (1) - } with { - variant "FIELDLENGTH(1)" //variant "1 bit" - } - type UInt6 TcId; - - } // end group geoNetworkingCommonHeader - - group geoNetworkingExtendedHeaders { - - /** - * @desc GeoNetworking ExtendedHeader - * - * @see ETSI EN 302 636-4-1 chapter 8.3 - * - * @member commonHeader - * @member gnExtHeader - */ - type union ExtendedHeader { - GeoUnicastHeader geoUnicastHeader, - TSBHeader tsbHeader, - SHBHeader shbHeader, - GeoBroadcastHeader geoBroadcastHeader, - GeoAnycastHeader geoAnycastHeader, - BeaconHeader beaconHeader, - LSRequestHeader lsRequestHeader, - LSReplyHeader lsReplyHeader, - AnyHeader anyHeader - } with { - variant "" - } - - /** - * @desc The unspecified ANY header. - * - * @member seqNumber - * @member reserved - */ - type record AnyHeader { - UInt16 seqNumber, - UInt16 reserved - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc The BEACON packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.6 - * - * @member commonHeader - */ - type record BeaconHeader { - LongPosVector srcPosVector - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc The GEOANYCAST packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.5 - * - * @member seqNumber - * @member reserved - * @member srcPosVector - * @member geoAreaPosLatitude - * @member geoAreaPosLongitude - * @member distanceA - * @member distanceB - * @member angle - * @member reserved - */ - type record GeoAnycastHeader { - UInt16 seqNumber, - UInt16 reserved, - LongPosVector srcPosVector, - Int32 geoAreaPosLatitude, - Int32 geoAreaPosLongitude, - UInt16 distanceA, - UInt16 distanceB, - UInt16 angle, - UInt16 reserved2 - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc The GEOBROADCAST packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.5 - * - * @member seqNumber - * @member reserved - * @member srcPosVector - * @member geoAreaPosLatitude - * @member geoAreaPosLongitude - * @member distanceA - * @member distanceB - * @member angle - * @member reserved - */ - type GeoAnycastHeader GeoBroadcastHeader; - - /** - * @desc The GEOUNICAST packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.2 - * - * @member seqNumber - * @member reserved - * @member srcPosVector - * @member dstPosVector - */ - type record GeoUnicastHeader { - UInt16 seqNumber, - UInt16 reserved, - LongPosVector srcPosVector, - ShortPosVector dstPosVector - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc The Location Service (LS) Reply packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.8 - * - * @member seqNumber - * @member reserved - * @member srcPosVector - * @member dstPosVector - */ - type record LSReplyHeader { - UInt16 seqNumber, - UInt16 reserved, - LongPosVector srcPosVector, - ShortPosVector dstPosVector - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc The Location Service (LS) Request packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.7 - * - * @member seqNumber - * @member reserved - * @member srcPosVector - * @member gnAddress - */ - type record LSRequestHeader { - UInt16 seqNumber, - UInt16 reserved, - LongPosVector srcPosVector, - GN_Address gnAddress - } with { - variant "FIELDORDER(msb)" - } - - /** - * The Single Hop Broadcast (SHB) packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.4 - * - * @member srcPosVector - * @member reserved - */ - type record SHBHeader { - LongPosVector srcPosVector, - UInt32 reserved - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc The Topologically-Scoped Broadcast (TSB) packet header. - * - * @see ETSI EN 302 636-4-1 chapter 8.8.3 - * - * @member seqNumber - * @member reserved - * @member srcPosVector - */ - type record TSBHeader { - UInt16 seqNumber, - UInt16 reserved, - LongPosVector srcPosVector - } with { - variant "FIELDORDER(msb)" - } - - group geoNetworkingHeadersSubtypes { - - /** - * @desc Identifies the header type and the header subtype for ANY. - * @member headerType - * @member reserved - */ - type record AnyHeaderType { - HeaderType headerType(e_any), - UInt4 headerSubType - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the header type and the header subtype for BEACON. - * @member headerType - * @member reserved - */ - type record BeaconHeaderType { - HeaderType headerType(e_beacon), - UInt4 headerSubType - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the header type and the header subtype for GEOANYCAST. - * @member headerType - * @member reserved - */ - type record GeoAnycastHeaderType { - HeaderType headerType(e_geoAnycast), - HeaderSubTypeGeoAnycast headerSubType - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the header type and the header subtype for GEOBROADCAST. - * @member headerType - * @member reserved - */ - type record GeoBroadcastHeaderType { - HeaderType headerType(e_geoBroadcast), - HeaderSubTypeGeoBroadcast headerSubType - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the header type and the header subtype for GEOUNICAST. - * @member headerType - * @member reserved - */ - type record GeoUnicastHeaderType { - HeaderType headerType(e_geoUnicast), - UInt4 headerSubType - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the header type and the header subtype for Location Service LS. - * @member headerType - * @member reserved - */ - type record LsHeaderType { - HeaderType headerType(e_locationService), - HeaderSubTypeLs headerSubType - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the header type and the header subtype for Topologically-Scoped Broadcast TSB. - * @member headerType - * @member headerSubType - */ - type record TsbHeaderType { - HeaderType headerType(e_topologicallyScopedBroadcast), - HeaderSubTypeTSB headerSubType - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the header subtype for GEOANYCAST. - */ - type enumerated HeaderSubTypeGeoAnycast { - e_geoAnycastCircle(0), - e_geoAnycastRect(1), - e_geoAnycastElip(2), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } - - /** - * @desc Identifies the header subtype for GEOBROADCAST. - */ - type enumerated HeaderSubTypeGeoBroadcast { - e_geoBroadcastCircle(0), - e_geoBroadcastRect(1), - e_geoBroadcastElip(2), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } - - /** - * @desc Identifies the header subtype for Topologically-scoped broadcast TSB. - */ - type enumerated HeaderSubTypeTSB { - e_singleHop(0), - e_multiHop(1), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } - - /** - * @desc Identifies the header subtype for Location Service LS. - */ - type enumerated HeaderSubTypeLs { - e_lsRequest(0), - e_lsReply(1), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } - - /** - * @desc Identifies the header subtype for Service Announcement SA. - */ - type enumerated HeaderSubTypeSa { - e_sa(0), - e_saEos(1), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } - - /** - * @desc Identifies the header type and the header subtype. - * @member anyHdr - * @member beaconHdr - * @member geoUnicastHdr - * @member geoAnycastHdr - * @member geoBroadcastHdr - * @member tsbHdr - * @member lsHdr - * @member saHdr - * @member reserved - */ - type union HeaderTST { - AnyHeaderType anyHdr, - BeaconHeaderType beaconHdr, - GeoUnicastHeaderType geoUnicastHdr, - GeoAnycastHeaderType geoAnycastHdr, - GeoBroadcastHeaderType geoBroadcastHdr, - TsbHeaderType tsbHdr, - LsHeaderType lsHdr, - UInt8 reserved - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Identifies the type of the GeoAdhoc header type (4Bits). - */ - type enumerated HeaderType { - e_any(0), - e_beacon(1), - e_geoUnicast(2), - e_geoAnycast(3), - e_geoBroadcast(4), - e_topologicallyScopedBroadcast(5), - e_locationService(6), - e_reserved - } with { - variant "FIELDLENGTH(4)" //variant "4 bit" - } - - /** - * @desc Long Position Vector - * - *
    -         *  0               1               2               3
    -         *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
    -         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         * |                           GN_ADDR                             |
    -         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         * |                             TST                               |
    -         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         * |                             Lat                               |
    -         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         * |                             Long                              |
    -         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         * |P|              S              |               H               |
    -         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         * 
    - * - * @see ETSI EN 302 636-4-1 chapter 8.5.2 - * - * @member gnAddr - * @member timestamp_ - * @member latitude - * @member longitude - * @member pai Position Accuracy Indicator - * @member speed - * @member heading - */ - type record LongPosVector { - GN_Address gnAddr, - UInt32 timestamp_, - Int32 latitude, - Int32 longitude, - Bit1 pai, - Int15 speed, - UInt16 heading - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Short Position Vector - * - *
    -         *  0               1               2               3
    -         *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
    -         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         * |                           GN_ADDR                             |
    -         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         * |                             TST                               |
    -         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         * |                             Lat                               |
    -         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         * |                             Long                              |
    -         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         * 
    - * - * @see ETSI EN 302 636-4-1 chapter 8.5.3 - * - * @member gnAddr - * @member timestamp - * @member latitude - * @member longitude - */ - type record ShortPosVector { - GN_Address gnAddr, - UInt32 timestamp_, - Int32 latitude, - Int32 longitude - } with { - variant "FIELDORDER(msb)" - } - - group geoNetworkingAddress { - /** - * @desc GeoNetworking address - * - *
    -           *  0               1               2               3
    -           *  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
    -           * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -           * |M|  S_T    |       S_CC        |             M_ID              |
    -           * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -           * |                              M_ID                             |
    -           * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -           * 
    - * - * @see ETSI EN 302 636-4-1 chapter 6.2 - * - * @member typeOfAddress - * @member stationType - * @member mid - */ - type record GN_Address { - TypeOfAddress typeOfAddress, - StationType stationType, - UInt10 reserved, - Oct6 mid - } with { - variant "FIELDORDER(msb)" - } - - group geoNetworkingAddressSubtypes { - - /** - * @desc Identifies the ITS station (5Bits). - */ - type enumerated StationType { - e_unknown(0), - e_pedestrian(1), - e_cyclist(2), - e_moped(3), - e_motorcycle(4), - e_passengerCar(5), - e_bus(6), - e_lightTruck(7), - e_heavyTruck(8), - e_trailer(9), - e_specialVehicle(10), - e_tram(11), - e_roadSideUnit(15) - } with { - variant "FIELDLENGTH(5)" //variant "5 bit" - } - - /** - * @desc Distinguish between manually configured - * network address and the initial GeoNetwork address (1Bit). - */ - type enumerated TypeOfAddress { - e_manual(1), - e_initial(0) - } with { - variant "FIELDLENGTH(1)" //variant "1 bit" - } - - } // end group geoNetworkingAddressSubtypes - - } // end group geoNetworkingAddress - - } // end group geoNetworkingHeadersSubtypes - - } // end group geoNetworkingExtendedHeaders - - } // end group geoNetworkingHeader - - group geoNwPicsTypes { - - /** - * @desc The GeoUnicast forwarding algorithm. - */ - type enumerated NonAreaForwardingAlgorithm { - e_unspecified(0), - e_greedy(1), - e_cbf(2) - } - - /** - * @desc The GeoBroadcast forwarding algorithm. - */ - type enumerated AreaForwardingAlgorithm { - e_unspecified(0), - e_simple(1), - e_cbf(2), - e_advanced(3) - } - - /** - * @desc GN address configuration method. - */ - type enumerated GnAddressConfigurationMethod { - e_auto(0), - e_managed(1), - e_anonymous(2) - } - - } // end geoNwPicsTypes - - group utPrimitives { - - /** - * @desc Upper Tester message to initialize IUT - * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use - */ - type record UtGnInitialize { - Oct8 hashedId8 - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester results message of the GeoNetworking IUT - * @member utGnInitialize - - * @member utGnTriggerResult - - * @member utAutoInteropTriggerResult - - * @member utGnChangePositionResult - - */ - type union UtGnResults { - boolean utGnInitializeResult, - boolean utGnTriggerResult, - boolean utAutoInteropTriggerResult, // FIXME Remove UtAutoInteropTrigger from GN component, create an AutoInterop component - boolean utGnChangePositionResult - } with { - variant "" - } // End of type UtGnResults - - /** - * @desc AutoInterop UpperTester trigger - * @member utRadioOnOff Set to true to power on the radio (on-link mode), false to power off the radio (off-link). - */ - type union UtAutoInteropTrigger { - boolean utRadioOnOff - } with { - variant "" - } // End of type UtAutoInteropTrigger - - /** - * @desc Upper Tester message to change the position of IUT. Values a relatives - */ - type record UtGnChangePosition { - Int32 latitude, - Int32 longitude, - Int32 elevation - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc UT primitives for GeoNetworking - * @member geoUnicast - - * @member geoBroadcast - - * @member geoAnycast - - * @member shb - - * @member tsb - - * @member changePosition - - * @member checkPacket - - */ - type union UtGnTrigger { - GenerateGeoUnicastMessage geoUnicast, - GenerateGeoBroadcastMessage geoBroadcast, - GenerateGeoAnycastMessage geoAnycast, - GenerateSHBMessage shb, - GenerateTSBMessage tsb - } with { - variant "" - } - - /** - * @desc UT primitive for IUT to send a GeoUnicast packet - * @member gnAddress Destination of the packet - * @member lifetime Lifetime of the packet - * @member trafficClass Traffic class of the packet - * @member payload GnRawPayload of the packet - */ - type record GenerateGeoUnicastMessage { - GN_Address gnAddress, - UInt16 lifetime, - TrafficClass trafficClass, - GnRawPayload payload - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc UT primitive for IUT to send a GeoBroadcast packet - * @member shape Shape of the area - * @member lifetime Lifetime of the packet - * @member trafficClass Traffic class of the packet - * @member area Destination GeoArea - * @member payload GnRawPayload of the packet - */ - type record GenerateGeoBroadcastMessage { - GeoShape shape, - UInt16 lifetime, - TrafficClass trafficClass, - UInt24 reserved, - Area area, - GnRawPayload payload - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc UT primitive for IUT to send a Geoanycast packet - */ - type GenerateGeoBroadcastMessage GenerateGeoAnycastMessage; - - /** - * @desc UT primitive for IUT to send a SHB packet - * @member trafficClass Traffic class of the packet - * @member payload GnRawPayload of the packet - */ - type record GenerateSHBMessage { - TrafficClass trafficClass, - GnRawPayload payload - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc UT primitive for IUT to send a SHB packet - * @member nbHops Number of Hops - * @member lifetime Lifetime of the packet - * @member trafficClass Traffic class of the packet - * @member payload GnRawPayload of the packet - */ - type record GenerateTSBMessage { - UInt8 nbHops, - UInt16 lifetime, - TrafficClass trafficClass, - GnRawPayload payload - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to check Upper Layer message transmission on GN IUT - */ - type record UtGnEventInd { - GnRawPayload rawPayload - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc List of Upper Tester messages to check Upper Layer message transmission on GN IUT - */ - type record of UtGnEventInd UtGnEventIndList; - - } // end utPrimitives - with { - encode "UpperTester"; - variant "" - } - - group acPrimitives { - - /** - * @desc TA primitives for GeoNetworking - * @member startBeaconing - - * @member stopBeaconing - - * @member startPassBeaconing - - * @member stopPassBeaconing - - * @member startBeaconingMultipleNeighbour - - * @member stopBeaconingMultipleNeighbour - - * @member getLongPosVector - - */ - type union AcGnPrimitive { - AcStartBeaconing startBeaconing, - AcStopBeaconing stopBeaconing, - AcStartPassBeaconing startPassBeaconing, - AcStopPassBeaconing stopPassBeaconing, - AcStartBeaconingMultipleNeighbour startBeaconingMultipleNeighbour, - AcStopBeaconingMultipleNeighbour stopBeaconingMultipleNeighbour, - AcGetLongPosVector getLongPosVector - } with { - variant "" - } - - /** - * @desc Primitive for receiveing response from TA - * @member getLongPosVector - */ - type union AcGnResponse { - LongPosVector getLongPosVector, - AcGnResponseFailure failure - } - with { - variant "" - encode(getLongPosVector) "LibItsGeoNetworking" - } - - type record AcGnResponseFailure { - boolean failure - } - - /** - * @desc Primitive for TA to start sending beacons for the test component - * @member beaconHeader Beacon template - */ - type record AcStartBeaconing { - GeoNetworkingPdu beaconPacket - } - with { - encode(beaconPacket) "LibItsGeoNetworking" - } - - /** - * @desc Primitive for TA to stop sending beacons for the test component - */ - type record AcStopBeaconing { - } - - /** - * @desc Primitive for TA to start enqueueing received beacons - * @member beaconHeader Filter - */ - type record AcStartPassBeaconing { - BeaconHeader beaconHeader - } - with { - encode(beaconHeader) "LibItsGeoNetworking" - }; - - /** - * @desc Primitive for TA to stop enqueueing received beacons - */ - type record AcStopPassBeaconing { - } - - /** - * @desc Primitive for TA to start sending beacons for multiple neighbours - * @member beaconHeader Beacon template - * @member numberOfNeighbour Number of neighbours to simulate - */ - type record AcStartBeaconingMultipleNeighbour { - GeoNetworkingPdu beaconPacket, - integer numberOfNeighbour - } - with { - encode(beaconPacket) "LibItsGeoNetworking" - }; - - /** - * @desc Primitive for TA to stop sending beacons for multiple neighbours - */ - type record AcStopBeaconingMultipleNeighbour { - } - - /** - * @desc Primitive for retrieving the position vector corresponding to a specific GN address - * @member gnAddress GN address to be searched - */ - type record AcGetLongPosVector { - GN_Address gnAddress - } - with { - encode(gnAddress) "LibItsGeoNetworking" - }; - - } // end acPrimitives - with { - variant "" - encode "AdapterControl" - } -} -with { - variant "" - encode "LibItsGeoNetworking" - } diff --git a/ttcn/GeoNetworking/module.mk b/ttcn/GeoNetworking/module.mk deleted file mode 100644 index 2db9447c..00000000 --- a/ttcn/GeoNetworking/module.mk +++ /dev/null @@ -1,8 +0,0 @@ -sources := \ - LibItsGeoNetworking_EncdecDeclarations.ttcn \ - LibItsGeoNetworking_Functions.ttcn \ - LibItsGeoNetworking_Pics.ttcn \ - LibItsGeoNetworking_Pixits.ttcn \ - LibItsGeoNetworking_Templates.ttcn \ - LibItsGeoNetworking_TestSystem.ttcn \ - LibItsGeoNetworking_TypesAndValues.ttcn \ diff --git a/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn b/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn index 8b2b26d0..c7650134 100644 --- a/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn +++ b/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn @@ -16,8 +16,8 @@ module LibItsHttp_BinaryMessageBodyTypes { */ // TODO Add here your custom binary import // LibIts - import from Ieee1609Dot2BaseTypes language "ASN.1:1997" all; - import from Ieee1609Dot2 language "ASN.1:1997" all; + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + import from IEEE1609dot2 language "ASN.1:1997" all; import from EtsiTs102941BaseTypes language "ASN.1:1997" all; import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; import from EtsiTs102941MessagesCa language "ASN.1:1997" all; diff --git a/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn b/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn index d988cfad..45c6df15 100644 --- a/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn +++ b/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn @@ -15,8 +15,8 @@ module LibItsHttp_BinaryTemplates { // TODO Add here your custom binary import // LibIts - import from Ieee1609Dot2BaseTypes language "ASN.1:1997" all; - import from Ieee1609Dot2 language "ASN.1:1997" all; + import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; + import from IEEE1609dot2 language "ASN.1:1997" all; import from EtsiTs102941BaseTypes language "ASN.1:1997" all; import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; import from EtsiTs102941MessagesCa language "ASN.1:1997" all; diff --git a/ttcn/Http/LibItsHttp_Functions.ttcn b/ttcn/Http/LibItsHttp_Functions.ttcn index a2a70803..c1abcf32 100644 --- a/ttcn/Http/LibItsHttp_Functions.ttcn +++ b/ttcn/Http/LibItsHttp_Functions.ttcn @@ -8,6 +8,7 @@ module LibItsHttp_Functions { // LibHttp import from LibItsHttp_TypesAndValues all; import from LibItsHttp_Pics all; + import from LibItsHttp_Pixits all; import from LibItsHttp_TestSystem all; group http_preambles { @@ -71,6 +72,9 @@ module LibItsHttp_Functions { v_i := v_i + 1; } //p_headers[v_i] := { c_header_accept, { "application/x-its-response" } }; + if (lengthof(PX_ADDITIONAL_HTTP_HEADERS_KEYS) != 0) { + f_set_headers_list(PX_ADDITIONAL_HTTP_HEADERS_KEYS, PX_ADDITIONAL_HTTP_HEADERS_VALUES, p_headers); + } } // End of function f_init_default_headers_list function f_set_headers_list( diff --git a/ttcn/Http/LibItsHttp_Pixits.ttcn b/ttcn/Http/LibItsHttp_Pixits.ttcn new file mode 100644 index 00000000..037caf7e --- /dev/null +++ b/ttcn/Http/LibItsHttp_Pixits.ttcn @@ -0,0 +1,9 @@ +module LibItsHttp_Pixits { + + import from LibItsHttp_TypesAndValues all; + + modulepar charstring_list PX_ADDITIONAL_HTTP_HEADERS_KEYS := { }; + + modulepar charstring_list PX_ADDITIONAL_HTTP_HEADERS_VALUES := { }; + +} // End of module LibItsHttp_Pixits diff --git a/ttcn/Http/module.mk b/ttcn/Http/module.mk index 9ac4f5b9..0a2300e5 100644 --- a/ttcn/Http/module.mk +++ b/ttcn/Http/module.mk @@ -8,6 +8,7 @@ sources := LibItsHttp_BinaryMessageBodyTypes.ttcn \ LibItsHttp_JsonTemplates.ttcn \ LibItsHttp_MessageBodyTypes.ttcn \ LibItsHttp_Pics.ttcn \ + LibItsHttp_Pixits.ttcn \ LibItsHttp_Templates.ttcn \ LibItsHttp_TestSystem.ttcn \ LibItsHttp_TypesAndValues.ttcn \ diff --git a/ttcn/IVIM/LibItsIvim_ASN1_IVInamedNumbers.ttcn b/ttcn/IVIM/LibItsIvim_ASN1_IVInamedNumbers.ttcn deleted file mode 100644 index 390e262f..00000000 --- a/ttcn/IVIM/LibItsIvim_ASN1_IVInamedNumbers.ttcn +++ /dev/null @@ -1,56 +0,0 @@ -//This module contains TTCN-3 values for ASN.1 named numbers, aligned with TTWorkbench name convention - -module LibItsIvim_ASN1_IVInamedNumbers { - -import from IVI language "ASN.1:1997" all; - - group IVI_constants { - - const Direction Direction_sameDirection_ := 0; - const Direction Direction_oppositeDirection_ := 1; - const Direction Direction_bothDirections_ := 2; - const Direction Direction_valueNotUsed_ := 3; - - const IviStatus IviStatus_new_ := 0; - const IviStatus IviStatus_update_ := 1; - const IviStatus IviStatus_cancellation_ := 2; - const IviStatus IviStatus_negation_ := 3; - - const IviType IviType_immediateDangerWarningMessages_ := 0; - const IviType IviType_regulatoryMessages_ := 1; - const IviType IviType_trafficRelatedInformationMessages_ := 2; - const IviType IviType_pollutionMessages_ := 3; - const IviType IviType_notTrafficRelatedInformationMessages_ := 4; - - const LaneType LaneType_traffic_ := 0; - const LaneType LaneType_through_ := 1; - const LaneType LaneType_reversible_ := 2; - const LaneType LaneType_acceleration_ := 3; - const LaneType LaneType_deceleration_ := 4; - const LaneType LaneType_leftHandTurning_ := 5; - const LaneType LaneType_rightHandTurning_ := 6; - const LaneType LaneType_dedicatedVehicle_ := 7; - const LaneType LaneType_bus_ := 8; - const LaneType LaneType_taxi_ := 9; - const LaneType LaneType_hov_ := 10; - const LaneType LaneType_hot_ := 11; - const LaneType LaneType_pedestrian_ := 12; - const LaneType LaneType_bikeLane_ := 13; - const LaneType LaneType_median_ := 14; - const LaneType LaneType_striping_ := 15; - const LaneType LaneType_trackedVehicle_ := 16; - const LaneType LaneType_parking_ := 17; - const LaneType LaneType_emergency_ := 18; - const LaneType LaneType_verge_ := 19; - - const LaneStatus LaneStatus_open_ := 0; - const LaneStatus LaneStatus_closed_ := 1; - const LaneStatus LaneStatus_mergeR_ := 2; - const LaneStatus LaneStatus_mergeL_ := 3; - const LaneStatus LaneStatus_mergeLR_ := 4; - const LaneStatus LaneStatus_provisionallyOpen_ := 5; - const LaneStatus LaneStatus_diverging_ := 6; - - } // end IVI_constants - -} // End of module LibItsIvim_ASN1_IVInamedNumbers diff --git a/ttcn/IVIM/LibItsIvim_EncdecDeclarations.ttcn b/ttcn/IVIM/LibItsIvim_EncdecDeclarations.ttcn deleted file mode 100644 index 1f063f87..00000000 --- a/ttcn/IVIM/LibItsIvim_EncdecDeclarations.ttcn +++ /dev/null @@ -1,50 +0,0 @@ -module LibItsIvim_EncdecDeclarations { - - // LibIts - import from IVIM_PDU_Descriptions language "ASN.1:1997" all; - - // LibItsIvim - import from LibItsIvim_TypesAndValues all; - import from LibItsIvim_TestSystem all; - - external function fx_enc_IvimReq (IvimReq p) return bitstring - with {extension "prototype(convert) encode(LibIts_Interface)"} - - external function fx_dec_IvimReq (inout bitstring b, out IvimReq p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_dec_IvimInd (inout bitstring b, out IvimInd p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_enc_IVIM (IVIM p) return bitstring - with {extension "prototype(convert) encode(PER)"} - - external function fx_dec_IVIM (inout bitstring b, out IVIM p) return integer - with {extension "prototype(sliding) decode(PER)"} -/* - external function fx_enc_IVIM (IVIM p) return octetstring - with {extension "prototype(convert) encode(BER:BER_ENCODE_CER)"} -*/ - - external function fx_enc_UtIvimInitialize (UtIvimInitialize p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - /* external function fx_enc_UtIvimChangePosition (UtIvimChangePosition p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"}*/ - - external function fx_enc_UtIvimTrigger (UtIvimTrigger p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtIvimUpdate (UtIvimUpdate p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtIvimTermination (UtIvimTermination p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_dec_UtIvimResults (inout bitstring b, out UtIvimResults p) return integer - with {extension "prototype(sliding) decode(UpperTester)"} - - external function fx_dec_UtIvimEventInd (inout bitstring b, out UtIvimEventInd p) return integer - with {extension "prototype(sliding) decode(UpperTester)"} - -} // End of module LibItsIvim_EncdecDeclarations diff --git a/ttcn/IVIM/LibItsIvim_Functions.ttcn b/ttcn/IVIM/LibItsIvim_Functions.ttcn deleted file mode 100644 index 45de2ac8..00000000 --- a/ttcn/IVIM/LibItsIvim_Functions.ttcn +++ /dev/null @@ -1,473 +0,0 @@ -/** - * @author ETSI / STF517 / TTF002 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/IVIM/LibItsIvim_Functions.ttcn $ - * $Id: LibItsIvim_Functions.ttcn,v 1.2 2018/05/31 15:57:12 dte Exp $ - * @desc Module containing functions for IVIM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsIvim_Functions { - - // LibCommon - import from LibCommon_Sync all; - import from LibCommon_VerdictControl all; - import from LibCommon_Time all; - - // LibItsCommon - import from LibItsCommon_Templates all; - import from LibItsCommon_TypesAndValues all; - import from LibItsCommon_Functions all; - import from LibItsCommon_Pixits all; - - // LibItsIvim - import from ITS_Container language "ASN.1:1997" all; - import from IVIM_PDU_Descriptions language "ASN.1:1997" all; - import from IVI language "ASN.1:1997" all; - import from EfcDsrcGeneric language "ASN.1:1997" all; - import from EfcDsrcApplication language "ASN.1:1997" all; - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - - // LibItsSecurity - import from LibItsSecurity_Functions all; - - // LibItsIvim - import from LibItsIvim_TestSystem all; - import from LibItsIvim_TypesAndValues all; - import from LibItsIvim_Templates all; - import from LibItsIvim_Pics all; - import from LibItsIvim_Pixits all; - - group utFuntions { - - /** - * @desc Requests to bring the IUT in an initial state - * @param p_init The initialisation to trigger. - */ - function f_utInitializeIut(template (value) UtIvimInitialize p_init) runs on ItsIvim { - - //deactivate ivimPort default alts - vc_ivimDefaultActive := false; - - utPort.send(p_init); - tc_wait.start; - alt { - [] utPort.receive(UtIvimResults: { utIvimInitializeResult := true }) { - tc_wait.stop; - log("*** " & testcasename() & ": INFO: IUT initialized ***"); - } - [] a_utDefault() { - //empty on purpose - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //deactivate ivimPort default alts - vc_ivimDefaultActive := true; - } - - /** - * @desc Triggers an event from the application layer - * @param p_event The event to trigger. - */ - function f_utTriggerEvent( - in template (value) UtIvimTrigger p_event - ) runs on ItsIvim return IviIdentificationNumber { - var IviIdentificationNumber v_iviIdentificationNumber; - var UtIvimResults v_result; - - //deactivate ivimPort default alts - vc_ivimDefaultActive := false; - - utPort.send(p_event); - tc_wait.start; - alt { - [] utPort.receive(UtIvimResults: { utIvimTriggerResult := ? }) -> value v_result { - tc_wait.stop; - v_iviIdentificationNumber := v_result.utIvimTriggerResult.iviIdentificationNumber; - if ( not v_result.utIvimTriggerResult.result ) { - f_selfOrClientSyncAndVerdict("IVIM Trigger failed", e_error); - } - } - [] a_utDefault() { - //empty on purpose - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //deactivate ivimPort default alts - vc_ivimDefaultActive := true; - - return v_iviIdentificationNumber; - } - - /** - * @desc Updates an event at the application layer - * @param p_event The event to update. - */ - function f_utUpdateEvent( - in template (value) UtIvimUpdate p_event - ) runs on ItsIvim return IviIdentificationNumber { - var IviIdentificationNumber v_iviIdentificationNumber; - var UtIvimResults v_result; - - //deactivate ivimPort default alts - vc_ivimDefaultActive := false; - - utPort.send(p_event); - tc_wait.start; - alt { - [] utPort.receive(UtIvimResults: { utIvimUpdateResult := ? }) -> value v_result { - tc_wait.stop; - v_iviIdentificationNumber := v_result.utIvimUpdateResult.iviIdentificationNumber; - if ( not v_result.utIvimUpdateResult.result ) { - f_selfOrClientSyncAndVerdict("IVIM Update failed", e_error); - } - } - [] a_utDefault() { - //empty on purpose - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //activate ivimPort default alts - vc_ivimDefaultActive := true; - - return v_iviIdentificationNumber; - } - - /** - * @desc Terminates an event at the application layer - * @param p_event The event to terminate. - */ - function f_utTerminateEvent(template (value) UtIvimTermination p_event) runs on ItsIvim { - - //deactivate ivimPort default alts - vc_ivimDefaultActive := false; - - utPort.send(p_event); - tc_wait.start; - alt { - [] utPort.receive(UtIvimResults: { utIvimTerminationResult := ? }) { - tc_wait.stop; - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] a_utDefault() { - //empty on purpose - } - } - - //deactivate ivimPort default alts - vc_ivimDefaultActive := true; - } - - } // End of group utFunctions - - group adapterControl { - - /** - * @desc Initialise secure mode if required - */ - function f_initialiseSecuredMode( - in charstring p_certificateId := PX_CERT_FOR_TS - ) runs on ItsIvim { - - if (PICS_IS_IUT_SECURED == true) { - - if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificateId))) { - log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); - stop; - } - } - - } // End of function f_initialiseSecuredMode() - - function f_uninitialiseSecuredMode() runs on ItsIvim { - - if (PICS_IS_IUT_SECURED == true) { - f_acTriggerSecEvent(m_acDisableSecurity); - } - - } // End of function f_initialiseSecuredMode() - - /** - * @desc Triggers event in the test system adaptation. - * @param p_event The event to trigger - * @return FncRetCode - */ - function f_acTriggerSecEvent(template (value) AcSecPrimitive p_event) runs on ItsIvim return FncRetCode { - var FncRetCode v_ret := e_success; - - acPort.send(p_event); - tc_ac.start; - alt { - [] acPort.receive(m_acSecResponseSuccess) { - tc_ac.stop; - } - [] acPort.receive { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - return v_ret; - } - - } // End of group adapterControl - - group ivimConfigurationFunctions { - - /** - * @desc Setups default configuration - * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT - */ - function f_cfUp( - in charstring p_certificateId := PX_CERT_FOR_TS - ) runs on ItsIvim system ItsIvimSystem { - - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - map(self:ivimPort, system:ivimPort); - f_connect4SelfOrClientSync(); - - // Initialise secured mode - f_initialiseSecuredMode(p_certificateId); - - } // End of function f_cfUp - - /** - * @desc Deletes default configuration - */ - function f_cfDown() runs on ItsIvim system ItsIvimSystem { - - // Initialise secured mode - f_uninitialiseSecuredMode(); - - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - unmap(self:ivimPort, system:ivimPort); - f_disconnect4SelfOrClientSync(); - - } // End of function f_cfDown - - } // End of group ivimConfigurationFunctions - - group altsteps { - - /** - * @desc The base default. - */ - altstep a_default() runs on ItsIvim { - [vc_ivimDefaultActive] ivimPort.receive( - mw_ivimInd( - mw_ivimPdu( - mw_ivimStructure - ))) { - log("*** " & testcasename() & ": INFO: IVIM received in default ***"); - vc_ivimReceived := true; - repeat; - } - [vc_ivimDefaultActive] ivimPort.receive { - log("*** " & testcasename() & ": ERROR: Received an unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INCONC: Timeout while awaiting reaction of the IUT prior to Upper Tester action ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] a_shutdown() { - f_poDefault(); - f_cfDown(); - log("*** " & testcasename() & ": INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc The default for handling upper tester messages. - */ - altstep a_utDefault() runs on ItsIvim { - var UtIvimEventInd v_event; - [] utPort.receive(UtIvimEventInd:?) -> value v_event { - //store every upper tester indication received - vc_utEvents[lengthof(vc_utEvents)] := v_event; - repeat; - } - [] utPort.receive { - log("*** " & testcasename() & ": INFO: Received unhandled/unknown UT message from IUT ***"); - repeat; - } - } - - } // End of group altsteps - - group preambles { - - /** - * @desc The default preamble. - */ - function f_prDefault() runs on ItsIvim { - vc_default := activate(a_default()); - activate(a_utDefault()); - } - - /** - * @desc Brings the IUT into an initial state. - * @return FncRetCode - */ -// function f_prInitialState(Scenario p_scenario := e_staticPosition) runs on ItsIvim return FncRetCode { -// var FncRetCode v_ret := e_success; -// -// f_utInitializeIut(m_ivimStructureInitialize); -// -// f_prDefault(); -// -// return v_ret; -// } - function f_prInitialState(Scenario p_scenario := e_staticPosition, // TODO: To be removed, not used in IVIM (RSU) - in charstring p_certificate_id := "" - ) runs on ItsIvim return FncRetCode { - var FncRetCode v_ret := e_success; - - // Initialize IUT with given certificate - if (p_certificate_id != "") { // Initialize IUT with given certificate - var HashedId8 v_hashedId8 := '0000000000000000'O; - - fx_readCertificateDigest("CERT_IVI_SSP_NONE", v_hashedId8); - if ('0000000000000000'O == v_hashedId8) { - // Certificate not found - log("*** " & testcasename() & ": Required IUT certificate is not found on the test system ***"); - return e_timeout; - } - f_utInitializeIut(m_ivimStructureInitialize(v_hashedId8)); - } else { - f_utInitializeIut(m_ivimStructureInitialize); - } - f_prDefault(); - return v_ret; - } - - } // End of group preambles - - group postambles { - - /** - * @desc The default postamble. - */ - function f_poDefault() runs on ItsIvim { - // Nothing to do - } - - /** - * @desc Postamble including cancellation of an event. - * @param p_trigger Indicates if the cancellation have to be raised by the test system(e_ets) - * or at the application layer of the IUT(e_iut). - * @param p_actionId The action ID of the event to be cancelled - */ - function f_poCancelEvent( - in template (value) Trigger p_trigger, - in template (value) IviIdentificationNumber p_iviIdentificationNumber - ) runs on ItsIvim { - var FncRetCode v_ret := e_success; - - if (valueof(p_trigger) == e_ets) { - f_sendIviMessage(valueof(m_ivimStructureCancellation(p_iviIdentificationNumber))); - f_sleep(PX_TNOAC); - } - else { - f_utTerminateEvent(m_utEventCancellation(p_iviIdentificationNumber)); - } - - f_poDefault(); - } - - } // End of group postambles - - group sendFunctions { - - /** - * @desc Sends a IVI message - * @param p_sendMsg The IVI message to send. - * @param p_overrideSeqNo Overrides the sequence number with the stored one. - */ - function f_sendIviMessage( - in template (value) IviStructure p_ivim - ) runs on ItsIvim { - ivimPort.send( - m_ivimReq( - m_ivimStructurePdu( - p_ivim - ) - ) - ); - } - - } // End of group sendFunctions - - group receiveFunctions { - - /** - * @desc Awaits a IVI message and returns it - * @param p_rcvMsg The expected message to be received. - * @param p_rcvdMsg The received message - OUT. - */ - function f_awaitIviMessage( - in template (present) IvimInd p_rcvMsg, - out IvimInd p_rcvdMsg - ) runs on ItsIvim { - - tc_ac.start; - alt { - [] ivimPort.receive(p_rcvMsg) -> value p_rcvdMsg { - tc_ac.stop; - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INFO: Timeout while awaiting the reception of a message ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - } - - } // End of group receiveFunctions - - group miscellaneousFunctions { - - /** - * @desc Increases the IviIdentification number and handles the special case where the - * IviIdentification number reaches the limit of 32768 and will be reset to 0. - * @param p_iviIdentificationNumber The IviIdentification number to increase. - * @return The increased IviIdentification number. - */ - function f_increaseIviIdentificationNumber( - in IviIdentificationNumber p_iviIdentificationNumber - ) return IviIdentificationNumber { - // if maximum number of 32768 reached, reset it to 0 - return ((p_iviIdentificationNumber + 1) mod 32768); - } - - } // End of group miscellaneousFunctions - -} // End of module LibItsIvim_Functions diff --git a/ttcn/IVIM/LibItsIvim_Pics.ttcn b/ttcn/IVIM/LibItsIvim_Pics.ttcn deleted file mode 100644 index 9508c5fc..00000000 --- a/ttcn/IVIM/LibItsIvim_Pics.ttcn +++ /dev/null @@ -1,118 +0,0 @@ -/** - * @author ETSI / STF517 / TTF002 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/IVIM/LibItsIvim_Pics.ttcn $ - * $Id: LibItsIvim_Pics.ttcn 1312 2016-12-14 09:21:45Z garciay $ - * @desc IVIM PICS - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsIvim_Pics { - - /** - * @desc Is the IUT running in secured mode? - * @see ETSI TS 103 191-1 Table A.1 - */ - modulepar boolean PICS_IS_IUT_SECURED := false; - - /** - * @desc Support for IVIM generation - * @see ETSI TS 103 191-1 Table A.3 - */ - modulepar boolean PICS_IVIM_GENERATION := true; - - /** - * @desc Support for IVIM update - * @see ETSI TS 103 191-1 Table A.3 - */ - modulepar boolean PICS_IVIM_UPDATE := true; - - /** - * @desc Support for IVIM cancellation - * @see ETSI TS 103 191-1 Table A.3 - */ - modulepar boolean PICS_IVIM_CANCELLATION := true; - - /** - * @desc Support for IVIM NEGATION - * @see ETSI TS 103 191-1 Table A.3 - */ - modulepar boolean PICS_IVIM_NEGATION := true; - - /** - * @desc Support for IVIM RECEPTION - * @see ETSI TS 103 191-1 Table A.3 - */ - modulepar boolean PICS_IVIM_RECEPTION := true; - - /** - * @desc Minimum time interval between IVIM generations (in seconds). - * Default value, as per base standard: 4s - * @see ETSI TS 103 191-1 Table A.4 - */ - modulepar float PICS_T_GENIVIMMIN := 4.0; - - /** - * @desc Maximum time interval between IVIM generations (in seconds). - * Default value, as per base standard: 10.0s - * @see ETSI TS 103 191-1 Table A.4 - */ - modulepar float PICS_T_GENIVIMMAX := 10.000; - - /** - * @desc Support for IVIM fragmentation - * @see TODO - */ - modulepar boolean PICS_IVIM_FRAGMENTATION := false; - - /** - * @desc Support for IVIM general container - * @see TODO - */ - modulepar boolean PICS_IVIM_HAS_GENERAL_CONTAINER := false; - - /** - * @desc Support for IVIM has layout container - * @see TODO - */ - modulepar boolean PICS_IVIM_HAS_LAYOUT_CONTAINER := false; - - /** - * @desc Support for IVIM has road cfg container - * @see TODO - */ - modulepar boolean PICS_IVIM_HAS_ROAD_CFG_CONTAINER := false; - - /** - * @desc Support for IVIM has text container - * @see TODO - */ - modulepar boolean PICS_IVIM_HAS_TEXT_CONTAINER := false; - - /** - * @desc Support for IVIM rscode viennaconv - * @see TODO - */ - modulepar boolean PICS_IVIM_RSCODE_VIENNACONV := false; - - /** - * @desc Support for IVIM rscode ISO14823 - * @see TODO - */ - modulepar boolean PICS_IVIM_RSCODE_ISO14823 := false; - - /** - * @desc Support for IVIM rscode saej2540 - * @see TODO - */ - modulepar boolean PICS_IVIM_RSCODE_SAEJ2540 := false; - - /** - * @desc Support for IVIM rscode anz catalogue - * @see TODO - */ - modulepar boolean PICS_IVIM_RSCODE_ANY_CATALOGUE := false; - -} // End of module LibItsIvim_Pics \ No newline at end of file diff --git a/ttcn/IVIM/LibItsIvim_Pixits.ttcn b/ttcn/IVIM/LibItsIvim_Pixits.ttcn deleted file mode 100644 index 3f592dd4..00000000 --- a/ttcn/IVIM/LibItsIvim_Pixits.ttcn +++ /dev/null @@ -1,95 +0,0 @@ -/** - * @author ETSI / STF517 / TTF002 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/IVIM/LibItsIvim_Pixits.ttcn $ - * $Id: LibItsIvim_Pixits.ttcn 1315 2016-12-15 13:25:41Z garciay $ - * @desc IVIM PIXITS - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsIvim_Pixits { - - // LibIts - import from EfcDsrcGeneric language "ASN.1:1997" all; - import from EfcDsrcApplication language "ASN.1:1997" all; - import from IVI language "ASN.1:1997" all; - import from ITS_Container language "ASN.1:1997" all; - - /** - * @desc IUT Provider identifier - * Provider description used in IVIM messages sent by the tester - * @see ETSI TS 103 191-3 Table B.8 - */ - modulepar Provider PX_PROVIDER := { - countryCode := '0000000000'B, - providerIdentifier := 0 - } - - /** - * @desc IUT IVI identifier - * IVI identification number - * @see ETSI TS 103 191-3 Table B.8 - */ - modulepar integer PX_IVI_ID := 2; - - /** - * @desc IUT ZoneId 1 identifier - * ZoneId 1 used in IVIM messages sent by the tester - * @see ETSI TS 103 191-3 Table B.8 - */ - modulepar Zid PX_ZONEID_1 := 1; - - /** - * @desc IUT ZoneId 2 identifier - * ZoneId 2 used in IVIM messages sent by the tester - * @see ETSI TS 103 191-3 Table B.8 - */ - modulepar Zid PX_ZONEID_2 := 2; - - /** - * @desc IUT LaneId identifier - * LaneId used in IVIM messages sent by the tester - * @see ETSI TS 103 191-3 Table B.8 - */ - modulepar LanePosition PX_LANE := 1; //innermostDrivingLane(1) - - /** - * @desc IUT RelavanceZoneId identifier - * RelavanceZoneId used in IVIM messages sent by the tester - * @see ETSI TS 103 191-3 Table B.8 - */ - modulepar Zid PX_RELAVANCE_ZONEID := 1; - - /** - * @desc IUT DetectionZoneId identifier - * DetectionZoneId used in IVIM messages sent by the tester - * @see ETSI TS 103 191-3 Table B.8 - */ - modulepar Zid PX_DETECTION_ZONEID := 1; - - /** - * @desc IUT DriverAwarenesZoneId identifier - * DriverAwarenesZoneId used in IVIM messages sent by the tester - * @see ETSI TS 103 191-3 Table B.8 - */ - modulepar Zid PX_DRIVER_AWARENES_ZONEID := 1; - - /** - * @desc IUT LayoutId identifier - * LayoutId used in IVIM messages sent by the tester - * @see ETSI TS 103 191-3 Table B.8 - */ - modulepar integer PX_LAYOUTID := 1; - - /** - * @desc IUT RScode integer variant - * see TpFunction to set the correct value - * used in f_IS_IVI_RCV_SSP_BO_03 and f_IS_IVI_RCV_SSP_BO_04 - * //add others if needed - * @see ETSI TS 103 191-3 Table B.8 - */ - modulepar integer PX_RSCODE_VA := 1; - -} // End of module LibItsIvim_Pixits diff --git a/ttcn/IVIM/LibItsIvim_Templates.ttcn b/ttcn/IVIM/LibItsIvim_Templates.ttcn deleted file mode 100644 index fcc8bb0e..00000000 --- a/ttcn/IVIM/LibItsIvim_Templates.ttcn +++ /dev/null @@ -1,1056 +0,0 @@ -/** - * @author ETSI / STF517 / TTF002 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/IVIM/LibItsIvim_Templates.ttcn $ - * $Id: LibItsIvim_Templates.ttcn 1316 2017-01-03 09:03:43Z garciay $ - * @desc Module containing base template definitions for IVIM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsIvim_Templates { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from ITS_Container language "ASN.1:1997" all; - import from IVIM_PDU_Descriptions language "ASN.1:1997" all; - import from IVI language "ASN.1:1997" all; - import from EfcDsrcApplication language "ASN.1:1997" all; - import from AVIAEINumberingAndDataStructures language "ASN.1:1997" all; - import from CITSapplMgmtIDs language "ASN.1:1997" all; - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - import from LibItsCommon_Functions all; - import from LibItsCommon_Pixits all; - import from LibItsCommon_ASN1_NamedNumbers all; - - // LibItsIvim - import from LibItsIvim_TestSystem all; - import from LibItsIvim_TypesAndValues all; - import from LibItsIvim_Pixits all; - import from LibItsIvim_ASN1_IVInamedNumbers all; - - group asn1Constants { - } // End of group asn1Constants - - group primitivesTemplates { - - /** - * @desc Send template for IVI Message (IvimPort Primitive) - * @param p_iviMsg The IVI Message to be sent - */ - template (value) IvimReq m_ivimReq( - in template (value) IVIM p_iviMsg - ) := { - msgOut := p_iviMsg - } // End of template m_ivimReq - - /** - * @desc Receive template for IVI Message (IvimPort Primitive) - * @param p_iviMsg The expected IVI Message - */ - template (present) IvimInd mw_ivimInd( - template (present) IVIM p_iviMsg := ? - ) := { - msgIn := p_iviMsg, - recvTime := ?, - gnNextHeader := *, - gnHeaderType := *, - gnHeaderSubtype := *, - gnLifetime := *, - gnTrafficClass := *, - btpDestinationPort := *, - btpInfo := *, - ssp := *, - its_aid := * - } // End of template mw_ivimInd - - - /** - * @desc Receive template for IVI Message (IvimPort Primitive) - * @param p_iviMsg The expected IVI Message - * @param p_gnNextHeader GN next header value - * @param p_gnHeaderType GN header type value - * @param p_gnHeaderSubtype GN header subtype value - * @param p_gnLifetime GN packet lifetime value (ms) - * @param p_gnTrafficClass GN traffic class value - */ - template IvimInd mw_ivimIndWithGnParameters( - template (present) IVIM p_iviMsg := ?, - template UInt8 p_gnNextHeader := *, - template UInt8 p_gnHeaderType := *, - template UInt8 p_gnHeaderSubtype := *, - template UInt32 p_gnLifetime := *, - template UInt8 p_gnTrafficClass := * - ) modifies mw_ivimInd := { - gnNextHeader := p_gnNextHeader, - gnHeaderType := p_gnHeaderType, - gnHeaderSubtype := p_gnHeaderSubtype, - gnLifetime := p_gnLifetime, - gnTrafficClass := p_gnTrafficClass - } // End of template mw_ivimIndWithGnParameters - - /** - * @desc Receive template for IVI Message (IvimPort Primitive) - * @param p_iviMsg The expected IVI Message - * @param p_btpDestinationPort BTP destination port value - * @param p_btpInfo BTP destination port info value (if BTP-B) or BTP source port value (if BTP-A) - */ - template IvimInd mw_ivimIndWithBtpParameters( - template (present) IVIM p_iviMsg := ?, - template UInt16 p_btpDestinationPort := *, - template UInt16 p_btpInfo := * - ) modifies mw_ivimInd := { - btpDestinationPort := p_btpDestinationPort, - btpInfo := p_btpInfo - } // End of template mw_ivimIndWithBtpParameters - - /** - * @desc Receive template for IVI Message (IvimPort Primitive) - * @param p_iviMsg The expected IVI Message - * @param p_ssp SSP security parameter - * @param p_its_aid ITS-AID value - */ - template IvimInd mw_ivimIndWithSecurityParameters( - template (present) IVIM p_iviMsg := ?, - template Bit256 p_ssp := *, - template UInt32 p_its_aid := * - ) modifies mw_ivimInd := { - ssp := p_ssp, - its_aid := p_its_aid - } // End of template mw_ivimIndWithSecurityParameters - - group utPrimitives { - - /** - * @desc Send template for Upper Tester event initialization - */ - template (value) UtIvimInitialize m_ivimStructureInitialize( - in HashedId8 p_hashedId8 := '0000000000000000'O - ) := { - hashedId8 := p_hashedId8 - } // End of template m_ivimStructureInitialize - - /** - * @desc Send template for Upper Tester Trigger event - * @param p_repetitionInterval Repetition interval (Default: 4 seconds) - * @param p_validFrom Valid From value (Default: omit) - * @param p_validTo Valid To value (Default: omit) - * @param p_connectedIviStructures List of ConnectedIviStructure (Default: omit) - * @param p_optional_ Optional field (Default: omit) - */ - template (value) UtIvimTrigger m_utTriggerEvent( - template (omit) TimestampIts p_repetitionInterval := c_duration_4sec * 1000, // TimeStampIts in millseconds - template (omit) TimestampIts p_validFrom := omit, - template (omit) TimestampIts p_validTo := omit, - template (omit) ZidList p_zoneIds := omit, - template (omit) LanePosition p_laneNumber := omit, - template (omit) RelavanceZidList p_relavanceZoneIds := omit, - template (omit) DetectionZidList p_detectionZoneIds := omit, - template (omit) DriverAwarenesZidList p_driverAwarenesZoneIds := omit, - template (omit) VarLengthNumber p_itsRrid := omit, - template (omit) Direction p_directionGic := omit, - template (omit) integer p_layoutId := omit - ) := { - validFrom := p_validFrom, - validTo := p_validTo, - repetitionInterval := p_repetitionInterval, - zoneIds := p_zoneIds, - laneNumber := p_laneNumber, - relavanceZoneIds := p_relavanceZoneIds, - detectionZoneIds := p_detectionZoneIds, - driverAwarenesZoneIds := p_driverAwarenesZoneIds, - itsRrid := p_itsRrid, - directionGic := p_directionGic, - layoutId := p_layoutId - } // End of template m_utTriggerEvent - - /** - * @desc Send template for Upper Tester event update - * @param p_iviIdentificationNumber The p_iviIVI identification number - * @param p_timeStamp Time stamp value (Default: 2 seconds) - * @param p_validFrom Valid From value (Default: omit) - * @param p_validTo Valid To value (Default: omit) - * @param p_connectedIviStructures List of ConnectedIviStructure (Default: omit) - */ - template (omit) UtIvimUpdate m_utIvimUpdateEvent( - template (value) IviIdentificationNumber p_iviIdentificationNumber, - template (omit) TimestampIts p_timeStamp := c_duration_2sec * 1000, // TimeStampIts in millseconds - template (omit) TimestampIts p_validFrom := omit, - template (omit) TimestampIts p_validTo := omit, - template (omit) IVIManagementContainer.connectedIviStructures p_connectedIviStructures := omit - ) := { - iviIdentificationNumber := p_iviIdentificationNumber, - validFrom := p_validFrom, - validTo := p_validTo, - timeStamp := p_timeStamp, - connectedIviStructures := p_connectedIviStructures - } // End of template m_utIvimUpdateEvent - - /** - * @desc Send template for Upper Tester event cancellation - * @param p_actionId The action id - */ - template (value) UtIvimTermination m_utEventCancellation( - template (value) IviIdentificationNumber p_iviIdentificationNumber - ) := { - iviIdentificationNumber := p_iviIdentificationNumber - } // End of template m_utEventCancellation - - } // End of group utPrimitives - - } // End of group primitivesTemplates - - group headerTemplates { - - /** - * @desc Default send template for ITS PDU header - * @param p_stationID The source station ID (Default: test system station id) - * @param p_protocolVersion The protocol version (Default: current IVI protocol version) - * @param p_messageID The message Id (Default: IVI message id) - */ - template (value) ItsPduHeader m_itsPduHeader( - template (value) StationID p_stationID := f_getTsStationId(), - template (value) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, - template (value) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_ivim_ - ) := { - protocolVersion := p_protocolVersion, - messageID := p_messageID, - stationID := p_stationID - } // End of template m_itsPduHeader - - /** - * @desc Default receive template for ITS PDU header - * @param p_stationID The expected station id (Default: any) - * @param p_protocolVersion The expected protocol version (Default: current IVI protocol version) - * @param p_messageID The expected message id (Default: IVI message id) - */ - template (present) ItsPduHeader mw_itsPduHeader( - template (present) StationID p_stationID := ?, - template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, - template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_ivim_ - ) := { - protocolVersion := p_protocolVersion, - messageID := p_messageID, - stationID := p_stationID - } // End of template mw_itsPduHeader - - template (present) StationID mw_anyStationId := ?; - - } // End of group headerTemplates - - group ivimPduTemplates { - - /** - * @desc Send template for IVIM PDU - * @param p_ivim The IVI Message - */ - template (value) IVIM m_ivimStructurePdu( - template (value) IviStructure p_ivim - ) := { - header := m_itsPduHeader, - ivi := p_ivim - } // End of template m_ivimStructurePdu - - /** - * @desc Default receive template for IVIM PDU - * @param p_itsPduHeader The expected ITS PDU header (Default: any) - * @param p_ivim The expected IVI Message (Default: any) - */ - template (present) IVIM mw_anyIvimPdu( - template (present) ItsPduHeader p_itsPduHeader := ?, - template (present) IviStructure p_ivim := ? - ) := { - header := p_itsPduHeader, - ivi := p_ivim - } // End of template mw_anyIvimPdu - - /** - * @desc Receive template for IVIM PDU - * @param p_ivim The expected IVI Message - * @param p_stationID The expected station id (Default: any) - * @param p_protocolVersion The expected protocol version (Default: current IVI protocol version) - * @param p_messageID The expected message id (Default: IVI message id) - */ - template (present) IVIM mw_ivimPdu( - template (present) IviStructure p_ivim := ?, - template (present) StationID p_stationID := ?, - template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, - template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_ivim_ - ) := { - header := mw_itsPduHeader(p_stationID, p_protocolVersion, p_messageID), - ivi := p_ivim - } // End of template mw_ivimPdu - - } // End of group ivimPduTemplates - - group iviStructureTemplates { - - /** - * @desc Send template for IVI Message - * @param p_mandatory The Management Container - * @param p_optional_ A list of IVI Container (Default: omit) - */ - template (omit) IviStructure m_ivimStructure( - in template (value) IVIManagementContainer p_mandatory, - in template (omit) IviStructure.optional_ p_optional_ := omit - ) := { - mandatory := p_mandatory, - optional_ := p_optional_ - } // End of template m_ivimStructure - - /** - * @desc Receive template for IVI Message - * @param p_mandatory The Management Container - * @param p_optional_ A list of IVI Container (Default: omit) - */ - template (present) IviStructure mw_ivimStructure( - template (present) IVIManagementContainer p_mandatory := ?, - template IviStructure.optional_ p_optional_ := * - ) := { - mandatory := p_mandatory, - optional_ := p_optional_ - } // End of template mw_ivimStructure - - /** - * @desc Send template for DEN Message for event termination. - * @param p_iviIdentificationNumber The IVIM identification number - */ - template (value) IviStructure m_ivimStructureCancellation( - in template (value) IviIdentificationNumber p_iviIdentificationNumber - ) := { - mandatory := valueof(m_iviManagementContainer(f_getProvider(), valueof(p_iviIdentificationNumber), IviStatus_cancellation_)), - optional_ := omit - } // End of template m_ivimStructureCancellation - - } // End of group iviStructureTemplates - - group iviManagementContainerGroup { - - /** - * @desc Send template for IVIManagement container - * @param p_serviceProviderId The IUT provider description - * @param p_iviIdentificationNumber The IVIM identification number - * @param p_iviStatus The IVIM status - */ - template (omit) IVIManagementContainer m_iviManagementContainer( - in template (value) Provider p_serviceProviderId, - in template (value) IviIdentificationNumber p_iviIdentificationNumber, - in template (value) IviStatus p_iviStatus, - in template (omit) IVIManagementContainer.connectedIviStructures p_connectedIviStructures := omit, - in template (omit) IVIManagementContainer.timeStamp p_timeStamp := f_getCurrentTime() - ) := { - serviceProviderId := p_serviceProviderId, - iviIdentificationNumber := p_iviIdentificationNumber, - timeStamp := p_timeStamp, - validFrom := omit, - validTo := omit, - connectedIviStructures := p_connectedIviStructures, - iviStatus := p_iviStatus - } // End of template m_iviManagementContainer - - /** - * @desc Receive template for IVIManagement container - * @param p_serviceProviderId The IUT provider description - * @param p_iviIdentificationNumber The IVIM identification number - * @param p_iviStatus The IVIM status - */ - template (present) IVIManagementContainer mw_iviManagementContainer( - template (present) Provider p_serviceProviderId := ?, - template (present) IviIdentificationNumber p_iviIdentificationNumber := ?, - template (present) IviStatus p_iviStatus := ? - ) := { - serviceProviderId := p_serviceProviderId, - iviIdentificationNumber := p_iviIdentificationNumber, - timeStamp := *, - validFrom := *, - validTo := *, - connectedIviStructures := *, - iviStatus := p_iviStatus - } // End of template mw_iviManagementContainer - - /** - * @desc Receive template for IVIManagement container - * @param p_serviceProviderId The IUT provider description - * @param p_iviIdentificationNumber The IVIM identification number - * @param p_iviStatus The IVIM status - * @param p_timeStamp Time stamp value - */ - template (present) IVIManagementContainer mw_iviManagementContainer_timestamp( - template (present) Provider p_serviceProviderId := ?, - template (present) IviIdentificationNumber p_iviIdentificationNumber := ?, - template (present) IviStatus p_iviStatus := ?, - template (present) TimestampIts p_timeStamp := ? - ) modifies mw_iviManagementContainer := { - timeStamp := p_timeStamp - } // End of template mw_iviManagementContainer_timestamp - - /** - * @desc Receive template for IVIManagement container - * @param p_serviceProviderId The IUT provider description - * @param p_iviIdentificationNumber The IVIM identification number - * @param p_iviStatus The IVIM status - * @param p_validTo Valid To value - */ - template (present) IVIManagementContainer mw_iviManagementContainer_validTo( - template (present) Provider p_serviceProviderId := ?, - template (present) IviIdentificationNumber p_iviIdentificationNumber := ?, - template (present) IviStatus p_iviStatus := ?, - template (present) TimestampIts p_validTo := ? - ) modifies mw_iviManagementContainer := { - validTo := p_validTo - } // End of template mw_iviManagementContainer_validTo - - /** - * @desc Receive template for IVIManagement container - * @param p_serviceProviderId The IUT provider description - * @param p_iviIdentificationNumber The IVIM identification number - * @param p_iviStatus The IVIM status - * @param p_validFrom Valid From value - */ - template (present) IVIManagementContainer mw_iviManagementContainer_validFrom( - template (present) Provider p_serviceProviderId := ?, - template (present) IviIdentificationNumber p_iviIdentificationNumber := ?, - template (present) IviStatus p_iviStatus := ?, - template (present) TimestampIts p_validFrom := ? - ) modifies mw_iviManagementContainer := { - validFrom := p_validFrom - } // End of template mw_iviManagementContainer_validFrom - - /** - * @desc Receive template for IVIManagement container - * @param p_serviceProviderId The IUT provider description - * @param p_iviIdentificationNumber The IVIM identification number - * @param p_iviStatus The IVIM status - * @param p_connectedIviStructures The IVIM connectedIviStructures - */ - template (present) IVIManagementContainer mw_iviManagementContainer_connectedIviStructures( - template (present) Provider p_serviceProviderId := ?, - template (present) IviIdentificationNumber p_iviIdentificationNumber := ?, - template (present) IviStatus p_iviStatus := ?, - template (present) IVIManagementContainer.connectedIviStructures p_connectedIviStructures := ? - ) modifies mw_iviManagementContainer := { - connectedIviStructures := p_connectedIviStructures - } // End of template mw_iviManagementContainer - - /** - * @desc Receive template for Porvide identifier - * @param p_countryCode Country code value - * @param p_providerIdentifier Provider Identifier value - */ - template (present) Provider mw_provider( - template (present) CountryCode p_countryCode := ?, - template (present) AVIAEIIssuerIdentifier p_providerIdentifier := ? - ) := { - countryCode := p_countryCode, - providerIdentifier := p_providerIdentifier - } // End of template mw_provider - - } // End of group iviManagementContainerGroup - - group connectedIviStructuresGroup { - - } // End of group connectedIviStructuresGroup - - group iviContainerGroup { - - template (value) IviContainer m_iviContainer_geographicLocationContainer( - in template (value) GeographicLocationContainer p_glc - ) := { - glc := p_glc - } // End of template m_iviContainer_geographicLocationContainer - - template (present) IviContainer mw_iviContainer_geographicLocationContainer( - template (present) GeographicLocationContainer p_glc := ? - ) := { - glc := p_glc - } // End of template mw_iviContainer_geographicLocationContainer - - template (value) IviContainer m_iviContainer_generalIviContainer( - in template (value) GeneralIviContainer p_giv - ) := { - giv := p_giv - } // End of template m_iviContainer_generalIviContainer - - template (present) IviContainer mw_iviContainer_generalIviContainer( - template (present) GeneralIviContainer p_giv := ? - ) := { - giv := p_giv - } // End of template mw_iviContainer_generalIviContainer - - template (value) IviContainer m_iviContainer_roadConfigurationContainer( - in template (value) RoadConfigurationContainer p_rcc - ) := { - rcc := p_rcc - } // End of template m_iviContainer_roadConfigurationContainer - - template (present) IviContainer mw_iviContainer_roadConfigurationContainer( - template (present) RoadConfigurationContainer p_rcc := ? - ) := { - rcc := p_rcc - } // End of template mw_iviContainer_roadConfigurationContainer - - template (value) IviContainer m_iviContainer_textContainer( - in template (value) TextContainer p_tc - ) := { - tc := p_tc - } // End of template m_iviContainer_textContainer - - template (present) IviContainer mw_iviContainer_textContainer( - template (present) TextContainer p_tc := ? - ) := { - tc := p_tc - } // End of template mw_iviContainer_textContainer - - template (value) IviContainer m_iviContainer_layoutContainer( - in template (value) LayoutContainer p_lac - ) := { - lac := p_lac - } // End of template m_iviContainer_layoutContainer - - template (present) IviContainer mw_iviContainer_layoutContainer( - template (present) LayoutContainer p_lac := ? - ) := { - lac := p_lac - } // End of template mw_iviContainer_layoutContainer - - } // End of group iviContainerGroup - - group geographicLocationContainerGroup { - - template (value) GeographicLocationContainer m_geographicLocationContainer( - in template (value) ReferencePosition p_referencePosition, - in template (value) GeographicLocationContainer.parts p_parts - ) := { - referencePosition := p_referencePosition, - referencePositionTime := omit, - referencePositionHeading := omit, - referencePositionSpeed := omit, - parts := p_parts - } // End of template m_geographicLocationContainer - - template (present) GeographicLocationContainer mw_geographicLocationContainer( - template (present) ReferencePosition p_referencePosition := ?, - template (present) GeographicLocationContainer.parts p_parts := ? - ) := { - referencePosition := p_referencePosition, - referencePositionTime := *, - referencePositionHeading := *, - referencePositionSpeed := *, - parts := p_parts - } // End of template mw_geographicLocationContainer - - template (omit) GlcPart m_glcPart( - in template (value) Zid p_zoneId, - in template (omit) LanePosition p_laneNumber := omit, - in template (omit) GlcPart.zoneExtension p_zoneExtension := omit, - in template (omit) HeadingValue p_zoneHeading := omit, - in template (omit) Zone p_zone := omit - ) := { - zoneId := p_zoneId, - laneNumber := p_laneNumber, - zoneExtension := p_zoneExtension, - zoneHeading := p_zoneHeading, - zone := p_zone - } // End of template m_glcPart - - template GlcPart mw_glcPart( - template (present) Zid p_zoneId := ?, - template LanePosition p_laneNumber := *, - template GlcPart.zoneExtension p_zoneExtension := *, - template HeadingValue p_zoneHeading := *, - template Zone p_zone := * - ) := { - zoneId := p_zoneId, - laneNumber := p_laneNumber, - zoneExtension := p_zoneExtension, - zoneHeading := p_zoneHeading, - zone := p_zone - } // End of template mw_glcPart - - template (value) ReferencePosition m_referencePosition( - in template (value) Latitude p_latitude := 10000, - in template (value) Longitude p_longitude := 10000, - in template (value) PosConfidenceEllipse p_position, - in template (value) Altitude p_altitude - ) := { - latitude := p_latitude, - longitude := p_longitude, - positionConfidenceEllipse := p_position, - altitude := p_altitude - } // End of template m_referencePosition - - template (value) ReferencePosition m_referencePosition_sample( - in template (value) Latitude p_latitude := 10000, - in template (value) Longitude p_longitude := 10000 - ) := { - latitude := p_latitude, - longitude := p_longitude, - positionConfidenceEllipse := - { - semiMajorConfidence := 1000, - semiMinorConfidence := 1000, - semiMajorOrientation := 1000 - }, - altitude := - { - altitudeValue := 10000, - altitudeConfidence := alt_000_01//unavailable - } - } // End of template m_referencePosition - - template Zone m_zone_segment( - template (value) Segment p_segment := m_segment - ) := { - segment := p_segment - } // End of template m_zone_segment - - template Zone m_zone_polygonalLine( - template (value) PolygonalLine p_area := m_polygonalLine_deltaPositions - ) := { - area := p_area - } // End of template m_zone_polygonalLine - - template Segment m_segment( - template (value) PolygonalLine p_line := m_polygonalLine_deltaPositions, - template (omit) IVILaneWidth p_laneWidth := omit - ) := { - line := p_line, - laneWidth := p_laneWidth - } // End of template m_segment - - template PolygonalLine m_polygonalLine_deltaPositions( - template (value) PolygonalLine.deltaPositions p_deltaPositions := {m_deltaPosition} - ) := { - deltaPositions := p_deltaPositions - } // End of template m_segment - - template DeltaPosition m_deltaPosition( - template (value) DeltaLatitude p_deltaLatitude := 9997, - template (value) DeltaLongitude p_deltaLongitude := 9998 - ) := { - deltaLatitude := p_deltaLatitude, - deltaLongitude := p_deltaLongitude - } // End of template m_segment - - - - } // End of group geographicLocationContainerGroup - - group generalIviContainerGroup { - - template (value) GicPart m_gicPart_basic( - in template (value) IviType p_iviType, - in template (value) GicPart.roadSignCodes p_roadSignCodes - ) := { - detectionZoneIds := omit, - its_Rrid := omit, - relevanceZoneIds := omit, - direction := omit, - driverAwarenessZoneIds := omit, - minimumAwarenessTime := omit, - applicableLanes := omit, - iviType := p_iviType, - iviPurpose := omit, - laneStatus := omit, - vehicleCharacteristics := omit, - driverCharacteristics := omit, - layoutId := omit, - preStoredlayoutId := omit, - roadSignCodes := p_roadSignCodes, - extraText := omit - } // End of template m_gicPart_basic - - template (value) GicPart m_gicPart_relavanceZoneId( - in template (value) IviType p_iviType := IviType_regulatoryMessages_, - in template (value) GicPart.roadSignCodes p_roadSignCodes := {m_rSCode_itisCodes}, - in template (value) GicPart.relevanceZoneIds p_relevanceZoneIds := {PX_RELAVANCE_ZONEID} - ) modifies m_gicPart_basic:= { - relevanceZoneIds := p_relevanceZoneIds, - iviType := p_iviType, - roadSignCodes := p_roadSignCodes - } // End of template m_gicPart_relavanceZoneId - - template (value) GicPart m_gicPart_relavanceZoneId_detectionZoneId_direction( - in template (value) IviType p_iviType := IviType_regulatoryMessages_, - in template (value) GicPart.roadSignCodes p_roadSignCodes := {m_rSCode_itisCodes}, - in template (value) GicPart.relevanceZoneIds p_relevanceZoneIds := {PX_RELAVANCE_ZONEID}, - in template (value) GicPart.detectionZoneIds p_detectionZoneIds := {PX_DETECTION_ZONEID}, - in template (value) GicPart.direction p_direction := Direction_sameDirection_ - ) modifies m_gicPart_basic:= { - detectionZoneIds := p_detectionZoneIds, - relevanceZoneIds := p_relevanceZoneIds, - direction := p_direction, - iviType := p_iviType, - roadSignCodes := p_roadSignCodes - } // End of template m_gicPart_relavanceZoneId_detectionZoneId_direction - - template (value) GicPart m_gicPart_laneStatus( - in template (value) IviType p_iviType := IviType_regulatoryMessages_, - in template (value) GicPart.roadSignCodes p_roadSignCodes := {m_rSCode_itisCodes}, - in template (value) GicPart.laneStatus p_laneStatus := LaneStatus_open_ - ) modifies m_gicPart_basic:= { - iviType := p_iviType, - laneStatus := p_laneStatus, - roadSignCodes := p_roadSignCodes - } // End of template m_gicPart_relavanceZoneId - - template (present) GicPart mw_gicPart_basic( - template (present) IviType p_iviType := ?, - template (present) GicPart.roadSignCodes p_roadSignCodes := ? - ) := { - detectionZoneIds := *, - its_Rrid := *, - relevanceZoneIds := *, - direction := *, - driverAwarenessZoneIds := *, - minimumAwarenessTime := *, - applicableLanes := *, - iviType := p_iviType, - iviPurpose := *, - laneStatus := *, - vehicleCharacteristics := *, - driverCharacteristics := *, - layoutId := *, - preStoredlayoutId := *, - roadSignCodes := p_roadSignCodes, - extraText := * - } // End of template mw_gicPart - - template (present) GicPart mw_gicPart_layoutId( - template (present) IviType p_iviType := ?, - template (present) GicPart.roadSignCodes p_roadSignCodes := ?, - template (present) integer p_layoutId := ? - ) modifies mw_gicPart_basic := { - layoutId := p_layoutId - } // End of template mw_gicPart_layoutId - - template (present) GicPart mw_gicPart_allZoneIdsAndItsRridAndDirection( - template (present) IviType p_iviType := ?, - template (present) GicPart.roadSignCodes p_roadSignCodes := ?, - template GicPart.detectionZoneIds p_detectionZoneIds := *, - template VarLengthNumber p_varLengthNumber := *, - template GicPart.relevanceZoneIds p_relevanceZoneIds := *, - template Direction p_direction := *, - template GicPart.driverAwarenessZoneIds p_driverAwarenessZoneIds := * - ) modifies mw_gicPart_basic := { - detectionZoneIds := p_detectionZoneIds, - its_Rrid := p_varLengthNumber, - relevanceZoneIds := p_relevanceZoneIds, - direction := p_direction, - driverAwarenessZoneIds := p_driverAwarenessZoneIds - } // End of template mw_gicPart - - template (present) RSCode mw_rSCode( - template RSCode.layoutComponentId p_layoutComponentId := *, - template (present) RSCode.code p_code := ? - ) := { - layoutComponentId := p_layoutComponentId, - code := p_code - } // End of template mw_rSCode - - template (present) RSCode mw_rSCode_viennaConvention( - template RSCode.layoutComponentId p_layoutComponentId := * - ) := { - layoutComponentId := p_layoutComponentId, - code := { - viennaConvention := ? - } - } // End of template mw_rSCode_viennaConvention - - template (present) RSCode mw_rSCode_iso14823( - template RSCode.layoutComponentId p_layoutComponentId := * - ) := { - layoutComponentId := p_layoutComponentId, - code := { - iso14823 := ? - } - } // End of template mw_rSCode_iso14823 - - template (present) RSCode mw_rSCode_itisCodes( - template RSCode.layoutComponentId p_layoutComponentId := * - ) := { - layoutComponentId := p_layoutComponentId, - code := { - itisCodes := ? - } - } // End of template mw_rSCode_itisCodes - - template (present) RSCode mw_rSCode_anyCatalogue( - template RSCode.layoutComponentId p_layoutComponentId := * - ) := { - layoutComponentId := p_layoutComponentId, - code := { - anyCatalogue := ? - } - } // End of template mw_rSCode_anyCatalogue - - template (value) RSCode m_rSCode_itisCodes := { - layoutComponentId := omit, - code := { - itisCodes := 100 - } - } // End of template m_rSCode_itisCodes - - template (value) RSCode m_rSCode_viennaConvention := { - layoutComponentId := omit, - code := { - viennaConvention := - { - roadSignClass := 1, // classB (1), - roadSignCode := 2, //INTEGER (1..64), - vcOption := 1, //a(1), - validity := omit, - value_ := omit, - unit := omit - } - } - } // End of template m_rSCode_viennaConvention - - template (value) RSCode m_rSCode_iso14823_trafficSignPictogram ( - template (value) RSCode.code.iso14823.pictogramCode.serviceCategoryCode.trafficSignPictogram p_trafficSignPictogram := dangerWarning - ):= { - layoutComponentId := omit, - code := { - iso14823 := { - pictogramCode := { - countryCode := omit, - serviceCategoryCode := { - trafficSignPictogram := p_trafficSignPictogram - }, - pictogramCategoryCode := { - nature := 2, - serialNumber := 3 - } - }, - attributes := omit - } - } - } // End of template m_rSCode_iso14823_trafficSignPictogram - - template (value) RSCode m_rSCode_iso14823_publicFacilitiesPictogram := { - layoutComponentId := omit, - code := { - iso14823 := { - pictogramCode := { - countryCode := omit, - serviceCategoryCode := { - publicFacilitiesPictogram := publicFacilities - }, - pictogramCategoryCode := { - nature := 2, - serialNumber := 3 - } - }, - attributes := omit - } - } - } // End of template m_rSCode_iso14823_publicFacilitiesPictogram - - template (value) RSCode m_rSCode_iso14823_ambientOrRoadConditionPictogram ( - template (value) RSCode.code.iso14823.pictogramCode.serviceCategoryCode.ambientOrRoadConditionPictogram p_ambientOrRoadConditionPictogram := ambientCondition - ):= { - layoutComponentId := omit, - code := { - iso14823 := { - pictogramCode := { - countryCode := omit, - serviceCategoryCode := { - ambientOrRoadConditionPictogram := p_ambientOrRoadConditionPictogram - }, - pictogramCategoryCode := { - nature := 2, - serialNumber := 3 - } - }, - attributes := omit - } - } - } // End of template m_rSCode_iso14823_ambientOrRoadConditionPictogram - - } // End of group generalIviContainerGroup - - group layoutContainerGroup { - - template (value) LayoutContainer m_layoutContainer( - in template (value) LayoutContainer.layoutComponents p_layoutComponents := {m_layoutComponent} - ) := { - layoutId := 1, - height := omit, - width := omit, - layoutComponents := p_layoutComponents - } // End of template m_tcPart_basic - - template (present) LayoutContainer mw_layoutContainer( - template (present) LayoutContainer.layoutComponents p_layoutComponents := ? - ) := { - layoutId := ?, - height := *, - width := *, - layoutComponents := p_layoutComponents - } // End of template mw_tcPart_basic - - template (value) LayoutComponent m_layoutComponent := { - layoutComponentId := 1, - height := 10, - width := 11, - x := 12, - y := 13, - textScripting := 1 - } // End of template m_layoutComponent - - } //end group layoutContainerGroup - - group roadConfigurationContainerGroup { - - template (value) RccPart m_rccPart( - in template (value) RccPart.zoneIds p_zoneIds, - in template (value) RoadType p_roadType, - in template (value) RccPart.laneConfiguration p_laneConfiguration - ) := { - zoneIds := p_zoneIds, - roadType := p_roadType, - laneConfiguration := p_laneConfiguration - } // End of template m_rccPart - - template (present) RccPart mw_rccPart( - template (present) RccPart.zoneIds p_zoneIds := ?, - template (present) RoadType p_roadType := ?, - template (present) RccPart.laneConfiguration p_laneConfiguration := ? - ) := { - zoneIds := p_zoneIds, - roadType := p_roadType, - laneConfiguration := p_laneConfiguration - } // End of template mw_rccPart - - template (present) LaneInformation mw_laneInformation( - template (present) LanePosition p_lanePosition := ?, - template (present) Direction p_direction := ?, - template (present) LaneType p_laneType := ?, - template (present) LaneStatus p_laneStatus := ? - ) := { - laneNumber := p_lanePosition, - direction := p_direction, - validity := *, //DTM - laneType := p_laneType, - laneTypeQualifier := *, //CompleteVehicleCharacteristics - laneStatus := p_laneStatus, - laneWidth := * //IVILaneWidth - } - - template (value) LaneInformation m_laneInformation( - template (value) LanePosition p_lanePosition := LanePosition_innerHardShoulder_, - template (value) Direction p_direction := Direction_sameDirection_, - template (value) LaneType p_laneType := LaneType_traffic_, - template (value) LaneStatus p_laneStatus := LaneStatus_open_ - ) := { - laneNumber := p_lanePosition, - direction := p_direction, - validity := omit, //DTM - laneType := p_laneType, - laneTypeQualifier := omit, //CompleteVehicleCharacteristics - laneStatus := p_laneStatus, - laneWidth := omit //IVILaneWidth - } - - } // End of group roadConfigurationContainerGroup - - group textContainerGroup { - - template (value) TcPart m_tcPart_basic( - in template (value) TcPart.relevanceZoneIds p_relevanceZoneIds, - in template (value) TcPart.data p_data - ) := { - detectionZoneIds := omit, - relevanceZoneIds := p_relevanceZoneIds, - direction := omit, - driverAwarenessZoneIds := omit, - minimumAwarenessTime := omit, - applicableLanes := omit, - layoutId := omit, - preStoredlayoutId := omit, - text := omit, - data := p_data - } // End of template m_tcPart_basic - - template (present) TcPart mw_tcPart_basic( - template (present) TcPart.relevanceZoneIds p_relevanceZoneIds := ?, - template (present) TcPart.data p_data := ? - ) := { - detectionZoneIds := *, - relevanceZoneIds := p_relevanceZoneIds, - direction := *, - driverAwarenessZoneIds := *, - minimumAwarenessTime := *, - applicableLanes := *, - layoutId := *, - preStoredlayoutId := *, - text := *, - data := p_data - } // End of template mw_tcPart_basic - - template (present) TcPart mw_tcPart_allZoneIds( - template (present) TcPart.relevanceZoneIds p_relevanceZoneIds := ?, - template (present) TcPart.data p_data := ?, - template (present) TcPart.detectionZoneIds p_detectionZoneIds := ?, - template (present) TcPart.driverAwarenessZoneIds p_driverAwarenessZoneIds := ? - ) modifies mw_tcPart_basic := { - detectionZoneIds := p_detectionZoneIds, - driverAwarenessZoneIds := p_driverAwarenessZoneIds - } // End of template mw_tcPart_allZoneIds - - template (present) TcPart mw_tcPart_direction( - template (present) TcPart.relevanceZoneIds p_relevanceZoneIds := ?, - template (present) TcPart.data p_data := ?, - template (present) TcPart.direction p_direction := ? - ) modifies mw_tcPart_basic := { - relevanceZoneIds := p_relevanceZoneIds - } // End of template mw_tcPart_direction - - template (present) TcPart mw_tcPart_text( - template (present) TcPart.relevanceZoneIds p_relevanceZoneIds := ?, - template (present) TcPart.data p_data := ?, - template (present) TcPart.text p_text := ? - ) modifies mw_tcPart_basic := { - text := p_text - } // End of template mw_tcPart_text - - template (present) TcPart mw_tcPart_layoutId( - template (present) TcPart.relevanceZoneIds p_relevanceZoneIds := ?, - template (present) TcPart.data p_data := ?, - template (present) TcPart.layoutId p_layoutId := ? - ) modifies mw_tcPart_basic := { - layoutId := p_layoutId - } // End of template mw_tcPart_layoutId - - template (present) Text mw_text := { - layoutComponentId := *, - language_ := ?, - textContent := ? - } - - } // End of group textContainerGroup - - group itsFunction { - - /** - * @desc Gets the Provifr of test system - * @return Test system's Provider value - * @see PX_PROVIDER - */ - function f_getProvider() - return Provider { - - return PX_PROVIDER; - - } // End of function f_getProvider - - } // End of group itsFunction - -} // End of module LibItsIvimTemplates diff --git a/ttcn/IVIM/LibItsIvim_TestSystem.ttcn b/ttcn/IVIM/LibItsIvim_TestSystem.ttcn deleted file mode 100644 index 1808ecf9..00000000 --- a/ttcn/IVIM/LibItsIvim_TestSystem.ttcn +++ /dev/null @@ -1,166 +0,0 @@ -/** - * @author ETSI / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/IVIM/LibItsIvim_TestSystem.ttcn $ - * $Id: LibItsIvim_TestSystem.ttcn,v 1.2 2018/05/31 15:57:12 dte Exp $ - * @desc Test System module for ITS IVIM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsIvim_TestSystem { - - // LibCommon - import from LibCommon_Time {modulepar all}; - import from LibCommon_Sync all; - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from IVIM_PDU_Descriptions language "ASN.1:1997" all; - import from ITS_Container language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TestSystem all; - import from LibItsCommon_TypesAndValues all; - - // LibItsIvim - import from LibItsIvim_TypesAndValues all; - - group portDefinitions { - - /** - * @desc Adapter control port - */ - type port AdapterControlPort message { - out - AcGnssPrimitive, AcSecPrimitive; - in - AdapterControlResults; - } // end AdapterControlPort - - /** - * @desc Upper Tester port - */ - type port UpperTesterPort message { - out - UtIvimInitialize, UtIvimTrigger, UtIvimUpdate, UtIvimTermination; - in - UtIvimResults, UtIvimEventInd; - } // end UpperTesterPort - - } // end portDefinitions - group interfacePorts { - - group facilityPorts { - - group fa1Ports { - - /** - * @desc FA1 IVIM Port (IVIM/BTP/GeoNet/G5) - */ - type port IvimPort message { - in IvimInd; - out IvimReq; - } // End of port IvimPort - - } // End of group fa1Ports - - } // End of group facilityPorts - - } // End of group interfacePorts - - group componentDefinitions { - - /** - * @desc ITS System Adapter - */ - type component ItsIvimSystem { - - port UpperTesterPort utPort; - port AdapterControlPort acPort; - - // FA1 ports - port IvimPort ivimPort; - - } // end component ItsAdapter - - } // End of group componentDefinitions - - /** - * @desc Test component for ITS Facility layer - */ - type component ItsIvim extends ItsBaseComponent { - - port AdapterControlPort acPort; - port UpperTesterPort utPort; - - // FA1 ports - port IvimPort ivimPort; - - //timers - - //component variables - - //default - var default vc_default := null; - - //global variables - var SequenceNumber vc_sequenceNo := 0; - var boolean vc_ivimReceived := false; - - var UtIvimEventIndList vc_utEvents := {}; - - var boolean vc_ivimDefaultActive := true; - } // End of component ItsIvim - - group facilityPrimitives { - - group fa1Primitives { - - /** - * @desc FA1 IVIM Indication Primitive - * - * @member ivimMsg - */ - type record IvimInd { - IVIM msgIn, - UInt64 recvTime, - UInt8 gnNextHeader optional, - UInt8 gnHeaderType optional, - UInt8 gnHeaderSubtype optional, - UInt32 gnLifetime optional, - UInt8 gnTrafficClass optional, - UInt16 btpDestinationPort optional, - UInt16 btpInfo optional, - Bit256 ssp optional, - UInt32 its_aid optional - } - with { - encode (msgIn) "PER" - } - - /** - * @desc FA1 IVIM Request Primitive - * - * @member ivimMsg - */ - type record IvimReq { - IVIM msgOut - } - with { - encode (msgOut) "PER" - } - - } // End of group fa1Primitives - - } // End of group facilityPrimitives - with { - variant "" - encode "LibIts_Interface" - } // end interfacePrimitives - -} // End of module LibItsIvim_TestSystem - - diff --git a/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn b/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn deleted file mode 100644 index cb16e7f9..00000000 --- a/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn +++ /dev/null @@ -1,203 +0,0 @@ -/** - * @author ETSI / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn $ - * $Id: LibItsIvim_TypesAndValues.ttcn,v 1.4 2019/01/02 14:14:11 dte Exp $ - * @desc Module containing type and value definitions for IVIM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsIvim_TypesAndValues { - - // LibCommon - import from LibCommon_DataStrings all; - import from LibCommon_BasicTypesAndValues all; - - // LibIts - import from IVIM_PDU_Descriptions language "ASN.1:1997" all; - import from IVI language "ASN.1:1997" all; - import from ITS_Container language "ASN.1:1997" all; - import from CITSapplMgmtIDs language "ASN.1:1997" all; - - group actionTypes { - - /** - * @desc Indication of whether event cancellation has to be raised by the test system or iut - */ - type enumerated Trigger { - e_ets(0), - e_iut(1) - } - - } // End ofgroup actionTypes - - group ivimConstants { - - const TimestampIts c_repetition_interval_deactivated := 0; - const TimestampIts c_duration_2sec := 2; // FIXME Change them into milliseconds and remove *1000 factor in Tp & Template (default values) - const TimestampIts c_duration_4sec := 4; - const TimestampIts c_duration_6sec := 6; - - type record of float Times; - } // End ofgroup ivimConstants - - group otherTypes { - - /** - * @desc List of UtIvimTriggers used in behaviours - */ - type record of UtIvimTrigger UtIvimTriggerList; - - /** - * @desc List of IviIdentificationNumbers used in behaviours - */ - type record of IviIdentificationNumber IviIdentificationNumberList; - - /** - * @desc List of ZoneIds - */ - type record of Zid ZidList; - - /** - * @desc List of RelavanceZoneIds - */ - type record of Zid RelavanceZidList; - - /** - * @desc List of DetectionZoneIds - */ - type record of Zid DetectionZidList; - - /** - * @desc List of DriverAwarenesZoneIds - */ - type record of Zid DriverAwarenesZidList; - - } - - group utPrimitives { - - /** - * @desc Upper Tester message to initialize IUT - * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use - */ - type record UtIvimInitialize { - Oct8 hashedId8 - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester results message of the IVIM IUT - * @member utIvimInitialize - - * @member utIvimTriggerResult - - * @member utIvimUpdateResult, - - * @member utIvimTerminationResult - - */ - type union UtIvimResults { - boolean utIvimInitializeResult, - UtIvimTriggerResult utIvimTriggerResult, - UtIvimUpdateResult utIvimUpdateResult, - boolean utIvimTerminationResult - } with { - variant "" - } // End of type UtIvimResults - - /** - * @desc Upper Tester message to request triggering of an event at IUT - */ - type record UtIvimTrigger { - TimestampIts validFrom optional, - TimestampIts validTo optional, - TimestampIts repetitionInterval optional, - ZidList zoneIds optional, - LanePosition laneNumber optional, - RelavanceZidList relavanceZoneIds optional, - DetectionZidList detectionZoneIds optional, - DriverAwarenesZidList driverAwarenesZoneIds optional, - VarLengthNumber itsRrid optional, - Direction directionGic optional, - integer layoutId optional - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester result message of request of triggering of an event at IUT - */ - type record UtIvimTriggerResult { - boolean result, - IviIdentificationNumber iviIdentificationNumber - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to update an event at IUT - */ - type record UtIvimUpdate { - IviIdentificationNumber iviIdentificationNumber, - TimestampIts validFrom optional, - TimestampIts validTo optional, - TimestampIts timeStamp optional, // FIXME Rename timeStamp into repetitionInterval as described in ETSI TR 103 099 Clause C.9.2 UpdateIvimEvent - IVIManagementContainer.connectedIviStructures connectedIviStructures optional - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester result message of an update request of an event on Ivim IUT - */ - type record UtIvimUpdateResult { - boolean result, - IviIdentificationNumber iviIdentificationNumber - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to request the termination of an event at IUT - */ - type record UtIvimTermination { - IviIdentificationNumber iviIdentificationNumber - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester result message of termination of an event on Ivim IUT - */ - //type boolean UtIvimTerminationResult; - - /** - * @desc Upper Tester message to check event/status on Ivim IUT - */ - type record UtIvimEventInd { - IVIM iviMsg - } with { - encode (iviMsg) "LibItsIvim_asn1" - } - - /** - * @desc List of Upper Tester messages to check event/status on Ivim IUT - */ - type record of UtIvimEventInd UtIvimEventIndList; - - /** - * @desc List of ActionID received in response to the Upper Tester triggered messages - */ - type record of ActionID UtIvimActionIDList; - - } - with { - encode "UpperTester" - variant "" - } -} -with { - encode "LibItsIvim" -} - - diff --git a/ttcn/IVIM/module.mk b/ttcn/IVIM/module.mk deleted file mode 100644 index 72982712..00000000 --- a/ttcn/IVIM/module.mk +++ /dev/null @@ -1,8 +0,0 @@ -sources := LibItsIvim_ASN1_IVInamedNumbers.ttcn \ - LibItsIvim_EncdecDeclarations.ttcn \ - LibItsIvim_Functions.ttcn \ - LibItsIvim_Pics.ttcn \ - LibItsIvim_Pixits.ttcn \ - LibItsIvim_Templates.ttcn \ - LibItsIvim_TestSystem.ttcn \ - LibItsIvim_TypesAndValues.ttcn diff --git a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_EncdecDeclarations.ttcn b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_EncdecDeclarations.ttcn deleted file mode 100644 index 0ccedc01..00000000 --- a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_EncdecDeclarations.ttcn +++ /dev/null @@ -1,11 +0,0 @@ -module LibItsIpv6OverGeoNetworking_EncdecDeclarations { - - import from LibItsIpv6OverGeoNetworking_TypesAndValues all; - - external function fx_enc_Ipv6Packet (Ipv6Packet p) return bitstring - with {extension "prototype(convert) encode(LibItsIpv6OverGeoNetworking)"} - - external function fx_dec_Ipv6Packet (inout bitstring b, out Ipv6Packet p) return integer - with {extension "prototype(sliding) decode(LibItsIpv6OverGeoNetworking)"} - -} // End of module LibItsIpv6OverGeoNetworking_EncdecDeclarations diff --git a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Functions.ttcn b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Functions.ttcn deleted file mode 100644 index 5a52ae09..00000000 --- a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Functions.ttcn +++ /dev/null @@ -1,761 +0,0 @@ -/** - * @author ETSI / STF405 / STF449 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Functions.ttcn $ - * $Id: LibItsIpv6OverGeoNetworking_Functions.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Module containing functions for Ipv6OverGeoNetworking - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsIpv6OverGeoNetworking_Functions { - - // Libcommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - import from LibCommon_VerdictControl all; - import from LibCommon_Sync all; - import from LibCommon_Time all; - import from LibCommon_TextStrings all; - - // LibIts - import from LibItsGeoNetworking_TypesAndValues all; - import from LibItsGeoNetworking_Functions all; - import from LibItsGeoNetworking_Templates all; - import from LibItsGeoNetworking_TestSystem all; - import from LibItsIpv6OverGeoNetworking_TestSystem all; - import from LibItsIpv6OverGeoNetworking_TypesAndValues all; - import from LibItsIpv6OverGeoNetworking_Templates all; - import from LibItsIpv6OverGeoNetworking_Pixits all; - import from LibItsExternal_TypesAndValues {type MacAddress}; - - group ipv6OverGeoConfigurationFunctions { - - /** - * @desc This configuration features: - * - one ITS node (IUT) - * - two ITS nodes (nodeA, nodeB) - * - three GVLs - */ - function f_cf01UpGn6() runs on ItsIpv6OverGeoNetworking system ItsIpv6OverGeoNetworkingSystem { - - // Variables - var float v_distance; - - // Map - map(self:ipv6OverGeoNetworkingPort, system:ipv6OverGeoNetworkingPort); - - f_cf01Up(); - v_distance := f_distance(f_getPosition(c_compNodeB), f_getPosition(c_compIut)); - - // Compute IPv6 addresses - f_addAddresses(vc_addressTable, c_compIut); - f_addAddresses(vc_addressTable, c_compNodeA); - f_addAddresses(vc_addressTable, c_compNodeB); - - // Create additional areas - f_addArea(vc_areaTable, c_gvlArea1, - f_computeSquareArea(f_getPosition(c_compIut), float2int(2.1 * v_distance))); - f_addArea(vc_areaTable, c_gvlArea2, - f_computeSquareArea(f_getPosition(c_compIut), float2int(2.2 * v_distance))); - f_addArea(vc_areaTable, c_gvlArea3, - f_computeSquareArea(f_getPosition(c_compIut), float2int(2.3 * v_distance))); - - // Create GVLs - f_addGvl(c_gvl1_name, f_getPrefix(1), f_getPrefixLength(1), c_gvlArea1, ""); - f_addGvl(c_gvl2_name, f_getPrefix(2), f_getPrefixLength(2), c_gvlArea2, ""); - f_addGvl(c_gvl3_name, f_getPrefix(3), f_getPrefixLength(3), c_gvlArea3, ""); - - - } // end f_cf01Up - - /** - * @desc Deletes configuration cf01Gn6 - */ - function f_cf01DownGn6() runs on ItsIpv6OverGeoNetworking system ItsIpv6OverGeoNetworkingSystem { - - // Map - unmap(self:ipv6OverGeoNetworkingPort, system:ipv6OverGeoNetworkingPort); - - f_cf01Down(); - - } // end f_cf01Down - - } // end group ipv6OverGeoConfigurationFunctions - - group ipv6OverGeoNwAltsteps { - - /** - * @desc IPv6 default. - */ - altstep a_ipv6Default() runs on ItsIpv6OverGeoNetworking { - var GeoNetworkingInd v_geoNwInd; - - [] geoNetworkingPort.receive ( - mw_geoNwInd( - mw_geoNwPdu( - mw_geoNwBroadcastPacketWithNextHeaderAndPayload( - ?, - ?, - e_ipv6, - ?// FIXME Check that we have an IPv6Payload mw_octetstringPayload - ) - ) - ) - ) { - log("*** " & testcasename() & ": INFO: Ignoring unsupported IPv6 packet ***"); - repeat; - } - [] geoNetworkingPort.receive ( - mw_geoNwInd( - mw_geoNwPdu( - mw_geoNwBroadcastPacketWithNextHeaderAndPayload( - ?, - ?, - e_ipv6, - ? - ) - ) - ) - ) -> value v_geoNwInd { - if (match( - v_geoNwInd.msgIn.gnPacket.packet.extendedHeader.geoBroadcastHeader.srcPosVector, - ( - mw_longPosVectorPosition(f_getPosition(c_compNodeA)), - mw_longPosVectorPosition(f_getPosition(c_compNodeB)) - ) - )) { - log("*** " & testcasename() & ": INFO: Ignoring rebroadcasted IPv6 packet ***"); - repeat; - } - else { - log("*** " & testcasename() & ": ERROR: Received an unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - } - [] ipv6OverGeoNetworkingPort.receive( - mw_ipv6OverGeoNwInd( - ?, - ?, - c_macBroadcastAddr, - ? // Refine rtAdv - ) - ) { - log("*** " & testcasename() & ": INFO: Ignoring Router Advertisement ***"); - repeat; - } - - } // end a_ipv6Default - - } // end ipv6OverGeoNwAltsteps - - group preambles { - - /** - * @desc Preamble for IPv6 neighbour nodes - */ - function f_prIpv6Neighbour() runs on ItsIpv6OverGeoNetworking { - f_prNeighbour(); - activate(a_ipv6Default()); - } - - /** - * @desc Preamble to configure the GVLs, either manual or via RA - * @param p_gvls The GVLs to configure - * @param p_validLifetimes The specific invalidation timer for the GVLs - */ - function f_prConfigureGVL( - in GvlIdxList p_gvls, - in template (omit) UInt32List p_validLifetimes := omit - ) runs on ItsIpv6OverGeoNetworking - return FncRetCode { - var integer i; - var charstring v_str := ""; - var UInt32 v_validLifetime := c_validLifetime30s; - - if (lengthof(vc_gvlTable)=(i+1)) { - v_validLifetime := valueof(p_validLifetimes[i]); - } - f_sendGeoBroadcastWithRtAdv(vc_gvlTable[i], c_compNodeA, v_validLifetime); - } - f_sleep(PX_T_BUILD_CONFIG); - } - f_acUpdateInterfaces(); - - return e_success; - } - - } // end preambles - - group postambles { - - /** - * @desc Postamble for neighbour nodes - */ - function f_poIpv6Neighbour() runs on ItsIpv6OverGeoNetworking { - f_poNeighbour(); - } - } // end postambles - - group testAdapter { - - /** - * @desc Retrieve IUT's interface names and associate them with predefined GVLs - */ - function f_acUpdateInterfaces() runs on ItsIpv6OverGeoNetworking { - - var AcGn6Response v_response; - var AcGn6InterfaceInfoList v_interfaceInfoList; - var integer i, j, k; - - acPort.send(m_acGetInterfaceInfos); - tc_ac.start; - alt { - [] acPort.receive(mw_acInterfaceInfos) -> value v_response { - tc_ac.stop; - - v_interfaceInfoList := valueof(v_response.interfaceInfoList); - // Go through interfaceInfos - for(i:=0; i < sizeof(v_interfaceInfoList); i:=i+1) { - // Go through IPv6 addresses configured for this interface - for(j:=0; j < sizeof(v_interfaceInfoList[i].ipv6AddressList); j:=j+1) { - // Compare IPv6 address to recorded GVL prefixes - for(k:=0; k < sizeof(vc_gvlTable); k:=k+1) { - if(f_isIpv6AddressCorrespondingToPrefix( - v_interfaceInfoList[i].ipv6AddressList[j], - vc_gvlTable[k].prefix, - vc_gvlTable[k].prefixLength)) { - // interface i is associated to GVL k - vc_gvlTable[k].interface := v_interfaceInfoList[i].interfaceName; - break; - } - } - if(k >= sizeof(vc_gvlTable)) { - // GVL already found - break; - } - } - } - } - [] acPort.receive { - tc_ac.stop; - log("*** " & testcasename() & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - } - - } // end group testAdapter - - group sendFunctions { - - /** - * @desc Send a GeoBroadcast containing an IPv6 Router Advertisement - * @param p_gvl Name of the GVL for which the RA is sent - * @param p_compName Name of the component sending this packet - */ - function f_sendGeoBroadcastWithRtAdv( - in template (value) GvlTableEntry p_gvl, - in charstring p_compName, - in UInt32 p_validLifetime := c_validLifetime30s - ) runs on ItsIpv6OverGeoNetworking { - var bitstring v_ipv6Payload; - var AddressTableEntry v_nodeAddresses := f_getAddresses(p_compName); - var LongPosVector v_nodeLongPosVector := f_getPosition(p_compName); - - v_ipv6Payload := encvalue( - m_ipv6Packet( - v_nodeAddresses.lla, - c_allNodesMca, - c_icmpHdr, - m_rtAdvWithOptions( - m_rtAdvOpt_prefixOpt( - p_gvl.prefixLength, - c_lFlag1, - c_aFlag1, - p_validLifetime, - c_preferredLifetime30s, - valueof(p_gvl.prefix) - ) - ) - ) - ); - - f_sendGeoNetMessageWithPayload( - m_geoNwReq_linkLayerBroadcast( - m_geoNwPdu( - m_geoNwBroadcastPacket( - v_nodeLongPosVector, - vc_localSeqNumber, - f_getGeoBroadcastArea(valueof(p_gvl.area)) - ) - ) - ), - bit2oct(v_ipv6Payload) - ); - } - - } //end group sendFunctions - - group miscellaneous { - - /** - * @desc Add GVL information in the GVL table - * @param p_gvlKey Name of the GVL - * @param p_prefix IPv6 prefix associated with the GVL - * @param p_prefixLength Prefix length - * @param p_area Name of the GeoArea associated with the GVL - * @param p_interface Name of IUT's virtual interface associated with the GVL - */ - function f_addGvl( - in charstring p_gvlKey, - in Oct16 p_prefix, - in UInt8 p_prefixLength, - in charstring p_area, - in charstring p_interface - ) runs on ItsIpv6OverGeoNetworking { - vc_gvlTable[lengthof(vc_gvlTable)] := { - key := p_gvlKey, - prefix := p_prefix, - prefixLength := p_prefixLength, - area := p_area, - interface := p_interface - }; - } // end f_addGvl - - /** - * @desc Gets the Geographical Virtual link entry associated to an area - * @param p_gvlName Name of the GVL - */ - function f_getGvl(in charstring p_gvlName) runs on ItsIpv6OverGeoNetworking return GvlTableEntry { - var GvlTableEntry v_return; - var integer i := 0; - - for (i:=0; i 64) { - log("*** " & testcasename() & ": ERROR: Wrong prefixLen (max 64 bits) ***"); - return int2oct(0, 8); - } - - //Fill v_prefixReady with existing Prefix - for (i:=0; i 64) { - log("*** " & testcasename() & ": ERROR: Wrong prefixLen ***"); - return '00000000000000000000000000000000'O; - } - - // compute interface ID - v_interfaceIdReady := f_createUniqueInterfaceId(f_getAddresses(p_compName).macAddress); - - return f_compute64BitsPrefix(oct2bit(p_prefix), p_prefixLen) & v_interfaceIdReady; - - } // end f_computeGlobalAddress - - /** - * @desc Compute Home Agent anycast address for a prefix - * @param p_prefix Prefix for which the address is computed - * @param p_prefixLen Length of the prefix - * @return Home Agent anycast address - */ - function f_computeHomeAgentAnycastAddress( - in Oct16 p_prefix, - in UInt8 p_prefixLen - ) return Ipv6Address { - var Oct8 v_haAnycast := 'FDFFFFFFFFFFFFFE'O; - - if (p_prefixLen != 64) { - log("*** " & testcasename() & ": ERROR: Wrong prefixLen ***"); - return '00000000000000000000000000000000'O; - } - - return f_compute64BitsPrefix(oct2bit(p_prefix), p_prefixLen) & v_haAnycast; - } // end f_computeHomeAgentAnycastAddress - - /** - * @desc Computes global-scoped unicast-prefix-based multicast Ipv6 address - * @param p_prefix Prefix for which the address is computed - * @param p_prefixLen Length of the prefix in bits (max 64) - * @param p_groupId Group ID - * @return Global-scoped unicast-prefix-based multicast Ipv6 address - */ - function f_computeGlobalScopedUnicastPrefixBasedMulticastIpv6Address( - in Oct16 p_prefix, - in UInt8 p_prefixLen, - in UInt32 p_groupId - ) return Ipv6Address { - var Oct3 v_leftPart := 'FF3E00'O; - - if (p_prefixLen>64) { - log("*** " & testcasename() & ": ERROR: Wrong prefixLen, max 64 bits allowed ***"); - return int2oct(0, 16); - } - - return v_leftPart & int2oct(p_prefixLen, 1) & f_compute64BitsPrefix(oct2bit(p_prefix), p_prefixLen) & int2oct(p_groupId, 4); - } - - /** - * @desc Computes geographic anycast Ipv6 address - * @param p_prefix Prefix for which the address is computed - * @param p_prefixLen Length of the prefix in bits (max 64) - * @return Geographic anycast Ipv6 address - */ - function f_computeGeographicAnycastIpv6Address( - in Oct16 p_prefix, - in UInt8 p_prefixLen - ) return Ipv6Address { - var Bit64 v_interfaceIdentifierField := '11111101'B & int2bit(1, 49) & c_itsGn6aslGeoAnycastID; - - if (p_prefixLen>64) { - log("*** " & testcasename() & ": ERROR: Wrong prefixLen, max 64 bits allowed ***"); - return int2oct(0, 16); - } - - return f_compute64BitsPrefix(oct2bit(p_prefix), p_prefixLen) & bit2oct(v_interfaceIdentifierField); - } - - /** - * @desc Gets a predefined prefix - * @param p_index Index of the predefined prefix - * @return IPv6 prefix - * @see PX_GN6_PREFIX_1 - * @see PX_GN6_PREFIX_2 - * @see PX_GN6_PREFIX_3 - */ - function f_getPrefix(in integer p_index) return Oct16 { - - select (p_index) { - case (1) { - return PX_GN6_PREFIX_1; - } - case (2) { - return PX_GN6_PREFIX_2; - } - case (3) { - return PX_GN6_PREFIX_3; - } - } - - return int2oct(0, 16); - - } // end f_getPrefix - - /** - * @desc Gets the length of a predefined prefix - * @param p_index Index of the predefined prefix - * @return length of a prefix - * @see PX_GN6_PREFIX_LENGTH_1 - * @see PX_GN6_PREFIX_LENGTH_2 - * @see PX_GN6_PREFIX_LENGTH_3 - */ - function f_getPrefixLength(in integer p_index) return UInt8 { - - select (p_index) { - case (1) { - return PX_GN6_PREFIX_LENGTH_1; - } - case (2) { - return PX_GN6_PREFIX_LENGTH_2; - } - case (3) { - return PX_GN6_PREFIX_LENGTH_3; - } - } - - return 64; - - } // end f_getPrefixLength - - /** - * @desc Checks whether an IPv6 address belongs to an IPv6 prefix - * @param p_ipv6Address IPv6 address to be checked - * @param p_prefix Prefix - * @param p_prefixLength Length of the prefix - * @return Boolean - True if IPv6 address belongs to prefix, False otherwise - */ - function f_isIpv6AddressCorrespondingToPrefix(Ipv6Address p_ipv6Address, Ipv6Address p_prefix, UInt8 p_prefixLength) - return boolean { - - var bitstring v_ipv6Address := oct2bit(p_ipv6Address); - var bitstring v_prefix := oct2bit(p_prefix); - var integer i; - - for(i:=0; i < p_prefixLength; i:=i+1) { - if(v_ipv6Address[i] != v_prefix[i]) { - return false; - } - } - - return true; - } // end f_isIpv6AddressCorrespondingToPrefix - - /** - * @desc Calculate ICMPv6 checksum on pseudo header according RFC 4443 - Clause 2.3 - * @param p_sourceAddress Source address, - * @param p_destinationAddress Destination address - * @param p_payloadLength Upper-Layer Packet Length - * @param p_payload Upper-Layer payload - * @param p_nextHdr Next header value (e.g. 0x3a for ICMPv6) - */ - function f_computeIPv6CheckSum( - in template (value) Ipv6Address p_sourceAddress, - in template (value) Ipv6Address p_destinationAddress, - in template (value) integer p_payloadLength, - in template (value) GnRawPayload p_payload, - in template (value) UInt8 p_nextHdr - ) return Oct2 { - var Oct2 v_checksum := 'FFFF'O; - - log("*** " & testcasename() & ": INFO: calling fx_computeIPv6CheckSum() ***"); - v_checksum := fx_computeIPv6CheckSum(valueof(p_sourceAddress), valueof(p_destinationAddress), valueof(p_payloadLength), valueof(p_payload), valueof(p_nextHdr)); - - return v_checksum; - } - - } // end group miscellaneous - - group externalFunctions { - - /** - * @desc Calculate ICMPv6 checksum on pseudo header according RFC 4443 - Clause 2.3 - * @param p_sourceAddress Source address, - * @param p_destinationAddress Destination address - * @param p_payloadLength Upper-Layer Packet Length - * @param p_payload Upper-Layer payload - * @param p_nextHdr Next header value (e.g. 0x3a for ICMPv6) - * @return The checksum value - *
    -         * Pseudo header is defined by RFC 2460 - Clause 8.1
    -         *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         *  |                                                               |
    -         *  +                                                               +
    -         *  |                                                               |
    -         *  +                         Source Address                        +
    -         *  |                                                               |
    -         *  +                                                               +
    -         *  |                                                               |
    -         *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         *  |                                                               |
    -         *  +                                                               +
    -         *  |                                                               |
    -         *  +                      Destination Address                      +
    -         *  |                                                               |
    -         *  +                                                               +
    -         *  |                                                               |
    -         *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         *  |                   Upper-Layer Packet Length                   |
    -         *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         *  |                      zero                     |  Next Header  |
    -         *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -         * 
    - */ - external function fx_computeIPv6CheckSum( - in template (value) Ipv6Address p_sourceAddress, - in template (value) Ipv6Address p_destinationAddress, - in template (value) integer p_payloadLength, - in template (value) GnRawPayload p_payload, - in template (value) UInt8 p_nextHdr - ) return Oct2; - - } // End of group externalFunctions - -} // end LibItsIpv6OverGeoNetworking_Functions \ No newline at end of file diff --git a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Pics.ttcn b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Pics.ttcn deleted file mode 100644 index 5d5efdc3..00000000 --- a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Pics.ttcn +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @author ETSI / STF405 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Pics.ttcn $ - * $Id: LibItsIpv6OverGeoNetworking_Pics.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc IPv6 Over GeoNetworking PICS - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsIpv6OverGeoNetworking_Pics { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from LibItsGeoNetworking_TypesAndValues all; - - group ipv6OverGeoNwPics { - - /** - * @desc Indicates whether the GN6ASL shall resolve the destination link-layer-address - * from the IPv6 address. - * FALSE, perform address resolution, otherwise do not. - * @see ETSI TS 102 859-1 A.10/10 - */ - modulepar boolean PICS_GN6_ASL_VI_RESOL_ADDR := true; - - - } // end ipv6OverGeoNwPics - -} // end LibItsIpv6OverGeoNetworking_Pics \ No newline at end of file diff --git a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Pixits.ttcn b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Pixits.ttcn deleted file mode 100644 index 68e016f6..00000000 --- a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Pixits.ttcn +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @author ETSI / STF405 /STF449 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Pixits.ttcn $ - * $Id: LibItsIpv6OverGeoNetworking_Pixits.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Module parameters for IPv6 over GeoNetworking Protocol - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsIpv6OverGeoNetworking_Pixits { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - /** - * @desc GVL will be configured manually? - */ - modulepar boolean PX_CONFIG_MANUAL_GVL := false; - - /** - * @desc Time for building the configuration and virtual interfaces dynamically. - */ - modulepar float PX_T_BUILD_CONFIG := 5.0; - - /** - * @desc IPv6 prefix 1 to be used for defining GVL - */ - modulepar Oct16 PX_GN6_PREFIX_1 := '3FFE0000000000010000000000000000'O; - - /** - * @desc IPv6 prefix 2 to be used for defining GVL - */ - modulepar Oct16 PX_GN6_PREFIX_2 := '3FFE0000000000020000000000000000'O; - - /** - * @desc IPv6 prefix 3 to be used for defining GVL - */ - modulepar Oct16 PX_GN6_PREFIX_3 := '3FFE0000000000030000000000000000'O; - - /** - * @desc Length of IPv6 prefix 1 - * @see PX_GN6_PREFIX_1 - */ - modulepar UInt8 PX_GN6_PREFIX_LENGTH_1 := 64; - - /** - * @desc Length of IPv6 prefix 2 - * @see PX_GN6_PREFIX_2 - */ - modulepar UInt8 PX_GN6_PREFIX_LENGTH_2 := 64; - - /** - * @desc Length of IPv6 prefix 3 - * @see PX_GN6_PREFIX_3 - */ - modulepar UInt8 PX_GN6_PREFIX_LENGTH_3 := 64; - - /** - * @desc Name of IUT's virtual interface associated with TVL - */ - modulepar charstring PX_GN6_TVL_INTERFACE_NAME := "tvl0"; - -} \ No newline at end of file diff --git a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Templates.ttcn b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Templates.ttcn deleted file mode 100644 index 70fae63a..00000000 --- a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Templates.ttcn +++ /dev/null @@ -1,292 +0,0 @@ -/** - * @author ETSI / STF405 / STF449 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_Templates.ttcn $ - * $Id: LibItsIpv6OverGeoNetworking_Templates.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc IPv6 over GeoNetworking Protocol Templates - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsIpv6OverGeoNetworking_Templates { - - //LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - //LibIts - import from LibItsIpv6OverGeoNetworking_TestSystem all; - import from LibItsIpv6OverGeoNetworking_TypesAndValues all; - import from LibItsGeoNetworking_TypesAndValues all; - import from LibItsExternal_TypesAndValues {type MacAddress}; - - group ipv6OverGeoNwPrimitivesTemplates { - - /** - * @desc Send template for IPv6OverGeoNetworking packet (IPv6OverGeoNetworking Primitive) - * @param p_interface Which virtual interface to use for sending the packet - * @param p_srcMacAddr Link-layer source address - * @param p_dstMacAddr Link-layer destination address - * @param p_ipv6Packet IPv6 packet to be sent - */ - template (value) IPv6OverGeoNetworkingReq m_ipv6OverGeoNwReq( - template (value) charstring p_interface, - template (value) MacAddress p_srcMacAddr, - template (value) MacAddress p_dstMacAddr, - template (value) Ipv6Packet p_ipv6Packet - ) := { - interface := p_interface, - macSourceAddress := p_srcMacAddr, - macDestinationAddress := p_dstMacAddr, - ipv6Packet := p_ipv6Packet - } - - /** - * @desc Receive template for IPv6OverGeoNetworking packet (IPv6OverGeoNetworking Primitive) - * @param p_interface On which virtual interface the packet is expected - * @param p_srcMacAddr Link-layer source address - * @param p_dstMacAddr Link-layer destination address - * @param p_ipv6Packet Expected IPv6 packet - */ - template IPv6OverGeoNetworkingInd mw_ipv6OverGeoNwInd( - template (present) charstring p_interface, - template (present) MacAddress p_srcMacAddr, - template (present) MacAddress p_dstMacAddr, - template (present) Ipv6Packet p_ipv6Packet - ) := { - interface := p_interface, - macSourceAddress := p_srcMacAddr, - macDestinationAddress := p_dstMacAddr, - ipv6Packet := p_ipv6Packet - } - - } // ipv6OverGeoNwPrimitivesTemplates - - group ipv6 { - - /** - * @desc Send template for IPv6 packet - * @param p_srcAddr IPv6 source address - * @param p_dstAddr IPv6 destination address - * @param p_nextHdr IPv6's next header - * @param p_payload IPv6 payload - */ - template (value) Ipv6Packet m_ipv6Packet( - in template (value) Ipv6Address p_srcAddr, - in template (value) Ipv6Address p_dstAddr, - in template (value) UInt8 p_nextHdr, - in template (omit) Ipv6Payload p_payload - ) := { - ipv6Hdr := m_ipv6Header(p_srcAddr, p_dstAddr, p_nextHdr), - extHdrList := omit, - ipv6Payload := p_payload - } - - /** - * @desc Reception template for IPv6 packet - * @param p_srcAddr IPv6 source address - * @param p_dstAddr IPv6 destination address - * @param p_nextHdr IPv6's next header - * @param p_payload IPv6 payload - */ - template Ipv6Packet mw_ipv6Packet( - in template (present) Ipv6Address p_srcAddr, - in template (present) Ipv6Address p_dstAddr, - in template (present) UInt8 p_nextHdr, - in template Ipv6Payload p_payload - ) := { - ipv6Hdr := mw_ipv6Header(p_srcAddr, p_dstAddr, p_nextHdr), - extHdrList := omit, - ipv6Payload := p_payload - } - - /** - * @desc Send template for IPv6 header - * @param p_srcAddr IPv6 source address - * @param p_dstAddr IPv6 destination address - * @param p_nextHdr IPv6's next header - */ - template (value) Ipv6Header m_ipv6Header( - in template (value) Ipv6Address p_srcAddr, - in template (value) Ipv6Address p_dstAddr, - in template (value) UInt8 p_nextHdr - ) := { - version := 6, - trafficClass := 0, - flowLabel := 0, - payloadLength := 0, //indicates that the adaptation will fill the correct value - nextHeader := p_nextHdr, - hopLimit := 255, - sourceAddress := p_srcAddr, - destinationAddress := p_dstAddr - } - - /** - * @desc Receive template for IPv6 header - * @param p_srcAddr IPv6 source address - * @param p_dstAddr IPv6 destination address - * @param p_nextHdr IPv6's next header - */ - template Ipv6Header mw_ipv6Header( - in template (present) Ipv6Address p_srcAddr, - in template (present) Ipv6Address p_dstAddr, - in template (present) UInt8 p_nextHdr - ) := { - version := 6, - trafficClass := ?, - flowLabel := ?, - payloadLength := ?, - nextHeader := p_nextHdr, - hopLimit := ?, - sourceAddress := p_srcAddr, - destinationAddress := p_dstAddr - } - - /** - * @desc Send template for IPv6 payload containing Router Advertisement - * @param p_rtAdvOptions Router Advertisement options - */ - template (value) Ipv6Payload m_rtAdvWithOptions( - in template (omit) RtAdvOptions p_rtAdvOptions - ) := { - routerAdvMsg := { - icmpType := c_rtAdvMsg, - icmpCode := 0, - checksum := c_2ZeroBytes, //indicates that the adaptation will fill the correct value - curHopLimit := 255, - managedConfigFlag := 0, - otherConfigFlag := 0, - homeAgentFlag := 0, - reserved := 0, - routerLifetime := c_uInt16Max, - reachableTime := c_uInt32Max, - retransTimer := 0, - rtAdvOptions := p_rtAdvOptions - } - } - - /** - * @desc Receive template for IPv6 payload containing Router Advertisement - * @param p_rtAdvOptions Router Advertisement options - */ - template Ipv6Payload mw_rtAdvWithOptions( - in template RtAdvOptions p_rtAdvOptions - ) := { - routerAdvMsg := { - icmpType := c_rtAdvMsg, - icmpCode := 0, - checksum := ?, - curHopLimit := ?, - managedConfigFlag := ?, - otherConfigFlag := ?, - homeAgentFlag := ?, - reserved := ?, - routerLifetime := ?, - reachableTime := ?, - retransTimer := ?, - rtAdvOptions := p_rtAdvOptions - } - } - - /** - * @desc Send template for IPv6 payload containing Router Advertisement - * @param p_rtAdvOptions Router Advertisement options - */ - template (value) Ipv6Payload m_octetstringPayload( - in template (value) octetstring p_payload - ) := { - octetstringMsg := p_payload - } - - /** - * @desc Receive template for IPv6 payload containing Router Advertisement - * @param p_rtAdvOptions Router Advertisement options - */ - template Ipv6Payload mw_octetstringPayload( - in template (present) octetstring p_payload - ) := { - octetstringMsg := p_payload - } - - /** - * @desc Send template for IPv6 Prefix option - * @param p_prefixLength Length of the prefix. - * @param p_lFlag Value for link flag. - * @param p_aFlag Value for autoconfiguration flag. - * @param p_validLifetime Value for valid life time duration. - * @param p_preferredLifetime Value for preffered life time duration. - * @param p_prefix Address prefix to be used - */ - template RtAdvOptions m_rtAdvOpt_prefixOpt ( - in template (value) UInt8 p_prefixLength, - in template (value) UInt1 p_lFlag, - in template (value) UInt1 p_aFlag, - in template (value) UInt32 p_validLifetime, - in template (value) UInt32 p_preferredLifetime, - in template (value) Ipv6Address p_prefix - ):={ - srcLinkLayerAddr := omit, - prefixInfoList := { - m_prefixInfo( - p_prefixLength, - p_lFlag, - p_aFlag, - p_validLifetime, - p_preferredLifetime, - p_prefix - ) - }, - otherOption := omit - } - - /** - * @desc Send template for IPv6 Prefix info - * @param p_prefixLength The length of the prefix - * @param p_lFlag Value for link flag. - * @param p_aFlag Value for autoconfiguration flag. - * @param p_validLifetime Value for valid life time duration. - * @param p_preferredLifetime Value for preferred life time duration. - * @param p_prefix Address prefix to be used - */ - template PrefixInfo m_prefixInfo ( - in template (value) UInt8 p_prefixLength, - in template (value) UInt1 p_lFlag, - in template (value) UInt1 p_aFlag, - in template (value) UInt32 p_validLifetime, - in template (value) UInt32 p_preferredLifetime, - in template (value) Ipv6Address p_prefix - ):= { - icmpType:= c_prefixInfo, - optionLength:= c_prefixInfoLen, - prefixLength:= p_prefixLength, - linkFlag:=p_lFlag, - autoConfigFlag:=p_aFlag, - rtAddrFlag := c_rtAddrFlag0, - reserved1:=0, - validLifetime:=p_validLifetime, - preferredLifetime:=p_preferredLifetime, - reserved2:=0, - prefix:= p_prefix - } - - } // end group ipv6 - - group gn6AcPrimitives { - - /** - * @desc TA primitive for querying link-layer interfaces information - */ - template (value) AcGn6Primitive m_acGetInterfaceInfos := { - getInterfaceInfos := 3 - } - - /** - * @desc TA primitive for retrieving link-layer interfaces information - */ - template AcGn6Response mw_acInterfaceInfos := { - interfaceInfoList := ? - } - } // end gn6AcPrimitives - -} // end LibItsIpv6OverGeoNetworking_TypesAndValues \ No newline at end of file diff --git a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TestSystem.ttcn b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TestSystem.ttcn deleted file mode 100644 index 88b6998b..00000000 --- a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TestSystem.ttcn +++ /dev/null @@ -1,105 +0,0 @@ -/** - * @author ETSI / STF405 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TestSystem.ttcn $ - * $Id: LibItsIpv6OverGeoNetworking_TestSystem.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Test System module for ITS Ipv6OverGeoNetworking - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsIpv6OverGeoNetworking_TestSystem { - - // LibCommon - import from LibCommon_Time {modulepar all}; - import from LibCommon_Sync all; - - // LibIts - import from LibItsGeoNetworking_TestSystem all; - import from LibItsIpv6OverGeoNetworking_TypesAndValues all; - import from LibItsExternal_TypesAndValues all; - - group componentDefinitions { - - /** - * @desc ITS System Adapter - */ - type component ItsIpv6OverGeoNetworkingSystem extends ItsGeoNetworkingSystem { - - // NT2 ports - port IPv6OverGeoNetworkingPort ipv6OverGeoNetworkingPort; - - } // end component ItsAdapter - - } // End of group componentDefinitions - - group interfacePorts { - - group networkAndTransportPorts { - - group nt2Ports { - - /** - * @desc NT2 IPv6 over GeoNetworking Port (IPv6/GeoNetworking/G5) - */ - type port IPv6OverGeoNetworkingPort message { - in IPv6OverGeoNetworkingInd; - out IPv6OverGeoNetworkingReq; - } // end IPv6OverGeoNetworkingPort - - } // End of group nt2Ports - - } // End of group networkAndTransportPorts - - } // End of group interfacePorts - - /** - * @desc Test component for ITS Network and Transport layer - */ - type component ItsIpv6OverGeoNetworking extends ItsGeoNetworking { - - // NT2 ports - port IPv6OverGeoNetworkingPort ipv6OverGeoNetworkingPort; - - // timers - - //variables for Gn6 - var GvlTable vc_gvlTable := {}; - var AddressTable vc_addressTable := {}; - - - } // End of component Ipv6OverGeoNetworking - - group networkAndTransportPrimitives { - - group nt2Primitives { - - /** - * @desc NT2 IPv6 over GeoNetworking Indication Primitive - */ - type record IPv6OverGeoNetworkingInd { - charstring interface, - MacAddress macSourceAddress, - MacAddress macDestinationAddress, - Ipv6Packet ipv6Packet - } - - /** - * @desc NT2 IPv6 over GeoNetworking Request Primitive - */ - type record IPv6OverGeoNetworkingReq { - charstring interface, - MacAddress macSourceAddress, - MacAddress macDestinationAddress, - Ipv6Packet ipv6Packet - } - - } // end nt2Primitives - - } // End of group networkAndTransportPrimitives - with { - encode "LibIts_Interface" - } // end interfacePrimitives - -} // End of module LibItsIpv6OverGeoNetworking_TestSystem diff --git a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TypesAndValues.ttcn b/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TypesAndValues.ttcn deleted file mode 100644 index 1d22a895..00000000 --- a/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TypesAndValues.ttcn +++ /dev/null @@ -1,315 +0,0 @@ -/** - * @author ETSI / STF405 / STF449 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Ipv6OverGeoNetworking/LibItsIpv6OverGeoNetworking_TypesAndValues.ttcn $ - * $Id: LibItsIpv6OverGeoNetworking_TypesAndValues.ttcn 1318 2017-01-26 10:20:53Z filatov $ - * @desc Types and values for IPv6 over GeoNetworking Protocol - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsIpv6OverGeoNetworking_TypesAndValues { - - //LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - //LibIts - import from LibItsExternal_TypesAndValues all; - - group ipv6OverGeoConfigurationTypes { - - /** - * @desc Entry of GVL table - * @member key Reference key of the entry - * @member prefix Prefix associated with the GVL - * @member prefixLength Prefix length - * @member area GeoArea associated with th e GVL - * @member interface IUT's interface associated with the GVL - */ - type record GvlTableEntry { - charstring key, - Oct16 prefix, - UInt8 prefixLength, - charstring area, - charstring interface - } - - /** - * @desc Table containing GVL information - */ - type record of GvlTableEntry GvlTable; - - /** - * @desc Entry of Address table - * @member key Reference key of the entry - * @member macAddress Link-layer address - * @member macSolNodeMca Link-layer solicited node multicast address - * @member lla IPv6 link-local address - * @member solNodeMca IPv6 solicited node multicast address - */ - type record AddressTableEntry { - charstring key, - MacAddress macAddress, - MacAddress macSolNodeMca, - Ipv6Address lla, - Ipv6Address solNodeMca - } - - /** - * @desc Table containing Address information - */ - type record of AddressTableEntry AddressTable; - - } // end ipv6OverGeoConfigurationTypes - - group ipv6OverGeoConfigurationValues { - - type record of integer GvlIdxList; - - type record of UInt32 UInt32List; - - const integer c_gvl1 := 0; - const integer c_gvl2 := 1; - const integer c_gvl3 := 2; - - const charstring c_gvl1_name := "GVL1"; - const charstring c_gvl2_name := "GVL2"; - const charstring c_gvl3_name := "GVL3"; - - const charstring c_gvlArea1 := "GVL_AREA1"; - const charstring c_gvlArea2 := "GVL_AREA2"; - const charstring c_gvlArea3 := "GVL_AREA3"; - - } // end ipv6OverGeoConfigurationValues - - group ethernet { - - const MacAddress c_macBroadcastAddr := '333300000001'O; - - } // end ethernet - - group ipv6 { - - /** - * @desc PDU type derived from RFC2460 - */ - type record Ipv6Packet { - Ipv6Header ipv6Hdr, - ExtensionHeaderList extHdrList optional, - Ipv6Payload ipv6Payload optional - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Derived from RFC 2460 Section 3 - * @url http://www.ietf.org/rfc/rfc2460.txt - */ - type record Ipv6Header { - UInt4 version, - UInt8 trafficClass, - UInt20 flowLabel, - UInt16 payloadLength, - UInt8 nextHeader, - UInt8 hopLimit, - Ipv6Address sourceAddress, - Ipv6Address destinationAddress - } - - group gn6ExtensionHeaderIds { - const UInt8 c_hopHdr := 0; - const UInt8 c_tcpHdr := 6; - const UInt8 c_udpHdr := 17; - const UInt8 c_tunneledIpHdr := 41; - const UInt8 c_routeHdr := 43; - const UInt8 c_fragHdr := 44; - const UInt8 c_espHdr := 50; - const UInt8 c_authHdr := 51; - const UInt8 c_icmpHdr := 58; - const UInt8 c_noNextHdr := 59; - const UInt8 c_dstHdr := 60; - const UInt8 c_mobileHdr := 135; - } - - /** - * @desc IPv6 extension header list - */ - type octetstring ExtensionHeaderList; - - /** - * @desc IPv6 payload - */ - type union Ipv6Payload { - RouterAdvertisementMsg routerAdvMsg, - octetstring octetstringMsg - } - - /** - * @desc IPv6 Address - */ - type Oct16 Ipv6Address with {encode "length(16)"}; - - group rfc2461MessageTypes { - const UInt8 c_prefixInfo := 3 ; - const UInt8 c_rtAdvMsg := 134; - } // end group rfc2461MessageTypes - - group ipv6Address { - //Prefix - const Oct2 c_llaMcaPrefix := 'FF02'O ; - const Oct2 c_llaPrefix := 'FE80'O ; - //Postfix - const Oct2 c_allNodesMcaPostfix := '0001'O ; - const Oct2 c_allRoutersMcaPostfix := '0002'O ; - const Oct2 c_anycastPostfix := 'FFFF'O ; - const Oct1 c_haAnycastPostfix := '7E'O ; - //Wellknown Multicast Address - const Ipv6Address c_allNodesMca := c_llaMcaPrefix & c_12ZeroBytes & c_allNodesMcaPostfix ; - const Ipv6Address c_allRoutersMca := c_llaMcaPrefix & c_12ZeroBytes & c_allRoutersMcaPostfix ; - //Unspecified - const Ipv6Address c_unspecified := '00000000000000000000000000000000'O; - - //geographic - const Bit7 c_itsGn6aslGeoAnycastID := '1111101'B; // TDB by IANA - }//end group ipv6Address - - /** - * @desc PDU type derived from RFC2461 clause 4.2 - */ - type record RouterAdvertisementMsg { - UInt8 icmpType(c_rtAdvMsg), - UInt8 icmpCode, - Oct2 checksum, - UInt8 curHopLimit, - UInt1 managedConfigFlag, - UInt1 otherConfigFlag, - UInt1 homeAgentFlag, - UInt5 reserved, - UInt16 routerLifetime, - UInt32 reachableTime, - UInt32 retransTimer, - RtAdvOptions rtAdvOptions optional - } // FIXME CHECK while TITAN refuse it: with { variant (checksum) "MarkForIPv6ChecksumCalculation" } - - /** - * @desc RouterAdvertisement option list - * - * @remark Any RtAdvOptions value should at least have - * one of the first three options present! - */ - type set RtAdvOptions { - SrcLinkLayerAddress srcLinkLayerAddr optional, -// MtuOption mtuOption optional, - PrefixInfoList prefixInfoList optional, -// AdvertisementInterval advertisementInterval optional, -// HomeAgentInfo homeAgentInfo optional, - octetstring otherOption optional - } - - /** - * @desc Derived from RFC2461 clause4.6.1 + MIPv6 - * @url http://www.ietf.org/rfc/rfc2461.txt - */ - type record SrcLinkLayerAddress { - UInt8 icmpType(c_srcLinkLayerAddress), - UInt8 optionLength, - Oct6to15 linkLayerAddr - } - - type set length (1..c_maxNrPrefixInfo) of PrefixInfo PrefixInfoList; - - /** - * @desc Derived from RFC 2461 clause 4.6.2 - */ - type record PrefixInfo { - UInt8 icmpType(c_prefixInfo), - UInt8 optionLength, - UInt8 prefixLength, - UInt1 linkFlag, - UInt1 autoConfigFlag, - UInt1 rtAddrFlag, - UInt5 reserved1, - UInt32 validLifetime, - UInt32 preferredLifetime, - UInt32 reserved2, - Prefix prefix - } - - type Ipv6Address Prefix ; - - group neighbourDiscoveryConstants { - const UInt8 c_maxNrPrefixInfo := 10; - const UInt1 c_rtAddrFlag0 := 0; - - const UInt1 c_aFlag0 := 0; - const UInt1 c_aFlag1 := 1; - const UInt1 c_rFlag0 := 0; - const UInt1 c_rFlag1 := 1; - const UInt1 c_sFlag0 := 0; - const UInt1 c_sFlag1 := 1; - const UInt1 c_oFlag0 := 0; - const UInt1 c_oFlag1 := 1; - const UInt1 c_mFlag0 := 0; - const UInt1 c_mFlag1 := 1; - const UInt1 c_lFlag0 := 0; - const UInt1 c_lFlag1 := 1; - - const UInt16 c_zeroLifetime := 0 ; - const UInt32 c_validLifetime20s := 20; - const UInt32 c_validLifetime30s := 30; - const UInt32 c_preferredLifetime30s := 30; - - } // end group neighbourDiscoveryConstants - - const UInt8 c_srcLinkLayerAddress := 1; - const UInt8 c_prefixInfoLen := 4; - - } // end group ipv6 - - group acPrimitives { - - /** - * @desc GN6 TA primitives - * @member getInterfaceInfos Primitive for querying IUT's interface information - */ - type union AcGn6Primitive { - integer getInterfaceInfos - } - - /** - * @desc GN6 TA responses - * @member interfaceInfoList Primitive for retrieving IUT's interface information - */ - type union AcGn6Response { - AcGn6InterfaceInfoList interfaceInfoList - } - - /** - * @desc List of interface informations - */ - type record of AcGn6InterfaceInfo AcGn6InterfaceInfoList; - - /** - * @desc Interface informations - * @member interfaceName Interface name - * @member ipv6AddressList Configured IPv6 addresses for this interface - */ - type record AcGn6InterfaceInfo { - charstring interfaceName, - Ipv6AddressList ipv6AddressList - } - - /** - * @desc List of IPv6 addresses - */ - type record of Ipv6Address Ipv6AddressList; - - } // end acPrimitives - -} -with { - variant "" - encode "LibItsIpv6OverGeoNetworking" -} \ No newline at end of file diff --git a/ttcn/Ipv6OverGeoNetworking/module.mk b/ttcn/Ipv6OverGeoNetworking/module.mk deleted file mode 100644 index bc70007d..00000000 --- a/ttcn/Ipv6OverGeoNetworking/module.mk +++ /dev/null @@ -1,8 +0,0 @@ -sources := \ -LibItsIpv6OverGeoNetworking_EncdecDeclarations.ttcn \ -LibItsIpv6OverGeoNetworking_Functions.ttcn \ -LibItsIpv6OverGeoNetworking_Pics.ttcn \ -LibItsIpv6OverGeoNetworking_Pixits.ttcn \ -LibItsIpv6OverGeoNetworking_Templates.ttcn \ -LibItsIpv6OverGeoNetworking_TestSystem.ttcn \ -LibItsIpv6OverGeoNetworking_TypesAndValues.ttcn \ No newline at end of file diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_EncdecDeclarations.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_EncdecDeclarations.ttcn deleted file mode 100644 index 6177edd0..00000000 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_EncdecDeclarations.ttcn +++ /dev/null @@ -1,19 +0,0 @@ -module LibItsMapemSpatem_EncdecDeclarations { - - // LibIts - import from MAPEM_PDU_Descriptions language "ASN.1:1997" all; - import from SPATEM_PDU_Descriptions language "ASN.1:1997" all; - - external function fx_enc_MAPEM (MAPEM pdu) return bitstring - with {extension "prototype(convert) encode(PER)"} - - external function fx_dec_MAPEM (inout bitstring b, out MAPEM p) return integer - with {extension "prototype(sliding) decode(PER)"} - - external function fx_enc_SPATEM (SPATEM pdu) return bitstring - with {extension "prototype(convert) encode(PER)"} - - external function fx_dec_SPATEM (inout bitstring b, out SPATEM p) return integer - with {extension "prototype(sliding) decode(PER)"} - -} // End of module LibItsMapemSpatem_EncdecDeclarations diff --git a/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn b/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn deleted file mode 100644 index 1f31709f..00000000 --- a/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn +++ /dev/null @@ -1,461 +0,0 @@ -/** - * @author ETSI / STF484 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/MapemSpatem/LibItsMapemSpatem_Functions.ttcn $ - * $Id: LibItsMapemSpatem_Functions.ttcn,v 1.2 2018/05/31 15:57:09 dte Exp $ - * @desc Module containing common functions for ITS MAPEM SPATEM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsMapemSpatem_Functions { - - // LibCommon - import from LibCommon_Sync all; - import from LibCommon_Time all; - import from LibCommon_VerdictControl all; - - // LibIts - import from ITS_Container language "ASN.1:1997" all; - import from DSRC language "ASN.1:1997" all; - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - import from LibItsCommon_Templates all; - import from LibItsCommon_Functions all; - import from LibItsCommon_Pixits all; - - // LibItsSecurity - import from LibItsSecurity_Functions all; - - // LibItsMapemSpatem - import from LibItsMapemSpatem_TestSystem all; - import from LibItsMapemSpatem_TypesAndValues all; - import from LibItsMapemSpatem_Templates all; - import from LibItsMapemSpatem_Pics all; - import from LibItsMapemSpatem_Pixits all; - - group utFuntions { - - /** - * @desc Requests to bring the IUT in an initial state - * @param p_init The initialisation to trigger. - */ - function f_utInitializeIut(template (value) UtMapemSpatemInitialize p_init) runs on ItsMapemSpatem { - - //deactivate mapemSpatemPort default alts - vc_mapemSpatemDefaultActive := false; - - utPort.send(p_init); - tc_wait.start; - alt { - [] utPort.receive(UtMapemSpatemResults: { utMapemSpatemInitializeResult := true }) { - tc_wait.stop; - log("*** " & testcasename() & ": INFO: IUT initialized ***"); - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //deactivate mapemSpatemPort default alts - vc_mapemSpatemDefaultActive := true; - } - - /** - * @desc Triggers an event from the application layer - * @param p_event The event to trigger. - */ - function f_utTriggerEvent( - in template (value) UtMapemSpatemTrigger p_event - ) runs on ItsMapemSpatem { - - //deactivate mapemSpatemPort default alts - vc_mapemSpatemDefaultActive := false; - - utPort.send ( p_event ); - tc_wait.start; - alt { - [] utPort.receive ( UtMapemSpatemResults: { utMapemSpatemTriggerResult := true }) { - tc_wait.stop; - } - [] utPort.receive ( UtMapemSpatemResults: { utMapemSpatemTriggerResult := false }) { - tc_wait.stop; - f_selfOrClientSyncAndVerdict("MapSpat Trigger failed", e_error); - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //deactivate mapemSpatemPort default alts - vc_mapemSpatemDefaultActive := true; - - return; - } - } // End of group utFuntions - - group adapterControl { - - /** - * @desc Initialise secure mode if required - */ - function f_initialiseSecuredMode( - in charstring p_certificateId := PX_CERT_FOR_TS - ) runs on ItsMapemSpatem { - - if (PICS_IS_IUT_SECURED == true) { - - if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificateId))) { - log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); - stop; - } - } - - } // End of function f_initialiseSecuredMode() - - function f_uninitialiseSecuredMode() runs on ItsMapemSpatem { - - if (PICS_IS_IUT_SECURED == true) { - f_acTriggerSecEvent(m_acDisableSecurity); - } - - } // End of function f_initialiseSecuredMode() - - /** - * @desc Triggers event in the test system adaptation. - * @param p_event The event to trigger - * @return FncRetCode - */ - function f_acTriggerSecEvent(template (value) AcSecPrimitive p_event) runs on ItsMapemSpatem return FncRetCode { - var FncRetCode v_ret := e_success; - - acPort.send(p_event); - tc_ac.start; - alt { - [] acPort.receive(m_acSecResponseSuccess) { - tc_ac.stop; - } - [] acPort.receive { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - return v_ret; - } - - } // End of group adapterControl - - group altsteps { - - /** - * @desc Default handling cf01 de-initialisation. - */ - altstep a_cf01Down() runs on ItsMapemSpatem { - [] a_shutdown() { - f_poDefault(); - f_cfDown(); - log("*** a_cf01Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc Default handling cf02 de-initialisation. - */ - altstep a_cf02Down() runs on ItsMtc { - [] a_shutdown() { - f_cf02Down(); - log("*** a_cf02Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc The base default. - */ - altstep a_default() runs on ItsMapemSpatem { - [vc_mapemSpatemDefaultActive] mapemSpatemPort.receive(mw_mapemInd(mw_mapemPdu(mw_defaultMapem))) { - log("*** " & testcasename() & ": INFO: MAPEM received in default ***"); - vc_mapemReceived := true; - repeat; - } - [vc_mapemSpatemDefaultActive] mapemSpatemPort.receive(mw_spatemInd(mw_spatemPdu(mw_defaultSpatem))) { - log("*** " & testcasename() & ": INFO: MAPEM received in default ***"); - vc_spatemReceived := true; - repeat; - } - [vc_mapemSpatemDefaultActive] mapemSpatemPort.receive { - log("*** " & testcasename() & ": ERROR: Received an unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] any timer.timeout { - log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] a_shutdown() { - f_poDefault(); - f_cfDown(); - log("*** " & testcasename() & ": INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc The default for handling upper tester messages. - */ - altstep a_utDefault() runs on ItsMapemSpatem { - var UtMapemEventInd v_mapemevent; - var UtSpatemEventInd v_spatemevent; - [] utPort.receive(UtMapemEventInd:?) -> value v_mapemevent { - //store every upper tester indication received - log("*** " & testcasename() & ": INFO: Store UtMapemEventInd messge ***"); - vc_utMapemEvents[lengthof(vc_utMapemEvents)] := v_mapemevent; - repeat; - } - [] utPort.receive(UtSpatemEventInd:?) -> value v_spatemevent { - //store every upper tester indication received - log("*** " & testcasename() & ": INFO: Store UtSpatemEventInd messge ***"); - vc_utSpatemEvents[lengthof(vc_utSpatemEvents)] := v_spatemevent; - repeat; - } - [] utPort.receive { - log("*** " & testcasename() & ": INFO: Received unhandled/unknown UT message from IUT ***"); - repeat; - } - } - - } // End of group altsteps - - group mapSpatConfigurationFunctions { - - /** - * @desc Setups default configuration - * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT - */ - function f_cfUp( - in charstring p_certificateId := PX_CERT_FOR_TS - ) runs on ItsMapemSpatem system ItsMapemSpatemSystem { - - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - map(self:mapemSpatemPort, system:mapemSpatemPort); - - // Connect - f_connect4SelfOrClientSync(); - activate(a_cf01Down()); - - // Initialise secured mode - f_initialiseSecuredMode(p_certificateId); - - } // End of f_cfUp - - /** - * @desc Deletes default configuration - */ - function f_cfDown() runs on ItsMapemSpatem /* TITAN TODO: system ItsMapemSpatemSystem */ { - - // Initialise secured mode - f_uninitialiseSecuredMode(); - - unmap(self:utPort, system:utPort); - unmap(self:acPort, system:acPort); - unmap(self:mapemSpatemPort, system:mapemSpatemPort); - - f_disconnect4SelfOrClientSync(); - } // End of f_cfDown - - /** - * @desc Setups default configuration - * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT - */ - function f_cf02Up(in charstring p_certificateId := PX_CERT_FOR_TS - ) runs on ItsMtc mtc ItsMtc system ItsMapemSpatemSystem { - - // Variables - var integer i; - - // Select components - vc_componentTable := {{c_compMap, omit}, {c_compSpat, omit}}; - - // Create components - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - vc_componentTable[i].msComponent := ItsMapemSpatem.create(vc_componentTable[i].componentName) alive; - } - - // Map & Connect - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - connect(self:syncPort, mtc:syncPort); - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - map(vc_componentTable[i].msComponent:acPort, system:acPort); - map(vc_componentTable[i].msComponent:utPort, system:utPort); - map(vc_componentTable[i].msComponent:mapemSpatemPort, system:mapemSpatemPort); - connect(vc_componentTable[i].msComponent:syncPort, self:syncPort); - } - - activate(a_cf02Down()); - - // Initialise secured mode - f_initialiseSecuredMode(p_certificateId); - - } // End of f_cf02Up - - /** - * @desc Deletes default configuration - */ - function f_cf02Down() runs on ItsMtc mtc ItsMtc system ItsMapemSpatemSystem { - - // Local variables - var integer i; - - f_uninitialiseSecuredMode(); - - // Unmap & Disconnect - for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { - unmap(vc_componentTable[i].msComponent:utPort, system:utPort); - unmap(vc_componentTable[i].msComponent:acPort, system:acPort); - unmap(vc_componentTable[i].msComponent:mapemSpatemPort, system:mapemSpatemPort); - disconnect(vc_componentTable[i].msComponent:syncPort, self:syncPort); - } - unmap(self:acPort, system:acPort); - unmap(self:utPort, system:utPort); - disconnect(self:syncPort, mtc:syncPort); - - - } // End of f_cf02Down - - } // End of of mapSpatConfigurationFunctions - - group preambles { - - /** - * @desc The default preamble. - */ - function f_prDefault() runs on ItsMapemSpatem { - vc_default := activate(a_default()); - activate(a_utDefault()); - } - - /** - * @desc Brings the IUT into an initial state. - * @return FncRetCode - */ - function f_prInitialState( - in charstring p_certificate_id := "" - ) runs on ItsMapemSpatem return FncRetCode { - var FncRetCode v_ret := e_success; - - // Initialize IUT with given certificate - if (p_certificate_id != "") { // Initialize IUT with given certificate - var HashedId8 v_hashedId8 := '0000000000000000'O; - - fx_readCertificateDigest("CERT_SRM_SSP_NONE", v_hashedId8); - if ('0000000000000000'O == v_hashedId8) { - // Certificate not found - log("*** " & testcasename() & ": Required IUT certificate is not found on the test system ***"); - return e_timeout; - } - f_utInitializeIut(m_mapemSpatemInitialize(v_hashedId8)); - } else { - f_utInitializeIut(m_mapemSpatemInitialize); - } - f_prDefault(); - return v_ret; - } - - } // End of group preambles - - group postambles { - - /** - * @desc The default postamble. - */ - function f_poDefault() runs on ItsMapemSpatem { - //empty - } - - } // End of group postambles - - group receiveFunctions { - - /** - * @desc Awaits a SPATE message and returns it - * @param p_rcvMsg The expected message to be received. - * @param p_rcvdMsg The received message - OUT. - */ - function f_awaitSpateMessage(in template (present) SpatemInd p_rcvMsg, out SpatemInd p_rcvdMsg) runs on ItsMapemSpatem { - - tc_ac.start; - alt { - [] mapemSpatemPort.receive(p_rcvMsg) -> value p_rcvdMsg { - tc_ac.stop; - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INFO: Timeout while awaiting the reception of a message ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - } - - /** - * @desc Awaits a MAPE message and returns it - * @param p_rcvMsg The expected message to be received. - * @param p_rcvdMsg The received message - OUT. - */ - function f_awaitMapeMessage(in template (present) MapemInd p_rcvMsg, out MapemInd p_rcvdMsg) runs on ItsMapemSpatem { - - tc_ac.start; - alt { - [] mapemSpatemPort.receive(p_rcvMsg) -> value p_rcvdMsg { - tc_ac.stop; - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INFO: Timeout while awaiting the reception of a message ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - } - - } // End of group receiveFunctions - - group componentFunctions { - /** - * @desc Get the component corresponding to a key - * @param p_componentName Name searched component - * @return ItsGeoNetworking - The searched position vector - */ - function f_getComponent( - in charstring p_componentName - ) runs on ItsMtc - return ItsMapemSpatem { - - var ItsMapemSpatem v_return := null; - var integer i := 0; - - for (i:=0; i>> f_initializeState: vc_hashedId8ToBeUsed= ", vc_hashedId8ToBeUsed); - v_hashedId8ToBeUsed := f_setupIutCertificate(vc_hashedId8ToBeUsed); - log("f_initializeState: v_hashedId8ToBeUsed= ", v_hashedId8ToBeUsed); - - f_utInitializeIut(UtPkiInitialize: { v_hashedId8ToBeUsed } ); - - f_sleep(PX_NEIGHBOUR_DISCOVERY_DELAY); - - // f_acLoadScenario(p_scenario); - // f_acStartScenario(); - } - - } // End of pkiConfigurationFunctions - - group ut_port { - - function f_utInitializeIut(template (value) UtPkiInitialize p_init) runs on ItsPkiItss { - utPort.send(p_init); - tc_wait.start; - alt { - [] utPort.receive(UtPkiResults: { utPkiInitializeResult := true }) { - tc_wait.stop; - log("*** f_utInitializeIut: INFO: IUT initialized ***"); - } - [] utPort.receive { - tc_wait.stop; - log("*** f_utInitializeIut: INFO: IUT could not be initialized ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_wait.timeout { - log("*** f_utInitializeIut: INFO: IUT could not be initialized in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - } // End of function f_utInitializeIut - - function f_sendUtTriggerEnrolmentRequestPrimitive( - in octetstring p_canonical_id := ''O, - in Oct1 p_enc_algorithm := '00'O, - in octetstring p_private_key := ''O, - in octetstring p_public_key_compressed := ''O, - in integer p_compressed_mode := 0 - ) runs on ItsPkiItss { - var TriggerEnrolmentRequest v_ut_trigger_enrolment_request; - var octetstring v_compressed_public_key; - - if (p_compressed_mode == 2) { // TODO v_compressed_public_key := int2oct(p_compressed_mode, 1) & p_public_key_compressed? - v_compressed_public_key := '02'O & p_public_key_compressed; - } else { - v_compressed_public_key := '03'O & p_public_key_compressed; - } - - v_ut_trigger_enrolment_request := { p_canonical_id, p_enc_algorithm, p_private_key, v_compressed_public_key }; - utPort.send(UtPkiTrigger: { triggerEnrolmentRequest := v_ut_trigger_enrolment_request }); - tc_ac.start; - alt { - [] utPort.receive(UtPkiResults: { utPkiTriggerResult := true }) { - tc_ac.stop; - } - [] utPort.receive(UtPkiResults: { utPkiTriggerResult := false }) { - tc_ac.stop; - log("*** f_sendUtTriggerEnrolmentRequestPrimitive: ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** f_sendAcPkiPrimitive: ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } // End of 'alt' statement - } // End of function f_sendUtTriggerEnrolmentRequestPrimitive - - function f_sendUtTriggerAuthorizationRequestPrimitive( - in octetstring p_canonical_id := ''O, - in Oct1 p_enc_algorithm := '00'O, - in octetstring p_private_key := ''O, - in octetstring p_public_key_compressed := ''O, - in integer p_compressed_mode := 0 - ) runs on ItsPkiItss { - var TriggerAuthorizationRequest v_ut_trigger_enrolment_request; - var octetstring v_compressed_public_key; - - if (p_compressed_mode == 2) { // TODO v_compressed_public_key := int2oct(p_compressed_mode, 1) & p_public_key_compressed? - v_compressed_public_key := '02'O & p_public_key_compressed; - } else { - v_compressed_public_key := '03'O & p_public_key_compressed; - } - - v_ut_trigger_enrolment_request := { p_canonical_id, p_enc_algorithm, p_private_key, v_compressed_public_key }; - utPort.send(UtPkiTrigger: { triggerAuthorizationRequest := v_ut_trigger_enrolment_request }); - tc_ac.start; - alt { - [] utPort.receive(UtPkiResults: { utPkiTriggerResult := true }) { - tc_ac.stop; - } - [] utPort.receive(UtPkiResults: { utPkiTriggerResult := false }) { - tc_ac.stop; - log("*** f_sendUtTriggerAuthorizationRequestPrimitive: ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** f_sendAcPkiPrimitive: ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } // End of 'alt' statement - } // End of function f_sendUtTriggerAuthorizationRequestPrimitive - - } // End of group ut_port - - group helpers { - - function f_generate_key_pair( - out octetstring p_private_key, - out octetstring p_public_key_x, - out octetstring p_public_key_y, - out octetstring p_public_key_compressed, - out integer p_compressed_mode - ) return boolean { - log(">>> f_generate_key_pair: PX_VE_ALG=", PX_VE_ALG); - - if (PX_VE_ALG == e_nist_p256) { - f_generate_key_pair_nistp256(p_private_key, p_public_key_x, p_public_key_y, p_public_key_compressed, p_compressed_mode); - } else if (PX_VE_ALG == e_brainpool_p256_r1) { - f_generate_key_pair_brainpoolp256r1(p_private_key, p_public_key_x, p_public_key_y, p_public_key_compressed, p_compressed_mode); - } else if (PX_VE_ALG == e_brainpool_p384_r1) { - f_generate_key_pair_brainpoolp384r1(p_private_key, p_public_key_x, p_public_key_y, p_public_key_compressed, p_compressed_mode); - } else { - // error - return false; - } - - log("<<< f_generate_key_pair: p_compressed_mode=", p_compressed_mode); - return true; - } - - function f_generate_key_pair_for_encryption( - in SecurityAlg p_algorithm, - out octetstring p_private_key, - out octetstring p_public_key_x, - out octetstring p_public_key_y, - out octetstring p_public_key_compressed, - out integer p_compressed_mode - ) return boolean { - if (p_algorithm == e_nist_p256) { - f_generate_key_pair_nistp256(p_private_key, p_public_key_x, p_public_key_y, p_public_key_compressed, p_compressed_mode); - } else if (p_algorithm == e_brainpool_p256_r1) { - f_generate_key_pair_brainpoolp256r1(p_private_key, p_public_key_x, p_public_key_y, p_public_key_compressed, p_compressed_mode); - } else { - // error - return false; - } - - return true; - } - - function f_signWithEcdsa( - in octetstring p_toBeSignedSecuredMessage, - in octetstring p_certificateIssuer, - in octetstring p_privateKey - ) return octetstring { - log(">>> f_verifyEcdsa: p_toBeSignedSecuredMessage= ", p_toBeSignedSecuredMessage); - log(">>> f_verifyEcdsa: p_certificateIssuer= ", p_certificateIssuer); - log(">>> f_verifyEcdsa: p_privateKey= ", p_privateKey); - log(">>> f_verifyEcdsa: PX_VE_ALG= ", PX_VE_ALG); - - if (PX_VE_ALG == e_nist_p256) { - return f_signWithEcdsaNistp256WithSha256(p_toBeSignedSecuredMessage, p_certificateIssuer, p_privateKey); - } else if (PX_VE_ALG == e_brainpool_p256_r1) { - return f_signWithEcdsaBrainpoolp256r1WithSha256(p_toBeSignedSecuredMessage, p_certificateIssuer, p_privateKey); - } else if (PX_VE_ALG == e_brainpool_p384_r1) { - if (p_certificateIssuer == int2oct(0, 32)) { - return f_signWithEcdsaBrainpoolp384r1WithSha384(p_toBeSignedSecuredMessage, int2oct(0, 48), p_privateKey); - } else { - return f_signWithEcdsaBrainpoolp384r1WithSha384(p_toBeSignedSecuredMessage, p_certificateIssuer, p_privateKey); - } - } - - return ''O; - } // End of function f_signWithEcdsa - - function f_verifyEcdsa( - in octetstring p_tbs, - in octetstring p_issuer, - in Signature p_signature_, - in PublicVerificationKey p_verification_key - ) return boolean { - var boolean v_ret := false; - - log(">>> f_verifyEcdsa: p_tbs= ", p_tbs); - log(">>> f_verifyEcdsa: p_issuer= ", p_issuer); - log(">>> f_verifyEcdsa: p_signature_= ", p_signature_); - log(">>> f_verifyEcdsa: p_verification_key= ", p_verification_key); - - if (ischosen(p_verification_key.ecdsaNistP256)) { - if (ischosen(p_verification_key.ecdsaNistP256.compressed_y_0)) { - v_ret := f_verifyWithEcdsaNistp256WithSha256( - p_tbs, - p_issuer, - p_signature_.ecdsaNistP256Signature.rSig.x_only & p_signature_.ecdsaNistP256Signature.sSig, - p_verification_key.ecdsaNistP256.compressed_y_0, - 0); - } else { - v_ret := f_verifyWithEcdsaNistp256WithSha256( - p_tbs, - p_issuer, - p_signature_.ecdsaNistP256Signature.rSig.x_only & p_signature_.ecdsaNistP256Signature.sSig, - p_verification_key.ecdsaNistP256.compressed_y_1, - 1); - } - } else if (ischosen(p_verification_key.ecdsaBrainpoolP256r1)) { - if (ischosen(p_verification_key.ecdsaBrainpoolP256r1.compressed_y_0)) { - v_ret := f_verifyWithEcdsaBrainpoolp256r1WithSha256( - p_tbs, - p_issuer, - p_signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only & p_signature_.ecdsaBrainpoolP256r1Signature.sSig, - p_verification_key.ecdsaBrainpoolP256r1.compressed_y_0, - 0); - } else { - v_ret := f_verifyWithEcdsaBrainpoolp256r1WithSha256( - p_tbs, - p_issuer, - p_signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only & p_signature_.ecdsaBrainpoolP256r1Signature.sSig, - p_verification_key.ecdsaBrainpoolP256r1.compressed_y_1, - 1); - } - } else if (ischosen(p_verification_key.ecdsaBrainpoolP384r1)) { - if (ischosen(p_verification_key.ecdsaBrainpoolP384r1.compressed_y_0)) { - v_ret := f_verifyWithEcdsaBrainpoolp384r1WithSha384( - p_tbs, - p_issuer, - p_signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only & p_signature_.ecdsaBrainpoolP384r1Signature.sSig, - p_verification_key.ecdsaBrainpoolP384r1.compressed_y_0, - 0); - } else { - v_ret := f_verifyWithEcdsaBrainpoolp384r1WithSha384( - p_tbs, - p_issuer, - p_signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only & p_signature_.ecdsaBrainpoolP384r1Signature.sSig, - p_verification_key.ecdsaBrainpoolP384r1.compressed_y_1, - 1); - } - } - - return v_ret; - } // End of function f_verifyEcdsa - - function f_http_send( - in Headers p_headers, - in template (value) HttpMessage p_http_message - ) runs on ItsPkiHttp { - log(">>> f_http_send: ", p_http_message); - - if (not(PICS_MULTIPLE_END_POINT)) { - httpPort.send(p_http_message); - } else { - var charstring_list v_content_text; - - f_get_header(p_headers, c_header_content_text, v_content_text); - - if (not(isvalue(v_content_text))) { - log("f_http_send: Failed to send message: header not found: ", c_header_content_text); - return; - } - if (v_content_text == { "inner_ec_request" }) { - log("f_http_send: Send on EC end point"); - f_set_headers_list({ c_header_host }, { PICS_HEADER_HOST_EC }, p_headers); - if (ischosen(p_http_message.request)) { - p_http_message.request.header := p_headers; - } else { - p_http_message.response.header := p_headers; - } - httpEcPort.send(p_http_message); - } else if (v_content_text == { "inner_atv_request" }) { - log("f_http_send: Send on ATV end point"); - f_set_headers_list({ c_header_host }, { PICS_HEADER_HOST_ATV }, p_headers); - if (ischosen(p_http_message.request)) { - p_http_message.request.header := p_headers; - } else { - p_http_message.response.header := p_headers; - } - httpAtVPort.send(p_http_message); - } else if (v_content_text == { "inner_at_request" }) { - log("f_http_send: Send on AT end point"); - f_set_headers_list({ c_header_host }, { PICS_HEADER_HOST_AT }, p_headers); - if (ischosen(p_http_message.request)) { - p_http_message.request.header := p_headers; - } else { - p_http_message.response.header := p_headers; - } - httpAtPort.send(p_http_message); - } else if (v_content_text == { "ca_request" }) { - log("f_http_send: Send on CA end point"); - f_set_headers_list({ c_header_host }, { PICS_HEADER_HOST_CA }, p_headers); - if (ischosen(p_http_message.request)) { - p_http_message.request.header := p_headers; - } else { - p_http_message.response.header := p_headers; - } - httpCaPort.send(p_http_message); - } else if (v_content_text == { "tlm_request" }) { - log("f_http_send: Send on TLM end point"); - f_set_headers_list({ c_header_host }, { PICS_HEADER_HOST_TLM }, p_headers); - if (ischosen(p_http_message.request)) { - p_http_message.request.header := p_headers; - } else { - p_http_message.response.header := p_headers; - } - httpTlmPort.send(p_http_message); - } else { - log("f_http_send: Invalid header value: ", v_content_text); - } - } - } // End of function f_http_send - - function f_generate_key_tag( - in octetstring p_public_key_compressed, - in integer p_compressed_key_mode, - in octetstring p_public_compressed_enc_key, - in integer p_compressed_enc_key_mode, - out octetstring p_encoded_tag - ) return boolean { - // Local variables - var PublicVerificationKey v_verification_tag; - var PublicEncryptionKey v_encryption_tag; - - log(">>> f_generate_key_tag: p_public_key_compressed=", p_public_key_compressed); - log(">>> f_generate_key_tag: p_public_compressed_enc_key=", p_public_compressed_enc_key); - - - if (PX_VE_ALG == e_nist_p256) { - if (p_compressed_key_mode == 0) { - v_verification_tag.ecdsaNistP256.compressed_y_0 := p_public_key_compressed; - } else { - v_verification_tag.ecdsaNistP256.compressed_y_1 := p_public_key_compressed; - } - } else if (PX_VE_ALG == e_brainpool_p256_r1) { - if (p_compressed_key_mode == 0) { - v_verification_tag.ecdsaBrainpoolP256r1.compressed_y_0 := p_public_key_compressed; - } else { - v_verification_tag.ecdsaBrainpoolP256r1.compressed_y_1 := p_public_key_compressed; - } - } else if (PX_VE_ALG == e_brainpool_p384_r1) { - if (p_compressed_key_mode == 0) { - v_verification_tag.ecdsaBrainpoolP384r1.compressed_y_0 := p_public_key_compressed; - } else { - v_verification_tag.ecdsaBrainpoolP384r1.compressed_y_1 := p_public_key_compressed; - } - } else { - log("f_generate_key_tag: Failed to generate HMAC tag"); - return false; - } - log("f_generate_key_tag: v_verification_tag= ", v_verification_tag); - p_encoded_tag := bit2oct(encvalue(v_verification_tag)); - if (PX_INCLUDE_ENCRYPTION_KEYS) { - v_encryption_tag.supportedSymmAlg := aes128Ccm; - if (PX_EC_ALG_FOR_EC_SIGN == e_nist_p256) { - if (p_compressed_enc_key_mode == 0) { - v_encryption_tag.publicKey.eciesNistP256.compressed_y_0 := p_public_compressed_enc_key; - } else { - v_encryption_tag.publicKey.eciesNistP256.compressed_y_1 := p_public_compressed_enc_key; - } - } else if (PX_EC_ALG_FOR_EC_SIGN == e_brainpool_p256_r1) { - if (p_compressed_enc_key_mode == 0) { - v_encryption_tag.publicKey.eciesBrainpoolP256r1.compressed_y_0 := p_public_compressed_enc_key; - } else { - v_encryption_tag.publicKey.eciesBrainpoolP256r1.compressed_y_1 := p_public_compressed_enc_key; - } - } else { - log("f_generate_key_tag: Failed to generate HMAC tag (enc)"); - return false; - } - log("f_generate_key_tag: v_encryption_tag= ", v_encryption_tag); - p_encoded_tag := p_encoded_tag & bit2oct(encvalue(v_encryption_tag)); - } - - return true; - } // End of function f_generate_key_tag - - } // End of group helpers - - group http { // TODO Split into EnnerEc, Authorization & AuthorizationValidation - - function f_http_build_inner_ec_request( // TODO Cleanup parameters - out octetstring p_private_key, - out octetstring p_public_key_compressed, - out integer p_compressed_mode, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce, - out octetstring p_salt, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, - out Oct32 p_request_hash - ) runs on ItsPkiHttp { - var InnerEcRequest v_inner_ec_request; - var Ieee1609Dot2Data v_inner_ec_request_signed_for_pop; - var octetstring v_public_enc_key; - var integer v_compressed_enc_key_mode; - var boolean v_result; - - log(">>> f_http_build_inner_ec_request"); - if (f_generate_inner_ec_request(p_private_key, p_public_key_compressed, p_compressed_mode, v_inner_ec_request) == false) { - log("*** f_http_build_inner_ec_request: ERROR: Failed to generate InnerEcRequest ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log ("f_http_build_inner_ec_request: ==> EC verification private key: ", p_private_key); - log ("f_http_build_inner_ec_request: ==> EC verification public compressed key: ", p_public_key_compressed); - log ("f_http_build_inner_ec_request: ==> EC verification public compressed mode: ", p_compressed_mode); - // TODO Store enrolment keys for re-enrolment - vc_ec_private_keys[vc_ec_keys_counter] := p_private_key; - vc_ec_public_compressed_key[vc_ec_keys_counter] := p_public_key_compressed; - vc_ec_compressed_modes[vc_ec_keys_counter] := p_compressed_mode; - vc_ec_keys_counter := vc_ec_keys_counter + 1; - // Generate InnerEcRequestSignedForPoP - if (f_generate_inner_ec_request_signed_for_pop(p_private_key, v_inner_ec_request, v_inner_ec_request_signed_for_pop) == false) { - log("*** f_http_build_inner_ec_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log("f_http_build_inner_ec_request: v_inner_ec_request_signed_for_pop= ", v_inner_ec_request_signed_for_pop); - - // Secure InnerEcRequestSignedForPoP message - if (f_extract_enc_key(vc_eaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { - log("*** f_http_build_inner_ec_request: ERROR: Non canonical EA certificate ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log("f_http_build_inner_ec_request: Public encryption key: ", v_public_enc_key); - log("f_http_build_inner_ec_request: Public encryption key comp: ", v_compressed_enc_key_mode); - p_salt := vc_eaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. - if ((PICS_SECPKI_REENROLMENT == false) or (vc_ec_keys_counter == 1)) { // This is the first enrolment, we used Factory keys - var octetstring v_private_key; - if (PX_VE_ALG == e_nist_p256) { - v_private_key := PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY; - } else if (PX_VE_ALG == e_brainpool_p256_r1) { - v_private_key := PICS_ITS_S_SIGN_BRAINPOOLP256r1_PRIVATE_KEY; - } else { - v_private_key := PICS_ITS_S_SIGN_BRAINPOOLP384r1_PRIVATE_KEY; - } - v_result := f_build_pki_secured_request_message_signed_with_pop(v_private_key, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); - } else { // We use last valid EC certificate - // TODO Retrieve EC certificate from the first enrolment instead of PX - log("f_http_build_inner_ec_request: v_ec_private_key: ", vc_ec_private_keys[vc_ec_keys_counter - 1]); - log("f_http_build_inner_ec_request: v_ec_public_compressed_key: ", vc_ec_public_compressed_key[vc_ec_keys_counter - 1]); - log("f_http_build_inner_ec_request: v_ec_compressed_modes: ", vc_ec_compressed_modes[vc_ec_keys_counter - 1]); - log("f_http_build_inner_ec_request: v_ec_hashed_id8: ", PX_EC_HASHED_ID8); - v_result := f_build_pki_secured_request_message_signed_with_pop(vc_ec_private_keys[vc_ec_keys_counter - 1], valueof(m_signerIdentifier_digest(PX_EC_HASHED_ID8)), PX_EC_HASHED_ID8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); - } - if (v_result == false) { - log("*** f_http_build_inner_ec_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } else { - log("f_http_build_inner_ec_request: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); - log("f_http_build_inner_ec_request: p_request_hash= ", p_request_hash); - } - } // End of function f_http_build_inner_ec_request - - function f_http_build_inner_ec_request_with_wrong_parameters( // TODO Cleanup parameters - in SequenceOfPsidSsp p_appPermissions, - in octetstring p_canonical_id := PICS_ITS_S_CANONICAL_ID, - in Time32 p_start, - in Duration p_duration, - in boolean p_alter_private_key := false, - out octetstring p_private_key, - out octetstring p_public_key_compressed, - out integer p_compressed_mode, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce, - out octetstring p_salt, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, - out Oct32 p_request_hash - ) runs on ItsPkiHttp { - var InnerEcRequest v_inner_ec_request; - var Ieee1609Dot2Data v_inner_ec_request_signed_for_pop; - var octetstring v_public_enc_key; - var integer v_compressed_enc_key_mode; - var boolean v_result; - - log(">>> f_http_build_inner_ec_request_with_wrong_parameters"); - if (f_generate_inner_ec_request_with_wrong_parameters(p_appPermissions, p_canonical_id, p_start, p_duration, p_alter_private_key, p_private_key, p_public_key_compressed, p_compressed_mode, v_inner_ec_request) == false) { - log("*** f_http_build_inner_ec_request_with_wrong_parameters: ERROR: Failed to generate InnerEcRequest ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log ("f_http_build_inner_ec_request_with_wrong_parameters: ==> EC verification private key: ", p_private_key); - log ("f_http_build_inner_ec_request_with_wrong_parameters: ==> EC verification public compressed key: ", p_public_key_compressed); - log ("f_http_build_inner_ec_request_with_wrong_parameters: ==> EC verification public compressed mode: ", p_compressed_mode); - // Generate InnerEcRequestSignedForPoP - if (f_generate_inner_ec_request_signed_for_pop(p_private_key, v_inner_ec_request, v_inner_ec_request_signed_for_pop) == false) { - log("*** f_http_build_inner_ec_request_with_wrong_parameters: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log("f_http_build_inner_ec_request_with_wrong_parameters: v_inner_ec_request_signed_for_pop= ", v_inner_ec_request_signed_for_pop); - - // Secure InnerEcRequestSignedForPoP message - if (f_extract_enc_key(vc_eaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { - log("*** f_http_build_inner_ec_request_with_wrong_parameters: ERROR: Non canonical EA certificate ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log("f_http_build_inner_ec_request_with_wrong_parameters: Public encryption key: ", v_public_enc_key); - log("f_http_build_inner_ec_request_with_wrong_parameters: Public encryption key comp: ", v_compressed_enc_key_mode); - p_salt := vc_eaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. - if (PICS_SECPKI_REENROLMENT == false) { // This is the first enrolment, we used Factory keys - var octetstring v_private_key; - if (PX_VE_ALG == e_nist_p256) { - v_private_key := PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY; - } else if (PX_VE_ALG == e_brainpool_p256_r1) { - v_private_key := PICS_ITS_S_SIGN_BRAINPOOLP256r1_PRIVATE_KEY; - } else { - v_private_key := PICS_ITS_S_SIGN_BRAINPOOLP384r1_PRIVATE_KEY; - } - v_result := f_build_pki_secured_request_message_signed_with_pop(v_private_key, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); - } else { // We use last valid EC certificate - // TODO Retrieve EC certificate from the first enrolment instead of PX - log("f_http_build_inner_ec_request_with_wrong_parameters: v_ec_private_key: ", PX_EC_PRIVATE_KEY); - log("f_http_build_inner_ec_request_with_wrong_parameters: v_ec_hashed_id8: ", PX_EC_HASHED_ID8); - v_result := f_build_pki_secured_request_message_signed_with_pop(PX_EC_PRIVATE_KEY, valueof(m_signerIdentifier_digest(PX_EC_HASHED_ID8)), PX_EC_HASHED_ID8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); - } - if (v_result == false) { - log("*** f_http_build_inner_ec_request_with_wrong_parameters: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } else { - log("f_http_build_inner_ec_request_with_wrong_parameters: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); - log("f_http_build_inner_ec_request_with_wrong_parameters: p_request_hash= ", p_request_hash); - } - } // End of function f_http_build_inner_ec_request_with_wrong_parameters - - function f_http_build_invalid_enrolment_request( - out octetstring p_private_key, - out octetstring p_public_key_compressed, - out integer p_compressed_mode, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce, - out octetstring p_salt, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, - out Oct32 p_request_hash - ) runs on ItsPkiHttp { - var InnerEcRequest v_inner_ec_request; - var Ieee1609Dot2Data v_inner_ec_request_signed_for_pop; - var octetstring v_public_enc_key; - var integer v_compressed_enc_key_mode; - var boolean v_ret_code; - - if (f_generate_inner_ec_request(p_private_key, p_public_key_compressed, p_compressed_mode, v_inner_ec_request) == false) { - log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequest ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log ("f_http_build_invalid_enrolment_request: EC verification private key: ", p_private_key); - log ("f_http_build_invalid_enrolment_request: EC verification public compressed key: ", p_public_key_compressed); - log ("f_http_build_invalid_enrolment_request: EC verification public compressed mode: ", p_compressed_mode); - // Generate InnerEcRequestSignedForPoP - if (f_generate_inner_ec_request_signed_for_pop(p_private_key, v_inner_ec_request, v_inner_ec_request_signed_for_pop) == false) { - log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log("f_http_build_invalid_enrolment_request: v_inner_ec_request_signed_for_pop= ", v_inner_ec_request_signed_for_pop); - // Modify signature to get an error - if (ischosen(v_inner_ec_request_signed_for_pop.content.signedData.signature_.ecdsaNistP256Signature)) { - v_inner_ec_request_signed_for_pop.content.signedData.signature_.ecdsaNistP256Signature.sSig[1] := bit2oct('10101010'B xor4b oct2bit(v_inner_ec_request_signed_for_pop.content.signedData.signature_.ecdsaNistP256Signature.sSig[1])); - } else if (ischosen(v_inner_ec_request_signed_for_pop.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { - v_inner_ec_request_signed_for_pop.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig[1] := bit2oct('10101010'B xor4b oct2bit(v_inner_ec_request_signed_for_pop.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig[1])); - } else { - v_inner_ec_request_signed_for_pop.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig[1] := bit2oct('10101010'B xor4b oct2bit(v_inner_ec_request_signed_for_pop.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig[1])); - } - - // Secure InnerEcRequestSignedForPoP message - if (f_extract_enc_key(vc_eaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { - log("*** f_http_build_invalid_enrolment_request: ERROR: Non canonical EA certificate ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log("*** f_http_build_invalid_enrolment_request: Public encryption key: ", v_public_enc_key); - log("*** f_http_build_invalid_enrolment_request: Public encryption key comp: ", v_compressed_enc_key_mode); - p_salt := vc_eaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. - if (PICS_SECPKI_REENROLMENT == false) { // This is the first enrolment, we used Factory keys - var octetstring v_private_key; - if (PX_VE_ALG == e_nist_p256) { - v_private_key := PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY; - } else if (PX_VE_ALG == e_brainpool_p256_r1) { - v_private_key := PICS_ITS_S_SIGN_BRAINPOOLP256r1_PRIVATE_KEY; - } else { - v_private_key := PICS_ITS_S_SIGN_BRAINPOOLP384r1_PRIVATE_KEY; - } - v_ret_code := f_build_pki_secured_request_message_signed_with_pop(v_private_key, valueof(m_signerIdentifier_self), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); - } else { // We use last valid EC certificate - // TODO Retrieve EC certificate from the first enrolment instead of PX - log("f_http_build_inner_ec_request: v_ec_private_key: ", PX_EC_PRIVATE_KEY); - log("f_http_build_inner_ec_request: v_ec_hashed_id8: ", PX_EC_HASHED_ID8); - v_ret_code := f_build_pki_secured_request_message_signed_with_pop(PX_EC_PRIVATE_KEY, valueof(m_signerIdentifier_digest(PX_EC_HASHED_ID8)), PX_EC_HASHED_ID8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_inner_ec_request_signed_for_pop(v_inner_ec_request_signed_for_pop))), PX_EC_ALG_FOR_EC, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash); - } - if (v_ret_code == false) { - log("*** f_http_build_invalid_enrolment_request: ERROR: Failed to generate InnerEcRequestSignedForPop ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log("*** f_http_build_invalid_enrolment_request: DEBUG: p_ieee1609dot2_signed_and_encrypted_data = ", p_ieee1609dot2_signed_and_encrypted_data); - } // End of function f_http_build_invalid_enrolment_request - - function f_http_build_inner_ec_response( - in template (omit) InnerEcRequest p_inner_ec_request := omit, - in EnrolmentResponseCode p_responseCode := ok, - in Oct16 p_request_hash, - in octetstring p_private_key := ''O, - in octetstring p_digest := ''O, - in Oct16 p_aes_sym_key, - out InnerEcResponse p_inner_ec_response, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data - ) return boolean { - // Local variables - var bitstring v_msg_bit; - var octetstring v_msg; - var Oct12 v_nonce; - var Ieee1609Dot2Data v_ieee1609dot2_signed_data; - var EtsiTs103097Certificate v_ec_certificate; - var boolean p_result := false; - - log(">>> f_http_build_inner_ec_response: p_inner_ec_request= ", p_inner_ec_request); - log(">>> f_http_build_inner_ec_response: p_responseCode= ", p_responseCode); - log(">>> f_http_build_inner_ec_response: p_request_hash= ", p_request_hash); - log(">>> f_http_build_inner_ec_response: p_private_key= ", p_private_key); - log(">>> f_http_build_inner_ec_response: p_digest= ", p_digest); - log(">>> f_http_build_inner_ec_response: p_aes_sym_key= ", p_aes_sym_key); - - // Check expectred response - if (p_responseCode != ok) { - p_inner_ec_response := valueof( - m_innerEcResponse_ko( - p_request_hash, - p_responseCode - ) - ); - p_result := true; - } else { - // Generate the certificate - if (f_generate_ec_certificate_for_inner_ec_response(valueof(p_inner_ec_request), p_private_key, p_digest, v_ec_certificate) == false) { - log("f_http_build_inner_ec_response: Failed to generate the certificate"); - p_inner_ec_response := valueof( - m_innerEcResponse_ko( - p_request_hash, - incompleterequest - ) - ); - } else { - p_inner_ec_response := valueof( - m_innerEcResponse_ok( - p_request_hash, - v_ec_certificate - ) - ); - } - } - - // Secure the response - log("f_http_build_inner_ec_response: p_inner_ec_response= ", p_inner_ec_response); - v_msg := bit2oct(encvalue(m_etsiTs102941Data_inner_ec_response(p_inner_ec_response))); - v_nonce := substr(f_hashWithSha256(int2oct((f_getCurrentTimeUtc() * 1000), 16)), 0, 12); // Random value - // TODO Consider Sha384: m_signerIdentifier_digest(f_hashedId8FromSha384(p_digest)) - if (f_build_pki_secured_response_message(p_private_key, - valueof(m_signerIdentifier_digest(f_hashedId8FromSha256(p_digest))),// in SignerIdentifier p_signer_identifier, - v_msg, - p_aes_sym_key, - v_nonce, - p_ieee1609dot2_signed_and_encrypted_data - ) == false) { - log("f_http_build_inner_ec_response: Failed to generate the certificate"); - p_inner_ec_response := valueof( - m_innerEcResponse_ko( - p_request_hash, - deniedrequest - ) - ); - } else { - p_result := true; - } - - return p_result; - } // End of function f_http_build_inner_ec_response - - function f_http_build_authorization_request( - in Certificate p_ec_certificate, // Enrolment credentials certificate - in octetstring p_ec_private_key, - out octetstring p_private_key, - out octetstring p_public_key_compressed, - out integer p_compressed_key_mode, - out octetstring p_private_enc_key, - out octetstring p_public_compressed_enc_key, - out integer p_compressed_enc_key_mode, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce, - out octetstring p_salt, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, - out Oct32 p_request_hash - ) runs on ItsPkiHttp { - // Local variables - var octetstring v_public_key_x; - var octetstring v_public_key_y; - var octetstring v_public_enc_key_x; - var octetstring v_public_enc_key_y; - var octetstring v_public_enc_key; - var integer v_compressed_enc_key_mode; - var InnerAtRequest v_inner_at_request; - var Ieee1609Dot2Data v_inner_at_request_data; - var InnerAtRequest v_authorization_request; - var bitstring v_authorization_request_msg; - - // Generate the InnerAtRequest - if (f_generate_inner_at_request(vc_aaCertificate, -, vc_aaHashedId8, vc_eaCertificate, vc_eaWholeHash/*salt*/, vc_eaHashedId8, p_ec_certificate, p_ec_private_key, p_private_key, p_public_key_compressed, p_compressed_key_mode, p_private_enc_key, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_inner_at_request) == false) { - log("*** f_http_build_authorization_request: ERROR: Failed to generate AuthorizationRequest ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - return; - } - log("f_http_build_authorization_request: v_inner_at_request= ", v_inner_at_request); - - // Secure InnerAtRequest message - if (f_extract_enc_key(vc_aaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { - log("*** f_http_build_authorization_request: ERROR: Non canonical AA certificate ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log("*** f_http_build_authorization_request: Public encryption key: ", v_public_enc_key); - log("*** f_http_build_authorization_request: Public encryption key comp: ", v_compressed_enc_key_mode); - p_salt := vc_aaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. - log("*** f_http_build_authorization_request: p_salt: ", p_salt); - if (PICS_PKI_AUTH_POP) { - if(f_build_pki_secured_request_message_signed_with_pop(p_private_key, valueof(m_signerIdentifier_self), vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), PX_EC_ALG_FOR_AT, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { - log("*** f_http_build_authorization_request: ERROR: Failed to generate Authorization Request ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - } else { // Only encryption of EtsiTs102941Data/InnerAtRequest - log("*** f_http_build_authorization_request: POP signature not applied"); - if(f_build_pki_secured_request_message_for_authorization(vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), PX_EC_ALG_FOR_AT, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { - log("*** f_http_build_authorization_request: ERROR: Failed to generate Authorization Request ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - } - log("*** f_http_build_authorization_request: DEBUG: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); - log("*** f_http_build_authorization_request: DEBUG: p_request_hash= ", p_request_hash); - } // End of function f_http_build_authorization_request - - function f_http_build_authorization_request_with_wrong_private_key( - in Certificate p_ec_certificate, // Enrolment credentials certificate - in octetstring p_ec_private_key, - out octetstring p_private_key, - out octetstring p_public_key_compressed, - out integer p_compressed_key_mode, - out octetstring p_private_enc_key, - out octetstring p_public_compressed_enc_key, - out integer p_compressed_enc_key_mode, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce, - out octetstring p_salt, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, - out Oct32 p_request_hash - ) runs on ItsPkiHttp { - // Local variables - var octetstring v_public_key_x; - var octetstring v_public_key_y; - var octetstring v_public_enc_key_x; - var octetstring v_public_enc_key_y; - var octetstring v_public_enc_key; - var integer v_compressed_enc_key_mode; - var InnerAtRequest v_inner_at_request; - var Ieee1609Dot2Data v_inner_at_request_data; - var InnerAtRequest v_authorization_request; - var bitstring v_authorization_request_msg; - - // Generate the InnerAtRequest - if (f_generate_inner_at_request(vc_aaCertificate, -, vc_aaHashedId8, vc_eaCertificate, vc_eaWholeHash/*salt*/, vc_eaHashedId8, p_ec_certificate, p_ec_private_key, p_private_key, p_public_key_compressed, p_compressed_key_mode, p_private_enc_key, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_inner_at_request) == false) { - log("*** f_http_build_authorization_request_with_wrong_private_key: ERROR: Failed to generate AuthorizationRequest ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - return; - } - log("f_http_build_authorization_request_with_wrong_private_key: v_inner_at_request= ", v_inner_at_request); - - // Secure InnerAtRequest message - /*** - Use the wrong private key - ***/ - if (f_extract_enc_key(vc_eaCertificate/*Insted of vc_aaCertificate/*/, v_public_enc_key, v_compressed_enc_key_mode) == false) { - log("*** f_http_build_authorization_request_with_wrong_private_key: ERROR: Non canonical EA certificate ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log("*** f_http_build_authorization_request_with_wrong_private_key: Public encryption key: ", v_public_enc_key); - log("*** f_http_build_authorization_request_with_wrong_private_key: Public encryption key comp: ", v_compressed_enc_key_mode); - p_salt := vc_aaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. - log("*** f_http_build_authorization_request_with_wrong_private_key: p_salt: ", p_salt); - if (PICS_PKI_AUTH_POP) { - if(f_build_pki_secured_request_message_signed_with_pop(p_private_key, valueof(m_signerIdentifier_self), vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), PX_EC_ALG_FOR_AT, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { - log("*** f_http_build_authorization_request_with_wrong_private_key: ERROR: Failed to generate Authorization Request ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - } else { // Only encryption of EtsiTs102941Data/InnerAtRequest - log("*** f_http_build_authorization_request_with_wrong_private_key: POP signature not applied"); - if(f_build_pki_secured_request_message_for_authorization(vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), PX_EC_ALG_FOR_AT, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { - log("*** f_http_build_authorization_request_with_wrong_private_key: ERROR: Failed to generate Authorization Request ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - } - log("*** f_http_build_authorization_request_with_wrong_private_key: DEBUG: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); - log("*** f_http_build_authorization_request_with_wrong_private_key: DEBUG: p_request_hash= ", p_request_hash); - } // End of function f_http_build_authorization_request_with_wrong_private_key - - function f_http_build_authorization_request_with_wrong_parameters( - in Certificate p_ec_certificate, // Enrolment credentials certificate - in octetstring p_ec_private_key, - in boolean p_alter_pop_signature := false, - in boolean p_alter_hmac := false, - in boolean p_alter_signer_digest := false, - in boolean p_alter_pks_recipient := false, - in boolean p_alter_enc_key := false, - in boolean p_alter_ea_id := false, - in template (omit) Time32 p_start := omit, - in template (omit) Duration p_duration := omit, - in template (omit) Time64 p_generation_time := omit, - out octetstring p_private_key, - out octetstring p_public_key_compressed, - out integer p_compressed_key_mode, - out octetstring p_private_enc_key, - out octetstring p_public_compressed_enc_key, - out integer p_compressed_enc_key_mode, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce, - out octetstring p_salt, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, - out Oct32 p_request_hash - ) runs on ItsPkiHttp { - // Local variables - var octetstring v_public_key_x; - var octetstring v_public_key_y; - var octetstring v_public_enc_key_x; - var octetstring v_public_enc_key_y; - var octetstring v_public_enc_key; - var integer v_compressed_enc_key_mode; - var InnerAtRequest v_inner_at_request; - var Ieee1609Dot2Data v_inner_at_request_data; - var InnerAtRequest v_authorization_request; - var bitstring v_authorization_request_msg; - var boolean v_ret_code; - - // Generate the InnerAtRequest - if (p_alter_ea_id == true) { - var HashedId8 v_ea_hashed_id8 := vc_eaHashedId8; - v_ea_hashed_id8[0] := 'bb'O; - v_ea_hashed_id8[1] := 'cc'O; - log("f_http_build_authorization_request_with_wrong_parameters: Altered eaId= ", v_ea_hashed_id8); - v_ret_code := f_generate_inner_at_request(vc_aaCertificate, -, vc_aaHashedId8, vc_eaCertificate, vc_eaWholeHash/*salt*/, v_ea_hashed_id8, p_ec_certificate, p_ec_private_key, p_private_key, p_public_key_compressed, p_compressed_key_mode, p_private_enc_key, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_inner_at_request); - } else { - v_ret_code := f_generate_inner_at_request_with_wrong_parameters(vc_aaCertificate, -, vc_aaHashedId8, vc_eaCertificate, vc_eaWholeHash/*salt*/, vc_eaHashedId8, p_ec_certificate, p_ec_private_key, p_alter_hmac, p_alter_signer_digest, p_start, p_duration, p_generation_time, p_private_key, p_public_key_compressed, p_compressed_key_mode, p_private_enc_key, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_inner_at_request); - } - if (v_ret_code == false) { - log("*** f_http_build_authorization_request_with_wrong_parameters: ERROR: Failed to generate AuthorizationRequest ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - return; - } - log("f_http_build_authorization_request_with_wrong_parameters: v_inner_at_request= ", v_inner_at_request); - - // Secure InnerAtRequest message - if (f_extract_enc_key(vc_aaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { - log("*** f_http_build_authorization_request_with_wrong_parameters: ERROR: Non canonical AA certificate ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log("*** f_http_build_authorization_request_with_wrong_parameters: Public encryption key: ", v_public_enc_key); - log("*** f_http_build_authorization_request_with_wrong_parameters: Public encryption key comp: ", v_compressed_enc_key_mode); - p_salt := vc_aaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. - log("*** f_http_build_authorization_request_with_wrong_parameters: p_salt: ", p_salt); - if (PICS_PKI_AUTH_POP) { - if(f_build_pki_secured_request_message_signed_with_pop(p_private_key, valueof(m_signerIdentifier_self), vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), PX_EC_ALG_FOR_AT, p_alter_pop_signature, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { - log("*** f_http_build_authorization_request_with_wrong_parameters: ERROR: Failed to generate Authorization Request ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - } else { // Only encryption of EtsiTs102941Data/InnerAtRequest - log("*** f_http_build_authorization_request_with_wrong_parameters: POP signature not applied"); - if(f_build_pki_secured_request_message_for_authorization(vc_aaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_request(v_inner_at_request))), PX_EC_ALG_FOR_AT, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { - log("*** f_http_build_authorization_request_with_wrong_parameters: ERROR: Failed to generate Authorization Request ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - } - log("*** f_http_build_authorization_request_with_wrong_parameters: DEBUG: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); - if (p_alter_enc_key == true) { - /*** - Alter encryption key to prevent decryption - ***/ - if (ischosen(p_ieee1609dot2_signed_and_encrypted_data.content.encryptedData.recipients[0].certRecipInfo.encKey.eciesNistP256)) { - p_ieee1609dot2_signed_and_encrypted_data.content.encryptedData.recipients[0].certRecipInfo.encKey.eciesNistP256.c[1] := 'aa'O; - p_ieee1609dot2_signed_and_encrypted_data.content.encryptedData.recipients[0].certRecipInfo.encKey.eciesNistP256.c[2] := 'bb'O; - } else { - p_ieee1609dot2_signed_and_encrypted_data.content.encryptedData.recipients[0].certRecipInfo.encKey.eciesBrainpoolP256r1.c[1] := 'aa'O; - p_ieee1609dot2_signed_and_encrypted_data.content.encryptedData.recipients[0].certRecipInfo.encKey.eciesBrainpoolP256r1.c[2] := 'bb'O; - } - log("*** f_http_build_authorization_request_with_wrong_parameters: DEBUG: Altered enc key= ", p_ieee1609dot2_signed_and_encrypted_data); - } - if (p_alter_pks_recipient == true) { - p_ieee1609dot2_signed_and_encrypted_data.content.encryptedData.recipients[0].pskRecipInfo := int2oct(314259265, 8); // NOT equal to the HashedId8 of the certificate CERT_AA - log("*** f_http_build_authorization_request_with_wrong_parameters: DEBUG: Altered pskRecipInfo= ", p_ieee1609dot2_signed_and_encrypted_data); - } - log("*** f_http_build_authorization_request_with_wrong_parameters: DEBUG: p_request_hash= ", p_request_hash); - } // End of function f_http_build_authorization_request_with_wrong_parameters - - function f_http_build_authorization_response( - in template (omit) InnerAtRequest p_inner_at_request := omit, - in AuthorizationResponseCode p_responseCode := ok, - in Oct16 p_request_hash, - in octetstring p_private_key := ''O, - in octetstring p_digest := ''O, - in Oct16 p_aes_sym_key, - out InnerAtResponse p_inner_at_response, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data - ) return boolean { - // Local variables - var bitstring v_msg_bit; - var octetstring v_msg; - var Oct12 v_nonce; - var Ieee1609Dot2Data v_ieee1609dot2_signed_data; - var EtsiTs103097Certificate v_at_certificate; - var boolean p_result := false; - - log(">>> f_http_build_authorization_response: p_inner_at_request= ", p_inner_at_request); - log(">>> f_http_build_authorization_response: p_responseCode= ", p_responseCode); - log(">>> f_http_build_authorization_response: p_request_hash= ", p_request_hash); - log(">>> f_http_build_authorization_response: p_private_key= ", p_private_key); - log(">>> f_http_build_authorization_response: p_digest= ", p_digest); - log(">>> f_http_build_authorization_response: p_aes_sym_key= ", p_aes_sym_key); - - // Check expectred response - if (p_responseCode != ok) { - p_inner_at_response := valueof( - m_innerAtResponse_ko( - p_request_hash, - p_responseCode - ) - ); - p_result := true; - } else { - // Generate the certificate - if (f_generate_at_certificate_for_inner_at_response(valueof(p_inner_at_request), p_private_key, p_digest, v_at_certificate) == false) { - log("f_http_build_authorization_response: Failed to generate the certificate"); - p_inner_at_response := valueof( - m_innerAtResponse_ko( - p_request_hash, - its_aa_incompleterequest - ) - ); - } else { - p_inner_at_response := valueof( - m_innerAtResponse_ok( - p_request_hash, - v_at_certificate - ) - ); - } - } - - // Secure the response - log("f_http_build_authorization_response: p_inner_at_response= ", p_inner_at_response); - v_msg := bit2oct(encvalue(m_etsiTs102941Data_inner_at_response(p_inner_at_response))); - v_nonce := substr(f_hashWithSha256(int2oct((f_getCurrentTimeUtc() * 1000), 16)), 0, 12); // Random value - // TODO Consider Sha384: m_signerIdentifier_digest(f_hashedId8FromSha384(p_digest)) - if (f_build_pki_secured_response_message(p_private_key, - valueof(m_signerIdentifier_digest(f_hashedId8FromSha256(p_digest))),// in SignerIdentifier p_signer_identifier, - v_msg, - p_aes_sym_key, - v_nonce, - p_ieee1609dot2_signed_and_encrypted_data - ) == false) { - log("f_http_build_authorization_response: Failed to generate the certificate"); - p_inner_at_response := valueof( - m_innerAtResponse_ko( - p_request_hash, - its_aa_deniedpermissions - ) - ); - } else { - p_result := true; - } - - log("<<< f_http_build_authorization_response: p_result= ", p_result); - log("<<< f_http_build_authorization_response: p_inner_at_response= ", p_inner_at_response); - return p_result; - } // End of function f_http_build_authorization_response - - function f_http_build_authorization_validation_request( - in InnerAtRequest p_inner_at_request, - in octetstring p_public_key_compressed, - in integer p_compressed_key_mode, - in octetstring p_private_enc_key, - in octetstring p_public_compressed_enc_key, - in integer p_compressed_enc_key_mode, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce, - out octetstring p_salt, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, - out Oct32 p_request_hash - ) runs on ItsPkiHttp { - // Local variables - var AuthorizationValidationRequest v_authorization_validation_request; - var bitstring v_authorization_validation_request_msg; - var octetstring v_public_enc_key; - var integer v_compressed_enc_key_mode; - - log(">>> f_http_build_authorization_validation_request"); - - // Copy the sharedAtRequest component from the InnerAtRequest received in the AuthorizationRequestMessage - v_authorization_validation_request.sharedAtRequest := p_inner_at_request.sharedAtRequest; - // Copy the ecSignature component from the InnerAtRequest received in the AuthorizationRequestMessage or AuthorizationRequestMessageWithPop - v_authorization_validation_request.ecSignature := p_inner_at_request.ecSignature; - // Secure the InnerAtRequest message - if (f_extract_enc_key(vc_eaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { - log("f_http_build_authorization_validation_request: Non canonical EA certificate"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log("f_http_build_authorization_validation_request: Public encryption key: ", v_public_enc_key); - log("f_http_build_authorization_validation_request: Public encryption key comp: ", v_compressed_enc_key_mode); - p_salt := vc_eaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. - log("f_http_build_authorization_validation_request: vc_aaHashedId8: ", vc_aaHashedId8); - log("f_http_build_authorization_validation_request: p_salt: ", p_salt); - if(f_build_pki_secured_request_message_signed_with_pop(vc_aaPrivateKey, valueof(m_signerIdentifier_digest(vc_aaHashedId8)), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_validation_request(v_authorization_validation_request))), PX_EC_ALG_FOR_ATV, -, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { - log("f_http_build_authorization_validation_request: Failed to generate Authorization Request"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log("f_http_build_authorization_validation_request: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); - log("f_http_build_authorization_validation_request: p_request_hash= ", p_request_hash); - } // End of function f_http_build_authorization_validation_request - - function f_http_build_invalid_authorization_validation_request( - in InnerAtRequest p_inner_at_request, - in octetstring p_public_key_compressed, - in integer p_compressed_key_mode, - in octetstring p_private_enc_key, - in octetstring p_public_compressed_enc_key, - in integer p_compressed_enc_key_mode, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce, - out octetstring p_salt, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, - out Oct32 p_request_hash - ) runs on ItsPkiHttp { - // Local variables - var AuthorizationValidationRequest v_authorization_validation_request; - var bitstring v_authorization_validation_request_msg; - var octetstring v_public_enc_key; - var integer v_compressed_enc_key_mode; - - log(">>> f_http_build_invalid_authorization_validation_request"); - - // Copy the sharedAtRequest component from the InnerAtRequest received in the AuthorizationRequestMessage - v_authorization_validation_request.sharedAtRequest := p_inner_at_request.sharedAtRequest; - // Copy the ecSignature component from the InnerAtRequest received in the AuthorizationRequestMessage or AuthorizationRequestMessageWithPop - v_authorization_validation_request.ecSignature := p_inner_at_request.ecSignature; - // Secure the InnerAtRequest message - if (f_extract_enc_key(vc_eaCertificate, v_public_enc_key, v_compressed_enc_key_mode) == false) { - log("f_http_build_invalid_authorization_validation_request: Non canonical EA certificate"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log("f_http_build_invalid_authorization_validation_request: Public encryption key: ", v_public_enc_key); - log("f_http_build_invalid_authorization_validation_request: Public encryption key comp: ", v_compressed_enc_key_mode); - p_salt := vc_eaWholeHash256; // IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3. - log("f_http_build_invalid_authorization_validation_request: vc_aaHashedId8: ", vc_aaHashedId8); - log("f_http_build_invalid_authorization_validation_request: p_salt: ", p_salt); - if(f_build_pki_secured_request_message_signed_with_pop(vc_aaPrivateKey, valueof(m_signerIdentifier_digest(vc_aaHashedId8)), vc_eaHashedId8/*recipientId*/, v_public_enc_key, v_compressed_enc_key_mode, p_salt, bit2oct(encvalue(m_etsiTs102941Data_authorization_validation_request(v_authorization_validation_request))), PX_EC_ALG_FOR_ATV, true, p_ieee1609dot2_signed_and_encrypted_data, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce, p_request_hash) == false) { - log("f_http_build_invalid_authorization_validation_request: Failed to generate Authorization Request"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - log("f_http_build_invalid_authorization_validation_request: p_ieee1609dot2_signed_and_encrypted_data= ", p_ieee1609dot2_signed_and_encrypted_data); - log("f_http_build_invalid_authorization_validation_request: p_request_hash= ", p_request_hash); - } // End of function f_http_build_invalid_authorization_validation_request - - function f_http_build_authorization_validation_response( - in SharedAtRequest p_shared_at_request, - in AuthorizationValidationResponseCode p_responseCode := ok, - in Oct16 p_request_hash, - in octetstring p_private_key := ''O, - in octetstring p_digest := ''O, - in Oct16 p_aes_sym_key, - out AuthorizationValidationResponse p_authorization_validation_response, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data - ) return boolean { - // Local variables - var bitstring v_msg_bit; - var octetstring v_msg; - var Oct12 v_nonce; - var Ieee1609Dot2Data v_ieee1609dot2_signed_data; - var EtsiTs103097Certificate v_at_certificate; - var boolean p_result := false; - - log(">>> f_http_build_authorization_validation_response: p_shared_at_request= ", p_shared_at_request); - log(">>> f_http_build_authorization_validation_response: p_responseCode= ", p_responseCode); - log(">>> f_http_build_authorization_validation_response: p_request_hash= ", p_request_hash); - log(">>> f_http_build_authorization_validation_response: p_private_key= ", p_private_key); - log(">>> f_http_build_authorization_validation_response: p_digest= ", p_digest); - log(">>> f_http_build_authorization_validation_response: p_aes_sym_key= ", p_aes_sym_key); - - // Check expectred response - if (p_responseCode != ok) { - p_authorization_validation_response := valueof( - m_authorizationValidationResponse_ko( - p_request_hash, - p_responseCode - ) - ); - p_result := true; - } else { - p_authorization_validation_response := valueof(m_authorizationValidationResponse_ok( - p_request_hash, - p_shared_at_request.requestedSubjectAttributes - ) - ); - } - - // Secure the response - log("f_http_build_authorization_validation_response: p_authorization_validation_response= ", p_authorization_validation_response); - v_msg := bit2oct(encvalue(p_authorization_validation_response)); - v_nonce := substr(f_hashWithSha256(int2oct((f_getCurrentTimeUtc() * 1000), 16)), 0, 12); // Random value - // TODO Consider Sha384: m_signerIdentifier_digest(f_hashedId8FromSha384(p_digest)) - if (f_build_pki_secured_response_message(p_private_key, - valueof(m_signerIdentifier_digest(f_hashedId8FromSha256(p_digest))),// in SignerIdentifier p_signer_identifier, - v_msg, - p_aes_sym_key, - v_nonce, - p_ieee1609dot2_signed_and_encrypted_data - ) == false) { - log("f_http_build_authorization_validation_response: Failed to generate the certificate"); - p_authorization_validation_response := valueof( - m_authorizationValidationResponse_ko( - p_request_hash, - deniedpermissions - ) - ); - } else { - p_result := true; - } - - log("<<< f_http_build_authorization_validation_response: p_result= ", p_result); - log("<<< f_http_build_authorization_validation_response: p_authorization_validation_response= ", p_authorization_validation_response); - return p_result; - } // End of function f_http_build_authorization_validation_response - - function f_http_build_dc_request( // TODO Cleanup parameters - in charstring p_ea_certificate_id, - in charstring p_aa_certificate_id, - in charstring p_rca_certificate_id, - out octetstring p_private_key, - out octetstring p_public_key_compressed, - out integer p_compressed_mode, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce, - out octetstring p_salt, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, - out Oct32 p_request_hash - ) runs on ItsPkiHttp { - } // End of function - } // End of group http - - group generate_certificates { - - function f_generate_ec_certificate( - out octetstring p_private_key, - out Certificate p_ec_certificate - ) return boolean { - var octetstring v_public_key_x; - var octetstring v_public_key_y; - var octetstring p_public_key_compressed; - var integer p_compressed_mode; - var EccP256CurvePoint v_ecc_p256_curve_point; - var SequenceOfPsidSsp v_appPermissions := { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs - valueof(m_appPermissions(36, { bitmapSsp := PX_INNER_EC_CERTFICATE_BITMAP_SSP_CAM })), - valueof(m_appPermissions(37, { bitmapSsp := PX_INNER_EC_CERTFICATE_BITMAP_SSP_DENM })) - }; - var template (value) EtsiTs103097Certificate v_cert; - var bitstring v_tbs; - var Oct32 v_sig; - var bitstring v_enc_msg; - var PublicVerificationKey v_public_verification_key; - - log(">>> f_generate_ec_certificate"); - log("f_generate_ec_certificate: PX_EC_ALG_FOR_EC=", PX_EC_ALG_FOR_EC); - log("f_generate_ec_certificate: PX_VE_ALG=", PX_VE_ALG); - - // Generate verification keys for the certificate - if (f_generate_key_pair(p_private_key, v_public_key_x, v_public_key_y, p_public_key_compressed, p_compressed_mode) == false) { - log("f_generate_ec_certificate: Failed to generate verification key"); - return false; - } - if (p_compressed_mode == 0) { - v_ecc_p256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(p_public_key_compressed)); - } else { - v_ecc_p256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(p_public_key_compressed)); - } - - if (PX_EC_ALG_FOR_EC == e_nist_p256) { - v_public_verification_key := valueof( - m_publicVerificationKey_ecdsaNistP256( - v_ecc_p256_curve_point - )); - } else if (PX_EC_ALG_FOR_EC == e_brainpool_p256_r1) { - v_public_verification_key := valueof( - m_publicVerificationKey_ecdsaBrainpoolP256r1( - v_ecc_p256_curve_point - )); - } else { - log("f_generate_ec_certificate: Wrong encryption algorithm, check PX_EC_ALG_FOR_xx"); - return false; - } - v_cert := m_etsiTs103097Certificate( - m_issuerIdentifier_sha256AndDigest(f_hashedId8FromSha256(f_hashWithSha256('616263'O))), - m_toBeSignedCertificate_at( - v_appPermissions, - m_verificationKeyIndicator_verificationKey( - v_public_verification_key - ), - m_validityPeriod( - f_getCurrentTime() / 1000, - m_duration_in_hours(PX_GENERATED_CERTIFICATE_DURATION) - ), - m_geographicRegion_identifiedRegion( - { - m_identifiedRegion_country_only(PX_GENERATED_CERTIFICATE_REGION_COUNTRY_2), - m_identifiedRegion_country_only(PX_GENERATED_CERTIFICATE_REGION_COUNTRY_2) - } - ), - PX_GENERATED_CERTIFICATE_SUBJECT_ASSURENCE_LEVEL - ) - ); - // Encode it ==> Get octetstring - v_tbs := encvalue(v_cert.toBeSigned); - // Sign the certificate - v_sig := f_signWithEcdsa(bit2oct(v_tbs), int2oct(11, 32), p_private_key); - if ((PX_VE_ALG == e_nist_p256) or (PX_VE_ALG == e_brainpool_p256_r1)) { - v_cert.signature_ := m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_sig, 0, 32) - ), - substr(v_sig, 32, 32) - ) - ); - } else if (PX_VE_ALG == e_brainpool_p384_r1) { - v_cert.signature_ := m_signature_ecdsaBrainpoolP384r1( - m_ecdsaP384Signature( - m_eccP384CurvePoint_x_only( - substr(v_sig, 0, 48) - ), - substr(v_sig, 48, 48) - ) - ); - } - log("f_generate_ec_certificate: v_cert= ", v_cert); - - p_ec_certificate := valueof(v_cert); - return true; - } // End of function f_generate_ec_certificate - - function f_generate_ec_certificate_for_inner_ec_response( - in InnerEcRequest p_inner_ec_request, - in octetstring p_private_key, - in octetstring p_digest, - out EtsiTs103097Certificate p_ec_certificate - ) return boolean { - var CertificateId v_certificate_id; - var EtsiTs103097Certificate v_cert; - var IssuerIdentifier v_issuer; - var bitstring v_tbs; - var octetstring v_sig; - - log(">>> f_generate_ec_certificate_for_inner_ec_response: p_inner_ec_request: ", p_inner_ec_request); - log(">>> f_generate_ec_certificate_for_inner_ec_response: p_digest: ", p_digest); - - v_issuer := valueof(m_issuerIdentifier_sha256AndDigest(f_hashedId8FromSha256(p_digest))); // TODO Check sha256/384 f_hashedId8FromSha384 - if (not(ispresent(p_inner_ec_request.requestedSubjectAttributes.id))) { - v_certificate_id := { none_ := NULL }; - } else { - v_certificate_id := p_inner_ec_request.requestedSubjectAttributes.id; - } - v_cert := valueof( - m_etsiTs103097Certificate( - v_issuer, - m_toBeSignedCertificate_ec( - v_certificate_id, - p_inner_ec_request.requestedSubjectAttributes.appPermissions, - m_verificationKeyIndicator_verificationKey( - p_inner_ec_request.publicKeys.verificationKey - ), - p_inner_ec_request.requestedSubjectAttributes.validityPeriod, - p_inner_ec_request.requestedSubjectAttributes.region, - p_inner_ec_request.requestedSubjectAttributes.assuranceLevel, - p_inner_ec_request.publicKeys.encryptionKey - ) - ) - ); - // Encode it ==> Get octetstring - v_tbs := encvalue(v_cert.toBeSigned); - // Sign the certificate - v_sig := f_signWithEcdsa(bit2oct(v_tbs), p_digest, p_private_key); - if (PX_VE_ALG == e_nist_p256) { - v_cert.signature_ := valueof( - m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_sig, 0, 32) - ), - substr(v_sig, 32, 32) - ) - ) - ); - } else if (PX_VE_ALG == e_brainpool_p256_r1) { - v_cert.signature_ := valueof( - m_signature_ecdsaBrainpoolP256r1( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_sig, 0, 32) - ), - substr(v_sig, 32, 32) - ) - ) - ); - } else if (PX_VE_ALG == e_brainpool_p384_r1) { - v_cert.signature_ := valueof( - m_signature_ecdsaBrainpoolP384r1( - m_ecdsaP384Signature( - m_eccP384CurvePoint_x_only( - substr(v_sig, 0, 48) - ), - substr(v_sig, 48, 48) - ) - ) - ); - } - p_ec_certificate := valueof(v_cert); - log("f_generate_ec_certificate_for_inner_ec_response: p_ec_certificate= ", p_ec_certificate); - - return true; - } // End of function f_generate_ec_certificate_for_inner_ec_response - - function f_generate_at_certificate_for_inner_at_response( - in InnerAtRequest p_inner_at_request, - in octetstring p_private_key, - in octetstring p_digest, - out EtsiTs103097Certificate p_at_certificate - ) return boolean { - var EtsiTs103097Certificate v_cert; - var IssuerIdentifier v_issuer; - var bitstring v_tbs; - var octetstring v_sig; - - v_issuer := valueof(m_issuerIdentifier_sha256AndDigest(f_hashedId8FromSha256(p_digest))); // TODO Check sha256/384 f_hashedId8FromSha384 - v_cert := valueof( - m_etsiTs103097Certificate( - v_issuer, - m_toBeSignedCertificate_at( - p_inner_at_request.sharedAtRequest.requestedSubjectAttributes.appPermissions, - m_verificationKeyIndicator_verificationKey( - p_inner_at_request.publicKeys.verificationKey - ), - p_inner_at_request.sharedAtRequest.requestedSubjectAttributes.validityPeriod, - p_inner_at_request.sharedAtRequest.requestedSubjectAttributes.region, - p_inner_at_request.sharedAtRequest.requestedSubjectAttributes.assuranceLevel, - p_inner_at_request.publicKeys.encryptionKey - ) - ) - ); - // Encode it ==> Get octetstring - v_tbs := encvalue(v_cert.toBeSigned); - // Sign the certificate - v_sig := f_signWithEcdsa(bit2oct(v_tbs), p_digest, p_private_key); - log("f_generate_at_certificate_for_inner_at_response: PX_VE_ALG=", PX_VE_ALG); - if (PX_VE_ALG == e_nist_p256) { - v_cert.signature_ := valueof( - m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_sig, 0, 32) - ), - substr(v_sig, 32, 32) - ) - ) - ); - } else if (PX_VE_ALG == e_brainpool_p256_r1) { - v_cert.signature_ := valueof( - m_signature_ecdsaBrainpoolP256r1( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_sig, 0, 32) - ), - substr(v_sig, 32, 32) - ) - ) - ); - } else if (PX_VE_ALG == e_brainpool_p384_r1) { - v_cert.signature_ := valueof( - m_signature_ecdsaBrainpoolP384r1( - m_ecdsaP384Signature( - m_eccP384CurvePoint_x_only( - substr(v_sig, 0, 48) - ), - substr(v_sig, 48, 48) - ) - ) - ); - } - p_at_certificate := valueof(v_cert); - log("f_generate_at_certificate_for_inner_at_response: p_ec_certificate= ", p_at_certificate); - - return true; - } // End of function f_generate_at_certificate_for_inner_at_response - - function f_generate_at_certificate_for_authorization_response( - in InnerAtRequest p_inner_at_request, - in octetstring p_private_key, - in octetstring p_digest, - out EtsiTs103097Certificate p_at_certificate - ) return boolean { - var EtsiTs103097Certificate v_cert; - var IssuerIdentifier v_issuer; - var bitstring v_tbs; - var octetstring v_sig; - - log(">>> f_generate_at_certificate_for_authorization_response"); - - v_issuer := valueof(m_issuerIdentifier_sha256AndDigest(f_hashedId8FromSha256(p_digest))); // TODO Check sha256/384 f_hashedId8FromSha384 - v_cert := valueof( - m_etsiTs103097Certificate( - v_issuer, - m_toBeSignedCertificate_ec( - p_inner_at_request.sharedAtRequest.requestedSubjectAttributes.id, - p_inner_at_request.sharedAtRequest.requestedSubjectAttributes.appPermissions, - m_verificationKeyIndicator_verificationKey( - p_inner_at_request.publicKeys.verificationKey - ), - p_inner_at_request.sharedAtRequest.requestedSubjectAttributes.validityPeriod, - p_inner_at_request.sharedAtRequest.requestedSubjectAttributes.region, - p_inner_at_request.sharedAtRequest.requestedSubjectAttributes.assuranceLevel, - p_inner_at_request.publicKeys.encryptionKey - ) - ) - ); - // Encode it ==> Get octetstring - v_tbs := encvalue(v_cert.toBeSigned); - // Sign the certificate - v_sig := f_signWithEcdsa(bit2oct(v_tbs), p_digest, p_private_key); - if (PX_VE_ALG == e_nist_p256) { - v_cert.signature_ := valueof( - m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_sig, 0, 32) - ), - substr(v_sig, 32, 32) - ) - ) - ); - } else if (PX_VE_ALG == e_brainpool_p256_r1) { - v_cert.signature_ := valueof( - m_signature_ecdsaBrainpoolP256r1( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_sig, 0, 32) - ), - substr(v_sig, 32, 32) - ) - ) - ); - } else if (PX_VE_ALG == e_brainpool_p384_r1) { - v_cert.signature_ := valueof( - m_signature_ecdsaBrainpoolP384r1( - m_ecdsaP384Signature( - m_eccP384CurvePoint_x_only( - substr(v_sig, 0, 48) - ), - substr(v_sig, 48, 48) - ) - ) - ); - } - p_at_certificate := valueof(v_cert); - log("f_generate_at_certificate_for_authorization_response: p_at_certificate= ", p_at_certificate); - - return true; - } // End of function f_generate_at_certificate_for_authorization_response - - } // End of group generate_certificates - - group inner_ec_xxx { - - function f_generate_inner_ec_request( - out octetstring p_private_key, - out octetstring p_public_key_compressed, - out integer p_compressed_mode, - out InnerEcRequest p_inner_ec_request - ) return boolean { - // Local variables - var Oct32 v_public_key_x; - var Oct32 v_public_key_y; - var PublicVerificationKey v_public_verification_key; - - log (">>> f_generate_inner_ec_request"); - log("f_generate_inner_ec_request: PX_VE_ALG=", PX_VE_ALG); - - // Generate keys for the certificate to be requested - if (f_generate_key_pair(p_private_key, v_public_key_x, v_public_key_y, p_public_key_compressed, p_compressed_mode) == false) { - log ("f_generate_inner_ec_request: failed to generate keys"); - return false; - } - // Build the Proof of Possession InnerEcRequest - if (PX_VE_ALG == e_nist_p256) { - var EccP256CurvePoint v_eccP256_curve_point; - if (p_compressed_mode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(p_public_key_compressed)); - } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(p_public_key_compressed)); - } - v_public_verification_key := valueof(m_publicVerificationKey_ecdsaNistP256(v_eccP256_curve_point)); - } else if (PX_VE_ALG == e_brainpool_p256_r1) { - var EccP256CurvePoint v_eccP256_curve_point; - if (p_compressed_mode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(p_public_key_compressed)); - } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(p_public_key_compressed)); - } - v_public_verification_key := valueof(m_publicVerificationKey_ecdsaBrainpoolP256r1(v_eccP256_curve_point)); - } else { - var EccP384CurvePoint v_eccP384_curve_point; - if (p_compressed_mode == 0) { - v_eccP384_curve_point := valueof(m_eccP384CurvePoint_compressed_y_0(p_public_key_compressed)); - } else { - v_eccP384_curve_point := valueof(m_eccP384CurvePoint_compressed_y_1(p_public_key_compressed)); - } - v_public_verification_key := valueof(m_publicVerificationKey_ecdsaBrainpoolP384r1(v_eccP384_curve_point)); - } - if (PICS_EC_SUBJECT_ATTRIBUT_ID) { - p_inner_ec_request := valueof( - m_innerEcRequest( - PICS_ITS_S_CANONICAL_ID, - m_publicKeys( - v_public_verification_key - ), - m_certificateSubjectAttributes_id_name( - oct2char(PICS_ITS_S_CANONICAL_ID) & int2str(f_getCurrentTime()), // ETSI TS 103 097 Clause 7.2.2 Enrolment credential - { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs - valueof(m_appPermissions(c_its_aid_SCR, { bitmapSsp := PX_INNER_EC_CERTFICATE_BITMAP_SSP_SCR })) - }, - m_validityPeriod( - f_getCurrentTime() / 1000, - m_duration_in_hours(PX_GENERATED_CERTIFICATE_DURATION) - ), - m_geographicRegion_identifiedRegion( - { - m_identifiedRegion_country_only(PX_GENERATED_CERTIFICATE_REGION_COUNTRY_1), - m_identifiedRegion_country_only(PX_GENERATED_CERTIFICATE_REGION_COUNTRY_2) - } - ), - PX_GENERATED_CERTIFICATE_SUBJECT_ASSURENCE_LEVEL - ) - ) - ); - } else { - p_inner_ec_request := valueof( - m_innerEcRequest( - PICS_ITS_S_CANONICAL_ID, - m_publicKeys( - v_public_verification_key - ), - m_certificateSubjectAttributes_id_omit( // ETSI TS 103 097 Clause 7.2.2 Enrolment credential - { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs - valueof(m_appPermissions(c_its_aid_SCR, { bitmapSsp := PX_INNER_EC_CERTFICATE_BITMAP_SSP_SCR })) - }, - m_validityPeriod( - f_getCurrentTime() / 1000, - m_duration_in_hours(PX_GENERATED_CERTIFICATE_DURATION) - ), - m_geographicRegion_identifiedRegion( - { - m_identifiedRegion_country_only(PX_GENERATED_CERTIFICATE_REGION_COUNTRY_1), - m_identifiedRegion_country_only(PX_GENERATED_CERTIFICATE_REGION_COUNTRY_2) - } - ), - PX_GENERATED_CERTIFICATE_SUBJECT_ASSURENCE_LEVEL - ) - ) - ); - } - if (PICS_SECPKI_REENROLMENT) { // This is a re-enrolment, the identifier of its current valid Enrolment Credential - log("f_generate_inner_ec_request: This is a re-enrolment"); - p_inner_ec_request.itsId := PX_EC_HASHED_ID8; - } - log("<<< f_generate_inner_ec_request: ", p_inner_ec_request); - - return true; - } // End of function f_generate_inner_ec_request - - function f_generate_inner_ec_request_with_wrong_parameters( - in SequenceOfPsidSsp p_appPermissions, - in octetstring p_canonical_id := PICS_ITS_S_CANONICAL_ID, - in Time32 p_start, - in Duration p_duration, - in boolean p_alter_private_key := false, - out octetstring p_private_key, - out octetstring p_public_key_compressed, - out integer p_compressed_mode, - out InnerEcRequest p_inner_ec_request - ) return boolean { - // Local variables - var Oct32 v_public_key_x; - var Oct32 v_public_key_y; - var octetstring v_private_key; - var octetstring v_public_key_compressed; - var integer v_compressed_mode; - var PublicVerificationKey v_public_verification_key; - - log (">>> f_generate_inner_ec_request_with_wrong_parameters"); - // Generate keys for the certificate to be requested - if (f_generate_key_pair(p_private_key, v_public_key_x, v_public_key_y, p_public_key_compressed, p_compressed_mode) == false) { - log ("f_generate_inner_ec_request_with_wrong_parameters: failed to generate keys"); - return false; - } - if (p_alter_private_key == false) { - v_private_key := p_private_key; - v_public_key_compressed := p_public_key_compressed; - v_compressed_mode := p_compressed_mode; - } else { - log ("f_generate_inner_ec_request_with_wrong_parameters: Alter verify private key"); - if (f_generate_key_pair(v_private_key, v_public_key_x, v_public_key_y, v_public_key_compressed, v_compressed_mode) == false) { - log ("f_generate_inner_ec_request_with_wrong_parameters: failed to generate keys"); - return false; - } - } - // Build the Proof of Possession InnerEcRequest - log("f_generate_inner_ec_request_with_wrong_parameters: PX_VE_ALG=", PX_VE_ALG); - if (PX_VE_ALG == e_nist_p256) { - var EccP256CurvePoint v_eccP256_curve_point; - if (v_compressed_mode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_key_compressed)); - } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_key_compressed)); - } - v_public_verification_key := valueof(m_publicVerificationKey_ecdsaNistP256(v_eccP256_curve_point)); - } else if (PX_VE_ALG == e_brainpool_p256_r1) { - var EccP256CurvePoint v_eccP256_curve_point; - if (v_compressed_mode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_key_compressed)); - } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_key_compressed)); - } - v_public_verification_key := valueof(m_publicVerificationKey_ecdsaBrainpoolP256r1(v_eccP256_curve_point)); - } else { - var EccP384CurvePoint v_eccP384_curve_point; - if (v_compressed_mode == 0) { - v_eccP384_curve_point := valueof(m_eccP384CurvePoint_compressed_y_0(v_public_key_compressed)); - } else { - v_eccP384_curve_point := valueof(m_eccP384CurvePoint_compressed_y_1(v_public_key_compressed)); - } - v_public_verification_key := valueof(m_publicVerificationKey_ecdsaBrainpoolP384r1(v_eccP384_curve_point)); - } - p_inner_ec_request := valueof( - m_innerEcRequest( - p_canonical_id, - m_publicKeys( - v_public_verification_key - ), - m_certificateSubjectAttributes_id_name( - oct2char(PICS_ITS_S_CANONICAL_ID), - p_appPermissions, // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs - m_validityPeriod( - p_start, - p_duration - ), - m_geographicRegion_identifiedRegion( - { - m_identifiedRegion_country_only(PX_GENERATED_CERTIFICATE_REGION_COUNTRY_1), - m_identifiedRegion_country_only(PX_GENERATED_CERTIFICATE_REGION_COUNTRY_2) - } - ), - PX_GENERATED_CERTIFICATE_SUBJECT_ASSURENCE_LEVEL - ) - ) - ); - if (PICS_SECPKI_REENROLMENT) { // This is a re-enrolment, the identifier of its current valid Enrolment Credential - log("f_generate_inner_ec_request_with_wrong_parameters: This is a re-enrolment"); - p_inner_ec_request.itsId := PX_EC_HASHED_ID8; - } - log("f_generate_inner_ec_request_with_wrong_parameters: ", p_inner_ec_request); - - return true; - } // End of function f_generate_inner_ec_request_with_wrong_parameters - - function f_generate_inner_ec_request_signed_for_pop( - in octetstring p_private_key, - in InnerEcRequest p_inner_ec_request, - out Ieee1609Dot2Data p_inner_ec_request_signed_for_pop - ) return boolean { - // Local variables - var template (value) EccP256CurvePoint v_eccP256_curve_point; - var octetstring v_encoded_inner_ec_request; - var template (value) ToBeSignedData v_tbs; - var octetstring v_tbs_signed; - var Signature v_signature; - - // Encode it - log("f_generate_inner_ec_request_signed_for_pop: encode ", p_inner_ec_request); - v_encoded_inner_ec_request := bit2oct(encvalue(p_inner_ec_request)); - // Signed the encoded InnerEcRequestSignedForPop - v_tbs := m_toBeSignedData( - m_signedDataPayload( - m_etsiTs103097Data_unsecured( - v_encoded_inner_ec_request - ) - ), - m_headerInfo_inner_pki_request( - -, - (f_getCurrentTime() * 1000) //us - ) - ); - // Signed the encoded InnerEcRequestSignedForPop - log("f_generate_inner_ec_request_signed_for_pop: tbs= ", v_tbs); - log("f_generate_inner_ec_request_signed_for_pop: tbs= ", bit2oct(encvalue(v_tbs))); - v_tbs_signed := f_signWithEcdsa(bit2oct(encvalue(v_tbs)), int2oct(0, 32), p_private_key); - // Finalyse signed InnerEcRequestSignedForPop - if (PX_VE_ALG == e_nist_p256) { - v_signature := valueof( - m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_tbs_signed, 0, 32) - ), - substr(v_tbs_signed, 32, 32) - ) - ) - ); - } else if (PX_VE_ALG == e_brainpool_p256_r1) { - v_signature := valueof( - m_signature_ecdsaBrainpoolP256r1( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_tbs_signed, 0, 32) - ), - substr(v_tbs_signed, 32, 32) - ) - ) - ); - } else if (PX_VE_ALG == e_brainpool_p384_r1) { - v_signature := valueof( - m_signature_ecdsaBrainpoolP384r1( - m_ecdsaP384Signature( - m_eccP384CurvePoint_x_only( - substr(v_tbs_signed, 0, 48) - ), - substr(v_tbs_signed, 48, 48) - ) - ) - ); - } - log("f_generate_inner_ec_request_signed_for_pop: v_signature= ", v_signature); - p_inner_ec_request_signed_for_pop := valueof( - m_etsiTs103097Data_signed( - m_signedData( - sha256, - v_tbs, - m_signerIdentifier_self, - v_signature - ) - ) - ); - - log("<<< f_generate_inner_ec_request_signed_for_pop: p_inner_ec_request_signed_for_pop= ", p_inner_ec_request_signed_for_pop); - return true; - } // End of function f_generate_inner_ec_request_signed_for_pop - - function f_verify_inner_ec_request_signed_for_pop( - in EtsiTs102941Data p_etsi_ts_102941_data, - out InnerEcRequest p_inner_ec_request - ) return boolean { - var bitstring v_msg_bit; - - log(">>> f_verify_inner_ec_request_signed_for_pop: ", p_etsi_ts_102941_data); - - // 1. Decode content - v_msg_bit := oct2bit(p_etsi_ts_102941_data.content.enrolmentRequest.content.signedData.tbsData.payload.data.content.unsecuredData); - if (decvalue(v_msg_bit, p_inner_ec_request) != 0) { - log("f_verify_inner_ec_request_signed_for_pop: Failed to decode InnerEcRequest"); - return false; - } else { - log("f_verify_inner_ec_request_signed_for_pop: v_inner_ec_request= ", p_inner_ec_request); - - // 2. Verify the InnerEcRequestSignedForPop signature - // TODO - } - - return true; - } // End of function f_verify_inner_ec_request_signed_for_pop - - function f_generate_inner_ec_response( - in octetstring p_inner_ec_request_hash, - in EtsiTs103097Certificate p_certificate, - out InnerEcResponse p_inner_ec_response - ) return boolean { - // Local variables - - // Build the Proof of Possession InnerEcResponse - p_inner_ec_response := valueof( - m_innerEcResponse_ok( - substr(p_inner_ec_request_hash, 0, 16), - p_certificate - ) - ); - - return true; - } // End of function f_generate_inner_ec_response - - } // End of group inner_ec_xxx - - group inner_at_xxx { - - function f_generate_inner_at_request( - in Certificate p_aa_certificate, - in SecurityAlg p_enc_algo := PX_EC_ALG_FOR_EC_SIGN, - in Oct8 p_aa_hashed_id8, - in Certificate p_ea_certificate, - in octetstring p_salt, - in Oct8 p_ea_hashed_id8, - in Certificate p_ec_certificate, - in octetstring p_ec_private_key, - out octetstring p_private_key, - out octetstring p_public_key_compressed, - out integer p_compressed_key_mode, - out octetstring p_private_enc_key, - out octetstring p_public_compressed_enc_key, - out integer p_compressed_enc_key_mode, - out InnerAtRequest p_inner_at_request - ) return boolean { - // Local variables - var octetstring v_public_key_x; - var octetstring v_public_key_y; - var octetstring v_public_enc_key_x; - var octetstring v_public_enc_key_y; - var bitstring v_enc_value; - var octetstring v_ec_hash; - var PublicVerificationKey v_public_verification_key; - var BasePublicEncryptionKey v_public_encryption_key; - var Oct8 v_ec_hashed_id8; - var octetstring public_enc_key_x; - var octetstring public_enc_key_y; - var Oct32 v_hmac_key; - var PublicVerificationKey v_verification_tag; - var PublicEncryptionKey v_encryption_tag; - var octetstring v_encoded_tag; - var Oct16 v_key_tag; - var octetstring v_hash_shared_at_request; - var template (value) ToBeSignedData v_tbs; - var octetstring v_tbs_signed; - var Ieee1609Dot2Data v_signed_at_signature; - var template (value) EccP256CurvePoint v_eccP256_curve_point; - var HashAlgorithm v_hashId; - var Signature v_signature; - var SequenceOfPsidSsp v_appPermissions := { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs - valueof(m_appPermissions(c_its_aid_CAM, { bitmapSsp := PX_INNER_AT_CERTFICATE_BITMAP_SSP_CAM })), - valueof(m_appPermissions(c_its_aid_DENM, { bitmapSsp := PX_INNER_AT_CERTFICATE_BITMAP_SSP_DENM })) - }; - - log(">>> f_generate_inner_at_request: p_enc_algo=", p_enc_algo); - - // Generate verification keys for the certificate to be requested - if (f_generate_key_pair(p_private_key, v_public_key_x, v_public_key_y, p_public_key_compressed, p_compressed_key_mode) == false) { - log("f_generate_inner_at_request: Failed to generate verification key"); - return false; - } - log ("f_generate_inner_at_request: AT verification private key: ", p_private_key); - log ("f_generate_inner_at_request: AT verification public compressed key: ", p_public_key_compressed); - log ("f_generate_inner_at_request: AT verification public compressed mode: ", p_compressed_key_mode); - // Generate encryption keys for the certificate to be requested - if (PX_INCLUDE_ENCRYPTION_KEYS) { - if (f_generate_key_pair_for_encryption(p_enc_algo, p_private_enc_key, v_public_enc_key_x, v_public_enc_key_y, p_public_compressed_enc_key, p_compressed_enc_key_mode) == false) { - log("f_generate_inner_at_request: Failed to generate encryption key"); - return false; - } else { - log ("f_generate_inner_at_request: AT encryption private key: ", p_private_enc_key); - log ("f_generate_inner_at_request: AT encryption public compressed key: ", p_public_compressed_enc_key); - log ("f_generate_inner_at_request: AT encryption public compressed mode: ", p_compressed_enc_key_mode); - } - } else { - p_private_enc_key := ''O; - v_public_enc_key_x := ''O; - v_public_enc_key_y := ''O; - p_public_compressed_enc_key := ''O; - p_compressed_enc_key_mode := -1; - } - - // Generate 32 octets length secret key - v_hmac_key := f_hashWithSha256(int2oct((f_getCurrentTimeUtc() * 1000), 12)); - log("f_generate_inner_at_request: v_hmac_key= ", v_hmac_key); - - // Generate tag based on the concatenation of verification keys & encryption keys - if (f_generate_key_tag(p_public_key_compressed, p_compressed_key_mode, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_encoded_tag) == false) { - log("f_generate_inner_at_request: Failed to generate Key tag"); - return false; - } - log("f_generate_inner_at_request: v_encoded_tag= ", v_encoded_tag); - v_key_tag := substr( - fx_hmac_sha256( // TODO Rename and use a wrapper function - v_hmac_key, - v_encoded_tag - ), - 0, - 16); // Leftmost 128 bits of the HMAC-SHA256 tag computed previously - log("f_generate_inner_at_request: v_key_tag= ", v_key_tag); - - // Build the SharedAtRequest - p_inner_at_request.sharedAtRequest := valueof( - m_shared_at_request( - p_ea_hashed_id8, // eaId identifies the EA certificate shared with EA entity - v_key_tag, // Calculated keyTag - valueof( - m_certificate_subject_attributes( // FIXME Review subjectPermissions - v_appPermissions, - p_ec_certificate.toBeSigned.certRequestPermissions, - -,//{ none_ := NULL },//p_ec_certificate.toBeSigned.id, - p_ec_certificate.toBeSigned.validityPeriod, - p_ec_certificate.toBeSigned.region, - p_ec_certificate.toBeSigned.assuranceLevel - ))) // Desired attributes - ); - - // Calculate the hash of the SharedAtRequest - v_hash_shared_at_request := f_hashWithSha256(bit2oct(encvalue(p_inner_at_request.sharedAtRequest))); - log("f_generate_inner_at_request: v_hash_shared_at_request= ", v_hash_shared_at_request); - - // Build the ETsiTs103097Data-SignedExternalPayload - v_tbs := m_toBeSignedData( - m_signedDataPayload_ext(v_hash_shared_at_request), // Payload containing extDataHash - m_headerInfo_inner_pki_request( // HeaderInfo - -, - (f_getCurrentTime()) * 1000) //us - ); - log("f_generate_inner_at_request: v_tbs= ", v_tbs); - - // Calculate the whole certificate SHA - v_enc_value := encvalue(p_ec_certificate); - if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1)) { - v_ec_hash := f_hashWithSha384(bit2oct(v_enc_value)); - v_ec_hashed_id8 := f_hashedId8FromSha384(v_ec_hash); - } else { - v_ec_hash := f_hashWithSha256(bit2oct(v_enc_value)); - v_ec_hashed_id8 := f_hashedId8FromSha256(v_ec_hash); - } - log("f_generate_inner_at_request: v_ec_hash= ", v_ec_hash); - - // Signed ToBeSigned payload using the private key of EC certificate obtained from Enrolment request - // In case of ITS-S privacy, v_signed_at_signature contained the data to be encrypted - if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1)) { - v_hashId := sha384; - v_tbs_signed := f_signWithEcdsaBrainpoolp384r1WithSha384(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); - v_signature := valueof( - m_signature_ecdsaBrainpoolP384r1( - m_ecdsaP384Signature( - m_eccP384CurvePoint_x_only( - substr(v_tbs_signed, 0, 48) - ), - substr(v_tbs_signed, 48, 48) - ) - ) - ); - } else { - v_hashId := sha256; - if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1)) { - v_tbs_signed := f_signWithEcdsaBrainpoolp256r1WithSha256(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); - v_signature := valueof( - m_signature_ecdsaBrainpoolP256r1( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_tbs_signed, 0, 32) - ), - substr(v_tbs_signed, 32, 32) - ) - ) - ); - } else if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256)) { - v_tbs_signed := f_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); - v_signature := valueof( - m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_tbs_signed, 0, 32) - ), - substr(v_tbs_signed, 32, 32) - ) - ) - ); - } else { - // Error - log("f_generate_inner_at_request: Failed to process signature"); - return false; - } - } - v_signed_at_signature := valueof( - m_etsiTs103097Data_signed( - m_signedData( - v_hashId, - v_tbs, - m_signerIdentifier_digest(v_ec_hashed_id8), // Signer is the hasheId8 of the EC certificate obtained from Enrolment request - v_signature - ) - ) - ); - log("f_generate_inner_at_request: v_signed_at_signature= ", v_signed_at_signature); - log("f_generate_inner_at_request: p_ea_certificate= ", p_ea_certificate); - - if (PICS_ITS_S_WITH_PRIVACY) { // Build EtsiTs102097Data-Encrypted structure - var octetstring v_public_enc_key; - var integer v_compressed_mode; - var Oct12 v_nonce; - var Oct16 v_authentication_vector; - var Oct16 v_aes_sym_key; - var Oct16 v_encrypted_sym_key; - var HashedId8 v_recipientId; - var octetstring v_public_compressed_ephemeral_key; - var integer v_public_compressed_ephemeral_mode; - var octetstring v_enc_signed_ec_signature; - var EncryptedDataEncryptionKey v_encrypted_data_encryption_key; - - // Use EA certificate for the encryption - if (p_enc_algo == e_nist_p256) { - if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0)) { - v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0; - v_compressed_mode := 0; - } else if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_1)) { - v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_1; - v_compressed_mode := 1; - } else { - log("f_generate_inner_at_request: Wrong NistP256 encryption variant"); - return false; - } - v_enc_signed_ec_signature := f_encryptWithEciesNistp256WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce); - if (v_public_compressed_ephemeral_mode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); - } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_compressed_ephemeral_key)); - } - v_encrypted_data_encryption_key := valueof( - m_encryptedDataEncryptionKey_eciesNistP256( - m_evciesP256EncryptedKey( - v_eccP256_curve_point, - v_encrypted_sym_key, - v_authentication_vector - ))); - } else if (p_enc_algo == e_brainpool_p256_r1) { - if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0)) { - v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0; - v_compressed_mode := 0; - } else if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_1)) { - v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_1; - v_compressed_mode := 1; - } else { - log("f_generate_inner_at_request: Wrong BrainpoolP256r1 encryption variant"); - return false; - } - v_enc_signed_ec_signature := f_encryptWithEciesBrainpoolp256r1WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce); - if (v_public_compressed_ephemeral_mode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); - } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_compressed_ephemeral_key)); - } - v_encrypted_data_encryption_key := valueof( - m_encryptedDataEncryptionKey_eciesBrainpoolP256r1( - m_evciesP256EncryptedKey( - v_eccP256_curve_point, - v_encrypted_sym_key, - v_authentication_vector - ))); - } else { - log("f_generate_inner_at_request: Wrong encryption variant"); - return false; - } - log("f_generate_inner_at_request: v_encrypted_data_encryption_key= ", v_encrypted_data_encryption_key); - v_recipientId := p_ea_hashed_id8; // RecipientId is the HashedId8 of the EA certificate - log("f_generate_inner_at_request: v_recipientId= ", v_recipientId); - // Fill Certificate template with the public compressed keys (canonical form) - p_inner_at_request.ecSignature := valueof( - m_ec_signature( - m_etsiTs103097Data_encrypted( - m_encryptedData( - { - m_recipientInfo_certRecipInfo( - m_pKRecipientInfo( - v_recipientId, - - v_encrypted_data_encryption_key )) - }, - m_SymmetricCiphertext_aes128ccm( - m_aesCcmCiphertext( - v_nonce, - v_enc_signed_ec_signature - ) - ) - ) - ) - ) - ); - } else { // Skip the encryption, alowed to be re-identified by the AA - p_inner_at_request.ecSignature := valueof(m_ec_signature_ext_payload(v_signed_at_signature)); - } - // Build the InnerAtRequest, EcSignature field is already set - if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256)) { - if (p_compressed_key_mode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_key_x)); - } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_key_x)); - } - v_public_verification_key := valueof(m_publicVerificationKey_ecdsaNistP256(v_eccP256_curve_point)); - } else if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1)) { - if (p_compressed_key_mode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_key_x)); - } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_key_x)); - } - v_public_verification_key := valueof(m_publicVerificationKey_ecdsaBrainpoolP256r1(v_eccP256_curve_point)); - } else { - var EccP384CurvePoint v_eccP384_curve_point; - if (p_compressed_key_mode == 0) { - v_eccP384_curve_point := valueof(m_eccP384CurvePoint_compressed_y_0(v_public_key_x)); - } else { - v_eccP384_curve_point := valueof(m_eccP384CurvePoint_compressed_y_1(v_public_key_x)); - } - v_public_verification_key := valueof(m_publicVerificationKey_ecdsaBrainpoolP384r1(v_eccP384_curve_point)); - } - if (PX_INCLUDE_ENCRYPTION_KEYS) { - var template (value) EccP256CurvePoint v_enc_eccP256_curve_point; - - if (p_compressed_enc_key_mode == 0) { - v_enc_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_0(v_public_enc_key_x); - } else { - v_enc_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_1(v_public_enc_key_x); - } - if (p_enc_algo == e_nist_p256) { - v_public_encryption_key := valueof(m_publicEncryptionKey_eciesNistP256(v_enc_eccP256_curve_point)); - } else { - v_public_encryption_key := valueof(m_publicEncryptionKey_eciesBrainpoolP256r1(v_enc_eccP256_curve_point)); - } - p_inner_at_request.publicKeys := valueof( // The freshly generated public verification & encrypition keys to be used for the requested AT certificate - m_publicKeys( - v_public_verification_key, - m_encryptionKey( // FIXME Encryption keys could be optional - -, - v_public_encryption_key - ) - ) - ); - } else { - p_inner_at_request.publicKeys := valueof( // The freshly generated public verification keys to be used for the requested AT certificate - m_publicKeys( - v_public_verification_key - ) - ); - } - p_inner_at_request.hmacKey := v_hmac_key; - log("f_generate_inner_at_request: p_inner_at_request= ", p_inner_at_request); - - return true; - } // End of function f_generate_inner_at_request - - function f_generate_inner_at_request_with_wrong_parameters( - in Certificate p_aa_certificate, - in SecurityAlg p_enc_algo := PX_EC_ALG_FOR_AT, - in Oct8 p_aa_hashed_id8, - in Certificate p_ea_certificate, - in octetstring p_salt, - in Oct8 p_ea_hashed_id8, - in Certificate p_ec_certificate, - in octetstring p_ec_private_key, - in boolean p_alter_hmac := false, - in boolean p_alter_signer_digest := false, - in template (omit) Time32 p_start := omit, - in template (omit) Duration p_duration := omit, - in template (omit) Time64 p_generation_time := omit, - out octetstring p_private_key, - out octetstring p_public_key_compressed, - out integer p_compressed_key_mode, - out octetstring p_private_enc_key, - out octetstring p_public_compressed_enc_key, - out integer p_compressed_enc_key_mode, - out InnerAtRequest p_inner_at_request - ) return boolean { - // Local variables - var octetstring v_public_key_x; - var octetstring v_public_key_y; - var octetstring v_public_enc_key_x; - var octetstring v_public_enc_key_y; - var bitstring v_enc_value; - var octetstring v_ec_hash; - var PublicVerificationKey v_public_verification_key; - var BasePublicEncryptionKey v_public_encryption_key; - var Oct8 v_ec_hashed_id8; - var octetstring public_enc_key_x; - var octetstring public_enc_key_y; - var Oct32 v_hmac_key; - var PublicVerificationKey v_verification_tag; - var PublicEncryptionKey v_encryption_tag; - var octetstring v_encoded_tag; - var Oct16 v_key_tag; - var octetstring v_hash_shared_at_request; - var template (value) ToBeSignedData v_tbs; - var octetstring v_tbs_signed; - var Ieee1609Dot2Data v_signed_at_signature; - var template (value) EccP256CurvePoint v_eccP256_curve_point; - var template (value) EccP256CurvePoint v_enc_eccP256_curve_point; - var HashAlgorithm v_hashId; - var Signature v_signature; - var Time32 v_start; - var Duration v_duration; - var SequenceOfPsidSsp v_appPermissions := { // ETSI TS 102 965 Table A.1: ETSI ITS standardized ITS-AIDs - valueof(m_appPermissions(c_its_aid_CAM, { bitmapSsp := PX_INNER_AT_CERTFICATE_BITMAP_SSP_CAM })), - valueof(m_appPermissions(c_its_aid_DENM, { bitmapSsp := PX_INNER_AT_CERTFICATE_BITMAP_SSP_DENM })) - }; - - log("f_generate_inner_at_request_with_wrong_parameters: p_enc_algo=", p_enc_algo); - - // Generate verification keys for the certificate to be requested - if (f_generate_key_pair(p_private_key, v_public_key_x, v_public_key_y, p_public_key_compressed, p_compressed_key_mode) == false) { - log("f_generate_inner_at_request_with_wrong_parameters: Failed to generate verification key"); - return false; - } - log ("f_generate_inner_at_request_with_wrong_parameters: AT verification private key: ", p_private_key); - log ("f_generate_inner_at_request_with_wrong_parameters: AT verification public compressed key: ", p_public_key_compressed); - log ("f_generate_inner_at_request_with_wrong_parameters: AT verification public compressed mode: ", p_compressed_key_mode); - // Generate encryption keys for the certificate to be requested - if (PX_INCLUDE_ENCRYPTION_KEYS) { - if (f_generate_key_pair_for_encryption(p_enc_algo, p_private_enc_key, v_public_enc_key_x, v_public_enc_key_y, p_public_compressed_enc_key, p_compressed_enc_key_mode) == false) { - log("f_generate_inner_at_request_with_wrong_parameters: Failed to generate encryption key"); - return false; - } else { - log ("f_generate_inner_at_request_with_wrong_parameters: AT encryption private key: ", p_private_enc_key); - log ("f_generate_inner_at_request_with_wrong_parameters: AT encryption public compressed key: ", p_public_compressed_enc_key); - log ("f_generate_inner_at_request_with_wrong_parameters: AT encryption public compressed mode: ", p_compressed_enc_key_mode); - } - } else { - p_private_enc_key := ''O; - v_public_enc_key_x := ''O; - v_public_enc_key_y := ''O; - p_public_compressed_enc_key := ''O; - p_compressed_enc_key_mode := -1; - } - - // Calculate the whole certificate SHA - v_enc_value := encvalue(p_ec_certificate); - if (ischosen(p_ec_certificate.issuer.sha256AndDigest)) { - v_ec_hash := f_hashWithSha256(bit2oct(v_enc_value)); - v_ec_hashed_id8 := f_hashedId8FromSha256(v_ec_hash); - } else { - v_ec_hash := f_hashWithSha384(bit2oct(v_enc_value)); - v_ec_hashed_id8 := f_hashedId8FromSha384(v_ec_hash); - } - log("f_generate_inner_at_request_with_wrong_parameters: v_ec_hash= ", v_ec_hash); - log("f_generate_inner_at_request_with_wrong_parameters: v_ec_hashed_id8= ", v_ec_hashed_id8); - if (p_alter_signer_digest == true) { - v_ec_hashed_id8 := int2oct((f_getCurrentTimeUtc() * 1000), 8); - log("f_generate_inner_at_request_with_wrong_parameters: Altered v_ec_hashed_id8= ", v_ec_hashed_id8); - } - - // Generate 32 octets length secret key - v_hmac_key := f_hashWithSha256(int2oct((f_getCurrentTimeUtc() * 1000), 12)); - log("f_generate_inner_at_request_with_wrong_parameters: v_hmac_key= ", v_hmac_key); - - // Generate tag based on the concatenation of verification keys & encryption keys - if (f_generate_key_tag(p_public_key_compressed, p_compressed_key_mode, p_public_compressed_enc_key, p_compressed_enc_key_mode, v_encoded_tag) == false) { - log("f_generate_inner_at_request_with_wrong_parameters: Failed to generate Key tag"); - return false; - } - log("f_generate_inner_at_request_with_wrong_parameters: v_encoded_tag= ", v_encoded_tag); - // Generate hmac key - v_key_tag := substr( - fx_hmac_sha256( // TODO Rename and use a wrapper function - v_hmac_key, - v_encoded_tag - ), - 0, - 16); // Leftmost 128 bits of the HMAC-SHA256 tag computed previously - log("f_generate_inner_at_request_with_wrong_parameters: v_key_tag= ", v_key_tag); - if (p_alter_hmac == true) { - v_hmac_key[0] := 'aa'O; - v_hmac_key[1] := 'bb'O; - log("f_generate_inner_at_request_with_wrong_parameters: Altered key_tag= ", v_hmac_key); - } - - // Build the SharedAtRequest - if (not(ispresent(p_start))) { - v_start := p_ec_certificate.toBeSigned.validityPeriod.start_; - } else { - v_start := valueof(p_start); - log("f_generate_inner_at_request_with_wrong_parameters: Altered ValidityPeriod.start= ", v_start); - } - if (not(ispresent(p_duration))) { - v_duration := p_ec_certificate.toBeSigned.validityPeriod.duration; - } else { - v_duration := valueof(p_duration); - log("f_generate_inner_at_request_with_wrong_parameters: Altered ValidityPeriod.duration= ", v_duration); - } - p_inner_at_request.sharedAtRequest := valueof( - m_shared_at_request( - p_ea_hashed_id8, // eaId identifies the EA certificate shared with EA entity - v_key_tag, // Calculated keyTag - valueof( - m_certificate_subject_attributes( - v_appPermissions, - p_ec_certificate.toBeSigned.certRequestPermissions, - { none_ := NULL },//p_ec_certificate.toBeSigned.id, - m_validityPeriod(v_start, v_duration), - p_ec_certificate.toBeSigned.region, - p_ec_certificate.toBeSigned.assuranceLevel - ))) // Desired attributes - ); - - // Calculate the hash of the SharedAtRequest - v_hash_shared_at_request := f_hashWithSha256(bit2oct(encvalue(p_inner_at_request.sharedAtRequest))); - log("f_generate_inner_at_request_with_wrong_parameters: v_hash_shared_at_request= ", v_hash_shared_at_request); - - // Build the ETsiTs103097Data-SignedExternalPayload - if (ispresent(p_generation_time)) { - v_tbs := m_toBeSignedData( - m_signedDataPayload_ext(v_hash_shared_at_request), // Payload containing extDataHash - m_headerInfo_inner_pki_request( // HeaderInfo - -, - valueof(p_generation_time) * 1000) //us - ); - log("f_generate_inner_at_request_with_wrong_parameters: Altered generation time: v_tbs= ", v_tbs); - } else { - v_tbs := m_toBeSignedData( - m_signedDataPayload_ext(v_hash_shared_at_request), // Payload containing extDataHash - m_headerInfo_inner_pki_request( // HeaderInfo - -, - f_getCurrentTime() * 1000) //us - ); - log("f_generate_inner_at_request_with_wrong_parameters: v_tbs= ", v_tbs); - } - // Signed ToBeSigned payload using the private key of EC certificate obtained from Enrolment request - // In case of ITS-S privacy, v_signed_at_signature contained the data to be encrypted - // TODO Simplify with f_signWithEcdsa - if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1)) { - v_hashId := sha384; - v_tbs_signed := f_signWithEcdsaBrainpoolp384r1WithSha384(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); - v_signature := valueof( - m_signature_ecdsaBrainpoolP384r1( - m_ecdsaP384Signature( - m_eccP384CurvePoint_x_only( - substr(v_tbs_signed, 0, 48) - ), - substr(v_tbs_signed, 48, 48) - ) - ) - ); - } else { - v_hashId := sha256; - if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1)) { - v_tbs_signed := f_signWithEcdsaBrainpoolp256r1WithSha256(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); - v_signature := valueof( - m_signature_ecdsaBrainpoolP256r1( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_tbs_signed, 0, 32) - ), - substr(v_tbs_signed, 32, 32) - ) - ) - ); - } else if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256)) { - v_tbs_signed := f_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), v_ec_hash, p_ec_private_key); - v_signature := valueof( - m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_tbs_signed, 0, 32) - ), - substr(v_tbs_signed, 32, 32) - ) - ) - ); - } else { - // Error - log("f_generate_inner_at_request_with_wrong_parameters: Failed to process signature"); - return false; - } - } - v_signed_at_signature := valueof( - m_etsiTs103097Data_signed( - m_signedData( - v_hashId, - v_tbs, - m_signerIdentifier_digest(v_ec_hashed_id8), // Signer is the hasheId8 of the EC certificate obtained from Enrolment request - v_signature - ) - ) - ); - log("f_generate_inner_at_request_with_wrong_parameters: v_signed_at_signature= ", v_signed_at_signature); - - if (PICS_ITS_S_WITH_PRIVACY) { // Build EtsiTs102097Data-Encrypted structure - var octetstring v_public_enc_key; - var integer v_compressed_mode; - var Oct12 v_nonce; - var Oct16 v_authentication_vector; - var Oct16 v_aes_sym_key; - var Oct16 v_encrypted_sym_key; - var HashedId8 v_recipientId; - var octetstring v_public_compressed_ephemeral_key; - var integer v_public_compressed_ephemeral_mode; - var octetstring v_enc_signed_ec_signature; - var EncryptedDataEncryptionKey v_encrypted_data_encryption_key; - - // Use EA certificate for the encryption - if (p_enc_algo == e_nist_p256) { - if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0)) { - v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0; - v_compressed_mode := 0; - } else if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_1)) { - v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_1; - v_compressed_mode := 1; - } else { - log("f_generate_inner_at_request_with_wrong_parameters: Wrong NistP256 encryption variant"); - return false; - } - v_enc_signed_ec_signature := f_encryptWithEciesNistp256WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce); - if (v_public_compressed_ephemeral_mode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); - } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_compressed_ephemeral_key)); - } - v_encrypted_data_encryption_key := valueof( - m_encryptedDataEncryptionKey_eciesNistP256( - m_evciesP256EncryptedKey( - v_eccP256_curve_point, - v_encrypted_sym_key, - v_authentication_vector - ))); - } else if (p_enc_algo == e_brainpool_p256_r1) { - if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0)) { - v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0; - v_compressed_mode := 0; - } else if (ischosen(p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_1)) { - v_public_enc_key := p_ea_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_1; - v_compressed_mode := 1; - } else { - log("f_generate_inner_at_request_with_wrong_parameters: Wrong BrainpoolP256r1 encryption variant"); - return false; - } - v_enc_signed_ec_signature := f_encryptWithEciesBrainpoolp256r1WithSha256(bit2oct(encvalue(v_signed_at_signature)), v_public_enc_key, v_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce); - if (v_public_compressed_ephemeral_mode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); - } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_compressed_ephemeral_key)); - } - v_encrypted_data_encryption_key := valueof( - m_encryptedDataEncryptionKey_eciesBrainpoolP256r1( - m_evciesP256EncryptedKey( - v_eccP256_curve_point, - v_encrypted_sym_key, - v_authentication_vector - ))); - } else { - log("f_generate_inner_at_request_with_wrong_parameters: Wrong encryption variant"); - return false; - } - log("f_generate_inner_at_request_with_wrong_parameters: v_encrypted_data_encryption_key= ", v_encrypted_data_encryption_key); - v_recipientId := p_ea_hashed_id8; // RecipientId is the HashedId8 of the EA certificate - log("f_generate_inner_at_request_with_wrong_parameters: v_recipientId= ", v_recipientId); - // Fill Certificate template with the public compressed keys (canonical form) - p_inner_at_request.ecSignature := valueof( - m_ec_signature( - m_etsiTs103097Data_encrypted( - m_encryptedData( - { - m_recipientInfo_certRecipInfo( - m_pKRecipientInfo( - v_recipientId, - - v_encrypted_data_encryption_key )) - }, - m_SymmetricCiphertext_aes128ccm( - m_aesCcmCiphertext( - v_nonce, - v_enc_signed_ec_signature - ) - ) - ) - ) - ) - ); - } else { // Skip the encryption, alowed to be re-identified by the AA - p_inner_at_request.ecSignature := valueof(m_ec_signature_ext_payload(v_signed_at_signature)); - } - // Build the InnerAtRequest, EcSignature field is already set - if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256)) { - if (p_compressed_key_mode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_key_x)); - } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_key_x)); - } - v_public_verification_key := valueof(m_publicVerificationKey_ecdsaNistP256(v_eccP256_curve_point)); - } else if (ischosen(p_ec_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1)) { - if (p_compressed_key_mode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_key_x)); - } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_key_x)); - } - v_public_verification_key := valueof(m_publicVerificationKey_ecdsaBrainpoolP256r1(v_eccP256_curve_point)); - } else { - var EccP384CurvePoint v_eccP384_curve_point; - if (p_compressed_key_mode == 0) { - v_eccP384_curve_point := valueof(m_eccP384CurvePoint_compressed_y_0(v_public_key_x)); - } else { - v_eccP384_curve_point := valueof(m_eccP384CurvePoint_compressed_y_1(v_public_key_x)); - } - v_public_verification_key := valueof(m_publicVerificationKey_ecdsaBrainpoolP384r1(v_eccP384_curve_point)); - } - if (PX_INCLUDE_ENCRYPTION_KEYS) { - if (p_compressed_enc_key_mode == 0) { - v_enc_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_0(v_public_enc_key_x); - } else { - v_enc_eccP256_curve_point := m_eccP256CurvePoint_compressed_y_1(v_public_enc_key_x); - } - if (p_enc_algo == e_nist_p256) { - v_public_encryption_key := valueof(m_publicEncryptionKey_eciesNistP256(v_enc_eccP256_curve_point)); - } else { - v_public_encryption_key := valueof(m_publicEncryptionKey_eciesBrainpoolP256r1(v_enc_eccP256_curve_point)); - } - p_inner_at_request.publicKeys := valueof( // The freshly generated public verification & encrypition keys to be used for the requested AT certificate - m_publicKeys( - v_public_verification_key, - m_encryptionKey( // FIXME Encryption keys could be optional - -, - v_public_encryption_key - ) - ) - ); - } else { - p_inner_at_request.publicKeys := valueof( // The freshly generated public verification keys to be used for the requested AT certificate - m_publicKeys( - v_public_verification_key - ) - ); - } - p_inner_at_request.hmacKey := v_hmac_key; - log("f_generate_inner_at_request_with_wrong_parameters: p_inner_at_request= ", p_inner_at_request); - - return true; - } // End of function f_generate_inner_at_request_with_wrong_parameters - - function f_verify_inner_at_request_signed_for_pop( - in EtsiTs102941Data p_etsi_ts_102941_data, - in EtsiTs103097Certificate p_ec_certificate, - out InnerAtRequest p_inner_at_request - ) return boolean { - var bitstring v_msg_bit; - - log(">>> f_verify_inner_at_request_signed_for_pop: p_etsi_ts_102941_data=", p_etsi_ts_102941_data); - log(">>> f_verify_inner_at_request_signed_for_pop: p_ec_certificate=", p_ec_certificate); - - // 1. Extract content - p_inner_at_request := p_etsi_ts_102941_data.content.authorizationRequest; - - // 2. Verify the InnerEcRequestSignedForPop signature - // TODO - - log("<<< f_verify_inner_at_request_signed_for_pop: ", p_inner_at_request); - return true; - } // End of function f_verify_inner_at_request_signed_for_pop - - function f_generate_inner_at_response( - in octetstring p_authorization_request_hash, - in EtsiTs103097Certificate p_certificate, - out InnerAtResponse p_authorization_response - ) return boolean { - // Local variables - - // Build the Proof of Possession InnerEcResponse - p_authorization_response := valueof( - m_innerAtResponse_ok( - substr(p_authorization_request_hash, 0, 16), - p_certificate - ) - ); - - return true; - } // End of function f_generate_inner_at_response - - } // End of group inner_at_xxx - - group authorization_validation_xxx { - - } // End of group authorization_validation_xxx - - group dc { - - function f_build_dc_ctl( - in charstring p_ea_certificate_id, - in charstring p_aa_certificate_id, - in charstring p_rca_certificate_id, - out ToBeSignedRcaCtl p_to_be_signed_rca_ctl - ) { - // Local variables - var EtsiTs103097Certificate v_ea_certificate; - var EtsiTs103097Certificate v_aa_certificate; - var EtsiTs103097Certificate v_rca_certificate; - var CtlCommands v_ctl_commands; - var ToBeSignedRcaCtl v_to_be_signed_rca_ctl; - - log(">>> f_build_dc_ctl"); - - // Load certificates - f_readCertificate(p_ea_certificate_id, v_ea_certificate); - f_readCertificate(p_aa_certificate_id, v_aa_certificate); - f_readCertificate(p_rca_certificate_id, v_rca_certificate); - // Create ctrlCommnand list - v_ctl_commands := { - { add := { rca := valueof(m_root_ca_entry(v_rca_certificate)) } }, - { add := { aa := valueof(m_aa_entry(v_aa_certificate, "http://www.etsi.org")) } }, - { add := { ea := valueof(m_ea_entry(v_ea_certificate, "http://www.etsi.org")) } } - }; - log("f_build_dc_ctl: v_ctl_commands= ", v_ctl_commands); - // Build the main data structure - p_to_be_signed_rca_ctl := valueof(m_to_be_signed_rca_full_ctl(1000, 1, v_ctl_commands)); - - log("<<< f_build_dc_ctl: p_to_be_signed_rca_ctl= ", p_to_be_signed_rca_ctl); - } // End of function f_build_dc_ctl - - function f_sign_dc_ctl( - in charstring p_issuer_certificate_id, - in ToBeSignedRcaCtl p_to_be_signed_rca_ctl, - out Ieee1609Dot2Data p_ieee_1609Dot2_signed_data - ) { - // Local variables - var EtsiTs103097Certificate v_certificate; - var EtsiTs102941Data v_etsi_ts_102941_data; - var octetstring v_pki_message; - var ToBeSignedData v_tbs; - var octetstring v_private_key; - var octetstring v_issuer; - var bitstring v_tbs_encoded; - var octetstring v_sig; - var Signature v_signature; - - log(">>> f_sign_dc_ctl"); - - f_readSigningKey(p_issuer_certificate_id, v_private_key); - f_getCertificateHash(p_issuer_certificate_id, v_issuer); - - // Encode the main data structure - v_etsi_ts_102941_data := valueof(m_etsiTs102941Data_to_be_signed_rca_ctl(p_to_be_signed_rca_ctl)); - v_pki_message := bit2oct(encvalue(v_etsi_ts_102941_data)); - // Signed the encoded PKI message - v_tbs := valueof( - m_toBeSignedData( - m_signedDataPayload( - m_etsiTs103097Data_unsecured(v_pki_message) - ), - m_headerInfo_inner_pki_response(-, (f_getCurrentTime() * 1000)/*us*/) - ) - ); - v_tbs_encoded := encvalue(v_tbs); - // Sign the certificate - v_sig := f_signWithEcdsa(bit2oct(v_tbs_encoded), v_issuer, v_private_key); - if ((PX_VE_ALG == e_nist_p256) or (PX_VE_ALG == e_brainpool_p256_r1)) { - v_signature := valueof( - m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_sig, 0, 32) - ), - substr(v_sig, 32, 32) - ) - )); - p_ieee_1609Dot2_signed_data := valueof( - m_etsiTs103097Data_signed( - m_signedData( - sha256, - v_tbs, - m_signerIdentifier_digest(v_issuer), - v_signature - ) - ) - ); - } else if (PX_VE_ALG == e_brainpool_p384_r1) { - v_signature := valueof( - m_signature_ecdsaBrainpoolP384r1( - m_ecdsaP384Signature( - m_eccP384CurvePoint_x_only( - substr(v_sig, 0, 48) - ), - substr(v_sig, 48, 48) - ) - )); - p_ieee_1609Dot2_signed_data := valueof( - m_etsiTs103097Data_signed( - m_signedData( - sha384, - v_tbs, - m_signerIdentifier_digest(v_issuer), - v_signature - ) - ) - ); - } - log("<<< f_sign_dc_ctl: p_ieee_1609Dot2_signed_data= ", p_ieee_1609Dot2_signed_data); - } // End of function f_sign_dc_ctl - - } // End of group dc - - group rca { - - function f_verify_rca_ctl_response_message( - in EtsiTs103097Data p_etsi_ts_103097_signed_data, - in boolean p_check_security := true, - out ToBeSignedRcaCtl p_to_be_signed_rca_ctl - ) return boolean { - var bitstring v_etsi_ts_102941_data_msg; - var bitstring v_tbs; - var Certificate v_certificate; - var charstring v_certificate_id; - var octetstring v_issuer; - var EtsiTs102941Data v_etsi_ts_102941_data; - - log(">>> f_verify_rca_ctl_response_message: p_etsi_ts_103097_signed_data= ", p_etsi_ts_103097_signed_data); - - // 1. Verify signature - log("f_verify_rca_ctl_response_message: p_etsi_ts_103097_signed_data.content.signedData.tbsData= ", p_etsi_ts_103097_signed_data.content.signedData.tbsData); - v_tbs := encvalue(p_etsi_ts_103097_signed_data.content.signedData.tbsData); - if (f_getCertificateFromDigest(p_etsi_ts_103097_signed_data.content.signedData.signer.digest, v_certificate, v_certificate_id) == false) { - log("f_verify_rca_ctl_response_message: Failed to retrieve certificate from ", p_etsi_ts_103097_signed_data.content.signedData.signer.digest); - if (p_check_security == true) { - return false; - } - } - f_getCertificateHash(v_certificate_id, v_issuer); - if (f_verifyEcdsa(bit2oct(v_tbs), v_issuer, p_etsi_ts_103097_signed_data.content.signedData.signature_, v_certificate.toBeSigned.verifyKeyIndicator.verificationKey) == false) { - log("f_verify_rca_ctl_response_message: Failed to verify signature"); - if (p_check_security == true) { - return false; - } - } - v_etsi_ts_102941_data_msg := oct2bit(p_etsi_ts_103097_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); - if (decvalue(v_etsi_ts_102941_data_msg, v_etsi_ts_102941_data) != 0) { - log("f_verify_rca_ctl_response_message: Failed to decode EtsiTs102941Data"); - return false; - } else { - log("f_verify_rca_ctl_response_message: v_etsi_ts_102941_data= ", v_etsi_ts_102941_data); - log("f_verify_pki_response_message: RcaCertificateTrustListMessage matching= ", match(v_etsi_ts_102941_data, mw_etsiTs102941Data_to_be_signed_rca_ctl)); - if (match(v_etsi_ts_102941_data, mw_etsiTs102941Data_to_be_signed_rca_ctl) == false) { - log("f_verify_rca_ctl_response_message: Failed to decode certificateTrustListRca"); - return false; - } else { - var Time32 v_time := (f_getCurrentTime()/* - 1072915200000*/) / 1000; - p_to_be_signed_rca_ctl := v_etsi_ts_102941_data.content.certificateTrustListRca; - log("f_verify_rca_ctl_response_message: p_to_be_signed_rca_ctl= ", p_to_be_signed_rca_ctl); - if (p_to_be_signed_rca_ctl.nextUpdate <= v_time) { - log("f_verify_rca_ctl_response_message: Invalid nextUpdate value: compared values=", p_to_be_signed_rca_ctl.nextUpdate, "/", v_time); - return false; - } - // TODO Verify RCA certificate & signature - } - } - - return true; - } - - function f_verify_rca_crl_response_message( - in EtsiTs103097Data p_etsi_ts_103097_signed_data, - in boolean p_check_security := true, - out ToBeSignedCrl p_to_be_signed_crl - ) return boolean { - var bitstring v_etsi_ts_102941_data_msg; - var bitstring v_tbs; - var Certificate v_certificate; - var charstring v_certificate_id; - var octetstring v_issuer; - var EtsiTs102941Data v_etsi_ts_102941_data; - - log(">>> f_verify_rca_crl_response_message: p_etsi_ts_103097_signed_data= ", p_etsi_ts_103097_signed_data); - - // 1. Verify signature - log("f_verify_rca_crl_response_message: p_etsi_ts_103097_signed_data.content.signedData.tbsData= ", p_etsi_ts_103097_signed_data.content.signedData.tbsData); - v_tbs := encvalue(p_etsi_ts_103097_signed_data.content.signedData.tbsData); - if (f_getCertificateFromDigest(p_etsi_ts_103097_signed_data.content.signedData.signer.digest, v_certificate, v_certificate_id) == false) { - log("f_verify_rca_crl_response_message: Failed to retrieve certificate from ", p_etsi_ts_103097_signed_data.content.signedData.signer.digest); - if (p_check_security == true) { - return false; - } - } - f_getCertificateHash(v_certificate_id, v_issuer); - if (f_verifyEcdsa(bit2oct(v_tbs), v_issuer, p_etsi_ts_103097_signed_data.content.signedData.signature_, v_certificate.toBeSigned.verifyKeyIndicator.verificationKey) == false) { - log("f_verify_rca_crl_response_message: Failed to verify signature"); - if (p_check_security == true) { - return false; - } - } - v_etsi_ts_102941_data_msg := oct2bit(p_etsi_ts_103097_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); - if (decvalue(v_etsi_ts_102941_data_msg, v_etsi_ts_102941_data) != 0) { - log("f_verify_rca_crl_response_message: Failed to decode EtsiTs102941Data"); - return false; - } else { - log("f_verify_rca_crl_response_message: v_etsi_ts_102941_data= ", v_etsi_ts_102941_data); - log("f_verify_pki_response_message: CertificateRevocationList matching= ", match(v_etsi_ts_102941_data, mw_etsiTs102941Data_to_be_signed_crl)); - if (match(v_etsi_ts_102941_data, mw_etsiTs102941Data_to_be_signed_crl) == false) { - log("f_verify_rca_crl_response_message: Failed to decode certificateRevocationList"); - return false; - } else { - var Time32 v_time := (f_getCurrentTime()/* - 1072915200000*/) / 1000; - p_to_be_signed_crl := v_etsi_ts_102941_data.content.certificateRevocationList; - log("f_verify_rca_crl_response_message: p_to_be_signed_crl= ", p_to_be_signed_crl); - if (p_to_be_signed_crl.thisUpdate >= v_time) { - log("f_verify_rca_crl_response_message: Invalid thisUpdate value"); - return false; - } - if (p_to_be_signed_crl.nextUpdate <= v_time) { - log("f_verify_rca_crl_response_message: Invalid nextUpdate value"); - return false; - } - // TODO Verify RCA certificate & signature - } - } - - return true; - } - - function f_verify_full_ctl( - in ToBeSignedRcaCtl p_to_be_signed_rca_ctl - ) return boolean { - log(">>> f_verify_full_ctl: p_to_be_signed_rca_ctl= ", p_to_be_signed_rca_ctl); - - // 1. Check mandatory fields - log("f_verify_full_ctl matching= ", match(p_to_be_signed_rca_ctl, mw_to_be_signed_rca_full_ctl)); - if (match(p_to_be_signed_rca_ctl, mw_to_be_signed_rca_full_ctl) == false) { - return false; - } - - log("f_verify_full_ctl: ctlCommands length: ", lengthof(p_to_be_signed_rca_ctl.ctlCommands)); - for (var integer v_i := 0; v_i < lengthof(p_to_be_signed_rca_ctl.ctlCommands); v_i := v_i + 1) { - var CtlCommand v_ctl_command := p_to_be_signed_rca_ctl.ctlCommands[v_i]; - - if (ischosen(v_ctl_command.delete)) { - log("f_verify_full_ctl: ctlCommands shall not contains 'delete' variant"); - return false; - } else { - if (f_verify_ctl_entry(v_ctl_command.add) == false) { - log("f_verify_full_ctl: ctlCommands contains invalid entries"); - return false; - } - } - } // End of 'for' statements - - return true; - } - - function f_verify_full_crl( - in ToBeSignedCrl p_to_be_signed_crl - ) return boolean { - log(">>> f_verify_full_crl: p_to_be_signed_crl= ", p_to_be_signed_crl); - - // 1. Check mandatory fields - log("f_verify_full_crl matching= ", match(p_to_be_signed_crl, mw_to_be_signed_crl)); - if (match(p_to_be_signed_crl, mw_to_be_signed_crl) == false) { - return false; - } - - log("f_verify_full_crl: entries length: ", lengthof(p_to_be_signed_crl.entries)); - for (var integer v_i := 0; v_i < lengthof(p_to_be_signed_crl.entries); v_i := v_i + 1) { - var CrlEntry v_crl_entry := p_to_be_signed_crl.entries[v_i]; - - log("f_verify_full_crl: crlEntry: v_crl_entry"); - } // End of 'for' statements - - return true; - } - - function f_verify_full_ectl( - in ToBeSignedRcaCtl p_to_be_signed_tlm_ectl - ) return boolean { - log(">>> f_verify_full_ectl: p_to_be_signed_tlm_ectl= ", p_to_be_signed_tlm_ectl); - - // 1. Check mandatory fields - log("f_verify_full_ectl matching= ", match(p_to_be_signed_tlm_ectl, mw_to_be_signed_rca_full_ctl)); - if (match(p_to_be_signed_tlm_ectl, mw_to_be_signed_rca_full_ctl) == false) { - return false; - } - - log("f_verify_full_ectl: ctlCommands length: ", lengthof(p_to_be_signed_tlm_ectl.ctlCommands)); - for (var integer v_i := 0; v_i < lengthof(p_to_be_signed_tlm_ectl.ctlCommands); v_i := v_i + 1) { - var CtlCommand v_ectl_command := p_to_be_signed_tlm_ectl.ctlCommands[v_i]; - - if (ischosen(v_ectl_command.delete)) { - log("f_verify_full_ectl: ctlCommands shall not contains 'delete' variant"); - return false; - } else { - if (f_verify_ectl_entry(v_ectl_command.add) == false) { - log("f_verify_full_ectl: ctlCommands contains invalid entries"); - return false; - } - } - } // End of 'for' statements - - return true; - } - - function f_verify_ctl_entry( - in CtlEntry p_ctl_entry - ) return boolean { - log(">>> f_verify_ctl_entry: p_ctl_entry=", p_ctl_entry); - - if (ischosen(p_ctl_entry.rca)) { - if (match(p_ctl_entry.rca, mw_root_ca_entry(mw_etsiTs103097Certificate)) == false) { - return false; - } else { - // TODO Verify RCA certificate & signature - } - } else if (ischosen(p_ctl_entry.ea)) { - if (match(p_ctl_entry.ea, mw_ea_entry(mw_etsiTs103097Certificate)) == false) { - return false; - } else { - // TODO Verify RCA certificate & signature - } - } else if (ischosen(p_ctl_entry.aa)) { - if (match(p_ctl_entry.aa, mw_aa_entry(mw_etsiTs103097Certificate)) == false) { - return false; - } else { - // TODO Verify RCA certificate & signature - } - } else if (ischosen(p_ctl_entry.dc)) { - if (match(p_ctl_entry.dc, mw_dc_entry) == false) { - return false; - } else { - // TODO Verify RCA certificate & signature - } - } else { - return false; - } - - return true; - } - - function f_verify_ectl_entry( - in CtlEntry p_ctl_entry - ) return boolean { - log(">>> f_verify_ectl_entry: p_ctl_entry=", p_ctl_entry); - - if (ischosen(p_ctl_entry.tlm)) { - if (match(p_ctl_entry.tlm, mw_tlm_entry(mw_etsiTs103097Certificate)) == false) { - return false; - } else { - // TODO Verify RCA certificate & signature - } - } else if (ischosen(p_ctl_entry.dc)) { - if (match(p_ctl_entry.dc, mw_dc_entry) == false) { - return false; - } else { - // TODO Verify RCA certificate & signature - } - } else if (ischosen(p_ctl_entry.rca)) { - if (match(p_ctl_entry.rca, mw_root_ca_entry(mw_etsiTs103097Certificate)) == false) { - return false; - } else { - // TODO Verify RCA certificate & signature - } - } else { - return false; - } - - return true; - } - - /** - * @desc this function is used to retrieve the root certificate from SubCA entity - * @param p_certificate The root certificate - * @return 0 on success, -1 otherwise - */ - external function fx_get_root_ca_certificate( - in charstring p_iut_certificate := "CERT_IUT_A_RCA",//"CERT_IUT_A_CA", - in boolean p_explicit_type := false, - out octetstring p_certificate - ) return integer; - - function f_get_root_ca_certificate( - in charstring p_iut_certificate := "CERT_IUT_A_CA", - in boolean p_explicit_type := false, - out Certificate p_certificate - ) return integer { - var octetstring v_os; - var bitstring v_msg_bit; - - log(">>> f_get_root_ca_certificate"); - - // Get root certificate - if (fx_get_root_ca_certificate(p_iut_certificate, p_explicit_type, v_os) != 0) { - log("f_get_root_ca_certificate: fail to get certificate"); - return -1; - } - log("f_get_root_ca_certificate: v_os=", v_os); - // Decode it - v_msg_bit := oct2bit(v_os); - if (decvalue(v_msg_bit, p_certificate) != 0) { - log("f_get_root_ca_certificate: fail to decode certificate"); - return -1; - } - log("<<< f_get_root_ca_certificate: ", p_certificate); - return 0; - } - - function f_verify_rca_certificate( - in charstring p_authorized_certificate := "CERT_IUT_A_RCA",//"CERT_IUT_A_RCA", - in Certificate p_certificate, - in boolean p_check_implicit := false, - in boolean p_check_reconstruction_value := false, - in boolean p_check_no_signature := false, - in boolean p_check_region_restriction := false, - in boolean p_check_signature_content := false, - in boolean p_check_app_permissions := false - ) return boolean { - var CertificateType v_type_ := explicit; - var template Signature v_signature_ := ?; - var template IssuerIdentifier v_issuer := ?; - var template PublicVerificationKey v_public_verification_key := ?; - - log(">>> f_verify_rca_certificate: p_authorized_certificate= ", p_authorized_certificate); - log(">>> f_verify_rca_certificate: p_certificate= ", p_certificate); - - if (p_check_implicit == true) { - v_type_ := implicit; - } - if (p_check_no_signature == true) { - v_signature_ := omit; - } - if (match(p_certificate, mw_etsiTs103097Certificate(-, -, v_signature_, v_type_)) == false) { - log("f_verify_rca_certificate: version/explicit mismatch"); - return false; - } - if (p_check_reconstruction_value == false) { - if (match(p_certificate, mw_etsiTs103097Certificate( - -, - mw_toBeSignedCertificate_ca( - (mw_certificateId_none, mw_certificateId_name), - -, - -, - mw_verificationKeyIndicator_verificationKey - ), - v_signature_ - )) == false) { - log("f_verify_rca_certificate: verificationKey mismatch"); - return false; - } - if (p_check_signature_content) { - var template PublicVerificationKey v_publicVerificationKey; - - if (PICS_SEC_SHA256) { - v_signature_ := mw_signature_ecdsaNistP256; - v_issuer := (mw_issuerIdentifier_self(sha256), mw_issuerIdentifier_sha256AndDigest); - v_public_verification_key := mw_publicVerificationKey_ecdsaNistP256; - } else if (PICS_SEC_BRAINPOOL_P256R1) { - v_signature_ := mw_signature_ecdsaBrainpoolP256r1; - v_issuer := (mw_issuerIdentifier_self(sha256), mw_issuerIdentifier_sha256AndDigest); - v_public_verification_key := mw_publicVerificationKey_ecdsaBrainpoolP256r1; - } else if (PICS_SEC_BRAINPOOL_P384R1) { - v_signature_ := mw_signature_ecdsaBrainpoolP384r1; - v_issuer := (mw_issuerIdentifier_self(sha384), mw_issuerIdentifier_sha384AndDigest); - v_public_verification_key := mw_publicVerificationKey_ecdsaBrainpoolP384r1; - } - if (match(p_certificate, mw_etsiTs103097Certificate( - v_issuer, - mw_toBeSignedCertificate_ca( - (mw_certificateId_none, mw_certificateId_name), - -, - -, - mw_verificationKeyIndicator_verificationKey(v_public_verification_key), - -, -, -, -, - -//mw_encryptionKey - ), - v_signature_ - )) == false) { - log("f_verify_rca_certificate: signature mismatch"); - return false; - } - // Verify Signature - if (ischosen(p_certificate.issuer.self_)) { - v_publicVerificationKey := p_certificate.toBeSigned.verifyKeyIndicator.verificationKey; - } else { - var HashedId8 v_digest; - var Certificate v_authorized_certificate; - var charstring v_cert; - - if (ischosen(p_certificate.issuer.sha256AndDigest)) { - v_digest := p_certificate.issuer.sha256AndDigest; - } else if (ischosen(p_certificate.issuer.sha384AndDigest)) { - v_digest := p_certificate.issuer.sha384AndDigest; - } else { - log("f_verify_rca_certificate: Invalid certificate issuer ", p_certificate.issuer); - return false; - } - if (f_getCertificateFromDigest(v_digest, v_authorized_certificate, v_cert) == false) { - log("f_verify_rca_certificate: Fail to load p_authorized_certificate"); - return false; - } - v_publicVerificationKey := v_authorized_certificate.toBeSigned.verifyKeyIndicator.verificationKey - } - log("f_verify_rca_certificate: v_publicVerificationKey= ", v_publicVerificationKey); - if (f_verifyCertificateSignatureWithPublicKey(p_certificate, v_publicVerificationKey) == false) { - log("f_verify_rca_certificate: signature not verified"); - return false; - } - } - } else { - if (match(p_certificate, mw_etsiTs103097Certificate( - -, - mw_toBeSignedCertificate_ca( - (mw_certificateId_none, mw_certificateId_name), - -, - -, - mw_verificationKeyIndicator_reconstructionValue - ), - v_signature_ - )) == false) { - log("f_verify_rca_certificate: verificationKey mismatch"); - return false; - } - // TODO Verify Signature - } - - if (p_check_region_restriction == true) { - var Certificate v_authorized_certificate; - var template GeographicRegion v_geographic_region := ?; - - if (f_readCertificate(p_authorized_certificate, v_authorized_certificate) == false) { - log("f_verify_rca_certificate: Fail to load p_authorized_certificate"); - return false; - } - log("f_verify_rca_certificate: v_authorized_certificate=", v_authorized_certificate); - - if (PICS_SEC_CIRCULAR_REGION == true) { - v_geographic_region := mw_geographicRegion_circle; - } else if (PICS_SEC_RECTANGULAR_REGION == true) { - v_geographic_region := mw_geographicRegion_rectangular; - } else if (PICS_SEC_POLYGONAL_REGION == true) { - v_geographic_region := mw_geographicRegion_polygonal; - } else if (PICS_SEC_IDENTIFIED_REGION == true) { - v_geographic_region := mw_geographicRegion_identified( - { - (mw_identifiedRegion_country_only, mw_identifiedRegion_country_and_region) - } - ); - } - if (match(p_certificate, mw_etsiTs103097Certificate( - -, - mw_toBeSignedCertificate_ca( - -, - -, - -, - -, - -, - -, - v_geographic_region - ) - )) == false) { - log("f_verify_rca_certificate: Geographical region mismatch"); - return false; - } - // Check interception of area - if (f_checkRegionValidityRestiction(v_authorized_certificate, p_certificate) == false) { - log("f_verify_rca_certificate: Geographical region intersection mismatch"); - return false; - } - } - // Check appPermissions - if (p_check_app_permissions == true) { - var integer v_idx, v_jdx; - var charstring v_psid := ""; // 'psid' currently processed - var charstring v_psidsFound := ";"; // Used to build the list of the 'psid' already processed - var template charstring m_found_pattern; // Used in regex to verify that 'psid' was not found before - var Certificate v_authorized_certificate; - - if (f_readCertificate(p_authorized_certificate, v_authorized_certificate) == false) { - log("f_verify_rca_certificate: Fail to load p_authorized_certificate"); - return false; - } - log("f_verify_rca_certificate: v_authorized_certificate=", v_authorized_certificate); - if (match(v_authorized_certificate.toBeSigned.certIssuePermissions, { mw_psidGroupPermissions }) == false) { - log("f_verify_rca_certificate: eeType mismatch"); - return false; - } - - for (v_idx := 0; v_idx < lengthof(p_certificate.toBeSigned.appPermissions); v_idx := v_idx + 1) { - log("f_verify_rca_certificate: Processing ", p_certificate.toBeSigned.appPermissions[v_idx]); - if (match(p_certificate.toBeSigned.appPermissions[v_idx], mw_appPermissions) == false) { - log("f_verify_rca_certificate: PsidSsp mismatch"); - return false; - } - // Check uniqueness of PSIDs - v_psid := int2str(p_certificate.toBeSigned.appPermissions[v_idx].psid); - m_found_pattern := pattern "*({v_psid})*"; - if (regexp(v_psidsFound, m_found_pattern, 0) == v_psid) { - log("f_verify_rca_certificate: Psid uniqueness is not verified"); - return false; // v_psid exist at least 2 times, uniqueness is not verified - } - // v_psid non found, add it into the built list - v_psidsFound := v_psidsFound & v_psid & ";"; - // Check that 'psid' is in the certIssuePermissions component in the issuing certificate - if (match(v_authorized_certificate.toBeSigned.certIssuePermissions[0].subjectPermissions, mw_subjectPermissions_explicit) == false) { - for (v_jdx := 0; v_jdx < lengthof(v_authorized_certificate.toBeSigned.certIssuePermissions[0].subjectPermissions.explicit); v_jdx := v_jdx + 1) { - if (int2str(v_authorized_certificate.toBeSigned.certIssuePermissions[0].subjectPermissions.explicit[v_jdx].psid) == v_psid) { - break; - } - } // End of 'for'statement - if (v_jdx == lengthof(v_authorized_certificate.toBeSigned.certIssuePermissions[0].subjectPermissions.explicit)) { - log("f_verify_rca_certificate: Psid is not in the list of the issuing certificate"); - return false; - } - } - } // End of 'for'statement - } - - return true; - } - - } // End of group rca - - group tlm { - - function f_verify_tlm_ectl_response_message( - in EtsiTs103097Data p_etsi_ts_103097_signed_data, - in boolean p_check_security := true, - out ToBeSignedTlmCtl p_to_be_signed_tlm_ectl - ) return boolean { - var bitstring v_etsi_ts_102941_data_msg; - var bitstring v_tbs; - var Certificate v_certificate; - var boolean v_result; - var EtsiTs102941Data v_etsi_ts_102941_data; - - log(">>> f_verify_tlm_ectl_response_message: p_etsi_ts_103097_signed_data= ", p_etsi_ts_103097_signed_data); - - // 1. Verify signature - log("f_verify_tlm_ectl_response_message: p_etsi_ts_103097_signed_data.content.signedData.tbsData= ", p_etsi_ts_103097_signed_data.content.signedData.tbsData); - v_tbs := encvalue(p_etsi_ts_103097_signed_data.content.signedData.tbsData); - if (ischosen(p_etsi_ts_103097_signed_data.content.signedData.signer.certificate)) { - v_certificate := p_etsi_ts_103097_signed_data.content.signedData.signer.certificate[0]; - } else { - var charstring v_certificate_id; - if (f_getCertificateFromDigest(p_etsi_ts_103097_signed_data.content.signedData.signer.digest, v_certificate, v_certificate_id) == false) { - log("f_verify_tlm_ectl_response_message: Failed to retrieve certificate from digest ", p_etsi_ts_103097_signed_data.content.signedData.signer.digest); - if (p_check_security == true) { - return false; - } - } - } - if (ischosen(p_etsi_ts_103097_signed_data.content.signedData.signature_.ecdsaBrainpoolP384r1Signature)) { - v_result := f_verifyEcdsa(bit2oct(v_tbs), int2oct(0, 48), p_etsi_ts_103097_signed_data.content.signedData.signature_, v_certificate.toBeSigned.verifyKeyIndicator.verificationKey); - } else { - v_result := f_verifyEcdsa(bit2oct(v_tbs), int2oct(0, 32), p_etsi_ts_103097_signed_data.content.signedData.signature_, v_certificate.toBeSigned.verifyKeyIndicator.verificationKey); - } - if (v_result == false) { - log("f_verify_tlm_ectl_response_message: Failed to verify signature"); - if (p_check_security == true) { - return false; - } - } - v_etsi_ts_102941_data_msg := oct2bit(p_etsi_ts_103097_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); - if (decvalue(v_etsi_ts_102941_data_msg, v_etsi_ts_102941_data) != 0) { - log("f_verify_tlm_ectl_response_message: Failed to decode EtsiTs102941Data"); - return false; - } else { - log("f_verify_tlm_ectl_response_message: v_etsi_ts_102941_data= ", v_etsi_ts_102941_data); - log("f_verify_pki_response_message: TlmCertificateTrustListMessage matching= ", match(v_etsi_ts_102941_data, mw_etsiTs102941Data_to_be_signed_tlm_ctl)); - if (match(v_etsi_ts_102941_data, mw_etsiTs102941Data_to_be_signed_tlm_ctl) == false) { - log("f_verify_tlm_ectl_response_message: Failed to decode certificateTrustListTlm"); - return false; - } else { - var Time32 v_time := (f_getCurrentTime()/* - 1072915200000*/) / 1000; - p_to_be_signed_tlm_ectl := v_etsi_ts_102941_data.content.certificateTrustListTlm; - log("f_verify_tlm_ectl_response_message: p_to_be_signed_tlm_ectl= ", p_to_be_signed_tlm_ectl); - if (p_to_be_signed_tlm_ectl.nextUpdate <= v_time) { - log("f_verify_tlm_ectl_response_message: Invalid nextUpdate value: compared values=", p_to_be_signed_tlm_ectl.nextUpdate, "/", v_time); - return false; - } - // TODO Verify RCA certificate & signature - } - } - - return true; - } - - } // End of group tlm - - group awaiting_messages { - - function f_await_http_inner_ec_request_response( - out Oct32 p_private_key, - out Oct32 p_compressed_public_key, - out integer p_compressed_mode, - out InnerEcResponse p_inner_ec_response, - in boolean p_strict_checks := true - ) runs on ItsPkiHttp return boolean { - var Headers v_headers; - var Oct32 v_request_hash; - var Oct16 v_encrypted_sym_key; - var Oct16 v_aes_sym_key; - var HashedId8 v_aes_sym_key_hashed_id8; - var Oct16 v_authentication_vector; - var Oct12 v_nonce; - var octetstring v_salt; - var Ieee1609Dot2Data v_ieee1609dot2_signed_and_encrypted_data; - var EtsiTs102941Data v_etsi_ts_102941_data; - var HttpMessage v_response; - - log(">>> f_await_http_inner_ec_request_response: p_strict_checks=", p_strict_checks); - - f_http_build_inner_ec_request(p_private_key, p_compressed_public_key, p_compressed_mode, v_aes_sym_key, v_encrypted_sym_key, v_authentication_vector, v_nonce, v_salt, v_ieee1609dot2_signed_and_encrypted_data, v_request_hash); - v_aes_sym_key_hashed_id8 := f_hashedId8FromSha256(f_hashWithSha256('80'O & v_aes_sym_key)); // Used to macth the response - f_init_default_headers_list(-, "inner_ec_request", v_headers); - f_http_send( - v_headers, - m_http_request( - m_http_request_post( - PICS_HTTP_POST_URI_EC, - v_headers, - m_http_message_body_binary( - m_binary_body_ieee1609dot2_data( - v_ieee1609dot2_signed_and_encrypted_data - ))))); - tc_ac.start; - alt { - [] a_await_ec_http_request_from_iut( - mw_http_response( - mw_http_response_ok( - mw_http_message_body_binary( - mw_binary_body_ieee1609dot2_data( - mw_enrolmentResponseMessage( - mw_encryptedData( - { *, mw_recipientInfo_pskRecipInfo(v_aes_sym_key_hashed_id8), * }, - mw_SymmetricCiphertext_aes128ccm - )))))), - v_response - ) { - tc_ac.stop; - - if (f_verify_pki_response_message(p_private_key, v_aes_sym_key, v_authentication_vector, vc_eaWholeHash, v_response.response.body.binary_body.ieee1609dot2_data, p_strict_checks, -, v_etsi_ts_102941_data) == false) { - log("f_await_http_inner_ec_request_response: Failed to verify PKI message ***"); - if (p_strict_checks) { - return false; - } - } - log("f_await_http_inner_ec_request_response: Receive ", v_etsi_ts_102941_data, " ***"); - // Verify the received EC certificate - log("f_await_http_inner_ec_request_response: match ", match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(substr(v_request_hash, 0, 16), mw_etsiTs103097Certificate(-, mw_toBeSignedCertificate_ec)))), " ***"); // TODO In TITAN, this is the only way to get the unmatching in log - if (match(v_etsi_ts_102941_data.content, mw_enrolmentResponse(mw_innerEcResponse_ok(?/*FIXME YANN Blackberry substr(v_request_hash, 0, 16)*/, mw_etsiTs103097Certificate(-, mw_toBeSignedCertificate_ec)))) == false) { - log("f_await_http_inner_ec_request_response: Unexpected message received ***"); - if (p_strict_checks) { - return false; - } - } - if (ischosen(v_etsi_ts_102941_data.content.enrolmentResponse) and ispresent(v_etsi_ts_102941_data.content.enrolmentResponse.certificate)) { - if (f_verify_ec_certificate(v_etsi_ts_102941_data.content.enrolmentResponse.certificate, vc_eaCertificate, vc_eaHashedId8, p_compressed_public_key, p_compressed_mode) == false) { - log("f_await_http_inner_ec_request_response: Cannot verify EC certificate signature ***"); - if (p_strict_checks) { - return false; - } - } - p_inner_ec_response := v_etsi_ts_102941_data.content.enrolmentResponse; - log("f_await_http_inner_ec_request_response: Well-secured EA certificate received ***"); - log("p_inner_ec_response= ", p_inner_ec_response); - } else { - log("f_await_http_inner_ec_request_response: Invalid message received ***"); - return false; - } - } - [] tc_ac.timeout { - log("f_await_http_inner_ec_request_response: Expected message not received ***"); - } - } // End of 'alt' statement - - return true; - } // End of function f_await_http_inner_ec_request_response - - function f_await_ec_request_send_response( - out InnerEcResponse p_inner_ec_response - ) runs on ItsPkiHttp return boolean { - var HttpMessage v_request; - var boolean v_result := false; - - log(">>> f_await_ec_request_send_response"); - - tc_ac.start; - alt { - [] a_await_ec_http_request_from_iut( - mw_http_request( - mw_http_request_post( - PICS_HTTP_POST_URI_EC, - -, - mw_http_message_body_binary( - mw_binary_body_ieee1609dot2_data( - mw_enrolmentRequestMessage( - mw_encryptedData( - -, - mw_SymmetricCiphertext_aes128ccm - )))))), - v_request - ) { - var Ieee1609Dot2Data v_ieee1609dot2_signed_and_encrypted_data; - var EtsiTs102941Data v_etsi_ts_102941_data; - var Oct16 v_request_hash; - var Oct16 v_aes_enc_key; - var InnerEcRequest v_inner_ec_request; - var template (value) HttpMessage v_response; - var Headers v_headers; - - tc_ac.stop; - - f_init_default_headers_list(-, "inner_ec_response", v_headers); - - if (f_verify_pki_request_message(vc_eaPrivateEncKey, vc_eaWholeHash/*salt*/, ''O, v_request.request.body.binary_body.ieee1609dot2_data, false, v_request_hash, v_etsi_ts_102941_data, v_aes_enc_key) == false) { // Cannot decrypt the message - log("f_await_ec_request_send_response: Failed to verify PKI message ***"); - // Send error message - v_response := m_http_response(m_http_response_ko(m_http_message_body_binary(m_binary_body_ieee1609dot2_data(v_ieee1609dot2_signed_and_encrypted_data)), v_headers, 400, "Bad request")); // Initialize v_reponse with an error message - } else { - log("f_await_ec_request_send_response: Receive ", v_etsi_ts_102941_data, " ***"); - if (f_verify_inner_ec_request_signed_for_pop(v_etsi_ts_102941_data, v_inner_ec_request) == false) { - log("f_await_ec_request_send_response: Failed to verify PKI message ***"); - // Send error message - f_http_build_inner_ec_response(v_inner_ec_request/*Not required*/, cantparse, v_request_hash, -, -, v_aes_enc_key, p_inner_ec_response, v_ieee1609dot2_signed_and_encrypted_data); - v_response := m_http_response(m_http_response_ok(m_http_message_body_binary(m_binary_body_ieee1609dot2_data(v_ieee1609dot2_signed_and_encrypted_data)), v_headers)); - } else { - f_http_build_inner_ec_response(v_inner_ec_request, ok, v_request_hash, vc_eaPrivateKey, vc_eaWholeHash, v_aes_enc_key, p_inner_ec_response, v_ieee1609dot2_signed_and_encrypted_data); - v_response := m_http_response(m_http_response_ok(m_http_message_body_binary(m_binary_body_ieee1609dot2_data(v_ieee1609dot2_signed_and_encrypted_data)), v_headers)); - v_result := true; - } - f_http_send(v_headers, v_response); - } - } - [] tc_ac.timeout { - log("f_await_ec_request_send_response: Expected message not received ***"); - } - } // End of 'alt' statement - - return v_result; - } // End of function f_await_ec_request_send_response - - function f_await_dc_request_send_response( - in charstring p_rca_certificate_id, - in charstring p_aa_certificate_id, - in charstring p_ea_certificate_id, - out ToBeSignedRcaCtl p_ctl - ) runs on ItsPkiHttp return boolean { - var HttpMessage v_request; - var boolean v_result := false; - - log(">>> f_await_dc_request_send_response"); - - tc_ac.start; - alt { - [] a_await_dc_http_request_from_iut( - mw_http_request( - mw_http_request_post( - PICS_HTTP_POST_URI_DC - )), - v_request - ) { - var Ieee1609Dot2Data v_ieee1609dot2_signed_and_encrypted_data; - var ToBeSignedRcaCtl p_to_be_signed_rca_ctl; - var EtsiTs102941Data v_etsi_ts_102941_data; - var Oct16 v_request_hash; - var Oct16 v_aes_enc_key; - var template (value) HttpMessage v_response; - var Headers v_headers; - tc_ac.stop; - - f_init_default_headers_list(-, "inner_dc_response", v_headers); - - // Send message - f_build_dc_ctl( - p_rca_certificate_id, - p_aa_certificate_id, - p_ea_certificate_id, - p_to_be_signed_rca_ctl - ); - f_sign_dc_ctl(p_rca_certificate_id, p_to_be_signed_rca_ctl, v_ieee1609dot2_signed_and_encrypted_data); - v_response := m_http_response(m_http_response_ok(m_http_message_body_binary(m_binary_body_ieee1609dot2_data(v_ieee1609dot2_signed_and_encrypted_data)), v_headers)); - f_http_send(v_headers, v_response); - v_result := true; - } - [] tc_ac.timeout { - log("f_await_dc_request_send_response: Expected message not received ***"); - } - } // End of 'alt' statement - - return v_result; - } // End of function f_await_dc_request_send_response - - } // End of group awaiting_messages - - group pki_functions { - - /** - * @desc Build a signed and encrypted PKI request message - * @param p_private_key Private key for signature - * @param p_signer_identifier Signer identifier for signature, could be self or certificate HashedId8 - * @param p_recipientId Recipient identifier to be inclued in encrypted layer. - * If value is int2oct(0. 8), the recipient id is the HashedId8 of the symmetric key used by the sender to encrypt the message to which the response is built - * @param p_public_key_compressed The public compressed key (canonical form) for encryption - * @param p_compressed_mode The compressed mode of the public compressed key (canonical form) for encryption - * @param p_pki_message The PKI message to be secured - * @param p_ieee1609dot2_signed_and_encrypted_data The secured message - * @return true on success, false otherwise - */ - function f_build_pki_secured_request_message_signed_with_pop( - in octetstring p_private_key, - in SignerIdentifier p_signer_identifier, - in HashedId8 p_recipientId, - in octetstring p_public_key_compressed, - in integer p_compressed_mode, - in octetstring p_salt, - in octetstring p_pki_message, - in SecurityAlg p_enc_algorithm, // TODO Use RCA to check encryption alg - in boolean p_alter_signature := false, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce, - out Oct32 p_request_hash - ) return boolean { - // Local variables - var template (value) EccP256CurvePoint v_eccP256_curve_point; - var template (value) ToBeSignedData v_tbs; - var octetstring v_tbs_signed; - var Signature v_signature; - var template (value) Ieee1609Dot2Data v_ieee1609dot2_signed_data; - var octetstring v_encoded_request; - var HashedId8 v_recipientId; - var octetstring v_public_compressed_ephemeral_key; - var integer v_public_compressed_ephemeral_mode; - var octetstring v_encrypted_request; - var EncryptedDataEncryptionKey v_encrypted_data_encryption_key; - var bitstring v_enc_value; - - log(">>> f_build_pki_secured_request_message_signed_with_pop: p_private_key= ", p_private_key); - log(">>> f_build_pki_secured_request_message_signed_with_pop: p_signer_identifier= ", p_signer_identifier); - log(">>> f_build_pki_secured_request_message_signed_with_pop: p_recipientId= ", p_recipientId); - log(">>> f_build_pki_secured_request_message_signed_with_pop: p_public_key_compressed= ", p_public_key_compressed); - log(">>> f_build_pki_secured_request_message_signed_with_pop: p_compressed_mode= ", p_compressed_mode); - log(">>> f_build_pki_secured_request_message_signed_with_pop: p_salt= ", p_salt); - log(">>> f_build_pki_secured_request_message_signed_with_pop: p_pki_message= ", p_pki_message); - log(">>> f_build_pki_secured_request_message_signed_with_pop: p_enc_algorithm= ", p_enc_algorithm); - log(">>> f_build_pki_secured_request_message_signed_with_pop: p_alter_signature= ", p_alter_signature); - - // Signed the encoded PKI message - v_tbs := m_toBeSignedData( - m_signedDataPayload( - m_etsiTs103097Data_unsecured(p_pki_message) - ), - m_headerInfo_inner_pki_request(-, (f_getCurrentTime() * 1000)/*us*/) - ); - log("f_build_pki_secured_request_message_signed_with_pop: v_tbs: ", v_tbs); - if (ischosen(p_signer_identifier.self_)) { - v_tbs_signed := f_signWithEcdsa(bit2oct(encvalue(v_tbs)), int2oct(0, 32), p_private_key); - } else { - var charstring v_certificate_id; - var octetstring v_hash; - // FIXME Huge issue, certificate is BP256 and PX_VE_ALG is e_brainpool_p384_r1, so v_hash & p_private_key are 32 bytes length not 48 - // ==> Need to sign with v_certificate_id capabilities not with PX_VE_ALG :( - fx_readCertificateFromDigest(p_signer_identifier.digest, v_certificate_id); // TODO Add a wrapper function - f_getCertificateHash(v_certificate_id, v_hash); - v_tbs_signed := f_signWithEcdsa(bit2oct(encvalue(v_tbs)), v_hash, p_private_key); - } - log("f_build_pki_secured_request_message_signed_with_pop: lengthof(v_tbs_signed)= ", lengthof(v_tbs_signed)); - log("f_build_pki_secured_request_message_signed_with_pop: v_tbs_signed= ", v_tbs_signed); - if (p_alter_signature == true) { - v_tbs_signed[0] := '0A'O; - v_tbs_signed[1] := '0A'O; - log("f_build_pki_secured_request_message_signed_with_pop: Altered signature= ", v_tbs_signed); - } - // Add the signature and create EtsiTs103097Data-Signed data structure - log("f_build_pki_secured_request_message_signed_with_pop: PX_VE_ALG=", PX_VE_ALG); - if (PX_VE_ALG == e_nist_p256) { - v_signature := valueof( - m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_tbs_signed, 0, 32) - ), - substr(v_tbs_signed, 32, 32) - ) - ) - ); - } else if (PX_VE_ALG == e_brainpool_p256_r1) { - v_signature := valueof( - m_signature_ecdsaBrainpoolP256r1( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_tbs_signed, 0, 32) - ), - substr(v_tbs_signed, 32, 32) - ) - ) - ); - } else if (PX_VE_ALG == e_brainpool_p384_r1) { - v_signature := valueof( - m_signature_ecdsaBrainpoolP384r1( - m_ecdsaP384Signature( - m_eccP384CurvePoint_x_only( - substr(v_tbs_signed, 0, 48) - ), - substr(v_tbs_signed, 48, 48) - ) - ) - ); - } - log("f_build_pki_secured_request_message_signed_with_pop: v_signature= ", v_signature); - v_ieee1609dot2_signed_data := m_etsiTs103097Data_signed( - m_signedData( - sha256, - v_tbs, - p_signer_identifier, - v_signature - ) - ); - // Encode EtsiTs103097Data-Signed data structure - v_encoded_request := bit2oct(encvalue(v_ieee1609dot2_signed_data)); - log("f_build_pki_secured_request_message_signed_with_pop: v_encoded_request= ", v_encoded_request); - // Encrypt encode EtsiTs103097Data-Signed data structure - - if (p_enc_algorithm == e_nist_p256) { - v_encrypted_request := f_encryptWithEciesNistp256WithSha256(v_encoded_request, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); - } else if (p_enc_algorithm == e_brainpool_p256_r1) { - v_encrypted_request := f_encryptWithEciesBrainpoolp256r1WithSha256(v_encoded_request, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); - } else { - log("f_build_pki_secured_request_message_signed_with_pop: Wrong encryption variant"); - return false; - } - log("f_build_pki_secured_request_message_signed_with_pop: p_aes_sym_key= ", p_aes_sym_key); - log("f_build_pki_secured_request_message_signed_with_pop: p_encrypted_sym_key= ", p_encrypted_sym_key); - log("f_build_pki_secured_request_message_signed_with_pop: p_authentication_vector= ", p_authentication_vector); - log("f_build_pki_secured_request_message_signed_with_pop: p_nonce= ", p_nonce); - log("f_build_pki_secured_request_message_signed_with_pop: p_recipientId= ", p_recipientId); - if (p_recipientId == int2oct(0, 8)) { - log("f_build_pki_secured_request_message_signed_with_pop: f_hashWithSha256(v_encrypted_sym_key)= ", f_hashWithSha256(p_encrypted_sym_key)); - v_recipientId := f_hashedId8FromSha256(f_hashWithSha256(p_encrypted_sym_key)); - } else { - v_recipientId := p_recipientId; - } - log("f_build_pki_secured_request_message_signed_with_pop: v_recipientId= ", v_recipientId); - // Fill Certificate template with the public compressed keys (canonical form) - if (v_public_compressed_ephemeral_mode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); - } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_compressed_ephemeral_key)); - } - if (p_enc_algorithm == e_nist_p256) { - v_encrypted_data_encryption_key := valueof( - m_encryptedDataEncryptionKey_eciesNistP256( - m_evciesP256EncryptedKey( - v_eccP256_curve_point, - p_encrypted_sym_key, - p_authentication_vector - ))); - } else if (p_enc_algorithm == e_brainpool_p256_r1) { - v_encrypted_data_encryption_key := valueof( - m_encryptedDataEncryptionKey_eciesBrainpoolP256r1( - m_evciesP256EncryptedKey( - v_eccP256_curve_point, - p_encrypted_sym_key, - p_authentication_vector - ))); - } else { - log("f_build_pki_secured_request_message_signed_with_pop: Wrong encryption variant"); - return false; - } - - p_ieee1609dot2_signed_and_encrypted_data := valueof( - m_etsiTs103097Data_encrypted( - m_encryptedData( - { - m_recipientInfo_certRecipInfo( - m_pKRecipientInfo( - v_recipientId, - v_encrypted_data_encryption_key - )) - }, - m_SymmetricCiphertext_aes128ccm( - m_aesCcmCiphertext( - p_nonce, - v_encrypted_request - ) - ) - ) - ) - ); - - // The 'p_request_hash' shall be the SHA256 digest of the OER representation of the topmost EtsiTs103097Data-Encoded structure - v_enc_value := encvalue(p_ieee1609dot2_signed_and_encrypted_data); - p_request_hash := f_hashWithSha256(bit2oct(v_enc_value)); - log("f_build_pki_secured_request_message_signed_with_pop: p_request_hash= ", p_request_hash); - - log("<<< f_build_pki_secured_request_message_signed_with_pop: ", p_pki_message); - return true; - } // End of function f_build_pki_secured_request_message_signed_with_pop - - /** - * @desc Build a signed and encrypted PKI request message without POP with signature - * @param p_recipientId Recipient identifier to be inclued in encrypted layer. - * If value is int2oct(0. 8), the recipient id is the HashedId8 of the symmetric key used by the sender to encrypt the message to which the response is built - * @param p_public_key_compressed The public compressed key (canonical form) for encryption - * @param p_compressed_mode The compressed mode of the public compressed key (canonical form) for encryption - * @param p_pki_message The PKI message to be secured - * @param p_ieee1609dot2_signed_and_encrypted_data The secured message - * @return true on success, false otherwise - */ - function f_build_pki_secured_request_message( - in HashedId8 p_recipientId, - in octetstring p_public_key_compressed, - in integer p_compressed_mode, - in octetstring p_salt, - in octetstring p_pki_message, - in SecurityAlg p_enc_algorithm, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce, - out Oct32 p_request_hash - ) return boolean { - // Local variables - var template (value) EccP256CurvePoint v_eccP256_curve_point; - var HashedId8 v_recipientId; - var octetstring v_public_compressed_ephemeral_key; - var integer v_public_compressed_ephemeral_mode; - var octetstring v_encrypted_request; - var EncryptedDataEncryptionKey v_encrypted_data_encryption_key; - var bitstring v_enc_value; - - log(">>> f_build_pki_secured_request_message"); - - // Encrypt encode EtsiTs103097Data-Signed data structure - if (p_enc_algorithm == e_nist_p256) { - v_encrypted_request := f_encryptWithEciesNistp256WithSha256(p_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); - } else if (p_enc_algorithm == e_brainpool_p256_r1) { - v_encrypted_request := f_encryptWithEciesBrainpoolp256r1WithSha256(p_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); - } else { - log("f_build_pki_secured_request_message: Wrong encryption variant"); - return false; - } - log("f_build_pki_secured_request_message: p_aes_sym_key= ", p_aes_sym_key); - log("f_build_pki_secured_request_message: p_encrypted_sym_key= ", p_encrypted_sym_key); - log("f_build_pki_secured_request_message: p_authentication_vector= ", p_authentication_vector); - log("f_build_pki_secured_request_message: p_nonce= ", p_nonce); - log("f_build_pki_secured_request_message: p_recipientId= ", p_recipientId); - if (p_recipientId == int2oct(0, 8)) { - log("f_build_pki_secured_request_message: f_hashWithSha256(v_encrypted_sym_key)= ", f_hashWithSha256(p_encrypted_sym_key)); - v_recipientId := f_hashedId8FromSha256(f_hashWithSha256(p_encrypted_sym_key)); - } else { - v_recipientId := p_recipientId; - } - log("f_build_pki_secured_request_message: v_recipientId= ", v_recipientId); - // Fill Certificate template with the public compressed keys (canonical form) - if (v_public_compressed_ephemeral_mode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); - } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_compressed_ephemeral_key)); - } - if (p_enc_algorithm == e_nist_p256) { - v_encrypted_data_encryption_key := valueof( - m_encryptedDataEncryptionKey_eciesNistP256( - m_evciesP256EncryptedKey( - v_eccP256_curve_point, - p_encrypted_sym_key, - p_authentication_vector - ))); - } else if (p_enc_algorithm == e_brainpool_p256_r1) { - v_encrypted_data_encryption_key := valueof( - m_encryptedDataEncryptionKey_eciesBrainpoolP256r1( - m_evciesP256EncryptedKey( - v_eccP256_curve_point, - p_encrypted_sym_key, - p_authentication_vector - ))); - } - p_ieee1609dot2_signed_and_encrypted_data := valueof( - m_etsiTs103097Data_encrypted( - m_encryptedData( - { - m_recipientInfo_certRecipInfo( - m_pKRecipientInfo( - v_recipientId, - v_encrypted_data_encryption_key - )) - }, - m_SymmetricCiphertext_aes128ccm( - m_aesCcmCiphertext( - p_nonce, - v_encrypted_request - ) - ) - ) - ) - ); - - // The 'p_request_hash' shall be the SHA256 digest of the OER representation of the topmost EtsiTs103097Data-Encoded structure - v_enc_value := encvalue(p_ieee1609dot2_signed_and_encrypted_data); - p_request_hash := f_hashWithSha256(bit2oct(v_enc_value)); - log("f_build_pki_secured_request_message: p_request_hash= ", p_request_hash); - - log("<<< f_build_pki_secured_request_message: ", p_ieee1609dot2_signed_and_encrypted_data); - return true; - } // End of function f_build_pki_secured_request_message - - function f_build_pki_secured_request_message_for_authorization( - in HashedId8 p_recipientId, - in octetstring p_public_key_compressed, - in integer p_compressed_mode, - in octetstring p_salt, - in octetstring p_pki_message, - in SecurityAlg p_enc_algorithm, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce, - out Oct32 p_request_hash - ) return boolean { - // Local variables - var Ieee1609Dot2Data v_unsecured_data; - var octetstring v_pki_message; - var template (value) EccP256CurvePoint v_eccP256_curve_point; - var HashedId8 v_recipientId; - var octetstring v_public_compressed_ephemeral_key; - var integer v_public_compressed_ephemeral_mode; - var octetstring v_encrypted_request; - var EncryptedDataEncryptionKey v_encrypted_data_encryption_key; - var bitstring v_enc_value; - - log(">>> f_build_pki_secured_request_message_for_authorization"); - - // Add Ieee1609Dot2Data layer - v_unsecured_data := valueof(m_etsiTs103097Data_unsecured(p_pki_message)); - v_pki_message := bit2oct(encvalue(v_unsecured_data)); - - // Encrypt encode EtsiTs103097Data-Signed data structure - if (p_enc_algorithm == e_nist_p256) { - v_encrypted_request := f_encryptWithEciesNistp256WithSha256(v_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); - } else if (p_enc_algorithm == e_brainpool_p256_r1) { - v_encrypted_request := f_encryptWithEciesBrainpoolp256r1WithSha256(v_pki_message, p_public_key_compressed, p_compressed_mode, p_salt, v_public_compressed_ephemeral_key, v_public_compressed_ephemeral_mode, p_aes_sym_key, p_encrypted_sym_key, p_authentication_vector, p_nonce); - } else { - log("f_build_pki_secured_request_message_for_authorization: Wrong encryption variant"); - return false; - } - log("f_build_pki_secured_request_message_for_authorization: p_aes_sym_key= ", p_aes_sym_key); - log("f_build_pki_secured_request_message_for_authorization: p_encrypted_sym_key= ", p_encrypted_sym_key); - log("f_build_pki_secured_request_message_for_authorization: p_authentication_vector= ", p_authentication_vector); - log("f_build_pki_secured_request_message_for_authorization: p_nonce= ", p_nonce); - log("f_build_pki_secured_request_message_for_authorization: p_recipientId= ", p_recipientId); - if (p_recipientId == int2oct(0, 8)) { - log("f_build_pki_secured_request_message_for_authorization: f_hashWithSha256(v_encrypted_sym_key)= ", f_hashWithSha256(p_encrypted_sym_key)); - v_recipientId := f_hashedId8FromSha256(f_hashWithSha256(p_encrypted_sym_key)); - } else { - v_recipientId := p_recipientId; - } - log("f_build_pki_secured_request_message_for_authorization: v_recipientId= ", v_recipientId); - // Fill Certificate template with the public compressed keys (canonical form) - if (v_public_compressed_ephemeral_mode == 0) { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_0(v_public_compressed_ephemeral_key)); - } else { - v_eccP256_curve_point := valueof(m_eccP256CurvePoint_compressed_y_1(v_public_compressed_ephemeral_key)); - } - if (p_enc_algorithm == e_nist_p256) { - v_encrypted_data_encryption_key := valueof( - m_encryptedDataEncryptionKey_eciesNistP256( - m_evciesP256EncryptedKey( - v_eccP256_curve_point, - p_encrypted_sym_key, - p_authentication_vector - ))); - } else if (p_enc_algorithm == e_brainpool_p256_r1) { - v_encrypted_data_encryption_key := valueof( - m_encryptedDataEncryptionKey_eciesBrainpoolP256r1( - m_evciesP256EncryptedKey( - v_eccP256_curve_point, - p_encrypted_sym_key, - p_authentication_vector - ))); - } - p_ieee1609dot2_signed_and_encrypted_data := valueof( - m_etsiTs103097Data_encrypted( - m_encryptedData( - { - m_recipientInfo_certRecipInfo( - m_pKRecipientInfo( - v_recipientId, - v_encrypted_data_encryption_key - )) - }, - m_SymmetricCiphertext_aes128ccm( - m_aesCcmCiphertext( - p_nonce, - v_encrypted_request - ) - ) - ) - ) - ); - - // The 'p_request_hash' shall be the SHA256 digest of the OER representation of the topmost EtsiTs103097Data-Encoded structure - v_enc_value := encvalue(p_ieee1609dot2_signed_and_encrypted_data); - p_request_hash := f_hashWithSha256(bit2oct(v_enc_value)); - log("f_build_pki_secured_request_message_for_authorization: p_request_hash= ", p_request_hash); - - log("<<< f_build_pki_secured_request_message_for_authorization: ", p_ieee1609dot2_signed_and_encrypted_data); - return true; - } // End of function f_build_pki_secured_request_message_for_authorization - - /** - * @desc Build a signed and encrypted PKI response message - * @param p_private_key Private key for signature - * @param p_signer_identifier Signer identifier for signature, could be self or certificate HashedId8 - * @param p_recipientId Recipient identifier to be inclued in encrypted layer. - * If value is int2oct(0. 8), the recipient id is the HashedId8 of the symmetric key used by the sender to encrypt the message to which the response is built - * @param p_public_key_compressed The public compressed key (canonical form) for encryption - * @param p_compressed_mode The compressed mode of the public compressed key (canonical form) for encryption - * @param p_pki_message The PKI message to be secured - * @param p_ieee1609dot2_signed_and_encrypted_data The secured message - * @return true on success, false otherwise - */ - function f_build_pki_secured_response_message( - in octetstring p_private_key, - in SignerIdentifier p_signer_identifier, - in octetstring p_pki_message, - in Oct16 p_aes_sym_key, - in Oct12 p_nonce, - out Ieee1609Dot2Data p_ieee1609dot2_signed_and_encrypted_data - ) return boolean { - // Local variables - var template (value) ToBeSignedData v_tbs; - var octetstring v_tbs_signed; - var template (value) Ieee1609Dot2Data v_ieee1609dot2_signed_data; - var octetstring v_encoded_inner_ec_response; - var HashedId8 v_recipientId; - var octetstring v_encrypted_inner_ec_response; - - // Signed the encoded PKI message - v_tbs := m_toBeSignedData( - m_signedDataPayload( - m_etsiTs103097Data_unsecured(p_pki_message) - ), - m_headerInfo_inner_pki_response(-, (f_getCurrentTime() * 1000)/*us*/) - ); - if (ischosen(p_signer_identifier.self_)) { - v_tbs_signed := f_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), int2oct(0, 32), p_private_key); - } else { - var charstring v_certificate_id; - var Oct32 v_hash; - fx_readCertificateFromDigest(p_signer_identifier.digest, v_certificate_id); // TODO Add a wrapper function - f_getCertificateHash(v_certificate_id, v_hash); - v_tbs_signed := f_signWithEcdsaNistp256WithSha256(bit2oct(encvalue(v_tbs)), v_hash, p_private_key); - } - // Add the signature and create EtsiTs103097Data-Signed data structure - v_ieee1609dot2_signed_data := m_etsiTs103097Data_signed( - m_signedData( - sha256, - v_tbs, - p_signer_identifier, - m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only( - substr(v_tbs_signed, 0, 32) - ), - substr(v_tbs_signed, 32, 32) - ) - ) - ) - ); - // Encode EtsiTs103097Data-Signed data structure - v_encoded_inner_ec_response := bit2oct(encvalue(v_ieee1609dot2_signed_data)); - v_encrypted_inner_ec_response := fx_encrypt_aes_128_ccm_test(p_aes_sym_key, p_nonce, v_encoded_inner_ec_response); - v_recipientId := f_hashedId8FromSha256(f_hashWithSha256(p_aes_sym_key)); - log("v_recipientId= ", v_recipientId); - // Fill Certificate template with the public compressed keys (canonical form) - p_ieee1609dot2_signed_and_encrypted_data := valueof( - m_etsiTs103097Data_encrypted( - m_encryptedData( - { - m_recipientInfo_pskRecipInfo( - v_recipientId - ) - }, - m_SymmetricCiphertext_aes128ccm( - m_aesCcmCiphertext( - p_nonce, - v_encrypted_inner_ec_response - ) - ) - ) - ) - ); - - log("<<< f_build_pki_secured_response_message: ", p_ieee1609dot2_signed_and_encrypted_data); - return true; - } // End of function f_build_pki_secured_response_message - - /** - * @desc Verify the protocol element of the Pki message. - * If p_check_security is set to false, only decryption and decoding of the outer message are verified. - * @param p_private_enc_key Private key for decryption - * @param p_salt - * @param p_p_ieee1609dot2_encrypted_and_signed_data - * @param p_check_security Set to true to verify PKI protocol element such as signatures... - * @param p_request_hash The request hash for to be used to build the response - * @param p_etsi_ts_102941_data The EtsiTs102941Data message - * @param p_aes_enc_key The AES 128 encrytion key to be used to encrypt the response - * @return true on success, false otherwise - */ - function f_verify_pki_request_message( - in Oct32 p_private_enc_key, - in Oct32 p_salt, - in octetstring p_issuer, - in Ieee1609Dot2Data p_ieee1609dot2_encrypted_and_signed_data, - in boolean p_check_security := true, - out Oct16 p_request_hash, - out EtsiTs102941Data p_etsi_ts_102941_data, - out Oct16 p_aes_enc_key - ) return boolean { - // Local variables - var bitstring v_msg_bit; - var octetstring v_msg; - var Ieee1609Dot2Data v_ieee1609dot2_signed_data; - var Certificate v_certificate; - var charstring v_certificate_id; - - log(">>> f_verify_pki_request_message: p_private_enc_key= ", p_private_enc_key); - log(">>> f_verify_pki_request_message: p_salt= ", p_salt); - log(">>> f_verify_pki_request_message: p_issuer= ", p_issuer); - log(">>> f_verify_pki_request_message: p_ieee1609dot2_encrypted_and_signed_data= ", p_ieee1609dot2_encrypted_and_signed_data); - - // 1. Calculate the request Hash - v_msg := bit2oct(encvalue(p_ieee1609dot2_encrypted_and_signed_data)); - log("f_verify_pki_request_message: Encoded request: ", v_msg); - p_request_hash := substr(f_hashWithSha256(v_msg), 0, 16); - log("f_verify_pki_request_message: p_request_hash= ", p_request_hash); - - // 2. Decrypt the InnerEcRequest - log("f_verify_pki_request_message: p_private_enc_key= ", p_private_enc_key); - if (f_decrypt(p_private_enc_key, p_ieee1609dot2_encrypted_and_signed_data, p_salt, v_ieee1609dot2_signed_data, p_aes_enc_key) == false) { - log("f_verify_pki_request_message: Failed to decrypt message"); - return false; - } - log("f_verify_pki_request_message: v_ieee1609dot2_signed_data= ", v_ieee1609dot2_signed_data); - log("f_verify_pki_request_message: p_aes_enc_key= ", p_aes_enc_key); - - // 3. Check basics security - log( - match( - v_ieee1609dot2_signed_data, - mw_etsiTs103097Data_signed( - mw_signedData( - -, - mw_toBeSignedData( - mw_signedDataPayload, - mw_ieee1609Dot2_headerInfo(c_its_aid_SCR) - ) - ) - ))); - if (match(v_ieee1609dot2_signed_data, mw_etsiTs103097Data_signed(mw_signedData(-, mw_toBeSignedData(mw_signedDataPayload)))) == false) { - log("f_verify_pki_request_message: Failed to check basic security"); - if (p_check_security == true) { - return false; - } - } - - // 4. Verifiy signature - log("f_verify_pki_request_message: v_ieee1609dot2_signed_data.content.signedData.tbsData= ", v_ieee1609dot2_signed_data.content.signedData.tbsData); - v_msg := bit2oct(encvalue(v_ieee1609dot2_signed_data.content.signedData.tbsData)); - log("f_verify_pki_request_message: v_msg= ", v_msg); - if (p_issuer == ''O) { // self - log("f_verify_pki_request_message: Issuer is self, check outer signature using IUT public key (PICS_ITS_S_SIGN_xxx_PUBLIC_KEY)"); - var PublicVerificationKey v_verification_key; - - log("f_verify_pki_request_message: PX_VE_ALG=", PX_VE_ALG); - if (PX_VE_ALG == e_nist_p256) { - if (PICS_ITS_S_SIGN_NISTP256_PUBLIC_KEY[0] == '02'O) { - v_verification_key.ecdsaNistP256.compressed_y_0 := substr(PICS_ITS_S_SIGN_NISTP256_PUBLIC_KEY, 1, 32); - } else { - v_verification_key.ecdsaNistP256.compressed_y_1 := substr(PICS_ITS_S_SIGN_NISTP256_PUBLIC_KEY, 1, 32); - } - } else if (PX_VE_ALG == e_brainpool_p256_r1) { - if (PICS_ITS_S_SIGN_BRAINPOOLP256r1_PUBLIC_KEY[0] == '02'O) { - v_verification_key.ecdsaBrainpoolP256r1.compressed_y_0 := substr(PICS_ITS_S_SIGN_BRAINPOOLP256r1_PUBLIC_KEY, 1, 32); - } else { - v_verification_key.ecdsaBrainpoolP256r1.compressed_y_1 := substr(PICS_ITS_S_SIGN_BRAINPOOLP256r1_PUBLIC_KEY, 1, 32); - } - } else if (PX_VE_ALG == e_brainpool_p384_r1) { - if (PICS_ITS_S_SIGN_BRAINPOOLP384r1_PUBLIC_KEY[0] == '02'O) { - v_verification_key.ecdsaBrainpoolP384r1.compressed_y_0 := substr(PICS_ITS_S_SIGN_BRAINPOOLP384r1_PUBLIC_KEY, 1, 48); - } else { - v_verification_key.ecdsaBrainpoolP384r1.compressed_y_1 := substr(PICS_ITS_S_SIGN_BRAINPOOLP384r1_PUBLIC_KEY, 1, 48); - } - } - log("f_verify_pki_request_message: v_verification_key=", v_verification_key); - if (f_verifyEcdsa(v_msg, int2oct(0, 32), v_ieee1609dot2_signed_data.content.signedData.signature_, v_verification_key) == false) { - if (p_check_security == true) { - return false; - } - } - //return false; - } else { - if (f_getCertificateFromDigest(f_hashedId8FromSha256(p_issuer), v_certificate, v_certificate_id) == false) { - if (p_check_security == true) { - return false; - } - } - log("f_verify_pki_request_message: v_certificate= ", v_certificate); - if (f_verifyEcdsa(v_msg, p_issuer, v_ieee1609dot2_signed_data.content.signedData.signature_, v_certificate.toBeSigned.verifyKeyIndicator.verificationKey) == false) { - if (p_check_security == true) { - return false; - } - } - } - - // 4. Return the PKI message - log("f_verify_pki_request_message: v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData= ", v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); - v_msg_bit := oct2bit(v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); - if (decvalue(v_msg_bit, p_etsi_ts_102941_data) != 0) { - if (p_check_security == true) { - return false; - } - } - if (p_etsi_ts_102941_data.version != PkiProtocolVersion) { - if (p_check_security == true) { - return false; - } - } - - log("<<< f_verify_pki_request_message: true"); - return true; - } // End of function f_verify_pki_request_message - - /** - * @desc Verify the protocol element of the Pki message. - * If p_check_security is set to false, only decryption and decoding of the outer message are verified. - * @param p_private_key Private key for decryption - * @param p_publicEphemeralCompressedKey - * @param p_publicEphemeralCompressedKeyMode - * @param p_issuer Issuer - * @param p_certificate Certificate to use for verification key - * @param p_ieee1609dot2_encrypted_and_signed_data The received encrypted and signed data - * @param p_check_security Set to true to verify PKI protocol element such as signatures... - * @param p_response_type Response type (0: InnerEcResponse, 1: InnerAtResponse...). Default: 0 - * @param p_etsi_ts_102941_data The EtsiTs102941Data message - * @return true on success, false otherwise - */ - function f_verify_pki_response_message( - in octetstring p_private_enc_key, - in Oct16 p_aes_sym_key, - in Oct16 p_authentication_vector, // TODO Tobe removed - in octetstring p_issuer, - in Ieee1609Dot2Data p_ieee1609dot2_encrypted_and_signed_data, - in boolean p_check_security := true, - in integer p_response_type := 0, - out EtsiTs102941Data p_etsi_ts_102941_data - ) return boolean { - // Local variables - var octetstring v_public_enc_key; - var integer v_compressed_enc_key_mode; - var octetstring v_plain_message; - var Ieee1609Dot2Data v_ieee1609dot2_signed_data; - var Certificate v_certificate; - var charstring v_certificate_id; - var bitstring v_etsi_ts_102941_data_msg; - var bitstring v_tbs; - var boolean v_ret; - - log(">>> f_verify_pki_response_message: p_private_enc_key= ", p_private_enc_key); - log(">>> f_verify_pki_response_message: p_aes_sym_key= ", p_aes_sym_key); - log(">>> f_verify_pki_response_message: p_authentication_vector= ", p_authentication_vector); - log(">>> f_verify_pki_response_message: p_issuer= ", p_issuer); - log(">>> f_verify_pki_response_message: p_check_security= ", p_check_security); - log(">>> f_verify_pki_response_message: p_response_type= ", p_response_type); - - // TODO Check p_ieee1609dot2_encrypted_and_signed_data.content.encryptedData.recipients[0].pskRecipInfo. See IEEE Std 1609.2-2017 Clause 6.3.34 PreSharedKeyRecipientInfo - - // 1. Decrypt the data - v_plain_message := fx_decrypt_aes_128_ccm_test(p_aes_sym_key, p_ieee1609dot2_encrypted_and_signed_data.content.encryptedData.ciphertext.aes128ccm.nonce, p_ieee1609dot2_encrypted_and_signed_data.content.encryptedData.ciphertext.aes128ccm.ccmCiphertext); - if (isbound(v_plain_message) == false) { - return false; - } - log("f_verify_pki_response_message: v_plain_message= ", v_plain_message); - - // 2. Decode it - v_tbs := oct2bit(v_plain_message); - if (decvalue(v_tbs, v_ieee1609dot2_signed_data) != 0) { - return false; - } - log("f_verify_pki_response_message: v_ieee1609dot2_signed_data= ", v_ieee1609dot2_signed_data); - - // 3. Check the signature - log("f_verify_pki_response_message: v_ieee1609dot2_signed_data.content.signedData.tbsData= ", v_ieee1609dot2_signed_data.content.signedData.tbsData); - v_tbs := encvalue(v_ieee1609dot2_signed_data.content.signedData.tbsData); - if (f_getCertificateFromDigest(v_ieee1609dot2_signed_data.content.signedData.signer.digest, v_certificate, v_certificate_id) == false) { - if (p_check_security == true) { - return false; - } - } - if (f_verifyEcdsa(bit2oct(v_tbs), p_issuer, v_ieee1609dot2_signed_data.content.signedData.signature_, v_certificate.toBeSigned.verifyKeyIndicator.verificationKey) == false) { - if (p_check_security == true) { - return false; - } - } - - // 4. Verify EtsiTs103097Data-Signed HeaderInfo - // TODO Parameter p_response_type seems to be useless - if ((p_response_type == 0) or (p_response_type == 1)) { // InnerEcResponse & InnerAtResponse - log("f_verify_pki_response_message: headerInfo matching= ", match(v_ieee1609dot2_signed_data.content.signedData.tbsData.headerInfo, mw_headerInfo_inner_pki_response)); - if (match(v_ieee1609dot2_signed_data.content.signedData.tbsData.headerInfo, mw_headerInfo_inner_pki_response) == false) { - if (p_check_security == true) { - return false; - } - } - } // else, no check - - // 5. Return the PKI message - log("f_verify_pki_response_message: v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData= ", v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); - v_etsi_ts_102941_data_msg := oct2bit(v_ieee1609dot2_signed_data.content.signedData.tbsData.payload.data.content.unsecuredData); - if (decvalue(v_etsi_ts_102941_data_msg, p_etsi_ts_102941_data) != 0) { - return false; - } - - if (p_etsi_ts_102941_data.version != PkiProtocolVersion) { - return false; - } - - return true; - } // End of function f_verify_pki_response_message - - /** - * @desc Verify the EC certificate generated by the EA entity - * @param p_ec_certificate The new EC certificate - * @param p_ea_certificate The certificate issuer - * @param p_public_key_compressed The public compressed key (canonical form) generated for the InnerEcRequest - * @param p_compressed_mode The public compressed key mode - * @return true on success, false otherwise - */ - function f_verify_ec_certificate( - in Certificate p_ec_certificate, - in Certificate p_ea_certificate, - in HashedId8 p_ea_hashed_id8, - in octetstring p_public_key_compressed, - in integer p_compressed_mode - ) return boolean { - var bitstring v_encoded_cert; - var Oct32 v_ec_cert_hash; - var HashedId8 v_ec_cert_hashed_id8; - - // Calculate the HashedId8 of the whole certificate - v_encoded_cert := encvalue(p_ec_certificate); - v_ec_cert_hash := f_hashWithSha256(bit2oct(v_encoded_cert)); - log("f_verify_ec_certificate: ==> EC certificate Hash: ", v_ec_cert_hash); - v_ec_cert_hashed_id8 := f_hashedId8FromSha256(v_ec_cert_hash); - log("f_verify_ec_certificate: ==> EC certificate HashedId8: ", v_ec_cert_hashed_id8); - - // Check the signer - log("f_verify_ec_certificate: Check the signer: ", match(p_ec_certificate.issuer, m_issuerIdentifier_sha256AndDigest(p_ea_hashed_id8))); - log("f_verify_ec_certificate: Check the signer: ", match(p_ec_certificate.issuer, m_issuerIdentifier_sha384AndDigest(p_ea_hashed_id8))); - if ( - (match(p_ec_certificate.issuer, m_issuerIdentifier_sha256AndDigest(p_ea_hashed_id8)) == false) and - (match(p_ec_certificate.issuer, m_issuerIdentifier_sha384AndDigest(p_ea_hashed_id8)) == false) - ) { - log("f_verify_ec_certificate: Wrong issuer"); - return false; - } - - // Check EC certificate signature - if (f_verifyCertificateSignatureWithPublicKey(p_ec_certificate, p_ea_certificate.toBeSigned.verifyKeyIndicator.verificationKey) == false) { - log("f_verify_ec_certificate: Signature not verified"); - return false; - } - - // TODO Check that requested information are present - - if (f_verifySspPermissions(p_ec_certificate.toBeSigned.appPermissions, p_ea_certificate.toBeSigned.appPermissions) == false) { - log("f_verify_ec_certificate: Ssp permissions not verified"); - return false; - } - - return true; - } // End of function f_verify_ec_certificate - - /** - * @desc Verify the generated AT certificate - * @param p_at_certificate The new AT certificate - * @param p_ea_certificate The certificate issuer - * @param p_public_key_compressed The public compressed key (canonical form) generated for the InnerAtRequest - * @param p_compressed_mode The public compressed key mode - * @return true on success, false otherwise - */ - function f_verify_at_certificate( - in Certificate p_at_certificate, - in Certificate p_aa_certificate, - in octetstring p_public_key_compressed, - in integer p_compressed_mode - ) return boolean { - var bitstring v_encoded_cert; - var HashedId8 v_at_cert_hashed_id8; - - // Calculate the HashedId8 of the whole certificate - v_encoded_cert := encvalue(p_at_certificate); - v_at_cert_hashed_id8 := f_hashedId8FromSha256(f_hashWithSha256(bit2oct(v_encoded_cert))); - log("f_verify_at_certificate: EC certificate HashedId8: ", v_at_cert_hashed_id8); - - // Check the signer - log("f_verify_at_certificate: ", match(p_at_certificate.issuer, mw_issuerIdentifier_self())); - if (match(p_at_certificate.issuer, mw_issuerIdentifier_self)) { - return false; - } - - // Check EC certificate signature - if (f_verifyCertificateSignatureWithPublicKey(p_at_certificate, p_aa_certificate.toBeSigned.verifyKeyIndicator.verificationKey) == false) { - log("f_verify_at_certificate: Signature not verified"); - return false; - } - - // TODO Check that requested information are present - - if (f_verifySspPermissions(p_aa_certificate.toBeSigned.appPermissions, p_at_certificate.toBeSigned.appPermissions) == false) { - log("f_verify_ec_certificate: Ssp permissions not verified"); - return false; - } - - return true; - } // End of function f_verify_at_certificate - - } // End of group inner_ec_xxx - - group security_function { // TODO To be moved in LibItsSecurity_Function module - - function f_extract_enc_key( - in Certificate p_certificate, - out octetstring p_public_enc_key, - out integer p_compressed_enc_key_mode - ) return boolean { - log(">>> f_extract_enc_key: ", p_certificate); - - if (ischosen(p_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256)) { - if (ischosen(p_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0)) { - p_public_enc_key := p_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_0; - p_compressed_enc_key_mode := 0; - } else if (ischosen(p_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_1)) { - p_public_enc_key := p_certificate.toBeSigned.encryptionKey.publicKey.eciesNistP256.compressed_y_1; - p_compressed_enc_key_mode := 1; - } else { - log("f_extract_enc_key: Non canonical certificate: ", p_certificate); - return false; - } - } else if (ischosen(p_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1)) { - if (ischosen(p_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0)) { - p_public_enc_key := p_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_0; - p_compressed_enc_key_mode := 0; - } else if (ischosen(p_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_1)) { - p_public_enc_key := p_certificate.toBeSigned.encryptionKey.publicKey.eciesBrainpoolP256r1.compressed_y_1; - p_compressed_enc_key_mode := 0; - } else { - log("f_extract_enc_key: Non canonical certificate: ", p_certificate); - return false; - } - } else { - log("f_extract_enc_key: Invalid certificate: ", p_certificate); - return false; - } - - return true; - } // End of function f_extract_enc_key - - } // End of group security_function - - group altsteps { - - altstep a_default_pki_http() runs on ItsPkiHttp { - [not(PICS_MULTIPLE_END_POINT)] httpPort.receive( - mw_http_response( - mw_http_response_ko - )) { - tc_ac.stop; - - log("*** " & testcasename() & ": FAIL: Unexpected message received ***"); - f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); - } - [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(mw_http_request) { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP Request received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(mw_http_response) { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP Response received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [not(PICS_MULTIPLE_END_POINT)] httpPort.receive { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP message received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] a_shutdown() { - log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } // End of altstep a_default_pki_http - - altstep a_default_pki_http_ec() runs on ItsPkiHttp { - [PICS_MULTIPLE_END_POINT] httpEcPort.receive( - mw_http_response( - mw_http_response_ko - )) { - tc_ac.stop; - - log("*** " & testcasename() & ": FAIL: Unexpected message received ***"); - f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); - } - [PICS_MULTIPLE_END_POINT] httpEcPort.receive(mw_http_request) { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP Request received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [PICS_MULTIPLE_END_POINT] httpEcPort.receive(mw_http_response) { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP Response received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [PICS_MULTIPLE_END_POINT] httpEcPort.receive { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP message received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] a_shutdown() { - log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } // End of altstep a_default_pki_http_ec - - altstep a_default_pki_http_atv() runs on ItsPkiHttp { - [PICS_MULTIPLE_END_POINT] httpAtVPort.receive( - mw_http_response( - mw_http_response_ko - )) { - tc_ac.stop; - - log("*** " & testcasename() & ": FAIL: Unexpected message received ***"); - f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); - } - [PICS_MULTIPLE_END_POINT] httpAtVPort.receive(mw_http_request) { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP Request received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [PICS_MULTIPLE_END_POINT] httpAtVPort.receive(mw_http_response) { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP Response received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [PICS_MULTIPLE_END_POINT] httpAtVPort.receive { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP message received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] a_shutdown() { - log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } // End of altstep a_default_pki_http_atv - - altstep a_default_pki_http_at() runs on ItsPkiHttp { - [PICS_MULTIPLE_END_POINT] httpAtPort.receive( - mw_http_response( - mw_http_response_ko - )) { - tc_ac.stop; - - log("*** " & testcasename() & ": FAIL: Unexpected message received ***"); - f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); - } - [PICS_MULTIPLE_END_POINT] httpAtPort.receive(mw_http_request) { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP Request received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [PICS_MULTIPLE_END_POINT] httpAtPort.receive(mw_http_response) { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP Response received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [PICS_MULTIPLE_END_POINT] httpAtPort.receive { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP message received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] a_shutdown() { - log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } // End of altstep a_default_pki_http_at - - altstep a_default_pki_http_ca() runs on ItsPkiHttp { - [PICS_MULTIPLE_END_POINT] httpCaPort.receive( - mw_http_response( - mw_http_response_ko - )) { - tc_ac.stop; - - log("*** " & testcasename() & ": FAIL: Unexpected message received ***"); - f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); - } - [PICS_MULTIPLE_END_POINT] httpCaPort.receive(mw_http_request) { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP Request received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [PICS_MULTIPLE_END_POINT] httpCaPort.receive(mw_http_response) { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP Response received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [PICS_MULTIPLE_END_POINT] httpCaPort.receive { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP message received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] a_shutdown() { - log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } // End of altstep a_default_pki_http_ca - - altstep a_default_pki_http_tlm() runs on ItsPkiHttp { - [PICS_MULTIPLE_END_POINT] httpTlmPort.receive( - mw_http_response( - mw_http_response_ko - )) { - tc_ac.stop; - - log("*** " & testcasename() & ": FAIL: Unexpected message received ***"); - f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); - } - [PICS_MULTIPLE_END_POINT] httpTlmPort.receive(mw_http_request) { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP Request received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [PICS_MULTIPLE_END_POINT] httpTlmPort.receive(mw_http_response) { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP Response received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [PICS_MULTIPLE_END_POINT] httpTlmPort.receive { - tc_ac.stop; - log("*** a_default: ERROR: Unexpected HTTP message received ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] a_shutdown() { - log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } // End of altstep a_default_pki_http_tlm - - altstep a_await_ec_http_request_from_iut( - template HttpMessage p_http_message, - out HttpMessage p_response - ) runs on ItsPkiHttp { - [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_response { - log("a_await_ec_http_request_from_iut: Received message on httpPort"); - } - [PICS_MULTIPLE_END_POINT] httpEcPort.receive(p_http_message) -> value p_response { - log("a_await_ec_http_request_from_iut: Received message on httpEcPort"); - } - } // End of altstep a_await_ec_http_request_from_iut - - altstep a_await_ec_http_response_from_iut( - template HttpMessage p_http_message, - out HttpMessage p_response - ) runs on ItsPkiHttp { - [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_response { - log("a_await_ec_http_response_from_iut: Received message on httpPort"); - } - [PICS_MULTIPLE_END_POINT] httpEcPort.receive(p_http_message) -> value p_response { - log("a_await_ec_http_response_from_iut: Received message on httpEcPort"); - } - } // End of altstep a_await_ec_http_response_from_iut - - altstep a_await_at_http_response_from_iut( - template HttpMessage p_http_message, - out HttpMessage p_response - ) runs on ItsPkiHttp { - [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_response { - log("a_await_at_http_response_from_iut: Received message on httpPort"); - } - [PICS_MULTIPLE_END_POINT] httpAtPort.receive(p_http_message) -> value p_response { - log("a_await_at_http_response_from_iut: Received message on httpAtPort"); - } - } // End of altstep a_await_at_http_response_from_iut - - altstep a_await_atv_http_request_from_iut( - template HttpMessage p_http_message, - out HttpMessage p_request - ) runs on ItsPkiHttp { - [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_request { - log("a_await_atv_http_request_from_iut: Received message on httpPort"); - } - [PICS_MULTIPLE_END_POINT] httpAtVPort.receive(p_http_message) -> value p_request { - log("a_await_avt_http_request_from_iut: Received message on httpAtVPort"); - } - } // End of altstep a_await_atv_http_request_from_iut - - altstep a_await_atv_http_response_from_iut( - template HttpMessage p_http_message, - out HttpMessage p_response - ) runs on ItsPkiHttp { - [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_response { - log("a_await_atv_http_response_from_iut: Received message on httpPort"); - } - [PICS_MULTIPLE_END_POINT] httpAtVPort.receive(p_http_message) -> value p_response { - log("a_await_avt_http_response_from_iut: Received message on httpAtVPort"); - } - } // End of altstep a_await_atv_http_response_from_iut - - altstep a_await_dc_http_request_from_iut( - template HttpMessage p_http_message, - out HttpMessage p_response - ) runs on ItsPkiHttp { - [not(PICS_MULTIPLE_END_POINT)] httpPort.receive(p_http_message) -> value p_response { - log("a_await_dc_http_request_from_iut: Received message on httpPort"); - } - [PICS_MULTIPLE_END_POINT] httpEcPort.receive(p_http_message) -> value p_response { - log("a_await_dc_http_request_from_iut: Received message on httpEcPort"); - } - } // End of altstep a_await_dc_http_request_from_iut - - } // End of group altsteps - -} // End of module LibItsPki_Functions diff --git a/ttcn/Pki/LibItsPki_Pics.ttcn b/ttcn/Pki/LibItsPki_Pics.ttcn deleted file mode 100644 index c03ef560..00000000 --- a/ttcn/Pki/LibItsPki_Pics.ttcn +++ /dev/null @@ -1,259 +0,0 @@ -module LibItsPki_Pics { - - /** - * @desc Does the IUT act as ITS-S device? - */ - modulepar boolean PICS_IUT_ITS_S_ROLE := false; - - /** - * @desc Does the IUT act as EA device? - */ - modulepar boolean PICS_IUT_EA_ROLE := true; - - /** - * @desc Does the IUT act as AA device? - */ - modulepar boolean PICS_IUT_AA_ROLE := true; - - /** - * @desc Does the IUT act as CA device? - */ - modulepar boolean PICS_IUT_CA_ROLE := true; - - /** - * @desc Does the IUT act as TLM device? - */ - modulepar boolean PICS_IUT_TLM_ROLE := true; - - /** - * @desc Does the IUT support enrolment? - */ - modulepar boolean PICS_SECPKI_ENROLMENT := true; - - /** - * @desc Does the IUT support autorization? - */ - modulepar boolean PICS_SECPKI_AUTHORIZATION := true; - - /** - * @desc Is a re-enrolment request? - */ - modulepar boolean PICS_SECPKI_REENROLMENT := false; - - /** - * @desc ? - */ - modulepar boolean PICS_SECPKI_CRL := false; - - /** - * @desc Do the Authorization Request use SignedWithPop mechanism? - */ - modulepar boolean PICS_PKI_AUTH_POP := true; - - /** - * @desc Certificate used by the IUT acting as ITS-S - */ - modulepar charstring PICS_IUT_CERTIFICATE_ID := "CERT_IUT_A_AT"; - - /** - * @desc Certificate used by the IUT acting as EA - */ - modulepar charstring PICS_IUT_EA_CERTIFICATE_ID := "CERT_IUT_A_EA"; - - /** - * @desc Certificate used by the IUT acting as AA - */ - modulepar charstring PICS_IUT_AA_CERTIFICATE_ID := "CERT_IUT_A_AA"; - - /** - * @desc Certificate used by the IUT acting as AA - */ - modulepar charstring PICS_IUT_CA_CERTIFICATE_ID := "CERT_IUT_A_RCA"; - - /** - * @desc Certificate used by the Test System acting as ITS-S - */ - modulepar charstring PICS_TS_CERTIFICATE_ID := "CERT_TS_A_AT"; - - /** - * @desc Certificate used by the Test System acting as EA - */ - modulepar charstring PICS_TS_EA_CERTIFICATE_ID := "CERT_TS_A_EA"; - - /** - * @desc Certificate used by the Test System acting as AA - */ - modulepar charstring PICS_TS_AA_CERTIFICATE_ID := "CERT_TS_A_AA"; - - /** - * @desc Certificate used by the Test System acting as EA - */ - modulepar charstring PICS_TS_CA_CERTIFICATE_ID := "CERT_TS_RCA_A"; - - /** - * @desc Set to true if different end points are used for EC and AT - */ - modulepar boolean PICS_MULTIPLE_END_POINT := false; - - /** - * @desc End point for the enrolment - */ - modulepar charstring PICS_HEADER_HOST_EC := "www.its.ec.org"; - - /** - * @desc End point for the authorization validation - */ - modulepar charstring PICS_HEADER_HOST_ATV := "www.its.atv.org"; - - /** - * @desc End point for the authorization - */ - modulepar charstring PICS_HEADER_HOST_AT := "www.its.at.org"; - - /** - * @desc End point for the CA - */ - modulepar charstring PICS_HEADER_HOST_CA := "www.its.ca.org"; - - /** - * @desc End point for the TLM - */ - modulepar charstring PICS_HEADER_HOST_TLM := "www.its.tlm.org"; - - /** - * @desc - */ - modulepar charstring PICS_HTTP_POST_URI_DC := "www.its.ec.org"; - - /** - * @desc Certificate used by the Test System - */ - modulepar charstring PICS_HTTP_POST_URI := "/its/inner_ec_request"; - - /** - * @desc ITS-S with privacy - */ - modulepar boolean PICS_ITS_S_WITH_PRIVACY := true; - - /** - * @desc Set to true if the PKI configuration authorize to configure an external EA entity - */ - - modulepar boolean PICS_SIMULATE_EA_ENTITY := false; - - /** - * @desc Set to true if the PKI configuration authorize to configure an external AA entity - */ - modulepar boolean PICS_SIMULATE_AA_ENTITY := false; - - /** - * @desc HTTP POST URI for InnerECRequest - */ - modulepar charstring PICS_HTTP_POST_URI_EC := "/enrolment"; - - /** - * @desc HTTP POST URI for InnerATRequest - */ - modulepar charstring PICS_HTTP_POST_URI_AT := "/authorize"; - - /** - * @desc HTTP POST URI for authorization validation - */ - modulepar charstring PICS_HTTP_POST_URI_ATV := "/authorize_validate"; - - /** - * @desc HTTP GET URI for Certificate Trusted List - */ - modulepar charstring PICS_HTTP_GET_URI_CA := "/dc/getctl"; - - /** - * @desc HTTP GET URI for Certificate Trusted List - */ - modulepar charstring PICS_HTTP_GET_URI_CTL := "/dc/getctl"; - - /** - * @desc HTTP GET URI for Certificate Trusted List - */ - modulepar charstring PICS_HTTP_GET_URI_CRL := "/dc/getcrl"; - - /** - * @desc HTTP GET URI for Certificate Trusted List - */ - modulepar charstring PICS_HTTP_GET_URI_ECTL := "/tlm/getectl"; - - /** - * @desc Factory private key for verification Nist P256 - */ - modulepar octetstring PICS_ITS_S_SIGN_NITSP256_PRIVATE_KEY := '5C25F97607DFC62972A147FAD8B7A7C939569F0F95ECD4C641724A68B51836E5'O; - - /** - * @desc Factory compressed public key for verification Nist P256 - */ - modulepar octetstring PICS_ITS_S_SIGN_NISTP256_PUBLIC_KEY := '020144E5174B0AFDA86BDB8B643B68D40030F5BDB9A9F090C64852CC3C20C9D5AD'O; - - /** - * @desc Factory private key for encryption Nist P256 - */ - modulepar octetstring PICS_ITS_S_ENC_NITSP256_PRIVATE_KEY := 'EDEBEADCAA9514CD4B30256126FB7DF958B911C6EB58CCF702983C3DCD3DECBD'O; - - /** - * @desc Factory compressed public key for encryption Nist P256 - */ - modulepar octetstring PICS_ITS_S_ENC_NISTP256_PUBLIC_KEY := '023A4ADDCDD5EE66DAB2116B0C3AB47CCEDAE92CD9ACE98A84B10EB63A9DCA798C'O; - - /** - * @desc Factory private key for encryption Brainpool P256 r1 - */ - modulepar octetstring PICS_ITS_S_ENC_BRAINPOOLP256r1_PRIVATE_KEY := '9F155D40B6C920BA45D8027093C8ADADAF3AA6F9F71F0CC0F8279FF0146A8A48'O; - - /** - * @desc Factory compressed public key for encryption Brainpool P256 r1 - */ - modulepar octetstring PICS_ITS_S_ENC_BRAINPOOLP256r1_PUBLIC_KEY := '038602F468BD334EA4D2BA416295E204D58BD1F42C85FB9BE57237C74544F6A69A'O; - - /** - * @desc Factory private key for verification Brainpool P256 r1 - */ - modulepar octetstring PICS_ITS_S_SIGN_BRAINPOOLP256r1_PRIVATE_KEY := '2CCBC88C6AD0FBB78AE50DA63366E64445F069369CED4605485442F524A0791E'O; - - /** - * @desc Factory compressed public key for verification Brainpool P256 r1 - */ - modulepar octetstring PICS_ITS_S_SIGN_BRAINPOOLP256r1_PUBLIC_KEY := '02A7A21F8FEE8DF454B7AF80A7C78CBC506C16F491C72BDC54F0CE98F20C15C59B'O; - - /** - * @desc Factory private key for encryption Brainpool P384 r1 - */ - modulepar octetstring PICS_ITS_S_ENC_BRAINPOOLP384r1_PRIVATE_KEY := '6B4B4392511B252C904801466F5DA0A7F28E038E6656800CBB0CDCB3D32F862CA4D59CBDC1A19E98E9191582AF1DB3D7'O; - - /** - * @desc Factory private key for verification Brainpool P384 r1 - */ - modulepar octetstring PICS_ITS_S_SIGN_BRAINPOOLP384r1_PRIVATE_KEY := '0F94E957F915B39E545FE845A8B4681D52F9D144353FFE36879F3DC9AFDE4001EDE55D5234EB977425E44D95BD6D3328'O; - - /** - * @desc Factory compressed public key for verification Brainpool P384 r1 - */ - modulepar octetstring PICS_ITS_S_SIGN_BRAINPOOLP384r1_PUBLIC_KEY := '0210E2B13DCC736F22A1E9C6E156177BD0CB106D34897EF8D596CF3A7AC4034003AD2BB3FA4F65C723F665BEF089858C4F'O; - - /** - * @desc Canonical ITSS-S identifier - */ - modulepar octetstring PICS_ITS_S_CANONICAL_ID := '455453492D4954532D303031'O; - - /** - * @desc Invalid Canonical ITSS-S identifier - */ - modulepar octetstring PICS_INVALID_ITS_S_CANONICAL_ID := '455453492D4954532D30303145454545'O; - - /** - * @desc Set to true if the IUT support CertificateId shall be set to the choice name - * @see ETSI TS 103 097 Clause 7.2.2 Enrolment credential - */ - modulepar boolean PICS_EC_SUBJECT_ATTRIBUT_ID := false; - - modulepar boolean PICS_SEC_IMPLICIT_CERTIFICATES := false; - - modulepar boolean PICS_SEC_EXPLICIT_CERTIFICATES := true; - -} // End of module LibItsPki_Pics diff --git a/ttcn/Pki/LibItsPki_Pixits.ttcn b/ttcn/Pki/LibItsPki_Pixits.ttcn deleted file mode 100644 index 8db552eb..00000000 --- a/ttcn/Pki/LibItsPki_Pixits.ttcn +++ /dev/null @@ -1,79 +0,0 @@ -module LibItsPki_Pixits { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - - // LibItsPki - import from LibItsPki_TypesAndValues all; - - /** - * @desc Do the encryption keys be included in Authorization Request? - */ - modulepar boolean PX_INCLUDE_ENCRYPTION_KEYS := true; - - /** - * @desc Contains the private key for the EC certificate, used in case of re-enrolment - */ - modulepar Oct32 PX_EC_PRIVATE_KEY := int2oct(0, 32); - - /** - * @desc Contains the hashed id8 of the EC certificate, used in case of re-enrolment - */ - modulepar HashedId8 PX_EC_HASHED_ID8 := int2oct(0, 8); - - /** - * @desc Contains the hash of the EC certificate, used in case of re-enrolment - */ - modulepar Oct32 PX_EC_HASH := int2oct(0, 32); - - /** - * @desc Indicate which encryption algorithem to be used for Enrolment Credencial - */ - modulepar SecurityAlg PX_EC_ALG_FOR_EC := e_nist_p256; // TODO Use RCA to determine encryption algorithm? - /** - * @desc Indicate which encryption algorithem to be used for Authorization Request (AA certificate of the IUT) - */ - modulepar SecurityAlg PX_EC_ALG_FOR_AT := e_nist_p256; - /** - * @desc Indicate which encryption algorithem to be used for Authorization Validation Request (EA certificate of the IUT) - */ - modulepar SecurityAlg PX_EC_ALG_FOR_ATV := e_nist_p256; - /** - * @desc Indicate which encryption algorithem to be used for EcSignature (EA certificate of the IUT) - */ - modulepar SecurityAlg PX_EC_ALG_FOR_EC_SIGN := e_nist_p256; - - /** - * @desc Indicate which verification algorithem to be used - */ - modulepar SecurityAlg PX_VE_ALG := e_nist_p256; - - modulepar Int16 PX_GENERATED_CERTIFICATE_DURATION := 120; - - modulepar SubjectAssurance PX_GENERATED_CERTIFICATE_SUBJECT_ASSURENCE_LEVEL := '00'O; - - modulepar CountryOnly PX_GENERATED_CERTIFICATE_REGION_COUNTRY_1 := 250; - - modulepar CountryOnly PX_GENERATED_CERTIFICATE_REGION_COUNTRY_2 := 380; - - modulepar octetstring PX_INNER_EC_CERTFICATE_BITMAP_SSP_SCR := '01C0'O; - - modulepar octetstring PX_INNER_EC_CERTFICATE_INCORRECT_BITMAP_SSP_SCR := '01FF'O; - - modulepar octetstring PX_INNER_EC_CERTFICATE_INCORRECT_BITMAP_SSP_SCR_WRONG_VERSION := '00C0'O; - - modulepar octetstring PX_INNER_EC_CERTFICATE_INCORRECT_BITMAP_SSP_SCR_WRONG_SSP_BIT := '0180'O; - - modulepar octetstring PX_INNER_EC_CERTFICATE_BITMAP_SSP_CAM := '830001'O; - - modulepar octetstring PX_INNER_EC_CERTFICATE_BITMAP_SSP_DENM := '830001'O; - - modulepar octetstring PX_INNER_AT_CERTFICATE_BITMAP_SSP_CAM := '01FFFC'O; - - modulepar octetstring PX_INNER_AT_CERTFICATE_BITMAP_SSP_DENM := '01FFFFFF'O; - -} // End of module LibItsPki_Pixits diff --git a/ttcn/Pki/LibItsPki_Templates.ttcn b/ttcn/Pki/LibItsPki_Templates.ttcn deleted file mode 100644 index e8f3cb63..00000000 --- a/ttcn/Pki/LibItsPki_Templates.ttcn +++ /dev/null @@ -1,671 +0,0 @@ -/** - * @author ETSI / STF545 - * @version $Url$ - * $Id$ - * @desc Module containing templates for IT PKI Protocol - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsPki_Templates { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - import from LibItsCommon_Functions all; - import from LibItsCommon_TypesAndValues all; - import from LibItsCommon_ASN1_NamedNumbers all; - - // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; - import from EtsiTs102941BaseTypes language "ASN.1:1997" all; - import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; - import from EtsiTs102941TypesAuthorization language "ASN.1:1997" all; - import from EtsiTs102941TypesAuthorizationValidation language "ASN.1:1997" all; - import from EtsiTs102941MessagesCa language "ASN.1:1997" all; - import from EtsiTs102941TrustLists language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; - - // LibItsSecurity - import from LibItsSecurity_TypesAndValues all; - import from LibItsSecurity_Templates all; - - // LibItsPki - import from LibItsPki_TypesAndValues all; - - template (value) EtsiTs102941Data m_etsiTs102941Data_inner_ec_request_signed_for_pop( - in template (value) InnerEcRequestSignedForPop p_inner_ec_request_signed_for_pop - ) := { - version := PkiProtocolVersion, - content := { - enrolmentRequest := p_inner_ec_request_signed_for_pop - } - } // End of template m_etsiTs102941Data_inner_ec_request_signed_for_pop - - template (value) EtsiTs102941Data m_etsiTs102941Data_inner_ec_response( - in template (value) InnerEcResponse p_inner_ec_response - ) := { - version := PkiProtocolVersion, - content := { - enrolmentResponse := p_inner_ec_response - } - } // End of template m_etsiTs102941Data_inner_ec_response - - template (value) EtsiTs102941Data m_etsiTs102941Data_inner_at_response( - in template (value) InnerAtResponse p_inner_at_response - ) := { - version := PkiProtocolVersion, - content := { - authorizationResponse := p_inner_at_response - } - } // End of template m_etsiTs102941Data_inner_at_response - - template (present) EtsiTs102941Data mw_etsiTs102941Data_inner_ec_response( - template (present) InnerEcResponse p_inner_ec_response := ? - ) := { - version := PkiProtocolVersion, - content := { - enrolmentResponse := p_inner_ec_response - } - } // End of template mw_etsiTs102941Data_inner_ec_response - - template (value) EtsiTs102941Data m_etsiTs102941Data_authorization_request( - in template (value) InnerAtRequest p_inner_at_request - ) := { - version := PkiProtocolVersion, - content := { - authorizationRequest := p_inner_at_request - } - } // End of template m_etsiTs102941Data_authorization_request - - template (value) EtsiTs102941Data m_etsiTs102941Data_authorization_response( - in template (value) InnerAtResponse p_inner_at_response - ) := { - version := PkiProtocolVersion, - content := { - authorizationResponse := p_inner_at_response - } - } // End of template m_etsiTs102941Data_authorization_response - - template (value) EtsiTs102941Data m_etsiTs102941Data_authorization_validation_request( - in template (value) AuthorizationValidationRequest p_authorization_validation_request - ) := { - version := PkiProtocolVersion, - content := { - authorizationValidationRequest := p_authorization_validation_request - } - } // End of template m_etsiTs102941Data_authorization_validation_request - - template (value) EtsiTs102941Data m_etsiTs102941Data_authorization_validation_response( - in template (value) AuthorizationValidationResponse p_authorization_validation_response - ) := { - version := PkiProtocolVersion, - content := { - authorizationValidationResponse := p_authorization_validation_response - } - } // End of template m_etsiTs102941Data_authorization_validation_response - - template (present) EtsiTs103097Data/*EnrolmentRequestMessage*/mw_enrolmentRequestMessage( - template (present) EncryptedData p_encryptedData := ? - ) modifies mw_etsiTs103097Data_encrypted := { - } // End of template mw_enrolmentRequestMessage - - template (present) EtsiTs103097Data/*EnrolmentResponseMessage*/mw_enrolmentResponseMessage( - template (present) EncryptedData p_encryptedData := ? - ) modifies mw_etsiTs103097Data_encrypted := { - } // End of template mw_enrolmentResponseMessage - - template (value) EtsiTs103097Data m_authorizationValidationRequestMessage( - in template (value) EncryptedData p_encryptedData - ) modifies m_etsiTs103097Data_encrypted := { - } // End of template m_authorizationValidationRequestMessage - - template (present) EtsiTs103097Data mw_authorizationValidationResponseMessage( - template (present) EncryptedData p_encryptedData := ? - ) modifies mw_etsiTs103097Data_encrypted := { - } // End of template mw_authorizationValidationResponseMessage - - template (value) EtsiTs103097Data/*AuthorizationRequestMessage*/ m_authorizationRequestMessage( - in template (value) EncryptedData p_encryptedData - ) modifies m_etsiTs103097Data_encrypted := { - } // End of template m_authorizationRequestMessage - - template (present) EtsiTs103097Data/*AuthorizationRequestMessage*/ mw_authorizationRequestMessage( - template (present) EncryptedData p_encryptedData := ? - ) modifies mw_etsiTs103097Data_encrypted := { - } // End of template mw_authorizationRequestMessage - - template (value) EtsiTs103097Data/*AuthorizationResponseMessage*/ m_authorizationResponseMessage( - in template (value) EncryptedData p_encryptedData - ) modifies m_etsiTs103097Data_encrypted := { - } // End of template m_authorizationResponseMessage - - template (present) EtsiTs103097Data/*AuthorizationResponseMessage*/ mw_authorizationResponseMessage( - template (present) EncryptedData p_encryptedData := ? - ) modifies mw_etsiTs103097Data_encrypted := { - } // End of template mw_authorizationResponseMessage - - template (value) EtsiTs102941Data m_etsiTs102941Data_to_be_signed_rca_ctl( - in template (value) ToBeSignedRcaCtl p_to_be_signed_rca_ctl - ) := { - version := PkiProtocolVersion, - content := { - certificateTrustListRca := p_to_be_signed_rca_ctl - } - } // End of template m_etsiTs102941Data_to_be_signed_rca_ctl - - template (present) EtsiTs102941Data mw_etsiTs102941Data_to_be_signed_rca_ctl( - template (present) ToBeSignedRcaCtl p_to_be_signed_rca_ctl := ? - ) := { - version := PkiProtocolVersion, - content := { - certificateTrustListRca := p_to_be_signed_rca_ctl - } - } // End of template mw_etsiTs102941Data_to_be_signed_rca_ctl - - template (present) EtsiTs102941Data mw_etsiTs102941Data_to_be_signed_crl( - template (present) ToBeSignedCrl p_to_be_signed_crl := ? - ) := { - version := PkiProtocolVersion, - content := { - certificateRevocationList := p_to_be_signed_crl - } - } // End of template mw_etsiTs102941Data_to_be_signed_crl - - template (present) EtsiTs102941Data mw_etsiTs102941Data_to_be_signed_tlm_ctl( - template (present) ToBeSignedTlmCtl p_to_be_signed_tlm := ? - ) := { - version := PkiProtocolVersion, - content := { - certificateTrustListTlm := p_to_be_signed_tlm - } - } // End of template mw_etsiTs102941Data_to_be_signed_crl - - template (value) EtsiTs102941DataContent m_enrolmentRequest( - in template (value) InnerEcRequestSignedForPop p_enrolmentRequest - ) := { - enrolmentRequest := p_enrolmentRequest - } // End of template m_enrolmentRequest - - template (present) EtsiTs102941DataContent mw_enrolmentRequest( - template (present) InnerEcRequestSignedForPop p_enrolmentRequest := ? - ) := { - enrolmentRequest := p_enrolmentRequest - } // End of template mw_enrolmentRequest - - template (present) InnerEcRequestSignedForPop mw_innerEcRequestSignedForPop( - template (present) SignedData p_signedData := ? - ) modifies mw_etsiTs103097Data_signed := { - } // End of template mw_innerEcRequestSignedForPop - - template (present) EtsiTs102941DataContent mw_enrolmentResponse( - template (present) InnerEcResponse p_enrolmentResponse := ? - ) := { - enrolmentResponse := p_enrolmentResponse - } // End of template mw_enrolmentResponse - - template (value) EtsiTs102941DataContent m_authorizationRequest( - in template (value) InnerAtRequest p_authorizationRequest - ) := { - authorizationRequest := p_authorizationRequest - } // End of template m_authorizationRequest - - template (present) EtsiTs102941DataContent mw_authorizationRequest( - in template (present) InnerAtRequest p_authorizationRequest := ? - ) := { - authorizationRequest := p_authorizationRequest - } // End of template mw_authorizationRequest - - template (present) EtsiTs102941DataContent mw_authorizationResponse( - template (present) InnerAtResponse p_authorizationResponse := ? - ) := { - authorizationResponse := p_authorizationResponse - } // End of template mw_authorizationResponse - - template (present) EtsiTs102941DataContent mw_authorizationValidationRequest( - template (present) AuthorizationValidationRequest p_authorization_validation_request := ? - ) := { - authorizationValidationRequest := p_authorization_validation_request - } // End of template mw_authorizationValidationRequest - - template (present) EtsiTs102941DataContent mw_authorizationValidationResponse( - template (present) AuthorizationValidationResponse p_authorization_validation_response := ? - ) := { - authorizationValidationResponse := p_authorization_validation_response - } // End of template mw_authorizationValidationResponse - - template (value) InnerEcRequest m_innerEcRequest( - in template (value) octetstring p_itsId, - in template (value) PublicKeys p_publicKeys, - in template (value) CertificateSubjectAttributes p_requestedSubjectAttributes - ) := { - itsId := p_itsId, - certificateFormat := 1, - publicKeys := p_publicKeys, - requestedSubjectAttributes := p_requestedSubjectAttributes - } // End of template m_innerEcRequest - - template (present) InnerEcRequest mw_innerEcRequest( - template (present) octetstring p_itsId := ?, - template (present) PublicKeys p_publicKeys := ?, - template (present) CertificateSubjectAttributes p_requestedSubjectAttributes := ? - ) := { - itsId := p_itsId, - certificateFormat := 1, - publicKeys := p_publicKeys, - requestedSubjectAttributes := p_requestedSubjectAttributes - } // End of template mw_innerEcRequest - - template (value) InnerAtRequest m_innerAtRequest( - in template (value) PublicKeys p_publicKeys, - in template (value) Oct32 p_hmacKey, - in template (value) SharedAtRequest p_sharedAtRequest, - in template (value) EcSignature p_ecSignature - ) := { - publicKeys := p_publicKeys, - hmacKey := p_hmacKey, - sharedAtRequest := p_sharedAtRequest, - ecSignature := p_ecSignature - } // End of template m_innerAtRequest - - template (present) InnerAtRequest mw_innerAtRequest( - template (present) PublicKeys p_publicKeys := ?, - template (present) Oct32 p_hmacKey := ?, - template (present) SharedAtRequest p_sharedAtRequest := ?, - template (present) EcSignature p_ecSignature := ? - ) := { - publicKeys := p_publicKeys, - hmacKey := p_hmacKey, - sharedAtRequest := p_sharedAtRequest, - ecSignature := p_ecSignature - } // End of template mw_innerAtRequest - - template (omit) PublicKeys m_publicKeys( - in template (value) PublicVerificationKey p_verificationKey, - in template (omit) PublicEncryptionKey p_encryptionKey := omit - ) := { - verificationKey := p_verificationKey, - encryptionKey := p_encryptionKey - } // End of template m_publicKeys - - template PublicKeys mw_publicKeys( - template (present) PublicVerificationKey p_verificationKey := ?, - template PublicEncryptionKey p_encryptionKey := * - ) := { - verificationKey := p_verificationKey, - encryptionKey := p_encryptionKey - } // End of template mw_publicKeys - - template (omit) CertificateSubjectAttributes m_certificateSubjectAttributes_id_none( - in template (value) SequenceOfPsidSsp p_appPermissions, - in template (omit) ValidityPeriod p_validityPeriod := omit, - in template (omit) GeographicRegion p_region := omit, - in template (omit) SubjectAssurance p_assuranceLevel := omit - ) := { - id := { none_ := NULL }, - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := omit - } // End of template m_certificateSubjectAttributes_id_none - - template (omit) CertificateSubjectAttributes m_certificateSubjectAttributes_id_omit( - in template (value) SequenceOfPsidSsp p_appPermissions, - in template (omit) ValidityPeriod p_validityPeriod := omit, - in template (omit) GeographicRegion p_region := omit, - in template (omit) SubjectAssurance p_assuranceLevel := omit - ) modifies m_certificateSubjectAttributes_id_none := { - id := omit - } // End of template m_certificateSubjectAttributes_id_omit - - template (omit) CertificateSubjectAttributes m_certificateSubjectAttributes_id_name( - in template (value) Hostname p_name, - in template (value) SequenceOfPsidSsp p_appPermissions, - in template (omit) ValidityPeriod p_validityPeriod := omit, - in template (omit) GeographicRegion p_region := omit, - in template (omit) SubjectAssurance p_assuranceLevel := omit - ) := { - id := { name := p_name }, - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := omit - } // End of template m_certificateSubjectAttributes_id_name - - template (value) InnerEcResponse m_innerEcResponse_ok( - in template (value) Oct16 p_requestHash, - in template (value) EtsiTs103097Certificate p_certificate - ) := { - requestHash := p_requestHash, - responseCode := ok, - certificate := p_certificate - } // End of template m_innerEcResponse_ok - - template (present) InnerEcResponse mw_innerEcResponse_ok( - template (present) Oct16 p_requestHash := ?, - template (present) EtsiTs103097Certificate p_certificate := ? - ) := { - requestHash := p_requestHash, - responseCode := ok, - certificate := p_certificate - } // End of template mw_innerEcResponse_ok - - template (value) InnerEcResponse m_innerEcResponse_ko( - in template (value) Oct16 p_requestHash, - in template (value) EnrolmentResponseCode p_responseCode - ) := { - requestHash := p_requestHash, - responseCode := p_responseCode, - certificate := omit - } // End of template m_innerEcResponse_ko - - template (present) InnerEcResponse mw_innerEcResponse_ko( - template (present) Oct16 p_requestHash := ?, - template (present) EnrolmentResponseCode p_responseCode := complement(ok) - ) := { - requestHash := p_requestHash, - responseCode := p_responseCode, - certificate := omit - } // End of template mw_innerEcResponse_ko - - template (value) InnerAtResponse m_innerAtResponse_ok( - in template (value) Oct16 p_requestHash, - in template (value) EtsiTs103097Certificate p_certificate - ) := { - requestHash := p_requestHash, - responseCode := ok, - certificate := p_certificate - } // End of template m_innerAtResponse_ok - - template (present) InnerAtResponse mw_innerAtResponse_ok( - template (present) Oct16 p_requestHash := ?, - template (present) EtsiTs103097Certificate p_certificate := ? - ) := { - requestHash := p_requestHash, - responseCode := ok, - certificate := p_certificate - } // End of template mw_innerAtResponse_ok - - template (value) InnerAtResponse m_innerAtResponse_ko( - in template (value) Oct16 p_requestHash, - in template (value) AuthorizationResponseCode p_responseCode - ) := { - requestHash := p_requestHash, - responseCode := p_responseCode, - certificate := omit - } // End of template m_innerAtResponse_ko - - template (present) InnerAtResponse mw_innerAtResponse_ko( - template (present) Oct16 p_requestHash := ?, - template (present) AuthorizationResponseCode p_responseCode := complement(ok) - ) := { - requestHash := p_requestHash, - responseCode := p_responseCode, - certificate := omit - } // End of template mw_innerAtResponse_ko - - template (value) AuthorizationValidationRequest m_authorization_validation_request( - in template (value) SharedAtRequest p_sharedAtRequest, - in template (value) EcSignature p_ecSignature - ) := { - sharedAtRequest := p_sharedAtRequest, - ecSignature := p_ecSignature - } // End of template m_authorization_validation_request - - template (present) AuthorizationValidationRequest mw_authorization_validation_request( - template (present) SharedAtRequest p_sharedAtRequest := ?, - template (present) EcSignature p_ecSignature := ? - ) := { - sharedAtRequest := p_sharedAtRequest, - ecSignature := p_ecSignature - } // End of template mw_authorization_validation_request - - template (value) AuthorizationValidationResponse m_authorizationValidationResponse_ok( - template (value) Oct16 p_requestHash, - template (value) CertificateSubjectAttributes p_confirmedSubjectAttributes - ) := { - requestHash := p_requestHash, - responseCode := ok, - confirmedSubjectAttributes := p_confirmedSubjectAttributes - } // End of template m_authorizationValidationResponse_ok - - template (present) AuthorizationValidationResponse mw_authorizationValidationResponse_ok( - template (present) Oct16 p_requestHash := ?, - template (present) CertificateSubjectAttributes p_confirmedSubjectAttributes := ? - ) := { - requestHash := p_requestHash, - responseCode := ok, - confirmedSubjectAttributes := p_confirmedSubjectAttributes - } // End of template mw_authorizationValidationResponse_ok - - template (value) AuthorizationValidationResponse m_authorizationValidationResponse_ko( - in template (value) Oct16 p_requestHash, - in template (value) AuthorizationValidationResponseCode p_responseCode - ) := { - requestHash := p_requestHash, - responseCode := p_responseCode, - confirmedSubjectAttributes := omit - } // End of template m_authorizationValidationResponse_ko - - template (present) AuthorizationValidationResponse mw_authorizationValidationResponse_ko( - template (present) Oct16 p_requestHash := ? - ) := { - requestHash := p_requestHash, - responseCode := complement(ok), - confirmedSubjectAttributes := omit - } // End of template mw_authorizationValidationResponse_ko - - template (value) SharedAtRequest m_shared_at_request( - in template (value) HashedId8 p_eaId, - in template (value) Oct16 p_keyTag, - in template (value) CertificateSubjectAttributes p_requestedSubjectAttributes - ) := { - eaId := p_eaId, - keyTag := p_keyTag, - certificateFormat := 1, - requestedSubjectAttributes := p_requestedSubjectAttributes - } // End of template m_shared_at_request - - template (present) SharedAtRequest mw_shared_at_request( - template (present) HashedId8 p_eaId := ?, - template (present) Oct16 p_keyTag := ?, - template (present) CertificateSubjectAttributes p_requestedSubjectAttributes := ? - ) := { - eaId := p_eaId, - keyTag := p_keyTag, - certificateFormat := 1, - requestedSubjectAttributes := p_requestedSubjectAttributes - } // End of template mw_shared_at_request - - template (value) EcSignature m_ec_signature( - in template (value) EtsiTs103097Data p_encryptedEcSignature - ) := { - encryptedEcSignature := p_encryptedEcSignature - } // End of template m_ec_signature - - template (present) EcSignature mw_ec_signature( - template (present) EtsiTs103097Data p_encryptedEcSignature := ? - ) := { - encryptedEcSignature := p_encryptedEcSignature - } // End of template mw_ec_signature - - template (value) EcSignature m_ec_signature_ext_payload( - in template (value) EtsiTs103097Data p_ecSignature - ) := { - ecSignature := p_ecSignature - } // End of template m_ec_signature_ext_payload - - template (present) EcSignature mw_ec_signature_ext_payload( - template (present) EtsiTs103097Data p_ecSignature := ? - ) := { - ecSignature := p_ecSignature - } // End of template mw_ec_signature_ext_payload - - template (omit) CertificateSubjectAttributes m_certificate_subject_attributes( - in template (value) SequenceOfPsidSsp p_appPermissions, - in template (value) SequenceOfPsidGroupPermissions p_certIssuePermissions, - in template (omit) CertificateId p_id := omit, - in template (omit) ValidityPeriod p_validityPeriod := omit, - in template (omit) GeographicRegion p_region := omit, - in template (omit) SubjectAssurance p_assuranceLevel := omit - ) := { - id := p_id, - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := p_certIssuePermissions - } // End of template m_certificate_subject_attributes - - template CertificateSubjectAttributes mw_certificate_subject_attributes( - template (present) SequenceOfPsidSsp p_appPermissions := ?, - template CertificateId p_id := *, - template (present) ValidityPeriod p_validityPeriod := ?, - template SubjectAssurance p_assuranceLevel := *, - template GeographicRegion p_region := *, - template SequenceOfPsidGroupPermissions p_certIssuePermissions := omit - ) := { - id := p_id ifpresent, - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := p_certIssuePermissions - } // End of template mw_certificate_subject_attributes - - template CertificateSubjectAttributes mw_certificate_subject_attributes_optional_assuranceLevel( - template (present) SequenceOfPsidSsp p_appPermissions := ?, - template (present) CertificateId p_id := ?, - template (present) ValidityPeriod p_validityPeriod := ?, - template SubjectAssurance p_assuranceLevel := *, - template GeographicRegion p_region := *, - template SequenceOfPsidGroupPermissions p_certIssuePermissions := omit - ) := { - id := p_id, - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := p_certIssuePermissions - } // End of template mw_certificate_subject_attributes - - template (value) ToBeSignedRcaCtl m_to_be_signed_rca_full_ctl( - in Time32 p_next_update, - in UInt8 p_ctl_sequence, - in CtlCommands p_ctl_commands -) := { - version := 1, - nextUpdate := p_next_update, - isFullCtl := true, - ctlSequence := p_ctl_sequence, - ctlCommands := p_ctl_commands - } // End of template m_to_be_signed_rca_ful_ctl - - template (present) ToBeSignedRcaCtl mw_to_be_signed_rca_full_ctl := { - version := 1, - nextUpdate := ?, - isFullCtl := true, - ctlSequence := ?, - ctlCommands := ? - } // End of template mw_to_be_signed_rca_ful_ctl - - template (present) ToBeSignedRcaCtl mw_to_be_signed_rca_delta_ctl := { - version := 1, - nextUpdate := ?, - isFullCtl := false, - ctlSequence := ?, - ctlCommands := ? - } // End of template mw_to_be_signed_rca_delta_ctl - - template (value) ToBeSignedCrl m_to_be_signed_crl( - in Time32 p_this_update, - in Time32 p_next_update, - in CrlEntries p_entries - ) := { - version := 1, - thisUpdate := p_this_update, - nextUpdate := p_next_update, - entries := p_entries - } // End of template m_to_be_signed_crl - - template (present) ToBeSignedCrl mw_to_be_signed_crl := { - version := 1, - thisUpdate := ?, - nextUpdate := ?, - entries := ? - } // End of template mw_to_be_signed_crl - - template (present) TlmEntry mw_tlm_entry( - template (present) EtsiTs103097Certificate p_selfSignedTLMCertificate := ?, - template (present) Url p_accessPoint := ? - ) := { - selfSignedTLMCertificate := p_selfSignedTLMCertificate, - linkTLMCertificate := *, - accessPoint := p_accessPoint - } // End of template mw_tlm_entry - - template (value) RootCaEntry m_root_ca_entry( - in template (value) EtsiTs103097Certificate p_selfsignedRootCa - ) := { - selfsignedRootCa := p_selfsignedRootCa, - linkRootCaCertificate := omit - } // End of template m_root_ca_entry - - template (present) RootCaEntry mw_root_ca_entry( - template (present) EtsiTs103097Certificate p_selfsignedRootCa := ? - ) := { - selfsignedRootCa := p_selfsignedRootCa, - linkRootCaCertificate := * - } // End of template mw_root_ca_entry - - template (value) EaEntry m_ea_entry( - in template (value) EtsiTs103097Certificate p_eaCertificate, - in template (value) Url p_aaAccessPoint - ) := { - eaCertificate := p_eaCertificate, - aaAccessPoint := p_aaAccessPoint, - itsAccessPoint := omit - } // End of template m_ea_entry - - template (present) EaEntry mw_ea_entry( - template (present) EtsiTs103097Certificate p_eaCertificate := ?, - template (present) Url p_aaAccessPoint := ? - ) := { - eaCertificate := p_eaCertificate, - aaAccessPoint := p_aaAccessPoint, - itsAccessPoint := * - } // End of template mw_ea_entry - - template (value) AaEntry m_aa_entry( - in template (value) EtsiTs103097Certificate p_aaCertificate, - in template (value) Url p_accessPoint - ) := { - aaCertificate := p_aaCertificate, - accessPoint := p_accessPoint - } // End of template m_aa_entry - - template (present) AaEntry mw_aa_entry( - template (present) EtsiTs103097Certificate p_aaCertificate := ?, - template (present) Url p_accessPoint := ? - ) := { - aaCertificate := p_aaCertificate, - accessPoint := p_accessPoint - } // End of template mw_aa_entry - - template (present) DcEntry mw_dc_entry( - template (present) Url p_url := ?, - template (present) HashedId8s p_cert := ? - ) := { - url := p_url, - cert := p_cert - } // End of template mw_dc_entry - -} // End of module LibItsPki_Templates diff --git a/ttcn/Pki/LibItsPki_TestSystem.ttcn b/ttcn/Pki/LibItsPki_TestSystem.ttcn deleted file mode 100644 index f6a7f354..00000000 --- a/ttcn/Pki/LibItsPki_TestSystem.ttcn +++ /dev/null @@ -1,124 +0,0 @@ -/** - * @author ETSI / STF545 - * @version $Url$ - * $Id$ - * @desc Test System module for ITS PKI - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsPki_TestSystem { - - // LibCommon - import from LibCommon_Sync all; - import from LibCommon_Time all; - - // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; - import from EtsiTs102941BaseTypes language "ASN.1:1997" all; - import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; - import from EtsiTs102941TypesAuthorization language "ASN.1:1997" all; - import from EtsiTs102941TypesAuthorizationValidation language "ASN.1:1997" all; - import from EtsiTs102941MessagesCa language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TestSystem all; - import from LibItsCommon_TypesAndValues all; - - // LibItsPki - import from LibItsPki_TypesAndValues all; - - // LibItsGeoNetworking - import from LibItsGeoNetworking_TestSystem all; - - // LibItsSecurity - import from LibItsSecurity_TestSystem all; - - // LibItsHttp - import from LibItsHttp_TestSystem all; - - group portDefinitions { - - /** - * @desc Upper Tester port - */ - type port UpperTesterPkiPort message { - out UtPkiInitialize, UtPkiTrigger; - in UtPkiResults; - } // End of UpperTesterPort - - type port InfoPort message { - inout InfoPortData - } with { - extension "internal" - } // End of InfoPort - - } // End of group portDefinitions - - group componentDefinitions { - - /** - * @desc System component - */ - type component ItsPkiHttpSystem extends HttpTestAdapter{ - /** Use httPort when EC and AT are served by the same end point */ - port HttpPort httpEcPort; /** Enrolment end point */ - port HttpPort httpAtVPort; /** Authorization Validation end point */ - port HttpPort httpAtPort; /** Authorization end point */ - port HttpPort httpCaPort; /** CA CTL/CRL end point */ - port HttpPort httpTlmPort; /** TLM ECTL end point */ - } // End of component ItsPkiHttpSystem - - type component ItsPkiItssSystem extends ItsPkiHttpSystem { - port UpperTesterPkiPort utPort; - port GeoNetworkingPort geoNetworkingPort; - } // End of component ItsPkiItssSystem - - /** - * @desc Test component for PKI entities execpt ITS-S - */ - type component ItsPkiHttp extends ItsSecurityBaseComponent, HttpComponent { - /** Use httPort when EC and AT are served by the same end point */ - port HttpPort httpEcPort; /** Enrolment end point */ - port HttpPort httpAtVPort; /** Authorization Validation end point */ - port HttpPort httpAtPort; /** Authorization end point */ - port HttpPort httpCaPort; /** CA CTL/CRL end point */ - port HttpPort httpTlmPort; /** TLM ECTL end point */ - - port InfoPort infoPort; - - var Certificate vc_eaCertificate; /** Test Adapter EA certificate */ - var octetstring vc_eaPrivateKey; /** Test Adapter EA private key for signature */ - var octetstring vc_eaPrivateEncKey; /** Test Adapter EA private key for encryption */ - var octetstring vc_eaWholeHash; /** Test Adapter EA whole-hash for signature check */ - var octetstring vc_eaWholeHash256; /** Test Adapter EA whole-hash using SHA 256 for encryption because of encryption key size == 32 */ - var HashedId8 vc_eaHashedId8; /** Test Adapter EA HashedId8 for decryption of IUT's response */ - var octetstring vc_aaPrivateKey; /** Test Adapter AA private key for signature */ - var octetstring vc_aaPrivateEncKey; /** Test Adapter AA private key for encryption */ - var HashedId8 vc_aaHashedId8; /** Test Adapter AA HashedId8 for decryption of IUT's response */ - var octetstring vc_aaWholeHash; /** Test Adapter AA whole-hash for signature check */ - var octetstring vc_aaWholeHash256; /** Test Adapter AA whole-hash using SHA 256 for encryption because of encryption key size == 32 */ - - var PrivateEcKeys vc_ec_private_keys; - var PublicCompressedEcKeys vc_ec_public_compressed_key; - var EcCompressedModes vc_ec_compressed_modes; - var EcHashedId8 vc_ec_hashed_id8; - var EcCertificates vc_ec_certificates; - var integer vc_ec_keys_counter; - } // End of component ItsPkiHttp - - /** - * @desc Test component for ITS-S entity - */ - type component ItsPkiItss extends ItsPkiHttp { - port UpperTesterPkiPort utPort; - port GeoNetworkingPort geoNetworkingPort; - } // End of component ItsPkiItss - - } // End of group componentDefinitions - -} // End of module LibItsPki_TestSystem diff --git a/ttcn/Pki/LibItsPki_TypesAndValues.ttcn b/ttcn/Pki/LibItsPki_TypesAndValues.ttcn deleted file mode 100644 index 0d602c05..00000000 --- a/ttcn/Pki/LibItsPki_TypesAndValues.ttcn +++ /dev/null @@ -1,153 +0,0 @@ -/** - * @author ETSI / STF545 - * @version $Url$ - * $Id$ - * @desc Module containing templates for IT PKI Protocol - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - */ -module LibItsPki_TypesAndValues { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; - import from EtsiTs102941TrustLists language "ASN.1:1997" all; - - group constants { - - const integer PkiProtocolVersion := 1; - - } // End of group constants - - type enumerated SecurityAlg { - e_nist_p256 (0), - e_brainpool_p256_r1 (1), - e_brainpool_p384_r1 (2) - } // End of type SecurityAlg - - type set of PublicVerificationKey ListOfPublicVerificationKey; - - group utPrimitives { - - /** - * @desc Upper Tester message to initialize ITS-S IUT - * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use - */ - type record UtPkiInitialize { - Oct8 hashedId8 - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester results message of the PKI ITS-S IUT - */ - type union UtPkiResults { - boolean utPkiInitializeResult, - boolean utPkiTriggerResult - } with { - variant "" - } // End of type UtPkiResults - - /** - * @desc UT primitives for PKI ITS-S IUT - * @member triggerEnrolmentRequest Request to trigger an EnrolmentRequest - */ - type union UtPkiTrigger { - TriggerEnrolmentRequest triggerEnrolmentRequest, - TriggerAuthorizationRequest triggerAuthorizationRequest - } with { - variant "" - } // End of type UtPkiTrigger - - /** - * @desc Request to trigger an EnrolmentRequest - * @member cannonicalId The canonical identifier of the ITS-S - * @member encAlgorithm The encrypion algorithm to be used (Nist P256 or Brainpool P256) - * @member privateKey The private key to be used for signature of the requested EA certificate - * @member compressedPublickey The compressed public key to be used for signature of the requested EA certificate (format: [02|03] - */ - type record TriggerEnrolmentRequest { - octetstring cannonicalId, - Oct1 encAlgorithm, - octetstring privateKey, - octetstring compressedPublickey - } with { - variant "FIELDORDER(msb)" - } // End of type TriggerEnrolmentRequest - - type record TriggerAuthorizationRequest { - octetstring cannonicalId, - Oct1 encAlgorithm, - octetstring privateKey, - octetstring compressedPublickey - } with { - variant "FIELDORDER(msb)" - } // End of type TriggerAuthorizationRequest - - } with { - encode "UpperTester" - variant "" - } // End of group utPrimitives - - group acPrimitives { - - /** - * @desc TA primitives for Pki - */ - type union AcPkiPrimitive { - AcSetSecurityData acSetSecurityData - } with { - variant "" - } - - /** - * @desc Primitive for receiveing response from TA - */ - type union AcPkiResponse { - boolean result - } with { - variant "" - } - - type record AcSetSecurityData { - charstring certificateId, - charstring peer_certificateId, - octetstring private_key, - octetstring public_key_compressed, - integer public_key_compressed_mode - } with { - variant "" - encode "LibItsPki" - } // AcSetSecurityData - - } with { - variant "" - encode "AdapterControl" - } // End of group acPrimitives - - type record InfoPortData { - octetstring hashed_id8, - EtsiTs103097Certificate at_certificate - } // End of type InfoPortData - - type record of CrlEntry CrlEntries; - - type record of CtlCommand CtlCommands; - - type record of octetstring PrivateEcKeys; - type record of octetstring PublicCompressedEcKeys; - type record of integer EcCompressedModes; - type record of HashedId8 EcHashedId8; - type record of EtsiTs103097Certificate EcCertificates; -} -with { - variant "" - encode "LibItsPki" -} // End of module LibItsPki_TypesAndValues diff --git a/ttcn/Pki/module.mk b/ttcn/Pki/module.mk deleted file mode 100644 index 24fe315b..00000000 --- a/ttcn/Pki/module.mk +++ /dev/null @@ -1,7 +0,0 @@ -sources := LibItsPki_EncdecDeclarations.ttcn \ - LibItsPki_Functions.ttcn \ - LibItsPki_Pics.ttcn \ - LibItsPki_Pixits.ttcn \ - LibItsPki_Templates.ttcn \ - LibItsPki_TestSystem.ttcn \ - LibItsPki_TypesAndValues.ttcn diff --git a/ttcn/Rtcmem/LibItsRtcmem_EncdecDeclarations.ttcn b/ttcn/Rtcmem/LibItsRtcmem_EncdecDeclarations.ttcn deleted file mode 100644 index 3573ca22..00000000 --- a/ttcn/Rtcmem/LibItsRtcmem_EncdecDeclarations.ttcn +++ /dev/null @@ -1,43 +0,0 @@ -module LibItsRtcmem_EncdecDeclarations { - - // LibIts - import from RTCMEM_PDU_Descriptions language "ASN.1:1997" all; - - // LibItsRtcmem - import from LibItsRtcmem_TypesAndValues all; - import from LibItsRtcmem_TestSystem all; - - external function fx_enc_RtcmemReq (RtcmemReq p) return bitstring - with {extension "prototype(convert) encode(LibIts_Interface)"} - - external function fx_dec_RtcmemReq (inout bitstring b, out RtcmemReq p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_dec_RtcmemInd (inout bitstring b, out RtcmemInd p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_enc_RTCMEM (RTCMEM p) return bitstring - with {extension "prototype(convert) encode(PER)"} - - external function fx_dec_RTCMEM (inout bitstring b, out RTCMEM p) return integer - with {extension "prototype(sliding) decode(PER)"} - - external function fx_enc_UtRtcmemInitialize (UtRtcmemInitialize p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtRtcmemTrigger (UtRtcmemTrigger p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtRtcmemUpdate (UtRtcmemUpdate p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_enc_UtRtcmemTermination (UtRtcmemTermination p) return bitstring - with {extension "prototype(convert) encode(UpperTester)"} - - external function fx_dec_UtRtcmemResults (inout bitstring b, out UtRtcmemResults p) return integer - with {extension "prototype(sliding) decode(UpperTester)"} - - external function fx_dec_UtRtcmemEventInd (inout bitstring b, out UtRtcmemEventInd p) return integer - with {extension "prototype(sliding) decode(UpperTester)"} - -} // End of module LibItsRtcmem_EncdecDeclarations diff --git a/ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn b/ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn deleted file mode 100644 index d24c6271..00000000 --- a/ttcn/Rtcmem/LibItsRtcmem_Functions.ttcn +++ /dev/null @@ -1,394 +0,0 @@ -module LibItsRtcmem_Functions { - - // LibCommon - import from LibCommon_Sync all; - import from LibCommon_Time all; - import from LibCommon_VerdictControl all; - - // LibIts - import from ITS_Container language "ASN.1:1997" all; - import from RTCMEM_PDU_Descriptions language "ASN.1:1997" all; - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - import from LibItsCommon_Templates all; - import from LibItsCommon_Functions all; - import from LibItsCommon_Pixits all; - - // LibItsSecurity - import from LibItsSecurity_Functions all; - - // LibItsRtcmem - import from LibItsRtcmem_TestSystem all; - import from LibItsRtcmem_TypesAndValues all; - import from LibItsRtcmem_Templates all; - import from LibItsRtcmem_Pics all; - import from LibItsRtcmem_Pixits all; - - group utFuntions { - - /** - * @desc Requests to bring the IUT in an initial state - * @param p_init The initialisation to trigger. - */ - function f_utInitializeIut(template (value) UtRtcmemInitialize p_init) runs on ItsRtcmem { - - //deactivate rtcmemPort default alts - vc_rtcmemDefaultActive := false; - - utPort.send(p_init); - tc_wait.start; - alt { - [] utPort.receive(UtRtcmemResults: { utRtcmemInitializeResult := true }) { - tc_wait.stop; - log("*** " & testcasename() & ": INFO: IUT initialized ***"); - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //deactivate rtcmemPort default alts - vc_rtcmemDefaultActive := true; - } - - /** - * @desc Triggers an event from the application layer - * @param p_event The event to trigger. - */ - function f_utTriggerEvent( - in template (value) UtRtcmemTrigger p_event - ) runs on ItsRtcmem { - - //deactivate rtcmemPort default alts - vc_rtcmemDefaultActive := false; - - utPort.send ( p_event ); - tc_wait.start; - alt { - [] utPort.receive ( UtRtcmemResults: { utRtcmemTriggerResult := true }) { - tc_wait.stop; - } - [] utPort.receive ( UtRtcmemResults: { utRtcmemTriggerResult := false }) { - tc_wait.stop; - f_selfOrClientSyncAndVerdict("RTCMEM Trigger failed", e_error); - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [else] { // Shortcut defaults - //f_sleep(0.050); // 50 ms - repeat; - } - } - - return; - } - - /** - * @desc Updates an event from the application layer - * @param p_event The event to trigger. - */ - function f_utUpdateEvent( - in template (value) UtRtcmemUpdate p_event - ) runs on ItsRtcmem { - - utPort.send ( p_event ); - tc_wait.start; - alt { - [] utPort.receive ( UtRtcmemResults: { utRtcmemUpdateResult := true }) { - tc_wait.stop; - } - [] utPort.receive ( UtRtcmemResults: { utRtcmemUpdateResult := false }) { - tc_wait.stop; - f_selfOrClientSyncAndVerdict("RTCMEM Update failed", e_error); - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //activate rtcmemPort default alts - vc_rtcmemDefaultActive := true; - - return; - } - - /** - * @desc Terminates an event at the application layer - * @param p_event The event to terminate. - */ - function f_utTerminateEvent(template (value) UtRtcmemTermination p_event) runs on ItsRtcmem { - - //deactivate rtcmemPort default alts - vc_rtcmemDefaultActive := false; - - utPort.send(p_event); - tc_wait.start; - alt { - [] utPort.receive(UtRtcmemResults: { utRtcmemTerminationResult := true}) { - tc_wait.stop; - } - [] utPort.receive(UtRtcmemResults: { utRtcmemTerminationResult := false}) { - tc_wait.stop; - f_selfOrClientSyncAndVerdict("RTCMEM Termination failed", e_error); - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] a_utDefault() { - //empty on purpose - } - } - - //activate rtcmemPort default alts - vc_rtcmemDefaultActive := true; - - } - - } // End of group utFuntions - - group adapterControl { - - /** - * @desc Initialise secure mode if required - */ - function f_initialiseSecuredMode( - in charstring p_certificateId := PX_CERT_FOR_TS - ) runs on ItsRtcmem { - - if (PICS_IS_IUT_SECURED == true) { - - if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificateId))) { - log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); - stop; - } - } - - } // End of function f_initialiseSecuredMode() - - function f_uninitialiseSecuredMode() runs on ItsRtcmem { - - if (PICS_IS_IUT_SECURED == true) { - f_acTriggerSecEvent(m_acDisableSecurity); - } - - } // End of function f_initialiseSecuredMode() - - /** - * @desc Triggers event in the test system adaptation. - * @param p_event The event to trigger - * @return FncRetCode - */ - function f_acTriggerSecEvent(template (value) AcSecPrimitive p_event) runs on ItsRtcmem return FncRetCode { - var FncRetCode v_ret := e_success; - - acPort.send(p_event); - tc_ac.start; - alt { - [] acPort.receive(m_acSecResponseSuccess) { - tc_ac.stop; - } - [] acPort.receive { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - return v_ret; - } - - } // End of group adapterControl - - group altsteps { - - /** - * @desc Default handling cf01 de-initialisation. - */ - altstep a_cf01Down() runs on ItsRtcmem { - [] a_shutdown() { - f_poDefault(); - f_cfDown(); - log("*** a_cf01Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc The base default. - */ - altstep a_default() runs on ItsRtcmem { - [vc_rtcmemDefaultActive] rtcmemPort.receive(mw_rtcmemInd(mw_rtcmemPdu(mw_defaultRtcmem))) { - log("*** " & testcasename() & ": INFO: RTCMEM received in default ***"); - vc_rtcmemReceived := true; - repeat; - } - [vc_rtcmemDefaultActive] rtcmemPort.receive { - log("*** " & testcasename() & ": ERROR: Received an unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] any timer.timeout { - log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] a_shutdown() { - f_poDefault(); - f_cfDown(); - log("*** " & testcasename() & ": INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc The default for handling upper tester messages. - */ - altstep a_utDefault() runs on ItsRtcmem { - var UtRtcmemEventInd v_rtcmemevent; - - [] utPort.receive(UtRtcmemEventInd:?) -> value v_rtcmemevent { - //store every upper tester indication received - vc_utEvents[lengthof(vc_utEvents)] := v_rtcmemevent; - repeat; - } - [] utPort.receive { - log("*** " & testcasename() & ": INFO: Received unhandled/unknown UT message from IUT ***"); - repeat; - } - } - - } // End of group altsteps - - group rtcmemConfigurationFunctions { - - /** - * @desc Setups default configuration - * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT - */ - function f_cfUp( - in charstring p_certificateId := PX_CERT_FOR_TS - ) runs on ItsRtcmem system ItsRtcmemSystem { - - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - map(self:rtcmemPort, system:rtcmemPort); - - // Connect - f_connect4SelfOrClientSync(); - activate(a_cf01Down()); - - // Initialise secured mode - f_initialiseSecuredMode(p_certificateId); - - //Initialze the IUT - f_prInitialState(); - - } // End of f_cfUp - - /** - * @desc Deletes default configuration - */ - function f_cfDown() runs on ItsRtcmem system ItsRtcmemSystem { - - // Initialise secured mode - f_uninitialiseSecuredMode(); - - unmap(self:utPort, system:utPort); - unmap(self:acPort, system:acPort); - unmap(self:rtcmemPort, system:rtcmemPort); - - f_disconnect4SelfOrClientSync(); - } // End of f_cfDown - - } // End of of rtcmemConfigurationFunctions - - group preambles { - - /** - * @desc The default preamble. - */ - function f_prDefault() runs on ItsRtcmem { - vc_default := activate(a_default()); - activate(a_utDefault()); - } - - /** - * @desc Brings the IUT into an initial state. - * @return FncRetCode - */ - function f_prInitialState( - in charstring p_certificate_id := "" - ) runs on ItsRtcmem return FncRetCode { - var FncRetCode v_ret := e_success; - - // Initialize IUT with given certificate - if (p_certificate_id != "") { // Initialize IUT with given certificate - var HashedId8 v_hashedId8 := '0000000000000000'O; - - fx_readCertificateDigest("CERT_SRM_SSP_NONE", v_hashedId8); - if ('0000000000000000'O == v_hashedId8) { - // Certificate not found - log("*** " & testcasename() & ": Required IUT certificate is not found on the test system ***"); - return e_timeout; - } - f_utInitializeIut(m_rtcmemInitialize(v_hashedId8)); - } else { - f_utInitializeIut(m_rtcmemInitialize); - } - f_prDefault(); - return v_ret; - } - - } // End of group preambles - - group postambles { - - /** - * @desc The default postamble. - */ - function f_poDefault() runs on ItsRtcmem { - //empty - } - - } // End of group postambles - - group sendFunctions { - - } // End of group sendFunctions - - group receiveFunctions { - - /** - * @desc Awaits a RTCMEM and returns it - * @param p_rcvMsg The expected message to be received. - * @param p_rcvdMsg The received message - OUT. - */ - function f_awaitRtcmeMessage( - in template (present) RtcmemInd p_rcvMsg, - out RtcmemInd p_rcvdMsg - ) runs on ItsRtcmem { - - tc_ac.start; - alt { - [] rtcmemPort.receive(p_rcvMsg) -> value p_rcvdMsg { - tc_ac.stop; - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INFO: Timeout while awaiting the reception of a message ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - } - - } // End of group receiveFunctions - -} // End of module LibItsRtcmem_Functions diff --git a/ttcn/Rtcmem/LibItsRtcmem_Pics.ttcn b/ttcn/Rtcmem/LibItsRtcmem_Pics.ttcn deleted file mode 100644 index 448f32b2..00000000 --- a/ttcn/Rtcmem/LibItsRtcmem_Pics.ttcn +++ /dev/null @@ -1,30 +0,0 @@ -module LibItsRtcmem_Pics { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - - /** - * @desc Is the IUT running in secured mode? - * @see ETSI TS 103 191-1 Table A.1 - */ - modulepar boolean PICS_IS_IUT_SECURED := false; - - /** - * @desc Support for RTCMEM generation - * @see ETSI TS 103 191-1 Table A.5 - */ - modulepar boolean PICS_RTCMEM_GENERATION := true; - - /** - * @desc Support for RTCMEM reception - * @see ETSI TS 103 191-1 Table A.5 - */ - modulepar boolean PICS_RTCMEM_RECEPTION := true; - - /** - * @desc Does IUT support GeoNetworking short range? - * @see ETSI TS 103 191-1 Table A.5 - */ - modulepar boolean PICS_SHORT_RANGE := true; - -} // End of module LibItsRtcmem_Pics diff --git a/ttcn/Rtcmem/LibItsRtcmem_Pixits.ttcn b/ttcn/Rtcmem/LibItsRtcmem_Pixits.ttcn deleted file mode 100644 index f4018e8a..00000000 --- a/ttcn/Rtcmem/LibItsRtcmem_Pixits.ttcn +++ /dev/null @@ -1,3 +0,0 @@ -module LibItsRtcmem_Pixits { - -} // End of module LibItsRtcmem_Pixits diff --git a/ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn b/ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn deleted file mode 100644 index 49f30843..00000000 --- a/ttcn/Rtcmem/LibItsRtcmem_Templates.ttcn +++ /dev/null @@ -1,277 +0,0 @@ -module LibItsRtcmem_Templates { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from ITS_Container language "ASN.1:1997" all; - import from RTCMEM_PDU_Descriptions language "ASN.1:1997" all; - import from DSRC language "ASN.1:1997" all; - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - import from LibItsCommon_Functions all; - import from LibItsCommon_ASN1_NamedNumbers all; - - // LibItsRtcmem - import from LibItsRtcmem_TestSystem all; - import from LibItsRtcmem_TypesAndValues all; - import from LibItsRtcmem_Pixits all; - - group primitivesTemplates { - - /** - * @desc Send template for RTCMEM Message (RtcmemPort Primitive) - * @param p_rtcmemMsg The RTCMEM Message to be sent - */ - template (value) RtcmemReq m_rtcmemReq( - in template (value) RTCMEM p_rtcmemMsg - ) := { - msgOut := p_rtcmemMsg - } - - /** - * @desc Receive template for RTCMEM Message (RtcmemPort Primitive) - * @param p_rtcmemMsg The expected RTCMEM Message - */ - template (present) RtcmemInd mw_rtcmemInd( - template (present) RTCMEM p_rtcmemMsg - ) := { - msgIn := p_rtcmemMsg, - recvTime := ?, - gnNextHeader := *, - gnHeaderType := *, - gnHeaderSubtype := *, - gnLifetime := *, - gnTrafficClass := *, - btpDestinationPort := *, - btpInfo := *, - ssp := *, - its_aid := * - } - - /** - * @desc Receive template for RTCMEM Message (RtcmemPort Primitive) - * @param p_rtcmemMsg The expected RTCMEM Message - * @param p_gnNextHeader GN next header value - * @param p_gnHeaderType GN header type value - * @param p_gnHeaderSubtype GN header subtype value - * @param p_gnLifetime GN packet lifetime value (ms) - * @param p_gnTrafficClass GN traffic class value - */ - template (present) RtcmemInd mw_rtcmemIndWithGnParameters( - template (present) RTCMEM p_rtcmemMsg, - in template UInt8 p_gnNextHeader := *, - in template UInt8 p_gnHeaderType := *, - in template UInt8 p_gnHeaderSubtype := *, - in template UInt32 p_gnLifetime := *, - in template UInt8 p_gnTrafficClass := * - ) modifies mw_rtcmemInd := { - gnNextHeader := p_gnNextHeader, - gnHeaderType := p_gnHeaderType, - gnHeaderSubtype := p_gnHeaderSubtype, - gnLifetime := p_gnLifetime, - gnTrafficClass := p_gnTrafficClass - } - - /** - * @desc Receive template for RTCMEM Message (RtcmemPort Primitive) - * @param p_rtcmemMsg Expected RTCMEM Message - * @param p_btpDestinationPort BTP destination port value - * @param p_btpInfo BTP destination port info value (if BTP-B) or BTP source port value (if BTP-A) - */ - template (present) RtcmemInd mw_rtcmemIndWithBtpParameters( - template (present) RTCMEM p_rtcmemMsg, - template UInt16 p_btpDestinationPort := *, - template UInt16 p_btpInfo := * - ) modifies mw_rtcmemInd := { - btpDestinationPort := p_btpDestinationPort, - btpInfo := p_btpInfo - }; - - /** - * @desc Receive template for RTCMEM Message (RtcmemPort Primitive) - * @param p_rtcmemMsg The expected RTCMEM Message - * @param p_ssp SSP value - * @param p_its_aid ITS-AID value - */ - template (present) RtcmemInd mw_rtcmemIndWithSecurityParameters( - template (present) RTCMEM p_rtcmemMsg, - template (present) Bit24 p_ssp := ?, - template (present) UInt32 p_its_aid := ? - ) modifies mw_rtcmemInd := { - ssp := p_ssp, - its_aid := p_its_aid - } - - } - - group utPrimitives { - - /** - * @desc Send template for Upper Tester event initialization - * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use - */ - template (value) UtRtcmemInitialize m_rtcmemInitialize( - in HashedId8 p_hashedId8 := '0000000000000000'O - ) := { - hashedId8 := p_hashedId8 - } - - /** - * @desc Send template for Upper Tester Trigger event - */ - template (omit) UtRtcmemTrigger m_utTriggerEvent( - in MsgCount p_msgCnt, - in RTCM_Revision p_rev := rtcmRev3, - in RTCMmessageList p_msgs, - in template (omit) MinuteOfTheYear p_timeStamp := omit, - in template (omit) FullPositionVector p_anchorPoint := omit, - in template (omit) RTCMheader p_rtcmHeader := omit - ) := { - msgCnt := p_msgCnt, - rev := p_rev, - msgs := p_msgs, - timeStamp := p_timeStamp, - anchorPoint := p_anchorPoint, - rtcmHeader := p_rtcmHeader - } - - /** - * @desc Send template for Upper Tester Trigger event - */ - template (omit) UtRtcmemTermination m_utTriggerTermination( - in MsgCount p_msgCnt - ) := { - msgCnt := p_msgCnt - } - - } - - group rtcmemPduTemplates { - - /** - * @desc Send template for RTCMEM PDU - * @param p_map The RTCMEM Message - */ - template (value) RTCMEM m_rtcmemPdu( - in template (value) RTCMcorrections p_rtcmc - ) := { - header := m_itsPduHeader( - , - ,LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_rtcmem_), - rtcmc := p_rtcmc - } - - /** - * @desc Receive template for RTCMEM PDU - * @param p_rtcmc The RTCMEM Message - */ - template (present) RTCMEM mw_rtcmemPdu( - template (present) RTCMcorrections p_rtcmc := ? - ) := { - header := mw_itsPduHeaderRtcmem, - rtcmc := p_rtcmc - } - - } // End of group rtcmemPduTemplates - - group headerTemplates { - - /** - * @desc Default send template for ITS PDU header - * @param p_stationID The source station ID (Default: test system station id) - * @param p_protocolVersion The protocol version (Default: current RTCMEM protocol version) - * @param p_messageID The message Id (Default: RTCMEM id) - */ - template (value) ItsPduHeader m_itsPduHeader( - in template (value) StationID p_stationID := f_getTsStationId(), - in template (value) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, - in template (value) ItsPduHeader.messageID p_messageID - ) := { - protocolVersion := p_protocolVersion, - messageID := p_messageID, - stationID := p_stationID - } - - /** - * @desc Default receive template for ITS PDU header - * @param p_stationID The expected station id (Default: any) - * @param p_protocolVersion The expected protocol version (Default: current RTCMEM protocol version) - * @param p_messageID The expected message id (Default: RTCMEM message id) - */ - template ItsPduHeader mw_itsPduHeader( - template (present) StationID p_stationID := ?, - template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, - template (present) ItsPduHeader.messageID p_messageID := ? - ) := { - protocolVersion := p_protocolVersion, - messageID := p_messageID, - stationID := p_stationID - } - - /** - * @desc Default receive template for ITS PDU header - * @param p_stationID The expected station id (Default: any) - * @param p_protocolVersion The expected protocol version (Default: current RTCMEM protocol version) - * @param p_messageID The expected message id (Default: SREM id) - */ - template ItsPduHeader mw_itsPduHeaderRtcmem( - template (present) StationID p_stationID := ?, - template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, - template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_rtcmem_ - ) := { - protocolVersion := p_protocolVersion, - messageID := p_messageID, - stationID := p_stationID - } - - /** - * @desc Default receive template for the station id - */ - template (present) StationID mw_anyStationId := ?; - - } // End of group headerTemplates - - group rtcmemTemplatesSend { - - /** - * @desc Receive template for RTCMEM Message - */ - template (value) RTCMcorrections m_defaultRtcmem( - in MsgCount p_msgCnt, - in RTCM_Revision p_rev := rtcmRev3, - in RTCMmessageList p_msgs, - in template (omit) MinuteOfTheYear p_timeStamp := omit, - in template (omit) FullPositionVector p_anchorPoint := omit, - in template (omit) RTCMheader p_rtcmHeader := omit - ) := { - msgCnt := p_msgCnt, - rev := p_rev, - timeStamp := p_timeStamp, - anchorPoint := p_anchorPoint, - rtcmHeader := p_rtcmHeader, - msgs := p_msgs, - regional := omit - } // End of template m_defaultRtcmem - - } // End of group rtcmemTemplatesSend - - group rtcmemTemplatesRecv { - - /** - * @desc Receive template for RTCMEM Message - */ - template (present) RTCMcorrections mw_defaultRtcmem := { - msgCnt := ?, - rev := ?, - timeStamp := *, - anchorPoint := *, - rtcmHeader := *, - msgs := ?, - regional := * - } - - } // End of group rtcmemTemplatesRecv - -} // End of module LibItsRtcmem_Templates diff --git a/ttcn/Rtcmem/LibItsRtcmem_TestSystem.ttcn b/ttcn/Rtcmem/LibItsRtcmem_TestSystem.ttcn deleted file mode 100644 index 674d3de0..00000000 --- a/ttcn/Rtcmem/LibItsRtcmem_TestSystem.ttcn +++ /dev/null @@ -1,127 +0,0 @@ -module LibItsRtcmem_TestSystem { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_Time all; - import from LibCommon_Sync all; - import from LibCommon_DataStrings all; - - // LibIts - import from ITS_Container language "ASN.1:1997" all; - import from RTCMEM_PDU_Descriptions language "ASN.1:1997" all; - import from EfcDsrcGeneric language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TestSystem all; - import from LibItsCommon_TypesAndValues all; - - // LibItsRtcmem - import from LibItsRtcmem_TypesAndValues all; - - group portDefinitions { - - /** - * @desc Adapter control port - */ - type port AdapterControlPort message { - out - AcSecPrimitive; - in - AdapterControlResults; - } // end AdapterControlPort - - /** - * @desc Upper Tester port - */ - type port UpperTesterPort message { - out - UtRtcmemInitialize, UtRtcmemTrigger, UtRtcmemUpdate, UtRtcmemTermination; - in - UtRtcmemResults, UtRtcmemEventInd; - } // end UpperTesterPort - - } // end portDefinitions - - group interfacePorts { - - /** - * @desc Application MapSpat Port - */ - type port RtcmemPort message { - in RtcmemInd; - out RtcmemReq - } - - } // End of group interfacePorts - - /** - * @desc ITS System Adapter - */ - type component ItsRtcmemSystem { - - port AdapterControlPort acPort; - port UpperTesterPort utPort; - port RtcmemPort rtcmemPort; - - } // End of component ITS System Adapter - - /** - * @desc Test component for ITS SREM-SSEM application layer - */ - type component ItsRtcmem extends ItsBaseComponent { - - port AdapterControlPort acPort; - port UpperTesterPort utPort; - port RtcmemPort rtcmemPort; - //timers - - //component variables - var RtcmemInd vc_mapMsg; - var UtRtcmemEventIndList vc_utEvents := {}; - - //default - var default vc_default := null; - - //global variables - var boolean vc_rtcmemReceived := false; - - var boolean vc_rtcmemDefaultActive := true; - } // End of component ItsRtcmem - - group ApplPrimitives { - - type record RtcmemInd { - RTCMEM msgIn, - UInt64 recvTime, - UInt8 gnNextHeader optional, - UInt8 gnHeaderType optional, - UInt8 gnHeaderSubtype optional, - UInt32 gnLifetime optional, - UInt8 gnTrafficClass optional, - UInt16 btpDestinationPort optional, - UInt16 btpInfo optional, - Bit24 ssp optional, - UInt32 its_aid optional - } - with { - encode (msgIn) "PER" - } - - type record of RtcmemInd RtcmemInds; - - /** - * @desc Appl SREM and SSEM Request Primitive - */ - type record RtcmemReq { - RTCMEM msgOut - } - with { - encode (msgOut) "PER" - } - - } with { - variant "" - encode "LibIts_Interface" - } // End of group ApplPrimitives - -} // End of module LibItsRtcmem_TestSystem diff --git a/ttcn/Rtcmem/LibItsRtcmem_TypesAndValues.ttcn b/ttcn/Rtcmem/LibItsRtcmem_TypesAndValues.ttcn deleted file mode 100644 index 6ccfed04..00000000 --- a/ttcn/Rtcmem/LibItsRtcmem_TypesAndValues.ttcn +++ /dev/null @@ -1,99 +0,0 @@ -module LibItsRtcmem_TypesAndValues { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from ITS_Container language "ASN.1:1997" all; - import from RTCMEM_PDU_Descriptions language "ASN.1:1997" all; - import from DSRC language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - - group utPrimitives { - - /** - * @desc Upper Tester message to initialize IUT - * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use - */ - type record UtRtcmemInitialize { - Oct8 hashedId8 - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester results message of the Rtcmem/Ssem IUT - * @member utRtcmemInitialize - - * @member utRtcmemTriggerResult - - * @member utRtcmemUpdateResult - - * @member utRtcmemTerminationResult - - */ - type union UtRtcmemResults { - boolean utRtcmemInitializeResult, - boolean utRtcmemTriggerResult, - boolean utRtcmemUpdateResult, - boolean utRtcmemTerminationResult - } with { - variant "" - } // End of type UtRtcmemResults - - /** - * @desc Upper Tester message to request triggering of an event at IUT - */ - type record UtRtcmemTrigger { - MsgCount msgCnt, - RTCM_Revision rev, - RTCMmessageList msgs, - MinuteOfTheYear timeStamp optional, - FullPositionVector anchorPoint optional, - RTCMheader rtcmHeader optional - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to request updating of an event at IUT - */ - type record UtRtcmemUpdate { - RTCMmessageList msgs, - MinuteOfTheYear timeStamp optional, - FullPositionVector anchorPoint optional, - RTCMheader rtcmHeader optional - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to request termination of an event at IUT - */ - type record UtRtcmemTermination { - MsgCount msgCnt - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to check event/status at IUT - */ - type record UtRtcmemEventInd { - RTCMEM rtcmemMsg - } with { - encode (rtcmemMsg) "PER" - } - - /** - * @desc List of Upper Tester messages to check event/status on RTCMEM IUT - */ - type record of UtRtcmemEventInd UtRtcmemEventIndList; - - } with { - encode "UpperTester" - variant "" - } - -} with { - encode "LibItsRtcmem" -} // End of module LibItsRtcmem_TypesAndValues diff --git a/ttcn/Rtcmem/module.mk b/ttcn/Rtcmem/module.mk deleted file mode 100644 index 1afd06be..00000000 --- a/ttcn/Rtcmem/module.mk +++ /dev/null @@ -1,8 +0,0 @@ -sources := \ -LibItsRtcmem_EncdecDeclarations.ttcn \ -LibItsRtcmem_Functions.ttcn \ -LibItsRtcmem_Pics.ttcn \ -LibItsRtcmem_Pixits.ttcn \ -LibItsRtcmem_Templates.ttcn \ -LibItsRtcmem_TestSystem.ttcn \ -LibItsRtcmem_TypesAndValues.ttcn diff --git a/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn b/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn deleted file mode 100644 index d48e56d0..00000000 --- a/ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn +++ /dev/null @@ -1,58 +0,0 @@ -module LibItsSecurity_EncdecDeclarations { - - // LibIts - //import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; - //import from EtsiTs103097Module language "ASN.1:1997" all; - - import from LibItsSecurity_TypesAndValues all; - - /** - * @desc Encoding function for EtsiTs103097Certificate certificate - * @param p The certificate to encode - * @return The encode message in OER format - */ - external function fx_enc_CertificateBase(in IEEE1609dot2.CertificateBase p) return bitstring - with {extension "prototype(convert) encode(PER)"} - - external function fx_dec_CertificateBase(inout bitstring b, out IEEE1609dot2.CertificateBase p) return integer - with {extension "prototype(sliding) decode(PER)"} - - /** - * @desc Encoding function for IEEE1609dot2.ToBeSignedCertificate - * @param p The ToBeSign part of the certificate - * @return The encode message in OER format - */ - external function fx_enc_ToBeSignedCertificate(in IEEE1609dot2.ToBeSignedCertificate p) return bitstring - with {extension "prototype(convert) encode(PER)"} - - /** - * @desc Encoding function for IEEE1609dot2.Ieee1609Dot2Data - * @param p The Ieee1609Dot2Data part of the certificate - * @return The encode message in OER format - */ - external function fx_enc_Ieee1609Dot2Data(in IEEE1609dot2.Ieee1609Dot2Data p) return bitstring - with {extension "prototype(convert) encode(PER)"} - - external function fx_dec_Ieee1609Dot2Data(inout bitstring p_data, out IEEE1609dot2.Ieee1609Dot2Data p_ieee1609Dot2Data) return integer - with {extension "prototype(sliding) decode(PER)"} - - external function fx_enc_Ieee1609Dot2ToBeSignedData(in IEEE1609dot2.ToBeSignedData p) return bitstring - with {extension "prototype(convert) encode(PER)"} - - external function fx_dec_Ieee1609Dot2ToBeSignedData(inout bitstring p_data, out IEEE1609dot2.ToBeSignedData p_toBeSignedData) return integer - with {extension "prototype(sliding) decode(PER)"} - - external function fx_enc_SspCAM (LibItsSecurity_TypesAndValues.SspCAM p_ssp) return bitstring - with {extension "prototype(convert) encode(LibItsSecurity)"} - - external function fx_dec_SspCAM (inout bitstring p_data, out LibItsSecurity_TypesAndValues.SspCAM p_ssp) return integer - with {extension "prototype(sliding) decode(LibItsSecurity)"} - - external function fx_enc_SspDENM (LibItsSecurity_TypesAndValues.SspDENM p_ssp) return bitstring - with {extension "prototype(convert) encode(LibItsSecurity)"} - - external function fx_dec_SspDENM (inout bitstring p_data, out LibItsSecurity_TypesAndValues.SspDENM p_ssp) return integer - with {extension "prototype(sliding) decode(LibItsSecurity)"} - -} // End of module LibItsSecurity_EncdecDeclarations diff --git a/ttcn/Security/LibItsSecurity_Functions.ttcn b/ttcn/Security/LibItsSecurity_Functions.ttcn deleted file mode 100644 index 2865ca82..00000000 --- a/ttcn/Security/LibItsSecurity_Functions.ttcn +++ /dev/null @@ -1,3557 +0,0 @@ -/** - * @Author ETSI / STF481 / STF507 / STF517 / STF538 / STF545 - * @version $Url$ - * $Id$ - * @desc Module containing functions for Security Protocol - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsSecurity_Functions { - - // Libcommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_Functions all; - //import from LibItsCommon_TypesAndValues all; - import from LibItsCommon_Pixits all; - - // LibItsSecurity - import from LibItsSecurity_TypesAndValues all; - import from LibItsSecurity_Templates all; - import from LibItsSecurity_Pixits all; - import from LibItsSecurity_Pics all; - import from LibItsSecurity_TestSystem all; - - group helpersFunctions { - - /** - * @desc Produces a 256-bit (32-byte) hash value - * @param p_toBeHashedData Data to be used to calculate the hash value - * @return The hash value - */ - function f_hashWithSha256( - in octetstring p_toBeHashedData - ) return Oct32 { - return fx_hashWithSha256(p_toBeHashedData); - } // End of function f_hashWithSha256 - - /** - * @desc Produces a 384-bit (48-byte) hash value - * @param p_toBeHashedData Data to be used to calculate the hash value - * @return The hash value - */ - function f_hashWithSha384( - in octetstring p_toBeHashedData - ) return Oct48 { - return fx_hashWithSha384(p_toBeHashedData); - } // End of function f_hashWithSha256 - - /** - * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature based on standard IEEE 1609.2 - * @param p_toBeSignedSecuredMessage The data to be signed - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_privateKey The private key for signature - * @return The signature value - */ - function f_signWithEcdsaNistp256WithSha256( - in octetstring p_toBeSignedSecuredMessage, - in Oct32 p_certificateIssuer, - in Oct32 p_privateKey - ) return octetstring { - log(">>> f_signWithEcdsaNistp256WithSha256: p_toBeSignedSecuredMessage= ", p_toBeSignedSecuredMessage); - log(">>> f_signWithEcdsaNistp256WithSha256: p_certificateIssuer= ", p_certificateIssuer); - log(">>> f_signWithEcdsaNistp256WithSha256: p_privateKey= ", p_privateKey); - - return fx_signWithEcdsaNistp256WithSha256( - p_toBeSignedSecuredMessage, - p_certificateIssuer, - p_privateKey - ); - - } // End of function f_signWithEcdsaNistp256WithSha256 - - /** - * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature based on standard IEEE 1609.2 - * @param p_toBeSignedSecuredMessage The data to be signed - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_privateKey The private key for signature - * @return The signature value - */ - function f_signWithEcdsaBrainpoolp256r1WithSha256( - in octetstring p_toBeSignedSecuredMessage, - in Oct32 p_certificateIssuer, - in Oct32 p_privateKey - ) return octetstring { - return fx_signWithEcdsaBrainpoolp256r1WithSha256( - p_toBeSignedSecuredMessage, - p_certificateIssuer, - p_privateKey - ); - - } // End of function f_signWithEcdsaBrainpoolp256r1WithSha256 - - /** - * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature based on standard IEEE 1609.2 - * @param p_toBeSignedSecuredMessage The data to be signed - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_privateKey The private key for signature - * @return The signature value - */ - function f_signWithEcdsaBrainpoolp384r1WithSha384( - in octetstring p_toBeSignedSecuredMessage, - in Oct48 p_certificateIssuer, - in Oct48 p_privateKey - ) return octetstring { - log(">>> f_signWithEcdsaBrainpoolp384r1WithSha384: ", p_toBeSignedSecuredMessage); - log(">>> f_signWithEcdsaBrainpoolp384r1WithSha384: ", p_certificateIssuer); - log(">>> f_signWithEcdsaBrainpoolp384r1WithSha384: ", p_privateKey); - return fx_signWithEcdsaBrainpoolp384r1WithSha384( - p_toBeSignedSecuredMessage, - p_certificateIssuer, - p_privateKey - ); - - } // End of function f_signWithEcdsaBrainpoolp384r1WithSha384 - - function f_decrypt( - in octetstring p_encryptPrivateKey, - in EtsiTs103097Data p_encrypedSecuredMessage, - in octetstring p_salt, - out EtsiTs103097Data p_decrypedSecuredMessage, - out octetstring p_aes_sym_enc_key - ) return boolean { - if (ischosen(p_encrypedSecuredMessage.content.encryptedData)) { - var PKRecipientInfo v_pKRecipientInfo; - var RecipientInfo v_recipientInfo := p_encrypedSecuredMessage.content.encryptedData.recipients[0]; - var octetstring v_decryptedSecuredMessage; - - log(">>> f_decrypt: p_encryptPrivateKey=", p_encryptPrivateKey); - log(">>> f_decrypt: p_encrypedSecuredMessage=", p_encrypedSecuredMessage); - log(">>> f_decrypt: p_salt=", p_salt); - - // Check the private encryption key - if (not(isbound(p_encryptPrivateKey))) { - log("*** " & testcasename() & ":ERROR: Failed to load encryption private key ***"); - return false; - } - - if (ischosen(v_recipientInfo.certRecipInfo)) { - v_pKRecipientInfo := p_encrypedSecuredMessage.content.encryptedData.recipients[0].certRecipInfo; - // Read the certificate based on the recipientId - } else if (ischosen(v_recipientInfo.signedDataRecipInfo)) { - v_pKRecipientInfo := p_encrypedSecuredMessage.content.encryptedData.recipients[0].signedDataRecipInfo; - // Read the certificate based on the recipientId - } else { - log("*** " & testcasename() & ":ERROR: Unsupported RecipientInfo variant ***"); - return false; - } - - log("f_decrypt: v_pKRecipientInfo=", v_pKRecipientInfo); - if (isbound(v_pKRecipientInfo)) { - if (ischosen(v_pKRecipientInfo.encKey.eciesNistP256)) { - var SymmetricCiphertext v_ciphertext := p_encrypedSecuredMessage.content.encryptedData.ciphertext; - - log("f_decrypt: v_ciphertext=", v_ciphertext); - if (ischosen(v_pKRecipientInfo.encKey.eciesNistP256.v.compressed_y_0)) { - v_decryptedSecuredMessage := f_decryptWithEciesNistp256WithSha256( - v_ciphertext.aes128ccm.ccmCiphertext, - p_encryptPrivateKey, - v_pKRecipientInfo.encKey.eciesNistP256.v.compressed_y_0, - 0, - v_pKRecipientInfo.encKey.eciesNistP256.c, - v_pKRecipientInfo.encKey.eciesNistP256.t, - v_ciphertext.aes128ccm.nonce, - p_salt, - p_aes_sym_enc_key - ); - } else if (ischosen(v_pKRecipientInfo.encKey.eciesNistP256.v.compressed_y_1)) { - v_decryptedSecuredMessage := f_decryptWithEciesNistp256WithSha256( - v_ciphertext.aes128ccm.ccmCiphertext, - p_encryptPrivateKey, - v_pKRecipientInfo.encKey.eciesNistP256.v.compressed_y_1, - 1, - v_pKRecipientInfo.encKey.eciesNistP256.c, - v_pKRecipientInfo.encKey.eciesNistP256.t, - v_ciphertext.aes128ccm.nonce, - p_salt, - p_aes_sym_enc_key - ); - } else { - log("*** " & testcasename() & ":ERROR: Non canonical ephemeral encryption keys ***"); - return false; - } - if (isbound(v_decryptedSecuredMessage)) { - var bitstring v_decode := oct2bit(v_decryptedSecuredMessage); - if (decvalue(v_decode, p_decrypedSecuredMessage) == 0) { - return true; - } else { - log("*** " & testcasename() & ":ERROR: Faild to decode secured message ***"); - } - } - } else if (ischosen(v_pKRecipientInfo.encKey.eciesBrainpoolP256r1)) { - var SymmetricCiphertext v_ciphertext := p_encrypedSecuredMessage.content.encryptedData.ciphertext; - if (ischosen(v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.compressed_y_0)) { - v_decryptedSecuredMessage := f_decryptWithEciesBrainpoolp256r1WithSha256( - v_ciphertext.aes128ccm.ccmCiphertext, - p_encryptPrivateKey, - v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.compressed_y_0, - 0, - v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.c, - v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.t, - v_ciphertext.aes128ccm.nonce, - p_salt, p_aes_sym_enc_key - ); - } else if (ischosen(v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.compressed_y_1)) { - v_decryptedSecuredMessage := f_decryptWithEciesBrainpoolp256r1WithSha256( - v_ciphertext.aes128ccm.ccmCiphertext, - p_encryptPrivateKey, - v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.v.compressed_y_1, - 1, - v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.c, - v_pKRecipientInfo.encKey.eciesBrainpoolP256r1.t, - v_ciphertext.aes128ccm.nonce, - p_salt, - p_aes_sym_enc_key - ); - } else { - log("*** " & testcasename() & ":ERROR: Non canonical ephemeral encryption keys ***"); - return false; - } - } else { - log("*** " & testcasename() & ":ERROR: Non canonical ephemeral encryption keys ***"); - return false; - } - // TODO else, other variants shall be processed here if - } else { - log("*** " & testcasename() & ":ERROR: Invalid recipient info ***"); - return false; - } - if (isbound(v_decryptedSecuredMessage)) { - var bitstring v_decode := oct2bit(v_decryptedSecuredMessage); - if (decvalue(v_decode, p_decrypedSecuredMessage) == 0) { - return true; - } else { - log("*** " & testcasename() & ":ERROR: Faild to decode secured message ***"); - } - } - } else { - log("*** " & testcasename() & ":ERROR: Message not encrypted ***"); - } - - return false; - } // End of function f_decrypt - - /** - * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption using Nist-P256 algorithm - * @param p_toBeEncryptedSecuredMessage The data to be encrypted - * @param p_recipientsPublicKeyCompressed The Recipient's compressed public key - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key - * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key - * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption - * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption - * @see IEEE Std 1609.2-2017 Clause 5.3.5 Public key encryption algorithms: ECIES - * @see https://www.nominet.uk/researchblog/how-elliptic-curve-cryptography-encryption-works/ - * @see http://digital.csic.es/bitstream/10261/32671/1/V2-I2-P7-13.pdf - * @return The encrypted message - */ - function f_encryptWithEciesNistp256WithSha256( - in octetstring p_toBeEncryptedSecuredMessage, - in Oct32 p_recipientsPublicKeyCompressed, - in integer p_compressed_mode, - in octetstring p_salt, - out Oct32 p_publicEphemeralKeyCompressed, - out integer p_ephemeralKeyModeCompressed, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce - ) return octetstring { - return fx_encryptWithEciesNistp256WithSha256( - p_toBeEncryptedSecuredMessage, - p_recipientsPublicKeyCompressed, - p_compressed_mode, - p_salt, - p_publicEphemeralKeyCompressed, - p_ephemeralKeyModeCompressed, - p_aes_sym_key, - p_encrypted_sym_key, - p_authentication_vector, - p_nonce - ); - } // End of function f_encryptWithEciesNistp256WithSha256 - - /** - * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Nist-P256 algorithm - * @param p_encryptedSecuredMessage The data to be decrypted - * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key - * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key - * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption - * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption - * @return The decrypted message - * @see IEEE Std 1609.2-2017 Clause 5.3.5 Public key encryption algorithms: ECIES - * @see https://www.nominet.uk/researchblog/how-elliptic-curve-cryptography-encryption-works/ - * @see http://digital.csic.es/bitstream/10261/32671/1/V2-I2-P7-13.pdf - */ - function f_decryptWithEciesNistp256WithSha256( - in octetstring p_encryptedSecuredMessage, - in Oct32 p_privateEncKey, - in Oct32 p_publicEphemeralKeyCompressed, - in integer p_ephemeralKeyModeCompressed, - in Oct16 p_encrypted_sym_key, - in Oct16 p_authentication_vector, - in Oct12 p_nonce, - in Oct32 p_salt, - out Oct16 p_aes_sym_enc_key - ) return octetstring { - return fx_decryptWithEciesNistp256WithSha256( - p_encryptedSecuredMessage, - p_privateEncKey, - p_publicEphemeralKeyCompressed, - p_ephemeralKeyModeCompressed, - p_encrypted_sym_key, - p_authentication_vector, - p_nonce, - p_salt, - p_aes_sym_enc_key - ); - } // End of function f_decryptWithEcdsaNistp256WithSha256 - - /** - * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption using Brainpool-P256 algorithm - * @param p_toBeEncryptedSecuredMessage The data to be encrypted - * @param p_recipientsPublicKeyCompressed The Recipient's compressed public key - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key - * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key - * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption - * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption - * @return The encrypted message - * @see IEEE Std 1609.2-2017 Clause 5.3.5 Public key encryption algorithms: ECIES - * @see https://www.nominet.uk/researchblog/how-elliptic-curve-cryptography-encryption-works/ - * @see http://digital.csic.es/bitstream/10261/32671/1/V2-I2-P7-13.pdf - */ - function f_encryptWithEciesBrainpoolp256r1WithSha256( - in octetstring p_toBeEncryptedSecuredMessage, - in Oct32 p_recipientsPublicKeyCompressed, - in integer p_compressed_mode, - in octetstring p_salt, - out Oct32 p_publicEphemeralKeyCompressed, - out integer p_ephemeralKeyModeCompressed, - out Oct16 p_aes_sym_key, - out Oct16 p_encrypted_sym_key, - out Oct16 p_authentication_vector, - out Oct12 p_nonce - ) return octetstring { - return fx_encryptWithEciesBrainpoolp256r1WithSha256( - p_toBeEncryptedSecuredMessage, - p_recipientsPublicKeyCompressed, - p_compressed_mode, - p_salt, - p_publicEphemeralKeyCompressed, - p_ephemeralKeyModeCompressed, - p_aes_sym_key, - p_encrypted_sym_key, - p_authentication_vector, - p_nonce - ); - } // End of function f_encryptWithEciesBrainpoolp256r1WithSha256 - - /** - * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Brainpool-P256 algorithm - * @param p_encryptedSecuredMessage The data to be decrypted - * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key - * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key - * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption - * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption - * @return The decrypted message - * @see IEEE Std 1609.2-2017 Clause 5.3.5 Public key encryption algorithms: ECIES - * @see https://www.nominet.uk/researchblog/how-elliptic-curve-cryptography-encryption-works/ - * @see http://digital.csic.es/bitstream/10261/32671/1/V2-I2-P7-13.pdf - */ - function f_decryptWithEciesBrainpoolp256r1WithSha256( - in octetstring p_encryptedSecuredMessage, - in Oct32 p_privateEncKey, - in Oct32 p_publicEphemeralKeyCompressed, - in integer p_ephemeralKeyModeCompressed, - in Oct16 p_encrypted_sym_key, - in Oct16 p_authentication_vector, - in Oct12 p_nonce, - in Oct32 p_salt, - out Oct16 p_aes_sym_enc_key - ) return octetstring { - return fx_decryptWithEciesBrainpoolp256r1WithSha256( - p_encryptedSecuredMessage, - p_privateEncKey, - p_publicEphemeralKeyCompressed, - p_ephemeralKeyModeCompressed, - p_encrypted_sym_key, - p_authentication_vector, - p_nonce, - p_salt, - p_aes_sym_enc_key - ); - } // End of function f_decryptWithEcdsaBrainpoolp256r1WithSha256 - - /** - * @desc Compute the HashedId8 value from the hash value - * @param p_hash The hash value - * @return The HashedId8 value - * @verdict - */ - function f_hashedId8FromSha256( - in Oct32 p_hash - ) return HashedId8 { - return substr(p_hash, lengthof(p_hash) - 8, 8); - } // End of function f_hashedId8FromSha256 - - /** - * @desc Compute the HashedId8 value from the hash value - * @param p_hash The hash value - * @return The HashedId8 value - * @verdict - */ - function f_hashedId8FromSha384( - in Oct48 p_hash - ) return HashedId8 { - return substr(p_hash, lengthof(p_hash) - 8, 8); - } // End of function f_hashedId8FromSha384 - - /** - * @desc Compute the HashedId3 value from the HashedId8 value - * @param p_hashp_hashedId8 The HashedId8 value - * @return The HashedId3 value - * @verdict Unchanged - */ - function f_hashedId3FromHashedId8( - in HashedId8 p_hashedId8 - ) return HashedId3 { - return substr(p_hashedId8, lengthof(p_hashedId8) - 3, 3); - } // End of function f_hashedId3FromHashedId8 - - /** - * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_signature The signature - * @param p_ecdsaNistp256PublicKeyCompressed The compressed public key - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - function f_verifyWithEcdsaNistp256WithSha256( - in octetstring p_toBeVerifiedData, - in Oct32 p_certificateIssuer, - in Oct64 p_signature, - in Oct32 p_ecdsaNistp256PublicKeyCompressed, - in integer p_compressed_mode - ) return boolean { -// log("f_verifyWithEcdsaNistp256WithSha256: toBeVerifiedData", p_toBeVerifiedData); -// log("f_verifyWithEcdsaNistp256WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); -// log("f_verifyWithEcdsaNistp256WithSha256: signature", p_signature); -// log("f_verifyWithEcdsaNistp256WithSha256: ecdsaNistp256PublicKeyCompressed", p_ecdsaNistp256PublicKeyCompressed); - return fx_verifyWithEcdsaNistp256WithSha256( - p_toBeVerifiedData, - p_certificateIssuer, - p_signature, - p_ecdsaNistp256PublicKeyCompressed, - p_compressed_mode - ); - } // End of function f_verifyWithEcdsaNistp256WithSha256 - - /** - * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_signature The signature - * @param p_ecdsaNistp256PublicKeyX The public key (x coordinate) - * @param p_ecdsaNistp256PublicKeyY The public key (y coordinate) - * @return true on success, false otherwise - */ - function f_verifyWithEcdsaNistp256WithSha256_1( // TODO To be removed - in octetstring p_toBeVerifiedData, - in Oct32 p_certificateIssuer, - in Oct64 p_signature, - in Oct32 p_ecdsaNistp256PublicKeyX, - in Oct32 p_ecdsaNistp256PublicKeyY - ) return boolean { -// log("f_verifyWithEcdsaNistp256WithSha256: toBeVerifiedData", p_toBeVerifiedData); -// log("f_verifyWithEcdsaNistp256WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); -// log("f_verifyWithEcdsaNistp256WithSha256: signature", p_signature); -// log("f_verifyWithEcdsaNistp256WithSha256: ecdsaNistp256PublicKeyX", p_ecdsaNistp256PublicKeyX); -// log("f_verifyWithEcdsaNistp256WithSha256: ecdsaNistp256PublicKeyY", p_ecdsaNistp256PublicKeyY); - return fx_verifyWithEcdsaNistp256WithSha256_1( - p_toBeVerifiedData, - p_certificateIssuer, - p_signature, - p_ecdsaNistp256PublicKeyX, - p_ecdsaNistp256PublicKeyY); - } // End of function f_verifyWithEcdsaNistp256WithSha256_1 - - /** - * @Desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_signature The signature - * @param p_ecdsaBrainpoolp256PublicKeyCompressed The compressed public key - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - function f_verifyWithEcdsaBrainpoolp256r1WithSha256( - in octetstring p_toBeVerifiedData, - in Oct32 p_certificateIssuer, - in Oct64 p_signature, - in Oct32 p_ecdsaBrainpoolp256PublicKeyCompressed, - in integer p_compressed_mode - ) return boolean { - log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: toBeVerifiedData", p_toBeVerifiedData); - log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); - log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: signature", p_signature); - log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: ecdsaBrainpoolp256PublicKeyCompressed", p_ecdsaBrainpoolp256PublicKeyCompressed); - return fx_verifyWithEcdsaBrainpoolp256r1WithSha256( - p_toBeVerifiedData, - p_certificateIssuer, - p_signature, - p_ecdsaBrainpoolp256PublicKeyCompressed, - p_compressed_mode - ); - } // End of function f_verifyWithEcdsaBrainpoolp256r1WithSha256 - - /** - * @Desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_signature The signature - * @param p_ecdsaBrainpoolp256PublicKeyX The public key (x coordinate) - * @param p_ecdsaBrainpoolp256PublicKeyY The public key (y coordinate) - * @return true on success, false otherwise - */ - function f_verifyWithEcdsaBrainpoolp256r1WithSha256_1( // TODO To be removed - in octetstring p_toBeVerifiedData, - in Oct32 p_certificateIssuer, - in Oct64 p_signature, - in Oct32 p_ecdsaBrainpoolp256PublicKeyX, - in Oct32 p_ecdsaBrainpoolp256PublicKeyY - ) return boolean { -// log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: toBeVerifiedData", p_toBeVerifiedData); -// log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); -// log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: signature", p_signature); -// log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: ecdsaBrainpoolp256PublicKeyX", p_ecdsaBrainpoolp256PublicKeyX); -// log("f_verifyWithEcdsaBrainpoolp256r1WithSha256: ecdsaBrainpoolp256PublicKeyY", p_ecdsaBrainpoolp256PublicKeyY); - return fx_verifyWithEcdsaBrainpoolp256r1WithSha256_1( - p_toBeVerifiedData, - p_certificateIssuer, - p_signature, - p_ecdsaBrainpoolp256PublicKeyX, - p_ecdsaBrainpoolp256PublicKeyY); - } // End of function f_verifyWithEcdsaBrainpoolp256r1WithSha256_1 - - /** - * @Desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_signature The signature - * @param p_ecdsaBrainpoolp384PublicKeyX The public key (x coordinate) - * @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate) - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - function f_verifyWithEcdsaBrainpoolp384r1WithSha384( - in octetstring p_toBeVerifiedData, - in Oct48 p_certificateIssuer, - in Oct96 p_signature, - in Oct48 p_ecdsaBrainpoolp384PublicKeyCompressed, - in integer p_compressed_mode - ) return boolean { -// log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: toBeVerifiedData", p_toBeVerifiedData); -// log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); -// log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: signature", p_signature); -// log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: ecdsaBrainpoolp384PublicKeyCompressed", p_ecdsaBrainpoolp384PublicKeyCompressed); - return fx_verifyWithEcdsaBrainpoolp384r1WithSha384( - p_toBeVerifiedData, - p_certificateIssuer, - p_signature, - p_ecdsaBrainpoolp384PublicKeyCompressed, - p_compressed_mode - ); - } // End of function f_verifyWithEcdsaBrainpoolp384r1WithSha384 - - /** - * @Desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_signature The signature - * @param p_ecdsaBrainpoolp384PublicKeyX The public key (x coordinate) - * @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate) - * @return true on success, false otherwise - */ - function f_verifyWithEcdsaBrainpoolp384r1WithSha384_1( // TODO To be removed - in octetstring p_toBeVerifiedData, - in Oct48 p_certificateIssuer, - in Oct96 p_signature, - in Oct48 p_ecdsaBrainpoolp384PublicKeyX, - in Oct48 p_ecdsaBrainpoolp384PublicKeyY - ) return boolean { -// log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: toBeVerifiedData", p_toBeVerifiedData); -// log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); -// log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: signature", p_signature); -// log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: ecdsaBrainpoolp384PublicKeyX", p_ecdsaBrainpoolp384PublicKeyX); -// log("f_verifyWithEcdsaBrainpoolp384r1WithSha384: ecdsaBrainpoolp384PublicKeyY", p_ecdsaBrainpoolp384PublicKeyY); - return fx_verifyWithEcdsaBrainpoolp384r1WithSha384_1( - p_toBeVerifiedData, - p_certificateIssuer, - p_signature, - p_ecdsaBrainpoolp384PublicKeyX, - p_ecdsaBrainpoolp384PublicKeyY); - } // End of function f_verifyWithEcdsaBrainpoolp384r1WithSha384_1 - - /** - * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. - * This function should not be used by the ATS - * @param p_privateKey The new private key value - * @param p_publicKeyX The new public key value (x coordinate) - * @param p_publicKeyX The new public key value (y coordinate) - * @param p_publicKeyCompressed The compressed public keys - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - function f_generate_key_pair_nistp256( - out Oct32 p_privateKey, - out Oct32 p_publicKeyX, - out Oct32 p_publicKeyY, - out Oct32 p_publicKeyCompressed, - out integer p_compressed_mode - ) return boolean { - log(">>> f_generate_key_pair_nistp256"); - return fx_generateKeyPair_nistp256(p_privateKey, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressed_mode); - } - - /** - * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. - * This function should not be used by the ATS - * @param p_privateKey The new private key value - * @param p_publicKeyX The new public key value (x coordinate) - * @param p_publicKeyX The new public key value (y coordinate) - * @param p_publicKeyCompressed The compressed public keys - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - function f_generate_key_pair_brainpoolp256r1( - out Oct32 p_privateKey, - out Oct32 p_publicKeyX, - out Oct32 p_publicKeyY, - out Oct32 p_publicKeyCompressed, - out integer p_compressed_mode - ) return boolean { - log(">>> f_generate_key_pair_brainpoolp256r1"); - return fx_generateKeyPair_brainpoolp256r1(p_privateKey, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressed_mode); - } - - /** - * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. - * This function should not be used by the ATS - * @param p_privateKey The new private key value - * @param p_publicKeyX The new public key value (x coordinate) - * @param p_publicKeyX The new public key value (y coordinate) - * @param p_publicKeyCompressed The compressed public keys - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - function f_generate_key_pair_brainpoolp384r1( - out Oct48 p_privateKey, - out Oct48 p_publicKeyX, - out Oct48 p_publicKeyY, - out Oct48 p_publicKeyCompressed, - out integer p_compressed_mode - ) return boolean { - return fx_generateKeyPair_brainpoolp384r1(p_privateKey, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressed_mode); - } - - /** - * @desc Calculate digest over the certificate - * @param p_cert The certificate - * @return the HashedId8 value - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.13 HashedId8 - */ - function f_calculateDigestFromCertificate( - in Certificate p_cert - ) return HashedId8 { - var octetstring v_hash; - - if (PICS_SEC_SHA256) { - v_hash := f_calculateDigestSha256FromCertificate(p_cert); - } if (PICS_SEC_SHA384) { - v_hash := f_calculateDigestSha384FromCertificate(p_cert); - } - - return substr(v_hash, lengthof(v_hash) - 8, 8); - } // End of function f_calculateDigestFromCertificate - - /** - * @desc Calculate digest over the certificate - * @param p_cert The certificate - * @return the HashedId8 value - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.13 HashedId8 - */ - function f_calculateDigestSha256FromCertificate( - in EtsiTs103097Certificate p_cert - ) return HashedId8 { - var octetstring v_toBeHashedData; - var octetstring v_hash; - - v_toBeHashedData := bit2oct(encvalue(p_cert)); - v_hash := f_hashWithSha256(v_toBeHashedData); - return substr(v_hash, lengthof(v_hash) - 8, 8); - } // End of function f_calculateDigestSha256FromCertificate - - function f_calculateDigestSha384FromCertificate( - in EtsiTs103097Certificate p_cert - ) return HashedId8 { - var octetstring v_toBeHashedData; - var octetstring v_hash; - - v_toBeHashedData := bit2oct(encvalue(p_cert)); - v_hash := f_hashWithSha384(v_toBeHashedData); - return substr(v_hash, lengthof(v_hash) - 8, 8); - } // End of function f_calculateDigestSha384FromCertificate - - function f_duration2time( - in Duration p_duration - ) return UInt16 { - if (ischosen(p_duration.seconds)) { - return p_duration.seconds; - } else if (ischosen(p_duration.minutes)) { - return p_duration.minutes; - } else if (ischosen(p_duration.hours)) { - return p_duration.hours; - } else if (ischosen(p_duration.sixtyHours)) { - return p_duration.sixtyHours; - } else if (ischosen(p_duration.years)) { - return p_duration.years; - } - - return 0; // Unrechable code - } // End of function f_duration2time - - group hostSignatureHelpers { - - /** - * @desc Initialize [out] certificates according to the specified certificate name - * @param p_certificateName The certificate name to be used - * @param p_aaCertificate The AA certificate [out] - * @param p_atCertificate The AT certificate [out] - * @return true on succes, false otherwise - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2.13 HashedId8 - */ - function f_prepareCertificates( - in template (omit) charstring p_certificateName, - out EtsiTs103097Certificate p_aaCertificate, - out EtsiTs103097Certificate p_atCertificate - ) runs on ItsSecurityBaseComponent return boolean { - //log(">>> f_prepareCertificates: ", p_certificateName); - - // Load certificates if required - if ((lengthof(p_certificateName) > 0) and (valueof(p_certificateName) != cc_taCert_A)) { - var HashedId8 v_digest; - var charstring v_cert; - - if (f_readCertificate(valueof(p_certificateName), p_atCertificate) == false){ - log("f_prepareCertificates: Failed to read certificate ", p_certificateName); - return false; - } - if (ischosen(p_atCertificate.issuer.sha256AndDigest)) { - v_digest := p_atCertificate.issuer.sha256AndDigest; - } else if (ischosen(p_atCertificate.issuer.sha384AndDigest)) { - v_digest := p_atCertificate.issuer.sha384AndDigest; - } else { - log("f_prepareCertificates: Invalid certificate issuer ", p_atCertificate.issuer); - return false; - } - if (f_getCertificateFromDigest(v_digest, p_aaCertificate, v_cert) == false) { - log("f_prepareCertificates: Failed to read certificate issuer ", v_digest); - return false; - } - } else { - p_atCertificate := vc_atCertificate; - p_aaCertificate := vc_aaCertificate; - } - // Store the certificate to build this message - vc_lastAtCertificateUsed := p_atCertificate; - - return true; - } // End of function f_prepareCertificates - - /** - * @desc This function build and sign the SecureMessage part covered by the signature process - * @param p_securedMessage The signed SecureMessage part - * @param p_payloadField Payloads to be included in the message - * @param p_mandatoryHeaders Mandatory headers for the selected profile - * @param p_headerInfo HeaderInfo to be inserted in the message - * @param p_securityProfile Selected security profile - * @return true on success, false otherwise - */ - function f_buildGnSecuredMessage( - inout EtsiTs103097Data p_securedMessage, - in charstring p_certificateName, - in ToBeSignedData p_payloadField - ) runs on ItsSecurityBaseComponent return boolean { - - // Local variables - var octetstring v_secPayload, v_signature; - var ToBeSignedData v_toBeSignedData; - var octetstring v_certificateIssuer; - var octetstring v_privateKey; - - log(">>> f_buildGnSecuredMessage: p_securedMessage=", p_securedMessage); - log(">>> f_buildGnSecuredMessage: p_payloadField=", p_payloadField); - - // Prepare payload to be signed - v_toBeSignedData := valueof(p_payloadField); - v_secPayload := bit2oct(encvalue(v_toBeSignedData)); - log("f_buildGnSecuredMessage: v_secPayload=", v_secPayload); - - // Signed payload - if (ispresent(p_certificateName) and (valueof(p_certificateName) != cc_taCert_A)) { - if(not f_readSigningKey(valueof(p_certificateName), v_privateKey)){ - return false; - } - } else { - if(not f_readSigningKey(cc_taCert_A, v_privateKey)){ - return false; - } - } -// log("f_buildGnSecuredMessage: v_privateKey=", v_privateKey); - f_getCertificateHash(p_certificateName, v_certificateIssuer); - - if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature)) { - v_signature := f_signWithEcdsaNistp256WithSha256( - v_secPayload, - v_certificateIssuer, - v_privateKey - ); - p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only(substr(v_signature, 0, 32)), - substr(v_signature, 32, 32) - ) - )); - } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { - v_signature := f_signWithEcdsaBrainpoolp256r1WithSha256( - v_secPayload, - v_certificateIssuer, - v_privateKey - ); - p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP256r1( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only(substr(v_signature, 0, 32)), - substr(v_signature, 32, 32) - ) - )); - } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature)) { - v_signature := f_signWithEcdsaBrainpoolp384r1WithSha384( - v_secPayload, - v_certificateIssuer, - v_privateKey - ); - p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP384r1( - m_ecdsaP384Signature( - m_eccP384CurvePoint_x_only(substr(v_signature, 0, 48)), - substr(v_signature, 48, 48) - ) - )); - } // TODO To be continued - -// log("<<< f_buildGnSecuredMessage: p_securedMessage=", p_securedMessage); - return true; - } // End of function f_buildGnSecuredMessage - - /** - * @desc This function build and sign the SecureMessage part covered by the signature process including wrong elements of protocols. It is used for BO test cases - * @param p_securedMessage The signed SecureMessage part - * @param p_certificateName The certificate name - * @param p_protocolVersion The protocol version to be set. Default: 2 - * @param p_trailerStatus The Traile behaviour: - *
  • 0 for no trailer
  • - *
  • 1 for invalid trailer
  • - *
  • 2 for duplicated trailer
  • - * @param p_payloadField Payloads to be included in the message - * @param p_mandatoryHeaders Mandatory headers for the selected profile - * @param p_headerInfo HeaderInfo to be inserted in the message - * @param p_securityProfile Selected security profile - * @return true on success, false otherwise - */ - function f_buildGnSecuredMessage_Bo( - inout EtsiTs103097Data p_securedMessage, - in template (value) charstring p_certificateName, - in UInt8 p_protocolVersion := c_protocol_version, - in integer p_trailerStatus := 0, - in template (value) ToBeSignedData p_payloadField, - in template (value) HeaderInfo p_mandatoryHeaders, - in template (omit) HeaderInfo p_headerInfo := omit - ) return boolean { - - // Local variables - var octetstring v_secPayload, v_signature; - var template (value) ToBeSignedData v_toBeSignedData; - var integer i, j, k, n; - var HeaderInfo v_headerFields; - var Ieee1609Dot2Content v_toBeSignedPayload; - var Oct32 v_privateKey; - var UInt8 v_trailerSize; - - // Prepare headers - if (not(ispresent(p_headerInfo))) { - v_headerFields := valueof(p_mandatoryHeaders); - } else {/* FIXME To be reviewed - // Merge p_headerInfo and v_mandatoryHeaders into v_headerFields - - i := 0; // index for p_headerInfo - j := 0; // index for v_mandatoryHeaders - k := 0; // index for v_headerFields - - // Special processing for signer_info - if (lengthof(valueof(p_headerInfo)) > 0 and valueof(p_headerInfo[i].type_) == e_signer_info) { - v_headerFields[k] := valueof(p_headerInfo[i]); - k := k + 1; - i := i + 1; - } - - for (j := j; j < lengthof(p_mandatoryHeaders); j := j + 1) { - // Search for mandatory header in p_HeaderFields - for (n := 0; n < lengthof(p_headerInfo); n := n + 1) { - if (valueof(p_headerInfo[n].type_) == valueof(p_mandatoryHeaders[j].type_)) { - // mandatory header already in p_HeaderFields - break; - } - } // End of 'for' statement - if (n >= lengthof(p_headerInfo)) { - if (valueof(p_mandatoryHeaders[j].type_) != e_signer_info) { - // Add headers from p_headerInfo having lower number than mandatory header - for (n := i; n < lengthof(p_headerInfo) and valueof(p_headerInfo[n].type_) < valueof(p_mandatoryHeaders[j].type_); n := n + 1) { - v_headerFields[k] := valueof(p_headerInfo[n]); - k := k + 1; - i := i + 1; - } - } - // Add mandatory header - v_headerFields[k] := valueof(p_mandatoryHeaders[j]); - k := k + 1; - } - } // End of 'for' statement - - // Add remaining headers from p_HeaderFields - for ( i := i; i < lengthof(p_headerInfo); i := i + 1) { - // Add headers from p_headerInfo having lower number than mandatory header - v_headerFields[k] := valueof(p_headerInfo[i]); - k := k + 1; - } // End of 'for' statement - */} - - // Prepare payload to be signed - /* FIXME To be reviewed v_toBeSignedPayload := valueof(p_payloadField); -// log("p_trailerStatus=", p_trailerStatus); - if (p_trailerStatus == 0) { - v_trailerSize := 0; - } else if (p_trailerStatus == 1) { - v_trailerSize := 67; - } else if (p_trailerStatus == 2) { - v_trailerSize := 2 * 67; - } else { - v_trailerSize := 67; - } - v_toBeSignedData := m_toBeSignedSecuredMessage_wrong_protocol( - v_headerFields, - v_toBeSignedPayload, - e_signature, - p_protocolVersion, - v_trailerSize - );*/ -// log("m_toBeSignedSecuredMessage_wrong_protocol=", v_toBeSignedData); - - /* FIXME To be reviewedv_secPayload := bit2oct(encvalue(v_toBeSignedData)); -// log("v_secPayload=", v_secPayload); - - // Signed payload - if (ispresent(p_certificateName) and (valueof(p_certificateName) != cc_taCert_A)) { - if(not f_readSigningKey(valueof(p_certificateName), v_privateKey)){ - return false; - } - } else { - if(not f_readSigningKey(cc_taCert_A, v_privateKey)){ - return false; - } - } - v_signature := f_signWithEcdsaNistp256WithSha256( - v_secPayload, - v_privateKey - );*/ -// log("v_signature=", v_signature); - -// log("p_trailerStatus=", p_trailerStatus); - /* FIXME To be reviewed if (p_trailerStatus == 0) { // No signature - p_securedMessage := m_securedMessage( - valueof(v_toBeSignedData.header_fields), - p_payloadField, - { } - ); - v_trailerSize := 0; - } else if (p_trailerStatus == 2) { // Duplicate signature - p_securedMessage := m_securedMessage( - valueof(v_toBeSignedData.header_fields), - p_payloadField, - { - m_trailer_field_signature( - m_signature( - m_ecdsaSignature( - m_eccPointecdsa_nistp256_with_sha256_y_coordinate_only( - substr(v_signature, 2, 32) - ), - substr(v_signature, 34, 32) - ) - ) - ), - m_trailer_field_signature( - m_signature( - m_ecdsaSignature( - m_eccPointecdsa_nistp256_with_sha256_y_coordinate_only( - substr(v_signature, 2, 32) - ), - substr(v_signature, 34, 32) - ) - ) - ) - } - ); - } else if (p_trailerStatus == 3) { // Signature with reserved algorthm - p_securedMessage := m_ieee1609Dot2Data_wrong_protocol( - p_protocolVersion, - valueof(v_toBeSignedData.header_fields), - p_payloadField, - { - m_trailer_field_signature( - m_unknownSignature( - v_signature - ) - ) - } - ); - } else { // Invalid signature - p_securedMessage := m_securedMessage( - valueof(v_toBeSignedData.header_fields), - p_payloadField, - { - m_trailer_field_signature( - m_signature( - m_ecdsaSignature( - m_eccPointecdsa_nistp256_with_sha256_y_coordinate_only( - substr(v_signature, 2, 32) - ), - substr(v_signature, 34, 32) - ) - ) - ) - } - ); - p_securedMessage.trailer_fields[0].trailerField.signature_.ecdsaNistP256Signature.sSig := not4b(valueof(p_securedMessage.trailer_fields[0].trailerField.signature_.ecdsaNistP256Signature.sSig)); - }*/ - - return false;/* FIXME To be reviewed true;*/ - } // End of function f_buildGnSecuredMessage_Bo - - /** - * @desc This function build and sign the SecureMessage part covered by the signature process - * @param p_securedMessage The signed SecureMessage part - * @param p_payloadField Payloads to be included in the message - * @param p_signerIdentifierType Add digest or AT certificate or certificate chain - * @param p_certificateName The certificate identifier to be used. Default: TA_CERT_A - * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerInfo - * @return true on success, false otherwise - * - * @see Draft ETSI TS 103 097 V1.1.14 Clause 7.1 Security profile for CAMs - */ - function f_buildGnSecuredCam( - out EtsiTs103097Data p_securedMessage, - in ToBeSignedData p_payloadField, - in SignerIdentifier p_signerIdentifierType, - in charstring p_certificateName := "" - ) runs on ItsSecurityBaseComponent return boolean { - // Local variables - var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; - - log(">>> f_buildGnSecuredCam: p_securedMessage= ", p_securedMessage); - log(">>> f_buildGnSecuredCam: p_payloadField= ", p_payloadField); - - // Load certificates if required - if (f_prepareCertificates(p_certificateName, v_aaCertificate, v_atCertificate) == false) { - return false; - } - //log("f_buildGnSecuredCam: v_atCertificate = ", v_atCertificate); - - // Fill the structure with default values, these values will be updated later - p_securedMessage := valueof(m_etsiTs103097Data_signed( - m_signedData( - sha256, - p_payloadField, - m_signerIdentifier_self, - m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only(int2oct(0, 32)), - int2oct(0, 32) - ) - ) - ) - )); - // Prepare mandatory headers - log("f_buildGnSecuredCam: p_signerIdentifierType=", p_signerIdentifierType); - if (ischosen(p_signerIdentifierType.digest)) { // Add the AT certificate digest - if (ischosen(v_atCertificate.issuer.sha256AndDigest)) { - p_securedMessage.content.signedData.hashId := sha256; - p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_digest( - f_calculateDigestSha256FromCertificate(v_atCertificate) - )); - } else if (ischosen(v_atCertificate.issuer.sha384AndDigest)) { - p_securedMessage.content.signedData.hashId := sha384; - p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_digest( - f_calculateDigestSha384FromCertificate(v_atCertificate) - )); - } - } - if (ispresent(v_atCertificate.signature_)) { - if (ischosen(v_atCertificate.signature_.ecdsaBrainpoolP256r1Signature)) { - p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP256r1( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only(int2oct(0, 32)), - int2oct(0, 32) - ) - )); - } else if (ischosen(v_atCertificate.signature_.ecdsaBrainpoolP384r1Signature)) { - p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP384r1( - m_ecdsaP384Signature( - m_eccP384CurvePoint_x_only(int2oct(0, 48)), - int2oct(0, 48) - ) - )); - } // else, m_signature_ecdsaNistP256 already chosen by default - } - log("f_buildGnSecuredCam: p_securedMessage = ", p_securedMessage); - - return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField/*, v_mandatoryHeaders*/); - - } // End of function f_buildGnSecuredCam - - /** - * @desc This function build and sign the SecureMessage part covered by the signature process including wrong elements of protocols. It is used for BO test cases - * @param p_securedMessage The signed SecureMessage part - * @param p_signerIdentifierType Add digest or AT certificate or certificate chain - * @param p_certificateName The certificate identifier to be used. Default: TA_CERT_A - * @param p_protocolVersion The protocol version to be set. Default: 2 - * @param p_alterIssuerIdentifier Set to true to alter IssuerIdentifier - * @param p_alterATCertificateSignature Set to true to alter the AT certificate signature - * @param p_alterAACertificateSignature Set to true to alter the AA certificate signature - * @return true on success, false otherwise - * - * @see Draft ETSI TS 103 097 V1.1.14 Clause 7.1 Security profile for CAMs - */ - function f_buildGnSecuredCam_Bo( - out EtsiTs103097Data p_securedMessage, - in ToBeSignedData p_payloadField, - in SignerIdentifier p_signerIdentifierType, // FIXME To be reviewed - in charstring p_certificateName, - in UInt8 p_protocolVersion, - in boolean p_alter_psid, - in boolean p_add_generation_location, - in boolean p_add_expiry_time, - in boolean p_add_p2pcd_learning_request, - in boolean p_add_missing_crl_identifier, - in boolean p_add_encryption_key, - in boolean p_alter_signature_algorithm, - in boolean p_alter_signer_identifier, - in boolean p_alter_signature - ) runs on ItsSecurityBaseComponent return boolean { - - // Local variables - var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; - var HeaderInfo v_mandatoryHeaders := valueof(m_ieee1609Dot2_headerInfo(0)); - var HeaderInfo v_signerInfo; - - // Load certificates if required - if (f_prepareCertificates(p_certificateName, v_aaCertificate, v_atCertificate) == false) { - return false; - } - - // Fill the structure with default values, these values will be updated later - p_securedMessage := valueof(m_etsiTs103097Data_signed( - m_signedData( - sha256, - p_payloadField, - m_signerIdentifier_self, - m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only(int2oct(0, 32)), - int2oct(0, 32) - ) - ) - ) - )); - // Prepare mandatory headers - //log("f_buildGnSecuredCam: p_signerIdentifierType=", p_signerIdentifierType); - if (ischosen(p_signerIdentifierType.digest)) { // Add the AT certificate digest - if (ischosen(v_atCertificate.issuer.sha256AndDigest)) { - p_securedMessage.content.signedData.hashId := sha256; - p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_digest( - f_calculateDigestSha256FromCertificate(v_atCertificate) - )); - } else if (ischosen(v_atCertificate.issuer.sha384AndDigest)) { - p_securedMessage.content.signedData.hashId := sha384; - p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_digest( - f_calculateDigestSha384FromCertificate(v_atCertificate) - )); - } - } - if (ispresent(v_atCertificate.signature_)) { - if (ischosen(v_atCertificate.signature_.ecdsaBrainpoolP256r1Signature)) { - p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP256r1( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only(int2oct(0, 32)), - int2oct(0, 32) - ) - )); - } else if (ischosen(v_atCertificate.signature_.ecdsaBrainpoolP384r1Signature)) { - p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP384r1( - m_ecdsaP384Signature( - m_eccP384CurvePoint_x_only(int2oct(0, 48)), - int2oct(0, 48) - ) - )); - } // else, m_signature_ecdsaNistP256 already chosen by default - } - log("f_buildGnSecuredCam_Bo: p_securedMessage = ", p_securedMessage); - - // Alter protocolVersion - p_securedMessage.protocolVersion := p_protocolVersion; - // Alter psid - if (p_alter_psid == true) { - p_securedMessage.content.signedData.tbsData.headerInfo.psid := 99; - } - // Add generationLocation - if (p_add_generation_location == true) { - p_securedMessage.content.signedData.tbsData.headerInfo.generationLocation := valueof(m_threeDLocation(PX_WGSLATITUDE, PX_WGSLONGITUDE, 0)); - } - if (p_add_expiry_time == true) { - p_securedMessage.content.signedData.tbsData.headerInfo.expiryTime := f_getCurrentTimeUtc() + 3600; - } - if (p_add_p2pcd_learning_request == true) { - p_securedMessage.content.signedData.tbsData.headerInfo.p2pcdLearningRequest := 'CAFEDE'O; - } - if (p_add_missing_crl_identifier == true) { - p_securedMessage.content.signedData.tbsData.headerInfo.missingCrlIdentifier := { - cracaId := 'CAFEDE'O, - crlSeries := 0 - }; - } - if (p_add_encryption_key == true) { - p_securedMessage.content.signedData.tbsData.headerInfo.encryptionKey := valueof( - m_encryptionKey_public( - m_encryptionKey( - -, - m_publicEncryptionKey_eciesNistP256( - m_eccP256CurvePoint_x_only(int2oct(5096, 32)) - )))); - } - if (p_alter_signature_algorithm == true) { - if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature)) { - // Change it in to Brainpool P256r1 - p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature := valueof(m_ecdsaSignature( - p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig, - p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig - )); - } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { - // Change it in to NistP256 - p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature := valueof(m_ecdsaSignature( - p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.rSig, - p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig - )); - } else { - var EccP256CurvePoint r_sig; - // Change it in to Brainpool P256r1 - if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.compressed_y_0)) { - r_sig := valueof(m_eccP256CurvePoint_compressed_y_0(str2oct(substr(oct2str(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.compressed_y_0), 0, 32 * 2)))); - } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.compressed_y_1)) { - r_sig := valueof(m_eccP256CurvePoint_compressed_y_1(str2oct(substr(oct2str(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.compressed_y_1), 0, 32 * 2)))); - } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only)) { - r_sig := valueof(m_eccP256CurvePoint_x_only(str2oct(substr(oct2str(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only), 0, 32 * 2)))); - } else { - // TODO - log("f_buildGnSecuredCam_Bo: Unsupported signature variant"); - } - p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature := valueof(m_ecdsaSignature( - r_sig, - str2oct(substr(oct2str(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig), 0, 32 * 2)) - )); - } - } - if (p_alter_signer_identifier == true) { - p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_self); - } - if (p_alter_signature == true) { - if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature)) { - p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig := not4b(valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig)); - } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { - p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig := not4b(valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig)); - } else { - p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig := not4b(valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig)); - } - } - - return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField); - /*if (p_alterATCertificateSignature == true) { - v_atCertificate.signature_.ecdsaNistP256Signature.sSig := not4b(v_atCertificate.signature_.ecdsaNistP256Signature.sSig); - } - if (p_alterAACertificateSignature == true) { - v_aaCertificate.signature_.ecdsaNistP256Signature.sSig := not4b(v_aaCertificate.signature_.ecdsaNistP256Signature.sSig); - }*/ - - /* FIXME To be reviewed if (p_addMissingHeaders == true) { - // Prepare mandatory headers - if (valueof(p_signerIdentifierType) == e_certificate) { // Add the AT certificate - v_signerInfo := valueof( - m_header_info_signer_info( - m_signerIdentifier_certificate( - v_atCertificate - ))); - } else if (valueof(p_signerIdentifierType) == e_certificate_chain) { // Add the AT certificate + AA EtsiTs103097Certificate - v_signerInfo := valueof( - m_header_info_signer_info( - m_signerIdentifier_certificates( - { - v_aaCertificate, - v_atCertificate - } - ) - )); - } else if (valueof(p_signerIdentifierType) == e_certificate_digest_with_sha256) { // Add the AT certificate digest - v_signerInfo := valueof( - m_header_info_signer_info( - m_issuerIdentifier_sha256AndDigest( - f_calculateDigestFromCertificate(v_atCertificate) - ))); - } - v_mandatoryHeaders := { - v_signerInfo, - valueof(m_header_info_generation_time(1000 * f_getCurrentTime())), // In us - valueof(m_header_info_its_aid(c_its_aid_CAM)) - } - } - - return f_buildGnSecuredMessage_Bo(p_securedMessage, p_certificateName, p_protocolVersion, p_trailerStatus, p_payloadField, v_mandatoryHeaders, p_headerInfo);*/ - - } // End of function f_buildGnSecuredCam_Bo - - /** - * @desc This function build and sign the SecureMessage part covered by the signature process - * @param p_securedMessage The signed SecureMessage part - * @param p_payloadField Payloads to be included in the message - * @param p_signerIdentifierType Add digest or AT certificate or certificate chain - * @param p_threeDLocation The 3D location - * @param p_headerInfo HeaderInfo to be inserted in the message - * @param p_certificateName The certificate identifier to be used. Default: TA_CERT_A - * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerInfo - * @return true on success, false otherwise - */ - function f_buildGnSecuredDenm( - out EtsiTs103097Data p_securedMessage, - in ToBeSignedData p_payloadField, - in SignerIdentifier p_signerIdentifierType, - in charstring p_certificateName := "" - ) runs on ItsSecurityBaseComponent return boolean { - // Local variables - var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; - - log(">>> f_buildGnSecuredDenm: p_securedMessage= ", p_securedMessage); - log(">>> f_buildGnSecuredDenm: p_payloadField= ", p_payloadField); - - // Load certificates if required - if (f_prepareCertificates(p_certificateName, v_aaCertificate, v_atCertificate) == false) { - return false; - } - //log("f_buildGnSecuredDenm: v_atCertificate = ", v_atCertificate); - - p_securedMessage := valueof(m_etsiTs103097Data_signed( - m_signedData( - sha256, - p_payloadField, - m_signerIdentifier_self, - m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only(int2oct(0, 32)), - int2oct(0, 32) - ) - ) - ) - )); - // Prepare mandatory headers - log("f_buildGnSecuredDenm: p_signerIdentifierType=", p_signerIdentifierType); - if (ischosen(p_signerIdentifierType.digest)) { // Add the AT certificate digest - if (ischosen(v_atCertificate.issuer.sha256AndDigest)) { - p_securedMessage.content.signedData.hashId := sha256; - p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_digest( - f_calculateDigestSha256FromCertificate(v_atCertificate) - )); - } else if (ischosen(v_atCertificate.issuer.sha384AndDigest)) { - p_securedMessage.content.signedData.hashId := sha384; - p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_digest( - f_calculateDigestSha384FromCertificate(v_atCertificate) - )); - } - } - if (ispresent(v_atCertificate.signature_)) { - if (ischosen(v_atCertificate.signature_.ecdsaBrainpoolP256r1Signature)) { - p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP256r1( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only(int2oct(0, 32)), - int2oct(0, 32) - ) - )); - } else if (ischosen(v_atCertificate.signature_.ecdsaBrainpoolP384r1Signature)) { - p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP384r1( - m_ecdsaP384Signature( - m_eccP384CurvePoint_x_only(int2oct(0, 48)), - int2oct(0, 48) - ) - )); - } // else, m_signature_ecdsaNistP256 already chosen by default - } - log("f_buildGnSecuredDenm: p_securedMessage = ", p_securedMessage); - - return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField/*, v_mandatoryHeaders*/); - } // End of function f_buildGnSecuredDenm - - /** - * @desc This function build and sign the SecureMessage part covered by the signature process including wrong elements of protocols. It is used for BO test cases - * @param p_securedMessage The signed SecureMessage part - * @param p_protocolVersion The protocol version to be set. Default: 2 - * @param p_trailerStatus The Traile behaviour: - *
  • 0 for no trailer
  • - *
  • 1 for invalid trailer
  • - *
  • 2 for duplicated trailer
  • - * @param p_payloadField Payloads to be included in the message - * @param p_signerIdentifierType Add digest or AT certificate or certificate chain - * @param p_threeDLocation The 3D location - * @param p_headerInfo HeaderInfo to be inserted in the message - * @param p_certificateName The certificate identifier to be used. Default: TA_CERT_A - * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerInfo - * @return true on success, false otherwise - */ - function f_buildGnSecuredDenm_Bo( - out EtsiTs103097Data p_securedMessage, - in ToBeSignedData p_payloadField, - in SignerIdentifier p_signerIdentifierType, // FIXME To be reviewed - in charstring p_certificateName, - in UInt8 p_protocolVersion, - in boolean p_alter_psid, - in boolean p_remove_generation_location := true, // Shall be present for DENM - in boolean p_add_expiry_time, - in boolean p_add_p2pcd_learning_request, - in boolean p_add_missing_crl_identifier, - in boolean p_add_encryption_key, - in boolean p_alter_signature_algorithm, - in boolean p_alter_signer_identifier, - in boolean p_alter_signature - ) runs on ItsSecurityBaseComponent return boolean { - // Local variables - var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; - var HeaderInfo v_mandatoryHeaders := valueof(m_ieee1609Dot2_headerInfo(0)); - var HeaderInfo v_signerInfo; - - // Load certificates if required - if (f_prepareCertificates(p_certificateName, v_aaCertificate, v_atCertificate) == false) { - return false; - } - - // Fill the structure with default values, these values will be updated later - p_securedMessage := valueof(m_etsiTs103097Data_signed( - m_signedData( - sha256, - p_payloadField, - m_signerIdentifier_self, - m_signature_ecdsaNistP256( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only(int2oct(0, 32)), - int2oct(0, 32) - ) - ) - ) - )); - // Prepare mandatory headers - //log("f_buildGnSecuredCam: p_signerIdentifierType=", p_signerIdentifierType); - if (ischosen(p_signerIdentifierType.digest)) { // Add the AT certificate digest - if (ischosen(v_atCertificate.issuer.sha256AndDigest)) { - p_securedMessage.content.signedData.hashId := sha256; - p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_digest( - f_calculateDigestSha256FromCertificate(v_atCertificate) - )); - } else if (ischosen(v_atCertificate.issuer.sha384AndDigest)) { - p_securedMessage.content.signedData.hashId := sha384; - p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_digest( - f_calculateDigestSha384FromCertificate(v_atCertificate) - )); - } - } - if (ispresent(v_atCertificate.signature_)) { - if (ischosen(v_atCertificate.signature_.ecdsaBrainpoolP256r1Signature)) { - p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP256r1( - m_ecdsaP256Signature( - m_eccP256CurvePoint_x_only(int2oct(0, 32)), - int2oct(0, 32) - ) - )); - } else if (ischosen(v_atCertificate.signature_.ecdsaBrainpoolP384r1Signature)) { - p_securedMessage.content.signedData.signature_ := valueof(m_signature_ecdsaBrainpoolP384r1( - m_ecdsaP384Signature( - m_eccP384CurvePoint_x_only(int2oct(0, 48)), - int2oct(0, 48) - ) - )); - } // else, m_signature_ecdsaNistP256 already chosen by default - } - log("f_buildGnSecuredDenm_Bo: p_securedMessage = ", p_securedMessage); - - // Alter protocolVersion - p_securedMessage.protocolVersion := p_protocolVersion; - // Alter psid - if (p_alter_psid == true) { - p_securedMessage.content.signedData.tbsData.headerInfo.psid := 99; - } - // Remove generationLocation - if (p_remove_generation_location == true) { - p_securedMessage.content.signedData.tbsData.headerInfo.generationLocation := omit; - } - if (p_add_expiry_time == true) { - p_securedMessage.content.signedData.tbsData.headerInfo.expiryTime := f_getCurrentTimeUtc() + 3600; - } - if (p_add_p2pcd_learning_request == true) { - p_securedMessage.content.signedData.tbsData.headerInfo.p2pcdLearningRequest := 'CAFEDE'O; - } - if (p_add_missing_crl_identifier == true) { - p_securedMessage.content.signedData.tbsData.headerInfo.missingCrlIdentifier := { - cracaId := 'CAFEDE'O, - crlSeries := 0 - }; - } - if (p_add_encryption_key == true) { - p_securedMessage.content.signedData.tbsData.headerInfo.encryptionKey := valueof( - m_encryptionKey_public( - m_encryptionKey( - -, - m_publicEncryptionKey_eciesNistP256( - m_eccP256CurvePoint_x_only(int2oct(5096, 32)) - )))); - } - if (p_alter_signature_algorithm == true) { - if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature)) { - // Change it in to Brainpool P256r1 - p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature := valueof(m_ecdsaSignature( - p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig, - p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig - )); - } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { - // Change it in to NistP256 - p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature := valueof(m_ecdsaSignature( - p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.rSig, - p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig - )); - } else { - var EccP256CurvePoint r_sig; - // Change it in to Brainpool P256r1 - if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.compressed_y_0)) { - r_sig := valueof(m_eccP256CurvePoint_compressed_y_0(str2oct(substr(oct2str(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.compressed_y_0), 0, 32 * 2)))); - } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.compressed_y_1)) { - r_sig := valueof(m_eccP256CurvePoint_compressed_y_1(str2oct(substr(oct2str(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.compressed_y_1), 0, 32 * 2)))); - } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only)) { - r_sig := valueof(m_eccP256CurvePoint_x_only(str2oct(substr(oct2str(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only), 0, 32 * 2)))); - } else { - // TODO - log("f_buildGnSecuredDenm_Bo: Unsupported signature variant"); - } - p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature := valueof(m_ecdsaSignature( - r_sig, - str2oct(substr(oct2str(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig), 0, 32 * 2)) - )); - } - } - if (p_alter_signer_identifier == true) { - p_securedMessage.content.signedData.signer := valueof(m_signerIdentifier_self); - } - if (p_alter_signature == true) { - if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature)) { - p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig := not4b(valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig)); - } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { - p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig := not4b(valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig)); - } else { - p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig := not4b(valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig)); - } - } - return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField); - } // End of function f_buildGnSecuredDenm_Bo - - /** - * @desc This function build and sign the SecureMessage part covered by the signature process - * @param p_securedMessage The signed SecureMessage part - * @param p_payloadField Payloads to be included in the message - * @param p_signerIdentifierType Add digest or AT certificate or certificate chain - * @param p_threeDLocation The 3D location - * @param p_headerInfo HeaderInfo to be inserted in the message - * @param p_certificateName The certificate identifier to be used. Default: TA_CERT_A - * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerInfo - * @return true on success, false otherwise - */ - function f_buildGnSecuredOtherMessage( - inout EtsiTs103097Data p_securedMessage, - in ToBeSignedData p_payloadField, - in SignerIdentifier p_signerIdentifierType, // FIXME To be reviewed - in ThreeDLocation p_threeDLocation, - in template (omit) HeaderInfo p_headerInfo := omit, - in charstring p_certificateName := "", - in boolean p_addMissingHeaders := true - ) runs on ItsSecurityBaseComponent return boolean { - - // Local variables - var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; - var HeaderInfo v_mandatoryHeaders := valueof(m_ieee1609Dot2_headerInfo(0)); - var HeaderInfo v_signerInfo; - - // Load certificates if required - if (f_prepareCertificates(p_certificateName, v_aaCertificate, v_atCertificate) == false) { - return false; - } - - // Add additional headers if required - /* FIXME To be reviewed if (p_addMissingHeaders == true) { - // Prepare mandatory headers - if (valueof(p_signerIdentifierType) == e_certificate) { // Add the AT certificate - v_signerInfo := valueof( - m_header_info_signer_info( - m_signerIdentifier_certificate( - v_atCertificate - ))); - } else if (valueof(p_signerIdentifierType) == e_certificate_chain) { // Add the AT certificate + AA EtsiTs103097Certificate - v_signerInfo := valueof( - m_header_info_signer_info( - m_signerIdentifier_certificates( - { - v_aaCertificate, - v_atCertificate - } - ) - )); - } else if (valueof(p_signerIdentifierType) == e_certificate_digest_with_sha256) { // Add the AT certificate digest - v_signerInfo := valueof( - m_header_info_signer_info( - m_issuerIdentifier_sha256AndDigest( - v_atCertificate.cracaId - ))); - } - v_mandatoryHeaders := { - v_signerInfo, - valueof(m_header_info_generation_time(1000 * f_getCurrentTime())), // In us - valueof(m_header_info_generation_location(p_threeDLocation)) - } - }*/ - - // Build the secured message and return it - return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField/*, v_mandatoryHeaders*/); - } // End of function f_buildGnSecuredOtherMessage - - /** - * @desc This function build and sign the SecureMessage part covered by the signature process including wrong elements of protocols. It is used for BO test cases - * @param p_securedMessage The signed SecureMessage part - * @param p_protocolVersion The protocol version to be set. Default: 2 - * @param p_trailerStatus The Traile behaviour: - *
  • 0 for no trailer
  • - *
  • 1 for invalid trailer
  • - *
  • 2 for duplicated trailer
  • - * @param p_payloadField Payloads to be included in the message - * @param p_signerIdentifierType Add digest or AT certificate or certificate chain - * @param p_threeDLocation The 3D location - * @param p_headerInfo HeaderInfo to be inserted in the message - * @param p_certificateName The certificate identifier to be used. Default: TA_CERT_A - * @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerInfo - * @return true on success, false otherwise - */ - function f_buildGnSecuredOtherMessage_Bo( - inout EtsiTs103097Data p_securedMessage, - in UInt8 p_protocolVersion := c_protocol_version, - in integer p_trailerStatus := 0, - in ToBeSignedData p_payloadField, - in SignerIdentifier p_signerIdentifierType, // FIXME To be reviewed - in ThreeDLocation p_threeDLocation, - in template (omit) HeaderInfo p_headerInfo := omit, - in charstring p_certificateName := "", - in boolean p_addMissingHeaders := true - ) runs on ItsSecurityBaseComponent return boolean { - - // Local variables - var EtsiTs103097Certificate v_aaCertificate, v_atCertificate; - var HeaderInfo v_mandatoryHeaders := valueof(m_ieee1609Dot2_headerInfo(0)); - var HeaderInfo v_signerInfo; - - // Load certificates if required - if (f_prepareCertificates(p_certificateName, v_aaCertificate, v_atCertificate) == false) { - return false; - } - - // Add additional headers if required - /* FIXME To be reviewed if (p_addMissingHeaders == true) { - // Prepare mandatory headers - if (valueof(p_signerIdentifierType) == e_certificate) { // Add the AT certificate - v_signerInfo := valueof( - m_header_info_signer_info( - m_signerIdentifier_certificate( - v_atCertificate - ))); - } else if (valueof(p_signerIdentifierType) == e_certificate_chain) { // Add the AT certificate + AA EtsiTs103097Certificate - v_signerInfo := valueof( - m_header_info_signer_info( - m_signerIdentifier_certificates( - { - v_aaCertificate, - v_atCertificate - } - ) - )); - } else if (valueof(p_signerIdentifierType) == e_certificate_digest_with_sha256) { // Add the AT certificate digest - v_signerInfo := valueof( - m_header_info_signer_info( - m_issuerIdentifier_sha256AndDigest( - v_atCertificate.cracaId - ))); - } - v_mandatoryHeaders := { - v_signerInfo, - valueof(m_header_info_generation_time(1000 * f_getCurrentTime())), // In us - valueof(m_header_info_generation_location(p_threeDLocation)) - } - }*/ - - // FIXME To be done - - // Build the secured message and return it - return f_buildGnSecuredMessage(p_securedMessage, p_certificateName, p_payloadField/*, v_mandatoryHeaders*/); - } // End of function f_buildGnSecuredOtherMessage_Bo - - } // End of group hostSignatureHelpers - - group deviceSignatureHelpers { - - /** - * @desc Retrieve the HashedId8 to be sent to the IUT, based on the provided certificate identifier - * @param p_certificateName The certificate the IUT shall use - * @return The HashedId8 to be sent to the IUT in the UtInitialize command - * @verdict Unchanged - * @remark Component variable vc_hashedId8ToBeUsed shall be set with the IUT certificate to be used - */ - function f_setupIutCertificate( - in charstring p_certificateName - ) runs on ItsSecurityBaseComponent return HashedId8 { - // Local variables - var HashedId8 v_hashedId8 := '0000000000000000'O; - - // Sanity check - if (lengthof(p_certificateName) == 0) { - return v_hashedId8; - } - - // Load certificates - if(f_getCertificateDigest(p_certificateName, v_hashedId8) == false) { - v_hashedId8 := '0000000000000000'O; - } - - return v_hashedId8; - } // End of function f_setupIutCertificate - - /** - * @desc Verify the signature of the provided certificate - * @param p_certificateToBeVerified EtsiTs103097Certificate to be verified - * @param p_publicKey Public key to verify the certificate signature - * @return true on success, false otherwise - * @verdict - */ - function f_verifyCertificateSignatureWithPublicKey( - in template (value) EtsiTs103097Certificate p_certificateToBeVerified, - in template (value) PublicVerificationKey p_publicVerificationKey - ) return boolean { - var ToBeSignedCertificate v_toBeSignedCertificate; - var octetstring v_enc_msg; - var octetstring v_signature; - var octetstring v_issuer; - - log(">>> f_verifyCertificateSignatureWithPublicKey: p_certificateToBeVerified=", p_certificateToBeVerified); - log(">>> f_verifyCertificateSignatureWithPublicKey: p_publicVerificationKey=", p_publicVerificationKey); - - // Create ToBeSignedCertificate payload to be signed - v_toBeSignedCertificate := valueof(p_certificateToBeVerified.toBeSigned); - log("f_verifyCertificateSignatureWithPublicKey: v_toBeSignedCertificate=", v_toBeSignedCertificate); - - v_enc_msg := bit2oct(encvalue(v_toBeSignedCertificate)); - log("f_verifyCertificateSignatureWithPublicKey: v_enc_msg=", v_enc_msg); - - // Verify payload - if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1)) { - if (ischosen(p_certificateToBeVerified.issuer.self_)) { - v_issuer := int2oct(0, 32); - } else { - var charstring v_certificate; - - if (fx_readCertificateFromDigest(valueof(p_certificateToBeVerified.issuer.sha256AndDigest), v_certificate) == false) { - log("f_verifyCertificateSignatureWithPublicKey: Invalid issuer: ", p_certificateToBeVerified.issuer.sha256AndDigest); - return false; - } - if (f_getCertificateHash(v_certificate, v_issuer) == false) { - log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate: " & v_certificate); - return false; - } - } - v_signature := valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only) & valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP256r1Signature.sSig); - log("f_verifyCertificateSignatureWithPublicKey: v_signedData=", v_signature); - if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1.uncompressedP256)) { - return f_verifyWithEcdsaBrainpoolp256r1WithSha256_1( - v_enc_msg, - v_issuer, - v_signature, - valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.uncompressedP256.x), - valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.uncompressedP256.y) - ); - } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1.compressed_y_0)) { - return f_verifyWithEcdsaBrainpoolp256r1WithSha256( - v_enc_msg, - v_issuer, - v_signature, - valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.compressed_y_0), - 0 // Latest bit of the Y-coordinate is 0 - ); - } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP256r1.compressed_y_1)) { - return f_verifyWithEcdsaBrainpoolp256r1WithSha256( - v_enc_msg, - v_issuer, - v_signature, - valueof(p_publicVerificationKey.ecdsaBrainpoolP256r1.compressed_y_1), - 1 // Latest bit of the Y-coordinate is 1 - ); - } else { - log("f_verifyCertificateSignatureWithPublicKey: Unknown PublicVerificationKey value"); - return false; - } - } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1)) { - if (ischosen(p_certificateToBeVerified.issuer.self_)) { - v_issuer := int2oct(0, 48); - } else { - var charstring v_certificate; - - if (fx_readCertificateFromDigest(valueof(p_certificateToBeVerified.issuer.sha384AndDigest), v_certificate) == false) { - log("f_verifyCertificateSignatureWithPublicKey: Invalid issuer: ", p_certificateToBeVerified.issuer.sha384AndDigest); - return false; - } - if (f_getCertificateHash(v_certificate, v_issuer) == false) { - log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate: " & v_certificate); - return false; - } - } - v_signature := valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only) & valueof(p_certificateToBeVerified.signature_.ecdsaBrainpoolP384r1Signature.sSig); - log("f_verifyCertificateSignatureWithPublicKey: v_signedData=", v_signature); - if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1.uncompressedP384)) { - return f_verifyWithEcdsaBrainpoolp384r1WithSha384_1( - v_enc_msg, - v_issuer, - v_signature, - valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.uncompressedP384.x), - valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.uncompressedP384.y) - ); - } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1.compressed_y_0)) { - return f_verifyWithEcdsaBrainpoolp384r1WithSha384( - v_enc_msg, - v_issuer, - v_signature, - valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.compressed_y_0), - 0 // Latest bit of the Y-coordinate is 0 - ); - } else if (ischosen(p_publicVerificationKey.ecdsaBrainpoolP384r1.compressed_y_1)) { - return f_verifyWithEcdsaBrainpoolp384r1WithSha384( - v_enc_msg, - v_issuer, - v_signature, - valueof(p_publicVerificationKey.ecdsaBrainpoolP384r1.compressed_y_1), - 1 // Latest bit of the Y-coordinate is 1 - ); - } else { - log("f_verifyCertificateSignatureWithPublicKey: Unknown PublicVerificationKey value"); - return false; - } - } else if (ischosen(p_publicVerificationKey.ecdsaNistP256)) { - if (ischosen(p_certificateToBeVerified.issuer.self_)) { - v_issuer := int2oct(0, 32); - } else { - var charstring v_certificate; - - if (fx_readCertificateFromDigest(valueof(p_certificateToBeVerified.issuer.sha256AndDigest), v_certificate) == false) { - log("f_verifyCertificateSignatureWithPublicKey: Invalid issuer: ", p_certificateToBeVerified.issuer.sha256AndDigest); - return false; - } - if (f_getCertificateHash(v_certificate, v_issuer) == false) { - log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate: " & v_certificate); - return false; - } - } - v_signature := valueof(p_certificateToBeVerified.signature_.ecdsaNistP256Signature.rSig.x_only) & valueof(p_certificateToBeVerified.signature_.ecdsaNistP256Signature.sSig); - log("f_verifyCertificateSignatureWithPublicKey: v_signedData=", v_signature); - if (ischosen(p_publicVerificationKey.ecdsaNistP256.uncompressedP256)) { - return f_verifyWithEcdsaNistp256WithSha256_1( - v_enc_msg, - v_issuer, - v_signature, - valueof(p_publicVerificationKey.ecdsaNistP256.uncompressedP256.x), - valueof(p_publicVerificationKey.ecdsaNistP256.uncompressedP256.y) - ); - } else if (ischosen(p_publicVerificationKey.ecdsaNistP256.compressed_y_0)) { - return f_verifyWithEcdsaNistp256WithSha256( - v_enc_msg, - v_issuer, - v_signature, - valueof(p_publicVerificationKey.ecdsaNistP256.compressed_y_0), - 0 // Latest bit of the Y-coordinate is 0 - ); - } else if (ischosen(p_publicVerificationKey.ecdsaNistP256.compressed_y_1)) { - return f_verifyWithEcdsaNistp256WithSha256( - v_enc_msg, - v_issuer, - v_signature, - valueof(p_publicVerificationKey.ecdsaNistP256.compressed_y_1), - 1 // Latest bit of the Y-coordinate is 1 - ); - } else { - log("f_verifyCertificateSignatureWithPublicKey: Unknown PublicVerificationKey value"); - return false; - } - } - - return false; - } // End of finction f_verifyCertificateSignatureWithPublicKey - - /** - * @desc Verify the signature of the provided secured message - * @param p_certificateToBeVerified EtsiTs103097Certificate to be verified - * @param p_issuingCertificate Issuing certificate - * @return true on success, false otherwise - * @verdict - */ - function f_verifyCertificateSignatureWithIssuingCertificate( - in template (value) EtsiTs103097Certificate p_certificateToBeVerified, - in template (value) EtsiTs103097Certificate p_issuingCertificate - ) return boolean { - - // Sanity checks - if (not(ischosen(p_issuingCertificate.toBeSigned.verifyKeyIndicator.verificationKey))) { - return false; - } - return f_verifyCertificateSignatureWithPublicKey( - p_certificateToBeVerified, - p_issuingCertificate.toBeSigned.verifyKeyIndicator.verificationKey - ); - } // End of function f_verifyCertificateSignatureWithIssuingCertificate - - /** - * @desc Verify the signature of the provided secured message for ECDSA Nist-P256 algorithm - * @param p_securedMessage The message to be verified - * @param p_publicKey The ECDSA public key to verify a signature - * @param p_certificate EtsiTs103097Certificate to be used to verify the message - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_verifyGnSecuredMessageSignature_ecdsaNistP256( - in template (value) Ieee1609Dot2Data p_securedMessage, - in template (value) Oct32 p_certificateIssuer, - in template (value) EccP256CurvePoint p_publicKey - ) return boolean { - - // Local variables - var octetstring v_secPayload; - var octetstring v_signedData; - var boolean v_result := false; - var template (value) ToBeSignedData v_toBeSignedData; - - log(">>> f_verifyGnSecuredMessageSignature_ecdsaNistP256: p_securedMessage= ", p_securedMessage); - log(">>> f_verifyGnSecuredMessageSignature_ecdsaNistP256: p_certificateIssuer= ", p_certificateIssuer); - log(">>> f_verifyGnSecuredMessageSignature_ecdsaNistP256: p_publicKey= ", p_publicKey); - - // Create Ieee1609Dot2Data payload to be signed - v_toBeSignedData := valueof(p_securedMessage.content.signedData.tbsData); - log("f_verifyGnSecuredMessageSignature_ecdsaNistP256: v_toBeSignedData=", p_securedMessage.content.signedData.tbsData); - - v_secPayload := bit2oct(encvalue(v_toBeSignedData)); - log("f_verifyGnSecuredMessageSignature_ecdsaNistP256: v_secPayload=", v_secPayload); - - // Verify payload - - // TODO Check in standard if x-only only - if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig.x_only)) { - v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig.x_only) & valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig); - } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig.compressed_y_0)) { - v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig.compressed_y_0) & valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig); - } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig.compressed_y_1)) { - v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.rSig.compressed_y_1) & valueof(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature.sSig); - } - log("f_verifyGnSecuredMessageSignature_ecdsaNistP256: v_signedData=", v_signedData); - if (ischosen(p_publicKey.uncompressedP256)) { - v_result := f_verifyWithEcdsaNistp256WithSha256_1( - v_secPayload, - valueof(p_certificateIssuer), - v_signedData, - valueof(p_publicKey.uncompressedP256.x), - valueof(p_publicKey.uncompressedP256.y) - ); - } else if (ischosen(p_publicKey.compressed_y_0)) { - v_result := f_verifyWithEcdsaNistp256WithSha256( - v_secPayload, - valueof(p_certificateIssuer), - v_signedData, - valueof(p_publicKey.compressed_y_0), - 0 - ); - } else if (ischosen(p_publicKey.compressed_y_1)) { - v_result := f_verifyWithEcdsaNistp256WithSha256( - v_secPayload, - valueof(p_certificateIssuer), - v_signedData, - valueof(p_publicKey.compressed_y_1), - 1 - ); - } - - log("f_verifyGnSecuredMessageSignature_ecdsaNistP256: v_result=", v_result); - return v_result; - } // End of function f_verifyGnSecuredMessageSignature_ecdsaNistP256 - - /** - * @desc Verify the signature of the provided secured message for ECDSA Brainpool-P256 algorithm - * @param p_securedMessage The message to be verified - * @param p_publicKey The ECDSA public key to verify a signature - * @param p_certificate EtsiTs103097Certificate to be used to verify the message - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1( - in template (value) Ieee1609Dot2Data p_securedMessage, - in template (value) Oct32 p_certificateIssuer, - in template (value) EccP256CurvePoint p_publicKey - ) return boolean { - - // Local variables - var octetstring v_secPayload; - var octetstring v_signedData; - var boolean v_result := false; - var template (value) ToBeSignedData v_toBeSignedData; - - log(">>> f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: p_securedMessage= ", p_securedMessage); - log(">>> f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: p_certificateIssuer= ", p_certificateIssuer); - log(">>> f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: p_publicKey= ", p_publicKey); - - // Create Ieee1609Dot2Data payload to be signed - v_toBeSignedData := valueof(p_securedMessage.content.signedData.tbsData); - log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: v_toBeSignedData=", p_securedMessage.content.signedData.tbsData); - - v_secPayload := bit2oct(encvalue(v_toBeSignedData)); - log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: v_secPayload=", v_secPayload); - - // Verify payload - v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.rSig.x_only) & valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature.sSig); - log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: v_signedData=", v_signedData); - if (ischosen(p_publicKey.uncompressedP256)) { - v_result := f_verifyWithEcdsaBrainpoolp256r1WithSha256_1( - v_secPayload, - valueof(p_certificateIssuer), - v_signedData, - valueof(p_publicKey.uncompressedP256.x), - valueof(p_publicKey.uncompressedP256.y) - ); - } else if (ischosen(p_publicKey.compressed_y_0)) { - v_result := f_verifyWithEcdsaBrainpoolp256r1WithSha256( - v_secPayload, - valueof(p_certificateIssuer), - v_signedData, - valueof(p_publicKey.compressed_y_0), - 0 - ); - } else if (ischosen(p_publicKey.compressed_y_1)) { - v_result := f_verifyWithEcdsaBrainpoolp256r1WithSha256( - v_secPayload, - valueof(p_certificateIssuer), - v_signedData, - valueof(p_publicKey.compressed_y_1), - 1 - ); - } - - log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1: v_result=", v_result); - return v_result; - } // End of function f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1 - - /** - * @desc Verify the signature of the provided secured message for ECDSA Brainpool-P384 algorithm - * @param p_securedMessage The message to be verified - * @param p_publicKey The ECDSA public key to verify a signature - * @param p_certificate EtsiTs103097Certificate to be used to verify the message - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1( - in template (value) Ieee1609Dot2Data p_securedMessage, - in template (value) Oct48 p_certificateIssuer, - in template (value) EccP384CurvePoint p_publicKey - ) return boolean { - - // Local variables - var octetstring v_secPayload; - var octetstring v_signedData; - var boolean v_result := false; - var template (value) ToBeSignedData v_toBeSignedData; - - log(">>> f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: p_securedMessage= ", p_securedMessage); - log(">>> f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: p_certificateIssuer= ", p_certificateIssuer); - log(">>> f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: p_publicKey= ", p_publicKey); - - // Create Ieee1609Dot2Data payload to be signed - v_toBeSignedData := valueof(p_securedMessage.content.signedData.tbsData); - log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: v_toBeSignedData=", p_securedMessage.content.signedData.tbsData); - - v_secPayload := bit2oct(encvalue(v_toBeSignedData)); - log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: v_secPayload=", v_secPayload); - - // Verify payload - v_signedData := valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.rSig.x_only) & valueof(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature.sSig); - log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: v_signedData=", v_signedData); - if (ischosen(p_publicKey.uncompressedP384)) { - v_result := f_verifyWithEcdsaBrainpoolp384r1WithSha384_1( - v_secPayload, - valueof(p_certificateIssuer), - v_signedData, - valueof(p_publicKey.uncompressedP384.x), - valueof(p_publicKey.uncompressedP384.y) - ); - } else if (ischosen(p_publicKey.compressed_y_0)) { - v_result := f_verifyWithEcdsaBrainpoolp384r1WithSha384( - v_secPayload, - valueof(p_certificateIssuer), - v_signedData, - valueof(p_publicKey.compressed_y_0), - 0 - ); - } else if (ischosen(p_publicKey.compressed_y_1)) { - v_result := f_verifyWithEcdsaBrainpoolp384r1WithSha384( - v_secPayload, - valueof(p_certificateIssuer), - v_signedData, - valueof(p_publicKey.compressed_y_1), - 1 - ); - } - - log("f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1: v_result=", v_result); - return v_result; - } // End of function f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1 - - /** - * @desc Verify the signature of the provided secured message - * @param p_securedMessage - * @param p_certificate EtsiTs103097Certificate to be used to verify the message - * @return true on success, false otherwise - * @verdict - */ - function f_verifyGnSecuredMessageSignatureWithCertificate( - in template (value) Ieee1609Dot2Data p_securedMessage, - in template (value) charstring p_certificate_id, - in template (value) EtsiTs103097Certificate p_certificate - - ) return boolean { - var octetstring v_issuer; - var EtsiTs103097Certificate v_certificate; - - log(">>> f_verifyGnSecuredMessageSignatureWithCertificate: p_securedMessage=", p_securedMessage); - log(">>> f_verifyGnSecuredMessageSignatureWithCertificate: p_certificate_id=", p_certificate_id); - log(">>> f_verifyGnSecuredMessageSignatureWithCertificate: p_certificate=", p_certificate); - - if (f_getCertificateHash(valueof(p_certificate_id), v_issuer) == false) { - log("f_verifyCertificateSignatureWithPublicKey: Invalid certificate id: " & valueof(p_certificate_id)); - return false; - } - if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP256r1Signature)) { - return f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP256r1(p_securedMessage, v_issuer, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP256r1); - } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaBrainpoolP384r1Signature)) { - return f_verifyGnSecuredMessageSignature_ecdsaBrainpoolP384r1(p_securedMessage, v_issuer, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaBrainpoolP384r1); - } else if (ischosen(p_securedMessage.content.signedData.signature_.ecdsaNistP256Signature)) { - return f_verifyGnSecuredMessageSignature_ecdsaNistP256(p_securedMessage, v_issuer, p_certificate.toBeSigned.verifyKeyIndicator.verificationKey.ecdsaNistP256); - } - - return false; - } // End of function f_verifyGnSecuredOtherMessageWithDeviceCertificate - - } // End of group deviceSignatureHelpers - - group sspPermissions { - - function f_verifySspPermissions( - in SequenceOfPsidSsp p_issuer_ssp_permissions, - in SequenceOfPsidSsp p_subordinate_ssp_permissions, - in boolean p_strict_checks := false - ) return boolean { - // Local variables - var integer v_idx := 0; - - log(">>> f_verifySspPermissions: p_issuer_ssp_permissions:", p_issuer_ssp_permissions); - log(">>> f_verifySspPermissions: p_subordinate_ssp_permissions: ", p_subordinate_ssp_permissions); - - for (v_idx := 0; v_idx < lengthof(p_issuer_ssp_permissions); v_idx := v_idx + 1) { - var PsidSsp v_issuerPsidSsp := p_issuer_ssp_permissions[v_idx]; - var PsidSsp v_subordinatePsidSsp; - var boolean v_found := false; - var integer v_jdx := 0; - log("f_verifySspPermissions: v_issuerPsidSsp: ", v_issuerPsidSsp); - // 1. Check permission from issuer is present - for (v_jdx := 0; v_jdx < lengthof(p_subordinate_ssp_permissions); v_jdx := v_jdx + 1) { - log("f_verifySspPermissions: match=", match(v_issuerPsidSsp, m_appPermissions(p_subordinate_ssp_permissions[v_jdx].psid, p_subordinate_ssp_permissions[v_jdx].ssp))); - // 1. Check the version - if (p_subordinate_ssp_permissions[v_jdx].ssp.bitmapSsp[0] != '01'O) { - log("f_verifySspPermissions: Wrong SSP version control (1 is expected): ", p_subordinate_ssp_permissions[v_jdx].ssp.bitmapSsp[0]); - return false; - } - // 2. Check the version - if (match(v_issuerPsidSsp, m_appPermissions(p_subordinate_ssp_permissions[v_jdx].psid, p_subordinate_ssp_permissions[v_jdx].ssp)) == true) { - v_subordinatePsidSsp := p_subordinate_ssp_permissions[v_jdx]; - v_found := true; - break; - } - } // End of 'for' statement - if (v_found == false) { - log("f_verifySspPermissions: Permission set not found: ", v_issuerPsidSsp); - if (p_strict_checks == true) { - return false; - } else { - return true; - } - } - // 2. Validate bits mask - if (ispresent(v_issuerPsidSsp.ssp)) { - if (ispresent(v_subordinatePsidSsp.ssp) == false) { - log("f_verifySspPermissions: Ssp shall not be omitted: ", v_issuerPsidSsp); - if (p_strict_checks == true) { - return false; - } - } - if ((ischosen(v_issuerPsidSsp.ssp.bitmapSsp) == false) or (ischosen(v_subordinatePsidSsp.ssp.bitmapSsp) == false)) { - log("f_verifySspPermissions: Wrong variant : ", v_issuerPsidSsp, " / ", v_subordinatePsidSsp); - if (p_strict_checks == true) { - return false; - } - } - if (lengthof(v_issuerPsidSsp.ssp.bitmapSsp) < lengthof(v_subordinatePsidSsp.ssp.bitmapSsp)) { - log("f_verifySspPermissions: Ssp not be compliant: ", v_issuerPsidSsp.ssp, " / ", v_subordinatePsidSsp.ssp); - if (p_strict_checks == true) { - return false; - } - } else { - var charstring v_issuerSsp := bit2str(oct2bit(v_issuerPsidSsp.ssp.bitmapSsp)); - var charstring v_subordinateSsp := bit2str(oct2bit(v_subordinatePsidSsp.ssp.bitmapSsp)); - - for (var integer i := 0; i < lengthof(v_issuerSsp); i := i + 1) { - if (v_issuerSsp[i] == "1") { // TODO How to check Permission using SspBitmask/SspValue - if (v_subordinateSsp[i] != "1") { - log("f_verifySspPermissions: Ssp bitmask mismatch at index: ", i); - return false; - } - } // else, no restriction, subordinate certificate can have any value. - } // End of 'for' statement - } - } - } // End of 'for' statement - - return true; - } // End of function f_verifySspPermissions - - } // End of group sspPermissions - - group messageGetters { - - /** - * @desc return Ieee1609Dot2Data header field of given type or null if none - * @param p_msg the Ieee1609Dot2Data - * @param p_type header field type - * @return HeaderInfo of given type if any or null - */ - function f_getMsgHeaderInfo( - in template(omit) Ieee1609Dot2Data p_securedMessage, - out HeaderInfo p_return - ) return boolean { - var integer v_length; - var Ieee1609Dot2Data v_securedMessage; - - if (not isvalue(p_securedMessage)) { - testcase.stop(__SCOPE__ & " can not handle omitted secured message values"); - } - v_securedMessage := valueof(p_securedMessage); - if (ischosen(v_securedMessage.content.signedData)) { - p_return := v_securedMessage.content.signedData.tbsData.headerInfo; - return true; - } - - log("f_getMsgHeaderField: return false"); - return false; - } - - /** - * @desc return SignerIdentifier Ieee1609Dot2Data field - */ - function f_getMsgSignerIdentifier ( - in template(omit) Ieee1609Dot2Data p_securedMessage, - out SignerIdentifier p_signerIdentifier - ) return boolean { - if (not isvalue(p_securedMessage)) { - testcase.stop(__SCOPE__ & " can not handle omitted secured message values"); - } - - if (ischosen(p_securedMessage.content.signedData)) { - p_signerIdentifier := valueof(p_securedMessage.content.signedData.signer); - return true; - } - - log("f_getMsgSignerIdentifier: return false"); - return false; - } - - } // End of group messageGetters - - group certificateGetters { - - /** - * @desc Set the generation location as defined in Draft ETSI TS 103 097 V1.1.14 Clause 7.2 Security profile for DENMs - * @param p_latitude The latitude value of the ITS-S position - * @param p_longitude The longitude value of the ITS-S position - * @param p_elevation The elevation value of the ITS-S position - * @verdict Unchanged - */ - function f_setGenerationLocation( - in SecLatitude p_latitude, - in SecLongitude p_longitude, - in SecElevation p_elevation := 0 - ) runs on ItsSecurityBaseComponent { - vc_location := { - p_latitude, - p_longitude, - p_elevation - } - } // End of function f_setGenerationLocation - - /** - * @desc Load in memory cache the certificates available - * @param p_configId A configuration identifier - * @remark This method SHALL be call before any usage of certificates - * @return true on success, false otherwise - */ - function f_loadCertificates( - in charstring p_configId - ) runs on ItsSecurityBaseComponent return boolean { - var charstring v_certificate_id; - - // Setup certificates memory cache - if (fx_loadCertificates(PX_CERTIFICATE_POOL_PATH, p_configId) == true) { - // Setup security component variables - if (f_readCertificate(PX_CERT_FOR_TS, vc_atCertificate) == true) { - var HashedId8 v_issuer; -// log("Issuer: ", vc_atCertificate.issuer); - if (ischosen(vc_atCertificate.issuer.sha256AndDigest)) { - v_issuer := vc_atCertificate.issuer.sha256AndDigest; - } else if (ischosen(vc_atCertificate.issuer.sha384AndDigest)) { - v_issuer := vc_atCertificate.issuer.sha384AndDigest; - } else { - log("AT certificate cannot be issued by CA"); - return false; - } - log("Selected issuer: ", v_issuer); - if (f_getCertificateFromDigest(v_issuer, vc_aaCertificate, v_certificate_id)) { - if (f_readSigningKey(cc_taCert_A, vc_signingPrivateKey) == true) { - f_readEncryptingKey(cc_taCert_A, vc_encryptPrivateKey); - return true; - } - log("f_loadCertificates: Failed to load signing key for ", cc_taCert_A); - } else { - log("f_loadCertificates: Failed to load AA certificate for ", cc_taCert_A); - } - } else { - log("f_loadCertificates: Failed to load AT certificate for ", cc_taCert_A); - } - } else { - log("f_loadCertificates: Failed to load certificates from ", PX_CERTIFICATE_POOL_PATH); - } - return false; - } // End of function f_loadCertificates - - /** - * @desc Unload from memory cache the certificates available - * @return true on success, false otherwise - */ - function f_unloadCertificates() runs on ItsSecurityBaseComponent return boolean { - // Reset security component variables - vc_signingPrivateKey := ''O; - vc_encryptPrivateKey := ''O; - // Clear certificates memory cache - return fx_unloadCertificates(); - } // End of function f_unloadCertificates - - /** - * @desc Read the specified certificate - * @param p_certificate_id the certificate identifier - * @param p_certificate the expected certificate - * @return true on success, false otherwise - */ - function f_readCertificate( - in charstring p_certificate_id, - out EtsiTs103097Certificate p_certificate - ) return boolean { - var octetstring v_certificate; - - if (fx_readCertificate(p_certificate_id, v_certificate) == true) { - var bitstring v_oct2bit; - var integer v_result; - - v_oct2bit := oct2bit(v_certificate); - v_result := decvalue(v_oct2bit, p_certificate); - if (v_result == 0) { - return true; - } - } - - log("f_readCertificate: Failed to retrieve ", p_certificate_id); - return false; - } // End of function f_readCertificate - - /** - * @desc Read the specified certificate - * @param p_certificate_id the certificate identifier - * @param p_digest the digest of the certificate - * @return true on success, false otherwise - */ - function f_getCertificateDigest( - in charstring p_certificate_id, - out HashedId8 p_digest - ) return boolean { - if (not fx_readCertificateDigest(p_certificate_id, p_digest)){ - log("f_getCertificateDigest: Failed to retrieve digest for ", p_certificate_id); - return false; - } - return true; - } // End of function f_getCertificateDigest - - /** - * @desc Read the whole-hash of the certificate - * @param p_certificate_id the certificate identifier - * @param p_hash the whole-hash of the certificate - * @return true on success, false otherwise - */ - function f_getCertificateHash( - in charstring p_certificate_id, - out octetstring p_hash - ) return boolean { - log(">>> f_getCertificateHash: ", p_certificate_id); - - if (not fx_readCertificateHash(p_certificate_id, p_hash)){ - log("f_getCertificateHash: Failed to retrieve digest for ", p_certificate_id); - return false; - } - return true; - } // End of function f_getCertificateHash - - /** - * @desc Read the whole-hash of the certificate SHA 256 - * @param p_certificate_id the certificate identifier - * @param p_hash the whole-hash of the certificate using SHA 256 - * @return true on success, false otherwise - */ - function f_getCertificateHash256( - in charstring p_certificate_id, - out Oct32 p_hash - ) return boolean { - if (not fx_readCertificateHash256(p_certificate_id, p_hash)){ - log("f_getCertificateHash256: Failed to retrieve digest for ", p_certificate_id); - return false; - } - return true; - } // End of function f_getCertificateHash256 - - function f_getCertificateFromDigest( - in HashedId8 p_digest, - out EtsiTs103097Certificate p_certificate, - out charstring p_certificate_id - ) return boolean { - if (not(fx_readCertificateFromDigest(p_digest, p_certificate_id))) { - log("f_getCertificateFromDigest: Failed to retrieve digest for ", p_digest); - return false; - } - if (not(f_readCertificate(p_certificate_id, p_certificate))) { - log("f_getCertificateFromDigest: Failed to retrieve digest for ", p_certificate_id); - return false; - } - return true; - } // End of function f_getCertificateFromDigest - - function f_getCertificateFromHashedId3( - in HashedId3 p_digest, - out EtsiTs103097Certificate p_certificate - ) return boolean { - var charstring v_certificate_id; - if (not(fx_readCertificateFromHashedId3(p_digest, v_certificate_id))) { - log("f_getCertificateFromHashedId3: Failed to retrieve digest for ", p_digest); - return false; - } - if (not(f_readCertificate(v_certificate_id, p_certificate))) { - log("f_getCertificateFromHashedId3: Failed to retrieve digest for ", v_certificate_id); - return false; - } - return true; - } // End of function f_getCertificateFromHashedId3 - - function f_getCertificateIssuer( - in IssuerIdentifier p_issuer - ) return HashedId8 { - if (ischosen(p_issuer.sha256AndDigest)) { - return p_issuer.sha256AndDigest; - } else if (ischosen(p_issuer.sha256AndDigest)) { - return p_issuer.sha256AndDigest; - } - return int2oct(0, 8); - } - - function f_getHashAlgorithm( - in IssuerIdentifier p_issuer - ) return HashAlgorithm { - if (ischosen(p_issuer.sha256AndDigest)) { - return sha256; - } else if (ischosen(p_issuer.sha256AndDigest)) { - return sha384; - } - return p_issuer.self_; - } - - /** - * @desc Read the signing private key for the specified certificate - * @param p_keysId the keys identifier - * @param p_signingPrivateKey the signing private key - * @return true on success, false otherwise - */ - function f_readSigningKey( - in charstring p_keysId, - out Oct32 p_signingPrivateKey - ) return boolean { - return fx_readSigningKey(p_keysId, p_signingPrivateKey); - } // End of function f_readSigningKey - - /** - * @desc Read the encrypting private keys for the specified certificate - * @param p_keysId the keys identifier - * @param p_encryptPrivateKey the encrypt private key - * @return true on success, false otherwise - */ - function f_readEncryptingKey( - in charstring p_keysId, - out Oct32 p_encryptPrivateKey - ) return boolean { - return fx_readEncryptingKey(p_keysId, p_encryptPrivateKey); - } // End of function f_readEncryptingKey - - function f_getCertificateValidityRestriction( - in template (value) EtsiTs103097Certificate p_cert, - out template (value) ValidityPeriod p_validityPeriod, - out template (omit) GeographicRegion p_geographicRegion - ) return boolean { - p_validityPeriod := valueof(p_cert.toBeSigned.validityPeriod); - if (ispresent(p_cert.toBeSigned.region)) { - p_geographicRegion := valueof(p_cert.toBeSigned.region); - } else { - p_geographicRegion := omit; - } - return true; - } // End of function f_getCertificateValidityRestriction - - }// End of group certificateGetters - - group certificatesCaching { - - function f_createCertificatesCaching( - in SequenceOfCertificate p_certificates, - out CertificatesCaching p_certificatesCaching - ) return boolean { - p_certificatesCaching := { }; - for (var integer v_counter := 0; v_counter < lengthof(p_certificates); v_counter := v_counter + 1) { - var CertificatesCachingItem v_item; - v_item.certificate := p_certificates[v_counter]; - v_item.hashedId8 := f_calculateDigestSha256FromCertificate(v_item.certificate); - p_certificatesCaching[v_counter] := v_item; - } // End of 'for' statement - - return true; - } - - function f_getCertificateFromCaching( - in CertificatesCaching p_certificatesCaching, - in HashedId8 p_hashedId8, - out EtsiTs103097Certificate p_certificate - ) return boolean { - for (var integer v_counter := 0; v_counter < lengthof(p_certificatesCaching); v_counter := v_counter + 1) { - if (match(p_certificatesCaching[v_counter].hashedId8, p_hashedId8) == true) { - p_certificate := p_certificatesCaching[v_counter].certificate; - return true; - } - } // End of 'for' statement - - return false; - } - - function f_getCertificatesCachingItem( - in CertificatesCaching p_certificatesCaching, - in UInt8 p_index, - out EtsiTs103097Certificate p_certificate - ) return boolean { - if (lengthof(p_certificatesCaching) < p_index) { - p_certificate := p_certificatesCaching[p_index].certificate; - return true; - } - - return false; - } - - function f_getCertificatesCachingItemSize( - in CertificatesCaching p_certificatesCaching - ) return UInt8 { - return lengthof(p_certificatesCaching); - } - - }// End of group certificatesCaching - - - } // End of group helpersFunctions - - group externalFunctions { - - group signing { - - /** - * @desc Produces a 256-bit (32-byte) hash value - * @param p_toBeHashedData Data to be used to calculate the hash value - * @return The hash value - */ - external function fx_hashWithSha256(in octetstring p_toBeHashedData) return Oct32; - - /** - * @desc Produces a 384-bit (48-byte) hash value - * @param p_toBeHashedData Data to be used to calculate the hash value - * @return The hash value - */ - external function fx_hashWithSha384(in octetstring p_toBeHashedData) return Oct48; - - /** - * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature - * @param p_toBeSignedSecuredMessage The data to be signed - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_privateKey The private key - * @return The signature value - */ - external function fx_signWithEcdsaNistp256WithSha256(in octetstring p_toBeSignedSecuredMessage, in Oct32 p_certificateIssuer, in Oct32 p_privateKey) return octetstring; - - /** - * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature - * @param p_toBeSignedSecuredMessage The data to be signed - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_privateKey The private key for signature - * @return The signature value - */ - external function fx_signWithEcdsaBrainpoolp256r1WithSha256(in octetstring p_toBeSignedSecuredMessage, in Oct32 p_certificateIssuer, in Oct32 p_privateKey) return octetstring; - - /** - * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signature - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_privateKey The private key for signature - * @return The signature value - */ - external function fx_signWithEcdsaBrainpoolp384r1WithSha384(in octetstring p_toBeSignedSecuredMessage, in Oct48 p_certificateIssuer, in Oct48 p_privateKey) return octetstring; - - /** - * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_signature The signature - * @param p_ecdsaNistp256PublicKeyCompressed The compressed public key - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - external function fx_verifyWithEcdsaNistp256WithSha256(in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyCompressed, in integer p_compressed_mode) return boolean; - - /** - * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_signature The signature - * @param p_ecdsaNistp256PublicKeyX The public key (x coordinate) - * @param p_ecdsaNistp256PublicKeyY The public key (y coordinate) - * @return true on success, false otherwise - */ - external function fx_verifyWithEcdsaNistp256WithSha256_1(in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in Oct64 p_signature, in Oct32 p_ecdsaNistp256PublicKeyX, in Oct32 p_ecdsaNistp256PublicKeyY) return boolean; - - /** - * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The whole-hash issuer certificate or int2oct(0, 32) in case of self signed certificate - * @param p_signature The signature - * @param p_ecdsaBrainpoolp256PublicKeyCompressed The compressed public key - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - external function fx_verifyWithEcdsaBrainpoolp256r1WithSha256(in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in Oct64 p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyCompressed, in integer p_compressed_mode) return boolean; - - /** - * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The certificate issuer - * @param p_signature The signature - * @param p_ecdsaBrainpoolp256PublicKeyX The public key (x coordinate) - * @param p_ecdsaBrainpoolp256PublicKeyY The public key (y coordinate) - * @return true on success, false otherwise - */ - external function fx_verifyWithEcdsaBrainpoolp256r1WithSha256_1(in octetstring p_toBeVerifiedData, in Oct32 p_certificateIssuer, in Oct64 p_signature, in Oct32 p_ecdsaBrainpoolp256PublicKeyX, in Oct32 p_ecdsaBrainpoolp256PublicKeyY) return boolean; - - /** - * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The certificate issuer - * @param p_signature The signature - * @param p_ecdsaBrainpoolp384PublicKeyCompressed The compressed public key - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - external function fx_verifyWithEcdsaBrainpoolp384r1WithSha384(in octetstring p_toBeVerifiedData, in Oct48 p_certificateIssuer, in Oct96 p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyCompressed, in integer p_compressed_mode) return boolean; - - /** - * @desc Verify the signature of the specified data - * @param p_toBeVerifiedData The data to be verified - * @param p_certificateIssuer The hash of the canonical certificate issuer - * @param p_signature The signature - * @param p_ecdsaBrainpoolp384PublicKeyX The public key (x coordinate) - * @param p_ecdsaBrainpoolp384PublicKeyY The public key (y coordinate) - * @return true on success, false otherwise - */ - external function fx_verifyWithEcdsaBrainpoolp384r1WithSha384_1(in octetstring p_toBeVerifiedData, in Oct48 p_certificateIssuer, in Oct96 p_signature, in Oct48 p_ecdsaBrainpoolp384PublicKeyX, in Oct48 p_ecdsaBrainpoolp384PublicKeyY) return boolean; - - /** - * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. - * This function should not be used by the ATS - * @param p_privateKey The new private key value - * @param p_publicKeyX The new public key value (x coordinate) - * @param p_publicKeyX The new public key value (y coordinate) - * @param p_publicKeyCompressed The compressed public keys - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - external function fx_generateKeyPair_nistp256(out Oct32 p_privateKey, out Oct32 p_publicKeyX, out Oct32 p_publicKeyY, out Oct32 p_publicKeyCompressed, out integer p_compressed_mode) return boolean; - - /** - * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. - * This function should not be used by the ATS - * @param p_privateKey The new private key value - * @param p_publicKeyX The new public key value (x coordinate) - * @param p_publicKeyX The new public key value (y coordinate) - * @param p_publicKeyCompressed The compressed public keys - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - external function fx_generateKeyPair_brainpoolp256r1(out Oct32 p_privateKey, out Oct32 p_publicKeyX, out Oct32 p_publicKeyY, out Oct32 p_publicKeyCompressed, out integer p_compressed_mode) return boolean; - - /** - * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm. - * This function should not be used by the ATS - * @param p_privateKey The new private key value - * @param p_publicKeyX The new public key value (x coordinate) - * @param p_publicKeyX The new public key value (y coordinate) - * @param p_publicKeyCompressed The compressed public keys - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @return true on success, false otherwise - */ - external function fx_generateKeyPair_brainpoolp384r1(out Oct48 p_privateKey, out Oct48 p_publicKeyX, out Oct48 p_publicKeyY, out Oct48 p_publicKeyCompressed, out integer p_compressed_mode) return boolean; - - external function fx_get_uncompressed_key_nistp256(in Oct32 p_privateKey, in Oct32 p_publicKeyCompressed, in integer p_compressed_mode, out Oct32 p_publicKeyY) return boolean; - external function fx_get_uncompressed_key_brainpoolp256r1(in Oct32 p_privateKey, in Oct32 p_publicKeyCompressed, in integer p_compressed_mode, out Oct32 p_publicKeyY) return boolean; - external function fx_get_uncompressed_key_brainpoolp384r1(in Oct48 p_privateKey, in Oct48 p_publicKeyCompressed, in integer p_compressed_mode, out Oct48 p_publicKeyY) return boolean; - - } // End of group signing - - group encryption { - - external function fx_hmac_sha256(in octetstring p_k, in octetstring p_m) return octetstring; - - /** - * @desc This function validates AES128 CCM encryption based on IEEE Std 1609.2-20XX Annex D.6.1 AES-CCM-128 - * @param[in] The symmetric AES 128 encryption key - * @param[in] The initial vector (aka nonce) - * @param[in] The raw payload - * @return The encrypted payload - */ - external function fx_encrypt_aes_128_ccm_test(in octetstring p_k, in octetstring p_n, in octetstring p_pt) return octetstring; - - /** - * @desc TThis function validates AES128 CCM encryption based on AES-GCM-256 - * @param[in] The symmetric AES 128 encryption key - * @param[in] The initial vector (aka nonce) - * @param[in] The raw payload - * @return The encrypted payload - */ - external function fx_encrypt_aes_128_gcm_test(in octetstring p_k, in octetstring p_n, in octetstring p_pt) return octetstring; - - /** - * @desc This function validates AES128 CCM decryption based on IEEE Std 1609.2-20XX Annex D.6.1 AES-CCM-128 - * @param[in] The symmetric AES 128 encryption key - * @param[in] The initial vector (aka nonce) - * @param[in] The cyphered payload - * @return The raw payload - */ - external function fx_decrypt_aes_128_ccm_test(in octetstring p_k, in octetstring p_n, in octetstring p_pt) return octetstring; - - /** - * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption using Nist-P256 algorithm - * @param p_toBeEncryptedSecuredMessage The data to be encrypted - * @param p_recipientsPublicKeyCompressed The Recipient's compressed public key - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key - * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key - * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption - * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption - * @return The encrypted message - */ - external function fx_encryptWithEciesNistp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyCompressed, in integer p_compressed_mode, in octetstring p_salt, out Oct32 p_publicEphemeralKeyCompressed, out integer p_ephemeralKeyModeCompressed, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; - - external function fx_test_encryptWithEciesNistp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_privateEphemeralKey, in Oct32 p_recipientPublicKeyX, in Oct32 p_recipientPublicKeyY, in octetstring p_salt, out Oct32 p_publicEphemeralKeyX, out Oct32 p_publicEphemeralKeyY, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; - - /** - * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Nist-P256 algorithm - * @param p_encryptedSecuredMessage The data to be decrypted - * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key - * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key - * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption - * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption - * @return The decrypted message - */ - external function fx_decryptWithEciesNistp256WithSha256(in octetstring p_encryptedSecuredMessage, in Oct32 p_privateEncKey, in Oct32 p_publicEphemeralKeyCompressed, in integer p_ephemeralKeyModeCompressed, in Oct16 p_encrypted_sym_key, in Oct16 p_authentication_vector, in Oct12 p_nonce, in Oct32 p_salt, out Oct16 p_aes_sym_enc_key) return octetstring; - - /** - * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption using Brainpool-P256 algorithm - * @param p_toBeEncryptedSecuredMessage The data to be encrypted - * @param p_recipientsPublicKeyCompressed The Recipient's compressed public key - * @param p_compressed_mode The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key - * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key - * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption - * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption - * @return The encrypted message - */ - external function fx_encryptWithEciesBrainpoolp256r1WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_recipientsPublicKeyCompressed, in integer p_compressed_mode, in octetstring p_salt, out Oct32 p_publicEphemeralKeyCompressed, out integer p_ephemeralKeyModeCompressed, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; - - external function fx_test_encryptWithEciesBrainpoolp256r1WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_privateEphemeralKey, in Oct32 p_recipientPublicKeyX, in Oct32 p_recipientPublicKeyY, in octetstring p_salt, out Oct32 p_publicEphemeralKeyX, out Oct32 p_publicEphemeralKeyY, out Oct16 p_aes_sym_key, out Oct16 p_encrypted_sym_key, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring; - - /** - * @desc Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption using Brainpool-P256 algorithm - * @param p_encryptedSecuredMessage The data to be decrypted - * @param p_publicEphemeralKeyCompressed The generated ephemeral compressed key - * @param p_ephemeralKeyModeCompressed The compressed mode, 0 if the latest bit of Y-coordinate is 0, 1 otherwise - * @param p_encrypted_sym_key The encrypted AES 128 CCM symmetric key - * @param p_authentication_vector The tag of the AES 128 CCM symmetric key encryption - * @param p_nonce The nonce vector of the AES 128 CCM symmetric key encryption - * @return The decrypted message - */ - external function fx_decryptWithEciesBrainpoolp256r1WithSha256(in octetstring p_encryptedSecuredMessage, in Oct32 p_privateEncKey, in Oct32 p_publicEphemeralKeyCompressed, in integer p_ephemeralKeyModeCompressed, in Oct16 p_encrypted_sym_key, in Oct16 p_authentication_vector, in Oct12 p_nonce, in Oct32 p_salt, out Oct16 p_aes_sym_enc_key) return octetstring; - - } // End of group encryption - - group certificatesLoader { - - /** - * @desc Load in memory cache the certificates available in the specified directory - * @param p_rootDirectory Root directory to access to the certificates identified by the certificate ID - * @param p_configId A configuration identifier - * @remark This method SHALL be call before any usage of certificates - * @return true on success, false otherwise - */ - external function fx_loadCertificates(in charstring p_rootDirectory, in charstring p_configId) return boolean; - external function fx_store_certificate(in charstring p_cert_id, in octetstring p_cert, in octetstring p_private_key, in octetstring p_public_key_x, in octetstring p_public_key_y, in octetstring p_public_key_compressed, in integer p_public_key_compressed_mode, in octetstring p_hash, in octetstring p_hash_256, in octetstring p_hashid8, in octetstring p_issuer, in template (omit) octetstring p_private_enc_key, in template (omit) octetstring p_public_enc_key_x, in template (omit) octetstring p_public_enc_key_y, in template (omit) octetstring p_public_enc_compressed_key, in template (omit) integer p_public_enc_key_compressed_mode) return boolean; - - /** - * @desc Unload from memory cache the certificates - * @return true on success, false otherwise - */ - external function fx_unloadCertificates() return boolean; - - /** - * @desc Read the specified certificate - * @param p_certificate_id the certificate identifier - * @param p_certificate the expected certificate - * @return true on success, false otherwise - */ - external function fx_readCertificate(in charstring p_certificate_id, out octetstring p_certificate) return boolean; - - /** - * @desc Read the specified certificate digest - * @param p_certificate_id the certificate identifier - * @param p_digest the expected certificate - * @return true on success, false otherwise - */ - external function fx_readCertificateDigest(in charstring p_certificate_id, out HashedId8 p_digest) return boolean; - - /** - * @desc Read the whole-hash of the specified certificate - * @param p_certificate_id the certificate identifier - * @param p_hash the whole-hash of the certificate - * @return true on success, false otherwise - */ - external function fx_readCertificateHash(in charstring p_certificate_id, out octetstring p_hash) return boolean; - - /** - * @desc Read the whole-hash of the specified certificate using SHA 256 - * @param p_certificate_id the certificate identifier - * @param p_hash the whole-hash of the certificate - * @return true on success, false otherwise - */ - external function fx_readCertificateHash256(in charstring p_certificate_id, out Oct32 p_hash) return boolean; - - external function fx_readCertificateFromDigest(in HashedId8 p_digest, out charstring p_certificate_id) return boolean; - - external function fx_readCertificateFromHashedId3(in HashedId3 p_digest, out charstring p_certificate_id) return boolean; - - /** - * @desc Read the private keys for the specified certificate - * @param p_keysId the keys identifier - * @param p_signingPrivateKey the signing private key - * @return true on success, false otherwise - */ - - external function fx_readSigningKey(in charstring p_keysId, out Oct32 p_signingPrivateKey) return boolean; - - /** - * @desc Read the private keys for the specified certificate - * @param p_keysId the keys identifier - * @param p_encryptPrivateKey the encrypt private key - * @return true on success, false otherwise - */ - - external function fx_readEncryptingKey(in charstring p_keysId, out Oct32 p_encryptingPrivateKey) return boolean; - - } // End of group certificatesLoader - - group geodesic { - - /** - * @desc Check that given polygon doesn't have neither self-intersections nor holes. - * @param p_region Polygonal Region - * @return true on success, false otherwise - * @verdict Unchanged - */ - external function fx_isValidPolygonalRegion(in PolygonalRegion p_region) return boolean; - - /** - * @desc Check if a polygonal region is inside another one - * @param p_parent The main polygonal region - * @param p_region The polygonal region to be included - * @return true on success, false otherwise - * @verdict Unchanged - */ - external function fx_isPolygonalRegionInside(in PolygonalRegion p_parent, in PolygonalRegion p_region) return boolean; - - /** - * @desc Check that the location is inside a circular region - * @param p_region The circular region to consider - * @param p_location The device location - * @return true on success, false otherwise - * @verdict Unchanged - */ - external function fx_isLocationInsideCircularRegion(in CircularRegion p_region, in ThreeDLocation p_location) return boolean; - - /** - * @desc Check that the location is inside a rectangular region - * @param p_region The rectangular region to consider - * @param p_location The device location - * @return true on success, false otherwise - * @verdict Unchanged - */ - external function fx_isLocationInsideRectangularRegion(in SequenceOfRectangularRegion p_region, in ThreeDLocation p_location) return boolean; - - /** - * @desc Check that the location is inside a polygonal region - * @param p_region The polygonal region to consider - * @param p_location The device location - * @return true on success, false otherwise - * @verdict Unchanged - */ - external function fx_isLocationInsidePolygonalRegion(in PolygonalRegion p_region, in ThreeDLocation p_location) return boolean; - - /** - * @desc Check if the location is inside an identified region - * @param p_region The identified region to consider - * @param p_location The device location - * @return true on success, false otherwise - * @verdict Unchanged - */ - external function fx_isLocationInsideIdentifiedRegion(in IdentifiedRegion p_region, in ThreeDLocation p_location) return boolean; - - /** - * @desc Check if the location is inside an undefined region - * @param p_region The identified region to consider - * @param p_location The device location - * @return true on success, false otherwise - * @verdict Unchanged - */ - external function fx_isLocationInsideOtherRegion(in octetstring p_region, in ThreeDLocation p_location) return boolean; - - /** - * @desc Check that p_circular_region_1 circular region is included into p_circular_region_2 circular region - * @param p_circular_region_1 Circular region 1 - * @param p_circular_region_2 Circular region 2 - * - * @return true on success, false otherwise - */ - external function fx_areCirclesInside(in CircularRegion p_circular_region_1, in CircularRegion p_circular_region_2) return boolean; - - /** - * @desc Check that p_rectanglar_region_1 rectangular region is included into p_rectanglar_region_2 rectangular region - * @param p_rectanglar_region_1 Rectangular region 1 - * @param p_rectanglar_region_2 Rectangular region 2 - * - * @return true on success, false otherwise - */ - external function fx_areRectanglesInside(in SequenceOfRectangularRegion p_rectanglar_region_1, in SequenceOfRectangularRegion p_rectanglar_region_2) return boolean; - - /** - * @desc Check that p_polygonal_region_1 polygonal region is included into p_polygonal_region_2 polygonal region - * @param p_polygonal_region_1 Polygonal region 1 - * @param p_polygonal_region_2 Polygonal region 2 - * - * @return true on success, false otherwise - */ - external function fx_arePolygonsInside(in PolygonalRegion p_polygonal_region_1, in PolygonalRegion p_polygonal_region_2) return boolean; - - /** - * @desc Convert a spacial coordinate from DMS to Dms - * @param p_degrees The degrees (D) - * @param p_minutes The minutes (M) - * @param p_seconds The seconds (S) - * @param p_latlon The latitude/longitude: (N|S|E|W) - * @return The decimal coordinate on success, 0.0, otherwise - * @verdict Unchanged - */ - external function fx_dms2dd(in Int p_degrees, in Int p_minutes, in float p_seconds, in Oct1 p_latlon) return float; - - } // End of group geodesic - - } // End of group externalFunctions - - group geometryFunctions { - - function f_checkRegionValidityRestiction( - in EtsiTs103097Certificate p_cert, - in EtsiTs103097Certificate p_cert_issuer - ) return boolean { - var GeographicRegion v_cert_region, v_cert_issuer_region; - var boolean v_cert_issuer_region_result; - - // FIXME To be reviewed - - // Sanity checks - if (ispresent(p_cert.toBeSigned.region) == false) { - log("f_checkRegionValidityRestiction: GeographicRegion missig into certificate"); - return false; - } - if (ispresent(p_cert_issuer.toBeSigned.region) == false) { - // No greographical constraints - return true; - } - v_cert_region := p_cert.toBeSigned.region; - v_cert_issuer_region := p_cert_issuer.toBeSigned.region; - if (ispresent(v_cert_region.circularRegion) and ispresent(v_cert_issuer_region.circularRegion)) { - // Check v_cert_region 'circle' is inside v_cert_issuer_region 'circle' - if (f_areCirclesInside(valueof(v_cert_region.circularRegion), valueof(v_cert_issuer_region.circularRegion)) == false) { - log("f_checkRegionValidityRestiction: FAIL: Issuer and issuing certificates circle area does not match"); - return false; - } - } else if (ispresent(v_cert_region.rectangularRegion) and ispresent(v_cert_issuer_region.rectangularRegion)) { - // Check v_cert_region 'rectangle' is inside v_cert_issuer_region 'rectangle' - if (f_isRectangularRegionsIntersected(v_cert_region.rectangularRegion, v_cert_issuer_region.rectangularRegion) == false) { - log("f_checkRegionValidityRestiction: FAIL: Issuer and issuing certificates rectangle area does not match"); - return false; - } - } else if (ispresent(v_cert_region.polygonalRegion) and ispresent(v_cert_issuer_region.polygonalRegion)) { - // Check v_cert_region 'polygon' is inside v_cert_issuer_region 'polygon' - log("f_checkRegionValidityRestiction: FAIL: Not implemented"); - // TODO - return false; - } else if (ispresent(v_cert_region.identifiedRegion) and ispresent(v_cert_issuer_region.identifiedRegion)) { - log("f_checkRegionValidityRestiction: FAIL: Not implemented"); - // Check id_region - // TODO - } - /*if (v_cert_region.validity.region.region_type == e_polygon) { - if (v_cert_issuer_region.validity.region.region_type == e_polygon) { - // Check v_cert_region 'polygon' is inside v_cert_issuer_region 'polygon' - if (f_arePolygonsInside(v_cert_region.validity.region.region.polygonal_region, v_cert_issuer_region.validity.region.region.polygonal_region) == false) { - log("*** " & testcasename() & ": FAIL: Issuer and issuing certificates polygon area does not match ***"); - return false; - } - } - } else if (v_cert_region.validity.region.region_type == e_id) { - // Check id_region - if (not match (v_cert_region.validity.region, mw_geographicRegion_identified(mw_identifiedRegion_iso3166_any))) { - log("*** " & testcasename() & ": FAIL: Identified region is not conformed to ISO 3166-1 ***"); - return false; - } - if (not match (v_cert_region.validity.region, mw_geographicRegion_identified(mw_identifiedRegion_un_stats_any))) { - log("*** " & testcasename() & ": FAIL: Identified region is not conformed to United Nations Statistics Division ***"); - return false; - } - // Check region_dictionary - if (not match (v_cert_region.validity.region.region.id_region.region_dictionary, v_cert_issuer_region.validity.region.region.id_region.region_dictionary)) { - log("*** " & testcasename() & ": FAIL: Issuer and issuing 'region_dictionary' field does not match ***"); - return false; - } - // Check region_identifier - if (not match (v_cert_region.validity.region.region.id_region.region_identifier, v_cert_issuer_region.validity.region.region.id_region.region_identifier)) { - log("*** " & testcasename() & ": FAIL: Issuer and issuing 'region_identifier' field does not match ***"); - return false; - } - // Check local_region - if ( - (not match (v_cert_issuer_region.validity.region.region.id_region.local_region, v_cert_region.validity.region.region.id_region.local_region)) or - (not match (v_cert_issuer_region.validity.region.region.id_region.local_region, 0)) - ) { - log("*** " & testcasename() & ": FAIL: Issuer and issuing 'local_region' field does not match ***"); - return false; - } - } - }*/ - - return true; - } // End of function f_checkRegionValidityRestiction - - /** - * @desc Check that p_circular_region_1 circular region is included into p_circular_region_2 circular region - * @param p_circular_region_1 Circular region 1 - * @param p_circular_region_2 Circular region 2 - * - * @return true on success, false otherwise - */ - function f_areCirclesInside( - in CircularRegion p_circular_region_1, - in CircularRegion p_circular_region_2 - ) return boolean { - return fx_areCirclesInside(p_circular_region_1, p_circular_region_2); - } - - /** - * @desc Check that p_rectanglar_region_1 rectangular region is included into p_rectanglar_region_2 rectangular region - * @param p_rectanglar_region_1 Rectangular region 1 - * @param p_rectanglar_region_2 Rectangular region 2 - * - * @return true on success, false otherwise - */ - function f_areRectanglesInside( - in SequenceOfRectangularRegion p_rectanglar_region_1, - in SequenceOfRectangularRegion p_rectanglar_region_2 - ) return boolean { - return fx_areRectanglesInside(p_rectanglar_region_1, p_rectanglar_region_2); - } - - /** - * @desc Check that p_polygonal_region_1 polygonal region is included into p_polygonal_region_2 polygonal region - * @param p_polygonal_region_1 Polygonal region 1 - * @param p_polygonal_region_2 Polygonal region 2 - * - * @return true on success, false otherwise - */ - function f_arePolygonsInside( - in PolygonalRegion p_polygonal_region_1, - in PolygonalRegion p_polygonal_region_2 - ) return boolean { - return fx_arePolygonsInside(p_polygonal_region_1, p_polygonal_region_2); - } - - /** - * @desc Check that given location is valid - * @param p_location location to be checked - * @return true on success, false otherwise - */ - function f_isValidTwoDLocation( - in template (value) TwoDLocation p_location - ) return boolean { - return -//FIXME RGY Titan doesn't support dot notation after valueof at the moment -// (valueof(p_location).longitude != c_maxLongitude + 1) and -// (valueof(p_location).latitude != c_maxLatitude + 1); - (valueof(p_location.longitude) != c_maxLongitude + 1) and - (valueof(p_location.latitude) != c_maxLatitude + 1); - } // End of function f_isValidTwoDLocation - - /** - * @desc Check that two given rectanlular regions are intersected - * Note: Regions must be normalized(northWest.latitude >= southEast.latitude) - * @param p_r1 Region 1 - * @param p_r2 Region 2 - * - * @return true on success, false otherwise - */ - function f_isRectangularRegionsIntersected( - in template (value) SequenceOfRectangularRegion p_r1, - in template (value) SequenceOfRectangularRegion p_r2 - ) return boolean { - var integer v_min := f_min(lengthof(p_r1), lengthof(p_r2)); - - for (var integer i := 0; i < v_min; i := i + 1) { - if (not ( - valueof(p_r2[i].northWest.longitude) > valueof(p_r1[i].southEast.longitude) or - valueof(p_r2[i].southEast.longitude) < valueof(p_r1[i].northWest.longitude) or - valueof(p_r2[i].southEast.latitude) > valueof(p_r1[i].northWest.latitude) or - valueof(p_r2[i].northWest.latitude) < valueof(p_r1[i].southEast.latitude) - )) { - return false; - } - } // End of 'for' statement - - return true; - } // End of function f_isRectangularRegionsIntersected - - function f_isContinuousRectangularRegions( - in template (value) SequenceOfRectangularRegion p_region - ) return boolean { - var integer v_i, v_j; - var boolean v_found; - - for (v_i := 0; v_i < lengthof(p_region); v_i := v_i + 1) { - var PolygonalRegion v_region_base; - f_convertRectangularRegionIntoPolygonalRegion(valueof(p_region[v_i]), v_region_base); - v_found := false; - for (v_j := 0; v_j < lengthof(p_region); v_j := v_j + 1) { - if (v_j != v_i) { - var PolygonalRegion v_region; - f_convertRectangularRegionIntoPolygonalRegion(valueof(p_region[v_j]), v_region); - if (f_isPolygonalRegionInside(v_region, v_region_base) == true) { - v_found := true; - } - } - } // End of 'for' statement - if (v_found == false) { - return false; - } - } // End of 'for' statement - - return true; - } // End of function f_isContinuousRectangularRegions - - /** - * @desc Check if a polygonal region is inside another one - * @param p_parent The main polygonal region - * @param p_region The polygonal region to be included - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_isRectangularRegionsInside( - in template (value) SequenceOfRectangularRegion p_parent, - in template (value) SequenceOfRectangularRegion p_region - ) return boolean { - var integer v_i, v_j; - - for (v_i := 0; v_i < lengthof(p_parent); v_i := v_i + 1) { - var PolygonalRegion v_region_parent, v_region; - f_convertRectangularRegionIntoPolygonalRegion(valueof(p_parent[v_i]), v_region_parent); - for (v_j := 0; v_j < lengthof(p_parent); v_j := v_j + 1) { - f_convertRectangularRegionIntoPolygonalRegion(valueof(p_region[v_j]), v_region); - if (f_isPolygonalRegionInside(v_region, v_region_parent) == true) { - return true; - } - } // End of 'for' statement - } // End of 'for' statement - - return false; - } // End of function f_isRectangularRegionsInside - - /** - * @desc Convert a rectangular region into a polygonal region - * @param p_region The rectangular regions to convert - * @return - * @verdict - */ - function f_convertRectangularRegionIntoPolygonalRegion( - in template (value) RectangularRegion p_rectangular_region, - out PolygonalRegion p_region - ) return boolean { - - // Convert rectangular regions to polygons and check polygons - p_region[0] := valueof(p_rectangular_region.northWest); - p_region[1] := { - valueof(p_rectangular_region.northWest.latitude) + valueof(p_rectangular_region.southEast.latitude), - valueof(p_rectangular_region.northWest.longitude) - }; - p_region[2] := valueof(p_rectangular_region.southEast); - p_region[3] := { - valueof(p_rectangular_region.northWest.latitude), - valueof(p_rectangular_region.northWest.longitude) + valueof(p_rectangular_region.southEast.longitude) - }; - log("f_convertRectangularRegionIntoPolygonalRegion: DEBUG: Northwest location is invalid in rect ", p_region); - - return true; - } // End of function - - /** - * @desc Check that given polygon doesn't have neither self-intersections nor holes. - * @param p_region Polygonal Region - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_isValidPolygonalRegion( - in template (value) PolygonalRegion p_region - ) return boolean { - // Sanity check - if (not isbound(p_region) or (lengthof(p_region) == 0)) { - return false; - } - - return fx_isValidPolygonalRegion(valueof(p_region)); - } // End of function f_isValidPolygonalRegion - - /** - * @desc Check if a polygonal region is inside another one - * @param p_parent The main polygonal region - * @param p_region The polygonal region to be included - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_isPolygonalRegionInside( - in template (value) PolygonalRegion p_parent, - in template (value) PolygonalRegion p_region - ) return boolean { - // Sanity check - if (not isbound(p_parent) or not isbound(p_region) or (lengthof(p_parent) == 0) or (lengthof(p_region) == 0)) { - return false; - } - - return fx_isPolygonalRegionInside(valueof(p_parent), valueof(p_region)); - } // End of function f_isPolygonalRegionInside - - /** - * @desc - */ - function f_isIdentifiedRegionInside( - in template (value) UInt16 p_parent, - in template (value) UInt16 p_region - ) return boolean { - return valueof(p_parent) == valueof(p_region); - } // End of function f_isIdentifiedRegionInside - - /** - * @desc Check that the location is inside a region - * @param p_region The region to consider - * @param p_location The device location - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_isLocationInsideRegion( - in template (value) GeographicRegion p_region, - in template (value) ThreeDLocation p_location - ) return boolean { - var boolean v_ret := false; - - if (ischosen(p_region.circularRegion)) { - v_ret := f_isLocationInsideCircularRegion(valueof(p_region.circularRegion), p_location); - } else if (ischosen(p_region.rectangularRegion)) { - v_ret := f_isLocationInsideRectangularRegion(valueof(p_region.rectangularRegion), p_location); - } else if (ischosen(p_region.polygonalRegion)) { - v_ret := f_isLocationInsidePolygonalRegion(valueof(p_region.polygonalRegion), p_location); - } else if (ischosen(p_region.identifiedRegion)) { - for (var integer v_i := 0; v_i < lengthof(p_region.identifiedRegion); v_i := v_i + 1) { - if (f_isLocationInsideIdentifiedRegion(valueof(p_region.identifiedRegion[v_i]), p_location) == true) { - v_ret := true; - break; - } - } // End of 'for' statement - } - - return v_ret; - } // End of function f_isLocationInsideRegion - - /** - * @desc Check that the location is inside a circular region - * @param p_region The circular region to consider - * @param p_location The device location - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_isLocationInsideCircularRegion( - in template (value) CircularRegion p_region, - in template (value) ThreeDLocation p_location - ) return boolean { - // Sanity check - if (not isbound(p_region) or not isbound(p_location)) { - return false; - } - - return fx_isLocationInsideCircularRegion(valueof(p_region), valueof(p_location)); - } // End of function f_isLocationInsideCircularRegion - - /** - * @desc Check that the location is inside a rectangular region - * @param p_region The rectangular region to consider - * @param p_location The device location - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_isLocationInsideRectangularRegion( - in template (value) SequenceOfRectangularRegion p_region, - in template (value) ThreeDLocation p_location - ) return boolean { - // Sanity check - if (not isbound(p_region) or not isbound(p_location) or (lengthof(p_region) == 0)) { - return false; - } -// log("f_isLocationInsideRectangularRegion: p_polygonalArea: ", p_region); -// log("f_isLocationInsideRectangularRegion: p_location: ", p_location); - - return fx_isLocationInsideRectangularRegion(valueof(p_region), valueof(p_location)); - } // End of function f_isLocationInsideRectangularRegion - - /** - * @desc Check that the location is inside a polygonal region - * @param p_region The polygonal region to consider - * @param p_location The device location - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_isLocationInsidePolygonalRegion( - in template (value) PolygonalRegion p_region, - in template (value) ThreeDLocation p_location - ) return boolean { - // Sanity check - if (not isbound(p_region) or not isbound(p_location) or (lengthof(p_region) == 0)) { - return false; - } -// log("f_isLocationInsidePolygonalRegion: p_polygonalArea: ", p_region, " - ", valueof(p_region)); -// log("f_isLocationInsidePolygonalRegion: p_location: ", p_location, " - ", valueof(p_location)); - - return fx_isLocationInsidePolygonalRegion(valueof(p_region), valueof(p_location)); - } // End of function f_isLocationInsidePolygonalRegion - - /** - * @desc Check if the location is inside an identified region - * @param p_region The identified region to consider - * @param p_location The device location - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_isLocationInsideIdentifiedRegion( - in template (value) IdentifiedRegion p_region, - in template (value) ThreeDLocation p_location - ) return boolean { - // Sanity check - if (not isbound(p_region) or not isbound(p_location)) { - return false; - } - - return fx_isLocationInsideIdentifiedRegion(valueof(p_region), valueof(p_location)); - } // End of function f_isLocationInsideIdentifiedRegion - - /** - * @desc Check if the location is inside an undefined region - * @param p_region The identified region to consider - * @param p_location The device location - * @return true on success, false otherwise - * @verdict Unchanged - */ - function f_isLocationInsideOtherRegion( - in template (value) octetstring p_region, - in template (value) ThreeDLocation p_location - ) return boolean { - // Sanity check - if (valueof(p_region) == ''O) { - return false; - } - - return fx_isLocationInsideOtherRegion(valueof(p_region), valueof(p_location)); - } // End of function f_isLocationInsideOtherRegion - - /** - * @desc Convert a spacial coordinate from DMS to Dms - * @param p_degrees The degrees (D) - * @param p_minutes The minutes (M) - * @param p_seconds The seconds (S) - * @param p_latlon The latitude/longitude: (N|S|E|W) - * @return The decimal coordinate on success, 0.0, otherwise - * @verdict Unchanged - */ - function f_dms2dd( - in integer p_degrees, - in integer p_minutes, - in float p_seconds, - in charstring p_latlon - ) return float { - var Oct1 v_latlon; - - // Sanity checks - if (lengthof(p_latlon) != 1) { - return 0.0; - } else if ((p_latlon != "N") and (p_latlon != "S") and (p_latlon != "E") and (p_latlon != "W")) { - return 0.0; - } - v_latlon := char2oct(p_latlon); - - return fx_dms2dd(p_degrees, p_minutes, p_seconds, v_latlon); - } // End of function f_dms2dd - - /** - * @desc Convert the latitude from float to int - * @param p_latitude The latitude to be converted. Significand length shall be 7 digits length - * @return The converted latitude - * @verdict Unchanged - */ - function f_ddlat2int( - in float p_latitude - ) return SecLatitude { - return float2int(p_latitude * 10000000.0); // Significand length shall be 7 digits length - } - - /** - * @desc Convert the longitude from float to int - * @param p_longitude The longitude to be converted. Significand length shall be 6 digits length - * @return The converted longitude - * @verdict Unchanged - */ - function f_ddlon2int( - in float p_longitude - ) return SecLongitude { - return float2int(p_longitude * 1000000.0); // Significand length shall be 6 digits length - } - - } // End of group geometryFunctions - -} // End of module LibItsSecurity_Functions - diff --git a/ttcn/Security/LibItsSecurity_Pics.ttcn b/ttcn/Security/LibItsSecurity_Pics.ttcn deleted file mode 100644 index 4265a9fc..00000000 --- a/ttcn/Security/LibItsSecurity_Pics.ttcn +++ /dev/null @@ -1,97 +0,0 @@ -/** - * @author ETSI / STF481 / STF507 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Security/LibItsSecurity_Pics.ttcn3 $ - * $Id: LibItsSecurity_Pics.ttcn3 1318 2017-01-26 10:20:53Z filatov $ - * @desc Module containing Pics for Security Protocol - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsSecurity_Pics { - - // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; - - // LibItsSecurity - import from LibItsSecurity_TypesAndValues all; - - /** - * Does the IUT support SHA-256 digest - */ - modulepar boolean PICS_SEC_SHA256 := true; - - /** - * Does the IUT support SHA-384 digest - */ - modulepar boolean PICS_SEC_SHA384 := false; - - /** - * Does the IUT support NIST P256 algorithm - */ - modulepar boolean PICS_SEC_NIST_P256 := true; - - /** - * Does the IUT support Brainpool P256r1 algorithm - */ - modulepar boolean PICS_SEC_BRAINPOOL_P256R1 := false; - - /** - * Does the IUT support Brainpool P384r1 algorithm - */ - modulepar boolean PICS_SEC_BRAINPOOL_P384R1 := false; - - /** - * Is the IUT able to distribute AT certificates - */ - modulepar boolean PICS_SEC_P2P_AT_DISTRIBUTION := true; - - /** - * Is the IUT able to distribute AA certificates - */ - modulepar boolean PICS_SEC_P2P_AA_DISTRIBUTION := true; - - /** - * Is the IUT support certificates pushing - */ - modulepar boolean PICS_SEC_CERTIFICATE_SELECTION := true; - - /** - * Is the IUT support circular region geographical restriction - */ - modulepar boolean PICS_SEC_CIRCULAR_REGION := true; - - /** - * Does the IUT support rectangular region geographical restriction - */ - modulepar boolean PICS_SEC_RECTANGULAR_REGION := true; - - /** - * Does the IUT support polygonal region geographical restriction - */ - modulepar boolean PICS_SEC_POLYGONAL_REGION := true; - - /** - * Is the IUT support identified region geographical restriction - */ - modulepar boolean PICS_SEC_IDENTIFIED_REGION := true; - - /** - * Does the IUT support identified region/UN geographical restriction - */ - //TODO Remove modulepar boolean PICS_SEC_UN_STATS_REGION_DICTIONARY := true; - - /** - * Does the IUT support identified region/ISO31661 geographical restriction - */ - //TODO Remove modulepar boolean PICS_ISO31661_REGION_DICTIONARY := true; - - /** - * Does the IUT support ITS-AID for Generic profile? - */ - modulepar boolean PICS_SEC_ITS_AID_OTHER := true; - -} // End of module LibItsSecurity_Pics diff --git a/ttcn/Security/LibItsSecurity_Pixits.ttcn b/ttcn/Security/LibItsSecurity_Pixits.ttcn deleted file mode 100644 index c25a11e1..00000000 --- a/ttcn/Security/LibItsSecurity_Pixits.ttcn +++ /dev/null @@ -1,65 +0,0 @@ -/** - * @author ETSI / STF481 / STF507 / STF517 / STF538 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Security/LibItsSecurity_Pixits.ttcn3 $ - * $Id: LibItsSecurity_Pixits.ttcn3 1318 2017-01-26 10:20:53Z filatov $ - * @desc Module containing Pixits for Security Protocol - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsSecurity_Pixits { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; - - /** - * @desc Root path to access certificate stored in files, identified by certficate ID - */ - modulepar charstring PX_CERTIFICATE_POOL_PATH := "data/v3/certificates"; - - /** - * @desc Configuration sub-directory to access certificate stored in files - */ - modulepar charstring PX_IUT_SEC_CONFIG_NAME := ""; - - /** - * @desc The certficate the IUT should use. Default: CERT_IUT_A_AT - * @remark If the IUT cannot use the test certificates, set this PIXIT to CERT_NONE - */ - modulepar charstring PX_IUT_DEFAULT_CERTIFICATE := "CERT_IUT_A_AT"; - - /** - * @desc The certficate the IUT should use. Default: CERT_TS_B_AT - * @remark Possible values: CERT_TS_C_AT, CERT_TS_D_AT, or CERT_TS_E_AT - */ - modulepar charstring PX_AT_CERTIFICATE := "CERT_TS_B_AT"; - - /** - * @desc ITS-AID value for other profile. Default: 38 - */ - modulepar Psid PX_OTHER_ITS_AID := 141; // Assign to GN-MGMT, Other than CA, DEN, MAP, SPAT, IVI, SRE, SSE & GN-MGMT: 38 - - /** - * @desc Invalid protocol version. Default: 3 - */ - modulepar UInt8 PX_WRONG_PROTOCOL_VERSION := 4; - - /** - * @desc Invalid WGS longitude - */ - modulepar SecLongitude PX_WGSLONGITUDE := 0; - - /** - * @desc Invalid WGS latitude. Default: 1 - */ - modulepar SecLatitude PX_WGSLATITUDE := 0; - -} // End of module LibItsSecurity_Pixits diff --git a/ttcn/Security/LibItsSecurity_Templates.ttcn b/ttcn/Security/LibItsSecurity_Templates.ttcn deleted file mode 100644 index 32ef18a5..00000000 --- a/ttcn/Security/LibItsSecurity_Templates.ttcn +++ /dev/null @@ -1,2101 +0,0 @@ -/** - * @author ETSI / STF481 / STF507 / STF517 / STF538 / STF545 - * @version $Url$ - * $Id$ - * @desc Module containing templates for Security Protocol - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsSecurity_Templates { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - - // LibItsGeoNetworking - import from LibItsGeoNetworking_TypesAndValues all; - - // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; - - // LibItsSecurity - import from LibItsSecurity_TypesAndValues all; - import from LibItsSecurity_Pixits all; - - /** - * @desc Constants declaration - */ - group constants { - - /** - * @desc Protocol version - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.1 Ieee1609Dot2Data - */ - const UInt8 c_protocol_version := 3; - - /** - * @desc Certificate version - * @see Draft ETSI TS 103 097 V1.3.1 Clause 6.1 Certificate - */ - const UInt8 c_certificate_version := 3; - - /** - * @desc Its AID for Other - * @see Draft ETSI TS 103 097 V1.3.1 Clause 7.3 Security profile for DENMs - */ - template Psid c_its_aid_Other := PX_OTHER_ITS_AID; - - /** - * @desc Minimal value of Longitude - */ - const SecLongitude c_minLongitude := -1799999999; // TODO Use constant from IEEE1609dot2BaseTypes - - /** - * @desc Maximal value of Longitude - */ - const SecLongitude c_maxLongitude := 1800000000; // TODO Use constant from IEEE1609dot2BaseTypes - - /** - * @desc Minimal value of Latitude - */ - const SecLatitude c_minLatitude := -900000000; // TODO Use constant from IEEE1609dot2BaseTypes - - /** - * @desc Maximal value of Latitude - */ - const SecLatitude c_maxLatitude := 900000000; // TODO Use constant from IEEE1609dot2BaseTypes - - /** - * @desc List of ISO-3166 country codes - */ - const SequenceOfUint16 c_iso3166Codes := { - 4, 8, 10, 12, 16, 20, 24, 28, 31, 32, 36, 40, 44, 48, 50, 51, 52, 56, - 60, 64, 68, 70, 72, 74, 76, 84, 86, 90, 92, 96, 100, 104, 108, 112, 116, 120, - 124, 132, 136, 140, 144, 148, 152, 156, 158, 162, 166, 170, 174, 175, 178, 180, 184, 188, - 191, 192, 196, 203, 204, 208, 212, 214, 218, 222, 226, 231, 232, 233, 234, 238, 239, 242, - 246, 248, 250, 254, 258, 260, 262, 266, 268, 270, 275, 276, 288, 292, 296, 300, 304, 308, - 312, 316, 320, 324, 328, 332, 334, 336, 340, 344, 348, 352, 356, 360, 364, 368, 372, 376, - 380, 384, 388, 392, 398, 400, 404, 408, 410, 414, 417, 418, 422, 426, 428, 430, 434, 438, - 440, 442, 446, 450, 454, 458, 462, 466, 470, 474, 478, 480, 484, 492, 496, 498, 499, 500, - 504, 508, 512, 516, 520, 524, 528, 531, 533, 534, 535, 540, 548, 554, 558, 562, 566, 570, - 574, 578, 580, 581, 583, 584, 585, 586, 591, 598, 600, 604, 608, 612, 616, 620, 624, 626, - 630, 634, 638, 642, 643, 646, 652, 654, 659, 660, 662, 663, 666, 670, 674, 678, 682, 686, - 688, 690, 694, 702, 703, 704, 705, 706, 710, 716, 724, 728, 729, 732, 740, 744, 748, 752, - 756, 760, 762, 764, 768, 772, 776, 780, 784, 788, 792, 795, 796, 798, 800, 804, 807, 810, - 818, 826, 831, 832, 833, 834, 840, 850, 854, 858, 860, 862, 876, 882, 887, 894 - }; - - /** - * @desc List of United Nations Statistics Division country codes - */ - const SequenceOfUint16 c_unStatsAdditionalCodes := { - 1, 2, 5, 9, 11, 13, 14, 15, 17, 18, 19, 21, 29, 30, 34, 35, 39, 53, - 54, 57, 61, 142, 143, 145, 150, 151, 154, 155, 199, 419, 432, 680, 722, 830 - }; - - } // End of group constants - - /** - * @desc Dummy send/receive templates for security headers - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4 Basic format elements - */ - group dummyBasicFormatElements { - - /** - * @desc Dummy receive templates for security headers - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2 Specification of basic format elements - */ - group dummyBasicFormatElementsRecv { - - /** - * @desc Dummy receive template for TwoDLocation - * @param p_latitude Latitude range from 900 000 000 to +900 000 000 - * @param p_longitude Longitude range from 1 800 000 000 to +1 800 000 000 - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.19 TwoDLocation - */ - template (present) TwoDLocation mw_twoDLocation_dummy := { - latitude := ?, - longitude := ? - } // End of template mw_twoDLocation_dummy - - /** - * @desc Dummy send template for ThreeDLocation - * @param p_latitude Latitude range from 900 000 000 to +900 000 000 - * @param p_longitude Longitude range from 1 800 000 000 to +1 800 000 000 - * @param p_elevation Elevation relative to the WGS-84 ellipsoid in decimetres - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.20 ThreeDLocation - */ - template (present) ThreeDLocation mw_threeDLocation_dummy := { - latitude := ?, - longitude := ?, - elevation := ? - } // End of template mw_threeDLocation_dummy - - } // End of group dummyBasicFormatElementsRecv - - } // End of group dummyBasicFormatElements - - /** - * @desc Send/receive templates for security headers - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4 Basic format elements - */ - group basicFormatElements { - - /** - * @desc Send templates for security headers - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2 Specification of basic format elements - */ - group basicFormatElementsSend { - - /** - * @desc Send templates for Signature description - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.9 Signature - * @see Draft ETSI TS 103 097 V1.3.1 Table 2: Derivation of field sizes depending on the used algorithm - */ - group signatures { - - /** - * @desc Send template for signatures based on ECDSA algorithm - * @member p_ecdsaSignature The ECDSA based signature - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.9 Signature - */ - template (value) Signature m_signature( - in template (value) EcdsaP256Signature p_ecdsaSignature - ):= { - ecdsaNistP256Signature := p_ecdsaSignature - } // End of template m_signature_ecdsa - - /** - * @desc Send template for ECDSA based signature - * @member p_r The coordinate of the elliptic curve point resulting from multiplying the generator element by the ephemeral private key - * @member p_s The signature - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.10 EcdsaP256Signature - */ - template (value) EcdsaP256Signature m_ecdsaSignature( - in template (value) EccP256CurvePoint p_rSig, - in template (value) octetstring p_sSig - ) := { - rSig := p_rSig, - sSig := p_sSig - } // End of template m_ecdsaSignature - - } // End of group signatures - - group signerInfos { - - /** - * @desc Send template for self signed message - */ - template (value) SignerIdentifier m_signerIdentifier_self := { - self_ := NULL - } // End of template m_signerIdentifier_self - - /** - * @desc Send template for certificate signed message - */ - template (value) SignerIdentifier m_signerIdentifier_certificate( - in template (value) Certificate p_certificate // TODO Use SingleEtsiTs103097Certificate - ) := { - certificate := { p_certificate } // Only one - } // End of template m_signerIdentifier_certificate - - /** - * @desc Send template for digest signed message - */ - template (value) SignerIdentifier m_signerIdentifier_digest( - in template (value) HashedId8 p_digest := '0000000000000000'O - ) := { - digest := p_digest - } // End of template m_signerIdentifier_digest - - /** - * @desc Send template for certificate signed message - */ - template (value) SignerIdentifier m_signerIdentifier_certificates( - in template (value) SequenceOfCertificate p_certificates := {} - ) := { - certificate := p_certificates - } // End of template m_signerIdentifier_certificates - - } // End of group signerInfos - - /** - * @desc Send template for TwoDLocation - * @param p_latitude Latitude range from 900 000 000 to +900 000 000 - * @param p_longitude Longitude range from 1 800 000 000 to +1 800 000 000 - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.19 TwoDLocation - */ - template (value) TwoDLocation m_twoDLocation( - in template (value) SecLatitude p_latitude, - in template (value) SecLongitude p_longitude - ) := { - latitude := p_latitude, - longitude := p_longitude - } // End of template m_twoDLocation - - /** - * @desc Send template for ThreeDLocation - * @param p_latitude Latitude range from 900 000 000 to +900 000 000 - * @param p_longitude Longitude range from 1 800 000 000 to +1 800 000 000 - * @param p_elevation Elevation relative to the WGS-84 ellipsoid in decimetres - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.20 ThreeDLocation - */ - template (value) ThreeDLocation m_threeDLocation( - in template (value) SecLatitude p_latitude, - in template (value) SecLongitude p_longitude, - in template (value) SecElevation p_elevation - ) := { - latitude := p_latitude, - longitude := p_longitude, - elevation := p_elevation - } // End of template m_threeDLocation - - /** - * @desc Send template circular geographic region - * @param p_center Circle center - * @param p_radius Circle radius - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion - */ - template (value) GeographicRegion m_geographicRegion_circle( - in template (value) TwoDLocation p_center, - in template (value) UInt16 p_radius - ) := { - circularRegion := { - center := p_center, - radius := p_radius - } - } // End of template m_geographicRegion_circle - - /** - * @desc Send template rectangular geographic region - * @param p_northwest Upper left corner - * @param p_southeast Lower rigth corner - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion - */ - template (value) GeographicRegion m_geographicRegion_rectangular( - in template (value) TwoDLocation p_northwest, - in template (value) TwoDLocation p_southeast - ) := { - rectangularRegion := { - { - northWest := p_northwest, - southEast := p_southeast - } - } - } // End of template m_geographicRegion_rectangular - - /** - * @desc Send template polygonial geographic region - * @param p_polygonal_region Polygonial region description - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion - */ - template (value) GeographicRegion m_geographicRegion_polygonial( - in template (value) PolygonalRegion p_polygonal_region - ) := { - polygonalRegion := p_polygonal_region - } // End of template m_geographicRegion_polygonial - - /** - * @desc Send template for geographic identified region - * @param p_identifiedRegion Indentified region - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion - */ - template (value) GeographicRegion m_geographicRegion_identifiedRegion( - in template (value) SequenceOfIdentifiedRegion p_identifiedRegions - ) := { - identifiedRegion := p_identifiedRegions - } // End of template m_geographicRegion_identifiedRegion - - template (value) IdentifiedRegion m_identifiedRegion_country_only( - in template (value) CountryOnly p_countryOnly - ) := { - countryOnly := p_countryOnly - } // End of template m_identifiedRegion_country_only - - template (value) IdentifiedRegion m_identifiedRegion_country_and_region( - in template (value) CountryOnly p_countryOnly, - in template (value) SequenceOfUint8 p_regions - ) := { - countryAndRegions := { - countryOnly := p_countryOnly, - regions := p_regions - } - } // End of template m_identifiedRegion_country_and_region - - } // End of group basicFormatElementsSend - - /** - * @desc Receive templates for security headers - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2 Specification of basic format elements - */ - group basicFormatElementsRecv { - - group signerIdentifiers { - - /** - * @desc Recv template for message signed with digest - */ - template (present) SignerIdentifier mw_signerIdentifier_digest( - template (present) HashedId8 p_digest := ? - ) := { - digest := p_digest - } // End of template mw_signerIdentifier_digest - - template (present) SignerIdentifier mw_signerIdentifier_certificate( - template (present) EtsiTs103097Certificate p_certificate := ? - ) := { - certificate := { p_certificate } - } // End of template m_signerIdentifier_certificate - - template (present) SignerIdentifier mw_signerIdentifier_certificates( - template (present) SequenceOfCertificate p_certificates := ? - ) := { - certificate := p_certificates - } // End of template mw_signerIdentifier_certificates - - } // End of group signerIdentifiers - - /** - * @desc Receive templates for Signature description - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.9 Signature - * @see Draft ETSI TS 103 097 V1.3.1 Table 2: Derivation of field sizes depending on the used algorithm - */ - group signatures { - - /** - * @desc Receive template for signatures based on ECDSA algorithm - * @member p_ecdsaSignature The ECDSA based signature - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.9 Signature - */ - template (present) Signature mw_signature( - template (present) EcdsaP256Signature p_ecdsaSignature := ? - ):= { - ecdsaNistP256Signature := p_ecdsaSignature - } // End of template mw_signature - - /** - * @desc Receive template for ECDSA based signature - * @member p_r The coordinate of the elliptic curve point resulting from multiplying the generator element by the ephemeral private key - * @member p_s The signature - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.10 EcdsaP256Signature - */ - template (present) EcdsaP256Signature mw_ecdsaSignature( - template (present) EccP256CurvePoint p_rSig := ?, - template (present) octetstring p_sSig := ? - ) := { - rSig := p_rSig, - sSig := p_sSig - } // End of template mw_ecdsaSignature - - } // End of group signatures - - /** - * @desc Receive template for TwoDLocation - * @param p_latitude Latitude range from 900 000 000 to +900 000 000 - * @param p_longitude Longitude range from 1 800 000 000 to +1 800 000 000 - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.19 TwoDLocation - */ - template (present) TwoDLocation mw_twoDLocation( - template (present) SecLatitude p_latitude, - template (present) SecLongitude p_longitude - ) := { - latitude := p_latitude, - longitude := p_longitude - } // End of template mw_twoDLocation - - /** - * @desc Receive template for ThreeDLocation - * @param p_latitude Latitude range from 900 000 000 to +900 000 000 - * @param p_longitude Longitude range from 1 800 000 000 to +1 800 000 000 - * @param p_elevation Elevation relative to the WGS-84 ellipsoid in decimetres - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.20 ThreeDLocation - */ - template (present) ThreeDLocation mw_threeDLocation( - template (present) SecLatitude p_latitude, - template (present) SecLongitude p_longitude, - template (present) SecElevation p_elevation - ) := { - latitude := p_latitude, - longitude := p_longitude, - elevation := p_elevation - } // End of template mw_threeDLocation - - /** - * @desc Receive template circular geographic region - * @param p_center Circle center - * @param p_radius Circle radius - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion - */ - template (present) GeographicRegion mw_geographicRegion_circle( - template (present) TwoDLocation p_center := ?, - template (present) UInt16 p_radius := ? - ) := { - circularRegion := { - center := p_center, - radius := p_radius - } - } // End of template mw_geographicRegion_circle - - /** - * @desc Basic receive template rectangular geographic region - * @param p_northwest Upper left corner - * @param p_southeast Lower rigth corner - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion - */ - template (present) GeographicRegion mw_geographicRegion_rectangular := { - rectangularRegion := ? - } // End of template mw_geographicRegion_rectangular - - /** - * @desc Receive template polygonial geographic region - * @param p_polygonal_region Polygonial region description - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion - */ - template (present) GeographicRegion mw_geographicRegion_polygonal( - template (present) PolygonalRegion p_polygonal_region := ? - ) := { - polygonalRegion := p_polygonal_region - } // End of template mw_geographicRegion_polygonial - - /** - * @desc Receive template for geographic identified region - * @param p_identifiedRegion Indentified region - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.21 GeographicRegion - */ - template (present) GeographicRegion mw_geographicRegion_identified( - template (present) SequenceOfIdentifiedRegion p_identifiedRegion := ? - ) := { - identifiedRegion := p_identifiedRegion - } // End of template mw_geographicRegion_identifiedRegion - - template (present) IdentifiedRegion mw_identifiedRegion_country_only - := { - countryOnly := ?// FIXME ((all from c_iso3166Codes), (all from c_unStatsAdditionalCodes)) - } - - template (present) IdentifiedRegion mw_identifiedRegion_country_and_region := { - countryAndRegions := { - countryOnly := ?, // FIXME ((all from c_iso3166Codes), (all from c_unStatsAdditionalCodes)), - regions := ? - } - } - - } // End of group basicFormatElementsRecv - - } // End of group dummyBasicFormatElements - - /** - * @desc Send templates for security headers - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.1 EtsiTs103097Data - */ - group etsiTs103097Data { - - /** - * @desc Generic send template for EtsiTs103097Data message - */ - template (value) EtsiTs103097Data m_etsiTs103097Data( - in template (value) Ieee1609Dot2Content p_content - ) := { - protocolVersion := c_protocol_version, - content := p_content - } // End of template m_etsiTs103097Data - - /** - * @desc Generic receive template for EtsiTs103097Data message - */ - template (present) EtsiTs103097Data mw_etsiTs103097Data( - template (present) Ieee1609Dot2Content p_content := ? - ) := { - protocolVersion := c_protocol_version, - content := p_content - } // End of template mw_etsiTs103097Data - - template (value) EtsiTs103097Data m_etsiTs103097Data_unsecured( - in template (value) Opaque p_unsecuredData - ) := { - protocolVersion := c_protocol_version, - content := { unsecuredData := p_unsecuredData } - } // End of template m_secured_data_unsecured - - template (value) EtsiTs103097Data m_etsiTs103097Data_signed( - in template (value) SignedData p_signedData - ) := { - protocolVersion := c_protocol_version, - content := { signedData := p_signedData } - } // End of template m_secured_data_signed - - template (present) EtsiTs103097Data mw_etsiTs103097Data_signed( - template (present) SignedData p_signedData := ? - ) := { - protocolVersion := c_protocol_version, - content := { signedData := p_signedData } - } // End of template mw_secured_data_signed - - template (value) EtsiTs103097Data m_etsiTs103097Data_encrypted( - in template (value) EncryptedData p_encryptedData - ) := { - protocolVersion := c_protocol_version, - content := { encryptedData := p_encryptedData } - } // End of template m_etsiTs103097Data_encrypted - - template (present) EtsiTs103097Data mw_etsiTs103097Data_encrypted( - template (present) EncryptedData p_encryptedData := ? - ) := { - protocolVersion := c_protocol_version, - content := { encryptedData := p_encryptedData } - } // End of template mw_etsiTs103097Data_encrypted - - /** - * @desc Generic send template for EtsiTs103097Data message - */ - template (value) EtsiTs103097Data m_etsiTs103097Data_wrong_protocol( - in template (value) UInt8 p_protocol_version, - in template (value) Ieee1609Dot2Content p_content - ) := { - protocolVersion := c_protocol_version, - content := p_content - } // End of template m_etsiTs103097Data_wrong_protocol - - } // End of group etsiTs103097Data - - /** - * @desc Send templates for ToBeSignedData header - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 SignedData - */ - group signedData { - - template (value) SignedData m_signedData( - in template (value) HashAlgorithm p_hashId, - in template (value) ToBeSignedData p_tbsData, - in template (value) SignerIdentifier p_signer, - in template (value) Signature p_signature_ - ) := { - hashId := p_hashId, - tbsData := p_tbsData, - signer := p_signer, - signature_ := p_signature_ - } // End of template m_signedData - - template (present) SignedData mw_signedData( - template (present) HashAlgorithm p_hashId := ?, - template (present) ToBeSignedData p_tbsData := ?, - template (present) SignerIdentifier p_signer := ?, - template (present) Signature p_signature_ := ? - ) := { - hashId := p_hashId, - tbsData := p_tbsData, - signer := p_signer, - signature_ := p_signature_ - } // End of template mw_signedData - - template (value) ToBeSignedData m_toBeSignedData( - in template (value) SignedDataPayload p_payload, - in template (value) HeaderInfo p_headerInfo - ) := { - payload := p_payload, - headerInfo := p_headerInfo - } // End of template m_toBeSignedData - - template (present) ToBeSignedData mw_toBeSignedData( - template (present) SignedDataPayload p_payload := ?, - template (present) HeaderInfo p_headerInfo := ? - ) := { - payload := p_payload, - headerInfo := p_headerInfo - } // End of template mw_toBeSignedData - - template (value) SignedDataPayload m_signedDataPayload( - in template (value) Ieee1609Dot2Data p_data - ) := { - data := p_data, - extDataHash := omit - } // End of template m_signedDataPayload - - template (present) SignedDataPayload mw_signedDataPayload( - template (present) Ieee1609Dot2Data p_data := ? - ) := { - data := p_data, - extDataHash := * - } // End of template mw_signedDataPayload - - template (value) SignedDataPayload m_signedDataPayload_ext( - in template (value) Oct32 p_extDataHash - ) := { - data := omit, - extDataHash := { sha256HashedData := p_extDataHash } - } // End of template m_signedDataPayload_ext - - } // End of group signedData - - /** - * @desc Send templates for ToBeSignedData header - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.3 EncryptedData - */ - group encryptedData { - - template (value) EncryptedData m_encryptedData( - in template (value) SequenceOfRecipientInfo p_recipients, - in template (value) SymmetricCiphertext p_ciphertex - ) := { - recipients := p_recipients, - ciphertext := p_ciphertex - } // End of template m_encryptedData - - template (present) EncryptedData mw_encryptedData( - template (present) SequenceOfRecipientInfo p_recipients := ?, - template (present) SymmetricCiphertext p_ciphertex := ? - ) := { - recipients := p_recipients, - ciphertext := p_ciphertex - } // End of template mw_encryptedData - - template (value) RecipientInfo m_recipientInfo_pskRecipInfo( - in template (value) PreSharedKeyRecipientInfo p_pskRecipInfo - ) := { - pskRecipInfo := p_pskRecipInfo - } // End of template m_recipientInfo_pskRecipInfo - - template (present) RecipientInfo mw_recipientInfo_pskRecipInfo( - template (present) PreSharedKeyRecipientInfo p_pskRecipInfo := ? - ) := { - pskRecipInfo := p_pskRecipInfo - } // End of template mw_recipientInfo_pskRecipInfo - - template (value) RecipientInfo m_recipientInfo_symmRecipInfo( - in template (value) SymmRecipientInfo p_symmRecipInfo - ) := { - symmRecipInfo := p_symmRecipInfo - } // End of template m_recipientInfo_symmRecipInfo - - template (value) RecipientInfo m_recipientInfo_certRecipInfo( - in template (value) PKRecipientInfo p_certRecipInfo - ) := { - certRecipInfo := p_certRecipInfo - } // End of template m_recipientInfo_certRecipInfo - - template (present) RecipientInfo mw_recipientInfo_certRecipInfo( - template (present) PKRecipientInfo p_certRecipInfo := ? - ) := { - certRecipInfo := p_certRecipInfo - } // End of template mw_recipientInfo_certRecipInfo - - template (value) RecipientInfo m_recipientInfo_signedDataRecipInfo( - in template (value) PKRecipientInfo p_signedDataRecipInfo - ) := { - signedDataRecipInfo := p_signedDataRecipInfo - } // End of template m_recipientInfo_signedDataRecipInfo - - template (value) RecipientInfo m_recipientInfo_rekRecipInfo( - in template (value) PKRecipientInfo p_rekRecipInfo - ) := { - rekRecipInfo := p_rekRecipInfo - } // End of template m_recipientInfo_rekRecipInfo - - template (value) PKRecipientInfo m_pKRecipientInfo( - in template (value) HashedId8 p_recipientId, - in template (value) EncryptedDataEncryptionKey p_encKey - ) := { - recipientId := p_recipientId, - encKey := p_encKey - } // End of template m_pKRecipientInfo - - template (present) PKRecipientInfo mw_pKRecipientInfo( - template (present) HashedId8 p_recipientId := ?, - template (present) EncryptedDataEncryptionKey p_encKey := ? - ) := { - recipientId := p_recipientId, - encKey := p_encKey - } // End of template mw_pKRecipientInfo - - template (value) EciesP256EncryptedKey m_evciesP256EncryptedKey( - in template (value) EccP256CurvePoint p_v, - in template (value) Oct16 p_c, - in template (value) Oct16 p_t - ) :={ - v := p_v, - c := p_c, - t := p_t - } // End of template m_evciesP256EncryptedKey - - template (present) EciesP256EncryptedKey mw_evciesP256EncryptedKey( - template (present) EccP256CurvePoint p_v := ?, - template (present) Oct16 p_c := ?, - template (present) Oct16 p_t := ? - ) :={ - v := p_v, - c := p_c, - t := p_t - } // End of template mw_evciesP256EncryptedKey - - template (value) EncryptedDataEncryptionKey m_encryptedDataEncryptionKey_eciesNistP256( - in template (value) EciesP256EncryptedKey p_eciesNistP256 - ) := { - eciesNistP256 := p_eciesNistP256 - } // End of template m_encryptedDataEncryptionKey_eciesNistP256 - - template (present) EncryptedDataEncryptionKey mw_encryptedDataEncryptionKey_eciesNistP256( - template (present) EciesP256EncryptedKey p_eciesNistP256 := ? - ) := { - eciesNistP256 := p_eciesNistP256 - } // End of template mw_encryptedDataEncryptionKey_eciesNistP256 - - template (value) EncryptedDataEncryptionKey m_encryptedDataEncryptionKey_eciesBrainpoolP256r1( - in template (value) EciesP256EncryptedKey p_eciesBrainpoolP256r1 - ) := { - eciesBrainpoolP256r1 := p_eciesBrainpoolP256r1 - } // End of template m_encryptedDataEncryptionKey_eciesBrainpoolP256r1 - - template (present) EncryptedDataEncryptionKey mw_encryptedDataEncryptionKey_eciesBrainpoolP256r1( - template (present) EciesP256EncryptedKey p_eciesBrainpoolP256r1 := ? - ) := { - eciesBrainpoolP256r1 := p_eciesBrainpoolP256r1 - } // End of template mw_encryptedDataEncryptionKey_eciesBrainpoolP256r1 - - template (value) SymmetricCiphertext m_SymmetricCiphertext_aes128ccm( - in template (value) AesCcmCiphertext p_aes128ccm - ) := { - aes128ccm := p_aes128ccm - } // End of template m_SymmetricCiphertext_aes128ccm - - template (present) SymmetricCiphertext mw_SymmetricCiphertext_aes128ccm( - template (present) AesCcmCiphertext p_aes128ccm := ? - ) := { - aes128ccm := p_aes128ccm - } // End of template mw_SymmetricCiphertext_aes128ccm - - template (value) AesCcmCiphertext m_aesCcmCiphertext( - in template (value) Oct12 p_nonce, - in template (value) Opaque p_ccmCiphertext - ) := { - nonce := p_nonce, - ccmCiphertext := p_ccmCiphertext - } // End of template m_aesCcmCiphertext - - template (present) AesCcmCiphertext mw_aesCcmCiphertext( - template (present) Oct12 p_nonce := ?, - template (present) Opaque p_ccmCiphertext := ? - ) := { - nonce := p_nonce, - ccmCiphertext := p_ccmCiphertext - } // End of template mw_aesCcmCiphertext - - } // End of group encryptedData - - /** - * @desc Send/Receive templates for Payload - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload - */ - group ieee1609Dot2Data { - - /** - * @desc Send template for Ieee1609Dot2Data - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload - */ - template (value) Ieee1609Dot2Data m_ieee1609Dot2Data( - in template (value) Ieee1609Dot2Content p_content - ) := { - protocolVersion := c_protocol_version, - content := p_content - } // End of template m_ieee1609Dot2Data - - /** - * @desc Receive template for Ieee1609Dot2Data - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload - */ - template (present) Ieee1609Dot2Data mw_ieee1609Dot2Data( - template (present) Ieee1609Dot2Content p_content := ? - ) := { - protocolVersion := c_protocol_version, - content := p_content - } // End of template mw_ieee1609Dot2Data - - /** - * @desc Send template for 'unsecured' Payload - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload - */ - template (value) Ieee1609Dot2Content m_ieee1609Dot2Data_unsecured( - in template (value) Opaque p_unsecuredData - ) := { - unsecuredData := p_unsecuredData - } // End of template m_ieee1609Dot2Data_unsecured - - /** - * @desc Receive template for 'unsecured' Payload - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload - */ - template (present) Ieee1609Dot2Content mw_ieee1609Dot2Data_unsecured( - template (present) Opaque p_unsecuredData := ? - ) := { - unsecuredData := p_unsecuredData - } // End of template mw_ieee1609Dot2Data_unsecured - - /** - * @desc Send template for 'signed' Payload - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload - */ - template (value) Ieee1609Dot2Content m_ieee1609Dot2Data_signed( - in template (value) SignedData p_signedData - ) := { - signedData := p_signedData - } // End of template m_ieee1609Dot2Data_signed - - /** - * @desc Send template for 'signed' Payload - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.2 Payload - */ - template (present) Ieee1609Dot2Content mw_ieee1609Dot2Data_signed( - template (present) SignedData p_signedData := ? - ) := { - signedData := p_signedData - } // End of template mw_ieee1609Dot2Data_signed - - } // End of group ieee1609Dot2Data - - /** - * @desc Send/Receive templates for HeaderInfo - * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.4 HeaderInfo - */ - group headerFields { - - /** - * @desc Basic send HeaderInfo template with ETSI ITS restrction - */ - template (omit) HeaderInfo m_ieee1609Dot2_headerInfo( - in template (value) Psid p_psid - ) := { - psid := p_psid, - generationTime := omit, - expiryTime := omit, - generationLocation := omit, - p2pcdLearningRequest := omit, - missingCrlIdentifier := omit, - encryptionKey := omit, - inlineP2pcdRequest := omit, - requestedCertificate := omit - } // End of template m_ieee1609Dot2_headerInfo - - /** - * @desc Basic receive HeaderInfo template with ETSI ITS restrction - */ - template (present) HeaderInfo mw_ieee1609Dot2_headerInfo( - template (present) Psid p_psid := ? - ) := { - psid := p_psid, - generationTime := *, - expiryTime := *, - generationLocation := *, - p2pcdLearningRequest := omit, - missingCrlIdentifier := omit, - encryptionKey := omit, - inlineP2pcdRequest := omit, - requestedCertificate := omit - } // End of template mw_ieee1609Dot2_headerInfo - - /** - * @desc Basic receive HeaderInfo template with ETSI ITS restrction - */ - template (present) HeaderInfo mw_ieee1609Dot2_headerInfo_request_certificate( - template (present) Psid p_psid := ?, - template (present) Certificate p_requestedCertificate := ? - ) modifies mw_ieee1609Dot2_headerInfo := { - psid := p_psid, - generationTime := *, - expiryTime := *, - generationLocation := *, - p2pcdLearningRequest := omit, - missingCrlIdentifier := omit, - encryptionKey := omit, - inlineP2pcdRequest := omit, - requestedCertificate := p_requestedCertificate - } // End of template mw_ieee1609Dot2_headerInfo - - /** - * @desc CAM specific send HeaderInfo template with ETSI ITS restrction - * - * @see Clause 7.1.1 Security profile for CAMs - */ - template (omit) HeaderInfo m_headerInfo_cam( - in template (value) Psid p_psid := c_its_aid_CAM, - in template (value) Time64 p_generationTime, - in template (omit) Time64 p_expiryTime := omit, - in template (omit) SequenceOfHashedId3 p_inlineP2pcdRequest := omit - ) modifies m_ieee1609Dot2_headerInfo := { - generationTime := p_generationTime, - expiryTime := p_expiryTime, - generationLocation := omit, - inlineP2pcdRequest := p_inlineP2pcdRequest - } // End of template m_headerInfo_cam - - /** - * @desc CAM specific receive HeaderInfo template with ETSI ITS restrction - * - * Clause 7.1.1 Security profile for CAMs - */ - template (present) HeaderInfo mw_headerInfo_cam( - template (present) Psid p_psid := c_its_aid_CAM, - template (present) Time64 p_generationTime := ?, - template SequenceOfHashedId3 p_inlineP2pcdRequest := omit, - template Certificate p_requestedCertificate := omit - ) modifies mw_ieee1609Dot2_headerInfo := { - psid := c_its_aid_CAM, - generationTime := p_generationTime, - expiryTime := omit, - generationLocation := omit, - inlineP2pcdRequest := p_inlineP2pcdRequest, - requestedCertificate := p_requestedCertificate - } // End of template mw_headerInfo_cam - - /** - * - * Clause 7.1.2 Security profile for DENMs - */ - template (omit) HeaderInfo m_headerInfo_denm( - in template (value) Psid p_psid := c_its_aid_DENM, - in template (value) Time64 p_generationTime, - in template (value) ThreeDLocation p_generationLocation, - in template (omit) Time64 p_expiryTime := omit - ) modifies m_ieee1609Dot2_headerInfo := { - generationTime := p_generationTime, - expiryTime := p_expiryTime, - generationLocation := p_generationLocation - } // End of template m_headerInfo_denm - - /** - * - * Clause 7.1.2 Security profile for DENMs - */ - template (present) HeaderInfo mw_headerInfo_denm( - template (present) Psid p_psid := c_its_aid_DENM, - template (present) Time64 p_generationTime := ?, - template (present) ThreeDLocation p_generationLocation := ?, - template Time64 p_expiryTime := omit - ) modifies mw_ieee1609Dot2_headerInfo := { - generationTime := p_generationTime, - expiryTime := p_expiryTime, - generationLocation := p_generationLocation - } // End of template mw_headerInfo_denm - - /** - * - * Clause 7.1.3 Generic security profile for other signed messages - */ - template (omit) HeaderInfo m_headerInfo_gn( - in template (value) Psid p_psid := c_its_aid_GN, - in template (value) Time64 p_generationTime - ) modifies m_ieee1609Dot2_headerInfo := { - generationTime := p_generationTime - } // End of template m_headerInfo_gn - - /** - * - * Clause 7.1.3 Generic security profile for other signed messages - */ - template (present) HeaderInfo mw_headerInfo_gn( - template (present) Psid p_psid := c_its_aid_GN, - template (present) Time64 p_generationTime := ? - ) modifies mw_ieee1609Dot2_headerInfo := { - generationTime := p_generationTime, - expiryTime := *, - generationLocation := *, - encryptionKey := *, - inlineP2pcdRequest := *, - requestedCertificate := * - } // End of template mw_headerInfo_gn - - template (omit) HeaderInfo m_headerInfo_inner_pki_request( - in template (value) Psid p_psid := c_its_aid_SCR, - in template (value) Time64 p_generationTime - ) modifies m_ieee1609Dot2_headerInfo := { - generationTime := p_generationTime - }; - - template (omit) HeaderInfo m_headerInfo_inner_pki_response( - in template (value) Psid p_psid := c_its_aid_SCR, - in template (value) Time64 p_generationTime - ) modifies m_ieee1609Dot2_headerInfo := { - generationTime := p_generationTime - }; - - template (present) HeaderInfo mw_headerInfo_inner_pki_request( - template (present) Psid p_psid := c_its_aid_SCR, - template (present) Time64 p_generationTime := ? - ) modifies mw_headerInfo_gn := {}; - - template HeaderInfo mw_headerInfo_inner_pki_response( - template (present) Psid p_psid := c_its_aid_SCR, - template Time64 p_generationTime := * - ) modifies mw_ieee1609Dot2_headerInfo := { - generationTime := p_generationTime, - expiryTime := omit, - generationLocation := omit - } - - } // End of group headerFields - - group signatures { - - template (value) Signature m_signature_ecdsaNistP256( - in template (value) EcdsaP256Signature p_ecdsaNistP256Signature - ) := { - ecdsaNistP256Signature := p_ecdsaNistP256Signature - } // End of template m_signature_ecdsaNistP256 - - template (present) Signature mw_signature_ecdsaNistP256( - template (present) EcdsaP256Signature p_ecdsaNistP256Signature := ? - ) := { - ecdsaNistP256Signature := p_ecdsaNistP256Signature - } // End of template mw_signature_ecdsaNistP256 - - template (value) Signature m_signature_ecdsaBrainpoolP256r1( - in template (value) EcdsaP256Signature p_ecdsaBrainpoolP256r1Signature - ) := { - ecdsaBrainpoolP256r1Signature := p_ecdsaBrainpoolP256r1Signature - } // End of template m_signature_ecdsaBrainpoolP256r1 - - template (present) Signature mw_signature_ecdsaBrainpoolP256r1( - template (present) EcdsaP256Signature p_ecdsaBrainpoolP256r1Signature := ? - ) := { - ecdsaBrainpoolP256r1Signature := p_ecdsaBrainpoolP256r1Signature - } // End of template m_signature_ecdsaBrainpoolP256r1 - - template (value) Signature m_signature_ecdsaBrainpoolP384r1( - in template (value) EcdsaP384Signature p_ecdsaBrainpoolP384r1Signature - ) := { - ecdsaBrainpoolP384r1Signature := p_ecdsaBrainpoolP384r1Signature - } // End of template m_signature_ecdsaBrainpoolP384r1 - - template (present) Signature mw_signature_ecdsaBrainpoolP384r1( - template (present) EcdsaP384Signature p_ecdsaBrainpoolP384r1Signature := ? - ) := { - ecdsaBrainpoolP384r1Signature := p_ecdsaBrainpoolP384r1Signature - } // End of template mw_signature_ecdsaBrainpoolP384r1 - - template (value) EcdsaP256Signature m_ecdsaP256Signature( - in template (value) EccP256CurvePoint p_rSig, - in template (value) Oct32 p_sSig - ) := { - rSig := p_rSig, - sSig := p_sSig - } // End of template m_ecdsaP256Signature - - template (present) EcdsaP256Signature mw_ecdsaP256Signature( - template (present) EccP256CurvePoint p_rSig := ?, - template (present) Oct32 p_sSig := ? - ) := { - rSig := p_rSig, - sSig := p_sSig - } // End of template mw_ecdsaP256Signature - - template (value) EcdsaP384Signature m_ecdsaP384Signature( - in template (value) EccP384CurvePoint p_rSig, - in template (value) Oct48 p_sSig - ) := { - rSig := p_rSig, - sSig := p_sSig - } // End of template m_ecdsaP384Signature - - template (present) EcdsaP384Signature mw_ecdsaP384Signature( - template (present) EccP384CurvePoint p_rSig := ?, - template (present) Oct48 p_sSig := ? - ) := { - rSig := p_rSig, - sSig := p_sSig - } // End of template mw_ecdsaP384Signature - - template (value) EccP256CurvePoint m_eccP256CurvePoint_x_only( - in template (value) Oct32 p_x_only - ) := { - x_only := p_x_only - } // End of template m_eccP256CurvePoint_x_only - - template (present) EccP256CurvePoint mw_eccP256CurvePoint_x_only( - template (present) Oct32 p_x_only := ? - ) := { - x_only := p_x_only - } // End of template mw_eccP256CurvePoint_x_only - - template (value) EccP256CurvePoint m_eccP256CurvePoint_compressed_y_0( - in template (value) Oct32 p_compressed_y_0 - ) := { - compressed_y_0 := p_compressed_y_0 - } // End of template m_eccP256CurvePoint_compressed_y_0 - - template (present) EccP256CurvePoint mw_eccP256CurvePoint_compressed_y_0( - template (present) Oct32 p_compressed_y_0 := ? - ) := { - compressed_y_0 := p_compressed_y_0 - } // End of template mw_eccP256CurvePoint_compressed_y_0 - - template (value) EccP256CurvePoint m_eccP256CurvePoint_compressed_y_1( - in template (value) Oct32 p_compressed_y_1 - ) := { - compressed_y_1 := p_compressed_y_1 - } // End of template m_eccP256CurvePoint_compressed_y_1 - - template (present) EccP256CurvePoint mw_eccP256CurvePoint_compressed_y_1( - template (present) Oct32 p_compressed_y_1 := ? - ) := { - compressed_y_1 := p_compressed_y_1 - } // End of template mw_eccP256CurvePoint_compressed_y_1 - - template (value) EccP256CurvePoint m_eccP256CurvePoint_uncompressed( - in template (value) Oct32 p_x, - in template (value) Oct32 p_y - ) := { - uncompressedP256 := { - x := p_x, - y := p_y - } - } // End of template m_eccP256CurvePoint_uncompressed - - template (present) EccP256CurvePoint mw_eccP256CurvePoint_uncompressed( - template (present) Oct32 p_x := ?, - template (present) Oct32 p_y := ? - ) := { - uncompressedP256 := { - x := p_x, - y := p_y - } - } // End of template mw_eccP256CurvePoint_uncompressed - - template (value) EccP384CurvePoint m_eccP384CurvePoint_x_only( - in template (value) Oct48 p_x_only - ) := { - x_only := p_x_only - } // End of template m_eccP384CurvePoint_x_only - - template (present) EccP384CurvePoint mw_eccP384CurvePoint_x_only( - template (present) Oct48 p_x_only := ? - ) := { - x_only := p_x_only - } // End of template mw_eccP384CurvePoint_x_only - - template (value) EccP384CurvePoint m_eccP384CurvePoint_compressed_y_0( - in template (value) Oct48 p_compressed_y_0 - ) := { - compressed_y_0 := p_compressed_y_0 - } // End of template m_eccP384CurvePoint_compressed_y_0 - - template (present) EccP384CurvePoint mw_eccP384CurvePoint_compressed_y_0( - template (present) Oct48 p_compressed_y_0 := ? - ) := { - compressed_y_0 := p_compressed_y_0 - } // End of template mw_eccP384CurvePoint_compressed_y_0 - - template (value) EccP384CurvePoint m_eccP384CurvePoint_compressed_y_1( - in template (value) Oct48 p_compressed_y_1 - ) := { - compressed_y_1 := p_compressed_y_1 - } // End of template m_eccP384CurvePoint_compressed_y_1 - - template (present) EccP384CurvePoint mw_eccP384CurvePoint_compressed_y_1( - template (present) Oct48 p_compressed_y_1 := ? - ) := { - compressed_y_1 := p_compressed_y_1 - } // End of template mw_eccP384CurvePoint_compressed_y_1 - - template (value) EccP384CurvePoint m_eccP384CurvePoint_uncompressed( - in template (value) Oct48 p_x, - in template (value) Oct48 p_y - ) := { - uncompressedP384 := { - x := p_x, - y := p_y - } - } // End of template m_eccP384CurvePoint_uncompressed - - template (present) EccP384CurvePoint mw_eccP384CurvePoint_uncompressed( - template (present) Oct48 p_x := ?, - template (present) Oct48 p_y := ? - ) := { - uncompressedP384 := { - x := p_x, - y := p_y - } - } // End of template mw_eccP384CurvePoint_uncompressed - - } // End of group signatures - - /** - * @desc Dummy send/receive templates for certificates - * @see Draft ETSI TS 103 097 V1.3.1 Clause 6 Specification of certificate format - */ - group certificates { - - /** - * @desc Send certificate template of type explicit (signature is included) - * @member p_signer_info Signer information - * @member p_subject_info The subject information - * @member p_subject_attributes List of subject attribute - * @member p_validity_restrictions List of validity restriction - * @member p_signature The signature - * @see Draft ETSI TS 103 097 V1.3.1 Clause 6.1 Certificate - */ - template (omit) EtsiTs103097Certificate m_etsiTs103097Certificate( - in template (value) IssuerIdentifier p_issuer, - in template (value) ToBeSignedCertificate p_toBeSigned, - in template (omit) Signature p_signature_ := omit, - in template (value) CertificateType p_type_ := explicit - ) := { - version := c_certificate_version, - type_ := p_type_, - issuer := p_issuer, - toBeSigned := p_toBeSigned, - signature_ := p_signature_ - } // End of template m_etsiTs103097Certificate - - /** - * @desc Send certificate template of type explicit (signature is included) - * @member p_signer_info Signer information - * @member p_subject_info The subject information - * @member p_subject_attributes List of subject attribute - * @member p_validity_restrictions List of validity restriction - * @member p_signature The signature - * @see Draft ETSI TS 103 097 V1.3.1 Clause 6.1 Certificate - */ - template (present) EtsiTs103097Certificate mw_etsiTs103097Certificate( - template (present) IssuerIdentifier p_issuer := ?, - template (present) ToBeSignedCertificate p_toBeSigned := ?, - template Signature p_signature_ := ?, - template (present) CertificateType p_type_ := explicit - ) := { - version := c_certificate_version, - type_ := p_type_, - issuer := p_issuer, - toBeSigned := p_toBeSigned, - signature_ := p_signature_ - } // End of template mw_etsiTs103097Certificate - - } // End of group certificates - - group issuerIdentifier { - - template (value) IssuerIdentifier m_issuerIdentifier_self( - in template (value) HashAlgorithm p_self := sha256 - ) := { - self_ := p_self - } // End of template m_issuerIdentifier_self - - template (present) IssuerIdentifier mw_issuerIdentifier_self( - template (present) HashAlgorithm p_self := ? - ) := { - self_ := p_self - } // End of template mw_issuerIdentifier_self - - template (value) IssuerIdentifier m_issuerIdentifier_sha256AndDigest( // FIXME Add opque field for unknown issuer? - in template (value) HashedId8 p_sha256AndDigest - ) := { - sha256AndDigest := p_sha256AndDigest - } // End of template m_issuerIdentifier_sha256AndDigest - - template (present) IssuerIdentifier mw_issuerIdentifier_sha256AndDigest( // FIXME Add opque field for unknown issuer? - template (present) HashedId8 p_sha256AndDigest := ? - ) := { - sha256AndDigest := p_sha256AndDigest - } // End of template mw_issuerIdentifier_sha256AndDigest - - template (value) IssuerIdentifier m_issuerIdentifier_sha384AndDigest( - in template (value) HashedId8 p_sha384AndDigest - ) := { - sha384AndDigest := p_sha384AndDigest - } // End of template m_issuerIdentifier_sha384AndDigest - - template (present) IssuerIdentifier mw_issuerIdentifier_sha384AndDigest( - template (present) HashedId8 p_sha384AndDigest := ? - ) := { - sha384AndDigest := p_sha384AndDigest - } // End of template mw_issuerIdentifier_sha384AndDigest - - } // End of group issuerIdentifier - - group toBeSignedCertificate { - - /** - * @desc Send template for ToBeSignedCertificate with CA restrictions - * @see ETSI TS 103 097 V1.3.1 Clause 7.2.3 Root CA certificate - */ - template (omit) ToBeSignedCertificate m_toBeSignedCertificate_ca( - in template (value) CertificateId p_id, - in template (value) SequenceOfPsidSsp p_appPermissions, - in template (value) SequenceOfPsidGroupPermissions p_certIssuePermissions, - in template (value) VerificationKeyIndicator p_verifyKeyIndicator, - in template (omit) ValidityPeriod p_validityPeriod := omit, - in template (omit) GeographicRegion p_region := omit, - in template (omit) SubjectAssurance p_assuranceLevel := omit, - in template (omit) PublicEncryptionKey p_encryptionKey := omit - ) := { - id := p_id, - cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 - crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := p_certIssuePermissions, // ETSI TS 103 097 V1.3.1 Clause 7.2.3 Root CA certificates Bullet 4 - certRequestPermissions := omit, - canRequestRollover := omit, - encryptionKey := p_encryptionKey, - verifyKeyIndicator := p_verifyKeyIndicator - } // End of template m_toBeSignedCertificate_ca - - /** - * @desc Receive template for ToBeSignedCertificate with CA restrictions - * @see ETSI TS 103 097 V1.3.1 Clause 7.2.3 Root CA certificate - */ - template ToBeSignedCertificate mw_toBeSignedCertificate_ca( - template (present) CertificateId p_id := ?, - template (present) SequenceOfPsidSsp p_appPermissions := ?, - template (present) SequenceOfPsidGroupPermissions p_certIssuePermissions := ?, - template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, - template (present) ValidityPeriod p_validityPeriod := ?, - template SequenceOfPsidGroupPermissions p_certRequestPermissions := *, - template GeographicRegion p_region := *, - template SubjectAssurance p_assuranceLevel := *, - template PublicEncryptionKey p_encryptionKey := * - ) := { - id := p_id, - cracaId := '000000'O, - crlSeries := 0, - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := ?, - certIssuePermissions := p_certIssuePermissions, - certRequestPermissions := p_certRequestPermissions, - canRequestRollover := omit, - encryptionKey := p_encryptionKey, - verifyKeyIndicator := p_verifyKeyIndicator - } // End of template mw_toBeSignedCertificate_ca - - /** - * @desc Send template for ToBeSignedCertificate with Enrolment credential restrictions - * @see ETSI TS 103 097 V1.3.1 Clause 7.2.2 Enrolment credential - */ - template (omit) ToBeSignedCertificate m_toBeSignedCertificate_ea( - in template (value) CertificateId p_id, - in template (value) SequenceOfPsidSsp p_appPermissions, - in template (value) VerificationKeyIndicator p_verifyKeyIndicator, - in template (value) ValidityPeriod p_validityPeriod, - in template (omit) GeographicRegion p_region := omit, - in template (omit) SubjectAssurance p_assuranceLevel := omit, - in template (omit) PublicEncryptionKey p_encryptionKey := omit - ) := { - id := p_id, - cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 - crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := omit, - certRequestPermissions := omit, - canRequestRollover := omit, - encryptionKey := p_encryptionKey, - verifyKeyIndicator := p_verifyKeyIndicator - } // End of template m_toBeSignedCertificate_ea - - /** - * @desc Send template for ToBeSignedCertificate with Enrolment credential restrictions - * @see ETSI TS 103 097 V1.3.1 Clause 7.2.2 Enrolment credential - */ - template ToBeSignedCertificate mw_toBeSignedCertificate_ea( - template (present) CertificateId p_id := ?, - template (present) SequenceOfPsidSsp p_appPermissions := ?, - template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, - template (present) ValidityPeriod p_validityPeriod := ?, - template GeographicRegion p_region := *, - template SubjectAssurance p_assuranceLevel := *, - template PublicEncryptionKey p_encryptionKey := * - ) := { - id := p_id, - cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 - crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := omit, - certRequestPermissions := omit, - canRequestRollover := omit, - encryptionKey := p_encryptionKey, - verifyKeyIndicator := p_verifyKeyIndicator - } // End of template mw_toBeSignedCertificate_ea - - template (omit) ToBeSignedCertificate m_toBeSignedCertificate_ec( - in template (value) CertificateId p_id, - in template (value) SequenceOfPsidSsp p_appPermissions, - in template (value) VerificationKeyIndicator p_verifyKeyIndicator, - in template (value) ValidityPeriod p_validityPeriod, - in template (omit) GeographicRegion p_region := omit, - in template (omit) SubjectAssurance p_assuranceLevel := omit, - in template (omit) PublicEncryptionKey p_encryptionKey := omit - ) := { - id := p_id, - cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 - crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := omit, - certRequestPermissions := omit, - canRequestRollover := omit, - encryptionKey := p_encryptionKey, - verifyKeyIndicator := p_verifyKeyIndicator - } // End of template m_toBeSignedCertificate_ec - - /** - * @desc Send template for ToBeSignedCertificate with Enrolment credential restrictions - * @see ETSI TS 103 097 V1.3.1 Clause 7.2.2 Enrolment credential - */ - template ToBeSignedCertificate mw_toBeSignedCertificate_ec( - template (present) CertificateId p_id := ?, - template (present) SequenceOfPsidSsp p_appPermissions := ?, - template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, - template (present) ValidityPeriod p_validityPeriod := ?, - template GeographicRegion p_region := *, - template SubjectAssurance p_assuranceLevel := *, - template PublicEncryptionKey p_encryptionKey := * - ) := { - id := p_id, - cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 - crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := omit, - certRequestPermissions := omit, - canRequestRollover := omit, - encryptionKey := p_encryptionKey, - verifyKeyIndicator := p_verifyKeyIndicator - } // End of template mw_toBeSignedCertificate_ec - - /** - * @desc Send template for ToBeSignedCertificate with Authorization authority restrictions - * @see ETSI TS 103 097 V1.3.1 Clause 7.2.4 Subordinate certification authority certificates - */ - template (omit) ToBeSignedCertificate m_toBeSignedCertificate_aa( - in template (value) CertificateId p_id, - in template (value) SequenceOfPsidSsp p_appPermissions, - in template (value) VerificationKeyIndicator p_verifyKeyIndicator, - in template (value) ValidityPeriod p_validityPeriod, - in template (omit) GeographicRegion p_region := omit, - in template (omit) SubjectAssurance p_assuranceLevel := omit, - in template (omit) PublicEncryptionKey p_encryptionKey := omit - ) := { - id := p_id, - cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 - crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := omit, - certRequestPermissions := omit, - canRequestRollover := omit, - encryptionKey := p_encryptionKey, - verifyKeyIndicator := p_verifyKeyIndicator - } // End of template m_toBeSignedCertificate_aa - - /** - * @desc Send template for ToBeSignedCertificate with Authorization authority restrictions - * @see ETSI TS 103 097 V1.3.1 Clause 7.2.4 Subordinate certification authority certificates - */ - template ToBeSignedCertificate mw_toBeSignedCertificate_aa( - template (present) CertificateId p_id := ?, - template (present) SequenceOfPsidSsp p_appPermissions := ?, - template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, - template (present) ValidityPeriod p_validityPeriod := ?, - template GeographicRegion p_region := *, - template SubjectAssurance p_assuranceLevel := *, - template PublicEncryptionKey p_encryptionKey := * - ) := { - id := p_id, - cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 - crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := omit, - certRequestPermissions := omit, - canRequestRollover := omit, - encryptionKey := p_encryptionKey, - verifyKeyIndicator := p_verifyKeyIndicator - } // End of template mw_toBeSignedCertificate_aa - - template (present) CertificateId mw_certificateId_name( - template (present) charstring p_name := ? - ) := { - name := p_name - } // End of template mw_certificateId_name - - template CertificateId mw_certificateId_none := { - none_ := NULL - } // End of template mw_certificateId_none - - /** - * @desc Send template for ToBeSignedCertificate with AT restrictions - * @see ETSI TS 103 097 V1.3.1 Clause 7.2.1 Authorization tickets - */ - template (omit) ToBeSignedCertificate m_toBeSignedCertificate_at( - in template (value) SequenceOfPsidSsp p_appPermissions, - in template (value) VerificationKeyIndicator p_verifyKeyIndicator, - in template (omit) ValidityPeriod p_validityPeriod := omit, - in template (omit) GeographicRegion p_region := omit, - in template (omit) SubjectAssurance p_assuranceLevel := omit, - in template (omit) PublicEncryptionKey p_encryptionKey := omit - ) := { - id := { none_ := NULL }, - cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 - crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := omit, - certRequestPermissions := omit, - canRequestRollover := omit, - encryptionKey := p_encryptionKey, - verifyKeyIndicator := p_verifyKeyIndicator - } // End of template m_toBeSignedCertificate_at - - /** - * @desc Send template for ToBeSignedCertificate with AT restrictions - * @see ETSI TS 103 097 V1.3.1 Clause 7.2.1 Authorization tickets - */ - template ToBeSignedCertificate mw_toBeSignedCertificate_at( - template (present) SequenceOfPsidSsp p_appPermissions := ?, - template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?, - template (present) ValidityPeriod p_validityPeriod := ?, - template GeographicRegion p_region := *, - template SubjectAssurance p_assuranceLevel := *, - template PublicEncryptionKey p_encryptionKey := * - ) := { - id := { none_ := NULL }, - cracaId := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2 - crlSeries := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3 - validityPeriod := p_validityPeriod, - region := p_region, - assuranceLevel := p_assuranceLevel, - appPermissions := p_appPermissions, - certIssuePermissions := omit, - certRequestPermissions := omit, - canRequestRollover := omit, - encryptionKey := p_encryptionKey, - verifyKeyIndicator := p_verifyKeyIndicator - } // End of template mw_toBeSignedCertificate_at - - } // End of group toBeSignedCertificate - - group verificationKeys { - - template (value) VerificationKeyIndicator m_verificationKeyIndicator_verificationKey( - in template (value) PublicVerificationKey p_verificationKey - ) := { - verificationKey := p_verificationKey - } // End of template m_verificationKeyIndicator_verificationKey - - template (present) VerificationKeyIndicator mw_verificationKeyIndicator_verificationKey( - template (present) PublicVerificationKey p_verificationKey := ? - ) := { - verificationKey := p_verificationKey - } // End of template mw_verificationKeyIndicator_verificationKey - - template (value) VerificationKeyIndicator m_verificationKeyIndicator_reconstructionValue( - in template (value) EccP256CurvePoint p_reconstructionValue - ) := { - reconstructionValue := p_reconstructionValue - } // End of template m_verificationKeyIndicator_reconstructionValue - - template (present) VerificationKeyIndicator mw_verificationKeyIndicator_reconstructionValue( - template (present) EccP256CurvePoint p_reconstructionValue := ? - ) := { - reconstructionValue := p_reconstructionValue - } // End of template mw_verificationKeyIndicator_reconstructionValue - - template (value) PublicVerificationKey m_publicVerificationKey_ecdsaNistP256( - in template (value) EccP256CurvePoint p_ecdsaNistP256 - ) := { - ecdsaNistP256 := p_ecdsaNistP256 - } // End of template m_publicVerificationKey_ecdsaNistP256 - - template (present) PublicVerificationKey mw_publicVerificationKey_ecdsaNistP256( - template (present) EccP256CurvePoint p_ecdsaNistP256 := ? - ) := { - ecdsaNistP256 := p_ecdsaNistP256 - } // End of template mw_publicVerificationKey_ecdsaNistP256 - - template (value) PublicVerificationKey m_publicVerificationKey_ecdsaBrainpoolP256r1( - in template (value) EccP256CurvePoint p_ecdsaBrainpoolP256r1 - ) := { - ecdsaBrainpoolP256r1 := p_ecdsaBrainpoolP256r1 - } // End of template m_publicVerificationKey_ecdsaBrainpoolP256r1 - - template (present) PublicVerificationKey mw_publicVerificationKey_ecdsaBrainpoolP256r1( - template (present) EccP256CurvePoint p_ecdsaBrainpoolP256r1 := ? - ) := { - ecdsaBrainpoolP256r1 := p_ecdsaBrainpoolP256r1 - } // End of template mw_publicVerificationKey_ecdsaBrainpoolP256r1 - - template (value) PublicVerificationKey m_publicVerificationKey_ecdsaBrainpoolP384r1( - in template (value) EccP384CurvePoint p_ecdsaBrainpoolP384r1 - ) := { - ecdsaBrainpoolP384r1 := p_ecdsaBrainpoolP384r1 - } // End of template m_publicVerificationKey_ecdsaBrainpoolP384r1 - - template (present) PublicVerificationKey mw_publicVerificationKey_ecdsaBrainpoolP384r1( - template (present) EccP384CurvePoint p_ecdsaBrainpoolP384r1 := ? - ) := { - ecdsaBrainpoolP384r1 := p_ecdsaBrainpoolP384r1 - } // End of template mw_publicVerificationKey_ecdsaBrainpoolP384r1 - - } // End of group verificationKeys - - group encryptionKey { - - template (value) EncryptionKey m_encryptionKey_public( - in template (value) PublicEncryptionKey p_encryptionKey - ) := { - public_ := p_encryptionKey - } - - template (present) EncryptionKey mw_encryptionKey_public( - template (present) PublicEncryptionKey p_encryptionKey := ? - ) := { - public_ := p_encryptionKey - } - - template (value) PublicEncryptionKey m_encryptionKey( - in template (value) SymmAlgorithm p_supportedSymmAlg := aes128Ccm, - in template (value) BasePublicEncryptionKey p_publicKey - ) := { - supportedSymmAlg := p_supportedSymmAlg, - publicKey := p_publicKey - } // End of template m_encryptionKey - - template (present) PublicEncryptionKey mw_encryptionKey( - template (present) SymmAlgorithm p_supportedSymmAlg := aes128Ccm, - template (present) BasePublicEncryptionKey p_publicKey := ? - ) := { - supportedSymmAlg := p_supportedSymmAlg, - publicKey := p_publicKey - } // End of template mw_encryptionKey - - template (value) BasePublicEncryptionKey m_publicEncryptionKey_eciesNistP256( - in template (value) EccP256CurvePoint p_eciesNistP256 - ) := { - eciesNistP256 := p_eciesNistP256 - } // End of template m_publicEncryptionKey_eciesNistP256 - - template (present) BasePublicEncryptionKey mw_publicEncryptionKey_eciesNistP256( - template (present) EccP256CurvePoint p_eciesNistP256 := ? - ) := { - eciesNistP256 := p_eciesNistP256 - } // End of template mw_publicEncryptionKey_eciesNistP256 - - template (value) BasePublicEncryptionKey m_publicEncryptionKey_eciesBrainpoolP256r1( - in template (value) EccP256CurvePoint p_eciesBrainpoolP256r1 - ) := { - eciesBrainpoolP256r1 := p_eciesBrainpoolP256r1 - } // End of template m_publicEncryptionKey_eciesBrainpoolP256r1 - - template (present) BasePublicEncryptionKey mw_publicEncryptionKey_eciesBrainpoolP256r1( - template (present) EccP256CurvePoint p_eciesBrainpoolP256r1 := ? - ) := { - eciesBrainpoolP256r1 := p_eciesBrainpoolP256r1 - } // End of template mw_publicEncryptionKey_eciesBrainpoolP256r1 - - } // End of group encryptionKey - - group appPermissions { - - template (omit) PsidSsp m_appPermissions( - in template (value) Psid p_psid, - in template (omit) ServiceSpecificPermissions p_ssp := omit - ) := { - psid := p_psid, - ssp := p_ssp - } // End of template m_appPermissions - - template PsidSsp mw_appPermissions( - template (present) Psid p_psid := ?, - template ServiceSpecificPermissions p_ssp := * - ) := { - psid := p_psid, - ssp := p_ssp - } // End of template mw_appPermissions - - template (value) PsidSspRange m_psidSspRange( - in Psid p_psid, - in template (value) SspRange p_sspRange := m_SspRange_all - ) := { - psid := p_psid, - sspRange := p_sspRange - } // End of template m_psidSspRange - - template (value) SspRange m_SspRange_all := { - all_ := NULL - } // End of template m_SspRange_all - - template (value) SspRange m_SspRange_opaque( - in template (value) SequenceOfOctetString p_opaque - ) := { - opaque := p_opaque - } // End of template m_SspRange_opaque - - template (value) SspRange m_SspRange_bitmapSspRange( - in template (value) BitmapSspRange p_bitmapSspRange - ) := { - bitmapSspRange := p_bitmapSspRange - } // End of template m_SspRange_bitmapSspRange - - template (value) PsidGroupPermissions m_psidGroupPermissions( - in template (value) SubjectPermissions p_subjectPermissions, - in integer p_minChainLength := 1, - in integer p_chainLengthRange := 0, - in EndEntityType p_eeType := oct2bit('00'O) - ) := { - subjectPermissions := p_subjectPermissions, - minChainLength := p_minChainLength, - chainLengthRange := p_chainLengthRange, - eeType := p_eeType - } // End of template m_psidGroupPermissions - - template (present) PsidGroupPermissions mw_psidGroupPermissions( - template (present) SubjectPermissions p_subjectPermissions := ?, - integer p_minChainLength := 1, - integer p_chainLengthRange := 0, - template (present) EndEntityType p_eeType := ? - ) := { - subjectPermissions := p_subjectPermissions, - minChainLength := p_minChainLength, - chainLengthRange := p_chainLengthRange, - eeType := p_eeType - } // End of template mw_psidGroupPermissions - - template (value) SubjectPermissions m_subjectPermissions_explicit( - in template (value) SequenceOfPsidSspRange p_certIssuePermissions - ) := { - explicit := p_certIssuePermissions - } // End of template m_subjectPermissions_explicit - - template (present) SubjectPermissions mw_subjectPermissions_explicit( - template (present) SequenceOfPsidSspRange p_certIssuePermissions := ? - ) := { - explicit := p_certIssuePermissions - } // End of template mw_subjectPermissions_explicit - - template (value) SubjectPermissions m_subjectPermissions_all := { - all_ := NULL - } // End of template m_subjectPermissions_all - - } // End of group appPermissions - - - group validityRestriction { - - template (value) ValidityPeriod m_validityPeriod( - in template (value) Time32 p_start_, - in template (value) Duration p_duration - ) := { - start_ := p_start_, - duration := p_duration - } // End of template m_validityPeriod - - template (present) ValidityPeriod mw_validityPeriod( - template (present) Time32 p_start_ := ?, - template (present) Duration p_duration := ? - ) := { - start_ := p_start_, - duration := p_duration - } // End of template mw_validityPeriod - - /** - * @desc Send template for Duration (in seconds) - * @param p_duration The duration value - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.18 Duration - */ - template (value) Duration m_duration_in_seconds( - in template (value) Int16 p_duration - ) := { - seconds := p_duration - } // End of template m_duration_in_seconds - - /** - * @desc Send template for Duration (in hours) - * @param p_duration The duration value - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.18 Duration - */ - template (value) Duration m_duration_in_hours( - in template (value) Int16 p_duration - ) := { - hours := p_duration - } // End of template m_duration_in_hours - - /** - * @desc Receive template for Duration (in seconds) - * @param p_duration The duration value - * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.18 Duration - */ - template (present) Duration mw_duration_in_seconds( - template (present) Int16 p_duration := ? - ) := { - seconds := p_duration - } // End of template mw_duration_in_seconds - - template (value) Duration m_duration_years( - in template (value) Uint16 p_years - ) := { - years := p_years - } // End of template m_duration_years - - template (present) Duration mw_duration_years( - template (present) Uint16 p_years := ? - ) := { - years := p_years - } // End of template mw_duration_years - - } // End of group validityRestriction - - group ssp { - - group sspCam { - - group sspCamSend { - - template (value) SspCAM m_sspCAMContainer_sign_all := { - cenDsrcTollingZone := '1'B, - publicTransport := '1'B, - specialTransport := '1'B, - dangerousGoods := '1'B, - roadwork := '1'B, - rescue := '1'B, - emergency := '1'B, - safetyCar := '1'B, - closedLanes := '1'B, - requestForRightOfWay := '1'B, - requestForFreeCrossingAtATrafficLight := '1'B, - noPassing := '1'B, - noPassingForTrucks := '1'B, - speedLimit := '1'B, - reserved := '000000000000000000'B - } // End of template m_sspCAMContainer_sign_all - - template (value) SspCAM m_sspCAMContainer_vehicle - modifies m_sspCAMContainer_sign_all := { - cenDsrcTollingZone := '0'B, - closedLanes := '0'B, - noPassing := '0'B, - noPassingForTrucks := '0'B, - speedLimit := '0'B - } // End of template m_sspCAMContainer_vehicle - - template (value) ServiceSpecificPermissions m_sspCAM( - in template (value) BitmapSsp p_bitmapSsp - ) := { - bitmapSsp := p_bitmapSsp - } // End of template m_sspCAM - - } // End of group sspCamSend - - group sspCamRecv { - - template (present) SspCAM mw_sspCAMContainer_dummy := { - cenDsrcTollingZone := ?, - publicTransport := ?, - specialTransport := ?, - dangerousGoods := ?, - roadwork := ?, - rescue := ?, - emergency := ?, - safetyCar := ?, - closedLanes := ?, - requestForRightOfWay := ?, - requestForFreeCrossingAtATrafficLight := ?, - noPassing := ?, - noPassingForTrucks := ?, - speedLimit := ?, - reserved := '000000000000000000'B - } // End of template mw_sspCAMContainer_dummy - - template (present) ServiceSpecificPermissions mw_sspCAM_dummy := { - bitmapSsp := ? - } // End of template mw_sspCAM_dummy - - } // End of group sspCamRecv - - } // End of group sspCam - - group sspDenm { - - group sspDenmSend { - - template (value) SspDENM m_sspDENMContainer_sign_all := { - trafficCondition := '1'B, - accident := '1'B, - roadworks := '1'B, - adverseWeatherCondition_Adhesion := '1'B, - hazardousLocation_SurfaceCondition := '1'B, - hazardousLocation_ObstacleOnTheRoad := '1'B, - hazardousLocation_AnimalOnTheRoad := '1'B, - humanPresenceOnTheRoad := '1'B, - wrongWayDriving := '1'B, - rescueAndRecoveryWorkInProgress := '1'B, - adverseWeatherCondition_ExtremeWeatherCondition := '1'B, - adverseWeatherCondition_Visibility := '1'B, - adverseWeatherCondition_Precipitation := '1'B, - slowVehicle := '1'B, - dangerousEndOfQueue := '1'B, - vehicleBreakdown := '1'B, - postCrash := '1'B, - humanProblem := '1'B, - stationaryVehicle := '1'B, - emergencyVehicleApproaching := '1'B, - hazardousLocation_DangerousCurve := '1'B, - collisionRisk := '1'B, - signalViolation := '1'B, - dangerousSituation := '1'B, - reserved := '00000000'B - } // End of template m_sspDENMContainer_sign_all - - template (value) SspDENM m_sspDENMContainer_vehicle - modifies m_sspDENMContainer_sign_all:= { - trafficCondition := '0'B, - accident := '0'B, - roadworks := '0'B, - adverseWeatherCondition_Adhesion := '0'B, - hazardousLocation_SurfaceCondition := '0'B, - hazardousLocation_ObstacleOnTheRoad := '0'B, - hazardousLocation_AnimalOnTheRoad := '0'B, - slowVehicle := '0'B, - dangerousEndOfQueue := '0'B, - vehicleBreakdown := '0'B, - stationaryVehicle := '0'B - } // End of template m_sspDENMContainer_sign_all - - template (value) SspDENM m_sspDENMContainer_roadSideUnit - modifies m_sspDENMContainer_sign_all:= { - trafficCondition := '0'B, - accident := '0'B, - roadworks := '0'B, - adverseWeatherCondition_Adhesion := '0'B, - hazardousLocation_SurfaceCondition := '0'B, - hazardousLocation_ObstacleOnTheRoad := '0'B, - hazardousLocation_AnimalOnTheRoad := '0'B, - humanPresenceOnTheRoad := '0'B, - wrongWayDriving := '0'B, - rescueAndRecoveryWorkInProgress := '0'B, - adverseWeatherCondition_ExtremeWeatherCondition := '0'B, - adverseWeatherCondition_Visibility := '0'B, - adverseWeatherCondition_Precipitation := '0'B, - postCrash := '0'B, - humanProblem := '0'B, - stationaryVehicle := '0'B, - hazardousLocation_DangerousCurve := '0'B, - collisionRisk := '0'B, - dangerousSituation := '0'B - } // End of template m_sspDENMContainer_roadSideUnit - - template (value) ServiceSpecificPermissions m_sspDENM( - in template (value) BitmapSsp p_bitmapSsp - ) := { - bitmapSsp := p_bitmapSsp - } // End of template m_sspDENM - - } // End of group sspDenmSend - - group sspDenmRecv { - - template (present) SspDENM mw_sspDENMContainer_dummy := { - trafficCondition := ?, - accident := ?, - roadworks := ?, - adverseWeatherCondition_Adhesion := ?, - hazardousLocation_SurfaceCondition := ?, - hazardousLocation_ObstacleOnTheRoad := ?, - hazardousLocation_AnimalOnTheRoad := ?, - humanPresenceOnTheRoad := ?, - wrongWayDriving := ?, - rescueAndRecoveryWorkInProgress := ?, - adverseWeatherCondition_ExtremeWeatherCondition := ?, - adverseWeatherCondition_Visibility := ?, - adverseWeatherCondition_Precipitation := ?, - slowVehicle := ?, - dangerousEndOfQueue := ?, - vehicleBreakdown := ?, - postCrash := ?, - humanProblem := ?, - stationaryVehicle := ?, - emergencyVehicleApproaching := ?, - hazardousLocation_DangerousCurve := ?, - collisionRisk := ?, - signalViolation := ?, - dangerousSituation := ?, - reserved := '00000000'B - } // End of template mw_sspDENMContainer_dummy - - template (present) SspDENM mw_sspDENMContainer_vehicle - modifies mw_sspDENMContainer_dummy := { - trafficCondition := '0'B, - accident := '0'B, - roadworks := '0'B, - adverseWeatherCondition_Adhesion := '0'B, - hazardousLocation_SurfaceCondition := '0'B, - hazardousLocation_ObstacleOnTheRoad := '0'B, - hazardousLocation_AnimalOnTheRoad := '0'B, - slowVehicle := '0'B, - dangerousEndOfQueue := '0'B, - vehicleBreakdown := '0'B, - stationaryVehicle := '0'B - } // End of template mw_sspDENMContainer_vehicle - - template (present) SspDENM mw_sspDENMContainer_roadSideUnit - modifies mw_sspDENMContainer_dummy := { - trafficCondition := '0'B, - accident := '0'B, - roadworks := '0'B, - adverseWeatherCondition_Adhesion := '0'B, - hazardousLocation_SurfaceCondition := '0'B, - hazardousLocation_ObstacleOnTheRoad := '0'B, - hazardousLocation_AnimalOnTheRoad := '0'B, - humanPresenceOnTheRoad := '0'B, - wrongWayDriving := '0'B, - rescueAndRecoveryWorkInProgress := '0'B, - adverseWeatherCondition_ExtremeWeatherCondition := '0'B, - adverseWeatherCondition_Visibility := '0'B, - adverseWeatherCondition_Precipitation := '0'B, - postCrash := '0'B, - humanProblem := '0'B, - stationaryVehicle := '0'B, - hazardousLocation_DangerousCurve := '0'B, - collisionRisk := '0'B, - dangerousSituation := '0'B - } // End of template m_sspDENMContainer_roadSideUnit - - } // End of group sspDenmRecv - - } // End of group sspDenm - - } // End of group ssp - - group utPrimitives { - - template (value) UtGnInitialize m_secGnInitialize( - in Oct8 p_hashedId8 - ) := { - hashedId8 := p_hashedId8 - } // End of template m_secGnInitialize - - } // End of group utPrimitives - -} // End of module LibItsSecurity_Templates diff --git a/ttcn/Security/LibItsSecurity_TestSystem.ttcn b/ttcn/Security/LibItsSecurity_TestSystem.ttcn deleted file mode 100644 index 3f6b75cb..00000000 --- a/ttcn/Security/LibItsSecurity_TestSystem.ttcn +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @author ETSI / STF481 / STF507 / STF517 / STF538 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Security/LibItsSecurity_TestSystem.ttcn3 $ - * $Id: LibItsSecurity_TestSystem.ttcn3 1318 2017-01-26 10:20:53Z filatov $ - * @desc Test System module for Security Protocol - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsSecurity_TestSystem { - - // LibCommon - import from LibCommon_DataStrings all; - - // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; - - // LibItsSecurity - import from LibItsSecurity_TypesAndValues all; - import from LibItsSecurity_Pixits all; - - group componentDefinitions { - - /** - * @desc ITS Security Component - */ - type component ItsSecurityBaseComponent { - - // Certificates - var Certificate vc_aaCertificate; /** Test Adapter AA certificate */ - var Certificate vc_atCertificate; /** Test Adapter AT certificate */ - var Certificate vc_lastAtCertificateUsed; /** Last Test Adapter certificate used in 'f_buildGnSecuredXXX' functions */ - var charstring vc_hashedId8ToBeUsed := PX_IUT_DEFAULT_CERTIFICATE; /** Digest value of the AT certificate to be used by the IUT. Default: CERT_IUT_A_AT */ - - // Private keys - var octetstring vc_signingPrivateKey; - var octetstring vc_encryptPrivateKey; - - // Generation position. See Draft ETSI TS 103 097 V1.1.14 Clause 7.2 Security profiles for DENMs - var ThreeDLocation vc_location; - - } // End of ItsSecurityBaseComponent - - } // End of group componentDefinitions - -} // End of module LibItsSecurity_TestSystem \ No newline at end of file diff --git a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn b/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn deleted file mode 100644 index fb2bcefb..00000000 --- a/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn +++ /dev/null @@ -1,314 +0,0 @@ -/** - * @author ETSI / STF481 / STF507 / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/Security/LibItsSecurity_TypesAndValues.ttcn3 $ - * $Id: LibItsSecurity_TypesAndValues.ttcn3 1318 2017-01-26 10:20:53Z filatov $ - * @desc Module containing types and values for Security Protocol - * @see Draft ETSI TS 103 097 V1.1.14 - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - */ -module LibItsSecurity_TypesAndValues { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibItsCommon - import from LibItsCommon_Pixits all; - - // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; - import from EtsiTs103097Module language "ASN.1:1997" all; - - /** - * @desc Sequence of HashedId8 - */ - type record of HashedId8 HashedId8s; - // Test Adapter certificates & private keys - Valid behavior - const charstring cc_taCert_A := PX_CERT_FOR_TS; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_A_AA := "CERT_TS_A_AA"; - const charstring cc_taCert_A_EA := "CERT_TS_A_EA"; - const charstring cc_taCert_A1 := "CERT_TS_A_A1_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_A2 := "CERT_TS_A_A2_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_A3 := "CERT_TS_A_A3_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_B := "CERT_TS_B_AT"; /** Default certificate, with circular region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_B1 := "CERT_TS_B_1_AT"; - const charstring cc_taCert_B_AA := "CERT_TS_B_1_AA"; - const charstring cc_taCert_A_B := "CERT_TS_A_B_AT"; - const charstring cc_taCert_A_B3 := "CERT_TS_A_B3_AT"; - const charstring cc_taCert_C := "CERT_TS_C_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_C1 := "CERT_TS_C1_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_CA1 := "CERT_TS_CA1_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_D := "CERT_TS_D_AT"; /** Certificate with a polygonal region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_E := "CERT_TS_E_AT"; /** Certificate with a region identifier, to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_F := "CERT_TS_F_AT"; /** Certificate that can be used as an unknown certificate for IUT. */ - const charstring cc_taCert_F3 := "CERT_TS_F3_AT"; /** Certificate that can be used as an unknown certificate for IUT with BrainpoolP384 curve. */ - const charstring cc_taCert_G := "CERT_TS_G_AT"; /** to be defined */ - const charstring cc_taCert_EC := "CERT_TS_A_EC"; /** Certificate with a subject type indicating 'enrolment_credentials', to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_AA := "CERT_TS_A_AA"; /** Certificate with a subject type indicating 'authorisation_authority', to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_EA := "CERT_TS_A_EA"; /** Certificate with a subject type indicating 'enrolment_authority', to be used when secured messages are sent from TA to IUT */ - const charstring cc_taCert_CA := "CERT_TS_A_CA"; /** Certificate with a subject type indicating 'root_ca', to be used when secured messages are sent from TA to IUT */ - // Test Adapter certificates & private keys - Inoportune behavior - const charstring cc_taCert_B_BO := "CERT_TS_B_BO_AT"; /** Certificate with a circular region, the IUT position is outside of the region */ - const charstring cc_taCert_C_BO := "CERT_TS_C_BO_AT"; /** Certificate with a rectangular region, the IUT position is outside of the region */ - const charstring cc_taCert_D_BO := "CERT_TS_D_BO_AT"; /** Certificate with a polygonal region, the IUT position is outside of the region */ - const charstring cc_taCert_E_BO := "CERT_TS_E_BO_AT"; /** Certificate with a region identifier, the IUT position is outside of the region */ - const charstring cc_taCert0101_BO := "CERT_TS_01_01_BO_AT"; /** Check that IUT discards the AT certificate with version 3 */ - const charstring cc_taCert0102_BO := "CERT_TS_01_02_BO_AT"; /** Check that IUT discards the AT certificate with version 1 */ - const charstring cc_taCert0103_BO := "CERT_TS_01_03_BO_AT"; /** Check that IUT discards the AA certificate with version 3 */ - const charstring cc_taCert0104_BO := "CERT_TS_01_04_BO_AT"; /** Check that IUT discards the AA certificate with version 1 */ - const charstring cc_taCert0201_BO := "CERT_TS_02_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization ticket certificate contains the subject type 'enrolment_credential' */ - const charstring cc_taCert0202_BO := "CERT_TS_02_02_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization authority certificate contains the subject type 'enrolment_credential' */ - const charstring cc_taCert0203_BO := "CERT_TS_02_03_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization ticket certificate contains the subject type 'enrolment_authority' */ - const charstring cc_taCert0204_BO := "CERT_TS_02_04_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization authority certificate contains the subject type 'enrolment_authority' */ - const charstring cc_taCert0301_BO := "CERT_TS_03_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization ticket certificate contains the subject type 'authorization_ticket' */ - const charstring cc_taCert0302_BO := "CERT_TS_03_02_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the authorization authority certificate contains the subject type 'authorization_ticket' */ - const charstring cc_taCert0601_BO := "CERT_TS_06_01_BO_AT"; /** Check that IUT discards a SecuredMessage containing generation_time before the message signing certificate validity period */ - const charstring cc_taCert0602_BO := "CERT_TS_06_02_BO_AT"; /** Check that IUT discards a SecuredMessage containing generation_time after the message signing certificate validity period */ - const charstring cc_taCert0401_BO := "CERT_TS_04_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the issuer certificate of the AA certificate contains the subject type 'authorization_authority' */ - const charstring cc_taCertMsg1301_BO := "CERT_TS_MSG_13_01_BO_AT"; /** Check that IUT discards secured CAM signed with the not yet valid certificate */ - const charstring cc_taCertMsg1302_BO := "CERT_TS_MSG_13_02_BO_AT"; /** Check that IUT discards secured CAM signed with the expired certificate */ - const charstring cc_taCertMsg1303_BO := "CERT_TS_MSG_13_03_BO_AT"; /** Check that IUT discards secured CAM when IUT location is outside the circular validity restriction of the signing certificatee */ - const charstring cc_taCertMsg1304_BO := "CERT_TS_MSG_13_04_BO_AT"; /** Check that IUT discards secured CAM when IUT location is outside the rectangular validity restriction of the signing certificate */ - const charstring cc_taCertMsg1305_BO := "CERT_TS_MSG_13_05_BO_AT"; /** Check that IUT discards secured CAM when IUT location is outside the polygonal validity restriction of the signing certificate */ - const charstring cc_taCertMsg1306_BO := "CERT_TS_MSG_13_06_BO_AT"; /** Check that IUT discards secured CAM when IUT location is outside the identified validity restriction of the signing certificate */ - const charstring cc_taCert0601_BV := "CERT_TS_06_01_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the same circular region validity restriction as its issuing certificate */ - const charstring cc_taCert0602_BV := "CERT_TS_06_02_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the circular region validity restriction of its issuing certificate */ - const charstring cc_taCert0603_BV := "CERT_TS_06_03_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the rectangular region validity restriction of its issuing certificate */ - const charstring cc_taCert0604_BV := "CERT_TS_06_04_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0605_BV := "CERT_TS_06_05_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the identified region validity restriction of its issuing certificate */ - const charstring cc_taCert0606_BO := "CERT_TS_06_06_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message does not contain the region validity restriction but its issuing certificate contains the circular region validity restriction */ - const charstring cc_taCert0607_BO := "CERT_TS_06_07_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains circular region validity restriction which is outside of the circular region validity restriction of its issuing certificate */ - const charstring cc_taCert0608_BO := "CERT_TS_06_08_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains circular region validity restriction which is not fully covered by the the circular region validity restriction of its issuing certificate */ - const charstring cc_taCert0701_BV := "CERT_TS_07_01_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the same rectangular region validity restriction as its issuing certificate */ - const charstring cc_taCert0702_BV := "CERT_TS_07_02_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the rectangular region validity restriction which is fully inside in the circular region validity restriction of its issuing certificate */ - const charstring cc_taCert0703_BV := "CERT_TS_07_03_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the validity restriction with rectangular region which is fully inside in the rectangular region validity restriction of its issuing certificate */ - const charstring cc_taCert0704_BV := "CERT_TS_07_04_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the rectangular region validity restriction which is fully inside in the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0705_BV := "CERT_TS_07_05_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the rectangular region validity restriction which is fully inside in the identified region validity restriction of its issuing certificate */ - const charstring cc_taCert0706_BO := "CERT_TS_07_06_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message does not contain the region validity restriction but its issuing certificate contains the rectangular region validity restriction */ - const charstring cc_taCert0707_BO := "CERT_TS_07_07_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains rectangular region validity restriction which is outside of the rectangular region validity restriction of its issuing certificate */ - const charstring cc_taCert0708_BO := "CERT_TS_07_08_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains rectangular region validity restriction which is not fully covered by the the rectangular region validity restriction of its issuing certificate */ - const charstring cc_taCert0801_BV := "CERT_TS_08_01_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the same polygonal region validity restriction as its issuing certificate */ - const charstring cc_taCert0802_BV := "CERT_TS_08_02_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the circular region validity restriction of its issuing certificate */ - const charstring cc_taCert0803_BV := "CERT_TS_08_03_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the rectangular region validity restriction of its issuing certificate */ - const charstring cc_taCert0804_BV := "CERT_TS_08_04_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0805_BV := "CERT_TS_08_05_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the identified region validity restriction of its issuing certificate */ - const charstring cc_taCert0806_BO := "CERT_TS_08_06_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message does not contain the region validity restriction but its issuing certificate contains the polygonal region validity restriction */ - const charstring cc_taCert0807_BO := "CERT_TS_08_07_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains polygonal region validity restriction which is outside of the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0808_BO := "CERT_TS_08_08_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains polygonal region validity restriction which is outside of the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0809_BO := "CERT_TS_08_09_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message contains polygonal region validity restriction which is not fully covered by the the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0901_BV := "CERT_TS_09_01_BV_AT"; /** Check that the IUT accepts a message when its signing certificate contains the identified region validity restriction with the same identified region as the issuing certificate and without local area definition */ - const charstring cc_taCert0902_BV := "CERT_TS_09_02_BV_AT"; /** Check that the IUT accepts a message when its signing certificate contains the identified region validity restriction with the same identified region as the issuing certificate and with local area definition */ - const charstring cc_taCert0903_BV := "CERT_TS_09_03_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the circular region validity restriction of its issuing certificate */ - const charstring cc_taCert0904_BV := "CERT_TS_09_04_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the rectangular region validity restriction of its issuing certificate */ - const charstring cc_taCert0905_BV := "CERT_TS_09_05_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of this message contains the polygonal region validity restriction which is fully inside in the polygonal region validity restriction of its issuing certificate */ - const charstring cc_taCert0906_BV := "CERT_TS_09_06_BV_AT"; /** Check that the IUT accepts a message when the signing certificate of the message contains the identified region validity restriction with the identified region which is fully covered by the identified region of the validity restriction of its issuing certificate */ - const charstring cc_taCert0907_BO := "CERT_TS_09_07_BO_AT"; /** Check that the IUT discards a message when the signing certificate of this message does not contain the region validity restriction but its issuing certificate contains the identified region validity restriction */ - const charstring cc_taCert0908_BO := "CERT_TS_09_08_BO_AT"; /** Check that the IUT discards a message when the signing certificate and its issuing certificate are both containing the identified region validity restrictions with the same region id but different local regions */ - const charstring cc_taCert0909_BO := "CERT_TS_09_09_BO_AT"; /** Check that the IUT discards a message when the identified region of the validity restriction of its signing certificate is different and not fully covered by the one in the issuing certificate */ - const charstring cc_taCert0910_BO := "CERT_TS_09_10_BO_AT"; /** Check that the IUT discards a message when the identified region validity restriction of its signing certificate contains unknown area code */ - const charstring cc_taCert0911_BO := "CERT_TS_09_11_BO_AT"; /** Check that the IUT discards a message when the identified region validity restriction of its signing certificate contains invalid area code */ - const charstring cc_taCert1001_BO := "CERT_TS_10_01_BO_AT"; /** Check that the IUT discards a message when its signing certificate does not contain the time validity restriction */ - const charstring cc_taCert1002_BO := "CERT_TS_10_02_BO_AT"; /** Check that the IUT discards a message when the issuing certificate of the message signing certificate does not contain the time validity restriction */ - const charstring cc_taCert1003_BO := "CERT_TS_10_03_BO_AT"; /** Check that the IUT discards a message when its signing certificate contains 'time_end' validity restriction */ - const charstring cc_taCert1004_BO := "CERT_TS_10_03_BO_AT"; /** Check that the IUT discards a message when its signing certificate contains 'time_start_and_duration' validity restriction */ - const charstring cc_taCert1005_BO := "CERT_TS_10_03_BO_AT"; /** Check that the IUT discards a message when the issuing certificate of the message signing certificate contains 'time_end' validity restriction */ - const charstring cc_taCert1006_BO := "CERT_TS_10_03_BO_AT"; /** Check that the IUT discards a message when its signing certificate contains 'time_start_and_duration' validity restriction */ - const charstring cc_taCert1101_BO := "CERT_TS_11_01_BO_AT"; /** Check that the IUT discards a message when the validity period of the signing certificate ends after the validity period of its issuing certificate */ - const charstring cc_taCert1102_BO := "CERT_TS_11_02_BO_AT"; /** Check that the IUT discards a message when the validity period of its signing certificate starts before the validity period of the issuing certificate */ - const charstring cc_taCert1103_BO := "CERT_TS_11_03_BO_AT"; /** Check that the IUT discards a message when the issuing certificate of signing certificate is expired but the signing certificate is not expired yet */ - const charstring cc_taCert1104_BO := "CERT_TS_11_04_BO_AT"; /** Check that the IUT discards a message when the validity period of the signing certificate is after the validity period of its issuing certificate */ - const charstring cc_taCert1201_BO := "CERT_TS_12_01_BO_AT"; /** Check that the IUT discards a message when its signing certificate does not contain the SSP-AID subject attribute */ - const charstring cc_taCert1202_BO := "CERT_TS_12_02_BO_AT"; /** Check that the IUT discards a Secured CAM when its signing certificate does not contain a record with AID_CAM in the its_aid_ssp_list subject attribute */ - const charstring cc_taCert1203_BO := "CERT_TS_12_03_BO_AT"; /** Check that the IUT discards a Secured DENM when its signing certificate does not contain a record with AID_DENM in the its_aid_ssp_list subject attribute */ - const charstring cc_taCert1204_BO := "CERT_TS_12_04_BO_AT"; /** Check that the IUT discards a Secured CAM when its signing certificate contains two records with AID_CAM in the its_aid_ssp_list subject attribute */ - const charstring cc_taCert1301_BO := "CERT_TS_13_01_BO_AT"; /** Check that the IUT discards a message when the signing AT certificate contains a CAM AID-SSP record whereas the issuing AA certificate does not contain the record with AID_CAM */ - const charstring cc_taCert1302_BO := "CERT_TS_13_02_BO_AT"; /** Check that the IUT discards a message when the signing AT certificate contains a DENM AID-SSP record whereas the issuing AA certificate does not contain the AID record with AID_DENM */ - const charstring cc_taCert1303_BO := "CERT_TS_13_03_BO_AT"; /** Check that IUT discards a SecuredMessage if the AA certificate does not contain a subject_attribute of type its_aid_list */ - const charstring cc_taCert1401_BO := "CERT_TS_14_01_BO_AT"; /** Check that IUT discards the AT certificate with signer info of type 'certificate' */ - const charstring cc_taCert1402_BO := "CERT_TS_14_02_BO_AT"; /** Check that IUT discards the AT certificate with signer info of type 'certificate_chain' */ - const charstring cc_taCert1403_BO := "CERT_TS_14_03_BO_AT"; /** Check that IUT discards the AT certificate with signer info of type 'certificate_digest_with_other_algorithm' */ - const charstring cc_taCert1501_BO := "CERT_TS_15_01_BO_AT"; /** Check that IUT discards the AA certificate with signer info of type 'certificate' */ - const charstring cc_taCert1502_BO := "CERT_TS_15_02_BO_AT"; /** Check that IUT discards the AA certificate with signer info of type 'certificate_chain' */ - const charstring cc_taCert1503_BO := "CERT_TS_15_03_BO_AT"; /** Check that IUT discards the AA certificate with signer info of type 'certificate_digest_with_other_algorithm' */ - const charstring cc_taCert1601_BO := "CERT_TS_16_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject_name of the AT certificate is not an empty name field */ - const charstring cc_taCert1701_BO := "CERT_TS_17_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject attribute of type assurance_level is missing in the AT certificate */ - const charstring cc_taCert1702_BO := "CERT_TS_17_02_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject attribute of type assurance_level is missing in the AA certificate */ - const charstring cc_taCert1703_BO := "CERT_TS_17_03_BO_AT"; /** Check that IUT discards a SecuredMessage if the assurance level of issuing certificate is less then assurance level of subordinate certificate */ - const charstring cc_taCert1704_BO := "CERT_TS_17_04_BO_AT"; /** Check that IUT discards a SecuredMessage if the assurance level of issuing certificate is equal to the assurance level of the subordinate certificate but the confidence of subject assurance of issuing certificate is less then the confidence of the subordinate certificate */ - const charstring cc_taCert1801_BO := "CERT_TS_18_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject attribute of type verification_key is missing in the AT certificate */ - const charstring cc_taCert1802_BO := "CERT_TS_18_02_BO_AT"; /** Check that IUT discards a SecuredMessage if the subject attribute of type verification_key is missing in the AA certificate */ - const charstring cc_taCert1901_BO := "CERT_TS_19_01_BO_AT"; /** Check that IUT discards a SecuredMessage if the reserved region type has been used in region validity restriction of the AT certificate */ - - // IUT certificates & private keys - const charstring cc_iutCert_C1 := "CERT_IUT_C1_AT"; - const charstring cc_iutCert_CA1 := "CERT_IUT_CA1_AT"; - const charstring cc_iutCert_CA2 := "CERT_IUT_CA2_AT"; - const charstring cc_iutCert_C3 := "CERT_IUT_C3_AA"; - const charstring cc_iutCert_CA3 := "CERT_IUT_CA3_AT"; - const charstring cc_iutCert_CA_AA := "CERT_IUT_CA_AA"; - const charstring cc_iutCert_CC_AA := "CERT_IUT_CC_AA"; - const charstring cc_iutCert_A := "CERT_IUT_A_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_A1 := "CERT_IUT_A1_AT"; - const charstring cc_iutCert_A2 := "CERT_IUT_A2_AT"; - const charstring cc_iutCert_A3 := "CERT_IUT_A3_AT"; - const charstring cc_iutCert_A4 := "CERT_IUT_A4_AT"; - const charstring cc_iutCert_A_AA := "CERT_IUT_A_AA"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT - NistP256*/ - const charstring cc_iutCert_A_N := "CERT_IUT_A_N_AT"; - const charstring cc_iutCert_A_B_N := "CERT_IUT_A_B_N_AT"; - const charstring cc_iutCert_A_B := "CERT_IUT_A_B_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT - BrainpoolP256r1*/ - const charstring cc_iutCert_A_B3 := "CERT_IUT_A_B3_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT - BrainpoolP384r1*/ - const charstring cc_iutCert_A_B3_N := "CERT_IUT_A_B3_N_AT"; - const charstring cc_iutCert_B := "CERT_IUT_B_AT"; /** Default certificate, with circular region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_C := "CERT_IUT_C_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_D := "CERT_IUT_D_AT"; /** Certificate with a polygonal region, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_E := "CERT_IUT_E_AT"; /** Certificate with a region identifier, to be used when secured messages are sent from TA to IUT */ - const charstring cc_iutCert_F := "CERT_IUT_F_AT"; /** Certificate with a subject type indicating 'enrolment_credentials', to be used when secured messages are sent from TA to IUT */ - - /** - * @desc Specification of basic format elements - * @see Draft ETSI TS 103 097 V1.1.14 Clause 4.2 - */ - group basicFormatElements { - - /** - * @desc Service specific permissions definition for CAM - * @see ETSI EN 302 637-2 V1.3.2 (2014-11) Clause 6.2.2.2 Service Specific Permissions (SSP) - */ - type record SspCAM { - Bit1 cenDsrcTollingZone, - Bit1 publicTransport, - Bit1 specialTransport, - Bit1 dangerousGoods, - Bit1 roadwork, - Bit1 rescue, - Bit1 emergency, - Bit1 safetyCar, - Bit1 closedLanes, - Bit1 requestForRightOfWay, - Bit1 requestForFreeCrossingAtATrafficLight, - Bit1 noPassing, - Bit1 noPassingForTrucks, - Bit1 speedLimit, - Bit18 reserved - } // End of type SspCAM - - /** - * @desc Service specific permissions definition for DENM - * @member trafficCondition - * @member accident - * @member roadworks - * @member adverseWeatherCondition_Adhesion - * @member hazardousLocation_SurfaceCondition - * @member hazardousLocation_ObstacleOnTheRoad - * @member hazardousLocation_AnimalOnTheRoad - * @member humanPresenceOnTheRoad - * @member wrongWayDriving - * @member rescueAndRecoveryWorkInProgress - * @member adverseWeatherCondition_ExtremeWeatherCondition - * @member adverseWeatherCondition_Visibility - * @member adverseWeatherCondition_Precipitation - * @member slowVehicle - * @member dangerousEndOfQueue - * @member vehicleBreakdown - * @member postCrash - * @member humanProblem - * @member stationaryVehicle - * @member emergencyVehicleApproaching - * @member hazardousLocation_DangerousCurve - * @member collisionRisk - * @member signalViolation - * @member dangerousSituation - * @member reserved Reserved for Future Usage - * @see Draft ETSI EN 302 637-3 V1.2.10 Clause 6.2.2.2 Service Specific Permissions (SSP) - */ - type record SspDENM { - Bit1 trafficCondition, - Bit1 accident, - Bit1 roadworks, - Bit1 adverseWeatherCondition_Adhesion, - Bit1 hazardousLocation_SurfaceCondition, - Bit1 hazardousLocation_ObstacleOnTheRoad, - Bit1 hazardousLocation_AnimalOnTheRoad, - Bit1 humanPresenceOnTheRoad, - Bit1 wrongWayDriving, - Bit1 rescueAndRecoveryWorkInProgress, - Bit1 adverseWeatherCondition_ExtremeWeatherCondition, - Bit1 adverseWeatherCondition_Visibility, - Bit1 adverseWeatherCondition_Precipitation, - Bit1 slowVehicle, - Bit1 dangerousEndOfQueue, - Bit1 vehicleBreakdown, - Bit1 postCrash, - Bit1 humanProblem, - Bit1 stationaryVehicle, - Bit1 emergencyVehicleApproaching, - Bit1 hazardousLocation_DangerousCurve, - Bit1 collisionRisk, - Bit1 signalViolation, - Bit1 dangerousSituation, - Bit8 reserved - } // End of type SspDENM - - } // End of group certificateSpecification - - /** - * @desc Send/receive templates for profiles for certificates - * @see Draft ETSI TS 103 097 V1.1.14 Clause 7.4 Profiles for certificate - */ - group profileCertificates { - - type record CertificatesCachingItem { - HashedId8 hashedId8, - EtsiTs103097Certificate certificate - } - type record of CertificatesCachingItem CertificatesCaching; - - } // End of group profileCertificates - - type enumerated SignAlgorithm { - e_nistp_256, - e_brainpool_256, - e_brainpool_384 - } - - group taConfiguration { - - /** - * @desc Describes the Test Adapter security configuration - * @member signingPrivateKey Signing private keys generated by the PKI Infrastructire tool (CertChainGenerator\src\org\etsi\stf440\pki\MainApp.java) - * @member encryptPrivateKey Encryption private keys generated by the PKI Infrastructire tool (CertChainGenerator\src\org\etsi\stf440\pki\MainApp.java) - * @member caCertificate Certificates Authorization certificate generated by the PKI Infrastructire tool - * @member aaCertificate Enrolment Credential certificate generated by the PKI Infrastructire tool - * @member atCertificate Authorization Tickate certificate generated by the PKI Infrastructire tool - * @member location 3D location associated to each configuration - */ - /*type record TaConfig { - Oct32 signingPrivateKey, - Oct32 encryptPrivateKey, - EtsiTs103097Certificate caCertificate, - EtsiTs103097Certificate aaCertificate, - EtsiTs103097Certificate atCertificate, - ThreeDLocation location - }*/ // End of type TaConfig - - /** - * @desc Describes the Test Adapter security configurations - */ - //type set of TaConfig TaConfigs; - - } // End of group taConfiguration - - group utPrimitives { - - } - with { - encode "UpperTester" - } // End of group utPrimitives - -} with { - encode "LibItsSecurity" -} // End of module LibItsSecurity_TypesAndValues diff --git a/ttcn/Security/module.mk b/ttcn/Security/module.mk deleted file mode 100644 index 12e4cc43..00000000 --- a/ttcn/Security/module.mk +++ /dev/null @@ -1,8 +0,0 @@ -sources := \ - LibItsSecurity_EncdecDeclarations.ttcn \ - LibItsSecurity_Functions.ttcn \ - LibItsSecurity_Pics.ttcn \ - LibItsSecurity_Pixits.ttcn \ - LibItsSecurity_Templates.ttcn \ - LibItsSecurity_TestSystem.ttcn \ - LibItsSecurity_TypesAndValues.ttcn \ diff --git a/ttcn/SremSsem/LibItsSremSsem_EncdecDeclarations.ttcn b/ttcn/SremSsem/LibItsSremSsem_EncdecDeclarations.ttcn deleted file mode 100644 index d8699dda..00000000 --- a/ttcn/SremSsem/LibItsSremSsem_EncdecDeclarations.ttcn +++ /dev/null @@ -1,59 +0,0 @@ -module LibItsSremSsem_EncdecDeclarations { - - // LibItsSremSsem - import from ITS_Container language "ASN.1:1997" all; - import from SREM_PDU_Descriptions language "ASN.1:1997" all; - import from SSEM_PDU_Descriptions language "ASN.1:1997" all; - import from DSRC language "ASN.1:1997" all; - - import from LibItsSremSsem_TypesAndValues all; - import from LibItsSremSsem_TestSystem all; - - external function fx_enc_SremReq (SremReq p) return bitstring - with {extension "prototype(convert) encode(LibIts_Interface)"} - - external function fx_dec_SremReq (inout bitstring b, out SremReq p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_enc_SremInd (SremInd p) return bitstring - with {extension "prototype(convert) encode(LibIts_Interface)"} - - external function fx_dec_SremInd (inout bitstring b, out SremInd p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_enc_SsemReq (SsemReq p) return bitstring - with {extension "prototype(convert) encode(LibIts_Interface)"} - - external function fx_dec_SsemReq (inout bitstring b, out SsemReq p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_enc_SsemInd (SsemInd p) return bitstring - with {extension "prototype(convert) encode(LibIts_Interface)"} - - external function fx_dec_SsemInd (inout bitstring b, out SsemInd p) return integer - with {extension "prototype(sliding) decode(LibIts_Interface)"} - - external function fx_enc_SREM (SREM p) return bitstring - with {extension "prototype(convert) encode(PER)"} - - external function fx_dec_SREM (inout bitstring b, out SREM p) return integer - with {extension "prototype(sliding) decode(PER)"} - - external function fx_enc_SSEM (SSEM p) return bitstring - with {extension "prototype(convert) encode(PER)"} - - external function fx_dec_SSEM (inout bitstring b, out SSEM p) return integer - with {extension "prototype(sliding) decode(PER)"} - - /*external function fx_enc_SRM (SignalRequestMessage p) return bitstring - with {extension "prototype(convert) encode(PER)"} - - external function fx_dec_SRM (inout bitstring b, out SignalRequestMessage p) return integer - with {extension "prototype(sliding) decode(PER)"} - - external function fx_enc_SSM (SignalStatusMessage p) return bitstring - with {extension "prototype(convert) encode(PER)"} - - external function fx_dec_SSM (inout bitstring b, out SignalStatusMessage p) return integer - with {extension "prototype(sliding) decode(PER)"}*/ -} diff --git a/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn b/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn deleted file mode 100644 index 7f5302a3..00000000 --- a/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn +++ /dev/null @@ -1,518 +0,0 @@ -/** - * @author ETSI STF517 / STF581 / TTF002 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/SremSsem/LibItsSremSsem_Functions.ttcn $ - * $Id: LibItsSremSsem_Functions.ttcn,v 1.2 2018/05/31 15:57:11 dte Exp $ - * @desc Module containing common functions for ITS SREMM SSEM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsSremSsem_Functions { - - // LibCommon - import from LibCommon_Sync all; - import from LibCommon_Time all; - import from LibCommon_VerdictControl all; - - // LibIts - import from ITS_Container language "ASN.1:1997" all; - import from DSRC language "ASN.1:1997" all; - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - import from LibItsCommon_Templates all; - import from LibItsCommon_Functions all; - import from LibItsCommon_Pixits all; - - // LibItsSecurity - import from LibItsSecurity_Functions all; - - // LibItsSremSsem - import from LibItsSremSsem_TestSystem all; - import from LibItsSremSsem_TypesAndValues all; - import from LibItsSremSsem_Templates all; - import from LibItsSremSsem_Pics all; - import from LibItsSremSsem_Pixits all; - - group utFuntions { - - /** - * @desc Requests to bring the IUT in an initial state - * @param p_init The initialisation to trigger. - */ - function f_utInitializeIut(template (value) UtSremInitialize p_init) runs on ItsSremSsem { - - //deactivate sremSsemPort default alts - vc_sremSsemDefaultActive := false; - - utPort.send(p_init); - tc_wait.start; - alt { - [] utPort.receive(UtSremResults: { utSremInitializeResult := true }) { - tc_wait.stop; - log("*** " & testcasename() & ": INFO: IUT initialized ***"); - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //deactivate sremSsemPort default alts - vc_sremSsemDefaultActive := true; - } - - /** - * @desc Triggers an event from the application layer - * @param p_event The event to trigger. - */ - function f_utTriggerEvent( - in template (value) UtSremTrigger p_event - ) runs on ItsSremSsem { - - //deactivate sremSsemPort default alts - vc_sremSsemDefaultActive := false; - - utPort.send ( p_event ); - tc_wait.start; - alt { - [] utPort.receive ( UtSremResults: { utSremTriggerResult := true }) { - tc_wait.stop; - } - [] utPort.receive ( UtSremResults: { utSremTriggerResult := false }) { - tc_wait.stop; - f_selfOrClientSyncAndVerdict("SREM Trigger failed", e_error); - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [else] { // Shortcut defaults - //f_sleep(0.050); // 50 ms - repeat; - } - } - - return; - } - - /** - * @desc Updates an event from the application layer - * @param p_event The event to trigger. - */ - function f_utUpdateEvent( - in template (value) UtSremUpdate p_event - ) runs on ItsSremSsem { - - utPort.send ( p_event ); - tc_wait.start; - alt { - [] utPort.receive ( UtSremResults: { utSremUpdateResult := true }) { - tc_wait.stop; - } - [] utPort.receive ( UtSremResults: { utSremUpdateResult := false }) { - tc_wait.stop; - f_selfOrClientSyncAndVerdict("SREM Update failed", e_error); - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //activate sremSsemPort default alts - vc_sremSsemDefaultActive := true; - - return; - } - - /** - * @desc Updates an event from the application layer - * @param p_event The event to trigger. - */ - function f_utCancelationEvent( - in template (value) UtSremCancelation p_event - ) runs on ItsSremSsem { - - utPort.send ( p_event ); - tc_wait.start; - alt { - [] utPort.receive ( UtSremResults: { utSremCancelationResult := true }) { - tc_wait.stop; - } - [] utPort.receive ( UtSremResults: { utSremCancelationResult := false }) { - tc_wait.stop; - f_selfOrClientSyncAndVerdict("SREM cancelation failed", e_error); - } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INFO: Could not receive expected UT message from IUT in time ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - //activate sremSsemPort default alts - vc_sremSsemDefaultActive := true; - - return; - } - - } // End of group utFuntions - - group adapterControl { - - /** - * @desc Initialise secure mode if required - */ - function f_initialiseSecuredMode( - in charstring p_certificateId := PX_CERT_FOR_TS - ) runs on ItsSremSsem { - - if (PICS_IS_IUT_SECURED == true) { - - if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificateId))) { - log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); - stop; - } - } - - } // End of function f_initialiseSecuredMode() - - function f_uninitialiseSecuredMode() runs on ItsSremSsem { - - if (PICS_IS_IUT_SECURED == true) { - f_acTriggerSecEvent(m_acDisableSecurity); - } - - } // End of function f_initialiseSecuredMode() - - /** - * @desc Triggers event in the test system adaptation. - * @param p_event The event to trigger - * @return FncRetCode - */ - function f_acTriggerSecEvent(template (value) AcSecPrimitive p_event) runs on ItsSremSsem return FncRetCode { - var FncRetCode v_ret := e_success; - - acPort.send(p_event); - tc_ac.start; - alt { - [] acPort.receive(m_acSecResponseSuccess) { - tc_ac.stop; - } - [] acPort.receive { - tc_ac.stop; - log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] tc_ac.timeout { - log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for adapter control event result ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - - return v_ret; - } - - } // End of group adapterControl - - group altsteps { - - /** - * @desc Default handling cf01 de-initialisation. - */ - altstep a_cf01Down() runs on ItsSremSsem { - [] a_shutdown() { - f_poDefault(); - f_cfDown(); - log("*** a_cf01Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc The base default. - */ - altstep a_default() runs on ItsSremSsem { - [vc_sremSsemDefaultActive] sremSsemPort.receive(mw_sremInd(mw_sremPdu)) { - log("*** " & testcasename() & ": INFO: SREMM received in default ***"); - vc_sremReceived := true; - repeat; - } - [vc_sremSsemDefaultActive] sremSsemPort.receive(mw_ssemInd(mw_ssemPdu)) { - log("*** " & testcasename() & ": INFO: SREMM received in default ***"); - vc_ssemReceived := true; - repeat; - } - [vc_sremSsemDefaultActive] sremSsemPort.receive { - log("*** " & testcasename() & ": ERROR: Received an unexpected message ***"); - f_selfOrClientSyncAndVerdict("error", e_error); - } - [] any timer.timeout { - log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - [] a_shutdown() { - f_poDefault(); - f_cfDown(); - log("*** " & testcasename() & ": INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); - stop; - } - } - - /** - * @desc The default for handling upper tester messages. - */ - altstep a_utDefault() runs on ItsSremSsem { - var UtSremEventInd v_sremevent; - var UtSsemEventInd v_ssemevent; - [] utPort.receive(UtSremEventInd:?) -> value v_sremevent { - //store every upper tester indication received - vc_utSremEvents[lengthof(vc_utSremEvents)] := v_sremevent; - repeat; - } - [] utPort.receive(UtSsemEventInd:?) -> value v_ssemevent { - //store every upper tester indication received - vc_utSsemEvents[lengthof(vc_utSsemEvents)] := v_ssemevent; - repeat; - } - [] utPort.receive { - log("*** " & testcasename() & ": INFO: Received unhandled/unknown UT message from IUT ***"); - repeat; - } - } - - } // End of group altsteps - - group sremSsemConfigurationFunctions { - - /** - * @desc Setups default configuration - * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT - */ - function f_cfUp( - in charstring p_certificateId := PX_CERT_FOR_TS, - in charstring p_iutCertificateId := "" - ) runs on ItsSremSsem system ItsSremSsemSystem { - - map(self:acPort, system:acPort); - map(self:utPort, system:utPort); - map(self:sremSsemPort, system:sremSsemPort); - - // Connect - f_connect4SelfOrClientSync(); - activate(a_cf01Down()); - - // Initialise secured mode - f_initialiseSecuredMode(p_certificateId); - - //Initialze the IUT - f_prInitialState(p_iutCertificateId); - - } // End of f_cfUp - - /** - * @desc Deletes default configuration - */ - function f_cfDown() runs on ItsSremSsem system ItsSremSsemSystem { - - // Initialise secured mode - f_uninitialiseSecuredMode(); - - unmap(self:utPort, system:utPort); - unmap(self:acPort, system:acPort); - unmap(self:sremSsemPort, system:sremSsemPort); - - f_disconnect4SelfOrClientSync(); - } // End of f_cfDown - - } // End of of sremSsemConfigurationFunctions - - group preambles { - - /** - * @desc The default preamble. - */ - function f_prDefault() runs on ItsSremSsem { - vc_default := activate(a_default()); - activate(a_utDefault()); - } - - /** - * @desc Brings the IUT into an initial state. - * @return FncRetCode - */ - function f_prInitialState( - in charstring p_certificate_id := "" - ) runs on ItsSremSsem return FncRetCode { - var FncRetCode v_ret := e_success; - - // Initialize IUT with given certificate - if (p_certificate_id != "") { // Initialize IUT with given certificate - var HashedId8 v_hashedId8 := '0000000000000000'O; - - fx_readCertificateDigest("CERT_SRM_SSP_NONE", v_hashedId8); - if ('0000000000000000'O == v_hashedId8) { - // Certificate not found - log("*** " & testcasename() & ": Required IUT certificate is not found on the test system ***"); - return e_timeout; - } - f_utInitializeIut(m_sremSsemInitialize(v_hashedId8)); - } else { - f_utInitializeIut(m_sremSsemInitialize); - } - f_prDefault(); - return v_ret; - } - - } // End of group preambles - - group postambles { - - /** - * @desc The default postamble. - */ - function f_poDefault() runs on ItsSremSsem { - //empty - } - - } // End of group postambles - - group sendFunctions { - - /** - * @desc Sends a SREM message for cancellation - */ - function f_sendSreMessageForCancellation() runs on ItsSremSsem { - // Send SREM cancellation - sremSsemPort.send( - m_sremReq( - m_sremPdu( - m_srem( - m_requestorDescription( - m_vehicleID( - f_getIutStationId() - ), - m_requestorType( - basicVehicle - ) - ), - { - m_signalRequestPackage( - m_signalRequest( - m_intersectionReferenceID, - 17, - priorityCancellation, - { lane := 2 } - ) - ) - })))); - tc_noac.start; - alt { - [] sremSsemPort.receive(mw_ssemInd) { - tc_noac.stop; - log("*** " & testcasename() & ": INCONC: Received SSEM PDU after cancellation. ***"); - } - [] tc_noac.timeout { - log("*** " & testcasename() & ": PASS: No more SSEM PDU received after cancellation. ***"); - } - } - } - - /** - * @desc Sends a SSEM message - * @param p_sendMsg The IVI message to send. - * @param p_overrideSeqNo Overrides the sequence number with the stored one. - */ - function f_sendSseMessage( - in template (value) SignalRequestMessage p_signalRequestMessage - ) runs on ItsSremSsem { - sremSsemPort.send( - m_ssemReq( - m_ssemPdu( - m_ssem( - valueof(p_signalRequestMessage) - )))); - } - - } // End of group sendFunctions - - group receiveFunctions { - - /** - * @desc Awaits a SREM and returns it - * @param p_rcvMsg The expected message to be received. - * @param p_rcvdMsg The received message - OUT. - */ - function f_awaitSreMessage( - in template (present) SremInd p_rcvMsg, - out SremInd p_rcvdMsg - ) runs on ItsSremSsem { - - tc_ac.start; - alt { - [] sremSsemPort.receive(p_rcvMsg) -> value p_rcvdMsg { - tc_ac.stop; - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INFO: Timeout while awaiting the reception of a message ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - } - - /** - * @desc Awaits a SREM and returns it - * @param p_rcvMsg The expected message to be received. - */ - function f_awaitSreMessageCancellation( - template (present) RequestID p_requestID := ? - ) runs on ItsSremSsem { - tc_ac.start; - alt { - [] sremSsemPort.receive( - mw_sremInd( - mw_sremPdu( - mw_sremWellFormatted( - mw_requestorDescription, - { - mw_signalRequestPackage( - mw_signalRequest( - ?, - p_requestID, - priorityCancellation - )) - }, - ? - )))) { - tc_ac.stop; - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INFO: Timeout while awaiting the reception of a message ***"); - f_selfOrClientSyncAndVerdict("error", e_timeout); - } - } - } - - } // End of group receiveFunctions - - group miscellaneousFunctions { - - /** - * @desc Increases the RequestID number and handles the special case where the - * SremIdentification number reaches the limit of 32768 and will be reset to 0. - * @param p_requestID The RequestID number to increase. - * @return The increased RequestID number. - */ - function f_increaseRequestID( - in RequestID p_requestID - ) return RequestID { - // if maximum number of 256 reached, reset it to 0 - return ((p_requestID + 1) mod 256); - } - - } // End of group miscellaneousFunctions - -} // End of module LibItsSremSsem_Functions diff --git a/ttcn/SremSsem/LibItsSremSsem_Pics.ttcn b/ttcn/SremSsem/LibItsSremSsem_Pics.ttcn deleted file mode 100644 index f6d2b0cc..00000000 --- a/ttcn/SremSsem/LibItsSremSsem_Pics.ttcn +++ /dev/null @@ -1,97 +0,0 @@ -/** - * @author ETSI / STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/SremSsem/LibItsSremSsem_Pics.ttcn $ - * $Id: LibItsSremSsem_Pics.ttcn 1312 2016-12-14 09:21:45Z garciay $ - * @desc SREM SSEM PICS - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsSremSsem_Pics { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - - /** - * @desc Is the IUT running in secured mode? - * @see ETSI TS 103 191-1 Table A.1 - */ - modulepar boolean PICS_IS_IUT_SECURED := false; - - /** - * @desc Support for SREM generation - * @see ETSI TS 103 191-1 Table A.5 - */ - modulepar boolean PICS_SREM_GENERATION := true; - - /** - * @desc Support for SREM generation - * @see ETSI TS 103 191-1 Table A.5 - */ - modulepar boolean PICS_SREM_TRANSMISSION_RATE := true; - - /** - * @desc Support for SREM cancelation - * @see ETSI TS 103 191-1 Table A.5 - */ - modulepar boolean PICS_SREM_CANCELATION := true; - - /** - * @desc Support for SREM reception - * @see ETSI TS 103 191-1 Table A.5 - */ - modulepar boolean PICS_SREM_RECEPTION := true; - - /** - * @desc Support for SSEM generation - * @see ETSI TS 103 191-1 Table A.5 - */ - modulepar boolean PICS_SSEM_GENERATION := true; - - /** - * @desc Support for SSEM reception - * @see ETSI TS 103 191-1 Table A.5 - */ - modulepar boolean PICS_SSEM_RECEPTION := true; - - /** - * @desc Support for Short Range communication - * @see ETSI TS 103 191-1 Table A.5 - */ - modulepar boolean PICS_SHORT_RANGE := true; - - modulepar float PICS_T_GENSREMMIN := 0.5; - - /** - * @desc Support for public transport vehicle - * @see ETSI TS 103 191-1 Table TODO - */ - modulepar boolean PICS_PUBLIC_TRANSPORT := true; - - /** - * @desc Support for TODO - * @see ETSI TS 103 191-1 Table TODO - */ - modulepar boolean PICS_SREM_HAS_TIMING := true; - - /** - * @desc Support for TODO - * @see ETSI TS 103 191-1 Table TODO - */ - modulepar boolean PICS_SSEM_TRATEMENT_DELAY := true; - - modulepar float PICS_T_DELAY_GENSSEMMIN := 0.1; - - /** - * @desc Support for TODO - * @see ETSI TS 103 191-1 Table TODO - */ - modulepar boolean PICS_SSEM_TRANSMISSION_RATE := true; - - modulepar float PICS_T_RATE_GENSSEMMIN := 0.1; - - modulepar float PICS_T_RATE_GENSSEMMAX := 2.0; - -} // end LibItsSremSsem_Pics diff --git a/ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn b/ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn deleted file mode 100644 index 4a9e7a9a..00000000 --- a/ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn +++ /dev/null @@ -1,64 +0,0 @@ -/** - * @author ETSI STF517 / STF581 / TTF002 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/SremSsem/LibItsSremSsem_Pixits.ttcn $ - * $Id: LibItsSremSsem_Pixits.ttcn 1315 2016-12-15 13:25:41Z garciay $ - * @desc MAPEM SPATEM PIXIT - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsSremSsem_Pixits { - - // LibCommon - import from LibCommon_DataStrings all; - import from LibCommon_BasicTypesAndValues all; - - // LibIts - import from DSRC language "ASN.1:1997" all; - import from DSRC_REGION_noCircular language "ASN.1:1997" all; - - // LibItsSremSsem - import from LibItsSremSsem_TypesAndValues all; - - /** - * @desc MsgCount for SREM sending - * @see ETSI TS 103 191-3 Table B.9 - */ - modulepar BasicVehicleRole PX_BASICVEHICLEROLE := basicVehicle; - - /** - * @desc Used by tester in SREM trigger request - * @see ETSI TS 103 191-3 Table B.9 - */ - modulepar RequestImportanceLevel PX_REQUESTIMPORTANCELEVEL := requestImportanceLevel3; - - modulepar IntersectionID PX_INTERSECTION_ID := 123; - - /** - * @desc Used by tester in SREM trigger request - * @see ETSI TS 103 191-3 Table B.9 - */ - modulepar DSecond PX_SECOND := 0; - - modulepar MsgCount PX_SEQUENCE_NUMBER := 10; - - modulepar RequestID PX_REQUEST_ID := 5; - - /** - * @desc Used in SREM and SSEM sent by tester - * @see ETSI TS 103 191-3 Table B.9 - */ - modulepar IntersectionReferenceID PX_STATUS := { - region := omit, - id := 0 - }; - - modulepar charstring PX_SREM_CERTIFICATE_X := "CERT_IUT_SREM_SSP_01"; - - modulepar octetstring PX_SREM_CERTIFICATE_X_SSP := '024000'O; - - modulepar BasicVehicleRole PX_SREM_CERTIFICATE_X_ROLE := publicTransport; - -} // end LibItsSremSsem_Pixits diff --git a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn b/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn deleted file mode 100644 index cafb5ee6..00000000 --- a/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn +++ /dev/null @@ -1,738 +0,0 @@ -/** - * @author ETSI STF517 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn $ - * $Id: LibItsSremSsem_Templates.ttcn 1312 2016-12-14 09:21:45Z garciay $ - * @desc Module containing base template definitions for SREM SSEM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsSremSsem_Templates { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from ITS_Container language "ASN.1:1997" all; - import from SREM_PDU_Descriptions language "ASN.1:1997" all; - import from SSEM_PDU_Descriptions language "ASN.1:1997" all; - import from DSRC language "ASN.1:1997" all; - import from DSRC_REGION_noCircular language "ASN.1:1997" all; - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - import from LibItsCommon_Functions all; - import from LibItsCommon_ASN1_NamedNumbers all; - - // LibItsSremSsem - import from LibItsSremSsem_TestSystem all; - import from LibItsSremSsem_TypesAndValues all; - import from LibItsSremSsem_Pixits all; - - group primitivesTemplates { - - /** - * @desc Send template for SREM Message (SremSsemPort Primitive) - * @param p_sremMsg The SREM Message to be sent - */ - template (value) SremReq m_sremReq( - in template (value) SREM p_sremMsg - ) := { - msgOut := p_sremMsg - } - - /** - * @desc Receive template for SREM Message (SremSsemPort Primitive) - * @param p_sremMsg The expected SREM Message - */ - template (present) SremInd mw_sremInd( - template (present) SREM p_sremMsg - ) := { - msgIn := p_sremMsg, - recvTime := ?, - gnNextHeader := *, - gnHeaderType := *, - gnHeaderSubtype := *, - gnLifetime := *, - gnTrafficClass := *, - btpDestinationPort := *, - btpInfo := *, - ssp := *, - its_aid := * - } - - /** - * @desc Receive template for SREM Message (SremSsemPort Primitive) - * @param p_sremMsg The expected SREM Message - * @param p_gnNextHeader GN next header value - * @param p_gnHeaderType GN header type value - * @param p_gnHeaderSubtype GN header subtype value - * @param p_gnLifetime GN packet lifetime value (ms) - * @param p_gnTrafficClass GN traffic class value - */ - template (present) SremInd mw_sremIndWithGnParameters( - template (present) SREM p_sremMsg, - in template UInt8 p_gnNextHeader := *, - in template UInt8 p_gnHeaderType := *, - in template UInt8 p_gnHeaderSubtype := *, - in template UInt32 p_gnLifetime := *, - in template UInt8 p_gnTrafficClass := * - ) modifies mw_sremInd := { - gnNextHeader := p_gnNextHeader, - gnHeaderType := p_gnHeaderType, - gnHeaderSubtype := p_gnHeaderSubtype, - gnLifetime := p_gnLifetime, - gnTrafficClass := p_gnTrafficClass - } - - /** - * @desc Receive template for SREM Message (SremSsemPort Primitive) - * @param p_sremMsg Expected SREM Message - * @param p_btpDestinationPort BTP destination port value - * @param p_btpInfo BTP destination port info value (if BTP-B) or BTP source port value (if BTP-A) - */ - template (present) SremInd mw_sremIndWithBtpParameters( - template (present) SREM p_sremMsg, - template UInt16 p_btpDestinationPort := *, - template UInt16 p_btpInfo := * - ) modifies mw_sremInd := { - btpDestinationPort := p_btpDestinationPort, - btpInfo := p_btpInfo - }; - - /** - * @desc Receive template for SREM Message (SremSsemPort Primitive) - * @param p_sremMsg The expected SREM Message - * @param p_ssp SSP value - * @param p_its_aid ITS-AID value - */ - template (present) SremInd mw_sremIndWithSecurityParameters( - template (present) SREM p_sremMsg, - template (present) Bit24 p_ssp := ?, - template (present) UInt32 p_its_aid := ? - ) modifies mw_sremInd := { - ssp := p_ssp, - its_aid := p_its_aid - } - - /** - * @desc Send template for SSEM Message (SremSsemPort Primitive) - * @param p_ssemMsg The SSEM Message to be sent - */ - template (value) SsemReq m_ssemReq( - in template (value) SSEM p_ssemMsg - ) := { - msgOut := p_ssemMsg - } - - /** - * @desc Receive template for SSEM Message (SremSsemPort Primitive) - * @param p_ssemMsg The expected SSEM Message - */ - template (present) SsemInd mw_ssemInd( - template (present) SSEM p_ssemMsg := ? - ) := { - msgIn := p_ssemMsg, - recvTime := ?, - gnNextHeader := *, - gnHeaderType := *, - gnHeaderSubtype := *, - gnLifetime := *, - gnTrafficClass := *, - btpDestinationPort := *, - btpInfo := *, - ssp := *, - its_aid := * - }; - - /** - * @desc Receive template for SSEM Message (SremSsemPort Primitive) - * @param p_ssemMsg The expected SSEM Message - * @param p_gnNextHeader GN next header value - * @param p_gnHeaderType GN header type value - * @param p_gnHeaderSubtype GN header subtype value - * @param p_gnLifetime GN packet lifetime value (ms) - * @param p_gnTrafficClass GN traffic class value - */ - template (present) SsemInd mw_ssemIndWithGnParameters( - template (present) SSEM p_ssemMsg, - in template UInt8 p_gnNextHeader := *, - in template UInt8 p_gnHeaderType := *, - in template UInt8 p_gnHeaderSubtype := *, - in template UInt32 p_gnLifetime := *, - in template UInt8 p_gnTrafficClass := * - ) modifies mw_ssemInd := { - gnNextHeader := p_gnNextHeader, - gnHeaderType := p_gnHeaderType, - gnHeaderSubtype := p_gnHeaderSubtype, - gnLifetime := p_gnLifetime, - gnTrafficClass := p_gnTrafficClass - } - - /** - * @desc Receive template for SSEM Message (SremSsemPort Primitive) - * @param p_ssemMsg Expected SREM Message - * @param p_btpDestinationPort BTP destination port value - * @param p_btpInfo BTP destination port info value (if BTP-B) or BTP source port value (if BTP-A) - */ - template(present) SsemInd mw_ssemIndWithBtpParameters( - template (present) SSEM p_ssemMsg, - template UInt16 p_btpDestinationPort := *, - template UInt16 p_btpInfo := * - ) modifies mw_ssemInd := { - btpDestinationPort := p_btpDestinationPort, - btpInfo := p_btpInfo - }; - - /** - * @desc Receive template for SSEM Message (SremSsemPort Primitive) - * @param p_ssemMsg The expected SSEM Message - * @param p_ssp SSP value - * @param p_its_aid ITS-AID value - */ - template (present) SsemInd mw_ssemIndWithSecurityParameters( - template (present) SSEM p_ssemMsg, - template (present) Bit24 p_ssp := ?, - template (present) UInt32 p_its_aid := ? - ) modifies mw_ssemInd := { - ssp := p_ssp, - its_aid := p_its_aid - } - - } - - group utPrimitives { - - /** - * @desc Send template for Upper Tester event initialization - * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use - */ - template (value) UtSremInitialize m_sremSsemInitialize( - in HashedId8 p_hashedId8 := '0000000000000000'O - ) := { - hashedId8 := p_hashedId8 - } - - /** - * @desc Send template for Upper Tester Trigger event - */ - template (value) UtSremTrigger m_utTriggerEvent( - in template (value) BasicVehicleRole p_basicVehicleRole, - in template (value) RequestImportanceLevel p_requestImportanceLevel, - in template (value) IntersectionID p_intersectionId - ) := { - basicVehicleRole := p_basicVehicleRole, - requestImportanceLevel := p_requestImportanceLevel, - intersectionId := p_intersectionId - } - - template (value) UtSremUpdate m_utUpdateEvent( - in template (value) RequestID p_requestID, - in template (value) BasicVehicleRole p_basicVehicleRole, - in template (value) RequestImportanceLevel p_requestImportanceLevel - ) := { - requestID := p_requestID, - basicVehicleRole := p_basicVehicleRole, - requestImportanceLevel := p_requestImportanceLevel - } - - template (value) UtSremCancelation m_UtSremCancelationEvent( - in template (value) RequestID p_requestID - ) := { - requestID := p_requestID - } - - } - - group sremSsemPduTemplates { - - /** - * @desc Send template for SREM PDU - * @param p_map The SREM Message - */ - template (value) SREM m_sremPdu( - in template (value) SignalRequestMessage p_srm - ) := { - header := m_itsPduHeader( - , - ,LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_srem_ ), - srm := p_srm - } - - /** - * @desc Receive template for SREM PDU - * @param p_map The SREM Message - */ - template (present) SREM mw_sremPdu( - template (present) SignalRequestMessage p_srm := ? - ) := { - header := mw_itsPduHeaderSrem, - srm := p_srm - } - - /** - * @desc Send template for SSEM PDU - * @param p_spat The SSEM Message - */ - template (value) SSEM m_ssemPdu( - in template (value) SignalStatusMessage p_ssm - ) := { - header := m_itsPduHeader( - , - , LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_ssem_), - ssm := p_ssm - } - - /** - * @desc Receive template for SSEM PDU - * @param p_spat The SSEM Message - */ - template (present) SSEM mw_ssemPdu( - template (present) SignalStatusMessage p_ssm := ? - ) := { - header := mw_itsPduHeaderSsem, - ssm := p_ssm - } - - } // End of group sremSsemPduTemplates - - group headerTemplates { - - /** - * @desc Default send template for ITS PDU header - * @param p_stationID The source station ID (Default: test system station id) - * @param p_protocolVersion The protocol version (Default: current SREM SSEM protocol version) - * @param p_messageID The message Id (Default: SREM SSEM id) - */ - template (value) ItsPduHeader m_itsPduHeader( - in template (value) StationID p_stationID := f_getTsStationId(), - in template (value) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, - in template (value) ItsPduHeader.messageID p_messageID - ) := { - protocolVersion := p_protocolVersion, - messageID := p_messageID, - stationID := p_stationID - } - - /** - * @desc Default receive template for ITS PDU header - * @param p_stationID The expected station id (Default: any) - * @param p_protocolVersion The expected protocol version (Default: current SREM SSEM protocol version) - * @param p_messageID The expected message id (Default: SREM SSEM message id) - */ - template ItsPduHeader mw_itsPduHeader( - template (present) StationID p_stationID := ?, - template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, - template (present) ItsPduHeader.messageID p_messageID := ? - ) := { - protocolVersion := p_protocolVersion, - messageID := p_messageID, - stationID := p_stationID - } - - /** - * @desc Default receive template for ITS PDU header - * @param p_stationID The expected station id (Default: any) - * @param p_protocolVersion The expected protocol version (Default: current SREM SSEM protocol version) - * @param p_messageID The expected message id (Default: SREM id) - */ - template ItsPduHeader mw_itsPduHeaderSrem( - template (present) StationID p_stationID := ?, - template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, - template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_srem_ - ) := { - protocolVersion := p_protocolVersion, - messageID := p_messageID, - stationID := p_stationID - } - - /** - * @desc Default receive template for ITS PDU header - * @param p_stationID The expected station id (Default: any) - * @param p_protocolVersion The expected protocol version (Default: current SREM SSEM protocol version) - * @param p_messageID The expected message id (Default: SSEM id) - */ - template (present) ItsPduHeader mw_itsPduHeaderSsem( - template (present) StationID p_stationID := ?, - template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, - template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_ssem_ - ) := { - protocolVersion := p_protocolVersion, - messageID := p_messageID, - stationID := p_stationID - } - - /** - * @desc Default receive template for the station id - */ - template (present) StationID mw_anyStationId := ?; - - } // End of group headerTemplates - - group sremSsemTemplates { - - template (omit) IntersectionReferenceID m_intersectionReferenceID( - in template (value) IntersectionID p_intersectionID := 0, - in template (omit) RoadRegulatorID p_roadRegulatorID := omit - ) := { - region := p_roadRegulatorID, // a globally unique regional assignment value typical assigned to a regional DOT authority the value zero shall be used for testing needs - id := p_intersectionID // a unique mapping to the intersection in question within the above region of use - } - - template IntersectionReferenceID mw_intersectionReferenceID( - template (present) IntersectionID p_intersectionID := ?, - template RoadRegulatorID p_roadRegulatorID := * - ) := { - region := p_roadRegulatorID, // a globally unique regional assignment value typical assigned to a regional DOT authority the value zero shall be used for testing needs - id := p_intersectionID // a unique mapping to the intersection in question within the above region of use - } - - group sremTemplates { - - group sremTemplatesSend { - - /** - * @desc Send template for SREM Message - */ - template (value) SignalRequestMessage m_defaultSrem := { - timeStamp := omit, - second := PX_SECOND, - sequenceNumber := PX_SEQUENCE_NUMBER, - requests := { - valueof( - m_signalRequestPackage( - valueof( - m_signalRequest( - m_intersectionReferenceID, - PX_REQUEST_ID, - priorityRequestTypeReserved, - { lane := 1 } - )))) }, - requestor := valueof(m_requestorDescription(m_vehicleID(f_getIutStationId()))), - regional := omit - } - - /** - * @desc Send template for SREM Message - */ - template (omit) SignalRequestMessage m_srem( - in template (value) RequestorDescription p_requestorDescription, - in template (omit) SignalRequestList p_requests := omit - ) modifies m_defaultSrem := { - requests := p_requests, - requestor := p_requestorDescription - } - - template (value) SignalRequestPackage m_signalRequestPackage( - in template (value) SignalRequest p_request - ) := { - request := p_request, - minute := omit, - second := omit, - duration := omit, - regional := omit - } - - template (omit) SignalRequest m_signalRequest( - in template (value) IntersectionReferenceID p_id, - in template (value) RequestID p_requestID, - in template (value) PriorityRequestType p_requestType, - in template (value) IntersectionAccessPoint p_inBoundLane, - in template (omit) IntersectionAccessPoint p_outBoundLane := omit - ) := { - id := p_id, - requestID := p_requestID, - requestType := p_requestType, - inBoundLane := p_inBoundLane, - outBoundLane := p_outBoundLane, - regional := omit - } - - template (omit) RequestorDescription m_requestorDescription( - in template (value) VehicleID p_id, - in template (omit) RequestorType p_type := omit, - in template (omit) RequestorPositionVector p_position := omit, - in template (omit) TransitVehicleStatus p_transitStatus := omit, - in template (omit) TransitVehicleOccupancy p_transitOccupancy := omit - ) := { - id := p_id, // The ID used in the BSM or CAM of the requestor - type_ := p_type, // Information regarding all type and class data about the requesting vehicle - position := p_position, // The location of the requesting vehicle - name := omit, // A human readable name for debugging use - routeName := omit, // A string for transit operations use - transitStatus := p_transitStatus, // current vehicle state (loading, etc.) - transitOccupancy := p_transitOccupancy, // current vehicle occupancy - transitSchedule := omit, // current vehicle schedule adherence - regional := omit - } - - template (value) VehicleID m_vehicleID( - in template (value) StationID p_stationID - ) := { - stationID := p_stationID - } - - template (omit) RequestorType m_requestorType( - in template (value) BasicVehicleRole p_role, - in template (omit) RequestSubRole p_subrole := omit, - in template (omit) RequestImportanceLevel p_request := omit - ) := { - role := p_role, // Basic role of this user at this time - subrole := p_subrole, // A local list with role based items - request := p_request, // A local list with request items - iso3883 := omit, - hpmsType := omit, // HPMS classification types - regional := omit - } - - template (value) RequestorPositionVector m_requestor_position( - in template (value) Position3D p_position - ) := { - position := p_position, - heading := omit, - speed := omit - } // End of template m_requestor_position - - template (value) Position3D m_position3D( - in template (value) Latitude p_latitude, - in template (value) Longitude p_longitude - ) := { - lat := p_latitude, // in 1/10th micro degrees - long := p_longitude, // in 1/10th micro degrees - elevation := omit, // in 10 cm units - regional := omit - } - - } // End of group sremTemplatesSend - - group sremTemplatesRecv { - - /** - * @desc Receive template for SREM Message - */ - template (present) SignalRequestMessage mw_defaultSrem := { - timeStamp := *, - second := ?, - sequenceNumber := *, - requests := *, - requestor := ?, - regional := * - } // End of template mw_defaultSrem - - /** - * @desc Receive template for SREM Message with no LayerType - */ - template (present) SignalRequestMessage mw_sremWellFormatted( - template (present) RequestorDescription p_requestor := ?, - template (present) SignalRequestList p_requests := ?, - template (present) MsgCount p_sequenceNumber := ?, - template (present) DSecond p_second := ?, - template MinuteOfTheYear p_timeStamp := * - ) modifies mw_defaultSrem := { - timeStamp := p_timeStamp, - second := p_second, - sequenceNumber := p_sequenceNumber, - requests := p_requests, - requestor := p_requestor - } // End of template mw_sremWellFormatted - - template (present) SignalRequestPackage mw_signalRequestPackage( - template (present) SignalRequest p_request := ? - ) := { - request := p_request, - minute := *, - second := *, - duration := *, - regional := * - } - - template SignalRequest mw_signalRequest( - template (present) IntersectionReferenceID p_id := ?, - template (present) RequestID p_requestID := ?, - template (present) PriorityRequestType p_requestType := priorityRequest, - template (present) IntersectionAccessPoint p_inBoundLane := ?, - template IntersectionAccessPoint p_outBoundLane := * - ) := { - id := p_id, - requestID := p_requestID, - requestType := p_requestType, - inBoundLane := p_inBoundLane, - outBoundLane := p_outBoundLane, - regional := * - } - - template (present) RequestorDescription mw_requestorDescription( - template (present) VehicleID p_id := ?, - template RequestorType p_type := *, - template RequestorPositionVector p_position := *, - template TransitVehicleStatus p_transitStatus := *, - template TransitVehicleOccupancy p_transitOccupancy := *, - template DeltaTime p_transitSchedule := * - ) := { - id := p_id, // The ID used in the BSM or CAM of the requestor - type_ := p_type, // Information regarding all type and class data about the requesting vehicle - position := p_position, // The location of the requesting vehicle - name := *, // A human readable name for debugging use - routeName := *, // A string for transit operations use - transitStatus := p_transitStatus, // current vehicle state (loading, etc.) - transitOccupancy := p_transitOccupancy, // current vehicle occupancy - transitSchedule := p_transitSchedule, // current vehicle schedule adherence - regional := * - } // End of template mw_requestorDescription - - template (present) RequestorPositionVector mw_requestor_position( - template (present) Position3D p_position := ? - ) := { - position := p_position, - heading := *, - speed := * - } // End of template mw_requestor_position - - template RequestorType mw_requestorType( - template (present) BasicVehicleRole p_role := ?, - template RequestSubRole p_subrole := *, - template RequestImportanceLevel p_request := * - ) := { - role := p_role, // Basic role of this user at this time - subrole := p_subrole, // A local list with role based items - request := p_request, // A local list with request items - iso3883 := *, - hpmsType := *, // HPMS classification types - regional := * - } // End of template mw_requestorType - - } // End of group sremTemplatesRecv - - } // End of group sremTemplates - - group ssemTemplates { - - /** - * @desc Send template for SignalStatusMessage Message - */ - template (value) SignalStatusMessage m_defaultSsem := { - timeStamp := omit, - second := PX_SECOND, - sequenceNumber := omit, - status := { - m_signalStatus( - PX_SEQUENCE_NUMBER, - m_requestorDescription( - m_vehicleID(f_getIutStationId() - )), - m_signalRequest( - m_intersectionReferenceID, - PX_REQUEST_ID, - priorityRequestTypeReserved, - { lane := 1 } - ) - ) - }, - regional := omit - } - - /** - * @desc Send template for SignalStatusMessage Message - */ - template (value) SignalStatusMessage m_ssem( - in SignalRequestMessage p_signalRequestMessage - ) modifies m_defaultSsem := { - second := p_signalRequestMessage.second, - status := { m_signalStatus(p_signalRequestMessage.sequenceNumber, p_signalRequestMessage.requestor, p_signalRequestMessage.requests[0].request) }, - regional := omit - } - - /** - * @desc Receive template for SSEM Message - */ - template (present) SignalStatusMessage mw_ssemWellFormatted( - template (present) MsgCount p_sequenceNumber := ?, - template (present) SignalStatus p_status := ? - ) := { - timeStamp := *, - second := ?, - sequenceNumber := p_sequenceNumber, - status := { p_status }, - regional := * - } - - template (value) SignalStatus m_signalStatus( - in template (value) MsgCount p_sequenceNumber, - in template (value) RequestorDescription p_requestor, - in template (value) SignalRequest p_signalRequest - ) := { - sequenceNumber := p_sequenceNumber, - id := p_signalRequest.id, - sigStatus := { m_signalStatusPackage(m_requester(p_requestor, p_signalRequest.requestID, p_sequenceNumber)) }, - regional := omit - } - - template (present) SignalStatus mw_signalStatus( - template (present) MsgCount p_sequenceNumber := ?, - template (present) IntersectionReferenceID p_id := ?, - template (present) SignalStatusPackage p_sigStatus := ? - ) := { - sequenceNumber := p_sequenceNumber, - id := p_id, - sigStatus := { p_sigStatus }, - regional := * - } - - template (value) SignalRequesterInfo m_requester( - in template (value) RequestorDescription p_requestor, - in template (value) RequestID p_request, - in template (value) MsgCount p_sequenceNumber - ) := { - id := p_requestor.id, - request := p_request, - sequenceNumber := p_sequenceNumber, - role := omit,//p_requestor.type_.role, - typeData := p_requestor.type_ - } - - template SignalRequesterInfo mw_requester( - template (present) VehicleID p_id := ?, - template (present) RequestID p_request := ?, - template (present) MsgCount p_sequenceNumber := ?, - template BasicVehicleRole role := * - ) := { - id := p_id, - request := p_request, - sequenceNumber := p_sequenceNumber, - role := *, - typeData := * - } - - template (value) SignalStatusPackage m_signalStatusPackage( - in template (value) SignalRequesterInfo p_requester - ) := { - requester := p_requester, - inboundOn := { - approach := 0 - }, - outboundOn := omit, - minute := omit, - second := omit, - duration := omit, - status := processing, - regional := omit - } - - template SignalStatusPackage mw_signalStatusPackage( - template (present) SignalRequesterInfo p_requester := ? - ) := { - requester := p_requester, - inboundOn := ?, - outboundOn := *, - minute := *, - second := *, - duration := *, - status := ?, - regional := * - } - - } // End of group ssemTemplates - - } // End of group sremSsemTemplates - -} // End of module LibItsSremSsem_Templates diff --git a/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn b/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn deleted file mode 100644 index 48daa6c1..00000000 --- a/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn +++ /dev/null @@ -1,162 +0,0 @@ -/** - * @author ETSI STF517 / STF581 / TTF002 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/SremSsem/LibItsSremSsem_TestSystem.ttcn $ - * $Id: LibItsSremSsem_TestSystem.ttcn,v 1.2 2018/05/31 15:57:11 dte Exp $ - * @desc Test System module for ITS SREM SSEM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsSremSsem_TestSystem { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_Time all; - import from LibCommon_Sync all; - import from LibCommon_DataStrings all; - - // LibIts - import from ITS_Container language "ASN.1:1997" all; - import from SREM_PDU_Descriptions language "ASN.1:1997" all; - import from SSEM_PDU_Descriptions language "ASN.1:1997" all; - import from EfcDsrcGeneric language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TestSystem all; - import from LibItsCommon_TypesAndValues all; - - // LibItsSremSsem - import from LibItsSremSsem_TypesAndValues all; - - group portDefinitions { - - /** - * @desc Adapter control port - */ - type port AdapterControlPort message { - out - AcSecPrimitive; - in - AdapterControlResults; - } // end AdapterControlPort - - /** - * @desc Upper Tester port - */ - type port UpperTesterPort message { - out - UtSremInitialize, UtSremTrigger, UtSremUpdate, UtSremCancelation; - in - UtSremResults, UtSremEventInd , UtSsemEventInd; - } // end UpperTesterPort - - } // end portDefinitions - - group interfacePorts { - - /** - * @desc Application MapSpat Port - */ - type port SremSsemPort message { in SremInd , SsemInd ; out SremReq , SsemReq } - - } // End of group interfacePorts - - /** - * @desc ITS System Adapter - */ - type component ItsSremSsemSystem { - - port AdapterControlPort acPort; - port UpperTesterPort utPort; - port SremSsemPort sremSsemPort; - - } // End of component ITS System Adapter - - /** - * @desc Test component for ITS SREM-SSEM application layer - */ - type component ItsSremSsem extends ItsBaseComponent { - - port AdapterControlPort acPort; - port UpperTesterPort utPort; - port SremSsemPort sremSsemPort; - //timers - - //component variables - var SremInd vc_mapMsg; - var SsemInd vc_spatMsg; - var UtSremEventIndList vc_utSremEvents := {}; - var UtSsemEventIndList vc_utSsemEvents := {}; - - //default - var default vc_default := null; - - //global variables - var boolean vc_sremReceived := false; - var boolean vc_ssemReceived := false; - - var boolean vc_sremSsemDefaultActive := true; - } // End of component ItsSremSsem - - group ApplPrimitives { - - type record SremInd { - SREM msgIn, - UInt64 recvTime, - UInt8 gnNextHeader optional, - UInt8 gnHeaderType optional, - UInt8 gnHeaderSubtype optional, - UInt32 gnLifetime optional, - UInt8 gnTrafficClass optional, - UInt16 btpDestinationPort optional, - UInt16 btpInfo optional, - Bit24 ssp optional, - UInt32 its_aid optional - } - with { - encode (msgIn) "LibItsSremSsem_asn1" - } - - type record of SremInd SremInds; - - type record SsemInd { - SSEM msgIn, - UInt64 recvTime, - UInt8 gnNextHeader optional, - UInt8 gnHeaderType optional, - UInt8 gnHeaderSubtype optional, - UInt32 gnLifetime optional, - UInt8 gnTrafficClass optional, - UInt16 btpDestinationPort optional, - UInt16 btpInfo optional, - Bit24 ssp optional, - UInt32 its_aid optional - } - with { - encode (msgIn) "PER" - } - - /** - * @desc Appl SREM and SSEM Request Primitive - */ - type record SremReq { - SREM msgOut - } - with { - encode (msgOut) "PER" - } - type record SsemReq { - SSEM msgOut - } - with { - encode (msgOut) "PER" - } - - } with { - variant "" - encode "LibIts_Interface" - } // End of group ApplPrimitives - -} // End of module LibItsSremSsem_TestSystem diff --git a/ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn b/ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn deleted file mode 100644 index 1fd49971..00000000 --- a/ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn +++ /dev/null @@ -1,126 +0,0 @@ -/** - * @author ETSI STF517 / STF581 / TTF002 - * @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/SremSsem/LibItsSremSsem_TypesAndValues.ttcn $ - * $Id: LibItsSremSsem_TypesAndValues.ttcn 1307 2016-12-13 07:51:14Z garciay $ - * @desc Module containing types and values for SREM SSEM - * @copyright ETSI Copyright Notification - * No part may be reproduced except as authorized by written permission. - * The copyright and the foregoing restriction extend to reproduction in all media. - * All rights reserved. - * - */ -module LibItsSremSsem_TypesAndValues { - - // LibCommon - import from LibCommon_BasicTypesAndValues all; - import from LibCommon_DataStrings all; - - // LibIts - import from ITS_Container language "ASN.1:1997" all; - import from SREM_PDU_Descriptions language "ASN.1:1997" all; - import from SSEM_PDU_Descriptions language "ASN.1:1997" all; - import from DSRC language "ASN.1:1997" all; - import from DSRC_REGION_noCircular language "ASN.1:1997" all; - - // LibItsCommon - import from LibItsCommon_TypesAndValues all; - - group utPrimitives { - - /** - * @desc Upper Tester message to initialize IUT - * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use - */ - type record UtSremInitialize { - Oct8 hashedId8 - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester results message of the Srem/Ssem IUT - * @member utSremInitialize - * @member utSremTriggerResult - * @member utSremUpdateResult - * @member utSremCancelationResult - */ - type union UtSremResults { - boolean utSremInitializeResult, - boolean utSremTriggerResult, - boolean utSremUpdateResult, - boolean utSremCancelationResult - } with { - variant "" - } // End of type UtSremResults - - /** - * @desc Upper Tester message to request triggering of an event at IUT - */ - type record UtSremTrigger { - BasicVehicleRole basicVehicleRole, - RequestImportanceLevel requestImportanceLevel, - IntersectionID intersectionId - } with { - variant "FIELDORDER(msb)" - } - - type record of UtSremTrigger UtSremTriggerList; - - /** - * @desc Upper Tester message to request updating of an event at IUT - */ - type record UtSremUpdate { - RequestID requestID, - BasicVehicleRole basicVehicleRole, - RequestImportanceLevel requestImportanceLevel - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to request cancelation of an event at IUT - */ - type record UtSremCancelation { - RequestID requestID - } with { - variant "FIELDORDER(msb)" - } - - /** - * @desc Upper Tester message to check event/status at IUT - */ - type record UtSremEventInd { - SREM sreMsg - } with { - encode (sreMsg) "PER" - } - - /** - * @desc Upper Tester message to check event/status at IUT - */ - type record UtSsemEventInd { - SSEM sseMsg - } with { - encode (sseMsg) "PER" - } - - /** - * @desc List of Upper Tester messages to check event/status on SREM IUT - */ - type record of UtSremEventInd UtSremEventIndList; - - /** - * @desc List of Upper Tester messages to check event/status on SSEM IUT - */ - type record of UtSsemEventInd UtSsemEventIndList; - - type record of RequestID RequestIDList; - - } with { - encode "UpperTester" - variant "" - } - -} with { - encode "LibItsSremSsem" -} // End of module LibItsSremSsem_TypesAndValues diff --git a/ttcn/SremSsem/module.mk b/ttcn/SremSsem/module.mk deleted file mode 100644 index b74c0602..00000000 --- a/ttcn/SremSsem/module.mk +++ /dev/null @@ -1,7 +0,0 @@ -sources := LibItsSremSsem_EncdecDeclarations.ttcn \ - LibItsSremSsem_Functions.ttcn \ - LibItsSremSsem_Pics.ttcn \ - LibItsSremSsem_Pixits.ttcn \ - LibItsSremSsem_Templates.ttcn \ - LibItsSremSsem_TestSystem.ttcn \ - LibItsSremSsem_TypesAndValues.ttcn -- GitLab From ba58b0d70b035751bcff8d13b0483c9eef2c18f1 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Thu, 28 Oct 2021 11:53:45 +0200 Subject: [PATCH 315/320] Merging TTF002 in TTF011 - Phase1: AtsCAM, AtsDENM, AtsGeoNetworking, AtsSecurity, AtsPki --- ttcn/Common/module.mk | 2 ++ ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn | 4 ++-- ttcn/Http/LibItsHttp_BinaryTemplates.ttcn | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ttcn/Common/module.mk b/ttcn/Common/module.mk index 343d2f12..d0b9f48c 100644 --- a/ttcn/Common/module.mk +++ b/ttcn/Common/module.mk @@ -11,4 +11,6 @@ sources := \ ifeq (,$(ITS_CONTAINER)) ITS_CONTAINER := defined sources += ../../asn1/cdd/ITS_Container.asn +else + sources += $(ITS_CONTAINER) # Set in config.mk endif diff --git a/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn b/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn index c7650134..8b2b26d0 100644 --- a/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn +++ b/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn @@ -16,8 +16,8 @@ module LibItsHttp_BinaryMessageBodyTypes { */ // TODO Add here your custom binary import // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; + import from Ieee1609Dot2BaseTypes language "ASN.1:1997" all; + import from Ieee1609Dot2 language "ASN.1:1997" all; import from EtsiTs102941BaseTypes language "ASN.1:1997" all; import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; import from EtsiTs102941MessagesCa language "ASN.1:1997" all; diff --git a/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn b/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn index 45c6df15..d988cfad 100644 --- a/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn +++ b/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn @@ -15,8 +15,8 @@ module LibItsHttp_BinaryTemplates { // TODO Add here your custom binary import // LibIts - import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; - import from IEEE1609dot2 language "ASN.1:1997" all; + import from Ieee1609Dot2BaseTypes language "ASN.1:1997" all; + import from Ieee1609Dot2 language "ASN.1:1997" all; import from EtsiTs102941BaseTypes language "ASN.1:1997" all; import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all; import from EtsiTs102941MessagesCa language "ASN.1:1997" all; -- GitLab From 8cc82f9090a74ea159ee1da9f26c3b94de153f3b Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Thu, 28 Oct 2021 13:31:37 +0200 Subject: [PATCH 316/320] Change path to CDD --- ttcn/Common/module.mk | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ttcn/Common/module.mk b/ttcn/Common/module.mk index d0b9f48c..7f8bb5da 100644 --- a/ttcn/Common/module.mk +++ b/ttcn/Common/module.mk @@ -10,7 +10,5 @@ sources := \ ifeq (,$(ITS_CONTAINER)) ITS_CONTAINER := defined - sources += ../../asn1/cdd/ITS_Container.asn -else - sources += $(ITS_CONTAINER) # Set in config.mk + sources += ../../../AtsDENM/lib/asn1/cdd/ITS_Container.asn #../../asn1/cdd/ITS_Container.asn endif -- GitLab From bf548622aec06cafeb5615f4750d5ef980a118bf Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Wed, 16 Mar 2022 16:53:00 +0100 Subject: [PATCH 317/320] Validate ITS-S enrolment/authorization --- ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn | 1 + ttcn/Http/LibItsHttp_BinaryTemplates.ttcn | 12 ++++++++++++ ttcn/Http/LibItsHttp_Templates.ttcn | 7 +++++++ 3 files changed, 20 insertions(+) diff --git a/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn b/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn index 8b2b26d0..fc2f78be 100644 --- a/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn +++ b/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn @@ -26,6 +26,7 @@ module LibItsHttp_BinaryMessageBodyTypes { type union BinaryBody { // TODO Add here your custom variants Ieee1609Dot2Data ieee1609dot2_data, + Certificate ieee1609dot2_certificate, octetstring raw } with { variant "" diff --git a/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn b/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn index d988cfad..a50f50b8 100644 --- a/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn +++ b/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn @@ -47,4 +47,16 @@ module LibItsHttp_BinaryTemplates { ieee1609dot2_data := p_ieee1609dot2_data } // End of template mw_binary_body_ieee1609dot2_data + template (value) BinaryBody m_binary_body_ieee1609dot2_certificate( + in template (value) CertificateBase p_ieee1609dot2_certificate + ) := { + ieee1609dot2_certificate := p_ieee1609dot2_certificate + } // End of template m_binary_body_ieee1609dot2_certificate + + template (present) BinaryBody mw_binary_body_ieee1609dot2_certificate( + template (present) CertificateBase p_ieee1609dot2_certificate := ? + ) := { + ieee1609dot2_certificate := p_ieee1609dot2_certificate + } // End of template mw_binary_body_ieee1609dot2_certificate + } // End of module LibItsHttp_BinaryTemplates diff --git a/ttcn/Http/LibItsHttp_Templates.ttcn b/ttcn/Http/LibItsHttp_Templates.ttcn index a8c27d76..cfd589dd 100644 --- a/ttcn/Http/LibItsHttp_Templates.ttcn +++ b/ttcn/Http/LibItsHttp_Templates.ttcn @@ -257,6 +257,13 @@ module LibItsHttp_Templates { body := omit } // End of template m_http_response_ko_no_body + template (value) Response m_http_response_500_internal_error( + in template (value) Headers p_header, + in template (value) integer p_statuscode := 500, + in template (value) charstring p_statustext := "Internal Error" + ) modifies m_http_response_ko_no_body := { + } // End of template m_http_response_ko + template (present) Response mw_http_response_ko_no_body( template (present) Headers p_header := ?, template (present) integer p_statuscode := 404, -- GitLab From 5e2726ae7230c722263dc1d875db10893f6a073e Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Thu, 31 Mar 2022 15:19:09 +0200 Subject: [PATCH 318/320] CV2X#3 Validation against PKIs --- ttcn/Http/LibItsHttp_Functions.ttcn | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/ttcn/Http/LibItsHttp_Functions.ttcn b/ttcn/Http/LibItsHttp_Functions.ttcn index c1abcf32..dbe069db 100644 --- a/ttcn/Http/LibItsHttp_Functions.ttcn +++ b/ttcn/Http/LibItsHttp_Functions.ttcn @@ -145,6 +145,32 @@ module LibItsHttp_Functions { } // End of 'for' statement } // End of function f_get_header + /** + * @desc Check HTTP response headers + * @param p_headers The HTTP headers + * @param p_value the expected va;ue + * @return true on success, false otherwise + */ + function f_check_headers( + in Headers p_headers, + in charstring p_header_name := "Location", + in template (present) charstring p_value := ? + ) return boolean { + // Local variables + var boolean v_header_matched := false; + + for (var integer v_idx := 0; v_idx < lengthof(p_headers); v_idx := v_idx + 1) { + if (p_headers[v_idx].header_name == p_header_name) { + if (match(p_headers[v_idx].header_value[0], p_value) == true) { + v_header_matched := true; + } // else, nothing to do + break; + } + } // End of 'for' statement + + return v_header_matched; + } // End of function f_check_headers + } // End of group http_headers } // End of module LibItsHttp_Functions -- GitLab From 735e79877b87097c2476bdcf4a71bf48fafdc737 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Fri, 22 Apr 2022 16:04:32 +0200 Subject: [PATCH 319/320] CV2X#3 Validation against PKIs (Remote) --- ttcn/Common/LibItsCommon_TypesAndValues.ttcn | 1 + 1 file changed, 1 insertion(+) diff --git a/ttcn/Common/LibItsCommon_TypesAndValues.ttcn b/ttcn/Common/LibItsCommon_TypesAndValues.ttcn index 4bf65e49..2057961a 100644 --- a/ttcn/Common/LibItsCommon_TypesAndValues.ttcn +++ b/ttcn/Common/LibItsCommon_TypesAndValues.ttcn @@ -204,6 +204,7 @@ module LibItsCommon_TypesAndValues { const integer c_its_aid_TLS := 140; const integer c_its_aid_GN := 141; const integer c_its_aid_SCR := 623; // Secured Certificate Request, https://standards.ieee.org/products-services/regauth/psid/public.html + const integer c_its_aid_CPOC := 624; // ETSI TS 102 941 Clause 6.4 Generation and distribution of TLM / RCA Link Certificates } } with { -- GitLab From d4311521a528842673b0b0c0404cfe38649f16ed Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Wed, 27 Apr 2022 16:28:24 +0200 Subject: [PATCH 320/320] CV2X#3 Validation against PKIs (Remote) --- ttcn/Common/LibItsCommon_Functions.ttcn | 2 +- ttcn/Common/LibItsCommon_TypesAndValues.ttcn | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ttcn/Common/LibItsCommon_Functions.ttcn b/ttcn/Common/LibItsCommon_Functions.ttcn index 9df9cb57..7424c484 100644 --- a/ttcn/Common/LibItsCommon_Functions.ttcn +++ b/ttcn/Common/LibItsCommon_Functions.ttcn @@ -119,7 +119,7 @@ module LibItsCommon_Functions { /** * @desc Gets the current time since 01/01/1970 in UTC format - * @return The current time since 01/01/1970 in UTC format + * @return The current time since 01/01/1970 in UTC format in milliseconds */ function f_getCurrentTimeUtc() return UInt64 { var UInt64 v_time := 0; diff --git a/ttcn/Common/LibItsCommon_TypesAndValues.ttcn b/ttcn/Common/LibItsCommon_TypesAndValues.ttcn index 2057961a..33179129 100644 --- a/ttcn/Common/LibItsCommon_TypesAndValues.ttcn +++ b/ttcn/Common/LibItsCommon_TypesAndValues.ttcn @@ -203,6 +203,7 @@ module LibItsCommon_TypesAndValues { const integer c_its_aid_TLC := 140; const integer c_its_aid_TLS := 140; const integer c_its_aid_GN := 141; + const integer c_its_aid_CRL := 622; // ETSI TS 102 941 Clause 6.4 Generation and distribution of TLM / RCA Link Certificates const integer c_its_aid_SCR := 623; // Secured Certificate Request, https://standards.ieee.org/products-services/regauth/psid/public.html const integer c_its_aid_CPOC := 624; // ETSI TS 102 941 Clause 6.4 Generation and distribution of TLM / RCA Link Certificates } -- GitLab